Skip to content

Commit

Permalink
lib: Fix serialization of mavlink v2
Browse files Browse the repository at this point in the history
Only 3 bytes are used by message id

Signed-off-by: Patrick José Pereira <[email protected]>
  • Loading branch information
patrickelectric committed Nov 20, 2023
1 parent 37155f0 commit f39cd28
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ impl<M: Message> MavFrame<M> {
match self.protocol_version {
MavlinkVersion::V2 => {
let bytes: [u8; 4] = self.msg.message_id().to_le_bytes();
buf.put_slice(&bytes);
buf.put_slice(&bytes[..3]);
}
MavlinkVersion::V1 => {
buf.put_u8(self.msg.message_id() as u8); //TODO check
Expand Down

0 comments on commit f39cd28

Please sign in to comment.