xref: /btstack/port/stm32-wb55xx-nucleo-freertos/Middlewares/STM32_WPAN/ble/core/auto/ble_hci_le.h (revision 0561b2d8d5dba972c7daa57d5e677f7a1327edfd)
1 /******************************************************************************
2  * @file    ble_hci_le.h
3  * @author  MCD Application Team
4  * @date    23 May 2019
5  * @brief   Header file for STM32WB (hci_le)
6  *          Auto-generated file: do not edit!
7  ******************************************************************************
8  * @attention
9  *
10  * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
11  * All rights reserved.</center></h2>
12  *
13  * This software component is licensed by ST under Ultimate Liberty license
14  * SLA0044, the "License"; You may not use this file except in compliance with
15  * the License. You may obtain a copy of the License at:
16  *                             www.st.com/SLA0044
17  *
18  ******************************************************************************
19  */
20 
21 #ifndef BLE_HCI_LE_H__
22 #define BLE_HCI_LE_H__
23 
24 
25 #include "ble_types.h"
26 
27 /**
28   * @brief The @ref hci_disconnect is used to terminate an existing connection. The
29 Connection_Handle command parameter indicates which connection is to be
30 disconnected. The Reason command parameter indicates the reason for ending
31 the connection. The remote Controller will receive the Reason command
32 parameter in the @ref hci_disconnection_complete_event event. All synchronous connections
33 on a physical link should be disconnected before the ACL connection on the
34 same physical connection is disconnected.
35 (See Bluetooth Specification v.5.0, Vol. 2, Part E, 7.1.6)
36 It is important to leave an 100 ms blank window before sending any new command (including system hardware reset),
37 since immediately after @ref hci_disconnection_complete_event event, system could save important information in non volatile memory.
38   * @param Connection_Handle Connection handle for which the command is given.
39   * Values:
40   - 0x0000 ... 0x0EFF
41   * @param Reason The reason for ending the connection.
42   * Values:
43   - 0x05: Authentication Failure
44   - 0x13: Remote User Terminated Connection
45   - 0x14: Remote Device Terminated Connection due to Low Resources
46   - 0x15: Remote Device Terminated Connection due to Power Off
47   - 0x1A: Unsupported Remote Feature
48   - 0x3B: Unacceptable Connection Parameters
49   * @retval Value indicating success or error code.
50 */
51 tBleStatus hci_disconnect(uint16_t Connection_Handle,
52                           uint8_t Reason);
53 
54 /**
55   * @brief This command will obtain the values for the version information for the remote
56 device identified by the Connection_Handle parameter. The Connection_Handle
57 must be a Connection_Handle for an ACL or LE connection.
58 (See Bluetooth Specification v.5.0, Vol. 2, Part E, 7.1.23)
59   * @param Connection_Handle Specifies which Connection_Handle's version information to get.
60   * Values:
61   - 0x0000 ... 0x0EFF
62   * @retval Value indicating success or error code.
63 */
64 tBleStatus hci_read_remote_version_information(uint16_t Connection_Handle);
65 
66 /**
67   * @brief The Set_Event_Mask command is used to control which events are generated
68 by the HCI for the Host.
69 
70 If the bit in the Event_Mask is set to a one, then the
71 event associated with that bit will be enabled. For an LE Controller, the LE
72 Meta Event bit in the Event_Mask shall enable or disable all LE events in the
73 LE Meta Event (see Section 7.7.65). The Host has to deal with each event that
74 occurs. The event mask allows the Host to control how much it is interrupted.
75 (See Bluetooth Specification v.5.0, Vol. 2, Part E, 7.3.1)
76   * @param Event_Mask Event mask. Default: 0x20001FFFFFFFFFFF
77   * Flags:
78   - 0x0000000000000000: No events specified
79   - 0x0000000000000001: Inquiry Complete Event
80   - 0x0000000000000002: Inquiry Result Event
81   - 0x0000000000000004: Connection Complete Event
82   - 0x0000000000000008: Connection Request Event
83   - 0x0000000000000010: Disconnection Complete Event
84   - 0x0000000000000020: Authentication Complete Event
85   - 0x0000000000000040: Remote Name Request Complete Event
86   - 0x0000000000000080: Encryption Change Event
87   - 0x0000000000000100: Change Connection Link Key Complete Event
88   - 0x0000000000000200: Master Link Key Complete Event
89   - 0x0000000000000400: Read Remote Supported Features Complete Event
90   - 0x0000000000000800: Read Remote Version Information Complete Event
91   - 0x0000000000001000: QoS Setup Complete Event
92   - 0x0000000000008000: Hardware Error Event
93   - 0x0000000000010000: Flush Occurred Event
94   - 0x0000000000020000: Role Change Event
95   - 0x0000000000080000: Mode Change Event
96   - 0x0000000000100000: Return Link Keys Event
97   - 0x0000000000200000: PIN Code Request Event
98   - 0x0000000000400000: Link Key Request Event
99   - 0x0000000000800000: Link Key Notification Event
100   - 0x0000000001000000: Loopback Command Event
101   - 0x0000000002000000: Data Buffer Overflow Event
102   - 0x0000000004000000: Max Slots Change Event
103   - 0x0000000008000000: Read Clock Offset Complete Event
104   - 0x0000000010000000: Connection Packet Type Changed Event
105   - 0x0000000020000000: QoS Violation Event
106   - 0x0000000040000000: Page Scan Mode Change Event
107   - 0x0000000080000000: Page Scan Repetition Mode Change Event
108   - 0x0000000100000000: Flow Specification Complete Event
109   - 0x0000000200000000: Inquiry Result with RSSI Event
110   - 0x0000000400000000: Read Remote Extended Features Complete Event
111   - 0x0000080000000000: Synchronous Connection Complete Event
112   - 0x0000100000000000: Synchronous Connection Changed Event
113   - 0x0000200000000000: Sniff Subrating Event
114   - 0x0000400000000000: Extended Inquiry Result Event
115   - 0x0000800000000000: Encryption Key Refresh Complete Event
116   - 0x0001000000000000: IO Capability Request Event
117   - 0x0002000000000000: IO Capability Request Reply Event
118   - 0x0004000000000000: User Confirmation Request Event
119   - 0x0008000000000000: User Passkey Request Event
120   - 0x0010000000000000: Remote OOB Data Request Event
121   - 0x0020000000000000: Simple Pairing Complete Event
122   - 0x0080000000000000: Link Supervision Timeout Changed Event
123   - 0x0100000000000000: Enhanced Flush Complete Event
124   - 0x0400000000000000: User Passkey Notification Event
125   - 0x0800000000000000: Keypress Notification Event
126   - 0x1000000000000000: Remote Host Supported Features Notification Event
127   - 0x2000000000000000: LE Meta-Event
128   * @retval Value indicating success or error code.
129 */
130 tBleStatus hci_set_event_mask(uint8_t Event_Mask[8]);
131 
132 /**
133   * @brief The Reset command will reset the Link Layer on an LE
134 Controller.
135 
136 The Reset command shall not affect the used HCI transport layer since the HCI transport
137 layers may have reset mechanisms of their own. After the reset is completed,
138 the current operational state will be lost, the Controller will enter standby mode
139 and the Controller will automatically revert to the default values for the parameters
140 for which default values are defined in the specification.
141 Note: The Reset command will not necessarily perform a hardware reset. This
142 is implementation defined.
143 The Host shall not send additional HCI commands before the Command Complete
144 event related to the Reset command has been received.
145 (See Bluetooth Specification v.5.0, Vol. 2, Part E, 7.3.2)
146   * @retval Value indicating success or error code.
147 */
148 tBleStatus hci_reset(void);
149 
150 /**
151   * @brief This command reads the values for the Transmit_Power_Level parameter for
152 the specified Connection_Handle. The Connection_Handle shall be a Connection_Handle
153 for an ACL connection.
154 (See Bluetooth Specification v.5.0, Vol. 2, Part E, 7.3.35)
155   * @param Connection_Handle Specifies which Connection_Handle's Transmit Power Level setting to read.
156   * Values:
157   - 0x0000 ... 0x0EFF
158   * @param Type Current or maximum transmit power level.
159   * Values:
160   - 0x00: Read Current Transmit Power Level.
161   - 0x01: Read Maximum Transmit Power Level.
162   * @param[out] Transmit_Power_Level Size: 1 Octet (signed integer)
163 Units: dBm
164   * Values:
165   - -30 ... 20
166   * @retval Value indicating success or error code.
167 */
168 tBleStatus hci_read_transmit_power_level(uint16_t Connection_Handle,
169                                          uint8_t Type,
170                                          uint8_t *Transmit_Power_Level);
171 
172 /**
173   * @brief This command is used by the Host to turn flow control on or off for data and/or
174 voice sent in the direction from the Controller to the Host. If flow control is turned
175 off, the Host should not send the Host_Number_Of_Completed_Packets
176 command. That command will be ignored by the Controller if it is sent by the
177 Host and flow control is off. If flow control is turned on for HCI ACL Data Packets
178 and off for HCI synchronous Data Packets,
179 Host_Number_Of_Completed_Packets commands sent by the Host should only
180 contain Connection_Handles for ACL connections. If flow control is turned off for
181 HCI ACL Data Packets and on for HCI synchronous Data Packets,
182 Host_Number_Of_Completed_Packets commands sent by the Host should only
183 contain Connection_Handles for synchronous connections. If flow control is
184 turned on for HCI ACL Data Packets and HCI synchronous Data Packets, the
185 Host will send Host_Number_Of_Completed_Packets commands both for ACL
186 connections and synchronous connections.
187 The Flow_Control_Enable parameter shall only be changed if no connections
188 exist. See Bluetooth Spec v.5.0, Vol. 2, Part E, 7.3.38
189   * @param Flow_Control_Enable Enable/Disable the Flow Control
190   * Values:
191   - 0x00: Flow control off in direction from Controller to Host. Default.
192   - 0x01: Flow control on for HCI ACL Data Packets and off for HCI synchronous.Data Packets in direction from Controller to Host.
193   - 0x02: Flow control off for HCI ACL Data Packets and on for HCI synchronous.Data Packets in direction from Controller to Host.
194   - 0x03: Flow control on both for HCI ACL Data Packets and HCI synchronous.Data Packets in direction from Controller to Host.
195   * @retval Value indicating success or error code.
196 */
197 tBleStatus hci_set_controller_to_host_flow_control(uint8_t Flow_Control_Enable);
198 
199 /**
200   * @brief The Host_Buffer_Size command is used by the Host to notify the Controller
201 about the maximum size of the data portion of HCI ACL and synchronous Data
202 Packets sent from the Controller to the Host. The Controller shall segment the
203 data to be transmitted from the Controller to the Host according to these sizes,
204 so that the HCI Data Packets will contain data with up to these sizes. The
205 Host_Buffer_Size command also notifies the Controller about the total number
206 of HCI ACL and synchronous Data Packets that can be stored in the data
207 buffers of the Host. If flow control from the Controller to the Host is turned off,
208 and the Host_Buffer_Size command has not been issued by the Host, this
209 means that the Controller will send HCI Data Packets to the Host with any
210 lengths the Controller wants to use, and it is assumed that the data buffer sizes
211 of the Host are unlimited. If flow control from the Controller to the Host is turned
212 on, the Host_Buffer_Size command shall after a power-on or a reset always be
213 sent by the Host before the first Host_Number_Of_Completed_Packets
214 command is sent.
215 The Set Controller To Host Flow Control Command is used to turn flow control
216 on or off. The Host_ACL_Data_Packet_Length command parameter will be
217 used to determine the size of the L2CAP segments contained in ACL Data
218 Packets, which are transferred from the Controller to the Host. The
219 Host_Synchronous_Data_Packet_Length command parameter is used to
220 determine the maximum size of HCI synchronous Data Packets. Both the Host
221 and the Controller shall support command and event packets, where the data
222 portion (excluding header) contained in the packets is 255 octets in size.
223 The Host_Total_Num_ACL_Data_Packets command parameter contains the
224 total number of HCI ACL Data Packets that can be stored in the data buffers of
225 the Host. The Controller will determine how the buffers are to be divided
226 between different Connection_Handles. The Host_Total_Num_Synchronous_
227 Data_Packets command parameter gives the same information for HCI
228 synchronous Data Packets.
229 Note: The Host_ACL_Data_Packet_Length and Host_Synchronous_Data_
230 Packet_Length command parameters do not include the length of the HCI Data
231 Packet header. See Bluetooth Spec v.5.0, Vol. 2, Part E, 7.3.39
232   * @param Host_ACL_Data_Packet_Length Maximum length (in octets) of the data portion of each HCI ACL Data Packet that the Host is able to accept. Must be greater or equal to 251 bytes
233   * @param Host_Synchronous_Data_Packet_Length Maximum length (in octets) of the data portion of each HCI synchronous Data Packet that the Host is able to accept.
234   * @param Host_Total_Num_ACL_Data_Packets Total number of HCI ACL Data Packets that can be stored in the data buffers of the Host.
235   * @param Host_Total_Num_Synchronous_Data_Packets Total number of HCI synchronous Data Packets that can be stored in the data buffers of the Host.
236   * @retval Value indicating success or error code.
237 */
238 tBleStatus hci_host_buffer_size(uint16_t Host_ACL_Data_Packet_Length,
239                                 uint8_t Host_Synchronous_Data_Packet_Length,
240                                 uint16_t Host_Total_Num_ACL_Data_Packets,
241                                 uint16_t Host_Total_Num_Synchronous_Data_Packets);
242 
243 /**
244   * @brief The Host_Number_Of_Completed_Packets command is used by the Host to
245 indicate to the Controller the number of HCI Data Packets that have been
246 completed for each Connection_Handle since the previous Host_Number_Of_
247 Completed_Packets command was sent to the Controller. This means that the
248 corresponding buffer space has been freed in the Host. Based on this
249 information, and the Host_Total_Num_ACL_Data_Packets and
250 Host_Total_Num_Synchronous_Data_Packets command parameters of the
251 Host_Buffer_Size command, the Controller can determine for which
252 Connection_Handles the following HCI Data Packets should be sent to the
253 Host. The command should only be issued by the Host if flow control in the
254 direction from the Controller to the Host is on and there is at least one
255 connection, or if the Controller is in local loopback mode. Otherwise, the
256 command will be ignored by the Controller. When the Host has completed one
257 or more HCI Data Packet(s) it shall send a
258 Host_Number_Of_Completed_Packets command to the Controller, until it
259 finally reports that all pending HCI Data Packets have been completed. The
260 frequency at which this command is sent is manufacturer specific.
261 The Set Controller To Host Flow Control Command is used to turn flow control on
262 or off. If flow control from the Controller to the Host is turned on, the
263 Host_Buffer_Size command shall always be sent by the Host after a power-on or
264 a reset before the first Host_Number_Of_Completed_Packets command is sent.
265 Note: The Host_Number_Of_Completed_Packets command is a special
266 command in the sense that no event is normally generated after the command
267 has completed. The command may be sent at any time by the Host when there
268 is at least one connection, or if the Controller is in local loopback mode
269 independent of other commands. The normal flow control for commands is not
270 used for the Host_Number_Of_Completed_Packets command. See Bluetooth Spec v.5.0, Vol. 2, Part E, 7.3.40
271   * @param Number_Of_Handles The number of Connection_Handles and Host_Num_Of_Completed_Packets
272 parameters pairs contained in this command.
273   * Values:
274   - 0 ... 255
275   * @param Host_Nb_Of_Completed_Pkt_Pair See @ref Host_Nb_Of_Completed_Pkt_Pair_t
276   * @retval Value indicating success or error code.
277 */
278 tBleStatus hci_host_number_of_completed_packets(uint8_t Number_Of_Handles,
279                                                 Host_Nb_Of_Completed_Pkt_Pair_t Host_Nb_Of_Completed_Pkt_Pair[]);
280 
281 /**
282   * @brief This command reads the values for the version information for the local Controller.
283 The HCI Version information defines the version information of the HCI layer.
284 The LMP/PAL Version information defines the version of the LMP or PAL. The
285 Manufacturer_Name information indicates the manufacturer of the local device.
286 The HCI Revision and LMP/PAL Subversion are implementation dependent.
287 (See Bluetooth Specification v.5.0, Vol. 2, Part E, 7.4.1)
288   * @param[out] HCI_Version See Bluetooth Assigned Numbers (https://www.bluetooth.org/en-us/specification/assigned-numbers)
289   * @param[out] HCI_Revision Revision of the Current HCI in the BR/EDR Controller.
290   * @param[out] LMP_PAL_Version Version of the Current LMP or PAL in the Controller.
291 See Bluetooth Assigned Numbers (https://www.bluetooth.org/en-us/specification/assigned-numbers)
292   * @param[out] Manufacturer_Name Manufacturer Name of the BR/EDR Controller.
293 See Bluetooth Assigned Numbers (https://www.bluetooth.org/en-us/specification/assigned-numbers)
294   * @param[out] LMP_PAL_Subversion Subversion of the Current LMP or PAL in the Controller. This value is
295 implementation dependent.
296   * @retval Value indicating success or error code.
297 */
298 tBleStatus hci_read_local_version_information(uint8_t *HCI_Version,
299                                               uint16_t *HCI_Revision,
300                                               uint8_t *LMP_PAL_Version,
301                                               uint16_t *Manufacturer_Name,
302                                               uint16_t *LMP_PAL_Subversion);
303 
304 /**
305   * @brief This command reads the list of HCI commands supported for the local Controller.
306 This command shall return the Supported_Commands configuration parameter.
307 It is implied that if a command is listed as supported, the feature underlying
308 that command is also supported.
309 (See Bluetooth Specification v.5.0, Vol. 2, Part E, 7.4.2)
310   * @param[out] Supported_Commands Bit mask for each HCI Command. If a bit is 1, the Controller supports the
311 corresponding command and the features required for the command.
312 Unsupported or undefined commands shall be set to 0.
313   * @retval Value indicating success or error code.
314 */
315 tBleStatus hci_read_local_supported_commands(uint8_t Supported_Commands[64]);
316 
317 /**
318   * @brief This command requests a list of the supported features for the local
319 Controller. This command will return a list of the LMP features. For details see
320 Part C, Link Manager Protocol Specification on page 227.
321 (See Bluetooth Specification v.5.0, Vol. 2, Part E, 7.4.3)
322   * @param[out] LMP_Features Bit Mask List of LMP features.
323   * @retval Value indicating success or error code.
324 */
325 tBleStatus hci_read_local_supported_features(uint8_t LMP_Features[8]);
326 
327 /**
328   * @brief On an LE Controller, this command shall read the Public Device Address as
329 defined in [Vol 6] Part B, Section 1.3, Device Address. If this Controller does
330 not have a Public Device Address, the value 0x000000000000 shall be
331 returned.
332 On an LE Controller, the public address shall be the same as the
333 BD_ADDR.
334 (See Bluetooth Specification v.5.0, Vol. 2, Part E, 7.4.6)
335   * @param[out] BD_ADDR BD_ADDR ( Bluetooth Device Address) of the Device.
336   * @retval Value indicating success or error code.
337 */
338 tBleStatus hci_read_bd_addr(uint8_t BD_ADDR[6]);
339 
340 /**
341   * @brief This command reads the Received Signal Strength Indication (RSSI) value from
342 a Controller.
343 For an LE transport, a Connection_Handle is used as the Handle command
344 parameter and return parameter. The meaning of the RSSI metric is an absolute
345 receiver signal strength value in dBm to +/- 6 dB accuracy. If the RSSI cannot
346 be read, the RSSI metric shall be set to 127.
347 (See Bluetooth Specification v.5.0, Vol. 2, Part E, 7.5.4)
348   * @param Connection_Handle Connection handle for which the command is given.
349   * Values:
350   - 0x0000 ... 0x0EFF
351   * @param[out] RSSI N Size: 1 Octet (signed integer)
352 Units: dBm
353   * Values:
354   - 127: RSSI not available
355   - -127 ... 20
356   * @retval Value indicating success or error code.
357 */
358 tBleStatus hci_read_rssi(uint16_t Connection_Handle,
359                          uint8_t *RSSI);
360 
361 /**
362   * @brief The LE_Set_Event_Mask command is used to control which LE events are
363 generated by the HCI for the Host. If the bit in the LE_Event_Mask is set to a
364 one, then the event associated with that bit will be enabled. The Host has to
365 deal with each event that is generated by an LE Controller. The event mask
366 allows the Host to control which events will interrupt it.
367 For LE events to be generated, the LE Meta-Event bit in the Event_Mask shall
368 also be set. If that bit is not set, then LE events shall not be generated, regardless
369 of how the LE_Event_Mask is set.
370 (See Bluetooth Specification v.5.0, Vol. 2, Part E, 7.8.1)
371   * @param LE_Event_Mask LE event mask. Default: 0x00000000000FFFFF.
372   * Flags:
373   - 0x0000000000000000: No LE events specified
374   - 0x0000000000000001: LE Connection Complete Event
375   - 0x0000000000000002: LE Advertising Report Event
376   - 0x0000000000000004: LE Connection Update Complete Event
377   - 0x0000000000000008: LE Read Remote Used Features Complete Event
378   - 0x0000000000000010: LE Long Term Key Request Event
379   - 0x0000000000000020: LE Remote Connection Parameter Request Event
380   - 0x0000000000000040: LE Data Length Change Event
381   - 0x0000000000000080: LE Read Local P-256 Public Key Complete Event
382   - 0x0000000000000100: LE Generate DHKey Complete Event
383   - 0x0000000000000200: LE Enhanced Connection Complete Event
384   - 0x0000000000000400: LE Direct Advertising Report Event
385   - 0x0000000000000800: LE PHY Update Complete Event
386   - 0x0000000000001000: LE Extended Advertising Report Event
387   - 0x0000000000002000: LE Periodic Advertising Sync Established Event
388   - 0x0000000000004000: LE Periodic Advertising Report Event
389   - 0x0000000000008000: LE Periodic Advertising Sync Lost Event
390   - 0x0000000000010000: LE Extended Scan Timeouout Event
391   - 0x0000000000020000: LE Extended Advertising Set Terminated Event
392   - 0x0000000000040000: LE Scan Request Received Event
393   - 0x0000000000080000: LE Channel Selection Algorithm Event
394   * @retval Value indicating success or error code.
395 */
396 tBleStatus hci_le_set_event_mask(uint8_t LE_Event_Mask[8]);
397 
398 /**
399   * @brief The LE_Read_Buffer_Size command is used to read the maximum size of the
400 data portion of HCI LE ACL Data Packets sent from the Host to the Controller.
401 The Host will segment the data transmitted to the Controller according to these
402 values, so that the HCI Data Packets will contain data with up to this size. The
403 LE_Read_Buffer_Size command also returns the total number of HCI LE ACL
404 Data Packets that can be stored in the data buffers of the Controller. The
405 LE_Read_Buffer_Size command must be issued by the Host before it sends
406 any data to an LE Controller (see Section 4.1.1).
407 If the Controller returns a length value of zero, the Host shall use the
408 Read_Buffer_Size command to determine the size of the data buffers
409 Note: Both the Read_Buffer_Size and LE_Read_Buffer_Size commands may
410 return buffer length and number of packets parameter values that are nonzero.
411 The HC_LE_ACL_Data_Packet_Length return parameter shall be used to
412 determine the size of the L2CAP PDU segments contained in ACL Data
413 Packets, which are transferred from the Host to the Controller to be broken up
414 into packets by the Link Layer. Both the Host and the Controller shall support
415 command and event packets, where the data portion (excluding header)
416 contained in the packets is 255 octets in size. The
417 HC_Total_Num_LE_ACL_Data_Packets return parameter contains the total
418 number of HCI ACL Data Packets that can be stored in the data buffers of the
419 Controller. The Host determines how the buffers are to be divided between
420 different Connection Handles.
421 Note: The HC_LE_ACL_Data_Packet_Length return parameter does not
422 include the length of the HCI Data Packet header.
423 (See Bluetooth Specification v.5.0, Vol. 2, Part E, 7.8.2)
424   * @param[out] HC_LE_ACL_Data_Packet_Length 0x0000 No dedicated LE Buffer - use Read_Buffer_Size command.
425 0x0001 - 0xFFFF Maximum length (in octets) of the data portion of each HCI ACL Data
426 Packet that the Controller is able to accept.
427   * @param[out] HC_Total_Num_LE_ACL_Data_Packets 0x00 No dedicated LE Buffer - use Read_Buffer_Size command.
428 0x01 - 0xFF Total number of HCI ACL Data Packets that can be stored in the data
429 buffers of the Controller.
430   * @retval Value indicating success or error code.
431 */
432 tBleStatus hci_le_read_buffer_size(uint16_t *HC_LE_ACL_Data_Packet_Length,
433                                    uint8_t *HC_Total_Num_LE_ACL_Data_Packets);
434 
435 /**
436   * @brief This command requests the list of the supported LE features for the Controller.
437 (See Bluetooth Specification v.5.0, Vol. 2, Part E, 7.8.3)
438   * @param[out] LE_Features Bit Mask List of LE features. See Core v5.0, Vol. 6, Part B, Section 4.6.
439   * @retval Value indicating success or error code.
440 */
441 tBleStatus hci_le_read_local_supported_features(uint8_t LE_Features[8]);
442 
443 /**
444   * @brief The LE_Set_Random_Address command is used by the Host to set the LE
445 Random Device Address in the Controller (see [Vol 6] Part B, Section 1.3).
446 (See Bluetooth Specification v.5.0, Vol. 2, Part E, 7.8.4)
447   * @param Random_Address Random Device Address.
448   * @retval Value indicating success or error code.
449 */
450 tBleStatus hci_le_set_random_address(uint8_t Random_Address[6]);
451 
452 /**
453   * @brief The LE_Set_Advertising_Parameters command is used by the Host to set the
454 advertising parameters.
455 The Advertising_Interval_Min shall be less than or equal to the Advertising_Interval_Max.
456 The Advertising_Interval_Min and Advertising_Interval_Max
457 should not be the same value to enable the Controller to determine the best
458 advertising interval given other activities.
459 For high duty cycle directed advertising, i.e. when Advertising_Type is 0x01
460 (ADV_DIRECT_IND, high duty cycle), the Advertising_Interval_Min and Advertising_Interval_Max
461 parameters are not used and shall be ignored.
462 The Advertising_Type is used to determine the packet type that is used for
463 advertising when advertising is enabled.
464 The Advertising_Interval_Min and Advertising_Interval_Max shall not be set to
465 less than 0x00A0 (100 ms) if the Advertising_Type is set to 0x02 (ADV_SCAN_IND)
466 or 0x03 (ADV_NONCONN_IND). The Own_Address_Type determines
467 if the advertising packets are identified with the Public Device Address of
468 the device, or a Random Device Address as written by the LE_Set_Random_Address
469 command.
470 If directed advertising is performed, i.e. when Advertising_Type is set to 0x01
471 (ADV_DIRECT_IND, high duty cycle) or 0x04 (ADV_DIRECT_IND, low duty
472 cycle mode), then the Direct_Address_Type and Direct_Address shall be valid,
473 otherwise they shall be ignored by the Controller and not used.
474 The Advertising_Channel_Map is a bit field that indicates the advertising channels
475 that shall be used when transmitting advertising packets. At least one
476 channel bit shall be set in the Advertising_Channel_Map parameter.
477 The Advertising_Filter_Policy parameter shall be ignored when directed advertising
478 is enabled.
479 The Host shall not issue this command when advertising is enabled in the Controller;
480 if it is the Command Disallowed error code shall be used.
481 (See Bluetooth Specification v.5.0, Vol. 2, Part E, 7.8.5)
482   * @param Advertising_Interval_Min Minimum advertising interval.
483 Time = N * 0.625 msec.
484   * Values:
485   - 0x0020 (20.000 ms)  ... 0x4000 (10240.000 ms)
486   * @param Advertising_Interval_Max Maximum advertising interval.
487 Time = N * 0.625 msec.
488   * Values:
489   - 0x0020 (20.000 ms)  ... 0x4000 (10240.000 ms)
490   * @param Advertising_Type Advertising type.
491   * Values:
492   - 0x00: ADV_IND (Connectable undirected advertising)
493   - 0x01: ADV_DIRECT_IND, high duty cycle (Connectable high duty cycle directed advertising)
494   - 0x02: ADV_SCAN_IND (Scannable undirected advertising)
495   - 0x03: ADV_NONCONN_IND (Non connectable undirected advertising)
496   - 0x04: ADV_DIRECT_IND, low duty cycle (Connectable low duty cycle directed advertising)
497   * @param Own_Address_Type Own address type.
498  - 0x00: Public Device Address
499  - 0x01 Random Device Address
500  - 0x02: Controller generates Resolvable Private Address based on the local
501          IRK from resolving list. If resolving list contains no matching entry,
502          use public address.
503  - 0x03: Controller generates Resolvable Private Address based on the local
504          IRK from resolving list. If resolving list contains no matching entry,
505          use random address from LE_Set_Random_Address.
506   * Values:
507   - 0x00: Public Device Address
508   - 0x01: Random Device Address
509   - 0x02: Resolvable Private Address or Public Address
510   - 0x03: Resolvable Private Address or Random Address
511   * @param Peer_Address_Type The address type of the peer device.
512   * Values:
513   - 0x00: Public Device Address
514   - 0x01: Random Device Address
515   * @param Peer_Address Public Device Address, Random Device Address, Public Identity
516 Address or Random (static) Identity Address of the device to be connected.
517   * @param Advertising_Channel_Map Advertising channel map.
518 Default: 00000111b (all channels enabled).
519   * Flags:
520   - 0x01: ch 37
521   - 0x02: ch 38
522   - 0x04: ch 39
523   * @param Advertising_Filter_Policy Advertising filter policy.
524   * Values:
525   - 0x00: Allow Scan Request from Any, Allow Connect Request from Any
526   - 0x01: Allow Scan Request from White List Only, Allow Connect Request from Any
527   - 0x02: Allow Scan Request from Any, Allow Connect Request from White List Only
528   - 0x03: Allow Scan Request from White List Only, Allow Connect Request from White List Only
529   * @retval Value indicating success or error code.
530 */
531 tBleStatus hci_le_set_advertising_parameters(uint16_t Advertising_Interval_Min,
532                                              uint16_t Advertising_Interval_Max,
533                                              uint8_t Advertising_Type,
534                                              uint8_t Own_Address_Type,
535                                              uint8_t Peer_Address_Type,
536                                              uint8_t Peer_Address[6],
537                                              uint8_t Advertising_Channel_Map,
538                                              uint8_t Advertising_Filter_Policy);
539 
540 /**
541   * @brief The LE_Read_Advertising_Channel_Tx_Power command is used by the Host
542 to read the transmit power level used for LE advertising channel packets.
543 (See Bluetooth Specification v.5.0, Vol. 2, Part E, 7.8.6)
544   * @param[out] Transmit_Power_Level Size: 1 Octet (signed integer)
545 Units: dBm
546 Accuracy: +/- 4 dBm
547   * Values:
548   - -20 ... 10
549   * @retval Value indicating success or error code.
550 */
551 tBleStatus hci_le_read_advertising_channel_tx_power(uint8_t *Transmit_Power_Level);
552 
553 /**
554   * @brief The LE_Set_Advertising_Data command is used to set the data used in advertising
555 packets that have a data field.
556 Only the significant part of the Advertising_Data is transmitted in the advertising
557 packets, as defined in [Vol 3] Part C, Section 11.,
558 (See Bluetooth Specification v.5.0, Vol. 2, Part E, 7.8.7)
559   * @param Advertising_Data_Length The number of significant octets in the following data field
560   * @param Advertising_Data 31 octets of data formatted as defined in [Vol 3] Part C, Section 11.
561   * @retval Value indicating success or error code.
562 */
563 tBleStatus hci_le_set_advertising_data(uint8_t Advertising_Data_Length,
564                                        uint8_t Advertising_Data[31]);
565 
566 /**
567   * @brief This command is used to provide data used in Scanning Packets that have a
568 data field.
569 Only the significant part of the Scan_Response_Data is transmitted in the
570 Scanning Packets, as defined in [Vol 3] Part C, Section 11.
571 (See Bluetooth Specification v.5.0, Vol. 2, Part E, 7.8.8)
572   * @param Scan_Response_Data_Length The number of significant octets in the following data field
573   * @param Scan_Response_Data 31 octets of data formatted as defined in [Vol 3] Part C, Section 11.
574   * @retval Value indicating success or error code.
575 */
576 tBleStatus hci_le_set_scan_response_data(uint8_t Scan_Response_Data_Length,
577                                          uint8_t Scan_Response_Data[31]);
578 
579 /**
580   * @brief The LE_Set_Advertise_Enable command is used to request the Controller to
581 start or stop advertising. The Controller manages the timing of advertisements
582 as per the advertising parameters given in the LE_Set_Advertising_Parameters
583 command.
584 The Controller shall continue advertising until the Host issues an LE_Set_Advertise_Enable
585 command with Advertising_Enable set to 0x00 (Advertising is
586 disabled) or until a connection is created or until the Advertising is timed out
587 due to high duty cycle Directed Advertising. In these cases, advertising is then
588 disabled.
589 (See Bluetooth Specification v.5.0, Vol. 2, Part E, 7.8.9)
590   * @param Advertising_Enable Enable/disable advertise. Default is 0 (disabled).
591   * Values:
592   - 0x00: Advertising is disabled
593   - 0x01: Advertising is enabled
594   * @retval Value indicating success or error code.
595 */
596 tBleStatus hci_le_set_advertise_enable(uint8_t Advertising_Enable);
597 
598 /**
599   * @brief The LE_Set_Scan_Parameters command is used to set the scan parameters.
600 The LE_Scan_Type parameter controls the type of scan to perform.
601 The LE_Scan_Interval and LE_Scan_Window parameters are recommendations
602 from the Host on how long (LE_Scan_Window) and how frequently
603 (LE_Scan_Interval) the Controller should scan (See [Vol 6] Part B, Section
604 4.4.3). The LE_Scan_Window parameter shall always be set to a value smaller
605 or equal to the value set for the LE_Scan_Interval parameter. If they are set to
606 the same value scanning should be run continuously.
607 The Own_Address_Type parameter determines the address used (Public or
608 Random Device Address) when performing active scan.
609 The Host shall not issue this command when scanning is enabled in the Controller;
610 if it is the Command Disallowed error code shall be used.
611 (See Bluetooth Specification v.5.0, Vol. 2, Part E, 7.8.10)
612   * @param LE_Scan_Type Passive or active scanning. With active scanning SCAN_REQ packets are sent.
613   * Values:
614   - 0x00: Passive Scanning
615   - 0x01: Active scanning
616   * @param LE_Scan_Interval This is defined as the time interval from when the Controller started
617 its last LE scan until it begins the subsequent LE scan.
618 Time = N * 0.625 msec.
619   * Values:
620   - 0x0004 (2.500 ms)  ... 0x4000 (10240.000 ms)
621   * @param LE_Scan_Window Amount of time for the duration of the LE scan. LE_Scan_Window
622 shall be less than or equal to LE_Scan_Interval.
623 Time = N * 0.625 msec.
624   * Values:
625   - 0x0004 (2.500 ms)  ... 0x4000 (10240.000 ms)
626   * @param Own_Address_Type Own address type.
627  - 0x00: Public Device Address
628  - 0x01 Random Device Address
629  - 0x02: Controller generates Resolvable Private Address based on the local
630          IRK from resolving list. If resolving list contains no matching entry,
631          use public address.
632  - 0x03: Controller generates Resolvable Private Address based on the local
633          IRK from resolving list. If resolving list contains no matching entry,
634          use random address from LE_Set_Random_Address.
635   * Values:
636   - 0x00: Public Device Address
637   - 0x01: Random Device Address
638   - 0x02: Resolvable Private Address or Public Address
639   - 0x03: Resolvable Private Address or Random Address
640   * @param Scanning_Filter_Policy 0x00 Accept all advertisement packets.
641 Directed advertising packets which are not addressed for this device
642 shall be ignored.
643 0x01 Ignore advertisement packets from devices not in the White List Only.
644 Directed advertising packets which are not addressed for this device
645 shall be ignored
646 0x02 Accept all undirected advertisement packets.
647 Directed advertisement packets where initiator address is a RPA and
648 Directed advertisement packets addressed to this device shall be accepted.
649 0x03 Accept all undirected advertisement packets from devices that are in
650 the White List.Directed advertisement packets where initiator address is RPA and Directed advertisement packets addressed to this device shall be accepted.
651   * Values:
652   - 0x00: Accept all
653   - 0x01: Ignore devices not in the White List
654   - 0x02: Accept all (use resolving list)
655   - 0x03: Ignore devices not in the White List (use resolving list)
656   * @retval Value indicating success or error code.
657 */
658 tBleStatus hci_le_set_scan_parameters(uint8_t LE_Scan_Type,
659                                       uint16_t LE_Scan_Interval,
660                                       uint16_t LE_Scan_Window,
661                                       uint8_t Own_Address_Type,
662                                       uint8_t Scanning_Filter_Policy);
663 
664 /**
665   * @brief The LE_Set_Scan_Enable command is used to start scanning. Scanning is
666 used to discover advertising devices nearby.
667 The Filter_Duplicates parameter controls whether the Link Layer shall filter
668 duplicate advertising reports to the Host, or if the Link Layer should generate
669 advertising reports for each packet received.
670 (See Bluetooth Specification v.5.0, Vol. 2, Part E, 7.8.11)
671   * @param LE_Scan_Enable Enable/disable scan. Default is 0 (disabled).
672   * Values:
673   - 0x00: Scanning disabled
674   - 0x01: Scanning enabled
675   * @param Filter_Duplicates Enable/disable duplicate filtering.
676   * Values:
677   - 0x00: Duplicate filtering disabled
678   - 0x01: Duplicate filtering enabled
679   * @retval Value indicating success or error code.
680 */
681 tBleStatus hci_le_set_scan_enable(uint8_t LE_Scan_Enable,
682                                   uint8_t Filter_Duplicates);
683 
684 /**
685   * @brief The LE_Create_Connection command is used to create a Link Layer connection
686 to a connectable advertiser.
687 The LE_Scan_Interval and LE_Scan_Window parameters are recommendations
688 from the Host on how long (LE_Scan_Window) and how frequently
689 (LE_Scan_Interval) the Controller should scan. The LE_Scan_Window parameter
690 shall be set to a value smaller or equal to the value set for the LE_Scan_Interval
691 parameter. If both are set to the same value, scanning should run
692 continuously.
693 The Initiator_Filter_Policy is used to determine whether the White List is used.
694 If the White List is not used, the Peer_Address_Type and the Peer_Address
695 parameters specify the address type and address of the advertising device to
696 connect to.
697 The Link Layer shall set the address in the CONNECT_REQ packets to either
698 the Public Device Address or the Random Device Addressed based on the
699 Own_Address_Type parameter.
700 The Conn_Interval_Min and Conn_Interval_Max parameters define the minimum
701 and maximum allowed connection interval. The Conn_Interval_Min
702 parameter shall not be greater than the Conn_Interval_Max parameter.
703 The Conn_Latency parameter defines the maximum allowed connection
704 latency (see [Vol 6] Part B, Section 4.5.1).
705 The Supervision_Timeout parameter defines the link supervision timeout for
706 the connection. The Supervision_Timeout in milliseconds shall be larger than
707 (1 + Conn_Latency) * Conn_Interval_Max * 2, where Conn_Interval_Max is
708 given in milliseconds. (See [Vol 6] Part B, Section 4.5.2).
709 The Minimum_CE_Length and Maximum_CE_Length parameters are informative
710 parameters providing the Controller with the expected minimum and maximum
711 length of the connection events. The Minimum_CE_Length parameter
712 shall be less than or equal to the Maximum_CE_Length parameter.
713 The Host shall not issue this command when another LE_Create_Connection
714 is pending in the Controller; if this does occur the Controller shall return the
715 Command Disallowed error code shall be used.
716 (See Bluetooth Specification v.5.0, Vol. 2, Part E, 7.8.12)
717   * @param LE_Scan_Interval This is defined as the time interval from when the Controller started
718 its last LE scan until it begins the subsequent LE scan.
719 Time = N * 0.625 msec.
720   * Values:
721   - 0x0004 (2.500 ms)  ... 0x4000 (10240.000 ms)
722   * @param LE_Scan_Window Amount of time for the duration of the LE scan. LE_Scan_Window
723 shall be less than or equal to LE_Scan_Interval.
724 Time = N * 0.625 msec.
725   * Values:
726   - 0x0004 (2.500 ms)  ... 0x4000 (10240.000 ms)
727   * @param Initiator_Filter_Policy 0x00 White list is not used to determine which advertiser to connect to.
728 Peer_Address_Type and Peer_Address shall be used.
729 0x01 White list is used to determine which advertiser to connect to.
730 Peer_Address_Type and Peer_Address shall be ignored.
731   * Values:
732   - 0x00: White list not used
733   - 0x01: White list used
734   * @param Peer_Address_Type 0x00 Public Device Address
735 0x01 Random Device Address
736 0x02 Public Identity Address (Corresponds to Resolved Private Address)
737 0x03 Random (Static) Identity Address (Corresponds to Resolved Private Address)
738   * Values:
739   - 0x00: Public Device Address
740   - 0x01: Random Device Address
741   - 0x02: Public Identity Address
742   - 0x03: Random (Static) Identity Address
743   * @param Peer_Address Public Device Address or Random Device Address of the device
744 to be connected.
745   * @param Own_Address_Type Own address type.
746  - 0x00: Public Device Address
747  - 0x01 Random Device Address
748  - 0x02: Controller generates Resolvable Private Address based on the local
749          IRK from resolving list. If resolving list contains no matching entry,
750          use public address.
751  - 0x03: Controller generates Resolvable Private Address based on the local
752          IRK from resolving list. If resolving list contains no matching entry,
753          use random address from LE_Set_Random_Address.
754   * Values:
755   - 0x00: Public Device Address
756   - 0x01: Random Device Address
757   - 0x02: Resolvable Private Address or Public Address
758   - 0x03: Resolvable Private Address or Random Address
759   * @param Conn_Interval_Min Minimum value for the connection event interval. This shall be less
760 than or equal to Conn_Interval_Max.
761 Time = N * 1.25 msec.
762   * Values:
763   - 0x0006 (7.50 ms)  ... 0x0C80 (4000.00 ms)
764   * @param Conn_Interval_Max Maximum value for the connection event interval. This shall be
765 greater than or equal to Conn_Interval_Min.
766 Time = N * 1.25 msec.
767   * Values:
768   - 0x0006 (7.50 ms)  ... 0x0C80 (4000.00 ms)
769   * @param Conn_Latency Slave latency for the connection in number of connection events.
770   * Values:
771   - 0x0000 ... 0x01F3
772   * @param Supervision_Timeout Supervision timeout for the LE Link.
773 It shall be a multiple of 10 ms and larger than (1 + connSlaveLatency) * connInterval * 2.
774 Time = N * 10 msec.
775   * Values:
776   - 0x000A (100 ms)  ... 0x0C80 (32000 ms)
777   * @param Minimum_CE_Length Information parameter about the minimum length of connection
778 needed for this LE connection.
779 Time = N * 0.625 msec.
780   * Values:
781   - 0x0000 (0.000 ms)  ... 0xFFFF (40959.375 ms)
782   * @param Maximum_CE_Length Information parameter about the maximum length of connection needed
783 for this LE connection.
784 Time = N * 0.625 msec.
785   * Values:
786   - 0x0000 (0.000 ms)  ... 0xFFFF (40959.375 ms)
787   * @retval Value indicating success or error code.
788 */
789 tBleStatus hci_le_create_connection(uint16_t LE_Scan_Interval,
790                                     uint16_t LE_Scan_Window,
791                                     uint8_t Initiator_Filter_Policy,
792                                     uint8_t Peer_Address_Type,
793                                     uint8_t Peer_Address[6],
794                                     uint8_t Own_Address_Type,
795                                     uint16_t Conn_Interval_Min,
796                                     uint16_t Conn_Interval_Max,
797                                     uint16_t Conn_Latency,
798                                     uint16_t Supervision_Timeout,
799                                     uint16_t Minimum_CE_Length,
800                                     uint16_t Maximum_CE_Length);
801 
802 /**
803   * @brief The LE_Create_Connection_Cancel command is used to cancel the LE_Create_Connection
804 command. This command shall only be issued after the
805 LE_Create_Connection command has been issued, a Command Status event
806 has been received for the LE Create Connection command and before the LE
807 Connection Complete event.
808 (See Bluetooth Specification v.5.0, Vol. 2, Part E, 7.8.13)
809   * @retval Value indicating success or error code.
810 */
811 tBleStatus hci_le_create_connection_cancel(void);
812 
813 /**
814   * @brief The LE_Read_White_List_Size command is used to read the total number of
815 white list entries that can be stored in the Controller.
816 (See Bluetooth Specification v.5.0, Vol. 2, Part E, 7.8.14)
817   * @param[out] White_List_Size Total number of white list entries that can be stored in the Controller.
818   * @retval Value indicating success or error code.
819 */
820 tBleStatus hci_le_read_white_list_size(uint8_t *White_List_Size);
821 
822 /**
823   * @brief The LE_Clear_White_List command is used to clear the white list stored in the
824 Controller.
825 This command can be used at any time except when:
826 - the advertising filter policy uses the white list and advertising is enabled.
827 - the scanning filter policy uses the white list and scanning is enabled.
828 - the initiator filter policy uses the white list and an LE_Create_Connection
829 command is outstanding.
830 (See Bluetooth Specification v.5.0, Vol. 2, Part E, 7.8.15)
831   * @retval Value indicating success or error code.
832 */
833 tBleStatus hci_le_clear_white_list(void);
834 
835 /**
836   * @brief The LE_Add_Device_To_White_List command is used to add a single device
837 to the white list stored in the Controller.
838 This command can be used at any time except when:
839 - the advertising filter policy uses the white list and advertising is enabled.
840 - the scanning filter policy uses the white list and scanning is enabled.
841 - the initiator filter policy uses the white list and a create connection command
842 is outstanding.
843 (See Bluetooth Specification v.5.0, Vol. 2, Part E, 7.8.16)
844   * @param Address_Type Address type.
845   * Values:
846   - 0x00: Public Device Address
847   - 0x01: Random Device Address
848   * @param Address Public Device Address or Random Device Address of the device
849 to be added to the white list.
850   * @retval Value indicating success or error code.
851 */
852 tBleStatus hci_le_add_device_to_white_list(uint8_t Address_Type,
853                                            uint8_t Address[6]);
854 
855 /**
856   * @brief The LE_Remove_Device_From_White_List command is used to remove a single
857 device from the white list stored in the Controller.
858 This command can be used at any time except when:
859 - the advertising filter policy uses the white list and advertising is enabled.
860 - the scanning filter policy uses the white list and scanning is enabled.
861 - the initiator filter policy uses the white list and a create connection command
862 is outstanding.
863 (See Bluetooth Specification v.5.0, Vol. 2, Part E, 7.8.17)
864   * @param Address_Type Address type.
865   * Values:
866   - 0x00: Public Device Address
867   - 0x01: Random Device Address
868   * @param Address Public Device Address or Random Device Address of the device
869 													   to be removed from the white list.
870   * @retval Value indicating success or error code.
871 */
872 tBleStatus hci_le_remove_device_from_white_list(uint8_t Address_Type,
873                                                 uint8_t Address[6]);
874 
875 /**
876   * @brief The LE_Connection_Update command is used to change the Link Layer connection
877 parameters of a connection. This command is supported only on master side.
878 The Conn_Interval_Min and Conn_Interval_Max parameters are used to define
879 the minimum and maximum allowed connection interval. The Conn_Interval_Min
880 parameter shall not be greater than the Conn_Interval_Max parameter.
881 The Conn_Latency parameter shall define the maximum allowed connection
882 latency.
883 The Supervision_Timeout parameter shall define the link supervision timeout
884 for the LE link. The Supervision_Timeout in milliseconds shall be larger than (1
885 + Conn_Latency) * Conn_Interval_Max * 2, where Conn_Interval_Max is given
886 in milliseconds.
887 The Minimum_CE_Length and Maximum_CE_Length are information parameters
888 providing the Controller with a hint about the expected minimum and maximum
889 length of the connection events. The Minimum_CE_Length shall be less
890 than or equal to the Maximum_CE_Length.
891 The actual parameter values selected by the Link Layer may be different from
892 the parameter values provided by the Host through this command.
893 (See Bluetooth Specification v.5.0, Vol. 2, Part E, 7.8.18)
894   * @param Connection_Handle Connection handle for which the command is given.
895   * Values:
896   - 0x0000 ... 0x0EFF
897   * @param Conn_Interval_Min Minimum value for the connection event interval. This shall be less
898 than or equal to Conn_Interval_Max.
899 Time = N * 1.25 msec.
900   * Values:
901   - 0x0006 (7.50 ms)  ... 0x0C80 (4000.00 ms)
902   * @param Conn_Interval_Max Maximum value for the connection event interval. This shall be
903 greater than or equal to Conn_Interval_Min.
904 Time = N * 1.25 msec.
905   * Values:
906   - 0x0006 (7.50 ms)  ... 0x0C80 (4000.00 ms)
907   * @param Conn_Latency Slave latency for the connection in number of connection events.
908   * Values:
909   - 0x0000 ... 0x01F3
910   * @param Supervision_Timeout Supervision timeout for the LE Link.
911 It shall be a multiple of 10 ms and larger than (1 + connSlaveLatency) * connInterval * 2.
912 Time = N * 10 msec.
913   * Values:
914   - 0x000A (100 ms)  ... 0x0C80 (32000 ms)
915   * @param Minimum_CE_Length Information parameter about the minimum length of connection
916 needed for this LE connection.
917 Time = N * 0.625 msec.
918   * Values:
919   - 0x0000 (0.000 ms)  ... 0xFFFF (40959.375 ms)
920   * @param Maximum_CE_Length Information parameter about the maximum length of connection needed
921 for this LE connection.
922 Time = N * 0.625 msec.
923   * Values:
924   - 0x0000 (0.000 ms)  ... 0xFFFF (40959.375 ms)
925   * @retval Value indicating success or error code.
926 */
927 tBleStatus hci_le_connection_update(uint16_t Connection_Handle,
928                                     uint16_t Conn_Interval_Min,
929                                     uint16_t Conn_Interval_Max,
930                                     uint16_t Conn_Latency,
931                                     uint16_t Supervision_Timeout,
932                                     uint16_t Minimum_CE_Length,
933                                     uint16_t Maximum_CE_Length);
934 
935 /**
936   * @brief The LE_Set_Host_Channel_Classification command allows the Host to specify
937 a channel classification for data channels based on its "local information". This
938 classification persists until overwritten with a subsequent LE_Set_Host_Channel_Classification
939 command or until the Controller is reset using the Reset
940 command (see [Vol 6] Part B, Section 4.5.8.1).
941 If this command is used, the Host should send it within 10 seconds of knowing
942 that the channel classification has changed. The interval between two successive
943 commands sent shall be at least one second.
944 This command shall only be used when the local device supports the Master
945 role.
946 (See Bluetooth Specification v.5.0, Vol. 2, Part E, 7.8.19)
947   * @param LE_Channel_Map This parameter contains 37 1-bit fields.
948 The nth such field (in the range 0 to 36) contains the value for the
949 link layer channel index n.
950 Channel n is bad = 0.
951 Channel n is unknown = 1.
952 The most significant bits are reserved and shall be set to 0.
953 At least one channel shall be marked as unknown.
954   * @retval Value indicating success or error code.
955 */
956 tBleStatus hci_le_set_host_channel_classification(uint8_t LE_Channel_Map[5]);
957 
958 /**
959   * @brief The LE_Read_Channel_Map command returns the current Channel_Map for
960 the specified Connection_Handle. The returned value indicates the state of the
961 Channel_Map specified by the last transmitted or received Channel_Map (in a
962 CONNECT_REQ or LL_CHANNEL_MAP_REQ message) for the specified
963 Connection_Handle, regardless of whether the Master has received an
964 acknowledgement.
965 (See Bluetooth Specification v.5.0, Vol. 2, Part E, 7.8.20)
966   * @param Connection_Handle Connection handle for which the command is given.
967   * Values:
968   - 0x0000 ... 0x0EFF
969   * @param[out] LE_Channel_Map This parameter contains 37 1-bit fields.
970 The nth such field (in the range 0 to 36) contains the value for the
971 link layer channel index n.
972 Channel n is unused = 0.
973 Channel n is used = 1.
974 The most significant bits are reserved and shall be set to 0.
975   * @retval Value indicating success or error code.
976 */
977 tBleStatus hci_le_read_channel_map(uint16_t Connection_Handle,
978                                    uint8_t LE_Channel_Map[5]);
979 
980 /**
981   * @brief This command requests a list of the used LE features from the remote device.
982 This command shall return a list of the used LE features. For details see [Vol 6]
983 Part B, Section 4.6.
984 This command may be issued on both the master and slave.
985 (See Bluetooth Specification v.5.0, Vol. 2, Part E, 7.8.21)
986   * @param Connection_Handle Connection handle for which the command is given.
987   * Values:
988   - 0x0000 ... 0x0EFF
989   * @retval Value indicating success or error code.
990 */
991 tBleStatus hci_le_read_remote_used_features(uint16_t Connection_Handle);
992 
993 /**
994   * @brief The LE_Encrypt command is used to request the Controller to encrypt the
995 Plaintext_Data in the command using the Key given in the command and
996 returns the Encrypted_Data to the Host. The AES-128 bit block cypher is
997 defined in NIST Publication FIPS-197 (http://csrc.nist.gov/publications/fips/
998 fips197/fips-197.pdf).
999 (See Bluetooth Specification v.5.0, Vol. 2, Part E, 7.8.22)
1000   * @param Key 128 bit key for the encryption of the data given in the command.
1001   * @param Plaintext_Data 128 bit data block that is requested to be encrypted.
1002   * @param[out] Encrypted_Data 128 bit encrypted data block.
1003   * @retval Value indicating success or error code.
1004 */
1005 tBleStatus hci_le_encrypt(uint8_t Key[16],
1006                           uint8_t Plaintext_Data[16],
1007                           uint8_t Encrypted_Data[16]);
1008 
1009 /**
1010   * @brief The LE_Rand command is used to request the Controller to generate 8 octets
1011 of random data to be sent to the Host. The Random_Number shall be generated
1012 according to [Vol 2] Part H, Section 2 if the LE Feature (LL Encryption) is
1013 supported.
1014 (See Bluetooth Specification v.5.0, Vol. 2, Part E, 7.8.23)
1015   * @param[out] Random_Number Random Number
1016   * @retval Value indicating success or error code.
1017 */
1018 tBleStatus hci_le_rand(uint8_t Random_Number[8]);
1019 
1020 /**
1021   * @brief The LE_Start_Encryption command is used to authenticate the given encryption
1022 key associated with the remote device specified by the connection handle,
1023 and once authenticated will encrypt the connection. The parameters are as
1024 defined in [Vol 3] Part H, Section 2.4.4.
1025 If the connection is already encrypted then the Controller shall pause connection
1026 encryption before attempting to authenticate the given encryption key, and
1027 then re-encrypt the connection. While encryption is paused no user data shall
1028 be transmitted.
1029 On an authentication failure, the connection shall be automatically disconnected
1030 by the Link Layer. If this command succeeds, then the connection shall
1031 be encrypted.
1032 This command shall only be used when the local device's role is Master.
1033 (See Bluetooth Specification v.5.0, Vol. 2, Part E, 7.8.24)
1034   * @param Connection_Handle Connection handle for which the command is given.
1035   * Values:
1036   - 0x0000 ... 0x0EFF
1037   * @param Random_Number 64 bit random number.
1038   * @param Encrypted_Diversifier 16 bit encrypted diversifier.
1039   * @param Long_Term_Key 128 bit long term key.
1040   * @retval Value indicating success or error code.
1041 */
1042 tBleStatus hci_le_start_encryption(uint16_t Connection_Handle,
1043                                    uint8_t Random_Number[8],
1044                                    uint16_t Encrypted_Diversifier,
1045                                    uint8_t Long_Term_Key[16]);
1046 
1047 /**
1048   * @brief The LE_Long_Term_Key_Request_Reply command is used to reply to an LE
1049 Long Term Key Request event from the Controller, and specifies the
1050 Long_Term_Key parameter that shall be used for this Connection_Handle. The
1051 Long_Term_Key is used as defined in [Vol 6] Part B, Section 5.1.3.
1052 (See Bluetooth Specification v.5.0, Vol. 2, Part E, 7.8.25)
1053   * @param Connection_Handle Connection handle for which the command is given.
1054   * Values:
1055   - 0x0000 ... 0x0EFF
1056   * @param Long_Term_Key 128 bit long term key.
1057   * @retval Value indicating success or error code.
1058 */
1059 tBleStatus hci_le_long_term_key_request_reply(uint16_t Connection_Handle,
1060                                               uint8_t Long_Term_Key[16]);
1061 
1062 /**
1063   * @brief The LE_Long_Term_Key_Request_Negative_Reply command is used to reply
1064 to an LE Long Term Key Request event from the Controller if the Host cannot
1065 provide a Long Term Key for this Connection_Handle.
1066 (See Bluetooth Specification v.5.0, Vol. 2, Part E, 7.8.26)
1067   * @param Connection_Handle Connection handle for which the command is given.
1068   * Values:
1069   - 0x0000 ... 0x0EFF
1070   * @retval Value indicating success or error code.
1071 */
1072 tBleStatus hci_le_long_term_key_requested_negative_reply(uint16_t Connection_Handle);
1073 
1074 /**
1075   * @brief The LE_Read_Supported_States command reads the states and state combinations
1076 that the link layer supports. See [Vol 6] Part B, Section 1.1.1.
1077 LE_States is an 8-octet bit field. If a bit is set to 1 then this state or state combination
1078 is supported by the Controller. Multiple bits in LE_States may be set to 1
1079 to indicate support for multiple state and state combinations.
1080 All the Advertising type with the Initiate State combinations shall be set only if
1081 the corresponding Advertising types and Master Role combination are set.
1082 All the Scanning types and the Initiate State combinations shall be set only if
1083 the corresponding Scanning types and Master Role combination are set.
1084 (See Bluetooth Specification v.5.0, Vol. 2, Part E, 7.8.27)
1085   * @param[out] LE_States State or state combination is supported by the Controller.
1086 See Core v5.0, Vol.2, part E, Ch. 7.8.27.
1087   * @retval Value indicating success or error code.
1088 */
1089 tBleStatus hci_le_read_supported_states(uint8_t LE_States[8]);
1090 
1091 /**
1092   * @brief This command is used to start a test where the DUT receives test reference
1093 packets at a fixed interval. The tester generates the test reference packets.
1094 (See Bluetooth Specification v.5.0, Vol. 2, Part E, 7.8.28)
1095   * @param RX_Frequency N = (F - 2402) / 2
1096 Frequency Range : 2402 MHz to 2480 MHz
1097   * Values:
1098   - 0x00 ... 0x27
1099   * @retval Value indicating success or error code.
1100 */
1101 tBleStatus hci_le_receiver_test(uint8_t RX_Frequency);
1102 
1103 /**
1104   * @brief This command is used to start a test where the DUT generates test reference
1105 packets at a fixed interval. The Controller shall transmit at maximum power.
1106 An LE Controller supporting the LE_Transmitter_Test command shall support
1107 Packet_Payload values 0x00, 0x01 and 0x02. An LE Controller may support
1108 other values of Packet_Payload.
1109 (See Bluetooth Specification v.5.0, Vol. 2, Part E, 7.8.29)
1110   * @param TX_Frequency N = (F - 2402) / 2
1111 Frequency Range : 2402 MHz to 2480 MHz
1112   * Values:
1113   - 0x00 ... 0x27
1114   * @param Length_Of_Test_Data Length in bytes of payload data in each packet.
1115   * Values:
1116   - 0x00 ... 0x25
1117   * @param Packet_Payload Type of packet payload.
1118   * Values:
1119   - 0x00: Pseudo-Random bit sequence 9
1120   - 0x01: Pattern of alternating bits '11110000'
1121   - 0x02: Pattern of alternating bits '10101010'
1122   - 0x03: Pseudo-Random bit sequence 15
1123   - 0x04: Pattern of All '1' bits
1124   - 0x05: Pattern of All '0' bits
1125   - 0x06: Pattern of alternating bits '00001111'
1126   - 0x07: Pattern of alternating bits '0101'
1127   * @retval Value indicating success or error code.
1128 */
1129 tBleStatus hci_le_transmitter_test(uint8_t TX_Frequency,
1130                                    uint8_t Length_Of_Test_Data,
1131                                    uint8_t Packet_Payload);
1132 
1133 /**
1134   * @brief This command is used to stop any test which is in progress. The Number_Of_Packets
1135 for a transmitter test shall be reported as 0x0000. The Number_Of_Packets
1136 is an unsigned number and contains the number of received
1137 packets.
1138 (See Bluetooth Specification v.5.0, Vol. 2, Part E, 7.8.30)
1139   * @param[out] Number_Of_Packets Number of packets received
1140   * @retval Value indicating success or error code.
1141 */
1142 tBleStatus hci_le_test_end(uint16_t *Number_Of_Packets);
1143 
1144 /**
1145   * @brief The LE_Set_Data_Length command allows the Host to suggest maximum
1146 transmission packet size and maximum packet transmission time
1147 (connMaxTxOctets and connMaxTxTime - see Bluetooth Specification v5.0 [Vol 6] Part B, Section 4.5.10) to
1148 be used for a given connection. The Controller may use smaller or larger
1149 values based on local information.
1150   * @param Connection_Handle Connection handle for which the command is given.
1151   * Values:
1152   - 0x0000 ... 0x0EFF
1153   * @param TxOctets Preferred maximum number of payload octets that the local Controller
1154 should include in a single Link Layer packet on this connection.
1155   * Values:
1156   - 0x001B ... 0x00FB
1157   * @param TxTime Preferred maximum number of microseconds that the local Controller
1158 should use to transmit a single Link Layer packet on this connection.
1159   * Values:
1160   - 0x0148 ... 0x4290
1161   * @retval Value indicating success or error code.
1162 */
1163 tBleStatus hci_le_set_data_length(uint16_t Connection_Handle,
1164                                   uint16_t TxOctets,
1165                                   uint16_t TxTime);
1166 
1167 /**
1168   * @brief The LE_Read_Suggested_Default_Data_Length command allows the Host to
1169 read the Host's suggested values (SuggestedMaxTxOctets and
1170 SuggestedMaxTxTime) for the Controller's maximum transmitted number of
1171 payload octets and maximum packet transmission time to be used for new
1172 connections (see Bluetooth Specification v5.0 [Vol 6] Part B, Section 4.5.10).
1173   * @param[out] SuggestedMaxTxOctets The Host's suggested value for the Controller's maximum transmitted
1174 number of payload octets to be used for new connections.
1175   * Values:
1176   - 0x001B ... 0x00FB
1177   * @param[out] SuggestedMaxTxTime The Host's suggested value for the Controller's maximum packet
1178 transmission time to be used for new connections.
1179   * Values:
1180   - 0x0148 ... 0x4290
1181   * @retval Value indicating success or error code.
1182 */
1183 tBleStatus hci_le_read_suggested_default_data_length(uint16_t *SuggestedMaxTxOctets,
1184                                                      uint16_t *SuggestedMaxTxTime);
1185 
1186 /**
1187   * @brief The LE_Write_Suggested_Default_Data_Length command allows the Host to
1188 specify its suggested values for the Controller's maximum transmission
1189 number of payload octets and maximum packet transmission time to be used
1190 for new connections. The Controller may use smaller or larger values for
1191 connInitialMaxTxOctets and connInitialMaxTxTime based on local
1192 information.(see Bluetooth Specification [Vol 6] Part B, Section 4.5.10).
1193   * @param SuggestedMaxTxOctets The Host's suggested value for the Controller's maximum transmitted
1194 number of payload octets to be used for new connections.
1195   * Values:
1196   - 0x001B ... 0x00FB
1197   * @param SuggestedMaxTxTime The Host's suggested value for the Controller's maximum packet
1198 transmission time to be used for new connections.
1199   * Values:
1200   - 0x0148 ... 0x4290
1201   * @retval Value indicating success or error code.
1202 */
1203 tBleStatus hci_le_write_suggested_default_data_length(uint16_t SuggestedMaxTxOctets,
1204                                                       uint16_t SuggestedMaxTxTime);
1205 
1206 /**
1207   * @brief The LE_Read_Local_P-256_Public_Key command is used to return the local
1208 P-256 public key from the Controller. The Controller shall generate a new P-
1209 256 public/private key pair upon receipt of this command.
1210 (See Bluetooth Specification v.5.0, Vol. 2, Part E, 7.8.36)
1211   * @retval Value indicating success or error code.
1212 */
1213 tBleStatus hci_le_read_local_p256_public_key(void);
1214 
1215 /**
1216   * @brief The LE_Generate_DHKey command is used to initiate generation of a Diffie-
1217 Hellman key in the Controller for use over the LE transport. This command
1218 takes the remote P-256 public key as input. The Diffie-Hellman key generation
1219 uses the private key generated by LE_Read_Local_P256_Public_Key command.
1220 (See Bluetooth Specification v.5.0, Vol. 2, Part E, 7.8.37)
1221   * @param Remote_P256_Public_Key The remote P-256 public key:
1222 X, Y format
1223 Octets 31-0: X co-ordinate
1224 Octets 63-32: Y co-ordinate
1225 Little Endian Format
1226   * @retval Value indicating success or error code.
1227 */
1228 tBleStatus hci_le_generate_dhkey(uint8_t Remote_P256_Public_Key[64]);
1229 
1230 /**
1231   * @brief The LE_Add_Device_To_Resolving_List command is used to add one device
1232 to the list of address translations used to resolve Resolvable Private Addresses
1233 in the Controller.
1234 This command cannot be used when address translation is enabled in the
1235 Controller and:
1236 - Advertising is enabled
1237 - Scanning is enabled
1238 - Create connection command is outstanding
1239 This command can be used at any time when address translation is disabled in
1240 the Controller.
1241 When a Controller cannot add a device to the resolving list because the list is
1242 full, it shall respond with error code 0x07 (Memory Capacity Exceeded).
1243 (See Bluetooth Specification v.5.0, Vol. 2, Part E, 7.8.38)
1244   * @param Peer_Identity_Address_Type Identity address type.
1245   * Values:
1246   - 0x00: Public Identity Address
1247   - 0x01: Random (static) Identity Address
1248   * @param Peer_Identity_Address Public or Random (static) Identity address of the peer device
1249   * @param Peer_IRK IRK of the peer device
1250   * @param Local_IRK IRK of the local device
1251   * @retval Value indicating success or error code.
1252 */
1253 tBleStatus hci_le_add_device_to_resolving_list(uint8_t Peer_Identity_Address_Type,
1254                                                uint8_t Peer_Identity_Address[6],
1255                                                uint8_t Peer_IRK[16],
1256                                                uint8_t Local_IRK[16]);
1257 
1258 /**
1259   * @brief The LE_Remove_Device_From_Resolving_List command is used to remove
1260 one device from the list of address translations used to resolve Resolvable
1261 Private Addresses in the controller.
1262 This command cannot be used when address translation is enabled in the
1263 Controller and:
1264 - Advertising is enabled
1265 - Scanning is enabled
1266 - Create connection command is outstanding
1267 This command can be used at any time when address translation is disabled in
1268 the Controller.
1269 When a Controller cannot remove a device from the resolving list because it is
1270 not found, it shall respond with error code 0x02 (Unknown Connection
1271 Identifier).
1272 (See Bluetooth Specification v.5.0, Vol. 2, Part E, 7.8.39)
1273   * @param Peer_Identity_Address_Type Identity address type.
1274   * Values:
1275   - 0x00: Public Identity Address
1276   - 0x01: Random (static) Identity Address
1277   * @param Peer_Identity_Address Public or Random (static) Identity address of the peer device
1278   * @retval Value indicating success or error code.
1279 */
1280 tBleStatus hci_le_remove_device_from_resolving_list(uint8_t Peer_Identity_Address_Type,
1281                                                     uint8_t Peer_Identity_Address[6]);
1282 
1283 /**
1284   * @brief The LE_Clear_Resolving_List command is used to remove all devices from the
1285 list of address translations used to resolve Resolvable Private Addresses in the
1286 Controller.
1287 This command cannot be used when address translation is enabled in the
1288 Controller and:
1289 - Advertising is enabled
1290 - Scanning is enabled
1291 - Create connection command is outstanding
1292 This command can be used at any time when address translation is disabled in
1293 the Controller.
1294 (See Bluetooth Specification v.5.0, Vol. 2, Part E, 7.8.40)
1295   * @retval Value indicating success or error code.
1296 */
1297 tBleStatus hci_le_clear_resolving_list(void);
1298 
1299 /**
1300   * @brief The LE_Read_Resolving_List_Size command is used to read the total number
1301 of address translation entries in the resolving list that can be stored in the
1302 Controller.
1303 (See Bluetooth Specification v.5.0, Vol. 2, Part E, 7.8.41)
1304   * @param[out] Resolving_List_Size Number of address translation entries in the resolving list
1305   * @retval Value indicating success or error code.
1306 */
1307 tBleStatus hci_le_read_resolving_list_size(uint8_t *Resolving_List_Size);
1308 
1309 /**
1310   * @brief The LE_Read_Peer_Resolvable_Address command is used to get the current
1311 peer Resolvable Private Address being used for the corresponding peer Public
1312 and Random (static) Identity Address. The peer's resolvable address being
1313 used may change after the command is called.
1314 This command can be used at any time.
1315 When a Controller cannot find a Resolvable Private Address associated with
1316 the Peer Identity Address, it shall respond with error code 0x02 (Unknown
1317 Connection Identifier).
1318 (See Bluetooth Specification v.5.0, Vol. 2, Part E, 7.8.42)
1319   * @param Peer_Identity_Address_Type Identity address type.
1320   * Values:
1321   - 0x00: Public Identity Address
1322   - 0x01: Random (static) Identity Address
1323   * @param Peer_Identity_Address Public or Random (static) Identity address of the peer device
1324   * @param[out] Peer_Resolvable_Address Resolvable Private Address being used by the peer device
1325   * @retval Value indicating success or error code.
1326 */
1327 tBleStatus hci_le_read_peer_resolvable_address(uint8_t Peer_Identity_Address_Type,
1328                                                uint8_t Peer_Identity_Address[6],
1329                                                uint8_t Peer_Resolvable_Address[6]);
1330 
1331 /**
1332   * @brief The LE_Read_Local_Resolvable_Address command is used to get the current
1333 local Resolvable Private Address being used for the corresponding peer
1334 Identity Address. The local's resolvable address being used may change after
1335 the command is called.
1336 This command can be used at any time.
1337 When a Controller cannot find a Resolvable Private Address associated with
1338 the Peer Identity Address, it shall respond with error code 0x02 (Unknown
1339 Connection Identifier).
1340 (See Bluetooth Specification v.5.0, Vol. 2, Part E, 7.8.43)
1341   * @param Peer_Identity_Address_Type Identity address type.
1342   * Values:
1343   - 0x00: Public Identity Address
1344   - 0x01: Random (static) Identity Address
1345   * @param Peer_Identity_Address Public or Random (static) Identity address of the peer device
1346   * @param[out] Local_Resolvable_Address Resolvable Private Address being used by the local device
1347   * @retval Value indicating success or error code.
1348 */
1349 tBleStatus hci_le_read_local_resolvable_address(uint8_t Peer_Identity_Address_Type,
1350                                                 uint8_t Peer_Identity_Address[6],
1351                                                 uint8_t Local_Resolvable_Address[6]);
1352 
1353 /**
1354   * @brief The LE_Set_Address_Resolution_Enable command is used to enable
1355 resolution of Resolvable Private Addresses in the Controller. This causes the
1356 Controller to use the resolving list whenever the Controller receives a local or
1357 peer Resolvable Private Address.
1358 This command can be used at any time except when:
1359 - Advertising is enabled
1360 - Scanning is enabled
1361 - Create connection command is outstanding
1362 (See Bluetooth Specification v.5.0, Vol. 2, Part E, 7.8.44)
1363   * @param Address_Resolution_Enable Enable/disable address resolution in the controller.
1364 0x00: Address Resolution in controller disabled (default),
1365 0x01: Address Resolution in controller enabled
1366   * Values:
1367   - 0x00: Address Resolution in controller disabled (default)
1368   - 0x01: Address Resolution in controller enabled
1369   * @retval Value indicating success or error code.
1370 */
1371 tBleStatus hci_le_set_address_resolution_enable(uint8_t Address_Resolution_Enable);
1372 
1373 /**
1374   * @brief The LE_Set_Resolvable_Private_Address_Timeout command set the length of
1375 time the controller uses a Resolvable Private Address before a new resolvable
1376 private address is generated and starts being used.
1377 This timeout applies to all addresses generated by the controller.
1378 (See Bluetooth Specification v.5.0, Vol. 2, Part E, 7.8.45)
1379   * @param RPA_Timeout RPA_Timeout measured in seconds.
1380 Range for N: 0x0001 - 0xA1B8 (1 sec - approximately 11.5 hours)
1381 Default: N= 0x0384 (900 secs or 15 minutes)
1382   * @retval Value indicating success or error code.
1383 */
1384 tBleStatus hci_le_set_resolvable_private_address_timeout(uint16_t RPA_Timeout);
1385 
1386 /**
1387   * @brief The LE_Read_Maximum_Data_Length command allows the Host to read the
1388 Controller’s maximum supported payload octets and packet duration times for
1389 transmission and reception (supportedMaxTxOctets and
1390 supportedMaxTxTime, supportedMaxRxOctets, and supportedMaxRxTime,
1391 see Bluetooth Specification v5.0 [Vol 6] Part B, Section 4.5.10).
1392   * @param[out] supportedMaxTxOctets Maximum number of payload octets that the local Controller supports
1393 for transmission of a single Link Layer packet on a data connection.
1394   * Values:
1395   - 0x001B ... 0x00FB
1396   * @param[out] supportedMaxTxTime Maximum time, in microseconds, that the local Controller supports for
1397 transmission of a single Link Layer packet on a data connection.
1398   * Values:
1399   - 0x0148 ... 0x4290
1400   * @param[out] supportedMaxRxOctets Maximum number of payload octets that the local Controller supports
1401 for reception of a single Link Layer packet on a data connection.
1402   * Values:
1403   - 0x001B ... 0x00FB
1404   * @param[out] supportedMaxRxTime Maximum time, in microseconds, that the local Controller supports for
1405 reception of a single Link Layer packet on a data connection.
1406   * Values:
1407   - 0x0148 ... 0x4290
1408   * @retval Value indicating success or error code.
1409 */
1410 tBleStatus hci_le_read_maximum_data_length(uint16_t *supportedMaxTxOctets,
1411                                            uint16_t *supportedMaxTxTime,
1412                                            uint16_t *supportedMaxRxOctets,
1413                                            uint16_t *supportedMaxRxTime);
1414 
1415 /**
1416   * @brief The LE_Read_PHY command is used to read the current transmitter PHY and
1417 receiver PHY on the connection identified by the Connection_Handle. see Bluetooth Specification [vol2] part E Section 7.8.47
1418   * @param Connection_Handle Connection handle for which the command is given.
1419   * Values:
1420   - 0x0000 ... 0x0EFF
1421   * @param[out] TX_PHY Transmitter PHY in use
1422   * Values:
1423   - 0x01: The transmitter PHY for the connection is LE 1M
1424   - 0x02: The transmitter PHY for the connection is LE 2M
1425   - 0x03: The transmitter PHY for the connection is LE Coded (Not Supported by STM32WB)
1426   * @param[out] RX_PHY Receiver PHY in use
1427   * Values:
1428   - 0x01: The receiver PHY for the connection is LE 1M
1429   - 0x02: The receiver PHY for the connection is LE 2M
1430   - 0x03: The receiver PHY for the connection is LE Coded (Not Supported by STM32WB)
1431   * @retval Value indicating success or error code.
1432 */
1433 tBleStatus hci_le_read_phy(uint16_t Connection_Handle,
1434                            uint8_t *TX_PHY,
1435                            uint8_t *RX_PHY);
1436 
1437 /**
1438   * @brief The LE_Set_Default_PHY command allows the Host to specify its preferred
1439 values for the transmitter PHY and receiver PHY to be used for all subsequent
1440 connections over the LE transport.
1441 The ALL_PHYS parameter is a bit field that allows the Host to specify, for each
1442 direction, whether it has no preference among the PHYs that the Controller
1443 supports in a given direction or whether it has specified particular PHYs that it
1444 prefers in the TX_PHYS or RX_PHYS parameter.
1445 The TX_PHYS parameter is a bit field that indicates the transmitter PHYs that
1446 the Host prefers the Controller to use. If the ALL_PHYS parameter specifies
1447 that the Host has no preference, the TX_PHYS parameter is ignored;
1448 otherwise at least one bit shall be set to 1.
1449 The RX_PHYS parameter is a bit field that indicates the receiver PHYs that the
1450 Host prefers the Controller to use. If the ALL_PHYS parameter specifies that
1451 the Host has no preference, the RX_PHYS parameter is ignored; otherwise at
1452 least one bit shall be set to 1. See Bluetooth Specification [Vol2] Part E Section 7.8.48
1453   * @param ALL_PHYS Host preferences for TX PHY and RX PHY
1454   * Values:
1455   - 0x00 ... 0x03
1456   * @param TX_PHYS Host preferences for TX PHY (no LE coded support)
1457   * Values:
1458   - 0x00 ... 0x03
1459   * @param RX_PHYS Host preferences for RX PHY (no LE coded support)
1460   * Values:
1461   - 0x00 ... 0x03
1462   * @retval Value indicating success or error code.
1463 */
1464 tBleStatus hci_le_set_default_phy(uint8_t ALL_PHYS,
1465                                   uint8_t TX_PHYS,
1466                                   uint8_t RX_PHYS);
1467 
1468 /**
1469   * @brief The LE_Set_PHY command is used to set the PHY preferences for the
1470 connection identified by the Connection_Handle. The Controller might not be
1471 able to make the change (e.g. because the peer does not support the
1472 requested PHY) or may decide that the current PHY is preferable.
1473 The ALL_PHYS parameter is a bit field that allows the Host to specify, for each
1474 direction, whether it has no preference among the PHYs that the Controller
1475 supports in a given direction or whether it has specified particular PHYs that it
1476 prefers in the TX_PHYS or RX_PHYS parameter.
1477 The TX_PHYS parameter is a bit field that indicates the transmitter PHYs that
1478 the Host prefers the Controller to use. If the ALL_PHYS parameter specifies
1479 that the Host has no preference, the TX_PHYS parameter is ignored;
1480 otherwise at least one bit shall be set to 1.
1481 The RX_PHYS parameter is a bit field that indicates the receiver PHYs that the
1482 Host prefers the Controller to use. If the ALL_PHYS parameter specifies that
1483 the Host has no preference, the RX_PHYS parameter is ignored; otherwise at
1484 least one bit shall be set to 1.
1485 If, for at least one direction, the Host has specified a preference and the current
1486 PHY is not one of those preferred, the Controller shall request a change.
1487 Otherwise the Controller may, but need not, request a change.
1488 The PHY preferences provided by the LE Set PHY command override those
1489 provided via the LE Set Default PHY command (Section 7.8.48) or any
1490 preferences previously set using the LE Set PHY command on the same
1491 connection.
1492 The PHY_options parameter is a bit field that allows the Host to specify options
1493 for PHYs. The default value for a new connection shall be all zero bits. The
1494 Controller may override any preferred coding for transmitting on the LE Coded
1495 PHY.
1496 The Host may specify a preferred coding even if it prefers not to use the LE
1497 Coded transmitter PHY since the Controller may override the PHY preference.
1498 see Bluetooth Specification v5.0 [Vol 6] Part B, Section 7.8.49
1499   * @param Connection_Handle Connection handle for which the command is given.
1500   * Values:
1501   - 0x0000 ... 0x0EFF
1502   * @param ALL_PHYS Host preferences for TX PHY and RX PHY
1503   * Values:
1504   - 0x00 ... 0x03
1505   * @param TX_PHYS Host preferences for TX PHY (no LE coded support)
1506   * Values:
1507   - 0x00 ... 0x03
1508   * @param RX_PHYS Host preferences for RX PHY (no LE coded support)
1509   * Values:
1510   - 0x00 ... 0x03
1511   * @param PHY_options Not Supported by STM32WB
1512   * @retval Value indicating success or error code.
1513 */
1514 tBleStatus hci_le_set_phy(uint16_t Connection_Handle,
1515                           uint8_t ALL_PHYS,
1516                           uint8_t TX_PHYS,
1517                           uint8_t RX_PHYS,
1518                           uint16_t PHY_options);
1519 
1520 /**
1521   * @brief This command is used to start a test where the DUT receives test reference
1522 packets at a fixed interval. The tester generates the test reference packets.
1523 see Bluetooth Specification v5.0 [Vol 6] Part B, Section 7.8.50
1524   * @param RX_Frequency N = (F - 2402) / 2
1525 Frequency Range : 2402 MHz to 2480 MHz
1526   * Values:
1527   - 0x00 ... 0x27
1528   * @param PHY PHY to use for test packet
1529   * Values:
1530   - 0x00: Reserved for future use
1531   - 0x01: Transmitter set to use the LE 1M PHY
1532   - 0x02: Transmitter set to use the LE 2M PHY
1533   - 0x03: Transmitter set to use the LE Coded PHY with S=8 data coding
1534   - 0x04: Transmitter set to use the LE Coded PHY with S=2 data coding
1535   * @param Modulation_Index Modulation index capability of the transmitter
1536   * Values:
1537   - 0x00: Assume transmitter will have a standard modulation index
1538   - 0x01: Assume transmitter will have a stable modulation index
1539   * @retval Value indicating success or error code.
1540 */
1541 tBleStatus hci_le_enhanced_receiver_test(uint8_t RX_Frequency,
1542                                          uint8_t PHY,
1543                                          uint8_t Modulation_Index);
1544 
1545 /**
1546   * @brief This command is used to start a test where the DUT generates test reference
1547 packets at a fixed interval. The Controller shall transmit at maximum power.
1548 An LE Controller supporting the LE_Enhanced Transmitter_Test command
1549 shall support Packet_Payload values 0x00, 0x01 and 0x02. An LE Controller
1550 supporting the LE Coded PHY shall also support Packet_Payload value 0x04 (not supported by STM32WB).
1551 An LE Controller may support other values of Packet_Payload. see Bluetooth Specification v5.0 [Vol 6] Part B, Section 7.8.51
1552   * @param TX_Frequency N = (F - 2402) / 2
1553 Frequency Range : 2402 MHz to 2480 MHz
1554   * Values:
1555   - 0x00 ... 0x27
1556   * @param Length_Of_Test_Data Length in bytes of payload data in each packet.
1557   * Values:
1558   - 0x00 ... 0x25
1559   * @param Packet_Payload Type of packet payload.
1560   * Values:
1561   - 0x00: Pseudo-Random bit sequence 9
1562   - 0x01: Pattern of alternating bits '11110000'
1563   - 0x02: Pattern of alternating bits '10101010'
1564   - 0x03: Pseudo-Random bit sequence 15
1565   - 0x04: Pattern of All '1' bits
1566   - 0x05: Pattern of All '0' bits
1567   - 0x06: Pattern of alternating bits '00001111'
1568   - 0x07: Pattern of alternating bits '0101'
1569   * @param PHY PHY to use for test packet
1570   * Values:
1571   - 0x00: Reserved for future use
1572   - 0x01: Transmitter set to use the LE 1M PHY
1573   - 0x02: Transmitter set to use the LE 2M PHY
1574   - 0x03: Transmitter set to use the LE Coded PHY with S=8 data coding
1575   - 0x04: Transmitter set to use the LE Coded PHY with S=2 data coding
1576   * @retval Value indicating success or error code.
1577 */
1578 tBleStatus hci_le_enhanced_transmitter_test(uint8_t TX_Frequency,
1579                                             uint8_t Length_Of_Test_Data,
1580                                             uint8_t Packet_Payload,
1581                                             uint8_t PHY);
1582 
1583 /**
1584      * @}
1585      */
1586 
1587 #endif /* ! BLE_HCI_LE_H__ */
1588