Skip to contentSkip to conversation

doc/gatt-api: Add options dictionary to ReadValue/WriteValue

RFC Superseded Luiz Augusto von Dentz 2 participants 4 messages Apr 29, 2016 Bluetooth drivers

lore
Share & tools
lore

Luiz Augusto von Dentz

author maintainer
#0 lore raw

RFC v2 1/3 doc/gatt-api: Add options dictionary to ReadValue/WriteValue

From: Luiz Augusto von Dentz <[email protected]>

This adds the possibility to pass an offset to these operations, and also in the server case to give the device object.
---
v2: Change flags to options since flags is term already used for other things, also include secure-{read,write} to the flags to restrict access to secure connection only.

 doc/gatt-api.txt | 20 ++++++++++++++++----
 1 file changed, 16 insertions(+), 4 deletions(-)
doc/gatt-api.txt +16 -4
index ad2ab16..683b1b7 100644
@@ -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 options)
 
 			Issues a request to read the value of the
 			characteristic and returns the value if the
 			operation was successful.
 
+			Possible options: "offset": uint16 offset
+					  "device": Object Device (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 options)
 
 			Issues a request to write the value of the
 			characteristic.
 
+			Possible options: "offset": Start offset
+					  "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 options: "offset": Start offset
+					  "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 options: "offset": Start offset
+					  "device": Device path (Server only)
+
 			Possible Errors: org.bluez.Error.Failed
 					 org.bluez.Error.InProgress
 					 org.bluez.Error.NotPermitted
Signature · 1 line
2.5.5
author maintainer
#1 lore raw

RFC v2 2/3 doc/gatt-api: Merge RegisterProfile with RegisterApplication

From: Luiz Augusto von Dentz <[email protected]>

Since RegisterApplication makes use of ObjectManager it is also possible to verify the existance of GattProfile objects unifying the API for both services (GATT server) and profiles (GATT client).

---
 doc/gatt-api.txt | 37 +++++++++----------------------------
 1 file changed, 9 insertions(+), 28 deletions(-)
doc/gatt-api.txt +9 -28
index 683b1b7..9404986 100644
@@ -218,8 +218,8 @@ Properties	string UUID [read-only]
 				"encrypt-authenticated-read"
 				"encrypt-authenticated-write"
 
-Profile hierarcy
-================
+GATT Profile hierarcy
+=====================
 
 Local profile (GATT client) instance. By registering this type of object
 an application effectively indicates support for a specific GATT profile
@@ -238,6 +238,10 @@ Methods		void Release()
 			profile, because when this method gets called it has
 			already been unregistered.
 
+Properties	array{string} UUIDs [read-only]
+
+			128-bit GATT service UUIDs.
+
 
 GATT Manager hierarchy
 ======================
@@ -306,11 +310,12 @@ 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 GATT profiles (GATT Client).
 
 			The application object path together with the D-Bus
 			system bus connection ID define the identification of
-			the application registering a GATT based service.
+			the application registering a GATT based
+			service or profile.
 
 			Possible errors: org.bluez.Error.InvalidArguments
 					 org.bluez.Error.AlreadyExists
@@ -324,27 +329,3 @@ Methods		void RegisterApplication(object application, dict options)
 
 			Possible errors: org.bluez.Error.InvalidArguments
 					 org.bluez.Error.DoesNotExist
-
-		void RegisterProfile(object profile, array{string} UUIDs,
-				     dict options)
-
-			Registers a GATT (client role) profile exported
-			under interface GattProfile1. The array of UUIDs
-			specifies the mandatory set of remote service
-			UUIDs that should all be available for the
-			remote device to match this profile. Matching
-			devices will be added to the auto-connection
-			list and connected whenever available.
-
-			Possible errors: org.bluez.Error.InvalidArguments
-					 org.bluez.Error.AlreadyExists
-
-		void UnregisterProfile(object profile)
-
-			This unregisters the profile that has been
-			previously registered. The object path parameter
-			must match the same value that has been used
-			on registration.
-
-			Possible errors: org.bluez.Error.InvalidArguments
-					 org.bluez.Error.DoesNotExist
Signature · 1 line
2.5.5
author maintainer
#3 lore raw

RFC v2 3/3 doc/gatt-api: Add secure flags

In reply to Luiz Augusto von Dentz

From: Luiz Augusto von Dentz <[email protected]>

This add secure-{read,write} which shall be used by servers that want to restrict attribute access to secure connection only (BT_SECURITY_FIPS)

---
 doc/gatt-api.txt | 4 ++++
 1 file changed, 4 insertions(+)
doc/gatt-api.txt +4 -0
index 9404986..cb4e196 100644
@@ -150,6 +150,8 @@ Properties	string UUID [read-only]
 				"encrypt-write"
 				"encrypt-authenticated-read"
 				"encrypt-authenticated-write"
+				"secure-read" (Server only)
+				"secure-write" (Server only)
 
 Characteristic Descriptors hierarchy
 ====================================
@@ -217,6 +219,8 @@ Properties	string UUID [read-only]
 				"encrypt-write"
 				"encrypt-authenticated-read"
 				"encrypt-authenticated-write"
+				"secure-read" (Server Only)
+				"secure-write" (Server Only)
 
 GATT Profile hierarcy
 =====================
Signature · 1 line
2.5.5
#2 lore raw

Re: [RFC v2 BlueZ 2/3] doc/gatt-api: Merge RegisterProfile with RegisterApplication

In reply to Luiz Augusto von Dentz

Hi Luiz,

Quoted 37 lines · Luiz Augusto von Dentz

From: Luiz Augusto von Dentz <[email protected]>

Since RegisterApplication makes use of ObjectManager it is also possible to verify the existance of GattProfile objects unifying the API for both services (GATT server) and profiles (GATT client).

---
 doc/gatt-api.txt | 37 +++++++++----------------------------
 1 file changed, 9 insertions(+), 28 deletions(-)
doc/gatt-api.txt +6 -2
index 683b1b7..9404986 100644
@@ -218,8 +218,8 @@ Properties	string UUID [read-only]
 				"encrypt-authenticated-read"
 				"encrypt-authenticated-write"
 
-Profile hierarcy
-================
+GATT Profile hierarcy
+=====================
 
 Local profile (GATT client) instance. By registering this type of object
 an application effectively indicates support for a specific GATT profile
@@ -238,6 +238,10 @@ Methods		void Release()
 			profile, because when this method gets called it has
 			already been unregistered.
 
+Properties	array{string} UUIDs [read-only]
+
+			128-bit GATT service UUIDs.
+
 
 GATT Manager hierarchy
 ======================
@@ -306,11 +310,12 @@ Object path	[variable prefix]/{hci0,hci1,...}
 Methods		void RegisterApplication(object application, dict options)

doc/gatt-api.txt Object path [variable prefix]/{hci0,hci1,...} · line 318

Quoted 10 lines
doc/gatt-api.txt +3 -2
 
 			Registers a local GATT services hierarchy as described
-			above.
+			above (GATT Server) and/or GATT profiles (GATT Client).
 
 			The application object path together with the D-Bus
 			system bus connection ID define the identification of
-			the application registering a GATT based service.
+			the application registering a GATT based
+			service or profile.

I guess that updating the '/com/example' example above with a profile case will go a long way making this clearer.

Cheers,
--
Vinicius