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

Packing data across byte boundaries #43

Open
FirebarSim opened this issue Oct 14, 2024 · 0 comments
Open

Packing data across byte boundaries #43

FirebarSim opened this issue Oct 14, 2024 · 0 comments

Comments

@FirebarSim
Copy link

Hi, thanks for an awesome tool. I have been using it really happily with a lot of data that is mostly multiples of 8 bits or sets of bools and enums. However I have hit a new challenge with a specific message type to encode. It packs like the below and I have struggled to work out if there is a corresponding format string.

a = message_id: 6 bit uint
b = repeat_count: 2 bit uint
c = sender: 30 bit uint
d = status: 4 bit uint
e ... etc

it continues on with other values, including a 27 and a 28 bit signed integer. The packed fields should come out like this:

b1 b0 a6 a a a a a0 | c7 c c c c c c c0 | c14 c c c c c c c8 | c23 c c c c c c c9 | d1 d0 c29 c c c c c24 |  e5 e e e e e0 d3 d2 | ...

Figured it was a worth a shot asking what to try next

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

1 participant