48 #include <sys/param.h>
50 #include <sys/types.h>
51 #include <sys/ioctl.h>
52 #include <sys/socket.h>
59 #define MIN(x, y) ((x) < (y) ? (x) : (y))
76 char *str = malloc(120);
84 if ((
unsigned int) m->
val & val)
85 ptr += sprintf(ptr,
"%s ", m->
str);
105 if (!str || !(str = ptr = strdup(str)))
110 while ((t = strsep(&ptr,
","))) {
111 for (m = map; m->
str; m++) {
112 if (!strcasecmp(m->
str, t)) {
113 *val |= (
unsigned int) m->
val;
132 char *str = malloc(50);
140 if ((
unsigned int) m->
val == val) {
141 ptr += sprintf(ptr,
"%s", m->
str);
167 str = ptr = strdup(str);
169 while ((t = strsep(&ptr,
","))) {
170 for (m = map; m->
str; m++) {
171 if (!strcasecmp(m->
str,t)) {
172 *val = (
unsigned int) m->
val;
272 ptr += sprintf(ptr,
"DOWN ");
276 ptr += sprintf(ptr,
"%s ", m->
str);
423 strcpy(str,
"SLAVE ");
451 {
"Inquiry Cancel", 1 },
452 {
"Periodic Inquiry Mode", 2 },
453 {
"Exit Periodic Inquiry Mode", 3 },
454 {
"Create Connection", 4 },
456 {
"Add SCO Connection", 6 },
457 {
"Cancel Create Connection", 7 },
459 {
"Accept Connection Request", 8 },
460 {
"Reject Connection Request", 9 },
461 {
"Link Key Request Reply", 10 },
462 {
"Link Key Request Negative Reply", 11 },
463 {
"PIN Code Request Reply", 12 },
464 {
"PIN Code Request Negative Reply", 13 },
465 {
"Change Connection Packet Type", 14 },
466 {
"Authentication Requested", 15 },
468 {
"Set Connection Encryption", 16 },
469 {
"Change Connection Link Key", 17 },
470 {
"Master Link Key", 18 },
471 {
"Remote Name Request", 19 },
472 {
"Cancel Remote Name Request", 20 },
473 {
"Read Remote Supported Features", 21 },
474 {
"Read Remote Extended Features", 22 },
475 {
"Read Remote Version Information", 23 },
477 {
"Read Clock Offset", 24 },
478 {
"Read LMP Handle", 25 },
488 {
"Sniff Mode", 34 },
489 {
"Exit Sniff Mode", 35 },
490 {
"Park State", 36 },
491 {
"Exit Park State", 37 },
493 {
"Role Discovery", 39 },
495 {
"Switch Role", 40 },
496 {
"Read Link Policy Settings", 41 },
497 {
"Write Link Policy Settings", 42 },
498 {
"Read Default Link Policy Settings", 43 },
499 {
"Write Default Link Policy Settings", 44 },
500 {
"Flow Specification", 45 },
501 {
"Set Event Mask", 46 },
504 {
"Set Event Filter", 48 },
506 {
"Read PIN Type", 50 },
507 {
"Write PIN Type", 51 },
508 {
"Create New Unit Key", 52 },
509 {
"Read Stored Link Key", 53 },
510 {
"Write Stored Link Key", 54 },
511 {
"Delete Stored Link Key", 55 },
513 {
"Write Local Name", 56 },
514 {
"Read Local Name", 57 },
515 {
"Read Connection Accept Timeout", 58 },
516 {
"Write Connection Accept Timeout", 59 },
517 {
"Read Page Timeout", 60 },
518 {
"Write Page Timeout", 61 },
519 {
"Read Scan Enable", 62 },
520 {
"Write Scan Enable", 63 },
522 {
"Read Page Scan Activity", 64 },
523 {
"Write Page Scan Activity", 65 },
524 {
"Read Inquiry Scan Activity", 66 },
525 {
"Write Inquiry Scan Activity", 67 },
526 {
"Read Authentication Enable", 68 },
527 {
"Write Authentication Enable", 69 },
528 {
"Read Encryption Mode", 70 },
529 {
"Write Encryption Mode", 71 },
531 {
"Read Class Of Device", 72 },
532 {
"Write Class Of Device", 73 },
533 {
"Read Voice Setting", 74 },
534 {
"Write Voice Setting", 75 },
535 {
"Read Automatic Flush Timeout", 76 },
536 {
"Write Automatic Flush Timeout", 77 },
537 {
"Read Num Broadcast Retransmissions", 78 },
538 {
"Write Num Broadcast Retransmissions", 79 },
540 {
"Read Hold Mode Activity", 80 },
541 {
"Write Hold Mode Activity", 81 },
542 {
"Read Transmit Power Level", 82 },
543 {
"Read Synchronous Flow Control Enable", 83 },
544 {
"Write Synchronous Flow Control Enable", 84 },
545 {
"Set Host Controller To Host Flow Control", 85 },
546 {
"Host Buffer Size", 86 },
547 {
"Host Number Of Completed Packets", 87 },
549 {
"Read Link Supervision Timeout", 88 },
550 {
"Write Link Supervision Timeout", 89 },
551 {
"Read Number of Supported IAC", 90 },
552 {
"Read Current IAC LAP", 91 },
553 {
"Write Current IAC LAP", 92 },
554 {
"Read Page Scan Period Mode", 93 },
555 {
"Write Page Scan Period Mode", 94 },
556 {
"Read Page Scan Mode", 95 },
558 {
"Write Page Scan Mode", 96 },
559 {
"Set AFH Channel Classification", 97 },
562 {
"Read Inquiry Scan Type", 100 },
563 {
"Write Inquiry Scan Type", 101 },
564 {
"Read Inquiry Mode", 102 },
565 {
"Write Inquiry Mode", 103 },
567 {
"Read Page Scan Type", 104 },
568 {
"Write Page Scan Type", 105 },
569 {
"Read AFH Channel Assessment Mode", 106 },
570 {
"Write AFH Channel Assessment Mode", 107 },
579 {
"Read Local Version Information", 115 },
580 {
"Read Local Supported Commands", 116 },
581 {
"Read Local Supported Features", 117 },
582 {
"Read Local Extended Features", 118 },
583 {
"Read Buffer Size", 119 },
585 {
"Read Country Code", 120 },
586 {
"Read BD ADDR", 121 },
587 {
"Read Failed Contact Counter", 122 },
588 {
"Reset Failed Contact Counter", 123 },
589 {
"Get Link Quality", 124 },
590 {
"Read RSSI", 125 },
591 {
"Read AFH Channel Map", 126 },
592 {
"Read BD Clock", 127 },
594 {
"Read Loopback Mode", 128 },
595 {
"Write Loopback Mode", 129 },
596 {
"Enable Device Under Test Mode", 130 },
597 {
"Setup Synchronous Connection", 131 },
598 {
"Accept Synchronous Connection", 132 },
599 {
"Reject Synchronous Connection", 133 },
603 {
"Read Extended Inquiry Response", 136 },
604 {
"Write Extended Inquiry Response", 137 },
605 {
"Refresh Encryption Key", 138 },
607 {
"Sniff Subrating", 140 },
608 {
"Read Simple Pairing Mode", 141 },
609 {
"Write Simple Pairing Mode", 142 },
610 {
"Read Local OOB Data", 143 },
612 {
"Read Inquiry Response Transmit Power Level", 144 },
613 {
"Write Inquiry Transmit Power Level", 145 },
614 {
"Read Default Erroneous Data Reporting", 146 },
615 {
"Write Default Erroneous Data Reporting", 147 },
619 {
"IO Capability Request Reply", 151 },
621 {
"User Confirmation Request Reply", 152 },
622 {
"User Confirmation Request Negative Reply", 153 },
623 {
"User Passkey Request Reply", 154 },
624 {
"User Passkey Request Negative Reply", 155 },
625 {
"Remote OOB Data Request Reply", 156 },
626 {
"Write Simple Pairing Debug Mode", 157 },
627 {
"Enhanced Flush", 158 },
628 {
"Remote OOB Data Request Negative Reply", 159 },
632 {
"Send Keypress Notification", 162 },
633 {
"IO Capability Request Negative Reply", 163 },
634 {
"Read Encryption Key Size", 164 },
639 {
"Create Physical Link", 168 },
640 {
"Accept Physical Link", 169 },
641 {
"Disconnect Physical Link", 170 },
642 {
"Create Logical Link", 171 },
643 {
"Accept Logical Link", 172 },
644 {
"Disconnect Logical Link", 173 },
645 {
"Logical Link Cancel", 174 },
646 {
"Flow Specification Modify", 175 },
648 {
"Read Logical Link Accept Timeout", 176 },
649 {
"Write Logical Link Accept Timeout", 177 },
650 {
"Set Event Mask Page 2", 178 },
651 {
"Read Location Data", 179 },
652 {
"Write Location Data", 180 },
653 {
"Read Local AMP Info", 181 },
654 {
"Read Local AMP_ASSOC", 182 },
655 {
"Write Remote AMP_ASSOC", 183 },
657 {
"Read Flow Control Mode", 184 },
658 {
"Write Flow Control Mode", 185 },
659 {
"Read Data Block Size", 186 },
662 {
"Enable AMP Receiver Reports", 189 },
663 {
"AMP Test End", 190 },
664 {
"AMP Test Command", 191 },
666 {
"Read Enhanced Transmit Power Level", 192 },
668 {
"Read Best Effort Flush Timeout", 194 },
669 {
"Write Best Effort Flush Timeout", 195 },
670 {
"Short Range Mode", 196 },
671 {
"Read LE Host Support", 197 },
672 {
"Write LE Host Support", 198 },
675 {
"LE Set Event Mask", 200 },
676 {
"LE Read Buffer Size", 201 },
677 {
"LE Read Local Supported Features", 202 },
679 {
"LE Set Random Address", 204 },
680 {
"LE Set Advertising Parameters", 205 },
681 {
"LE Read Advertising Channel TX Power", 206 },
682 {
"LE Set Advertising Data", 207 },
684 {
"LE Set Scan Response Data", 208 },
685 {
"LE Set Advertise Enable", 209 },
686 {
"LE Set Scan Parameters", 210 },
687 {
"LE Set Scan Enable", 211 },
688 {
"LE Create Connection", 212 },
689 {
"LE Create Connection Cancel", 213 },
690 {
"LE Read White List Size", 214 },
691 {
"LE Clear White List", 215 },
693 {
"LE Add Device To White List", 216 },
694 {
"LE Remove Device From White List", 217 },
695 {
"LE Connection Update", 218 },
696 {
"LE Set Host Channel Classification", 219 },
697 {
"LE Read Channel Map", 220 },
698 {
"LE Read Remote Used Features", 221 },
699 {
"LE Encrypt", 222 },
702 {
"LE Start Encryption", 224 },
703 {
"LE Long Term Key Request Reply", 225 },
704 {
"LE Long Term Key Request Negative Reply", 226 },
705 {
"LE Read Supported States", 227 },
706 {
"LE Receiver Test", 228 },
707 {
"LE Transmitter Test", 229 },
708 {
"LE Test End", 230 },
737 unsigned int maxwidth = width - 3;
739 char *off, *ptr, *str;
745 if (commands[m->
val / 8] & (1 << (m->
val % 8)))
746 size += strlen(m->
str) + (pref ? strlen(pref) : 0) + 3;
754 ptr = str; *ptr =
'\0';
757 ptr += sprintf(ptr,
"%s", pref);
764 if (commands[m->
val / 8] & (1 << (m->
val % 8))) {
765 if (strlen(off) + strlen(m->
str) > maxwidth) {
766 ptr += sprintf(ptr,
"\n%s", pref ? pref :
"");
769 ptr += sprintf(ptr,
"'%s' ", m->
str);
898 {
"<no. 24>", 0x01 },
911 {
"<no. 34>", 0x04 },
915 {
"<LE support>",
LMP_LE },
933 {
"<no. 50>", 0x04 },
938 {
"<no. 55>", 0x80 },
945 {
"<no. 59>", 0x08 },
946 {
"<no. 60>", 0x10 },
947 {
"<no. 61>", 0x20 },
948 {
"<no. 62>", 0x40 },
964 unsigned int maxwidth = width - 1;
965 char *off, *ptr, *str;
968 for (i = 0; i < 8; i++) {
969 hci_map *m = lmp_features_map[i];
972 if (m->
val & features[i])
973 size += strlen(m->
str) +
974 (pref ? strlen(pref) : 0) + 1;
983 ptr = str; *ptr =
'\0';
986 ptr += sprintf(ptr,
"%s", pref);
990 for (i = 0; i < 8; i++) {
991 hci_map *m = lmp_features_map[i];
994 if (m->
val & features[i]) {
995 if (strlen(off) + strlen(m->
str) > maxwidth) {
996 ptr += sprintf(ptr,
"\n%s",
1000 ptr += sprintf(ptr,
"%s ", m->
str);
1031 dl = malloc(
HCI_MAX_DEV *
sizeof(*dr) +
sizeof(*dl));
1037 memset(dl, 0,
HCI_MAX_DEV *
sizeof(*dr) +
sizeof(*dl));
1047 for (i = 0; i < dl->
dev_num; i++, dr++) {
1119 (
long) (bdaddr ? bdaddr : BDADDR_ANY));
1135 if (!strncmp(str,
"hci", 3) && strlen(str) >= 4) {
1186 memset(&di, 0,
sizeof(di));
1213 inquiry_info **ii,
long flags)
1218 int dd, size, err, ret = -1;
1237 buf = malloc(
sizeof(*ir) + (
sizeof(inquiry_info) * (nrsp)));
1248 memcpy(ir->
lap, lap, 3);
1255 ret = ioctl(dd,
HCIINQUIRY, (
unsigned long) buf);
1259 size =
sizeof(inquiry_info) * ir->
num_rsp;
1265 memcpy((
void *) *ii, buf +
sizeof(*ir), size);
1304 memset(&a, 0,
sizeof(a));
1307 if (bind(dd, (
struct sockaddr *) &a,
sizeof(a)) < 0)
1343 int hci_send_cmd(
int dd, uint16_t ogf, uint16_t ocf, uint8_t plen,
void *param)
1353 iv[0].iov_base = &
type;
1355 iv[1].iov_base = &hc;
1360 iv[2].iov_base = param;
1361 iv[2].iov_len = plen;
1365 while (writev(dd, iv, ivn) < 0) {
1366 if (errno == EAGAIN || errno == EINTR)
1409 evt_cmd_complete *cc;
1411 evt_remote_name_req_complete *rn;
1412 evt_le_meta_event *me;
1413 remote_name_req_cp *cp;
1420 p.fd = dd; p.events = POLLIN;
1421 while ((n = poll(&p, 1, to)) < 0) {
1422 if (errno == EAGAIN || errno == EINTR)
1438 while ((len = read(dd, buf,
sizeof(buf))) < 0) {
1439 if (errno == EAGAIN || errno == EINTR)
1444 hdr = (
void *) (buf + 1);
1452 if (cs->opcode != opcode)
1470 if (cc->opcode != opcode)
1481 if (hdr->evt != r->
event)
1487 if (
bacmp(&rn->bdaddr, &cp->bdaddr))
1497 if (me->subevent != r->
event)
1506 if (hdr->evt != r->
event)
1540 uint16_t clkoffset, uint8_t rswitch,
1541 uint16_t *handle,
int to)
1543 evt_conn_complete rp;
1547 memset(&cp, 0,
sizeof(cp));
1548 bacpy(&cp.bdaddr, bdaddr);
1549 cp.pkt_type = ptype;
1550 cp.pscan_rep_mode = 0x02;
1551 cp.clock_offset = clkoffset;
1552 cp.role_switch = rswitch;
1554 memset(&rq, 0,
sizeof(rq));
1571 *handle = rp.handle;
1586 evt_disconn_complete rp;
1590 memset(&cp, 0,
sizeof(cp));
1594 memset(&rq, 0,
sizeof(rq));
1625 le_add_device_to_white_list_cp cp;
1628 memset(&cp, 0,
sizeof(cp));
1629 cp.bdaddr_type =
type;
1630 bacpy(&cp.bdaddr, bdaddr);
1632 memset(&rq, 0,
sizeof(rq));
1663 le_remove_device_from_white_list_cp cp;
1666 memset(&cp, 0,
sizeof(cp));
1667 cp.bdaddr_type =
type;
1668 bacpy(&cp.bdaddr, bdaddr);
1670 memset(&rq, 0,
sizeof(rq));
1700 le_read_white_list_size_rp rp;
1702 memset(&rp, 0,
sizeof(rp));
1703 memset(&rq, 0,
sizeof(rq));
1736 memset(&rq, 0,
sizeof(rq));
1765 uint8_t *peer_irk, uint8_t *local_irk,
int to)
1768 le_add_device_to_resolv_list_cp cp;
1771 memset(&cp, 0,
sizeof(cp));
1772 cp.bdaddr_type =
type;
1773 bacpy(&cp.bdaddr, bdaddr);
1775 memcpy(cp.peer_irk, peer_irk, 16);
1777 memcpy(cp.local_irk, local_irk, 16);
1779 memset(&rq, 0,
sizeof(rq));
1810 le_remove_device_from_resolv_list_cp cp;
1813 memset(&cp, 0,
sizeof(cp));
1814 cp.bdaddr_type =
type;
1815 bacpy(&cp.bdaddr, bdaddr);
1817 memset(&rq, 0,
sizeof(rq));
1848 memset(&rq, 0,
sizeof(rq));
1876 le_read_resolv_list_size_rp rp;
1878 memset(&rp, 0,
sizeof(rp));
1879 memset(&rq, 0,
sizeof(rq));
1911 le_set_address_resolution_enable_cp cp;
1914 memset(&cp, 0,
sizeof(cp));
1917 memset(&rq, 0,
sizeof(rq));
1945 read_local_name_rp rp;
1948 memset(&rq, 0,
sizeof(rq));
1962 rp.name[247] =
'\0';
1963 strncpy(name, (
char *) rp.name, len);
1977 change_local_name_cp cp;
1980 memset(&cp, 0,
sizeof(cp));
1981 strncpy((
char *) cp.name, name,
sizeof(cp.name));
1983 memset(&rq, 0,
sizeof(rq));
2008 uint8_t pscan_rep_mode,
2010 int len,
char *name,
int to)
2012 evt_remote_name_req_complete rn;
2013 remote_name_req_cp cp;
2016 memset(&cp, 0,
sizeof(cp));
2017 bacpy(&cp.bdaddr, bdaddr);
2018 cp.pscan_rep_mode = pscan_rep_mode;
2019 cp.clock_offset = clkoffset;
2021 memset(&rq, 0,
sizeof(rq));
2038 rn.name[247] =
'\0';
2039 strncpy(name, (
char *) rn.name, len);
2070 remote_name_req_cancel_cp cp;
2073 memset(&cp, 0,
sizeof(cp));
2074 bacpy(&cp.bdaddr, bdaddr);
2076 memset(&rq, 0,
sizeof(rq));
2100 evt_read_remote_version_complete rp;
2101 read_remote_version_cp cp;
2104 memset(&cp, 0,
sizeof(cp));
2107 memset(&rq, 0,
sizeof(rq));
2141 evt_read_remote_features_complete rp;
2142 read_remote_features_cp cp;
2145 memset(&cp, 0,
sizeof(cp));
2148 memset(&rq, 0,
sizeof(rq));
2166 memcpy(features, rp.features, 8);
2183 uint8_t *max_page, uint8_t *features,
2186 evt_read_remote_ext_features_complete rp;
2187 read_remote_ext_features_cp cp;
2190 memset(&cp, 0,
sizeof(cp));
2194 memset(&rq, 0,
sizeof(rq));
2212 *max_page = rp.max_page_num;
2215 memcpy(features, rp.features, 8);
2231 evt_read_clock_offset_complete rp;
2232 read_clock_offset_cp cp;
2235 memset(&cp, 0,
sizeof(cp));
2238 memset(&rq, 0,
sizeof(rq));
2255 *clkoffset = rp.clock_offset;
2269 read_local_version_rp rp;
2272 memset(&rq, 0,
sizeof(rq));
2304 read_local_commands_rp rp;
2307 memset(&rq, 0,
sizeof(rq));
2322 memcpy(commands, rp.commands, 64);
2337 read_local_features_rp rp;
2340 memset(&rq, 0,
sizeof(rq));
2355 memcpy(features, rp.features, 8);
2371 uint8_t *features,
int to)
2373 read_local_ext_features_cp cp;
2374 read_local_ext_features_rp rp;
2379 memset(&rq, 0,
sizeof(rq));
2396 *max_page = rp.max_page_num;
2399 memcpy(features, rp.features, 8);
2417 memset(&rq, 0,
sizeof(rq));
2432 bacpy(bdaddr, &rp.bdaddr);
2447 read_class_of_dev_rp rp;
2450 memset(&rq, 0,
sizeof(rq));
2464 memcpy(cls, rp.dev_class, 3);
2478 write_class_of_dev_cp cp;
2481 memset(&rq, 0,
sizeof(rq));
2482 cp.dev_class[0] = cls & 0xff;
2483 cp.dev_class[1] = (cls >> 8) & 0xff;
2484 cp.dev_class[2] = (cls >> 16) & 0xff;
2502 read_voice_setting_rp rp;
2505 memset(&rq, 0,
sizeof(rq));
2519 *vs = rp.voice_setting;
2533 write_voice_setting_cp cp;
2536 memset(&rq, 0,
sizeof(rq));
2537 cp.voice_setting = vs;
2557 read_current_iac_lap_rp rp;
2560 memset(&rq, 0,
sizeof(rq));
2574 *num_iac = rp.num_current_iac;
2575 memcpy(lap, rp.lap, rp.num_current_iac * 3);
2590 write_current_iac_lap_cp cp;
2593 memset(&cp, 0,
sizeof(cp));
2594 cp.num_current_iac = num_iac;
2595 memcpy(&cp.lap, lap, num_iac * 3);
2597 memset(&rq, 0,
sizeof(rq));
2601 rq.
clen = num_iac * 3 + 1;
2617 read_stored_link_key_cp cp;
2620 memset(&cp, 0,
sizeof(cp));
2621 bacpy(&cp.bdaddr, bdaddr);
2624 memset(&rq, 0,
sizeof(rq));
2647 memset(&cp, 0,
sizeof(cp));
2649 bacpy((bdaddr_t *) (cp + 1), bdaddr);
2650 memcpy(cp + 7, key, 16);
2652 memset(&rq, 0,
sizeof(rq));
2672 delete_stored_link_key_cp cp;
2675 memset(&cp, 0,
sizeof(cp));
2676 bacpy(&cp.bdaddr, bdaddr);
2677 cp.delete_all = all;
2679 memset(&rq, 0,
sizeof(rq));
2698 auth_requested_cp cp;
2699 evt_auth_complete rp;
2734 set_conn_encrypt_cp cp;
2735 evt_encrypt_change rp;
2739 cp.encrypt = encrypt;
2770 change_conn_link_key_cp cp;
2771 evt_change_conn_link_key_complete rp;
2810 bacpy(&cp.bdaddr, bdaddr);
2842 uint16_t min_interval,
int to)
2848 memset(&cp, 0,
sizeof (cp));
2850 cp.max_interval = max_interval;
2851 cp.min_interval = min_interval;
2853 memset(&rq, 0,
sizeof (rq));
2883 exit_park_mode_cp cp;
2887 memset(&cp, 0,
sizeof (cp));
2890 memset (&rq, 0,
sizeof (rq));
2920 read_inquiry_scan_type_rp rp;
2923 memset(&rq, 0,
sizeof(rq));
2951 write_inquiry_scan_type_cp cp;
2952 write_inquiry_scan_type_rp rp;
2955 memset(&cp, 0,
sizeof(cp));
2958 memset(&rq, 0,
sizeof(rq));
2987 read_inquiry_mode_rp rp;
2990 memset(&rq, 0,
sizeof(rq));
3018 write_inquiry_mode_cp cp;
3019 write_inquiry_mode_rp rp;
3022 memset(&cp, 0,
sizeof(cp));
3025 memset(&rq, 0,
sizeof(rq));
3054 read_afh_mode_rp rp;
3057 memset(&rq, 0,
sizeof(rq));
3085 write_afh_mode_cp cp;
3086 write_afh_mode_rp rp;
3089 memset(&cp, 0,
sizeof(cp));
3092 memset(&rq, 0,
sizeof(rq));
3122 read_ext_inquiry_response_rp rp;
3125 memset(&rq, 0,
sizeof(rq));
3156 write_ext_inquiry_response_cp cp;
3157 write_ext_inquiry_response_rp rp;
3160 memset(&cp, 0,
sizeof(cp));
3164 memset(&rq, 0,
sizeof(rq));
3193 read_simple_pairing_mode_rp rp;
3196 memset(&rq, 0,
sizeof(rq));
3224 write_simple_pairing_mode_cp cp;
3225 write_simple_pairing_mode_rp rp;
3228 memset(&cp, 0,
sizeof(cp));
3231 memset(&rq, 0,
sizeof(rq));
3261 read_local_oob_data_rp rp;
3264 memset(&rq, 0,
sizeof(rq));
3278 memcpy(hash, rp.hash, 16);
3279 memcpy(randomizer, rp.randomizer, 16);
3293 read_inq_response_tx_power_level_rp rp;
3296 memset(&rq, 0,
sizeof(rq));
3337 write_inquiry_transmit_power_level_cp cp;
3338 write_inquiry_transmit_power_level_rp rp;
3341 memset(&cp, 0,
sizeof(cp));
3344 memset(&rq, 0,
sizeof(rq));
3374 int8_t *level,
int to)
3376 read_transmit_power_level_cp cp;
3377 read_transmit_power_level_rp rp;
3380 memset(&cp, 0,
sizeof(cp));
3384 memset(&rq, 0,
sizeof(rq));
3415 read_link_policy_rp rp;
3418 memset(&rq, 0,
sizeof(rq));
3434 *policy = rp.policy;
3449 write_link_policy_cp cp;
3450 write_link_policy_rp rp;
3453 memset(&cp, 0,
sizeof(cp));
3457 memset(&rq, 0,
sizeof(rq));
3486 uint16_t *timeout,
int to)
3488 read_link_supervision_timeout_rp rp;
3491 memset(&rq, 0,
sizeof(rq));
3507 *timeout = rp.timeout;
3521 uint16_t timeout,
int to)
3523 write_link_supervision_timeout_cp cp;
3524 write_link_supervision_timeout_rp rp;
3527 memset(&cp, 0,
sizeof(cp));
3529 cp.timeout = timeout;
3531 memset(&rq, 0,
sizeof(rq));
3560 set_afh_classification_cp cp;
3561 set_afh_classification_rp rp;
3564 memset(&cp, 0,
sizeof(cp));
3565 memcpy(cp.map, map, 10);
3567 memset(&rq, 0,
sizeof(rq));
3598 read_link_quality_rp rp;
3601 memset(&rq, 0,
sizeof(rq));
3617 *link_quality = rp.link_quality;
3635 memset(&rq, 0,
sizeof(rq));
3671 memset(&rq, 0,
sizeof(rq));
3688 memcpy(map, rp.map, 10);
3704 uint16_t *accuracy,
int to)
3710 memset(&cp, 0,
sizeof(cp));
3712 cp.which_clock = which;
3714 memset(&rq, 0,
sizeof(rq));
3731 *accuracy = rp.accuracy;
3747 le_set_scan_enable_cp scan_cp;
3750 memset(&scan_cp, 0,
sizeof(scan_cp));
3751 scan_cp.enable = enable;
3752 scan_cp.filter_dup = filter_dup;
3754 memset(&rq, 0,
sizeof(rq));
3786 uint16_t interval, uint16_t window,
3787 uint8_t own_type, uint8_t filter,
int to)
3790 le_set_scan_parameters_cp param_cp;
3793 memset(¶m_cp, 0,
sizeof(param_cp));
3794 param_cp.type =
type;
3795 param_cp.interval = interval;
3796 param_cp.window = window;
3797 param_cp.own_bdaddr_type = own_type;
3798 param_cp.filter = filter;
3800 memset(&rq, 0,
sizeof(rq));
3830 le_set_advertise_enable_cp adv_cp;
3833 memset(&adv_cp, 0,
sizeof(adv_cp));
3834 adv_cp.enable = enable;
3836 memset(&rq, 0,
sizeof(rq));
3876 uint8_t initiator_filter, uint8_t peer_bdaddr_type,
3877 bdaddr_t peer_bdaddr, uint8_t own_bdaddr_type,
3878 uint16_t min_interval, uint16_t max_interval,
3879 uint16_t latency, uint16_t supervision_timeout,
3880 uint16_t min_ce_length, uint16_t max_ce_length,
3881 uint16_t *handle,
int to)
3884 le_create_connection_cp create_conn_cp;
3885 evt_le_connection_complete conn_complete_rp;
3887 memset(&create_conn_cp, 0,
sizeof(create_conn_cp));
3888 create_conn_cp.interval = interval;
3889 create_conn_cp.window = window;
3890 create_conn_cp.initiator_filter = initiator_filter;
3891 create_conn_cp.peer_bdaddr_type = peer_bdaddr_type;
3892 create_conn_cp.peer_bdaddr = peer_bdaddr;
3893 create_conn_cp.own_bdaddr_type = own_bdaddr_type;
3894 create_conn_cp.min_interval = min_interval;
3895 create_conn_cp.max_interval = max_interval;
3896 create_conn_cp.latency = latency;
3897 create_conn_cp.supervision_timeout = supervision_timeout;
3898 create_conn_cp.min_ce_length = min_ce_length;
3899 create_conn_cp.max_ce_length = max_ce_length;
3901 memset(&rq, 0,
sizeof(rq));
3905 rq.
cparam = &create_conn_cp;
3907 rq.
rparam = &conn_complete_rp;
3913 if (conn_complete_rp.status) {
3919 *handle = conn_complete_rp.handle;
3937 uint16_t max_interval, uint16_t latency,
3938 uint16_t supervision_timeout,
int to)
3940 evt_le_connection_update_complete evt;
3941 le_connection_update_cp cp;
3944 memset(&cp, 0,
sizeof(cp));
3946 cp.min_interval = min_interval;
3947 cp.max_interval = max_interval;
3948 cp.latency = latency;
3949 cp.supervision_timeout = supervision_timeout;
3950 cp.min_ce_length =
htobs(0x0001);
3951 cp.max_ce_length =
htobs(0x0001);
3953 memset(&rq, 0,
sizeof(rq));
3960 rq.
rlen =
sizeof(evt);
3984 evt_le_read_remote_used_features_complete rp;
3985 le_read_remote_used_features_cp cp;
3988 memset(&cp, 0,
sizeof(cp));
3991 memset(&rq, 0,
sizeof(rq));
4009 memcpy(features, rp.features, 8);
void * bt_malloc(size_t size)
#define OCF_READ_CLOCK_OFFSET
#define READ_INQUIRY_MODE_RP_SIZE
#define WRITE_VOICE_SETTING_CP_SIZE
#define WRITE_AFH_MODE_RP_SIZE
int hci_read_local_version(int dd, struct hci_version *ver, int to)
#define OCF_AUTH_REQUESTED
#define EVT_READ_REMOTE_FEATURES_COMPLETE_SIZE
#define EVT_AUTH_COMPLETE
#define HCI_MAX_EIR_LENGTH
static int __other_bdaddr(int dd, int dev_id, long arg)
int hci_exit_park_mode(int dd, uint16_t handle, int to)
#define HCI_COMMAND_HDR_SIZE
int hci_read_remote_features(int dd, uint16_t handle, uint8_t *features, int to)
#define HCI_EVENT_HDR_SIZE
int hci_read_link_supervision_timeout(int dd, uint16_t handle, uint16_t *timeout, int to)
int hci_read_local_name(int dd, int len, char *name, int to)
#define OCF_LE_CLEAR_RESOLV_LIST
#define EVT_DISCONN_COMPLETE_SIZE
#define OCF_REMOTE_NAME_REQ_CANCEL
#define OCF_READ_CLASS_OF_DEV
int hci_devinfo(int dev_id, struct hci_dev_info *di)
int hci_read_stored_link_key(int dd, bdaddr_t *bdaddr, uint8_t all, int to)
#define READ_REMOTE_FEATURES_CP_SIZE
static int bacmp(const bdaddr_t *ba1, const bdaddr_t *ba2)
#define OCF_READ_SIMPLE_PAIRING_MODE
#define OCF_LE_REMOVE_DEVICE_FROM_WHITE_LIST
#define OCF_READ_INQ_RESPONSE_TX_POWER_LEVEL
int hci_strtolp(char *str, unsigned int *val)
#define SET_AFH_CLASSIFICATION_RP_SIZE
#define OCF_EXIT_PARK_MODE
int hci_read_remote_name_cancel(int dd, const bdaddr_t *bdaddr, int to)
char * lmp_featurestostr(uint8_t *features, char *pref, int width)
#define OCF_CHANGE_CONN_LINK_KEY
int hci_le_set_scan_enable(int dd, uint8_t enable, uint8_t filter_dup, int to)
#define WRITE_INQUIRY_TRANSMIT_POWER_LEVEL_CP_SIZE
#define READ_INQUIRY_SCAN_TYPE_RP_SIZE
#define LE_SET_ADVERTISE_ENABLE_CP_SIZE
#define WRITE_LINK_POLICY_CP_SIZE
static int hci_str2uint(hci_map *map, char *str, unsigned int *val)
#define CHANGE_LOCAL_NAME_CP_SIZE
char * pal_vertostr(unsigned int ver)
char * hci_cmdtostr(unsigned int cmd)
#define OCF_WRITE_CURRENT_IAC_LAP
#define WRITE_INQUIRY_MODE_CP_SIZE
#define OCF_READ_EXT_INQUIRY_RESPONSE
#define OCF_READ_LINK_SUPERVISION_TIMEOUT
int hci_write_voice_setting(int dd, uint16_t vs, int to)
#define EVT_ROLE_CHANGE_SIZE
int hci_write_inquiry_mode(int dd, uint8_t mode, int to)
#define EVT_READ_REMOTE_FEATURES_COMPLETE
#define OCF_WRITE_EXT_INQUIRY_RESPONSE
#define READ_TRANSMIT_POWER_LEVEL_CP_SIZE
int hci_le_set_scan_parameters(int dd, uint8_t type, uint16_t interval, uint16_t window, uint8_t own_type, uint8_t filter, int to)
#define READ_REMOTE_EXT_FEATURES_CP_SIZE
#define WRITE_EXT_INQUIRY_RESPONSE_CP_SIZE
char * hci_dflagstostr(uint32_t flags)
static hci_map commands_map[]
int hci_set_afh_classification(int dd, uint8_t *map, int to)
int hci_get_route(bdaddr_t *bdaddr)
char * lmp_vertostr(unsigned int ver)
#define OCF_READ_LINK_QUALITY
#define DISCONNECT_CP_SIZE
#define READ_VOICE_SETTING_RP_SIZE
#define EVT_READ_CLOCK_OFFSET_COMPLETE
#define EVT_CONN_COMPLETE
int hci_le_clear_resolving_list(int dd, int to)
struct hci_dev_req dev_req[0]
int hci_write_class_of_dev(int dd, uint32_t cls, int to)
int hci_encrypt_link(int dd, uint16_t handle, uint8_t encrypt, int to)
int hci_read_remote_ext_features(int dd, uint16_t handle, uint8_t page, uint8_t *max_page, uint8_t *features, int to)
#define OCF_READ_LOCAL_COMMANDS
int hci_devba(int dev_id, bdaddr_t *bdaddr)
int hci_le_read_resolving_list_size(int dd, uint8_t *size, int to)
int hci_send_req(int dd, struct hci_request *r, int to)
#define OCF_READ_AFH_MODE
int hci_devid(const char *str)
#define READ_CLOCK_RP_SIZE
int lmp_strtover(char *str, unsigned int *ver)
#define LE_SET_ADDRESS_RESOLUTION_ENABLE_CP_SIZE
int hci_read_local_features(int dd, uint8_t *features, int to)
#define READ_EXT_INQUIRY_RESPONSE_RP_SIZE
#define WRITE_INQUIRY_SCAN_TYPE_CP_SIZE
#define REMOTE_NAME_REQ_CANCEL_CP_SIZE
#define OCF_LE_READ_WHITE_LIST_SIZE
#define REMOTE_NAME_REQ_CP_SIZE
char * hci_scoptypetostr(unsigned int ptype)
int hci_write_link_supervision_timeout(int dd, uint16_t handle, uint16_t timeout, int to)
#define OCF_READ_REMOTE_EXT_FEATURES
int hci_read_clock(int dd, uint16_t handle, uint8_t which, uint32_t *clock, uint16_t *accuracy, int to)
#define EVT_LE_READ_REMOTE_USED_FEATURES_COMPLETE
#define READ_AFH_MODE_RP_SIZE
#define OCF_READ_TRANSMIT_POWER_LEVEL
#define EVT_ENCRYPT_CHANGE
char * hci_ptypetostr(unsigned int ptype)
#define EXIT_PARK_MODE_CP_SIZE
#define CREATE_CONN_CP_SIZE
int hci_read_afh_map(int dd, uint16_t handle, uint8_t *mode, uint8_t *map, int to)
#define OCF_SET_CONN_ENCRYPT
int hci_write_stored_link_key(int dd, bdaddr_t *bdaddr, uint8_t *key, int to)
#define READ_LOCAL_EXT_FEATURES_RP_SIZE
#define OCF_READ_LOCAL_NAME
#define LE_READ_REMOTE_USED_FEATURES_CP_SIZE
int hci_read_link_policy(int dd, uint16_t handle, uint16_t *policy, int to)
#define WRITE_LINK_SUPERVISION_TIMEOUT_RP_SIZE
int hci_for_each_dev(int flag, int(*func)(int dd, int dev_id, long arg), long arg)
#define OCF_READ_VOICE_SETTING
int hci_write_afh_mode(int dd, uint8_t mode, int to)
#define OCF_LE_REMOVE_DEVICE_FROM_RESOLV_LIST
int hci_change_link_key(int dd, uint16_t handle, int to)
static hci_map link_mode_map[]
#define READ_AFH_MAP_RP_SIZE
int hci_le_read_remote_features(int dd, uint16_t handle, uint8_t *features, int to)
static int hci_test_bit(int nr, void *addr)
#define OCF_WRITE_INQUIRY_SCAN_TYPE
int hci_read_inquiry_transmit_power_level(int dd, int8_t *level, int to)
#define OCF_READ_LOCAL_OOB_DATA
static int __same_bdaddr(int dd, int dev_id, long arg)
#define OCF_READ_STORED_LINK_KEY
#define EVT_READ_REMOTE_VERSION_COMPLETE_SIZE
#define LE_REMOVE_DEVICE_FROM_RESOLV_LIST_CP_SIZE
int hci_write_current_iac_lap(int dd, uint8_t num_iac, uint8_t *lap, int to)
int hci_read_inq_response_tx_power_level(int dd, int8_t *level, int to)
int hci_read_ext_inquiry_response(int dd, uint8_t *fec, uint8_t *data, int to)
static void bacpy(bdaddr_t *dst, const bdaddr_t *src)
int hci_strtover(char *str, unsigned int *ver)
int hci_delete_stored_link_key(int dd, bdaddr_t *bdaddr, uint8_t all, int to)
char * hci_commandstostr(uint8_t *commands, char *pref, int width)
int hci_read_remote_name_with_clock_offset(int dd, const bdaddr_t *bdaddr, uint8_t pscan_rep_mode, uint16_t clkoffset, int len, char *name, int to)
static void hci_filter_set_opcode(int opcode, struct hci_filter *f)
#define OCF_READ_CURRENT_IAC_LAP
#define READ_LOCAL_NAME_RP_SIZE
int hci_strtolm(char *str, unsigned int *val)
#define READ_STORED_LINK_KEY_CP_SIZE
#define LE_CREATE_CONN_CP_SIZE
#define OCF_LE_SET_SCAN_PARAMETERS
int hci_read_voice_setting(int dd, uint16_t *vs, int to)
#define EVT_READ_CLOCK_OFFSET_COMPLETE_SIZE
#define READ_TRANSMIT_POWER_LEVEL_RP_SIZE
#define HCI_MAX_EVENT_SIZE
#define EVT_REMOTE_NAME_REQ_COMPLETE
int hci_read_rssi(int dd, uint16_t handle, int8_t *rssi, int to)
int hci_inquiry(int dev_id, int len, int nrsp, const uint8_t *lap, inquiry_info **ii, long flags)
char * hci_dtypetostr(int type)
#define EVT_READ_REMOTE_EXT_FEATURES_COMPLETE
int hci_create_connection(int dd, const bdaddr_t *bdaddr, uint16_t ptype, uint16_t clkoffset, uint8_t rswitch, uint16_t *handle, int to)
#define READ_RSSI_RP_SIZE
#define OCF_WRITE_CLASS_OF_DEV
int hci_strtoptype(char *str, unsigned int *val)
static char * hci_uint2str(hci_map *m, unsigned int val)
int hci_le_rm_white_list(int dd, const bdaddr_t *bdaddr, uint8_t type, int to)
#define OCF_WRITE_LINK_SUPERVISION_TIMEOUT
#define OCF_WRITE_STORED_LINK_KEY
int hci_switch_role(int dd, bdaddr_t *bdaddr, uint8_t role, int to)
int hci_write_ext_inquiry_response(int dd, uint8_t fec, uint8_t *data, int to)
static hci_map sco_ptype_map[]
#define cmd_opcode_pack(ogf, ocf)
int hci_park_mode(int dd, uint16_t handle, uint16_t max_interval, uint16_t min_interval, int to)
static int hci_str2bit(hci_map *map, char *str, unsigned int *val)
#define LE_ADD_DEVICE_TO_RESOLV_LIST_CP_SIZE
int hci_write_inquiry_scan_type(int dd, uint8_t type, int to)
#define READ_SIMPLE_PAIRING_MODE_RP_SIZE
#define READ_LOCAL_OOB_DATA_RP_SIZE
#define LE_SET_SCAN_PARAMETERS_CP_SIZE
int hci_le_add_white_list(int dd, const bdaddr_t *bdaddr, uint8_t type, int to)
int hci_write_local_name(int dd, const char *name, int to)
#define READ_BD_ADDR_RP_SIZE
int hci_read_remote_version(int dd, uint16_t handle, struct hci_version *ver, int to)
#define READ_LINK_SUPERVISION_TIMEOUT_RP_SIZE
#define EVT_CONN_COMPLETE_SIZE
#define OCF_WRITE_SIMPLE_PAIRING_MODE
#define OCF_LE_CREATE_CONN
#define READ_LINK_QUALITY_RP_SIZE
char * hci_lmtostr(unsigned int lm)
int hci_send_cmd(int dd, uint16_t ogf, uint16_t ocf, uint8_t plen, void *param)
#define OCF_LE_ADD_DEVICE_TO_WHITE_LIST
char * hci_vertostr(unsigned int ver)
int hci_disconnect(int dd, uint16_t handle, uint8_t reason, int to)
int hci_le_set_advertise_enable(int dd, uint8_t enable, int to)
int hci_le_set_address_resolution_enable(int dd, uint8_t enable, int to)
int hci_close_dev(int dd)
#define EVT_CHANGE_CONN_LINK_KEY_COMPLETE
#define EVT_CHANGE_CONN_LINK_KEY_COMPLETE_SIZE
#define OCF_LE_SET_SCAN_ENABLE
int hci_read_inquiry_scan_type(int dd, uint8_t *type, int to)
#define WRITE_INQUIRY_MODE_RP_SIZE
#define EVT_LE_READ_REMOTE_USED_FEATURES_COMPLETE_SIZE
static void hci_filter_clear(struct hci_filter *f)
#define EVT_ENCRYPT_CHANGE_SIZE
#define LE_ADD_DEVICE_TO_WHITE_LIST_CP_SIZE
#define WRITE_INQUIRY_TRANSMIT_POWER_LEVEL_RP_SIZE
#define WRITE_LINK_SUPERVISION_TIMEOUT_CP_SIZE
int hci_read_simple_pairing_mode(int dd, uint8_t *mode, int to)
#define LE_READ_WHITE_LIST_SIZE_RP_SIZE
#define WRITE_EXT_INQUIRY_RESPONSE_RP_SIZE
#define CHANGE_CONN_LINK_KEY_CP_SIZE
#define READ_INQ_RESPONSE_TX_POWER_LEVEL_RP_SIZE
#define OCF_LE_SET_ADDRESS_RESOLUTION_ENABLE
char * hci_bustostr(int bus)
#define LE_CONN_UPDATE_CP_SIZE
#define WRITE_CLASS_OF_DEV_CP_SIZE
#define READ_LINK_POLICY_RP_SIZE
#define OCF_READ_REMOTE_FEATURES
#define OCF_READ_INQUIRY_MODE
#define WRITE_SIMPLE_PAIRING_MODE_CP_SIZE
int hci_write_link_policy(int dd, uint16_t handle, uint16_t policy, int to)
static hci_map dev_flags_map[]
#define READ_CLOCK_CP_SIZE
int hci_open_dev(int dev_id)
#define OCF_LE_READ_REMOTE_USED_FEATURES
int hci_le_conn_update(int dd, uint16_t handle, uint16_t min_interval, uint16_t max_interval, uint16_t latency, uint16_t supervision_timeout, int to)
#define EVT_READ_REMOTE_EXT_FEATURES_COMPLETE_SIZE
int hci_le_read_white_list_size(int dd, uint8_t *size, int to)
#define EVT_CMD_COMPLETE_SIZE
static hci_map lmp_features_map[8][9]
int hci_read_bd_addr(int dd, bdaddr_t *bdaddr, int to)
#define OCF_LE_CLEAR_WHITE_LIST
int hci_read_link_quality(int dd, uint16_t handle, uint8_t *link_quality, int to)
int hci_write_simple_pairing_mode(int dd, uint8_t mode, int to)
#define LE_SET_SCAN_ENABLE_CP_SIZE
int hci_write_inquiry_transmit_power_level(int dd, int8_t level, int to)
#define OCF_WRITE_LINK_POLICY
#define AUTH_REQUESTED_CP_SIZE
int hci_strtoscoptype(char *str, unsigned int *val)
int hci_le_create_conn(int dd, uint16_t interval, uint16_t window, uint8_t initiator_filter, uint8_t peer_bdaddr_type, bdaddr_t 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, uint16_t *handle, int to)
char * hci_lptostr(unsigned int lp)
int hci_read_local_commands(int dd, uint8_t *commands, int to)
#define LE_REMOVE_DEVICE_FROM_WHITE_LIST_CP_SIZE
int pal_strtover(char *str, unsigned int *ver)
#define WRITE_SIMPLE_PAIRING_MODE_RP_SIZE
int hci_le_rm_resolving_list(int dd, const bdaddr_t *bdaddr, uint8_t type, int to)
char * hci_typetostr(int type)
#define EVT_LE_CONN_UPDATE_COMPLETE
int str2ba(const char *str, bdaddr_t *ba)
#define OCF_WRITE_VOICE_SETTING
#define WRITE_AFH_MODE_CP_SIZE
static hci_map pkt_type_map[]
#define OCF_READ_LOCAL_FEATURES
int hci_read_remote_name(int dd, const bdaddr_t *bdaddr, int len, char *name, int to)
int hci_read_local_oob_data(int dd, uint8_t *hash, uint8_t *randomizer, int to)
#define READ_CLOCK_OFFSET_CP_SIZE
#define WRITE_LINK_POLICY_RP_SIZE
int hci_authenticate_link(int dd, uint16_t handle, int to)
#define SET_AFH_CLASSIFICATION_CP_SIZE
#define EVT_REMOTE_NAME_REQ_COMPLETE_SIZE
#define EVT_READ_REMOTE_VERSION_COMPLETE
#define OCF_READ_REMOTE_VERSION
#define DELETE_STORED_LINK_KEY_CP_SIZE
#define OCF_READ_LINK_POLICY
int hci_read_class_of_dev(int dd, uint8_t *cls, int to)
#define SWITCH_ROLE_CP_SIZE
int hci_read_local_ext_features(int dd, uint8_t page, uint8_t *max_page, uint8_t *features, int to)
#define EVT_DISCONN_COMPLETE
#define OCF_WRITE_INQUIRY_MODE
#define READ_LOCAL_COMMANDS_RP_SIZE
int hci_read_clock_offset(int dd, uint16_t handle, uint16_t *clkoffset, int to)
#define OCF_REMOTE_NAME_REQ
int hci_read_transmit_power_level(int dd, uint16_t handle, uint8_t type, int8_t *level, int to)
#define EVT_MODE_CHANGE_SIZE
#define EVT_AUTH_COMPLETE_SIZE
int hci_read_inquiry_mode(int dd, uint8_t *mode, int to)
int hci_read_afh_mode(int dd, uint8_t *mode, int to)
#define OCF_READ_LOCAL_EXT_FEATURES
static char * hci_bit2str(hci_map *m, unsigned int val)
#define READ_LOCAL_FEATURES_RP_SIZE
#define OCF_LE_CONN_UPDATE
static void hci_filter_set_event(int e, struct hci_filter *f)
#define READ_CURRENT_IAC_LAP_RP_SIZE
int hci_le_clear_white_list(int dd, int to)
#define READ_REMOTE_VERSION_CP_SIZE
#define SET_CONN_ENCRYPT_CP_SIZE
#define OCF_CHANGE_LOCAL_NAME
#define EVT_LE_CONN_COMPLETE
#define OCF_LE_SET_ADVERTISE_ENABLE
#define OCF_READ_INQUIRY_SCAN_TYPE
#define OCF_READ_LOCAL_VERSION
#define OCF_LE_READ_RESOLV_LIST_SIZE
#define WRITE_STORED_LINK_KEY_CP_SIZE
#define LE_READ_RESOLV_LIST_SIZE_RP_SIZE
#define READ_LOCAL_EXT_FEATURES_CP_SIZE
#define OCF_WRITE_AFH_MODE
#define OCF_DELETE_STORED_LINK_KEY
#define READ_CLASS_OF_DEV_RP_SIZE
#define READ_LOCAL_VERSION_RP_SIZE
static hci_map link_policy_map[]
int hci_read_current_iac_lap(int dd, uint8_t *num_iac, uint8_t *lap, int to)
#define OCF_SET_AFH_CLASSIFICATION
int hci_le_add_resolving_list(int dd, const bdaddr_t *bdaddr, uint8_t type, uint8_t *peer_irk, uint8_t *local_irk, int to)
#define OCF_LE_ADD_DEVICE_TO_RESOLV_LIST
#define WRITE_INQUIRY_SCAN_TYPE_RP_SIZE
#define OCF_WRITE_INQUIRY_TRANSMIT_POWER_LEVEL
#define EVT_LE_META_EVENT
#define PARK_MODE_CP_SIZE
static void hci_filter_set_ptype(int t, struct hci_filter *f)