Add your own events and tasks to the ZIGBEE stack

https://www.cnblogs.com/xxg1992/p/6591219.html

Add your own events and tasks to the ZIGBEE stack

1. Add events:

1. Adding an event is different from adding a task. It belongs to a certain task, but is only an event in this task, that is, one more bit in the event mask, and multiple branches (if branch or case branch) in the event processing function.

 

 

 

 

 

2. Add tasks:

1. All tasks are added in the osalInitTasks() function of the current project. At the beginning, taskID=0. After each task is added, it will be in the form of "SampleApp_Init( taskID++ ); ", that is, the taskID will be incremented by one after the addition. .

 

 

 

 

2. Add the corresponding event processing callback function:

 

 3. Implement the above two functions:

 

 

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325772085&siteId=291194637