timer in contiki cooja

289 views Asked by At

I want to settle a timer and check it if it's expired in the next invocation of the function coap_send_transaction(). How can I do that?


    PROCESS_THREAD(example_process, ev, data){

       static struct etimer et;

       PROCESS_BEGIN();

       while (1) {
         etimer_set(&et, CLOCK_SECOND); /* Set the timer to 1 second. */
         PROCESS_WAIT_EVENT_UNTIL(etimer_expired(&et));
         printf("the timer is expired!\n");
       }

       PROCESS_END();
    }

    void coap_send_transaction(coap_transaction_t *t) { 
      
       process_start(&example_process, NULL);
       if etimer_expired(&et) { 
         // do something 
         // how can I do this?
       }
    }
0

There are 0 answers