<br />

Added: 23

## **PROTOCOLS**

## CharacteristicNotifier

*Defined in [fuchsia.bluetooth.gatt2/client.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.bluetooth.gatt2/client.fidl;l=32)*

Listens to characteristic notifications \& indications.

<br />

### 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` | `https://fuchsia.dev/reference/fidl/fuchsia.bluetooth.gatt2#ReadValue` |

#### Response

\<EMPTY\>

## Client

*Defined in [fuchsia.bluetooth.gatt2/client.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.bluetooth.gatt2/client.fidl;l=188)*

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

| Name | Type |
|---|---|
| `handle` | `https://fuchsia.dev/reference/fidl/fuchsia.bluetooth.gatt2#ServiceHandle` |
| `service` | `server_end:https://fuchsia.dev/reference/fidl/fuchsia.bluetooth.gatt2#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`. If concluded due to a new call with a new `uuids` 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<https://fuchsia.dev/reference/fuchsia.bluetooth//https://fuchsia.dev/reference/fuchsia.bluetooth#Uuid>` |

#### Response

| Name | Type |
|---|---|
| `updated` | `vector<https://fuchsia.dev/reference/fidl/fuchsia.bluetooth.gatt2#ServiceInfo>:65535` |
| `removed` | `vector<https://fuchsia.dev/reference/fidl/fuchsia.bluetooth.gatt2#Handle>:65535` |

## LocalService

*Defined in [fuchsia.bluetooth.gatt2/server.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.bluetooth.gatt2/server.fidl;l=36)*

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.

<br />

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

| Name | Type |
|---|---|
| `peer_id` | `https://fuchsia.dev/reference/fuchsia.bluetooth//https://fuchsia.dev/reference/fuchsia.bluetooth#PeerId` |
| `handle` | `https://fuchsia.dev/reference/fidl/fuchsia.bluetooth.gatt2#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 in `update.peer_ids`.

#### Response

| Name | Type |
|---|---|
| `update` | `https://fuchsia.dev/reference/fidl/fuchsia.bluetooth.gatt2#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` | `https://fuchsia.dev/reference/fidl/fuchsia.bluetooth.gatt2#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` | `https://fuchsia.dev/reference/fidl/fuchsia.bluetooth.gatt2#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` | `https://fuchsia.dev/reference/fuchsia.bluetooth//https://fuchsia.dev/reference/fuchsia.bluetooth#PeerId` |
| `handle` | `https://fuchsia.dev/reference/fidl/fuchsia.bluetooth.gatt2#Handle` |
| `offset` | `int32` |

#### Response

| Name | Type |
|---|---|
| `payload` | `https://fuchsia.dev/reference/fidl/fuchsia.bluetooth.gatt2#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 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

| Name | Type |
|---|---|
| `payload` | `https://fuchsia.dev/reference/fidl/fuchsia.bluetooth.gatt2#LocalServiceWriteValueRequest` |

#### Response

| Name | Type |
|---|---|
| `payload` | `https://fuchsia.dev/reference/fidl/fuchsia.bluetooth.gatt2#LocalService_WriteValue_Result` |

## RemoteService

*Defined in [fuchsia.bluetooth.gatt2/client.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.bluetooth.gatt2/client.fidl;l=44)*

### DiscoverCharacteristics

Returns the characteristics and characteristic descriptors that belong to
this service.

#### Request

\<EMPTY\>

#### Response

| Name | Type |
|---|---|
| `characteristics` | `vector<https://fuchsia.dev/reference/fidl/fuchsia.bluetooth.gatt2#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

| Name | Type |
|---|---|
| `uuid` | `https://fuchsia.dev/reference/fuchsia.bluetooth//https://fuchsia.dev/reference/fuchsia.bluetooth#Uuid` |

#### Response

