Skip to content

Conversation

@notoriaga
Copy link
Contributor

No description provided.

let mut name = msg.name.to_string();
if name.is_empty() {
name = NO_NAME.to_string();
let name = if msg.name.as_bytes().iter().all(|b| b == &0) {
Copy link
Collaborator

@john-michaelburke john-michaelburke Oct 1, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Interesting so a "no name" string that comes in would still have null characters? I guess you are just checking for the one null char that would indicate an empty string.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think (@silverjam could probably confirm) that because the string is fixed length it will always be 20 chars so whatever space you don't use will be a null byte. So the "empty" string in this case is 20 nulls

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, that is correct from what I remember

PackedObsContentDepC, PackedOsrContent,
},
SBP,
piksi::{Latency, MsgSpecan, MsgSpecanDep, MsgUartState, MsgUartStateDepa, Period},
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure how big of a change it would be but since you are working on sbp message naming I will point out this MsgUartStateDepa seems to break the more common scheme.

@notoriaga notoriaga merged commit cfe9bee into main Oct 2, 2021
@notoriaga notoriaga deleted the steve/update-sbp branch October 2, 2021 00:54
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