Skip to content

Packing data across byte boundaries #43

@FirebarSim

Description

@FirebarSim

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions