10 #ifndef __HCI_CONST_H_ 11 #define __HCI_CONST_H_ 18 #define HCI_COMMAND_PKT 0x01 19 #define HCI_ACLDATA_PKT 0x02 20 #define HCI_SCODATA_PKT 0x03 21 #define HCI_EVENT_PKT 0x04 22 #define HCI_VENDOR_PKT 0xff 28 #define HCI_HDR_SIZE 1 34 #define HCI_COMMAND_HDR_SIZE 3 41 #define HCI_EVENT_HDR_SIZE 2 47 #define HCI_ACL_HDR_SIZE 4 50 #define OGF_LINK_CTL 0x01 52 #define OCF_DISCONNECT 0x0006 57 #define DISCONNECT_CP_SIZE 3 60 #define OGF_HOST_CTL 0x03 62 #define OCF_SET_EVENT_MASK 0x0001 63 #define OCF_RESET 0x0003 65 #define OCF_READ_TRANSMIT_POWER_LEVEL 0x002D 70 #define READ_TRANSMIT_POWER_LEVEL_CP_SIZE 3 76 #define READ_TRANSMIT_POWER_LEVEL_RP_SIZE 4 78 #define OCF_SET_CONTROLLER_TO_HOST_FC 0x0031 79 #define OCF_HOST_BUFFER_SIZE 0x0033 80 #define OCF_HOST_NUM_COMP_PKTS 0x0035 83 #define OGF_INFO_PARAM 0x04 85 #define OCF_READ_LOCAL_VERSION 0x0001 94 #define READ_LOCAL_VERSION_RP_SIZE 9 96 #define OCF_READ_LOCAL_COMMANDS 0x0002 97 #define OCF_READ_LOCAL_FEATURES 0x0003 99 #define OCF_READ_BD_ADDR 0x0009 104 #define READ_BD_ADDR_RP_SIZE 7 107 #define OGF_STATUS_PARAM 0x05 109 #define OCF_READ_RSSI 0x0005 113 #define READ_RSSI_CP_SIZE 2 119 #define READ_RSSI_RP_SIZE 4 123 #define OGF_LE_CTL 0x08 125 #define OCF_LE_SET_EVENT_MASK 0x0001 129 #define LE_SET_EVENT_MASK_CP_SIZE 8 131 #define OCF_LE_READ_BUFFER_SIZE 0x0002 137 #define LE_READ_BUFFER_SIZE_RP_SIZE 4 139 #define OCF_LE_READ_LOCAL_SUPPORTED_FEATURES 0x0003 144 #define LE_READ_LOCAL_SUPPORTED_FEATURES_RP_SIZE 9 146 #define OCF_LE_SET_RANDOM_ADDRESS 0x0005 150 #define LE_SET_RANDOM_ADDRESS_CP_SIZE 6 152 #define OCF_LE_SET_ADV_PARAMETERS 0x0006 163 #define LE_SET_ADV_PARAMETERS_CP_SIZE 15 165 #define OCF_LE_READ_ADV_CHANNEL_TX_POWER 0x0007 170 #define LE_READ_ADV_CHANNEL_TX_POWER_RP_SIZE 2 172 #define OCF_LE_SET_ADV_DATA 0x0008 177 #define LE_SET_ADV_DATA_CP_SIZE 32 179 #define OCF_LE_SET_SCAN_RESPONSE_DATA 0x0009 184 #define LE_SET_SCAN_RESPONSE_DATA_CP_SIZE 32 186 #define OCF_LE_SET_ADVERTISE_ENABLE 0x000A 190 #define LE_SET_ADVERTISE_ENABLE_CP_SIZE 1 192 #define OCF_LE_SET_SCAN_PARAMETERS 0x000B 200 #define LE_SET_SCAN_PARAMETERS_CP_SIZE 7 202 #define OCF_LE_SET_SCAN_ENABLE 0x000C 207 #define LE_SET_SCAN_ENABLE_CP_SIZE 2 209 #define OCF_LE_CREATE_CONN 0x000D 224 #define LE_CREATE_CONN_CP_SIZE 25 226 #define OCF_LE_CREATE_CONN_CANCEL 0x000E 228 #define OCF_LE_READ_WHITE_LIST_SIZE 0x000F 233 #define LE_READ_WHITE_LIST_SIZE_RP_SIZE 2 235 #define OCF_LE_CLEAR_WHITE_LIST 0x0010 237 #define OCF_LE_ADD_DEVICE_TO_WHITE_LIST 0x0011 242 #define LE_ADD_DEVICE_TO_WHITE_LIST_CP_SIZE 7 244 #define OCF_LE_REMOVE_DEVICE_FROM_WHITE_LIST 0x0012 249 #define LE_REMOVE_DEVICE_FROM_WHITE_LIST_CP_SIZE 7 251 #define OCF_LE_CONN_UPDATE 0x0013 261 #define LE_CONN_UPDATE_CP_SIZE 14 263 #define OCF_LE_SET_HOST_CHANNEL_CLASSIFICATION 0x0014 267 #define LE_SET_HOST_CHANNEL_CLASSIFICATION_CP_SIZE 5 269 #define OCF_LE_READ_CHANNEL_MAP 0x0015 273 #define LE_READ_CHANNEL_MAP_CP_SIZE 2 280 #define LE_READ_CHANNEL_MAP_RP_SIZE 8 282 #define OCF_LE_READ_REMOTE_USED_FEATURES 0x0016 286 #define LE_READ_REMOTE_USED_FEATURES_CP_SIZE 2 288 #define OCF_LE_ENCRYPT 0x0017 291 uint8_t plaintext[16];
293 #define LE_ENCRYPT_CP_SIZE 32 299 #define LE_ENCRYPT_RP_SIZE 17 301 #define OCF_LE_RAND 0x0018 306 #define LE_RAND_RP_SIZE 9 308 #define OCF_LE_START_ENCRYPTION 0x0019 315 #define LE_START_ENCRYPTION_CP_SIZE 28 317 #define OCF_LE_LTK_REPLY 0x001A 322 #define LE_LTK_REPLY_CP_SIZE 18 328 #define LE_LTK_REPLY_RP_SIZE 3 330 #define OCF_LE_LTK_NEG_REPLY 0x001B 334 #define LE_LTK_NEG_REPLY_CP_SIZE 2 340 #define LE_LTK_NEG_REPLY_RP_SIZE 3 342 #define OCF_LE_READ_SUPPORTED_STATES 0x001C 347 #define LE_READ_SUPPORTED_STATES_RP_SIZE 9 349 #define OCF_LE_RECEIVER_TEST 0x001D 353 #define LE_RECEIVER_TEST_CP_SIZE 1 355 #define OCF_LE_TRANSMITTER_TEST 0x001E 361 #define LE_TRANSMITTER_TEST_CP_SIZE 3 363 #define OCF_LE_TEST_END 0x001F 368 #define LE_TEST_END_RP_SIZE 3 371 #define OGF_VENDOR_CMD 0x3f 375 #define EVT_CONN_COMPLETE 0x03 383 #define EVT_CONN_COMPLETE_SIZE 13 385 #define EVT_DISCONN_COMPLETE 0x05 391 #define EVT_DISCONN_COMPLETE_SIZE 4 393 #define EVT_ENCRYPT_CHANGE 0x08 399 #define EVT_ENCRYPT_CHANGE_SIZE 5 401 #define EVT_READ_REMOTE_VERSION_COMPLETE 0x0C 403 #define EVT_CMD_COMPLETE 0x0E 408 #define EVT_CMD_COMPLETE_SIZE 3 410 #define EVT_CMD_STATUS 0x0F 416 #define EVT_CMD_STATUS_SIZE 4 418 #define EVT_HARDWARE_ERROR 0x10 422 #define EVT_HARDWARE_ERROR_SIZE 1 424 #define EVT_NUM_COMP_PKTS 0x13 429 #define EVT_NUM_COMP_PKTS_SIZE 1 436 #define EVT_NUM_COMP_PKTS_PARAM_SIZE 1 438 #define EVT_DATA_BUFFER_OVERFLOW 0x1A 442 #define EVT_DATA_BUFFER_OVERFLOW_SIZE 1 444 #define EVT_ENCRYPTION_KEY_REFRESH_COMPLETE 0x30 449 #define EVT_ENCRYPTION_KEY_REFRESH_COMPLETE_SIZE 3 451 #define EVT_LE_META_EVENT 0x3E 456 #define EVT_LE_META_EVENT_SIZE 1 458 #define EVT_LE_CONN_COMPLETE 0x01 470 #define EVT_LE_CONN_COMPLETE_SIZE 18 472 #define EVT_LE_ADVERTISING_REPORT 0x02 480 #define LE_ADVERTISING_INFO_SIZE 9 482 #define EVT_LE_CONN_UPDATE_COMPLETE 0x03 490 #define EVT_LE_CONN_UPDATE_COMPLETE_SIZE 9 492 #define EVT_LE_READ_REMOTE_USED_FEATURES_COMPLETE 0x04 498 #define EVT_LE_READ_REMOTE_USED_FEATURES_COMPLETE_SIZE 11 500 #define EVT_LE_LTK_REQUEST 0x05 506 #define EVT_LE_LTK_REQUEST_SIZE 12 512 #define EVT_VENDOR 0xFF 516 #define cmd_opcode_pack(ogf, ocf) (uint16_t)((ocf & 0x03ff)|(ogf << 10)) 517 #define cmd_opcode_ogf(op) (op >> 10) 518 #define cmd_opcode_ocf(op) (op & 0x03ff) uint16_t latency
Definition: hci_const.h:256
Definition: hci_const.h:289
__packed struct _le_connection_update_cp le_connection_update_cp
uint16_t opcode
Definition: hci_const.h:406
uint8_t status
Definition: hci_const.h:230
__packed struct _disconnect_cp disconnect_cp
uint8_t length
Definition: hci_const.h:181
uint8_t plen
Definition: hci_const.h:38
__packed struct _evt_data_buffer_overflow evt_data_buffer_overflow
uint8_t type
Definition: hci_const.h:194
uint16_t min_ce_length
Definition: hci_const.h:258
Definition: hci_const.h:166
Definition: hci_const.h:364
__packed struct _le_read_channel_map_cp le_read_channel_map_cp
tBDAddr peer_bdaddr
Definition: hci_const.h:215
uint16_t num_comp_pkts
Definition: hci_const.h:434
uint16_t hndl
Definition: hci_const.h:433
__packed struct _le_rand_rp le_rand_rp
Definition: hci_const.h:318
__packed struct _le_create_connection_cp le_create_connection_cp
Definition: hci_const.h:376
__packed struct _le_set_adv_data_cp le_set_adv_data_cp
__packed struct _le_add_device_to_white_list_cp le_add_device_to_white_list_cp
__packed struct _le_set_random_address_cp le_set_random_address_cp
Definition: hci_const.h:336
uint8_t status
Definition: hci_const.h:344
__packed struct _evt_cmd_complete evt_cmd_complete
tBDAddr direct_bdaddr
Definition: hci_const.h:159
uint16_t diversifier
Definition: hci_const.h:312
Definition: hci_const.h:173
uint16_t window
Definition: hci_const.h:196
uint8_t max_pkt
Definition: hci_const.h:135
Definition: hci_const.h:71
__packed struct _le_read_supported_states_rp le_read_supported_states_rp
uint8_t type
Definition: hci_const.h:68
uint8_t status
Definition: hci_const.h:460
int8_t level
Definition: hci_const.h:168
uint16_t handle
Definition: hci_const.h:310
uint16_t interval
Definition: hci_const.h:465
Definition: hci_const.h:525
Definition: hci_const.h:473
uint8_t status
Definition: hci_const.h:296
Definition: hci_const.h:43
uint16_t latency
Definition: hci_const.h:466
__packed struct _le_read_white_list_size_rp le_read_white_list_size_rp
uint8_t advtype
Definition: hci_const.h:156
uint16_t min_interval
Definition: hci_const.h:154
__packed struct _evt_conn_complete evt_conn_complete
uint8_t master_clock_accuracy
Definition: hci_const.h:468
uint16_t interval
Definition: hci_const.h:195
void(* hci_packet_complete_callback)(void *pckt, uint16_t len)
Definition: hci_const.h:533
__packed struct _evt_le_connection_update_complete evt_le_connection_update_complete
uint8_t enable
Definition: hci_const.h:204
uint16_t max_interval
Definition: hci_const.h:255
uint8_t status
Definition: hci_const.h:484
Definition: hci_const.h:356
__packed struct _le_remove_device_from_white_list_cp le_remove_device_from_white_list_cp
uint16_t latency
Definition: hci_const.h:487
Definition: hci_const.h:275
Definition: hci_const.h:238
uint8_t status
Definition: hci_const.h:325
uint8_t filter
Definition: hci_const.h:161
uint16_t handle
Definition: hci_const.h:378
tBDAddr bdaddr
Definition: hci_const.h:379
__packed struct _le_read_remote_used_features_cp le_read_remote_used_features_cp
Definition: hci_const.h:439
#define VARIABLE_SIZE
Definition: bluenrg_types.h:31
uint8_t num_hndl
Definition: hci_const.h:426
uint8_t own_bdaddr_type
Definition: hci_const.h:197
uint8_t peer_bdaddr_type
Definition: hci_const.h:214
uint16_t pkt_len
Definition: hci_const.h:134
uint16_t lmp_pal_subversion
Definition: hci_const.h:92
uint16_t supervision_timeout
Definition: hci_const.h:488
uint8_t length
Definition: hci_const.h:174
Definition: hci_const.h:529
__packed struct _le_set_advertise_enable_cp le_set_advertise_enable_cp
uint16_t supervision_timeout
Definition: hci_const.h:467
uint16_t min_interval
Definition: hci_const.h:217
uint16_t handle
Definition: hci_const.h:502
uint8_t frequency
Definition: hci_const.h:351
Definition: hci_const.h:524
Definition: hci_const.h:523
uint16_t handle
Definition: hci_const.h:447
Definition: hci_const.h:309
uint8_t evt_type
Definition: hci_const.h:474
__packed struct _le_advertising_info le_advertising_info
__packed struct _evt_cmd_status evt_cmd_status
uint8_t own_bdaddr_type
Definition: hci_const.h:157
uint16_t latency
Definition: hci_const.h:219
__packed struct _read_transmit_power_level_rp read_transmit_power_level_rp
uint8_t status
Definition: hci_const.h:387
__packed struct _evt_num_comp_pkts evt_num_comp_pkts
uint16_t handle
Definition: hci_const.h:54
__packed struct _evt_le_read_remote_used_features_complete evt_le_read_remote_used_features_complete
uint16_t opcode
Definition: hci_const.h:31
uint8_t status
Definition: hci_const.h:133
uint8_t ncmd
Definition: hci_const.h:405
__packed struct _le_ltk_reply_cp le_ltk_reply_cp
Definition: hci_const.h:527
uint8_t status
Definition: hci_const.h:446
uint8_t tBDAddr[6]
Definition: link_layer.h:51
uint8_t status
Definition: hci_const.h:412
__packed struct _le_read_channel_map_rp le_read_channel_map_rp
uint16_t handle
Definition: hci_const.h:485
uint16_t interval
Definition: hci_const.h:486
uint16_t num_pkts
Definition: hci_const.h:366
uint16_t handle
Definition: hci_const.h:326
Definition: hci_const.h:432
__packed struct _hci_uart_pckt hci_uart_pckt
tBDAddr peer_bdaddr
Definition: hci_const.h:464
Definition: hci_const.h:530
uint16_t min_interval
Definition: hci_const.h:254
__packed struct _le_set_scan_enable_cp le_set_scan_enable_cp
uint8_t link_type
Definition: hci_const.h:380
uint8_t status
Definition: hci_const.h:337
uint16_t ediv
Definition: hci_const.h:504
Definition: hci_const.h:350
__packed struct _le_set_host_channel_classification_cp le_set_host_channel_classification_cp
Definition: hci_const.h:404
uint16_t handle
Definition: hci_const.h:284
uint8_t status
Definition: hci_const.h:395
__packed struct _evt_le_meta_event evt_le_meta_event
uint8_t hci_version
Definition: hci_const.h:88
uint8_t status
Definition: hci_const.h:276
__packed struct _le_read_adv_channel_tx_power_rp le_read_adv_channel_tx_power_rp
Definition: hci_const.h:126
Definition: hci_const.h:445
Definition: hci_const.h:295
uint16_t handle
Definition: hci_const.h:44
uint8_t status
Definition: hci_const.h:377
Definition: hci_const.h:132
int8_t level
Definition: hci_const.h:74
uint16_t opcode
Definition: hci_const.h:414
uint8_t reason
Definition: hci_const.h:55
Definition: hci_const.h:147
__packed struct _le_ltk_neg_reply_rp le_ltk_neg_reply_rp
uint8_t peer_bdaddr_type
Definition: hci_const.h:463
__packed struct _read_local_version_rp read_local_version_rp
uint16_t manufacturer_name
Definition: hci_const.h:91
uint8_t chan_map
Definition: hci_const.h:160
Definition: hci_const.h:501
__packed struct _le_read_local_supported_features_rp le_read_local_supported_features_rp
uint16_t handle
Definition: hci_const.h:388
Definition: hci_const.h:324
uint16_t interval
Definition: hci_const.h:211
Definition: hci_const.h:270
uint16_t hci_revision
Definition: hci_const.h:89
__packed struct _le_test_end_rp le_test_end_rp
Definition: hci_const.h:483
Definition: hci_const.h:252
Definition: hci_const.h:331
__packed struct _hci_acl_hdr hci_acl_hdr
uint8_t filter
Definition: hci_const.h:198
uint16_t window
Definition: hci_const.h:212
__packed struct _le_ltk_neg_reply_cp le_ltk_neg_reply_cp
Definition: hci_const.h:66
uint16_t handle
Definition: hci_const.h:277
Definition: hci_const.h:386
uint8_t type
Definition: hci_const.h:25
uint16_t supervision_timeout
Definition: hci_const.h:220
uint8_t plen
Definition: hci_const.h:32
Definition: hci_const.h:193
uint8_t status
Definition: hci_const.h:167
Definition: hci_const.h:245
uint16_t handle
Definition: hci_const.h:73
uint16_t handle
Definition: hci_const.h:271
tBDAddr bdaddr
Definition: hci_const.h:102
uint8_t evt
Definition: hci_const.h:37
Definition: hci_const.h:394
Definition: hci_const.h:140
uint16_t handle
Definition: hci_const.h:253
Definition: hci_const.h:459
__packed struct _read_rssi_rp read_rssi_rp
uint16_t handle
Definition: hci_const.h:461
Definition: hci_const.h:210
Definition: hci_const.h:343
uint8_t direct_bdaddr_type
Definition: hci_const.h:158
uint8_t status
Definition: hci_const.h:365
__packed struct _le_receiver_test_cp le_receiver_test_cp
uint16_t supervision_timeout
Definition: hci_const.h:257
uint8_t frequency
Definition: hci_const.h:357
uint16_t handle
Definition: hci_const.h:495
uint8_t status
Definition: hci_const.h:303
__packed struct _evt_hardware_error evt_hardware_error
uint8_t initiator_filter
Definition: hci_const.h:213
__packed struct _evt_encrypt_change evt_encrypt_change
uint16_t handle
Definition: hci_const.h:338
uint8_t role
Definition: hci_const.h:462
__packed struct _evt_num_comp_pkts_param evt_num_comp_pkts_param
__packed struct _hci_event_pckt hci_event_pckt
__packed struct _le_set_adv_parameters_cp le_set_adv_parameters_cp
__packed struct _le_read_buffer_size_rp le_read_buffer_size_rp
__packed struct _evt_le_connection_complete evt_le_connection_complete
Definition: hci_const.h:493
uint8_t length
Definition: hci_const.h:358
Definition: hci_const.h:521
__packed struct _evt_le_long_term_key_request evt_le_long_term_key_request
Definition: hci_const.h:24
Definition: hci_const.h:411
uint8_t status
Definition: hci_const.h:141
uint8_t status
Definition: hci_const.h:494
uint8_t enable
Definition: hci_const.h:188
Definition: hci_const.h:283
Definition: hci_const.h:264
uint8_t status
Definition: hci_const.h:87
#define PACKED
Definition: bluenrg_types.h:63
__packed struct _le_set_event_mask_cp le_set_event_mask_cp
uint16_t max_ce_length
Definition: hci_const.h:259
Definition: hci_const.h:30
uint8_t bdaddr_type
Definition: hci_const.h:239
Definition: hci_const.h:302
uint8_t status
Definition: hci_const.h:101
Definition: hci_const.h:100
uint8_t data_length
Definition: hci_const.h:477
uint8_t reason
Definition: hci_const.h:389
Definition: hci_const.h:187
uint16_t handle
Definition: hci_const.h:332
__packed struct _le_encrypt_cp le_encrypt_cp
Definition: hci_const.h:522
Definition: hci_const.h:153
uint16_t handle
Definition: hci_const.h:319
__packed struct _evt_disconn_complete evt_disconn_complete
uint16_t dlen
Definition: hci_const.h:45
Definition: hci_const.h:425
__packed struct _le_set_scan_parameters_cp le_set_scan_parameters_cp
uint8_t code
Definition: hci_const.h:420
Definition: hci_const.h:36
Definition: hci_const.h:53
tBDAddr bdaddr
Definition: hci_const.h:148
tBDAddr bdaddr
Definition: hci_const.h:247
uint8_t filter_dup
Definition: hci_const.h:205
uint16_t handle
Definition: hci_const.h:67
__packed struct _hci_command_hdr hci_command_hdr
uint16_t max_ce_length
Definition: hci_const.h:222
uint8_t own_bdaddr_type
Definition: hci_const.h:216
Definition: hci_const.h:528
__packed struct _read_rssi_cp read_rssi_cp
uint8_t payload
Definition: hci_const.h:359
hci_state
Definition: hci_const.h:520
__packed struct _read_transmit_power_level_cp read_transmit_power_level_cp
Definition: hci_const.h:526
uint16_t max_interval
Definition: hci_const.h:155
__packed struct _read_bd_addr_rp read_bd_addr_rp
uint8_t size
Definition: hci_const.h:231
uint16_t handle
Definition: hci_const.h:396
__packed struct _le_transmitter_test_cp le_transmitter_test_cp
uint16_t min_ce_length
Definition: hci_const.h:221
tBDAddr bdaddr
Definition: hci_const.h:476
uint16_t max_interval
Definition: hci_const.h:218
uint8_t bdaddr_type
Definition: hci_const.h:475
uint8_t status
Definition: hci_const.h:72
uint8_t ncmd
Definition: hci_const.h:413
Definition: hci_const.h:86
uint8_t lmp_pal_version
Definition: hci_const.h:90
tBDAddr bdaddr
Definition: hci_const.h:240
__packed struct _le_encrypt_rp le_encrypt_rp
uint8_t bdaddr_type
Definition: hci_const.h:246
Definition: hci_const.h:229
uint8_t encrypt
Definition: hci_const.h:397
__packed struct _le_set_scan_response_data_cp le_set_scan_response_data_cp
__packed struct _le_ltk_reply_rp le_ltk_reply_rp
Definition: hci_const.h:419
Definition: hci_const.h:203
uint8_t encr_mode
Definition: hci_const.h:381
uint8_t link_type
Definition: hci_const.h:440
__packed struct _evt_encryption_key_refresh_complete evt_encryption_key_refresh_complete
uint8_t data[VARIABLE_SIZE]
Definition: hci_const.h:26
__packed struct _le_start_encryption_cp le_start_encryption_cp
Definition: hci_const.h:180