micropython-lib icon indicating copy to clipboard operation
micropython-lib copied to clipboard

The order of bt_addr passed up in the ScanResult

Open brianreinhold opened this issue 8 months ago • 1 comments

In the aioble code there is a line like this:

self.addr: bytes = addr if len(addr) == 6 else binascii.unhexlify(addr.replace(":", ""))

The unhexify part with the colons suggests the bt address is passed up to the application in big endian. You don't see BT addresses expressed in little endian with colons.

The normal way one would write the BT address on a device is ae:f4:27:9F:d2:ee. In BLE this would be transmitted as ee d2 9f 27 f4 ae.

It's not clear what I get in ScanResult.device.addr

is it ee d2 9f 27 f4 ae or ae f4 27 9F d2 ee?

brianreinhold avatar Jun 14 '24 17:06 brianreinhold