PROTOCOLS
CharacteristicNotifier
Defined in fuchsia.bluetooth.gatt2/client.fidl
Listens to characteristic notifications & indications.
OnNotification
Called when a characteristic value notification or indication is received from the server.
- request
value
the value of the updated characteristic.
- response An empty response should be sent immediately as an acknowledgement that the notification was received (for flow control).
Request
Name | Type |
---|---|
value |
ReadValue
|
Response
<EMPTY>
Client
Defined in fuchsia.bluetooth.gatt2/client.fidl
ConnectToService
Connects the RemoteService with the given identifier. Only 1 connection per service is allowed.
service
will be closed on error, with an epitaph that provides a
reason.
- error Returns a
ZX_ERR_INVALID_ARGS
ifhandle
is invalid. - error Returns a
ZX_ERR_NOT_FOUND
if the service is not found. - error Returns a
ZX_ERR_CONNECTION_RESET
if the service is removed. - error Returns a
ZX_ERR_NOT_CONNECTED
if the peer disconnects. - error Returns a
ZX_ERR_ALREADY_EXISTS
if the service is already connected.
Request
Name | Type |
---|---|
handle |
ServiceHandle
|
service |
server_end<RemoteService>
|
WatchServices
Enumerates services found on the peer that this Client represents.
Results can be filtered by specifying a list of UUIDs in uuids
. This
method follows the hanging get pattern. On the initial request, a
complete snapshot will be returned. Subsequent calls with the same set
of uuids
receive a response only when one or more services have been
added, modified, or removed from the entries reported since the most
recent call. Calls with new values of uuids
will reset the filter and
receive a complete snapshot.
Handles may be reused across services, so a handle may be in both
updated
and removed
. For this reason, it is recommended to process
removed services before updated services.
To further interact with services, clients must obtain a RemoteService protocol by calling ConnectToService().
- request
uuids
the UUID allowlist. If empty, all services will be returned.
- response
updated
the services that have been added or modified since WatchServices() was last called. The returned ServiceInfo tables will contain only basic information about each service and thecharacteristics
andincludes
fields will be null. If a service has been added/modified and then removed since the last call, it will only be present inremoved
, notupdated
. If concluded due to a new call with a newuuids
value,updated
will be empty. - response
removed
the handles of the services that have been removed since the last call to WatchServices().
Request
Name | Type |
---|---|
uuids |
vector<fuchsia.bluetooth/Uuid>
|
Response
Name | Type |
---|---|
updated |
vector<ServiceInfo>[65535]
|
removed |
vector<Handle>[65535]
|
LocalService
Defined in fuchsia.bluetooth.gatt2/server.fidl
Interface for serving a local GATT service. Closing the server_end of this protocol causes the GATT service to be removed from the local GATT database. Similarly, closure of the client_end of this protocol means the Bluetooth stack has removed this service from its GATT database.
CharacteristicConfiguration
This notifies the current configuration of a particular characteristic/descriptor for a particular peer. It will be called when the peer GATT client changes the configuration.
The Bluetooth stack maintains the state of each peer's configuration across reconnections. As such, this method will also be called when a peer connects for each characteristic with the initial, persisted state of the newly-connected peer's configuration. However, clients should not rely on this state being persisted indefinitely by the Bluetooth stack.
- request
peer_id
The PeerId of the GATT client associated with this particular CCC. - request
handle
The handle of the characteristic associated with thenotify
andindicate
parameters. - request
notify
True if the client has enabled notifications, false otherwise. - request
indicate
True if the client has enabled indications, false otherwise.
- response empty Returns nothing to acknowledge the characteristic configuration.
Request
Name | Type |
---|---|
peer_id |
fuchsia.bluetooth/PeerId
|
handle |
Handle
|
notify |
bool
|
indicate |
bool
|
Response
<EMPTY>
OnIndicateValue
This event is used to send an indication to a peer. Indications should be used instead of notifications when the service does require peer confirmation of the update.
Indications should not be sent to peers which have not enabled indications on a particular characteristic - if they are sent, they will not be propagated. The Bluetooth stack will track this configuration for the lifetime of the service.
LocalServices must keep track of available credit provided by the ValueChangedCredit
method and send at most that many OnNotifyValue
and OnIndicateValue
events. If more
events are sent than available credits, or the parameters are invalid, the protocol will be
closed.
- request
update
The parameters associated with the changed characteristic. - request
confirmation
When all peers that will be updated have confirmed the indication,confirmation
is signalled with ZX_EVENTPAIR_SIGNALLED.confirmation
will be closed if indicating any peer fails, such as if the peer hasn't configured indications, is not connected, or does not confirm within the ATT transaction timeout of 30 seconds (Bluetooth 5.3 Vol. 3 Part F 3.3.3). To track indication confirmation on a per-peer basis, the implementation can send this event with a single ID inupdate.peer_ids
.
Response
Name | Type |
---|---|
update |
ValueChangedParameters
|
confirmation |
handle<eventpair>
|
OnNotifyValue
This event is used to send a notification to a peer. Notifications should be used instead of indications when the service does not require peer confirmation of the update.
Notifications should not be sent to peers which have not enabled notifications on a particular characteristic - if they are sent, they will not be propagated. The Bluetooth stack will track this configuration for the lifetime of the service.
LocalServices must keep track of available credit provided by the ValueChangedCredit
method and send at most that many OnNotifyValue
and OnIndicateValue
events. If more
events are sent than available credits, or the parameters are invalid, the protocol will be
closed.
Response
Name | Type |
---|---|
payload |
ValueChangedParameters
|
OnSuppressDiscovery
After this event, new peers will no longer be able to discover the service, although peers which have already discovered this service may still access it. This should be sent once per service lifetime; sending more than once closes the protocol and disconnects GATT clients.
Response
<EMPTY>
PeerUpdate
Called to provide GATT information specific to a peer. PeerUpdate will not be called unless the prior invocation received a response. As such, the implementation can simply ignore the first invocation if they are not interested in any PeerUpdate fields.
A PeerUpdate will be made before propagating any other interaction from the peer to the LocalService (Write/ReadValue, CharacteristicConfiguration) on a best-effort basis, as long as all preceding PeerUpdates were acknowledged.
Not currently sent. Comment on https://fxbug.dev/42178509 to request support
- request
peer_id
The PeerId the update pertains to. Always present. - request
mtu
The maximum number of bytes that fit in a notification/indication to this peer. Any bytes past this limit are silently truncated. Most clients need not concern themselves with this unless they are using notifications/indications for high throughput. Optional.
- response An empty response to acknowledge that the update was received.
Request
Name | Type |
---|---|
payload |
LocalServicePeerUpdateRequest
|
Response
<EMPTY>
ReadValue
Called when a peer requests to read the value of a characteristic or descriptor. It is guaranteed that the peer satisfies the permssions associated with this attribute.
- request
peer_id
The PeerId of the GATT client making the read request. - request
handle
The handle of the requested descriptor/characteristic. - request
offset
The offset at which to start reading the requested value.
- response
value
The value of the characteristic.
- error See
gatt2.Error
documentation for possible errors.
Request
Name | Type |
---|---|
peer_id |
fuchsia.bluetooth/PeerId
|
handle |
Handle
|
offset |
int32
|
Response
Name | Type |
---|---|
payload |
LocalService_ReadValue_Result
|
ValueChangedCredit
Add credit for sending indications/notifications. Implementors are defined to start out with
INITIAL_VALUE_CHANGED_CREDITS credits before this method is called. Implementors must keep
track of the available credit they have. The implementor can send exactly one OnNotifyValue
or OnIndicateValue event for each credit. Note that ValueChangedCredit
will only be called
if at least one indication/notification has been sent since the prior call.
Request
Name | Type |
---|---|
additional_credit |
uint8
|
WriteValue
Called when a peer issues a request to write the value of a characteristic or descriptor. It is guaranteed that the peer satisfies the permissions associated with this attribute.
- request
peer_id
The PeerId of the GATT client making the write request. Always present. - request
handle
The handle of the requested descriptor/characteristic. Always present. - request
offset
The offset at which to start writing the value. If the offset is 0, any existing value should be overwritten by the new value. Otherwise, the existing value from offset:(offset + len(value)) should be changed tovalue
. Always present. - request
value
The new value for the descriptor/characteristic. Always present, but may be the empty string.
- response The implementation must send an empty response once the value has been updated as confirmation.
- error See
gatt2.Error
documentation for possible errors.
Request
Name | Type |
---|---|
payload |
LocalServiceWriteValueRequest
|
Response
Name | Type |
---|---|
payload |
LocalService_WriteValue_Result
|
RemoteService
Defined in fuchsia.bluetooth.gatt2/client.fidl
DiscoverCharacteristics
Returns the characteristics and characteristic descriptors that belong to this service.
Request
<EMPTY>
Response
Name | Type |
---|---|
characteristics |
vector<Characteristic>[32767]
|
ReadByType
Reads characteristics and descriptors with the given uuid
.
This method is useful for reading values before discovery has completed, thereby reducing latency.
- request
uuid
The UUID of the characteristics/descriptors to read.
- response
results
The results of the read. May be empty if no matching values are read. If reading a value results in a permission error, the handle and error will be included.
- error Returns
INVALID_PARAMETERS
ifuuid
refers to an internally reserved descriptor type (e.g. the Client Characteristic Configuration descriptor). - error Returns
TOO_MANY_RESULTS
if more results were read than can fit in a FIDL response. Consider reading characteristics/descriptors individually after performing discovery. - error Returns
FAILURE
if the server returns an error not specific to a single result.
Request
Name | Type |
---|---|
uuid |
fuchsia.bluetooth/Uuid
|
Response
Name | Type |
---|---|
payload |
RemoteService_ReadByType_Result
|
ReadCharacteristic
Reads the value of a characteristic with the given handle
.
- request
handle
The characteristic handle to read. - request
options
Options that apply to the read.
- response
value
The value of the characteristic.
- error Returns
INVALID_HANDLE
ifhandle
is invalid. - error Returns
INVALID_PARAMETERS
ifoptions
is invalid. - error Returns
READ_NOT_PERMITTED
orINSUFFICIENT_*
if the server rejects the read request. - error Returns
FAILURE
if the server returns an error.
Request
Name | Type |
---|---|
handle |
Handle
|
options |
ReadOptions
|
Response
Name | Type |
---|---|
payload |
RemoteService_ReadCharacteristic_Result
|
ReadDescriptor
Reads the value of the characteristic descriptor with handle
and
returns it in the reply.
- request
handle
The descriptor handle to read. - request
options
Options that apply to the read.
- response
value
The value of the descriptor.
- error Returns
INVALID_HANDLE
ifhandle
is invalid. - error Returns
INVALID_PARAMETERS
ifoptions
is invalid. - error Returns
READ_NOT_PERMITTED
orINSUFFICIENT_*
if the server rejects the read request. - error Returns
FAILURE
if the server returns an error.
Request
Name | Type |
---|---|
handle |
Handle
|
options |
ReadOptions
|
Response
Name | Type |
---|---|
payload |
RemoteService_ReadDescriptor_Result
|
RegisterCharacteristicNotifier
Subscribe to notifications & indications from the characteristic with
the given handle
.
Either notifications or indications will be enabled depending on characteristic properties. Indications will be preferred if they are supported. This operation fails if the characteristic does not have the "notify" or "indicate" property.
A write request will be issued to configure the characteristic for notifications/indications if it contains a Client Characteristic Configuration descriptor. This method fails if an error occurs while writing to the descriptor.
On success, the notifier
protocol can be used to be notified when
the peer sends a notification or indication. Indications are
automatically confirmed. When the protocol is dropped, the subscription
may end if no other local client is receiving notifications.
- request
handle
the characteristic handle. - request
notifier
the protocol used for notifications.
- response An empty response will be sent immediately if registration succeeds.
- error Returns a
FAILURE
if the characteristic does not support notifications or indications. - error Returns a
INVALID_HANDLE
ifhandle
is invalid. - error Returns a
WRITE_NOT_PERMITTED
orINSUFFICIENT_*
for a descriptor write error.
Request
Name | Type |
---|---|
handle |
Handle
|
notifier |
CharacteristicNotifier
|
Response
Name | Type |
---|---|
payload |
RemoteService_RegisterCharacteristicNotifier_Result
|
WriteCharacteristic
Writes value
to the characteristic with handle
using the provided
options
.
It is not recommended to send additional writes while a write is already in progress (the server may receive simultaneous writes in any order).
- request
handle
The characteristic to be written to. - request
value
The value to be written. - request
options
Options that apply to the write.
- response An empty response will be sent when a success response is
received from the server (or immediately if
options.with_response
is false)
- error Returns
INVALID_HANDLE
ifhandle
is invalid. - error Returns
INVALID_PARAMETERS
ifoptions
is invalid. - error Returns
WRITE_NOT_PERMITTED
orINSUFFICIENT_*
if the server rejects the write request with a reason. - error Returns
FAILURE
if the server returns an error.
Request
Name | Type |
---|---|
handle |
Handle
|
value |
vector<uint8>[512]
|
options |
WriteOptions
|
Response
Name | Type |
---|---|
payload |
RemoteService_WriteCharacteristic_Result
|
WriteDescriptor
Writes value
to the characteristic descriptor with handle
.
It is not recommended to send additional writes while a write is already
in progress (the server may receive simultaneous writes in any order).
- request
handle
The descriptor handle to written to. - request
value
The value to be written. - request
options
Options that apply to the write.
- response An empty response will be sent when a success response is
received from the server (or immediately if
options.with_response
is false)
- error Returns
INVALID_HANDLE
ifhandle
is invalid or refers to an internally reserved descriptor type (e.g. the Client Characteristic Configuration descriptor). - error Returns
INVALID_PARAMETERS
ifoptions
is invalid. - error Returns
WRITE_NOT_PERMITTED
orINSUFFICIENT_*
if the server rejects the write with a reason. - error Returns
FAILURE
if the server returns an error.
Request
Name | Type |
---|---|
handle |
Handle
|
value |
vector<uint8>[512]
|
options |
WriteOptions
|
Response
Name | Type |
---|---|
payload |
RemoteService_WriteDescriptor_Result
|
Server
Defined in fuchsia.bluetooth.gatt2/server.fidl
PublishService
Publishes the given service
so that it is available to all remote peers. Upon publication,
the service is defined to have INITIAL_VALUE_CHANGED_CREDITS credits available for sending
indications/notifications.
The caller must assign distinct handles to the characteristics and descriptors listed in
info
. These identifiers will be used in requests sent to service
.
- request
info
Defines the structure of the GATT service. Includes characteristics and descriptors that will be made available to peers, as well as the service handle, which is required to be unique across all services published to this Server. - request
service
Provides the implementation of the service per the documented behavior of aLocalService
.
- response An empty response indicates the service was successfully published.
- error See
gatt2.PublishServiceError
for possible failure modes.
Request
Name | Type |
---|---|
info |
ServiceInfo
|
service |
LocalService
|
Response
Name | Type |
---|---|
payload |
Server_PublishService_Result
|
STRUCTS
Handle
Defined in fuchsia.bluetooth.gatt2/types.fidl
Field | Type | Description | Default |
---|---|---|---|
value |
uint64
|
No default |
LocalService_ReadValue_Response
Defined in fuchsia.bluetooth.gatt2/server.fidl
Field | Type | Description | Default |
---|---|---|---|
value |
vector<uint8>[512]
|
No default |
LocalService_WriteValue_Response
Defined in fuchsia.bluetooth.gatt2/server.fidl
<EMPTY>
RemoteService_ReadByType_Response
Defined in fuchsia.bluetooth.gatt2/client.fidl
Field | Type | Description | Default |
---|---|---|---|
results |
vector<ReadByTypeResult>[65535]
|
No default |
RemoteService_ReadCharacteristic_Response
Defined in fuchsia.bluetooth.gatt2/client.fidl
Field | Type | Description | Default |
---|---|---|---|
value |
ReadValue
|
No default |
RemoteService_ReadDescriptor_Response
Defined in fuchsia.bluetooth.gatt2/client.fidl
Field | Type | Description | Default |
---|---|---|---|
value |
ReadValue
|
No default |
RemoteService_RegisterCharacteristicNotifier_Response
Defined in fuchsia.bluetooth.gatt2/client.fidl
<EMPTY>
RemoteService_WriteCharacteristic_Response
Defined in fuchsia.bluetooth.gatt2/client.fidl
<EMPTY>
RemoteService_WriteDescriptor_Response
Defined in fuchsia.bluetooth.gatt2/client.fidl
<EMPTY>
Server_PublishService_Response
Defined in fuchsia.bluetooth.gatt2/server.fidl
<EMPTY>
ServiceHandle
Defined in fuchsia.bluetooth.gatt2/types.fidl
Field | Type | Description | Default |
---|---|---|---|
value |
uint64
|
No default |
ShortReadOptions
Defined in fuchsia.bluetooth.gatt2/types.fidl
Represents the options for reading a short characteristic or descriptor value from a server. Short values are those that fit in a single message, which is at least 22 bytes. This is an empty placeholder for now, as there are no options.
<EMPTY>
ENUMS
Error strict
Type: uint32
Defined in fuchsia.bluetooth.gatt2/types.fidl
Errors that are returned by bluetooth.gatt2.* methods.
The values correspond with those in Bluetooth 5.2 Vol. 3 Part G Table 3.4, and Supplement to the Bluetooth Core Specification v9 Part B Table 1.1, but this is for ease of reference only. Clients should not rely on these values remaining constant. Omitted values from the spec are handled internally and will not be returned to clients.
Only certain errors can be returned by LocalService methods. Those are noted in comments.
Name | Value | Description |
---|---|---|
INVALID_HANDLE |
1 |
The attribute indicated by the handle is invalid. It may have been removed. This may be returned by a LocalService method. |
READ_NOT_PERMITTED |
2 |
This attribute is not readable. |
WRITE_NOT_PERMITTED |
3 |
This attribute is not writable. |
INVALID_PDU |
4 |
Indicates that the response received from the server was invalid. |
INSUFFICIENT_AUTHENTICATION |
5 |
This attribute requires authentication, but the client is not authenticated. |
INVALID_OFFSET |
7 |
Indicates that the offset used in a read or write request exceeds the bounds of the value. This may be returned by a LocalService method. |
INSUFFICIENT_AUTHORIZATION |
8 |
This attribute requires authorization, but the client is not authorized. |
INSUFFICIENT_ENCRYPTION_KEY_SIZE |
12 |
This attribute requires a connection encrypted by a larger encryption key. |
INVALID_ATTRIBUTE_VALUE_LENGTH |
13 |
Indicates that the value given in a write request would exceed the maximum length allowed for the destionation characteristic or descriptor. This may be returned by a LocalService method. |
UNLIKELY_ERROR |
14 |
A general error occurred that can not be classified as one of the more specific errors. This may be returned by a LocalService method. |
INSUFFICIENT_ENCRYPTION |
15 |
This attribute requires encryption, but the connection is not encrypted. |
INSUFFICIENT_RESOURCES |
17 |
The server had insufficient resources to complete the task. This may be returned by a LocalService method. |
VALUE_NOT_ALLOWED |
19 |
The value was not allowed. This may be returned by a LocalService method. |
APPLICATION_ERROR_80 |
128 |
Application Errors. The uses of these are specified at the application level. These may all be returned by a LocalService method. |
APPLICATION_ERROR_81 |
129 |
|
APPLICATION_ERROR_82 |
130 |
|
APPLICATION_ERROR_83 |
131 |
|
APPLICATION_ERROR_84 |
132 |
|
APPLICATION_ERROR_85 |
133 |
|
APPLICATION_ERROR_86 |
134 |
|
APPLICATION_ERROR_87 |
135 |
|
APPLICATION_ERROR_88 |
136 |
|
APPLICATION_ERROR_89 |
137 |
|
APPLICATION_ERROR_8A |
138 |
|
APPLICATION_ERROR_8B |
139 |
|
APPLICATION_ERROR_8C |
140 |
|
APPLICATION_ERROR_8D |
141 |
|
APPLICATION_ERROR_8E |
142 |
|
APPLICATION_ERROR_8F |
143 |
|
APPLICATION_ERROR_90 |
144 |
|
APPLICATION_ERROR_91 |
145 |
|
APPLICATION_ERROR_92 |
146 |
|
APPLICATION_ERROR_93 |
147 |
|
APPLICATION_ERROR_94 |
148 |
|
APPLICATION_ERROR_95 |
149 |
|
APPLICATION_ERROR_96 |
150 |
|
APPLICATION_ERROR_97 |
151 |
|
APPLICATION_ERROR_98 |
152 |
|
APPLICATION_ERROR_99 |
153 |
|
APPLICATION_ERROR_9A |
154 |
|
APPLICATION_ERROR_9B |
155 |
|
APPLICATION_ERROR_9C |
156 |
|
APPLICATION_ERROR_9D |
157 |
|
APPLICATION_ERROR_9E |
158 |
|
APPLICATION_ERROR_9F |
159 |
|
WRITE_REQUEST_REJECTED |
252 |
Write request was rejected at the profile or service level. |
CCC_DESCRIPTOR_IMPROPERLY_CONFIGURED |
253 |
The Client Characteristic Configuration Descriptor was improperly configured. |
PROCEDURE_ALREADY_IN_PROGRESS |
254 |
Profile or service procedure already in progress. |
OUT_OF_RANGE |
255 |
A value was out of range at the profile or service level. |
INVALID_PARAMETERS |
257 |
One or more of the FIDL call parameters are invalid. See the parameter documentation. |
TOO_MANY_RESULTS |
258 |
Indicates that more results were read than can fit in a FIDL response. Consider reading attributes individually. |
PublishServiceError flexible
Type: uint32
Defined in fuchsia.bluetooth.gatt2/types.fidl
Errors that can occur during service publication.
Name | Value | Description |
---|---|---|
INVALID_SERVICE_HANDLE |
1 |
The service handle is invalid or already in use on the Server publishing the service. |
INVALID_UUID |
2 |
Invalid service UUID provided. |
INVALID_CHARACTERISTICS |
3 |
The |
UNLIKELY_ERROR |
4 |
A general error occurred that can not be classified as one of the more specific errors. |
ServiceKind strict
Type: uint32
Defined in fuchsia.bluetooth.gatt2/types.fidl
The kind ("type") of a GATT Service as outlined in Bluetooth Core Spec v5.3 Vol. 1 Part A 6.5.1.
Name | Value | Description |
---|---|---|
PRIMARY |
1 |
A "service that provides functionality of a device that can be used on its own" (Ibid) |
SECONDARY |
2 |
A "service that provides additional functionality [...] in association with a primary service and is included from at least one primary service" (Ibid) |
WriteMode flexible
Type: uint32
Defined in fuchsia.bluetooth.gatt2/types.fidl
Represents the supported write modes for writing characteristics & descriptors to the server.
Name | Value | Description |
---|---|---|
DEFAULT |
1 |
In |
RELIABLE |
2 |
In |
WITHOUT_RESPONSE |
3 |
In |
TABLES
AttributePermissions
Defined in fuchsia.bluetooth.gatt2/types.fidl
Specifies the access permissions for a specific attribute value.
Ordinal | Field | Type | Description |
---|---|---|---|
1 |
read |
SecurityRequirements
|
Specifies whether an attribute has the read permission. If not present, the attribute value cannot be read. Otherwise, it can be read only if the permissions specified in the SecurityRequirements table are satisfied. |
2 |
write |
SecurityRequirements
|
Specifies whether an attribute has the write permission. If not present, the attribute value cannot be written. Otherwise, it can be written only if the permissions specified in the SecurityRequirements table are satisfied. |
3 |
update |
SecurityRequirements
|
Specifies the security requirements for a client to subscribe to notifications or indications on a characteristic. A characteristic's support for notifications or indiciations is specified using the NOTIFY and INDICATE characteristic properties. If a local characteristic has one of these properties then this field must be present. Otherwise, this field must not be present. This field is ignored for Descriptors. |
Characteristic
Defined in fuchsia.bluetooth.gatt2/types.fidl
Represents a local or remote GATT characteristic.
Ordinal | Field | Type | Description |
---|---|---|---|
1 |
handle |
Handle
|
Uniquely identifies this characteristic within a service. For local characteristics, the specified handle must be unique across all characteristic and descriptor handles in this service. Always present. For local characteristics, this value is mandatory. |
2 |
type |
fuchsia.bluetooth/Uuid
|
The UUID that identifies the type of this characteristic. Always present. Mandatory for local characteristics. |
3 |
properties |
CharacteristicPropertyBits
|
The characteristic properties bitfield. Always present. Mandatory for local characteristics. |
4 |
permissions |
AttributePermissions
|
The attribute permissions of this characteristic. For remote characteristics, this value will not be present until the permissions are discovered via read and write requests. For local characteristics, this value is mandatory. |
5 |
descriptors |
vector<Descriptor>[65532]
|
The descriptors of this characteristic. Present only if non-empty. Optional for local characteristics. |
Descriptor
Defined in fuchsia.bluetooth.gatt2/types.fidl
Represents a local or remote GATT characteristic descriptor.
Ordinal | Field | Type | Description |
---|---|---|---|
1 |
handle |
Handle
|
Uniquely identifies this descriptor within a service. For local descriptors, the specified handle must be unique across all characteristic and descriptor handles in this service. Always present. For local descriptors, this value is mandatory. |
2 |
type |
fuchsia.bluetooth/Uuid
|
The UUID that identifies the type of this descriptor. Always present. For local descriptors, this value is mandatory. |
3 |
permissions |
AttributePermissions
|
The attribute permissions of this descriptor. For remote descriptors, this value will not be present until the permissions are discovered via read and write requests. For local descriptors, this value is mandatory. |
LocalServicePeerUpdateRequest
Defined in fuchsia.bluetooth.gatt2/server.fidl
Ordinal | Field | Type | Description |
---|---|---|---|
1 |
peer_id |
fuchsia.bluetooth/PeerId
|
|
2 |
mtu |
uint16
|
LocalServiceWriteValueRequest
Defined in fuchsia.bluetooth.gatt2/server.fidl
Ordinal | Field | Type | Description |
---|---|---|---|
1 |
peer_id |
fuchsia.bluetooth/PeerId
|
|
2 |
handle |
Handle
|
|
3 |
offset |
uint32
|
|
4 |
value |
vector<uint8>[512]
|
LongReadOptions
Defined in fuchsia.bluetooth.gatt2/types.fidl
Represents the supported options to read a long characteristic or descriptor value from a server. Long values are those that may not fit in a single message (longer than 22 bytes).
Ordinal | Field | Type | Description |
---|---|---|---|
1 |
offset |
uint16
|
The byte to start the read at. Must be less than the length of the value. Optional. Default: 0 |
2 |
max_bytes |
uint16
|
The maximum number of bytes to read.
Optional.
Default: |
ReadByTypeResult
Defined in fuchsia.bluetooth.gatt2/client.fidl
A result returned by RemoteService.ReadByType
.
Ordinal | Field | Type | Description |
---|---|---|---|
1 |
handle |
Handle
|
Characteristic or descriptor handle. |
2 |
value |
ReadValue
|
The value of the characteristic or descriptor, if it was read successfully. |
3 |
error |
Error
|
Reason the value could not be read, if reading it resulted in an error. |
ReadValue
Defined in fuchsia.bluetooth.gatt2/client.fidl
Wrapper around a possible truncated value received from the server.
Ordinal | Field | Type | Description |
---|---|---|---|
1 |
handle |
Handle
|
Characteristic or descriptor handle. Always present. |
2 |
value |
vector<uint8>[512]
|
The value of the characteristic or descriptor. Always present. |
3 |
maybe_truncated |
bool
|
True if |
SecurityRequirements
Defined in fuchsia.bluetooth.gatt2/types.fidl
Represents encryption, authentication, and authorization permissions that can be assigned to a specific access permission.
Ordinal | Field | Type | Description |
---|---|---|---|
1 |
encryption_required |
bool
|
If true, the physical link must be encrypted to access this attribute. If not present or false, this attribute permits unencrypted access. |
2 |
authentication_required |
bool
|
If true, the physical link must be authenticated to access this attribute. If not present or false, this attribute permits unauthenticated access. |
3 |
authorization_required |
bool
|
If true, the client needs to be authorized to access this attribute. If not present or false, this attribute permits access without authorization. |
ServiceInfo
Defined in fuchsia.bluetooth.gatt2/types.fidl
Represents a local or remote GATT service.
Ordinal | Field | Type | Description |
---|---|---|---|
1 |
handle |
ServiceHandle
|
Unique identifier for this GATT service.
Always present if this represents a remote service, in which case this is unique across the
Client that returned this ServiceInfo.
Required for local services, in which case this must be unique across all services published
to a single Server instance. Can be used in the |
2 |
kind |
ServiceKind
|
Indicates whether this is a primary or secondary service. Always present for remote services. Optional for local services Default: ServiceKind::PRIMARY |
3 |
type |
fuchsia.bluetooth/Uuid
|
The UUID that identifies the type of this service. There may be multiple services with the same UUID. Always present for remote services. Required for local services. |
4 |
characteristics |
vector<Characteristic>[32767]
|
The characteristics of this service. Required for local services. Never present for remote services. |
5 |
includes |
vector<ServiceHandle>[65535]
|
Handles of other services that are included by this service. Optional for local services. Never present for remote services. TODO(https://fxbug.dev/42147529): This is not currently supported for local services. |
ValueChangedParameters
Defined in fuchsia.bluetooth.gatt2/server.fidl
The parameters used to signal a characteristic value change from a LocalService to a peer.
Ordinal | Field | Type | Description |
---|---|---|---|
1 |
handle |
Handle
|
The handle of the characteristic value being signalled. Mandatory. |
2 |
value |
vector<uint8>[512]
|
The updated value of the characteristic.
Note for clients using indications/notifications for high-throughput (not recommended):
While statically constrained to |
3 |
peer_ids |
vector<fuchsia.bluetooth/PeerId>
|
Only signal a subset of peers.
If not present or empty, all peers that can be updated are signaled.
If included, only the set of peers in this list will be signaled.
Peers are only signaled if they have configured updates or notifications per |
WriteOptions
Defined in fuchsia.bluetooth.gatt2/types.fidl
Represents the supported options to write a characteristic/descriptor value to a server.
Ordinal | Field | Type | Description |
---|---|---|---|
1 |
write_mode |
WriteMode
|
The mode of the write operation. For descriptors, only WriteMode.DEFAULT is supported Optional. Default: WriteMode.DEFAULT |
2 |
offset |
uint16
|
Request a write starting at the byte indicated.
Must be missing or 0 if |
UNIONS
LocalService_ReadValue_Result strict
Defined in fuchsia.bluetooth.gatt2/server.fidl
Ordinal | Variant | Type | Description |
---|---|---|---|
1 |
response |
LocalService_ReadValue_Response
|
|
2 |
err |
Error
|
LocalService_WriteValue_Result strict
Defined in fuchsia.bluetooth.gatt2/server.fidl
Ordinal | Variant | Type | Description |
---|---|---|---|
1 |
response |
LocalService_WriteValue_Response
|
|
2 |
err |
Error
|
ReadOptions flexible
Defined in fuchsia.bluetooth.gatt2/types.fidl
Represents the supported options to read a characteristic or descriptor value from a server.
Ordinal | Variant | Type | Description |
---|---|---|---|
1 |
short_read |
ShortReadOptions
|
Perform a short read, which may be truncated (as indicated by the maybe_truncated in the result) Most reads in GATT services are short reads (<= 22 bytes). |
2 |
long_read |
LongReadOptions
|
If present, perform a long read using the indicated options. Optional. Default: A short read will be performed. |
RemoteService_ReadByType_Result strict
Defined in fuchsia.bluetooth.gatt2/client.fidl
Ordinal | Variant | Type | Description |
---|---|---|---|
1 |
response |
RemoteService_ReadByType_Response
|
|
2 |
err |
Error
|
RemoteService_ReadCharacteristic_Result strict
Defined in fuchsia.bluetooth.gatt2/client.fidl
Ordinal | Variant | Type | Description |
---|---|---|---|
1 |
response |
RemoteService_ReadCharacteristic_Response
|
|
2 |
err |
Error
|
RemoteService_ReadDescriptor_Result strict
Defined in fuchsia.bluetooth.gatt2/client.fidl
Ordinal | Variant | Type | Description |
---|---|---|---|
1 |
response |
RemoteService_ReadDescriptor_Response
|
|
2 |
err |
Error
|
RemoteService_RegisterCharacteristicNotifier_Result strict
Defined in fuchsia.bluetooth.gatt2/client.fidl
Ordinal | Variant | Type | Description |
---|---|---|---|
1 |
response |
RemoteService_RegisterCharacteristicNotifier_Response
|
|
2 |
err |
Error
|
RemoteService_WriteCharacteristic_Result strict
Defined in fuchsia.bluetooth.gatt2/client.fidl
Ordinal | Variant | Type | Description |
---|---|---|---|
1 |
response |
RemoteService_WriteCharacteristic_Response
|
|
2 |
err |
Error
|
RemoteService_WriteDescriptor_Result strict
Defined in fuchsia.bluetooth.gatt2/client.fidl
Ordinal | Variant | Type | Description |
---|---|---|---|
1 |
response |
RemoteService_WriteDescriptor_Response
|
|
2 |
err |
Error
|
Server_PublishService_Result strict
Defined in fuchsia.bluetooth.gatt2/server.fidl
Ordinal | Variant | Type | Description |
---|---|---|---|
1 |
response |
Server_PublishService_Response
|
|
2 |
err |
PublishServiceError
|
BITS
CharacteristicPropertyBits strict
Type: uint16
Defined in fuchsia.bluetooth.gatt2/types.fidl
Possible values for the characteristic properties bitfield. These specify the GATT procedures that are allowed for a particular characteristic.
Name | Value | Description |
---|---|---|
BROADCAST |
1 | |
READ |
2 | |
WRITE_WITHOUT_RESPONSE |
4 | |
WRITE |
8 | |
NOTIFY |
16 | |
INDICATE |
32 | |
AUTHENTICATED_SIGNED_WRITES |
64 | |
RELIABLE_WRITE |
256 | |
WRITABLE_AUXILIARIES |
512 |
CONSTANTS
Name | Value | Type | Description |
---|---|---|---|
INITIAL_VALUE_CHANGED_CREDITS |
10
|
uint32 |
The amount of credits defined to be available for sending indications/notifications when a LocalService is first published. |
MAX_ATTRIBUTE_COUNT |
65535
|
uint16 |
|
MAX_CHARACTERISTIC_COUNT |
32767
|
uint16 |
|
MAX_DESCRIPTOR_COUNT |
65532
|
uint16 |
|
MAX_SERVICE_COUNT |
MAX_ATTRIBUTE_COUNT
|
uint16 |
|
MAX_VALUE_LENGTH |
512
|
uint16 |