0

There are 3 fields in a 4bytes of a packet of length 8, 12 and 12 bits. Each field should be encoded in little endian format. How do I reliably encode fields which are shorter than a word? Is reversing the bit the only option?

-- Thanks.

badcompany
  • 1,263
  • 2
  • 9
  • 9
  • maybe useful? [How Endianness Effects Bitfield Packing](http://mjfrazer.org/mjfrazer/bitfields/) Also, [C/C++: Force Bit Field Order and Alignment](http://stackoverflow.com/questions/1490092/c-c-force-bit-field-order-and-alignment) – Ryan Vincent Jun 13 '15 at 09:36
  • Thanks. First link is promising. – badcompany Jun 13 '15 at 10:07

0 Answers0