| Name | Type |
|---|---|
| `payload` | `https://fuchsia.dev/reference/fidl/fuchsia.bluetooth.gatt2#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

| Name | Type |
|---|---|
| `handle` | `https://fuchsia.dev/reference/fidl/fuchsia.bluetooth.gatt2#Handle` |
| `options` | `https://fuchsia.dev/reference/fidl/fuchsia.bluetooth.gatt2#ReadOptions` |

#### Response

| Name | Type |
|---|---|
| `payload` | `https://fuchsia.dev/reference/fidl/fuchsia.bluetooth.gatt2#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

| Name | Type |
|---|---|
| `handle` | `https://fuchsia.dev/reference/fidl/fuchsia.bluetooth.gatt2#Handle` |
| `options` | `https://fuchsia.dev/reference/fidl/fuchsia.bluetooth.gatt2#ReadOptions` |

#### Response

| Name | Type |
|---|---|
| `payload` | `https://fuchsia.dev/reference/fidl/fuchsia.bluetooth.gatt2#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

| Name | Type |
|---|---|
| `handle` | `https://fuchsia.dev/reference/fidl/fuchsia.bluetooth.gatt2#Handle` |
| `notifier` | `client_end:https://fuchsia.dev/reference/fidl/fuchsia.bluetooth.gatt2#CharacteristicNotifier` |

#### Response

| Name | Type |
|---|---|
| `payload` | `https://fuchsia.dev/reference/fidl/fuchsia.bluetooth.gatt2#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

| Name | Type |
|---|---|
| `handle` | `https://fuchsia.dev/reference/fidl/fuchsia.bluetooth.gatt2#Handle` |
| `value` | `vector<uint8>:512` |
| `options` | `https://fuchsia.dev/reference/fidl/fuchsia.bluetooth.gatt2#WriteOptions` |

#### Response

| Name | Type |
|---|---|
| `payload` | `https://fuchsia.dev/reference/fidl/fuchsia.bluetooth.gatt2#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

| Name | Type |
|---|---|
| `handle` | `https://fuchsia.dev/reference/fidl/fuchsia.bluetooth.gatt2#Handle` |
| `value` | `vector<uint8>:512` |
| `options` | `https://fuchsia.dev/reference/fidl/fuchsia.bluetooth.gatt2#WriteOptions` |

#### Response

| Name | Type |
|---|---|
| `payload` | `https://fuchsia.dev/reference/fidl/fuchsia.bluetooth.gatt2#RemoteService_WriteDescriptor_Result` |

## Server

*Defined in [fuchsia.bluetooth.gatt2/server.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.bluetooth.gatt2/server.fidl;l=171)*

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

| Name | Type |
|---|---|
| `info` | `https://fuchsia.dev/reference/fidl/fuchsia.bluetooth.gatt2#ServiceInfo` |
| `service` | `client_end:https://fuchsia.dev/reference/fidl/fuchsia.bluetooth.gatt2#LocalService` |

#### Response

| Name | Type |
|---|---|
| `payload` | `https://fuchsia.dev/reference/fidl/fuchsia.bluetooth.gatt2#Server_PublishService_Result` |

## **STRUCTS**

### Handle

*Defined in [fuchsia.bluetooth.gatt2/types.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.bluetooth.gatt2/types.fidl;l=155)*

| Field | Type | Description | Default |
|---|---|---|---|
| `value` | `uint64` |   | No default |

### LocalService_ReadValue_Response

*Defined in [fuchsia.bluetooth.gatt2/server.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.bluetooth.gatt2/server.fidl;l=70)*

| Field | Type | Description | Default |
|---|---|---|---|
| `value` | `vector<uint8>:512` |   | No default |

### LocalService_WriteValue_Response

*Defined in [fuchsia.bluetooth.gatt2/server.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.bluetooth.gatt2/server.fidl;l=92)*

\<EMPTY\>

### RemoteService_ReadByType_Response

*Defined in [fuchsia.bluetooth.gatt2/client.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.bluetooth.gatt2/client.fidl;l=70)*

