33 #include <sys/socket.h>
35 #define HCI_MAX_DEV 16
37 #define HCI_MAX_ACL_SIZE (1492 + 4)
38 #define HCI_MAX_SCO_SIZE 255
39 #define HCI_MAX_EVENT_SIZE 260
40 #define HCI_MAX_FRAME_SIZE (HCI_MAX_ACL_SIZE + 4)
44 #define HCI_DEV_UNREG 2
46 #define HCI_DEV_DOWN 4
47 #define HCI_DEV_SUSPEND 5
48 #define HCI_DEV_RESUME 6
60 #define HCI_BREDR 0x00
85 #define HCIDEVUP _IOW('H', 201, int)
86 #define HCIDEVDOWN _IOW('H', 202, int)
87 #define HCIDEVRESET _IOW('H', 203, int)
88 #define HCIDEVRESTAT _IOW('H', 204, int)
90 #define HCIGETDEVLIST _IOR('H', 210, int)
91 #define HCIGETDEVINFO _IOR('H', 211, int)
92 #define HCIGETCONNLIST _IOR('H', 212, int)
93 #define HCIGETCONNINFO _IOR('H', 213, int)
94 #define HCIGETAUTHINFO _IOR('H', 215, int)
96 #define HCISETRAW _IOW('H', 220, int)
97 #define HCISETSCAN _IOW('H', 221, int)
98 #define HCISETAUTH _IOW('H', 222, int)
99 #define HCISETENCRYPT _IOW('H', 223, int)
100 #define HCISETPTYPE _IOW('H', 224, int)
101 #define HCISETLINKPOL _IOW('H', 225, int)
102 #define HCISETLINKMODE _IOW('H', 226, int)
103 #define HCISETACLMTU _IOW('H', 227, int)
104 #define HCISETSCOMTU _IOW('H', 228, int)
106 #define HCIBLOCKADDR _IOW('H', 230, int)
107 #define HCIUNBLOCKADDR _IOW('H', 231, int)
109 #define HCIINQUIRY _IOR('H', 240, int)
111 #ifndef __NO_HCI_DEFS
114 #define HCI_COMMAND_PKT 0x01
115 #define HCI_ACLDATA_PKT 0x02
116 #define HCI_SCODATA_PKT 0x03
117 #define HCI_EVENT_PKT 0x04
118 #define HCI_VENDOR_PKT 0xff
121 #define HCI_2DH1 0x0002
122 #define HCI_3DH1 0x0004
123 #define HCI_DM1 0x0008
124 #define HCI_DH1 0x0010
125 #define HCI_2DH3 0x0100
126 #define HCI_3DH3 0x0200
127 #define HCI_DM3 0x0400
128 #define HCI_DH3 0x0800
129 #define HCI_2DH5 0x1000
130 #define HCI_3DH5 0x2000
131 #define HCI_DM5 0x4000
132 #define HCI_DH5 0x8000
134 #define HCI_HV1 0x0020
135 #define HCI_HV2 0x0040
136 #define HCI_HV3 0x0080
138 #define HCI_EV3 0x0008
139 #define HCI_EV4 0x0010
140 #define HCI_EV5 0x0020
141 #define HCI_2EV3 0x0040
142 #define HCI_3EV3 0x0080
143 #define HCI_2EV5 0x0100
144 #define HCI_3EV5 0x0200
146 #define SCO_PTYPE_MASK (HCI_HV1 | HCI_HV2 | HCI_HV3)
147 #define ACL_PTYPE_MASK (HCI_DM1 | HCI_DH1 | HCI_DM3 | HCI_DH3 | HCI_DM5 | HCI_DH5)
150 #define HCI_UNKNOWN_COMMAND 0x01
151 #define HCI_NO_CONNECTION 0x02
152 #define HCI_HARDWARE_FAILURE 0x03
153 #define HCI_PAGE_TIMEOUT 0x04
154 #define HCI_AUTHENTICATION_FAILURE 0x05
155 #define HCI_PIN_OR_KEY_MISSING 0x06
156 #define HCI_MEMORY_FULL 0x07
157 #define HCI_CONNECTION_TIMEOUT 0x08
158 #define HCI_MAX_NUMBER_OF_CONNECTIONS 0x09
159 #define HCI_MAX_NUMBER_OF_SCO_CONNECTIONS 0x0a
160 #define HCI_ACL_CONNECTION_EXISTS 0x0b
161 #define HCI_COMMAND_DISALLOWED 0x0c
162 #define HCI_REJECTED_LIMITED_RESOURCES 0x0d
163 #define HCI_REJECTED_SECURITY 0x0e
164 #define HCI_REJECTED_PERSONAL 0x0f
165 #define HCI_HOST_TIMEOUT 0x10
166 #define HCI_UNSUPPORTED_FEATURE 0x11
167 #define HCI_INVALID_PARAMETERS 0x12
168 #define HCI_OE_USER_ENDED_CONNECTION 0x13
169 #define HCI_OE_LOW_RESOURCES 0x14
170 #define HCI_OE_POWER_OFF 0x15
171 #define HCI_CONNECTION_TERMINATED 0x16
172 #define HCI_REPEATED_ATTEMPTS 0x17
173 #define HCI_PAIRING_NOT_ALLOWED 0x18
174 #define HCI_UNKNOWN_LMP_PDU 0x19
175 #define HCI_UNSUPPORTED_REMOTE_FEATURE 0x1a
176 #define HCI_SCO_OFFSET_REJECTED 0x1b
177 #define HCI_SCO_INTERVAL_REJECTED 0x1c
178 #define HCI_AIR_MODE_REJECTED 0x1d
179 #define HCI_INVALID_LMP_PARAMETERS 0x1e
180 #define HCI_UNSPECIFIED_ERROR 0x1f
181 #define HCI_UNSUPPORTED_LMP_PARAMETER_VALUE 0x20
182 #define HCI_ROLE_CHANGE_NOT_ALLOWED 0x21
183 #define HCI_LMP_RESPONSE_TIMEOUT 0x22
184 #define HCI_LMP_ERROR_TRANSACTION_COLLISION 0x23
185 #define HCI_LMP_PDU_NOT_ALLOWED 0x24
186 #define HCI_ENCRYPTION_MODE_NOT_ACCEPTED 0x25
187 #define HCI_UNIT_LINK_KEY_USED 0x26
188 #define HCI_QOS_NOT_SUPPORTED 0x27
189 #define HCI_INSTANT_PASSED 0x28
190 #define HCI_PAIRING_NOT_SUPPORTED 0x29
191 #define HCI_TRANSACTION_COLLISION 0x2a
192 #define HCI_QOS_UNACCEPTABLE_PARAMETER 0x2c
193 #define HCI_QOS_REJECTED 0x2d
194 #define HCI_CLASSIFICATION_NOT_SUPPORTED 0x2e
195 #define HCI_INSUFFICIENT_SECURITY 0x2f
196 #define HCI_PARAMETER_OUT_OF_RANGE 0x30
197 #define HCI_ROLE_SWITCH_PENDING 0x32
198 #define HCI_SLOT_VIOLATION 0x34
199 #define HCI_ROLE_SWITCH_FAILED 0x35
200 #define HCI_EIR_TOO_LARGE 0x36
201 #define HCI_SIMPLE_PAIRING_NOT_SUPPORTED 0x37
202 #define HCI_HOST_BUSY_PAIRING 0x38
205 #define ACL_START_NO_FLUSH 0x00
206 #define ACL_CONT 0x01
207 #define ACL_START 0x02
208 #define ACL_ACTIVE_BCAST 0x04
209 #define ACL_PICO_BCAST 0x08
212 #define SCO_LINK 0x00
213 #define ACL_LINK 0x01
214 #define ESCO_LINK 0x02
217 #define LMP_3SLOT 0x01
218 #define LMP_5SLOT 0x02
219 #define LMP_ENCRYPT 0x04
220 #define LMP_SOFFSET 0x08
221 #define LMP_TACCURACY 0x10
222 #define LMP_RSWITCH 0x20
223 #define LMP_HOLD 0x40
224 #define LMP_SNIFF 0x80
226 #define LMP_PARK 0x01
227 #define LMP_RSSI 0x02
228 #define LMP_QUALITY 0x04
232 #define LMP_ULAW 0x40
233 #define LMP_ALAW 0x80
235 #define LMP_CVSD 0x01
236 #define LMP_PSCHEME 0x02
237 #define LMP_PCONTROL 0x04
238 #define LMP_TRSP_SCO 0x08
239 #define LMP_BCAST_ENC 0x80
241 #define LMP_EDR_ACL_2M 0x02
242 #define LMP_EDR_ACL_3M 0x04
243 #define LMP_ENH_ISCAN 0x08
244 #define LMP_ILACE_ISCAN 0x10
245 #define LMP_ILACE_PSCAN 0x20
246 #define LMP_RSSI_INQ 0x40
247 #define LMP_ESCO 0x80
251 #define LMP_AFH_CAP_SLV 0x08
252 #define LMP_AFH_CLS_SLV 0x10
253 #define LMP_NO_BREDR 0x20
255 #define LMP_EDR_3SLOT 0x80
257 #define LMP_EDR_5SLOT 0x01
258 #define LMP_SNIFF_SUBR 0x02
259 #define LMP_PAUSE_ENC 0x04
260 #define LMP_AFH_CAP_MST 0x08
261 #define LMP_AFH_CLS_MST 0x10
262 #define LMP_EDR_ESCO_2M 0x20
263 #define LMP_EDR_ESCO_3M 0x40
264 #define LMP_EDR_3S_ESCO 0x80
266 #define LMP_EXT_INQ 0x01
267 #define LMP_LE_BREDR 0x02
268 #define LMP_SIMPLE_PAIR 0x08
269 #define LMP_ENCAPS_PDU 0x10
270 #define LMP_ERR_DAT_REP 0x20
271 #define LMP_NFLUSH_PKTS 0x40
273 #define LMP_LSTO 0x01
274 #define LMP_INQ_TX_PWR 0x02
276 #define LMP_EXT_FEAT 0x80
279 #define LMP_HOST_SSP 0x01
280 #define LMP_HOST_LE 0x02
281 #define LMP_HOST_LE_BREDR 0x04
284 #define HCI_LP_RSWITCH 0x0001
285 #define HCI_LP_HOLD 0x0002
286 #define HCI_LP_SNIFF 0x0004
287 #define HCI_LP_PARK 0x0008
290 #define HCI_LM_ACCEPT 0x8000
291 #define HCI_LM_MASTER 0x0001
292 #define HCI_LM_AUTH 0x0002
293 #define HCI_LM_ENCRYPT 0x0004
294 #define HCI_LM_TRUSTED 0x0008
295 #define HCI_LM_RELIABLE 0x0010
296 #define HCI_LM_SECURE 0x0020
299 #define HCI_LK_COMBINATION 0x00
300 #define HCI_LK_LOCAL_UNIT 0x01
301 #define HCI_LK_REMOTE_UNIT 0x02
302 #define HCI_LK_DEBUG_COMBINATION 0x03
303 #define HCI_LK_UNAUTH_COMBINATION 0x04
304 #define HCI_LK_AUTH_COMBINATION 0x05
305 #define HCI_LK_CHANGED_COMBINATION 0x06
306 #define HCI_LK_INVALID 0xFF
311 #define OGF_LINK_CTL 0x01
313 #define OCF_INQUIRY 0x0001
319 #define INQUIRY_CP_SIZE 5
325 #define STATUS_BDADDR_RP_SIZE 7
327 #define OCF_INQUIRY_CANCEL 0x0002
329 #define OCF_PERIODIC_INQUIRY 0x0003
337 #define PERIODIC_INQUIRY_CP_SIZE 9
339 #define OCF_EXIT_PERIODIC_INQUIRY 0x0004
341 #define OCF_CREATE_CONN 0x0005
350 #define CREATE_CONN_CP_SIZE 13
352 #define OCF_DISCONNECT 0x0006
357 #define DISCONNECT_CP_SIZE 3
359 #define OCF_ADD_SCO 0x0007
364 #define ADD_SCO_CP_SIZE 4
366 #define OCF_CREATE_CONN_CANCEL 0x0008
370 #define CREATE_CONN_CANCEL_CP_SIZE 6
372 #define OCF_ACCEPT_CONN_REQ 0x0009
377 #define ACCEPT_CONN_REQ_CP_SIZE 7
379 #define OCF_REJECT_CONN_REQ 0x000A
384 #define REJECT_CONN_REQ_CP_SIZE 7
386 #define OCF_LINK_KEY_REPLY 0x000B
389 uint8_t link_key[16];
391 #define LINK_KEY_REPLY_CP_SIZE 22
393 #define OCF_LINK_KEY_NEG_REPLY 0x000C
395 #define OCF_PIN_CODE_REPLY 0x000D
399 uint8_t pin_code[16];
401 #define PIN_CODE_REPLY_CP_SIZE 23
403 #define OCF_PIN_CODE_NEG_REPLY 0x000E
405 #define OCF_SET_CONN_PTYPE 0x000F
410 #define SET_CONN_PTYPE_CP_SIZE 4
412 #define OCF_AUTH_REQUESTED 0x0011
416 #define AUTH_REQUESTED_CP_SIZE 2
418 #define OCF_SET_CONN_ENCRYPT 0x0013
423 #define SET_CONN_ENCRYPT_CP_SIZE 3
425 #define OCF_CHANGE_CONN_LINK_KEY 0x0015
429 #define CHANGE_CONN_LINK_KEY_CP_SIZE 2
431 #define OCF_MASTER_LINK_KEY 0x0017
435 #define MASTER_LINK_KEY_CP_SIZE 1
437 #define OCF_REMOTE_NAME_REQ 0x0019
440 uint8_t pscan_rep_mode;
442 uint16_t clock_offset;
444 #define REMOTE_NAME_REQ_CP_SIZE 10
446 #define OCF_REMOTE_NAME_REQ_CANCEL 0x001A
450 #define REMOTE_NAME_REQ_CANCEL_CP_SIZE 6
452 #define OCF_READ_REMOTE_FEATURES 0x001B
456 #define READ_REMOTE_FEATURES_CP_SIZE 2
458 #define OCF_READ_REMOTE_EXT_FEATURES 0x001C
463 #define READ_REMOTE_EXT_FEATURES_CP_SIZE 3
465 #define OCF_READ_REMOTE_VERSION 0x001D
469 #define READ_REMOTE_VERSION_CP_SIZE 2
471 #define OCF_READ_CLOCK_OFFSET 0x001F
475 #define READ_CLOCK_OFFSET_CP_SIZE 2
477 #define OCF_READ_LMP_HANDLE 0x0020
479 #define OCF_SETUP_SYNC_CONN 0x0028
489 #define SETUP_SYNC_CONN_CP_SIZE 17
491 #define OCF_ACCEPT_SYNC_CONN_REQ 0x0029
494 uint32_t tx_bandwith;
495 uint32_t rx_bandwith;
496 uint16_t max_latency;
497 uint16_t voice_setting;
498 uint8_t retrans_effort;
501 #define ACCEPT_SYNC_CONN_REQ_CP_SIZE 21
503 #define OCF_REJECT_SYNC_CONN_REQ 0x002A
508 #define REJECT_SYNC_CONN_REQ_CP_SIZE 7
510 #define OCF_IO_CAPABILITY_REPLY 0x002B
517 #define IO_CAPABILITY_REPLY_CP_SIZE 9
519 #define OCF_USER_CONFIRM_REPLY 0x002C
523 #define USER_CONFIRM_REPLY_CP_SIZE 6
525 #define OCF_USER_CONFIRM_NEG_REPLY 0x002D
527 #define OCF_USER_PASSKEY_REPLY 0x002E
532 #define USER_PASSKEY_REPLY_CP_SIZE 10
534 #define OCF_USER_PASSKEY_NEG_REPLY 0x002F
536 #define OCF_REMOTE_OOB_DATA_REPLY 0x0030
540 uint8_t randomizer[16];
542 #define REMOTE_OOB_DATA_REPLY_CP_SIZE 38
544 #define OCF_REMOTE_OOB_DATA_NEG_REPLY 0x0033
546 #define OCF_IO_CAPABILITY_NEG_REPLY 0x0034
551 #define IO_CAPABILITY_NEG_REPLY_CP_SIZE 7
553 #define OCF_CREATE_PHYSICAL_LINK 0x0035
560 #define CREATE_PHYSICAL_LINK_CP_SIZE 35
562 #define OCF_ACCEPT_PHYSICAL_LINK 0x0036
569 #define ACCEPT_PHYSICAL_LINK_CP_SIZE 35
571 #define OCF_DISCONNECT_PHYSICAL_LINK 0x0037
576 #define DISCONNECT_PHYSICAL_LINK_CP_SIZE 2
578 #define OCF_CREATE_LOGICAL_LINK 0x0038
584 #define CREATE_LOGICAL_LINK_CP_SIZE 33
586 #define OCF_ACCEPT_LOGICAL_LINK 0x0039
588 #define OCF_DISCONNECT_LOGICAL_LINK 0x003A
592 #define DISCONNECT_LOGICAL_LINK_CP_SIZE 2
594 #define OCF_LOGICAL_LINK_CANCEL 0x003B
599 #define LOGICAL_LINK_CANCEL_CP_SIZE 2
605 #define LOGICAL_LINK_CANCEL_RP_SIZE 3
607 #define OCF_FLOW_SPEC_MODIFY 0x003C
610 #define OGF_LINK_POLICY 0x02
612 #define OCF_HOLD_MODE 0x0001
618 #define HOLD_MODE_CP_SIZE 6
620 #define OCF_SNIFF_MODE 0x0003
623 uint16_t max_interval;
624 uint16_t min_interval;
628 #define SNIFF_MODE_CP_SIZE 10
630 #define OCF_EXIT_SNIFF_MODE 0x0004
634 #define EXIT_SNIFF_MODE_CP_SIZE 2
636 #define OCF_PARK_MODE 0x0005
639 uint16_t max_interval;
640 uint16_t min_interval;
642 #define PARK_MODE_CP_SIZE 6
644 #define OCF_EXIT_PARK_MODE 0x0006
648 #define EXIT_PARK_MODE_CP_SIZE 2
650 #define OCF_QOS_SETUP 0x0007
658 #define HCI_QOS_CP_SIZE 17
664 #define QOS_SETUP_CP_SIZE (3 + HCI_QOS_CP_SIZE)
666 #define OCF_ROLE_DISCOVERY 0x0009
670 #define ROLE_DISCOVERY_CP_SIZE 2
676 #define ROLE_DISCOVERY_RP_SIZE 4
678 #define OCF_SWITCH_ROLE 0x000B
683 #define SWITCH_ROLE_CP_SIZE 7
685 #define OCF_READ_LINK_POLICY 0x000C
689 #define READ_LINK_POLICY_CP_SIZE 2
695 #define READ_LINK_POLICY_RP_SIZE 5
697 #define OCF_WRITE_LINK_POLICY 0x000D
702 #define WRITE_LINK_POLICY_CP_SIZE 4
707 #define WRITE_LINK_POLICY_RP_SIZE 3
709 #define OCF_READ_DEFAULT_LINK_POLICY 0x000E
711 #define OCF_WRITE_DEFAULT_LINK_POLICY 0x000F
713 #define OCF_FLOW_SPECIFICATION 0x0010
715 #define OCF_SNIFF_SUBRATING 0x0011
718 uint16_t max_latency;
722 #define SNIFF_SUBRATING_CP_SIZE 8
725 #define OGF_HOST_CTL 0x03
727 #define OCF_SET_EVENT_MASK 0x0001
731 #define SET_EVENT_MASK_CP_SIZE 8
733 #define OCF_RESET 0x0003
735 #define OCF_SET_EVENT_FLT 0x0005
739 uint8_t condition[0];
741 #define SET_EVENT_FLT_CP_SIZE 2
744 #define FLT_CLEAR_ALL 0x00
745 #define FLT_INQ_RESULT 0x01
746 #define FLT_CONN_SETUP 0x02
748 #define INQ_RESULT_RETURN_ALL 0x00
749 #define INQ_RESULT_RETURN_CLASS 0x01
750 #define INQ_RESULT_RETURN_BDADDR 0x02
752 #define CONN_SETUP_ALLOW_ALL 0x00
753 #define CONN_SETUP_ALLOW_CLASS 0x01
754 #define CONN_SETUP_ALLOW_BDADDR 0x02
756 #define CONN_SETUP_AUTO_OFF 0x01
757 #define CONN_SETUP_AUTO_ON 0x02
759 #define OCF_FLUSH 0x0008
761 #define OCF_READ_PIN_TYPE 0x0009
766 #define READ_PIN_TYPE_RP_SIZE 2
768 #define OCF_WRITE_PIN_TYPE 0x000A
772 #define WRITE_PIN_TYPE_CP_SIZE 1
774 #define OCF_CREATE_NEW_UNIT_KEY 0x000B
776 #define OCF_READ_STORED_LINK_KEY 0x000D
781 #define READ_STORED_LINK_KEY_CP_SIZE 7
787 #define READ_STORED_LINK_KEY_RP_SIZE 5
789 #define OCF_WRITE_STORED_LINK_KEY 0x0011
794 #define WRITE_STORED_LINK_KEY_CP_SIZE 1
799 #define READ_WRITE_LINK_KEY_RP_SIZE 2
801 #define OCF_DELETE_STORED_LINK_KEY 0x0012
806 #define DELETE_STORED_LINK_KEY_CP_SIZE 7
811 #define DELETE_STORED_LINK_KEY_RP_SIZE 3
813 #define HCI_MAX_NAME_LENGTH 248
815 #define OCF_CHANGE_LOCAL_NAME 0x0013
819 #define CHANGE_LOCAL_NAME_CP_SIZE 248
821 #define OCF_READ_LOCAL_NAME 0x0014
826 #define READ_LOCAL_NAME_RP_SIZE 249
828 #define OCF_READ_CONN_ACCEPT_TIMEOUT 0x0015
833 #define READ_CONN_ACCEPT_TIMEOUT_RP_SIZE 3
835 #define OCF_WRITE_CONN_ACCEPT_TIMEOUT 0x0016
839 #define WRITE_CONN_ACCEPT_TIMEOUT_CP_SIZE 2
841 #define OCF_READ_PAGE_TIMEOUT 0x0017
846 #define READ_PAGE_TIMEOUT_RP_SIZE 3
848 #define OCF_WRITE_PAGE_TIMEOUT 0x0018
852 #define WRITE_PAGE_TIMEOUT_CP_SIZE 2
854 #define OCF_READ_SCAN_ENABLE 0x0019
859 #define READ_SCAN_ENABLE_RP_SIZE 2
861 #define OCF_WRITE_SCAN_ENABLE 0x001A
862 #define SCAN_DISABLED 0x00
863 #define SCAN_INQUIRY 0x01
864 #define SCAN_PAGE 0x02
866 #define OCF_READ_PAGE_ACTIVITY 0x001B
872 #define READ_PAGE_ACTIVITY_RP_SIZE 5
874 #define OCF_WRITE_PAGE_ACTIVITY 0x001C
879 #define WRITE_PAGE_ACTIVITY_CP_SIZE 4
881 #define OCF_READ_INQ_ACTIVITY 0x001D
887 #define READ_INQ_ACTIVITY_RP_SIZE 5
889 #define OCF_WRITE_INQ_ACTIVITY 0x001E
894 #define WRITE_INQ_ACTIVITY_CP_SIZE 4
896 #define OCF_READ_AUTH_ENABLE 0x001F
898 #define OCF_WRITE_AUTH_ENABLE 0x0020
899 #define AUTH_DISABLED 0x00
900 #define AUTH_ENABLED 0x01
902 #define OCF_READ_ENCRYPT_MODE 0x0021
904 #define OCF_WRITE_ENCRYPT_MODE 0x0022
905 #define ENCRYPT_DISABLED 0x00
906 #define ENCRYPT_P2P 0x01
907 #define ENCRYPT_BOTH 0x02
909 #define OCF_READ_CLASS_OF_DEV 0x0023
912 uint8_t dev_class[3];
914 #define READ_CLASS_OF_DEV_RP_SIZE 4
916 #define OCF_WRITE_CLASS_OF_DEV 0x0024
918 uint8_t dev_class[3];
920 #define WRITE_CLASS_OF_DEV_CP_SIZE 3
922 #define OCF_READ_VOICE_SETTING 0x0025
925 uint16_t voice_setting;
927 #define READ_VOICE_SETTING_RP_SIZE 3
929 #define OCF_WRITE_VOICE_SETTING 0x0026
931 uint16_t voice_setting;
933 #define WRITE_VOICE_SETTING_CP_SIZE 2
935 #define OCF_READ_AUTOMATIC_FLUSH_TIMEOUT 0x0027
937 #define OCF_WRITE_AUTOMATIC_FLUSH_TIMEOUT 0x0028
939 #define OCF_READ_NUM_BROADCAST_RETRANS 0x0029
941 #define OCF_WRITE_NUM_BROADCAST_RETRANS 0x002A
943 #define OCF_READ_HOLD_MODE_ACTIVITY 0x002B
945 #define OCF_WRITE_HOLD_MODE_ACTIVITY 0x002C
947 #define OCF_READ_TRANSMIT_POWER_LEVEL 0x002D
952 #define READ_TRANSMIT_POWER_LEVEL_CP_SIZE 3
958 #define READ_TRANSMIT_POWER_LEVEL_RP_SIZE 4
960 #define OCF_READ_SYNC_FLOW_ENABLE 0x002E
962 #define OCF_WRITE_SYNC_FLOW_ENABLE 0x002F
964 #define OCF_SET_CONTROLLER_TO_HOST_FC 0x0031
966 #define OCF_HOST_BUFFER_SIZE 0x0033
973 #define HOST_BUFFER_SIZE_CP_SIZE 7
975 #define OCF_HOST_NUM_COMP_PKTS 0x0035
980 #define HOST_NUM_COMP_PKTS_CP_SIZE 1
982 #define OCF_READ_LINK_SUPERVISION_TIMEOUT 0x0036
988 #define READ_LINK_SUPERVISION_TIMEOUT_RP_SIZE 5
990 #define OCF_WRITE_LINK_SUPERVISION_TIMEOUT 0x0037
994 }
__attribute__ ((packed)) write_link_supervision_timeout_cp;
995 #define WRITE_LINK_SUPERVISION_TIMEOUT_CP_SIZE 4
999 }
__attribute__ ((packed)) write_link_supervision_timeout_rp;
1000 #define WRITE_LINK_SUPERVISION_TIMEOUT_RP_SIZE 3
1002 #define OCF_READ_NUM_SUPPORTED_IAC 0x0038
1004 #define MAX_IAC_LAP 0x40
1005 #define OCF_READ_CURRENT_IAC_LAP 0x0039
1011 #define READ_CURRENT_IAC_LAP_RP_SIZE 2+3*MAX_IAC_LAP
1013 #define OCF_WRITE_CURRENT_IAC_LAP 0x003A
1015 uint8_t num_current_iac;
1018 #define WRITE_CURRENT_IAC_LAP_CP_SIZE 1+3*MAX_IAC_LAP
1020 #define OCF_READ_PAGE_SCAN_PERIOD_MODE 0x003B
1022 #define OCF_WRITE_PAGE_SCAN_PERIOD_MODE 0x003C
1024 #define OCF_READ_PAGE_SCAN_MODE 0x003D
1026 #define OCF_WRITE_PAGE_SCAN_MODE 0x003E
1028 #define OCF_SET_AFH_CLASSIFICATION 0x003F
1032 #define SET_AFH_CLASSIFICATION_CP_SIZE 10
1036 #define SET_AFH_CLASSIFICATION_RP_SIZE 1
1038 #define OCF_READ_INQUIRY_SCAN_TYPE 0x0042
1043 #define READ_INQUIRY_SCAN_TYPE_RP_SIZE 2
1045 #define OCF_WRITE_INQUIRY_SCAN_TYPE 0x0043
1049 #define WRITE_INQUIRY_SCAN_TYPE_CP_SIZE 1
1053 #define WRITE_INQUIRY_SCAN_TYPE_RP_SIZE 1
1055 #define OCF_READ_INQUIRY_MODE 0x0044
1060 #define READ_INQUIRY_MODE_RP_SIZE 2
1062 #define OCF_WRITE_INQUIRY_MODE 0x0045
1066 #define WRITE_INQUIRY_MODE_CP_SIZE 1
1070 #define WRITE_INQUIRY_MODE_RP_SIZE 1
1072 #define OCF_READ_PAGE_SCAN_TYPE 0x0046
1074 #define OCF_WRITE_PAGE_SCAN_TYPE 0x0047
1075 #define PAGE_SCAN_TYPE_STANDARD 0x00
1076 #define PAGE_SCAN_TYPE_INTERLACED 0x01
1078 #define OCF_READ_AFH_MODE 0x0048
1083 #define READ_AFH_MODE_RP_SIZE 2
1085 #define OCF_WRITE_AFH_MODE 0x0049
1089 #define WRITE_AFH_MODE_CP_SIZE 1
1093 #define WRITE_AFH_MODE_RP_SIZE 1
1095 #define HCI_MAX_EIR_LENGTH 240
1097 #define OCF_READ_EXT_INQUIRY_RESPONSE 0x0051
1103 #define READ_EXT_INQUIRY_RESPONSE_RP_SIZE 242
1105 #define OCF_WRITE_EXT_INQUIRY_RESPONSE 0x0052
1110 #define WRITE_EXT_INQUIRY_RESPONSE_CP_SIZE 241
1114 #define WRITE_EXT_INQUIRY_RESPONSE_RP_SIZE 1
1116 #define OCF_REFRESH_ENCRYPTION_KEY 0x0053
1120 #define REFRESH_ENCRYPTION_KEY_CP_SIZE 2
1124 #define REFRESH_ENCRYPTION_KEY_RP_SIZE 1
1126 #define OCF_READ_SIMPLE_PAIRING_MODE 0x0055
1131 #define READ_SIMPLE_PAIRING_MODE_RP_SIZE 2
1133 #define OCF_WRITE_SIMPLE_PAIRING_MODE 0x0056
1137 #define WRITE_SIMPLE_PAIRING_MODE_CP_SIZE 1
1141 #define WRITE_SIMPLE_PAIRING_MODE_RP_SIZE 1
1143 #define OCF_READ_LOCAL_OOB_DATA 0x0057
1147 uint8_t randomizer[16];
1149 #define READ_LOCAL_OOB_DATA_RP_SIZE 33
1151 #define OCF_READ_INQ_RESPONSE_TX_POWER_LEVEL 0x0058
1155 }
__attribute__ ((packed)) read_inq_response_tx_power_level_rp;
1156 #define READ_INQ_RESPONSE_TX_POWER_LEVEL_RP_SIZE 2
1158 #define OCF_READ_INQUIRY_TRANSMIT_POWER_LEVEL 0x0058
1162 }
__attribute__ ((packed)) read_inquiry_transmit_power_level_rp;
1163 #define READ_INQUIRY_TRANSMIT_POWER_LEVEL_RP_SIZE 2
1165 #define OCF_WRITE_INQUIRY_TRANSMIT_POWER_LEVEL 0x0059
1168 }
__attribute__ ((packed)) write_inquiry_transmit_power_level_cp;
1169 #define WRITE_INQUIRY_TRANSMIT_POWER_LEVEL_CP_SIZE 1
1172 }
__attribute__ ((packed)) write_inquiry_transmit_power_level_rp;
1173 #define WRITE_INQUIRY_TRANSMIT_POWER_LEVEL_RP_SIZE 1
1175 #define OCF_READ_DEFAULT_ERROR_DATA_REPORTING 0x005A
1179 }
__attribute__ ((packed)) read_default_error_data_reporting_rp;
1180 #define READ_DEFAULT_ERROR_DATA_REPORTING_RP_SIZE 2
1182 #define OCF_WRITE_DEFAULT_ERROR_DATA_REPORTING 0x005B
1185 }
__attribute__ ((packed)) write_default_error_data_reporting_cp;
1186 #define WRITE_DEFAULT_ERROR_DATA_REPORTING_CP_SIZE 1
1189 }
__attribute__ ((packed)) write_default_error_data_reporting_rp;
1190 #define WRITE_DEFAULT_ERROR_DATA_REPORTING_RP_SIZE 1
1192 #define OCF_ENHANCED_FLUSH 0x005F
1197 #define ENHANCED_FLUSH_CP_SIZE 3
1199 #define OCF_SEND_KEYPRESS_NOTIFY 0x0060
1204 #define SEND_KEYPRESS_NOTIFY_CP_SIZE 7
1208 #define SEND_KEYPRESS_NOTIFY_RP_SIZE 1
1210 #define OCF_READ_LOGICAL_LINK_ACCEPT_TIMEOUT 0x0061
1215 #define READ_LOGICAL_LINK_ACCEPT_TIMEOUT_RP_SIZE 3
1217 #define OCF_WRITE_LOGICAL_LINK_ACCEPT_TIMEOUT 0x0062
1220 }
__attribute__ ((packed)) write_log_link_accept_timeout_cp;
1221 #define WRITE_LOGICAL_LINK_ACCEPT_TIMEOUT_CP_SIZE 2
1223 #define OCF_SET_EVENT_MASK_PAGE_2 0x0063
1225 #define OCF_READ_LOCATION_DATA 0x0064
1227 #define OCF_WRITE_LOCATION_DATA 0x0065
1229 #define OCF_READ_FLOW_CONTROL_MODE 0x0066
1231 #define OCF_WRITE_FLOW_CONTROL_MODE 0x0067
1233 #define OCF_READ_ENHANCED_TRANSMIT_POWER_LEVEL 0x0068
1240 }
__attribute__ ((packed)) read_enhanced_transmit_power_level_rp;
1241 #define READ_ENHANCED_TRANSMIT_POWER_LEVEL_RP_SIZE 6
1243 #define OCF_READ_BEST_EFFORT_FLUSH_TIMEOUT 0x0069
1247 }
__attribute__ ((packed)) read_best_effort_flush_timeout_rp;
1248 #define READ_BEST_EFFORT_FLUSH_TIMEOUT_RP_SIZE 5
1250 #define OCF_WRITE_BEST_EFFORT_FLUSH_TIMEOUT 0x006A
1254 }
__attribute__ ((packed)) write_best_effort_flush_timeout_cp;
1255 #define WRITE_BEST_EFFORT_FLUSH_TIMEOUT_CP_SIZE 6
1258 }
__attribute__ ((packed)) write_best_effort_flush_timeout_rp;
1259 #define WRITE_BEST_EFFORT_FLUSH_TIMEOUT_RP_SIZE 1
1261 #define OCF_READ_LE_HOST_SUPPORTED 0x006C
1267 #define READ_LE_HOST_SUPPORTED_RP_SIZE 3
1269 #define OCF_WRITE_LE_HOST_SUPPORTED 0x006D
1274 #define WRITE_LE_HOST_SUPPORTED_CP_SIZE 2
1277 #define OGF_INFO_PARAM 0x04
1279 #define OCF_READ_LOCAL_VERSION 0x0001
1288 #define READ_LOCAL_VERSION_RP_SIZE 9
1290 #define OCF_READ_LOCAL_COMMANDS 0x0002
1293 uint8_t commands[64];
1295 #define READ_LOCAL_COMMANDS_RP_SIZE 65
1297 #define OCF_READ_LOCAL_FEATURES 0x0003
1300 uint8_t features[8];
1302 #define READ_LOCAL_FEATURES_RP_SIZE 9
1304 #define OCF_READ_LOCAL_EXT_FEATURES 0x0004
1308 #define READ_LOCAL_EXT_FEATURES_CP_SIZE 1
1313 uint8_t features[8];
1315 #define READ_LOCAL_EXT_FEATURES_RP_SIZE 11
1317 #define OCF_READ_BUFFER_SIZE 0x0005
1322 uint16_t acl_max_pkt;
1323 uint16_t sco_max_pkt;
1325 #define READ_BUFFER_SIZE_RP_SIZE 8
1327 #define OCF_READ_COUNTRY_CODE 0x0007
1329 #define OCF_READ_BD_ADDR 0x0009
1334 #define READ_BD_ADDR_RP_SIZE 7
1336 #define OCF_READ_DATA_BLOCK_SIZE 0x000A
1345 #define OGF_STATUS_PARAM 0x05
1347 #define OCF_READ_FAILED_CONTACT_COUNTER 0x0001
1353 #define READ_FAILED_CONTACT_COUNTER_RP_SIZE 4
1355 #define OCF_RESET_FAILED_CONTACT_COUNTER 0x0002
1360 #define RESET_FAILED_CONTACT_COUNTER_RP_SIZE 3
1362 #define OCF_READ_LINK_QUALITY 0x0003
1368 #define READ_LINK_QUALITY_RP_SIZE 4
1370 #define OCF_READ_RSSI 0x0005
1376 #define READ_RSSI_RP_SIZE 4
1378 #define OCF_READ_AFH_MAP 0x0006
1385 #define READ_AFH_MAP_RP_SIZE 14
1387 #define OCF_READ_CLOCK 0x0007
1392 #define READ_CLOCK_CP_SIZE 3
1399 #define READ_CLOCK_RP_SIZE 9
1401 #define OCF_READ_LOCAL_AMP_INFO 0x0009
1415 #define READ_LOCAL_AMP_INFO_RP_SIZE 31
1417 #define OCF_READ_LOCAL_AMP_ASSOC 0x000A
1423 #define READ_LOCAL_AMP_ASSOC_CP_SIZE 5
1430 #define READ_LOCAL_AMP_ASSOC_RP_SIZE 252
1432 #define OCF_WRITE_REMOTE_AMP_ASSOC 0x000B
1435 uint16_t length_so_far;
1439 #define WRITE_REMOTE_AMP_ASSOC_CP_SIZE 253
1444 #define WRITE_REMOTE_AMP_ASSOC_RP_SIZE 2
1447 #define OGF_TESTING_CMD 0x3e
1449 #define OCF_READ_LOOPBACK_MODE 0x0001
1451 #define OCF_WRITE_LOOPBACK_MODE 0x0002
1453 #define OCF_ENABLE_DEVICE_UNDER_TEST_MODE 0x0003
1455 #define OCF_WRITE_SIMPLE_PAIRING_DEBUG_MODE 0x0004
1458 }
__attribute__ ((packed)) write_simple_pairing_debug_mode_cp;
1459 #define WRITE_SIMPLE_PAIRING_DEBUG_MODE_CP_SIZE 1
1462 }
__attribute__ ((packed)) write_simple_pairing_debug_mode_rp;
1463 #define WRITE_SIMPLE_PAIRING_DEBUG_MODE_RP_SIZE 1
1466 #define OGF_LE_CTL 0x08
1468 #define OCF_LE_SET_EVENT_MASK 0x0001
1472 #define LE_SET_EVENT_MASK_CP_SIZE 8
1474 #define OCF_LE_READ_BUFFER_SIZE 0x0002
1480 #define LE_READ_BUFFER_SIZE_RP_SIZE 4
1482 #define OCF_LE_READ_LOCAL_SUPPORTED_FEATURES 0x0003
1485 uint8_t features[8];
1486 }
__attribute__ ((packed)) le_read_local_supported_features_rp;
1487 #define LE_READ_LOCAL_SUPPORTED_FEATURES_RP_SIZE 9
1489 #define OCF_LE_SET_RANDOM_ADDRESS 0x0005
1493 #define LE_SET_RANDOM_ADDRESS_CP_SIZE 6
1495 #define OCF_LE_SET_ADVERTISING_PARAMETERS 0x0006
1497 uint16_t min_interval;
1498 uint16_t max_interval;
1505 }
__attribute__ ((packed)) le_set_advertising_parameters_cp;
1506 #define LE_SET_ADVERTISING_PARAMETERS_CP_SIZE 15
1508 #define OCF_LE_READ_ADVERTISING_CHANNEL_TX_POWER 0x0007
1512 }
__attribute__ ((packed)) le_read_advertising_channel_tx_power_rp;
1513 #define LE_READ_ADVERTISING_CHANNEL_TX_POWER_RP_SIZE 2
1515 #define OCF_LE_SET_ADVERTISING_DATA 0x0008
1520 #define LE_SET_ADVERTISING_DATA_CP_SIZE 32
1522 #define OCF_LE_SET_SCAN_RESPONSE_DATA 0x0009
1527 #define LE_SET_SCAN_RESPONSE_DATA_CP_SIZE 32
1529 #define OCF_LE_SET_ADVERTISE_ENABLE 0x000A
1533 #define LE_SET_ADVERTISE_ENABLE_CP_SIZE 1
1535 #define OCF_LE_SET_SCAN_PARAMETERS 0x000B
1540 uint8_t own_bdaddr_type;
1543 #define LE_SET_SCAN_PARAMETERS_CP_SIZE 7
1545 #define OCF_LE_SET_SCAN_ENABLE 0x000C
1550 #define LE_SET_SCAN_ENABLE_CP_SIZE 2
1552 #define OCF_LE_CREATE_CONN 0x000D
1559 uint8_t own_bdaddr_type;
1560 uint16_t min_interval;
1561 uint16_t max_interval;
1567 #define LE_CREATE_CONN_CP_SIZE 25
1569 #define OCF_LE_CREATE_CONN_CANCEL 0x000E
1571 #define OCF_LE_READ_WHITE_LIST_SIZE 0x000F
1576 #define LE_READ_WHITE_LIST_SIZE_RP_SIZE 2
1578 #define OCF_LE_CLEAR_WHITE_LIST 0x0010
1580 #define OCF_LE_ADD_DEVICE_TO_WHITE_LIST 0x0011
1585 #define LE_ADD_DEVICE_TO_WHITE_LIST_CP_SIZE 7
1587 #define OCF_LE_REMOVE_DEVICE_FROM_WHITE_LIST 0x0012
1589 uint8_t bdaddr_type;
1591 }
__attribute__ ((packed)) le_remove_device_from_white_list_cp;
1592 #define LE_REMOVE_DEVICE_FROM_WHITE_LIST_CP_SIZE 7
1594 #define OCF_LE_CONN_UPDATE 0x0013
1597 uint16_t min_interval;
1598 uint16_t max_interval;
1600 uint16_t supervision_timeout;
1601 uint16_t min_ce_length;
1602 uint16_t max_ce_length;
1604 #define LE_CONN_UPDATE_CP_SIZE 14
1606 #define OCF_LE_SET_HOST_CHANNEL_CLASSIFICATION 0x0014
1609 }
__attribute__ ((packed)) le_set_host_channel_classification_cp;
1610 #define LE_SET_HOST_CHANNEL_CLASSIFICATION_CP_SIZE 5
1612 #define OCF_LE_READ_CHANNEL_MAP 0x0015
1616 #define LE_READ_CHANNEL_MAP_CP_SIZE 2
1622 #define LE_READ_CHANNEL_MAP_RP_SIZE 8
1624 #define OCF_LE_READ_REMOTE_USED_FEATURES 0x0016
1628 #define LE_READ_REMOTE_USED_FEATURES_CP_SIZE 2
1630 #define OCF_LE_ENCRYPT 0x0017
1633 uint8_t plaintext[16];
1635 #define LE_ENCRYPT_CP_SIZE 32
1640 #define LE_ENCRYPT_RP_SIZE 17
1642 #define OCF_LE_RAND 0x0018
1647 #define LE_RAND_RP_SIZE 9
1649 #define OCF_LE_START_ENCRYPTION 0x0019
1656 #define LE_START_ENCRYPTION_CP_SIZE 28
1658 #define OCF_LE_LTK_REPLY 0x001A
1663 #define LE_LTK_REPLY_CP_SIZE 18
1668 #define LE_LTK_REPLY_RP_SIZE 3
1670 #define OCF_LE_LTK_NEG_REPLY 0x001B
1674 #define LE_LTK_NEG_REPLY_CP_SIZE 2
1679 #define LE_LTK_NEG_REPLY_RP_SIZE 3
1681 #define OCF_LE_READ_SUPPORTED_STATES 0x001C
1686 #define LE_READ_SUPPORTED_STATES_RP_SIZE 9
1688 #define OCF_LE_RECEIVER_TEST 0x001D
1692 #define LE_RECEIVER_TEST_CP_SIZE 1
1694 #define OCF_LE_TRANSMITTER_TEST 0x001E
1700 #define LE_TRANSMITTER_TEST_CP_SIZE 3
1702 #define OCF_LE_TEST_END 0x001F
1707 #define LE_TEST_END_RP_SIZE 3
1709 #define OCF_LE_ADD_DEVICE_TO_RESOLV_LIST 0x0027
1711 uint8_t bdaddr_type;
1713 uint8_t peer_irk[16];
1714 uint8_t local_irk[16];
1716 #define LE_ADD_DEVICE_TO_RESOLV_LIST_CP_SIZE 39
1718 #define OCF_LE_REMOVE_DEVICE_FROM_RESOLV_LIST 0x0028
1720 uint8_t bdaddr_type;
1722 }
__attribute__ ((packed)) le_remove_device_from_resolv_list_cp;
1723 #define LE_REMOVE_DEVICE_FROM_RESOLV_LIST_CP_SIZE 7
1725 #define OCF_LE_CLEAR_RESOLV_LIST 0x0029
1727 #define OCF_LE_READ_RESOLV_LIST_SIZE 0x002A
1732 #define LE_READ_RESOLV_LIST_SIZE_RP_SIZE 2
1734 #define OCF_LE_SET_ADDRESS_RESOLUTION_ENABLE 0x002D
1737 }
__attribute__ ((packed)) le_set_address_resolution_enable_cp;
1738 #define LE_SET_ADDRESS_RESOLUTION_ENABLE_CP_SIZE 1
1741 #define OGF_VENDOR_CMD 0x3f
1745 #define EVT_INQUIRY_COMPLETE 0x01
1747 #define EVT_INQUIRY_RESULT 0x02
1750 uint8_t pscan_rep_mode;
1753 uint8_t dev_class[3];
1754 uint16_t clock_offset;
1756 #define INQUIRY_INFO_SIZE 14
1758 #define EVT_CONN_COMPLETE 0x03
1766 #define EVT_CONN_COMPLETE_SIZE 11
1768 #define EVT_CONN_REQUEST 0x04
1771 uint8_t dev_class[3];
1774 #define EVT_CONN_REQUEST_SIZE 10
1776 #define EVT_DISCONN_COMPLETE 0x05
1782 #define EVT_DISCONN_COMPLETE_SIZE 4
1784 #define EVT_AUTH_COMPLETE 0x06
1789 #define EVT_AUTH_COMPLETE_SIZE 3
1791 #define EVT_REMOTE_NAME_REQ_COMPLETE 0x07
1797 #define EVT_REMOTE_NAME_REQ_COMPLETE_SIZE 255
1799 #define EVT_ENCRYPT_CHANGE 0x08
1805 #define EVT_ENCRYPT_CHANGE_SIZE 4
1807 #define EVT_CHANGE_CONN_LINK_KEY_COMPLETE 0x09
1811 }
__attribute__ ((packed)) evt_change_conn_link_key_complete;
1812 #define EVT_CHANGE_CONN_LINK_KEY_COMPLETE_SIZE 3
1814 #define EVT_MASTER_LINK_KEY_COMPLETE 0x0A
1820 #define EVT_MASTER_LINK_KEY_COMPLETE_SIZE 4
1822 #define EVT_READ_REMOTE_FEATURES_COMPLETE 0x0B
1826 uint8_t features[8];
1827 }
__attribute__ ((packed)) evt_read_remote_features_complete;
1828 #define EVT_READ_REMOTE_FEATURES_COMPLETE_SIZE 11
1830 #define EVT_READ_REMOTE_VERSION_COMPLETE 0x0C
1835 uint16_t manufacturer;
1836 uint16_t lmp_subver;
1837 }
__attribute__ ((packed)) evt_read_remote_version_complete;
1838 #define EVT_READ_REMOTE_VERSION_COMPLETE_SIZE 8
1840 #define EVT_QOS_SETUP_COMPLETE 0x0D
1847 #define EVT_QOS_SETUP_COMPLETE_SIZE (4 + HCI_QOS_CP_SIZE)
1849 #define EVT_CMD_COMPLETE 0x0E
1854 #define EVT_CMD_COMPLETE_SIZE 3
1856 #define EVT_CMD_STATUS 0x0F
1862 #define EVT_CMD_STATUS_SIZE 4
1864 #define EVT_HARDWARE_ERROR 0x10
1868 #define EVT_HARDWARE_ERROR_SIZE 1
1870 #define EVT_FLUSH_OCCURRED 0x11
1874 #define EVT_FLUSH_OCCURRED_SIZE 2
1876 #define EVT_ROLE_CHANGE 0x12
1882 #define EVT_ROLE_CHANGE_SIZE 8
1884 #define EVT_NUM_COMP_PKTS 0x13
1889 #define EVT_NUM_COMP_PKTS_SIZE 1
1891 #define EVT_MODE_CHANGE 0x14
1898 #define EVT_MODE_CHANGE_SIZE 6
1900 #define EVT_RETURN_LINK_KEYS 0x15
1905 #define EVT_RETURN_LINK_KEYS_SIZE 1
1907 #define EVT_PIN_CODE_REQ 0x16
1911 #define EVT_PIN_CODE_REQ_SIZE 6
1913 #define EVT_LINK_KEY_REQ 0x17
1917 #define EVT_LINK_KEY_REQ_SIZE 6
1919 #define EVT_LINK_KEY_NOTIFY 0x18
1922 uint8_t link_key[16];
1925 #define EVT_LINK_KEY_NOTIFY_SIZE 23
1927 #define EVT_LOOPBACK_COMMAND 0x19
1929 #define EVT_DATA_BUFFER_OVERFLOW 0x1A
1933 #define EVT_DATA_BUFFER_OVERFLOW_SIZE 1
1935 #define EVT_MAX_SLOTS_CHANGE 0x1B
1940 #define EVT_MAX_SLOTS_CHANGE_SIZE 3
1942 #define EVT_READ_CLOCK_OFFSET_COMPLETE 0x1C
1946 uint16_t clock_offset;
1948 #define EVT_READ_CLOCK_OFFSET_COMPLETE_SIZE 5
1950 #define EVT_CONN_PTYPE_CHANGED 0x1D
1956 #define EVT_CONN_PTYPE_CHANGED_SIZE 5
1958 #define EVT_QOS_VIOLATION 0x1E
1962 #define EVT_QOS_VIOLATION_SIZE 2
1964 #define EVT_PSCAN_REP_MODE_CHANGE 0x20
1967 uint8_t pscan_rep_mode;
1969 #define EVT_PSCAN_REP_MODE_CHANGE_SIZE 7
1971 #define EVT_FLOW_SPEC_COMPLETE 0x21
1979 #define EVT_FLOW_SPEC_COMPLETE_SIZE (5 + HCI_QOS_CP_SIZE)
1981 #define EVT_INQUIRY_RESULT_WITH_RSSI 0x22
1984 uint8_t pscan_rep_mode;
1985 uint8_t pscan_period_mode;
1986 uint8_t dev_class[3];
1987 uint16_t clock_offset;
1990 #define INQUIRY_INFO_WITH_RSSI_SIZE 14
1993 uint8_t pscan_rep_mode;
1994 uint8_t pscan_period_mode;
1996 uint8_t dev_class[3];
1997 uint16_t clock_offset;
1999 }
__attribute__ ((packed)) inquiry_info_with_rssi_and_pscan_mode;
2000 #define INQUIRY_INFO_WITH_RSSI_AND_PSCAN_MODE_SIZE 15
2002 #define EVT_READ_REMOTE_EXT_FEATURES_COMPLETE 0x23
2007 uint8_t max_page_num;
2008 uint8_t features[8];
2009 }
__attribute__ ((packed)) evt_read_remote_ext_features_complete;
2010 #define EVT_READ_REMOTE_EXT_FEATURES_COMPLETE_SIZE 13
2012 #define EVT_SYNC_CONN_COMPLETE 0x2C
2024 #define EVT_SYNC_CONN_COMPLETE_SIZE 17
2026 #define EVT_SYNC_CONN_CHANGED 0x2D
2030 uint8_t trans_interval;
2031 uint8_t retrans_window;
2032 uint16_t rx_pkt_len;
2033 uint16_t tx_pkt_len;
2035 #define EVT_SYNC_CONN_CHANGED_SIZE 9
2037 #define EVT_SNIFF_SUBRATING 0x2E
2043 uint16_t min_remote_timeout;
2044 uint16_t min_local_timeout;
2046 #define EVT_SNIFF_SUBRATING_SIZE 11
2048 #define EVT_EXTENDED_INQUIRY_RESULT 0x2F
2051 uint8_t pscan_rep_mode;
2052 uint8_t pscan_period_mode;
2053 uint8_t dev_class[3];
2054 uint16_t clock_offset;
2058 #define EXTENDED_INQUIRY_INFO_SIZE 254
2060 #define EVT_ENCRYPTION_KEY_REFRESH_COMPLETE 0x30
2064 }
__attribute__ ((packed)) evt_encryption_key_refresh_complete;
2065 #define EVT_ENCRYPTION_KEY_REFRESH_COMPLETE_SIZE 3
2067 #define EVT_IO_CAPABILITY_REQUEST 0x31
2071 #define EVT_IO_CAPABILITY_REQUEST_SIZE 6
2073 #define EVT_IO_CAPABILITY_RESPONSE 0x32
2078 uint8_t authentication;
2080 #define EVT_IO_CAPABILITY_RESPONSE_SIZE 9
2082 #define EVT_USER_CONFIRM_REQUEST 0x33
2087 #define EVT_USER_CONFIRM_REQUEST_SIZE 10
2089 #define EVT_USER_PASSKEY_REQUEST 0x34
2093 #define EVT_USER_PASSKEY_REQUEST_SIZE 6
2095 #define EVT_REMOTE_OOB_DATA_REQUEST 0x35
2099 #define EVT_REMOTE_OOB_DATA_REQUEST_SIZE 6
2101 #define EVT_SIMPLE_PAIRING_COMPLETE 0x36
2106 #define EVT_SIMPLE_PAIRING_COMPLETE_SIZE 7
2108 #define EVT_LINK_SUPERVISION_TIMEOUT_CHANGED 0x38
2112 }
__attribute__ ((packed)) evt_link_supervision_timeout_changed;
2113 #define EVT_LINK_SUPERVISION_TIMEOUT_CHANGED_SIZE 4
2115 #define EVT_ENHANCED_FLUSH_COMPLETE 0x39
2119 #define EVT_ENHANCED_FLUSH_COMPLETE_SIZE 2
2121 #define EVT_USER_PASSKEY_NOTIFY 0x3B
2126 #define EVT_USER_PASSKEY_NOTIFY_SIZE 10
2128 #define EVT_KEYPRESS_NOTIFY 0x3C
2133 #define EVT_KEYPRESS_NOTIFY_SIZE 7
2135 #define EVT_REMOTE_HOST_FEATURES_NOTIFY 0x3D
2138 uint8_t features[8];
2140 #define EVT_REMOTE_HOST_FEATURES_NOTIFY_SIZE 14
2142 #define EVT_LE_META_EVENT 0x3E
2147 #define EVT_LE_META_EVENT_SIZE 1
2149 #define EVT_LE_CONN_COMPLETE 0x01
2154 uint8_t peer_bdaddr_type;
2155 bdaddr_t peer_bdaddr;
2158 uint16_t supervision_timeout;
2161 #define EVT_LE_CONN_COMPLETE_SIZE 18
2163 #define EVT_LE_ADVERTISING_REPORT 0x02
2166 uint8_t bdaddr_type;
2171 #define LE_ADVERTISING_INFO_SIZE 9
2173 #define EVT_LE_CONN_UPDATE_COMPLETE 0x03
2179 uint16_t supervision_timeout;
2180 }
__attribute__ ((packed)) evt_le_connection_update_complete;
2181 #define EVT_LE_CONN_UPDATE_COMPLETE_SIZE 9
2183 #define EVT_LE_READ_REMOTE_USED_FEATURES_COMPLETE 0x04
2187 uint8_t features[8];
2188 }
__attribute__ ((packed)) evt_le_read_remote_used_features_complete;
2189 #define EVT_LE_READ_REMOTE_USED_FEATURES_COMPLETE_SIZE 11
2191 #define EVT_LE_LTK_REQUEST 0x05
2195 uint16_t diversifier;
2197 #define EVT_LE_LTK_REQUEST_SIZE 12
2199 #define EVT_PHYSICAL_LINK_COMPLETE 0x40
2204 #define EVT_PHYSICAL_LINK_COMPLETE_SIZE 2
2206 #define EVT_CHANNEL_SELECTED 0x41
2208 #define EVT_DISCONNECT_PHYSICAL_LINK_COMPLETE 0x42
2213 }
__attribute__ ((packed)) evt_disconn_physical_link_complete;
2214 #define EVT_DISCONNECT_PHYSICAL_LINK_COMPLETE_SIZE 3
2216 #define EVT_PHYSICAL_LINK_LOSS_EARLY_WARNING 0x43
2221 #define EVT_PHYSICAL_LINK_LOSS_WARNING_SIZE 2
2223 #define EVT_PHYSICAL_LINK_RECOVERY 0x44
2227 #define EVT_PHYSICAL_LINK_RECOVERY_SIZE 1
2229 #define EVT_LOGICAL_LINK_COMPLETE 0x45
2236 #define EVT_LOGICAL_LINK_COMPLETE_SIZE 5
2238 #define EVT_DISCONNECT_LOGICAL_LINK_COMPLETE 0x46
2240 #define EVT_FLOW_SPEC_MODIFY_COMPLETE 0x47
2245 #define EVT_FLOW_SPEC_MODIFY_COMPLETE_SIZE 3
2247 #define EVT_NUMBER_COMPLETED_BLOCKS 0x48
2256 cmplt_handle handles[0];
2259 #define EVT_AMP_STATUS_CHANGE 0x4D
2264 #define EVT_AMP_STATUS_CHANGE_SIZE 2
2266 #define EVT_TESTING 0xFE
2268 #define EVT_VENDOR 0xFF
2271 #define EVT_STACK_INTERNAL 0xFD
2276 #define EVT_STACK_INTERNAL_SIZE 2
2278 #define EVT_SI_DEVICE 0x01
2283 #define EVT_SI_DEVICE_SIZE 4
2286 #define HCI_TYPE_LEN 1
2292 #define HCI_COMMAND_HDR_SIZE 3
2298 #define HCI_EVENT_HDR_SIZE 2
2304 #define HCI_ACL_HDR_SIZE 4
2310 #define HCI_SCO_HDR_SIZE 3
2317 #define HCI_MSG_HDR_SIZE 6
2320 #define cmd_opcode_pack(ogf, ocf) (uint16_t)((ocf & 0x03ff)|(ogf << 10))
2321 #define cmd_opcode_ogf(op) (op >> 10)
2322 #define cmd_opcode_ocf(op) (op & 0x03ff)
2325 #define acl_handle_pack(h, f) (uint16_t)((h & 0x0fff)|(f << 12))
2326 #define acl_handle(h) (h & 0x0fff)
2327 #define acl_flags(h) (h >> 12)
2332 #define HCI_DATA_DIR 1
2333 #define HCI_FILTER 2
2334 #define HCI_TIME_STAMP 3
2337 #define HCI_CMSG_DIR 0x0001
2338 #define HCI_CMSG_TSTAMP 0x0002
2345 #define HCI_DEV_NONE 0xffff
2347 #define HCI_CHANNEL_RAW 0
2348 #define HCI_CHANNEL_USER 1
2349 #define HCI_CHANNEL_MONITOR 2
2350 #define HCI_CHANNEL_CONTROL 3
2358 #define HCI_FLT_TYPE_BITS 31
2359 #define HCI_FLT_EVENT_BITS 63
2360 #define HCI_FLT_OGF_BITS 63
2361 #define HCI_FLT_OCF_BITS 127
2443 #define IREQ_CACHE_FLUSH 0x0001
#define HCI_MAX_EIR_LENGTH
uint16_t supervision_timeout
uint32_t max_flush_timeout
struct hci_dev_req dev_req[0]
struct hci_dev_stats stat
struct hci_conn_info conn_info[0]
uint16_t min_remote_timeout
uint8_t master_clock_accuracy
uint16_t total_num_blocks
uint8_t pscan_period_mode
uint32_t max_guaranteed_bandwidth
#define HCI_MAX_NAME_LENGTH
uint32_t best_effort_flush_timeout
uint8_t direct_bdaddr_type
unsigned short hci_channel
struct hci_conn_info conn_info[0]
uint16_t min_local_timeout
uint16_t remaining_length
uint16_t max_amp_assoc_length