I am new to BLUEZ as well as linux. I found that Bluez promotes usage of DBUS APIs. I want to know whats a DBUS API in terms of BLUEZ also, whats the benefit of using them instead of direct C APIS? How different is it as compared to C APIs?
相关问题
- How to stop a dbus gobject loop
- what is the difference between bounded and unbound
- How to extract service state via Systemd DBus API?
- CoreBluetooth - Can connectPeripheral be called mu
- Bluetooth Le Gatt Not Finding Any Devices
相关文章
- Why the address of my BluetoothDevice changes ever
- bluetoothctl No default controller available
- Bluetooth LE Scanning Sometimes Doesn't Find D
- UWP BLE device pairing
- Android 4.3: How to connect to multiple Bluetooth
- Bluetooth LE TX Power reading
- Bluez implementation in android
- Android / iOS - BLE - wake up a terminated applica
From my own experience:
So it depends on what you are trying to achieve. If you just want basic discovery and rfcomm/l2cap connections then the C apis are probably ok. If you want anything beyond that and if your platform is able to accommodate the extra overhead of DBUS/bluetoothd/etc then you probably want to go with the DBUS apis.
Update: bluez now supports a gatt API via the dbus. Just completed in 5.28 (though I think there were bits of it in earlier versions).
Bluez pushes the use of the DBUS interface over the rest. Unfortunately, not everything is possible through the DBUS interface.
I haven't looked at it recently, but it used to be that BLE was poorly supported though DBUS. You could only interact with officially published BLE profiles such as heart rate monitors. If you wanted to do anything with attributes not part of any Bluetooth BLE profile then you were stuck. So, for example, accelerometers were impossible to access via the DBUS interface.
This may have changed in the 5.X branch (I haven't been looking at it because it doesn't work on the 3.4 kernel I have to use). The 4.X branch of Bluez hasn't changed and it's definitely the case you'll have issues with BLE over DBUS on non-profile attributes.
Just a note of warning, though, if you're using the 3.4 kernel or older you'll have issues opening more than one L2CAP socket. There's a bug in the kernel that no one seems interested in fixing. (what happens is all the data comes down one socket regardless of which device it came from)