| Field | Type | Description | Default |
|---|---|---|---|
| `results` | `vector<https://fuchsia.dev/reference/fidl/fuchsia.bluetooth.gatt2#ReadByTypeResult>:65535` |   | No default |

### RemoteService_ReadCharacteristic_Response

*Defined in [fuchsia.bluetooth.gatt2/client.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.bluetooth.gatt2/client.fidl;l=87)*

| Field | Type | Description | Default |
|---|---|---|---|
| `value` | `https://fuchsia.dev/reference/fidl/fuchsia.bluetooth.gatt2#ReadValue` |   | No default |

### RemoteService_ReadDescriptor_Response

*Defined in [fuchsia.bluetooth.gatt2/client.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.bluetooth.gatt2/client.fidl;l=128)*

| Field | Type | Description | Default |
|---|---|---|---|
| `value` | `https://fuchsia.dev/reference/fidl/fuchsia.bluetooth.gatt2#ReadValue` |   | No default |

### RemoteService_RegisterCharacteristicNotifier_Response

*Defined in [fuchsia.bluetooth.gatt2/client.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.bluetooth.gatt2/client.fidl;l=185)*

\<EMPTY\>

### RemoteService_WriteCharacteristic_Response

*Defined in [fuchsia.bluetooth.gatt2/client.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.bluetooth.gatt2/client.fidl;l=112)*

\<EMPTY\>

### RemoteService_WriteDescriptor_Response

*Defined in [fuchsia.bluetooth.gatt2/client.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.bluetooth.gatt2/client.fidl;l=153)*

\<EMPTY\>

### Server_PublishService_Response

*Defined in [fuchsia.bluetooth.gatt2/server.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.bluetooth.gatt2/server.fidl;l=189)*

\<EMPTY\>

### ServiceHandle

*Defined in [fuchsia.bluetooth.gatt2/types.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.bluetooth.gatt2/types.fidl;l=160)*

| Field | Type | Description | Default |
|---|---|---|---|
| `value` | `uint64` |   | No default |

### ShortReadOptions

*Defined in [fuchsia.bluetooth.gatt2/types.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.bluetooth.gatt2/types.fidl;l=326)*

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.

<br />

\<EMPTY\>

## **ENUMS**

### Error [strict](https://fuchsia.dev/fuchsia-src/reference/fidl/language/language#strict-vs-flexible)

Type: `uint32`

*Defined in [fuchsia.bluetooth.gatt2/types.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.bluetooth.gatt2/types.fidl;l=19)*

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.

<br />

