1 /*$Id: //dwh/bluetooth/DWC_ble154combo/firmware/rel/1.30a-SOW05Patchv6_2/firmware/public_inc/ll_intf.h#1 $*/ 2 /** 3 ******************************************************************************** 4 * @file ll_intf_cmds.h 5 * @brief This file contains all the functions prototypes for the LL interface component. 6 ****************************************************************************** 7 * @copy 8 * This Synopsys DWC Bluetooth Low Energy Combo Link Layer/MAC software and 9 * associated documentation ( hereinafter the "Software") is an unsupported 10 * proprietary work of Synopsys, Inc. unless otherwise expressly agreed to in 11 * writing between Synopsys and you. The Software IS NOT an item of Licensed 12 * Software or a Licensed Product under any End User Software License Agreement 13 * or Agreement for Licensed Products with Synopsys or any supplement thereto. 14 * Synopsys is a registered trademark of Synopsys, Inc. Other names included in 15 * the SOFTWARE may be the trademarks of their respective owners. 16 * 17 * Synopsys MIT License: 18 * Copyright (c) 2020-Present Synopsys, Inc 19 * 20 * Permission is hereby granted, free of charge, to any person obtaining a copy of 21 * the Software), to deal in the Software without restriction, including without 22 * limitation the rights to use, copy, modify, merge, publish, distribute, 23 * sublicense, and/or sell copies of the Software, and to permit persons to whom 24 * the Software is furnished to do so, subject to the following conditions: 25 * 26 * The above copyright notice and this permission notice shall be included in all 27 * copies or substantial portions of the Software. 28 * 29 * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 30 * IMPLIED, INCLUDING, BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 31 * FITNESS FOR A PARTICULAR PURPOSE, AND NONINFRINGEMENT. IN NO EVENT SHALL THE 32 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 33 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT, OR OTHERWISE ARISING FROM, 34 * OUT OF, OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 35 * 36 * */ 37 38 #ifndef INCLUDE_LL_INTF_CMDS_H 39 #define INCLUDE_LL_INTF_CMDS_H 40 41 #include <stdint.h> 42 #include "common_types.h" 43 #if SUPPORT_PTA 44 #include "pta.h" 45 #endif /* SUPPORT_PTA */ 46 /** 47 * @brief Global error definition across different components. 48 * refer the error codes defined in @ref ll_error.h for more information about the values that this type should set 49 */ 50 typedef uint32_t ble_stat_t; 51 52 #ifndef ADDRESS_SIZE 53 #define ADDRESS_SIZE 6 54 #endif /* ADDRESS_SIZE */ 55 56 #define LE_FEATURES_BYTES_NO 8 57 #define ISO_CODEC_ID_SIZE 5 58 59 /*! 60 * The link layer will write the received packets RX_DATA_OFFSET 61 * bytes after the start of the allocated shared memory. This may 62 * be used to meet the requirements of the host or application in 63 * case that some free space has to lead the received packets. 64 */ 65 #define RX_DATA_OFFSET 0 66 67 /** 68 * This defined value is used on Link Status custom command as 69 * the maximum number of states as follows: 70 * 8 (max num of state machines) 71 * 72 * in addition to: 73 * 2 (Broadcaster and Observer) 74 */ 75 #define LINK_STATUS_SIZE (MAX_NUM_CNCRT_STAT_MCHNS+2) 76 /** 77 * This defined value is used on Link Status custom command to indicate 78 * that the given state machine on a state other that a connection state 79 */ 80 #define LINK_STATUS_DEFAULT_HANDLE 0xFFFF 81 82 83 /** 84 * This defined values are used to check for the range of values that the 85 * channel classification parameters take (both min_spacing and max_delay) 86 */ 87 #define CHANNEL_CLASSIFICATION_REPORTING_TIMING_PARAM_MIN 5 88 #define CHANNEL_CLASSIFICATION_REPORTING_TIMING_PARAM_MAX 150 89 90 extern const struct hci_dispatch_tbl* p_dis_tbl; 91 /*================================= Enumerations =====================================*/ 92 93 /** 94 * @brief BLE role enumeration 95 */ 96 typedef enum _ble_conn_role_e { 97 BLE_ROLE_MASTER = 0 , 98 BLE_ROLE_SLAVE = 1 99 }ble_conn_role_e; 100 101 /** 102 * @brief Advertising event type enumeration 103 */ 104 typedef enum _ble_adv_event_type_e { 105 ADV_IND_EVENT, 106 ADV_DIRECT_IND_EVENT, 107 ADV_SCAN_IND_EVENT, 108 ADV_NONCONN_IND_EVENT, 109 SCAN_RSP_EVENT, 110 } ble_adv_event_type_e; 111 112 /** 113 * @brief Enum device address type. 114 */ 115 typedef enum dev_addr_type { 116 PUBLIC, RANDOM, PUBLIC_ID, RANDOM_STATIC_ID, INVALID_TYPE, 117 ANNONYMOUS = 0xFF 118 } dev_addr_type_e; 119 120 /** 121 * @brief Enum device address type. 122 */ 123 typedef enum _rec_adv_stat_e { 124 ADV_EXT_STAT, 125 AUX_ADV_STAT, 126 AUX_CHAIN_STAT, 127 } rec_adv_stat_e; 128 129 #if (SUPPORT_AOA_AOD) 130 /** 131 * @brief Enum CTE_Type. 132 */ 133 typedef enum _cte_type_e { 134 AOA_CTE, 135 AOD_CTE_1_US_SLOTS, 136 AOD_CTE_2_US_SLOTS 137 } cte_type_e; 138 139 /** 140 * @brief Enum CTE_Category (connection CTE or connectionless CTE). 141 */ 142 typedef enum _cte_category_e { 143 CONNECTION_CTE, 144 CONNECTIONLESS_CTE 145 } cte_category_e; 146 147 /** 148 * @brief Enum CTE Slot Durations. 149 */ 150 typedef enum _cte_slot_durtn_e { 151 SLOT_DURTN_1_US = 0x01, 152 SLOT_DURTN_2_US 153 } cte_slot_durtn_e; 154 #endif /* SUPPORT_AOA_AOD */ 155 156 /* 157 * @brief Privacy Modes 158 */ 159 typedef enum _ble_prvcy_mod_e { 160 NETWORK_MODE, 161 DEVICE_MODE 162 } ble_prvcy_mod_e; 163 164 /** 165 * @brief State machine status for Get Link Status Command, it holds the 166 * values for different state machines based on its running event type 167 */ 168 enum _sm_status_e { 169 SM_STATUS_IDLE = 0, 170 SM_STATUS_ADV_EXTADV = 1, 171 SM_STATUS_PERI_CONN = 2, 172 SM_STATUS_SCN_EXTSCN = 3, 173 SM_STATUS_CENT_CONN = 5, 174 SM_STATUS_DTM_TX = 6, 175 SM_STATUS_DTM_RX = 7, 176 SM_STATUS_PRDC_ADV = 9, 177 SM_STATUS_PRDC_SYNC = 10, 178 SM_STATUS_BIG_ADV = 11, 179 SM_STATUS_BIG_SYNC = 12, 180 SM_STATUS_PERI_CIG = 13, 181 SM_STATUS_CENT_CIG = 14, 182 }; 183 184 /*================================= Structures =====================================*/ 185 186 /** 187 * @brief The data in one advertising report from the non-connection manager to the LL interface 188 * 189 * This structure contains the parameters should be sent from the link layer to the host per report. 190 */ 191 typedef struct _ble_intf_adv_report_data_st { 192 uint8_t adv_addr[ADDRESS_SIZE + 2]; 193 ble_buff_hdr_t adv_rprt_data; 194 int8_t rssi; 195 ble_adv_event_type_e evnt_type; 196 dev_addr_type_e adv_addr_type; 197 } ble_intf_adv_report_data_st; 198 199 /** 200 * @brief Structure containing the advertising report data to be reported to host 201 */ 202 typedef struct _ble_intf_extended_adv_rprt_data_st { 203 rec_adv_stat_e adv_stat; 204 uint16_t event_type; 205 uint8_t address_type; 206 uint8_t *ptr_address; 207 uint8_t primary_phy; 208 uint8_t secondary_phy; 209 uint8_t advertising_sid; 210 uint16_t adv_data_id; 211 uint8_t TX_power; 212 int8_t rssi; 213 uint16_t periodic_advertisng_interval; 214 uint8_t direct_addresses_type; 215 uint8_t *ptr_direct_address; 216 uint8_t data_length; 217 ble_buff_hdr_t *ptr_data; 218 uint8_t rmv_adv_rprt; /* set to mark duplicate packet */ 219 uint8_t address [ADDRESS_SIZE]; 220 } ble_intf_extended_adv_rprt_data_st; 221 222 #if (SUPPORT_PERIODIC_SYNC_TRANSFER) 223 /** 224 * @brief Structure containing the advertising sync transfer report to be reported to the host 225 */ 226 typedef struct _ble_intf_prdc_adv_sync_transfer_report_st { 227 uint8_t* ptr_advertiser_address; /* Pointer to advertiser address */ 228 uint16_t conn_handle; /* Used to identify connection */ 229 uint16_t service_data; /* A value provided by the peer device */ 230 uint16_t sync_handle; /* Used to identify the periodic advertiser */ 231 uint16_t periodic_advertising_interval; /* Periodic advertising interval */ 232 uint8_t status; /* Periodic advertising sync successful/failed */ 233 uint8_t advertising_sid; /* Value of the Advertising SID subfield in the ADI field of the PDU */ 234 uint8_t advertiser_address_type; /* Advertiser address type */ 235 uint8_t advertiser_phy; /* Advertiser PHY */ 236 uint8_t advertiser_clock_accuracy; /* Clock accuracy used by advertise */ 237 } ble_intf_prdc_adv_sync_transfer_report_st ; 238 #endif /* SUPPORT_PERIODIC_SYNC_TRANSFER */ 239 240 /** 241 * @brief The data in one direct advertising report from the non-connection manager to the LL interface 242 * 243 * This structure contains the parameters should be sent from the link layer to the host per direct advertising report. 244 */ 245 typedef struct _ble_intf_dir_adv_report_data_st { 246 uint8_t addr[ADDRESS_SIZE + 2]; 247 uint8_t dir_addr[ADDRESS_SIZE + 2]; 248 int8_t rssi; 249 ble_adv_event_type_e evnt_type; 250 dev_addr_type_e addr_type; 251 dev_addr_type_e dir_addr_type; 252 } ble_intf_dir_adv_report_data_st; 253 254 /** 255 * @brief Data contained in extended advertising enable command for each advertising handle. 256 * 257 * This structure contains the parameters that are passed by the Host in extended advertising enable command for each advertising handle . 258 * we divided the duration into two octets to avoid the structure padding 259 */ 260 typedef struct { 261 uint8_t advertising_handle; /* Advertising handle that identify the advertising sets.*/ 262 uint8_t duration_LSB; /* The Least Significant Octet of the Duration of the advertising */ 263 uint8_t duration_MSB; /* The Most Significant Octet of the Duration of the advertising */ 264 uint8_t max_extended_advertising_events; /* Max number of events of the advertising of each advertising handle */ 265 } st_ble_intf_ext_adv_enable_params; 266 267 /** 268 * @brief Data contained in extended create connection command for each PHY. 269 * 270 * This structure contains the parameters that are passed by the Host in set extended scan parameters command for each PHY. 271 */ 272 typedef struct { 273 uint8_t scan_type; 274 uint16_t scan_interval; 275 uint16_t scan_window; 276 } st_ble_intf_ext_scn_params; 277 278 #if (SUPPORT_CONNECTED_ISOCHRONOUS &&( SUPPORT_MASTER_CONNECTION || SUPPORT_SLAVE_CONNECTION)) 279 /** 280 * @brief Data contained in CIS established event 281 * 282 * This structure contains the parameters that are passed to the Host in different scenarios of CIS (eg: create_cis). 283 */ 284 typedef struct _ble_intf_cis_estblshd_evnt_st{ 285 uint32_t cig_sync_delay; /* The maximum time, in us, for transmission all CISes */ 286 uint32_t cis_sync_delay; /* The maximum time, in us, for transmission of PDUs of a CIS */ 287 uint32_t trsnprt_ltncy_m_to_s; /* The maximum time, in us, for transmission of SDUs of all CISes */ 288 uint32_t trsnprt_ltncy_s_to_m; 289 uint16_t conn_hndl; /* Connection handle of the CIS */ 290 uint16_t max_pdu_m_to_s; /* max pdu size */ 291 uint16_t max_pdu_s_to_m; 292 uint16_t iso_interval; 293 uint8_t status; /* Status of the establishment */ 294 uint8_t phy_m_to_s; /* Used PHY from Master to Slave */ 295 uint8_t phy_s_to_m; /* Used PHY from Slave to Master */ 296 uint8_t nse; /* number of sub-event*/ 297 uint8_t bn_m_to_s; /* number of payloads */ 298 uint8_t bn_s_to_m; 299 uint8_t ft_m_to_s; /* flush timeout */ 300 uint8_t ft_s_to_m; 301 } ble_intf_cis_estblshd_evnt_st; 302 303 /** 304 * @brief Data contained in CIS Request event 305 * 306 * This structure contains the parameters passed from the master to the host of the slave in CIS creation procedure. 307 */ 308 typedef struct _ble_intf_cis_req_evnt_st{ 309 uint16_t acl_conn_hndl; /* ACL connection handle*/ 310 uint16_t cis_conn_hndl; /* CIS connection handle */ 311 uint8_t cis_id; /* CIS Identifier */ 312 uint8_t cig_id; /* CIG Identifier */ 313 } ble_intf_cis_req_evnt_st; 314 315 #endif/* SUPPORT_CONNECTED_ISOCHRONOUS &&( SUPPORT_MASTER_CONNECTION || SUPPORT_SLAVE_CONNECTION) */ 316 317 #if ((SUPPORT_CONNECTED_ISOCHRONOUS &&( SUPPORT_MASTER_CONNECTION || SUPPORT_SLAVE_CONNECTION)) || (SUPPORT_BRD_ISOCHRONOUS || SUPPORT_SYNC_ISOCHRONOUS)) 318 /** 319 * @brief Structure containing the ISO sync event info to be reported to host 320 */ 321 typedef struct _ble_intf_sync_evnt_st{ 322 uint8_t group_id; /* identifier of the CIG or BIG*/ 323 uint32_t next_anchor_point; /* the time stamp in microseconds at the Controller clock of the next expected CIG or BIG anchor point */ 324 uint32_t time_stamp; /* the time stamp in microseconds at the Controller clock, this represent the time at which the Trigger is generated */ 325 uint32_t nxt_sdu_delivery_timeout; 326 } ble_intf_sync_evnt_st; 327 #endif /* (SUPPORT_CONNECTED_ISOCHRONOUS &&( SUPPORT_MASTER_CONNECTION || SUPPORT_SLAVE_CONNECTION)) || (SUPPORT_BRD_ISOCHRONOUS || SUPPORT_SYNC_ISOCHRONOUS) */ 328 329 #if (SUPPORT_BRD_ISOCHRONOUS || SUPPORT_SYNC_ISOCHRONOUS) 330 /** 331 * @brief Structure containing the Create BIG Test command parameters 332 */ 333 typedef struct _ble_intf_create_big_test_cmd_st 334 { 335 uint16_t iso_intrv; /* contains the time duration between two consecutive BIG anchor points*/ 336 uint16_t max_pdu; /* contains the maximum size of every BIS Data PDU for every BIS in the BIG*/ 337 uint8_t nse; /* Number of SubEvents */ 338 uint8_t bn; /* (Burst Number) the number of new payloads for each BIS in an isochronous interval*/ 339 uint8_t irc; /*(Immediate Repetition Count) the number of times the data packet is transmitted */ 340 uint8_t pto; /* (Pre_Transmission_Offset) the offset in number of ISO_Intervals for pre-transmissions of data packets */ 341 } ble_intf_create_big_test_cmd_st; 342 343 /** 344 * @brief Structure containing the Create BIG SYNC command parameters 345 */ 346 typedef struct _ble_intf_big_common_sync_bc_cmd_st{ 347 uint8_t num_bis; /* Total number of BISes to synchronize*/ 348 uint32_t bcast_code[4]; /* used for deriving the session key for decrypting payloads of encrypted BISes.*/ 349 uint8_t big_hndle; /* the identifier of the BIG */ 350 uint8_t encrptn; /* identifies the encryption mode of the BISes */ 351 }ble_intf_big_common_sync_bc_cmd_st; 352 353 /** 354 * @brief structure of common parameters between create_big and create_big_test 355 */ 356 typedef struct _ble_intf_create_big_common_param_cmd_st{ 357 uint32_t sdu_intrv; /* contains the time interval of the periodic SDUs */ 358 uint16_t max_sdu; /* contains the maximum size of an SDU*/ 359 uint8_t adv_hndle; /* identifies the associated periodic advertising train of the BIG */ 360 uint8_t pack; /* the preferred method of arranging subevents of multiple BISes*/ 361 uint8_t framing; /* indicates the format for sending BIS Data PDUs (framed or unframed)*/ 362 tx_rx_phy_e phy; /* the PHY used for transmission of PDUs of BISes in the BIG */ 363 ble_intf_big_common_sync_bc_cmd_st big_common_sync_bc; /* common parameters between the synchronizer and broadcaster */ 364 }ble_intf_create_big_common_param_cmd_st; 365 366 #if(SUPPORT_BRD_ISOCHRONOUS) 367 /** 368 * @brief Data contained in big complete event 369 * 370 * This structure contains parameters that are passed to the Host while ig creation. 371 */ 372 typedef struct _ble_intf_big_cmplt_evnt_st{ 373 uint16_t *conn_hndle; /* the list of connection handles of all BISes in the BIG*/ 374 uint32_t big_sync_delay; /* the maximum time, in microseconds, for transmission of PDUs of all BISes in a BIG in an isochronous interval */ 375 uint32_t trnsprt_ltncy_big; /* the maximum time, in microseconds, for transmission of SDUs of all BISes in a BIG */ 376 uint16_t max_pdu; /*Maximum size, in octets, of the payload*/ 377 uint16_t iso_intrv; /* iso interval */ 378 uint8_t status; /*Create BIG successful/failed*/ 379 uint8_t big_hndle; /* the identifier of the BIG */ 380 uint8_t phy; /* the PHY used to create the BIG*/ 381 uint8_t num_bis; /* the total number of BISes in the BIG*/ 382 uint8_t nse; /*The number of subevents in each BIS event in the BIG*/ 383 uint8_t bn; /*The number of new payloads in each BIS event*/ 384 uint8_t pto; /*Offset used for pre-transmissions*/ 385 uint8_t irc; /*The number of times a payload is transmitted in a BIS event*/ 386 } ble_intf_big_cmplt_evnt_st; 387 #endif /* SUPPORT_BRD_ISOCHRONOUS */ 388 389 #if(SUPPORT_SYNC_ISOCHRONOUS) 390 /** 391 * @brief Data contained in big sync established event 392 */ 393 typedef struct _ble_intf_big_sync_estblshd_evnt_st{ 394 uint32_t trnsprt_ltncy_big; /* the maximum time, in microseconds, for reception of SDUs of all BISes in aBIG */ 395 uint16_t *conn_hndle; /* The list of connection handles of all BISes in the BIG*/ 396 uint16_t max_pdu; /* Maximum size, in octets, of the payload*/ 397 uint16_t iso_intrvl; /* IsoInterval */ 398 uint8_t status; /* BIG sync establish successful/failed */ 399 uint8_t big_hndle; /* the identifier of the BIG */ 400 uint8_t num_bis; /* the total number of BISes in the BIG*/ 401 uint8_t nse; /*The number of subevents in each BIS event in the BIG*/ 402 uint8_t bn; /*The number of new payloads in each BIS event*/ 403 uint8_t pto; /*Offset used for pre-transmissions*/ 404 uint8_t irc; /*The number of times a payload is transmitted in a BIS event*/ 405 } ble_intf_big_sync_estblshd_evnt_st; 406 407 /** 408 * @brief Data contained in BIGInfo report event 409 */ 410 typedef struct _ble_intf_biginfo_rprt_evnt_st{ 411 ble_intf_create_big_test_cmd_st test_param_st; 412 ble_intf_create_big_common_param_cmd_st non_test_param; 413 uint16_t sync_hndl; 414 } ble_intf_biginfo_rprt_evnt_st; 415 416 #endif /* SUPPORT_SYNC_ISOCHRONOUS */ 417 #endif/* SUPPORT_BRD_ISOCHRONOUS || SUPPORT_SYNC_ISOCHRONOUS */ 418 419 #if (SUPPORT_AOA_AOD) 420 #if (SUPPORT_EXPLCT_OBSERVER_ROLE || SUPPORT_MASTER_CONNECTION || SUPPORT_SYNC_ISOCHRONOUS) 421 /** 422 * @brief This structure contains the parameters that should be sent from the link layer to the host through the LE_Connectionless_IQ_Report_Event. 423 */ 424 typedef struct _le_connless_iq_report_evnt_st { 425 ble_buff_hdr_t *ptr_iq_samples; /* Pointer to the IQ samples buffer received in AUX_SYNC_IND PDU */ 426 uint16_t sync_handle; 427 int16_t rssi; /* RSSI of the packet (excluding the Constant Tone Extension) */ 428 uint16_t pa_event_counter; 429 uint8_t rssi_antenna_id; /* ID of the antenna on which the RSSI was measured */ 430 uint8_t channel_index; /* Index of the channel on which the AUX_SYNC_IND PDU was received */ 431 uint8_t pckt_status; /* Indicate whether the received packet had a valid CRC */ 432 uint8_t sample_count; /* Total number of IQ sample pairs */ 433 cte_type_e cte_type; /* CTE field type */ 434 cte_slot_durtn_e slot_durations; /* CTE switching and sampling slot durations */ 435 } le_connless_iq_report_evnt_st; 436 #endif /* SUPPORT_EXPLCT_OBSERVER_ROLE || SUPPORT_MASTER_CONNECTION || SUPPORT_SYNC_ISOCHRONOUS*/ 437 438 #if (SUPPORT_MASTER_CONNECTION || SUPPORT_SLAVE_CONNECTION) 439 /** 440 * @brief This structure contains the parameters that should be sent from the link layer to the host through the LE_Connection_IQ_Report_Event. 441 */ 442 typedef struct _ble_intf_conn_iq_report_st { 443 ble_buff_hdr_t *ptr_iq_samples; /* Pointer to the IQ samples buffer received during the connection event */ 444 uint16_t conn_handle; 445 int16_t rssi; /* RSSI value of the received data packet */ 446 uint16_t conn_event_counter; 447 uint8_t rx_phy; /* Receiver PHY for the connection. 0x01: LE 1M PHY, 0x02: LE 2M PHY */ 448 uint8_t data_channel_index; /* Index of the data channel on which the Data Channel PDU was received */ 449 uint8_t rssi_antenna_id; /* ID of the antenna on which the RSSI was measured */ 450 uint8_t pckt_status; /* Indicate whether the received packet had a valid CRC */ 451 uint8_t sample_count; /* Total number of IQ sample pairs */ 452 cte_type_e cte_type; /* CTE field type */ 453 cte_slot_durtn_e slot_durations; /* CTE switching and sampling slot durations */ 454 } ble_intf_conn_iq_report_st; 455 #endif /* (SUPPORT_MASTER_CONNECTION || SUPPORT_SLAVE_CONNECTION) */ 456 #endif /* SUPPORT_AOA_AOD */ 457 458 #if (SUPPORT_LE_POWER_CONTROL) 459 /** 460 * @brief This structure contains the parameters that should be sent from the link layer to the host through the LE_Transmit_Power_Reporting_Event. 461 */ 462 typedef struct _le_tx_power_report_st { 463 uint16_t conn_handle_id; /* Connection handle for which the TX_Power level is reported to Host */ 464 uint8_t status; /* Status of the "HCI_LE_Read_Remote_Transmit_Power_Level" command */ 465 uint8_t reason; /* Indicates why the event was sent and the device whose TX_Power level is being reported: 466 0x00: Local transmit power changed 467 0x01: Remote transmit power changed 468 0x02: HCI_LE_Read_Remote_Transmit_Power_Level command completed */ 469 uint8_t phy; /* Indicate the PHY involved (which might not be the current TX PHY for the relevant device) */ 470 uint8_t tx_power_level_flag;/* Indicate whether the TX_Power level that is being reported has reached its minimum and/or maximum level */ 471 int8_t tx_power_level; /* Indicate the TX_Power level for the PHY (unit: dBm) */ 472 int8_t delta; /* Set to the change in power level for the transmitter being reported (unit: dB) */ 473 } le_tx_power_report_st; 474 475 /** 476 * @brief This structure contains the parameters that should be sent from the link layer to the host through the LE_Path_Loss_Threshold_Event. 477 */ 478 typedef struct _le_path_loss_threshold_evnt_st { 479 uint16_t conn_handle_id; /* Connection handle for which a path loss threshold crossing is reported to Host */ 480 uint8_t current_path_loss; /* The current path loss value as calculated by the Controller. (unit: dB) */ 481 uint8_t zone_entered; /* Indicates which zone was entered: 482 0x00: Entered low zone 483 0x01: Entered middle zone 484 0x02: Entered high zone */ 485 } le_path_loss_threshold_evnt_st; 486 #endif /* SUPPORT_LE_POWER_CONTROL */ 487 488 #if SUPPORT_LE_ENHANCED_CONN_UPDATE 489 /* struct holding the subrate parameters used in posting subrate change event to the host */ 490 typedef struct _le_subrate_change_evnt_st{ 491 uint16_t conn_handle_id; 492 uint16_t subrate_factor; 493 uint16_t peripheral_latency; 494 uint16_t continuation_num; 495 uint16_t supervisionTo; 496 uint8_t status; 497 }le_subrate_change_evnt_st; 498 #endif /* SUPPORT_LE_ENHANCED_CONN_UPDATE */ 499 500 typedef enum _enum_ext_create_conn_verison 501 { 502 EXT_CREATE_CONN_VER_1, 503 EXT_CREATE_CONN_VER_2, 504 }enum_ext_create_conn_ver; 505 506 typedef enum _enum_prdc_adv_param_ver 507 { 508 PRDC_ADV_PARAM_VER_1, 509 PRDC_ADV_PARAM_VER_2, 510 }enum_prdc_adv_param_ver; 511 512 /** 513 * @brief Data contained in extended create connection command for each PHY. 514 * 515 * This structure contains the parameters that are passed by the Host in extended create connection command for each PHY. 516 */ 517 typedef struct _ble_intf_ext_create_conn_st { 518 uint16_t scan_interval; /* scanning intervals for each PHY. */ 519 uint16_t scan_window; /* scanning windows for each PHY. */ 520 uint16_t conn_interval_min; /* minimum connection interval for each PHY. */ 521 uint16_t conn_interval_max; /* maximum connection interval for each PHY. */ 522 uint16_t conn_latency; /* connection latencies for each PHY. */ 523 uint16_t supervision_timeout; /* supervision timeout for each PHY. */ 524 uint16_t minimum_ce_length; /* minimum connection event length for each PHY. */ 525 uint16_t maximum_ce_length; 526 } st_ble_intf_ext_create_conn; 527 528 typedef struct _ble_intf_ext_create_conn_cmd_st 529 { 530 st_ble_intf_ext_create_conn* ptr_ext_create_conn; /* ptr to extended create connection parameters */ 531 uint8_t* ptr_peer_address; /* ptr to the Peer address*/ 532 uint8_t initiator_filter_policy; /* used to determine whether the Filter Accept List is used */ 533 uint8_t own_address_type; /* indicates the type of address used in the connection request packets */ 534 uint8_t peer_address_type; /* indicates the type of address used in the connectable advertisement sent by the peer */ 535 uint8_t initiating_phys; /* indicates the PHY(s) on which the advertising packets should be received */ 536 }ble_intf_ext_create_conn_cmd_st; 537 538 typedef struct _ble_set_prdc_adv_param_st 539 { 540 uint16_t prdc_adv_intrvl_min;/* Minimum advertising interval for periodic advertising */ 541 uint16_t prdc_adv_intrvl_max;/* Maximum advertising interval for periodic advertising */ 542 uint16_t prdc_adv_prpts; /* Include TxPower in the advertising PDU */ 543 }ble_set_prdc_adv_param_st; 544 545 typedef struct _ble_enhanced_conn_cmplt_evnt_st 546 { 547 ble_stat_t status; /*Connection Status*/ 548 uint8_t *ptr_peer_addr;/*Public Device Address, or Random Device Address, Public Identity Address or Random (static) Identity Address of the device to be connected.*/ 549 uint8_t *ptr_local_resolvable_prvt_addr;/*Resolvable Private Address being used by the local device for this connection.*/ 550 uint8_t *ptr_peer_resolvable_prvt_addr;/*Resolvable Private Address being used by the peer device for this connection.*/ 551 ble_conn_role_e role;/*Connection type (Master or Slave)*/ 552 uint16_t conn_handle_id;/*Connection_Handle to be used to identify a connection between two Bluetooth devices.*/ 553 uint16_t conn_intrvl;/*Connection interval used on this connection.*/ 554 uint16_t slave_ltncy;/*Slave latency for the connection in number of connection events.*/ 555 uint16_t suprvsn_tout;/*Supervision timeout for the connection requested by the remote device.*/ 556 uint8_t peer_addr_type;/*Peer address type*/ 557 uint8_t master_clk_accurcy;/*Master clock acuracy.*/ 558 }ble_enhanced_conn_cmplt_evnt_st; 559 560 typedef struct _ble_prdc_adv_sync_estblshd_st 561 { 562 uint8_t* ptr_adv_addrs; /*ptr to Address of the advertiser */ 563 ble_stat_t status; /*Periodic advertising sync Status*/ 564 uint16_t sync_handle; /*identifying the periodic advertising train*/ 565 uint16_t prdc_adv_intrvl;/*Periodic advertising interval*/ 566 uint8_t adv_sid;/*Value of the Advertising SID subfield in the ADI field of the PDU */ 567 uint8_t adv_addrs_type;/*address type of the advertiser */ 568 uint8_t adv_phy; /*advertiser PHY */ 569 uint8_t adv_clk_accuracy;/*Advertiser Clock Accuracy*/ 570 }ble_prdc_adv_sync_estblshd_st; 571 572 /*============ PAWR ============ */ 573 574 typedef struct _ble_prdc_adv_rprt_st 575 { 576 ble_buff_hdr_t *ptr_data;/*ptr to Data received from a Periodic Advertising packet.*/ 577 uint8_t tx_power;/*Tx Power information*/ 578 int8_t rssi;/*RSSI value*/ 579 uint8_t cte_type;/* indicates the type of Constant Tone Extension in the periodic advertising packets*/ 580 uint8_t data_status;/*Data status*/ 581 uint8_t data_length;/*Length of the Data field*/ 582 }ble_prdc_adv_rprt_st; 583 584 585 /* HCI Commands Parameters Structures */ 586 #if (SUPPORT_AOA_AOD) 587 #if (SUPPORT_EXPLCT_BROADCASTER_ROLE) 588 /** 589 * @brief LE Set Connectionless CTE Transmit Parameters Command 590 */ 591 typedef struct _le_set_connless_cte_tx_params_cmd_st 592 { 593 uint8_t adv_handle; 594 uint8_t cte_len; /* Length of the Constant Tone Extension in 8 us units. Range:[0x02 – 0x14] 595 0x00: means Do not transmit a Constant Tone Extension */ 596 uint8_t cte_type; /* 0x00: AoA CTE 597 0x01: AoD CTE with 1 us slots 598 0x02: AoD CTE with 2 us slots */ 599 uint8_t cte_count; /* Number of CTEs to transmit in each periodic advertising interval*/ 600 uint8_t switching_pattern_len; /* The number of Antenna IDs in the switching pattern */ 601 uint8_t *ptr_antenna_ids; /* List of Antenna IDs in the pattern */ 602 }le_set_connless_cte_tx_params_cmd_st; 603 604 /** 605 * @brief LE Set Connectionless CTE Transmit Enable Command 606 */ 607 typedef struct _le_set_connless_cte_tx_enable_cmd_st 608 { 609 uint8_t adv_handle; 610 uint8_t connless_cte_enable; /* Enable/Disable Connectionless CTE transmission. Enable:1 - Disable:0 */ 611 612 }le_set_connless_cte_tx_enable_cmd_st; 613 #endif /* (SUPPORT_EXPLCT_BROADCASTER_ROLE) */ 614 615 #if (SUPPORT_EXPLCT_OBSERVER_ROLE || SUPPORT_MASTER_CONNECTION || SUPPORT_SYNC_ISOCHRONOUS) 616 /** 617 * @brief LE Set Connectionless IQ Sampling Enable Command 618 */ 619 typedef struct _le_set_connless_iq_sampling_enable_cmd_st 620 { 621 uint16_t sync_handle; 622 uint8_t iq_sampling_enable; /* Enable/Disable Connectionless IQ samples capturing. Enable:1 - Disable:0 */ 623 uint8_t slot_durations; /* Switching and sampling slots' duration */ 624 uint8_t max_sampled_ctes; /* maximum number of CTEs to sample and report in each periodic advertising interval */ 625 uint8_t switching_pattern_len; /* The number of Antenna IDs in the switching pattern */ 626 uint8_t *ptr_antenna_ids; /* List of Antenna IDs in the pattern */ 627 }le_set_connless_iq_sampling_enable_cmd_st; 628 #endif /* (SUPPORT_EXPLCT_OBSERVER_ROLE || SUPPORT_MASTER_CONNECTION || SUPPORT_SYNC_ISOCHRONOUS) */ 629 630 #if ((SUPPORT_MASTER_CONNECTION) || (SUPPORT_SLAVE_CONNECTION)) 631 /** 632 * @brief LE Set Connection CTE Receive Parameters Command 633 */ 634 typedef struct _le_set_conn_cte_rx_params_cmd_st 635 { 636 uint16_t conn_handle_id; 637 uint8_t cte_sampling_enable; /* Enable/Disable sampling the received CTE fields on this connection handle. Enable:1 - Disable:0 */ 638 uint8_t slot_durations; /* Switching and sampling slots' duration */ 639 uint8_t switching_pattern_len; /* The number of Antenna IDs in the switching pattern */ 640 uint8_t *ptr_antenna_ids; /* List of Antenna IDs in the pattern */ 641 }le_set_conn_cte_rx_params_cmd_st; 642 643 /** 644 * @brief LE Set Connection CTE Transmit Parameters Command 645 */ 646 typedef struct _le_set_conn_cte_tx_params_cmd_st 647 { 648 uint16_t conn_handle_id; 649 uint8_t cte_types; /* 0x00: AoA CTE 650 0x01: AoD CTE with 1 us slots 651 0x02: AoD CTE with 2 us slots */ 652 uint8_t switching_pattern_len; /* The number of Antenna IDs in the switching pattern */ 653 uint8_t *ptr_antenna_ids; /* List of Antenna IDs in the pattern */ 654 }le_set_conn_cte_tx_params_cmd_st; 655 656 /** 657 * @brief LE Connection CTE Request Enable Command 658 */ 659 typedef struct _le_set_conn_cte_req_enable_cmd_st 660 { 661 uint16_t conn_handle_id; 662 uint16_t cte_req_intrvl; /* 0x00 : Send LL_CTE_REQ once, at the earliest practical opportunity 663 0x0001 - 0xFFFF : Requested interval for sending LL_CTE_REQ PDUs in number of connection events. */ 664 uint8_t cte_req_enable; /* Enable/Disable CTE Request transmission for the connection. Enable:1 - Disable:0 */ 665 uint8_t requested_cte_len; /* Minimum length of the Constant Tone Extension being requested in 8 us units */ 666 uint8_t requested_cte_type; /* Indicates the type of CTE that the Controller shall request from the remote device, its values: 667 0x00 : AoA Constant Tone Extension 668 0x01 : AoD Constant Tone Extension with 1 us slots 669 0x02 : AoD Constant Tone Extension with 2 us slots */ 670 }le_set_conn_cte_req_enable_cmd_st; 671 672 /** 673 * @brief LE Connection CTE Response Enable Command 674 */ 675 typedef struct _le_set_conn_cte_rsp_enable_cmd_st 676 { 677 uint16_t conn_handle_id; 678 uint8_t cte_rsp_enable; /* Enable/Disable CTE Response transmission for the connection. Enable:1 - Disable:0 */ 679 }le_set_conn_cte_rsp_enable_cmd_st; 680 #endif /* (SUPPORT_MASTER_CONNECTION) || (SUPPORT_SLAVE_CONNECTION) */ 681 #endif /* SUPPORT_AOA_AOD */ 682 683 #if (SUPPORT_AOA_AOD) 684 /** 685 * @brief LE Receiver Test command [v3] 686 */ 687 typedef struct 688 { 689 uint8_t rx_channel; /* specify the RF channel to be used by the receiver */ 690 uint8_t phy; /* specify the PHY to be used by the receiver */ 691 uint8_t modulation_index; /* specify whether or not the Controller should assume the receiver has a stable modulation index */ 692 uint8_t expected_cte_length; /* specify the expected length of the Constant Tone Extension in received test reference packets */ 693 uint8_t expected_cte_type; /* specify the expected type of the Constant Tone Extension in expected test reference packets */ 694 uint8_t switching_pattern_len; /* specify the length of the antenna switching pattern used when receiving an AoA CTE */ 695 uint8_t *ptr_antenna_ids; /* specify the antenna switching pattern used when receiving an AoA CTE */ 696 cte_slot_durtn_e slot_durations; /* specify the CTE sampling slots durations */ 697 }le_rx_test_v3_cmd_st; 698 699 /** 700 * @brief LE Transmitter Test command [v3] 701 */ 702 typedef struct _le_tx_test_v3_cmd_st 703 { 704 uint8_t tx_channel; /* specify the RF channel to be used by the transmitter */ 705 uint8_t length_of_test_data; /* specify the length of the Payload of the test reference packets */ 706 uint8_t packet_payload; /* specify the con_le_rx_test_v3_cmd_sttents of the Payload of the test reference packets */ 707 uint8_t phy; /* specify the PHY to be used by the transmitter */ 708 uint8_t cte_length; /* specify the length of the Constant Tone Extension in the test reference packets */ 709 uint8_t cte_type; /* specify the type of the Constant Tone Extension in the test reference packets */ 710 uint8_t switching_pattern_len; /* specify the length of the antenna switching pattern used when transmitting an AoD CTE */ 711 uint8_t *ptr_antenna_ids; /* specify the antenna switching pattern used when transmitting an AoD CTE */ 712 }le_tx_test_v3_cmd_st; 713 #endif /* SUPPORT_AOA_AOD */ 714 715 /** 716 * @brief LE Set Connection Transmit Power Level command 717 */ 718 #if (SUPPORT_MASTER_CONNECTION || SUPPORT_SLAVE_CONNECTION) 719 typedef struct _le_set_conn_tx_pwr_lvl_cmd_st{ 720 uint16_t conn_handle_id; /* Connection handle for which the TX_Power level used by the local controller is updated */ 721 uint8_t phy; /* PHY for which the TX_Power level used by the local controller is updated */ 722 int8_t tx_power; /* specify the change in the local TX_Power level, if any,for the PHY(s) specified */ 723 }le_set_conn_tx_pwr_lvl_cmd_st; 724 #endif /* SUPPORT_MASTER_CONNECTION || SUPPORT_SLAVE_CONNECTION */ 725 726 #if (SUPPORT_LE_POWER_CONTROL) 727 /** 728 * @brief LE Enhanced Read Transmit Power Level command 729 */ 730 typedef struct _le_enhanced_read_tx_pwr_lvl_cmd_st{ 731 uint16_t conn_handle_id; /* Connection handle for which the current and maximum TX_Power levels are reported */ 732 uint8_t phy; /* PHY for which the current and maximum TX_Power levels are reported */ 733 }le_enhanced_read_tx_pwr_lvl_cmd_st; 734 735 /** 736 * @brief LE Read Remote Transmit Power Level command 737 */ 738 typedef struct _le_read_remote_tx_pwr_lvl_cmd_st{ 739 uint16_t conn_handle_id; /* Connection handle for which the TX_Power level used by the remote controller is reported */ 740 uint8_t phy; /* PHY for which the TX_Power level used by the remote controller is reported */ 741 }le_read_remote_tx_pwr_lvl_cmd_st; 742 743 /** 744 * @brief LE Set Path Loss Reporting Parameters command 745 */ 746 typedef struct _le_set_path_loss_reporting_params_cmd_st{ 747 uint16_t conn_handle_id; /* Connection handle for which path loss threshold reporting parameters are set */ 748 uint16_t min_time_spent; /* Minimum time in number of connection events to be observed once the path crosses the threshold before an event is generated to Host */ 749 uint8_t high_threshold; /* High threshold for the path loss (unit: dB) */ 750 uint8_t high_hysteresis; /* Hysteresis value for the high threshold (unit: dB) */ 751 uint8_t low_threshold; /* Low threshold for the path loss (unit: dB) */ 752 uint8_t low_hysteresis; /* Hysteresis value for the low threshold (unit: dB) */ 753 }le_set_path_loss_reporting_params_cmd_st; 754 755 /** 756 * @brief LE Set Path Loss Reporting Enable command 757 */ 758 typedef struct _le_set_path_loss_reporting_enable_cmd_st{ 759 uint16_t conn_handle_id; /* Connection handle for which path loss reporting to Host is enabled or disabled */ 760 uint8_t enable; /* Enable or Disabled the path loss reporting to Host. 0x00: Reporting disabled. 0x01: Reporting enabled */ 761 }le_set_path_loss_reporting_enable_cmd_st; 762 763 /** 764 * @brief LE Set Transmit Power Reporting Enable command 765 */ 766 typedef struct _le_set_tx_pwr_reporting_enable_cmd_st{ 767 uint16_t conn_handle_id; /* Connection handle for which reporting to the local Host of TX_Power level changes in the local and remote Controllers is enabled or disabled */ 768 uint8_t local_enable; /* 0x00: Disable local transmit power reports 769 0x01: Enable local transmit power reports */ 770 uint8_t remote_enable; /* 0x00: Disable remote transmit power reports 771 0x01 Enable remote transmit power reports */ 772 }le_set_tx_pwr_reporting_enable_cmd_st; 773 774 /** 775 * @brief LE Transmitter Test command [v4] 776 */ 777 typedef struct _le_tx_test_v4_cmd_st 778 { 779 uint8_t tx_channel; /* specify the RF channel to be used by the transmitter */ 780 uint8_t length_of_test_data; /* specify the length of the Payload of the test reference packets */ 781 uint8_t packet_payload; /* specify the con_le_rx_test_v3_cmd_sttents of the Payload of the test reference packets */ 782 uint8_t phy; /* specify the PHY to be used by the transmitter */ 783 uint8_t cte_length; /* specify the length of the Constant Tone Extension in the test reference packets */ 784 uint8_t cte_type; /* specify the type of the Constant Tone Extension in the test reference packets */ 785 uint8_t switching_pattern_len; /* specify the length of the antenna switching pattern used when transmitting an AoD CTE */ 786 uint8_t *ptr_antenna_ids; /* specify the antenna switching pattern used when transmitting an AoD CTE */ 787 int8_t tx_power_level; /* specify the TX_Power level to be used by the transmitter. (Unit: dBm) 788 0x7E: Set transmitter to minimum TX_Power. 789 0x7F: Set transmitter to maximum TX_Power. 790 otherwise, Set transmitter to the specified or the nearest TX_Power level. */ 791 }le_tx_test_v4_cmd_st; 792 #endif /* SUPPORT_LE_POWER_CONTROL */ 793 794 /** 795 * @brief LE Set ADV parameters 796 */ 797 typedef struct _le_set_adv_params_cmd_st { 798 uint16_t adv_intrv_min; /* Range: 0x0020 to 0x4000, Time = N * 0.625 msec, Time Range: 20 ms to 10.24 sec*/ 799 uint16_t adv_intrv_max; /* Range: 0x0020 to 0x4000, Time = N * 0.625 msec, Time Range: 20 ms to 10.24 sec*/ 800 uint8_t adv_type; /* Advertising type*/ 801 uint8_t own_addr_type; /* Address type of the source address */ 802 uint8_t peer_addr_type; /* peer address type */ 803 uint8_t peer_addr[ADDRESS_SIZE]; /* Public Device Address, Random Device Address, 804 Public Identity Address, or Random (static) 805 Identity Address of the device to be connected*/ 806 uint8_t adv_chnl_map; /* Advertising channel index used when transmitting advertising packets. */ 807 uint8_t adv_filter_policy; /* filter policy type. range 0:3 */ 808 } le_set_adv_params_cmd_st; 809 810 /** 811 * @brief LE Create Connection Command 812 */ 813 typedef struct _le_set_scn_params_cmd_st { 814 uint8_t scn_type; /* Passive 0 or active 1 scanning*/ 815 uint16_t scn_interv; /* Range: 0x0020 to 0x4000, Time = N * 0.625 msec, Time Range: 20 ms to 10.24 sec*/ 816 uint16_t scn_wndw; /* Range: 0x0020 to 0x4000, Time = N * 0.625 msec, Time Range: 20 ms to 10.24 sec*/ 817 uint8_t own_addr_type; /* Address type of the source address */ 818 uint8_t scanning_filter_policy; /**<filter policy type saved for fw purposes. range 0:3 */ 819 } le_set_scn_params_cmd_st; 820 821 /** 822 * @brief LE Set Scan Command 823 */ 824 typedef struct _le_create_conn_cmd_st { 825 uint16_t le_scan_intrv; 826 uint16_t le_scan_wndw; 827 uint8_t init_filter_policy ; 828 uint8_t peer_addr_type; 829 uint8_t peer_addr[ADDRESS_SIZE]; 830 uint8_t own_addr_type; 831 uint16_t conn_interval_min; /*Range: 0x0006 to 0x0C80, Time = N * 1.25 msec, Time Range: 7.5 msec to 4 seconds*/ 832 uint16_t conn_interval_max; /*Range: 0x0006 to 0x0C80, Time = N * 1.25 msec, Time Range: 7.5 msec to 4 seconds*/ 833 uint16_t host_slave_latency;/*Range: 0x0000 to 0x01F3*/ 834 uint16_t sv_timeout; /*Range: 0x000A to 0x0C80, Time = N * 10 msec, Time Range: 100 msec to 32 seconds*/ 835 uint16_t min_ce_length; /*Range: 0x0000 0xFFFF, Time = N * 0.625 msec.*/ 836 uint16_t max_ce_length; /*Range: 0x0000 0xFFFF, Time = N * 0.625 msec.*/ 837 } le_create_conn_cmd_st; 838 839 /** 840 * @brief LE Remote Connection Parameters REQ reply 841 */ 842 typedef struct _le_rmt_conn_param_req_rply_cmd_st { 843 uint16_t conn_interval_min; /*Range: 0x0006 to 0x0C80, Time = N * 1.25 msec, Time Range: 7.5 msec to 4 seconds*/ 844 uint16_t conn_interval_max; /*Range: 0x0006 to 0x0C80, Time = N * 1.25 msec, Time Range: 7.5 msec to 4 seconds*/ 845 uint16_t slave_latency; /*Range: 0x0000 to 0x01F3*/ 846 uint16_t sv_timeout; /*Range: 0x000A to 0x0C80, Time = N * 10 msec, Time Range: 100 msec to 32 seconds*/ 847 uint16_t min_ce_length; /*Range: 0x0000 0xFFFF, Time = N * 0.625 msec.*/ 848 uint16_t max_ce_length; /*Range: 0x0000 0xFFFF, Time = N * 0.625 msec.*/ 849 } le_rmt_conn_param_req_rply_cmd_st; 850 851 /** 852 * @brief HCI Dispatch table containing callback event functions 853 */ 854 struct hci_dispatch_tbl { 855 856 /*========================================================================================================*/ 857 /*================================================= APIs =================================================*/ 858 /*========================================================================================================*/ 859 860 /*##### Generic Events HCI Group #####*/ 861 862 /** 863 * @brief Used to notify the Host that a hardware failure has occurred in the Controller 864 * 865 * @param hw_code : [in] code values that indicate various hardware problems. 866 */ 867 void (*ll_intf_hw_error_evnt)(uint8_t hw_code); 868 869 /*##### Connection Setup HCI Group #####*/ 870 871 #if (SUPPORT_SLEEP_CLOCK_ACCURCY_UPDATES) 872 /** 873 * @brief The HCI_LE_Request_Peer_SCA_Complete event indicates that the HCI_LE_Request_Peer_SCA command has been completed. 874 * 875 * @param status : [in] whether the correct PDU is recieved by the controller. 876 * @param conn_hndl : [in] is the connection handle of the ACL connection in which the HCI_LE_Request_Peer_SCA command is issued. 877 * @param sca : [in] contains the sleep clock accuracy of the peer. 878 */ 879 void (*ll_intf_le_req_peer_sca_cpmlt_evnt)(uint8_t status, uint16_t conn_hndl, uint8_t sca); 880 #endif /* Sleep Clock Accuracy update*/ 881 882 #if (SUPPORT_CONNECTED_ISOCHRONOUS &&( SUPPORT_MASTER_CONNECTION || SUPPORT_SLAVE_CONNECTION)) 883 /** 884 * @brief The HCI_LE_CIS_Established event indicates that the CIS with the Connection_Handle is established. 885 * 886 * @param ptr_st_cis_estblshd_evnt_params : [in] pointer to ble_intf_cis_estblshd_evnt_st that carries all event parameters. 887 */ 888 void (*ll_intf_le_cis_estblshd_evnt)(ble_intf_cis_estblshd_evnt_st* ptr_st_cis_estblshd_evnt_params); 889 890 #if(SUPPORT_SLAVE_CONNECTION) 891 /** 892 * @brief The HCI_LE_CIS_Request event indicates that a Controller has received a request to establish a CIS. 893 * 894 * @param ptr_st_cis_req_evnt_params : [in] pointer to ble_intf_cis_req_evnt_st that carries all event parameters. 895 */ 896 void (*ll_intf_le_cis_req_evnt)(ble_intf_cis_req_evnt_st* ptr_st_cis_req_evnt_params); 897 #endif /* SUPPORT_SLAVE_CONNECTION */ 898 #endif /* SUPPORT_CONNECTED_ISOCHRONOUS &&( SUPPORT_MASTER_CONNECTION || SUPPORT_SLAVE_CONNECTION) */ 899 900 #if (SUPPORT_BRD_ISOCHRONOUS || SUPPORT_SYNC_ISOCHRONOUS) 901 902 #if(SUPPORT_BRD_ISOCHRONOUS) 903 /** 904 * @brief The HCI_LE_Create_BIG_Complete event indicates that the HCI_LE_Create_BIG command has completed. 905 * 906 * @param ptr_st_big_cmplt_evnt : [in] pointer to ble_intf_big_cmplt_evnt_st that carries all event parameters. 907 */ 908 void (*ll_intf_le_create_big_cmplt_evnt)(ble_intf_big_cmplt_evnt_st* ptr_st_big_cmplt_evnt); 909 910 /** 911 * @brief The HCI_LE_Terminate_BIG_Complete event indicates that the transmission of all the BISes in the BIG are terminated. 912 * 913 * @param rsn : [in] Reason for termination. 914 * @param big_hndle : [in] BIG identifier used to identify the BIG that is terminated. 915 */ 916 void (*ll_intf_le_terminate_big_cmplt_evntt)(uint8_t rsn, uint8_t big_hndle); 917 #endif /* SUPPORT_BRD_ISOCHRONOUS */ 918 919 #if(SUPPORT_SYNC_ISOCHRONOUS) 920 /** 921 * @brief The HCI_LE_BIG_Sync_Established event indicates that the HCI_LE_BIG_Create_Sync command has completed. 922 * 923 * @param ptr_st_big_sync_estblshd_evnt : [in] pointer to ble_intf_big_sync_estblshd_evnt_st that carries all event parameters. 924 */ 925 void (*ll_intf_le_big_sync_estblshd_evnt)(ble_intf_big_sync_estblshd_evnt_st* ptr_st_big_sync_estblshd_evnt); 926 927 /** 928 * @brief The HCI_LE_BIG_Sync_Lost event indicates that the Controller has either not received any PDUs on a BIG within 929 * the timeout period BIG_Sync_Timeout, or the BIG has been terminated by the remote device, or the local Host 930 * has terminated synchronization using the HCI_LE_BIG_Terminate_Sync command 931 * 932 * @param rsn : [in] Reason for termination. 933 * @param big_hndle : [in] BIG identifier used to identify the BIG that is terminated. 934 */ 935 void (*ll_intf_le_big_sync_lost_evnt)(uint8_t big_hndle, uint8_t rsn); 936 937 /** 938 * @brief The HCI_LE_BIGInfo_Advertising_Report event indicates that the Controller 939 * has received an Advertising PDU that contained a BIGInfo field. Whenever such a PDU is received 940 * and the Controller generates a corresponding HCI_LE_Periodic_Advertising_Report event, 941 * it shall generate this event immediately afterwards 942 * 943 * @param ptr_st_biginfo_rprt_event : [in] pointer to structure that contains returned report. 944 */ 945 void (*ll_intf_le_biginfo_rprt_evnt)(ble_intf_biginfo_rprt_evnt_st * ptr_st_biginfo_rprt_event); 946 #endif /* SUPPORT_SYNC_ISOCHRONOUS */ 947 #endif /* SUPPORT_BRD_ISOCHRONOUS || SUPPORT_SYNC_ISOCHRONOUS */ 948 949 #if (SUPPORT_MASTER_CONNECTION || SUPPORT_SLAVE_CONNECTION) 950 951 /** 952 * @brief Event generated when a connection is terminated. 953 * 954 * @param status : [in] indicate if the disconnection was successful or not. 955 * @param conn_handle_id : [in] connection handle of the connection which was disconnected. 956 * @param reason : [in] indicate the reason for the disconnection if the disconnection was successful. 957 */ 958 void (*ll_intf_conn_disconnect_evnt)(ble_stat_t status, 959 uint16_t conn_handle_id, uint8_t reason); 960 961 962 /** 963 * @brief Used to inform the host that a new connection has been created(if both the LE Enhanced Connection Complete event and 964 * LE Connection Complete event are unmasked, only the LE Enhanced Connection Complete event is generated is sent when 965 * a new connection has been completed). 966 * 967 * @param ptr_enhanced_conn_cmplt_evnt* : [in] Pointer to struct contains the enhanced conn complt event params. 968 * 969 * @retval None. 970 */ 971 void (*ll_intf_le_enhanced_conn_cmplt_evnt)( 972 ble_enhanced_conn_cmplt_evnt_st* ptr_enhanced_conn_cmplt_evnt); 973 974 /*===== Read Remote Version Information Complete Event =====*/ 975 /** 976 * @brief used to indicate the completion of the process obtaining the version information of the remote Controller. 977 * 978 * @param status : [in] indicate whether the Read Remote Version Information command has successfully completed. 979 * @param conn_handle_id : [in] connection handle of the connection for which the Read Remote Version Information command is applied. 980 * @param version : [in] define the specification version of the LE Controller. 981 * @param manufacturer_name : [in] indicate the manufacturer of the remote Controller. 982 * @param subversion : [in] Subversion of the LMP in the remote Controller(this value is controlled by the manufacturer and is implementation dependent). 983 */ 984 void (*ll_intf_read_remote_version_info_cmplt_evnt)(ble_stat_t status, 985 uint16_t conn_handle_id, uint8_t version, 986 uint16_t manufacturer_name, uint16_t subversion); 987 988 /** 989 * @brief used to indicate the completion of the process of the local Controller obtaining the used features of the remote device. 990 * 991 * @param status : [in] indicate whether the LE Read Remote Used Features command has successfully completed. 992 * @param conn_handle_id : [in] connection handle of the connection for which the LE Read Remote Used Features command is applied. 993 * @param le_features : [in] Bit Mask List of used LE features. 994 */ 995 void (*ll_intf_le_read_remote_used_features_cmplt_evnt)( 996 ble_stat_t status, uint16_t conn_handle_id, 997 uint8_t le_features[LE_FEATURES_BYTES_NO]); 998 999 /*##### Host Flow Control HCI Group #####*/ 1000 1001 /** 1002 * @brief used to indicate that the Controller’s data buffers have been overflowed. This can occur if the Host has sent more packets than allowed. 1003 * 1004 * @param link_type : [in] indicate whether the overflow was caused by ACL or synchronous data (in case of BLE: only ACL is used). 1005 */ 1006 void (*ll_intf_data_buffer_overflow_evnt)(uint8_t link_type); 1007 1008 /*##### Controller Flow Control HCI Group #####*/ 1009 1010 /*##### Received ACL Data #####*/ 1011 1012 /** 1013 * @brief used to send the received ACL data packets from controller to host. 1014 * 1015 * @param conn_handle_id : [in] connection handle contained in the Number of Completed Packets event to be sent to the Host. 1016 * @param *received_acl_data_packets : [in] Array of the received ACL data packet information. 1017 */ 1018 void (*ll_intf_send_data_to_host)(uint16_t conn_handle_id, 1019 ble_buff_hdr_t *received_acl_data_packet); 1020 #endif /* SUPPORT_MASTER_CONNECTION || SUPPORT_SLAVE_CONNECTION */ 1021 1022 #if ((SUPPORT_BRD_ISOCHRONOUS) || (SUPPORT_SLAVE_CONNECTION || SUPPORT_MASTER_CONNECTION)) 1023 1024 /*===== Number of Completed Packets event =====*/ 1025 /** 1026 * @brief used to send the Number of Completed Packets event to the host. 1027 * 1028 * @param conn_handle_id : [in] connection handle contained in the Number of Completed Packets event to be sent to the Host. 1029 * @param useful_pkt_transmitted : [in] Number of ACL Data Packets that have been transmitted for this connection handle. 1030 */ 1031 void (*ll_intf_transmit_receive_status_evnt)(uint8_t num_of_handles, 1032 uint16_t* conn_handle_id, uint16_t* useful_pkt_transmitted); 1033 1034 #endif /* (SUPPORT_BRD_ISOCHRONOUS) || (SUPPORT_SLAVE_CONNECTION || SUPPORT_MASTER_CONNECTION) */ 1035 /*##### Device Discovery HCI Group #####*/ 1036 1037 #if (SUPPORT_MASTER_CONNECTION || SUPPORT_EXPLCT_OBSERVER_ROLE || SUPPORT_SYNC_ISOCHRONOUS) 1038 /*===== LE Advertising Report event =====*/ 1039 /** 1040 * @brief Used to indicate to the host that a Bluetooth device or multiple Bluetooth devices have responded to an active scan or received some 1041 * information during a passive scan. 1042 * 1043 * @param ble_intf_tot_adv_report_st : This structure contains the whole report should be sent from the link layer to the host to be reported 1044 * When receiving advertising or scanning response 1045 */ 1046 void (*ll_intf_le_adv_report_evnt)( 1047 ble_intf_adv_report_data_st* le_adv_report, uint8_t num_rprts); 1048 #endif /* SUPPORT_MASTER_CONNECTION || SUPPORT_EXPLCT_OBSERVER_ROLE || SUPPORT_SYNC_ISOCHRONOUS */ 1049 1050 #if (SUPPORT_MASTER_CONNECTION || SUPPORT_EXPLCT_OBSERVER_ROLE || SUPPORT_SYNC_ISOCHRONOUS) && SUPPORT_PRIVACY 1051 /*===== LE Direct Advertising Report event =====*/ 1052 /** 1053 * @brief Used to indicate to the host that directed advertisements have been received by the controller, where the advertiser is using a resolvable private address. 1054 * 1055 * @param le_dir_adv_report : This structure contains the whole report should be sent from the link layer to the host to be reported 1056 * When receiving direct advertisement. 1057 */ 1058 void (*ll_intf_le_dir_adv_report_evnt)( 1059 ble_intf_dir_adv_report_data_st* le_dir_adv_report); 1060 #endif /* (SUPPORT_MASTER_CONNECTION || SUPPORT_EXPLCT_OBSERVER_ROLE || SUPPORT_SYNC_ISOCHRONOUS) && SUPPORT_PRIVACY */ 1061 1062 /*##### Connection State HCI Commands' Group #####*/ 1063 1064 /** 1065 * @brief indicate the completion of the process of the Link Manager obtaining the version information of the remote device associated with the Connection_Handle event parameter. 1066 * 1067 * @param status : [in] Connection_Update command status. 1068 * @param conn_handle_id : [in] Connection Handle Id to be used to identify a connection between two Bluetooth devices. 1069 * @param conn_interval : [in] Connection interval used on this connection. 1070 * @param slave_latency : [in] Slave latency for the connection in number of connection events. 1071 * @param supervsn_timeout : [in] Supervision timeout for this connection. 1072 */ 1073 #if (SUPPORT_MASTER_CONNECTION || SUPPORT_SLAVE_CONNECTION) 1074 void (*ll_intf_le_conn_update_cmplt_event)(ble_stat_t status, 1075 uint16_t conn_handle_id, uint16_t conn_interval, 1076 uint16_t slave_latency, uint16_t supervsn_timeout); 1077 #endif /* SUPPORT_MASTER_CONNECTION || SUPPORT_SLAVE_CONNECTION */ 1078 1079 #if SUPPORT_MASTER_CONNECTION || SUPPORT_SLAVE_CONNECTION 1080 /** 1081 * @brief indicate the completion of the process of the Link Manager obtaining the version information of the remote device associated with the Connection_Handle event parameter. 1082 * 1083 * @param conn_handle_id : [in] Connection Handle Id to be used to identify a connection. 1084 * @param interval_min : [in] Minimum value of the connection interval requested by the remote device. 1085 * @param interval_max : [in] Maximum value of the connection interval requested by the remote device. 1086 * @param slave_latency : [in] Maximum allowed slave latency for the connection specified as the number of connection events requested by the remote device. 1087 * @param supervsn_timeout : [in] Supervision timeout for the connection requested by the remote device. 1088 * 1089 * @retval Status (0:SUCCESS, 0xXX:ERROR_CODE). 1090 */ 1091 ble_stat_t (*ll_intf_le_remote_conn_param_req_event)( 1092 uint16_t conn_handle_id, uint16_t interval_min, 1093 uint16_t interval_max, uint16_t slave_latency, 1094 uint16_t supervsn_timeout); 1095 #endif /*SUPPORT_MASTER_CONNECTION || SUPPORT_SLAVE_CONNECTION*/ 1096 1097 /** 1098 * @brief is used to suggest maximum packet sizes to the Controller. 1099 * 1100 * @param conn_handle_id : [in] Connection Handle Id to be used to identify a connection. 1101 * @param max_tx_octets : [in] The maximum number of payload octets in a Link Layer Data Channel PDU that the local Controller will send on this connection. 1102 * @param max_tx_time : [in] The maximum time that the local Controller will take to send a Link Layer Data Channel PDU on this connection. 1103 * @param max_rx_octets : [in] The maximum number of payload octets in a Link Layer Data Channel PDU that the local controller expects to receive on this connection. 1104 * @param max_rx_time : [in] The maximum time that the local Controller expects to take to receive a Link Layer Data Channel PDU on this connection. 1105 */ 1106 void (*ll_intf_le_data_length_chg_event)(uint16_t conn_handle_id, 1107 uint16_t max_tx_octets, uint16_t max_tx_time, 1108 uint16_t max_rx_octets, uint16_t max_rx_time); 1109 1110 #if (SUPPORT_MASTER_CONNECTION || SUPPORT_SLAVE_CONNECTION) 1111 /** 1112 * @brief The LE PHY Update Complete Event command is used to request a change to the transmitter PHY and receiver PHY for a connection. 1113 * 1114 * @param subevent_code : [in] Subevent code for LE PHY Update Complete Event (0x0c). 1115 * @param status : [in] 0:SUCCESS, 0xXX:ERROR_CODE. 1116 * @param conn_handle_id : [in] Connection_Handle to be used to identify a connection.(Range:0x0000-0x0EFF) 1117 * @param tx_phys : [in] The used PHY in the Tx 1118 * @param rx_phys : [in] The used PHY in the Rx 1119 */ 1120 void (*ll_intf_le_phy_update_complete_event)(ble_stat_t status, 1121 uint16_t conn_handle_id, uint8_t tx_phy, uint8_t rx_phy); 1122 1123 #endif /* (SUPPORT_MASTER_CONNECTION || SUPPORT_SLAVE_CONNECTION) */ 1124 1125 /*##### Authentication and Encryption HCI Group #####*/ 1126 1127 #if (SUPPORT_LE_ENCRYPTION) 1128 /*================ Encryption Change Event =====================*/ 1129 /** 1130 * @brief Used to indicate that the change of the encryption mode has been completed. 1131 * 1132 * @param status : [in] indicate whether the encryption change has occurred or failed. 1133 * status = 0x00, if encryption change has occurred 1134 * status = 0x01 - 0xFF, if encryption change has failed 1135 * @param conn_handle_id : [in] Connection_Handle for which the link layer encryption has been enabled/disabled. 1136 * @param encrpt_enbld : [in] This parameter is: 1137 * 0x00 when encryption is off, and 1138 * ox01 when encryption is on. 1139 */ 1140 void (*ll_intf_encrpt_chng_evnt)(ble_stat_t status, 1141 uint16_t conn_handle_id, uint8_t encrpt_enbld); 1142 1143 /*================ Encryption Key Refresh Complete Event =====================*/ 1144 /** 1145 * @brief Used to indicate to the Host that the encryption key was refreshed on the given Connection_Handle any time encryption 1146 * is paused and then resumed 1147 * 1148 * @param status : [in] indicate whether the encryption key refresh has completed successfully or failed. 1149 * status = 0x00, if encryption key refresh has completed successfully 1150 * status = 0x01 - 0xFF, if encryption key refresh has failed 1151 * @param conn_handle_id : [in] Connection Handle for the ACL connection to have the encryption key refreshed on. 1152 */ 1153 void (*ll_intf_encrpt_key_rfrsh_cmplt_evnt)(ble_stat_t status, 1154 uint16_t conn_handle_id); 1155 1156 /*================ Authenticated Payload Timeout Expired Event =====================*/ 1157 /** 1158 * @brief Used to indicate that a packet containing a valid MIC on the Connection_Handle was not received 1159 * within the LE Authenticated Payload Timeout for the LE connection. 1160 * 1161 * @param conn_handle_id : [in] Connection_Handle of the connection where the packet with a valid MIC was not 1162 * received within the timeout. 1163 1164 */ 1165 void (*ll_intf_authn_pyld_tout_exprd_evnt)(uint16_t conn_handle_id); 1166 1167 #if SUPPORT_SLAVE_CONNECTION 1168 /*================ LE Long term Key Request Event =====================*/ 1169 /** 1170 * @brief Indicate that the master device is attempting to encrypt or re-encrypt the link and is requesting the Long 1171 * Term Key from the Host 1172 * 1173 * @param conn_handle_id : [in] Connection Handle to identify the connection handle for which the host is requesting the long term key. 1174 * @param ptr_rand_num : [in] A pointer to 64-bit random number. 1175 * @param encrptd_divrsfier : [in] 16-bit encrypted diversifier. 1176 * 1177 * @retval Status (0:SUCCESS, 0xXX:ERROR_CODE). 1178 */ 1179 ble_stat_t (*ll_intf_le_long_trm_key_rqst_evnt)(uint16_t conn_handle_id, 1180 uint8_t *ptr_rand_num, uint16_t encrpt_divrsfier); 1181 1182 #endif /* SUPPORT_SLAVE_CONNECTION */ 1183 #endif /* SUPPORT_LE_ENCRYPTION */ 1184 1185 #if (SUPPORT_LE_EXTENDED_ADVERTISING) 1186 #if (SUPPORT_EXPLCT_OBSERVER_ROLE || SUPPORT_MASTER_CONNECTION || SUPPORT_SYNC_ISOCHRONOUS) 1187 /*===== LE Extended Advertising Report Event =====*/ 1188 /** 1189 * @brief indicates that one or more Bluetooth devices have responded to an active scan or have broadcast advertisements 1190 * that were received during a passive scan. 1191 * 1192 * @param num_of_rprts : [in] Number of separate reports in the event. 1193 * @param ptr_adv_rprt : [in] pointer to the advertising reports. 1194 */ 1195 void (*ll_intf_le_extended_adv_report)(uint8_t num_of_rprts, 1196 ble_intf_extended_adv_rprt_data_st *ptr_adv_rprt); 1197 1198 /*===== LE Extended Truncated Advertising Report Event =====*/ 1199 /** 1200 * @brief indicates that one or more Bluetooth devices have responded to an active scan or have broadcast advertisements 1201 * that were received during a passive scan but are truncated. 1202 * 1203 * @param ptr_adv_rprt : [in] pointer to the truncated advertising reports. 1204 */ 1205 void (*ll_intf_le_trunc_extended_adv_report)( 1206 ble_intf_extended_adv_rprt_data_st *ptr_adv_rprt); 1207 1208 /*===== LE Scan Timeout Event =====*/ 1209 /** 1210 * @brief indicates that scanning has ended because the duration has expired. 1211 */ 1212 void (*ll_intf_le_scan_timeout)(void); 1213 #endif /* SUPPORT_EXPLCT_OBSERVER_ROLE || SUPPORT_MASTER_CONNECTION || SUPPORT_SYNC_ISOCHRONOUS*/ 1214 1215 #if (SUPPORT_EXPLCT_BROADCASTER_ROLE || SUPPORT_SLAVE_CONNECTION || SUPPORT_BRD_ISOCHRONOUS) 1216 /*===== LE Advertising Set Terminated Event =====*/ 1217 /** 1218 * @brief indicates that the Controller has terminated advertising in the advertising sets specified by theadv_hndl parameter. 1219 * 1220 * @param status : [in] 0 : Advertising successfully ended with a connection being created. 1221 * OW : Advertising ended for another reason. 1222 * @param adv_hndl : [in] Advertising_Handle in which advertising has ended. 1223 * @param conn_hndl : [in] Connection_Handle of the connection whose creation ended the advertising. 1224 * @param num_of_cmpltd_extended_events : [in] Number of completed extended advertising events transmitted by the Controller. 1225 */ 1226 void (*ll_intf_le_adv_set_terminated)(uint8_t status, uint8_t adv_hndl, 1227 uint16_t conn_hndl, uint8_t num_of_cmpltd_extended_events); 1228 1229 /*===== LE Scan Request Received Event =====*/ 1230 /** 1231 * @brief indicates that a SCAN_REQ PDU or an AUX_SCAN_REQ PDU has been received by the advertiser. 1232 * 1233 * @param adv_hndl : [in] Used to identify an advertising set. 1234 * @param scanner_addrs_type : [in] indicates the type of the address 1235 * @param ptr_scanner_addrs : [in] pointer to the scanner address. 1236 */ 1237 void (*ll_intf_le_scan_req_received)(uint8_t adv_hndl, 1238 uint8_t scanner_addrs_type, uint8_t *ptr_scanner_addrs); 1239 #endif /* SUPPORT_EXPLCT_BROADCASTER_ROLE || SUPPORT_SLAVE_CONNECTION || SUPPORT_BRD_ISOCHRONOUS */ 1240 1241 #if SUPPORT_LE_PERIODIC_ADVERTISING 1242 #if (SUPPORT_EXPLCT_OBSERVER_ROLE || SUPPORT_MASTER_CONNECTION || SUPPORT_SYNC_ISOCHRONOUS) 1243 /*===== LE Periodic Advertising Report Event =====*/ 1244 /** 1245 * @brief indicates that the Controller has received a Periodic Advertising packet 1246 * 1247 * @param sync_handle :[in] Sync_Handle identifying the periodic advertising train. 1248 * @param ptr_prdc_adv_rprt_params* :[in] ptr to struct contains the periodic adv packet to be reported. 1249 * 1250 * 1251 * @retval None. 1252 */ 1253 void (*ll_intf_le_periodic_adv_report)(uint16_t sync_handle, 1254 ble_prdc_adv_rprt_st* ptr_prdc_adv_rprt_params); 1255 1256 /*===== LE Periodic Advertising Sync Established =====*/ 1257 /** 1258 * @brief indicates that the Controller has received the first periodic advertising packet from an advertiser 1259 * after the LE_Periodic_Advertising_Create_Sync Command has been sent to the Controller. 1260 * 1261 * @param ptr_prdc_adv_sync_estblshd* : [in] ptr to struct contains the established periodic adv sync parameters. 1262 * 1263 * @retval None. 1264 */ 1265 void (*ll_intf_le_periodic_adv_sync_estblshd)( 1266 ble_prdc_adv_sync_estblshd_st* ptr_prdc_adv_sync_estblshd); 1267 1268 /*===== LE Periodic Advertising Sync Lost Event =====*/ 1269 /** 1270 * @brief indicates that the Controller has received the first periodic advertising packet from an advertiser after the LE_Periodic_Advertising_Create_Sync Command has been sent to the Controller. 1271 * 1272 * @param Sync_Handle : [in] used to identify the periodic advertiser. 1273 */ 1274 void (*ll_intf_le_periodic_adv_sync_lost)(uint16_t sync_hndl); 1275 1276 #if (SUPPORT_PERIODIC_SYNC_TRANSFER) 1277 /*===== LE Periodic Advertising Sync Transfer Received =====*/ 1278 /** 1279 * @brief used by the Controller to report that it has received periodic advertising synchronization 1280 * information from the device referred to by the Connection_Handle parameter and either successfully 1281 * synchronized to the periodic advertising events or timed out while attempting to synchronize 1282 * 1283 * @param ptr_prdc_sync_transfer_report : [in] Pointer to periodic advertising sync transfer report 1284 */ 1285 void (*ll_intf_periodic_adv_sync_transfer_recieved)( 1286 ble_intf_prdc_adv_sync_transfer_report_st * ptr_prdc_sync_transfer_report); 1287 #endif /* SUPPORT_PERIODIC_SYNC_TRANSFER */ 1288 1289 #endif /* SUPPORT_EXPLCT_OBSERVER_ROLE || SUPPORT_MASTER_CONNECTION || SUPPORT_SYNC_ISOCHRONOUS*/ 1290 #endif /* SUPPORT_LE_PERIODIC_ADVERTISING */ 1291 #endif /* SUPPORT_LE_EXTENDED_ADVERTISING */ 1292 1293 /*=======================================================================================================================*/ 1294 /*=============================================== BLE_5.0 =========================================================*/ 1295 /*=======================================================================================================================*/ 1296 1297 #if (SUPPORT_MASTER_CONNECTION || SUPPORT_SLAVE_CONNECTION) 1298 /*===================== LE Channel Selection Algorithm Event =====================*/ 1299 /** 1300 * @brief used to indicate which channel selection algorithm is used on a data channel connection. 1301 * 1302 * @param conn_handle_id : [in] connection handle of the connection for which the channel selection algorithm is determined. 1303 * @param chnl_sel_algo : [in] 0x00 means LE Channel Selection Algorithm #1 is used, and 1304 * 0x01 means LE Channel Selection Algorithm #2 is used. 1305 */ 1306 void (*ll_intf_le_chnl_sel_algo_evnt)(uint16_t conn_handle_id, 1307 uint8_t chnl_sel_algo); 1308 #endif /* (SUPPORT_MASTER_CONNECTION || SUPPORT_SLAVE_CONNECTION) */ 1309 1310 /* AOA_AOD HCI Events */ 1311 /*===================== LE Connectionless IQ Report Event =====================*/ 1312 #if (SUPPORT_AOA_AOD) 1313 #if (SUPPORT_EXPLCT_OBSERVER_ROLE || SUPPORT_MASTER_CONNECTION || SUPPORT_SYNC_ISOCHRONOUS) 1314 /** 1315 * @brief Used by the Controller to report IQ information from the CTE field of a received advertising packet containing the AUX_SYNC_IND PDU. 1316 * 1317 * @param ptr_connless_iq_rprt : [in] Pointer to the connectionless IQ report params. 1318 */ 1319 void (*ll_intf_le_connless_iq_report_evnt)(le_connless_iq_report_evnt_st *ptr_connless_iq_rprt); 1320 #endif /* SUPPORT_EXPLCT_OBSERVER_ROLE || SUPPORT_MASTER_CONNECTION || SUPPORT_SYNC_ISOCHRONOUS*/ 1321 1322 #if ((SUPPORT_MASTER_CONNECTION) || (SUPPORT_SLAVE_CONNECTION)) 1323 /*===================== LE Connection IQ Report Event =====================*/ 1324 /** 1325 * @brief Used by the Controller to report the IQ samples from the Constant Tone Extension field of a received data packet. 1326 * 1327 * @param ptr_conn_iq_rprt : [in] Pointer to the connection IQ report parameters 1328 */ 1329 void (*ll_intf_le_conn_iq_report_evnt) (ble_intf_conn_iq_report_st *ptr_conn_iq_rprt); 1330 1331 /*===================== LE CTE Request Failed Event =====================*/ 1332 /** 1333 * @brief Used by the Controller to report an issue following a request to a peer device to reply with an LL_CTE_RSP PDU containing a CTE field. 1334 * 1335 * @param cte_prcdur_status : [in] Identify whether the LL_CTE_RSP PDU was received successfully or the peer has rejected the request. 1336 * @param conn_handle_id : [in] Identifying the connection handle. 1337 */ 1338 void (*ll_intf_le_cte_req_failed_evnt) (uint16_t conn_handle_id, uint8_t cte_prcdur_status); 1339 #endif /* (SUPPORT_MASTER_CONNECTION) || (SUPPORT_SLAVE_CONNECTION) || SUPPORT_SYNC_ISOCHRONOUS*/ 1340 #endif /* SUPPORT_AOA_AOD */ 1341 1342 /*##### Custom Events HCI Group #####*/ 1343 #if (SUPPORT_SLEEP_CLOCK_ACCURCY_UPDATES && (SUPPORT_MASTER_CONNECTION || SUPPORT_SLAVE_CONNECTION)) 1344 /*=============== LE Update Sleep Clock Accuracy Complete Event ===============*/ 1345 /** 1346 * @brief notify the Host that Sleep clock accuracy update procedure completed. 1347 * 1348 * @param status : HCI_LE_Update_Sleep_Clock_Accuracy command successfully completed. 1349 * @param sca : Recommanded sleep clock accuracy. 1350 */ 1351 void (*ll_intf_le_update_slp_clk_acc_cmp_evnt) (uint8_t status , uint8_t sca); 1352 1353 #endif /* SUPPORT_SLEEP_CLOCK_ACCURCY_UPDATES && (SUPPORT_MASTER_CONNECTION || SUPPORT_SLAVE_CONNECTION)*/ 1354 1355 #if (SUPPORT_CONNECTED_ISOCHRONOUS &&( SUPPORT_MASTER_CONNECTION || SUPPORT_SLAVE_CONNECTION) || (SUPPORT_BRD_ISOCHRONOUS) || (SUPPORT_SYNC_ISOCHRONOUS)) 1356 /*=============== LE Sync Event ===============*/ 1357 /** 1358 * @brief generated after the execution of CIG or BIG is completed on hardware. 1359 * 1360 * @param ptr_sync_evnt_params : pointer to sync event paramters. 1361 */ 1362 void (*ll_intf_le_sync_evnt) (ble_intf_sync_evnt_st * ptr_sync_evnt_params); 1363 #endif /* (SUPPORT_CONNECTED_ISOCHRONOUS &&( SUPPORT_MASTER_CONNECTION || SUPPORT_SLAVE_CONNECTION) || (SUPPORT_BRD_ISOCHRONOUS) || (SUPPORT_SYNC_ISOCHRONOUS)) */ 1364 1365 #if (SUPPORT_LE_POWER_CONTROL) 1366 /* LE Power Control HCI Events */ 1367 /*===================== LE Path Loss Threshold Event =====================*/ 1368 /** 1369 * @brief Used by the Controller to report a path loss threshold crossing. 1370 * 1371 * @param ptr_path_loss_threshold_evnt : [in] Pointer to path loss threshold params. 1372 */ 1373 void (*ll_intf_le_path_loss_threshold_evnt) (le_path_loss_threshold_evnt_st *ptr_path_loss_threshold_evnt); 1374 1375 /*===================== LE Transmit Power Reporting Event =====================*/ 1376 /** 1377 * @brief Used used to report the transmit power level on the ACL connection. 1378 * 1379 * @param ptr_tx_power_report: [in] Pointer to structure containing the Tx power report params. 1380 */ 1381 void (*ll_intf_le_tx_power_reporting_evnt) (le_tx_power_report_st *ptr_tx_power_report); 1382 #endif /* SUPPORT_LE_POWER_CONTROL */ 1383 1384 #if (SUPPORT_AUGMENTED_BLE_MODE) 1385 /*=============== LE Energy Detection Complete Event ===============*/ 1386 /** 1387 * @brief generated after the execution of Energy Detection on the host provided channel Map is completed on hardware. 1388 * 1389 * @param ed_values : Array of Energy Detected Values. 1390 * @param num_of_chnl : Numer of energy detection channels. 1391 */ 1392 void (*ll_intf_le_energy_dctn_cmplt_evnt)(uint16_t* ed_values, uint8_t num_of_chnl); 1393 #endif /* SUPPORT_AUGMENTED_BLE_MODE */ 1394 1395 #if ((SUPPORT_CONNECTED_ISOCHRONOUS && (SUPPORT_MASTER_CONNECTION || SUPPORT_SLAVE_CONNECTION)) || (SUPPORT_SYNC_ISOCHRONOUS)) 1396 /** 1397 * @brief Send the ISO data from the controller to host. 1398 * 1399 * @param frst_sdu_ptr : [in] pointer to the first received sdu_buff_hdr 1400 * @param iso_conn_hndl : [in] the iso conn_handle for BIS /CIS in which the SDU is recieved 1401 * 1402 * @retval None 1403 */ 1404 void (*ll_intf_send_iso_data_from_cntrlr_to_host)(const iso_sdu_buf_hdr_p frst_sdu_ptr, const uint16_t iso_conn_hndl); 1405 #endif /* (SUPPORT_CONNECTED_ISOCHRONOUS && (SUPPORT_MASTER_CONNECTION || SUPPORT_SLAVE_CONNECTION)) || (SUPPORT_SYNC_ISOCHRONOUS) */ 1406 #if SUPPORT_LE_ENHANCED_CONN_UPDATE 1407 /** 1408 * @brief Send the subrate change event to the host. 1409 * 1410 * @param ptr_le_subrate_change_evnt : [in] pointer to struct holding the changed subrate parameters to notify the host of it. 1411 * 1412 * @retval None 1413 */ 1414 void (*ll_intf_le_subrate_change_event)(const le_subrate_change_evnt_st * ptr_le_subrate_change_evnt); 1415 #endif /* SUPPORT_LE_ENHANCED_CONN_UPDATE */ 1416 1417 #if END_OF_RADIO_ACTIVITY_REPORTING 1418 /** 1419 * @brief Send the end of radio activity event to host. 1420 * 1421 * @param curr_state : [in] the state of the current event 1422 * @param nxt_state : [in] the state of the next event 1423 * 1424 * @retval None 1425 */ 1426 void (*ll_intf_end_of_activity_evnt)(uint16_t curr_state, uint16_t nxt_state); 1427 #endif /* END_OF_RADIO_ACTIVITY_REPORTING */ 1428 1429 }; 1430 1431 #if (SUPPORT_CONNECTED_ISOCHRONOUS &&( SUPPORT_MASTER_CONNECTION || SUPPORT_SLAVE_CONNECTION)) 1432 /** 1433 * @brief ble_intf_cig_host_param_st structure is a container to CIG parameters passed from the host 1434 */ 1435 typedef struct _ble_intf_cig_host_param{ 1436 uint32_t sdu_intrv_m_to_s; /* The interval, in us, of periodic SDUs M-> S */ 1437 uint32_t sdu_intrv_s_to_m; /* The interval, in us, of periodic SDUs S->M */ 1438 uint16_t iso_interval; /* Time duration of the isochronous interval */ 1439 uint16_t max_trnsprt_ltncy_m_to_s; /* Maximum time, in ms, for an SDU to be sent from the master to slave */ 1440 uint16_t max_trnsprt_ltncy_s_to_m; /* Maximum time, in ms, for an SDU to be sent from the slave to master */ 1441 uint8_t cig_id; /* CIG Identifer */ 1442 uint8_t sca; /* The worst-case sleep clock accuracy of all the slaves */ 1443 uint8_t pack; /* the preferred method of arranging subevents of multiple CISes */ 1444 uint8_t framing; /* Framed or Unframed SDUs */ 1445 uint8_t cis_cnt; /* Total number of CISes in the CIG being added or modified */ 1446 uint8_t ft_m_to_s; /* The flush timeout in multiples of ISO_Interval for each payload sent from the master to slave */ 1447 uint8_t ft_s_to_m; /* The flush timeout in multiples of ISO_Interval for each payload sent from the slave to master */ 1448 } ble_intf_cig_host_param_st; 1449 1450 /** 1451 * @brief ble_intf_cis_host_param_st structure is a container to CIS(es) parameters passed from the host 1452 */ 1453 typedef struct _ble_intf_cis_host_param{ 1454 uint8_t cis_id; /* Maximum number of subevents in each isochronous interval of CIS*/ 1455 uint8_t max_sdu_m_to_s_least; /* max pdu size from master to slave Least OCTET*/ 1456 uint8_t max_sdu_m_to_s_most; /* max pdu size from master to slave Most OCTET */ 1457 uint8_t max_sdu_s_to_m_least; /* max pdu size from slave to master Least OCTET */ 1458 uint8_t max_sdu_s_to_m_most; /* max pdu size from slave to master Most OCTET */ 1459 uint8_t phy_m_to_s; /* The used PHY from master to slave */ 1460 uint8_t phy_s_to_m; /* The used PHY from slave to master */ 1461 uint8_t rtn_m_to_s; /* The recommendation retransmission effort from master to slave */ 1462 uint8_t rtn_s_to_m; /* The recommendation retransmission effort from slave to master */ 1463 } ble_intf_cis_host_param_st; 1464 1465 /** 1466 * @brief ble_intf_cis_host_param_test_st structure is a container to CIS(es) parameters passed from the host 1467 */ 1468 typedef struct _ble_intf_cis_host_param_test{ 1469 uint8_t cis_id; /* Maximum number of subevents in each isochronous interval of CIS*/ 1470 uint8_t nse; /* Maximum number of subevents in each isochronous interval of CIS*/ 1471 uint8_t max_sdu_m_to_s_least; /* Maximum size, in octets, of an SDU from the master Host Least OCTET */ 1472 uint8_t max_sdu_m_to_s_most; /* Maximum size, in octets, of an SDU from the master Host Most OCTET */ 1473 uint8_t max_sdu_s_to_m_least; /* Maximum size, in octets, of an SDU from the slave Host Least OCTET */ 1474 uint8_t max_sdu_s_to_m_most; /* Maximum size, in octets, of an SDU from the slave Host Most OCTET */ 1475 uint8_t max_pdu_m_to_s_least; /* max pdu size from master to slave Least OCTET */ 1476 uint8_t max_pdu_m_to_s_most; /* max pdu size from master to slave Most OCTET */ 1477 uint8_t max_pdu_s_to_m_least; /* max pdu size from slave to master Least OCTET */ 1478 uint8_t max_pdu_s_to_m_most; /* max pdu size from slave to master Most OCTET */ 1479 uint8_t phy_m_to_s; /* The used PHY from master to slave */ 1480 uint8_t phy_s_to_m; /* The used PHY from slave to master */ 1481 uint8_t bn_m_to_s; /* burst number from master to slave */ 1482 uint8_t bn_s_to_m; /* burst number from slave to master */ 1483 } ble_intf_cis_host_param_test_st; 1484 1485 /** 1486 * @brief ble_intf_set_cig_params_comman_cmd_st structure is a container to CIS(es)/CIG parameters passed from the host 1487 */ 1488 typedef struct _ble_intf_set_cig_params_common_cmd_st { 1489 1490 ble_intf_cis_host_param_st* cis_host_params; 1491 ble_intf_cis_host_param_test_st* cis_host_params_test; 1492 ble_intf_cig_host_param_st cig_host_params; 1493 uint8_t slv_cis_id; 1494 } ble_intf_set_cig_params_comman_cmd_st; 1495 1496 /** 1497 * @brief ble_intf_create_cis_cmd_st structure used to carry map between CISes and their corresponding ACL 1498 */ 1499 typedef struct _ble_intf_create_cis_cmd_hndl_st{ 1500 uint16_t cis_conn_hndl; /* CIS connection handles */ 1501 uint16_t acl_conn_hndl; /* ACL connection handles */ 1502 } ble_intf_create_cis_cmd_hndl_st; 1503 1504 /** 1505 * @brief ble_intf_create_cis_cmd_st structure used to create a CIS stream 1506 */ 1507 typedef struct _ble_intf_create_cis_cmd_st{ 1508 ble_intf_create_cis_cmd_hndl_st* create_cis_hndls; /* CIS to ACL connection handles */ 1509 uint8_t cis_cnt; /* The number of CISes to be created */ 1510 } ble_intf_create_cis_cmd_st; 1511 #endif/* SUPPORT_CONNECTED_ISOCHRONOUS &&( SUPPORT_MASTER_CONNECTION || SUPPORT_SLAVE_CONNECTION */ 1512 1513 1514 #if (SUPPORT_BRD_ISOCHRONOUS || SUPPORT_SYNC_ISOCHRONOUS) 1515 #if(SUPPORT_SYNC_ISOCHRONOUS) 1516 /** 1517 * @brief ble_intf_big_create_sync_cmd_st structure used to create a BIG SYNC 1518 */ 1519 typedef struct _ble_intf_big_create_sync_cmd_st 1520 { 1521 uint8_t *bis; /* List of indices of BISes*/ 1522 uint16_t big_sync_timeout; /* Synchronization timeout for the BIG */ 1523 uint16_t sync_hndle; /* Used to identify the periodic advertising train*/ 1524 uint8_t mse; /* the maximum number of subevents that a Controller should use to receive data payloads in each interval for a BIS */ 1525 ble_intf_big_common_sync_bc_cmd_st big_common_sync_bc; /* common parameters between the synchronizer and broadcaster */ 1526 } ble_intf_big_create_sync_cmd_st; 1527 #endif/* SUPPORT_SYNC_ISOCHRONOUS */ 1528 1529 /** 1530 * @brief ble_intf_create_big_cmd_st structure used to create a BIG 1531 */ 1532 typedef struct _ble_intf_create_big_cmd_st 1533 { 1534 uint16_t max_trnsprt_ltncy; 1535 uint8_t rtn; /* specifies the number of times every PDU should be retransmitted*/ 1536 } ble_intf_create_big_cmd_st; 1537 1538 /** 1539 * @brief ble_intf_create_big_cmd_un union governing the create BIG commands 1540 */ 1541 typedef union _ble_intf_create_big_cmd_un{ 1542 ble_intf_create_big_test_cmd_st create_big_test_cmd_st; 1543 ble_intf_create_big_cmd_st create_big_cmd_st; 1544 } ble_intf_create_big_cmd_un; 1545 1546 /** 1547 * @brief ble_intf_create_big_st Structure containing the Create BIG params 1548 */ 1549 typedef struct _ble_intf_create_big_st{ 1550 /* Common parameters of create big and create big test */ 1551 ble_intf_create_big_common_param_cmd_st create_big_common_param; 1552 /* choose between create_big and create_big_test */ 1553 ble_intf_create_big_cmd_un create_big_cmd_un; 1554 } ble_intf_create_big_st; 1555 1556 #endif/* SUPPORT_BRD_ISOCHRONOUS || SUPPORT_SYNC_ISOCHRONOUS */ 1557 1558 #if((SUPPORT_CONNECTED_ISOCHRONOUS && (SUPPORT_MASTER_CONNECTION || SUPPORT_SLAVE_CONNECTION)) || (SUPPORT_BRD_ISOCHRONOUS || SUPPORT_SYNC_ISOCHRONOUS)) 1559 /** 1560 * @brief ble_intf_read_iso_link_cmd_st is a container to the output parameters used in read_iso_link_quality cmd 1561 */ 1562 typedef struct _ble_intf_read_iso_link_cmd_st{ 1563 uint32_t crc_error_pkt_cntr; /*This counter is incremented when The Link Layer receives a packet with a CRC error.*/ 1564 uint32_t rx_unreceived_pkt_cntr; /*This counter is incremented when The Link Layer does not receive a specific payload by its flush point (on a CIS) or the end of the event it is associated with (on a BIS)*/ 1565 uint32_t tx_unacked_pkt_cntr; /*This counter is incremented when The Link Layer does not receive an acknowledgment for a CIS Data PDU that it transmitted at least once by its flush point*/ 1566 uint32_t tx_flshed_pkt_cntr; /*This counter is incremented when The Link Layer does not transmit a specific payload by its flush point.*/ 1567 uint32_t retrans_pkt_cntr; /*This counter is incremented when The Link Layer retransmits a CIS Data PDU.*/ 1568 uint32_t duplicate_pkt_cntr; /*This counter is incremented when The Link Layer receives a retransmission of a CIS Data PDU.*/ 1569 uint32_t tx_last_se_pkt_cntr; /*This counter is incremented when The Link Layer transmits a CIS Data PDU in the last subevent of a CIS event*/ 1570 } ble_intf_read_iso_link_cmd_st; 1571 1572 /** 1573 * @brief ble_intf_setup_iso_data_path is a structure containing the ISO Setup Data Path params 1574 */ 1575 typedef struct _ble_intf_setup_iso_data_path{ 1576 uint8_t* codec_config; /* Codec-specific configuration data */ 1577 uint32_t controller_delay; /* Controller delay in microseconds */ 1578 uint8_t codec_id[ISO_CODEC_ID_SIZE]; /* Octet 0 See Assigned Numbers for Coding Format 1579 * Octet 1 to 2 Company ID, see Assigned Numbers for Company Identifier. (Shall be ignored if octet 0 is not 0xFF.) 1580 * Octet 3 to 4 Vendor-defined codec ID. (Shall be ignored if octet 0 is not 0xFF.) 1581 */ 1582 uint8_t data_path_dir; /* input or output from from controller respective */ 1583 uint8_t data_path_id; /* HCI or vendor specific */ 1584 uint8_t codec_config_length; /* Length of codec configuration */ 1585 } ble_intf_setup_iso_data_path; 1586 #endif/* (SUPPORT_CONNECTED_ISOCHRONOUS || SUPPORT_BROADCAST_ISOCHRONOUS ) */ 1587 1588 /** 1589 * @brief Union containing the set parameters commands 1590 */ 1591 typedef union _hci_cmds_params_un 1592 { 1593 #if (SUPPORT_AOA_AOD) 1594 #if (SUPPORT_EXPLCT_BROADCASTER_ROLE) 1595 le_set_connless_cte_tx_params_cmd_st le_set_connless_cte_tx_params_cmd; 1596 le_set_connless_cte_tx_enable_cmd_st le_set_connless_cte_tx_enable_cmd; 1597 #endif /* (SUPPORT_EXPLCT_BROADCASTER_ROLE) */ 1598 #if (SUPPORT_EXPLCT_OBSERVER_ROLE) 1599 le_set_connless_iq_sampling_enable_cmd_st le_set_connless_iq_sampling_enable_cmd; 1600 #endif /* (SUPPORT_EXPLCT_OBSERVER_ROLE) */ 1601 #if ((SUPPORT_MASTER_CONNECTION) || (SUPPORT_SLAVE_CONNECTION)) 1602 le_set_conn_cte_rx_params_cmd_st le_set_conn_cte_rx_params_cmd; 1603 le_set_conn_cte_req_enable_cmd_st le_set_conn_cte_req_enable_cmd; 1604 le_set_conn_cte_tx_params_cmd_st le_set_conn_cte_tx_params_cmd; 1605 le_set_conn_cte_rsp_enable_cmd_st le_set_conn_cte_rsp_enable_cmd; 1606 #endif /* (SUPPORT_MASTER_CONNECTION) || (SUPPORT_SLAVE_CONNECTION) */ 1607 #endif /* SUPPORT_AOA_AOD */ 1608 #if (SUPPORT_AOA_AOD) 1609 le_rx_test_v3_cmd_st le_rx_test_v3_cmd; 1610 le_tx_test_v3_cmd_st le_tx_test_v3_cmd; 1611 #endif /* SUPPORT_AOA_AOD */ 1612 le_set_adv_params_cmd_st le_set_adv_params_cmd; 1613 le_create_conn_cmd_st le_create_conn_cmd; 1614 le_set_scn_params_cmd_st le_set_scn_params_cmd; 1615 le_rmt_conn_param_req_rply_cmd_st le_rmt_conn_param_req_rply_cmd; 1616 /* CONNECTION ISOCHRONOUS */ 1617 #if (SUPPORT_CONNECTED_ISOCHRONOUS &&( SUPPORT_MASTER_CONNECTION || SUPPORT_SLAVE_CONNECTION)) 1618 ble_intf_set_cig_params_comman_cmd_st ble_intf_set_cig_params_common_cmd; 1619 ble_intf_create_cis_cmd_st ble_intf_create_cis_cmd; 1620 // ble_intf_set_cig_params_comman_cmd_st ble_intf_set_cig_params_test_cmd; 1621 #endif /* CONNECTION ISOCHRONOUS */ 1622 /* BROADCAST ISOCHRONOUS */ 1623 #if (SUPPORT_BRD_ISOCHRONOUS || SUPPORT_SYNC_ISOCHRONOUS) 1624 /* SCANNER OBSERVER ROLE */ 1625 #if(SUPPORT_SYNC_ISOCHRONOUS) 1626 ble_intf_big_create_sync_cmd_st ble_intf_big_create_sync_cmd; 1627 #endif/* SCANNER OBSERVER ROLE */ 1628 /* ADVERTISER BC ROLE */ 1629 #if(SUPPORT_BRD_ISOCHRONOUS) 1630 ble_intf_create_big_st ble_intf_create_big_cmd; 1631 #endif/* ADVERTISER BC ROLE */ 1632 #endif/* BROADCAST ISOCHRONOUS */ 1633 #if((SUPPORT_CONNECTED_ISOCHRONOUS && (SUPPORT_MASTER_CONNECTION || SUPPORT_SLAVE_CONNECTION))|| (SUPPORT_BRD_ISOCHRONOUS || SUPPORT_SYNC_ISOCHRONOUS)) 1634 ble_intf_setup_iso_data_path ble_intf_setup_iso_data_path_cmd; 1635 #endif /* (SUPPORT_CONNECTED_ISOCHRONOUS && (SUPPORT_MASTER_CONNECTION || SUPPORT_SLAVE_CONNECTION)) */ 1636 #if (SUPPORT_LE_POWER_CONTROL) 1637 le_enhanced_read_tx_pwr_lvl_cmd_st le_enhanced_read_tx_pwr_lvl_cmd; 1638 le_read_remote_tx_pwr_lvl_cmd_st le_read_remote_tx_pwr_lvl_cmd; 1639 le_set_path_loss_reporting_params_cmd_st le_set_path_loss_reporting_params_cmd; 1640 le_set_path_loss_reporting_enable_cmd_st le_set_path_loss_reporting_enable_cmd; 1641 le_set_tx_pwr_reporting_enable_cmd_st le_set_tx_pwr_reporting_enable_cmd; 1642 le_tx_test_v4_cmd_st le_tx_test_v4_cmd; 1643 #endif /* SUPPORT_LE_POWER_CONTROL */ 1644 #if (SUPPORT_MASTER_CONNECTION || SUPPORT_SLAVE_CONNECTION) 1645 le_set_conn_tx_pwr_lvl_cmd_st le_set_conn_tx_pwr_lvl_cmd; 1646 #endif /* SUPPORT_MASTER_CONNECTION || SUPPORT_SLAVE_CONNECTION */ 1647 } hci_cmds_params_un; 1648 1649 1650 1651 1652 #if SUPPORT_LE_ENHANCED_CONN_UPDATE 1653 1654 1655 /* struct holding the default subrate values requested by master's host also used to hold the values requested by the host from le_subrate_req */ 1656 typedef struct subrate_default_params_st{ 1657 uint16_t subrate_min; /*the minimum subrate factor allowed in requests by a Peripheral Range: 0x0001 to 0x01F4*/ 1658 uint16_t subrate_max; /*the maximum subrate factor allowed in requests by a Peripheral Range: 0x0001 to 0x01F4*/ 1659 uint16_t max_latency; /*the maximum slavePeripheral latency allowed in requests by a Peripheral,in units of subrated connection intervals Range: 0x0000 to 0x01F3*/ 1660 uint16_t continuation_num;/*the minimum number of underlying connection events to remain active after a packet is sent or received in requests by a Peripheral Range: 0x0000 to 0x01F3*/ 1661 uint16_t supervisionTO; /*the maximum supervision timeout allowed in requests by a Peripheral Range: 0x000A to 0x0C80*/ 1662 }subrate_default_params_t; 1663 1664 #endif /* SUPPORT_LE_ENHANCED_CONN_UPDATE */ 1665 1666 /* Exported Definition ------------------------------------------------------*/ 1667 #if ((SUPPORT_CONNECTED_ISOCHRONOUS && (SUPPORT_MASTER_CONNECTION || SUPPORT_SLAVE_CONNECTION)) || (SUPPORT_SYNC_ISOCHRONOUS)) 1668 typedef void (*vendor_specific_from_cntrl_to_host_cbk)(const iso_sdu_buf_hdr_p, const uint16_t conn_hndl); 1669 #endif /* ((SUPPORT_CONNECTED_ISOCHRONOUS && (SUPPORT_MASTER_CONNECTION || SUPPORT_SLAVE_CONNECTION)) || (SUPPORT_SYNC_ISOCHRONOUS)) */ 1670 1671 #if SUPPORT_HCI_EVENT_ONLY 1672 typedef uint8_t (*hst_cbk)(ble_buff_hdr_t *ptr_evnt_hdr); 1673 typedef void (*hst_cbk_queue_full)(ble_buff_hdr_t *ptr_evnt_hdr); 1674 #endif /* SUPPORT_HCI_EVENT_ONLY */ 1675 1676 #if (SUPPORT_CONNECTED_ISOCHRONOUS && (SUPPORT_MASTER_CONNECTION || SUPPORT_SLAVE_CONNECTION)) 1677 /* missed cig events callback function type definition */ 1678 typedef void (*hst_cig_missed_evnt_cbk)(uint8_t cig_id, uint8_t missed_intrvs, uint32_t nxt_anchor_pnt); 1679 #endif /* (SUPPORT_CONNECTED_ISOCHRONOUS && (SUPPORT_MASTER_CONNECTION || SUPPORT_SLAVE_CONNECTION)) */ 1680 1681 #if (SUPPORT_BRD_ISOCHRONOUS || SUPPORT_SYNC_ISOCHRONOUS) 1682 /* missed big events callback function type definition */ 1683 typedef void (*hst_big_missed_evnt_cbk)(uint8_t big_hndl, uint8_t missed_intrvs, uint32_t nxt_anchor_pnt); 1684 #endif /* (SUPPORT_BRD_ISOCHRONOUS || SUPPORT_SYNC_ISOCHRONOUS) */ 1685 1686 /*##### Device Setup HCI Commands' Group #####*/ 1687 /** @ingroup device_setup 1688 * @{ 1689 */ 1690 /*========================================================================================================*/ 1691 /*======================================= ll_intf Initialization ========================================*/ 1692 /*========================================================================================================*/ 1693 /** 1694 * @brief Initializes the LL stack 1695 * 1696 * @param p_dispatch_tbl : [in] Dispatch table for HCI events 1697 * 1698 * @retval ble_stat_t : Command status to be sent to the Host. 1699 */ 1700 ble_stat_t ll_intf_init(const struct hci_dispatch_tbl* p_dispatch_tbl); 1701 1702 1703 /*========================================================================================================*/ 1704 /*============================ HCI Commands' Groups (Based on Functionality) ============================*/ 1705 /*========================================================================================================*/ 1706 1707 /** 1708 * @brief Reset the controller and the Link Layer on an LE controller . 1709 * 1710 * @retval ble_stat_t : Command status to be sent to the Host. 1711 */ 1712 ble_stat_t ll_intf_reset(void); 1713 1714 /** @} 1715 */ 1716 1717 /*##### Controller Flow Control HCI Commands' Group #####*/ 1718 /** @ingroup controller_info 1719 * @{ 1720 */ 1721 #if(SUPPORT_SLAVE_CONNECTION || SUPPORT_MASTER_CONNECTION) 1722 /** 1723 * @brief Read the maximum size of the data portion of HCI LE ACL Data Packets sent from the Host to the Controller . 1724 * 1725 * @param le_acl_data_pkt_length : [out] Max length (in octets) of the data portion of each HCI ACL Data Packet that the controller is able to accept . 1726 * @param total_num_le_acl_data_pkts : [out] Total number of HCI ACL Data Packets that can be stored in the data buffers of the controller . 1727 * 1728 * @retval ble_stat_t : Command status to be sent to the Host. 1729 */ 1730 ble_stat_t ll_intf_le_read_buffer_size(uint16_t *le_acl_data_pkt_length, 1731 uint8_t *total_num_le_acl_data_pkts); 1732 #endif /*(SUPPORT_SLAVE_CONNECTION || SUPPORT_MASTER_CONNECTION)*/ 1733 /*##### Controller Information HCI Commands' Group #####*/ 1734 1735 /** 1736 * @brief Read the values of the version information of the local controller . 1737 * 1738 * @param hci_version : [out] Defines the version information of the HCI layer . 1739 * @param hci_revision : [out] Revision of the Current HCI in the BE/EDR Controller . 1740 * @param lmp_version : [out] Version of the Current LMP or PAL in the Controller . 1741 * @param manfacturer_name : [out] Manufacturer Name of the BR/EDR Controller . 1742 * @param lmp_subversion : [out] Subversion of the Current LMP or PAL in the Controller . 1743 * 1744 * @retval ble_stat_t : Command status to be sent to the Host. 1745 */ 1746 ble_stat_t ll_intf_read_local_ver_info(uint8_t *hci_version, 1747 uint8_t *hci_revision, uint8_t *lmp_version, uint8_t *manfacturer_name, 1748 uint8_t *lmp_subversion); 1749 1750 /** 1751 * @brief Read the version information of the controller . 1752 * 1753 * @param ptr_vrsn : [out] Defines the controller version information. 1754 * @param length : [in] the length of the sent array to be written. 1755 * 1756 * @retval ble_stat_t : Command status to be sent to the Host. 1757 */ 1758 ble_stat_t ll_intf_read_cntrlr_ver_info(uint8_t *ptr_vrsn, uint8_t length); 1759 1760 /** 1761 * @brief Read the list of HCI commands supported for the local controller 1762 * (It is implied that if a command is listed as supported, the feature underlying that command is also supported) . 1763 * 1764 * @param supported_cmds : [out] A bit mask for each HCI command, where: 1765 * If the controller sets a bit to 1, then the controller supports the corresponding command and the features required for the comman, and 1766 * If the controller sets a bit to 0, then this command is unsupported or undefined command . 1767 * 1768 * @retval ble_stat_t : Command status to be sent to the Host. 1769 */ 1770 ble_stat_t ll_intf_read_local_supported_cmds(uint8_t supported_cmds[64]); 1771 1772 /** 1773 * @brief Read a list of the supported features for the local BR/EDR Controller including the LE Supported feature . 1774 * 1775 * @param lmp_features : [out] Bit Mask List of LMP features . 1776 * 1777 * @retval ble_stat_t : Command status to be sent to the Host. 1778 */ 1779 ble_stat_t ll_intf_read_local_supported_features(uint8_t lmp_features[8]); 1780 1781 /** 1782 * @brief Read the list of the supported LE features for the Controller . 1783 * 1784 * @param le_features : [out] Bit Mask List of supported LE features . 1785 * 1786 * @retval ble_stat_t : Command status to be sent to the Host. 1787 */ 1788 ble_stat_t ll_intf_le_read_local_supported_features( 1789 uint8_t le_features[LE_FEATURES_BYTES_NO]); 1790 1791 /** 1792 * @brief Read the Public Device Address of the LE controller .Reset the controller and the Link Layer on an LE controller . 1793 * 1794 * @param bd_addr : [out] Public address of the LE controller . 1795 * 1796 * @retval ble_stat_t : Command status to be sent to the Host . 1797 */ 1798 ble_stat_t ll_intf_read_bd_addr(uint8_t bd_addr[6]); 1799 1800 /*=============== Write BD_ADDR Command ===============*/ 1801 1802 /** 1803 * @brief write the Public Device Address of the LE controller . 1804 * 1805 * @param bd_addr : [in] Public address of the LE controller . 1806 * 1807 * @retval ble_stat_t : Command status to be sent to the Host . 1808 */ 1809 ble_stat_t ll_intf_write_bd_addr(uint8_t* bd_addr); 1810 1811 /** 1812 * @brief Read the states and state combinations that the link layer supports . 1813 * 1814 * @param le_states : [out] Bit Mask List of supported LE states and state combinations . 1815 * 1816 * @retval ble_stat_t : Command status to be sent to the Host. 1817 */ 1818 ble_stat_t ll_intf_le_read_supported_states(uint8_t le_states[8]); 1819 1820 #if(SUPPORT_SLAVE_CONNECTION || SUPPORT_MASTER_CONNECTION) 1821 /** 1822 * @brief Allow the Host to read the Controller maximum supported payload octets and packet duration times for transmission and reception . 1823 * 1824 * @param supported_max_tx_octets : [out] Max number of payload octets that the local Controller supports for transmission of a single LL Data Channel PDU . 1825 * @param supported_max_tx_time : [out] Max time, in microseconds, that the local Controller supports for transmission of a single LL Data Channel PDU . 1826 * @param supported_max_rx_octets : [out] Max number of payload octets that the local Controller supports for reception of a single LL Data Channel PDU . 1827 * @param supported_max_rx_time : [out] Max time, in microseconds, that the local Controller supports for reception of a single LL Data Channel PDU . 1828 * 1829 * @retval ble_stat_t : Command status to be sent to the Host. 1830 */ 1831 ble_stat_t ll_intf_le_read_max_data_length(uint8_t *supported_max_tx_octets, 1832 uint8_t *supported_max_tx_time, uint8_t *supported_max_rx_octets, 1833 uint8_t *supported_max_rx_time); 1834 #endif /* SUPPORT_SLAVE_CONNECTION || SUPPORT_MASTER_CONNECTION */ 1835 1836 /** @} 1837 */ 1838 /*##### Controller Configuration HCI Commands' Group #####*/ 1839 /** @ingroup adv_cfg 1840 * @{ 1841 */ 1842 #if(SUPPORT_EXPLCT_BROADCASTER_ROLE || SUPPORT_SLAVE_CONNECTION || SUPPORT_BRD_ISOCHRONOUS) 1843 /** 1844 * @brief Set the advertising parameters, sent by the host, in the controller. 1845 * 1846 * @param ptr_hst_adv_params : [in] Structure containing the host adv params. 1847 * 1848 * @retval ble_stat_t : Command status to be sent to the Host. 1849 */ 1850 ble_stat_t ll_intf_le_set_adv_params(le_set_adv_params_cmd_st *ptr_hst_adv_params); 1851 1852 /** 1853 * @brief Set the data used in advertising packets that have a data field. This data is sent by the Host to the Controller. 1854 * 1855 * @param adv_data_length : [in] Number of significant octets in the advertising data command parameter. 1856 * @param adv_data : [in] Advertising data sent by the host to be sent in the advertising packets. 1857 * 1858 * @retval ble_stat_t : Command status to be sent to the Host. 1859 */ 1860 ble_stat_t ll_intf_le_set_adv_data(uint8_t adv_data_length, 1861 uint8_t * adv_data); 1862 #endif /* SUPPORT_EXPLCT_BROADCASTER_ROLE || SUPPORT_SLAVE_CONNECTION || SUPPORT_BRD_ISOCHRONOUS */ 1863 1864 #if (SUPPORT_SLAVE_CONNECTION || SUPPORT_EXPLCT_BROADCASTER_ROLE) 1865 /** 1866 * @brief Set the data used in Scanning Packets that have a data field. This data is sent by the Host to the Controller. 1867 * 1868 * @param scan_rsp_data_length : [in] Number of significant octets in the scan response data command parameter. 1869 * @param scan_rsp_data : [in] Scanning response data sent by the host to be sent in the scanning packets. 1870 * 1871 * @retval ble_stat_t : Command status to be sent to the Host. 1872 */ 1873 ble_stat_t ll_intf_le_set_scan_rsp_data(uint8_t scan_rsp_data_length, 1874 uint8_t * scan_rsp_data); 1875 #endif /* SUPPORT_SLAVE_CONNECTION || SUPPORT_EXPLCT_BROADCASTER_ROLE */ 1876 1877 #if(SUPPORT_EXPLCT_BROADCASTER_ROLE || SUPPORT_SLAVE_CONNECTION || SUPPORT_BRD_ISOCHRONOUS) 1878 /** 1879 * @brief Command the controller to start or stop advertising based on the Host's request. 1880 * 1881 * @param adv_enable : [in] If 0x00, advertising is disabled. 1882 * If 0x01, advertising is enabled. 1883 * 1884 * @retval ble_stat_t : Command status to be sent to the Host. 1885 */ 1886 ble_stat_t ll_intf_le_set_adv_enable(uint8_t adv_enable); 1887 #endif /* SUPPORT_EXPLCT_BROADCASTER_ROLE || SUPPORT_SLAVE_CONNECTION || SUPPORT_BRD_ISOCHRONOUS */ 1888 1889 /** @} 1890 */ 1891 1892 /** @ingroup controller_info 1893 * @{ 1894 */ 1895 /** 1896 * @brief Set the LE Random Device Address in the Controller. This address is sent by the Host. 1897 * 1898 * @param random_addr : [in] Random Device Address sent by the Host to the Controller. 1899 * 1900 * @retval ble_stat_t : Command status to be sent to the Host. 1901 */ 1902 ble_stat_t ll_intf_le_set_random_addr(uint8_t random_addr[6]); 1903 /**@} 1904 */ 1905 1906 #if (SUPPORT_PRIVACY) 1907 /*##### Controller Configuration HCI Commands' Group #####*/ 1908 /** @ingroup privacy_cfg 1909 * @{ 1910 */ 1911 /** 1912 * @brief Set the length of time the controller uses a Resolvable Private Address before a new resolvable 1913 private address is generated and starts being used. 1914 * 1915 * @param rpa_timeout : [in] Resolvable Private Address timeout measured in seconds. 1916 * 1917 * @retval ble_stat_t : Command status to be sent to the Host. 1918 */ 1919 /**@} 1920 */ 1921 ble_stat_t ll_intf_le_set_resolvable_private_addr_timeout(uint16_t rpa_timeout); 1922 1923 #endif /* SUPPORT_PRIVACY */ 1924 1925 /*##### Device Discovery HCI Commands' Group #####*/ 1926 /** @ingroup scn_cfg 1927 * @{ 1928 */ 1929 #if(SUPPORT_MASTER_CONNECTION || SUPPORT_EXPLCT_OBSERVER_ROLE) 1930 /** 1931 * @brief Set the scan parameters, sent by the Host,in the controller. 1932 * 1933 * @param ptr_hst_scn_params : [in] Pointer to the set scan command parameters. 1934 * 1935 * @retval ble_stat_t : Command status to be sent to the Host. 1936 */ 1937 ble_stat_t ll_intf_le_set_scan_params(le_set_scn_params_cmd_st *ptr_hst_scn_params); 1938 1939 /** 1940 * @brief Command the controller to start or stop scanning based on the Host's request. 1941 * 1942 * @param scan_enable : [in] If 0x00, scanning is disabled,If 0x01, scanning is enabled. 1943 * @param filter_duplicates : [in] control whether the LL should filter out duplicate advertising reports to the Host, or if the LL should generate advertising reports for each packet received. 1944 * 1945 * @retval ble_stat_t : Command status to be sent to the Host. 1946 */ 1947 ble_stat_t ll_intf_le_set_scan_enable(uint8_t scan_enable, 1948 uint8_t filter_duplicates); 1949 /**@} 1950 */ 1951 #endif /* SUPPORT_MASTER_CONNECTION || SUPPORT_EXPLCT_OBSERVER_ROLE */ 1952 1953 /*##### Connection Setup HCI Commands' Group #####*/ 1954 /** @ingroup Conn_cfg Connection Commands 1955 * @{ 1956 */ 1957 #if(SUPPORT_MASTER_CONNECTION) 1958 /** 1959 * @brief Used to create a LL connection to a connectable advertiser. 1960 * 1961 * @param ptr_hst_init_params : [in] Pointer to the create connection command parameters. 1962 * 1963 * @retval ble_stat_t : Command status to be sent to the Host. 1964 */ 1965 ble_stat_t ll_intf_le_create_conn(le_create_conn_cmd_st *ptr_hst_init_params); 1966 1967 /** 1968 * @brief Used to cancel the "LE_Create_Connection" Command. 1969 * 1970 * @retval ble_stat_t : Command status to be sent to the Host. 1971 */ 1972 ble_stat_t ll_intf_le_create_conn_cancel(void); 1973 #endif /* SUPPORT_MASTER_CONNECTION */ 1974 1975 #if(SUPPORT_MASTER_CONNECTION || SUPPORT_SLAVE_CONNECTION) 1976 /** 1977 * @brief Used to terminate an existing connection. 1978 * 1979 * @param conn_handle_id : [in] Connection_Handle for the connection being disconnected. 1980 * @param reason : [in] indicate the reason for ending the connection. 1981 * 1982 * @retval ble_stat_t : Command status to be sent to the Host. 1983 */ 1984 ble_stat_t ll_intf_disconnect(uint16_t conn_handle_id, uint8_t reason); 1985 #endif 1986 /** @} 1987 */ 1988 /*##### Physical Links HCI Commands' Group #####*/ 1989 1990 #if SUPPORT_MASTER_CONNECTION || \ 1991 (SUPPORT_SLAVE_CONNECTION && SUPPORT_CHANNEL_CLASSIFICATION) || \ 1992 (SUPPORT_LE_EXTENDED_ADVERTISING && (SUPPORT_SLAVE_CONNECTION || SUPPORT_EXPLCT_BROADCASTER_ROLE)) 1993 /** @ingroup chnlmap_cfg Channel Map Commands 1994 * @{ 1995 */ 1996 /** 1997 * @brief Used to allow the Host to specify a channel classification for data channels based on its "local information". 1998 * 1999 * @param channel_map : [in] Bit Mask parameter to classify each LL channel index. 2000 * If a bit is set to 0, then the corresponding LL channel index is bad, and 2001 * If a bit is set to 1, then the corresponding LL channel index is unknown. 2002 * 2003 * @retval ble_stat_t : Command status to be sent to the Host. 2004 */ 2005 ble_stat_t ll_intf_le_set_host_channel_classification(uint8_t channel_map[]); 2006 /**@} 2007 */ 2008 #endif /* SUPPORT_MASTER_CONNECTION || (SUPPORT_SLAVE_CONNECTION && SUPPORT_CHANNEL_CLASSIFICATION) || (SUPPORT_EXPLCT_BROADCASTER_ROLE && SUPPORT_LE_EXTENDED_ADVERTISING) */ 2009 2010 /*##### Host Flow Control HCI Commands' Group #####*/ 2011 /** @ingroup white_list_cfg White list Commands 2012 * @{ 2013 */ 2014 /** 2015 * @brief Add a single device to the white list stored in the Controller. 2016 * 2017 * @param addr_type : [in] Address type of the device to be added to the white list of the controller. 2018 * @param addr : [in] Public Device Address or Random Device Address of the device to be added to the white list. 2019 * 2020 * @retval ble_stat_t : Command status to be sent to the Host. 2021 */ 2022 ble_stat_t ll_intf_le_add_device_white_list(uint8_t addr_type, uint8_t addr[6]); 2023 2024 /** 2025 * @brief Remove a single device from the white list stored in the Controller. 2026 * 2027 * @param addr_type : [in] Address type of the device to be added to the white list of the controller. 2028 * @param addr : [in] Public Device Address or Random Device Address of the device to be removed from the white list. 2029 * 2030 * @retval ble_stat_t : Command status to be sent to the Host. 2031 */ 2032 ble_stat_t ll_intf_le_remove_device_white_list(uint8_t addr_type, 2033 uint8_t addr[6]); 2034 2035 /** 2036 * @brief Clear the white list stored in the Controller. 2037 * 2038 * @retval ble_stat_t : Command status to be sent to the Host. 2039 */ 2040 ble_stat_t ll_intf_le_clear_white_list(void); 2041 2042 /** 2043 * @brief Read the total number of white list entries that can be stored in the Controller. 2044 * 2045 * @param white_list_size : [out] Total number of white list entries that can be stored in the Controller. 2046 * 2047 * @retval ble_stat_t : Command status to be sent to the Host. 2048 */ 2049 ble_stat_t ll_intf_le_read_white_list_size(uint8_t *white_list_size); 2050 2051 /** @} 2052 */ 2053 2054 /** @ingroup privacy_cfg 2055 * @{ 2056 */ 2057 2058 #if (SUPPORT_PRIVACY &&(SUPPORT_EXPLCT_BROADCASTER_ROLE || SUPPORT_SLAVE_CONNECTION || SUPPORT_BRD_ISOCHRONOUS)) 2059 /** 2060 * @brief Set the reasons that trigger generating RPA 2061 * bit0 : regenerate when adv data change 2062 * bit1 : regenerate when scan response data change 2063 * 2064 * @param[in] handler handler to the advertising set to assign its change_reason parameter 2065 * @param[in] chng_resns the new change_reason value bit 0 : Change the address whenever the advertising data changes bit 1 : Change the address whenever the scan response data changes 2066 * 2067 * @retval ble_stat_t : Command status to be sent to the Host. 2068 */ 2069 ble_stat_t ll_intf_le_set_data_related_address_changes_command(uint8_t handler, uint8_t chng_resns); 2070 #endif /*SUPPORT_PRIVACY &&(SUPPORT_EXPLCT_BROADCASTER_ROLE || SUPPORT_SLAVE_CONNECTION || SUPPORT_BRD_ISOCHRONOUS)*/ 2071 2072 2073 #if (SUPPORT_PRIVACY) 2074 /** 2075 * @brief Used to add one device to the list of address translations used to resolve Resolvable Private 2076 * Addresses in the Controller 2077 * 2078 * @param peer_id_addr_type : [in] Peer address type whether public or random (static). 2079 * @param peer_id_addr : [in] Public or Random (static) Identity address of the peer device. 2080 * @param peer_irk : [in] A pointer to the IRK of the peer device. 2081 * @param lcl_irk : [in] A pointer to the IRK of the local device. 2082 * 2083 * @retval ble_stat_t : Command status to be sent to the Host. 2084 */ 2085 ble_stat_t ll_intf_le_add_device_rsolv_list(uint8_t peer_id_addr_type, 2086 uint8_t peer_id_addr[ADDRESS_SIZE], uint8_t *peer_irk, uint8_t *lcl_irk); 2087 2088 /** 2089 * @brief Used to remove one device from the list of address translations used to resolve Resolvable 2090 * Private Addresses in the controller. 2091 * 2092 * @param peer_id_addr_type : [in] Address type of the device to be added to the resolving list of the controller. 2093 * @param peer_id_addr : [in] Public Device Address or Random Device Address of the device to be removed from the resolving list. 2094 * 2095 * @retval ble_stat_t : Command status to be sent to the Host. 2096 */ 2097 ble_stat_t ll_intf_le_remove_device_rsolv_list(uint8_t peer_id_addr_type, 2098 uint8_t peer_id_addr[ADDRESS_SIZE]); 2099 2100 /** 2101 * @brief used to remove all devices from the list of address translations used to resolve 2102 * Resolvable Private Addresses in the Controller. 2103 * 2104 * @retval ble_stat_t : Command status to be sent to the Host. 2105 */ 2106 ble_stat_t ll_intf_le_clear_rsolv_list(void); 2107 2108 /** 2109 * @brief Read the total number of white list entries that can be stored in the Controller. 2110 * 2111 * @param rsolv_list_size : [out] Number of address translation entries in the resolving list. 2112 * 2113 * @retval ble_stat_t : Command status to be sent to the Host. 2114 */ 2115 ble_stat_t ll_intf_le_read_rsolv_list_size(uint8_t *rsolv_list_size); 2116 2117 /** 2118 * @brief Used to get the current peer Resolvable Private Address being used for the corresponding 2119 * peer Public and Random (static) Identity Address. 2120 * 2121 * @param peer_id_addr_type : [in] Address type of the peer device to be read by the controller. 2122 * @param peer_id_addr : [in] Public Device Address or Random Device Address of the peer device to be read by the controller. 2123 * @param peer_rsolvabl_addr : [out] Peer resolvable address of the peer device. 2124 * 2125 * @retval ble_stat_t : Command status to be sent to the Host. 2126 */ 2127 ble_stat_t ll_intf_le_read_peer_rsolvabl_addr(uint8_t peer_id_addr_type, 2128 uint8_t peer_id_addr[ADDRESS_SIZE], 2129 uint8_t peer_rsolvabl_addr[ADDRESS_SIZE]); 2130 2131 /** 2132 * @brief Used to get the current local Resolvable Private Address being used for the corresponding peer Identity Address. 2133 * 2134 * @param peer_id_addr_type : [in] Address type of the peer device. 2135 * @param peer_id_addr : [in] Public Device Address or Random Device Address of the peer device. 2136 * @param lcl_rsolvabl_addr : [out] Resolvable address of the local device read by the controller. 2137 * 2138 * @retval ble_stat_t : Command status to be sent to the Host. 2139 */ 2140 ble_stat_t ll_intf_le_read_lcl_rsolvabl_addr(uint8_t peer_id_addr_type, 2141 uint8_t peer_id_addr[ADDRESS_SIZE], 2142 uint8_t lcl_rsolvabl_addr[ADDRESS_SIZE]); 2143 2144 /** 2145 * @brief Used to enable resolution of Resolvable Private Addresses in the Controller. 2146 * 2147 * @param addr_rsln_enble : [in] Parameter to enable or disable the address resolution in the controller. 2148 * 2149 * @retval ble_stat_t : Command status to be sent to the Host. 2150 */ 2151 ble_stat_t ll_intf_le_set_addr_rsln_enble(uint8_t addr_rsln_enble); 2152 2153 /* 2154 * @brief Used to set the privacy mode for a specific peer in the Controller. 2155 * 2156 * @param peer_id_addr_type : [in] Address type of the peer device. 2157 * @param peer_id_addr : [in] Public Device Address or Random Device Address of the peer device. 2158 * @param prvcy_mode : [in] Privacy Mode of this peer (Network or Device). 2159 * 2160 * @retval ble_stat_t : Command status to be sent to the Host. 2161 */ 2162 ble_stat_t ll_intf_le_set_privacy_mode(uint8_t peer_id_addr_type, 2163 uint8_t peer_id_addr[ADDRESS_SIZE], 2164 ble_prvcy_mod_e prvcy_mode); 2165 /** @} 2166 */ 2167 #endif 2168 2169 /*##### Link Information HCI Commands' Group #####*/ 2170 /*##### Connection Setup HCI Commands' Group #####*/ 2171 /** @ingroup Conn_cfg Connection Commands 2172 * @{ 2173 */ 2174 #if (SUPPORT_MASTER_CONNECTION || SUPPORT_SLAVE_CONNECTION) 2175 /** 2176 * @brief Read the value of the transmit power level of certain connection handle. 2177 * 2178 * @param conn_handle_id : [in] Specify which Connection_Handle’s Transmit Power Level setting to read. 2179 * @param type : [in] Type of the transmit power level to be read, whether current transmit power level or maximum transmit power level. 2180 * @param transmit_power_level : [out] Transmit power level value to be returned. 2181 * 2182 * @retval ble_stat_t : Command status to be sent to the Host. 2183 */ 2184 ble_stat_t ll_intf_read_transmit_power_level(uint16_t conn_handle_id, 2185 uint8_t type, int8_t *transmit_power_level); 2186 2187 /** 2188 * @brief Read the RSSI value for a ceratin connection from the controller. 2189 * 2190 * @param conn_handle_id : [in] Handle for the connection for which the RSSI is to be read. 2191 * @param rssi : [out] RSSI (Received Signal Strength Indication) value read from the controller. 2192 * 2193 * @retval ble_stat_t : Command status to be sent to the Host. 2194 */ 2195 ble_stat_t ll_intf_read_rssi(uint16_t conn_handle_id, int8_t *rssi); 2196 #endif /* SUPPORT_MASTER_CONNECTION || SUPPORT_SLAVE_CONNECTION */ 2197 /** @} 2198 */ 2199 2200 #if(SUPPORT_SLAVE_CONNECTION || SUPPORT_EXPLCT_BROADCASTER_ROLE) 2201 /** @ingroup tx_pwr_cfg Tx Power Commands 2202 * @{ 2203 */ 2204 /** 2205 * @brief Read the transmit power level used for LE advertising channel packets from the controller. 2206 * 2207 * @param transmit_power_level : [out] Transmit power level value for LE advertising channel packets read from the controller. 2208 * 2209 * @retval ble_stat_t : Command status to be sent to the Host. 2210 */ 2211 ble_stat_t ll_intf_le_read_adv_channel_tx_power(int8_t *transmit_power_level); 2212 /**@} 2213 */ 2214 #endif /* SUPPORT_SLAVE_CONNECTION || SUPPORT_EXPLCT_BROADCASTER_ROLE */ 2215 2216 #if (SUPPORT_MASTER_CONNECTION || SUPPORT_SLAVE_CONNECTION) 2217 /** @ingroup chnlmap_cfg Channel Map Commands 2218 * @{ 2219 */ 2220 /** 2221 * @brief Read the current channel map of a certain connection from the controller. 2222 * 2223 * @param conn_handle_id : [in] Connection handle for the connection for which the channel map is to be read. 2224 * @param channel_map : [out] The current channel map for the specified connection handle. 2225 * 2226 * @retval ble_stat_t : Command status to be sent to the Host. 2227 */ 2228 ble_stat_t ll_intf_le_read_channel_map(uint16_t conn_handle_id, 2229 uint8_t * channel_map); 2230 /**@} 2231 */ 2232 #endif /* SUPPORT_MASTER_CONNECTION || SUPPORT_SLAVE_CONNECTION */ 2233 2234 /*##### Authentication and Encryption HCI Commands' Group #####*/ 2235 /** @ingroup enc_cfg Authentication and Encryption Commands 2236 * @{ 2237 */ 2238 #if (SUPPORT_LE_ENCRYPTION) 2239 /** 2240 * @brief Request the controller to encrypt the data provided with the given key. 2241 * 2242 * @param ptr_key : [in] A pointer to 128 bit key for the encryption of the data. 2243 * @param ptr_plaintxt_data : [in] A pointer to 128 bit data block that is requested to be encrypted. 2244 * @param ptr_encrptd_data : [out] A pointer to the encrypted data. 2245 * 2246 * @retval ble_stat_t : Command status to be sent to the Host. 2247 */ 2248 ble_stat_t ll_intf_le_encrypt(uint8_t *ptr_key, uint8_t *ptr_plaintxt_data, 2249 uint8_t *ptr_encrptd_data); 2250 #endif /* SUPPORT_LE_ENCRYPTION */ 2251 2252 #if (SUPPORT_LE_ENCRYPTION && SUPPORT_SLAVE_CONNECTION) 2253 /** 2254 * @brief Used to reply to an LE Long Term Key Request event from the controller. 2255 * 2256 * @param conn_handle_id : [in] Connection_Handle to be used to identify the connection. 2257 * @param ptr_long_trm_key : [in] A pointer to 128 bit long term key provided by the Host. 2258 * 2259 * @retval ble_stat_t : Command status to be sent to the Host. 2260 */ 2261 ble_stat_t ll_intf_rcvd_long_trm_key(uint16_t conn_handle_id, 2262 uint8_t *ptr_long_trm_key); 2263 #endif /* (SUPPORT_LE_ENCRYPTION && SUPPORT_SLAVE_CONNECTION) */ 2264 2265 #if SUPPORT_LE_ENCRYPTION 2266 /** 2267 * @brief Request the Controller to generate 8 octets of random data to be sent to the Host. 2268 * 2269 * @param ptr_rand_data : [out] A pointer to the random number generated by the controller. 2270 * 2271 * @retval ble_stat_t : Command status to be sent to the Host. 2272 */ 2273 ble_stat_t ll_intf_le_rand_data(uint8_t *ptr_rand_data); 2274 #endif /* SUPPORT_LE_ENCRYPTION */ 2275 2276 #if (SUPPORT_LE_ENCRYPTION && SUPPORT_MASTER_CONNECTION) 2277 /** 2278 * @brief Used to authenticate the given encryption key and to encrypt the connection. 2279 * 2280 * @param conn_handle_id : [in] Connection_Handle to be used to identify the connection. 2281 * @param ptr_rand_num : [in] A pointer to 64 bit random number to be used in encryption. 2282 * @param encrptd_divrsfier : [in] A pointer to 16 bit encrypted diversifier to be used in encryption. 2283 * @param ptr_long_trm_key : [in] A pointer to 128 bit long term key to be used in encryption. 2284 * 2285 * @retval ble_stat_t : Command status to be sent to the Host. 2286 */ 2287 ble_stat_t ll_intf_le_strt_encrpt(uint16_t conn_handle_id, 2288 uint8_t *ptr_rand_num, uint16_t encrptd_divrsfier, 2289 uint8_t * ptr_long_trm_key); 2290 #endif /* SUPPORT_LE_ENCRYPTION && SUPPORT_MASTER_CONNECTION */ 2291 /** @} 2292 */ 2293 2294 /*##### DTM Commands' Group #####*/ 2295 /** @ingroup dtm_cfg DTM Commands 2296 * @{ 2297 */ 2298 /** 2299 * @brief run the LE receiver test. 2300 * 2301 * @param rx_channel : [in] rx channel value: 2302 * 2303 * @retval ble_stat_t : Command status to be sent to the Host. 2304 */ 2305 ble_stat_t ll_intf_le_receiver_test(uint8_t rx_channel); 2306 2307 /** 2308 * @brief run the LE transmitter test. 2309 * 2310 * @param tx_channel : [in] tx channel value. 2311 * @param length_of_test_data : [in] Length in bytes of payload data in each packet. 2312 * @param packet_payload : [in] Packet payload type in each packet as in (7.8.29). 2313 * 2314 * @retval ble_stat_t : Command status to be sent to the Host. 2315 */ 2316 ble_stat_t ll_intf_le_transmitter_test(uint8_t tx_channel, 2317 uint8_t length_of_test_data, uint8_t packet_payload); 2318 2319 /** 2320 * @brief end LE test. 2321 * 2322 * @param number_of_packets : Pointer to number of packets received. 2323 * 2324 * @retval ble_stat_t : Command status to be sent to the Host. 2325 */ 2326 ble_stat_t ll_intf_le_test_end(uint16_t* number_of_packets); 2327 2328 /** 2329 * @brief The LE Set PHY command is used to request a change to the transmitter PHY and receiver PHY for a connection. 2330 * 2331 * @param rx_channel : [in] Frequency Range 0x00 to 0x27 2332 * @param phy : [in] Receiver set to 1M/2M/coded PHY 2333 * @param modulation_index : [in] Modulation index type (standard/stable) 2334 * 2335 * @retval status : [out] 0:SUCCESS, 0xXX:ERROR_CODE. 2336 * 2337 */ 2338 ble_stat_t ll_intf_le_enhanced_receiver_test(uint8_t rx_channel, 2339 uint8_t phy, uint8_t modulation_index); 2340 2341 /** 2342 * @brief The LE Set PHY command is used to request a change to the transmitter PHY and receiver PHY for a connection. 2343 * 2344 * @param tx_channel : [in] Frequency Range 0x00 to 0x27 2345 * @param length_of_test_data : [in] Length in bytes of payload data in each packet 2346 * @param packet_payload : [in] Sequence 2347 * @param phy : [in] Transmitter set to 1M/2M/coded PHY 2348 * 2349 * @retval status : [out] 0:SUCCESS, 0xXX:ERROR_CODE. 2350 */ 2351 ble_stat_t ll_intf_le_enhanced_transmitter_test(uint8_t tx_channel, 2352 uint8_t length_of_test_data, uint8_t packet_payload, uint8_t phy); 2353 2354 2355 #if (SUPPORT_AOA_AOD) 2356 /*================ LE receiver Test [v3] Command =====================*/ 2357 /** 2358 * @brief Used to start a test where the DUT receives test reference packets at a fixed interval. This command includes the Constant Tone Extension feature. 2359 * 2360 * @param ptr_hci_cmd_params : [in] Pointer to the HCI command parameters. 2361 * 2362 * @retval status : [out] 0:SUCCESS, 0xXX:ERROR_CODE. 2363 * 2364 */ 2365 ble_stat_t ll_intf_le_receiver_test_v3(le_rx_test_v3_cmd_st *ptr_hci_cmd_params); 2366 2367 /*================ LE transmitter Test [v3] Command =====================*/ 2368 /** 2369 * @brief Used to start a test where the DUT generates test reference packets at a fixed interval and including the Constant Tone Extension feature. 2370 * 2371 * @param ptr_hci_cmd_params : [in] Pointer to the HCI command parameters. 2372 * 2373 * @retval status : [out] 0:SUCCESS, 0xXX:ERROR_CODE. 2374 * 2375 */ 2376 ble_stat_t ll_intf_le_transmitter_test_v3(le_tx_test_v3_cmd_st *ptr_hci_cmd_params); 2377 #endif /* SUPPORT_AOA_AOD */ 2378 2379 2380 #if SUPPORT_CHANNEL_CLASSIFICATION 2381 /** 2382 * @brief Read the current channel assessment mode of the controller 2383 * 2384 * @param ptr_assessment_mode : [out] A pointer to the channel assessment mode used by the controller 2385 * 2386 * @retval ble_stat_t : Command status to be sent to the Host. 2387 */ 2388 ble_stat_t ll_intf_read_afh_chnl_assessment_mode(uint8_t *ptr_assessment_mode); 2389 2390 /** 2391 * @brief Write channel assessment mode to be used by the controller 2392 * 2393 * @param assessment_mode : [in] channel assessment mode set by the host to be used by the controller 2394 * 2395 * @retval ble_stat_t : Command status to be sent to the Host. 2396 */ 2397 ble_stat_t ll_intf_write_afh_chnl_assessment_mode(uint8_t assessment_mode); 2398 #endif /* SUPPORT_CHANNEL_CLASSIFICATION */ 2399 2400 2401 /** @} 2402 */ 2403 2404 /** @ingroup enc_cfg Authentication and Encryption Commands 2405 * @{ 2406 */ 2407 #if (SUPPORT_LE_ENCRYPTION && (SUPPORT_SLAVE_CONNECTION || SUPPORT_MASTER_CONNECTION)) 2408 /** 2409 * @brief Write the LE Authenticated Payload Timeout for the LE connection 2410 * 2411 * @param conn_handle_id : [in] Connection_Handle to be used to identify the connection. 2412 * @param authn_pyld_tout : [in] Maximum amount of time specified between packets authenticated by a valid MIC. 2413 * 2414 * @retval ble_stat_t : Command status to be sent to the Host. 2415 */ 2416 ble_stat_t ll_intf_wrte_authn_pyld_tout(uint16_t conn_handle_id, 2417 uint16_t authn_pyld_tout); 2418 2419 /** 2420 * @brief Read the LE Authenticated Payload Timeout for the LE connection. 2421 * 2422 * @param conn_handle_id : [in] Connection_Handle to be used to identify the connection. 2423 * @param ptr_authn_pyld_tout : [out] A pointer to the authenticated payload timeout, which is the maximum amount of time 2424 * specified between packets authenticated by a MIC. 2425 * 2426 * @retval ble_stat_t : Command status to be sent to the Host. 2427 */ 2428 ble_stat_t ll_intf_read_authn_pyld_tout(uint16_t conn_handle_id, 2429 uint16_t *ptr_authn_pyld_tout); 2430 #endif /* SUPPORT_LE_ENCRYPTION && (SUPPORT_SLAVE_CONNECTION || SUPPORT_MASTER_CONNECTION) */ 2431 /** @} 2432 */ 2433 2434 /*##### Remote Information HCI Commands' Group #####*/ 2435 2436 /** @ingroup remote_info_cfg Remote Information HCI Commands 2437 * @{ 2438 */ 2439 #if(SUPPORT_MASTER_CONNECTION || SUPPORT_SLAVE_CONNECTION) 2440 /** 2441 * @brief Read the values for the version information for the remote device associated with the Connection_Handle. 2442 * 2443 * @param conn_handle_id : [in] Connection Handle Id version information to get. 2444 * 2445 * @retval ble_stat_t : Command status to be sent to the Host. 2446 */ 2447 ble_stat_t ll_intf_read_remote_version_info(uint16_t conn_handle_id); 2448 2449 /** 2450 * @brief Read the used features of a LE remote device. 2451 * 2452 * @param conn_handle_id : [in] Connection Handle Id to identify a connection. 2453 * 2454 * @retval ble_stat_t : Command status to be sent to the Host. 2455 */ 2456 ble_stat_t ll_intf_le_read_remote_used_features(uint16_t conn_handle_id); 2457 /**@} 2458 */ 2459 2460 /*##### Connection State HCI Commands' Group #####*/ 2461 /** @ingroup conn_state_cmds Connection State HCI Commands 2462 * @{ 2463 */ 2464 /** 2465 * @brief Used to change the connection parameters of an existing connection. 2466 * 2467 * @param conn_handle_id : [in] Connection Handle Id to identify a connection. 2468 * @param conn_interval_min : [in] Minimum value for the connection event interval. 2469 * @param conn_interval_max : [in] Maximum value for the connection event interval. 2470 * @param slave_latency : [in] Slave latency for the connection in number of connection events. 2471 * @param supervsn_timeout : [in] Supervision timeout for the LE Link. 2472 * @param min_ce_length : [in] Information parameter about the minimum length of connection event needed for this LE connection. 2473 * @param max_ce_length : [in] Information parameter about the maximum length of connection event needed for this LE connection. 2474 * 2475 * @retval ble_stat_t : Command status to be sent to the Host. 2476 */ 2477 ble_stat_t ll_intf_le_conn_update(uint16_t conn_handle_id, 2478 uint16_t conn_interval_min, uint16_t conn_interval_max, 2479 uint16_t slave_latency, uint16_t supervsn_timeout, 2480 uint16_t min_ce_length, uint16_t max_ce_length); 2481 2482 /** 2483 * @brief is used to accept the remote device’s request to change the connection parameters of the LE connection. 2484 * 2485 * @param conn_handle_id : [in] Connection Handle Id to be used to identify a connection. 2486 * @param ptr_new_conn_param : [in] Pointer to the new connection parameters. 2487 * 2488 * @retval ble_stat_t : Command status to be sent to the Host. 2489 */ 2490 ble_stat_t ll_intf_le_remote_conn_parm_req_reply( 2491 uint16_t conn_handle_id, 2492 le_rmt_conn_param_req_rply_cmd_st *ptr_new_conn_param); 2493 2494 /** 2495 * @brief is used to reject the remote device’s request to change the connection parameters of the LE connection. 2496 * 2497 * @param conn_handle_id : [in] Connection Handle Id to be used to identify a connection. 2498 * @param reason : [in] Reason that the connection parameter request was rejected. 2499 * 2500 * @retval ble_stat_t : Command status to be sent to the Host. 2501 */ 2502 ble_stat_t ll_intf_le_remote_conn_parm_req_neg_reply(uint16_t conn_handle_id, 2503 uint8_t reason); 2504 2505 /** 2506 * @brief is used to suggest maximum packet sizes to the Controller. 2507 * 2508 * @param conn_handle_id : [in] Connection Handle Id to be used to identify a connection. 2509 * @param tx_octets : [in] Preferred maximum number of payload octets that the local Controller should include in a single Link Layer Data Channel PDU. 2510 * @param tx_time : [in] Preferred maximum number of microseconds that the local Controller should use to transmit a single Link Layer Data Channel PDU. 2511 * 2512 * @retval ble_stat_t : Command status to be sent to the Host. 2513 */ 2514 ble_stat_t ll_intf_le_set_data_length(uint16_t conn_handle_id, 2515 uint16_t tx_octets, uint16_t tx_time); 2516 2517 /** 2518 * @brief allows the Host to read the initial MaxTxOctets and MaxTx-Time values for new connections it suggested to the Controller. 2519 * 2520 * @param sug_max_tx_octets : [out] used for new connections - connInitialMaxTxOctets. 2521 * @param sug_max_tx_time : [out] used for new connections - connInitialMaxTx-Time. 2522 * 2523 * @retval ble_stat_t : Command status to be sent to the Host. 2524 */ 2525 ble_stat_t ll_intf_le_read_sugg_default_data_length(uint16_t *sug_max_tx_octets, 2526 uint16_t *sug_max_tx_time); 2527 2528 /** 2529 * @brief allows the Host to suggest initial MaxTxOctets and MaxTxTime values for new connections. 2530 * 2531 * @param sug_max_tx_octets : [in] used for new connections - connInitialMaxTxOctets. 2532 * @param sug_max_tx_time : [in] used for new connections - connInitialMaxTx-Time. 2533 * 2534 * @retval ble_stat_t : Command status to be sent to the Host. 2535 */ 2536 ble_stat_t ll_intf_le_wrt_sugg_default_data_length(uint16_t sug_max_tx_octets, 2537 uint16_t sug_max_tx_time); 2538 2539 /** 2540 * @brief received data packets from host to controller. 2541 * 2542 * @param conn_handle_id : [in] Connection Handle ID. 2543 * @param ptr_pkt : [in] Pointer to the data sent from host. 2544 * 2545 * @retval ble_stat_t : Command status. 2546 */ 2547 ble_stat_t ll_intf_acl_data_from_host_to_cntrlr(uint16_t conn_handle_id, 2548 ble_buff_hdr_t *ptr_pkt); 2549 #endif /* SUPPORT_MASTER_CONNECTION || SUPPORT_SLAVE_CONNECTION */ 2550 /** @} 2551 */ 2552 2553 #if SUPPORT_LE_EXTENDED_ADVERTISING 2554 #if (SUPPORT_EXPLCT_BROADCASTER_ROLE || SUPPORT_SLAVE_CONNECTION || SUPPORT_BRD_ISOCHRONOUS) 2555 /** @ingroup adv_cfg 2556 * @{ 2557 */ 2558 /*================ The extended advertising =====================*/ 2559 /*================ LE Set Advertising Set Random Address Command =====================*/ 2560 /** 2561 * @brief Set Advertising Set Random Address Command, sent by the host, in the controller. 2562 * 2563 * @param adv_handle : [in] Advertising Handle used to identify an advertising set. 2564 * @param ptr_random_adv_addrs : [in] pointer to the Random Device Address, This address is used in the Controller 2565 * for the advertiser's address contained in the advertising PDUs for the 2566 * advertising set specified by the adv_handle parameter. 2567 * 2568 * @retval ble_stat_t : Command status to be sent to the Host. 2569 */ 2570 ble_stat_t ll_intf_le_set_adv_set_random_addrs(uint8_t adv_handle, 2571 uint8_t *ptr_random_adv_addrs); 2572 2573 /* ================ LE Set Extended Advertising Parameters Command =====================*/ 2574 /* 2575 * @brief Set Extended Advertising Parameters Command , used by the Host to set the advertising parameters. . 2576 * 2577 * @param adv_handle : [in] Advertising Handle used to identify an advertising set. 2578 * @param adv_properties : [in] describes the type of advertising event that is being configured and its basic properties. 2579 * @param prim_adv_intrv_min : [in] Minimum advertising interval for undirected and low duty cycle directed advertising. 2580 * @param prim_adv_intrv_max : [in] Maximum advertising interval for undirected and low duty cycle directed advertising. 2581 * @param prim_adv_chnl_map : [in] indicates the advertising channels that shall be used when transmitting advertising packets.. 2582 * @param own_addrs_type : [in] specifies the type of address being used in the advertising packets. 2583 * @param peer_addrs_type : [in] specifies the type of the peer address being used in the advertising packets. 2584 * @param ptr_peer_addrs : [in] pointer to the Peer Device Address, This address is used in the Controller 2585 * for the advertiser's address contained in the advertising PDUs for the 2586 * advertising set specified by the adv_handle parameter. 2587 * @param adv_filter_policy : [in] Advertising Filter Policy to be used for the advertising set specified by the adv_handle parameter. 2588 * @param prim_adv_phy : [in] indicates the PHY on which the 2589 advertising packets are transmitted on the primary advertising channel. 2590 * @param sec_adv_max_skip : [in] the maximum number of advertising events that can be skipped before the AUX_ADV_IND can be sent. 2591 * @param sec_adv_phy : [in] indicates the PHY on which the advertising packets are be transmitted on the 2592 * secondary advertising channel. 2593 * @param adv_sid : [in] specifies the value to be transmitted in the Advertising SID subfield of the ADI field of the 2594 * Extended Header of those advertising channel PDUs that have an ADI field.. 2595 * @param scan_req_notfy : [in] indicates whether the Controller shall send notifications upon the receipt of a scan request PDU that 2596 * is in response to an advertisement from the specified advertising set that contains its device address and is 2597 * from a scanner that is allowed by the advertising filter policy. 2598 * @param *selected_tx_pwr : [out] pointer to the selected TX power value to be set by link layer. 2599 * 2600 * @retval ble_stat_t : Command status to be sent to the Host. 2601 */ 2602 ble_stat_t ll_intf_le_set_extended_adv_params(uint8_t adv_handle, 2603 uint16_t adv_properties, uint32_t prim_adv_intrv_min, 2604 uint32_t prim_adv_intrv_max, uint8_t prim_adv_chnl_map, 2605 uint8_t own_addrs_type, uint8_t peer_addrs_type, 2606 uint8_t *ptr_peer_addrs, uint8_t adv_filter_policy, int8_t adv_tx_power, 2607 uint8_t prim_adv_phy, uint8_t sec_adv_max_skip, uint8_t sec_adv_phy, 2608 uint8_t adv_sid, uint8_t scan_req_notfy, 2609 int8_t *selected_tx_pwr); 2610 2611 /*================ LE Set Extended Advertising Data Command =====================*/ 2612 /** 2613 * @brief Set Extended Advertising Data Command , used by the Host to set the advertising data. . 2614 * 2615 * @param adv_handle : [in] Advertising Handle used to identify an advertising set. 2616 * @param adv_data_operation : [in] indicates if the data is intermediate fragment, first fragment , last fragment, or 2617 * Complete extended advertising data, or unchanged data(just update the DID). 2618 * @param fragmnt_preference : [in] provides a hint to the Controller as to whether advertising data should be fragmented. 2619 * @param adv_data_length : [in] The number of octets in the Advertising Data parameter. 2620 * @param ptr_adv_data : [in] pointer Advertising data formatted as defined in [Vol 3] Part C, Section 11 of the standard. 2621 * 2622 * @retval ble_stat_t : Command status to be sent to the Host. 2623 */ 2624 ble_stat_t ll_intf_le_set_extended_adv_data(uint8_t adv_handle, 2625 uint8_t adv_data_operation, uint8_t fragmnt_preference, 2626 uint8_t adv_data_length, uint8_t *ptr_adv_data); 2627 2628 /*================ LE Set Extended Scan Response Data Command =====================*/ 2629 /** 2630 * @brief Set Extended Scan Response Data Command , used by the Host to set the Scan Responsedata. . 2631 * 2632 * @param adv_handle : [in] Advertising Handle used to identify an advertising set. 2633 * @param scn_rsp_data_operation : [in] indicates if the data is intermediate fragment, first fragment , last fragment, or 2634 * Complete extended scan response data, or unchanged data(just update the DID). 2635 * @param fragmnt_preference : [in] provides a hint to the Controller as to whether scan response data should be fragmented. 2636 * @param scn_rsp_data_length : [in] The number of octets in the scan response Data parameter. 2637 * @param ptr_scn_rsp_data : [in] pointer scan response data formatted as defined in [Vol 3] Part C, Section 11 of the standard. 2638 * 2639 * @retval ble_stat_t : Command status to be sent to the Host. 2640 */ 2641 ble_stat_t ll_intf_le_set_extended_scn_rsp_data(uint8_t adv_handle, 2642 uint8_t scn_rsp_data_operation, uint8_t fragmnt_preference, 2643 uint8_t scn_rsp_data_length, uint8_t *ptr_scn_rsp_data); 2644 2645 /*================ LE Set Extended Advertising Enable Command =====================*/ 2646 /** 2647 * @brief Set Extended Advertising Enable is used to request the 2648 * Controller to enable or disable one or more advertising sets using the 2649 * advertising sets identified by the Advertising handles . 2650 * 2651 * @param adv_enbl : [in] For disable the advertising set it to zero , for enable set it to one . 2652 * @param num_of_sets : [in] the number of advertising sets contained in the parameter arrays. 2653 * @param ptr_ext_adv_enable_params : [in] Pointer represents array of advertising enable structure. 2654 * 2655 * @retval ble_stat_t : Command status to be sent to the Host. 2656 */ 2657 ble_stat_t ll_intf_le_set_extended_adv_enable(uint8_t adv_enbl, 2658 uint8_t num_of_sets, 2659 st_ble_intf_ext_adv_enable_params* ptr_ext_adv_enable_params); 2660 2661 /*================ LE Read Maximum Advertising Data Length Command =====================*/ 2662 /** 2663 * @brief is used to read the maximum length of data supported by the Controller for use as 2664 * advertisement data or scan response data in an advertising event or as periodic advertisement data. 2665 * 2666 * @param ptr_max_adv_data_len : [out] pointer to the maximum length of advertisement data or scan response data. 2667 * 2668 * @retval ble_stat_t : Command status to be sent to the Host. 2669 */ 2670 ble_stat_t ll_intf_le_read_max_adv_data_len(uint16_t *ptr_max_adv_data_len); 2671 2672 /*================ LE Read Maximum Advertising Data Length Command =====================*/ 2673 /** 2674 * @brief is used to read the maximum number of advertising sets supported by the advertising Controller at the same time. 2675 * 2676 * @param ptr_max_num_of_adv_sets : [out] pointer to the maximum number of advertising sets supported by the advertising 2677 * Controller at the same time. 2678 * 2679 * @retval ble_stat_t : Command status to be sent to the Host. 2680 */ 2681 ble_stat_t ll_intf_le_read_max_num_of_adv_sets(uint8_t *ptr_max_num_of_adv_sets); 2682 2683 /*================ LE Remove Advertising Set Command =====================*/ 2684 /** 2685 * @brief is used to remove an advertising set from the Controller. 2686 * 2687 * @param adv_hndl : [in] Used to identify an advertising set. 2688 * 2689 * @retval ble_stat_t : Command status to be sent to the Host. 2690 */ 2691 ble_stat_t ll_intf_le_rmv_adv_set(uint8_t adv_hndl); 2692 2693 /*================ LE Clear Advertising Sets Command =====================*/ 2694 /** 2695 * @brief is used to remove all existing advertising sets from the Controller. 2696 * 2697 * @retval ble_stat_t : Command status to be sent to the Host. 2698 */ 2699 ble_stat_t ll_intf_le_clear_adv_sets(void); 2700 2701 #if SUPPORT_LE_PERIODIC_ADVERTISING 2702 /** 2703 * @brief Set periodic advertising parameters. 2704 * 2705 * @param advertising_handle : [in] Advertising handle referring to an advertising instant. 2706 * @param periodic_advertising_interval_min : [in] Minimum value for periodic advertising interval. 2707 * @param periodic_advertising_interval_max : [in] Maximum value for periodic advertising interval. 2708 * @param periodic_advertising_properties : [in] Indicates which fields should be included in the advertising packet. 2709 * 2710 * @retval ble_stat_t : Command status. 2711 */ 2712 ble_stat_t ll_intf_le_set_periodic_adv_params(uint8_t advertising_handle , ble_set_prdc_adv_param_st* ptr_prdc_adv_params); 2713 /** 2714 * @brief Set periodic advertising data. 2715 * 2716 * @param advertising_handle : [in] Advertising handle referring to an advertising instant. 2717 * @param operation : [in] Information for Host fragmentation. 2718 * @param advertising_data_length : [in] Length of Host advertising data. 2719 * @param ptr_periodic_adv_data : [in] Pointer to Host advertising data. 2720 * 2721 * @retval ble_stat_t : Command status. 2722 */ 2723 ble_stat_t ll_intf_le_set_periodic_adv_data(uint8_t advertising_handle, 2724 uint8_t operation, uint8_t advertising_data_length, 2725 uint8_t *ptr_periodic_adv_data); 2726 2727 /** 2728 * @brief Enable/Disable periodic advertising. 2729 * 2730 * @param enable : [in] Enable/Disable advertising. 2731 * @param advertising_handle : [in] Advertising handle referring to an advertising instant. 2732 * 2733 * @retval ble_stat_t : Command status. 2734 */ 2735 ble_stat_t ll_intf_le_set_periodic_adv_enable(uint8_t enable, 2736 uint8_t advertising_handle); 2737 #endif /* SUPPORT_LE_PERIODIC_ADVERTISING */ 2738 #endif /* (SUPPORT_EXPLCT_BROADCASTER_ROLE || SUPPORT_SLAVE_CONNECTION || SUPPORT_BRD_ISOCHRONOUS) */ 2739 /**@} 2740 */ 2741 2742 /** @ingroup scn_cfg 2743 * @{ 2744 */ 2745 #if (SUPPORT_MASTER_CONNECTION || SUPPORT_EXPLCT_OBSERVER_ROLE) 2746 /** 2747 * @brief Set extended scanning parameters. 2748 * 2749 * @param own_address_type : [in] Own (scanner) address type. 2750 * @param scanning_filter_policy : [in] Filter policy used in scanning state. 2751 * @param scanning_phys : [in] PHY(s) on which the advertising packets should be received on the primary advertising channel. 2752 * @param ptr_ext_scn_params : [in] Pointer represents extended scanning parameters each PHY. 2753 * 2754 * @retval ble_stat_t : Command status. 2755 */ 2756 ble_stat_t ll_intf_le_set_extended_scan_params(uint8_t own_address_type, 2757 uint8_t scanning_filter_policy, uint8_t scanning_phys, 2758 st_ble_intf_ext_scn_params* ptr_ext_scn_params); 2759 2760 /** 2761 * @brief Enable/Disable extended scanning. 2762 * 2763 * @param scan_enable : [in] Scanning enable/disable flag. 2764 * @param filter_duplicates : [in] Filter out duplicate advertising reports flag. 2765 * @param durtion : [in] Scanning duration. 2766 * @param period : [in] scanning period. 2767 * 2768 * @retval ble_stat_t : Command status. 2769 */ 2770 ble_stat_t ll_intf_le_set_extended_scan_enable(uint8_t scan_enable, 2771 uint8_t filter_duplicates, uint16_t durtion, uint16_t period); 2772 #endif /* (SUPPORT_MASTER_CONNECTION || SUPPORT_EXPLCT_OBSERVER_ROLE) */ 2773 /**@} 2774 */ 2775 2776 /** @ingroup Conn_cfg Connection Commands 2777 * @{ 2778 */ 2779 #if (SUPPORT_MASTER_CONNECTION) 2780 /** 2781 * @brief Start initiating to create a connection. 2782 * 2783 * @param initiator_filter_policy : [in] Scanning enable/disable flag. 2784 * @param own_addr_type : [in] Filter policy used in initiating state. 2785 * @param peer_addr_type : [in] Peer address type. 2786 * @param ptr_peer_address : [in] Pionter to peer address. 2787 * @param initiating_phys : [in] PHY(s) on which the advertising packets should be received on the primary advertising channel.. 2788 * @param ptr_ext_create_conn : [in] Pointer represents extended create connection structure. 2789 * 2790 * @retval ble_stat_t : Command status. 2791 */ 2792 ble_stat_t ll_intf_le_extended_create_conn(ble_intf_ext_create_conn_cmd_st* ptr_ext_create_conn_params); 2793 #endif /* (SUPPORT_MASTER_CONNECTION) */ 2794 /**@} 2795 */ 2796 2797 #if (SUPPORT_MASTER_CONNECTION || SUPPORT_EXPLCT_OBSERVER_ROLE) && SUPPORT_LE_PERIODIC_ADVERTISING 2798 /** @ingroup prdc_sync_cmds Periodic Synchronization Commands 2799 * @{ 2800 */ 2801 /** 2802 * @brief Set periodic advertising create sync. 2803 * 2804 * @param options : [in] Determine whether the Periodic Advertiser List is used. 2805 * @param advertising_sid : [in] Advertiser set ID. 2806 * @param advertising_address_type : [in] Advertiser address type. 2807 * @param ptr_advertiser_address : [in] Pointer to advertiser address. 2808 * @param skip : [in] Number of consecutive periodic advertising packets that the receiver may skip after successfully receiving a periodic advertising packet. 2809 * @param sync_timeout : [in] Maximum permitted time between successful receives. 2810 * @param cte_type : [in] Specifies whether to only sync to periodic advertising with certain types of Constant Tone Extension. 2811 * 2812 * @retval ble_stat_t : Command status. 2813 */ 2814 ble_stat_t ll_intf_le_set_periodic_adv_create_sync(uint8_t options, 2815 uint8_t advertising_sid, uint8_t advertising_address_type, 2816 uint8_t *ptr_advertiser_address, uint16_t skip, uint16_t sync_timeout,uint8_t cte_type); 2817 2818 /** 2819 * @brief Cancel periodic advertising create sync cancel. 2820 * 2821 * @retval ble_stat_t : Command status. 2822 */ 2823 ble_stat_t ll_intf_le_set_periodic_adv_create_sync_cancel(void); 2824 2825 /** 2826 * @brief Cancel periodic advertising terminate sync. 2827 * 2828 * @param sync_handle : Used to identify the periodic advertiser. 2829 * 2830 * @retval ble_stat_t : Command status. 2831 */ 2832 ble_stat_t ll_intf_le_set_periodic_adv_terminate_sync(uint16_t sync_handle); 2833 /**@} 2834 */ 2835 2836 /** @ingroup prdc_list_cfg Periodic list Commands 2837 * @{ 2838 */ 2839 /** 2840 * @brief Add device to periodic advertiser list. 2841 * 2842 * @param advertiser_address_type : [in] Advertiser address type. 2843 * @param ptr_advertiser_address : [in] Pointer to advertiser address. 2844 * @param advertising_sid : [in] Advertiser set ID. 2845 * 2846 * @retval ble_stat_t : Command status. 2847 */ 2848 ble_stat_t ll_intf_le_add_dev_to_periodic_adv_lst( 2849 uint8_t advertiser_address_type, uint8_t* ptr_advertiser_address, 2850 uint8_t advertising_sid); 2851 2852 /** 2853 * @brief Remove device from periodic advertiser list. 2854 * 2855 * @param advertiser_address_type : [in] Advertiser address type. 2856 * @param ptr_advertiser_address : [in] Pointer to advertiser address. 2857 * @param advertising_sid : [in] Advertiser set ID. 2858 * 2859 * @retval ble_stat_t : Command status. 2860 */ 2861 ble_stat_t ll_intf_le_rmv_dev_from_periodic_adv_lst( 2862 uint8_t advertiser_address_type, uint8_t* ptr_advertiser_address, 2863 uint8_t advertising_sid); 2864 2865 /** 2866 * @brief Clear periodic advertiser list. 2867 * 2868 * @retval ble_stat_t : Command status. 2869 */ 2870 ble_stat_t ll_intf_le_clr_periodic_adv_lst(void); 2871 2872 /** 2873 * @brief Read periodic advertiser list size. 2874 * 2875 * @param ptr_periodic_advertiser_list_size : [out] Pointer to advertiser list size. 2876 * 2877 * @retval ble_stat_t : Command status. 2878 */ 2879 ble_stat_t ll_intf_le_read_periodic_adv_lst_size( 2880 uint8_t* ptr_periodic_advertiser_list_size); 2881 /**@} 2882 */ 2883 #endif /* (SUPPORT_MASTER_CONNECTION || SUPPORT_EXPLCT_OBSERVER_ROLE) && SUPPORT_LE_PERIODIC_ADVERTISING*/ 2884 #endif /*SUPPORT_LE_EXTENDED_ADVERTISING*/ 2885 2886 /** @ingroup tx_pwr_cfg Tx Power Commands 2887 * @{ 2888 */ 2889 /** 2890 * @brief Used to read the minimum and maximum transmit powers supported by the Controller. 2891 * 2892 * @param ptr_min_tx_pwr : [out] A pointer to the min TX power value to be set by the controller [Range: -127 dB to 20 dB] 2893 * @param ptr_max_tx_pwr : [out] A pointer to the max TX power compensation value to be set by the controller [Range: -127 dB to 20.0 dB] 2894 * 2895 * @retval ble_stat_t : Command status. 2896 */ 2897 ble_stat_t ll_intf_le_read_tx_pwr( 2898 int8_t *ptr_min_tx_pwr, int8_t* ptr_max_tx_pwr); 2899 2900 /** 2901 * @brief Used to read the RF Path Compensation Values parameter used in the Tx Power Level and RSSI calculation. 2902 * 2903 * @param ptr_rf_tx_path_compnstn : [out] A pointer to the RF TX path compensation value to be set by the controller [Range: -128.0 dB (0xFB00) -> 128.0 dB (0x0500)] 2904 * @param ptr_rf_rx_path_compnstn : [out] A pointer to the RF RX path compensation value to be set by the controller [Range: -128.0 dB (0xFB00) -> 128.0 dB (0x0500)] 2905 * 2906 * @retval ble_stat_t : Command status. 2907 */ 2908 ble_stat_t ll_intf_le_read_rf_path_compensation( 2909 int16_t *ptr_rf_tx_path_compnstn, int16_t* ptr_rf_rx_path_compnstn); 2910 2911 /** 2912 * @brief Used to indicate the RF path gain or loss between the RF transceiver and the antenna contributed by intermediate components. 2913 * 2914 * @param ptr_rf_tx_path_compnstn : [in] RF TX path compensation value sent by host [Range: -128.0 dB (0xFB00) -> 128.0 dB (0x0500)] 2915 * @param ptr_rf_rx_path_compnstn : [in] RF RX path compensation value sent by host [Range: -128.0 dB (0xFB00) -> 128.0 dB (0x0500)] 2916 * 2917 * @retval ble_stat_t : Command status. 2918 */ 2919 ble_stat_t ll_intf_le_write_rf_path_compensation( 2920 int16_t ptr_rf_tx_path_compnstn, int16_t ptr_rf_rx_path_compnstn); 2921 /**@} 2922 */ 2923 2924 /** @ingroup connless_cte_cfg Connectionless CTE Commands 2925 * @{ 2926 */ 2927 /*================ AoA / AoD =====================*/ 2928 /*================ LE Set Connectionless CTE Transmit Parameters Command =====================*/ 2929 /** 2930 * @brief Used to set the type, length, and antenna switching pattern for the transmission of the Constant Tone Extension field 2931 * in any periodic advertising on the advertising set identified by the Advertising_Handle parameter. 2932 * 2933 * @param ptr_hci_cmd_params : [in] Pointer to the HCI command parameters. 2934 * 2935 * @retval ble_stat_t : Command status. 2936 */ 2937 #if (SUPPORT_AOA_AOD) 2938 #if (SUPPORT_EXPLCT_BROADCASTER_ROLE && SUPPORT_LE_PERIODIC_ADVERTISING) 2939 ble_stat_t ll_intf_le_set_connectionless_cte_tx_params(le_set_connless_cte_tx_params_cmd_st *ptr_hci_cmd_params); 2940 2941 /*================ LE Set Connectionless CTE Transmit Enable Command =====================*/ 2942 /** 2943 * @brief Used to request that the Controller enables or disables the use of Constant Tone Extensions in any periodic 2944 * advertising on the advertising set identified by Advertising_Handle. 2945 * 2946 * @param ptr_hci_cmd_params : [in] Pointer to the HCI command parameters. 2947 * 2948 * @retval ble_stat_t : Command status. 2949 */ 2950 ble_stat_t ll_intf_le_set_connless_cte_tx_enable(le_set_connless_cte_tx_enable_cmd_st *ptr_hci_cmd_params); 2951 #endif /* (SUPPORT_EXPLCT_BROADCASTER_ROLE && SUPPORT_LE_PERIODIC_ADVERTISING) */ 2952 2953 #if (SUPPORT_EXPLCT_OBSERVER_ROLE) 2954 /*================ LE Set Connectionless IQ Sampling Enable Command =====================*/ 2955 /** 2956 * @brief Used to request that the Controller enables or disables capturing IQ samples from 2957 * the Constant Tone Extension field of periodic advertising packets identified by the 2958 * Sync_Handle parameter. 2959 * 2960 * @param ptr_hci_cmd_params : [in] Pointer to the HCI command parameters. 2961 * 2962 * @retval ble_stat_t : Command status. 2963 */ 2964 ble_stat_t ll_intf_le_set_connless_iq_sampling_enable(le_set_connless_iq_sampling_enable_cmd_st *ptr_hci_cmd_params); 2965 #endif /* (SUPPORT_EXPLCT_OBSERVER_ROLE) */ 2966 /**@} 2967 */ 2968 2969 /** @ingroup conn_cte_cfg Connection CTE Commands 2970 * @{ 2971 */ 2972 /*================ LE Set Connection CTE Receive Parameters Command =====================*/ 2973 /** 2974 * @brief Used to set the antenna switching pattern and switching and sampling slot durations for 2975 * receiving the CTE field during connection. 2976 * 2977 * @param ptr_hci_cmd_params : [in] Pointer to the HCI command parameters. 2978 * 2979 * @retval ble_stat_t : Command status. 2980 */ 2981 #if ((SUPPORT_MASTER_CONNECTION) || (SUPPORT_SLAVE_CONNECTION)) 2982 ble_stat_t ll_intf_le_set_conn_cte_rx_params(le_set_conn_cte_rx_params_cmd_st *ptr_hci_cmd_params); 2983 2984 /*================ LE Set Connection CTE Transmit Parameters Command =====================*/ 2985 /** 2986 * @brief Used to set the antenna switching pattern and permitted CTE types used for transmitting the CTE field requested by the peer 2987 * evice during connection. 2988 * 2989 * @param ptr_hci_cmd_params : [in] Pointer to the HCI command parameters. 2990 * 2991 * @retval ble_stat_t : Command status. 2992 */ 2993 ble_stat_t ll_intf_le_set_conn_cte_tx_params(le_set_conn_cte_tx_params_cmd_st *ptr_hci_cmd_params); 2994 2995 /*================ LE Connection CTE Request Enable Command =====================*/ 2996 /** 2997 * @brief Used to request the Controller to start or stop sending one or more LL_CTE_REQ PDU(s) on a 2998 * connection identified by the Connection_Handle parameter. 2999 * 3000 * @param ptr_hci_cmd_params : [in] Pointer to the HCI command parameters. 3001 * 3002 * @retval ble_stat_t : Command status. 3003 */ 3004 ble_stat_t ll_intf_le_set_conn_cte_req_enable(le_set_conn_cte_req_enable_cmd_st *ptr_hci_cmd_params); 3005 3006 /*================ LE Connection CTE Response Enable Command =====================*/ 3007 /** 3008 * @brief Used to request the Controller to respond to LL_CTE_REQ PDUs with LL_CTE_RSP PDUs on the specified connection. 3009 * 3010 * @param ptr_hci_cmd_params : [in] Pointer to the HCI command parameters. 3011 * 3012 * @retval ble_stat_t : Command status. 3013 */ 3014 ble_stat_t ll_intf_le_set_conn_cte_rsp_enable(le_set_conn_cte_rsp_enable_cmd_st *ptr_hci_cmd_params); 3015 3016 #endif /* (SUPPORT_MASTER_CONNECTION) || (SUPPORT_SLAVE_CONNECTION) */ 3017 /**@} 3018 */ 3019 3020 /** @ingroup antenna_cfg Antenna Commands 3021 * @{ 3022 */ 3023 /*================ LE Read Antenna Information Command =====================*/ 3024 /** 3025 * @brief Allow the Host to read the switching rates, the sampling rates, the number of antennae, and the maximum 3026 * length of the Constant Tone Extension supported by the Controller. 3027 * 3028 * @param ptr_supprtd_switching_sampling_rates : [out] Antenna Switching and IQ Sampling rates supported by the controller. 3029 * @param ptr_antenna_num : [out] The number of antennae supported by the Controller. 3030 * @param ptr_switching_pattern_max_len : [out] Maximum length of antenna switching pattern supported by the Controller. 3031 * @param ptr_cte_max_len : [out] Maximum length of Constant Tone Extension supported in 8 us units. 3032 * 3033 * @retval ble_stat_t : Command status. 3034 */ 3035 ble_stat_t ll_intf_read_antenna_info(uint8_t *ptr_supprtd_switching_sampling_rates, 3036 uint8_t *ptr_antenna_num, 3037 uint8_t *ptr_switching_pattern_max_len, 3038 uint8_t *ptr_cte_max_len); 3039 /**@} 3040 */ 3041 3042 /** @ingroup vendor_cfg Vendor Specific Commands 3043 * @{ 3044 */ 3045 /*================ LE Set Default Antenna ID Command =====================*/ 3046 /** 3047 * @brief Allow the Host to set the default antenna ID to be used by the Controller. 3048 * 3049 * @param default_antenna_id : [in] Antenna ID value for the default antenna to be used by the controller, in case no antenna switching is required. 3050 * 3051 * @retval ble_stat_t : Command status. 3052 */ 3053 ble_stat_t ll_intf_set_default_antenna_id(uint8_t default_antenna_id); 3054 /**@} 3055 */ 3056 #endif /* SUPPORT_AOA_AOD */ 3057 3058 /** @ingroup phy_cfg PHY Commands 3059 * @{ 3060 */ 3061 #if (SUPPORT_MASTER_CONNECTION || SUPPORT_SLAVE_CONNECTION) 3062 /** 3063 * @brief The LE Read PHY command is sent by the host to read the current working PHY per connection. 3064 * 3065 * @param conn_handle_id : [in] Connection_Handle to be used to identify a connection.(Range:0x0000-0x0EFF) 3066 * @param tx_phy : [out] The used PHY in the Tx 3067 * @param rx_phy : [out] The used PHY in the Rx 3068 * 3069 * @retval status : [out] 0:SUCCESS, 0xXX:ERROR_CODE. 3070 */ 3071 ble_stat_t ll_intf_le_read_phy_cmd(uint16_t conn_handle_id, uint8_t *tx_phy, 3072 uint8_t *rx_phy); 3073 3074 /** 3075 * @brief The LE Set Default PHY command is sent by the host to set the prefered working PHYs for Tx and Rx. 3076 * 3077 * @param all_phys : [in] The Host preferences (use prefered shown in tx_phys and rx_phys / no_preference) for the used PHYs in the TX or RX 3078 * @param tx_phys : [in] The prefered used PHY in the Tx 3079 * @param rx_phys : [in] The prefered used PHY in the Rx 3080 * 3081 * @retval status : [out] 0:SUCCESS, 0xXX:ERROR_CODE. 3082 * 3083 */ 3084 ble_stat_t ll_intf_le_set_default_phy_cmd(uint8_t all_phys, uint8_t tx_phys, 3085 uint8_t rx_phys); 3086 3087 /** 3088 * @brief The LE Set PHY command is used to request a change to the transmitter PHY and receiver PHY for a connection. 3089 * 3090 * @param conn_handle_id : [in] Connection_Handle to be used to identify a connection.(Range:0x0000-0x0EFF) 3091 * @param all_phys : [in] The Host preferences (use prefered shown in tx_phys and rx_phys / no_preference) for the used PHYs in the TX or RX 3092 * @param tx_phys : [in] The prefered used PHY in the Tx 3093 * @param rx_phys : [in] The prefered used PHY in the Rx 3094 * 3095 * @retval status : [out] 0:SUCCESS, 0xXX:ERROR_CODE. 3096 */ 3097 ble_stat_t ll_intf_le_set_phy_cmd(uint16_t conn_handle_id, uint8_t all_phys, 3098 uint8_t tx_phys, uint8_t rx_phys, uint16_t phy_options); 3099 #endif /* (SUPPORT_MASTER_CONNECTION || SUPPORT_SLAVE_CONNECTION) */ 3100 /**@} 3101 */ 3102 3103 #if (SUPPORT_LE_PERIODIC_ADVERTISING) 3104 /** @ingroup scn_cfg 3105 * @{ 3106 */ 3107 #if (SUPPORT_EXPLCT_OBSERVER_ROLE || SUPPORT_MASTER_CONNECTION || SUPPORT_SYNC_ISOCHRONOUS) 3108 /*=============== LE Set Periodic Advertising Receive Enable Command ===============*/ 3109 /** 3110 * @brief used to enable or disable reports for the periodic advertising identified by the Sync Handle parameter. 3111 * 3112 * @param sync_handle : [in] Used to identify the periodic advertiser. 3113 * @param enable : [in] Enable/Disable sending reports 3114 * 3115 * @retval ble_stat_t : Command status. 3116 */ 3117 ble_stat_t ll_intf_le_set_periodic_adv_receive_enable(uint16_t sync_handle , uint8_t enable); 3118 #endif /* (SUPPORT_EXPLCT_OBSERVER_ROLE || SUPPORT_MASTER_CONNECTION || SUPPORT_SYNC_ISOCHRONOUS)*/ 3119 /**@} 3120 */ 3121 3122 /** @ingroup prdc_sync_transfer_cfg Periodic Sync Transfer Commands 3123 * @{ 3124 */ 3125 #if (SUPPORT_PERIODIC_SYNC_TRANSFER) 3126 /*=============== LE Periodic Advertising Sync Transfer Command ===============*/ 3127 /** 3128 * @brief : used to instruct the Controller to send synchronization information about the periodic advertising 3129 * identified by the Sync Handle parameter to a connected device. 3130 * 3131 * @param conn_handle : [in] Connection Handle Id to identify a connection. 3132 * @param service_data : [in] A value provided by the Host 3133 * @param sync_handle : [in] Used to identify the periodic advertiser. 3134 * 3135 * @retval ble_stat_t : Command status. 3136 */ 3137 ble_stat_t ll_intf_le_periodic_adv_sync_transfer( 3138 uint16_t conn_handle, 3139 uint16_t service_data, 3140 uint16_t sync_handle); 3141 3142 /*=============== LE Set Periodic Advertising Set Info Transfer Command ===============*/ 3143 /** 3144 * @brief : used to instruct the Controller to send synchronization information about the periodic advertising 3145 * in an advertising set to a connected device. 3146 * 3147 * @param service_data : [in] A value provided by the Host. 3148 * @param conn_handle : [in] Connection Handle Id to identify a connection. 3149 * @param adv_handle : [in] Used to identify the periodic advertiser. 3150 * 3151 * @retval ble_stat_t : Command status. 3152 */ 3153 ble_stat_t ll_intf_le_periodic_adv_set_info_transfer( 3154 uint16_t conn_handle, 3155 uint16_t service_data, 3156 uint8_t adv_handle); 3157 3158 /*=============== LE Set Periodic Advertising Sync Transfer Parameters Command ===============*/ 3159 /** 3160 * @brief : used to specify how the Controller will process periodic advertising synchronization information 3161 * received from the device identified by the Connection Handle parameter. 3162 * 3163 * @param conn_handle : [in] Connection Handle Id to identify a connection. 3164 * @param mode : [in] Specifies the action to be taken when periodic advertising synchronization information is received. 3165 * @param skip : [in] Number of consecutive periodic advertising packets that the receiver may skip after successfully receiving a periodic advertising packet. 3166 * @param sync_timeout : [in] Maximum permitted time between successful receives. 3167 * @param cte_type : [in] Specifies whether to only synchronize to periodic advertising with certain types of Constant Tone Extension. 3168 * 3169 * @retval ble_stat_t : Command status. 3170 */ 3171 ble_stat_t ll_intf_le_set_periodic_adv_sync_transfer_paramters( 3172 uint16_t conn_handle,uint8_t mode , uint16_t skip , uint16_t sync_timeout,uint8_t cte_type); 3173 3174 /*=============== LE Set Default Periodic Advertising Sync Transfer Parameters Command ===============*/ 3175 /** 3176 * @brief : used to specify the initial value for the mode, skip, timeout, and Constant Tone Extension type. 3177 * 3178 * @param mode : [in] Specifies the action to be taken when periodic advertising synchronization information is received. 3179 * @param skip : [in] Number of consecutive periodic advertising packets that the receiver may skip after successfully receiving a periodic advertising packet. 3180 * @param sync_timeout : [in] Maximum permitted time between successful receives. 3181 * @param cte_type : [in] Specifies whether to only synchronize to periodic advertising with certain types of Constant Tone Extension. 3182 * 3183 * @retval ble_stat_t : Command status. 3184 */ 3185 ble_stat_t ll_intf_le_set_default_periodic_adv_sync_transfer_paramters( 3186 uint8_t mode , uint16_t skip , uint16_t sync_timeout,uint8_t cte_type); 3187 3188 #endif /* SUPPORT_PERIODIC_SYNC_TRANSFER */ 3189 /**@} 3190 */ 3191 #endif /* SUPPORT_LE_PERIODIC_ADVERTISING */ 3192 3193 #if (SUPPORT_MASTER_CONNECTION || SUPPORT_SLAVE_CONNECTION) 3194 /** @ingroup tx_pwr_cfg Tx Power Commands 3195 * @{ 3196 */ 3197 /*================ LE Set Connection Transmit Power Level Command =====================*/ 3198 /** 3199 * @brief Used to Set the TX_Power level used by the local Controller on an ACL connection for a certain PHY. 3200 * 3201 * @param ptr_hci_cmd_params : [in] Pointer to the HCI command parameters. 3202 * @param ptr_tx_power : [out] Used to report the new Tx_power after the change. 3203 * 3204 * @retval ble_stat_t : Command status. 3205 */ 3206 ble_stat_t ll_intf_set_conn_tx_power_level(le_set_conn_tx_pwr_lvl_cmd_st *ptr_hci_cmd_params, int8_t *ptr_tx_power); 3207 /**@} 3208 */ 3209 #endif /* SUPPORT_MASTER_CONNECTION || SUPPORT_SLAVE_CONNECTION */ 3210 3211 /*================ LE Power Control =====================*/ 3212 /*================ LE Enhanced Read Transmit Power Level Command =====================*/ 3213 #if (SUPPORT_LE_POWER_CONTROL) 3214 /** @ingroup power_control_cfg Power Control Commands 3215 * @{ 3216 */ 3217 /** 3218 * @brief Used to read the current and maximum TX_Power levels of the local Controller on an ACL connection for a certain PHY. 3219 * 3220 * @param ptr_hci_cmd_params : [in] Pointer to the HCI command parameters. 3221 * @param ptr_curr_tx_power : [Out] Value of the local current TX_Power level to be set by the Controller. 3222 * @param ptr_max_tx_power : [Out] Value of the local maximum TX_Power level to be set by the Controller. 3223 * 3224 * @retval ble_stat_t : Command status. 3225 */ 3226 ble_stat_t ll_intf_enhanced_read_tx_power_level(le_enhanced_read_tx_pwr_lvl_cmd_st *ptr_hci_cmd_params, 3227 uint8_t *ptr_curr_tx_power, 3228 uint8_t *ptr_max_tx_power); 3229 3230 /*================ LE Read Remote Transmit Power Level Command =====================*/ 3231 /** 3232 * @brief Used to read the TX_Power level used by the remote Controller on an ACL connection for a certain PHY. 3233 * 3234 * @param ptr_hci_cmd_params : [in] Pointer to the HCI command parameters. 3235 * 3236 * @retval ble_stat_t : Command status. 3237 */ 3238 ble_stat_t ll_intf_read_remote_tx_power_level(le_read_remote_tx_pwr_lvl_cmd_st *ptr_hci_cmd_params); 3239 3240 /*================ LE Set Path Loss Reporting Parameters Command =====================*/ 3241 /** 3242 * @brief Used to set the path loss threshold reporting parameters for an ACL connection. 3243 * 3244 * @param ptr_hci_cmd_params : [in] Pointer to the HCI command parameters. 3245 * 3246 * @retval ble_stat_t : Command status. 3247 */ 3248 ble_stat_t ll_intf_set_path_loss_reporting_params(le_set_path_loss_reporting_params_cmd_st *ptr_hci_cmd_params); 3249 3250 /*================ LE Set Path Loss Reporting Enable Command =====================*/ 3251 /** 3252 * @brief Used to enable or disable path loss reporting for an ACL connection. 3253 * 3254 * @param ptr_hci_cmd_params : [in] Pointer to the HCI command parameters. 3255 * 3256 * @retval ble_stat_t : Command status. 3257 */ 3258 ble_stat_t ll_intf_set_path_loss_reporting_enable(le_set_path_loss_reporting_enable_cmd_st *ptr_hci_cmd_params); 3259 3260 /*================ LE Set Transmit Power Reporting Enable Command =====================*/ 3261 /** 3262 * @brief Used to enable or disable the reporting to the local Host of TX_Power level changes in the local and remote Controllers for an ACL connection. 3263 * 3264 * @param ptr_hci_cmd_params : [in] Pointer to the HCI command parameters. 3265 * 3266 * @retval ble_stat_t : Command status. 3267 */ 3268 ble_stat_t ll_intf_set_tx_power_reporting_enable(le_set_tx_pwr_reporting_enable_cmd_st *ptr_hci_cmd_params); 3269 /**@} 3270 */ 3271 3272 /** @ingroup dtm_cfg DTM Commands 3273 * @{ 3274 */ 3275 /*================ LE transmitter Test [v4] Command =====================*/ 3276 /** 3277 * @brief Used to start a test where the DUT generates test reference packets at a fixed interval and including the LE Low Power feature. 3278 * 3279 * @param ptr_hci_cmd_params : [in] Pointer to the HCI command parameters. 3280 * 3281 * @retval status : [out] 0:SUCCESS, 0xXX:ERROR_CODE. 3282 */ 3283 ble_stat_t ll_intf_le_transmitter_test_v4(le_tx_test_v4_cmd_st *ptr_hci_cmd_params); 3284 /**@} 3285 */ 3286 #endif /* SUPPORT_LE_POWER_CONTROL */ 3287 3288 /*################# Vendor-Specific HCI Commands' Group ################# */ 3289 3290 /** @ingroup vendor_cfg Vendor Specific Commands 3291 * @{ 3292 */ 3293 /*=============== LE Write Transmit Power Command ===============*/ 3294 /** 3295 * @brief Set the minimum and maximum TX Power values to be supported by the controller. 3296 * 3297 * @param tx_pwr : [in] transmit power sent by host to be used by the controller 3298 * 3299 * @retval ble_stat_t : Command status to be sent to the Host. 3300 */ 3301 ble_stat_t ll_intf_le_write_tx_pwr(int8_t tx_pwr); 3302 /**@} 3303 */ 3304 3305 3306 #if (SUPPORT_SLEEP_CLOCK_ACCURCY_UPDATES && MAXIMUM_SLP_CLK_ACCURACY > 1 ) 3307 /** @ingroup modify_slpclk_cfg Sleep Clock Accuracy Commands 3308 * @{ 3309 */ 3310 /*=============== LE modify Sleep Clock Accuracy ===============*/ 3311 /** 3312 * @brief Modify Sleep Clock Accuracy. This should be used for testing purposes only. 3313 * 3314 * @param action : [in] specifies action more accurate or less accurate SCA 3315 * 3316 * @retval ble_stat_t : Command status to be sent to the Host. 3317 */ 3318 ble_stat_t ll_intf_le_modify_sleep_clock_accuracy(uint8_t action); 3319 /**@} 3320 */ 3321 #endif /* SUPPORT_SLEEP_CLOCK_ACCURCY_UPDATES */ 3322 3323 /** @ingroup sleep_clk_acc_cfg Set Sleep Clock Accuracy Command 3324 * @{ 3325 */ 3326 /*=============== LE Set Sleep Clock Accuracy ===============*/ 3327 /** 3328 * @brief Set Sleep Clock Acuuracy. 3329 * 3330 * @param slp_clk_acc : [in] sleep clock accuracy 3331 * 3332 * @retval ble_stat_t : Command status to be sent to the Host. 3333 */ 3334 ble_stat_t ll_intf_le_set_sleep_clock_accuracy(uint8_t slp_clk_acc); 3335 /**@} 3336 */ 3337 3338 /** @ingroup dpslp_cfg Deep Sleep Commands 3339 * @{ 3340 */ 3341 /*=============== LE Set Deep Sleep Mode ===============*/ 3342 /** 3343 * @brief Used to configure linklayer to go to/back from deep sleep mode. 3344 * 3345 * @param dp_slp_mode : [in] 1 enable deep sleep mode , 0 go back to sleep mode 3346 * 3347 * @retval Status. 3348 */ 3349 ble_stat_t ll_intf_le_set_dp_slp_mode(uint8_t dp_slp_mode); 3350 /**@} 3351 */ 3352 3353 /** @ingroup vendor_cfg Vendor Specific Commands 3354 * @{ 3355 */ 3356 /*=============== LE Set PHY Calibration Event Parameters ===============*/ 3357 /** 3358 * @brief Used to configure the PHY calibration event parameters. 3359 * 3360 * @param phy_clbr_evnt_period : [in] Indicate the periodicity of the PHY calibration event. Periodicity = phy_clbr_evnt_period * 1s. 3361 * @param phy_clbr_evnt_count : [in] Indicate the number of the PHY calibration events to be executed. 3362 */ 3363 void ll_intf_le_set_phy_clbr_params(uint32_t phy_clbr_evnt_period, uint32_t phy_clbr_evnt_count); 3364 3365 #if ((SUPPORT_BRD_ISOCHRONOUS || SUPPORT_SYNC_ISOCHRONOUS) || (SUPPORT_CONNECTED_ISOCHRONOUS)) 3366 #if SUPPORT_HW_AUDIO_SYNC_SIGNAL 3367 /** 3368 * @brief Enable the audio sync signal for specific Stream 3369 * @param conn_hndle : Connection handle for stream for which hw audio sync signal should be enabled 3370 * @retval Status 3371 */ 3372 ble_stat_t ll_intf_enable_audio_sync_signal(uint16_t conn_hndle); 3373 #if (SUPPORT_SYNC_ISOCHRONOUS) 3374 /** 3375 * @brief Force RTL to re-rx the first sub-event in the stream which is already enabled 3376 * @param conn_hndle : Connection handle for stream for which hw audio sync signal should be enabled 3377 * @param force_state : Switch control of force resync 3378 * (1: means that the force mechanism is enabled, and the HW Audio signal 3379 * is generated at the first sub-event of the stream that is already HW Audio signal is enabled 3380 * 0: means that the force mechanism is disabled, and the HW Audio signal 3381 * is generated at the last 3382 * @retval Status 3383 */ 3384 ble_stat_t ll_intf_force_audio_sync_signal_resync(uint16_t conn_hndle, uint8_t force_state); 3385 #endif /*SUPPORT_SYNC_ISOCHRONOUS*/ 3386 #endif /*SUPPORT_HW_AUDIO_SYNC_SIGNAL*/ 3387 #endif /* ((SUPPORT_BRD_ISOCHRONOUS || SUPPORT_SYNC_ISOCHRONOUS) || (SUPPORT_CONNECTED_ISOCHRONOUS)) */ 3388 3389 /*=============== LE Set Get Remaining Time For Next Event ===============*/ 3390 /** 3391 * @brief Used to Get Remaining Time For Next Event. 3392 * 3393 * @param remaing_time : [out] the value of remaining time for the next event in us. 3394 * 3395 * @retval Status. 3396 */ 3397 ble_stat_t ll_intf_le_get_remaining_time_for_next_event(uint32_t* remaing_time); 3398 3399 /*=============== LE Set SETUP_TIME Time ===============*/ 3400 /** 3401 * @brief Used to Set SETUP_TIME Time For Next Event. 3402 * 3403 * @param setup_time : [in] the value of setup time in us to be used be the link layer scheduler . 3404 * 3405 * @retval Status. 3406 */ 3407 ble_stat_t ll_intf_le_set_scheduler_setup_time(uint32_t setup_time) ; 3408 3409 #if (SUPPORT_AUGMENTED_BLE_MODE) 3410 /**@} 3411 */ 3412 /** @ingroup aug_ble_cfg Augmented BLE Commands 3413 * @{ 3414 */ 3415 /** 3416 * @brief Used to Start BLE Augmented Mode. 3417 * 3418 * @param aug_access_address : [in] the value of access address to be used in augmented mode. 3419 * @param aug_whitening_init : [in] the value of whitening initialization to be used in augmented mode. 3420 * 3421 * @retval Status. 3422 */ 3423 ble_stat_t ll_intf_le_start_augmented_mode(uint32_t aug_access_address, uint8_t aug_whitening_init); 3424 3425 /** 3426 * @brief Used to Stop BLE Augmented Mode 3427 * 3428 * @retval Status. 3429 */ 3430 ble_stat_t ll_intf_le_stop_augmented_mode(void); 3431 /**@} 3432 */ 3433 3434 /** @ingroup vendor_cfg Vendor Specific Commands 3435 * @{ 3436 */ 3437 /** 3438 * @brief Used to Start Energy detection on a specific channel map 3439 * 3440 * @param chnnl_map : [in] bit mask of channel map. 3441 * @param duration : [in] Duration of energy detection on each channel. 3442 * 3443 * @retval Status. 3444 */ 3445 ble_stat_t ll_intf_le_start_energy_detection(uint8_t * chnnl_map, uint32_t duration); 3446 #endif /*(SUPPORT_AUGMENTED_BLE_MODE)*/ 3447 3448 #if (USE_NON_ACCURATE_32K_SLEEP_CLK) 3449 /*=============== LE Select Sleep Clock Source ===============*/ 3450 /** 3451 * @brief Used to select the source that drives the sleep clock, whether to use an external crystal oscillator or an integrated RC oscillator (RCO). 3452 * 3453 * @param slp_clk_src : [in] Indicate which source to drive the sleep clock. 0: Crystal Oscillator (default). 1: RC0 3454 * @param ptr_slp_clk_freq_value : [out] Indicate the nominal frequency value of the sleep clock. 3455 * 3456 * @retval ble_stat_t : Command status to be sent to the Host. 3457 */ 3458 ble_stat_t ll_intf_le_select_slp_clk_src(uint8_t slp_clk_src, uint16_t *ptr_slp_clk_freq_value); 3459 3460 /*=============== LE Set RCO Calibration Event Parameters ===============*/ 3461 /** 3462 * @brief Used to configure the runtime RCO calibration event parameters. 3463 * 3464 * @param rco_clbr_event_duration : [in] Indicate the number of sleep clock cycles for performing the RCO calibration process. 3465 * @param rco_clbr_event_interval : [in] Indicate the periodicity of running the runtime RCO calibration event. 3466 * 3467 * @retval ble_stat_t : Command status to be sent to the Host. 3468 */ 3469 ble_stat_t ll_intf_le_set_rco_clbr_evnt_params(uint8_t rco_clbr_event_duration, uint32_t rco_clbr_event_interval); 3470 #endif /* USE_NON_ACCURATE_32K_SLEEP_CLK */ 3471 3472 /*=============== LE Select TX_Power Table ===============*/ 3473 /** 3474 * @brief Used to specify the used power table and its size based on the selected TX_Power table ID. 3475 * 3476 * @param tx_power_table_id : [in] Selected TX_Power table ID. 3477 * 3478 * @retval Status : 0: SUCCESS. Otherwise: Error code. 3479 */ 3480 uint8_t ll_intf_select_tx_power_table(uint8_t tx_power_table_id); 3481 3482 #if(SUPPORT_CONNECTED_ISOCHRONOUS &&( SUPPORT_MASTER_CONNECTION || SUPPORT_SLAVE_CONNECTION)) || (SUPPORT_BRD_ISOCHRONOUS) 3483 /*=============== LE Enable Sync Event ===============*/ 3484 /** 3485 * @brief Used to enable or disable generation of sync event and generation of calibration signal . 3486 * 3487 * @param group_id : [in] contain the identifier of the CIG or BIG. 3488 * @param enable_sync : [in] enable or disable generation of sync event. 3489 * @param enable_clbr_trigger : [in] enable or disable generation of calibration signal 3490 * @param trigger_source : [in] identify trigger source (CIG or BIG) 3491 */ 3492 ble_stat_t ll_intf_le_enable_sync_evnt(uint8_t group_id ,uint8_t enable_sync, 3493 uint8_t enable_clbr_trigger,uint8_t trigger_source); 3494 #endif /* SUPPORT_CONNECTED_ISOCHRONOUS &&( SUPPORT_MASTER_CONNECTION || SUPPORT_SLAVE_CONNECTION) */ 3495 /**@} 3496 */ 3497 3498 /** @ingroup alloc_pkt_cfg Packet Allocation Commands 3499 * @{ 3500 */ 3501 #if (SUPPORT_MASTER_CONNECTION || SUPPORT_SLAVE_CONNECTION) 3502 /*=============== ll_intf_alloc_ll_pkt ===============*/ 3503 /** 3504 * @brief Allocates LL packet that will be used for LL Tx/Rx. 3505 * 3506 * @retval void * : Pointer to the raw LL packet. 3507 */ 3508 void* ll_intf_alloc_ll_pkt(void); 3509 #endif /* SUPPORT_MASTER_CONNECTION || SUPPORT_SLAVE_CONNECTION */ 3510 3511 /*=============== ll_intf_free_ll_pkt ===============*/ 3512 /** 3513 * @brief This function shall be called on any packets that has been passed from the LL to the host. 3514 * 3515 * @param pkt : [in] Pointer to the raw LL packet 3516 */ 3517 void ll_intf_free_ll_pkt(void* pkt); 3518 3519 /*=============== ll_intf_free_ll_pkt_hndlr ===============*/ 3520 /** 3521 * @brief This function free both the LL packet and the handler asociated with it. 3522 * 3523 * @param pkt : [in] Pointer to ble_buff_hdr_t that points to the LL packet 3524 */ 3525 void ll_intf_free_ll_pkt_hndlr(ble_buff_hdr_t* pkt); 3526 /**@} 3527 */ 3528 3529 #if (SUPPORT_SLEEP_CLOCK_ACCURCY_UPDATES&&( SUPPORT_MASTER_CONNECTION || SUPPORT_SLAVE_CONNECTION)) 3530 /** @ingroup modify_slpclk_cfg Sleep Clock Accuracy Commands 3531 * @{ 3532 */ 3533 /*=============== LE Request Peer SCA Command ===============*/ 3534 /** 3535 * @brief : is used to read the Sleep Clock Accuracy (SCA) of the peer device. 3536 * 3537 * @param conn_hndl : contains the identifier of the Connection_handler of the ACL_Connection 3538 * 3539 * @retval ble_stat_t : Command status. 3540 */ 3541 ble_stat_t ll_intf_req_peer_sca(uint16_t conn_hndl); 3542 /**@} 3543 */ 3544 #endif /* Sleep Clock Accuracy update &&( SUPPORT_MASTER_CONNECTION || SUPPORT_SLAVE_CONNECTION)*/ 3545 3546 /*################################## Isochronous ################################## */ 3547 /** @ingroup iso_cfg 3548 * @{ 3549 */ 3550 #if((SUPPORT_CONNECTED_ISOCHRONOUS &&( SUPPORT_MASTER_CONNECTION || SUPPORT_SLAVE_CONNECTION)) || (SUPPORT_SYNC_ISOCHRONOUS)) 3551 /*=============== LE Set from controller to host function path ===============*/ 3552 /** 3553 * @brief it sets the output path function in a CIS context 3554 * 3555 * @param conn_hndl :[IN] ISO handle 3556 * @param ptr_func :[IN] output data path 3557 * 3558 * @retval ble_stat_t. 3559 */ 3560 ble_stat_t ll_intf_set_output_data_path(uint16_t conn_hndl ,vendor_specific_from_cntrl_to_host_cbk func_ptr); 3561 #endif /*((SUPPORT_CONNECTED_ISOCHRONOUS &&( SUPPORT_MASTER_CONNECTION || SUPPORT_SLAVE_CONNECTION)) || (SUPPORT_SYNC_ISOCHRONOUS))*/ 3562 #if(SUPPORT_CONNECTED_ISOCHRONOUS &&( SUPPORT_MASTER_CONNECTION || SUPPORT_SLAVE_CONNECTION)) 3563 #if(SUPPORT_MASTER_CONNECTION) 3564 /*=============== LE Set CIG Parameters Command ===============*/ 3565 /** 3566 * @brief : used to set the parameters of one or more CISes that are associated with a CIG in the Controller 3567 * 3568 * @param ptr_st_set_cig_params : [IN] pointer to ble_intf_set_cig_params_cmd_st that contains CIG parameters coming from the Host 3569 * @param conn_hndl : [out] pointer to array of connection handles in the CIG 3570 * 3571 * @retval ble_stat_t : Command status. 3572 */ 3573 ble_stat_t ll_intf_le_set_cig_params(ble_intf_set_cig_params_comman_cmd_st* ptr_st_set_cig_params, uint8_t* conn_hndl); 3574 3575 /*=============== LE Set CIG Parameters Test Command ===============*/ 3576 /** 3577 * @brief : used to set the parameters of one or more CISes that are associated with a CIG in the Controller 3578 * 3579 * @param ptr_st_set_cig_params_test : [IN] pointer to ble_intf_set_cig_params_cmd_st that contains CIG parameters coming from the Host 3580 * @param conn_hndl : [out] pointer to array of connection handles in the CIG 3581 * 3582 * @retval ble_stat_t : Command status. 3583 */ 3584 ble_stat_t ll_intf_le_set_cig_params_test(ble_intf_set_cig_params_comman_cmd_st* ptr_st_set_cig_params_test, uint8_t* conn_hndl); 3585 3586 /*=============== LE Create CIS Command ===============*/ 3587 /** 3588 * @brief : The HCI_LE_Create_CIS command is used by the master’s Host to create one or more CISes 3589 * using the connections identified by the ACL_Connection_Handle[i] parameter array 3590 * @param ptr_st_create_cis_params : pointer to ble_intf_create_cis_cmd_st that contains ACL_Connection_Handles, 3591 * ISO_Connection_Handles and Number of CISes. 3592 * @retval ble_stat_t : Command status. 3593 */ 3594 ble_stat_t ll_intf_le_create_cis(ble_intf_create_cis_cmd_st* ptr_st_create_cis_params); 3595 #endif /* SUPPORT_MASTER_CONNECTION */ 3596 3597 /*=============== LE Accept CIS Request Command ===============*/ 3598 /** 3599 * @brief : is used by the slave’s Host to inform the Controller to accept 3600 * the request for the CIS that is identified by the Connection_Handle. 3601 * 3602 * @param conn_hndl : contains the identifier of the Connection_handler of the master 3603 * 3604 * @retval ble_stat_t : Command status. 3605 */ 3606 ble_stat_t ll_intf_accept_cis_req(uint16_t conn_hndl); 3607 3608 /*=============== LE Reject CIS Request Command ===============*/ 3609 /** 3610 * @brief : is used by the slave’s Host to inform the Controller to reject 3611 * the request for the CIS that is identified by the Connection_Handle. 3612 * 3613 * @param conn_hndl : contains the identifier of the Connection_handler of the master 3614 * @param reason : the reason for rejection 3615 * 3616 * @retval ble_stat_t : Command status. 3617 */ 3618 ble_stat_t ll_intf_reject_cis_req(uint16_t conn_hndl, uint8_t reason); 3619 3620 /** 3621 * @brief Used to set cis req event mask value . 3622 * 3623 * @param cis_req_evnt_mask : [in] event mask value. 3624 */ 3625 void ll_intf_set_cis_req_evnt_mask(uint32_t cis_req_evnt_mask); 3626 /*=============== LE Remove CIG Command ===============*/ 3627 /** 3628 * @brief : is used by the master’s Host to remove all the CISes associated with the CIG identified by CIG_ID 3629 * 3630 * @param cig_id : contains the identifier of the CIG 3631 * 3632 * @retval ble_stat_t : Command status. 3633 */ 3634 ble_stat_t ll_intf_rmv_cig(uint8_t cig_id); 3635 /** @} 3636 */ 3637 3638 typedef void (*ll_intf_clbr_cb_t)(uint32_t); 3639 3640 /** @ingroup clbr_cbk_cfg Calibration Callback 3641 * @{ 3642 */ 3643 /** 3644 * @brief Registers a calibration function callback 3645 * 3646 * @param clbr_cb : Calibration function callback 3647 */ 3648 void ll_intf_rgstr_clbr_cbk(ll_intf_clbr_cb_t clbr_cb); 3649 /**@} 3650 */ 3651 3652 /** @ingroup alloc_pkt_cfg Packet Allocation Commands 3653 * @{ 3654 */ 3655 /** 3656 * @brief Allocates an ISO packet 3657 * 3658 * @retval Pointer to the allocated ISO packet 3659 */ 3660 void* ll_intf_alloc_iso_pkt(void); 3661 /**@} 3662 */ 3663 3664 /** @ingroup conn_cte_cfg Connection CTE Commands 3665 * @{ 3666 */ 3667 #if (SUPPORT_LE_POWER_CONTROL) 3668 /** 3669 * @brief Custom command to read RSSI of CIS handle to be used in power control testing. 3670 * 3671 * @param conn_handle_id : [in] ACL_CONNECTION_ID 3672 * @param ptr_cis_rssi_value : [out] CIS RSSI value 3673 * 3674 * @retval ble_stat_t : Command status. 3675 */ 3676 ble_stat_t ll_intf_cis_read_rssi(uint16_t conn_handle_id, int8_t *ptr_cis_rssi_value); 3677 #endif /* SUPPORT_LE_POWER_CONTROL */ 3678 /**@} 3679 */ 3680 #endif/* SUPPORT_CONNECTED_ISOCHRONOUS &&( SUPPORT_MASTER_CONNECTION || SUPPORT_SLAVE_CONNECTION) */ 3681 3682 #if(SUPPORT_BRD_ISOCHRONOUS || SUPPORT_SYNC_ISOCHRONOUS) 3683 #if(SUPPORT_SYNC_ISOCHRONOUS) 3684 /** @ingroup iso_cfg 3685 * @{ 3686 */ 3687 /*=============== LE BIG Create Sync Command ===============*/ 3688 /** 3689 * @brief : is used to synchronize to a BIG described in the periodic advertising train specified by the Sync_Handle parameter. 3690 * @param ptr_str_big_create_sync_cmd : pointer to ble_intf_big_create_sync_cmd_st that contains the command parameters 3691 * @retval ble_stat_t : Command status. 3692 */ 3693 ble_stat_t ll_intf_le_big_create_sync(ble_intf_big_create_sync_cmd_st * ptr_str_big_create_sync_cmd); 3694 3695 /*=============== LE BIG Terminate Sync Command ===============*/ 3696 /** 3697 * @brief : is used to stop synchronizing or cancel the process of synchronizing to the BIG identified by the BIG_Handle parameter. 3698 * destroys the associated connection handles of the BISes in the BIG and removes the data paths for all BISes 3699 * in the BIG identified by BIG_Handle. 3700 * @param big_hndle : contains the identifier of the BIG_Handler. 3701 * 3702 * @retval ble_stat_t : Command status. 3703 */ 3704 ble_stat_t ll_intf_le_big_term_sync(uint8_t* big_hndle); 3705 3706 #endif /* SUPPORT_SYNC_ISOCHRONOUS */ 3707 3708 #if(SUPPORT_BRD_ISOCHRONOUS) 3709 /*=============== LE Create BIG Command ===============*/ 3710 /** 3711 * @brief : is used to create a BIG with one or more BISes (All BISes in a BIG have the same value for all parameters) 3712 * @param ptr_create_big_cmd_st : pointer to ble_intf_create_big_st that contains the parameters of create big / test command 3713 * 3714 * @retval ble_stat_t : Command status. 3715 */ 3716 ble_stat_t ll_intf_le_create_big(ble_intf_create_big_st* ptr_create_big_cmd_st); 3717 3718 /*=============== LE Create BIG Test Command ===============*/ 3719 /** 3720 * @brief : (should be used in the ISO Test mode) is used to create a BIG with one or more BISes (All BISes in a BIG have the same value for all parameters) 3721 * @param ptr_create_big_test_cmd_st : pointer to ble_intf_create_big_st that contains the parameters of create big / test command 3722 * 3723 * @retval ble_stat_t : Command status. 3724 */ 3725 ble_stat_t ll_intf_le_create_big_test(ble_intf_create_big_st* ptr_create_big_test_cmd_st); 3726 #endif /* SUPPORT_BRD_ISOCHRONOUS */ 3727 3728 /*=============== LE Terminate BIG Command ===============*/ 3729 /** 3730 * @brief : is used to terminate a BIG identified by the BIG_Handle parameter 3731 * @param big_hndle : contains the identifier of the BIG_Handler. 3732 * @param reason : indicate the reason why the BIG is to be terminated 3733 * 3734 * @retval ble_stat_t : Command status. 3735 */ 3736 ble_stat_t ll_intf_le_term_big(uint8_t big_hndle, uint8_t reason); 3737 3738 #endif /* SUPPORT_BRD_ISOCHRONOUS || SUPPORT_SYNC_ISOCHRONOUS*/ 3739 3740 #if(SUPPORT_CONNECTED_ISOCHRONOUS && SUPPORT_SLAVE_CONNECTION) 3741 /*=============== LL write connection accept timeout Command ===============*/ 3742 /** 3743 * @brief :this command is used to write connection timeout for cis connection 3744 * after that the cis is rejected 3745 * @param accept_tout[in] : the accept timeout to be written 3746 * 3747 * @retval ble_stat_t : Command status. 3748 */ 3749 3750 ble_stat_t ll_intf_write_connection_accept_tout(uint16_t accept_tout); 3751 3752 /*=============== LL read connection accept timeout Command ===============*/ 3753 /** 3754 * @brief :this command is used to read connection timeout for cis connection 3755 * after that the cis is rejected 3756 * @param ptr_accept_tout[out] : pointer to timeout to be read 3757 * 3758 * @retval ble_stat_t : Command status. 3759 */ 3760 3761 ble_stat_t ll_intf_read_connection_accept_tout(uint16_t *ptr_accept_tout); 3762 #endif 3763 3764 #if (SUPPORT_LE_POWER_CONTROL) 3765 /** 3766 * @brief Used for setting the custom golden range RSSI 3767 * 3768 * @param upper_limit : [in] 3769 * @param lower_limit : [in] 3770 * 3771 * @retval Success 3772 */ 3773 ble_stat_t ll_intf_set_cstm_rssi_golden_range(int lower_limit , int upper_limit); 3774 #endif /* (SUPPORT_LE_POWER_CONTROL) */ 3775 #if (SUPPORT_LE_ENHANCED_CONN_UPDATE || SUPPORT_CONNECTED_ISOCHRONOUS || SUPPORT_CSSA) 3776 /** @} 3777 */ 3778 3779 /** @ingroup controller_info 3780 * @{ 3781 */ 3782 /*=============== LE Set Host Feature Command ===============*/ 3783 /** 3784 * @brief : The HCI_LE_Set_Host_Feature command is used by the Host to set or clear a bit controlled by the Host in the Link Layer FeatureSet stored in the Controller 3785 * 3786 * @param bit_num : bit number to be changed 3787 * @param bit_value : value to be stored in the link_layer features 3788 * 3789 * @retval ble_stat_t : Command status. 3790 */ 3791 ble_stat_t ll_intf_le_set_host_feature(uint8_t bit_num, uint8_t bit_value); 3792 #endif /* (SUPPORT_LE_ENHANCED_CONN_UPDATE || SUPPORT_CONNECTED_ISOCHRONOUS || SUPPORT_CSSA) */ 3793 #if((SUPPORT_CONNECTED_ISOCHRONOUS &&( SUPPORT_MASTER_CONNECTION || SUPPORT_SLAVE_CONNECTION)) \ 3794 ||(SUPPORT_BRD_ISOCHRONOUS || SUPPORT_SYNC_ISOCHRONOUS)) 3795 3796 3797 /*=============== LE Setup ISO Data Path Command ===============*/ 3798 /** 3799 * @brief : is used to identify and create the isochronous data path between the Host and the Controller 3800 * for an established CIS or BIS identified by the Connection_Handle parameter. 3801 * @param conn_hndl : contains the identifier of the Connection_Handler. 3802 * @param ptr_st_setup_iso_data_path : pointer that carries the information parameters of setup_iso_data_path 3803 * 3804 * @retval ble_stat_t : Command status. 3805 */ 3806 ble_stat_t ll_intf_setup_iso_data_path(uint16_t conn_hndl, ble_intf_setup_iso_data_path* ptr_st_setup_iso_data_path); 3807 3808 /*=============== LE Remove ISO Data Path Command ===============*/ 3809 /** 3810 * @brief : is used to remove the input and/or output data path(s) associated 3811 * with a CIS or BIS identified by the Connection_Handle parameter 3812 * @param conn_hndl : contains the identifier of the Connection_Handler. 3813 * @param data_path_dirc : ( w.r.t the controller) specifies the data path to be removed 3814 * 3815 * @retval ble_stat_t : Command status. 3816 */ 3817 ble_stat_t ll_intf_rmv_iso_data_path(uint16_t conn_hndl, uint8_t data_path_dirc); 3818 3819 /*=============== LE ISO Test End Command ===============*/ 3820 /** 3821 * @brief : (This command should only be used for testing purposes) is used to terminate the ISO Transmit and/or Receive Test mode for a CIS or BIS 3822 * specified by the Connection_Handle parameter but does not terminate the CIS or BIS. 3823 * @param conn_hndl : contains the identifier of the Connection_Handler. 3824 * @param rcvd_pckt_cntr : number of received packets 3825 * @param missed_pckt_cntr : number of missed packets 3826 * @param failed_pckt_cntr : number of failed packets 3827 * 3828 * @retval ble_stat_t : Command status. 3829 */ 3830 ble_stat_t ll_intf_le_iso_test_end(uint16_t conn_hndl, uint32_t* rcvd_pckt_cntr, 3831 uint32_t * missed_pckt_cntr, uint32_t *failed_pckt_cntr); 3832 3833 3834 3835 #if(SUPPORT_BRD_ISOCHRONOUS|| SUPPORT_MASTER_CONNECTION || SUPPORT_SLAVE_CONNECTION || SUPPORT_SYNC_ISOCHRONOUS) 3836 3837 /*=============== LE Read Buffer Size V2 Command ===============*/ 3838 /** 3839 * @brief : Read the maximum size of the data portion of HCI LE ACL Data Packets, ISO packets sent from the Host to the Controller . 3840 * 3841 * @param le_acl_data_pkt_length : Max length (in octets) of the data portion of each HCI ACL Data Packet that the controller is able to accept . 3842 * @param total_num_le_acl_data_pkts : Total number of HCI ACL Data Packets that can be stored in the data buffers of the controller . 3843 * @param iso_data_pkt_length : Max length (in octets) of the data portion of each HCI ISO Data Packet that the controller is able to accept . 3844 * @param total_num_iso_data_pkts : Total number of HCI ISO Data Packets that can be stored in the data buffers of the controller . 3845 * 3846 * @retval ble_stat_t : Command status. 3847 */ 3848 ble_stat_t ll_intf_le_read_buffer_size_v2(uint16_t *le_acl_data_pkt_length, 3849 uint8_t *total_num_le_acl_data_pkts, uint16_t *iso_data_pkt_length, 3850 uint8_t *total_num_iso_data_pkts); 3851 3852 /** @} 3853 */ 3854 3855 /** @ingroup iso_cfg 3856 * @{ 3857 */ 3858 /*=============== LE Read ISO Tx Sync Command ===============*/ 3859 /** 3860 * @brief : is used to read the Time_Stamp and Time_Offset of a transmitted SDU identified 3861 * by the Packet_Sequence_Number on a CIS or BIS identified by the Connection_Handle parameter on the master or slave. 3862 * @param conn_hndl : contains the identifier of the Connection_Handler. 3863 * @param pkt_seq_num : contains the sequence number of a transmitted SDU 3864 * @param time_stamp : contains the time stamp of a transmitted SDU 3865 * @param time_ofst : contains the time offset of a transmitted SDU 3866 * 3867 * @retval ble_stat_t : Command status. 3868 */ 3869 ble_stat_t ll_intf_le_read_iso_tx_sync(uint16_t conn_hndl, uint16_t* pkt_seq_num, 3870 uint32_t *time_stamp,uint32_t * time_ofst); 3871 3872 /*=============== LE ISO Tx Test Command ===============*/ 3873 /** 3874 * @brief : is used to configure an established CIS or BIS specified by the Connection_Handle parameter, 3875 * and transmit test payloads which are generated by the Controller 3876 * @param conn_hndl : contains the identifier of the Connection_Handler. 3877 * @param pyld_t : defines the configuration of SDUs in the payload 3878 * 3879 * @retval ble_stat_t : Command status. 3880 */ 3881 ble_stat_t ll_intf_le_iso_tx_test(uint16_t conn_hndl, uint8_t pyld_t); 3882 #endif /* (SUPPORT_EXPLCT_BROADCASTER_ROLE|| SUPPORT_MASTER_CONNECTION || SUPPORT_SLAVE_CONNECTION) */ 3883 3884 3885 #if(SUPPORT_SYNC_ISOCHRONOUS || SUPPORT_MASTER_CONNECTION || SUPPORT_SLAVE_CONNECTION) 3886 3887 /*=============== LE Read ISO Link Quality Command ===============*/ 3888 /** 3889 * @brief : Read the maximum size of the data portion of HCI LE ACL Data Packets, ISO packets sent from the Host to the Controller . 3890 * 3891 * @param conn_hndl : connection handle of CIS or BIS. 3892 * @param ptr_read_iso_link_output : pointer to structure that contains counters to be filled in the specified CIS Identified by the cis_hndl . 3893 * 3894 * @retval ble_stat_t : Command status. 3895 */ 3896 ble_stat_t ll_intf_le_read_iso_link_quality(uint16_t conn_hndl, ble_intf_read_iso_link_cmd_st * ptr_read_iso_link_output); 3897 3898 /*=============== LE ISO Rx Test Command ===============*/ 3899 /** 3900 * @brief : (This command should only be used for testing purposes) is used to configure an established CIS 3901 * or a synchronized BIG specified by the Connection_Handle parameter to receive payloads 3902 * @param conn_hndl : contains the identifier of the Connection_Handler. 3903 * @param pyld_t : defines the configuration of SDUs in the payload 3904 * 3905 * @retval ble_stat_t : Command status. 3906 */ 3907 ble_stat_t ll_intf_le_iso_rx_test(uint16_t conn_hndl, uint8_t pyld_t); 3908 3909 /*=============== LE ISO Rx Test Counetrs Command ===============*/ 3910 /** 3911 * @brief : (This command should only be used for testing purposes) is used to read the test counters ) in the Controller which is configured in 3912 * ISO Receive Test mode for a CIS or BIS specified by the Connection_Handle. 3913 * @param conn_hndl : contains the identifier of the Connection_Handler. 3914 * @param rcvd_pckt_cntr : number of received packets 3915 * @param missed_pckt_cntr : number of missed packets 3916 * @param failed_pckt_cntr : number of failed packets 3917 * 3918 * @retval ble_stat_t : Command status. 3919 */ 3920 ble_stat_t ll_intf_le_iso_read_test_cntrs(uint16_t conn_hndl, uint32_t* rcvd_pckt_cntr, uint32_t * missed_pckt_cntr, uint32_t *failed_pckt_cntr ); 3921 #endif /* (SUPPORT_EXPLCT_OBSERVER_ROLE || SUPPORT_MASTER_CONNECTION || SUPPORT_SLAVE_CONNECTION) */ 3922 3923 #endif /* (SUPPORT_CONNECTED_ISOCHRONOUS &&( SUPPORT_MASTER_CONNECTION || SUPPORT_SLAVE_CONNECTION)) \ 3924 ||(SUPPORT_BRD_ISOCHRONOUS || SUPPORT_SYNC_ISOCHRONOUS) */ 3925 3926 /*=============== LE Set EcoSystem Base Interval Command ===============*/ 3927 /** 3928 * @brief : TheSet EcoSystem Base Interval Command is used by the Host to hint the controller with the best radio period 3929 * 3930 * @param interval : hinted interval from the host 3931 * 3932 * @retval ble_stat_t : Command status. 3933 */ 3934 ble_stat_t ll_intf_set_ecosystem_base_interval(uint16_t interval); 3935 /** @} 3936 */ 3937 3938 /*##### Curb Sleep State Commands Group #####*/ 3939 /** @ingroup curb_sleep_ll_intf 3940 * @{ 3941 */ 3942 /*=============== Curb Sleep State Command ===============*/ 3943 /** 3944 * @brief Forwards to llhwc_cmn to take decision whether to prevent device form 3945 * entering sleep state 3946 * 3947 * @param state [in]: Enable/Disable preventing sleep state mode 3948 * 3949 * @retval ble_state_t : Command status 3950 */ 3951 ble_stat_t ll_intf_curb_sleep_state(uint8_t state); 3952 /** @} 3953 */ 3954 3955 /** @ingroup vendor_cfg Vendor Specific Commands 3956 * @{ 3957 */ 3958 /*=============== Configure LL Context Control Command ===============*/ 3959 /** 3960 * @brief Used to configure the LL contexts, where: 3961 * 1. For bare-metal: 3962 * - High ISR is executed in the ISR context 3963 * - Low ISR can be executed in the high ISR context, or switched to low ISR context 3964 * 2. For RTOS: 3965 * - High ISR is executed in the ISR context 3966 * - Low ISR is executed in the thread of the "linkLayerHighPrioTask" 3967 * 3968 * @param allow_low_isr : [in] Configuration parameter for the context of the low ISR in the bare-metal model. Range is [0,1]. 3969 * 0: Low ISR code is executed in the same context of the high ISR. 3970 * 1: Low ISR code is executed in the context of the low ISR (by configuring a low priority interrupt that is triggered by FW). 3971 * @param run_post_evnt_frm_isr : [in] Configuration parameter to decide whether the scheduling of the next BLE event is done in the low ISR context or to be handled by the LL main thread. Range is [0,1]. 3972 * 0: BLE next event scheduling is handled in the LL main thread. 3973 * 1: BLE next event scheduling is handled in the low ISR context. 3974 * 3975 * @retval ble_state_t : Command status 3976 */ 3977 ble_stat_t ll_intf_config_ll_ctx_params(uint8_t allow_low_isr, uint8_t run_post_evnt_frm_isr); 3978 3979 3980 3981 /** 3982 * @brief Get the value of link layer timer in microsecond aligned with sleep timer clock edge 3983 * Microsecond timing can be calculated as Return value (steps) * Multiplier /divider taking into consideration to implement calculation in good accuracy 3984 * 3985 * @param multiplier : Value that should be multiplied by the return steps 3986 * @param divider : the product of the steps and multiplier should be divided by this value 3987 * 3988 * @retval number of steps : Read number of steps. 3989 * @note Caller should call it in a critical section to make sure the timing is not drifted by interrupt serving 3990 */ 3991 uint32_t ll_intf_get_aligned_us_now(uint32_t* multiplier , uint32_t *divider); 3992 /**@} 3993 */ 3994 3995 #if SUPPORT_PTA 3996 /*##### Packet Traffic Arbitration (PTA) Commands Group #####*/ 3997 /** @ingroup pta_ll_intf 3998 * @{ 3999 */ 4000 /** 4001 * @brief Initializes the PTA init 4002 * 4003 * @param request_to_event_time :[IN] Time between the request signal assertion 4004 * and beginning of event on air. 4005 * 4006 * @retval INVALID_HCI_COMMAND_PARAMETERS: 4007 * If request to event time is not in range 20us to MIN(Tx Config / Rx Config) 4008 * @retval COMMAND_DISALLOWED: All other PTA error codes 4009 * @retval SUCCESS: Otherwise 4010 */ 4011 ble_stat_t ll_intf_pta_init( 4012 const uint8_t request_to_event_time); 4013 4014 /** 4015 * @brief Enables the PTA in the hardware 4016 * 4017 * @param enable: [IN] Enable/Disable Indicator 4018 * 4019 * @retval COMMAND_DISALLOWED: If events exist in the system or the pta_enable 4020 * returns any error code. 4021 * @retval SUCCESS: Otherwise 4022 */ 4023 ble_stat_t ll_intf_pta_enable( 4024 const uint8_t enable); 4025 4026 #if (SUPPORT_MASTER_CONNECTION || SUPPORT_SLAVE_CONNECTION || \ 4027 (SUPPORT_LE_PERIODIC_ADVERTISING && (SUPPORT_EXPLCT_OBSERVER_ROLE || SUPPORT_SYNC_ISOCHRONOUS))) 4028 /** 4029 * @brief Priority configuration function for the ACL and Periodic Scan events 4030 * 4031 * @param event_type :[IN] Either ACL or Periodic Scan event. 4032 * @param handle :[IN] ACL Handle or Periodic Scan Handle. 4033 * @param priority :[IN] Determines the state of each priority mode. 4034 * @param priority_mask :[IN] Determines which priorities are in effect in 4035 * the priority variable. 4036 * @param acl_multi_slot_nbr_of_packets :[IN] Number of protected slots. 4037 * @param link_loss_limit_timeout :[IN] Timeout percentage for link loss mode 4038 * 4039 * @retval COMMAND_DISALLOWED: If the PTA is not enabled. 4040 * @retval INVALID_HCI_COMMAND_PARAMETERS: For all the other PTA error codes. 4041 * @retval SUCCESS: Otherwise 4042 */ 4043 ble_stat_t ll_intf_pta_ble_set_link_coex_priority( 4044 const pta_link_coex_event_type event_type, 4045 const uint16_t handle, 4046 const uint32_t priority, 4047 const uint32_t priority_mask, 4048 const uint8_t acl_multi_slot_nbr_of_packets, 4049 const uint8_t link_loss_limit_timeout); 4050 #endif /* (SUPPORT_MASTER_CONNECTION || SUPPORT_SLAVE_CONNECTION || \ 4051 (SUPPORT_LE_PERIODIC_ADVERTISING && (SUPPORT_EXPLCT_OBSERVER_ROLE || SUPPORT_SYNC_ISOCHRONOUS))) */ 4052 4053 #if (SUPPORT_BRD_ISOCHRONOUS || SUPPORT_SYNC_ISOCHRONOUS || (SUPPORT_CONNECTED_ISOCHRONOUS)) 4054 4055 /** 4056 * @brief Priority configuration function for the BIG and CIG events. 4057 * 4058 * @param iso_type :[IN] Either BIG or CIG event. 4059 * @param group_id :[IN] Isochronous Group ID. 4060 * @param priority :[IN] Determines the state of each priority mode. 4061 * @param priority_mask :[IN] Determines which priorities are in effect in 4062 * the priority variable. 4063 * @param link_loss_limit_timeout :[IN] Timeout percentage for link loss mode 4064 * 4065 * @retval COMMAND_DISALLOWED: If the PTA is not enabled. 4066 * @retval INVALID_HCI_COMMAND_PARAMETERS: For all the other PTA error codes. 4067 * @retval SUCCESS: Otherwise 4068 */ 4069 ble_stat_t ll_intf_pta_ble_set_iso_coex_priority( 4070 const pta_iso_type iso_type, 4071 const uint8_t group_id, 4072 const uint32_t priority, 4073 const uint32_t priority_mask, 4074 const uint8_t link_loss_limit_timeout); 4075 #endif /* (SUPPORT_BRD_ISOCHRONOUS || SUPPORT_SYNC_ISOCHRONOUS || (SUPPORT_CONNECTED_ISOCHRONOUS)) */ 4076 4077 /** 4078 * @brief Generic Priority configuration function. 4079 * 4080 * @param priority :[IN] Determines the state of each priority mode. 4081 * @param priority_mask :[IN] Determines which priorities are in effect in 4082 * the priority variable. 4083 * 4084 * @retval COMMAND_DISALLOWED: If the PTA is not enabled. 4085 * @retval INVALID_HCI_COMMAND_PARAMETERS: For all the other PTA error codes. 4086 * @retval SUCCESS: Otherwise 4087 */ 4088 ble_stat_t ll_intf_pta_ble_set_coex_priority( 4089 const uint32_t priority, 4090 const uint32_t priority_mask); 4091 /** @} 4092 */ 4093 #endif /* SUPPORT_PTA */ 4094 4095 /** @ingroup vendor_cfg Vendor Specific Commands 4096 * @{ 4097 */ 4098 /** 4099 * @brief this function is used to Start unmodulated carrier Mode 4100 * @param channel : input to selected channel from 0 to 39 4101 * @param offset : offset will have a step of 244 hz 4102 * from -8196 steps(around -2Mhz) to 8196 steps(around 2Mhz) 4103 * @param phy : rate to start unmodulated carrier mode on ( LE_1M , LE_2M ) 4104 * @param Tx_power_level : indicate TX Power level. 4105 * @retval status. 4106 */ 4107 ble_stat_t ll_init_start_unmod_carrier(uint8_t channel, int16_t offset , uint8_t phy, int8_t tx_power_level); 4108 /*=========== End working phy mode (continuous modulation mode or unmodulated carrier mode) ============*/ 4109 /** 4110 * @brief function to check and stop the running phy mode in case of a new event is 4111 * started while the continuous modulation mode or unmodulated carrier mode is running 4112 * @retval status. 4113 */ 4114 ble_stat_t ll_init_stop_unmod_carrier(void); 4115 4116 /** 4117 * @brief this function is used to Start continuous DTM Mode 4118 * @param ch_index : Logical channel index of DTM . 4119 * @param packet_payload : DTM pay-load type. 4120 * @param phy : PHY type, 1M/2M/coded PHY. 4121 * @param Tx_power_level : indicate TX Power level. 4122 * @retval status. 4123 */ 4124 ble_stat_t ll_init_start_cont_dtm(uint8_t ch_index, uint8_t phy, uint8_t packet_payload, int8_t tx_power_level); 4125 /** 4126 * @brief this function is used to Read Register from Phy 4127 * @param phy_reg : Address of register . 4128 * @param value : Pointer to store value of register in it. 4129 * @retval status. 4130 * @note this APi should be called after curb sleep to have a proper 4131 * functionality as it should be called after PHY is started 4132 * ,otherwise, it will return COMMAND_DISALLOWED 4133 */ 4134 ble_stat_t ll_intf_le_read_phy_reg(uint8_t phy_reg, uint8_t* value); 4135 4136 /** 4137 * @brief this function is used to Write value in Register of Phy 4138 * @param phy_reg : Address of register . 4139 * @param value : value to be stored in register. 4140 * @retval status. 4141 * @note this APi should be called after curb sleep to have a proper 4142 * functionality as it should be called after PHY is started 4143 * ,otherwise, it will return COMMAND_DISALLOWED 4144 */ 4145 ble_stat_t ll_intf_le_write_phy_reg(uint8_t phy_reg, uint8_t value); 4146 4147 /** 4148 * @brief flag to the LL the existence of a temperature sensor 4149 * @retval status 4150 */ 4151 void ll_intf_set_temperature_sensor_state(void); 4152 /** 4153 * @brief set the current temperature 4154 * @param temperature : The current temperature 4155 * @retval status 4156 */ 4157 uint32_t ll_intf_set_temperature_value(uint32_t temperature); 4158 /** 4159 * @brief This function returns the number of packets sent in Direct Test Mode. 4160 * @param[out] packet_number : number of packets 4161 * @retval ble_stat_t : Command status. 4162 * @note the value will not be cleared until the next Direct TX test starts. 4163 */ 4164 ble_stat_t ll_intf_le_tx_test_packet_number(uint32_t* packet_number); 4165 4166 /** 4167 * @brief This function returns the value of rssi. 4168 * @param[out] rssi : rssi value 4169 * @retval ble_stat_t : Command status. 4170 */ 4171 ble_stat_t ll_intf_read_raw_rssi(int32_t* rssi); 4172 4173 /*=============== Set Tx Free Carrier Command ===============*/ 4174 /** 4175 * @brief Set Tx free carrier mode . 4176 * This function is used ot disable or enable Transmit Free carrier on a given channel 4177 * @note this API should only be called if there is no events registered ( for example , Advertising , Connection, etc..) 4178 * 4179 * @param enable : [in] input argument to control TX free carrier mode 4180 * True --> start transmission of free carrier on specific channel 4181 * False --> Stop transmission of free carrier if it is already started 4182 * 4183 * @param channel_idx : [in] RF channel index of the used channel 4184 * 4185 * @retval ble_stat_t : Command status to be sent to the Host. 4186 */ 4187 ble_stat_t ll_intf_set_tx_free_carrier(uint8_t enable, uint8_t channel_idx); 4188 4189 #if(END_OF_RADIO_ACTIVITY_REPORTING) 4190 /** 4191 * @brief This function sets the bitmask associated to END_OF_RADIO_ACTIVITY_EVENT. 4192 * Only the radio activities enabled in the mask will be reported to application by 4193 * END_OF_RADIO_ACTIVITY_EVENT. 4194 * 4195 * @param[in] mask : bitmask of the events, the mask can take one of the following 4196 * values (or a bitwise OR of them in case of a mask for multiple events) 4197 * (0x0001) idle 4198 * (0x0002) advertising and extended advertising events 4199 * (0x0004) peripeheral in connection state event 4200 * (0x0008) scanning and extended scanning events 4201 * (0x0020) central in connection state event 4202 * (0x0200) periodic advertising event 4203 * (0x0400) periodic scanning event 4204 * (0x0800) isochronous broadcast advertising event 4205 * (0x1000) isochronous broadcast scanning event 4206 * (0x2000) peripheral in isochronous connection state event 4207 * (0x4000) central in isochronous connection state event 4208 * note that the following values are reserved and will be ignored upon recepient 4209 * (0x0010, 0x0040, 0x0080, 0x0100, 0x8000) 4210 * 4211 * @retval ble_stat_t : Command status. 4212 */ 4213 ble_stat_t ll_intf_set_end_of_activity_mask(uint16_t mask); 4214 #endif /* END_OF_RADIO_ACTIVITY_REPORTING */ 4215 4216 /** 4217 * @brief This function returns the status of the 8 BLE links managed by the device. 4218 * @param[out] sm_status : pointer to array of per running state machine status. 4219 * @param[out] link_conn_handle : pointer to array of per running state machine handle. 4220 * @retval ble_stat_t : Command status. 4221 */ 4222 ble_stat_t ll_intf_get_link_status(uint8_t *sm_status, uint8_t *link_conn_handle); 4223 4224 #if (SUPPORT_MASTER_CONNECTION && SUPPORT_CHANNEL_CLASSIFICATION) 4225 /** 4226 * @brief this function is used control the channel reporting mode of the controller 4227 * @param[in] conn_handle_id : identifier of the connection. 4228 * @param[in] ptr_reporting_params : pointer to structure holding the reporting parameters as follows: 4229 * report_mode : reporting mode value. 4230 * 0 : disable 4231 * 1 : enable 4232 * min_spacing :min spacing value (min time between 4233 * 2 consecutive LL_CHANNEL_STATUS 4234 * "unit of 200 ms") 4235 * 5 (1 sec) <= min_spacing <= 150 (30 sec) 4236 * max_delay :max delay value (max time between 4237 * channel classification change and 4238 * LL_CHANNEL_STATUS sending "unit of 200 ms") 4239 * 5 (1 sec) <= max_delay <= 150 (30 sec) 4240 * @retval status. 4241 */ 4242 ble_stat_t ll_intf_cntrl_chnl_clsfction_report(uint16_t conn_handle_id, void *ptr_reporting_params); 4243 #endif /* (SUPPORT_MASTER_CONNECTION && SUPPORT_CHANNEL_CLASSIFICATION) */ 4244 4245 #if SUPPORT_LE_ENHANCED_CONN_UPDATE 4246 /*=============== LE Set Default Subrate Parameters ===============*/ 4247 /** 4248 * @brief Used to save default subrate parameters to be used to test the future incoming subrate requests from the slave against them to decide whether to accept or reject them 4249 * 4250 * @param subrate_default_params : [in] pointer to structure includes all subrate default parameters from the host. 4251 * 4252 * @retval Status(0:SUCCESS, 0xXX:ERROR_CODE).. 4253 */ 4254 ble_stat_t ll_intf_le_set_default_subrate( 4255 subrate_default_params_t * subrate_default_params 4256 ); 4257 /*=============== LE Subrate Request ===============*/ 4258 /** 4259 * @brief Used to process the subrate request from the host to start the subrate procedure based on the current controller role in the input connection. 4260 * 4261 * @param conn_handle_id : [in] the identifier of the ACL connection to start the subrate procedure on it. 4262 * 4263 * @param subrate_default_params : [in] structure includes all subrate parameters from the host to start the procedure based on them. 4264 * 4265 * @retval Status(0:SUCCESS, 0xXX:ERROR_CODE). 4266 */ 4267 ble_stat_t ll_intf_le_subrate_req( 4268 uint16_t conn_handle , 4269 subrate_default_params_t subrate_requested_param 4270 ); 4271 #endif /* SUPPORT_LE_ENHANCED_CONN_UPDATE */ 4272 4273 /** @} 4274 */ 4275 4276 /** 4277 * @ingroup pawr_custom 4278 * @{ 4279 */ 4280 4281 4282 /** @} 4283 */ 4284 4285 /** @ingroup pawr 4286 * @{ 4287 */ 4288 4289 /** 4290 * @} 4291 */ 4292 4293 #if SUPPORT_HCI_EVENT_ONLY 4294 4295 /* 4296 * @brief register callback to be called on LL queue is full 4297 * @param cbk: host callback 4298 * @retval None 4299 * */ 4300 void ll_intf_rgstr_hst_cbk_ll_queue_full(hst_cbk_queue_full cbk); 4301 4302 /* 4303 * @brief register callback to be called sending data to host 4304 * @param upper_layer_cbk: host callback 4305 * @retval None 4306 * */ 4307 void ll_intf_rgstr_hst_cbk(hst_cbk upper_layer_cbk); 4308 4309 typedef union _change_state_options_t 4310 { 4311 uint8_t combined_value; 4312 struct { 4313 uint8_t allow_generic_event: 1; 4314 uint8_t allow_acl_data: 1; 4315 uint8_t allow_iso_data: 1; 4316 uint8_t allow_reports: 1; 4317 uint8_t rfu: 4; 4318 } bitfield; 4319 } change_state_options_t; 4320 /** 4321 * @brief This function is used to indicate to the LL that the host 4322 * is ready to receive events as indicated by options parameter 4323 * @param options: [In] bit-field to set specific events on 4324 * @retval None 4325 */ 4326 void ll_intf_chng_evnt_hndlr_state(change_state_options_t options); 4327 4328 4329 4330 4331 /* 4332 * @brief sets the event mask in hci event only configuration 4333 * @param event_mask : [In] an array of 8 bytes representing new event mask 4334 * @retval: None 4335 * */ 4336 void ll_intf_set_event_mask(uint8_t event_mask[8]); 4337 4338 /* 4339 * @brief sets page2 event mask in hci event only configuration 4340 * @param event_mask : [In] an array of 8 bytes representing new event mask 4341 * @retval: None 4342 * */ 4343 void ll_intf_set_event_mask_page2(uint8_t event_mask[8]); 4344 4345 4346 /* 4347 * @brief sets the LE event mask in hci event only configuration 4348 * @param event_mask : [In] an array of 8 bytes representing new event mask 4349 * @retval: None 4350 * */ 4351 void ll_intf_set_le_event_mask(uint8_t event_mask[8]); 4352 4353 4354 /* 4355 * @brief Delete ACL/ISO data related to a specific connection handle 4356 * @param : [In] ACL or Cis or Bis conenction handle 4357 * @retval: UNKNOWN_CONNECTION_IDENTIF if conn_Handle doesn't belong to any state machine. False 4358 * if no data was found for conn_Handle and True if any data was deleted. 4359 * */ 4360 ble_stat_t ll_intf_clear_event(uint16_t conn_Handle); 4361 4362 /* 4363 * @brief sets the custom event mask in hci event only configuration 4364 * @param cstm_evnt_mask : [In] custom event mask bitfield 4365 * @retval: None 4366 * */ 4367 void ll_intf_set_custom_event_mask(uint8_t cstm_evnt_mask); 4368 4369 #endif /* SUPPORT_HCI_EVENT_ONLY */ 4370 /** @ingroup iso_cfg 4371 * @{ 4372 */ 4373 #if (SUPPORT_CONNECTED_ISOCHRONOUS && (SUPPORT_MASTER_CONNECTION || SUPPORT_SLAVE_CONNECTION)) 4374 /** 4375 * @brief register a callback function to be called on missed cig events, 4376 * the cbk reports the current cig id, number of accumulated missed 4377 * events and the anchor point of the next scheduled cig event 4378 * 4379 * @param cbk : [in] pointer to the callback function to be registered 4380 * 4381 * @retval None 4382 */ 4383 void ll_intf_rgstr_missed_cig_evnts_cbk(hst_cig_missed_evnt_cbk cbk); 4384 4385 #endif /* (SUPPORT_CONNECTED_ISOCHRONOUS && (SUPPORT_MASTER_CONNECTION || SUPPORT_SLAVE_CONNECTION)) */ 4386 4387 #if (SUPPORT_BRD_ISOCHRONOUS || SUPPORT_SYNC_ISOCHRONOUS) 4388 /** 4389 * @brief register a callback function to be called on missed big events, 4390 * the cbk reports the current big handle, number of accumulated missed 4391 * events and the anchor point of the next scheduled big event 4392 * 4393 * @param cbk : [in] pointer to the callback function to be registered 4394 * 4395 * @retval None 4396 */ 4397 void ll_intf_rgstr_missed_big_evnts_cbk(hst_big_missed_evnt_cbk cbk); 4398 4399 #endif /* (SUPPORT_BRD_ISOCHRONOUS || SUPPORT_SYNC_ISOCHRONOUS) */ 4400 /**@} 4401 */ 4402 /** @ingroup vendor_cfg Vendor Specific Commands 4403 * @{ 4404 */ 4405 #if (SUPPORT_AOA_AOD) 4406 4407 /** 4408 * @brief Set the number of antennas to be used by the controller, number of 4409 * antennas is used as an upper limit for antenna_id set by the host 4410 * 4411 * @param num_of_antennas: [in] number of antennas 4412 * 4413 * @retval status : [out] 0:SUCCESS, 0xXX:ERROR_CODE. 4414 */ 4415 ble_stat_t ll_intf_set_num_of_antennas(uint8_t num_of_antennas); 4416 4417 /** 4418 * @brief Get the number of antennas configured to the controller 4419 * 4420 * @param ptr_num_of_antennas: [out] pointer to a variable hold 4421 * number of antennas retrived 4422 * 4423 * @retval status : [out] 0:SUCCESS, 0xXX:ERROR_CODE. 4424 */ 4425 ble_stat_t ll_intf_get_num_of_antennas(uint8_t *ptr_num_of_antennas); 4426 4427 #endif /* SUPPORT_AOA_AOD */ 4428 4429 /** 4430 * @brief Set number of packets to be transmitted on DTM mode. 4431 * 4432 * @param pckt_count: [in] number of packets to be transmitter 4433 * 4434 * @note for non-zero values of pckt_count, DTM start on TX mode will trigger sending packets with the specified 4435 * number (pckt_count), if the value of pckt_count is Zero, DTM start on TX mode will trigger sending 4436 * indefinite number of packets untill subsequent DTM stop is called or HCI reset is sent. 4437 * 4438 * @retval status : [out] 0:SUCCESS, 0xXX:ERROR_CODE. 4439 */ 4440 ble_stat_t ll_intf_set_dtm_with_spcfc_pckt_count(uint16_t pckt_count); 4441 4442 /** 4443 * @brief used to update the event timing. 4444 * 4445 * @param p_evnt_timing[in]: pointer to structure containing the new Event timing requested from the Upper layer. 4446 * 4447 * @retval None 4448 */ 4449 void ll_intf_config_schdling_time(Evnt_timing_t * p_evnt_timing); 4450 /**@} 4451 */ 4452 4453 #endif /* INCLUDE_LL_INTF_H */ 4454