fuchsia.bluetooth.gatt2

Added: HEAD

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

NameType
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 if handle 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

NameType
handle ServiceHandle
service request<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 the characteristics and includes fields will be null. If a service has been added/modified and then removed since the last call, it will only be present in removed, not updated.
  • response removed the handles of the services that have been removed since the last call to WatchServices().

Request

NameType
uuids vector<fuchsia.bluetooth/Uuid>

Response

NameType
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 the notify and indicate 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

NameType
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, 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 in update.peer_ids.

Response

NameType
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, the protocol will be closed.

Response

NameType
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.

  • 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

NameType
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

NameType
peer_id fuchsia.bluetooth/PeerId
handle Handle
offset int32

Response

NameType
result 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

NameType
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 to value. 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

NameType
payload LocalServiceWriteValueRequest

Response

NameType
result 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

NameType
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 if uuid 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

NameType
uuid fuchsia.bluetooth/Uuid

Response

NameType
result 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 if handle is invalid.
  • error Returns INVALID_PARAMETERS if options is invalid.
  • error Returns READ_NOT_PERMITTED or INSUFFICIENT_* if the server rejects the read request.
  • error Returns FAILURE if the server returns an error.

Request

NameType
handle Handle
options ReadOptions

Response

NameType
result 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 if handle is invalid.
  • error Returns INVALID_PARAMETERS if options is invalid.
  • error Returns READ_NOT_PERMITTED or INSUFFICIENT_* if the server rejects the read request.
  • error Returns FAILURE if the server returns an error.

Request

NameType
handle Handle
options ReadOptions

Response

NameType
result 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 if handle is invalid.
  • error Returns a WRITE_NOT_PERMITTED or INSUFFICIENT_*for a descriptor write error.

Request

NameType
handle Handle
notifier CharacteristicNotifier

Response

NameType
result 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 if handle is invalid.
  • error Returns INVALID_PARAMETERS if options is invalid.
  • error Returns WRITE_NOT_PERMITTED or INSUFFICIENT_*if the server rejects the write request with a reason.
  • error Returns FAILURE if the server returns an error.

Request

NameType
handle Handle
value vector<uint8>[512]
options WriteOptions

Response

NameType
result 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 if handle is invalid or refers to an internally reserved descriptor type (e.g. the Client Characteristic Configuration descriptor).
  • error Returns INVALID_PARAMETERS if options is invalid.
  • error Returns WRITE_NOT_PERMITTED or INSUFFICIENT_* if the server rejects the write with a reason.
  • error Returns FAILURE if the server returns an error.

Request

NameType
handle Handle
value vector<uint8>[512]
options WriteOptions

Response

NameType
result 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 a LocalService.
  • response An empty response indicates the service was successfully published.
  • error See gatt2.PublishServiceError for possible failure modes.

Request

NameType
info ServiceInfo
service LocalService

Response

NameType
result Server_PublishService_Result

STRUCTS

Handle

Defined in fuchsia.bluetooth.gatt2/types.fidl

FieldTypeDescriptionDefault
value uint64 No default

LocalService_ReadValue_Response

Defined in fuchsia.bluetooth.gatt2/server.fidl

FieldTypeDescriptionDefault
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

FieldTypeDescriptionDefault
results vector<ReadByTypeResult>[65535] No default

RemoteService_ReadCharacteristic_Response

Defined in fuchsia.bluetooth.gatt2/client.fidl

FieldTypeDescriptionDefault
value ReadValue No default

RemoteService_ReadDescriptor_Response

Defined in fuchsia.bluetooth.gatt2/client.fidl

FieldTypeDescriptionDefault
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

FieldTypeDescriptionDefault
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.

NameValueDescription
1

The attribute indicated by the handle is invalid. It may have been removed.

This may be returned by a LocalService method.

2

This attribute is not readable.

3

This attribute is not writable.

4

Indicates that the response received from the server was invalid.

5

This attribute requires authentication, but the client is not authenticated.

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.

8

This attribute requires authorization, but the client is not authorized.

12

This attribute requires a connection encrypted by a larger encryption key.

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.

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.

15

This attribute requires encryption, but the connection is not encrypted.

17

The server had insufficient resources to complete the task.

This may be returned by a LocalService method.

19

The value was not allowed.

This may be returned by a LocalService method.

128

Application Errors. The uses of these are specified at the application level.

These may all be returned by a LocalService method.

129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
252

Write request was rejected at the profile or service level.

253

The Client Characteristic Configuration Descriptor was improperly configured.

254

Profile or service procedure already in progress.

255

A value was out of range at the profile or service level.

257

One or more of the FIDL call parameters are invalid. See the parameter documentation.

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.

NameValueDescription
1

The provided LocalService client_end was not a valid instance of the protocol.

2

The service handle is invalid or already in use on the Server publishing the service.

3

Invalid service UUID provided.

4

The ServiceInfo.characteristics field was formatted invalidly or missing. If the service is meant to be empty, the vector should be empty, but present.

5

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.

NameValueDescription
1

A "service that provides functionality of a device that can be used on its own" (Ibid)

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.

NameValueDescription
1

In DEFAULT mode, wait for a response from the server before returning and do not verify the echo response. Supported for both characteristics and descriptors.

2

In RELIABLE mode, every value blob is verified against an echo response from the server. The procedure is aborted if a value blob has not been reliably delivered to the peer. Only supported for characteristics.

3

In WITHOUT_RESPONSE mode, delivery will not be confirmed before returning. Writing without a response is only supported for short characteristics with the WRITE_WITHOUT_RESPONSE property. The value must fit into a single message. It is guaranteed that at least 20 bytes will fit into a single message. If the value does not fit, a FAILURE error will be produced. The value will be written at offset 0. Only supported for characteristics.