| 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](https://fuchsia.dev/fuchsia-src/reference/fidl/language/language#strict-vs-flexible)

Type: `uint32`

*Defined in [fuchsia.bluetooth.gatt2/types.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.bluetooth.gatt2/types.fidl;l=142)*

Errors that can occur during service publication.

<br />

| 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 `ServiceInfo.characteristics` field was formatted invalidly or missing. If the service is meant to be empty, the vector should be empty, but present. |
| ### UNLIKELY_ERROR | `4` | A general error occurred that can not be classified as one of the more specific errors. |

### ServiceKind [strict](https://fuchsia.dev/fuchsia-src/reference/fidl/language/language#strict-vs-flexible)

Type: `uint32`

*Defined in [fuchsia.bluetooth.gatt2/types.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.bluetooth.gatt2/types.fidl;l=166)*

The kind ("type") of a GATT Service as outlined in Bluetooth Core Spec v5.3 Vol. 1 Part A 6.5.1.

<br />

| 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](https://fuchsia.dev/fuchsia-src/reference/fidl/language/language#strict-vs-flexible)

Type: `uint32`

*Defined in [fuchsia.bluetooth.gatt2/types.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.bluetooth.gatt2/types.fidl;l=343)*

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

<br />

| Name | Value | Description |
|---|---|---|
| ### 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](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.bluetooth.gatt2/types.fidl;l=191)*

Specifies the access permissions for a specific attribute value.

<br />

| Ordinal | Field | Type | Description |
|---|---|---|---|
| ### 1 | `read` | `https://fuchsia.dev/reference/fidl/fuchsia.bluetooth.gatt2#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` | `https://fuchsia.dev/reference/fidl/fuchsia.bluetooth.gatt2#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` | `https://fuchsia.dev/reference/fidl/fuchsia.bluetooth.gatt2#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](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.bluetooth.gatt2/types.fidl;l=259)*

Represents a local or remote GATT characteristic.

<br />

| Ordinal | Field | Type | Description |
|---|---|---|---|
| ### 1 | `handle` | `https://fuchsia.dev/reference/fidl/fuchsia.bluetooth.gatt2#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` | `https://fuchsia.dev/reference/fuchsia.bluetooth//https://fuchsia.dev/reference/fuchsia.bluetooth#Uuid` | The UUID that identifies the type of this characteristic. Always present. Mandatory for local characteristics. |
| ### 3 | `properties` | `https://fuchsia.dev/reference/fidl/fuchsia.bluetooth.gatt2#CharacteristicPropertyBits` | The characteristic properties bitfield. Always present. Mandatory for local characteristics. |
| ### 4 | `permissions` | `https://fuchsia.dev/reference/fidl/fuchsia.bluetooth.gatt2#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<https://fuchsia.dev/reference/fidl/fuchsia.bluetooth.gatt2#Descriptor>:65532` | The descriptors of this characteristic. Present only if non-empty. Optional for local characteristics. |

### Descriptor

*Defined in [fuchsia.bluetooth.gatt2/types.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.bluetooth.gatt2/types.fidl;l=288)*

Represents a local or remote GATT characteristic descriptor.

<br />

| Ordinal | Field | Type | Description |
|---|---|---|---|
| ### 1 | `handle` | `https://fuchsia.dev/reference/fidl/fuchsia.bluetooth.gatt2#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` | `https://fuchsia.dev/reference/fuchsia.bluetooth//https://fuchsia.dev/reference/fuchsia.bluetooth#Uuid` | The UUID that identifies the type of this descriptor. Always present. For local descriptors, this value is mandatory. |
| ### 3 | `permissions` | `https://fuchsia.dev/reference/fidl/fuchsia.bluetooth.gatt2#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](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.bluetooth.gatt2/server.fidl;l=110)*

| Ordinal | Field | Type | Description |
|---|---|---|---|
| ### 1 | `peer_id` | `https://fuchsia.dev/reference/fuchsia.bluetooth//https://fuchsia.dev/reference/fuchsia.bluetooth#PeerId` |   |
| ### 2 | `mtu` | `uint16` |   |

### LocalServiceWriteValueRequest

*Defined in [fuchsia.bluetooth.gatt2/server.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.bluetooth.gatt2/server.fidl;l=87)*

| Ordinal | Field | Type | Description |
|---|---|---|---|
| ### 1 | `peer_id` | `https://fuchsia.dev/reference/fuchsia.bluetooth//https://fuchsia.dev/reference/fuchsia.bluetooth#PeerId` |   |
| ### 2 | `handle` | `https://fuchsia.dev/reference/fidl/fuchsia.bluetooth.gatt2#Handle` |   |
| ### 3 | `offset` | `uint32` |   |
| ### 4 | `value` | `vector<uint8>:512` |   |

### LongReadOptions

*Defined in [fuchsia.bluetooth.gatt2/types.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.bluetooth.gatt2/types.fidl;l=311)*

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

<br />

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

### ReadByTypeResult

*Defined in [fuchsia.bluetooth.gatt2/client.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.bluetooth.gatt2/client.fidl;l=22)*

A result returned by `RemoteService.ReadByType`.

<br />

| Ordinal | Field | Type | Description |
|---|---|---|---|
| ### 1 | `handle` | `https://fuchsia.dev/reference/fidl/fuchsia.bluetooth.gatt2#Handle` | Characteristic or descriptor handle. |
| ### 2 | `value` | `https://fuchsia.dev/reference/fidl/fuchsia.bluetooth.gatt2#ReadValue` | The value of the characteristic or descriptor, if it was read successfully. |
| ### 3 | `error` | `https://fuchsia.dev/reference/fidl/fuchsia.bluetooth.gatt2#Error` | Reason the value could not be read, if reading it resulted in an error. |

### ReadValue

*Defined in [fuchsia.bluetooth.gatt2/client.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.bluetooth.gatt2/client.fidl;l=9)*

Wrapper around a possible truncated value received from the server.

<br />

| Ordinal | Field | Type | Description |
|---|---|---|---|
| ### 1 | `handle` | `https://fuchsia.dev/reference/fidl/fuchsia.bluetooth.gatt2#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](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.bluetooth.gatt2/types.fidl;l=176)*

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

<br />

| 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](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.bluetooth.gatt2/types.fidl;l=229)*

