BlueNRG-MS pack for STM32CubeMX: includes/hci_le.h Source File

STM32CubeMX BlueNRG-MS

BlueNRG-MS pack for STM32CubeMX  V4.4.0
The BlueNRG-MS pack is an additional software for STM32CubeMX.
hci_le.h
Go to the documentation of this file.
1 /******************** (C) COPYRIGHT 2016 STMicroelectronics ********************
2 * File Name : hci_le.h
3 * Author : AMG RF FW team
4 * Version : V1.1.0
5 * Date : 18-July-2016
6 * Description : Constants and functions for HCI layer. See Bluetooth Core
7 * v 4.1, Vol. 2, Part E.
8 ********************************************************************************
9 * THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS
10 * WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE TIME.
11 * AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY DIRECT,
12 * INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING FROM THE
13 * CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE CODING
14 * INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS.
15 *******************************************************************************/
16 
17 #ifndef __HCI_LE_H_
18 #define __HCI_LE_H_
19 
20 #include "bluenrg_types.h"
21 #include "link_layer.h"
22 
38 #define HCI_UNKNOWN_COMMAND 0x01
39 #define HCI_NO_CONNECTION 0x02
40 #define HCI_HARDWARE_FAILURE 0x03
41 #define HCI_PAGE_TIMEOUT 0x04
42 #define HCI_AUTHENTICATION_FAILURE 0x05
43 #define HCI_PIN_OR_KEY_MISSING 0x06
44 #define HCI_MEMORY_FULL 0x07
45 #define HCI_CONNECTION_TIMEOUT 0x08
46 #define HCI_MAX_NUMBER_OF_CONNECTIONS 0x09
47 #define HCI_MAX_NUMBER_OF_SCO_CONNECTIONS 0x0a
48 #define HCI_ACL_CONNECTION_EXISTS 0x0b
49 #define HCI_COMMAND_DISALLOWED 0x0c
50 #define HCI_REJECTED_LIMITED_RESOURCES 0x0d
51 #define HCI_REJECTED_SECURITY 0x0e
52 #define HCI_REJECTED_PERSONAL 0x0f
53 #define HCI_HOST_TIMEOUT 0x10
54 #define HCI_UNSUPPORTED_FEATURE 0x11
55 #define HCI_INVALID_PARAMETERS 0x12
56 #define HCI_OE_USER_ENDED_CONNECTION 0x13
57 #define HCI_OE_LOW_RESOURCES 0x14
58 #define HCI_OE_POWER_OFF 0x15
59 #define HCI_CONNECTION_TERMINATED 0x16
60 #define HCI_REPEATED_ATTEMPTS 0x17
61 #define HCI_PAIRING_NOT_ALLOWED 0x18
62 #define HCI_UNKNOWN_LMP_PDU 0x19
63 #define HCI_UNSUPPORTED_REMOTE_FEATURE 0x1a
64 #define HCI_SCO_OFFSET_REJECTED 0x1b
65 #define HCI_SCO_INTERVAL_REJECTED 0x1c
66 #define HCI_AIR_MODE_REJECTED 0x1d
67 #define HCI_INVALID_LMP_PARAMETERS 0x1e
68 #define HCI_UNSPECIFIED_ERROR 0x1f
69 #define HCI_UNSUPPORTED_LMP_PARAMETER_VALUE 0x20
70 #define HCI_ROLE_CHANGE_NOT_ALLOWED 0x21
71 #define HCI_LMP_RESPONSE_TIMEOUT 0x22
72 #define HCI_LMP_ERROR_TRANSACTION_COLLISION 0x23
73 #define HCI_LMP_PDU_NOT_ALLOWED 0x24
74 #define HCI_ENCRYPTION_MODE_NOT_ACCEPTED 0x25
75 #define HCI_UNIT_LINK_KEY_USED 0x26
76 #define HCI_QOS_NOT_SUPPORTED 0x27
77 #define HCI_INSTANT_PASSED 0x28
78 #define HCI_PAIRING_NOT_SUPPORTED 0x29
79 #define HCI_TRANSACTION_COLLISION 0x2a
80 #define HCI_QOS_UNACCEPTABLE_PARAMETER 0x2c
81 #define HCI_QOS_REJECTED 0x2d
82 #define HCI_CLASSIFICATION_NOT_SUPPORTED 0x2e
83 #define HCI_INSUFFICIENT_SECURITY 0x2f
84 #define HCI_PARAMETER_OUT_OF_RANGE 0x30
85 #define HCI_ROLE_SWITCH_PENDING 0x32
86 #define HCI_SLOT_VIOLATION 0x34
87 #define HCI_ROLE_SWITCH_FAILED 0x35
88 #define HCI_EIR_TOO_LARGE 0x36
89 #define HCI_SIMPLE_PAIRING_NOT_SUPPORTED 0x37
90 #define HCI_HOST_BUSY_PAIRING 0x38
91 #define HCI_CONN_REJ_NO_CH_FOUND 0x39
92 #define HCI_CONTROLLER_BUSY 0x3A
93 #define HCI_UNACCEPTABLE_CONN_INTERV 0x3B
94 #define HCI_DIRECTED_ADV_TIMEOUT 0x3C
95 #define HCI_CONN_TERM_MIC_FAIL 0x3D
96 #define HCI_CONN_FAIL_TO_BE_ESTABL 0x3E
97 #define HCI_MAC_CONN_FAILED 0x3F
98 
103 /*
104  * HCI library functions.
105  * Each function returns 0 in case of success, otherwise one of the error codes.
106  */
107 
108 int hci_reset(void);
109 
110 int hci_disconnect(uint16_t handle, uint8_t reason);
111 
112 int hci_le_set_advertise_enable(uint8_t enable);
113 
114 int hci_le_set_advertising_parameters(uint16_t min_interval, uint16_t max_interval, uint8_t advtype,
115  uint8_t own_bdaddr_type, uint8_t direct_bdaddr_type, const tBDAddr direct_bdaddr, uint8_t chan_map,
116  uint8_t filter);
117 
118 int hci_le_set_scan_parameters(uint8_t type, uint16_t interval,
119  uint16_t window, uint8_t own_bdaddr_type,
120  uint8_t filter);
121 
122 int hci_le_set_scan_enable(uint8_t enable, uint8_t filter_dup);
123 
124 int hci_le_set_advertising_data(uint8_t length, const uint8_t data[]);
125 
126 int hci_le_set_scan_resp_data(uint8_t length, const uint8_t data[]);
127 
128 int hci_le_rand(uint8_t random_number[8]);
129 
130 int hci_le_read_advertising_channel_tx_power(int8_t *tx_power_level);
131 
132 int hci_acl_data(const uint8_t * data, uint16_t len);
133 
135 
136 int hci_read_bd_addr(tBDAddr bdaddr);
137 
138 int hci_le_read_white_list_size(uint8_t *size);
139 
140 int hci_le_clear_white_list(void);
141 
142 int hci_le_add_device_to_white_list(uint8_t bdaddr_type, tBDAddr bdaddr);
143 
144 int hci_le_remove_device_from_white_list(uint8_t bdaddr_type, tBDAddr bdaddr);
145 
146 int hci_le_encrypt(uint8_t key[16], uint8_t plaintextData[16], uint8_t encryptedData[16]);
147 
148 int hci_le_ltk_request_reply(uint8_t key[16]);
149 
151 
152 int hci_le_read_buffer_size(uint16_t *pkt_len, uint8_t *max_pkt);
153 
154 int hci_le_create_connection(uint16_t interval, uint16_t window, uint8_t initiator_filter, uint8_t peer_bdaddr_type,
155  const tBDAddr peer_bdaddr, uint8_t own_bdaddr_type, uint16_t min_interval, uint16_t max_interval,
156  uint16_t latency, uint16_t supervision_timeout, uint16_t min_ce_length, uint16_t max_ce_length);
157 
159 
160 int hci_read_transmit_power_level(uint16_t *conn_handle, uint8_t type, int8_t * tx_level);
161 
162 int hci_read_rssi(uint16_t *conn_handle, int8_t * rssi);
163 
164 int hci_le_read_local_supported_features(uint8_t *features);
165 
166 int hci_le_read_channel_map(uint16_t conn_handle, uint8_t ch_map[5]);
167 
168 int hci_le_read_supported_states(uint8_t states[8]);
169 
170 int hci_le_receiver_test(uint8_t frequency);
171 
172 int hci_le_transmitter_test(uint8_t frequency, uint8_t length, uint8_t payload);
173 
174 int hci_le_test_end(uint16_t *num_pkts);
175 
176 int hci_le_read_local_version(uint8_t *hci_version, uint16_t *hci_revision, uint8_t *lmp_pal_version,
177  uint16_t *manufacturer_name, uint16_t *lmp_pal_subversion);
178 
192 #endif /* __HCI_LE_H_ */
int hci_le_add_device_to_white_list(uint8_t bdaddr_type, tBDAddr bdaddr)
Definition: hci_le.c:569
int hci_read_transmit_power_level(uint16_t *conn_handle, uint8_t type, int8_t *tx_level)
Definition: hci_le.c:617
int hci_reset(void)
Definition: hci_le.c:28
int hci_le_read_local_supported_features(uint8_t *features)
Definition: hci_le.c:682
int hci_le_set_scan_parameters(uint8_t type, uint16_t interval, uint16_t window, uint8_t own_bdaddr_type, uint8_t filter)
Definition: hci_le.c:210
int hci_disconnect(uint16_t handle, uint8_t reason)
Definition: hci_le.c:45
int hci_le_ltk_request_reply(uint8_t key[16])
Definition: hci_le.c:476
int hci_le_read_white_list_size(uint8_t *size)
Definition: hci_le.c:525
int hci_le_set_advertise_enable(uint8_t enable)
Definition: hci_le.c:187
int hci_read_rssi(uint16_t *conn_handle, int8_t *rssi)
Definition: hci_le.c:650
uint8_t tBDAddr[6]
Definition: link_layer.h:51
int hci_le_read_local_version(uint8_t *hci_version, uint16_t *hci_revision, uint8_t *lmp_pal_version, uint16_t *manufacturer_name, uint16_t *lmp_pal_subversion)
Definition: hci_le.c:69
int hci_le_ltk_request_neg_reply(void)
Definition: hci_le.c:501
int hci_le_set_advertising_data(uint8_t length, const uint8_t data[])
Definition: hci_le.c:163
int hci_le_set_scan_resp_data(uint8_t length, const uint8_t data[])
Definition: hci_le.c:290
int hci_le_read_channel_map(uint16_t conn_handle, uint8_t ch_map[5])
Definition: hci_le.c:708
int hci_read_bd_addr(tBDAddr bdaddr)
Definition: hci_le.c:364
int hci_acl_data(const uint8_t *data, uint16_t len)
int hci_le_set_advertising_parameters(uint16_t min_interval, uint16_t max_interval, uint8_t advtype, uint8_t own_bdaddr_type, uint8_t direct_bdaddr_type, const tBDAddr direct_bdaddr, uint8_t chan_map, uint8_t filter)
Definition: hci_le.c:130
int hci_le_test_end(uint16_t *num_pkts)
Definition: hci_le.c:813
int hci_le_set_scan_enable(uint8_t enable, uint8_t filter_dup)
Definition: hci_le.c:239
int hci_le_rand(uint8_t random_number[8])
Definition: hci_le.c:263
int hci_le_read_supported_states(uint8_t states[8])
Definition: hci_le.c:739
int hci_le_create_connection_cancel(void)
Definition: hci_le.c:427
int hci_le_transmitter_test(uint8_t frequency, uint8_t length, uint8_t payload)
Definition: hci_le.c:788
int hci_le_create_connection(uint16_t interval, uint16_t window, uint8_t initiator_filter, uint8_t peer_bdaddr_type, const tBDAddr peer_bdaddr, uint8_t own_bdaddr_type, uint16_t min_interval, uint16_t max_interval, uint16_t latency, uint16_t supervision_timeout, uint16_t min_ce_length, uint16_t max_ce_length)
Definition: hci_le.c:390
int hci_le_remove_device_from_white_list(uint8_t bdaddr_type, tBDAddr bdaddr)
Definition: hci_le.c:593
int hci_le_read_buffer_size(uint16_t *pkt_len, uint8_t *max_pkt)
Definition: hci_le.c:102
int hci_le_encrypt(uint8_t key[16], uint8_t plaintextData[16], uint8_t encryptedData[16])
Definition: hci_le.c:444
int hci_le_receiver_test(uint8_t frequency)
Definition: hci_le.c:765
int hci_le_set_random_address(tBDAddr bdaddr)
Definition: hci_le.c:341
int hci_le_read_advertising_channel_tx_power(int8_t *tx_power_level)
Definition: hci_le.c:314
int hci_le_clear_white_list(void)
Definition: hci_le.c:551
Generated on Mon Apr 15 2019 18:10:39 for BlueNRG-MS pack for STM32CubeMX by   doxygen 1.8.13