-
Notifications
You must be signed in to change notification settings - Fork 73
Description
Is your feature request related to a problem? Please describe.
There are use cases where the arrival of a packet of a certain type in and of itself indicates what should happen. E.g. reboot, or ping (reply with pong).
Describe the solution you'd like
A packet received with 0 length payload data should be processed and cause the appropriate callback to be taken / message to be made available. The problem starts in line 167 of packet.cpp:
if ((recChar > 0) && (recChar <= MAX_PACKET_SIZE))
If recChar (the payload length) is 0, it goes back to find_start_byte state and declares a PAYLOAD_ERROR. IMHO the check for recChar > 0 shouldn't be there, or maybe if recChar is 0 it should jump straight to find_crc state
Describe alternatives you've considered
The workaround I'm currently using is to send a dummy int in the reboot and ping messages
Additional context
Add any other context or screenshots about the feature request here.