这两个函数看起来很相像,用的时候也很相似。很容易弄混淆,仔细看一下文档就知道其中的区别了。

osal_start_timer( )

This function is called to start a timer. When the timer expires, the given event bit will be set. The event will be set in the task from which the osal_start_timer function is called. To explicitly specify the task id, use the osal_start_timerEx() function instead of osal_start_timer().

 

osal_start_timerEx( ) This is very similar to osal_start_timer(), with the added parameter of taskID. This allows the caller to set the timer for another task. When in doubt, use this function over osal_start_timer().

由此可以看出前者是设置本事件的定时器的时间,而后者是设置下一个从另一个任务的时间。这个任务是协议栈下一次调用的任务。

相关的详细文档可以看z-stack的文档。

以上纯属个人理解,有错误之处请批评指正。

posted on 2016-02-21 12:05  farbeyond  阅读(1453)  评论(0编辑  收藏  举报