fuchsia.bluetooth.test

PROTOCOLS

HciEmulator

Defined in fuchsia.bluetooth.test/hci_emulator.fidl

Protocol used to emulate a Bluetooth controller that supports the standard Bluetooth HCI.

Publish

Publish a bt-hci device using the provided settings. Each HciEmulator instance can only manage a single bt-hci device. Returns Emulator.HCI_ALREADY_PUBLISHED if the device has already been published.

Request

NameType
settings EmulatorSettings

Response

NameType
result HciEmulator_Publish_Result

AddPeer

Inserts a new peer device to be emulated by this controller. Returns an error if peer is improperly configured (e.g. does not contain an address). On success, returns an id that can be used to refer to the created peer.

Request

NameType
peer FakePeer

Response

NameType
result HciEmulator_AddPeer_Result

RemovePeer

Remove a previously inserted peer. Returns EmulatorPeerError.NOT_FOUND if id is not recognized.

Request

NameType
id fuchsia.bluetooth/PeerId

Response

NameType
result HciEmulator_RemovePeer_Result

WatchLeScanState

Returns the latest state of the link layer LE scan procedure. This method returns when there is a state change since the last invocation of this method by this client (see hanging get pattern).

Request

NameType

Response

NameType
state LeScanState

STRUCTS

HciEmulator_Publish_Response

generated

NameTypeDescriptionDefault

HciEmulator_AddPeer_Response

generated

NameTypeDescriptionDefault
id fuchsia.bluetooth/PeerId No default

HciEmulator_RemovePeer_Response

generated

NameTypeDescriptionDefault

AclBufferSettings

Defined in fuchsia.bluetooth.test/hci_emulator.fidl

The HCI ACL data flow-control parameters.

NameTypeDescriptionDefault
data_packet_length uint16 ACL frame MTU in bytes. No default
total_num_data_packets uint8 The maximum number of ACL frames that the controller can buffer. No default

ENUMS

EmulatorError

Type: uint32

Defined in fuchsia.bluetooth.test/hci_emulator.fidl

Error codes that can be generated for emulator-wide configurations.

NameValueDescription
FAILED 1
HCI_ALREADY_PUBLISHED 2

EmulatorPeerError

Type: uint32

Defined in fuchsia.bluetooth.test/hci_emulator.fidl

Error codes that are generated for functions that manipulate fake peers.

NameValueDescription
ADDRESS_REPEATED 1
PARAMETERS_INVALID 2
NOT_FOUND 3

LeAddressType

Type: uint32

Defined in fuchsia.bluetooth.test/hci_emulator.fidl

The Bluetooth device address type used with link layer procedures.

NameValueDescription
PUBLIC 1
RANDOM 2

HciConfig

Type: uint32

Defined in fuchsia.bluetooth.test/hci_emulator.fidl

Pre-set HCI configurations.

NameValueDescription
DUAL_MODE 1
LE_ONLY 2

HciError

Type: uint8

Defined in fuchsia.bluetooth.test/hci_errors.fidl

Defines the list of HCI protocol error codes that a Bluetooth controller can report. These values are taken from Bluetooth Core Specification v5.1, Vol 2, Part D.

NameValueDescription
SUCCESS 0
UNKNOWN_COMMAND 1
UNKNOWN_CONNECTION_ID 2
HARDWARE_FAILURE 3
PAGE_TIMEOUT 4
AUTHENTICATION_FAILURE 5
PIN_OR_KEY_MISSING 6
MEMORY_CAPACITY_EXCEEDED 7
CONNECTION_TIMEOUT 8
CONNECTION_LIMIT_EXCEEDED 9
SYNCHRONOUS_CONNECTION_LIMIT_EXCEEDED 10
CONNECTION_ALREADY_EXISTS 11
COMMAND_DISALLOWED 12
CONNECTION_REJECTED_LIMITED_RESOURCES 13
CONNECTION_REJECTED_SECURITY 14
CONNECTION_REJECTED_BAD_BD_ADDR 15
CONNECTION_ACCEPT_TIMEOUT_EXCEEDED 16
UNSUPPORTED_FEATURE_OR_PARAMETER 17
INVALID_HCICOMMAND_PARAMETERS 18
REMOTE_USER_TERMINATED_CONNECTION 19
REMOTE_DEVICE_TERMINATED_CONNECTION_LOW_RESOURCES 20
REMOTE_DEVICE_TERMINATED_CONNECTION_POWER_OFF 21
CONNECTION_TERMINATED_BY_LOCAL_HOST 22
REPEATED_ATTEMPTS 23
PAIRING_NOT_ALLOWED 24
UNKNOWN_LMP_PDU 25
UNSUPPORTED_REMOTE_FEATURE 26
SCO_OFFSET_REJECTED 27
SCO_INTERVAL_REJECTED 28
SCO_AIR_MODE_REJECTED 29
INVALID_LMP_OR_LL_PARAMETERS 30
UNSPECIFIED_ERROR 31
UNSUPPORTED_LMP_OR_LL_PARAMETER_VALUE 32
ROLE_CHANGE_NOT_ALLOWED 33
LMP_OR_LL_RESPONSE_TIMEOUT 34
LMP_ERROR_TRANSACTION_COLLISION 35
LMP_PDU_NOT_ALLOWED 36
ENCRYPTION_MODE_NOT_ACCEPTABLE 37
LINK_KEY_CANNOT_BE_CHANGED 38
REQUESTED_QOS_NOT_SUPPORTED 39
INSTANT_PASSED 40
PAIRING_WITH_UNIT_KEY_NOT_SUPPORTED 41
DIFFERENT_TRANSACTION_COLLISION 42
RESERVED0 43
QOS_UNACCEPTABLE_PARAMETER 44
QOS_REJECTED 45
CHANNEL_CLASSIFICATION_NOT_SUPPORTED 46
INSUFFICIENT_SECURITY 47
PARAMETER_OUT_OF_MANDATORY_RANGE 48
RESERVED1 49
ROLE_SWITCH_PENDING 50
RESERVED2 51
RESERVED_SLOT_VIOLATION 52
ROLE_SWITCH_FAILED 53
EXTENDED_INQUIRY_RESPONSE_TOO_LARGE 54
SECURE_SIMPLE_PAIRING_NOT_SUPPORTED_BY_HOST 55
HOST_BUSY_PAIRING 56
CONNECTION_REJECTED_NO_SUITABLE_CHANNEL_FOUND 57
CONTROLLER_BUSY 58
UNACCEPTABLE_CONNECTION_PARAMETERS 59
DIRECTED_ADVERTISING_TIMEOUT 60
CONNECTION_TERMINATED_MIC_FAILURE 61
CONNECTION_FAILED_TO_BE_ESTABLISHED 62
MAC_CONNECTION_FAILED 63
COARSE_CLOCK_ADJUSTMENT_REJECTED 64
TYPE0_SUBMAP_NOT_DEFINED 65
UNKNOWN_ADVERTISING_IDENTIFIER 66
LIMIT_REACHED 67
OPERATION_CANCELLED_BY_HOST 68