TABLES

AttributePermissions

Defined in fuchsia.bluetooth.gatt2/types.fidl

Specifies the access permissions for a specific attribute value.

OrdinalFieldTypeDescription
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.

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.

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.

OrdinalFieldTypeDescription
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.

type fuchsia.bluetooth/Uuid

The UUID that identifies the type of this characteristic. Always present. Mandatory for local characteristics.

properties uint32

The characteristic properties bitfield. See CharacteristicPropertyBits above for possible values. Always present. Mandatory for local characteristics.

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.

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.

OrdinalFieldTypeDescription
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.

type fuchsia.bluetooth/Uuid

The UUID that identifies the type of this descriptor. Always present. For local descriptors, this value is mandatory.

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

OrdinalFieldTypeDescription
peer_id fuchsia.bluetooth/PeerId
mtu uint16

LocalServiceWriteValueRequest

Defined in fuchsia.bluetooth.gatt2/server.fidl

OrdinalFieldTypeDescription
peer_id fuchsia.bluetooth/PeerId
handle Handle
offset uint32
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).

OrdinalFieldTypeDescription
offset uint16

The byte to start the read at. Must be less than the length of the value. Optional. Default: 0

max_bytes uint16

The maximum number of bytes to read. Optional. Default: MAX_VALUE_LENGTH

ReadByTypeResult

Defined in fuchsia.bluetooth.gatt2/client.fidl

A result returned by RemoteService.ReadByType.

OrdinalFieldTypeDescription
handle Handle

Characteristic or descriptor handle.

value ReadValue

The value of the characteristic or descriptor, if it was read successfully.

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.

OrdinalFieldTypeDescription
handle Handle

Characteristic or descriptor handle. Always present.

value vector<uint8>[512]

The value of the characteristic or descriptor. Always present.

maybe_truncated bool

True if value might be truncated (the buffer was completely filled by the server). ReadCharacteristic or ReadDescriptor should be used to read the complete value. Always present.

SecurityRequirements

Defined in fuchsia.bluetooth.gatt2/types.fidl

Represents encryption, authentication, and authorization permissions that can be assigned to a specific access permission.

OrdinalFieldTypeDescription
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.

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.

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.

OrdinalFieldTypeDescription
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 ServiceInfo.includes of other PublishService calls to the Server where this service is published.

kind ServiceKind

Indicates whether this is a primary or secondary service. Always present for remote services. Optional for local services Default: ServiceKind::PRIMARY

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.

characteristics vector<Characteristic>[32767]

The characteristics of this service. Required for local services. Never present for remote services.

includes vector<ServiceHandle>[65535]

Handles of other services that are included by this service. Optional for local services. Never present for remote services. TODO(fxbug.dev/685): 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.

OrdinalFieldTypeDescription
handle Handle

The handle of the characteristic value being signalled. Mandatory.

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 MAX_VALUE_LENGTH, the real limit depends on the specific peer's configuration as notified by LocalService.PeerUpdate. Any bytes exceeding that limit are truncated internally by the stack. Mandatory.

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 LocalService. CharacteristicConfiguration; other peers in peer_ids will be ignored.

WriteOptions

Defined in fuchsia.bluetooth.gatt2/types.fidl

Represents the supported options to write a characteristic/descriptor value to a server.

OrdinalFieldTypeDescription
write_mode WriteMode

The mode of the write operation. For descriptors, only WriteMode.DEFAULT is supported Optional. Default: WriteMode.DEFAULT

offset uint16

Request a write starting at the byte indicated. Must be missing or 0 if write_mode is WriteMode.WITHOUT_RESPONSE. Optional. Default: 0

UNIONS

LocalService_ReadValue_Result strict

Defined in fuchsia.bluetooth.gatt2/server.fidl

OrdinalVariantTypeDescription
response LocalService_ReadValue_Response
err Error

LocalService_WriteValue_Result strict

Defined in fuchsia.bluetooth.gatt2/server.fidl

OrdinalVariantTypeDescription
response LocalService_WriteValue_Response
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.

OrdinalVariantTypeDescription
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).

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

OrdinalVariantTypeDescription
response RemoteService_ReadByType_Response
err Error

RemoteService_ReadCharacteristic_Result strict

Defined in fuchsia.bluetooth.gatt2/client.fidl

OrdinalVariantTypeDescription
response RemoteService_ReadCharacteristic_Response
err Error

RemoteService_ReadDescriptor_Result strict

Defined in fuchsia.bluetooth.gatt2/client.fidl

OrdinalVariantTypeDescription
response RemoteService_ReadDescriptor_Response
err Error

RemoteService_RegisterCharacteristicNotifier_Result strict

Defined in fuchsia.bluetooth.gatt2/client.fidl

OrdinalVariantTypeDescription
response RemoteService_RegisterCharacteristicNotifier_Response
err Error

RemoteService_WriteCharacteristic_Result strict

Defined in fuchsia.bluetooth.gatt2/client.fidl

OrdinalVariantTypeDescription
response RemoteService_WriteCharacteristic_Response
err Error

RemoteService_WriteDescriptor_Result strict

Defined in fuchsia.bluetooth.gatt2/client.fidl

OrdinalVariantTypeDescription
response RemoteService_WriteDescriptor_Response
err Error

Server_PublishService_Result strict

Defined in fuchsia.bluetooth.gatt2/server.fidl

OrdinalVariantTypeDescription
response Server_PublishService_Response
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.

NameValueDescription
1
2
4
8
16
32
64
256
512

CONSTANTS

NameValueTypeDescription
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