Bluez-5.36 StartDiscovery() method

2019-08-12 15:33发布

I have searched for the method StartDiscovery() in bluez-5.36 libraries and I could not find.

Can some one please tell where this method is implemented?

Its mentioned in "adapter-api.txt" of "bluez-5.36/doc/" directory.

2条回答
Deceive 欺骗
2楼-- · 2019-08-12 16:10

That is to use bluez through D-Bus API and GATT. In order to access to this feature you need to compile bluez with some experimental features (GATT/D-Bus API is still experimental). Then you can use D-Bus API to access to Adapter and execute the methods on it (Start/StopDiscovery)

Please have a look at this project: https://github.com/jomarmar/bluez-experimental . It is just a fork of bluez, with some changes in order to activate the GATT API experimental feature.

查看更多
霸刀☆藐视天下
3楼-- · 2019-08-12 16:31

You should install BlueZ with the experimental flag enabled. BlueZ is moving towards user space development by using the DBus to expose bluetooth 'objects' and associated methods and properties.

If you install d-feetyou can actually check out the methods and types of objects described in the API documentation:

sudo apt-get install d-feet

However, for GATT-related functionality, the experimental flag has to be enabled. If you're not sure how to enable the experimental flag, you can just run sudo bluetoothd -E to enable the Bluetooth Daemon with the experimental flag. The corresponding GattManager1 interfaces and such will be published in the DBus interface, which again, I strongly recommend using d-feet to get an idea of how it all works.

If you're looking for some source code and documentation/help regarding the use of and programming with the DBus API, you might want to check out my answer here.

查看更多
登录 后发表回答