Skip to content

Conversation

@andersjohnsen
Copy link

No description provided.

@andersjohnsen andersjohnsen requested a review from lask June 7, 2021 12:41
Copy link
Contributor

@lask lask left a comment

Choose a reason for hiding this comment

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

Add a couple of words to CHANGELOG.md and ship.

Comment on lines +111 to +119
if (reader.byte 0) != 0xb5 or (reader.byte 1) != 0x62: throw INVALID_UBX_HEADER_

// Verify the length and get full the packet.
length ::= (reader.byte 4) | (((reader.byte 5) & 0xff) << 8)
if not 0 <= length <= 512: throw INVALID_UBX_MESSAGE_
if not 0 <= length <= 512: throw INVALID_UBX_SIZE_
frame ::= reader.bytes length + 8

// Verify the checksum.
if not is_valid_frame_ frame: throw INVALID_UBX_MESSAGE_
if not is_valid_frame_ frame: throw INVALID_UBX_CHECKSUM_
Copy link
Contributor

Choose a reason for hiding this comment

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

If this doesn't help, we are going to need more information to figure out what bytes we see. Do we want to add this already?

static is_valid_frame_ frame/ByteArray -> bool:
// Check the sync bytes.
if frame[0] != 0xb5 or frame[1] != 0x62: throw INVALID_UBX_MESSAGE_
if frame[0] != 0xb5 or frame[1] != 0x62: return false
Copy link
Contributor

Choose a reason for hiding this comment

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

This should probably behave like Message.from_reader, so Message.from_byte act the same.

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.

2 participants