contiki cooja 中的计时器

问题描述

我想设置一个计时器,并在下次调用函数 coap_send_transaction() 时检查它是否已过期。我该怎么做?


    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?
       }
    }

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)