14.2.2.2 Task handlers

The user's applications and the Zigbee stack operate as two tasks in a RTOS environment. Allocation of the execution time is controlled by the Free RTOS scheduler, based on the priorities given for Zigbee stack and application tasks. The "zigbee_task" is the stack task. There is an internal mechanism implemented by the stack to schedule the layer specific tasks among stack layers. The task scheduler manages the order in which tasks raised by different stack components are executed. The order is based on the priority of layers. Tasks posted by a certain layer are processed with a call to the corresponding task handler which is a function specific for each layer.

The application task handler is defined as _APP_Tasks() and should be implemented by the application. When _APP_Tasks() is executed, various requests to the stack and indications from the stack, events from uart etc., are handled.