Bluetooth-Devices / bthome-ble

Parser for BTHome BLE devices
https://bthome.io/
MIT License
67 stars 12 forks source link

bthome_v2_encryption.py #37

Closed pvvx closed 1 year ago

pvvx commented 1 year ago

data[: data[0] + 1] - What is the purpose of this command? https://github.com/Bluetooth-Devices/bthome-ble/blob/main/src/bthome_ble/bthome_v2_encryption.py#L48

if adslength > 15 and data[0] == 0xD2 and data[1] == 0xFC:
        pkt = data[: data[0] + 1] # data[0]  = 0xD2 !
        uuid = pkt[0:2]
        ...
Ernst79 commented 1 year ago

Hmm, that should be there. I think this is a leftover from the move from BLE monitor to here, where we had the length byte at [0]. I think we can just replace pkt with data and remove line 48. Will fix that a.s.a.p.