1 BlueZ D-Bus GATT API description
2 ********************************
4 GATT local and remote services share the same high-level D-Bus API. Local
5 refers to GATT based service exported by a BlueZ plugin or an external
6 application. Remote refers to GATT services exported by the peer.
8 BlueZ acts as a proxy, translating ATT operations to D-Bus method calls and
9 Properties (or the opposite). Support for D-Bus Object Manager is mandatory for
10 external services to allow seamless GATT declarations (Service, Characteristic
11 and Descriptors) discovery. Each GATT service tree is required to export a D-Bus
12 Object Manager at its root that is solely responsible for the objects that
13 belong to that service.
15 Releasing a registered GATT service is not defined yet. Any API extension
16 should avoid breaking the defined API, and if possible keep an unified GATT
17 remote and local services representation.
22 GATT remote and local service representation. Object path for local services
25 External applications implementing local services must register the services
26 using GattManager1 registration method and must implement the methods and
27 properties defined in GattService1 interface.
30 Interface org.bluez.GattService1 [Experimental]
31 Object path [variable prefix]/{hci0,hci1,...}/dev_XX_XX_XX_XX_XX_XX/serviceXX
33 Properties string UUID [read-only]
37 boolean Primary [read-only]
39 Indicates whether or not this GATT service is a
40 primary service. If false, the service is secondary.
42 object Device [read-only, optional]
44 Object path of the Bluetooth device the service
45 belongs to. Only present on services from remote
48 array{object} Characteristics [read-only]
50 Array of object paths representing the characteristics
51 of this service. This property is set only when the
52 characteristic discovery has been completed, however the
53 characteristic objects will become available via
54 ObjectManager as soon as they get discovered.
56 array{object} Includes [read-only]: Not implemented
58 Array of object paths representing the included
59 services of this service.
62 Characteristic hierarchy
63 ========================
65 For local GATT defined services, the object paths need to follow the service
66 path hierarchy and are freely definable.
69 Interface org.bluez.GattCharacteristic1 [Experimental]
70 Object path [variable prefix]/{hci0,hci1,...}/dev_XX_XX_XX_XX_XX_XX/serviceXX/charYYYY
72 Methods array{byte} ReadValue()
74 Issues a request to read the value of the
75 characteristic and returns the value if the
76 operation was successful.
78 Possible Errors: org.bluez.Error.Failed
79 org.bluez.Error.InProgress
80 org.bluez.Error.NotPermitted
81 org.bluez.Error.NotAuthorized
82 org.bluez.Error.NotSupported
84 void WriteValue(array{byte} value)
86 Issues a request to write the value of the
89 Possible Errors: org.bluez.Error.Failed
90 org.bluez.Error.InProgress
91 org.bluez.Error.NotPermitted
92 org.bluez.Error.InvalidValueLength
93 org.bluez.Error.NotAuthorized
94 org.bluez.Error.NotSupported
98 Starts a notification session from this characteristic
99 if it supports value notifications or indications.
101 Possible Errors: org.bluez.Error.Failed
102 org.bluez.Error.InProgress
103 org.bluez.Error.NotSupported
107 This method will cancel any previous StartNotify
108 transaction. Note that notifications from a
109 characteristic are shared between sessions thus
110 calling StopNotify will release a single session.
112 Possible Errors: org.bluez.Error.Failed
114 Properties string UUID [read-only]
116 128-bit characteristic UUID.
118 object Service [read-only]
120 Object path of the GATT service the characteristc
123 array{byte} Value [read-only, optional]
125 The cached value of the characteristic. This property
126 gets updated only after a successful read request and
127 when a notification or indication is received, upon
128 which a PropertiesChanged signal will be emitted.
130 boolean Notifying [read-only]
132 True, if notifications or indications on this
133 characteristic are currently enabled.
135 array{string} Flags [read-only]
137 Defines how the characteristic value can be used. See
138 Core spec "Table 3.5: Characteristic Properties bit
139 field", and "Table 3.8: Characteristic Extended
140 Properties bit field". Allowed values:
144 "write-without-response"
148 "authenticated-signed-writes"
150 "writable-auxiliaries"
152 array{object} Descriptors [read-only]
154 Array of object paths representing the descriptors
155 of this service. This property is set only when the
156 descriptor discovery has been completed, however the
157 descriptor objects will become available via
158 ObjectManager as soon as they get discovered.
161 Characteristic Descriptors hierarchy
162 ====================================
164 Local or remote GATT characteristic descriptors hierarchy.
167 Interface org.bluez.GattDescriptor1 [Experimental]
168 Object path [variable prefix]/{hci0,hci1,...}/dev_XX_XX_XX_XX_XX_XX/serviceXX/charYYYY/descriptorZZZ
170 Methods array{byte} ReadValue()
172 Issues a request to read the value of the
173 characteristic and returns the value if the
174 operation was successful.
176 Possible Errors: org.bluez.Error.Failed
177 org.bluez.Error.InProgress
178 org.bluez.Error.NotPermitted
179 org.bluez.Error.NotAuthorized
180 org.bluez.Error.NotSupported
182 void WriteValue(array{byte} value)
184 Issues a request to write the value of the
187 Possible Errors: org.bluez.Error.Failed
188 org.bluez.Error.InProgress
189 org.bluez.Error.NotPermitted
190 org.bluez.Error.InvalidValueLength
191 org.bluez.Error.NotAuthorized
192 org.bluez.Error.NotSupported
194 Properties string UUID [read-only]
196 128-bit descriptor UUID.
198 object Characteristic [read-only]
200 Object path of the GATT characteristc the descriptor
203 array{byte} Value [read-only, optional]
205 The cached value of the descriptor. This property
206 gets updated only after a successful read request, upon
207 which a PropertiesChanged signal will be emitted.
213 Local profile (GATT client) instance. By registering this type of object
214 an application effectively indicates support for a specific GATT profile
215 and requests automatic connections to be established to devices
218 Service <application dependent>
219 Interface org.bluez.GattProfile1 [Experimental]
220 Object path <application dependent>
222 Methods void Release()
224 This method gets called when the service daemon
225 unregisters the profile. The profile can use it to
226 do cleanup tasks. There is no need to unregister the
227 profile, because when this method gets called it has
228 already been unregistered.
231 GATT Manager hierarchy
232 ======================
234 GATT Manager allows external applications to register GATT services and
237 Registering a profile allows applications to subscribe to *remote* services.
238 These must implement the GattProfile1 interface defined above.
240 Registering a service allows applications to publish a *local* GATT service,
241 which then becomes available to remote devices. A GATT service is represented by
242 a D-Bus object hierarchy where the root node corresponds to a service and the
243 child nodes represent characteristics and descriptors that belong to that
244 service. Each node must implement one of GattService1, GattCharacteristic1,
245 or GattDescriptor1 interfaces described above, based on the attribute it
246 represents. Each node must also implement the standard D-Bus Properties
247 interface to expose their properties. These objects collectively represent a
248 GATT service definition.
250 To make service registration simple, BlueZ requires that all objects that belong
251 to a GATT service be grouped under a D-Bus Object Manager that solely manages
252 the objects of that service. Hence, the standard DBus.ObjectManager interface
253 must be available on the root service path. An example application hierarchy
254 containing two separate GATT services may look like this:
258 -> /com/example/service0
259 | | - org.freedesktop.DBus.ObjectManager
260 | | - org.freedesktop.DBus.Properties
261 | | - org.bluez.GattService1
263 | -> /com/example/service0/char0
264 | | - org.freedesktop.DBus.Properties
265 | | - org.bluez.GattCharacteristic1
267 | -> /com/example/service0/char1
268 | | - org.freedesktop.DBus.Properties
269 | | - org.bluez.GattCharacteristic1
271 | -> /com/example/service0/char1/desc0
272 | - org.freedesktop.DBus.Properties
273 | - org.bluez.GattDescriptor1
275 -> /com/example/service1
276 | - org.freedesktop.DBus.ObjectManager
277 | - org.freedesktop.DBus.Properties
278 | - org.bluez.GattService1
280 -> /com/example/service1/char0
281 - org.freedesktop.DBus.Properties
282 - org.bluez.GattCharacteristic1
284 When a service is registered, BlueZ will automatically obtain information about
285 all objects using the service's Object Manager. Once a service has been
286 registered, the objects of a service should not be removed. If BlueZ receives an
287 InterfacesRemoved signal from a service's Object Manager, it will immediately
288 unregister the service. Similarly, if the application disconnects from the bus,
289 all of its registered services will be automatically unregistered.
290 InterfacesAdded signals will be ignored.
293 Interface org.bluez.GattManager1 [Experimental]
294 Object path [variable prefix]/{hci0,hci1,...}
296 Methods void RegisterService(object service, dict options)
298 Registers a local GATT service hierarchy as described
301 "service" object path together with the D-Bus system
302 bus connection ID define the identification of the
303 application registering a GATT based service.
305 Possible errors: org.bluez.Error.InvalidArguments
306 org.bluez.Error.AlreadyExists
308 void UnregisterService(object service)
310 This unregisters the service that has been
311 previously registered. The object path parameter
312 must match the same value that has been used
315 Possible errors: org.bluez.Error.InvalidArguments
316 org.bluez.Error.DoesNotExist
318 void RegisterProfile(object profile, array{string} UUIDs,
321 Registers a GATT (client role) profile exported
322 under interface GattProfile1. The array of UUIDs
323 specifies the mandatory set of remote service
324 UUIDs that should all be available for the
325 remote device to match this profile. Matching
326 devices will be added to the auto-connection
327 list and connected whenever available.
329 Possible errors: org.bluez.Error.InvalidArguments
330 org.bluez.Error.AlreadyExists
332 void UnregisterProfile(object profile)
334 This unregisters the profile that has been
335 previously registered. The object path parameter
336 must match the same value that has been used
339 Possible errors: org.bluez.Error.InvalidArguments
340 org.bluez.Error.DoesNotExist
341 #ifdef __TIZEN_PATCH__
342 GetService(string uuid)
344 This Reads the service, characterstics and descriptors
345 that has been previously registered. The string uuid parameter
346 must match the same value that has been used
349 The return values includes,
353 CharacteristicsX /serviceX/CharacterisitcX
354 DescriptorX /serviceX/CharacterisitcX/DescriptorX
356 Possible errors: org.bluez.Error.InvalidArguments