fuchsia.bluetooth.gatt2

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

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.

If any of the peers in update.peer_ids fails to confirm the indication within the ATT transaction timeout (30 seconds per Bluetooth 5.2 Vol. 4 Part G 3.3.3), the link between the peer and the local adapter will be closed.

  • request update The parameters associated with the changed characteristic.
  • request confirmation When all the peers listed in update.peer_ids have confirmed the indication, confirmation is signalled with ZX_USER_SIGNAL_0. If the implementation wishes to receive indication confirmations on a per-peer basis, they should send this event with a single PeerId 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
update ValueChangedParameters

OnSupressDiscovery

After this event, new peers will no longer be able to discover the service, although open connections to existing peer GATT clients will not be closed. This should be sent once per service lifetime; sending more than once will close the protocol.

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 and notifications. Implementors must keep track of the available credit they have. For each credit the implementor can send exactly one OnNotifyValue or OnIndicateValue event.

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 params The parameters of the write.
  • 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
params WriteValueParameters

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.

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, including characteristics and descriptors that will be made available to peers.
  • request service Provides the implementation of the service per the documented behavior of a LocalService.
  • response empty Returns nothing upon successful service publication.
  • 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>

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

NameValueDescription
INVALID_LOCAL_SERVICE 1

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

INVALID_UUID 2

Invalid service UUID provided.

WriteMode flexible

Type: uint32

Defined in fuchsia.bluetooth.gatt2/types.fidl

Represents the supported write modes for writing characteristics & descriptors to the server.

NameValueDescription
DEFAULT 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.

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

WITHOUT_RESPONSE 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
1 read SecurityRequirements

Specifies whether or not an attribute has the read permission. If null, then 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 or not an attribute has the write permission. If null, then the attribute value cannot be written. Otherwise, it 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 can not be null. Otherwise, this field must be left as null.

This field is ignored for Descriptors.

Characteristic

Defined in fuchsia.bluetooth.gatt2/types.fidl

Represents a local or remote GATT characteristic.

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

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

4 permissions AttributePermissions

The attribute permissions of this characteristic. For remote characteristics, this value will be null 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.

OrdinalFieldTypeDescription
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 be null until the permissions are discovered via read and write requests.

For local descriptors, this value is mandatory.

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
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: MAX_VALUE_LENGTH

ReadByTypeResult

Defined in fuchsia.bluetooth.gatt2/client.fidl

A result returned by RemoteService.ReadByType.

OrdinalFieldTypeDescription
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 recieved from the server.

OrdinalFieldTypeDescription
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 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
1 encryption_required bool

If true, the physical link must be encrypted to access this attribute.

2 authentication_required bool

If true, the physical link must be authenticated to access this attribute.

3 authorization_required bool

If true, the client needs to be authorized before accessing this attribute.

ServiceInfo

Defined in fuchsia.bluetooth.gatt2/types.fidl

Represents a local or remote GATT service.

OrdinalFieldTypeDescription
1 handle Handle

Uniquely identifies this GATT service. Always present if this represents a remote service. Ignored if present for local services.

2 primary bool

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

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<Handle>[65535]

Handles of other services that are included by this service. Optional for local services. Never present for remote 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
1 peer_ids vector<fuchsia.bluetooth/PeerId>

The PeerIds of the peers to signal. The LocalService should respect the Characteristic Configuration associated with a peer+handle when deciding whether to signal it. If empty/not present, all peers are signalled.

2 handle Handle

The handle of the characteristic value being signalled. Mandatory.

3 value vector<uint8>[512]

The updated value of the characteristic. Mandatory.

WriteOptions

Defined in fuchsia.bluetooth.gatt2/types.fidl

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

OrdinalFieldTypeDescription
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 write_mode is WriteMode.WITHOUT_RESPONSE. Optional. Default: 0

WriteValueParameters

Defined in fuchsia.bluetooth.gatt2/server.fidl

Parameters for the LocalService.WriteValue method

OrdinalFieldTypeDescription
1 peer_id fuchsia.bluetooth/PeerId

The PeerId of the GATT client making the write request. Always present.

2 handle Handle

The handle of the requested descriptor/characteristic. Always present.

3 offset uint32

The offset at which to start writing the requested value. If the offset is 0, any existing value should be overwritten by the new value. Otherwise, the existing value between offset:(offset + len(value)) should be changed to value. Always present.

4 value vector<uint8>[512]

The new value for the descriptor/characteristic. Always present. May be the empty string.

UNIONS

LocalService_ReadValue_Result strict

Defined in fuchsia.bluetooth.gatt2/server.fidl

Ordinal
VariantTypeDescription
1 response LocalService_ReadValue_Response
2 err Error

LocalService_WriteValue_Result strict

Defined in fuchsia.bluetooth.gatt2/server.fidl

Ordinal
VariantTypeDescription
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
VariantTypeDescription
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
VariantTypeDescription
1 response RemoteService_ReadByType_Response
2 err Error

RemoteService_ReadCharacteristic_Result strict

Defined in fuchsia.bluetooth.gatt2/client.fidl

Ordinal
VariantTypeDescription
1 response RemoteService_ReadCharacteristic_Response
2 err Error

RemoteService_ReadDescriptor_Result strict

Defined in fuchsia.bluetooth.gatt2/client.fidl

Ordinal
VariantTypeDescription
1 response RemoteService_ReadDescriptor_Response
2 err Error

RemoteService_RegisterCharacteristicNotifier_Result strict

Defined in fuchsia.bluetooth.gatt2/client.fidl

Ordinal
VariantTypeDescription
1 response RemoteService_RegisterCharacteristicNotifier_Response
2 err Error

RemoteService_WriteCharacteristic_Result strict

Defined in fuchsia.bluetooth.gatt2/client.fidl

Ordinal
VariantTypeDescription
1 response RemoteService_WriteCharacteristic_Response
2 err Error

RemoteService_WriteDescriptor_Result strict

Defined in fuchsia.bluetooth.gatt2/client.fidl

Ordinal
VariantTypeDescription
1 response RemoteService_WriteDescriptor_Response
2 err Error

Server_PublishService_Result strict

Defined in fuchsia.bluetooth.gatt2/server.fidl

Ordinal
VariantTypeDescription
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.

NameValueDescription
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

NameValueTypeDescription
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