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

Removed redundant strip of trailing zeros for 2.0 messages. #276

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

beforezod
Copy link

@beforezod beforezod commented Feb 26, 2019

Given the four helper functions: ..pack, ..to_send_buffer, ..parse_char, ..decode
both ...pack and ...to_send_buffer call the _mav_trim_payload function to trim the trailing zeros. Only the ..to_send_buffer call should do this. Otherwise you cannot pack a message, use the getter functions, and expect the same data back.

We ran into this problem because all our unit tests were attempting exactly this and began to fail when we switched to the v2.0 standard.

@hamishwillee
Copy link
Contributor

Slightly related to #241 (ie in that both are related to zero trimming)

@hamishwillee
Copy link
Contributor

This is failing with some parse errors

@amilcarlucas
Copy link
Contributor

amilcarlucas commented Feb 26, 2019

Can you please rebase this ? Or even better, cherry pick
01d6a75 on top of master

@amilcarlucas amilcarlucas requested a review from tridge February 26, 2019 12:12
@beforezod
Copy link
Author

beforezod commented Feb 26, 2019 via email

…andled later in the ..to_send_buffer function.
@beforezod
Copy link
Author

This fail is interesting. It passes with my message set locally.

@beforezod
Copy link
Author

GOPRO_HEARTBEAT { status: 5 capture_mode: 72 flags: 139 }
GOPRO_HEARTBEAT { status: 5 capture_mode: 72 flags: 139 }
GOPRO_GET_REQUEST { target_system: 5 target_component: 72 cmd_id: 139 }
GOPRO_GET_REQUEST { target_system: 5 target_component: 72 cmd_id: 139 }
GOPRO_GET_RESPONSE { cmd_id: 5 status: 72 value: [ 139, 140, 141, 142, ] }
GOPRO_GET_RESPONSE { cmd_id: 5 status: 72 value: [ 139, 140, 141, 142, ] }
GOPRO_SET_REQUEST { target_system: 5 target_component: 72 cmd_id: 139 value: [ 206, 207, 208, 209, ] }
GOPRO_SET_REQUEST { target_system: 5 target_component: 72 cmd_id: 139 value: [ 206, 207, 208, 209, ] }
GOPRO_SET_RESPONSE { cmd_id: 5 status: 72 }
GOPRO_SET_RESPONSE { cmd_id: 5 status: 72 }
RPM { rpm1: 17.000000 rpm2: 45.000000 }
RPM { rpm1: 17.000000 rpm2: 45.000000 }
Received 604 messages on channel 0 OK
Received 604 messages on channel 1 OK
No errors detected

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

Successfully merging this pull request may close these issues.

3 participants