147f4e325SMatthias Ringwald /* 247f4e325SMatthias Ringwald * Copyright (C) 2015 BlueKitchen GmbH 347f4e325SMatthias Ringwald * 447f4e325SMatthias Ringwald * Redistribution and use in source and binary forms, with or without 547f4e325SMatthias Ringwald * modification, are permitted provided that the following conditions 647f4e325SMatthias Ringwald * are met: 747f4e325SMatthias Ringwald * 847f4e325SMatthias Ringwald * 1. Redistributions of source code must retain the above copyright 947f4e325SMatthias Ringwald * notice, this list of conditions and the following disclaimer. 1047f4e325SMatthias Ringwald * 2. Redistributions in binary form must reproduce the above copyright 1147f4e325SMatthias Ringwald * notice, this list of conditions and the following disclaimer in the 1247f4e325SMatthias Ringwald * documentation and/or other materials provided with the distribution. 1347f4e325SMatthias Ringwald * 3. Neither the name of the copyright holders nor the names of 1447f4e325SMatthias Ringwald * contributors may be used to endorse or promote products derived 1547f4e325SMatthias Ringwald * from this software without specific prior written permission. 1647f4e325SMatthias Ringwald * 4. Any redistribution, use, or modification is done solely for 1747f4e325SMatthias Ringwald * personal benefit and not for any commercial purpose or for 1847f4e325SMatthias Ringwald * monetary gain. 1947f4e325SMatthias Ringwald * 2047f4e325SMatthias Ringwald * THIS SOFTWARE IS PROVIDED BY BLUEKITCHEN GMBH AND CONTRIBUTORS 2147f4e325SMatthias Ringwald * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 2247f4e325SMatthias Ringwald * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 2347f4e325SMatthias Ringwald * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL MATTHIAS 2447f4e325SMatthias Ringwald * RINGWALD OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 2547f4e325SMatthias Ringwald * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 2647f4e325SMatthias Ringwald * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS 2747f4e325SMatthias Ringwald * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED 2847f4e325SMatthias Ringwald * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 2947f4e325SMatthias Ringwald * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF 3047f4e325SMatthias Ringwald * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 3147f4e325SMatthias Ringwald * SUCH DAMAGE. 3247f4e325SMatthias Ringwald * 3347f4e325SMatthias Ringwald * Please inquire about commercial licensing options at 3447f4e325SMatthias Ringwald * [email protected] 3547f4e325SMatthias Ringwald * 3647f4e325SMatthias Ringwald */ 3747f4e325SMatthias Ringwald 3847f4e325SMatthias Ringwald /* 3947f4e325SMatthias Ringwald * bluetooth.h 4047f4e325SMatthias Ringwald * 4147f4e325SMatthias Ringwald * Numbers defined or derived from the official Bluetooth specification 4247f4e325SMatthias Ringwald */ 4347f4e325SMatthias Ringwald 4447f4e325SMatthias Ringwald #ifndef __BLUETOOTH_H 4547f4e325SMatthias Ringwald #define __BLUETOOTH_H 4647f4e325SMatthias Ringwald 4747f4e325SMatthias Ringwald #include <stdint.h> 4847f4e325SMatthias Ringwald 4947f4e325SMatthias Ringwald /** 5047f4e325SMatthias Ringwald * HCI Transport 5147f4e325SMatthias Ringwald */ 5247f4e325SMatthias Ringwald 5347f4e325SMatthias Ringwald /** 5447f4e325SMatthias Ringwald * packet types - used in BTstack and over the H4 UART interface 5547f4e325SMatthias Ringwald */ 5647f4e325SMatthias Ringwald #define HCI_COMMAND_DATA_PACKET 0x01 5747f4e325SMatthias Ringwald #define HCI_ACL_DATA_PACKET 0x02 5847f4e325SMatthias Ringwald #define HCI_SCO_DATA_PACKET 0x03 5947f4e325SMatthias Ringwald #define HCI_EVENT_PACKET 0x04 6047f4e325SMatthias Ringwald 618799c043SMatthias Ringwald // packet header sizes 628799c043SMatthias Ringwald #define HCI_CMD_HEADER_SIZE 3 638799c043SMatthias Ringwald #define HCI_ACL_HEADER_SIZE 4 648799c043SMatthias Ringwald #define HCI_SCO_HEADER_SIZE 3 658799c043SMatthias Ringwald #define HCI_EVENT_HEADER_SIZE 2 668799c043SMatthias Ringwald 6747f4e325SMatthias Ringwald /** 6847f4e325SMatthias Ringwald * HCI Layer 6947f4e325SMatthias Ringwald */ 7047f4e325SMatthias Ringwald 7147f4e325SMatthias Ringwald // 7247f4e325SMatthias Ringwald // Error Codes 7347f4e325SMatthias Ringwald // 7447f4e325SMatthias Ringwald 7547f4e325SMatthias Ringwald // from Bluetooth Core Specification 76616edd56SMatthias Ringwald #define ERROR_CODE_SUCCESS 0x00 7747f4e325SMatthias Ringwald #define ERROR_CODE_UNKNOWN_HCI_COMMAND 0x01 7847f4e325SMatthias Ringwald #define ERROR_CODE_UNKNOWN_CONNECTION_IDENTIFIER 0x02 7947f4e325SMatthias Ringwald #define ERROR_CODE_HARDWARE_FAILURE 0x03 8047f4e325SMatthias Ringwald #define ERROR_CODE_PAGE_TIMEOUT 0x04 8147f4e325SMatthias Ringwald #define ERROR_CODE_AUTHENTICATION_FAILURE 0x05 8247f4e325SMatthias Ringwald #define ERROR_CODE_PIN_OR_KEY_MISSING 0x06 8347f4e325SMatthias Ringwald #define ERROR_CODE_MEMORY_CAPACITY_EXCEEDED 0x07 8447f4e325SMatthias Ringwald #define ERROR_CODE_CONNECTION_TIMEOUT 0x08 8547f4e325SMatthias Ringwald #define ERROR_CODE_CONNECTION_LIMIT_EXCEEDED 0x09 8647f4e325SMatthias Ringwald #define ERROR_CODE_SYNCHRONOUS_CONNECTION_LIMIT_TO_A_DEVICE_EXCEEDED 0x0A 8747f4e325SMatthias Ringwald #define ERROR_CODE_ACL_CONNECTION_ALREADY_EXISTS 0x0B 8847f4e325SMatthias Ringwald #define ERROR_CODE_COMMAND_DISALLOWED 0x0C 8947f4e325SMatthias Ringwald #define ERROR_CODE_CONNECTION_REJECTED_DUE_TO_LIMITED_RESOURCES 0x0D 9047f4e325SMatthias Ringwald #define ERROR_CODE_CONNECTION_REJECTED_DUE_TO_SECURITY_REASONS 0x0E 9147f4e325SMatthias Ringwald #define ERROR_CODE_CONNECTION_REJECTED_DUE_TO_UNACCEPTABLE_BD_ADDR 0x0F 9247f4e325SMatthias Ringwald #define ERROR_CODE_CONNECTION_ACCEPT_TIMEOUT_EXCEEDED 0x10 9347f4e325SMatthias Ringwald #define ERROR_CODE_UNSUPPORTED_FEATURE_OR_PARAMETER_VALUE 0x11 9447f4e325SMatthias Ringwald #define ERROR_CODE_INVALID_HCI_COMMAND_PARAMETERS 0x12 9547f4e325SMatthias Ringwald #define ERROR_CODE_REMOTE_USER_TERMINATED_CONNECTION 0x13 9647f4e325SMatthias Ringwald #define ERROR_CODE_REMOTE_DEVICE_TERMINATED_CONNECTION_DUE_TO_LOW_RESOURCES 0x14 9747f4e325SMatthias Ringwald #define ERROR_CODE_REMOTE_DEVICE_TERMINATED_CONNECTION_DUE_TO_POWER_OFF 0x15 9847f4e325SMatthias Ringwald #define ERROR_CODE_CONNECTION_TERMINATED_BY_LOCAL_HOST 0x16 9947f4e325SMatthias Ringwald #define ERROR_CODE_REPEATED_ATTEMPTS 0x17 10047f4e325SMatthias Ringwald #define ERROR_CODE_PAIRING_NOT_ALLOWED 0x18 10147f4e325SMatthias Ringwald #define ERROR_CODE_UNKNOWN_LMP_PDU 0x19 10247f4e325SMatthias Ringwald #define ERROR_CODE_UNSUPPORTED_REMOTE_FEATURE_UNSUPPORTED_LMP_FEATURE 0x1A 10347f4e325SMatthias Ringwald #define ERROR_CODE_SCO_OFFSET_REJECTED 0x1B 10447f4e325SMatthias Ringwald #define ERROR_CODE_SCO_INTERVAL_REJECTED 0x1C 10547f4e325SMatthias Ringwald #define ERROR_CODE_SCO_AIR_MODE_REJECTED 0x1D 10647f4e325SMatthias Ringwald #define ERROR_CODE_INVALID_LMP_PARAMETERS_INVALID_LL_PARAMETERS 0x1E 10747f4e325SMatthias Ringwald #define ERROR_CODE_UNSPECIFIED_ERROR 0x1F 10847f4e325SMatthias Ringwald #define ERROR_CODE_UNSUPPORTED_LMP_PARAMETER_VALUE_UNSUPPORTED_LL_PARAMETER_VALUE 0x20 10947f4e325SMatthias Ringwald #define ERROR_CODE_ROLE_CHANGE_NOT_ALLOWED 0x21 11047f4e325SMatthias Ringwald #define ERROR_CODE_LMP_RESPONSE_TIMEOUT_LL_RESPONSE_TIMEOUT 0x22 11147f4e325SMatthias Ringwald #define ERROR_CODE_LMP_ERROR_TRANSACTION_COLLISION 0x23 11247f4e325SMatthias Ringwald #define ERROR_CODE_LMP_PDU_NOT_ALLOWED 0x24 11347f4e325SMatthias Ringwald #define ERROR_CODE_ENCRYPTION_MODE_NOT_ACCEPTABLE 0x25 11447f4e325SMatthias Ringwald #define ERROR_CODE_LINK_KEY_CANNOT_BE_CHANGED 0x26 11547f4e325SMatthias Ringwald #define ERROR_CODE_REQUESTED_QOS_NOT_SUPPORTED 0x27 11647f4e325SMatthias Ringwald #define ERROR_CODE_INSTANT_PASSED 0x28 11747f4e325SMatthias Ringwald #define ERROR_CODE_PAIRING_WITH_UNIT_KEY_NOT_SUPPORTED 0x29 11847f4e325SMatthias Ringwald #define ERROR_CODE_DIFFERENT_TRANSACTION_COLLISION 0x2A 11947f4e325SMatthias Ringwald #define ERROR_CODE_RESERVED 0x2B 12047f4e325SMatthias Ringwald #define ERROR_CODE_QOS_UNACCEPTABLE_PARAMETER 0x2C 12147f4e325SMatthias Ringwald #define ERROR_CODE_QOS_REJECTED 0x2D 12247f4e325SMatthias Ringwald #define ERROR_CODE_CHANNEL_CLASSIFICATION_NOT_SUPPORTED 0x2E 12347f4e325SMatthias Ringwald #define ERROR_CODE_INSUFFICIENT_SECURITY 0x2F 12447f4e325SMatthias Ringwald #define ERROR_CODE_PARAMETER_OUT_OF_MANDATORY_RANGE 0x30 12547f4e325SMatthias Ringwald // #define ERROR_CODE_RESERVED 12647f4e325SMatthias Ringwald #define ERROR_CODE_ROLE_SWITCH_PENDING 0x32 12747f4e325SMatthias Ringwald // #define ERROR_CODE_RESERVED 12847f4e325SMatthias Ringwald #define ERROR_CODE_RESERVED_SLOT_VIOLATION 0x34 12947f4e325SMatthias Ringwald #define ERROR_CODE_ROLE_SWITCH_FAILED 0x35 13047f4e325SMatthias Ringwald #define ERROR_CODE_EXTENDED_INQUIRY_RESPONSE_TOO_LARGE 0x36 13147f4e325SMatthias Ringwald #define ERROR_CODE_SECURE_SIMPLE_PAIRING_NOT_SUPPORTED_BY_HOST 0x37 13247f4e325SMatthias Ringwald #define ERROR_CODE_HOST_BUSY_PAIRING 0x38 13347f4e325SMatthias Ringwald #define ERROR_CODE_CONNECTION_REJECTED_DUE_TO_NO_SUITABLE_CHANNEL_FOUND 0x39 13447f4e325SMatthias Ringwald #define ERROR_CODE_CONTROLLER_BUSY 0x3A 13547f4e325SMatthias Ringwald #define ERROR_CODE_UNACCEPTABLE_CONNECTION_PARAMETERS 0x3B 13647f4e325SMatthias Ringwald #define ERROR_CODE_DIRECTED_ADVERTISING_TIMEOUT 0x3C 13747f4e325SMatthias Ringwald #define ERROR_CODE_CONNECTION_TERMINATED_DUE_TO_MIC_FAILURE 0x3D 13847f4e325SMatthias Ringwald #define ERROR_CODE_CONNECTION_FAILED_TO_BE_ESTABLISHED 0x3E 13947f4e325SMatthias Ringwald #define ERROR_CODE_MAC_CONNECTION_FAILED 0x3F 14047f4e325SMatthias Ringwald #define ERROR_CODE_COARSE_CLOCK_ADJUSTMENT_REJECTED_BUT_WILL_TRY_TO_ADJUST_USING_CLOCK_DRAGGING 0x40 14147f4e325SMatthias Ringwald 1428799c043SMatthias Ringwald // HCI roles 1438799c043SMatthias Ringwald #define HCI_ROLE_MASTER 0 1448799c043SMatthias Ringwald #define HCI_ROLE_SLAVE 1 1458799c043SMatthias Ringwald 1468799c043SMatthias Ringwald // packet sizes (max payload) 1478799c043SMatthias Ringwald #define HCI_ACL_DM1_SIZE 17 1488799c043SMatthias Ringwald #define HCI_ACL_DH1_SIZE 27 1498799c043SMatthias Ringwald #define HCI_ACL_2DH1_SIZE 54 1508799c043SMatthias Ringwald #define HCI_ACL_3DH1_SIZE 83 1518799c043SMatthias Ringwald #define HCI_ACL_DM3_SIZE 121 1528799c043SMatthias Ringwald #define HCI_ACL_DH3_SIZE 183 1538799c043SMatthias Ringwald #define HCI_ACL_DM5_SIZE 224 1548799c043SMatthias Ringwald #define HCI_ACL_DH5_SIZE 339 1558799c043SMatthias Ringwald #define HCI_ACL_2DH3_SIZE 367 1568799c043SMatthias Ringwald #define HCI_ACL_3DH3_SIZE 552 1578799c043SMatthias Ringwald #define HCI_ACL_2DH5_SIZE 679 1588799c043SMatthias Ringwald #define HCI_ACL_3DH5_SIZE 1021 1598799c043SMatthias Ringwald 1608799c043SMatthias Ringwald #define HCI_EVENT_PAYLOAD_SIZE 255 1618799c043SMatthias Ringwald #define HCI_CMD_PAYLOAD_SIZE 255 1628799c043SMatthias Ringwald 1638799c043SMatthias Ringwald #define LE_ADVERTISING_DATA_SIZE 31 16447f4e325SMatthias Ringwald 16547f4e325SMatthias Ringwald /** 16647f4e325SMatthias Ringwald * Default INQ Mode 16747f4e325SMatthias Ringwald */ 16847f4e325SMatthias Ringwald #define HCI_INQUIRY_LAP 0x9E8B33L // 0x9E8B33: General/Unlimited Inquiry Access Code (GIAC) 16947f4e325SMatthias Ringwald 17047f4e325SMatthias Ringwald /** 17147f4e325SMatthias Ringwald * SSP IO Capabilities 17247f4e325SMatthias Ringwald */ 17347f4e325SMatthias Ringwald #define SSP_IO_CAPABILITY_DISPLAY_ONLY 0 17447f4e325SMatthias Ringwald #define SSP_IO_CAPABILITY_DISPLAY_YES_NO 1 17547f4e325SMatthias Ringwald #define SSP_IO_CAPABILITY_KEYBOARD_ONLY 2 17647f4e325SMatthias Ringwald #define SSP_IO_CAPABILITY_NO_INPUT_NO_OUTPUT 3 17747f4e325SMatthias Ringwald #define SSP_IO_CAPABILITY_UNKNOWN 0xff 17847f4e325SMatthias Ringwald 17947f4e325SMatthias Ringwald 18047f4e325SMatthias Ringwald /** 18147f4e325SMatthias Ringwald * SSP Authentication Requirements, see IO Capability Request Reply Commmand 18247f4e325SMatthias Ringwald */ 18347f4e325SMatthias Ringwald 18447f4e325SMatthias Ringwald // Numeric comparison with automatic accept allowed. 18547f4e325SMatthias Ringwald #define SSP_IO_AUTHREQ_MITM_PROTECTION_NOT_REQUIRED_NO_BONDING 0x00 18647f4e325SMatthias Ringwald 18747f4e325SMatthias Ringwald // Use IO Capabilities to deter- mine authentication procedure 18847f4e325SMatthias Ringwald #define SSP_IO_AUTHREQ_MITM_PROTECTION_REQUIRED_NO_BONDING 0x01 18947f4e325SMatthias Ringwald 19047f4e325SMatthias Ringwald // Numeric compar- ison with automatic accept allowed. 19147f4e325SMatthias Ringwald #define SSP_IO_AUTHREQ_MITM_PROTECTION_NOT_REQUIRED_DEDICATED_BONDING 0x02 19247f4e325SMatthias Ringwald 19347f4e325SMatthias Ringwald // Use IO Capabilities to determine authentication procedure 19447f4e325SMatthias Ringwald #define SSP_IO_AUTHREQ_MITM_PROTECTION_REQUIRED_DEDICATED_BONDING 0x03 19547f4e325SMatthias Ringwald 19647f4e325SMatthias Ringwald // Numeric Compari- son with automatic accept allowed. 19747f4e325SMatthias Ringwald #define SSP_IO_AUTHREQ_MITM_PROTECTION_NOT_REQUIRED_GENERAL_BONDING 0x04 19847f4e325SMatthias Ringwald 1998799c043SMatthias Ringwald // Use IO capabilities to determine authentication procedure. 20047f4e325SMatthias Ringwald #define SSP_IO_AUTHREQ_MITM_PROTECTION_REQUIRED_GENERAL_BONDING 0x05 20147f4e325SMatthias Ringwald 20247f4e325SMatthias Ringwald 2038799c043SMatthias Ringwald // OGFs 2048799c043SMatthias Ringwald #define OGF_LINK_CONTROL 0x01 2058799c043SMatthias Ringwald #define OGF_LINK_POLICY 0x02 2068799c043SMatthias Ringwald #define OGF_CONTROLLER_BASEBAND 0x03 2078799c043SMatthias Ringwald #define OGF_INFORMATIONAL_PARAMETERS 0x04 2088799c043SMatthias Ringwald #define OGF_STATUS_PARAMETERS 0x05 2098799c043SMatthias Ringwald #define OGF_TESTING 0x06 2108799c043SMatthias Ringwald #define OGF_LE_CONTROLLER 0x08 2118799c043SMatthias Ringwald #define OGF_VENDOR 0x3f 2128799c043SMatthias Ringwald 2138799c043SMatthias Ringwald 21447f4e325SMatthias Ringwald // Events from host controller to host 21547f4e325SMatthias Ringwald 21647f4e325SMatthias Ringwald /** 21747f4e325SMatthias Ringwald * @format 1 21847f4e325SMatthias Ringwald * @param status 21947f4e325SMatthias Ringwald */ 22047f4e325SMatthias Ringwald #define HCI_EVENT_INQUIRY_COMPLETE 0x01 22147f4e325SMatthias Ringwald // no format yet, can contain multiple results 22247f4e325SMatthias Ringwald 22347f4e325SMatthias Ringwald /** 22447f4e325SMatthias Ringwald * @format 1B11132 22547f4e325SMatthias Ringwald * @param num_responses 22647f4e325SMatthias Ringwald * @param bd_addr 22747f4e325SMatthias Ringwald * @param page_scan_repetition_mode 22847f4e325SMatthias Ringwald * @param reserved1 22947f4e325SMatthias Ringwald * @param reserved2 23047f4e325SMatthias Ringwald * @param class_of_device 23147f4e325SMatthias Ringwald * @param clock_offset 23247f4e325SMatthias Ringwald */ 23347f4e325SMatthias Ringwald #define HCI_EVENT_INQUIRY_RESULT 0x02 23447f4e325SMatthias Ringwald 23547f4e325SMatthias Ringwald /** 23647f4e325SMatthias Ringwald * @format 12B11 23747f4e325SMatthias Ringwald * @param status 23847f4e325SMatthias Ringwald * @param connection_handle 23947f4e325SMatthias Ringwald * @param bd_addr 24047f4e325SMatthias Ringwald * @param link_type 24147f4e325SMatthias Ringwald * @param encryption_enabled 24247f4e325SMatthias Ringwald */ 24347f4e325SMatthias Ringwald #define HCI_EVENT_CONNECTION_COMPLETE 0x03 24447f4e325SMatthias Ringwald /** 24547f4e325SMatthias Ringwald * @format B31 24647f4e325SMatthias Ringwald * @param bd_addr 24747f4e325SMatthias Ringwald * @param class_of_device 24847f4e325SMatthias Ringwald * @param link_type 24947f4e325SMatthias Ringwald */ 25047f4e325SMatthias Ringwald #define HCI_EVENT_CONNECTION_REQUEST 0x04 25147f4e325SMatthias Ringwald /** 25247f4e325SMatthias Ringwald * @format 121 25347f4e325SMatthias Ringwald * @param status 25447f4e325SMatthias Ringwald * @param connection_handle 25547f4e325SMatthias Ringwald * @param reason 25647f4e325SMatthias Ringwald */ 25747f4e325SMatthias Ringwald #define HCI_EVENT_DISCONNECTION_COMPLETE 0x05 25847f4e325SMatthias Ringwald /** 25947f4e325SMatthias Ringwald * @format 12 26047f4e325SMatthias Ringwald * @param status 26147f4e325SMatthias Ringwald * @param connection_handle 26247f4e325SMatthias Ringwald */ 26347f4e325SMatthias Ringwald #define HCI_EVENT_AUTHENTICATION_COMPLETE_EVENT 0x06 26447f4e325SMatthias Ringwald /** 26547f4e325SMatthias Ringwald * @format 1BN 26647f4e325SMatthias Ringwald * @param status 26747f4e325SMatthias Ringwald * @param bd_addr 26847f4e325SMatthias Ringwald * @param remote_name 26947f4e325SMatthias Ringwald */ 27047f4e325SMatthias Ringwald #define HCI_EVENT_REMOTE_NAME_REQUEST_COMPLETE 0x07 27147f4e325SMatthias Ringwald /** 27247f4e325SMatthias Ringwald * @format 121 27347f4e325SMatthias Ringwald * @param status 27447f4e325SMatthias Ringwald * @param connection_handle 27547f4e325SMatthias Ringwald * @param encryption_enabled 27647f4e325SMatthias Ringwald */ 27747f4e325SMatthias Ringwald #define HCI_EVENT_ENCRYPTION_CHANGE 0x08 27847f4e325SMatthias Ringwald /** 27947f4e325SMatthias Ringwald * @format 12 28047f4e325SMatthias Ringwald * @param status 28147f4e325SMatthias Ringwald * @param connection_handle 28247f4e325SMatthias Ringwald */ 28347f4e325SMatthias Ringwald #define HCI_EVENT_CHANGE_CONNECTION_LINK_KEY_COMPLETE 0x09 28447f4e325SMatthias Ringwald /** 28547f4e325SMatthias Ringwald * @format 121 28647f4e325SMatthias Ringwald * @param status 28747f4e325SMatthias Ringwald * @param connection_handle 28847f4e325SMatthias Ringwald * @param key_flag 28947f4e325SMatthias Ringwald */ 29047f4e325SMatthias Ringwald #define HCI_EVENT_MASTER_LINK_KEY_COMPLETE 0x0A 29147f4e325SMatthias Ringwald #define HCI_EVENT_READ_REMOTE_SUPPORTED_FEATURES_COMPLETE 0x0B 29247f4e325SMatthias Ringwald #define HCI_EVENT_READ_REMOTE_VERSION_INFORMATION_COMPLETE 0x0C 29347f4e325SMatthias Ringwald #define HCI_EVENT_QOS_SETUP_COMPLETE 0x0D 29447f4e325SMatthias Ringwald 29547f4e325SMatthias Ringwald /** 29647f4e325SMatthias Ringwald * @format 12R 29747f4e325SMatthias Ringwald * @param num_hci_command_packets 29847f4e325SMatthias Ringwald * @param command_opcode 29947f4e325SMatthias Ringwald * @param return_parameters 30047f4e325SMatthias Ringwald */ 30147f4e325SMatthias Ringwald #define HCI_EVENT_COMMAND_COMPLETE 0x0E 30247f4e325SMatthias Ringwald /** 30347f4e325SMatthias Ringwald * @format 112 30447f4e325SMatthias Ringwald * @param status 30547f4e325SMatthias Ringwald * @param num_hci_command_packets 30647f4e325SMatthias Ringwald * @param command_opcode 30747f4e325SMatthias Ringwald */ 30847f4e325SMatthias Ringwald #define HCI_EVENT_COMMAND_STATUS 0x0F 30947f4e325SMatthias Ringwald 31047f4e325SMatthias Ringwald /** 31147f4e325SMatthias Ringwald * @format 121 31247f4e325SMatthias Ringwald * @param hardware_code 31347f4e325SMatthias Ringwald */ 31447f4e325SMatthias Ringwald #define HCI_EVENT_HARDWARE_ERROR 0x10 31547f4e325SMatthias Ringwald 31647f4e325SMatthias Ringwald #define HCI_EVENT_FLUSH_OCCURED 0x11 31747f4e325SMatthias Ringwald 31847f4e325SMatthias Ringwald /** 31947f4e325SMatthias Ringwald * @format 1B1 32047f4e325SMatthias Ringwald * @param status 32147f4e325SMatthias Ringwald * @param bd_addr 32247f4e325SMatthias Ringwald * @param role 32347f4e325SMatthias Ringwald */ 32447f4e325SMatthias Ringwald #define HCI_EVENT_ROLE_CHANGE 0x12 32547f4e325SMatthias Ringwald 32647f4e325SMatthias Ringwald #define HCI_EVENT_NUMBER_OF_COMPLETED_PACKETS 0x13 32747f4e325SMatthias Ringwald #define HCI_EVENT_MODE_CHANGE_EVENT 0x14 32847f4e325SMatthias Ringwald #define HCI_EVENT_RETURN_LINK_KEYS 0x15 32947f4e325SMatthias Ringwald #define HCI_EVENT_PIN_CODE_REQUEST 0x16 33047f4e325SMatthias Ringwald #define HCI_EVENT_LINK_KEY_REQUEST 0x17 33147f4e325SMatthias Ringwald #define HCI_EVENT_LINK_KEY_NOTIFICATION 0x18 33247f4e325SMatthias Ringwald #define HCI_EVENT_DATA_BUFFER_OVERFLOW 0x1A 33347f4e325SMatthias Ringwald #define HCI_EVENT_MAX_SLOTS_CHANGED 0x1B 33447f4e325SMatthias Ringwald #define HCI_EVENT_READ_CLOCK_OFFSET_COMPLETE 0x1C 33547f4e325SMatthias Ringwald #define HCI_EVENT_PACKET_TYPE_CHANGED 0x1D 33647f4e325SMatthias Ringwald 33747f4e325SMatthias Ringwald /** 33847f4e325SMatthias Ringwald * @format 1B11321 33947f4e325SMatthias Ringwald * @param num_responses 34047f4e325SMatthias Ringwald * @param bd_addr 34147f4e325SMatthias Ringwald * @param page_scan_repetition_mode 34247f4e325SMatthias Ringwald * @param reserved 34347f4e325SMatthias Ringwald * @param class_of_device 34447f4e325SMatthias Ringwald * @param clock_offset 34547f4e325SMatthias Ringwald * @param rssi 34647f4e325SMatthias Ringwald */ 34747f4e325SMatthias Ringwald #define HCI_EVENT_INQUIRY_RESULT_WITH_RSSI 0x22 34847f4e325SMatthias Ringwald 34947f4e325SMatthias Ringwald /** 35047f4e325SMatthias Ringwald * @format 1HB111221 35147f4e325SMatthias Ringwald * @param status 35247f4e325SMatthias Ringwald * @param handle 35347f4e325SMatthias Ringwald * @param bd_addr 35447f4e325SMatthias Ringwald * @param link_type 35547f4e325SMatthias Ringwald * @param transmission_interval 35647f4e325SMatthias Ringwald * @param retransmission_interval 35747f4e325SMatthias Ringwald * @param rx_packet_length 35847f4e325SMatthias Ringwald * @param tx_packet_length 35947f4e325SMatthias Ringwald * @param air_mode 36047f4e325SMatthias Ringwald */ 36147f4e325SMatthias Ringwald #define HCI_EVENT_SYNCHRONOUS_CONNECTION_COMPLETE 0x2C 36247f4e325SMatthias Ringwald 36347f4e325SMatthias Ringwald // TODO: serialize extended_inquiry_response and provide parser 36447f4e325SMatthias Ringwald /** 36547f4e325SMatthias Ringwald * @format 1B11321 36647f4e325SMatthias Ringwald * @param num_responses 36747f4e325SMatthias Ringwald * @param bd_addr 36847f4e325SMatthias Ringwald * @param page_scan_repetition_mode 36947f4e325SMatthias Ringwald * @param reserved 37047f4e325SMatthias Ringwald * @param class_of_device 37147f4e325SMatthias Ringwald * @param clock_offset 37247f4e325SMatthias Ringwald * @param rssi 37347f4e325SMatthias Ringwald */ 37447f4e325SMatthias Ringwald #define HCI_EVENT_EXTENDED_INQUIRY_RESPONSE 0x2F 37547f4e325SMatthias Ringwald 37647f4e325SMatthias Ringwald /** 37747f4e325SMatthias Ringwald * @format 1H 37847f4e325SMatthias Ringwald * @param status 37947f4e325SMatthias Ringwald * @param handle 38047f4e325SMatthias Ringwald */ 38147f4e325SMatthias Ringwald #define HCI_EVENT_ENCRYPTION_KEY_REFRESH_COMPLETE 0x30 38247f4e325SMatthias Ringwald 38347f4e325SMatthias Ringwald #define HCI_EVENT_IO_CAPABILITY_REQUEST 0x31 38447f4e325SMatthias Ringwald #define HCI_EVENT_IO_CAPABILITY_RESPONSE 0x32 38547f4e325SMatthias Ringwald #define HCI_EVENT_USER_CONFIRMATION_REQUEST 0x33 38647f4e325SMatthias Ringwald #define HCI_EVENT_USER_PASSKEY_REQUEST 0x34 38747f4e325SMatthias Ringwald #define HCI_EVENT_REMOTE_OOB_DATA_REQUEST 0x35 38847f4e325SMatthias Ringwald #define HCI_EVENT_SIMPLE_PAIRING_COMPLETE 0x36 38947f4e325SMatthias Ringwald 39047f4e325SMatthias Ringwald #define HCI_EVENT_LE_META 0x3E 39147f4e325SMatthias Ringwald 392941b3855SMatthias Ringwald #define HCI_EVENT_VENDOR_SPECIFIC 0xFF 393941b3855SMatthias Ringwald 39447f4e325SMatthias Ringwald /** 39547f4e325SMatthias Ringwald * @format 11211B2221 39647f4e325SMatthias Ringwald * @param subevent_code 39747f4e325SMatthias Ringwald * @param status 39847f4e325SMatthias Ringwald * @param connection_handle 39947f4e325SMatthias Ringwald * @param role 40047f4e325SMatthias Ringwald * @param peer_address_type 40147f4e325SMatthias Ringwald * @param peer_address 40247f4e325SMatthias Ringwald * @param conn_interval 40347f4e325SMatthias Ringwald * @param conn_latency 40447f4e325SMatthias Ringwald * @param supervision_timeout 40547f4e325SMatthias Ringwald * @param master_clock_accuracy 40647f4e325SMatthias Ringwald */ 40747f4e325SMatthias Ringwald #define HCI_SUBEVENT_LE_CONNECTION_COMPLETE 0x01 40847f4e325SMatthias Ringwald #define HCI_SUBEVENT_LE_ADVERTISING_REPORT 0x02 40947f4e325SMatthias Ringwald #define HCI_SUBEVENT_LE_CONNECTION_UPDATE_COMPLETE 0x03 41047f4e325SMatthias Ringwald #define HCI_SUBEVENT_LE_READ_REMOTE_USED_FEATURES_COMPLETE 0x04 41147f4e325SMatthias Ringwald #define HCI_SUBEVENT_LE_LONG_TERM_KEY_REQUEST 0x05 41247f4e325SMatthias Ringwald 41347f4e325SMatthias Ringwald // last used HCI_EVENT in 2.1 is 0x3d 41447f4e325SMatthias Ringwald // last used HCI_EVENT in 4.1 is 0x57 41547f4e325SMatthias Ringwald 41647f4e325SMatthias Ringwald /** 41747f4e325SMatthias Ringwald * L2CAP Layer 41847f4e325SMatthias Ringwald */ 41947f4e325SMatthias Ringwald 420a8373a41SMatthias Ringwald #define L2CAP_HEADER_SIZE 4 421a8373a41SMatthias Ringwald 422a8373a41SMatthias Ringwald #define L2CAP_SIG_ID_INVALID 0 423a8373a41SMatthias Ringwald 424a8373a41SMatthias Ringwald // size of HCI ACL + L2CAP Header for regular data packets (8) 425a8373a41SMatthias Ringwald #define COMPLETE_L2CAP_HEADER (HCI_ACL_HEADER_SIZE + L2CAP_HEADER_SIZE) 426a8373a41SMatthias Ringwald 427a8373a41SMatthias Ringwald // minimum signaling MTU 428a8373a41SMatthias Ringwald #define L2CAP_MINIMAL_MTU 48 429a8373a41SMatthias Ringwald #define L2CAP_DEFAULT_MTU 672 430a8373a41SMatthias Ringwald 431a8373a41SMatthias Ringwald // Minimum/default MTU 432a8373a41SMatthias Ringwald #define L2CAP_LE_DEFAULT_MTU 23 433a8373a41SMatthias Ringwald 434a8373a41SMatthias Ringwald // L2CAP Fixed Channel IDs 435a8373a41SMatthias Ringwald #define L2CAP_CID_SIGNALING 0x0001 436a8373a41SMatthias Ringwald #define L2CAP_CID_CONNECTIONLESS_CHANNEL 0x0002 437a8373a41SMatthias Ringwald #define L2CAP_CID_ATTRIBUTE_PROTOCOL 0x0004 438a8373a41SMatthias Ringwald #define L2CAP_CID_SIGNALING_LE 0x0005 439a8373a41SMatthias Ringwald #define L2CAP_CID_SECURITY_MANAGER_PROTOCOL 0x0006 440a8373a41SMatthias Ringwald 441a8373a41SMatthias Ringwald // L2CAP Configuration Result Codes 442a8373a41SMatthias Ringwald #define L2CAP_CONF_RESULT_UNKNOWN_OPTIONS 0x0003 443a8373a41SMatthias Ringwald 444a8373a41SMatthias Ringwald // L2CAP Reject Result Codes 445a8373a41SMatthias Ringwald #define L2CAP_REJ_CMD_UNKNOWN 0x0000 446a8373a41SMatthias Ringwald 447a8373a41SMatthias Ringwald // Response Timeout eXpired 448a8373a41SMatthias Ringwald #define L2CAP_RTX_TIMEOUT_MS 10000 449a8373a41SMatthias Ringwald 450a8373a41SMatthias Ringwald // Extended Response Timeout eXpired 451a8373a41SMatthias Ringwald #define L2CAP_ERTX_TIMEOUT_MS 120000 452a8373a41SMatthias Ringwald 45347f4e325SMatthias Ringwald // Fixed PSM numbers 45447f4e325SMatthias Ringwald #define PSM_SDP 0x01 45547f4e325SMatthias Ringwald #define PSM_RFCOMM 0x03 45647f4e325SMatthias Ringwald #define PSM_BNEP 0x0F 45747f4e325SMatthias Ringwald #define PSM_HID_CONTROL 0x11 45847f4e325SMatthias Ringwald #define PSM_HID_INTERRUPT 0x13 45947f4e325SMatthias Ringwald 46066b1fcb3SMatthias Ringwald /** 461ef907034SMatthias Ringwald * SDP Protocl 462ef907034SMatthias Ringwald */ 463ef907034SMatthias Ringwald 464ef907034SMatthias Ringwald // PDU Types 465ef907034SMatthias Ringwald typedef enum { 466ef907034SMatthias Ringwald SDP_Invalid = 0, 467ef907034SMatthias Ringwald SDP_ErrorResponse = 1, 468ef907034SMatthias Ringwald SDP_ServiceSearchRequest, 469ef907034SMatthias Ringwald SDP_ServiceSearchResponse, 470ef907034SMatthias Ringwald SDP_ServiceAttributeRequest, 471ef907034SMatthias Ringwald SDP_ServiceAttributeResponse, 472ef907034SMatthias Ringwald SDP_ServiceSearchAttributeRequest, 473ef907034SMatthias Ringwald SDP_ServiceSearchAttributeResponse 474ef907034SMatthias Ringwald } SDP_PDU_ID_t; 475ef907034SMatthias Ringwald 476ef907034SMatthias Ringwald // UNIVERSAL ATTRIBUTE DEFINITIONS 477ef907034SMatthias Ringwald #define SDP_ServiceRecordHandle 0x0000 478ef907034SMatthias Ringwald #define SDP_ServiceClassIDList 0x0001 479ef907034SMatthias Ringwald #define SDP_ServiceRecordState 0x0002 480ef907034SMatthias Ringwald #define SDP_ServiceID 0x0003 481ef907034SMatthias Ringwald #define SDP_ProtocolDescriptorList 0x0004 482ef907034SMatthias Ringwald #define SDP_BrowseGroupList 0x0005 483ef907034SMatthias Ringwald #define SDP_LanguageBaseAttributeIDList 0x0006 484ef907034SMatthias Ringwald #define SDP_ServiceInfoTimeToLive 0x0007 485ef907034SMatthias Ringwald #define SDP_ServiceAvailability 0x0008 486ef907034SMatthias Ringwald #define SDP_BluetoothProfileDescriptorList 0x0009 487ef907034SMatthias Ringwald #define SDP_DocumentationURL 0x000a 488ef907034SMatthias Ringwald #define SDP_ClientExecutableURL 0x000b 489ef907034SMatthias Ringwald #define SDP_IconURL 0x000c 490ef907034SMatthias Ringwald #define SDP_AdditionalProtocolDescriptorList 0x000d 491ef907034SMatthias Ringwald #define SDP_SupportedFormatsList 0x0303 492ef907034SMatthias Ringwald 493ef907034SMatthias Ringwald // SERVICE CLASSES 494ef907034SMatthias Ringwald #define SDP_OBEXObjectPush 0x1105 495ef907034SMatthias Ringwald #define SDP_OBEXFileTransfer 0x1106 496ef907034SMatthias Ringwald #define SDP_PublicBrowseGroup 0x1002 497ef907034SMatthias Ringwald #define SDP_HSP 0x1108 498ef907034SMatthias Ringwald #define SDP_Headset_AG 0x1112 499ef907034SMatthias Ringwald #define SDP_PANU 0x1115 500ef907034SMatthias Ringwald #define SDP_NAP 0x1116 501ef907034SMatthias Ringwald #define SDP_GN 0x1117 502ef907034SMatthias Ringwald #define SDP_Handsfree 0x111E 503ef907034SMatthias Ringwald #define SDP_HandsfreeAudioGateway 0x111F 504ef907034SMatthias Ringwald #define SDP_Headset_HS 0x1131 505ef907034SMatthias Ringwald #define SDP_GenericAudio 0x1203 506ef907034SMatthias Ringwald 507ef907034SMatthias Ringwald 508ef907034SMatthias Ringwald // PROTOCOLS 509ef907034SMatthias Ringwald #define SDP_SDPProtocol 0x0001 510ef907034SMatthias Ringwald #define SDP_UDPProtocol 0x0002 511ef907034SMatthias Ringwald #define SDP_RFCOMMProtocol 0x0003 512ef907034SMatthias Ringwald #define SDP_OBEXProtocol 0x0008 513ef907034SMatthias Ringwald #define SDP_L2CAPProtocol 0x0100 514ef907034SMatthias Ringwald #define SDP_BNEPProtocol 0x000F 515ef907034SMatthias Ringwald #define SDP_AVDTPProtocol 0x0019 516ef907034SMatthias Ringwald 517ef907034SMatthias Ringwald // OFFSETS FOR LOCALIZED ATTRIBUTES - SDP_LanguageBaseAttributeIDList 518ef907034SMatthias Ringwald #define SDP_Offest_ServiceName 0x0000 519ef907034SMatthias Ringwald #define SDP_Offest_ServiceDescription 0x0001 520ef907034SMatthias Ringwald #define SDP_Offest_ProviderName 0x0002 521ef907034SMatthias Ringwald 522ef907034SMatthias Ringwald // OBEX 523ef907034SMatthias Ringwald #define SDP_vCard_2_1 0x01 524ef907034SMatthias Ringwald #define SDP_vCard_3_0 0x02 525ef907034SMatthias Ringwald #define SDP_vCal_1_0 0x03 526ef907034SMatthias Ringwald #define SDP_iCal_2_0 0x04 527ef907034SMatthias Ringwald #define SDP_vNote 0x05 528ef907034SMatthias Ringwald #define SDP_vMessage 0x06 529ef907034SMatthias Ringwald #define SDP_OBEXFileTypeAny 0xFF 530ef907034SMatthias Ringwald 531ef907034SMatthias Ringwald /** 532e2577bd7SMatthias Ringwald * RFCOMM Protocol 533e2577bd7SMatthias Ringwald */ 534e2577bd7SMatthias Ringwald 535e2577bd7SMatthias Ringwald // Control field values bit no. 1 2 3 4 PF 6 7 8 536e2577bd7SMatthias Ringwald #define BT_RFCOMM_SABM 0x3F // 1 1 1 1 1 1 0 0 537e2577bd7SMatthias Ringwald #define BT_RFCOMM_UA 0x73 // 1 1 0 0 1 1 1 0 538e2577bd7SMatthias Ringwald #define BT_RFCOMM_DM 0x0F // 1 1 1 1 0 0 0 0 539e2577bd7SMatthias Ringwald #define BT_RFCOMM_DM_PF 0x1F // 1 1 1 1 1 0 0 0 540e2577bd7SMatthias Ringwald #define BT_RFCOMM_DISC 0x53 // 1 1 0 0 1 0 1 0 541e2577bd7SMatthias Ringwald #define BT_RFCOMM_UIH 0xEF // 1 1 1 1 0 1 1 1 542e2577bd7SMatthias Ringwald #define BT_RFCOMM_UIH_PF 0xFF // 1 1 1 1 0 1 1 1 543e2577bd7SMatthias Ringwald 544e2577bd7SMatthias Ringwald // Multiplexer message types 545e2577bd7SMatthias Ringwald #define BT_RFCOMM_CLD_CMD 0xC3 546e2577bd7SMatthias Ringwald #define BT_RFCOMM_FCON_CMD 0xA3 547e2577bd7SMatthias Ringwald #define BT_RFCOMM_FCON_RSP 0xA1 548e2577bd7SMatthias Ringwald #define BT_RFCOMM_FCOFF_CMD 0x63 549e2577bd7SMatthias Ringwald #define BT_RFCOMM_FCOFF_RSP 0x61 550e2577bd7SMatthias Ringwald #define BT_RFCOMM_MSC_CMD 0xE3 551e2577bd7SMatthias Ringwald #define BT_RFCOMM_MSC_RSP 0xE1 552e2577bd7SMatthias Ringwald #define BT_RFCOMM_NSC_RSP 0x11 553e2577bd7SMatthias Ringwald #define BT_RFCOMM_PN_CMD 0x83 554e2577bd7SMatthias Ringwald #define BT_RFCOMM_PN_RSP 0x81 555e2577bd7SMatthias Ringwald #define BT_RFCOMM_RLS_CMD 0x53 556e2577bd7SMatthias Ringwald #define BT_RFCOMM_RLS_RSP 0x51 557e2577bd7SMatthias Ringwald #define BT_RFCOMM_RPN_CMD 0x93 558e2577bd7SMatthias Ringwald #define BT_RFCOMM_RPN_RSP 0x91 559e2577bd7SMatthias Ringwald #define BT_RFCOMM_TEST_CMD 0x23 560e2577bd7SMatthias Ringwald #define BT_RFCOMM_TEST_RSP 0x21 561e2577bd7SMatthias Ringwald 562e2577bd7SMatthias Ringwald // Line Status 563e2577bd7SMatthias Ringwald #define LINE_STATUS_NO_ERROR 0x00 564e2577bd7SMatthias Ringwald #define LINE_STATUS_OVERRUN_ERROR 0x03 565e2577bd7SMatthias Ringwald #define LINE_STATUS_PARITY_ERORR 0x05 566e2577bd7SMatthias Ringwald #define LINE_STATUS_FRAMING_ERROR 0x09 567e2577bd7SMatthias Ringwald 568e2577bd7SMatthias Ringwald // Modem Status Flags 569e2577bd7SMatthias Ringwald #define MODEM_STATUS_FC 0x02 570e2577bd7SMatthias Ringwald #define MODEM_STATUS_RTC 0x04 571e2577bd7SMatthias Ringwald #define MODEM_STATUS_RTR 0x08 572e2577bd7SMatthias Ringwald #define MODEM_STATUS_IC 0x40 573e2577bd7SMatthias Ringwald #define MODEM_STATUS_DV 0x80 574e2577bd7SMatthias Ringwald 575e2577bd7SMatthias Ringwald typedef enum rpn_baud { 576e2577bd7SMatthias Ringwald RPN_BAUD_2400 = 0, 577e2577bd7SMatthias Ringwald RPN_BAUD_4800, 578e2577bd7SMatthias Ringwald RPN_BAUD_7200, 579e2577bd7SMatthias Ringwald RPN_BAUD_9600, 580e2577bd7SMatthias Ringwald RPN_BAUD_19200, 581e2577bd7SMatthias Ringwald RPN_BAUD_38400, 582e2577bd7SMatthias Ringwald RPN_BAUD_57600, 583e2577bd7SMatthias Ringwald RPN_BAUD_115200, 584e2577bd7SMatthias Ringwald RPN_BAUD_230400 585e2577bd7SMatthias Ringwald } rpn_baud_t; 586e2577bd7SMatthias Ringwald 587e2577bd7SMatthias Ringwald typedef enum rpn_data_bits { 588e2577bd7SMatthias Ringwald RPN_DATA_BITS_5 = 0, 589e2577bd7SMatthias Ringwald RPN_DATA_BITS_6 = 0, 590e2577bd7SMatthias Ringwald RPN_DATA_BITS_7 = 0, 591e2577bd7SMatthias Ringwald RPN_DATA_BITS_8 = 0 592e2577bd7SMatthias Ringwald } rpn_data_bits_t; 593e2577bd7SMatthias Ringwald 594e2577bd7SMatthias Ringwald typedef enum rpn_stop_bits { 595e2577bd7SMatthias Ringwald RPN_STOP_BITS_1_0 = 0, 596e2577bd7SMatthias Ringwald RPN_STOP_BITS_1_5 597e2577bd7SMatthias Ringwald } rpn_stop_bits_t; 598e2577bd7SMatthias Ringwald 599e2577bd7SMatthias Ringwald typedef enum rpn_parity { 600e2577bd7SMatthias Ringwald RPN_PARITY_NONE = 0, 601e2577bd7SMatthias Ringwald RPN_PARITY_ODD = 1, 602e2577bd7SMatthias Ringwald RPN_PARITY_EVEN = 3, 603e2577bd7SMatthias Ringwald RPN_PARITY_MARK = 5, 604e2577bd7SMatthias Ringwald RPN_PARITY_SPACE = 7, 605e2577bd7SMatthias Ringwald } rpn_parity_t; 606e2577bd7SMatthias Ringwald 607e2577bd7SMatthias Ringwald typedef enum rpn_flow_control { 608e2577bd7SMatthias Ringwald RPN_FLOW_CONTROL_XONXOFF_ON_INPUT = 1 << 0, 609e2577bd7SMatthias Ringwald RPN_FLOW_CONTROL_XONXOFF_ON_OUTPUT = 1 << 1, 610e2577bd7SMatthias Ringwald RPN_FLOW_CONTROL_RTR_ON_INPUT = 1 << 2, 611e2577bd7SMatthias Ringwald RPN_FLOW_CONTROL_RTR_ON_OUTPUT = 1 << 3, 612e2577bd7SMatthias Ringwald RPN_FLOW_CONTROL_RTC_ON_INPUT = 1 << 4, 613e2577bd7SMatthias Ringwald RPN_FLOW_CONTROL_RTC_ON_OUTPUT = 1 << 5, 614e2577bd7SMatthias Ringwald } rpn_flow_control_t; 615e2577bd7SMatthias Ringwald 616e2577bd7SMatthias Ringwald #define RPN_PARAM_MASK_0_BAUD 0x01 617e2577bd7SMatthias Ringwald #define RPN_PARAM_MASK_0_DATA_BITS 0x02 618e2577bd7SMatthias Ringwald #define RPN_PARAM_MASK_0_STOP_BITS 0x04 619e2577bd7SMatthias Ringwald #define RPN_PARAM_MASK_0_PARITY 0x08 620e2577bd7SMatthias Ringwald #define RPN_PARAM_MASK_0_PARITY_TYPE 0x10 621e2577bd7SMatthias Ringwald #define RPN_PARAM_MASK_0_XON_CHAR 0x20 622e2577bd7SMatthias Ringwald #define RPN_PARAM_MASK_0_XOFF_CHAR 0x40 623e2577bd7SMatthias Ringwald #define RPN_PARAM_MASK_0_RESERVED 0x80 624e2577bd7SMatthias Ringwald 625e2577bd7SMatthias Ringwald // @note: values are identical to rpn_flow_control_t 626e2577bd7SMatthias Ringwald #define RPN_PARAM_MASK_1_XONOFF_ON_INPUT 0x01 627e2577bd7SMatthias Ringwald #define RPN_PARAM_MASK_1_XONOFF_ON_OUTPUT 0x02 628e2577bd7SMatthias Ringwald #define RPN_PARAM_MASK_1_RTR_ON_INPUT 0x04 629e2577bd7SMatthias Ringwald #define RPN_PARAM_MASK_1_RTR_ON_OUTPUT 0x08 630e2577bd7SMatthias Ringwald #define RPN_PARAM_MASK_1_RTC_ON_INPUT 0x10 631e2577bd7SMatthias Ringwald #define RPN_PARAM_MASK_1_RTC_ON_OUTPUT 0x20 632e2577bd7SMatthias Ringwald #define RPN_PARAM_MASK_1_RESERVED_0 0x40 633e2577bd7SMatthias Ringwald #define RPN_PARAM_MASK_1_RESERVED_1 0x80 634e2577bd7SMatthias Ringwald 635e2577bd7SMatthias Ringwald /** 63666b1fcb3SMatthias Ringwald * BNEP Protocol 63766b1fcb3SMatthias Ringwald */ 63847f4e325SMatthias Ringwald 63966b1fcb3SMatthias Ringwald #ifndef ETHER_ADDR_LEN 6409a73f75dSMatthias Ringwald #define ETHER_ADDR_LEN 6 64166b1fcb3SMatthias Ringwald #endif 64247f4e325SMatthias Ringwald 64366b1fcb3SMatthias Ringwald #ifndef ETHERTYPE_VLAN 64466b1fcb3SMatthias Ringwald #define ETHERTYPE_VLAN 0x8100 /* IEEE 802.1Q VLAN tag */ 64566b1fcb3SMatthias Ringwald #endif 64666b1fcb3SMatthias Ringwald 64766b1fcb3SMatthias Ringwald #define BNEP_MTU_MIN 1691 64866b1fcb3SMatthias Ringwald 64966b1fcb3SMatthias Ringwald #define BNEP_EXT_FLAG 0x80 65066b1fcb3SMatthias Ringwald #define BNEP_TYPE_MASK 0x7F 65166b1fcb3SMatthias Ringwald #define BNEP_TYPE(header) ((header) & BNEP_TYPE_MASK) 65266b1fcb3SMatthias Ringwald #define BNEP_HEADER_HAS_EXT(x) (((x) & BNEP_EXT_FLAG) == BNEP_EXT_FLAG) 65366b1fcb3SMatthias Ringwald 65466b1fcb3SMatthias Ringwald /* BNEP packet types */ 65566b1fcb3SMatthias Ringwald #define BNEP_PKT_TYPE_GENERAL_ETHERNET 0x00 65666b1fcb3SMatthias Ringwald #define BNEP_PKT_TYPE_CONTROL 0x01 65766b1fcb3SMatthias Ringwald #define BNEP_PKT_TYPE_COMPRESSED_ETHERNET 0x02 65866b1fcb3SMatthias Ringwald #define BNEP_PKT_TYPE_COMPRESSED_ETHERNET_SOURCE_ONLY 0x03 65966b1fcb3SMatthias Ringwald #define BNEP_PKT_TYPE_COMPRESSED_ETHERNET_DEST_ONLY 0x04 66066b1fcb3SMatthias Ringwald 66166b1fcb3SMatthias Ringwald /* BNEP control types */ 66266b1fcb3SMatthias Ringwald #define BNEP_CONTROL_TYPE_COMMAND_NOT_UNDERSTOOD 0x00 66366b1fcb3SMatthias Ringwald #define BNEP_CONTROL_TYPE_SETUP_CONNECTION_REQUEST 0x01 66466b1fcb3SMatthias Ringwald #define BNEP_CONTROL_TYPE_SETUP_CONNECTION_RESPONSE 0x02 66566b1fcb3SMatthias Ringwald #define BNEP_CONTROL_TYPE_FILTER_NET_TYPE_SET 0x03 66666b1fcb3SMatthias Ringwald #define BNEP_CONTROL_TYPE_FILTER_NET_TYPE_RESPONSE 0x04 66766b1fcb3SMatthias Ringwald #define BNEP_CONTROL_TYPE_FILTER_MULTI_ADDR_SET 0x05 66866b1fcb3SMatthias Ringwald #define BNEP_CONTROL_TYPE_FILTER_MULTI_ADDR_RESPONSE 0x06 66966b1fcb3SMatthias Ringwald 67066b1fcb3SMatthias Ringwald /* BNEP extension header types */ 67166b1fcb3SMatthias Ringwald #define BNEP_EXT_HEADER_TYPE_EXTENSION_CONTROL 0x00 67266b1fcb3SMatthias Ringwald 67366b1fcb3SMatthias Ringwald /* BNEP setup response codes */ 67466b1fcb3SMatthias Ringwald #define BNEP_RESP_SETUP_SUCCESS 0x0000 67566b1fcb3SMatthias Ringwald #define BNEP_RESP_SETUP_INVALID_DEST_UUID 0x0001 67666b1fcb3SMatthias Ringwald #define BNEP_RESP_SETUP_INVALID_SOURCE_UUID 0x0002 67766b1fcb3SMatthias Ringwald #define BNEP_RESP_SETUP_INVALID_SERVICE_UUID_SIZE 0x0003 67866b1fcb3SMatthias Ringwald #define BNEP_RESP_SETUP_CONNECTION_NOT_ALLOWED 0x0004 67966b1fcb3SMatthias Ringwald 68066b1fcb3SMatthias Ringwald /* BNEP filter response codes */ 68166b1fcb3SMatthias Ringwald #define BNEP_RESP_FILTER_SUCCESS 0x0000 68266b1fcb3SMatthias Ringwald #define BNEP_RESP_FILTER_UNSUPPORTED_REQUEST 0x0001 68366b1fcb3SMatthias Ringwald #define BNEP_RESP_FILTER_ERR_INVALID_RANGE 0x0002 68466b1fcb3SMatthias Ringwald #define BNEP_RESP_FILTER_ERR_TOO_MANY_FILTERS 0x0003 68566b1fcb3SMatthias Ringwald #define BNEP_RESP_FILTER_ERR_SECURITY 0x0004 68666b1fcb3SMatthias Ringwald 68766b1fcb3SMatthias Ringwald /** 68866b1fcb3SMatthias Ringwald * PAN Profile 68966b1fcb3SMatthias Ringwald */ 69066b1fcb3SMatthias Ringwald 69166b1fcb3SMatthias Ringwald typedef enum { 69266b1fcb3SMatthias Ringwald PANU_UUID = 0x1115, 69366b1fcb3SMatthias Ringwald NAP_UUID = 0x1116, 69466b1fcb3SMatthias Ringwald GN_UUID = 0x1117 69566b1fcb3SMatthias Ringwald } bnep_service_uuid_t; 69666b1fcb3SMatthias Ringwald 69766b1fcb3SMatthias Ringwald typedef enum { 69866b1fcb3SMatthias Ringwald BNEP_SECURITY_NONE = 0x0000, 69966b1fcb3SMatthias Ringwald BNEP_SECURITY_SERVICE_LEVEL_ENFORCED, 70066b1fcb3SMatthias Ringwald BNEP_SECURITY_802_1X 70166b1fcb3SMatthias Ringwald } security_description_t; 70266b1fcb3SMatthias Ringwald 70366b1fcb3SMatthias Ringwald typedef enum { 70466b1fcb3SMatthias Ringwald PAN_NET_ACCESS_TYPE_PSTN = 0x0000, 70566b1fcb3SMatthias Ringwald PAN_NET_ACCESS_TYPE_ISDN, 70666b1fcb3SMatthias Ringwald PAN_NET_ACCESS_TYPE_DSL, 70766b1fcb3SMatthias Ringwald PAN_NET_ACCESS_TYPE_CABLE_MODEM, 70866b1fcb3SMatthias Ringwald PAN_NET_ACCESS_TYPE_10MB_ETHERNET, 70966b1fcb3SMatthias Ringwald PAN_NET_ACCESS_TYPE_100MB_ETHERNET, 71066b1fcb3SMatthias Ringwald PAN_NET_ACCESS_TYPE_4MB_TOKEN_RING, 71166b1fcb3SMatthias Ringwald PAN_NET_ACCESS_TYPE_16MB_TOKEN_RING, 71266b1fcb3SMatthias Ringwald PAN_NET_ACCESS_TYPE_100MB_TOKEN_RING, 71366b1fcb3SMatthias Ringwald PAN_NET_ACCESS_TYPE_FDDI, 71466b1fcb3SMatthias Ringwald PAN_NET_ACCESS_TYPE_GSM, 71566b1fcb3SMatthias Ringwald PAN_NET_ACCESS_TYPE_CDMA, 71666b1fcb3SMatthias Ringwald PAN_NET_ACCESS_TYPE_GPRS, 71766b1fcb3SMatthias Ringwald PAN_NET_ACCESS_TYPE_3G, 71866b1fcb3SMatthias Ringwald PAN_NET_ACCESS_TYPE_CELULAR, 71966b1fcb3SMatthias Ringwald PAN_NET_ACCESS_TYPE_OTHER = 0xFFFE, 72066b1fcb3SMatthias Ringwald PAN_NET_ACCESS_TYPE_NONE 72166b1fcb3SMatthias Ringwald } net_access_type_t; 72247f4e325SMatthias Ringwald 7234c1900e6SMatthias Ringwald /** 7244c1900e6SMatthias Ringwald * ATT 7254c1900e6SMatthias Ringwald */ 7264c1900e6SMatthias Ringwald 7274c1900e6SMatthias Ringwald // Minimum/default MTU 7284c1900e6SMatthias Ringwald #define ATT_DEFAULT_MTU 23 7294c1900e6SMatthias Ringwald 7304c1900e6SMatthias Ringwald // MARK: Attribute PDU Opcodes 7314c1900e6SMatthias Ringwald #define ATT_ERROR_RESPONSE 0x01 7324c1900e6SMatthias Ringwald 7334c1900e6SMatthias Ringwald #define ATT_EXCHANGE_MTU_REQUEST 0x02 7344c1900e6SMatthias Ringwald #define ATT_EXCHANGE_MTU_RESPONSE 0x03 7354c1900e6SMatthias Ringwald 7364c1900e6SMatthias Ringwald #define ATT_FIND_INFORMATION_REQUEST 0x04 7374c1900e6SMatthias Ringwald #define ATT_FIND_INFORMATION_REPLY 0x05 7384c1900e6SMatthias Ringwald #define ATT_FIND_BY_TYPE_VALUE_REQUEST 0x06 7394c1900e6SMatthias Ringwald #define ATT_FIND_BY_TYPE_VALUE_RESPONSE 0x07 7404c1900e6SMatthias Ringwald 7414c1900e6SMatthias Ringwald #define ATT_READ_BY_TYPE_REQUEST 0x08 7424c1900e6SMatthias Ringwald #define ATT_READ_BY_TYPE_RESPONSE 0x09 7434c1900e6SMatthias Ringwald #define ATT_READ_REQUEST 0x0a 7444c1900e6SMatthias Ringwald #define ATT_READ_RESPONSE 0x0b 7454c1900e6SMatthias Ringwald #define ATT_READ_BLOB_REQUEST 0x0c 7464c1900e6SMatthias Ringwald #define ATT_READ_BLOB_RESPONSE 0x0d 7474c1900e6SMatthias Ringwald #define ATT_READ_MULTIPLE_REQUEST 0x0e 7484c1900e6SMatthias Ringwald #define ATT_READ_MULTIPLE_RESPONSE 0x0f 7494c1900e6SMatthias Ringwald #define ATT_READ_BY_GROUP_TYPE_REQUEST 0x10 7504c1900e6SMatthias Ringwald #define ATT_READ_BY_GROUP_TYPE_RESPONSE 0x11 7514c1900e6SMatthias Ringwald 7524c1900e6SMatthias Ringwald #define ATT_WRITE_REQUEST 0x12 7534c1900e6SMatthias Ringwald #define ATT_WRITE_RESPONSE 0x13 7544c1900e6SMatthias Ringwald 7554c1900e6SMatthias Ringwald #define ATT_PREPARE_WRITE_REQUEST 0x16 7564c1900e6SMatthias Ringwald #define ATT_PREPARE_WRITE_RESPONSE 0x17 7574c1900e6SMatthias Ringwald #define ATT_EXECUTE_WRITE_REQUEST 0x18 7584c1900e6SMatthias Ringwald #define ATT_EXECUTE_WRITE_RESPONSE 0x19 7594c1900e6SMatthias Ringwald 7604c1900e6SMatthias Ringwald #define ATT_HANDLE_VALUE_NOTIFICATION 0x1b 7614c1900e6SMatthias Ringwald #define ATT_HANDLE_VALUE_INDICATION 0x1d 7624c1900e6SMatthias Ringwald #define ATT_HANDLE_VALUE_CONFIRMATION 0x1e 7634c1900e6SMatthias Ringwald 7644c1900e6SMatthias Ringwald 7654c1900e6SMatthias Ringwald #define ATT_WRITE_COMMAND 0x52 7664c1900e6SMatthias Ringwald #define ATT_SIGNED_WRITE_COMMAND 0xD2 7674c1900e6SMatthias Ringwald 7684c1900e6SMatthias Ringwald // MARK: ATT Error Codes 7694c1900e6SMatthias Ringwald #define ATT_ERROR_INVALID_HANDLE 0x01 7704c1900e6SMatthias Ringwald #define ATT_ERROR_READ_NOT_PERMITTED 0x02 7714c1900e6SMatthias Ringwald #define ATT_ERROR_WRITE_NOT_PERMITTED 0x03 7724c1900e6SMatthias Ringwald #define ATT_ERROR_INVALID_PDU 0x04 7734c1900e6SMatthias Ringwald #define ATT_ERROR_INSUFFICIENT_AUTHENTICATION 0x05 7744c1900e6SMatthias Ringwald #define ATT_ERROR_REQUEST_NOT_SUPPORTED 0x06 7754c1900e6SMatthias Ringwald #define ATT_ERROR_INVALID_OFFSET 0x07 7764c1900e6SMatthias Ringwald #define ATT_ERROR_INSUFFICIENT_AUTHORIZATION 0x08 7774c1900e6SMatthias Ringwald #define ATT_ERROR_PREPARE_QUEUE_FULL 0x09 7784c1900e6SMatthias Ringwald #define ATT_ERROR_ATTRIBUTE_NOT_FOUND 0x0a 7794c1900e6SMatthias Ringwald #define ATT_ERROR_ATTRIBUTE_NOT_LONG 0x0b 7804c1900e6SMatthias Ringwald #define ATT_ERROR_INSUFFICIENT_ENCRYPTION_KEY_SIZE 0x0c 7814c1900e6SMatthias Ringwald #define ATT_ERROR_INVALID_ATTRIBUTE_VALUE_LENGTH 0x0d 7824c1900e6SMatthias Ringwald #define ATT_ERROR_UNLIKELY_ERROR 0x0e 7834c1900e6SMatthias Ringwald #define ATT_ERROR_INSUFFICIENT_ENCRYPTION 0x0f 7844c1900e6SMatthias Ringwald #define ATT_ERROR_UNSUPPORTED_GROUP_TYPE 0x10 7854c1900e6SMatthias Ringwald #define ATT_ERROR_INSUFFICIENT_RESOURCES 0x11 7864c1900e6SMatthias Ringwald 7874c1900e6SMatthias Ringwald // MARK: Attribute Property Flags 7884c1900e6SMatthias Ringwald #define ATT_PROPERTY_BROADCAST 0x01 7894c1900e6SMatthias Ringwald #define ATT_PROPERTY_READ 0x02 7904c1900e6SMatthias Ringwald #define ATT_PROPERTY_WRITE_WITHOUT_RESPONSE 0x04 7914c1900e6SMatthias Ringwald #define ATT_PROPERTY_WRITE 0x08 7924c1900e6SMatthias Ringwald #define ATT_PROPERTY_NOTIFY 0x10 7934c1900e6SMatthias Ringwald #define ATT_PROPERTY_INDICATE 0x20 7944c1900e6SMatthias Ringwald #define ATT_PROPERTY_AUTHENTICATED_SIGNED_WRITE 0x40 7954c1900e6SMatthias Ringwald #define ATT_PROPERTY_EXTENDED_PROPERTIES 0x80 7964c1900e6SMatthias Ringwald 7974c1900e6SMatthias Ringwald // MARK: Attribute Property Flag, BTstack extension 7984c1900e6SMatthias Ringwald // value is asked from client 7994c1900e6SMatthias Ringwald #define ATT_PROPERTY_DYNAMIC 0x100 8004c1900e6SMatthias Ringwald // 128 bit UUID used 8014c1900e6SMatthias Ringwald #define ATT_PROPERTY_UUID128 0x200 8024c1900e6SMatthias Ringwald // Authentication required 8034c1900e6SMatthias Ringwald #define ATT_PROPERTY_AUTHENTICATION_REQUIRED 0x400 8044c1900e6SMatthias Ringwald // Authorization from user required 8054c1900e6SMatthias Ringwald #define ATT_PROPERTY_AUTHORIZATION_REQUIRED 0x800 8064c1900e6SMatthias Ringwald // Encryption key size stored in upper 4 bits, 0 == no encryption, encryption key size - 1 otherwise 8074c1900e6SMatthias Ringwald 8084c1900e6SMatthias Ringwald // ATT Transaction Timeout of 30 seconds for Command/Response or Incidationc/Confirmation 8094c1900e6SMatthias Ringwald #define ATT_TRANSACTION_TIMEOUT_MS 30000 8104c1900e6SMatthias Ringwald 8114c1900e6SMatthias Ringwald #define ATT_TRANSACTION_MODE_NONE 0x0 8124c1900e6SMatthias Ringwald #define ATT_TRANSACTION_MODE_ACTIVE 0x1 8134c1900e6SMatthias Ringwald #define ATT_TRANSACTION_MODE_EXECUTE 0x2 8144c1900e6SMatthias Ringwald #define ATT_TRANSACTION_MODE_CANCEL 0x3 8154c1900e6SMatthias Ringwald 8164c1900e6SMatthias Ringwald // MARK: GATT UUIDs 8174c1900e6SMatthias Ringwald #define GATT_PRIMARY_SERVICE_UUID 0x2800 8184c1900e6SMatthias Ringwald #define GATT_SECONDARY_SERVICE_UUID 0x2801 8194c1900e6SMatthias Ringwald #define GATT_INCLUDE_SERVICE_UUID 0x2802 8204c1900e6SMatthias Ringwald #define GATT_CHARACTERISTICS_UUID 0x2803 8214c1900e6SMatthias Ringwald #define GATT_CHARACTERISTIC_EXTENDED_PROPERTIES 0x2900 8224c1900e6SMatthias Ringwald #define GATT_CHARACTERISTIC_USER_DESCRIPTION 0x2901 8234c1900e6SMatthias Ringwald #define GATT_CLIENT_CHARACTERISTICS_CONFIGURATION 0x2902 8244c1900e6SMatthias Ringwald #define GATT_SERVER_CHARACTERISTICS_CONFIGURATION 0x2903 8254c1900e6SMatthias Ringwald #define GATT_CHARACTERISTIC_PRESENTATION_FORMAT 0x2904 8264c1900e6SMatthias Ringwald #define GATT_CHARACTERISTIC_AGGREGATE_FORMAT 0x2905 8274c1900e6SMatthias Ringwald 8284c1900e6SMatthias Ringwald #define GATT_CLIENT_CHARACTERISTICS_CONFIGURATION_NONE 0 8294c1900e6SMatthias Ringwald #define GATT_CLIENT_CHARACTERISTICS_CONFIGURATION_NOTIFICATION 1 8304c1900e6SMatthias Ringwald #define GATT_CLIENT_CHARACTERISTICS_CONFIGURATION_INDICATION 2 8314c1900e6SMatthias Ringwald 8324c1900e6SMatthias Ringwald // GAP Service and Characteristics 8334c1900e6SMatthias Ringwald #define GAP_SERVICE_UUID 0x1800 8344c1900e6SMatthias Ringwald #define GAP_DEVICE_NAME_UUID 0x2a00 8354c1900e6SMatthias Ringwald #define GAP_APPEARANCE_UUID 0x2a01 8364c1900e6SMatthias Ringwald #define GAP_PERIPHERAL_PRIVACY_FLAG 0x2a02 8374c1900e6SMatthias Ringwald #define GAP_RECONNECTION_ADDRESS_UUID 0x2a03 8384c1900e6SMatthias Ringwald #define GAP_PERIPHERAL_PREFERRED_CONNECTION_PARAMETERS_UUID 0x2a04 8394c1900e6SMatthias Ringwald 8404c1900e6SMatthias Ringwald /** 8414c1900e6SMatthias Ringwald * SM - LE Security Manager 8424c1900e6SMatthias Ringwald */ 8434c1900e6SMatthias Ringwald // Bluetooth Spec definitions 8444c1900e6SMatthias Ringwald typedef enum { 8454c1900e6SMatthias Ringwald SM_CODE_PAIRING_REQUEST = 0X01, 8464c1900e6SMatthias Ringwald SM_CODE_PAIRING_RESPONSE, 8474c1900e6SMatthias Ringwald SM_CODE_PAIRING_CONFIRM, 8484c1900e6SMatthias Ringwald SM_CODE_PAIRING_RANDOM, 8494c1900e6SMatthias Ringwald SM_CODE_PAIRING_FAILED, 8504c1900e6SMatthias Ringwald SM_CODE_ENCRYPTION_INFORMATION, 8514c1900e6SMatthias Ringwald SM_CODE_MASTER_IDENTIFICATION, 8524c1900e6SMatthias Ringwald SM_CODE_IDENTITY_INFORMATION, 8534c1900e6SMatthias Ringwald SM_CODE_IDENTITY_ADDRESS_INFORMATION, 8544c1900e6SMatthias Ringwald SM_CODE_SIGNING_INFORMATION, 8554c1900e6SMatthias Ringwald SM_CODE_SECURITY_REQUEST 8564c1900e6SMatthias Ringwald } SECURITY_MANAGER_COMMANDS; 8574c1900e6SMatthias Ringwald 8584c1900e6SMatthias Ringwald // IO Capability Values 8594c1900e6SMatthias Ringwald typedef enum { 8604c1900e6SMatthias Ringwald IO_CAPABILITY_DISPLAY_ONLY = 0, 8614c1900e6SMatthias Ringwald IO_CAPABILITY_DISPLAY_YES_NO, 8624c1900e6SMatthias Ringwald IO_CAPABILITY_KEYBOARD_ONLY, 8634c1900e6SMatthias Ringwald IO_CAPABILITY_NO_INPUT_NO_OUTPUT, 8644c1900e6SMatthias Ringwald IO_CAPABILITY_KEYBOARD_DISPLAY, // not used by secure simple pairing 8654c1900e6SMatthias Ringwald } io_capability_t; 8664c1900e6SMatthias Ringwald 8674c1900e6SMatthias Ringwald // Authentication requirement flags 8684c1900e6SMatthias Ringwald #define SM_AUTHREQ_NO_BONDING 0x00 8694c1900e6SMatthias Ringwald #define SM_AUTHREQ_BONDING 0x01 8704c1900e6SMatthias Ringwald #define SM_AUTHREQ_MITM_PROTECTION 0x04 8714c1900e6SMatthias Ringwald 8724c1900e6SMatthias Ringwald // Key distribution flags used by spec 8734c1900e6SMatthias Ringwald #define SM_KEYDIST_ENC_KEY 0X01 8744c1900e6SMatthias Ringwald #define SM_KEYDIST_ID_KEY 0x02 8754c1900e6SMatthias Ringwald #define SM_KEYDIST_SIGN 0x04 8764c1900e6SMatthias Ringwald 8774c1900e6SMatthias Ringwald // Key distribution flags used internally 8784c1900e6SMatthias Ringwald #define SM_KEYDIST_FLAG_ENCRYPTION_INFORMATION 0x01 8794c1900e6SMatthias Ringwald #define SM_KEYDIST_FLAG_MASTER_IDENTIFICATION 0x02 8804c1900e6SMatthias Ringwald #define SM_KEYDIST_FLAG_IDENTITY_INFORMATION 0x04 8814c1900e6SMatthias Ringwald #define SM_KEYDIST_FLAG_IDENTITY_ADDRESS_INFORMATION 0x08 8824c1900e6SMatthias Ringwald #define SM_KEYDIST_FLAG_SIGNING_IDENTIFICATION 0x10 8834c1900e6SMatthias Ringwald 8844c1900e6SMatthias Ringwald // STK Generation Methods 8854c1900e6SMatthias Ringwald #define SM_STK_GENERATION_METHOD_JUST_WORKS 0x01 8864c1900e6SMatthias Ringwald #define SM_STK_GENERATION_METHOD_OOB 0x02 8874c1900e6SMatthias Ringwald #define SM_STK_GENERATION_METHOD_PASSKEY 0x04 8884c1900e6SMatthias Ringwald 8894c1900e6SMatthias Ringwald // Pairing Failed Reasons 8904c1900e6SMatthias Ringwald #define SM_REASON_RESERVED 0x00 8914c1900e6SMatthias Ringwald #define SM_REASON_PASSKEYT_ENTRY_FAILED 0x01 8924c1900e6SMatthias Ringwald #define SM_REASON_OOB_NOT_AVAILABLE 0x02 8934c1900e6SMatthias Ringwald #define SM_REASON_AUTHENTHICATION_REQUIREMENTS 0x03 8944c1900e6SMatthias Ringwald #define SM_REASON_CONFIRM_VALUE_FAILED 0x04 8954c1900e6SMatthias Ringwald #define SM_REASON_PAIRING_NOT_SUPPORTED 0x05 8964c1900e6SMatthias Ringwald #define SM_REASON_ENCRYPTION_KEY_SIZE 0x06 8974c1900e6SMatthias Ringwald #define SM_REASON_COMMAND_NOT_SUPPORTED 0x07 8984c1900e6SMatthias Ringwald #define SM_REASON_UNSPECIFIED_REASON 0x08 8994c1900e6SMatthias Ringwald #define SM_REASON_REPEATED_ATTEMPTS 0x09 9004c1900e6SMatthias Ringwald // also, invalid parameters 9014c1900e6SMatthias Ringwald // and reserved 9024c1900e6SMatthias Ringwald 903*c6d1dbedSMatthias Ringwald // Company identifiers / manufacturers 904*c6d1dbedSMatthias Ringwald #define COMPANY_ID_CAMBRIDGE_SILICON_RADIO 0x000A 905*c6d1dbedSMatthias Ringwald #define COMPANY_ID_TEXAS_INSTRUMENTS_INC 0x000D 906*c6d1dbedSMatthias Ringwald #define COMPANY_ID_BROADCOM_CORPORATION 0x000F 907*c6d1dbedSMatthias Ringwald #define COMPANY_ID_ST_MICROELECTRONICS 0x0030 908*c6d1dbedSMatthias Ringwald #define COMPANY_ID_EM_MICROELECTRONICS_MARIN 0x005A 909*c6d1dbedSMatthias Ringwald 9104c1900e6SMatthias Ringwald 91147f4e325SMatthias Ringwald #endif