This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author zeero
Recipients martin.panter, zeero
Date 2015-08-14.11:00:05
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1439550005.67.0.905025120124.issue24859@psf.upfronthosting.co.za>
In-reply-to
Content
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.
History
Date User Action Args
2015-08-14 11:00:05zeerosetrecipients: + zeero, martin.panter
2015-08-14 11:00:05zeerosetmessageid: <1439550005.67.0.905025120124.issue24859@psf.upfronthosting.co.za>
2015-08-14 11:00:05zeerolinkissue24859 messages
2015-08-14 11:00:05zeerocreate