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

How to get length of parsed packet? #78

Open
blowback opened this issue May 11, 2024 · 1 comment
Open

How to get length of parsed packet? #78

blowback opened this issue May 11, 2024 · 1 comment

Comments

@blowback
Copy link

Given a PacketRef obtained from a parser iterator, how do you get the packet's original encoded length? There's a class_and_msg_id() method on PacketRef, but I don't see anything similar for length (bytes at offsets 4 and 5).

@gwbres
Copy link
Collaborator

gwbres commented May 11, 2024

@blowback,

We have no means to expose such information in the current state, when dealing with complex packets whose size may vary.
With simplistic packets, you have UbxPacketMeta::FIXED_PAYLOAD_LEN.
To answer that requirement, pack_len here should be saved in the packet being constructed

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

No branches or pull requests

2 participants