27#ifndef H_BLE_HCI_COMMON_
28#define H_BLE_HCI_COMMON_
30#include "nimble/nimble/include/nimble/ble.h"
31#include "nimble/nimble/transport/include/nimble/transport.h"
37#define BLE_HCI_MAX_DATA_LEN (MYNEWT_VAL(BLE_TRANSPORT_EVT_SIZE) - \
38 sizeof(struct ble_hci_ev))
45} __attribute__((packed));
52} __attribute__((packed));
54#define BLE_HCI_OPCODE_NOP (0)
57#define BLE_HCI_OP(ogf, ocf) ((ocf) | ((ogf) << 10))
60#define BLE_HCI_OGF(opcode) (((opcode) >> 10) & 0x003F)
61#define BLE_HCI_OCF(opcode) ((opcode) & 0x03FF)
64#define BLE_HCI_OGF_LINK_CTRL (0x01)
65#define BLE_HCI_OGF_LINK_POLICY (0x02)
66#define BLE_HCI_OGF_CTLR_BASEBAND (0x03)
67#define BLE_HCI_OGF_INFO_PARAMS (0x04)
68#define BLE_HCI_OGF_STATUS_PARAMS (0x05)
69#define BLE_HCI_OGF_TESTING (0x06)
70#define BLE_HCI_OGF_LE (0x08)
71#define BLE_HCI_OGF_VENDOR (0x3F)
77#define BLE_HCI_NUM_LE_CMDS (79)
80#define BLE_HCI_OCF_DISCONNECT_CMD (0x0006)
81struct ble_hci_lc_disconnect_cp {
84} __attribute__((packed));
86#define BLE_HCI_OCF_RD_REM_VER_INFO (0x001D)
87struct ble_hci_rd_rem_ver_info_cp {
89} __attribute__((packed));
92#define BLE_HCI_OCF_CB_SET_EVENT_MASK (0x0001)
93struct ble_hci_cb_set_event_mask_cp {
95} __attribute__((packed));
97#define BLE_HCI_OCF_CB_RESET (0x0003)
99#define BLE_HCI_OCF_CB_READ_TX_PWR (0x002D)
100struct ble_hci_cb_read_tx_pwr_cp {
101 uint16_t conn_handle;
103} __attribute__((packed));
105struct ble_hci_cb_read_tx_pwr_rp {
106 uint16_t conn_handle;
108} __attribute__((packed));
111#define BLE_HCI_OCF_CB_SET_CTLR_TO_HOST_FC (0x0031)
112struct ble_hci_cb_ctlr_to_host_fc_cp {
114} __attribute__((packed));
116#define BLE_HCI_OCF_CB_HOST_BUF_SIZE (0x0033)
117struct ble_hci_cb_host_buf_size_cp {
118 uint16_t acl_data_len;
119 uint8_t sco_data_len;
122} __attribute__((packed));
124#define BLE_HCI_OCF_CB_HOST_NUM_COMP_PKTS (0x0035)
125struct ble_hci_cb_host_num_comp_pkts_entry {
128} __attribute__((packed));
129struct ble_hci_cb_host_num_comp_pkts_cp {
131 struct ble_hci_cb_host_num_comp_pkts_entry h[0];
132} __attribute__((packed));
134#define BLE_HCI_OCF_CB_SET_EVENT_MASK2 (0x0063)
135struct ble_hci_cb_set_event_mask2_cp {
136 uint64_t event_mask2;
137} __attribute__((packed));
139#define BLE_HCI_OCF_CB_RD_AUTH_PYLD_TMO (0x007B)
140struct ble_hci_cb_rd_auth_pyld_tmo_cp {
141 uint16_t conn_handle;
142} __attribute__((packed));
143struct ble_hci_cb_rd_auth_pyld_tmo_rp {
144 uint16_t conn_handle;
146} __attribute__((packed));
148#define BLE_HCI_OCF_CB_WR_AUTH_PYLD_TMO (0x007C)
149struct ble_hci_cb_wr_auth_pyld_tmo_cp {
150 uint16_t conn_handle;
152} __attribute__((packed));
153struct ble_hci_cb_wr_auth_pyld_tmo_rp {
154 uint16_t conn_handle;
155} __attribute__((packed));
158#define BLE_HCI_OCF_IP_RD_LOCAL_VER (0x0001)
159struct ble_hci_ip_rd_local_ver_rp {
163 uint16_t manufacturer;
165} __attribute__((packed));
167#define BLE_HCI_OCF_IP_RD_LOC_SUPP_CMD (0x0002)
168struct ble_hci_ip_rd_loc_supp_cmd_rp {
169 uint8_t commands[64];
170} __attribute__((packed));
172#define BLE_HCI_OCF_IP_RD_LOC_SUPP_FEAT (0x0003)
173struct ble_hci_ip_rd_loc_supp_feat_rp {
175} __attribute__((packed));
177#define BLE_HCI_OCF_IP_RD_BUF_SIZE (0x0005)
178struct ble_hci_ip_rd_buf_size_rp {
179 uint16_t acl_data_len;
180 uint8_t sco_data_len;
183} __attribute__((packed));
185#define BLE_HCI_OCF_IP_RD_BD_ADDR (0x0009)
186struct ble_hci_ip_rd_bd_addr_rp {
188} __attribute__((packed));
191#define BLE_HCI_OCF_RD_RSSI (0x0005)
192struct ble_hci_rd_rssi_cp {
194} __attribute__((packed));
195struct ble_hci_rd_rssi_rp {
198} __attribute__((packed));
201#define BLE_HCI_OCF_LE_SET_EVENT_MASK (0x0001)
202struct ble_hci_le_set_event_mask_cp {
204} __attribute__((packed));
206#define BLE_HCI_OCF_LE_RD_BUF_SIZE (0x0002)
207struct ble_hci_le_rd_buf_size_rp {
209 uint8_t data_packets;
210} __attribute__((packed));
212#define BLE_HCI_OCF_LE_RD_BUF_SIZE_V2 (0x0060)
213struct ble_hci_le_rd_buf_size_v2_rp {
215 uint8_t data_packets;
216 uint16_t iso_data_len;
217 uint8_t iso_data_packets;
218} __attribute__((packed));
220#define BLE_HCI_OCF_LE_RD_LOC_SUPP_FEAT (0x0003)
221struct ble_hci_le_rd_loc_supp_feat_rp {
223} __attribute__((packed));
226#define BLE_HCI_OCF_LE_SET_RAND_ADDR (0x0005)
227struct ble_hci_le_set_rand_addr_cp {
229} __attribute__((packed));
231#define BLE_HCI_OCF_LE_SET_ADV_PARAMS (0x0006)
232struct ble_hci_le_set_adv_params_cp {
233 uint16_t min_interval;
234 uint16_t max_interval;
236 uint8_t own_addr_type;
237 uint8_t peer_addr_type;
238 uint8_t peer_addr[6];
240 uint8_t filter_policy;
241} __attribute__((packed));
243#define BLE_HCI_OCF_LE_RD_ADV_CHAN_TXPWR (0x0007)
244struct ble_hci_le_rd_adv_chan_txpwr_rp {
246} __attribute__((packed));
248#define BLE_HCI_OCF_LE_SET_ADV_DATA (0x0008)
249#define BLE_HCI_MAX_ADV_DATA_LEN (31)
250struct ble_hci_le_set_adv_data_cp {
251 uint8_t adv_data_len;
252 uint8_t adv_data[BLE_HCI_MAX_ADV_DATA_LEN];
253} __attribute__((packed));
255#define BLE_HCI_OCF_LE_SET_SCAN_RSP_DATA (0x0009)
256#define BLE_HCI_MAX_SCAN_RSP_DATA_LEN (31)
257struct ble_hci_le_set_scan_rsp_data_cp {
258 uint8_t scan_rsp_len;
259 uint8_t scan_rsp[BLE_HCI_MAX_SCAN_RSP_DATA_LEN];
260} __attribute__((packed));
262#define BLE_HCI_OCF_LE_SET_ADV_ENABLE (0x000A)
263struct ble_hci_le_set_adv_enable_cp {
265} __attribute__((packed));
267#define BLE_HCI_OCF_LE_SET_SCAN_PARAMS (0x000B)
268struct ble_hci_le_set_scan_params_cp {
271 uint16_t scan_window;
272 uint8_t own_addr_type;
273 uint8_t filter_policy;
274} __attribute__((packed));
276#define BLE_HCI_OCF_LE_SET_SCAN_ENABLE (0x000C)
277struct ble_hci_le_set_scan_enable_cp {
279 uint8_t filter_duplicates;
280} __attribute__((packed));
282#define BLE_HCI_OCF_LE_CREATE_CONN (0x000D)
283struct ble_hci_le_create_conn_cp {
285 uint16_t scan_window;
286 uint8_t filter_policy;
287 uint8_t peer_addr_type;
288 uint8_t peer_addr[6];
289 uint8_t own_addr_type;
290 uint16_t min_conn_itvl;
291 uint16_t max_conn_itvl;
292 uint16_t conn_latency;
296} __attribute__((packed));
298#define BLE_HCI_OCF_LE_CREATE_CONN_CANCEL (0x000E)
300#define BLE_HCI_OCF_LE_RD_WHITE_LIST_SIZE (0x000F)
301struct ble_hci_le_rd_white_list_rp {
303} __attribute__((packed));
305#define BLE_HCI_OCF_LE_CLEAR_WHITE_LIST (0x0010)
307#define BLE_HCI_OCF_LE_ADD_WHITE_LIST (0x0011)
308struct ble_hci_le_add_whte_list_cp {
311} __attribute__((packed));
313#define BLE_HCI_OCF_LE_RMV_WHITE_LIST (0x0012)
314struct ble_hci_le_rmv_white_list_cp {
317} __attribute__((packed));
319#define BLE_HCI_OCF_LE_CONN_UPDATE (0x0013)
320struct ble_hci_le_conn_update_cp {
321 uint16_t conn_handle;
322 uint16_t conn_itvl_min;
323 uint16_t conn_itvl_max;
324 uint16_t conn_latency;
325 uint16_t supervision_timeout;
328} __attribute__((packed));
330#define BLE_HCI_OCF_LE_SET_HOST_CHAN_CLASS (0x0014)
331struct ble_hci_le_set_host_chan_class_cp {
333} __attribute__((packed));
335#define BLE_HCI_OCF_LE_RD_CHAN_MAP (0x0015)
336struct ble_hci_le_rd_chan_map_cp {
337 uint16_t conn_handle;
338} __attribute__((packed));
339struct ble_hci_le_rd_chan_map_rp {
340 uint16_t conn_handle;
342} __attribute__((packed));
344#define BLE_HCI_OCF_LE_RD_REM_FEAT (0x0016)
345struct ble_hci_le_rd_rem_feat_cp {
346 uint16_t conn_handle;
347} __attribute__((packed));
349#define BLE_HCI_OCF_LE_ENCRYPT (0x0017)
350struct ble_hci_le_encrypt_cp {
353} __attribute__((packed));
354struct ble_hci_le_encrypt_rp {
356} __attribute__((packed));
358#define BLE_HCI_OCF_LE_RAND (0x0018)
359struct ble_hci_le_rand_rp {
360 uint64_t random_number;
361} __attribute__((packed));
363#define BLE_HCI_OCF_LE_START_ENCRYPT (0x0019)
364struct ble_hci_le_start_encrypt_cp {
365 uint16_t conn_handle;
369} __attribute__((packed));
371#define BLE_HCI_OCF_LE_LT_KEY_REQ_REPLY (0x001A)
372struct ble_hci_le_lt_key_req_reply_cp {
373 uint16_t conn_handle;
375} __attribute__((packed));
376struct ble_hci_le_lt_key_req_reply_rp {
377 uint16_t conn_handle;
378} __attribute__((packed));
380#define BLE_HCI_OCF_LE_LT_KEY_REQ_NEG_REPLY (0x001B)
381struct ble_hci_le_lt_key_req_neg_reply_cp {
382 uint16_t conn_handle;
383} __attribute__((packed));
384struct ble_hci_le_lt_key_req_neg_reply_rp {
385 uint16_t conn_handle;
386} __attribute__((packed));
388#define BLE_HCI_OCF_LE_RD_SUPP_STATES (0x001C)
389struct ble_hci_le_rd_supp_states_rp {
391} __attribute__((packed));
393#define BLE_HCI_OCF_LE_RX_TEST (0x001D)
394struct ble_hci_le_rx_test_cp {
396} __attribute__((packed));
398#define BLE_HCI_OCF_LE_TX_TEST (0x001E)
399struct ble_hci_le_tx_test_cp {
401 uint8_t test_data_len;
403} __attribute__((packed));
404#if MYNEWT_VAL(BLE_LL_DTM_EXTENSIONS)
405struct ble_hci_le_tx_test_ext_cp {
407 uint8_t test_data_len;
411} __attribute__((packed));
414#define BLE_HCI_OCF_LE_TEST_END (0x001F)
415struct ble_hci_le_test_end_rp {
416 uint16_t num_packets;
417} __attribute__((packed));
419#define BLE_HCI_OCF_LE_REM_CONN_PARAM_RR (0x0020)
420struct ble_hci_le_rem_conn_param_rr_cp {
421 uint16_t conn_handle;
422 uint16_t conn_itvl_min;
423 uint16_t conn_itvl_max;
424 uint16_t conn_latency;
425 uint16_t supervision_timeout;
428} __attribute__((packed));
429struct ble_hci_le_rem_conn_param_rr_rp {
430 uint16_t conn_handle;
431} __attribute__((packed));
433#define BLE_HCI_OCF_LE_REM_CONN_PARAM_NRR (0x0021)
434struct ble_hci_le_rem_conn_params_nrr_cp {
435 uint16_t conn_handle;
437} __attribute__((packed));
438struct ble_hci_le_rem_conn_params_nrr_rp {
439 uint16_t conn_handle;
440} __attribute__((packed));
442#define BLE_HCI_OCF_LE_SET_DATA_LEN (0x0022)
443struct ble_hci_le_set_data_len_cp {
444 uint16_t conn_handle;
447} __attribute__((packed));
448struct ble_hci_le_set_data_len_rp {
449 uint16_t conn_handle;
450} __attribute__((packed));
452#define BLE_HCI_OCF_LE_RD_SUGG_DEF_DATA_LEN (0x0023)
453struct ble_hci_le_rd_sugg_def_data_len_rp {
454 uint16_t max_tx_octets;
455 uint16_t max_tx_time;
456} __attribute__((packed));
458#define BLE_HCI_OCF_LE_WR_SUGG_DEF_DATA_LEN (0x0024)
459struct ble_hci_le_wr_sugg_def_data_len_cp {
460 uint16_t max_tx_octets;
461 uint16_t max_tx_time;
462} __attribute__((packed));
464#define BLE_HCI_OCF_LE_RD_P256_PUBKEY (0x0025)
466#define BLE_HCI_OCF_LE_GEN_DHKEY (0x0026)
467struct ble_hci_le_gen_dhkey_cp {
469} __attribute__((packed));
471#define BLE_HCI_OCF_LE_ADD_RESOLV_LIST (0x0027)
472struct ble_hci_le_add_resolv_list_cp {
473 uint8_t peer_addr_type;
474 uint8_t peer_id_addr[6];
475 uint8_t peer_irk[16];
476 uint8_t local_irk[16];
477} __attribute__((packed));
479#define BLE_HCI_OCF_LE_RMV_RESOLV_LIST (0x0028)
480struct ble_hci_le_rmv_resolve_list_cp {
481 uint8_t peer_addr_type;
482 uint8_t peer_id_addr[6];
483} __attribute__((packed));
485#define BLE_HCI_OCF_LE_CLR_RESOLV_LIST (0x0029)
487#define BLE_HCI_OCF_LE_RD_RESOLV_LIST_SIZE (0x002A)
488struct ble_hci_le_rd_resolv_list_size_rp {
490} __attribute__((packed));
492#define BLE_HCI_OCF_LE_RD_PEER_RESOLV_ADDR (0x002B)
493struct ble_hci_le_rd_peer_resolv_addr_cp {
494 uint8_t peer_addr_type;
495 uint8_t peer_id_addr[6];
496} __attribute__((packed));
497struct ble_hci_le_rd_peer_resolv_addr_rp {
499} __attribute__((packed));
501#define BLE_HCI_OCF_LE_RD_LOCAL_RESOLV_ADDR (0x002C)
502struct ble_hci_le_rd_local_resolv_addr_cp {
503 uint8_t peer_addr_type;
504 uint8_t peer_id_addr[6];
505} __attribute__((packed));
506struct ble_hci_le_rd_local_resolv_addr_rp {
508} __attribute__((packed));
510#define BLE_HCI_OCF_LE_SET_ADDR_RES_EN (0x002D)
511struct ble_hci_le_set_addr_res_en_cp {
513} __attribute__((packed));
515#define BLE_HCI_OCF_LE_SET_RPA_TMO (0x002E)
516struct ble_hci_le_set_rpa_tmo_cp {
517 uint16_t rpa_timeout;
518} __attribute__((packed));
520#define BLE_HCI_OCF_LE_RD_MAX_DATA_LEN (0x002F)
521struct ble_hci_le_rd_max_data_len_rp {
522 uint16_t max_tx_octests;
523 uint16_t max_tx_time;
524 uint16_t max_rx_octests;
525 uint16_t max_rx_time;
526} __attribute__((packed));
528#define BLE_HCI_OCF_LE_RD_PHY (0x0030)
529struct ble_hci_le_rd_phy_cp {
530 uint16_t conn_handle;
531} __attribute__((packed));
532struct ble_hci_le_rd_phy_rp {
533 uint16_t conn_handle;
536} __attribute__((packed));
538#define BLE_HCI_OCF_LE_SET_DEFAULT_PHY (0x0031)
539struct ble_hci_le_set_default_phy_cp {
543} __attribute__((packed));
545#define BLE_HCI_OCF_LE_SET_PHY (0x0032)
546struct ble_hci_le_set_phy_cp {
547 uint16_t conn_handle;
551 uint16_t phy_options;
552} __attribute__((packed));
554#define BLE_HCI_OCF_LE_RX_TEST_V2 (0x0033)
555struct ble_hci_le_rx_test_v2_cp {
559} __attribute__((packed));
561#define BLE_HCI_OCF_LE_TX_TEST_V2 (0x0034)
562struct ble_hci_le_tx_test_v2_cp {
564 uint8_t test_data_len;
567} __attribute__((packed));
568#if MYNEWT_VAL(BLE_LL_DTM_EXTENSIONS)
569struct ble_hci_le_tx_test_v2_ext_cp {
571 uint8_t test_data_len;
576} __attribute__((packed));
579#define BLE_HCI_OCF_LE_SET_ADV_SET_RND_ADDR (0x0035)
580struct ble_hci_le_set_adv_set_rnd_addr_cp {
583} __attribute__((packed));
585#define BLE_HCI_OCF_LE_SET_EXT_ADV_PARAM (0x0036)
586struct ble_hci_le_set_ext_adv_params_cp {
589 uint8_t pri_itvl_min[3];
590 uint8_t pri_itvl_max[3];
591 uint8_t pri_chan_map;
592 uint8_t own_addr_type;
593 uint8_t peer_addr_type;
594 uint8_t peer_addr[6];
595 uint8_t filter_policy;
598 uint8_t sec_max_skip;
601 uint8_t scan_req_notif;
602} __attribute__((packed));
603struct ble_hci_le_set_ext_adv_params_rp {
605} __attribute__((packed));
607#define BLE_HCI_OCF_LE_SET_EXT_ADV_DATA (0x0037)
608struct ble_hci_le_set_ext_adv_data_cp {
611 uint8_t fragment_pref;
612 uint8_t adv_data_len;
614} __attribute__((packed));
616#define BLE_HCI_OCF_LE_SET_EXT_SCAN_RSP_DATA (0x0038)
617struct ble_hci_le_set_ext_scan_rsp_data_cp {
620 uint8_t fragment_pref;
621 uint8_t scan_rsp_len;
623} __attribute__((packed));
625#define BLE_HCI_OCF_LE_SET_EXT_ADV_ENABLE (0x0039)
630} __attribute__((packed));
631struct ble_hci_le_set_ext_adv_enable_cp {
634 struct adv_set sets[0];
635} __attribute__((packed));
637#define BLE_HCI_OCF_LE_RD_MAX_ADV_DATA_LEN (0x003A)
638struct ble_hci_le_rd_max_adv_data_len_rp {
639 uint16_t max_adv_data_len;
640} __attribute__((packed));
642#define BLE_HCI_OCF_LE_RD_NUM_OF_ADV_SETS (0x003B)
643struct ble_hci_le_rd_num_of_adv_sets_rp {
645} __attribute__((packed));
647#define BLE_HCI_OCF_LE_REMOVE_ADV_SET (0x003C)
648struct ble_hci_le_remove_adv_set_cp {
650} __attribute__((packed));
652#define BLE_HCI_OCF_LE_CLEAR_ADV_SETS (0x003D)
654#define BLE_HCI_OCF_LE_SET_PERIODIC_ADV_PARAMS (0x003E)
655struct ble_hci_le_set_periodic_adv_params_cp {
660} __attribute__((packed));
662#define BLE_HCI_OCF_LE_SET_PERIODIC_ADV_DATA (0x003F)
663struct ble_hci_le_set_periodic_adv_data_cp {
666 uint8_t adv_data_len;
668} __attribute__((packed));
670#define BLE_HCI_OCF_LE_SET_PERIODIC_ADV_ENABLE (0x0040)
671struct ble_hci_le_set_periodic_adv_enable_cp {
674} __attribute__((packed));
676#define BLE_HCI_OCF_LE_SET_EXT_SCAN_PARAM (0x0041)
681} __attribute__((packed));
682struct ble_hci_le_set_ext_scan_params_cp {
683 uint8_t own_addr_type;
684 uint8_t filter_policy;
686 struct scan_params scans[0];
687} __attribute__((packed));
689#define BLE_HCI_OCF_LE_SET_EXT_SCAN_ENABLE (0x0042)
690struct ble_hci_le_set_ext_scan_enable_cp {
695} __attribute__((packed));
697#define BLE_HCI_OCF_LE_EXT_CREATE_CONN (0x0043)
700 uint16_t scan_window;
701 uint16_t conn_min_itvl;
702 uint16_t conn_max_itvl;
703 uint16_t conn_latency;
704 uint16_t supervision_timeout;
707} __attribute__((packed));
708struct ble_hci_le_ext_create_conn_cp {
709 uint8_t filter_policy;
710 uint8_t own_addr_type;
711 uint8_t peer_addr_type;
712 uint8_t peer_addr[6];
713 uint8_t init_phy_mask;
714 struct conn_params conn_params[0];
715} __attribute__((packed));
717#define BLE_HCI_LE_PERIODIC_ADV_CREATE_SYNC_OPT_FILTER 0x01
718#define BLE_HCI_LE_PERIODIC_ADV_CREATE_SYNC_OPT_DISABLED 0x02
719#define BLE_HCI_LE_PERIODIC_ADV_CREATE_SYNC_OPT_DUPLICATES 0x04
721#define BLE_HCI_OCF_LE_PERIODIC_ADV_CREATE_SYNC (0x0044)
722struct ble_hci_le_periodic_adv_create_sync_cp {
725 uint8_t peer_addr_type;
726 uint8_t peer_addr[6];
728 uint16_t sync_timeout;
729 uint8_t sync_cte_type;
730} __attribute__((packed));
732#define BLE_HCI_OCF_LE_PERIODIC_ADV_CREATE_SYNC_CANCEL (0x0045)
734#define BLE_HCI_OCF_LE_PERIODIC_ADV_TERM_SYNC (0x0046)
735struct ble_hci_le_periodic_adv_term_sync_cp {
736 uint16_t sync_handle;
737} __attribute__((packed));
739#define BLE_HCI_OCF_LE_ADD_DEV_TO_PERIODIC_ADV_LIST (0x0047)
740struct ble_hci_le_add_dev_to_periodic_adv_list_cp {
741 uint8_t peer_addr_type;
742 uint8_t peer_addr[6];
744} __attribute__((packed));
746#define BLE_HCI_OCF_LE_REM_DEV_FROM_PERIODIC_ADV_LIST (0x0048)
747struct ble_hci_le_rem_dev_from_periodic_adv_list_cp {
748 uint8_t peer_addr_type;
749 uint8_t peer_addr[6];
751} __attribute__((packed));
753#define BLE_HCI_OCF_LE_CLEAR_PERIODIC_ADV_LIST (0x0049)
755#define BLE_HCI_OCF_LE_RD_PERIODIC_ADV_LIST_SIZE (0x004A)
756struct ble_hci_le_rd_periodic_adv_list_size_rp {
758} __attribute__((packed));
760#define BLE_HCI_OCF_LE_RD_TRANSMIT_POWER (0x004B)
761struct ble_hci_le_rd_transmit_power_rp {
764} __attribute__((packed));
766#define BLE_HCI_OCF_LE_RD_RF_PATH_COMPENSATION (0x004C)
767struct ble_hci_le_rd_rf_path_compensation_rp {
768 int16_t tx_path_compensation;
769 int16_t rx_path_compensation;
770} __attribute__((packed));
772#define BLE_HCI_OCF_LE_WR_RF_PATH_COMPENSATION (0x004D)
773struct ble_hci_le_wr_rf_path_compensation_cp {
774 int16_t tx_path_compensation;
775 int16_t rx_path_compensation;
776} __attribute__((packed));
778#define BLE_HCI_OCF_LE_SET_PRIVACY_MODE (0x004E)
779struct ble_hci_le_set_privacy_mode_cp {
780 uint8_t peer_id_addr_type;
781 uint8_t peer_id_addr[6];
783} __attribute__((packed));
785#define BLE_HCI_OCF_LE_RX_TEST_V3 (0x004F)
786#define BLE_HCI_OCF_LE_TX_TEST_V3 (0x0050)
787#define BLE_HCI_OCF_LE_SET_CONNLESS_CTE_TX_PARAMS (0x0051)
788#define BLE_HCI_OCF_LE_SET_CONNLESS_CTE_TX_ENABLE (0x0052)
789#define BLE_HCI_OCF_LE_SET_CONNLESS_IQ_SAMPLING_ENABLE (0x0053)
790#define BLE_HCI_OCF_LE_SET_CONN_CTE_RX_PARAMS (0x0054)
791#define BLE_HCI_OCF_LE_SET_CONN_CTE_TX_PARAMS (0x0055)
792#define BLE_HCI_OCF_LE_SET_CONN_CTE_REQ_ENABLE (0x0056)
793#define BLE_HCI_OCF_LE_SET_CONN_CTE_RESP_ENABLE (0x0057)
794#define BLE_HCI_OCF_LE_RD_ANTENNA_INFO (0x0058)
796#define BLE_HCI_OCF_LE_PERIODIC_ADV_RECEIVE_ENABLE (0x0059)
797struct ble_hci_le_periodic_adv_receive_enable_cp {
798 uint16_t sync_handle;
800} __attribute__((packed));
802#define BLE_HCI_OCF_LE_PERIODIC_ADV_SYNC_TRANSFER (0x005A)
803struct ble_hci_le_periodic_adv_sync_transfer_cp {
804 uint16_t conn_handle;
805 uint16_t service_data;
806 uint16_t sync_handle;
807} __attribute__((packed));
808struct ble_hci_le_periodic_adv_sync_transfer_rp {
809 uint16_t conn_handle;
810} __attribute__((packed));
812#define BLE_HCI_OCF_LE_PERIODIC_ADV_SET_INFO_TRANSFER (0x005B)
813struct ble_hci_le_periodic_adv_set_info_transfer_cp {
814 uint16_t conn_handle;
815 uint16_t service_data;
817} __attribute__((packed));
818struct ble_hci_le_periodic_adv_set_info_transfer_rp {
819 uint16_t conn_handle;
820} __attribute__((packed));
822#define BLE_HCI_OCF_LE_PERIODIC_ADV_SYNC_TRANSFER_PARAMS (0x005C)
823struct ble_hci_le_periodic_adv_sync_transfer_params_cp {
824 uint16_t conn_handle;
827 uint16_t sync_timeout;
828 uint8_t sync_cte_type;
829} __attribute__((packed));
830struct ble_hci_le_periodic_adv_sync_transfer_params_rp {
831 uint16_t conn_handle;
832} __attribute__((packed));
834#define BLE_HCI_OCF_LE_SET_DEFAULT_SYNC_TRANSFER_PARAMS (0x005D)
835struct ble_hci_le_set_default_periodic_sync_transfer_params_cp {
838 uint16_t sync_timeout;
839 uint8_t sync_cte_type;
840} __attribute__((packed));
842#define BLE_HCI_OCF_LE_GENERATE_DHKEY_V2 (0x005E)
843#define BLE_HCI_OCF_LE_MODIFY_SCA (0x005F)
845#if MYNEWT_VAL(BLE_ISO)
846#define BLE_HCI_OCF_LE_READ_ISO_TX_SYNC (0x0061)
847struct ble_hci_le_read_iso_tx_sync_cp {
848 uint16_t conn_handle;
849} __attribute__((packed));
851struct ble_hci_le_read_iso_tx_sync_rp {
852 uint16_t conn_handle;
853 uint16_t packet_seq_num;
855 uint8_t timeoffset[3];
856} __attribute__((packed));
858#define BLE_HCI_LE_SET_CIG_CIS_MAX_NUM (0x1F)
859#define BLE_HCI_OCF_LE_SET_CIG_PARAM (0x0062)
860struct ble_hci_le_cis_params {
862 uint16_t max_sdu_mtos;
863 uint16_t max_sdu_stom;
868} __attribute__((packed));
870struct ble_hci_le_set_cig_params_cp {
872 uint8_t sdu_interval_mtos[3];
873 uint8_t sdu_interval_stom[3];
877 uint16_t max_latency_mtos;
878 uint16_t max_latency_stom;
880 struct ble_hci_le_cis_params cis_params[0];
881} __attribute__((packed));
883struct ble_hci_le_set_cig_params_rp {
886 uint16_t cis_handle[0];
887} __attribute__((packed));
889#if MYNEWT_VAL(BLE_ISO_TEST)
890#define BLE_HCI_OCF_LE_SET_CIG_PARAM_TEST (0x0063)
891struct ble_hci_le_cis_params_test {
894 uint16_t max_sdu_mtos;
895 uint16_t max_sdu_stom;
896 uint16_t max_pdu_mtos;
897 uint16_t max_pdu_stom;
902} __attribute__((packed));
904struct ble_hci_le_set_cig_params_test_cp {
906 uint8_t sdu_interval_mtos[3];
907 uint8_t sdu_interval_stom[3];
910 uint16_t iso_interval;
915 struct ble_hci_le_cis_params_test cis_params[0];
916} __attribute__((packed));
919#define BLE_HCI_LE_CREATE_CIS_MAX_CIS_NUM (0x1F)
920#define BLE_HCI_OCF_LE_CREATE_CIS (0x0064)
921struct ble_hci_le_create_cis_params {
923 uint16_t conn_handle;
924} __attribute__((packed));
926struct ble_hci_le_create_cis_cp {
928 struct ble_hci_le_create_cis_params params[0];
929} __attribute__((packed));
931#define BLE_HCI_OCF_LE_REMOVE_CIG (0x0065)
932struct ble_hci_le_remove_cig_cp {
934} __attribute__((packed));
936struct ble_hci_le_remove_cig_rp {
938} __attribute__((packed));
940#define BLE_HCI_OCF_LE_ACCEPT_CIS_REQ (0x0066)
941struct ble_hci_le_accept_cis_request_cp {
943} __attribute__((packed));
945#define BLE_HCI_OCF_LE_REJECT_CIS_REQ (0x0067)
946struct ble_hci_le_reject_cis_request_cp {
949} __attribute__((packed));
951struct ble_hci_le_reject_cis_request_rp {
952 uint16_t conn_handle;
953} __attribute__((packed));
955#define BLE_HCI_OCF_LE_CREATE_BIG (0x0068)
956struct ble_hci_le_create_big_cp {
960 uint8_t sdu_interval[3];
962 uint16_t max_transport_latency;
968 uint8_t broadcast_code[16];
969} __attribute__((packed));
971#if MYNEWT_VAL(BLE_ISO_TEST)
972#define BLE_HCI_OCF_LE_CREATE_BIG_TEST (0x0069)
973struct ble_hci_le_create_big_test_cp {
977 uint8_t sdu_interval[3];
978 uint16_t iso_interval;
989 uint8_t broadcast_code[16];
990} __attribute__((packed));
993#define BLE_HCI_OCF_LE_TERMINATE_BIG (0x006a)
994struct ble_hci_le_terminate_big_cp {
997} __attribute__((packed));
999#define BLE_HCI_LE_BIG_CREATE_SYNC_LEN_MIN (25)
1000#define BLE_HCI_OCF_LE_BIG_CREATE_SYNC (0x006b)
1001struct ble_hci_le_big_create_sync_cp {
1003 uint16_t sync_handle;
1006 uint8_t broadcast_code[16];
1010} __attribute__((packed));
1012#define BLE_HCI_OCF_LE_BIG_TERMINATE_SYNC (0x006c)
1013struct ble_hci_le_terminate_big_sync_cp {
1015} __attribute__((packed));
1018#define BLE_HCI_OCF_LE_REQ_PEER_SCA (0x006d)
1019struct ble_hci_le_request_peer_sca_cp {
1020 uint16_t conn_handle;
1021} __attribute__((packed));
1023#if MYNEWT_VAL(BLE_ISO)
1024#define BLE_HCI_OCF_LE_SETUP_ISO_DATA_PATH (0x006e)
1025struct ble_hci_le_iso_setup_data_path_cp {
1026 uint16_t iso_handle;
1029 uint8_t codec_id[5];
1030 uint8_t controller_delay[3];
1031 uint8_t codec_conf_len;
1032 uint8_t codec_conf[0];
1033} __attribute__((packed));
1035#define BLE_HCI_LE_REMOVE_INPUT_DATA_PATH_BIT (0x01)
1036#define BLE_HCI_LE_REMOVE_OUTPUT_DATA_PATH_BIT (0x02)
1037#define BLE_HCI_OCF_LE_REMOVE_ISO_DATA_PATH (0x006f)
1038struct ble_hci_le_iso_remove_data_path_cp {
1039 uint16_t iso_handle;
1041} __attribute__((packed));
1043#if MYNEWT_VAL(BLE_ISO_TEST)
1044#define BLE_HCI_OCF_LE_ISO_TRANSMIT_TEST (0x0070)
1045struct ble_hci_le_iso_transmit_test_cp {
1046 uint16_t iso_handle;
1047 uint8_t payload_type;
1048} __attribute__((packed));
1050#define BLE_HCI_OCF_LE_ISO_RECEIVE_TEST (0x0071)
1051struct ble_hci_le_iso_receive_test_cp {
1052 uint16_t iso_handle;
1053} __attribute__((packed));
1055#define BLE_HCI_OCF_LE_ISO_READ_TEST_COUNTERS (0x0072)
1056struct ble_hci_le_iso_read_test_counters_cp {
1057 uint16_t iso_handle;
1058} __attribute__((packed));
1060#define BLE_HCI_OCF_LE_ISO_TEST_END (0x0073)
1061struct ble_hci_le_iso_test_end_cp {
1062 uint16_t iso_handle;
1063} __attribute__((packed));
1067#define BLE_HCI_OCF_LE_SET_HOST_FEAT (0x0074)
1068struct ble_hci_le_set_host_feat_cp {
1071} __attribute__((packed));
1073#define BLE_HCI_OCF_LE_ENH_READ_TRANSMIT_POWER_LEVEL (0x0076)
1074struct ble_hci_le_enh_read_transmit_power_level_cp {
1075 uint16_t conn_handle;
1077} __attribute__((packed));
1078struct ble_hci_le_enh_read_transmit_power_level_rp {
1079 uint16_t conn_handle;
1081 uint8_t curr_tx_power_level;
1082 uint8_t max_tx_power_level;
1083} __attribute__((packed));
1085#define BLE_HCI_OCF_LE_READ_REMOTE_TRANSMIT_POWER_LEVEL (0x0077)
1086struct ble_hci_le_read_remote_transmit_power_level_cp {
1087 uint16_t conn_handle;
1089} __attribute__((packed));
1091#define BLE_HCI_OCF_LE_SET_PATH_LOSS_REPORT_PARAM (0x0078)
1092struct ble_hci_le_set_path_loss_report_param_cp {
1093 uint16_t conn_handle;
1094 uint8_t high_threshold;
1095 uint8_t high_hysteresis;
1096 uint8_t low_threshold;
1097 uint8_t low_hysteresis;
1098 uint16_t min_time_spent;
1099} __attribute__((packed));
1101#define BLE_HCI_OCF_LE_SET_PATH_LOSS_REPORT_ENABLE (0x0079)
1102struct ble_hci_le_set_path_loss_report_enable_cp {
1103 uint16_t conn_handle;
1105} __attribute__((packed));
1107#define BLE_HCI_OCF_LE_SET_TRANS_PWR_REPORT_ENABLE (0x007A)
1108struct ble_hci_le_set_transmit_power_report_enable_cp {
1109 uint16_t conn_handle;
1110 uint8_t local_enable;
1111 uint8_t remote_enable;
1112} __attribute__((packed));
1114#define BLE_HCI_OCF_LE_SET_DATA_ADDR_CHANGE (0x007C)
1115struct ble_hci_le_set_data_addr_change_cp {
1117 uint8_t change_reason;
1118} __attribute__((packed));
1120#define BLE_HCI_OCF_LE_SET_DEFAULT_SUBRATE (0x007D)
1121struct ble_hci_le_set_default_subrate_cp {
1122 uint16_t subrate_min;
1123 uint16_t subrate_max;
1124 uint16_t max_latency;
1126 uint16_t supervision_tmo;
1127} __attribute__((packed));
1129#define BLE_HCI_OCF_LE_SUBRATE_REQ (0x007E)
1130struct ble_hci_le_subrate_req_cp {
1131 uint16_t conn_handle;
1132 uint16_t subrate_min;
1133 uint16_t subrate_max;
1134 uint16_t max_latency;
1136 uint16_t supervision_tmo;
1137} __attribute__((packed));
1141#define BLE_HCI_OCF_VS_RD_STATIC_ADDR (MYNEWT_VAL(BLE_HCI_VS_OCF_OFFSET) + (0x0001))
1142struct ble_hci_vs_rd_static_addr_rp {
1144} __attribute__((packed));
1149#define BLE_HCI_OCF_VS_SET_TX_PWR (MYNEWT_VAL(BLE_HCI_VS_OCF_OFFSET) + (0x0002))
1150struct ble_hci_vs_set_tx_pwr_cp {
1152} __attribute__((packed));
1153struct ble_hci_vs_set_tx_pwr_rp {
1155} __attribute__((packed));
1157#define BLE_HCI_OCF_VS_CSS (0x0003)
1158struct ble_hci_vs_css_cp {
1160} __attribute__((packed));
1161#define BLE_HCI_VS_CSS_OP_CONFIGURE 0x01
1162struct ble_hci_vs_css_configure_cp {
1165 uint32_t period_slots;
1166} __attribute__((packed));
1167#define BLE_HCI_VS_CSS_OP_SET_NEXT_SLOT 0x02
1168struct ble_hci_vs_css_set_next_slot_cp {
1171} __attribute__((packed));
1172#define BLE_HCI_VS_CSS_OP_SET_CONN_SLOT 0x03
1173struct ble_hci_vs_css_set_conn_slot_cp {
1175 uint16_t conn_handle;
1177} __attribute__((packed));
1179#define BLE_HCI_OCF_VS_DUPLICATE_EXCEPTION_LIST (MYNEWT_VAL(BLE_HCI_VS_OCF_OFFSET) + (0x0108))
1180struct ble_hci_vs_duplicate_exception_list_cp {
1183 uint8_t device_info[6];
1184} __attribute__((packed));
1186#define BLE_HCI_OCF_VS_LEGACY_ADV_CLEAR (MYNEWT_VAL(BLE_HCI_VS_OCF_OFFSET) + (0x010C))
1188#if SOC_BLE_POWER_CONTROL_SUPPORTED
1189#define BLE_HCI_OCF_VS_PCL_SET_RSSI (MYNEWT_VAL(BLE_HCI_VS_OCF_OFFSET) + (0x0111))
1192#define BLE_HCI_OCF_VS_SET_CHAN_SELECT (MYNEWT_VAL(BLE_HCI_VS_OCF_OFFSET) + (0x0112))
1196#define BLE_HCI_CTLR_TO_HOST_FC_OFF (0)
1197#define BLE_HCI_CTLR_TO_HOST_FC_ACL (1)
1198#define BLE_HCI_CTLR_TO_HOST_FC_SYNC (2)
1199#define BLE_HCI_CTLR_TO_HOST_FC_BOTH (3)
1203#define BLE_HCI_ADV_TYPE_ADV_IND (0)
1204#define BLE_HCI_ADV_TYPE_ADV_DIRECT_IND_HD (1)
1205#define BLE_HCI_ADV_TYPE_ADV_SCAN_IND (2)
1206#define BLE_HCI_ADV_TYPE_ADV_NONCONN_IND (3)
1207#define BLE_HCI_ADV_TYPE_ADV_DIRECT_IND_LD (4)
1208#define BLE_HCI_ADV_TYPE_MAX (4)
1210#define BLE_HCI_ADV_CONN_MASK (0x0001)
1211#define BLE_HCI_ADV_SCAN_MASK (0x0002)
1212#define BLE_HCI_ADV_DIRECT_MASK (0x0004)
1213#define BLE_HCI_ADV_SCAN_RSP_MASK (0x0008)
1214#define BLE_HCI_ADV_LEGACY_MASK (0x0010)
1216#define BLE_HCI_ADV_DATA_STATUS_COMPLETE (0x0000)
1217#define BLE_HCI_ADV_DATA_STATUS_INCOMPLETE (0x0020)
1218#define BLE_HCI_ADV_DATA_STATUS_TRUNCATED (0x0040)
1219#define BLE_HCI_ADV_DATA_STATUS_MASK (0x0060)
1222#define BLE_HCI_ADV_OWN_ADDR_PUBLIC (0)
1223#define BLE_HCI_ADV_OWN_ADDR_RANDOM (1)
1224#define BLE_HCI_ADV_OWN_ADDR_PRIV_PUB (2)
1225#define BLE_HCI_ADV_OWN_ADDR_PRIV_RAND (3)
1226#define BLE_HCI_ADV_OWN_ADDR_MAX (3)
1229#define BLE_HCI_ADV_PEER_ADDR_PUBLIC (0)
1230#define BLE_HCI_ADV_PEER_ADDR_RANDOM (1)
1231#define BLE_HCI_ADV_PEER_ADDR_MAX (1)
1234#define BLE_HCI_ADV_CHAN_TXPWR_MIN (-20)
1235#define BLE_HCI_ADV_CHAN_TXPWR_MAX (10)
1240#define BLE_HCI_CONN_PEER_ADDR_PUBLIC (0)
1241#define BLE_HCI_CONN_PEER_ADDR_RANDOM (1)
1242#define BLE_HCI_CONN_PEER_ADDR_PUBLIC_IDENT (2)
1243#define BLE_HCI_CONN_PEER_ADDR_RANDOM_IDENT (3)
1244#define BLE_HCI_CONN_PEER_ADDR_MAX (3)
1256#define BLE_HCI_ADV_FILT_NONE (0)
1257#define BLE_HCI_ADV_FILT_SCAN (1)
1258#define BLE_HCI_ADV_FILT_CONN (2)
1259#define BLE_HCI_ADV_FILT_BOTH (3)
1260#define BLE_HCI_ADV_FILT_MAX (3)
1262#define BLE_HCI_ADV_FILT_DEF (BLE_HCI_ADV_FILT_NONE)
1265#define BLE_HCI_ADV_ITVL (625)
1266#define BLE_HCI_ADV_ITVL_MIN (32)
1267#define BLE_HCI_ADV_ITVL_MAX (16384)
1268#define BLE_HCI_ADV_ITVL_NONCONN_MIN (160)
1270#define BLE_HCI_ADV_ITVL_DEF (0x800)
1271#define BLE_HCI_ADV_CHANMASK_DEF (0x7)
1273#define BLE_HCI_PERIODIC_ADV_ITVL (1250)
1276#define BLE_HCI_SCAN_TYPE_PASSIVE (0)
1277#define BLE_HCI_SCAN_TYPE_ACTIVE (1)
1280#define BLE_HCI_SCAN_ITVL (625)
1281#define BLE_HCI_SCAN_ITVL_MIN (0x0004)
1282#define BLE_HCI_SCAN_ITVL_MAX (0x4000)
1283#define BLE_HCI_SCAN_ITVL_MAX_EXT (0xffff)
1284#define BLE_HCI_SCAN_ITVL_DEF (16)
1285#define BLE_HCI_SCAN_WINDOW_MIN (0x0004)
1286#define BLE_HCI_SCAN_WINDOW_MAX (0x4000)
1287#define BLE_HCI_SCAN_WINDOW_MAX_EXT (0xffff)
1288#define BLE_HCI_SCAN_WINDOW_DEF (16)
1307#define BLE_HCI_SCAN_FILT_NO_WL (0)
1308#define BLE_HCI_SCAN_FILT_USE_WL (1)
1309#define BLE_HCI_SCAN_FILT_NO_WL_INITA (2)
1310#define BLE_HCI_SCAN_FILT_USE_WL_INITA (3)
1311#define BLE_HCI_SCAN_FILT_MAX (3)
1314#define BLE_HCI_ADD_WHITE_LIST_LEN (7)
1315#define BLE_HCI_RMV_WHITE_LIST_LEN (7)
1318#define BLE_HCI_CREATE_CONN_LEN (25)
1319#define BLE_HCI_CONN_ITVL (1250)
1320#define BLE_HCI_CONN_FILT_NO_WL (0)
1321#define BLE_HCI_CONN_FILT_USE_WL (1)
1322#define BLE_HCI_CONN_FILT_MAX (1)
1323#define BLE_HCI_CONN_ITVL_MIN (0x0006)
1324#define BLE_HCI_CONN_ITVL_MAX (0x0c80)
1325#define BLE_HCI_CONN_LATENCY_MIN (0x0000)
1326#define BLE_HCI_CONN_LATENCY_MAX (0x01f3)
1327#define BLE_HCI_CONN_SPVN_TIMEOUT_MIN (0x000a)
1328#define BLE_HCI_CONN_SPVN_TIMEOUT_MAX (0x0c80)
1329#define BLE_HCI_CONN_SPVN_TMO_UNITS (10)
1330#define BLE_HCI_INITIATOR_FILT_POLICY_MAX (1)
1333#define BLE_HCI_CONN_PEER_ADDR_PUBLIC (0)
1334#define BLE_HCI_CONN_PEER_ADDR_RANDOM (1)
1335#define BLE_HCI_CONN_PEER_ADDR_PUB_ID (2)
1336#define BLE_HCI_CONN_PEER_ADDR_RAND_ID (3)
1337#define BLE_HCI_CONN_PEER_ADDR_MAX (3)
1341#define BLE_HCI_SET_DATALEN_TX_OCTETS_MIN (0x001b)
1342#define BLE_HCI_SET_DATALEN_TX_OCTETS_MAX (0x00fb)
1343#define BLE_HCI_SET_DATALEN_TX_TIME_MIN (0x0148)
1344#define BLE_HCI_SET_DATALEN_TX_TIME_MAX (0x4290)
1347#define BLE_HCI_SUGG_DEF_DATALEN_TX_OCTETS_MIN (0x001b)
1348#define BLE_HCI_SUGG_DEF_DATALEN_TX_OCTETS_MAX (0x00fb)
1349#define BLE_HCI_SUGG_DEF_DATALEN_TX_TIME_MIN (0x0148)
1350#define BLE_HCI_SUGG_DEF_DATALEN_TX_TIME_MAX (0x4290)
1353#define BLE_HCI_LE_PHY_1M (1)
1354#define BLE_HCI_LE_PHY_2M (2)
1355#define BLE_HCI_LE_PHY_CODED (3)
1358#define BLE_HCI_LE_PHY_NO_TX_PREF_MASK (0x01)
1359#define BLE_HCI_LE_PHY_NO_RX_PREF_MASK (0x02)
1360#define BLE_HCI_LE_PHY_1M_PREF_MASK (0x01)
1361#define BLE_HCI_LE_PHY_2M_PREF_MASK (0x02)
1362#define BLE_HCI_LE_PHY_CODED_PREF_MASK (0x04)
1364#define BLE_HCI_LE_PHY_PREF_MASK_ALL \
1365 (BLE_HCI_LE_PHY_1M_PREF_MASK | BLE_HCI_LE_PHY_2M_PREF_MASK | \
1366 BLE_HCI_LE_PHY_CODED_PREF_MASK)
1369#define BLE_HCI_LE_PHY_CODED_ANY (0x0000)
1370#define BLE_HCI_LE_PHY_CODED_S2_PREF (0x0001)
1371#define BLE_HCI_LE_PHY_CODED_S8_PREF (0x0002)
1374#define BLE_HCI_LE_PHY_1M (1)
1375#define BLE_HCI_LE_PHY_2M (2)
1376#define BLE_HCI_LE_PHY_CODED (3)
1379#define BLE_HCI_LE_PHY_CODED_S8 (3)
1380#define BLE_HCI_LE_PHY_CODED_S2 (4)
1383#define BLE_HCI_LE_SET_EXT_ADV_PROP_CONNECTABLE (0x0001)
1384#define BLE_HCI_LE_SET_EXT_ADV_PROP_SCANNABLE (0x0002)
1385#define BLE_HCI_LE_SET_EXT_ADV_PROP_DIRECTED (0x0004)
1386#define BLE_HCI_LE_SET_EXT_ADV_PROP_HD_DIRECTED (0x0008)
1387#define BLE_HCI_LE_SET_EXT_ADV_PROP_LEGACY (0x0010)
1388#define BLE_HCI_LE_SET_EXT_ADV_PROP_ANON_ADV (0x0020)
1389#define BLE_HCI_LE_SET_EXT_ADV_PROP_INC_TX_PWR (0x0040)
1390#define BLE_HCI_LE_SET_EXT_ADV_PROP_MASK (0x7F)
1392#define BLE_HCI_LE_SET_EXT_ADV_PROP_LEGACY_IND (0x0013)
1393#define BLE_HCI_LE_SET_EXT_ADV_PROP_LEGACY_LD_DIR (0x0015)
1394#define BLE_HCI_LE_SET_EXT_ADV_PROP_LEGACY_HD_DIR (0x001d)
1395#define BLE_HCI_LE_SET_EXT_ADV_PROP_LEGACY_SCAN (0x0012)
1396#define BLE_HCI_LE_SET_EXT_ADV_PROP_LEGACY_NONCONN (0x0010)
1399#define BLE_HCI_MAX_EXT_ADV_DATA_LEN (251)
1401#define BLE_HCI_LE_SET_DATA_OPER_INT (0)
1402#define BLE_HCI_LE_SET_DATA_OPER_FIRST (1)
1403#define BLE_HCI_LE_SET_DATA_OPER_LAST (2)
1404#define BLE_HCI_LE_SET_DATA_OPER_COMPLETE (3)
1405#define BLE_HCI_LE_SET_DATA_OPER_UNCHANGED (4)
1408#define BLE_HCI_MAX_EXT_SCAN_RSP_DATA_LEN (251)
1411#define BLE_HCI_LE_SET_PERIODIC_ADV_PROP_INC_TX_PWR (0x0040)
1412#define BLE_HCI_LE_SET_PERIODIC_ADV_PROP_MASK (0x0040)
1415#define BLE_HCI_MAX_PERIODIC_ADV_DATA_LEN (252)
1418#define BLE_HCI_PERIODIC_DATA_STATUS_COMPLETE 0x00
1419#define BLE_HCI_PERIODIC_DATA_STATUS_INCOMPLETE 0x01
1420#define BLE_HCI_PERIODIC_DATA_STATUS_TRUNCATED 0x02
1423#define BLE_HCI_PRIVACY_NETWORK (0)
1424#define BLE_HCI_PRIVACY_DEVICE (1)
1427#define BLE_HCI_EVCODE_INQUIRY_CMP (0x01)
1428#define BLE_HCI_EVCODE_INQUIRY_RESULT (0x02)
1429#define BLE_HCI_EVCODE_CONN_DONE (0x03)
1430#define BLE_HCI_EVCODE_CONN_REQUEST (0x04)
1431#define BLE_HCI_EVCODE_DISCONN_CMP (0x05)
1432struct ble_hci_ev_disconn_cmp {
1434 uint16_t conn_handle;
1436} __attribute__((packed));
1438#define BLE_HCI_EVCODE_AUTH_CMP (0x06)
1439#define BLE_HCI_EVCODE_REM_NAME_REQ_CMP (0x07)
1441#define BLE_HCI_EVCODE_ENCRYPT_CHG (0x08)
1442struct ble_hci_ev_enrypt_chg {
1444 uint16_t connection_handle;
1446} __attribute__((packed));
1448#define BLE_HCI_EVCODE_CHG_LINK_KEY_CMP (0x09)
1449#define BLE_HCI_EVCODE_MASTER_LINK_KEY_CMP (0x0A)
1450#define BLE_HCI_EVCODE_RD_REM_SUPP_FEAT_CMP (0x0B)
1451#define BLE_HCI_EVCODE_RD_REM_VER_INFO_CMP (0x0C)
1452struct ble_hci_ev_rd_rem_ver_info_cmp {
1454 uint16_t conn_handle;
1456 uint16_t manufacturer;
1457 uint16_t subversion;
1458} __attribute__((packed));
1460#define BLE_HCI_EVCODE_QOS_SETUP_CMP (0x0D)
1462#define BLE_HCI_EVCODE_COMMAND_COMPLETE (0x0E)
1463struct ble_hci_ev_command_complete {
1464 uint8_t num_packets;
1467 uint8_t return_params[0];
1468} __attribute__((packed));
1470struct ble_hci_ev_command_complete_nop {
1471 uint8_t num_packets;
1473} __attribute__((packed));
1475#define BLE_HCI_EVCODE_COMMAND_STATUS (0x0F)
1476struct ble_hci_ev_command_status {
1478 uint8_t num_packets;
1480} __attribute__((packed));
1482#define BLE_HCI_EVCODE_HW_ERROR (0x10)
1483struct ble_hci_ev_hw_error {
1485} __attribute__((packed));
1487#define BLE_HCI_EVCODE_NUM_COMP_PKTS (0x13)
1491} __attribute__((packed));;
1492struct ble_hci_ev_num_comp_pkts {
1494 struct comp_pkt completed[0];
1495} __attribute__((packed));
1497#define BLE_HCI_EVCODE_MODE_CHANGE (0x14)
1498#define BLE_HCI_EVCODE_RETURN_LINK_KEYS (0x15)
1499#define BLE_HCI_EVCODE_PIN_CODE_REQ (0x16)
1500#define BLE_HCI_EVCODE_LINK_KEY_REQ (0x17)
1501#define BLE_HCI_EVCODE_LINK_KEY_NOTIFY (0x18)
1502#define BLE_HCI_EVCODE_LOOPBACK_CMD (0x19)
1504#define BLE_HCI_EVCODE_DATA_BUF_OVERFLOW (0x1A)
1505struct ble_hci_ev_data_buf_overflow {
1507} __attribute__((packed));
1509#define BLE_HCI_EVCODE_MAX_SLOTS_CHG (0x1B)
1510#define BLE_HCI_EVCODE_READ_CLK_OFF_COMP (0x1C)
1511#define BLE_HCI_EVCODE_CONN_PKT_TYPE_CHG (0x1D)
1512#define BLE_HCI_EVCODE_QOS_VIOLATION (0x1E)
1514#define BLE_HCI_EVCODE_PSR_MODE_CHG (0x20)
1515#define BLE_HCI_EVCODE_FLOW_SPEC_COMP (0x21)
1516#define BLE_HCI_EVCODE_INQ_RESULT_RSSI (0x22)
1517#define BLE_HCI_EVCODE_READ_REM_EXT_FEAT (0x23)
1519#define BLE_HCI_EVCODE_SYNCH_CONN_COMP (0x2C)
1520#define BLE_HCI_EVCODE_SYNCH_CONN_CHG (0x2D)
1521#define BLE_HCI_EVCODE_SNIFF_SUBRATING (0x2E)
1522#define BLE_HCI_EVCODE_EXT_INQ_RESULT (0x2F)
1524#define BLE_HCI_EVCODE_ENC_KEY_REFRESH (0x30)
1525struct ble_hci_ev_enc_key_refresh {
1527 uint16_t conn_handle;
1528} __attribute__((packed));
1530#define BLE_HCI_EVOCDE_IO_CAP_REQ (0x31)
1531#define BLE_HCI_EVCODE_IO_CAP_RSP (0x32)
1532#define BLE_HCI_EVCODE_USER_CONFIRM_REQ (0x33)
1533#define BLE_HCI_EVCODE_PASSKEY_REQ (0x34)
1534#define BLE_HCI_EVCODE_REM_OOB_DATA_REQ (0x35)
1535#define BLE_HCI_EVCODE_SIMPLE_PAIR_COMP (0x36)
1537#define BLE_HCI_EVCODE_LNK_SPVN_TMO_CHG (0x38)
1538#define BLE_HCI_EVCODE_ENH_FLUSH_COMP (0x39)
1539#define BLE_HCI_EVCODE_USER_PASSKEY_NOTIFY (0x3B)
1540#define BLE_HCI_EVCODE_KEYPRESS_NOTIFY (0x3C)
1541#define BLE_HCI_EVCODE_REM_HOST_SUPP_FEAT (0x3D)
1543#define BLE_HCI_EVCODE_LE_META (0x3E)
1544struct ble_hci_ev_le_meta {
1547} __attribute__((packed));
1550#define BLE_HCI_EVCODE_PHYS_LINK_COMP (0x40)
1551#define BLE_HCI_EVCODE_CHAN_SELECTED (0x41)
1552#define BLE_HCI_EVCODE_DISCONN_PHYS_LINK (0x42)
1553#define BLE_HCI_EVCODE_PHYS_LINK_LOSS_EARLY (0x43)
1554#define BLE_HCI_EVCODE_PHYS_LINK_RECOVERY (0x44)
1555#define BLE_HCI_EVCODE_LOGICAL_LINK_COMP (0x45)
1556#define BLE_HCI_EVCODE_DISCONN_LOGICAL_LINK (0x46)
1557#define BLE_HCI_EVCODE_FLOW_SPEC_MODE_COMP (0x47)
1558#define BLE_HCI_EVCODE_NUM_COMP_DATA_BLKS (0x48)
1559#define BLE_HCI_EVCODE_AMP_START_TEST (0x49)
1560#define BLE_HCI_EVOCDE_AMP_TEST_END (0x4A)
1561#define BLE_HCI_EVOCDE_AMP_RCVR_REPORT (0x4B)
1562#define BLE_HCI_EVCODE_SHORT_RANGE_MODE_CHG (0x4C)
1563#define BLE_HCI_EVCODE_AMP_STATUS_CHG (0x4D)
1564#define BLE_HCI_EVCODE_TRIG_CLK_CAPTURE (0x4E)
1565#define BLE_HCI_EVCODE_SYNCH_TRAIN_COMP (0x4F)
1566#define BLE_HCI_EVCODE_SYNCH_TRAIN_RCVD (0x50)
1567#define BLE_HCI_EVCODE_SLAVE_BCAST_RX (0x51)
1568#define BLE_HCI_EVCODE_SLAVE_BCAST_TMO (0x52)
1569#define BLE_HCI_EVCODE_TRUNC_PAGE_COMP (0x53)
1570#define BLE_HCI_EVCODE_SLAVE_PAGE_RSP_TMO (0x54)
1571#define BLE_HCI_EVCODE_SLAVE_BCAST_CHAN_MAP (0x55)
1572#define BLE_HCI_EVCODE_INQ_RSP_NOTIFY (0x56)
1574#define BLE_HCI_EVCODE_AUTH_PYLD_TMO (0x57)
1575struct ble_hci_ev_auth_pyld_tmo {
1576 uint16_t conn_handle;
1577} __attribute__((packed));
1579#define BLE_HCI_EVCODE_SAM_STATUS_CHG (0x58)
1581#define BLE_HCI_EVCODE_VS_DEBUG (0xFF)
1582struct ble_hci_ev_vs_debug {
1585} __attribute__((packed));
1588#define BLE_HCI_LE_SUBEV_CONN_COMPLETE (0x01)
1589struct ble_hci_ev_le_subev_conn_complete {
1592 uint16_t conn_handle;
1594 uint8_t peer_addr_type;
1595 uint8_t peer_addr[6];
1597 uint16_t conn_latency;
1598 uint16_t supervision_timeout;
1600} __attribute__((packed));
1602#define BLE_HCI_LE_SUBEV_ADV_RPT (0x02)
1609} __attribute__((packed));
1610struct ble_hci_ev_le_subev_adv_rpt {
1612 uint8_t num_reports;
1613 struct adv_report reports[0];
1614} __attribute__((packed));
1616#define BLE_HCI_LE_SUBEV_CONN_UPD_COMPLETE (0x03)
1617struct ble_hci_ev_le_subev_conn_upd_complete {
1620 uint16_t conn_handle;
1622 uint16_t conn_latency;
1623 uint16_t supervision_timeout;
1624} __attribute__((packed));
1626#define BLE_HCI_LE_SUBEV_RD_REM_USED_FEAT (0x04)
1627struct ble_hci_ev_le_subev_rd_rem_used_feat {
1630 uint16_t conn_handle;
1631 uint8_t features[8];
1632} __attribute__((packed));
1634#define BLE_HCI_LE_SUBEV_LT_KEY_REQ (0x05)
1635struct ble_hci_ev_le_subev_lt_key_req {
1637 uint16_t conn_handle;
1640} __attribute__((packed));
1642#define BLE_HCI_LE_SUBEV_REM_CONN_PARM_REQ (0x06)
1643struct ble_hci_ev_le_subev_rem_conn_param_req {
1645 uint16_t conn_handle;
1646 uint16_t min_interval;
1647 uint16_t max_interval;
1650} __attribute__((packed));
1652#define BLE_HCI_LE_SUBEV_DATA_LEN_CHG (0x07)
1653struct ble_hci_ev_le_subev_data_len_chg {
1655 uint16_t conn_handle;
1656 uint16_t max_tx_octets;
1657 uint16_t max_tx_time;
1658 uint16_t max_rx_octets;
1659 uint16_t max_rx_time;
1660} __attribute__((packed));
1662#define BLE_HCI_LE_SUBEV_RD_LOC_P256_PUBKEY (0x08)
1663struct ble_hci_ev_le_subev_rd_loc_p256_pubkey {
1666 uint8_t public_key[64];
1667} __attribute__((packed));
1669#define BLE_HCI_LE_SUBEV_GEN_DHKEY_COMPLETE (0x09)
1670struct ble_hci_ev_le_subev_gen_dhkey_complete {
1674} __attribute__((packed));
1676#define BLE_HCI_LE_SUBEV_ENH_CONN_COMPLETE (0x0A)
1677struct ble_hci_ev_le_subev_enh_conn_complete {
1680 uint16_t conn_handle;
1682 uint8_t peer_addr_type;
1683 uint8_t peer_addr[6];
1684 uint8_t local_rpa[6];
1685 uint8_t peer_rpa[6];
1687 uint16_t conn_latency;
1688 uint16_t supervision_timeout;
1690} __attribute__((packed));
1692#define BLE_HCI_LE_SUBEV_DIRECT_ADV_RPT (0x0B)
1693struct dir_adv_report {
1697 uint8_t dir_addr_type;
1698 uint8_t dir_addr[6];
1700} __attribute__((packed));
1701struct ble_hci_ev_le_subev_direct_adv_rpt {
1703 uint8_t num_reports;
1704 struct dir_adv_report reports[0];
1705} __attribute__((packed));
1707#define BLE_HCI_LE_SUBEV_PHY_UPDATE_COMPLETE (0x0C)
1708struct ble_hci_ev_le_subev_phy_update_complete {
1711 uint16_t conn_handle;
1714} __attribute__((packed));
1716#define BLE_HCI_LE_SUBEV_EXT_ADV_RPT (0x0D)
1717struct ext_adv_report {
1726 uint16_t periodic_itvl;
1727 uint8_t dir_addr_type;
1728 uint8_t dir_addr[6];
1731} __attribute__((packed));
1732struct ble_hci_ev_le_subev_ext_adv_rpt {
1734 uint8_t num_reports;
1735 struct ext_adv_report reports[0];
1736} __attribute__((packed));
1738#define BLE_HCI_LE_SUBEV_PERIODIC_ADV_SYNC_ESTAB (0x0E)
1739struct ble_hci_ev_le_subev_periodic_adv_sync_estab {
1742 uint16_t sync_handle;
1744 uint8_t peer_addr_type;
1745 uint8_t peer_addr[6];
1749} __attribute__((packed));
1751#define BLE_HCI_LE_SUBEV_PERIODIC_ADV_RPT (0x0F)
1752struct ble_hci_ev_le_subev_periodic_adv_rpt {
1754 uint16_t sync_handle;
1758 uint8_t data_status;
1761} __attribute__((packed));
1763#define BLE_HCI_LE_SUBEV_PERIODIC_ADV_SYNC_LOST (0x10)
1764struct ble_hci_ev_le_subev_periodic_adv_sync_lost {
1766 uint16_t sync_handle;
1767} __attribute__((packed));
1769#define BLE_HCI_LE_SUBEV_SCAN_TIMEOUT (0x11)
1770struct ble_hci_ev_le_subev_scan_timeout {
1772} __attribute__((packed));
1774#define BLE_HCI_LE_SUBEV_ADV_SET_TERMINATED (0x12)
1775struct ble_hci_ev_le_subev_adv_set_terminated {
1779 uint16_t conn_handle;
1781} __attribute__((packed));
1783#define BLE_HCI_LE_SUBEV_SCAN_REQ_RCVD (0x13)
1784struct ble_hci_ev_le_subev_scan_req_rcvd {
1787 uint8_t peer_addr_type;
1788 uint8_t peer_addr[6];
1789} __attribute__((packed));
1791#define BLE_HCI_LE_SUBEV_CHAN_SEL_ALG (0x14)
1792struct ble_hci_ev_le_subev_chan_sel_alg {
1794 uint16_t conn_handle;
1796} __attribute__((packed));
1798#define BLE_HCI_LE_SUBEV_CONNLESS_IQ_RPT (0x15)
1799#define BLE_HCI_LE_SUBEV_CONN_IQ_RPT (0x16)
1800#define BLE_HCI_LE_SUBEV_CTE_REQ_FAILED (0x17)
1802#define BLE_HCI_LE_SUBEV_PERIODIC_ADV_SYNC_TRANSFER (0x18)
1803struct ble_hci_ev_le_subev_periodic_adv_sync_transfer {
1806 uint16_t conn_handle;
1807 uint16_t service_data;
1808 uint16_t sync_handle;
1810 uint8_t peer_addr_type;
1811 uint8_t peer_addr[6];
1815} __attribute__((packed));
1817#define BLE_HCI_LE_SUBEV_CIS_ESTAB (0x19)
1818struct ble_hci_ev_le_subev_cis_established {
1821 uint16_t cis_handle;
1822 uint8_t cig_sync_delay[3];
1823 uint8_t cis_sync_delay[3];
1824 uint8_t trans_latency_mtos[3];
1825 uint8_t trans_latency_stom[3];
1833 uint16_t max_pdu_mtos;
1834 uint16_t max_pdu_stom;
1835 uint16_t iso_interval;
1836} __attribute__((packed));
1838#define BLE_HCI_LE_SUBEV_CIS_REQUEST (0x1A)
1839struct ble_hci_ev_le_subev_cis_request {
1841 uint16_t conn_handle;
1842 uint16_t cis_handle;
1845} __attribute__((packed));
1847#define BLE_HCI_LE_SUBEV_BIG_COMP (0x1B)
1848struct ble_hci_ev_le_subev_big_complete {
1852 uint8_t big_sync_delay[3];
1853 uint8_t transport_latency[3];
1860 uint16_t iso_interval;
1863} __attribute__((packed));
1865#define BLE_HCI_LE_SUBEV_BIG_TERMINATE_COMP (0x1C)
1866struct ble_hci_ev_le_subev_big_terminate_complete {
1870} __attribute__((packed));
1872#define BLE_HCI_LE_SUBEV_BIG_SYNC_ESTAB (0x1D)
1873struct ble_hci_ev_le_subev_big_sync_established {
1877 uint8_t transport_latency[3];
1883 uint16_t iso_interval;
1885 uint16_t bis_handles[0];
1886} __attribute__((packed));
1888#define BLE_HCI_LE_SUBEV_BIG_SYNC_LOST (0x1E)
1889struct ble_hci_ev_le_subev_big_sync_lost {
1893} __attribute__((packed));
1895#define BLE_HCI_LE_SUBEV_REQ_PEER_SCA_COMP (0x1F)
1896struct ble_hci_ev_le_subev_peer_sca_complete {
1899 uint16_t conn_handle;
1901} __attribute__((packed));
1903#define BLE_HCI_LE_SUBEV_PATH_LOSS_THRESHOLD (0x20)
1904struct ble_hci_ev_le_subev_path_loss_threshold {
1906 uint16_t conn_handle;
1907 uint8_t current_path_loss;
1908 uint8_t zone_entered;
1909} __attribute__((packed));
1911#define BLE_HCI_LE_SUBEV_TRANSMIT_POWER_REPORT (0x21)
1912struct ble_hci_ev_le_subev_transmit_power_report {
1915 uint16_t conn_handle;
1918 int8_t transmit_power_level;
1919 uint8_t transmit_power_level_flag;
1921} __attribute__((packed));
1923#define BLE_HCI_LE_SUBEV_BIGINFO_ADV_REPORT (0x22)
1924struct ble_hci_ev_le_subev_biginfo_adv_report {
1926 uint16_t sync_handle;
1929 uint16_t iso_interval;
1934 uint8_t sdu_interval[3];
1939} __attribute__((packed));
1941#define BLE_HCI_LE_SUBEV_SUBRATE_CHANGE (0x23)
1942struct ble_hci_ev_le_subev_subrate_change {
1945 uint16_t conn_handle;
1946 uint16_t subrate_factor;
1947 uint16_t periph_latency;
1949 uint16_t supervision_tmo;
1950} __attribute__((packed));
1952#if (BLE_ADV_REPORT_FLOW_CONTROL == TRUE)
1954#define BLE_HCI_LE_SUBEV_DISCARD_REPORT_EVT 0XF0
1958#define BLE_HCI_EVENT_ACL_BUF_OVERFLOW (0x01)
1961#define BLE_HCI_ADV_RPT_EVTYPE_ADV_IND (0)
1962#define BLE_HCI_ADV_RPT_EVTYPE_DIR_IND (1)
1963#define BLE_HCI_ADV_RPT_EVTYPE_SCAN_IND (2)
1964#define BLE_HCI_ADV_RPT_EVTYPE_NONCONN_IND (3)
1965#define BLE_HCI_ADV_RPT_EVTYPE_SCAN_RSP (4)
1968#define BLE_HCI_LEGACY_ADV_EVTYPE_ADV_IND (0x13)
1969#define BLE_HCI_LEGACY_ADV_EVTYPE_ADV_DIRECT_IND (0x15)
1970#define BLE_HCI_LEGACY_ADV_EVTYPE_ADV_SCAN_IND (0x12)
1971#define BLE_HCI_LEGACY_ADV_EVTYPE_ADV_NONCON_IND (0x10)
1972#define BLE_HCI_LEGACY_ADV_EVTYPE_SCAN_RSP_ADV_IND (0x1b)
1973#define BLE_HCI_LEGACY_ADV_EVTYPE_SCAN_RSP_ADV_SCAN_IND (0x1a)
1976#define BLE_HCI_LE_CONN_COMPLETE_ROLE_MASTER (0x00)
1977#define BLE_HCI_LE_CONN_COMPLETE_ROLE_SLAVE (0x01)
1980#define BLE_HCI_LE_CONN_HANDLE_MAX (0x0eff)
1983#define BLE_HCI_LE_ADV_RPT_NUM_RPTS_MIN (1)
1984#define BLE_HCI_LE_ADV_RPT_NUM_RPTS_MAX (0x19)
1987#define BLE_HCI_VER_BCS_1_0b (0)
1988#define BLE_HCI_VER_BCS_1_1 (1)
1989#define BLE_HCI_VER_BCS_1_2 (2)
1990#define BLE_HCI_VER_BCS_2_0_EDR (3)
1991#define BLE_HCI_VER_BCS_2_1_EDR (4)
1992#define BLE_HCI_VER_BCS_3_0_HCS (5)
1993#define BLE_HCI_VER_BCS_4_0 (6)
1994#define BLE_HCI_VER_BCS_4_1 (7)
1995#define BLE_HCI_VER_BCS_4_2 (8)
1996#define BLE_HCI_VER_BCS_5_0 (9)
1997#define BLE_HCI_VER_BCS_5_1 (10)
1998#define BLE_HCI_VER_BCS_5_2 (11)
1999#define BLE_HCI_VER_BCS_5_3 (12)
2001#define BLE_LMP_VER_BCS_1_0b (0)
2002#define BLE_LMP_VER_BCS_1_1 (1)
2003#define BLE_LMP_VER_BCS_1_2 (2)
2004#define BLE_LMP_VER_BCS_2_0_EDR (3)
2005#define BLE_LMP_VER_BCS_2_1_EDR (4)
2006#define BLE_LMP_VER_BCS_3_0_HCS (5)
2007#define BLE_LMP_VER_BCS_4_0 (6)
2008#define BLE_LMP_VER_BCS_4_1 (7)
2009#define BLE_LMP_VER_BCS_4_2 (8)
2010#define BLE_LMP_VER_BCS_5_0 (9)
2011#define BLE_LMP_VER_BCS_5_1 (10)
2012#define BLE_LMP_VER_BCS_5_2 (11)
2013#define BLE_LMP_VER_BCS_5_3 (12)
2016#if MYNEWT_VAL(BLE_VERSION) == 50
2017#define BLE_HCI_VER_BCS BLE_HCI_VER_BCS_5_0
2018#define BLE_LMP_VER_BCS BLE_LMP_VER_BCS_5_0
2019#elif MYNEWT_VAL(BLE_VERSION) == 51
2020#define BLE_HCI_VER_BCS BLE_HCI_VER_BCS_5_1
2021#define BLE_LMP_VER_BCS BLE_LMP_VER_BCS_5_1
2022#elif MYNEWT_VAL(BLE_VERSION) == 52
2023#define BLE_HCI_VER_BCS BLE_HCI_VER_BCS_5_2
2024#define BLE_LMP_VER_BCS BLE_LMP_VER_BCS_5_2
2025#elif MYNEWT_VAL(BLE_VERSION) == 53
2026#define BLE_HCI_VER_BCS BLE_HCI_VER_BCS_5_3
2027#define BLE_LMP_VER_BCS BLE_LMP_VER_BCS_5_3
2030#define BLE_HCI_DATA_HDR_SZ 4
2031#define BLE_HCI_DATA_HANDLE(handle_pb_bc) (((handle_pb_bc) & 0x0fff) >> 0)
2032#define BLE_HCI_DATA_PB(handle_pb_bc) (((handle_pb_bc) & 0x3000) >> 12)
2033#define BLE_HCI_DATA_BC(handle_pb_bc) (((handle_pb_bc) & 0xc000) >> 14)
2037 uint16_t hdh_handle_pb_bc;
2041#define BLE_HCI_PB_FIRST_NON_FLUSH 0
2042#define BLE_HCI_PB_MIDDLE 1
2043#define BLE_HCI_PB_FIRST_FLUSH 2
2044#define BLE_HCI_PB_FULL 3