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