Search code examples
bluetooth-lowenergyadsiot

BLE Advertising RawData - How to decode?


I have a E66 Fitness band connected to a gateway and the band does connect to the gateway and I receive data on MQTT. But I am unsure on how to decode the RawData format, can someone help me with that? Thanks

{
      "TimeStamp":"2020-05-30 16:44:32",
      "DataFormat":"RawData",
      "BLEMac(hex)":"E5F604C2EAAE",
      "RSSI(dBm)":-30,
      "BLEName":"E67 EAAE",
      "RawData(hex)":"02010610FF107803E8000000000000640023290009094536372045414145"
  }


Solution

  • BLE data is decoded as follows:-

    • 1st byte = length (n bytes)
    • 2nd byte = Types
    • n-1 bytes = actual data

    And this repeats over the whole raw data. You can find the meaning of raw data here. Going over your example:-

    1st Set:

    • 02: Length: 2 Bytes
    • 01: Type: Flags
    • 06: Flag - 02 && 04: LE General Discoverable && BR/EDR Not Supported

    2nd Set:

    • 10: Length: 16 bytes
    • FF: Type: Manufacture Data
    • 107803E80000000000006400232900: Data specific to the manufacturer

    3rd Set:

    • 09: Length: 9 bytes
    • 09: Type: Complete Local Name
    • 4536372045414145: E67 EAAE (Name of device in ASCII)

    I hope this helps.