| # Copyright 2023 The Pigweed Authors |
| # |
| # Licensed under the Apache License, Version 2.0 (the "License"); you may not |
| # use this file except in compliance with the License. You may obtain a copy of |
| # the License at |
| # |
| # https://www.apache.org/licenses/LICENSE-2.0 |
| # |
| # Unless required by applicable law or agreed to in writing, software |
| # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT |
| # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the |
| # License for the specific language governing permissions and limitations under |
| # the License. |
| |
| # This file contains Emboss definitions for Host Controller Interface packets |
| # and types found in the Bluetooth Core Specification. The Emboss compiler is |
| # used to generate a C++ header from this file. |
| |
| [$default byte_order: "LittleEndian"] |
| [(cpp) namespace: "pw::bluetooth::emboss"] |
| # =========================== Common Definitions ================================= |
| |
| |
| enum StatusCode: |
| -- HCI Error Codes. Refer to Core Spec v5.0, Vol 2, Part D for definitions and |
| -- descriptions. All enum values are in increasing numerical order, however the |
| -- values are listed below for clarity. |
| [maximum_bits: 8] |
| SUCCESS = 0x00 |
| UNKNOWN_COMMAND = 0x01 |
| UNKNOWN_CONNECTION_ID = 0x02 |
| HARDWARE_FAILURE = 0x03 |
| PAGE_TIMEOUT = 0x04 |
| AUTHENTICATION_FAILURE = 0x05 |
| PIN_OR_KEY_MISSING = 0x06 |
| MEMORY_CAPACITY_EXCEEDED = 0x07 |
| CONNECTION_TIMEOUT = 0x08 |
| CONNECTION_LIMIT_EXCEEDED = 0x09 |
| SYNCHRONOUS_CONNECTION_LIMIT_EXCEEDED = 0x0A |
| CONNECTION_ALREADY_EXISTS = 0x0B |
| COMMAND_DISALLOWED = 0x0C |
| CONNECTION_REJECTED_LIMITED_RESOURCES = 0x0D |
| CONNECTION_REJECTED_SECURITY = 0x0E |
| CONNECTION_REJECTED_BAD_BD_ADDR = 0x0F |
| CONNECTION_ACCEPT_TIMEOUT_EXCEEDED = 0x10 |
| UNSUPPORTED_FEATURE_OR_PARAMETER = 0x11 |
| INVALID_HCI_COMMAND_PARAMETERS = 0x12 |
| REMOTE_USER_TERMINATED_CONNECTION = 0x13 |
| REMOTE_DEVICE_TERMINATED_CONNECTION_LOW_RESOURCES = 0x14 |
| REMOTE_DEVICE_TERMINATED_CONNECTION_POWER_OFF = 0x15 |
| CONNECTION_TERMINATED_BY_LOCAL_HOST = 0x16 |
| REPEATED_ATTEMPTS = 0x17 |
| PAIRING_NOT_ALLOWED = 0x18 |
| UNKNOWN_LMP_PDU = 0x19 |
| UNSUPPORTED_REMOTE_FEATURE = 0x1A |
| SCO_OFFSET_REJECTED = 0x1B |
| SCO_INTERVAL_REJECTED = 0x1C |
| SCO_AIRMODE_REJECTED = 0x1D |
| INVALID_LMP_OR_LL_PARAMETERS = 0x1E |
| UNSPECIFIED_ERROR = 0x1F |
| UNSUPPORTED_LMP_OR_LL_PARAMETER_VALUE = 0x20 |
| ROLE_CHANGE_NOT_ALLOWED = 0x21 |
| LMP_OR_LL_RESPONSE_TIMEOUT = 0x22 |
| LMP_ERROR_TRANSACTION_COLLISION = 0x23 |
| LMP_PDU_NOT_ALLOWED = 0x24 |
| ENCRYPTION_MODE_NOT_ACCEPTABLE = 0x25 |
| LINK_KEY_CANNOT_BE_CHANGED = 0x26 |
| REQUESTED_QOS_NOT_SUPPORTED = 0x27 |
| INSTANT_PASSED = 0x28 |
| PAIRING_WITH_UNIT_KEY_NOT_SUPPORTED = 0x29 |
| DIFFERENT_TRANSACTION_COLLISION = 0x2A |
| RESERVED_0 = 0x2B |
| QOS_UNACCEPTABLE_PARAMETER = 0x2C |
| QOS_REJECTED = 0x2D |
| CHANNEL_CLASSIFICATION_NOT_SUPPORTED = 0x2E |
| INSUFFICIENT_SECURITY = 0x2F |
| PARAMETER_OUT_OF_MANDATORY_RANGE = 0x30 |
| RESERVED_1 = 0x31 |
| ROLE_SWITCH_PENDING = 0x32 |
| RESERVED_2 = 0x33 |
| RESERVED_SLOT_VIOLATION = 0x34 |
| ROLE_SWITCH_FAILED = 0x35 |
| EXTENDED_INQUIRY_RESPONSE_TOO_LARGE = 0x36 |
| SECURE_SIMPLE_PAIRING_NOT_SUPPORTED_BY_HOST = 0x37 |
| HOST_BUSY_PAIRING = 0x38 |
| CONNECTION_REJECTED_NO_SUITABLE_CHANNEL_FOUND = 0x39 |
| CONTROLLER_BUSY = 0x3A |
| UNACCEPTABLE_CONNECTION_PARAMETERS = 0x3B |
| DIRECTED_ADVERTISING_TIMEOUT = 0x3C |
| CONNECTION_TERMINATED_MIC_FAILURE = 0x3D |
| CONNECTION_FAILED_TO_BE_ESTABLISHED = 0x3E |
| MAC_CONNECTION_FAILED = 0x3F |
| COARSE_CLOCK_ADJUSTMENT_REJECTED = 0x40 |
| # 5.0 |
| TYPE_0_SUBMAP_NOT_DEFINED = 0x41 |
| UNKNOWN_ADVERTISING_IDENTIFIER = 0x42 |
| LIMIT_REACHED = 0x43 |
| OPERATION_CANCELLED_BY_HOST = 0x44 |
| |
| |
| enum OpCode: |
| -- HCI Command OpCodes. See Core Spec v5.0, Vol 2, Part E, Section 7 for definitions. |
| |
| [maximum_bits: 16] |
| |
| UNSPECIFIED = 0x0000 |
| -- No OpCode set |
| |
| ### Link Control Commands - Core Spec v5.0, Vol 2, Part E, Section 7.1 (OGF 0x01) |
| |
| INQUIRY = 0x0401 |
| -- Inquiry Command (v1.1) (BR/EDR) |
| |
| INQUIRY_CANCEL = 0x0402 |
| -- Inquiry Cancel Command (v1.1) (BR/EDR) |
| |
| CREATE_CONNECTION = 0x0405 |
| -- Create Connection (v1.1) (BR/EDR) |
| |
| DISCONNECT = 0x0406 |
| -- Disconnect Command (v1.1) (BR/EDR & LE) |
| |
| CREATE_CONNECTION_CANCEL = 0x0408 |
| -- Create Connection Cancel (v1.1) (BR/EDR) |
| |
| ACCEPT_CONNECTION_REQUEST = 0x0409 |
| -- Accept Connection Request (v1.1) (BR/EDR) |
| |
| REJECT_CONNECTION_REQUEST = 0x040A |
| -- Reject Connection Request (v1.1) (BR/EDR) |
| |
| LINK_KEY_REQUEST_REPLY = 0x040B |
| -- Link Key Request Reply Command (v1.1) (BR/EDR) |
| |
| LINK_KEY_REQUEST_NEGATIVE_REPLY = 0x040C |
| -- Link Key Request Negative Reply Command (v1.1) (BR/EDR) |
| |
| AUTHENTICATION_REQUESTED = 0x0411 |
| -- Authentication Requested Command (v1.1) (BR/EDR) |
| |
| SET_CONNECTION_ENCRYPTION = 0x0413 |
| -- Set Connection Encryption Command (v1.1) (BR/EDR) |
| |
| REMOTE_NAME_REQUEST = 0x0419 |
| -- Remote Name Request Command (v1.1) (BR/EDR) |
| |
| READ_REMOTE_SUPPORTED_FEATURES = 0x041B |
| -- Read Remote Supported Features Command (v1.1) (BR/EDR) |
| |
| READ_REMOTE_EXTENDED_FEATURES = 0x041C |
| -- Read Remote Extended Features Command (v1.2) (BR/EDR) |
| |
| READ_REMOTE_VERSION_INFO = 0x041D |
| -- Read Remote Version Information Command (v1.1) (BR/EDR & LE) |
| |
| IO_CAPABILITY_REQUEST_REPLY = 0x042B |
| -- IO Capability Request Reply Command (v2.1 + EDR) (BR/EDR) |
| |
| USER_CONFIRMATION_REQUEST_REPLY = 0x042C |
| -- User Confirmation Request Reply Command (v2.1 + EDR) (BR/EDR) |
| |
| USER_PASSKEY_REQUEST_REPLY = 0x042E |
| -- User Passkey Request Reply Command (v2.1 + EDR) (BR/EDR) |
| |
| USER_PASSKEY_REQUEST_NEGATIVE_REPLY = 0x042F |
| -- User Passkey Request Negative Reply Command (v2.1 + EDR) (BR/EDR) |
| |
| IO_CAPABILITY_REQUEST_NEGATIVE_REPLY = 0x0434 |
| -- IO Capability Request Negative Reply Command (v2.1 + EDR) (BR/EDR) |
| |
| ### Controller & Baseband Commands - Core Spec v5.0 Vol 2, Part E, Section 7.3 (OGF 0x03) |
| |
| SET_EVENT_MASK = 0x0C01 |
| -- Set Event Mask Command (v1.1) |
| |
| RESET = 0x0C03 |
| -- Reset Command (v1.1) |
| |
| WRITE_LOCAL_NAME = 0x0C13 |
| -- Write Local Name Command (v1.1) (BR/EDR) |
| |
| READ_LOCAL_NAME = 0x0C14 |
| -- Read Local Name Command (v1.1) (BR/EDR) |
| |
| WRITE_PAGE_TIMEOUT = 0x0C18 |
| -- Write Page Timeout Command (v1.1) (BR/EDR) |
| |
| READ_SCAN_ENABLE = 0x0C19 |
| -- Read Scan Enable Command (v1.1) (BR/EDR) |
| |
| WRITE_SCAN_ENABLE = 0x0C1A |
| -- Write Scan Enable Command (v1.1) (BR/EDR) |
| |
| READ_PAGE_SCAN_ACTIVITY = 0x0C1B |
| -- Read Page Scan Activity Command (v1.1) (BR/EDR) |
| |
| WRITE_PAGE_SCAN_ACTIVITY = 0x0C1C |
| -- Write Page Scan Activity Command (v1.1) (BR/EDR) |
| |
| READ_INQUIRY_SCAN_ACTIVITY = 0x0C1D |
| -- Read Inquiry Scan Activity Command (v1.1) (BR/EDR) |
| |
| READ_CLASS_OFDEVICE = 0x0C23 |
| -- Read Class of Device Command (v1.1) (BR/EDR) |
| |
| WRITE_CLASS_OFDEVICE = 0x0C24 |
| -- Write Class Of Device Command (v1.1) (BR/EDR) |
| |
| READ_TRANSMIT_POWER_LEVEL = 0x0C2D |
| -- Read Transmit Transmit Power Level Command (v1.1) (BR/EDR & LE) |
| |
| READ_INQUIRY_SCAN_TYPE = 0x0C42 |
| -- Read Inquiry Scan Type (v1.2) (BR/EDR) |
| |
| WRITE_INQUIRY_SCAN_TYPE = 0x0C43 |
| -- Write Inquiry Scan Type (v1.2) (BR/EDR) |
| |
| READ_INQUIRY_MODE = 0x0C44 |
| -- Read Inquiry Mode (v1.2) (BR/EDR) |
| |
| WRITE_INQUIRY_MODE = 0x0C45 |
| -- Write Inquiry Mode (v1.2) (BR/EDR) |
| |
| READ_PAGE_SCAN_TYPE = 0x0C46 |
| -- Read Page Scan Type (v1.2) (BR/EDR) |
| |
| WRITE_PAGE_SCAN_TYPE = 0x0C47 |
| -- Write Page Scan Type (v1.2) (BR/EDR) |
| |
| READ_SIMPLE_PAIRING_MODE = 0x0C55 |
| -- Read Simple Pairing Mode (v2.1 + EDR) (BR/EDR) |
| |
| WRITE_SIMPLE_PAIRING_MODE = 0x0C56 |
| -- Write Simple Pairing Mode (v2.1 + EDR) (BR/EDR) |
| |
| SET_EVENT_MASK_PAGE2 = 0x0C63 |
| -- Set Event Mask Page 2 Command (v3.0 + HS) |
| |
| READ_FLOW_CONTROL_MODE = 0x0C66 |
| -- Read Flow Control Mode Command (v3.0 + HS) (BR/EDR & AMP) |
| |
| WRITE_FLOW_CONTROL_MODE = 0x0C67 |
| -- Write Flow Control Mode Command (v3.0 + HS) (BR/EDR & AMP) |
| |
| READ_LE_HOST_SUPPORT = 0x0C6C |
| -- Read LE Host Support Command (v4.0) (BR/EDR) |
| |
| WRITE_LE_HOST_SUPPORT = 0x0C6D |
| -- Write LE Host Support Command (v4.0) (BR/EDR) |
| |
| ### Informational Parameters - Core Spec v5.0 Vol 2, Part E, Section 7.4 (OGF 0x04) |
| |
| READ_LOCAL_VERSION_INFO = 0x1001 |
| -- Read Local Version Information Command (v1.1) |
| |
| READ_LOCAL_EXTENDED_FEATURES = 0x1004 |
| -- Read Local Extended Features Command (v1.2) (BR/EDR) |
| |
| READ_BUFFER_SIZE = 0x1005 |
| -- Read Buffer Size Command (v1.1) |
| |
| READ_BD_ADDR = 0x1009 |
| -- Read BD_ADDR Command (v1.1) (BR/EDR, LE) |
| |
| READ_DATA_BLOCK_SIZE = 0x100A |
| -- Read Data Block Size Command (v3.0 + HS) (BR/EDR & AMP) |
| |
| ### Status Parameters - Core Spec v5.0, Vol 2, Part E, Section 7.5 (OGF 0x05) |
| |
| READ_RSSI = 0x1405 |
| -- Read RSSI Command (v1.1) |
| |
| READ_ENCRYPTION_KEY_SIZE = 0x1408 |
| -- Read Encryption Key Size (v1.1) (BR/EDR) |
| |
| ### LE Controller Commands - Core Spec v5.0 Vol 2, Part E, Section 7.8 (OGF 0x08) |
| |
| LE_SET_EVENT_MASK = 0x2001 |
| -- LE Set Event Mask Command (v4.0) (LE) |
| |
| LE_READ_BUFFER_SIZE_V1 = 0x2002 |
| -- LE Read Buffer Size [v1] Command (v4.0) (LE) |
| |
| LE_SET_RANDOM_ADDRESS = 0x2005 |
| -- LE Set Random Address Command (v4.0) (LE) |
| |
| LE_SET_ADVERTISING_DATA = 0x2008 |
| -- LE Set Advertising Data Command (v4.0) (LE) |
| |
| LE_SET_SCAN_RESPONSE_DATA = 0x2009 |
| -- LE Set Scan Response Data Command (v4.0) (LE) |
| |
| LE_SET_ADVERTISING_ENABLE = 0x200A |
| -- LE Set Advertising Enable Command (v4.0) (LE) |
| |
| LE_SET_SCAN_PARAMETERS = 0x200B |
| -- LE Set Scan Parameters Command (v4.0) (LE) |
| |
| LE_SET_SCAN_ENABLE = 0x200C |
| -- LE Set Scan Enable Command (v4.0) (LE) |
| |
| LE_CREATE_CONNECTION = 0x200D |
| -- LE Create Connection Command (v4.0) (LE) |
| |
| LE_CREATE_CONNECTION_CANCEL = 0x200E |
| -- LE Create Connection Cancel Command (v4.0) (LE) |
| |
| LE_CLEAR_FILTER_ACCEPT_LIST = 0x2010 |
| -- LE Clear Filter Accept List Command (v4.0) (LE) |
| |
| LE_CONNECTION_UPDATE = 0x2013 |
| -- LE Connection Update Command (v4.0) (LE) |
| |
| LE_READ_CHANNEL_MAP = 0x2015 |
| -- LE Read Channel Map Command (v4.0) (LE) |
| |
| LE_READ_REMOTE_FEATURES = 0x2016 |
| -- LE Read Remote Features Command (v4.0) (LE) |
| |
| LE_ENCRYPT = 0x2017 |
| -- LE Encrypt Command (v4.0) (LE) |
| |
| LE_RAND = 0x2018 |
| -- LE Rand Command (v4.0) (LE) |
| |
| LE_START_ENCRYPTION = 0x2019 |
| -- LE Start Encryption Command (v4.0) (LE) |
| |
| LE_LONG_TERM_KEY_REQUEST_REPLY = 0x201A |
| -- LE Long Term Key Request Reply Command (v4.0) (LE) |
| |
| LE_READ_SUPPORTED_STATES = 0x201C |
| -- LE Read Supported States Command (v4.0) (LE) |
| |
| LE_RECEIVER_TEST = 0x201D |
| -- LE Receiver Test Command (v4.0) (LE) |
| |
| LE_TRANSMITTER_TEST = 0x201E |
| -- LE Transmitter Test Command (v4.0) (LE) |
| |
| LE_TEST_END = 0x201F |
| -- LE Test End Command (v4.0) (LE) |
| |
| LE_SET_DATA_LENGTH = 0x2022 |
| -- LE Set Data Length Command (v4.2) (LE) |
| |
| LE_READ_LOCAL_P256_PUBLIC_KEY = 0x2025 |
| -- LE Read Local P-256 Public Key Command (v4.2) (LE) |
| |
| LE_GENERATE_DH_KEY = 0x2026 |
| -- LE Generate DH Key Command (v4.2) (LE) |
| |
| LE_CLEAR_RESOLVING_LIST = 0x2029 |
| -- LE Clear Resolving List Command (v4.2) (LE) |
| |
| LE_READ_RESOLVING_LIST_SIZE = 0x202A |
| -- LE Read Resolving List Size Command (v4.2) (LE) |
| |
| LE_READ_MAXIMUM_DATA_LENGTH = 0x202F |
| -- LE Read Maximum Data Length Command (v4.2) (LE) |
| |
| LE_READ_PHY = 0x2030 |
| -- LE Read PHY Command (v5.0) (LE) |
| |
| LE_SET_DEFAULT_PHY = 0x2031 |
| -- LE Set Default PHY Command (v5.0) (LE) |
| |
| LE_SET_PHY = 0x2032 |
| -- LE Set PHY Command (v5.0) (LE) |
| |
| LE_ENHANCED_RECEIVER_TEXT = 0x2033 |
| -- LE Enhanced Receiver Test Command (v5.0) (LE) |
| |
| LE_ENHANCED_TRANSMITTER_TEST = 0x2034 |
| -- LE Enhanced Transmitter Test Command (v5.0) (LE) |
| |
| LE_REMOVE_ADVERTISING_SET = 0x203C |
| -- LE Remove Advertising Set Command (v5.0) (LE) |
| |
| LE_CLEAR_ADVERTISING_SETS = 0x203D |
| -- LE Clear Advertising Sets Command (v5.0) (LE) |
| |
| LE_SET_EXTENDED_SCAN_ENABLE = 0x2042 |
| -- LE Set Extended Scan Enable Command (v5.0) (LE) |
| |
| LE_READ_TRANSMIT_POWER = 0x204B |
| -- LE Read Transmit Power Command (v5.0) (LE) |
| |
| LE_READ_RF_PATH_COMPENSATION = 0x204C |
| -- LE Read RF Path Compensation Command (v5.0) (LE) |
| |
| LE_WRITE_RF_PATH_COMPENSATION = 0x204D |
| -- LE Write RF Path Compensation Command (v5.0) (LE) |
| |
| LE_SET_PRIVACY_MODE = 0x204E |
| -- LE Set Privacy Mode Command (v5.0) (LE) |
| |
| LE_SET_PERIODIC_ADVERTISING_RECEIVE_ENABLE = 0x2059 |
| -- LE Set Periodic Advertising Receive Enable Command (v5.1) (LE) |
| |
| LE_PERIODIC_ADVERTISING_SYNC_TRANSFER = 0x205A |
| -- LE Periodic Advertising Sync Transfer Command (v5.1) (LE) |
| |
| LE_PERIODIC_ADVERTISING_SET_INFO_TRANSFER = 0x205B |
| -- LE Periodic Advertising Set Info Transfer Command (v5.1) (LE) |
| |
| LE_SET_PERIODIC_ADVERTISING_SYNC_TRANSFER_PARAMETERS = 0x205C |
| -- LE Set Periodic Advertising Sync Transfer Parameters Command (v5.1) (LE) |
| |
| LE_SET_DEFAULT_PERIODIC_ADVERTISING_SYNC_TRANSFER_PARAMETERS = 0x205D |
| -- LE Set Default Periodic Advertising Sync Transfer Parameters Command (v5.1) (LE) |
| |
| LE_MODIFY_SLEEP_CLOCK_ACCURACY = 0x205F |
| -- LE Modify Sleep Clock Accuracy Command (v5.1) (LE) |
| |
| LE_READ_BUFFER_SIZE_V2 = 0x2060 |
| -- LE Read Buffer Size [v2] Command (v5.2) (LE) |
| |
| LE_READ_ISO_TX_SYNC = 0x2061 |
| -- LE Read ISO TX Sync Command (v5.2) (LE) |
| |
| LE_SET_CIG_PARAMETERS = 0x2062 |
| -- LE Set CIG Parameters Command (v5.2) (LE) |
| |
| LE_SET_CIG_PARAMETERS_TEST = 0x2063 |
| -- LE Set CIG Parameters Test Command (v5.2) (LE) |
| |
| LE_CREATE_CIS = 0x2064 |
| -- LE Create CIS Command (v5.2) (LE) |
| |
| LE_REMOVE_CIG = 0x2065 |
| -- LE Remove CIG Command (v5.2) (LE) |
| |
| LE_ACCEPT_CIS_REQUEST = 0x2066 |
| -- LE Accept CIS Request Command (v5.2) (LE) |
| |
| LE_REJECT_CIS_REQUEST = 0x2067 |
| -- LE Reject CIS Request Command (v5.2) (LE) |
| |
| LE_CREATE_BIG = 0x2068 |
| -- LE Create BIG Command (v5.2) (LE) |
| |
| LE_CREATE_BIG_TEST = 0x2069 |
| -- LE Create BIG Test Command (v5.2) (LE) |
| |
| LE_TERMINATE_BIG = 0x206A |
| -- LE Terminate BIG Command (v5.2) (LE) |
| |
| LE_BIG_CREATE_SYNC = 0x206B |
| -- LE BIG Create Sync Command (v5.2) (LE) |
| |
| LE_BIG_TERMINATE_SYNC = 0x206C |
| -- LE BIG Terminate Sync Command (v5.2) (LE) |
| |
| LE_REQUEST_PEER_SCA = 0x206D |
| -- LE Request Peer SCA Command (v5.2) (LE) |
| |
| LE_SETUP_ISO_DATA_PATH = 0x206E |
| -- LE Setup ISO Data Path Command (v5.2) (LE) |
| |
| LE_REMOVE_ISO_DATA_PATH = 0x206F |
| -- LE Remove ISO Data Path Command (v5.2) (LE) |
| |
| LE_ISO_TRANSMIT_TEST = 0x2070 |
| -- LE ISO Transmit Test Command (v5.2) (LE) |
| |
| LE_ISO_RECEIVE_TEST = 0x2071 |
| -- LE ISO Receive Test Command (v5.2) (LE) |
| |
| LE_ISO_READ_TEST_COUNTERS = 0x2072 |
| -- LE ISO Read Test Counters Command (v5.2) (LE) |
| |
| LE_ISO_TEST_END = 0x2073 |
| -- LE ISO Test End Command (v5.2) (LE) |
| |
| LE_SET_HOST_FEATURE = 0x2074 |
| -- LE Set Host Feature Command (v5.2) (LE) |
| |
| LE_READ_ISO_LINK_QUALITY = 0x2075 |
| -- LE Read ISO Link Quality Command (v5.2) (LE) |
| |
| |
| enum MajorDeviceClass: |
| [maximum_bits: 5] |
| MISCELLANEOUS = 0x00 |
| COMPUTER = 0x01 |
| PHONE = 0x02 |
| LAN = 0x03 |
| AUDIO_VIDEO = 0x04 |
| PERIPHERAL = 0x05 |
| IMAGING = 0x06 |
| WEARABLE = 0x07 |
| TOY = 0x08 |
| HEALTH = 0x09 |
| UNCATEGORIZED = 0x1F |
| |
| |
| bits MajorServiceClasses: |
| 0 [+1] Flag limited_discoverable_mode |
| $next [+1] Flag le_audio |
| $next [+1] Flag reserved |
| $next [+1] Flag positioning |
| $next [+1] Flag networking |
| $next [+1] Flag rendering |
| $next [+1] Flag capturing |
| $next [+1] Flag object_transfer |
| $next [+1] Flag audio |
| $next [+1] Flag telephony |
| $next [+1] Flag information |
| |
| |
| enum ComputerMinorDeviceClass: |
| [maximum_bits: 6] |
| UNCATEGORIZED = 0x00 |
| DESKTOP_WORKSTATION = 0x01 |
| SERVER_CLASS = 0x02 |
| LAPTOP = 0x03 |
| HANDHELD_PC = 0x04 |
| PALM_SIZE_PC = 0x05 |
| WEARABLE = 0x06 |
| TABLET = 0x07 |
| |
| |
| enum PhoneMinorDeviceClass: |
| [maximum_bits: 6] |
| UNCATEGORIZED = 0x00 |
| CELLULAR = 0x01 |
| CORDLESS = 0x02 |
| SMARTPHONE = 0x03 |
| WIRED_MODEM_OR_VOID_GATEWAY = 0x04 |
| COMMON_ISDN_ACCESS = 0x05 |
| |
| |
| enum LANMinorDeviceClass: |
| [maximum_bits: 6] |
| FULLY_AVAILABLE = 0x00 |
| UTILIZED_1_TO_17 = 0x08 |
| UTILIZED_17_TO_33 = 0x10 |
| UTILIZED_33_TO_50 = 0x18 |
| UTILIZED_50_TO_67 = 0x20 |
| UTILIZED_67_TO_83 = 0x28 |
| UTILIZED_83_TO_99 = 0x30 |
| NO_SERVICE_AVAILABLE = 0x38 |
| |
| |
| enum AudioVideoMinorDeviceClass: |
| [maximum_bits: 6] |
| UNCATEGORIZED = 0x00 |
| WEARABLE_HEADSET_DEVICE = 0x01 |
| HANDS_FREE_DEVICE = 0x02 |
| RESERVED_0 = 0x03 |
| MICROPHONE = 0x04 |
| LOUDSPEAKER = 0x05 |
| HEADPHONES = 0x06 |
| PORTABLE_AUDIO = 0x07 |
| CAR_AUDIO = 0x08 |
| SET_TOP_BOX = 0x09 |
| HIFI_AUDIO_DEVICE = 0x0A |
| VCR = 0x0B |
| VIDEO_CAMERA = 0x0C |
| CAMCORDER = 0x0D |
| VIDEO_MONITOR = 0x0E |
| VIDEO_DISPLAY_AND_LOUDSPEAKER = 0x0F |
| VIDEO_CONFERENCING = 0x10 |
| RESERVED_1 = 0x11 |
| GAMING_TOY = 0x12 |
| |
| |
| enum PeripheralMinorDeviceClass0: |
| [maximum_bits: 4] |
| UNCATEGORIZED = 0x00 |
| JOYSTICK = 0x01 |
| GAMEPAD = 0x02 |
| REMOTE_CONTROL = 0x03 |
| SENSING_DEVICE = 0x04 |
| DIGITIZER_TABLET = 0x05 |
| CARD_READER = 0x06 |
| DIGITAL_PEN = 0x07 |
| HANDHELD_SCANNER = 0x08 |
| HANDHELD_GESTURAL_INPUT_DEVICE = 0x09 |
| |
| |
| enum PeripheralMinorDeviceClass1: |
| [maximum_bits: 2] |
| UNCATEGORIZED = 0x00 |
| KEYBOARD = 0x01 |
| POINTING_DEVICE = 0x02 |
| COMBO_KEYBOARD_POINTING_DEVICE = 0x03 |
| |
| |
| bits PeripheralMinorDeviceClass: |
| 0 [+4] PeripheralMinorDeviceClass0 device_class_0 |
| $next [+2] PeripheralMinorDeviceClass1 device_class_1 |
| |
| |
| enum ImagingMinorDeviceClass: |
| [maximum_bits: 2] |
| UNCATEGORIZED = 0x00 |
| |
| |
| bits ImagingMinorDeviceClassBits: |
| 0 [+2] ImagingMinorDeviceClass device_class |
| $next [+1] Flag display |
| $next [+1] Flag camera |
| $next [+1] Flag scanner |
| $next [+1] Flag printer |
| |
| |
| enum WearableMinorDeviceClass: |
| [maximum_bits: 6] |
| WRISTWATCH = 0x01 |
| PAGER = 0x02 |
| JACKET = 0x03 |
| HELMET = 0x04 |
| GLASSES = 0x05 |
| |
| |
| enum ToyMinorDeviceClass: |
| [maximum_bits: 6] |
| ROBOT = 0x01 |
| VEHICLE = 0x02 |
| DOLL = 0x03 |
| CONTROLLER = 0x04 |
| GAME = 0x05 |
| |
| |
| enum HealthMinorDeviceClass: |
| [maximum_bits: 6] |
| UNDEFINED = 0x00 |
| BLOOD_PRESSURE_MONITOR = 0x01 |
| THERMOMETER = 0x02 |
| WEIGHING_SCALE = 0x03 |
| GLUCOSE_METER = 0x04 |
| PULSE_OXIMETER = 0x05 |
| HEART_PULSE_RATE_MONITOR = 0x06 |
| HEALTH_DATA_DISPLAY = 0x07 |
| STEP_COUNTER = 0x08 |
| BODY_COMPOSITION_ANALYZER = 0x09 |
| PEAK_FLOW_MONITOR = 0x0A |
| MEDICATION_MONITOR = 0x0B |
| KNEE_PROSTHESIS = 0x0C |
| ANKLE_PROSTHESIS = 0x0D |
| GENERIC_HEALTH_MANAGER = 0x0E |
| PERSONAL_MOBILITY_DEVICE = 0x0F |
| |
| |
| enum GenericEnableParam: |
| -- Binary values that can be generically passed to HCI commands that expect a |
| -- 1-octet boolean "enable"/"disable" parameter. |
| [maximum_bits: 8] |
| DISABLE = 0x00 |
| ENABLE = 0x01 |
| |
| |
| enum GenericPresenceParam: |
| [maximum_bits: 8] |
| NOT_PRESENT = 0x00 |
| PRESENT = 0x01 |
| |
| |
| struct BdAddr: |
| -- Bluetooth Device Address |
| 0 [+6] UInt bd_addr |
| |
| |
| bits ClassOfDevice: |
| -- Defined in Assigned Numbers for the Baseband |
| -- https://www.bluetooth.com/specifications/assigned-numbers/baseband |
| 0 [+2] UInt zero |
| [requires: this == 0] |
| |
| if major_device_class == MajorDeviceClass.COMPUTER: |
| 2 [+6] ComputerMinorDeviceClass computer_minor_device_class |
| |
| if major_device_class == MajorDeviceClass.PHONE: |
| 2 [+6] PhoneMinorDeviceClass phone_minor_device_class |
| |
| if major_device_class == MajorDeviceClass.LAN: |
| 2 [+6] LANMinorDeviceClass lan_minor_device_class |
| |
| if major_device_class == MajorDeviceClass.AUDIO_VIDEO: |
| 2 [+6] AudioVideoMinorDeviceClass audio_video_minor_device_class |
| |
| if major_device_class == MajorDeviceClass.PERIPHERAL: |
| 2 [+6] PeripheralMinorDeviceClass peripheral_minor_device_class |
| |
| if major_device_class == MajorDeviceClass.IMAGING: |
| 2 [+6] ImagingMinorDeviceClassBits imaging_minor_device_class |
| |
| if major_device_class == MajorDeviceClass.WEARABLE: |
| 2 [+6] WearableMinorDeviceClass wearable_minor_device_class |
| |
| if major_device_class == MajorDeviceClass.TOY: |
| 2 [+6] ToyMinorDeviceClass toy_minor_device_class |
| |
| if major_device_class == MajorDeviceClass.HEALTH: |
| 2 [+6] HealthMinorDeviceClass health_minor_device_class |
| |
| 8 [+5] MajorDeviceClass major_device_class |
| $next [+11] MajorServiceClasses major_service_classes |
| |
| |
| enum ConnectionRole: |
| [maximum_bits: 8] |
| CENTRAL = 0x00 |
| PERIPHERAL = 0x01 |
| |
| |
| enum LEAdvertisingType: |
| [maximum_bits: 8] |
| CONNECTABLE_AND_SCANNABLE_UNDIRECTED = 0x00 |
| -- ADV_IND |
| |
| CONNECTABLE_HIGH_DUTY_CYCLE_DIRECTED = 0x01 |
| -- ADV_DIRECT_IND |
| |
| SCANNABLE_UNDIRECTED = 0x02 |
| -- ADV_SCAN_IND |
| |
| NOT_CONNECTABLE_UNDIRECTED = 0x03 |
| -- ADV_NONCONN_IND |
| |
| CONNECTABLE_LOW_DUTY_CYCLE_DIRECTED = 0x04 |
| -- ADV_DIRECT_IND |
| |
| |
| enum LEOwnAddressType: |
| -- Possible values that can be used for the |own_address_type| parameter in various LE packets. |
| |
| [maximum_bits: 8] |
| |
| PUBLIC = 0x00 |
| -- Public Device Address |
| |
| RANDOM = 0x01 |
| -- Random Device Address |
| |
| PRIVATE_DEFAULT_TO_PUBLIC = 0x02 |
| -- Controller generates the Resolvable Private Address based on the local IRK from the resolving |
| -- list. If the resolving list contains no matching entry, then use the public address. |
| |
| PRIVATE_DEFAULT_TO_RANDOM = 0x03 |
| -- Controller generates the Resolvable Private Address based on the local IRK from the resolving |
| -- list. If the resolving list contains no matching entry, then use the random address from |
| -- LE_Set_Random_Address. |
| |
| |
| enum LEPeerAddressType: |
| -- Possible values that can be used for the address_type parameters in various |
| -- HCI commands |
| [maximum_bits: 8] |
| PUBLIC = 0x00 |
| RANDOM = 0x01 |
| ANONYMOUS = 0xFF |
| |
| |
| enum LEPeerAddressTypeNoAnon: |
| -- Possible values that can be used for the address_type parameters in various |
| -- HCI commands |
| [maximum_bits: 8] |
| PUBLIC = 0x00 |
| RANDOM = 0x01 |
| |
| |
| bits ClockOffset: |
| -- Clock Offset. The lower 15 bits are set to the clock offset as retrieved |
| -- by an Inquiry. The highest bit is set to 1 if the rest of this parameter |
| -- is valid. |
| 15 [+1] Flag valid |
| if valid: |
| 0 [+15] UInt clock_offset |
| |
| |
| enum LEPrimaryAdvertisingPHY: |
| [maximum_bits: 8] |
| LE_1M = 0x01 |
| LE_CODED = 0x03 |
| LE_CODED_S2 = 0x04 |
| |
| |
| enum LESecondaryAdvertisingPHY: |
| [maximum_bits: 8] |
| NONE = 0x00 |
| LE_1M = 0x01 |
| LE_2M = 0x02 |
| LE_CODED = 0x03 |
| LE_CODED_S2 = 0x04 |
| |
| |
| enum LEAddressType: |
| -- Possible values that can be reported for various |*_address_type| parameters in various LE |
| -- packets. |
| [maximum_bits: 8] |
| PUBLIC = 0x00 |
| -- Public Device Address (default) |
| |
| RANDOM = 0x01 |
| -- Random Device Address |
| |
| PUBLIC_IDENTITY = 0x02 |
| -- Public Identity Address (corresponds to Resolved Private Address) |
| |
| RANDOM_IDENTITY = 0x03 |
| -- Random (static) Identity Address (corresponds to Resolved Private Address) |
| |
| |
| enum LEExtendedAddressType: |
| -- Possible values that can be reported for various |*_address_type| parameters in various LE |
| -- packets. |
| [maximum_bits: 8] |
| PUBLIC = 0x00 |
| -- Public Device Address (default) |
| |
| RANDOM = 0x01 |
| -- Random Device Address |
| |
| PUBLIC_IDENTITY = 0x02 |
| -- Public Identity Address (corresponds to Resolved Private Address) |
| |
| RANDOM_IDENTITY = 0x03 |
| -- Random (static) Identity Address (corresponds to Resolved Private Address) |
| |
| ANONYMOUS = 0xFF |
| -- No address provided (anonymous advertisement) |
| -- This is a special value that is only used in LE Advertising Report events. |
| |
| |
| bits LEAdvertisingChannels: |
| 0 [+1] Flag channel_37 |
| $next [+1] Flag channel_38 |
| $next [+1] Flag channel_39 |
| |
| |
| enum LEAdvertisingFilterPolicy: |
| [maximum_bits: 8] |
| |
| ALLOW_ALL = 0x00 |
| -- Process scan and connection requests from all devices (i.e., the Filter |
| -- Accept List is not in use) (default). |
| |
| ALLOW_ALL_CONNECTIONS_AND_USE_FILTER_ACCEPT_LIST_FOR_SCANS = 0x01 |
| -- Process connection requests from all devices and scan requests only from |
| -- devices that are in the Filter Accept List. |
| |
| ALLOW_ALL_SCANS_AND_USE_FILTER_ACCEPT_LIST_FOR_CONNECTIONS = 0x02 |
| -- Process scan requests from all devices and connection requests only from |
| -- devices that are in the Filter Accept List. |
| |
| ALLOW_FILTER_ACCEPT_LIST_ONLY = 0x03 |
| -- Process scan and connection requests only from devices in the Filter |
| -- Accept List. |
| |
| |
| enum PageScanRepetitionMode: |
| -- The page scan repetition mode, representing a maximum time between Page Scans. |
| -- (See Core Spec v5.0, Volume 2, Part B, Section 8.3.1) |
| [maximum_bits: 8] |
| R0_ = 0x00 # Continuous Scan |
| R1_ = 0x01 # <= 1.28s |
| R2_ = 0x02 # <= 2.56s |
| |
| |
| enum CodingFormat: |
| -- Coding formats from assigned numbers. |
| -- (https://www.bluetooth.com/specifications/assigned-numbers/host-controller-interface) |
| [maximum_bits: 8] |
| U_LAW = 0x00 |
| A_LAW = 0x01 |
| CVSD = 0x02 |
| TRANSPARENT = 0x03 |
| LINEAR_PCM = 0x04 |
| MSBC = 0x05 |
| LC3 = 0x06 |
| G729A = 0x07 |
| VENDOR_SPECIFIC = 0xFF |
| |
| |
| enum IoCapability: |
| -- All other values reserved for future use. |
| [maximum_bits: 8] |
| DISPLAY_ONLY = 0x00 |
| DISPLAY_YES_NO = 0x01 |
| KEYBOARD_ONLY = 0x02 |
| NO_INPUT_NO_OUTPUT = 0x03 |
| |
| |
| enum LESleepClockAccuracyRange: |
| -- Accuracy of the sleep clock, provided as a range |
| [maximum_bits: 8] |
| PPM_251_TO_500 = 0x00 |
| PPM_151_TO_250 = 0x01 |
| PPM_101_TO_150 = 0x02 |
| PPM_76_TO_100 = 0x03 |
| PPM_51_TO_75 = 0x04 |
| PPM_31_TO_50 = 0x05 |
| PPM_21_TO_30 = 0x06 |
| PPM_0_TO_20 = 0x07 |
| |
| # inclusive-language: disable |
| |
| |
| enum AuthenticationRequirements: |
| -- All options without MITM do not require MITM protection, and a numeric |
| -- comparison with automatic accept is allowed. |
| -- All options with MITM do require MITM protection, and IO capabilities should |
| -- be used to determine the authentication procedure. |
| [maximum_bits: 8] |
| NO_BONDING = 0x00 |
| MITM_NO_BONDING = 0x01 |
| DEDICATED_BONDING = 0x02 |
| MITM_DEDICATED_BONDING = 0x03 |
| GENERAL_BONDING = 0x04 |
| MITM_GENERAL_BONDING = 0x05 |
| |
| # inclusive-language: enable |
| |
| |
| struct LinkKey: |
| 0 [+16] UInt:8[16] value |
| |
| # ========================= HCI packet headers ========================== |
| |
| |
| bits OpCodeBits: |
| # Emboss currently lacks support for default field values and cross-type integral equality. |
| # (https://github.com/google/emboss/issues/21) |
| # (https://github.com/google/emboss/issues/23) |
| # Upon the addition of these features, we will transition OpCodeBits to be a parameterized |
| # field which defaults for each HCI packet type to its corresponding OpCode. |
| 0 [+10] UInt ocf |
| $next [+6] UInt ogf |
| |
| |
| struct CommandHeader: |
| -- HCI Command packet header. |
| 0 [+2] OpCode opcode_full |
| -- Full HCI command opcode. |
| |
| 0 [+2] OpCodeBits opcode |
| -- Access opcode ogf or ocf sub-fields. |
| |
| $next [+1] UInt parameter_total_size |
| |
| |
| struct EventHeader: |
| -- HCI Event packet header. |
| 0 [+1] UInt event_code |
| $next [+1] UInt parameter_total_size |
| |
| |
| struct CommandCompleteEvent: |
| -- Core Spec v5.3 Vol 4, Part E, Section 7.7.14 |
| -- EventHeader.opcode == 0xe |
| let hdr_size = EventHeader.$size_in_bytes |
| 0 [+hdr_size] EventHeader header |
| $next [+1] UInt num_hci_command_packets |
| $next [+2] OpCodeBits command_opcode |
| let event_fixed_size = $size_in_bytes-hdr_size |
| let return_parameters_size = header.parameter_total_size-event_fixed_size |
| |
| |
| struct VendorDebugEvent: |
| -- This opcode is reserved for vendor-specific debugging events. |
| -- See Core Spec v5.3 Vol 4, Part E, Section 5.4.4. |
| let hdr_size = EventHeader.$size_in_bytes |
| 0 [+hdr_size] EventHeader header |
| $next [+1] UInt subevent_code |
| -- The event code for the vendor subevent. |