IanHarvey / bluepy

Python interface to Bluetooth LE on Linux
Other
1.6k stars 490 forks source link

Get mac address of local BT device #339

Open lokeshh opened 5 years ago

lokeshh commented 5 years ago

Is there a way to know the MAC address of the bluetooth device of the machine? The equivalent to do this in linux is hciconfig | grep "BD Address" | awk '{ print $3}'

dhruvkakadiya commented 5 years ago

You can read identity file under specific HCI interface which provides MAC address of the local Bluetooth device.

sudo cat /sys/kernel/debug/bluetooth/hci0/identity
lokeshh commented 5 years ago

It would have been better if this is available through the python only so that I don't need to use sudo and cat which are system dependent.