-
-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bit Order in <bitfield>
and <set>
#17
Comments
Hi @bearbattle, When you specify members of the
The bit ordering of the In other words, if your The endian specifies the order of written bytes, not bits, i.e the two bytes above can be written in only 2 ways:
That's all. If you need to serialize it in different way, then you need to re-order your Hope it helps. |
Thank you. Will the library provide any methods to alter the bit order (i.e. from MSB to LSB)? |
Hi @bearbattle, <set name="Flags" ...>
<bit name="F" idx="7" />
<bit name="K" idx="6" />
<bit name="P" idx="5" />
<bit name="C" idx="4" />
</set> Note that the order of the |
Thanks for your reply! I'm closing the issue. |
I've defined a
<bitfield>
in the XML.As I set flag
F
totrue
, this is what I get in Wireshark:With
endian="big"
, this is what I get:Another thing is when I try to modify the value of
UnitNum
field, I actually change the value ofPXNum
field.With
msg.field_annFlags().field_unitNum().value() = 1
:How to alter the bit order of generated packet data?
The text was updated successfully, but these errors were encountered: