| Algorithm 2: Time interval assignment and operation algorithm for the coordinator. |
| Data: Time intervals TI for priorities are configured. |
| Input: Received message from the device D. |
| Output: Assigned time interval TI(P) for the device D. |
| 1 ZigBee communication initiation of device D |
| 2 if D not assigned with time interval then |
| 3 send Offer message with available priorities to D at the time T |
| 4 wait for Selection message from D with priority P |
| 5 assign D with time interval TI(P) based on the time T |
| 6 repeat |
| 7 wait for data from D in time interval TI(P) |
| 8 send Acknowledgement to D |
| 9 until D communicates out of time interval TI(P) |