org.bluez.GattCharacteristic - BlueZ D-Bus GattCharacteristic API documentation
Contents
Description
GATT local/server and remote/client characteristic attribute representation share the same high-level
D-Bus API.
Local/Server refers to GATT based characteristics exported by a plugin or an external application.
Remote/Client refers to GATT characteristics exported by the peer.
Interface
ClientService
org.bluez
Interface
org.bluez.GattCharacteristic1
Objectpath
[variable prefix]/{hci0,hci1,...}/dev_XX_XX_XX_XX_XX_XX/serviceXX/charYYYY
ServerService
unique name
Interface
org.bluez.GattCharacteristic1
Objectpath
freely definable
Methodsarray{byte}ReadValue(dictoptions)
Issues a request to read the value of the characteristic and returns the value if the operation was
successful.
Possible options:
uint16offset
Read start offset in bytes.
uint16mtu(serveronly)
Exchange MTU in bytes.
objectdevice(serveronly)
Device object.
stringlink(serveronly)
Link type.
Possible values:
"BR/EDR""LE"
Possible Errors:
org.bluez.Error.Failed
Possible values: string 0x80 - 0x9f
org.bluez.Error.InProgressorg.bluez.Error.NotPermittedorg.bluez.Error.NotAuthorizedorg.bluez.Error.InvalidOffsetorg.bluez.Error.NotSupportedvoidWriteValue(array{byte}value,dictoptions)
Issues a request to write the value of the characteristic.
Possible options:
uint16offset
Write start offset in bytes.
stringtype
Possible values:
"command"
Use Write without response procedure.
"request"
Use Write with response procedure.
"reliable"
Use Reliable Write procedure.
uint16mtu
Exchanged MTU (Server only).
objectdevice
Device path (Server only).
stringlink
Link type (Server only).
Possible values:
"BR/EDR""LE"booleanprepare-authorize
True if prepare authorization request.
Possible Errors:
org.bluez.Error.Failed
Possible values: string 0x80 - 0x9f
org.bluez.Error.InProgressorg.bluez.Error.NotPermittedorg.bluez.Error.InvalidValueLengthorg.bluez.Error.NotAuthorizedorg.bluez.Error.NotSupportedorg.bluez.Error.ImproperlyConfiguredfd,uint16AcquireWrite(dictoptions)[optional]
Acquire file descriptor and MTU for writing. Only sockets are supported. Usage of WriteValue will be
locked causing it to return NotPermitted error.
For server the MTU returned shall be equal or smaller than the negotiated MTU.
For client it only works with characteristic that has WriteAcquired property which relies on
write-without-response Flag.
To release the lock the client shall close the file descriptor, a HUP is generated in case the device
is disconnected.
Note: the MTU can only be negotiated once and is symmetric therefore this method may be delayed in
order to have the exchange MTU completed, because of that the file descriptor is closed during
reconnections as the MTU has to be renegotiated.
Possible options:
objectdevice
Object Device (Server only).
uint16mtu
Exchanged MTU (Server only).
stringlink
Link type (Server only).
Possible values:
"BR/EDR""LE"
Possible Errors:
org.bluez.Error.Failedorg.bluez.Error.NotSupportedfd,uint16AcquireNotify(dictoptions)[optional]
Acquire file descriptor and MTU for notify. Only sockets are support.
Usage of StartNotify will be locked causing it to return org.bluez.Error.NotPermitted.
For server the MTU returned shall be equal or smaller than the negotiated MTU.
Only works with characteristic that has NotifyAcquired property which relies on presence of "notify"or"indicate"Flag and no other client have called StartNotify().
Notification are enabled during this procedure so StartNotify() shall not be called, any notification
will be dispatched via file descriptor therefore the Value property is not affected during the time
where notify has been acquired.
To release the lock the client shall close the file descriptor, a HUP is generated in case the device
is disconnected.
As a client if indication procedure is used the confirmation is generated automatically once received,
for a server if the file descriptor is writable (POLLOUT) then upon receiving a confirmation from the
client one byte (0x01) is written to the file descriptor.
Note: the MTU can only be negotiated once and is symmetric therefore this method may be delayed in
order to have the exchange MTU completed, because of that the file descriptor is closed during
reconnections as the MTU has to be renegotiated.
Possible options:
objectdevice
Object Device (Server only).
uint16mtu
Exchanged MTU (Server only).
stringlink
Link type (Server only).
Possible values:
"BR/EDR""LE"
Possible Errors:
org.bluez.Error.Failedorg.bluez.Error.NotSupportedorg.bluez.Error.NotPermittedvoidStartNotify()
Starts a notification session from this characteristic if it supports value notifications or
indications.
Possible Errors:
org.bluez.Error.Failedorg.bluez.Error.NotPermittedorg.bluez.Error.InProgressorg.bluez.Error.NotConnectedorg.bluez.Error.NotSupportedvoidStopNotify()
Stops or cancel session previously created by StartNotify().
Note that notifications from a characteristic are shared between sessions thus calling StopNotify will
release a single session.
Possible Errors:
org.bluez.Error.FailedvoidConfirm()[noreply,optional](Serveronly)
Confirms value was received.
Possible Errors:
org.bluez.Error.Failed
PropertiesstringUUID[read-only]
128-bit characteristic UUID.
objectService[read-only]
Object path of the GATT service the characteristic belongs to.
array{byte}Value[read-only,optional]
The cached value of the characteristic. This property gets updated only after a successful read
request and when a notification or indication is received, upon which a PropertiesChanged signal will
be emitted.
booleanWriteAcquired[read-only,optional]
True, if this characteristic has been acquired by any client using AcquireWrite.
For client properties is ommited in case 'write-without-response' flag is not set.
For server the presence of this property indicates that AcquireWrite is supported.
booleanNotifyAcquired[read-only,optional]
True, if this characteristic has been acquired by any client using AcquireNotify.
For client this properties is ommited in case 'notify' flag is not set.
For server the presence of this property indicates that AcquireNotify is supported.
booleanNotifying[read-only,optional]
True, if notifications or indications on this characteristic are currently enabled.
array{string}Flags[read-only]
Defines how the characteristic value can be used. See Core spec "Table 3.5: Characteristic Properties
bit field", and "Table 3.8: Characteristic Extended Properties bit field".
The "x-notify" and "x-indicate" flags restrict access to notifications and indications by imposing
write restrictions on a characteristic's client characteristic configuration descriptor.
Possible values:
"broadcast""read""write-without-response""write""notify""indicate""authenticated-signed-writes""extended-properties""reliable-write""writable-auxiliaries""encrypt-read""encrypt-write""encrypt-notify"(Serveronly)"encrypt-indicate"(Serveronly)"encrypt-authenticated-read""encrypt-authenticated-write""encrypt-authenticated-notify"(Serveronly)"encrypt-authenticated-indicate"(Serveronly)"secure-read"(Serveronly)"secure-write"(Serveronly)"secure-notify"(Serveronly)"secure-indicate"(Serveronly)"authorize"uint16Handle[read-only](ClientOnly)
Characteristic handle.
uint16Handle[read-write,optional](ServerOnly)
Characteristic handle. When available in the server it would attempt to use to allocate into the
database which may fail, to auto allocate the value 0x0000 shall be used which will cause the
allocated handle to be set once registered.
uint16MTU[read-only]
Characteristic MTU, this is valid both for ReadValue() and WriteValue() but either method can use long
procedures when supported.
BlueZ October 2023 ORG.BLUEZ.GATTCHARACTERISTIC(5)
Name
org.bluez.GattCharacteristic - BlueZ D-Bus GattCharacteristic API documentation
