void on_rx_packet(mwx::packet_rx& pkt, bool_t &b_handled)
When a wireless packet is received, this function is called from within the MWX library with the data stored in pkt
as packet_rx
. If this function is not defined in the application, a weak function that does nothing will be linked.
If true is set to b_handled
within this function, it notifies the MWX library that the received packet has been processed within the application. When marked as processed, unnecessary processing is suppressed (the processing of the_twelite.receiver
is not performed).
the_twelite.receiver
is not recommended.
Previously, processing using the_twelite.receiver
was intended to be written inside loop()
, but due to the queuing delay processing, packet loss can occur in principle, and the code tends to become complicated. Therefore, on_rx_packet()
was added.