I am performing a Bluetooth scan from a SiPy board using Pymakr. The console returns unexpected values when decoding the returning advertisements.
from network import Bluetooth
bluetooth = Bluetooth()
bluetooth.start_scan(30)
while bluetooth.isscanning():
adv = bluetooth.get_adv()
if adv:
print(adv)
print(adv[4].decode())
The advertisement returns:
(mac=b'\xd0O~\x07\xc0.', addr_type=0, adv_type=0, rssi=-53, data=b'\x02\x01\x1a\x0b\xffL\x00\t\x06\x03\x04\xc0\xa8\x01!\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00')
When decoding the 'data' on [4] I get:
STX SOH SUB VT ÿL
I have a hard time making sense of the last two characters. Why the accent? Why the capital L? What's with this piece of the data string:
\xffL
Looks like bad hex to me.
I am using MicroPython so I'm sort of limited in workarounds.