zeero added the comment: Sorry for the inconvenience.
The format specification can be found in chapter 2.1 in http://vector.com/portal/medien/cmc/application_notes/AN-ION-1-3100_Introduction_to_J1939.pdf So I would write down the field contents in that order _fields_ = [('reserved',c_uint8,3), ('priority',c_uint8,3), ('extended_data_page',c_uint8,1), ('data_page',c_uint8,1) ... ] I expect the first Byte to be 0x1C when I set priority to 7 but it came out as 0x38, after tunneling it through the Union object. Reversing the order of the bit fields makes it work like expected. ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue24859> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com