PROTOCOLS
BtGattNotificationValue
Defined in fuchsia.hardware.bt.gattsvc/bt-gatt-svc.banjo
Value change notification callback of the |EnableNotifications| function.
Callback
Request
Name | Type |
---|---|
id |
BtGattId
|
value |
vector<uint8>
|
Response
Name | Type |
---|
BtGattSvc
Defined in fuchsia.hardware.bt.gattsvc/bt-gatt-svc.banjo
Connect
Connects to and starts characteristic discovery on the remote service.
|status| will contain the result of the characteristic discovery procedure if it was initiated by |connect|. The service will be ready to receive further requests once this has been called successfully and the |status| callback has been called with success.
Request
Name | Type |
---|
Response
Name | Type |
---|---|
status |
BtGattStatus
|
characteristic |
vector<BtGattChr>
|
EnableNotifications
Enables notifications from the characteristic with the given ID. Returns
ZX_ERR_BAD_STATE
if the service has not been started yet.
Returns ZX_ERR_SHOULD_WAIT
if this request is already in progress.
The async callback will be called to asynchronously report the result of this operation.
Request
Name | Type |
---|---|
id |
BtGattId
|
value_cb |
BtGattNotificationValue
|
Response
Name | Type |
---|---|
status |
BtGattStatus
|
id |
BtGattId
|
ReadCharacteristic
Reads the value of the characteristic with the given ID.
Request
Name | Type |
---|---|
id |
BtGattId
|
Response
Name | Type |
---|---|
status |
BtGattStatus
|
id |
BtGattId
|
value |
vector<uint8>
|
ReadLongCharacteristic
Reads the long value of the characteristic with the given ID.
Request
Name | Type |
---|---|
id |
BtGattId
|
offset |
uint16
|
max_bytes |
uint64
|
Response
Name | Type |
---|---|
status |
BtGattStatus
|
id |
BtGattId
|
value |
vector<uint8>
|
Stop
Stops this service and unregisters previously registered callbacks.
Request
Name | Type |
---|
Response
Name | Type |
---|
WriteCharacteristic
Writes a characteristic with the given ID. Automatically handles long writes if required by the mtu size.
Request
Name | Type |
---|---|
id |
BtGattId
|
buf |
vector<uint8>
|
Response
Name | Type |
---|---|
status |
BtGattStatus
|
id |
BtGattId
|
STRUCTS
BtGattChr
Defined in fuchsia.hardware.bt.gattsvc/bt-gatt-svc.banjo
Represents a GATT characteristic.
Name | Type | Description | Default |
---|---|---|---|
id |
BtGattId
|
No default | |
type |
BtGattUuid
|
No default | |
properties |
uint8
|
The bitmask of characteristic properties. The |extended_properties| field is populated if the "Characteristic Extended Properties" descriptor is present. See enums |BtGattChrProp| and |BtGattChrExtProp| for possible bit values. |
No default |
extended_properties |
uint16
|
No default | |
descriptor |
vector<BtGattDescriptor>
|
No default |
BtGattDescriptor
Defined in fuchsia.hardware.bt.gattsvc/bt-gatt-svc.banjo
Represents a GATT characteristic descriptor.
Name | Type | Description | Default |
---|---|---|---|
id |
BtGattId
|
No default | |
type |
BtGattUuid
|
No default |
BtGattStatus
Defined in fuchsia.hardware.bt.gattsvc/bt-gatt-svc.banjo
Represents the status of a GATT operation.
Name | Type | Description | Default |
---|---|---|---|
status |
zx/status
|
Represents errors reported by the host (i.e. not over ATT). |
No default |
att_ecode |
BtGattErr
|
ATT protocol error. |
No default |
BtGattUuid
Defined in fuchsia.hardware.bt.gattsvc/bt-gatt-svc.banjo
Name | Type | Description | Default |
---|---|---|---|
bytes |
uint8[16]
|
No default |
ENUMS
BtGattChrExtProp
Type: uint16
Defined in fuchsia.hardware.bt.gattsvc/bt-gatt-svc.banjo
Name | Value | Description |
---|---|---|
RELIABLE_WRITE |
256 |
|
WRITABLE_AUXILIARIES |
512 |
BtGattChrPropr
Type: uint8
Defined in fuchsia.hardware.bt.gattsvc/bt-gatt-svc.banjo
Possible values for the characteristic properties bitfield.
Name | Value | Description |
---|---|---|
BROADCAST |
1 |
|
READ |
2 |
|
WRITE_WITHOUT_RESPONSE |
4 |
|
WRITE |
8 |
|
NOTIFY |
16 |
|
INDICATE |
32 |
|
AUTHENTICATED_SIGNED_WRITES |
64 |
|
EXTENDED_PROPERTIES |
128 |
BtGattErr
Type: uint8
Defined in fuchsia.hardware.bt.gattsvc/bt-gatt-svc.banjo
ATT protocol error codes.
Name | Value | Description |
---|---|---|
NO_ERROR |
0 |
|
INVALID_HANDLE |
1 |
|
READ_NOT_PERMITTED |
2 |
|
WRITE_NOT_PERMITTED |
3 |
|
INVALID_PDU |
4 |
|
INSUFFICIENT_AUTHENTICATION |
5 |
|
REQUEST_NOT_SUPPORTED |
6 |
|
INVALID_OFFSET |
7 |
|
INSUFFICIENT_AUTHORIZATION |
8 |
|
PREPARE_QUEUE_FULL |
9 |
|
ATTRIBUTE_NOT_FOUND |
10 |
|
ATTRIBUTENOTLONG |
11 |
|
INSUFFICIENT_ENCRYPTION_KEY_SIZE |
12 |
|
INVALID_ATTRIBUTE_VALUE_LENGTH |
13 |
|
UNLIKELY_ERROR |
14 |
|
INSUFFICIENT_ENCRYPTION |
15 |
|
UNSUPPORTED_GROUP_TYPE |
16 |
|
INSUFFICIENT_RESOURCES |
17 |
TYPE ALIASES
Name | Value | Description |
---|---|---|
BtGattId |
uint64 |