Represents a local or remote GATT service.

<br />

| Ordinal | Field | Type | Description |
|---|---|---|---|
| ### 1 | `handle` | `https://fuchsia.dev/reference/fidl/fuchsia.bluetooth.gatt2#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. |
| ### 2 | `kind` | `https://fuchsia.dev/reference/fidl/fuchsia.bluetooth.gatt2#ServiceKind` | Indicates whether this is a primary or secondary service. Always present for remote services. Optional for local services Default: ServiceKind::PRIMARY |
| ### 3 | `type` | `https://fuchsia.dev/reference/fuchsia.bluetooth//https://fuchsia.dev/reference/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<https://fuchsia.dev/reference/fidl/fuchsia.bluetooth.gatt2#Characteristic>:32767` | The characteristics of this service. Required for local services. Never present for remote services. |
| ### 5 | `includes` | `vector<https://fuchsia.dev/reference/fidl/fuchsia.bluetooth.gatt2#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](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.bluetooth.gatt2/server.fidl;l=14)*

The parameters used to signal a characteristic value change from a LocalService to a peer.

<br />

| Ordinal | Field | Type | Description |
|---|---|---|---|
| ### 1 | `handle` | `https://fuchsia.dev/reference/fidl/fuchsia.bluetooth.gatt2#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 `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. |
| ### 3 | `peer_ids` | `vector<https://fuchsia.dev/reference/fuchsia.bluetooth//https://fuchsia.dev/reference/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](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.bluetooth.gatt2/types.fidl;l=365)*

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

<br />

| Ordinal | Field | Type | Description |
|---|---|---|---|
| ### 1 | `write_mode` | `https://fuchsia.dev/reference/fidl/fuchsia.bluetooth.gatt2#WriteMode` | The mode of the write operation. For descriptors, only [WriteMode.DEFAULT](https://fuchsia.dev/reference/fidl/fuchsia.bluetooth.gatt2#WriteMode.DEFAULT) is supported Optional. Default: [WriteMode.DEFAULT](https://fuchsia.dev/reference/fidl/fuchsia.bluetooth.gatt2#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](https://fuchsia.dev/reference/fidl/fuchsia.bluetooth.gatt2#WriteMode.WITHOUT_RESPONSE). Optional. Default: 0 |

## **UNIONS**

### LocalService_ReadValue_Result [strict](https://fuchsia.dev/fuchsia-src/reference/fidl/language/language#strict-vs-flexible)

*Defined in [fuchsia.bluetooth.gatt2/server.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.bluetooth.gatt2/server.fidl;l=70)*

| Ordinal | Variant | Type | Description |
|---|---|---|---|
| ### 1 | `response` | `https://fuchsia.dev/reference/fidl/fuchsia.bluetooth.gatt2#LocalService_ReadValue_Response` |   |
| ### 2 | `err` | `https://fuchsia.dev/reference/fidl/fuchsia.bluetooth.gatt2#Error` |   |

