Google is committed to advancing racial equity for Black communities. See how.

fuchsia.hardware.bt.gattsvc

PROTOCOLS

BtGattNotificationValue

Defined in fuchsia.hardware.bt.gattsvc/bt-gatt-svc.fidl

Value change notification callback of the |EnableNotifications| function.

Callback

Request

NameType
id BtGattId
value vector<uint8>

Response

NameType

BtGattSvc

Defined in fuchsia.hardware.bt.gattsvc/bt-gatt-svc.fidl

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

NameType

Response

NameType
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

NameType
id BtGattId
value_cb BtGattNotificationValue

Response

NameType
status BtGattStatus
id BtGattId

ReadCharacteristic

Reads the value of the characteristic with the given ID.

Request

NameType
id BtGattId

Response

NameType
status BtGattStatus
id BtGattId
value vector<uint8>

ReadLongCharacteristic

Reads the long value of the characteristic with the given ID.

Request

NameType
id BtGattId
offset uint16
max_bytes uint64

Response

NameType
status BtGattStatus
id BtGattId
value vector<uint8>

Stop

Stops this service and unregisters previously registered callbacks.

Request

NameType

Response

NameType

WriteCharacteristic

Writes a characteristic with the given ID. Automatically handles long writes if required by the mtu size.

Request

NameType
id BtGattId
buf vector<uint8>

Response

NameType
status BtGattStatus
id BtGattId

STRUCTS

BtGattChr

Defined in fuchsia.hardware.bt.gattsvc/bt-gatt-svc.fidl

Represents a GATT characteristic.

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

Represents a GATT characteristic descriptor.

NameTypeDescriptionDefault
id BtGattId No default
type BtGattUuid No default

BtGattStatus

Defined in fuchsia.hardware.bt.gattsvc/bt-gatt-svc.fidl

Represents the status of a GATT operation.

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

NameTypeDescriptionDefault
bytes uint8[16] No default

ENUMS

BtGattChrExtProp strict

Type: uint16

Defined in fuchsia.hardware.bt.gattsvc/bt-gatt-svc.fidl

NameValueDescription
RELIABLE_WRITE 256
WRITABLE_AUXILIARIES 512

BtGattChrPropr strict

Type: uint8

Defined in fuchsia.hardware.bt.gattsvc/bt-gatt-svc.fidl

Possible values for the characteristic properties bitfield.

NameValueDescription
BROADCAST 1
READ 2
WRITE_WITHOUT_RESPONSE 4
WRITE 8
NOTIFY 16
INDICATE 32
AUTHENTICATED_SIGNED_WRITES 64
EXTENDED_PROPERTIES 128

BtGattErr strict

Type: uint8

Defined in fuchsia.hardware.bt.gattsvc/bt-gatt-svc.fidl

ATT protocol error codes.

NameValueDescription
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

NameValueDescription
BtGattId uint64