• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2021 Huawei Device Co., Ltd.
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6  *
7  *     http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15 
16 #ifndef HCI_DEF_EVT_H
17 #define HCI_DEF_EVT_H
18 
19 #include <stdint.h>
20 
21 #include "hci_def_common.h"
22 
23 #ifdef __cplusplus
24 extern "C" {
25 #endif
26 
27 #pragma pack(1)
28 
29 // BLUETOOTH SPECIFICATION Version 5.0 | Vol 2, Part E
30 // 7.7.1 Inquiry Complete Event
31 #define HCI_INQUIRY_COMPLETE_EVENT 0x01
32 
33 typedef HciStatusParam HciInquiryCompleteEventParam;
34 
35 // BLUETOOTH SPECIFICATION Version 5.0 | Vol 2, Part E
36 // 7.7.2 Inquiry Result Event
37 #define HCI_INQUIRY_RESULT_EVENT 0x02
38 
39 typedef struct {
40     HciBdAddr bdAddr;
41     uint8_t pageScanRepetitionMode;
42     uint8_t reserved1;
43     uint8_t reserved2;
44     uint8_t classOfDevice[3];
45     uint16_t clockOffset;
46 } HciInquiryResult;
47 
48 typedef struct {
49     uint8_t numResponses;
50     HciInquiryResult *responses;
51 } HciInquiryResultEventParam;
52 
53 // BLUETOOTH SPECIFICATION Version 5.0 | Vol 2, Part E
54 // 7.7.3 Connection Complete Event
55 #define HCI_CONNECTION_COMPLETE_EVENT 0x03
56 
57 typedef struct {
58     uint8_t status;
59     uint16_t connectionHandle;
60     HciBdAddr bdAddr;
61     uint8_t linkType;
62     uint8_t encryptionEnabled;
63 } HciConnectionCompleteEventParam;
64 
65 // BLUETOOTH SPECIFICATION Version 5.0 | Vol 2, Part E
66 // 7.7.4 Connection Request Event
67 #define HCI_CONNECTION_REQUEST_EVENT 0x04
68 
69 #define HCI_LINK_TYPE_SCO 0x00
70 #define HCI_LINK_TYPE_ACL 0x01
71 #define HCI_LINK_TYPE_ESCO 0x02
72 
73 typedef struct {
74     HciBdAddr bdAddr;
75     uint8_t classOfDevice[3];
76     uint8_t linkType;
77 } HciConnectionRequestEventParam;
78 
79 // BLUETOOTH SPECIFICATION Version 5.0 | Vol 2, Part E
80 // 7.7.5 Disconnection Complete Event
81 #define HCI_DISCONNECT_COMPLETE_EVENT 0x05
82 
83 typedef struct {
84     uint8_t status;
85     uint16_t connectionHandle;
86     uint8_t reason;
87 } HciDisconnectCompleteEventParam;
88 
89 // BLUETOOTH SPECIFICATION Version 5.0 | Vol 2, Part E
90 // 7.7.6 Authentication Complete Event
91 #define HCI_AUTHENTICATION_COMPLETE_EVENT 0x06
92 
93 typedef struct {
94     uint8_t status;
95     uint16_t connectionHandle;
96 } HciAuthenticationCompleteEventParam;
97 
98 // BLUETOOTH SPECIFICATION Version 5.0 | Vol 2, Part E
99 // 7.7.7 Remote Name Request Complete Event
100 #define HCI_REMOTE_NAME_REQUEST_COMPLETE_EVENT 0x07
101 
102 typedef struct {
103     uint8_t status;
104     HciBdAddr bdAddr;
105     uint8_t remoteName[248];
106 } HciRemoteNameRequestCompleteEventParam;
107 
108 // BLUETOOTH SPECIFICATION Version 5.0 | Vol 2, Part E
109 // 7.7.8 Encryption Change Event
110 #define HCI_ENCRYPTION_CHANGE_EVENT 0x08
111 
112 #define LINK_LEVEL_ENCRYPTION_OFF 0x00
113 #define LINK_LEVEL_ENCRYPTION_ON_E0 0x01
114 #define LINK_LEVEL_ENCRYPTION_ON_AES_CCM 0x02
115 
116 typedef struct {
117     uint8_t status;
118     uint16_t connectionHandle;
119     uint8_t encryptionEnabled;
120 } HciEncryptionChangeEventParam;
121 
122 // BLUETOOTH SPECIFICATION Version 5.0 | Vol 2, Part E
123 // 7.7.9 Change Connection Link Key Complete Event
124 #define HCI_CHANGE_CONNECTION_LINK_KEY_COMPLETE_EVENT 0x09
125 
126 typedef struct {
127     uint8_t status;
128     uint16_t connectionHandle;
129 } HciChangeConnectionLinkKeyCompleteEventParam;
130 
131 // BLUETOOTH SPECIFICATION Version 5.0 | Vol 2, Part E
132 // 7.7.10 Master Link Key Complete Event
133 #define HCI_MASTER_LINK_KEY_COMPLETE_EVENT 0x0A
134 
135 typedef struct {
136     uint8_t status;
137     uint16_t connectionHandle;
138     uint8_t keyFlag;
139 } HciMasterLinkKeyCompleteEventParam;
140 
141 // BLUETOOTH SPECIFICATION Version 5.0 | Vol 2, Part E
142 // 7.7.11 Read Remote Supported Features Complete Event
143 #define HCI_READ_REMOTE_SUPPORTED_FEATURES_COMPLETE_EVENT 0x0B
144 
145 typedef struct {
146     uint8_t status;
147     uint16_t connectionHandle;
148     HciLmpFeatures lmpFeatures;
149 } HciReadRemoteSupportedFeaturesCompleteEventParam;
150 
151 // BLUETOOTH SPECIFICATION Version 5.0 | Vol 2, Part E
152 // 7.7.12 Read Remote Version Information Complete Event
153 #define HCI_READ_REMOTE_VERSION_INFORMATION_COMPLETE_EVENT 0x0C
154 
155 typedef struct {
156     uint8_t status;
157     uint16_t connectionHandle;
158     uint8_t version;
159     uint16_t manufacturerName;
160     uint16_t subVersion;
161 } HciReadRemoteVersionInformationCompleteEventParam;
162 
163 // BLUETOOTH SPECIFICATION Version 5.0 | Vol 2, Part E
164 // 7.7.13 QoS Setup Complete Event
165 #define HCI_QOS_SETUP_COMPLETE_EVENT 0x0D
166 
167 typedef struct {
168     uint8_t status;
169     uint16_t connectionHandle;
170     uint8_t flags;
171     uint8_t serviceType;
172     uint32_t tokenRate;
173     uint32_t peakBandwidth;
174     uint32_t latency;
175     uint32_t delayVariation;
176 } HciQosSetupCompleteEventParam;
177 
178 // BLUETOOTH SPECIFICATION Version 5.0 | Vol 2, Part E
179 // 7.7.14 Command Complete Event
180 #define HCI_COMMAND_COMPLETE_EVENT 0x0E
181 
182 typedef struct {
183     uint8_t numHciCommandPackets;
184     uint16_t commandOpcode;
185 } HciCommandCompleteEventParam;
186 
187 // BLUETOOTH SPECIFICATION Version 5.0 | Vol 2, Part E
188 // 7.7.15 Command Status Event
189 #define HCI_COMMAND_STATUS_EVENT 0x0F
190 
191 typedef struct {
192     uint8_t status;
193     uint8_t numHciCommandPackets;
194     uint16_t commandOpcode;
195 } HciCommandStatusEventParam;
196 
197 // BLUETOOTH SPECIFICATION Version 5.0 | Vol 2, Part E
198 // 7.7.16 Hardware Error Event
199 #define HCI_HARDWARE_ERROR_EVENT 0x10
200 
201 typedef struct {
202     uint8_t hardwareCode;
203 } HciHardwareErrorEventParam;
204 
205 // BLUETOOTH SPECIFICATION Version 5.0 | Vol 2, Part E
206 // 7.7.17 Flush Occurred Event
207 #define HCI_FLUSH_OCCURRED_EVENT 0x11
208 
209 typedef struct {
210     uint16_t handle;
211 } HciFlushOccurredEventParam;
212 
213 // BLUETOOTH SPECIFICATION Version 5.0 | Vol 2, Part E
214 // 7.7.18 Role Change Event
215 #define HCI_ROLE_CHANGE_EVENT 0x12
216 
217 typedef struct {
218     uint8_t status;
219     HciBdAddr bdAddr;
220     uint8_t newRole;
221 } HciRoleChangeEventParam;
222 
223 // BLUETOOTH SPECIFICATION Version 5.0 | Vol 2, Part E
224 // 7.7.19 Number Of Completed Packets Event
225 #define HCI_NUMBER_OF_COMPLETED_PACKETS_EVENT 0x13
226 
227 // BLUETOOTH SPECIFICATION Version 5.0 | Vol 2, Part E
228 // 7.7.20 Mode Change Event
229 #define HCI_MODE_CHANGE_EVENT 0x14
230 
231 #define ACTIVE_MODE 0x00
232 #define HOLD_MODE 0x01
233 #define SNIFF_MODE 0x02
234 
235 typedef struct {
236     uint8_t status;
237     uint16_t connectionHandle;
238     uint8_t currentMode;
239     uint16_t interval;
240 } HciModeChangeEventParam;
241 
242 // BLUETOOTH SPECIFICATION Version 5.0 | Vol 2, Part E
243 // 7.7.21 Return Link Keys Event
244 #define HCI_RETURN_LINK_KEYS_EVENT 0x15
245 
246 typedef struct {
247     HciBdAddr bdAddr;
248     uint8_t linkKey[16];
249 } HciReturnLinkKeys;
250 
251 typedef struct {
252     uint8_t numKeys;
253     HciReturnLinkKeys *responses;
254 } HciReturnLinkKeysEventParam;
255 
256 // BLUETOOTH SPECIFICATION Version 5.0 | Vol 2, Part E
257 // 7.7.22 PIN Code Request Event
258 #define HCI_PIN_CODE_REQUEST_EVENT 0x16
259 
260 typedef struct {
261     HciBdAddr bdAddr;
262 } HciPinCodeRequestEventParam;
263 
264 // BLUETOOTH SPECIFICATION Version 5.0 | Vol 2, Part E
265 // 7.7.23 Link Key Request Event
266 #define HCI_LINK_KEY_REQUEST_EVENT 0x17
267 
268 typedef struct {
269     HciBdAddr bdAddr;
270 } HciLinkKeyRequestEventParam;
271 
272 // BLUETOOTH SPECIFICATION Version 5.0 | Vol 2, Part E
273 // 7.7.24 Link Key Notification Event
274 #define HCI_LINK_KEY_NOTIFICATION_EVENT 0x18
275 
276 #define COMBINATION_KEY 0x00
277 #define LOCAL_UNIT_KEY 0x01
278 #define REMOTE_UNIT_KEY 0x02
279 #define DEBUG_COMBINATION_KE 0x03
280 #define UNAUTHENTICATED_COMBINATION_KEY_GENERATED_FROM_P192 0x04
281 #define AUTHENTICATED_COMBINATION_KEY_GENERATED_FROM_P192 0x05
282 #define CHANGED_COMBINATION_KEY 0x06
283 #define UNAUTHENTICATED_COMBINATION_KEY_GENERATED_FROM_P256 0x07
284 #define AUTHENTICATED_COMBINATION_KEY_GENERATED_FROM_P256 0x08
285 
286 typedef struct {
287     HciBdAddr bdAddr;
288     uint8_t linkKey[16];
289     uint8_t keyType;
290 } HciLinkKeyNotificationEventParam;
291 
292 // BLUETOOTH SPECIFICATION Version 5.0 | Vol 2, Part E
293 // 7.7.26 Data Buffer Overflow Event
294 #define HCI_DATA_BUFFER_OVERFLOW_EVENT 0x1A
295 
296 typedef struct {
297     uint8_t linkType;
298 } HciDataBufferOverflowEventParam;
299 
300 // BLUETOOTH SPECIFICATION Version 5.0 | Vol 2, Part E
301 // 7.7.27 Max Slots Change Event
302 #define HCI_MAX_SLOTS_CHANGE_EVENT 0x1B
303 
304 typedef struct {
305     uint16_t connectionHandle;
306     uint8_t lmpMaxSlots;
307 } HciMaxSlotsChangeEventParam;
308 
309 // BLUETOOTH SPECIFICATION Version 5.0 | Vol 2, Part E
310 // 7.7.28 Read Clock Offset Complete Event
311 #define HCI_READ_CLOCK_OFFSET_COMPLETE_EVENT 0x1C
312 
313 typedef struct {
314     uint8_t status;
315     uint16_t connectionHandle;
316     uint16_t clockOffset;
317 } HciReadClockOffsetCompleteEventParam;
318 
319 // BLUETOOTH SPECIFICATION Version 5.0 | Vol 2, Part E
320 // 7.7.29 Connection Packet Type Changed Event
321 #define HCI_CONNECTION_PACKET_TYPE_CHANGED_EVENT 0x1D
322 
323 typedef struct {
324     uint8_t status;
325     uint16_t connectionHandle;
326     uint16_t packetType;
327 } HciConnectionPacketTypeChangedEventParam;
328 
329 // BLUETOOTH SPECIFICATION Version 5.0 | Vol 2, Part E
330 // 7.7.30 QoS Violation Event
331 #define HCI_QOS_VIOLATION_EVENT 0x1E
332 
333 typedef struct {
334     uint16_t handle;
335 } HciQosViolationEventParam;
336 
337 // BLUETOOTH SPECIFICATION Version 5.0 | Vol 2, Part E
338 // 7.7.31 Page Scan Repetition Mode Change Event
339 #define HCI_PAGE_SCAN_REPETITION_MODE_CHANGE_EVENT 0x20
340 
341 typedef struct {
342     HciBdAddr bdAddr;
343     uint8_t pageScanRepetitionMode;
344 } HciPageScanRepetitionModeChangeEventParam;
345 
346 // BLUETOOTH SPECIFICATION Version 5.0 | Vol 2, Part E
347 // 7.7.32 Flow Specification Complete Event
348 #define HCI_FLOW_SPECIFICATION_COMPLETE_EVENT 0x21
349 
350 typedef struct {
351     uint8_t status;
352     uint16_t connectionHandle;
353     uint8_t flags;
354     uint8_t flowdirection;
355     uint8_t serviceType;
356     uint32_t tokenRate;
357     uint32_t tokenBucketSize;
358     uint32_t peakBandwidth;
359     uint32_t accessLatency;
360 } HciFlowSpecificationCompleteEventParam;
361 
362 // BLUETOOTH SPECIFICATION Version 5.0 | Vol 2, Part E
363 // 7.7.33 Inquiry Result with RSSI Event
364 #define HCI_INQUIRY_RESULT_WITH_RSSI_EVENT 0x22
365 
366 typedef struct {
367     HciBdAddr bdAddr;
368     uint8_t pageScanRepetitionMode;
369     uint8_t reserved;
370     uint8_t classOfDevice[3];
371     uint16_t clockOffset;
372     uint8_t rssi;
373 } HciInquiryResultWithRssi;
374 
375 typedef struct {
376     uint8_t numResponses;
377     HciInquiryResultWithRssi *responses;
378 } HciInquiryResultWithRssiEventParam;
379 
380 // BLUETOOTH SPECIFICATION Version 5.0 | Vol 2, Part E
381 // 7.7.34 Read Remote Extended Features Complete Event
382 #define HCI_READ_REMOTE_EXTENDED_FEATURES_COMPLETE_EVENT 0x23
383 
384 typedef struct {
385     uint8_t status;
386     uint16_t connectionHandle;
387     uint8_t pageNumber;
388     uint8_t maximumPageNumber;
389     uint8_t extendedLMPFeatures[LMP_FEATURES_SIZE];
390 } HciReadRemoteExtendedFeaturesCompleteEventParam;
391 
392 // BLUETOOTH SPECIFICATION Version 5.0 | Vol 2, Part E
393 // 7.7.35 Synchronous Connection Complete Event
394 #define HCI_SYNCHRONOUS_CONNECTION_COMPLETE_EVENT 0x2C
395 
396 typedef struct {
397     uint8_t status;
398     uint16_t connectionHandle;
399     HciBdAddr bdAddr;
400     uint8_t linkType;
401     uint8_t transmissionInterval;
402     uint8_t retransmissionWindow;
403     uint16_t rxPacketLength;
404     uint16_t txPacketLength;
405     uint8_t airMode;
406 } HciSynchronousConnectionCompleteEventParam;
407 
408 // BLUETOOTH SPECIFICATION Version 5.0 | Vol 2, Part E
409 // 7.7.36 Synchronous Connection Changed Event
410 #define HCI_SYNCHRONOUS_CONNECTION_CHANGED_EVENT 0x2D
411 
412 typedef struct {
413     uint8_t status;
414     uint16_t connectionHandle;
415     uint8_t transmissionInterval;
416     uint8_t retransmissionWindow;
417     uint16_t rxPacketLength;
418     uint16_t txPacketLength;
419 } HciSynchronousConnectionChangedEventParam;
420 
421 // BLUETOOTH SPECIFICATION Version 5.0 | Vol 2, Part E
422 // 7.7.37 Sniff Subrating Event
423 #define HCI_SNIFF_SUBRATING_EVENT 0x2E
424 
425 typedef struct {
426     uint8_t status;
427     uint16_t connectionHandle;
428     uint16_t maximumTransmitLatency;
429     uint16_t maximumReceiveLatency;
430     uint16_t minimumRemoteTimeout;
431     uint16_t minimumLocalTimeout;
432 } HciSniffSubratingEventParam;
433 
434 // BLUETOOTH SPECIFICATION Version 5.0 | Vol 2, Part E
435 // 7.7.38 Extended Inquiry Result Event
436 #define HCI_EXTENDED_INQUIRY_RESULT_EVENT 0x2F
437 
438 typedef struct {
439     uint8_t numResponses;
440     HciBdAddr bdAddr;
441     uint8_t pageScanRepetitionMode;
442     uint8_t reserved;
443     uint8_t classofDevice[3];
444     uint16_t clockOffset;
445     uint8_t rssi;
446     uint8_t extendedInquiryResponse[240];
447 } HciExtendedInquiryResultEventParam;
448 
449 // BLUETOOTH SPECIFICATION Version 5.0 | Vol 2, Part E
450 // 7.7.39 Encryption Key Refresh Complete Event
451 #define HCI_ENCRYPTION_KEY_REFRESH_COMPLETE_EVENT 0x30
452 
453 typedef struct {
454     uint8_t status;
455     uint16_t connectionHandle;
456 } HciEncryptionKeyRefreshCompleteEventParam;
457 
458 // BLUETOOTH SPECIFICATION Version 5.0 | Vol 2, Part E
459 // 7.7.40 IO Capability Request Event
460 #define HCI_IO_CAPABILITY_REQUEST_EVENT 0x31
461 
462 typedef struct {
463     HciBdAddr bdAddr;
464 } HciIoCapabilityRequestEventParam;
465 
466 // BLUETOOTH SPECIFICATION Version 5.0 | Vol 2, Part E
467 // 7.7.41 IO Capability Response Event
468 #define HCI_IO_CAPABILITY_RESPONSE_EVENT 0x32
469 
470 typedef struct {
471     HciBdAddr bdAddr;
472     uint8_t IOCapability;
473     uint8_t OOBDataPresent;
474     uint8_t authenticationRequirements;
475 } HciIoCapabilityResponseEventParam;
476 
477 // BLUETOOTH SPECIFICATION Version 5.0 | Vol 2, Part E
478 // 7.7.42 User Confirmation Request Event
479 #define HCI_USER_CONFIRMATION_REQUEST_EVENT 0x33
480 
481 typedef struct {
482     HciBdAddr bdAddr;
483     uint32_t numericValue;
484 } HciUserConfirmationRequestEventParam;
485 
486 // BLUETOOTH SPECIFICATION Version 5.0 | Vol 2, Part E
487 // 7.7.43 User Passkey Request Event
488 #define HCI_USER_PASSKEY_REQUEST_EVENT 0x34
489 
490 typedef struct {
491     HciBdAddr bdAddr;
492 } HciUserPasskeyRequestEventParam;
493 
494 // BLUETOOTH SPECIFICATION Version 5.0 | Vol 2, Part E
495 // 7.7.44 Remote OOB Data Request Event
496 #define HCI_REMOTE_OOB_DATA_REQUEST_EVENT 0x35
497 
498 typedef struct {
499     HciBdAddr bdAddr;
500 } HciRemoteOobDataRequestEventParam;
501 
502 // BLUETOOTH SPECIFICATION Version 5.0 | Vol 2, Part E
503 // 7.7.45 Simple Pairing Complete Event
504 #define HCI_SIMPLE_PAIRING_COMPLETE_EVENT 0x36
505 
506 typedef struct {
507     uint8_t status;
508     HciBdAddr bdAddr;
509 } HciSimplePairingCompleteEventParam;
510 
511 // BLUETOOTH SPECIFICATION Version 5.0 | Vol 2, Part E
512 // 7.7.46 Link Supervision Timeout Changed Event
513 #define HCI_LINK_SUPERVISION_TIMEOUT_CHANGED_EVENT 0x38
514 
515 typedef struct {
516     uint16_t connectionHandle;
517     uint16_t linkSupervisionTimeout;
518 } HciLinkSupervisionTimeoutChangedEventParam;
519 
520 // BLUETOOTH SPECIFICATION Version 5.0 | Vol 2, Part E
521 // 7.7.47 Enhanced Flush Complete Event
522 #define HCI_ENHANCED_FLUSH_COMPLETE_EVENT 0x39
523 
524 typedef struct {
525     uint16_t handle;
526 } HciEnhancedFlushCompleteEventParam;
527 
528 // BLUETOOTH SPECIFICATION Version 5.0 | Vol 2, Part E
529 // 7.7.48 User Passkey Notification Event
530 #define HCI_USER_PASSKEY_NOTIFICATION_EVENT 0x3B
531 
532 typedef struct {
533     HciBdAddr bdAddr;
534     uint32_t passkey;
535 } HciUserPasskeyNotificationEventParam;
536 
537 // BLUETOOTH SPECIFICATION Version 5.0 | Vol 2, Part E
538 // 7.7.49 Keypress Notification Event
539 #define HCI_KEYPRESS_NOTIFICATION_EVENT 0x3C
540 
541 typedef struct {
542     HciBdAddr bdAddr;
543     uint8_t notificationType;
544 } HciKeypressNotificationEventParam;
545 
546 // BLUETOOTH SPECIFICATION Version 5.0 | Vol 2, Part E
547 // 7.7.50 Remote Host Supported Features Notification Event
548 #define HCI_REMOTE_HOST_SUPPORTED_FEATURES_NOTIFICATION_EVENT 0x3D
549 
550 typedef struct {
551     HciBdAddr addr;
552     uint8_t hostSupportedFeatures[8];
553 } HciRemoteHostSupportedFeaturesNotificationEventParam;
554 
555 // BLUETOOTH SPECIFICATION Version 5.0 | Vol 2, Part E
556 // 7.7.51 Physical Link Complete Event
557 #define HCI_PHYSICAL_LINK_COMPLETE_EVENT 0x40
558 
559 typedef struct {
560     uint8_t status;
561     uint8_t physicalLinkHandle;
562 } HciPhysicalLinkCompleteEventParam;
563 
564 // BLUETOOTH SPECIFICATION Version 5.0 | Vol 2, Part E
565 // 7.7.52 Channel Selected Event
566 #define HCI_CHANNEL_SELECTED_EVENT 0x41
567 
568 typedef struct {
569     uint8_t physicalLinkHandle;
570 } HciChannelSelectedEventParam;
571 
572 // BLUETOOTH SPECIFICATION Version 5.0 | Vol 2, Part E
573 // 7.7.53 Disconnection Physical Link Complete Event
574 #define HCI_DISCONNECTION_PHYSICAL_LINK_COMPLETE_EVENT 0x42
575 
576 typedef struct {
577     uint8_t status;
578     uint8_t physicalLinkHandle;
579     uint8_t reason;
580 } HciDisconnectionPhysicalLinkCompleteEventParam;
581 
582 // BLUETOOTH SPECIFICATION Version 5.0 | Vol 2, Part E
583 // 7.7.54 Physical Link Loss Early Warning Event
584 #define HCI_PHYSICAL_LINK_LOSS_EARLY_WARNING_EVENT 0x43
585 
586 typedef struct {
587     uint8_t physicalLinkHandle;
588     uint8_t linkLossReason;
589 } HciPhysicalLinkLossEarlyWarningEventParam;
590 
591 // BLUETOOTH SPECIFICATION Version 5.0 | Vol 2, Part E
592 // 7.7.55 Physical Link Recovery Event
593 #define HCI_PHYSICAL_LINK_RECOVERY_EVENT 0x44
594 
595 typedef struct {
596     uint8_t physicalLinkHandle;
597 } HciPhysicalLinkRecoveryEventParam;
598 
599 // BLUETOOTH SPECIFICATION Version 5.0 | Vol 2, Part E
600 // 7.7.56 Logical Link Complete Event
601 #define HCI_LOGICAL_LINK_COMPLETE_EVENT 0x45
602 
603 typedef struct {
604     uint8_t status;
605     uint16_t logicalLinkHandle;
606     uint8_t physicalLinkHandle;
607     uint8_t txFlowSpecID;
608 } HciLogicalLinkCompleteEventParam;
609 
610 // BLUETOOTH SPECIFICATION Version 5.0 | Vol 2, Part E
611 // 7.7.57 Disconnection Logical Link Complete Event
612 #define HCI_DISCONNECTION_LOGICAL_LINK_COMPLETE_EVENT 0x46
613 
614 typedef struct {
615     uint8_t status;
616     uint16_t logicalLinkHandle;
617     uint8_t reason;
618 } HciDisconnectionLogicalLinkCompleteEventParam;
619 
620 // BLUETOOTH SPECIFICATION Version 5.0 | Vol 2, Part E
621 // 7.7.58 Flow Spec Modify Complete Event
622 #define HCI_FLOW_SPEC_MODIFY_COMPLETE_EVENT 0x47
623 
624 typedef struct {
625     uint8_t status;
626     uint16_t handle;
627 } HciFlowSpecModifyCompleteEventParam;
628 
629 // BLUETOOTH SPECIFICATION Version 5.0 | Vol 2, Part E
630 // 7.7.59 Number Of Completed Data Blocks Event
631 #define HCI_NUMBER_OF_COMPLETED_DATA_BLOCKS_EVENT 0x48
632 
633 typedef struct {
634     uint16_t handle;
635     uint16_t numOfCompletedPackets;
636     uint16_t numOfCompletedBlocks;
637 } HciNumberOfCompletedDataBlocks;
638 
639 typedef struct {
640     uint16_t totalNumDataBlocks;
641     uint8_t NumberofHandles;
642     HciNumberOfCompletedDataBlocks *responses;
643 } HciNumberOfCompletedDataBlocksEventParam;
644 
645 // BLUETOOTH SPECIFICATION Version 5.0 | Vol 2, Part E
646 // 7.7.60 Short Range Mode Change Complete Event
647 #define HCI_SHORT_RANGE_MODE_CHANGE_COMPLETE_EVENT 0x4C
648 
649 typedef struct {
650     uint8_t status;
651     uint8_t physicalLinkHandle;
652     uint8_t shortRangeModeState;
653 } HciShortRangeModeChangeCompleteEventParam;
654 
655 // BLUETOOTH SPECIFICATION Version 5.0 | Vol 2, Part E
656 // 7.7.61 AMP Status Change Event
657 #define HCI_AMP_STATUS_CHANGE_EVENT 0x4D
658 
659 typedef struct {
660     uint8_t status;
661     uint8_t ampStatus;
662 } HciAmpStatusChangeEventParam;
663 
664 // BLUETOOTH SPECIFICATION Version 5.0 | Vol 2, Part E
665 // 7.7.62 AMP Start Test Event
666 #define HCI_AMP_START_TEST_EVENT 0x49
667 
668 typedef struct {
669     uint8_t status;
670     uint8_t testScenario;
671 } HciAmpStartTestEventParam;
672 
673 // BLUETOOTH SPECIFICATION Version 5.0 | Vol 2, Part E
674 // 7.7.63 AMP Test End Event
675 #define HCI_AMP_TEST_END_EVENT 0x4A
676 
677 typedef struct {
678     uint8_t status;
679     uint8_t testScenario;
680 } HciAmpTestEndEventParam;
681 
682 // BLUETOOTH SPECIFICATION Version 5.0 | Vol 2, Part E
683 // 7.7.64 AMP Receiver Report Event
684 #define HCI_AMP_RECEIVER_REPORT_EVENT 0x4B
685 
686 typedef struct {
687     uint8_t controllerType;
688     uint8_t reason;
689     uint32_t eventType;
690     uint16_t numberOfFrames;
691     uint16_t numberOfErrorFrames;
692     uint32_t numberOfBits;
693     uint32_t numberOfErrorBits;
694 } HciAmpReceiverReportEventParam;
695 
696 // BLUETOOTH SPECIFICATION Version 5.0 | Vol 2, Part E
697 // 7.7.65 LE Meta Event
698 #define HCI_LE_META_EVENT 0x3E
699 
700 // BLUETOOTH SPECIFICATION Version 5.0 | Vol 2, Part E
701 // 7.7.66 Triggered Clock Capture Event
702 #define HCI_TRIGGERED_CLOCK_CAPTURE_EVENT 0x4E
703 
704 typedef struct {
705     uint16_t connectionHandle;
706     uint8_t whichClock;
707     uint32_t clock;
708     uint16_t slotOffset;
709 } HciTriggeredClockCaptureEventParam;
710 
711 // BLUETOOTH SPECIFICATION Version 5.0 | Vol 2, Part E
712 // 7.7.67 Synchronization Train Complete Event
713 #define HCI_SYNCHRONIZATION_TRAIN_COMPLETE_EVENT 0x4F
714 
715 typedef struct {
716     uint8_t status;
717 } HciSynchronizationTrainCompleteEventParam;
718 
719 // BLUETOOTH SPECIFICATION Version 5.0 | Vol 2, Part E
720 // 7.7.68 Synchronization Train Received Event
721 #define HCI_SYNCHRONIZATION_TRAIN_RECEIVED_EVENT 0x50
722 
723 typedef struct {
724     uint8_t status;
725     HciBdAddr bdAdddr;
726     uint32_t clockOffset;
727     uint8_t afhChannelMap[10];
728     uint8_t ltAddr;
729     uint32_t nextBroadcastInstant;
730     uint16_t connectionlessSlaveBroadcastInterval;
731     uint8_t serviceData;
732 } HciSynchronizationTrainReceivedEventParam;
733 
734 // BLUETOOTH SPECIFICATION Version 5.0 | Vol 2, Part E
735 // 7.7.69 Connectionless Slave Broadcast Receive Event
736 #define HCI_CONNECTIONLESS_SLAVE_BROADCAST_RECEIVE_EVENT 0x51
737 
738 typedef struct {
739     HciBdAddr bdAddr;
740     uint8_t ltAddr;
741     uint32_t clk;
742     uint32_t offset;
743     uint8_t receiveStatus;
744     uint8_t fragment;
745     uint8_t dataLength;
746     uint8_t *data;
747 } HciConnectionlessSlaveBroadcastReceiveEventParam;
748 
749 // BLUETOOTH SPECIFICATION Version 5.0 | Vol 2, Part E
750 // 7.7.70 Connectionless Slave Broadcast Timeout Event
751 #define HCI_CONNECTIONLESS_SLAVE_BROADCAST_TIMEOUT_EVENT 0x52
752 
753 typedef struct {
754     HciBdAddr bdAddr;
755     uint8_t ltAddr;
756 } HciConnectionlessSlaveBroadcastTimeoutEventParam;
757 
758 // BLUETOOTH SPECIFICATION Version 5.0 | Vol 2, Part E
759 // 7.7.71 Truncated Page Complete Event
760 #define HCI_TRUNCATED_PAGE_COMPLETE_EVENT 0x53
761 
762 typedef struct {
763     uint8_t status;
764     HciBdAddr bdAddr;
765 } HciTruncatedPageCompleteEventParam;
766 
767 // BLUETOOTH SPECIFICATION Version 5.0 | Vol 2, Part E
768 // 7.7.72 Slave Page Response Timeout Event
769 #define HCI_SLAVE_PAGE_RESPONSE_TIMEOUT_EVENT 0x54
770 
771 // BLUETOOTH SPECIFICATION Version 5.0 | Vol 2, Part E
772 // 7.7.73 Connectionless Slave Broadcast Channel Map Change Event
773 #define HCI_CONNECTIONLESS_SLAVE_BROADCAST_CHANNEL_MAP_CHANGE_EVENT 0x55
774 
775 typedef struct {
776     uint8_t channelMap[10];
777 } HciConnectionlessSlaveBroadcastChannelMapChangeEventParam;
778 
779 // BLUETOOTH SPECIFICATION Version 5.0 | Vol 2, Part E
780 // 7.7.74 Inquiry Response Notification Event
781 #define HCI_INQUIRY_RESPONSE_NOTIFICATION_EVENT 0x56
782 
783 typedef struct {
784     uint8_t lap : 3;
785     uint8_t rssi;
786 } HciInquiryResponseNotificationEventParam;
787 
788 // BLUETOOTH SPECIFICATION Version 5.0 | Vol 2, Part E
789 // 7.7.76 SAM Status Change Event
790 #define HCI_SAM_STATUS_CHANGE_EVENT 0x58
791 
792 typedef struct {
793     uint16_t connectionHandle;
794     uint8_t localSamIndex;
795     uint8_t localSamTxAvailability;
796     uint8_t localSamRxAvailability;
797     uint8_t remoteSamIndex;
798     uint8_t remoteSamTxAvailability;
799     uint8_t remoteSamRxAvailability;
800 } HciSamStatusChangeEventParam;
801 
802 #pragma pack(0)
803 
804 #ifdef __cplusplus
805 }
806 #endif
807 
808 #endif