Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SerialTransfer should support packets with 0 data bytes #88

Open
PaulBouchier opened this issue Mar 5, 2022 · 0 comments
Open

SerialTransfer should support packets with 0 data bytes #88

PaulBouchier opened this issue Mar 5, 2022 · 0 comments

Comments

@PaulBouchier
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant