PhilipsHue / flutter_reactive_ble

Flutter library that handles BLE operations for multiple devices.
https://developers.meethue.com/
Other
665 stars 331 forks source link

Why manufacturer data's first two byte is always in reverse order? #302

Closed keval-devani closed 3 years ago

keval-devani commented 3 years ago

Describe the bug When scanning BLE device only first two bytes in manufacturerData order is reverse.

To Reproduce Steps to reproduce the behavior:

  1. set manufacturer Data in nrf connect for mobile
    • Company Identifier : 0059
    • Data : 5403202121.....
  2. When Scanning in result device.manufacturerData give me data like this [89, 0, 84, 3, 32, 33, 33] that means 59 00

Expected behavior it should not reverse first two bytes in manufacturerData.

Smartphone / tablet

Peripheral device

Additional context

jobfeikens commented 3 years ago

Hi, its not in reverse.

From v4.2 of the spec:

2.4 Profile Fundamentals

    ...

    • Multi-octet fields within the GATT Profile shall be sent least significant octet first (little endian).
werediver commented 3 years ago

Thank you for looking into this, @jobfeikens.

I suppose, the above answer resolves the original issue.

keval-devani commented 3 years ago

But, what about v5? Is there is way to differentiate that it is coming from v5 or v4.2?

werediver commented 3 years ago

The same is true for BLE v5.0, see the Core spec p. 2225.

No, there is no (direct) way of determining the version of the BLE that your device supports.