OpenXbox / smartglass-documentation

Documentation of the Xbox One SmartGlass protocol
https://openxbox.github.io/smartglass-documentation
35 stars 9 forks source link

Corrected 'Header Flags' Parsing #5

Closed industriousonesoft closed 4 years ago

industriousonesoft commented 4 years ago

Hi, Thank you for building such a brilliant project. It helps me a lot. When i was reading your codes and documents, i found there may be a mistake about parsing "Header Flags" in "Message Header".

tuxuser commented 4 years ago

hey, thanks for your PR, the bitmasking was written with a little endian uint16 in mind. You are describing bitmasking of the original, big endian value - that seems more appropriate.

From my calculation it should look like this tho: Flag Bits Mask
Version 1100 0000 0000 0000 0xC000
Need Acknowledgement 0010 0000 0000 0000 0x2000
Is Fragment 0001 0000 0000 0000 0x1000
Message Type 0000 1111 1111 1111 0x0FFF

Can you confirm?

industriousonesoft commented 4 years ago

Yes, you are right! I got it, thanks!☕️