<br />

### LocalService_WriteValue_Result [strict](https://fuchsia.dev/fuchsia-src/reference/fidl/language/language#strict-vs-flexible)

*Defined in [fuchsia.bluetooth.gatt2/server.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.bluetooth.gatt2/server.fidl;l=92)*

| Ordinal | Variant | Type | Description |
|---|---|---|---|
| ### 1 | `response` | `https://fuchsia.dev/reference/fidl/fuchsia.bluetooth.gatt2#LocalService_WriteValue_Response` |   |
| ### 2 | `err` | `https://fuchsia.dev/reference/fidl/fuchsia.bluetooth.gatt2#Error` |   |

<br />

### ReadOptions [flexible](https://fuchsia.dev/fuchsia-src/reference/fidl/language/language#strict-vs-flexible)

*Defined in [fuchsia.bluetooth.gatt2/types.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.bluetooth.gatt2/types.fidl;l=330)*

Represents the supported options to read a characteristic or descriptor
value from a server.

| Ordinal | Variant | Type | Description |
|---|---|---|---|
| ### 1 | `short_read` | `https://fuchsia.dev/reference/fidl/fuchsia.bluetooth.gatt2#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` | `https://fuchsia.dev/reference/fidl/fuchsia.bluetooth.gatt2#LongReadOptions` | If present, perform a long read using the indicated options. Optional. Default: A short read will be performed. |

<br />

### RemoteService_ReadByType_Result [strict](https://fuchsia.dev/fuchsia-src/reference/fidl/language/language#strict-vs-flexible)

*Defined in [fuchsia.bluetooth.gatt2/client.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.bluetooth.gatt2/client.fidl;l=70)*

| Ordinal | Variant | Type | Description |
|---|---|---|---|
| ### 1 | `response` | `https://fuchsia.dev/reference/fidl/fuchsia.bluetooth.gatt2#RemoteService_ReadByType_Response` |   |
| ### 2 | `err` | `https://fuchsia.dev/reference/fidl/fuchsia.bluetooth.gatt2#Error` |   |

<br />

### RemoteService_ReadCharacteristic_Result [strict](https://fuchsia.dev/fuchsia-src/reference/fidl/language/language#strict-vs-flexible)

*Defined in [fuchsia.bluetooth.gatt2/client.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.bluetooth.gatt2/client.fidl;l=87)*

| Ordinal | Variant | Type | Description |
|---|---|---|---|
| ### 1 | `response` | `https://fuchsia.dev/reference/fidl/fuchsia.bluetooth.gatt2#RemoteService_ReadCharacteristic_Response` |   |
| ### 2 | `err` | `https://fuchsia.dev/reference/fidl/fuchsia.bluetooth.gatt2#Error` |   |

<br />

### RemoteService_ReadDescriptor_Result [strict](https://fuchsia.dev/fuchsia-src/reference/fidl/language/language#strict-vs-flexible)

*Defined in [fuchsia.bluetooth.gatt2/client.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.bluetooth.gatt2/client.fidl;l=128)*

| Ordinal | Variant | Type | Description |
|---|---|---|---|
| ### 1 | `response` | `https://fuchsia.dev/reference/fidl/fuchsia.bluetooth.gatt2#RemoteService_ReadDescriptor_Response` |   |
| ### 2 | `err` | `https://fuchsia.dev/reference/fidl/fuchsia.bluetooth.gatt2#Error` |   |

<br />

### RemoteService_RegisterCharacteristicNotifier_Result [strict](https://fuchsia.dev/fuchsia-src/reference/fidl/language/language#strict-vs-flexible)

*Defined in [fuchsia.bluetooth.gatt2/client.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.bluetooth.gatt2/client.fidl;l=185)*