TABLES

FakePeer

Defined in fuchsia.bluetooth.test/hci_emulator.fidl

Represents a peer that a FakeController can be configured to emulate.

OrdinalNameTypeDescription
1 address fuchsia.bluetooth/Address The LE identity address and/or `BD_ADDR` of the peer. This field is mandatory.
2 le LeParameters Parameters used by this peer on the Low Energy transport. This field is optional. The peer will not be active on the LE transport if this field is not present. However, the peer must support at least one transport.
3 bredr BrEdrParameters Parameters used by this peer on the BR/EDR transport. This field is optional. The peer will not be active on the BR/EDR transport if this field is not present. However, the peer must support at least one transport.

LeParameters

Defined in fuchsia.bluetooth.test/hci_emulator.fidl

Parameters used to emulate a peer's behavior over the Low Energy transport.

OrdinalNameTypeDescription
1 connectable bool If true, the peer will send connectable advertisements and accept connection requests. The peer will ignore connection requests if not connectable.
2 advertisement AdvertisingData The advertising data contents. If not present, the advertising data sent by this peer will be empty.
3 scan_response AdvertisingData The scan response data contents. When present, the fake controller will generate scannable advertising packets and scan response events.

BrEdrParameters

Defined in fuchsia.bluetooth.test/hci_emulator.fidl

Parameters used to emulate a peer's behavior over the BR/EDR transport.

OrdinalNameTypeDescription

LeScanState

Defined in fuchsia.bluetooth.test/hci_emulator.fidl

Represents the LE scan state. The fields are present if scan parameters have been configured.

OrdinalNameTypeDescription
1 enabled bool True if a scan is enabled.
2 active bool True if an active scan is enabled. Otherwise the scan is passive.
3 interval uint16 The scan interval and window parameters. These are defined in Bluetotoh controller "timeslices" where 1 slice = 0.625 ms. Valid values range from 0x4 (2.5 ms) to 0x4000 (10.24 ms).
4 window uint16
5 filter_duplicates bool True if duplicate filtering has been enabled.
6 own_address_type LeAddressType The type of local device address used.

EmulatorSettings

Defined in fuchsia.bluetooth.test/hci_emulator.fidl

Controller settings used by the emulator.

OrdinalNameTypeDescription
1 address fuchsia.bluetooth/Address The `BD_ADDR` (BR/EDR) or LE Public Device Address. Defaults to "00:00:00:00:00:00".
2 hci_config HciConfig Supported HCI command configuration. Defaults to "`DUAL_MODE`".
3 extended_advertising bool True if the 5.0 extended advertising features are supported. Defaults to "false".
4 acl_buffer_settings AclBufferSettings The ACL-U data buffer settings. Defaults to data_packet_length: 1024 total_num_data_packets: 5 IF `hci_config` is set to `DUAL_MODE`. Defaults to null otherwise.
5 le_acl_buffer_settings AclBufferSettings The LE-U ACL data buffer settings. Defaults to data_packet_length: 251 total_num_data_packets: 5

UNIONS

HciEmulator_Publish_Result

generated

NameTypeDescription
response HciEmulator_Publish_Response
err EmulatorError

HciEmulator_AddPeer_Result

generated

NameTypeDescription
response HciEmulator_AddPeer_Response
err EmulatorPeerError

HciEmulator_RemovePeer_Result

generated

NameTypeDescription
response HciEmulator_RemovePeer_Response
err EmulatorPeerError

XUNIONS

AdvertisingData

Defined in fuchsia.bluetooth.test/hci_emulator.fidl

NameTypeDescription
legacy_data vector<uint8>[31]
extended_data vector<uint8>[251]

CONSTANTS

NameValueTypeDescription
MAX_LEGACY_ADVERTISING_DATA_LENGTH 31 uint8
MAX_EXTENDED_ADVERTISING_DATA_LENGTH 251 uint8