Open chenwq3 opened 6 years ago
#!/usr/bin/env python3
import dbus
import gatt
class DeviceManager(gatt.DeviceManager):
def device_discovered(self,device):
print("Discovered [%s] %s" %
(device.mac_address, device.alias()))
if __name__ == '__main__':
manager = DeviceManager(adapter_name='hci0')
uuid = '680c21d9-c946-4c1f-9c11-baa1c21329e7'
if True:
manager.start_discovery([uuid])
else:
if False:
manager._adapter.SetDiscoveryFilter({
dbus.String("UUIDs"):[dbus.String(uuid)],
})
else:
manager._adapter.SetDiscoveryFilter({
dbus.String("Transport"):dbus.String("le")
})
manager._adapter.StartDiscovery()
manager.run()
while True:
pass
Not work at Raspberry Pi 3 with image of mate 16.04.2.(official image).
version
$ bluetoothd --version
5.41
$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 16.04.2 LTS
Release: 16.04
Codename: xenial
~$ uname -a
Linux rpi-desktop 4.4.38-v7+ #938 SMP Thu Dec 15 15:22:21 GMT 2016 armv7l armv7l armv7l GNU/Linux
Hello,
Thank you for developing the python Bluetooth LE library. I'm trying to learn Bluetooth, and I am testing a dwm1001-dev device.
It uuid is
680c21d9-c946-4c1f-9c11-baa1c21329e7
, I check for many times.Here is my debugging code:
Output: when i set a filter with
"UUIDs":['<uuid>']
, it can't not discovery any devices.device: Raspberry Pi B2 Bluetooth dongle: Bus 001 Device 004: ID 0a12:0001 Cambridge Silicon Radio, Ltd Bluetooth Dongle (HCI mode)
version: