1*941b3855SMatthias Ringwald /* 2*941b3855SMatthias Ringwald * Copyright (C) 2015 BlueKitchen GmbH 3*941b3855SMatthias Ringwald * 4*941b3855SMatthias Ringwald * Redistribution and use in source and binary forms, with or without 5*941b3855SMatthias Ringwald * modification, are permitted provided that the following conditions 6*941b3855SMatthias Ringwald * are met: 7*941b3855SMatthias Ringwald * 8*941b3855SMatthias Ringwald * 1. Redistributions of source code must retain the above copyright 9*941b3855SMatthias Ringwald * notice, this list of conditions and the following disclaimer. 10*941b3855SMatthias Ringwald * 2. Redistributions in binary form must reproduce the above copyright 11*941b3855SMatthias Ringwald * notice, this list of conditions and the following disclaimer in the 12*941b3855SMatthias Ringwald * documentation and/or other materials provided with the distribution. 13*941b3855SMatthias Ringwald * 3. Neither the name of the copyright holders nor the names of 14*941b3855SMatthias Ringwald * contributors may be used to endorse or promote products derived 15*941b3855SMatthias Ringwald * from this software without specific prior written permission. 16*941b3855SMatthias Ringwald * 4. Any redistribution, use, or modification is done solely for 17*941b3855SMatthias Ringwald * personal benefit and not for any commercial purpose or for 18*941b3855SMatthias Ringwald * monetary gain. 19*941b3855SMatthias Ringwald * 20*941b3855SMatthias Ringwald * THIS SOFTWARE IS PROVIDED BY BLUEKITCHEN GMBH AND CONTRIBUTORS 21*941b3855SMatthias Ringwald * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 22*941b3855SMatthias Ringwald * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 23*941b3855SMatthias Ringwald * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL MATTHIAS 24*941b3855SMatthias Ringwald * RINGWALD OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 25*941b3855SMatthias Ringwald * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 26*941b3855SMatthias Ringwald * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS 27*941b3855SMatthias Ringwald * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED 28*941b3855SMatthias Ringwald * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 29*941b3855SMatthias Ringwald * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF 30*941b3855SMatthias Ringwald * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 31*941b3855SMatthias Ringwald * SUCH DAMAGE. 32*941b3855SMatthias Ringwald * 33*941b3855SMatthias Ringwald * Please inquire about commercial licensing options at 34*941b3855SMatthias Ringwald * [email protected] 35*941b3855SMatthias Ringwald * 36*941b3855SMatthias Ringwald */ 37*941b3855SMatthias Ringwald 38*941b3855SMatthias Ringwald /* 39*941b3855SMatthias Ringwald * btstack-defines.h 40*941b3855SMatthias Ringwald * 41*941b3855SMatthias Ringwald * BTstack definitions, events, and error codes */ 42*941b3855SMatthias Ringwald 43*941b3855SMatthias Ringwald #ifndef __BTSTACK_DEFINES_H 44*941b3855SMatthias Ringwald #define __BTSTACK_DEFINES_H 45*941b3855SMatthias Ringwald 46*941b3855SMatthias Ringwald // DEFINES 47*941b3855SMatthias Ringwald 48*941b3855SMatthias Ringwald #define DAEMON_EVENT_PACKET 0x05 49*941b3855SMatthias Ringwald 50*941b3855SMatthias Ringwald // L2CAP data 51*941b3855SMatthias Ringwald #define L2CAP_DATA_PACKET 0x06 52*941b3855SMatthias Ringwald 53*941b3855SMatthias Ringwald // RFCOMM data 54*941b3855SMatthias Ringwald #define RFCOMM_DATA_PACKET 0x07 55*941b3855SMatthias Ringwald 56*941b3855SMatthias Ringwald // Attribute protocol data 57*941b3855SMatthias Ringwald #define ATT_DATA_PACKET 0x08 58*941b3855SMatthias Ringwald 59*941b3855SMatthias Ringwald // Security Manager protocol data 60*941b3855SMatthias Ringwald #define SM_DATA_PACKET 0x09 61*941b3855SMatthias Ringwald 62*941b3855SMatthias Ringwald // SDP query result 63*941b3855SMatthias Ringwald // format: type (8), record_id (16), attribute_id (16), attribute_length (16), attribute_value (max 1k) 64*941b3855SMatthias Ringwald #define SDP_CLIENT_PACKET 0x0a 65*941b3855SMatthias Ringwald 66*941b3855SMatthias Ringwald // BNEP data 67*941b3855SMatthias Ringwald #define BNEP_DATA_PACKET 0x0b 68*941b3855SMatthias Ringwald 69*941b3855SMatthias Ringwald // Unicast Connectionless Data 70*941b3855SMatthias Ringwald #define UCD_DATA_PACKET 0x0c 71*941b3855SMatthias Ringwald 72*941b3855SMatthias Ringwald // debug log messages 73*941b3855SMatthias Ringwald #define LOG_MESSAGE_PACKET 0xfc 74*941b3855SMatthias Ringwald 75*941b3855SMatthias Ringwald 76*941b3855SMatthias Ringwald // ERRORS 77*941b3855SMatthias Ringwald 78*941b3855SMatthias Ringwald // last error code in 2.1 is 0x38 - we start with 0x50 for BTstack errors 79*941b3855SMatthias Ringwald #define BTSTACK_CONNECTION_TO_BTDAEMON_FAILED 0x50 80*941b3855SMatthias Ringwald #define BTSTACK_ACTIVATION_FAILED_SYSTEM_BLUETOOTH 0x51 81*941b3855SMatthias Ringwald #define BTSTACK_ACTIVATION_POWERON_FAILED 0x52 82*941b3855SMatthias Ringwald #define BTSTACK_ACTIVATION_FAILED_UNKNOWN 0x53 83*941b3855SMatthias Ringwald #define BTSTACK_NOT_ACTIVATED 0x54 84*941b3855SMatthias Ringwald #define BTSTACK_BUSY 0x55 85*941b3855SMatthias Ringwald #define BTSTACK_MEMORY_ALLOC_FAILED 0x56 86*941b3855SMatthias Ringwald #define BTSTACK_ACL_BUFFERS_FULL 0x57 87*941b3855SMatthias Ringwald 88*941b3855SMatthias Ringwald // l2cap errors - enumeration by the command that created them 89*941b3855SMatthias Ringwald #define L2CAP_COMMAND_REJECT_REASON_COMMAND_NOT_UNDERSTOOD 0x60 90*941b3855SMatthias Ringwald #define L2CAP_COMMAND_REJECT_REASON_SIGNALING_MTU_EXCEEDED 0x61 91*941b3855SMatthias Ringwald #define L2CAP_COMMAND_REJECT_REASON_INVALID_CID_IN_REQUEST 0x62 92*941b3855SMatthias Ringwald 93*941b3855SMatthias Ringwald #define L2CAP_CONNECTION_RESPONSE_RESULT_SUCCESSFUL 0x63 94*941b3855SMatthias Ringwald #define L2CAP_CONNECTION_RESPONSE_RESULT_PENDING 0x64 95*941b3855SMatthias Ringwald #define L2CAP_CONNECTION_RESPONSE_RESULT_REFUSED_PSM 0x65 96*941b3855SMatthias Ringwald #define L2CAP_CONNECTION_RESPONSE_RESULT_REFUSED_SECURITY 0x66 97*941b3855SMatthias Ringwald #define L2CAP_CONNECTION_RESPONSE_RESULT_REFUSED_RESOURCES 0x67 98*941b3855SMatthias Ringwald #define L2CAP_CONNECTION_RESPONSE_RESULT_RTX_TIMEOUT 0x68 99*941b3855SMatthias Ringwald 100*941b3855SMatthias Ringwald #define L2CAP_SERVICE_ALREADY_REGISTERED 0x69 101*941b3855SMatthias Ringwald #define L2CAP_DATA_LEN_EXCEEDS_REMOTE_MTU 0x6A 102*941b3855SMatthias Ringwald 103*941b3855SMatthias Ringwald #define RFCOMM_MULTIPLEXER_STOPPED 0x70 104*941b3855SMatthias Ringwald #define RFCOMM_CHANNEL_ALREADY_REGISTERED 0x71 105*941b3855SMatthias Ringwald #define RFCOMM_NO_OUTGOING_CREDITS 0x72 106*941b3855SMatthias Ringwald #define RFCOMM_AGGREGATE_FLOW_OFF 0x73 107*941b3855SMatthias Ringwald #define RFCOMM_DATA_LEN_EXCEEDS_MTU 0x74 108*941b3855SMatthias Ringwald 109*941b3855SMatthias Ringwald #define SDP_HANDLE_ALREADY_REGISTERED 0x80 110*941b3855SMatthias Ringwald #define SDP_QUERY_INCOMPLETE 0x81 111*941b3855SMatthias Ringwald #define SDP_SERVICE_NOT_FOUND 0x82 112*941b3855SMatthias Ringwald #define SDP_HANDLE_INVALID 0x83 113*941b3855SMatthias Ringwald 114*941b3855SMatthias Ringwald #define ATT_HANDLE_VALUE_INDICATION_IN_PORGRESS 0x90 115*941b3855SMatthias Ringwald #define ATT_HANDLE_VALUE_INDICATION_TIMEOUT 0x91 116*941b3855SMatthias Ringwald 117*941b3855SMatthias Ringwald #define GATT_CLIENT_NOT_CONNECTED 0x93 118*941b3855SMatthias Ringwald #define GATT_CLIENT_BUSY 0x94 119*941b3855SMatthias Ringwald 120*941b3855SMatthias Ringwald #define BNEP_SERVICE_ALREADY_REGISTERED 0xA0 121*941b3855SMatthias Ringwald #define BNEP_CHANNEL_NOT_CONNECTED 0xA1 122*941b3855SMatthias Ringwald #define BNEP_DATA_LEN_EXCEEDS_MTU 0xA2 123*941b3855SMatthias Ringwald 124*941b3855SMatthias Ringwald typedef enum { 125*941b3855SMatthias Ringwald BLE_PERIPHERAL_OK = 0xA0, 126*941b3855SMatthias Ringwald BLE_PERIPHERAL_IN_WRONG_STATE, 127*941b3855SMatthias Ringwald BLE_PERIPHERAL_DIFFERENT_CONTEXT_FOR_ADDRESS_ALREADY_EXISTS, 128*941b3855SMatthias Ringwald BLE_PERIPHERAL_NOT_CONNECTED, 129*941b3855SMatthias Ringwald BLE_VALUE_TOO_LONG, 130*941b3855SMatthias Ringwald BLE_PERIPHERAL_BUSY, 131*941b3855SMatthias Ringwald BLE_CHARACTERISTIC_NOTIFICATION_NOT_SUPPORTED, 132*941b3855SMatthias Ringwald BLE_CHARACTERISTIC_INDICATION_NOT_SUPPORTED 133*941b3855SMatthias Ringwald } le_command_status_t; 134*941b3855SMatthias Ringwald 135*941b3855SMatthias Ringwald 136*941b3855SMatthias Ringwald // EVENTS 137*941b3855SMatthias Ringwald 138*941b3855SMatthias Ringwald /** 139*941b3855SMatthias Ringwald * @format 1 140*941b3855SMatthias Ringwald * @param state 141*941b3855SMatthias Ringwald */ 142*941b3855SMatthias Ringwald #define BTSTACK_EVENT_STATE 0x60 143*941b3855SMatthias Ringwald 144*941b3855SMatthias Ringwald // data: event(8), len(8), nr hci connections 145*941b3855SMatthias Ringwald #define BTSTACK_EVENT_NR_CONNECTIONS_CHANGED 0x61 146*941b3855SMatthias Ringwald 147*941b3855SMatthias Ringwald /** 148*941b3855SMatthias Ringwald * @format 149*941b3855SMatthias Ringwald */ 150*941b3855SMatthias Ringwald #define BTSTACK_EVENT_POWERON_FAILED 0x62 151*941b3855SMatthias Ringwald 152*941b3855SMatthias Ringwald /** 153*941b3855SMatthias Ringwald * @format 112 154*941b3855SMatthias Ringwald * @param major 155*941b3855SMatthias Ringwald * @param minor 156*941b3855SMatthias Ringwald @ @param revision 157*941b3855SMatthias Ringwald */ 158*941b3855SMatthias Ringwald #define BTSTACK_EVENT_VERSION 0x63 159*941b3855SMatthias Ringwald 160*941b3855SMatthias Ringwald // data: system bluetooth on/off (bool) 161*941b3855SMatthias Ringwald #define BTSTACK_EVENT_SYSTEM_BLUETOOTH_ENABLED 0x64 162*941b3855SMatthias Ringwald 163*941b3855SMatthias Ringwald // data: event (8), len(8), status (8) == 0, address (48), name (1984 bits = 248 bytes) 164*941b3855SMatthias Ringwald #define BTSTACK_EVENT_REMOTE_NAME_CACHED 0x65 165*941b3855SMatthias Ringwald 166*941b3855SMatthias Ringwald // data: discoverable enabled (bool) 167*941b3855SMatthias Ringwald #define BTSTACK_EVENT_DISCOVERABLE_ENABLED 0x66 168*941b3855SMatthias Ringwald 169*941b3855SMatthias Ringwald // Daemon Events used internally 170*941b3855SMatthias Ringwald 171*941b3855SMatthias Ringwald // data: event(8) 172*941b3855SMatthias Ringwald #define DAEMON_EVENT_CONNECTION_OPENED 0x68 173*941b3855SMatthias Ringwald 174*941b3855SMatthias Ringwald // data: event(8) 175*941b3855SMatthias Ringwald #define DAEMON_EVENT_CONNECTION_CLOSED 0x69 176*941b3855SMatthias Ringwald 177*941b3855SMatthias Ringwald // data: event(8), nr_connections(8) 178*941b3855SMatthias Ringwald #define DAEMON_NR_CONNECTIONS_CHANGED 0x6A 179*941b3855SMatthias Ringwald 180*941b3855SMatthias Ringwald // data: event(8) 181*941b3855SMatthias Ringwald #define DAEMON_EVENT_NEW_RFCOMM_CREDITS 0x6B 182*941b3855SMatthias Ringwald 183*941b3855SMatthias Ringwald // data: event(8) 184*941b3855SMatthias Ringwald #define DAEMON_EVENT_HCI_PACKET_SENT 0x6C 185*941b3855SMatthias Ringwald 186*941b3855SMatthias Ringwald // L2CAP EVENTS 187*941b3855SMatthias Ringwald 188*941b3855SMatthias Ringwald // data: event (8), len(8), status (8), address(48), handle (16), psm (16), local_cid(16), remote_cid (16), local_mtu(16), remote_mtu(16), flush_timeout(16) 189*941b3855SMatthias Ringwald #define L2CAP_EVENT_CHANNEL_OPENED 0x70 190*941b3855SMatthias Ringwald 191*941b3855SMatthias Ringwald // data: event (8), len(8), channel (16) 192*941b3855SMatthias Ringwald #define L2CAP_EVENT_CHANNEL_CLOSED 0x71 193*941b3855SMatthias Ringwald 194*941b3855SMatthias Ringwald // data: event (8), len(8), address(48), handle (16), psm (16), local_cid(16), remote_cid (16) 195*941b3855SMatthias Ringwald #define L2CAP_EVENT_INCOMING_CONNECTION 0x72 196*941b3855SMatthias Ringwald 197*941b3855SMatthias Ringwald // data: event(8), len(8), handle(16) 198*941b3855SMatthias Ringwald #define L2CAP_EVENT_TIMEOUT_CHECK 0x73 199*941b3855SMatthias Ringwald 200*941b3855SMatthias Ringwald // data: event(8), len(8), local_cid(16), credits(8) 201*941b3855SMatthias Ringwald #define L2CAP_EVENT_CREDITS 0x74 202*941b3855SMatthias Ringwald 203*941b3855SMatthias Ringwald // data: event(8), len(8), status (8), psm (16) 204*941b3855SMatthias Ringwald #define L2CAP_EVENT_SERVICE_REGISTERED 0x75 205*941b3855SMatthias Ringwald 206*941b3855SMatthias Ringwald // data: event(8), len(8), handle(16), interval min(16), interval max(16), latency(16), timeout multiplier(16) 207*941b3855SMatthias Ringwald #define L2CAP_EVENT_CONNECTION_PARAMETER_UPDATE_REQUEST 0x76 208*941b3855SMatthias Ringwald 209*941b3855SMatthias Ringwald // data: event(8), len(8), handle(16), result (16) (0 == ok, 1 == fail) 210*941b3855SMatthias Ringwald #define L2CAP_EVENT_CONNECTION_PARAMETER_UPDATE_RESPONSE 0x77 211*941b3855SMatthias Ringwald 212*941b3855SMatthias Ringwald // RFCOMM EVENTS 213*941b3855SMatthias Ringwald /** 214*941b3855SMatthias Ringwald * @format 1B2122 215*941b3855SMatthias Ringwald * @param status 216*941b3855SMatthias Ringwald * @param bd_addr 217*941b3855SMatthias Ringwald * @param con_handle 218*941b3855SMatthias Ringwald * @param server_channel 219*941b3855SMatthias Ringwald * @param rfcomm_cid 220*941b3855SMatthias Ringwald * @param max_frame_size 221*941b3855SMatthias Ringwald */ 222*941b3855SMatthias Ringwald #define RFCOMM_EVENT_OPEN_CHANNEL_COMPLETE 0x80 223*941b3855SMatthias Ringwald 224*941b3855SMatthias Ringwald /** 225*941b3855SMatthias Ringwald * @format 2 226*941b3855SMatthias Ringwald * @param rfcomm_cid 227*941b3855SMatthias Ringwald */ 228*941b3855SMatthias Ringwald #define RFCOMM_EVENT_CHANNEL_CLOSED 0x81 229*941b3855SMatthias Ringwald 230*941b3855SMatthias Ringwald /** 231*941b3855SMatthias Ringwald * @format B12 232*941b3855SMatthias Ringwald * @param bd_addr 233*941b3855SMatthias Ringwald * @param server_channel 234*941b3855SMatthias Ringwald * @param rfcomm_cid 235*941b3855SMatthias Ringwald */ 236*941b3855SMatthias Ringwald #define RFCOMM_EVENT_INCOMING_CONNECTION 0x82 237*941b3855SMatthias Ringwald 238*941b3855SMatthias Ringwald /** 239*941b3855SMatthias Ringwald * @format 21 240*941b3855SMatthias Ringwald * @param rfcomm_cid 241*941b3855SMatthias Ringwald * @param line_status 242*941b3855SMatthias Ringwald */ 243*941b3855SMatthias Ringwald #define RFCOMM_EVENT_REMOTE_LINE_STATUS 0x83 244*941b3855SMatthias Ringwald 245*941b3855SMatthias Ringwald /** 246*941b3855SMatthias Ringwald * @format 21 247*941b3855SMatthias Ringwald * @param rfcomm_cid 248*941b3855SMatthias Ringwald * @param credits 249*941b3855SMatthias Ringwald */ 250*941b3855SMatthias Ringwald #define RFCOMM_EVENT_CREDITS 0x84 251*941b3855SMatthias Ringwald 252*941b3855SMatthias Ringwald /** 253*941b3855SMatthias Ringwald * @format 11 254*941b3855SMatthias Ringwald * @param status 255*941b3855SMatthias Ringwald * @param channel_id 256*941b3855SMatthias Ringwald */ 257*941b3855SMatthias Ringwald #define RFCOMM_EVENT_SERVICE_REGISTERED 0x85 258*941b3855SMatthias Ringwald 259*941b3855SMatthias Ringwald /** 260*941b3855SMatthias Ringwald * @format 11 261*941b3855SMatthias Ringwald * @param status 262*941b3855SMatthias Ringwald * @param server_channel_id 263*941b3855SMatthias Ringwald */ 264*941b3855SMatthias Ringwald #define RFCOMM_EVENT_PERSISTENT_CHANNEL 0x86 265*941b3855SMatthias Ringwald 266*941b3855SMatthias Ringwald // data: event (8), len(8), rfcomm_cid (16), modem status (8) 267*941b3855SMatthias Ringwald 268*941b3855SMatthias Ringwald /** 269*941b3855SMatthias Ringwald * @format 21 270*941b3855SMatthias Ringwald * @param rfcomm_cid 271*941b3855SMatthias Ringwald * @param modem_status 272*941b3855SMatthias Ringwald */ 273*941b3855SMatthias Ringwald #define RFCOMM_EVENT_REMOTE_MODEM_STATUS 0x87 274*941b3855SMatthias Ringwald 275*941b3855SMatthias Ringwald // data: event (8), len(8), rfcomm_cid (16), rpn_data_t (67) 276*941b3855SMatthias Ringwald /** 277*941b3855SMatthias Ringwald * TODO: format for variable data 278*941b3855SMatthias Ringwald * @param rfcomm_cid 279*941b3855SMatthias Ringwald * @param rpn_data 280*941b3855SMatthias Ringwald */ 281*941b3855SMatthias Ringwald #define RFCOMM_EVENT_PORT_CONFIGURATION 0x88 282*941b3855SMatthias Ringwald 283*941b3855SMatthias Ringwald 284*941b3855SMatthias Ringwald // data: event(8), len(8), status(8), service_record_handle(32) 285*941b3855SMatthias Ringwald /** 286*941b3855SMatthias Ringwald * @format 14 287*941b3855SMatthias Ringwald * @param status 288*941b3855SMatthias Ringwald * @param service_record_handle 289*941b3855SMatthias Ringwald */ 290*941b3855SMatthias Ringwald #define SDP_SERVICE_REGISTERED 0x90 291*941b3855SMatthias Ringwald 292*941b3855SMatthias Ringwald // data: event(8), len(8), status(8) 293*941b3855SMatthias Ringwald /** 294*941b3855SMatthias Ringwald * @format 1 295*941b3855SMatthias Ringwald * @param status 296*941b3855SMatthias Ringwald */ 297*941b3855SMatthias Ringwald #define SDP_QUERY_COMPLETE 0x91 298*941b3855SMatthias Ringwald 299*941b3855SMatthias Ringwald // data: event(8), len(8), rfcomm channel(8), name(var) 300*941b3855SMatthias Ringwald /** 301*941b3855SMatthias Ringwald * @format 1T 302*941b3855SMatthias Ringwald * @param rfcomm_channel 303*941b3855SMatthias Ringwald * @param name 304*941b3855SMatthias Ringwald * @brief SDP_QUERY_RFCOMM_SERVICE 0x92 305*941b3855SMatthias Ringwald */ 306*941b3855SMatthias Ringwald #define SDP_QUERY_RFCOMM_SERVICE 0x92 307*941b3855SMatthias Ringwald 308*941b3855SMatthias Ringwald // data: event(8), len(8), record nr(16), attribute id(16), attribute value(var) 309*941b3855SMatthias Ringwald /** 310*941b3855SMatthias Ringwald * TODO: format for variable data 311*941b3855SMatthias Ringwald * @param record_nr 312*941b3855SMatthias Ringwald * @param attribute_id 313*941b3855SMatthias Ringwald * @param attribute_value 314*941b3855SMatthias Ringwald */ 315*941b3855SMatthias Ringwald #define SDP_QUERY_ATTRIBUTE_VALUE 0x93 316*941b3855SMatthias Ringwald 317*941b3855SMatthias Ringwald // not provided by daemon, only used for internal testing 318*941b3855SMatthias Ringwald #define SDP_QUERY_SERVICE_RECORD_HANDLE 0x94 319*941b3855SMatthias Ringwald 320*941b3855SMatthias Ringwald /** 321*941b3855SMatthias Ringwald * @format H1 322*941b3855SMatthias Ringwald * @param handle 323*941b3855SMatthias Ringwald * @param status 324*941b3855SMatthias Ringwald */ 325*941b3855SMatthias Ringwald #define GATT_QUERY_COMPLETE 0xA0 326*941b3855SMatthias Ringwald 327*941b3855SMatthias Ringwald /** 328*941b3855SMatthias Ringwald * @format HX 329*941b3855SMatthias Ringwald * @param handle 330*941b3855SMatthias Ringwald * @param service 331*941b3855SMatthias Ringwald */ 332*941b3855SMatthias Ringwald #define GATT_SERVICE_QUERY_RESULT 0xA1 333*941b3855SMatthias Ringwald 334*941b3855SMatthias Ringwald /** 335*941b3855SMatthias Ringwald * @format HY 336*941b3855SMatthias Ringwald * @param handle 337*941b3855SMatthias Ringwald * @param characteristic 338*941b3855SMatthias Ringwald */ 339*941b3855SMatthias Ringwald #define GATT_CHARACTERISTIC_QUERY_RESULT 0xA2 340*941b3855SMatthias Ringwald 341*941b3855SMatthias Ringwald /** 342*941b3855SMatthias Ringwald * @format H2X 343*941b3855SMatthias Ringwald * @param handle 344*941b3855SMatthias Ringwald * @param include_handle 345*941b3855SMatthias Ringwald * @param service 346*941b3855SMatthias Ringwald */ 347*941b3855SMatthias Ringwald #define GATT_INCLUDED_SERVICE_QUERY_RESULT 0xA3 348*941b3855SMatthias Ringwald 349*941b3855SMatthias Ringwald /** 350*941b3855SMatthias Ringwald * @format HZ 351*941b3855SMatthias Ringwald * @param handle 352*941b3855SMatthias Ringwald * @param characteristic_descriptor 353*941b3855SMatthias Ringwald */ 354*941b3855SMatthias Ringwald #define GATT_ALL_CHARACTERISTIC_DESCRIPTORS_QUERY_RESULT 0xA4 355*941b3855SMatthias Ringwald 356*941b3855SMatthias Ringwald /** 357*941b3855SMatthias Ringwald * @format H2LV 358*941b3855SMatthias Ringwald * @param handle 359*941b3855SMatthias Ringwald * @param value_handle 360*941b3855SMatthias Ringwald * @param value_length 361*941b3855SMatthias Ringwald * @param value 362*941b3855SMatthias Ringwald */ 363*941b3855SMatthias Ringwald #define GATT_CHARACTERISTIC_VALUE_QUERY_RESULT 0xA5 364*941b3855SMatthias Ringwald 365*941b3855SMatthias Ringwald /** 366*941b3855SMatthias Ringwald * @format H22LV 367*941b3855SMatthias Ringwald * @param handle 368*941b3855SMatthias Ringwald * @param value_handle 369*941b3855SMatthias Ringwald * @param value_offset 370*941b3855SMatthias Ringwald * @param value_length 371*941b3855SMatthias Ringwald * @param value 372*941b3855SMatthias Ringwald */ 373*941b3855SMatthias Ringwald #define GATT_LONG_CHARACTERISTIC_VALUE_QUERY_RESULT 0xA6 374*941b3855SMatthias Ringwald 375*941b3855SMatthias Ringwald /** 376*941b3855SMatthias Ringwald * @format H2LV 377*941b3855SMatthias Ringwald * @param handle 378*941b3855SMatthias Ringwald * @param value_handle 379*941b3855SMatthias Ringwald * @param value_length 380*941b3855SMatthias Ringwald * @param value 381*941b3855SMatthias Ringwald */ 382*941b3855SMatthias Ringwald #define GATT_NOTIFICATION 0xA7 383*941b3855SMatthias Ringwald 384*941b3855SMatthias Ringwald /** 385*941b3855SMatthias Ringwald * @format H2LV 386*941b3855SMatthias Ringwald * @param handle 387*941b3855SMatthias Ringwald * @param value_handle 388*941b3855SMatthias Ringwald * @param value_length 389*941b3855SMatthias Ringwald * @param value 390*941b3855SMatthias Ringwald */ 391*941b3855SMatthias Ringwald #define GATT_INDICATION 0xA8 392*941b3855SMatthias Ringwald 393*941b3855SMatthias Ringwald /** 394*941b3855SMatthias Ringwald * @format H2LV 395*941b3855SMatthias Ringwald * @param descriptor_handle 396*941b3855SMatthias Ringwald * @param descriptor_length 397*941b3855SMatthias Ringwald * @param descriptor 398*941b3855SMatthias Ringwald */ 399*941b3855SMatthias Ringwald #define GATT_CHARACTERISTIC_DESCRIPTOR_QUERY_RESULT 0xA9 400*941b3855SMatthias Ringwald 401*941b3855SMatthias Ringwald /** 402*941b3855SMatthias Ringwald * @format H2LV 403*941b3855SMatthias Ringwald * @param handle 404*941b3855SMatthias Ringwald * @param descriptor_offset 405*941b3855SMatthias Ringwald * @param descriptor_length 406*941b3855SMatthias Ringwald * @param descriptor 407*941b3855SMatthias Ringwald */ 408*941b3855SMatthias Ringwald #define GATT_LONG_CHARACTERISTIC_DESCRIPTOR_QUERY_RESULT 0xAA 409*941b3855SMatthias Ringwald 410*941b3855SMatthias Ringwald /** 411*941b3855SMatthias Ringwald * @format H2 412*941b3855SMatthias Ringwald * @param handle 413*941b3855SMatthias Ringwald * @param MTU 414*941b3855SMatthias Ringwald */ 415*941b3855SMatthias Ringwald #define GATT_MTU 0xAB 416*941b3855SMatthias Ringwald 417*941b3855SMatthias Ringwald /** 418*941b3855SMatthias Ringwald * @format H2 419*941b3855SMatthias Ringwald * @param handle 420*941b3855SMatthias Ringwald * @param MTU 421*941b3855SMatthias Ringwald */ 422*941b3855SMatthias Ringwald #define ATT_MTU_EXCHANGE_COMPLETE 0xB5 423*941b3855SMatthias Ringwald 424*941b3855SMatthias Ringwald // data: event(8), len(8), status (8), hci_handle (16), attribute_handle (16) 425*941b3855SMatthias Ringwald #define ATT_HANDLE_VALUE_INDICATION_COMPLETE 0xB6 426*941b3855SMatthias Ringwald 427*941b3855SMatthias Ringwald 428*941b3855SMatthias Ringwald // data: event(8), len(8), status (8), bnep service uuid (16) 429*941b3855SMatthias Ringwald #define BNEP_EVENT_SERVICE_REGISTERED 0xC0 430*941b3855SMatthias Ringwald 431*941b3855SMatthias Ringwald // data: event(8), len(8), status (8), bnep source uuid (16), bnep destination uuid (16), mtu (16), remote_address (48) 432*941b3855SMatthias Ringwald #define BNEP_EVENT_OPEN_CHANNEL_COMPLETE 0xC1 433*941b3855SMatthias Ringwald 434*941b3855SMatthias Ringwald // data: event(8), len(8), bnep source uuid (16), bnep destination uuid (16), remote_address (48) 435*941b3855SMatthias Ringwald #define BNEP_EVENT_CHANNEL_CLOSED 0xC2 436*941b3855SMatthias Ringwald 437*941b3855SMatthias Ringwald // data: event(8), len(8), bnep source uuid (16), bnep destination uuid (16), remote_address (48), channel state (8) 438*941b3855SMatthias Ringwald #define BNEP_EVENT_CHANNEL_TIMEOUT 0xC3 439*941b3855SMatthias Ringwald 440*941b3855SMatthias Ringwald // data: event(8), len(8) 441*941b3855SMatthias Ringwald #define BNEP_EVENT_READY_TO_SEND 0xC4 442*941b3855SMatthias Ringwald 443*941b3855SMatthias Ringwald /** 444*941b3855SMatthias Ringwald * @format H1B 445*941b3855SMatthias Ringwald * @param handle 446*941b3855SMatthias Ringwald * @param addr_type 447*941b3855SMatthias Ringwald * @param address 448*941b3855SMatthias Ringwald */ 449*941b3855SMatthias Ringwald #define SM_JUST_WORKS_REQUEST 0xD0 450*941b3855SMatthias Ringwald 451*941b3855SMatthias Ringwald /** 452*941b3855SMatthias Ringwald * @format H1B 453*941b3855SMatthias Ringwald * @param handle 454*941b3855SMatthias Ringwald * @param addr_type 455*941b3855SMatthias Ringwald * @param address 456*941b3855SMatthias Ringwald */ 457*941b3855SMatthias Ringwald #define SM_JUST_WORKS_CANCEL 0xD1 458*941b3855SMatthias Ringwald 459*941b3855SMatthias Ringwald /** 460*941b3855SMatthias Ringwald * @format H1B4 461*941b3855SMatthias Ringwald * @param handle 462*941b3855SMatthias Ringwald * @param addr_type 463*941b3855SMatthias Ringwald * @param address 464*941b3855SMatthias Ringwald * @param passkey 465*941b3855SMatthias Ringwald */ 466*941b3855SMatthias Ringwald #define SM_PASSKEY_DISPLAY_NUMBER 0xD2 467*941b3855SMatthias Ringwald 468*941b3855SMatthias Ringwald /** 469*941b3855SMatthias Ringwald * @format H1B 470*941b3855SMatthias Ringwald * @param handle 471*941b3855SMatthias Ringwald * @param addr_type 472*941b3855SMatthias Ringwald * @param address 473*941b3855SMatthias Ringwald */ 474*941b3855SMatthias Ringwald #define SM_PASSKEY_DISPLAY_CANCEL 0xD3 475*941b3855SMatthias Ringwald 476*941b3855SMatthias Ringwald /** 477*941b3855SMatthias Ringwald * @format H1B421 478*941b3855SMatthias Ringwald * @param handle 479*941b3855SMatthias Ringwald * @param addr_type 480*941b3855SMatthias Ringwald * @param address 481*941b3855SMatthias Ringwald */ 482*941b3855SMatthias Ringwald #define SM_PASSKEY_INPUT_NUMBER 0xD4 483*941b3855SMatthias Ringwald 484*941b3855SMatthias Ringwald /** 485*941b3855SMatthias Ringwald * @format H1B 486*941b3855SMatthias Ringwald * @param handle 487*941b3855SMatthias Ringwald * @param addr_type 488*941b3855SMatthias Ringwald * @param address 489*941b3855SMatthias Ringwald */ 490*941b3855SMatthias Ringwald #define SM_PASSKEY_INPUT_CANCEL 0xD5 491*941b3855SMatthias Ringwald 492*941b3855SMatthias Ringwald /** 493*941b3855SMatthias Ringwald * @format H1B 494*941b3855SMatthias Ringwald * @param handle 495*941b3855SMatthias Ringwald * @param addr_type 496*941b3855SMatthias Ringwald * @param address 497*941b3855SMatthias Ringwald */ 498*941b3855SMatthias Ringwald #define SM_IDENTITY_RESOLVING_STARTED 0xD6 499*941b3855SMatthias Ringwald 500*941b3855SMatthias Ringwald /** 501*941b3855SMatthias Ringwald * @format H1B 502*941b3855SMatthias Ringwald * @param handle 503*941b3855SMatthias Ringwald * @param addr_type 504*941b3855SMatthias Ringwald * @param address 505*941b3855SMatthias Ringwald */ 506*941b3855SMatthias Ringwald #define SM_IDENTITY_RESOLVING_FAILED 0xD7 507*941b3855SMatthias Ringwald 508*941b3855SMatthias Ringwald /** 509*941b3855SMatthias Ringwald * @format H1B2 510*941b3855SMatthias Ringwald * @param handle 511*941b3855SMatthias Ringwald * @param addr_type 512*941b3855SMatthias Ringwald * @param address 513*941b3855SMatthias Ringwald * @param le_device_db_index 514*941b3855SMatthias Ringwald */ 515*941b3855SMatthias Ringwald #define SM_IDENTITY_RESOLVING_SUCCEEDED 0xD8 516*941b3855SMatthias Ringwald 517*941b3855SMatthias Ringwald /** 518*941b3855SMatthias Ringwald * @format H1B 519*941b3855SMatthias Ringwald * @param handle 520*941b3855SMatthias Ringwald * @param addr_type 521*941b3855SMatthias Ringwald * @param address 522*941b3855SMatthias Ringwald */ 523*941b3855SMatthias Ringwald #define SM_AUTHORIZATION_REQUEST 0xD9 524*941b3855SMatthias Ringwald 525*941b3855SMatthias Ringwald /** 526*941b3855SMatthias Ringwald * @format H1B1 527*941b3855SMatthias Ringwald * @param handle 528*941b3855SMatthias Ringwald * @param addr_type 529*941b3855SMatthias Ringwald * @param address 530*941b3855SMatthias Ringwald * @param authorization_result 531*941b3855SMatthias Ringwald */ 532*941b3855SMatthias Ringwald #define SM_AUTHORIZATION_RESULT 0xDA 533*941b3855SMatthias Ringwald 534*941b3855SMatthias Ringwald // GAP 535*941b3855SMatthias Ringwald 536*941b3855SMatthias Ringwald // data: event(8), len(8), hci_handle (16), security_level (8) 537*941b3855SMatthias Ringwald #define GAP_SECURITY_LEVEL 0xE0 538*941b3855SMatthias Ringwald 539*941b3855SMatthias Ringwald // data: event(8), len(8), status (8), bd_addr(48) 540*941b3855SMatthias Ringwald #define GAP_DEDICATED_BONDING_COMPLETED 0xE1 541*941b3855SMatthias Ringwald 542*941b3855SMatthias Ringwald /** 543*941b3855SMatthias Ringwald * @format 11B1JV 544*941b3855SMatthias Ringwald * @param advertising_event_type 545*941b3855SMatthias Ringwald * @param address_type 546*941b3855SMatthias Ringwald * @param address 547*941b3855SMatthias Ringwald * @param rssi 548*941b3855SMatthias Ringwald * @param data_length 549*941b3855SMatthias Ringwald * @param data 550*941b3855SMatthias Ringwald */ 551*941b3855SMatthias Ringwald #define GAP_LE_ADVERTISING_REPORT 0xE2 552*941b3855SMatthias Ringwald 553*941b3855SMatthias Ringwald #define HCI_EVENT_HSP_META 0xE8 554*941b3855SMatthias Ringwald 555*941b3855SMatthias Ringwald #define HSP_SUBEVENT_AUDIO_CONNECTION_COMPLETE 0x01 556*941b3855SMatthias Ringwald #define HSP_SUBEVENT_AUDIO_DISCONNECTION_COMPLETE 0x02 557*941b3855SMatthias Ringwald #define HSP_SUBEVENT_MICROPHONE_GAIN_CHANGED 0x03 558*941b3855SMatthias Ringwald #define HSP_SUBEVENT_SPEAKER_GAIN_CHANGED 0x04 559*941b3855SMatthias Ringwald #define HSP_SUBEVENT_HS_COMMAND 0x05 560*941b3855SMatthias Ringwald #define HSP_SUBEVENT_AG_INDICATION 0x06 561*941b3855SMatthias Ringwald #define HSP_SUBEVENT_ERROR 0x07 562*941b3855SMatthias Ringwald #define HSP_SUBEVENT_RING 0x08 563*941b3855SMatthias Ringwald 564*941b3855SMatthias Ringwald #define HCI_EVENT_HFP_META 0xE9 565*941b3855SMatthias Ringwald 566*941b3855SMatthias Ringwald #define HFP_SUBEVENT_SERVICE_LEVEL_CONNECTION_ESTABLISHED 0x01 567*941b3855SMatthias Ringwald #define HFP_SUBEVENT_SERVICE_LEVEL_CONNECTION_RELEASED 0x02 568*941b3855SMatthias Ringwald #define HFP_SUBEVENT_AUDIO_CONNECTION_ESTABLISHED 0x03 569*941b3855SMatthias Ringwald #define HFP_SUBEVENT_AUDIO_CONNECTION_RELEASED 0x04 570*941b3855SMatthias Ringwald #define HFP_SUBEVENT_COMPLETE 0x05 571*941b3855SMatthias Ringwald #define HFP_SUBEVENT_AG_INDICATOR_STATUS_CHANGED 0x06 572*941b3855SMatthias Ringwald #define HFP_SUBEVENT_NETWORK_OPERATOR_CHANGED 0x07 573*941b3855SMatthias Ringwald #define HFP_SUBEVENT_EXTENDED_AUDIO_GATEWAY_ERROR 0x08 574*941b3855SMatthias Ringwald #define HFP_SUBEVENT_CODECS_CONNECTION_COMPLETE 0x09 575*941b3855SMatthias Ringwald #define HFP_SUBEVENT_AUDIO_CONNECTION_COMPLETE 0x0A 576*941b3855SMatthias Ringwald 577*941b3855SMatthias Ringwald // ANCS Client 578*941b3855SMatthias Ringwald #define ANCS_CLIENT_CONNECTED 0xF0 579*941b3855SMatthias Ringwald #define ANCS_CLIENT_NOTIFICATION 0xF1 580*941b3855SMatthias Ringwald #define ANCS_CLIENT_DISCONNECTED 0xF2 581*941b3855SMatthias Ringwald 582*941b3855SMatthias Ringwald // #define HCI_EVENT_HFP_META 0xxx 583*941b3855SMatthias Ringwald // #define HCI_EVENT_GATT_META 0xxx 584*941b3855SMatthias Ringwald // #define HCI_EVENT_SDP_META 0xxx 585*941b3855SMatthias Ringwald // #define HCI_EVENT_ANCS_META 0xxx 586*941b3855SMatthias Ringwald // #define HCI_EVENT_SM_META 0xxx 587*941b3855SMatthias Ringwald // #define HCI_EVENT_GAP_META 0xxx 588*941b3855SMatthias Ringwald // #define HCI_EVENT_BNEP_META 0xxx 589*941b3855SMatthias Ringwald // #define HCI_EVENT_PAN_META 0xxx 590*941b3855SMatthias Ringwald 591*941b3855SMatthias Ringwald #endif 592