converting bluetooth bytes mac address issue !

All ESP32 boards running MicroPython.
Target audience: MicroPython users with an ESP32 board.
Post Reply
Posts: 2
Joined: Thu May 14, 2020 10:11 am

converting bluetooth bytes mac address issue !

Post by shenouda » Thu May 14, 2020 10:24 am

I am developing something on esp32 with bluetooth
simply I scan and got the result:

Code: Select all

def bt_irq(event, data):
  if event == _IRQ_SCAN_RESULT:
    # A single scan result.
    addr_type, addr, connectable, rssi, adv_data = data
    print('type:{} addr:{} rssi:{} data:{}'.format(addr_type, ubinascii.hexlify(addr), rssi, ubinascii.hexlify(adv_data)))

  elif event == _IRQ_SCAN_COMPLETE:
    # Scan duration finished or manually stopped.
    print('scan complete')

the result:

Code: Select all

type:1 addr:b'790c96ba0d35' rssi:-38 data:b'1eff060001092002a7ad7a8ddbb036b1379963a399cc0731f7d591c43e87c9'
however when I scan using nRf connect app on android, I get the DC:FB:48:4D:62:A9 and this is the actual mac address

so how to get from b'y\x0c\x96\xba\r5' to DC:FB:48:4D:62:A9 ??
or where is the issue ??


Post Reply