RetroArch
hci.h
Go to the documentation of this file.
1 #ifndef __HCI_H__
2 #define __HCI_H__
3 
4 #include "bt.h"
5 #include "bd_addr.h"
6 
7 /* HCI packet indicators */
8 #define HCI_COMMAND_DATA_PACKET 0x01
9 #define HCI_ACL_DATA_PACKET 0x02
10 #define HCI_SCO_DATA_PACKET 0x03
11 #define HCI_EVENT_PACKET 0x04
12 #define HCI_VENDOR_PACKET 0xff
13 
14 /* HCI packet types */
15 #define HCI_DM1 0x0008
16 #define HCI_DM3 0x0400
17 #define HCI_DM5 0x4000
18 #define HCI_DH1 0x0010
19 #define HCI_DH3 0x0800
20 #define HCI_DH5 0x8000
21 
22 #define HCI_HV1 0x0020
23 #define HCI_HV2 0x0040
24 #define HCI_HV3 0x0080
25 
26 #define SCO_PTYPE_MASK (HCI_HV1 | HCI_HV2 | HCI_HV3)
27 #define ACL_PTYPE_MASK (~SCO_PTYPE_MASK)
28 
29 #define HCI_EVENT_HDR_LEN 2
30 #define HCI_ACL_HDR_LEN 4
31 #define HCI_SCO_HDR_LEN 3
32 #define HCI_CMD_HDR_LEN 3
33 
34 /* LMP features */
35 #define LMP_3SLOT 0x01
36 #define LMP_5SLOT 0x02
37 #define LMP_ENCRYPT 0x04
38 #define LMP_SOFFSET 0x08
39 #define LMP_TACCURACY 0x10
40 #define LMP_RSWITCH 0x20
41 #define LMP_HOLD 0x40
42 #define LMP_SNIFF 0x80
43 
44 #define LMP_PARK 0x01
45 #define LMP_RSSI 0x02
46 #define LMP_QUALITY 0x04
47 #define LMP_SCO 0x08
48 #define LMP_HV2 0x10
49 #define LMP_HV3 0x20
50 #define LMP_ULAW 0x40
51 #define LMP_ALAW 0x80
52 
53 #define LMP_CVSD 0x01
54 #define LMP_PSCHEME 0x02
55 #define LMP_PCONTROL 0x04
56 
57 /* Opcode Group Field (OGF) values */
58 #define HCI_LINK_CONTROL 0x01 /* Link Control Commands */
59 #define HCI_LINK_POLICY 0x02 /* Link Policy Commands */
60 #define HCI_HOST_C_N_BB 0x03 /* Host Controller & Baseband Commands */
61 #define HCI_INFO_PARAM 0x04 /* Informational Parameters */
62 #define HCI_STATUS_PARAM 0x05 /* Status Parameters */
63 #define HCI_TESTING 0x06 /* Testing Commands */
64 
65 /* Opcode Command Field (OCF) values */
66 
67 /* Link control commands */
68 #define HCI_INQUIRY 0x01
69 #define HCI_PERIODIC_INQUIRY 0x03
70 #define HCI_CREATE_CONNECTION 0x05
71 #define HCI_REJECT_CONNECTION_REQUEST 0x0A
72 #define HCI_DISCONNECT 0x06
73 #define HCI_PIN_CODE_REQ_REP 0x0D
74 #define HCI_PIN_CODE_REQ_NEG_REP 0x0E
75 #define HCI_LINK_KEY_REQ_REP 0x0B
76 #define HCI_LINK_KEY_REQ_REP_NEG 0x0C
77 #define HCI_SET_CONN_ENCRYPT 0x13
78 
79 /* Link Policy commands */
80 #define HCI_HOLD_MODE 0x01
81 #define HCI_SNIFF_MODE 0x03
82 #define HCI_EXIT_SNIFF_MODE 0x04
83 #define HCI_PARK_MODE 0x05
84 #define HCI_EXIT_PARK_MODE 0x06
85 #define HCI_W_LINK_POLICY 0x0D
86 
87 /* Host-Controller and Baseband Commands */
88 #define HCI_SET_EVENT_MASK 0x01
89 #define HCI_RESET 0x03
90 #define HCI_SET_EVENT_FILTER 0x05
91 #define HCI_WRITE_STORED_LINK_KEY 0x11
92 #define HCI_ROLE_CHANGE 0x12
93 #define HCI_WRITE_LOCAL_NAME 0x13
94 
95 #define HCI_WRITE_PAGE_TIMEOUT 0x18
96 #define HCI_WRITE_SCAN_ENABLE 0x1A
97 #define HCI_WRITE_COD 0x24
98 #define HCI_W_FLUSHTO 0x28
99 #define HCI_SET_HC_TO_H_FC 0x31
100 #define HCI_READ_CUR_IACLAP 0x39
101 #define HCI_WRITE_PIN_TYPE 0x0A
102 #define HCI_R_STORED_LINK_KEY 0x0D
103 #define HCI_HOST_BUF_SIZE 0x33
104 #define HCI_WRITE_INQUIRY_SCAN_TYPE 0x43
105 #define HCI_WRITE_INQUIRY_MODE 0x45
106 #define HCI_WRITE_PAGE_SCAN_TYPE 0x47
107 
108 /* Informational Parameters */
109 #define HCI_READ_LOCAL_VERSION 0x01
110 #define HCI_READ_LOCAL_FEATURES 0x03
111 #define HCI_READ_BUFFER_SIZE 0x05
112 #define HCI_READ_BD_ADDR 0x09
113 
114 /* Status Parameters */
115 #define HCI_READ_FAILED_CONTACT_COUNTER 0x01
116 #define HCI_RESET_FAILED_CONTACT_COUNTER 0x02
117 #define HCI_GET_LINK_QUALITY 0x03
118 #define HCI_READ_RSSI 0x05
119 
120 /* Testing commands */
121 
122 /* Possible event codes */
123 #define HCI_INQUIRY_COMPLETE 0x01
124 #define HCI_INQUIRY_RESULT 0x02
125 #define HCI_CONNECTION_COMPLETE 0x03
126 #define HCI_CONNECTION_REQUEST 0x04
127 #define HCI_DISCONNECTION_COMPLETE 0x05
128 #define HCI_ENCRYPTION_CHANGE 0x08
129 #define HCI_QOS_SETUP_COMPLETE 0x0D
130 #define HCI_COMMAND_COMPLETE 0x0E
131 #define HCI_COMMAND_STATUS 0x0F
132 #define HCI_HARDWARE_ERROR 0x10
133 #define HCI_ROLE_CHANGE 0x12
134 #define HCI_NBR_OF_COMPLETED_PACKETS 0x13
135 #define HCI_MODE_CHANGE 0x14
136 #define HCI_RETURN_LINK_KEYS 0x15
137 #define HCI_PIN_CODE_REQUEST 0x16
138 #define HCI_LINK_KEY_REQUEST 0x17
139 #define HCI_LINK_KEY_NOTIFICATION 0x18
140 #define HCI_DATA_BUFFER_OVERFLOW 0x1A
141 #define HCI_MAX_SLOTS_CHANGE 0x1B
142 
143 /* Success code */
144 #define HCI_SUCCESS 0x00
145 /* Possible error codes */
146 #define HCI_UNKNOWN_HCI_COMMAND 0x01
147 #define HCI_NO_CONNECTION 0x02
148 #define HCI_HW_FAILURE 0x03
149 #define HCI_PAGE_TIMEOUT 0x04
150 #define HCI_AUTHENTICATION_FAILURE 0x05
151 #define HCI_KEY_MISSING 0x06
152 #define HCI_MEMORY_FULL 0x07
153 #define HCI_CONN_TIMEOUT 0x08
154 #define HCI_MAX_NUMBER_OF_CONNECTIONS 0x09
155 #define HCI_MAX_NUMBER_OF_SCO_CONNECTIONS_TO_DEVICE 0x0A
156 #define HCI_ACL_CONNECTION_EXISTS 0x0B
157 #define HCI_COMMAND_DISSALLOWED 0x0C
158 #define HCI_HOST_REJECTED_DUE_TO_LIMITED_RESOURCES 0x0D
159 #define HCI_HOST_REJECTED_DUE_TO_SECURITY_REASONS 0x0E
160 #define HCI_HOST_REJECTED_DUE_TO_REMOTE_DEVICE_ONLY_PERSONAL_SERVICE 0x0F
161 #define HCI_HOST_TIMEOUT 0x10
162 #define HCI_UNSUPPORTED_FEATURE_OR_PARAMETER_VALUE 0x11
163 #define HCI_INVALID_HCI_COMMAND_PARAMETERS 0x12
164 #define HCI_OTHER_END_TERMINATED_CONN_USER_ENDED 0x13
165 #define HCI_OTHER_END_TERMINATED_CONN_LOW_RESOURCES 0x14
166 #define HCI_OTHER_END_TERMINATED_CONN_ABOUT_TO_POWER_OFF 0x15
167 #define HCI_CONN_TERMINATED_BY_LOCAL_HOST 0x16
168 #define HCI_REPETED_ATTEMPTS 0x17
169 #define HCI_PAIRING_NOT_ALLOWED 0x18
170 #define HCI_UNKNOWN_LMP_PDU 0x19
171 #define HCI_UNSUPPORTED_REMOTE_FEATURE 0x1A
172 #define HCI_SCO_OFFSET_REJECTED 0x1B
173 #define HCI_SCO_INTERVAL_REJECTED 0x1C
174 #define HCI_SCO_AIR_MODE_REJECTED 0x1D
175 #define HCI_INVALID_LMP_PARAMETERS 0x1E
176 #define HCI_UNSPECIFIED_ERROR 0x1F
177 #define HCI_UNSUPPORTED_LMP_PARAMETER_VALUE 0x20
178 #define HCI_ROLE_CHANGE_NOT_ALLOWED 0x21
179 #define HCI_LMP_RESPONSE_TIMEOUT 0x22
180 #define HCI_LMP_ERROR_TRANSACTION_COLLISION 0x23
181 #define HCI_LMP_PDU_NOT_ALLOWED 0x24
182 #define HCI_ENCRYPTION_MODE_NOT_ACCEPTABLE 0x25
183 #define HCI_UNIT_KEY_USED 0x26
184 #define HCI_QOS_NOT_SUPPORTED 0x27
185 #define HCI_INSTANT_PASSED 0x28
186 #define HCI_PAIRING_UNIT_KEY_NOT_SUPPORTED 0x29
187 
188 /* Specification specific parameters */
189 #define HCI_BD_ADDR_LEN 6
190 #define HCI_LMP_FEATURES_LEN 8
191 #define HCI_LINK_KEY_LEN 16
192 #define HCI_LMP_FEAT_LEN 8
193 
194 /* Command OGF */
195 #define HCI_LINK_CTRL_OGF 0x01 /* Link ctrl cmds */
196 #define HCI_LINK_POLICY_OGF 0x02 /* Link Policy Commands */
197 #define HCI_HC_BB_OGF 0x03 /* Host controller and baseband commands */
198 #define HCI_INFO_PARAM_OGF 0x04 /* Informal parameters */
199 
200 /* Command OCF */
201 #define HCI_INQUIRY_OCF 0x01
202 #define HCI_SNIFF_MODE_OCF 0x03
203 #define HCI_EXIT_SNIFF_MODE_OCF 0x04
204 #define HCI_PARK_MODE_OCF 0x05
205 #define HCI_EXIT_PARK_MODE_OCF 0x06
206 #define HCI_PERIODIC_INQUIRY_OCF 0x03
207 #define HCI_EXIT_PERIODIC_INQUIRY_OCF 0x04
208 #define HCI_CREATE_CONN_OCF 0x05
209 #define HCI_DISCONN_OCF 0x06
210 #define HCI_W_LOCAL_NAME_OCF 0x13
211 #define HCI_W_LINK_POLICY_OCF 0x0D
212 #define HCI_ACCEPT_CONN_REQ_OCF 0x09
213 #define HCI_REJECT_CONN_REQ_OCF 0x0A
214 #define HCI_SET_EV_MASK_OCF 0x01
215 #define HCI_RESET_OCF 0x03
216 #define HCI_SET_EV_FILTER_OCF 0x05
217 #define HCI_R_STORED_LINK_KEY_OCF 0x0D
218 #define HCI_W_PAGE_TIMEOUT_OCF 0x18
219 #define HCI_W_SCAN_EN_OCF 0x1A
220 #define HCI_R_COD_OCF 0x23
221 #define HCI_W_COD_OCF 0x24
222 #define HCI_SET_HC_TO_H_FC_OCF 0x31
223 #define HCI_H_BUF_SIZE_OCF 0x33
224 #define HCI_H_NUM_COMPL_OCF 0x35
225 #define HCI_R_CUR_IACLAP_OCF 0x39
226 #define HCI_R_LOC_VERSION_OCF 0x01
227 #define HCI_R_LOC_FEATURES_OCF 0x03
228 #define HCI_R_BUF_SIZE_OCF 0x05
229 #define HCI_R_BD_ADDR_OCF 0x09
230 #define HCI_R_REMOTE_NAME_OCF 0x19
231 #define HCI_W_PIN_TYPE_OCF 0x0A
232 #define HCI_W_INQUIRY_SCAN_TYPE_OCF 0x43
233 #define HCI_W_INQUIRY_MODE_OCF 0x45
234 #define HCI_W_PAGE_SCAN_TYPE_OCF 0x47
235 #define HCI_W_PAGE_SCAN_TYPE_OCF 0x47
236 
237 /* Command packet length (including ACL header)*/
238 #define HCI_INQUIRY_PLEN 9
239 #define HCI_PERIODIC_INQUIRY_PLEN 13
240 #define HCI_EXIT_PERIODIC_INQUIRY_PLEN 4
241 #define HCI_CREATE_CONN_PLEN 17
242 #define HCI_DISCONN_PLEN 7
243 #define HCI_REJECT_CONN_REQ_PLEN 11
244 #define HCI_ACCEPT_CONN_REQ_PLEN 11
245 #define HCI_PIN_CODE_REQ_REP_PLEN 27
246 #define HCI_PIN_CODE_REQ_NEG_REP_PLEN 10
247 #define HCI_LINK_KEY_REQ_REP_PLEN 26
248 #define HCI_LINK_KEY_REQ_REP_NEG_PLEN 10
249 #define HCI_SET_CONN_ENCRYPT_PLEN 7
250 #define HCI_WRITE_STORED_LINK_KEY_PLEN 27
251 #define HCI_SET_EV_MASK_PLEN 12
252 #define HCI_SNIFF_PLEN 14
253 #define HCI_W_LINK_POLICY_PLEN 8
254 #define HCI_RESET_PLEN 4
255 #define HCI_SET_EV_FILTER_PLEN 6
256 #define HCI_W_PAGE_TIMEOUT_PLEN 6
257 #define HCI_W_SCAN_EN_PLEN 5
258 #define HCI_R_COD_PLEN 4
259 #define HCI_W_COD_PLEN 7
260 #define HCI_W_FLUSHTO_PLEN 8
261 #define HCI_W_LOCAL_NAME_PLEN 252
262 #define HCI_SET_HC_TO_H_FC_PLEN 5
263 #define HCI_H_BUF_SIZE_PLEN 11
264 #define HCI_H_NUM_COMPL_PLEN 9
265 #define HCI_R_LOC_FEAT_SIZE_PLEN 4
266 #define HCI_R_LOC_VERS_SIZE_PLEN 4
267 #define HCI_R_BUF_SIZE_PLEN 4
268 #define HCI_R_BD_ADDR_PLEN 4
269 #define HCI_R_CUR_IACLAP_PLEN 4
270 #define HCI_R_STORED_LINK_KEY_PLEN 11
271 #define HCI_R_REMOTE_NAME_PLEN 14
272 #define HCI_W_PIN_TYPE_PLEN 5
273 #define HCI_W_INQUIRY_MODE_PLEN 5
274 #define HCI_W_INQUIRY_SCAN_TYPE_PLEN 5
275 #define HCI_W_PAGE_SCAN_TYPE_PLEN 5
276 #define HCI_W_VENDOR_CMD_PLEN 4
277 
279 {
283 
285 {
289 
291 {
292  struct hci_inq_res *next;
293  struct bd_addr bdaddr;
294  u8_t cod[3];
298 };
299 
301 {
302  struct bd_addr bdaddr;
303  u8_t key[16];
304 
306 };
307 
308 struct hci_link
309 {
310  struct hci_link *next;
311  struct bd_addr bdaddr;
313  struct pbuf *p;
317 };
318 
320 {
326 };
327 
328 struct hci_pcb
329 {
330  void *cbarg;
332 
337 
339 
342 
345 
346  struct bd_addr bdaddr;
348 
349  struct hci_inq_res *ires;
351 
352  err_t (*pin_req)(void *arg,struct bd_addr *bdaddr);
353  err_t (*link_key_req)(void *arg,struct bd_addr *bdaddr);
354  err_t (*cmd_complete)(void *arg,struct hci_pcb *pcb,u8_t ogf,u8_t ocf,u8_t result);
355  err_t (*link_key_not)(void *arg, struct bd_addr *bdaddr, u8_t *key);
356  err_t (*conn_complete)(void *arg,struct bd_addr *bdaddr);
357  err_t (*inq_complete)(void *arg,struct hci_pcb *pcb,struct hci_inq_res *ires,u16_t result);
358  err_t (*wlp_complete)(void *arg, struct bd_addr *bdaddr);
359  err_t (*conn_req)(void *arg,struct bd_addr *bdaddr,u8_t *cod,u8_t link_type);
360 };
361 
362 err_t hci_init(void);
363 struct hci_link* hci_new(void);
364 void hci_reset_all(void);
365 void hci_event_handler(struct pbuf *p);
366 void hci_acldata_handler(struct pbuf *p);
367 
368 err_t hci_reset();
369 err_t hci_read_bd_addr(void);
374 err_t hci_write_cod(u8_t *cod);
375 err_t hci_close(struct hci_link *link);
379 err_t hci_disconnect(struct bd_addr *bdaddr, u8_t reason);
381 err_t hci_pin_code_request_reply(struct bd_addr *bdaddr, u8_t pinlen, u8_t *pincode);
382 err_t hci_link_key_req_reply(struct bd_addr *bdaddr, u8_t *link_key);
384 err_t hci_set_event_filter(u8_t filter_type,u8_t filter_cond_type,u8_t *cond);
386 err_t hci_inquiry(u32_t lap,u8_t inq_len,u8_t num_resp,err_t (*inq_complete)(void *arg,struct hci_pcb *pcb,struct hci_inq_res *ires,u16_t result));
389 err_t hci_write_scan_enable(u8_t scan_enable);
390 err_t hci_host_num_comp_packets(u16_t conhdl, u16_t num_complete);
391 err_t hci_sniff_mode(struct bd_addr *bdaddr, u16_t max_interval, u16_t min_interval, u16_t attempt, u16_t timeout);
393 err_t hci_periodic_inquiry(u32_t lap,u16_t min_period,u16_t max_period,u8_t inq_len,u8_t num_resp,err_t (*inq_complete)(void *arg,struct hci_pcb *pcb,struct hci_inq_res *ires,u16_t result));
404 
405 err_t hci_reg_dev_info(struct bd_addr *bdaddr,u8_t *cod,u8_t psrm,u8_t psm,u16_t co);
406 
407 void hci_arg(void *arg);
408 void hci_cmd_complete(err_t (*cmd_complete)(void *arg,struct hci_pcb *pcb,u8_t ogf,u8_t ocf,u8_t result));
409 void hci_connection_complete(err_t (* conn_complete)(void *arg, struct bd_addr *bdaddr));
410 void hci_pin_req(err_t (* pin_req)(void *arg, struct bd_addr *bdaddr));
411 void hci_link_key_req(err_t (* link_key_req)(void *arg, struct bd_addr *bdaddr));
412 void hci_link_key_not(err_t (* link_key_not)(void *arg, struct bd_addr *bdaddr, u8_t *key));
413 void hci_wlp_complete(err_t (* wlp_complete)(void *arg, struct bd_addr *bdaddr));
414 void hci_conn_req(err_t (*conn_req)(void *arg,struct bd_addr *bdaddr,u8_t *cod,u8_t link_type));
415 
418 err_t lp_acl_write(struct bd_addr *bdaddr,struct pbuf *p,u16_t len,u8_t pb);
419 err_t lp_connect_req(struct bd_addr *bdaddr, u8_t allow_role_switch);
421 
422 
423 #define HCI_EVENT_PIN_REQ(pcb,bdaddr,ret) \
424  if((pcb)->pin_req != NULL) { \
425  (ret = (pcb)->pin_req((pcb)->cbarg,(bdaddr))); \
426  } else { \
427  ret = hci_pin_code_request_neg_reply(bdaddr); \
428  }
429 #define HCI_EVENT_LINK_KEY_REQ(pcb,bdaddr,ret) \
430  if((pcb)->link_key_req != NULL) { \
431  (ret = (pcb)->link_key_req((pcb)->cbarg,(bdaddr))); \
432  } else { \
433  ret = hci_link_key_req_neg_reply(bdaddr); \
434  }
435 #define HCI_EVENT_CONN_REQ(pcb,bdaddr,cod,linktype,ret) \
436  if((pcb)->conn_req!=NULL) \
437  (ret = (pcb)->conn_req((pcb)->cbarg,(bdaddr),(cod),(linktype)))
438 #define HCI_EVENT_LINK_KEY_NOT(pcb,bdaddr,key,ret) \
439  if((pcb)->link_key_not != NULL) { \
440  (ret = (pcb)->link_key_not((pcb)->cbarg,(bdaddr),(key))); \
441  }
442 #define HCI_EVENT_INQ_COMPLETE(pcb,result,ret) \
443  if((pcb)->inq_complete != NULL) \
444  (ret = (pcb)->inq_complete((pcb)->cbarg,(pcb),(pcb)->ires,(result)))
445 #define HCI_EVENT_WLP_COMPLETE(pcb,bdaddr,ret) \
446  if((pcb)->wlp_complete != NULL) \
447  (ret = (pcb)->wlp_complete((pcb)->cbarg,(bdaddr)));
448 #define HCI_EVENT_CONN_COMPLETE(pcb,bdaddr,ret) \
449  if((pcb)->conn_complete != NULL) \
450  (ret = (pcb)->conn_complete((pcb)->cbarg,(bdaddr)));
451 #define HCI_EVENT_CMD_COMPLETE(pcb,ogf,ocf,result,ret) \
452  if((pcb)->cmd_complete != NULL) \
453  (ret = (pcb)->cmd_complete((pcb)->cbarg,(pcb),(ogf),(ocf),(result)))
454 
455 /* The HCI LINK lists. */
456 extern struct hci_link *hci_active_links; /* List of all active HCI LINKs */
457 extern struct hci_link *hci_tmp_link; /* Only used for temporary storage. */
458 extern struct hci_link_key *hci_tmp_key;
459 
460 #define HCI_REG(links, nlink) do { \
461  u32 level; \
462  _CPU_ISR_Disable(level); \
463  nlink->next = *links; \
464  *links = nlink; \
465  _CPU_ISR_Restore(level); \
466  } while(0)
467 #define HCI_RMV(links, nlink) do { \
468  u32 level; \
469  _CPU_ISR_Disable(level);\
470  if(*links == nlink) { \
471  *links = (*links)->next; \
472  } else for(hci_tmp_link = *links; hci_tmp_link != NULL; hci_tmp_link = hci_tmp_link->next) { \
473  if(hci_tmp_link->next != NULL && hci_tmp_link->next == nlink) { \
474  hci_tmp_link->next = nlink->next; \
475  break; \
476  } \
477  } \
478  nlink->next = NULL; \
479  _CPU_ISR_Restore(level); \
480  } while(0)
481 
482 #endif
Definition: hci.h:278
u16_t connhdl_pb_bc
Definition: hci.h:286
int link(const char *oldpath, const char *newpath)
Definition: compat_ctype.c:438
GLuint const GLchar * name
Definition: glext.h:6671
GLbitfield GLuint64 timeout
Definition: glext.h:7831
s8 s8_t
Definition: cc.h:44
struct hci_link * hci_new(void)
Definition: hci.c:89
void hci_event_handler(struct pbuf *p)
Definition: hci.c:1591
u8_t lp_is_connected(struct bd_addr *bdaddr)
Definition: hci.c:1193
err_t hci_vendor_specific_command(u8_t ocf, u8_t ogf, void *data, u8_t len)
Definition: hci.c:756
void hci_reset_all(void)
Definition: hci.c:136
s8_t err_t
Definition: err.h:39
GLenum mode
Definition: glext.h:6857
err_t lp_acl_write(struct bd_addr *bdaddr, struct pbuf *p, u16_t len, u8_t pb)
Definition: hci.c:1212
err_t(* pin_req)(void *arg, struct bd_addr *bdaddr)
Definition: hci.h:352
void hci_link_key_req(err_t(*link_key_req)(void *arg, struct bd_addr *bdaddr))
Definition: hci.c:195
err_t hci_exit_periodic_inquiry()
Definition: hci.c:552
u16_t pkt_type
Definition: hci.h:343
u8_t hci_version
Definition: hci.h:321
Definition: hci.h:319
err_t(* cmd_complete)(void *arg, struct hci_pcb *pcb, u8_t ogf, u8_t ocf, u8_t result)
Definition: hci.h:354
struct hci_evt_hdr ATTRIBUTE_PACKED
Definition: libretro.h:2275
u16_t acl_max_pkt
Definition: hci.h:335
err_t lp_write_flush_timeout(struct bd_addr *bdaddr, u16_t flushto)
Definition: hci.c:1275
err_t hci_reset()
Definition: hci.c:274
GLenum GLsizei len
Definition: glext.h:7389
err_t hci_accecpt_conn_request(struct bd_addr *bdaddr, u8_t role)
Definition: hci.c:570
u8_t sco_mtu
Definition: hci.h:334
u8_t cod[3]
Definition: hci.h:294
static int cond(LexState *ls)
Definition: lparser.c:1177
err_t hci_pin_code_request_reply(struct bd_addr *bdaddr, u8_t pinlen, u8_t *pincode)
Definition: hci.c:856
void hci_arg(void *arg)
Definition: hci.c:165
u16_t lmp_subversion
Definition: hci.h:325
struct hci_inq_res * ires
Definition: hci.h:349
err_t hci_write_page_timeout(u16_t timeout)
Definition: hci.c:447
u8_t psm
Definition: hci.h:296
err_t(* link_key_not)(void *arg, struct bd_addr *bdaddr, u8_t *key)
Definition: hci.h:355
err_t hci_read_stored_link_key()
Definition: hci.c:359
err_t hci_inquiry(u32_t lap, u8_t inq_len, u8_t num_resp, err_t(*inq_complete)(void *arg, struct hci_pcb *pcb, struct hci_inq_res *ires, u16_t result))
Definition: hci.c:483
Definition: hci.h:290
err_t lp_connect_req(struct bd_addr *bdaddr, u8_t allow_role_switch)
Definition: hci.c:1311
err_t(* link_key_req)(void *arg, struct bd_addr *bdaddr)
Definition: hci.h:353
void hci_connection_complete(err_t(*conn_complete)(void *arg, struct bd_addr *bdaddr))
Definition: hci.c:220
Definition: ibxm.h:9
err_t hci_write_stored_link_key(struct bd_addr *bdaddr, u8_t *link)
Definition: hci.c:1025
err_t hci_read_buffer_size(void)
Definition: hci.c:291
err_t hci_init(void)
Definition: hci.c:67
err_t hci_write_inquiry_mode(u8_t mode)
Definition: hci.c:696
void hci_acldata_handler(struct pbuf *p)
Definition: hci.c:1734
struct bd_addr bdaddr
Definition: hci.h:311
err_t hci_set_event_filter(u8_t filter_type, u8_t filter_cond_type, u8_t *cond)
Definition: hci.c:388
Definition: hci.h:308
GLenum type
Definition: glext.h:6233
err_t hci_reject_connection_request(struct bd_addr *bdaddr, u8_t reason)
Definition: hci.c:999
err_t pin_req(void *arg, struct bd_addr *bdaddr)
Definition: bte.c:849
err_t hci_read_current_lap(void)
Definition: hci.c:1072
Definition: hci.h:284
Definition: bd_addr.h:42
err_t hci_read_bd_addr(void)
Definition: hci.c:308
err_t hci_write_link_policy_settings(struct bd_addr *bdaddr, u16_t link_policy)
Definition: hci.c:820
u16_t manufacturer
Definition: hci.h:324
err_t hci_pin_code_request_neg_reply(struct bd_addr *bdaddr)
Definition: hci.c:916
void hci_wlp_complete(err_t(*wlp_complete)(void *arg, struct bd_addr *bdaddr))
Definition: hci.c:233
struct hci_inq_res * next
Definition: hci.h:292
err_t link_key_not(void *arg, struct bd_addr *bdaddr, u8_t *key)
Definition: bte.c:914
struct bd_addr bdaddr
Definition: hci.h:293
err_t hci_write_scan_enable(u8_t scan_enable)
Definition: hci.c:465
u8_t lmp_version
Definition: hci.h:323
err_t(* inq_complete)(void *arg, struct hci_pcb *pcb, struct hci_inq_res *ires, u16_t result)
Definition: hci.h:357
Definition: hci.h:328
u64 u64_t
Definition: btopt.h:123
Definition: hci.h:300
struct bd_addr bdaddr
Definition: hci.h:302
u8_t flow
Definition: hci.h:340
u8_t len
Definition: hci.h:281
struct hci_link_key * keyres
Definition: hci.h:350
GLuint64EXT * result
Definition: glext.h:12211
u16_t host_num_acl
Definition: hci.h:341
void hci_cmd_complete(err_t(*cmd_complete)(void *arg, struct hci_pcb *pcb, u8_t ogf, u8_t ocf, u8_t result))
Definition: hci.c:170
err_t hci_write_local_name(u8_t *name, u8_t len)
Definition: hci.c:614
u8_t key[16]
Definition: hci.h:303
u16_t hci_revision
Definition: hci.h:322
GLfloat GLfloat p
Definition: glext.h:9809
err_t(* conn_complete)(void *arg, struct bd_addr *bdaddr)
Definition: hci.h:356
u16_t acl_mtu
Definition: hci.h:333
u16_t lp_pdu_maxsize()
Definition: hci.c:1181
err_t hci_read_local_version(void)
Definition: hci.c:325
struct hci_link * next
Definition: hci.h:310
err_t hci_write_cod(u8_t *cod)
Definition: hci.c:1053
err_t hci_write_page_scan_type(u8_t type)
Definition: hci.c:716
u8 u8_t
Definition: cc.h:43
err_t hci_write_pin_type(u8_t type)
Definition: hci.c:634
err_t hci_disconnect(struct bd_addr *bdaddr, u8_t reason)
Definition: hci.c:965
u8_t features[8]
Definition: hci.h:344
err_t(* conn_req)(void *arg, struct bd_addr *bdaddr, u8_t *cod, u8_t link_type)
Definition: hci.h:359
err_t(* wlp_complete)(void *arg, struct bd_addr *bdaddr)
Definition: hci.h:358
u16_t sco_max_pkt
Definition: hci.h:336
u16_t len
Definition: hci.h:287
err_t hci_link_key_req_neg_reply(struct bd_addr *bdaddr)
Definition: hci.c:941
err_t hci_periodic_inquiry(u32_t lap, u16_t min_period, u16_t max_period, u8_t inq_len, u8_t num_resp, err_t(*inq_complete)(void *arg, struct hci_pcb *pcb, struct hci_inq_res *ires, u16_t result))
Definition: hci.c:515
void hci_link_key_not(err_t(*link_key_not)(void *arg, struct bd_addr *bdaddr, u8_t *key))
Definition: hci.c:207
struct bd_addr bdaddr
Definition: hci.h:346
err_t hci_link_key_req_reply(struct bd_addr *bdaddr, u8_t *link_key)
Definition: hci.c:888
void hci_conn_req(err_t(*conn_req)(void *arg, struct bd_addr *bdaddr, u8_t *cod, u8_t link_type))
Definition: hci.c:238
u32_t link_mode
Definition: hci.h:316
u8_t pb
Definition: hci.h:315
u32_t flags
Definition: hci.h:338
u32 u32_t
Definition: cc.h:47
err_t hci_sniff_mode(struct bd_addr *bdaddr, u16_t max_interval, u16_t min_interval, u16_t attempt, u16_t timeout)
Definition: hci.c:781
err_t hci_write_inquiry_scan_type(u8_t type)
Definition: hci.c:736
u16_t connhdl
Definition: hci.h:312
u16_t co
Definition: hci.h:297
u8_t code
Definition: hci.h:280
err_t hci_host_buffer_size(void)
Definition: hci.c:1123
u8_t psrm
Definition: hci.h:295
err_t hci_host_num_comp_packets(u16_t conhdl, u16_t num_complete)
Definition: hci.c:1152
struct pbuf * p
Definition: hci.h:313
err_t hci_reg_dev_info(struct bd_addr *bdaddr, u8_t *cod, u8_t psrm, u8_t psm, u16_t co)
Definition: hci.c:243
u16_t len
Definition: hci.h:314
struct hci_link_key * hci_tmp_key
Definition: hci.c:60
void * cbarg
Definition: hci.h:330
void hci_pin_req(err_t(*pin_req)(void *arg, struct bd_addr *bdaddr))
Definition: hci.c:183
struct hci_link * hci_tmp_link
Definition: hci.c:59
struct hci_link * hci_active_links
Definition: hci.c:58
s8_t num_cmd
Definition: hci.h:331
err_t hci_close(struct hci_link *link)
Definition: hci.c:117
err_t hci_set_hc_to_h_fc(void)
Definition: hci.c:1096
err_t hci_read_remote_name(struct bd_addr *bdaddr)
Definition: hci.c:654
err_t hci_read_local_features(void)
Definition: hci.c:342
err_t hci_set_event_mask(u64_t ev_mask)
Definition: hci.c:592
u16 u16_t
Definition: cc.h:45
struct hci_link_key * next
Definition: hci.h:305
Definition: pbuf.h:66