shmuelzon / ble2mqtt

A BLE to MQTT bridge
MIT License
60 stars 6 forks source link

characteristic type #6

Closed Yury777 closed 5 years ago

Yury777 commented 5 years ago

Hello! How convert this characteristics to string? Name | UUID | Type | Data | Description Pressure characteristic | 0202 | Notify | 5 bytes | Pressure in hPa: int32_t - integer, uint8_t - decimal

Now I receive in mqtt: 216,3,0,0,90. How convert to 1092 hPa? I try: "ef680202-9b35-4933-9b10-52ffa9740042": { "name": "Pressure", "types": ["uint32"], "types": ["uint8"] },

shmuelzon commented 5 years ago

Try this:

{
  "ble": {
    "characteristics": {
      "ef680202-9b35-4933-9b10-52ffa9740042": {
        "name": "Pressure",
        "types": [
          "uint32",
          "uint8"
        ] 
      }
    }
  }
}
Yury777 commented 5 years ago

It's WORKING!!! Tell me please, how I can convert this data? Device name characteristic | 0101 | Write/Read | max 10 bytes | Device name as ASCII string.

shmuelzon commented 5 years ago

Try this:

{
  "ble": {
    "characteristics": {
      "ef680101-9b35-4933-9b10-52ffa9740042": {
        "name": "Device Name",
        "types": [
          "utf8s"
        ] 
      }
    }
  }
}
Yury777 commented 5 years ago

Thank you!!!