I am getting below errors while parsing BLE packet. Any suggestion how to fix this?
Packet
b'x04>+x02x01x03x01xd7xd3Axc9xaexf5x1fx02x01x06x03x03xaaxfex17x16xaaxfex00xd8x8bx9cxc7<:xe7Gxefexbcx00x00x00x00x15xd1x00x00xaf'
Traceback (most recent call last):
File "BluetoothWiliot.py", line 95, in <module>
dataString = parse_events(sock, 100)
File "BluetoothWiliot.py", line 47, in parse_events
print(struct.unpack("B", bytes(pkt[3])))
**struct.error: unpack requires a buffer of 1 bytes**
Traceback (most recent call last):
File "BluetoothWiliot.py", line 95, in <module>
dataString = parse_events(sock, 100)
File "BluetoothWiliot.py", line 47, in parse_events
print(struct.unpack("B", pkt[3]))
**TypeError: a bytes-like object is required, not 'int'**
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…