This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Task scheduling by time on Z-stack

Other Parts Discussed in Thread: CC2538, Z-STACK

Is there any mechanism to be able to define a task on Z-stack (CC2538) that would be processed  at a specific time of a day? As an example, at 10:30, set GPIO PC2 = 1;  at 13:47, set GPIO PC2 = 0? I use OSAL_CLOCK to store and update the time information, the task is not time critical and can have couple seconds tolerance. 

If there is no such mechanism on the Z-Stack (or related APIs), has anyone done something similar to suggest me what could be an efficient way to define an interrupt to perform the task?

  • As I know, there is no related API in Z-Stack for this. In my application, I run similar function from my host application and send command from coordinator to device to control ON/OFF of a GPO.
  • If the task is not time critical, and can have a couple of seconds of tolerance, maybe the OSAL timer and clock API be used for your application.
    OSAL system clock ticks every 1 millisecond.
    With OSAL clock API like osal_getClock() you can get the current time of the system, then use OSAL timer API to schedule the next event, computing the offset in millisecond wrt to the current time (e.g osal_start_timerEx()).
    This way, you can schedule an event to occur at a 'specified' time.

    Thanks,
    TheDarkSide
  • Maybe you can run RTC on CC2538. Then use osal_start_timerEX to start a scheduled event to serve your purpose.