| Ordinal | Variant | Type | Description |
|---|---|---|---|
| ### 1 | `response` | `https://fuchsia.dev/reference/fidl/fuchsia.bluetooth.gatt2#RemoteService_RegisterCharacteristicNotifier_Response` |   |
| ### 2 | `err` | `https://fuchsia.dev/reference/fidl/fuchsia.bluetooth.gatt2#Error` |   |

<br />

### RemoteService_WriteCharacteristic_Result [strict](https://fuchsia.dev/fuchsia-src/reference/fidl/language/language#strict-vs-flexible)

*Defined in [fuchsia.bluetooth.gatt2/client.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.bluetooth.gatt2/client.fidl;l=112)*

| Ordinal | Variant | Type | Description |
|---|---|---|---|
| ### 1 | `response` | `https://fuchsia.dev/reference/fidl/fuchsia.bluetooth.gatt2#RemoteService_WriteCharacteristic_Response` |   |
| ### 2 | `err` | `https://fuchsia.dev/reference/fidl/fuchsia.bluetooth.gatt2#Error` |   |

<br />

### RemoteService_WriteDescriptor_Result [strict](https://fuchsia.dev/fuchsia-src/reference/fidl/language/language#strict-vs-flexible)

*Defined in [fuchsia.bluetooth.gatt2/client.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.bluetooth.gatt2/client.fidl;l=153)*

| Ordinal | Variant | Type | Description |
|---|---|---|---|
| ### 1 | `response` | `https://fuchsia.dev/reference/fidl/fuchsia.bluetooth.gatt2#RemoteService_WriteDescriptor_Response` |   |
| ### 2 | `err` | `https://fuchsia.dev/reference/fidl/fuchsia.bluetooth.gatt2#Error` |   |

<br />

### Server_PublishService_Result [strict](https://fuchsia.dev/fuchsia-src/reference/fidl/language/language#strict-vs-flexible)

*Defined in [fuchsia.bluetooth.gatt2/server.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.bluetooth.gatt2/server.fidl;l=189)*

| Ordinal | Variant | Type | Description |
|---|---|---|---|
| ### 1 | `response` | `https://fuchsia.dev/reference/fidl/fuchsia.bluetooth.gatt2#Server_PublishService_Response` |   |
| ### 2 | `err` | `https://fuchsia.dev/reference/fidl/fuchsia.bluetooth.gatt2#PublishServiceError` |   |

<br />

## **BITS**

### CharacteristicPropertyBits [strict](https://fuchsia.dev/fuchsia-src/reference/fidl/language/language#strict-vs-flexible)

Type: `uint16`

*Defined in [fuchsia.bluetooth.gatt2/types.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.bluetooth.gatt2/types.fidl;l=216)*

Possible values for the characteristic properties bitfield. These specify the
GATT procedures that are allowed for a particular characteristic.

<br />

| 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](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.bluetooth.gatt2/server.fidl;l=11) | `10` | `uint32` | The amount of credits defined to be available for sending indications/notifications when a LocalService is first published. |
| [MAX_ATTRIBUTE_COUNT](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.bluetooth.gatt2/constants.fidl;l=11) | `65535` | `uint16` |   |
| [MAX_CHARACTERISTIC_COUNT](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.bluetooth.gatt2/constants.fidl;l=26) | `32767` | `uint16` |   |
| [MAX_DESCRIPTOR_COUNT](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.bluetooth.gatt2/constants.fidl;l=34) | `65532` | `uint16` |   |
| [MAX_SERVICE_COUNT](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.bluetooth.gatt2/constants.fidl;l=18) | `https://fuchsia.dev/reference/fidl/fuchsia.bluetooth.gatt2#MAX_ATTRIBUTE_COUNT` | `uint16` |   |
| [MAX_VALUE_LENGTH](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.bluetooth.gatt2/constants.fidl;l=8) | `512` | `uint16` |   |