split field

48 views
Skip to first unread message

Chris Chow

unread,
Aug 11, 2014, 1:36:26 PM8/11/14
to const...@googlegroups.com
I have a protocol that defines a couple fields that are divided up across the message. For example, there are a couple unsigned ints where the 8 MS bits are stored 3 bytes after their LS bits. What's the best way to handle cases like this? I feel like it's a case of mapping a single value to a BitField and a pointer to a BitField, but I'm not sure how to do that.

Steven Michalske

unread,
Aug 14, 2014, 6:22:36 PM8/14/14
to const...@googlegroups.com
I am in the middle of this problem now as well.

I am coding a construct for an EDID.

The closest solution I have come up with is to take the entire odd ball structure into an adapter and manipulate it there.
This is unfortunately not too clean.  I don't know how to encode the data where two pointers are writing to the same byte.

It also gets really messy for the extended display timing descriptor.

Is there a better way to cope with these mixed up descriptors?

Steve

Arek Bulski

unread,
Sep 26, 2016, 11:15:51 AM9/26/16
to Construct
Computed can be used to combine other fields. Please provide a clear example of what you would like to see and submit a feature request on Github.
Reply all
Reply to author
Forward
0 new messages