BluezV5.42 DBUS C API for BLE?

匿名 (未验证) 提交于 2019-12-03 09:02:45

问题:

I have developed BLE application for openwrt using BLUEZV5.30. I was able to create the application by extracting source code gatttool and hcitool. I have also added few more functionality then provided by these tools (like reading rssi).

However, i have upgraded my bluez stack to 5.42 and i am planning to use DBUS interface for all BLE related operations. The functionality i want:

  1. Reading RSSI
  2. Connecting and Disconnecting
  3. Bonding
  4. Pairing
  5. Deleting Bonding information
  6. Discovery
  7. Scanning
  8. Advertising
  9. Write/Reading to Characteristics
  10. Notifications and Indications

I was able to perform all the above operations (except bonding and pairing) using my code written in C++. However, due to some issues with my existing code and inability to pair/bond, i want to migrate to dbus interface. However, i am not sure about the bugs in BLUEZ DBUS API and functionality provided by the APIs. I have read this API Doc but it didn't give any clear picture of DBUS interface.

My question is I am not sure if i can get all of the required functionality with dbus api? I have read the documentation (bluez dbus api) but i am still not sure.

回答1:

As you mention in the other post I updated gattlib to support Bluez DBUS API.
gattlib is written in C. If you do not want to use it looking at its code should help you to progress.

Sinve Bluez v5.42, GATT D-BUS API is not longer mark as experimental.

The DBUS API is described here: https://git.kernel.org/pub/scm/bluetooth/bluez.git/tree/doc. There are also (python) examples that demonstrate the API.



标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!