The responsibility of router is to schedule sending times
of each associated device and wait for other devices to join.
The router chooses a PAN Coordinator to join according to
the number of associated routers and the distance between
the PAN Coordinator and the router. Router also schedule
sending time for each associated device according its
neighbor table and adjusting its idle time according to the
signal type and attributes of the associated end device. The
software flow of the router is shown in Fig. 4.
The ISR task is waked when the ISR occurs, which is
used to process received packets and parse the RX frame if
the interrupt is an RX event. The ISR task shows the
processing status of packet transmission if the interrupt is a
TX event. If the received packet is a data frame, the router
sends data to the associated PAN Coordinator wirelessly