-
Notifications
You must be signed in to change notification settings - Fork 13.5k
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
review PX4 Mavlink module write helper (send_bytes) #10389
Comments
I need to cross check. It certainly was whole packet size earlier and got broken in the process if it really is broken. |
I think the messages are splitted. I noticed it when I was writing the IridiumSBD driver. There I am checking if the whole package fits in the buffer and reset that one if it doesn't. If we are rewriting how packages are sent it would be great if we can get some feedback if the bytes were sent successfully. Currently if one is using |
https://github.com/mavlink/c_library_v2/blob/master/mavlink_helpers.h#L349 It can be fixed in the mavlink library, but I'd also like to preserve the data and skip the unnecessary work px4 mavlink module side. |
PR for testing #10394 |
@dagar should we test this? |
@julianoes yes, there are a number of small mavlink issues like this we should discuss. |
This issue has been automatically marked as stale because it has not had recent activity. Thank you for your contributions. |
Each mavlink packet is broken up into several writes (header, payload, optional signature). The PX4 mavlink module write helper (send_bytes) checks the remaining buffer on each of these writes and aborts with a logged tx error if there isn't sufficient space.
https://github.com/PX4/Firmware/blob/master/src/modules/mavlink/mavlink_main.cpp#L942-L994
The result is a garbage partially written mavlink packet and potentially lost data.
I propose we do this check per mavlink message send initially.
The text was updated successfully, but these errors were encountered: