Change BlueZ GATT Server DBus API. |
|||||||
Issue descriptionThe BlueZ GATT server DBus API currently has missing parts. Particularly, .) The ReadValue/WriteValue methods do not include a device object, indicating which device a read/write value request came from. .) There is no method to notify a remote connected device that a local characteristic/descriptor value has changed. This call needs to be added.
,
Apr 22 2016
This is on my list, what Im planning is basically the following:
diff --git a/doc/gatt-api.txt b/doc/gatt-api.txt
index ad2ab16..0861930 100644
--- a/doc/gatt-api.txt
+++ b/doc/gatt-api.txt
@@ -61,23 +61,29 @@ Service org.bluez
Interface org.bluez.GattCharacteristic1 [Experimental]
Object path [variable prefix]/{hci0,hci1,...}/dev_XX_XX_XX_XX_XX_XX/serviceXX/charYYYY
-Methods array{byte} ReadValue()
+Methods array{byte} ReadValue(dict flags)
Issues a request to read the value of the
characteristic and returns the value if the
operation was successful.
+ Possible flags: "offset": Start offset (optional)
+ "device": Device path (Server only)
+
Possible Errors: org.bluez.Error.Failed
org.bluez.Error.InProgress
org.bluez.Error.NotPermitted
org.bluez.Error.NotAuthorized
org.bluez.Error.NotSupported
- void WriteValue(array{byte} value)
+ void WriteValue(array{byte} value, dict flags)
Issues a request to write the value of the
characteristic.
+ Possible flags: "offset": Start offset (optional)
+ "device": Device path (Server only)
+
Possible Errors: org.bluez.Error.Failed
org.bluez.Error.InProgress
org.bluez.Error.NotPermitted
@@ -154,23 +160,29 @@ Service org.bluez
Interface org.bluez.GattDescriptor1 [Experimental]
Object path [variable prefix]/{hci0,hci1,...}/dev_XX_XX_XX_XX_XX_XX/serviceXX/charYYYY/descriptorZZZ
-Methods array{byte} ReadValue()
+Methods array{byte} ReadValue(dict flags)
Issues a request to read the value of the
characteristic and returns the value if the
operation was successful.
+ Possible flags: "offset": Start offset (optional)
+ "device": Device path (Server only)
+
Possible Errors: org.bluez.Error.Failed
org.bluez.Error.InProgress
org.bluez.Error.NotPermitted
org.bluez.Error.NotAuthorized
org.bluez.Error.NotSupported
- void WriteValue(array{byte} value)
+ void WriteValue(array{byte} value, dict flags)
Issues a request to write the value of the
characteristic.
+ Possible flags: "offset": Start offset (optional)
+ "device": Device path (Server only)
+
Possible Errors: org.bluez.Error.Failed
org.bluez.Error.InProgress
org.bluez.Error.NotPermitted
@@ -294,7 +306,7 @@ Object path [variable prefix]/{hci0,hci1,...}
Methods void RegisterApplication(object application, dict options)
Registers a local GATT services hierarchy as described
- above.
+ above (GATT Server) and/or profiles (GATT Client).
The application object path together with the D-Bus
system bus connection ID define the identification of
,
Apr 22 2016
Thanks for the update! Have just two questions :) .) This doesn't add an API to let us send notifications to a central device that we've updated a local characteristic/descriptor value, right? How much work do you believe that would be? .) Do you have an approximate idea of what timelines are you looking at? Is there any way we can help?
,
Apr 25 2016
Changes to local characteristic/descriptor is better done changing the entire service since ServiceChanged has be sent with the range of the service so the client can perform a discovery, furthermore most GATT database don't reserve extra space in between services which means you will not be able to add new attributes to service. Also note that while it would be possible for BlueZ to reserve space in practice this would cause extra time for clients discovering these area. While this is true we could perhaps allow this over D-Bus but internally we still would remove/add the services. As for timeline I would like to have this as soon as possible, so fill free to send patches, I will probably start with the API changes above.
,
Apr 25 2016
,
Apr 25 2016
,
Apr 26 2016
So last question Luiz. I am trying to figure out the BlueZ equivalent to this API: http://developer.android.com/reference/android/bluetooth/BluetoothGattServer.html#notifyCharacteristicChanged(android.bluetooth.BluetoothDevice,%20android.bluetooth.BluetoothGattCharacteristic,%20boolean) Currently there doesn't seem to be an explicit API to do this. We could probably simulate this by sending a properties changed signal on a characteristic but having an explicit API might be useful since both Android and iOS provide it. The iOS equivalent API is: https://developer.apple.com/library/tvos/documentation/CoreBluetooth/Reference/CBPeripheralManager_Class/index.html#//apple_ref/occ/instm/CBPeripheralManager/updateValue:forCharacteristic:onSubscribedCentrals:
,
Apr 28 2016
vudentz replied on IRC:
<vudentz> rkc, there is the StartNotification then the Application just need to send PropertiesChanged("Value") which will be send with ATT notification, and in the plus side we actually tell the application with StopNotification when there is no device connected with CCC configured.
So ideally we 'should' just be able to use the properties changed signal to trigger a notification. This is only if the remote central has requested a StartNotification though.
,
May 3 2016
Just a heads up that Ive started implementing the changes, should be posting them later today or tomorrow.
,
May 3 2016
Thanks. Luiz. I also started looking at this.
,
May 5 2016
Friendly ping. I still waiting for the implementation to start looking at this.
,
May 6 2016
Will be sending the changes today, we found a bug that prevent the proper ordering of signals on D-Bus thus the delay.
,
May 14 2016
The following revision refers to this bug: https://chromium.googlesource.com/chromiumos/third_party/bluez/+/2a2e7102cd86ec3c28cc2b7e003ba8deb07f4731 commit 2a2e7102cd86ec3c28cc2b7e003ba8deb07f4731 Author: Luiz Augusto von Dentz <luiz.von.dentz@intel.com> Date: Mon May 09 13:51:18 2016 FROMLIST: doc/gatt-api: Add options dictionary to ReadValue/WriteValue This adds the possibility to pass an offset to these operations, and also in the server case to give the device object. (am from http://www.spinics.net/lists/linux-bluetooth/msg67177.html) [puthik: fix conflict with the patch below in src/gatt-client.c 96bfbb5 - CHROMIUM: Make GATT server API non-experimental] BUG= 605187 TEST=Build Change-Id: I8db42d59a2cf79cfd437a609ebf89712df56c1d1 Reviewed-on: https://chromium-review.googlesource.com/344691 Commit-Ready: Rahul Chaturvedi <rkc@chromium.org> Tested-by: Rahul Chaturvedi <rkc@chromium.org> Reviewed-by: Rahul Chaturvedi <rkc@chromium.org> [modify] https://crrev.com/2a2e7102cd86ec3c28cc2b7e003ba8deb07f4731/src/gatt-client.c [modify] https://crrev.com/2a2e7102cd86ec3c28cc2b7e003ba8deb07f4731/doc/gatt-api.txt [modify] https://crrev.com/2a2e7102cd86ec3c28cc2b7e003ba8deb07f4731/src/gatt-database.c
,
May 16 2016
3 days from branch. Please remove M-52 label from issues, or schedule for 53, as appropriate.
,
May 16 2016
,
May 19 2016
bulk verify of io>bluetooth gatt server bugs |
|||||||
►
Sign in to add a comment |
|||||||
Comment 1 by r...@chromium.org
, Apr 20 2016