-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathcy_ble_stack.h
2738 lines (2335 loc) · 129 KB
/
cy_ble_stack.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/*******************************************************************************
* \file cy_ble_stack.h
* \version 3.60
*
* \brief
* This file contains the BLE Stack, which will be updated on the Jenkins
* build and the common structures, APIs.
*
*******************************************************************************
* Copyright 2017-2021, Cypress Semiconductor Corporation. All rights reserved.
* You may use this file only in accordance with the license, terms, conditions,
* disclaimers, and limitations in the end user license agreement accompanying
* the software package with which this file was provided.
******************************************************************************/
#ifndef CY_BLE_STACK_H_
#define CY_BLE_STACK_H_
/***************************************
* Common stack includes
***************************************/
#ifdef CY_PSOC_CREATOR_USED
#include "syslib/cy_syslib.h"
#else
#include "cy_syslib.h"
#endif /* CY_PSOC_CREATOR_USED */
/* C binding of definitions if building with C++ compiler */
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
/***************************************
** Constants
***************************************/
/** BLE Stack Build Version Constants - It will be updated by Jenkins during build.*/
/** Major version number for device firmware. */
#define CY_BLE_STACK_MAJOR (5u)
/** Minor version number for device firmware. */
#define CY_BLE_STACK_MINOR (0u)
/** Patch version number for device firmware. */
#define CY_BLE_STACK_PATCH (10u)
/** Firmware build number. */
#define CY_BLE_STACK_BUILD (365u)
/** BT Address Size */
#define CY_BLE_BD_ADDR_SIZE (0x06u)
/** BLE Component ID */
#define CY_BLE_ID (0x05ul << 18u)
/** Memory pool configuration data defines*/
/** Size of internal data buffer structures */
#define CY_BLE_STACK_BUFFER_MGR_UTIL_RAM_SZ (0x1Cu)
/** Memory extension offset */
#define CY_BLE_MEM_EXT_SZ (0x08u)
/** Feature mask for 4.2 features */
/** DLE feature */
#define CY_BLE_DLE_FEATURE_MASK (0x01u)
/** Privacy 1.2 feature */
#define CY_BLE_PRIVACY_1_2_FEATURE_MASK (0x02u)
/** Secured connection feature */
#define CY_BLE_SECURE_CONN_FEATURE_MASK (0x04u)
/** Feature mask for Shanghai features */
#define CY_BLE_PHY_UPDATE_FEATURE_MASK (0x08u)
/** Feature mask for persistent Store */
/** Bonded Devices List */
#define CY_BLE_PERSISTENT_STORE_BONDLIST (0x10u)
/** Resolving List */
#define CY_BLE_PERSISTENT_STORE_RESOLVING_LIST (0x20u)
/** White List */
#define CY_BLE_PERSISTENT_STORE_WHITELIST (0x40u)
/** Radio power calibration*/
#define CY_BLE_PERSISTENT_RADIO_CALIBRATION_MASK (0x80u)
/** Feature mask bit-mask */
#define CY_BLE_FEATURE_BIT_MASK (0x0FFu)
/** Default RPA List Entry Size */
#define CY_BLE_DEFAULT_RPA_LIST_SZ (0x10u)
/** Default Bonded Devices List entry size */
#define CY_BLE_DEFAULT_BONDED_DEVICE_LIST_SZ (0x10u)
/** Resolving List memory computation
* CY_BLE_MAX_RESOLVABLE_DEVICES:
* It is user configured value for size of Resolving List using BLE PDL.
* Range: 1 to 16, 0 if Privacy 1.2 feature is not used.
* Memory required =
* (((CY_BLE_LL_PRIVACY_HEAP_REQ * CY_BLE_MAX_RESOLVABLE_DEVICES) +
CY_BLE_LL_PRIVACY_RETENTION_HEAP_REQ)
* Note:
* This configurable memory should be added to
* CY_BLE_CONTROLLER_DEVICE_SPECIFIC_HEAP_REQ
* static macro value passed to BLE Stack.
*/
/** Internal RAM required for Resolving List retention data
* structure
*/
#define CY_BLE_LL_PRIVACY_RETENTION_HEAP_REQ (0x0Cu)
/** Internal RAM required for single Resolving List entry
*/
#define CY_BLE_LL_PRIVACY_HEAP_REQ (0x44u)
/** White List list memory computation
* CY_BLE_MAX_WHITELIST_LIST_SZ:
* It is a user-configured value for the size of the White List using the BLE PDL.
* Range: 1 to 16.
* Memory required =
* (((CY_BLE_LL_ONE_WHITELIST_HEAP_REQ * CY_BLE_MAX_WHITELIST_LIST_SZ) +
CY_BLE_LL_WHITELIST_RETENTION_HEAP_REQ)
* Note:
* This configurable memory should be added to
* the CY_BLE_CONTROLLER_DEVICE_SPECIFIC_HEAP_REQ
* static macro value passed to the BLE Stack.
*/
/** Max WhiteList size that is supported by BLE Stack */
#define CY_BLE_MAX_WHITELIST_LIST_SZ (0x10u)
/** LL White List retention heap requirement */
#define CY_BLE_LL_WHITELIST_RETENTION_HEAP_REQ (0x08u)
/** LL White List size for one entity */
#define CY_BLE_LL_ONE_WHITELIST_HEAP_REQ (0x08u)
/** Convert Octets to Bits. */
#define CY_BLE_OCTETS_TO_BITS(octets) ((octets) << 3)
/** Convert LL Data Octets to Time in micro-seconds - 1Mbps */
#define CY_BLE_DATA_OCTETS_TO_US_1MBPS(octets) (CY_BLE_OCTETS_TO_BITS((octets) + 14))
/** Convert LL Data Octets to Time in micro-seconds - 2Mbps */
#define CY_BLE_DATA_OCTETS_TO_US_2MBPS(octets) (CY_BLE_OCTETS_TO_BITS(((octets) + 15) >> 1))
/** Total Command Buffers Chunks for Command Buffer Pool */
#define CY_BLE_BT_FW_LE_CMD_BUFFERS (0x05u)
/** Event Buffer Pool 1 */
#define CY_BLE_BT_FW_LE_EVENT_TYPE1_BUFFERS (0x01u)
/** Event Buffer Pool 2 */
#define CY_BLE_BT_FW_LE_EVENT_TYPE2_BUFFERS (0x08u)
/** Per Connection LL Control PDU Size for Tx */
#define CY_BLE_BT_FW_TX_LL_PDU_Q_SZ (0x02u)
/** Per Connection LL Control PDU Size for Rx */
#define CY_BLE_BT_FW_RX_LL_PDU_Q_SZ (0x02u)
/** Firmware total LE pdu packets */
#define CY_BLE_BT_FW_LE_TOTAL_PDU_PKTS (CY_BLE_BT_FW_TX_LL_PDU_Q_SZ + \
CY_BLE_BT_FW_RX_LL_PDU_Q_SZ)
/** Encryption and Connection Parameter Update */
#define CY_BLE_BT_FW_LE_TXN_BUFFERS (0x02u)
/** HCI Command Buffers per single Command Buffer Pool*/
#define CY_BLE_HCI_LE_CMD_BUFFER_SZ (0x50u)
/** Event packet size
* Max size for HCI LE event is 64 bytes
* Total size = 2 * (64 + 4(Event Header) + 4)
*/
#define CY_BLE_HCI_LE_EVENT_BUFFER_POOL_TYPE1_SZ (0x48u)
/** Event buffer pool for rest of the LE single mode events.*/
#define CY_BLE_HCI_LE_EVENT_BUFFER_POOL_TYPE2_SZ (0x30u)
/**
* LL Control PDU Buffer Size per connection
*/
#define CY_BLE_LL_PDU_MAX_BUFFER_SZ (0x20u)
/** LL transaction buffer size */
#define CY_BLE_LL_LE_TXN_BUFFER_SZ (0x40u)
/** Memory pool item size*/
#define CY_BLE_MEM_POOL_ITEM_SZ (0x04u)
/** BLE DLE device param size */
#define CY_BLE_DLE_DEVICE_PARAM_SZ (0x10u)
/** Controller per-connection data struct heap size */
#define CY_BLE_CONTROLLER_PER_CONN_DATA_STRUCT_HEAP_SZ (0x0110u)
/** Heap Reserve for Controller */
#define CY_BLE_BT_FW_HEAP_RESERVE_REQ (0x80u)
/** Device Specific Pool Memory for BLESS RX FIFO, HCI Command and
* HCI Events memory
*/
#define CY_BLE_BT_FW_DEV_SPECIFIC_POOL_REQ (CY_BLE_BT_FW_RX_ACL_MEM_POOL_REQ + \
CY_BLE_BT_FW_CMD_MEM_POOL_REQ + \
CY_BLE_BT_FW_EVENT_MEM_POOL_REQ)
/** Device specific controller heap requirement */
#define CY_BLE_CONTROLLER_DEVICE_SPECIFIC_HEAP_REQ \
((CY_BLE_BT_FW_LE_EVENT_TYPE1_BUFFERS * \
(CY_BLE_HCI_LE_EVENT_BUFFER_POOL_TYPE1_SZ + CY_BLE_MEM_POOL_ITEM_SZ)) + \
(CY_BLE_BT_FW_LE_EVENT_TYPE2_BUFFERS * \
(CY_BLE_HCI_LE_EVENT_BUFFER_POOL_TYPE2_SZ + CY_BLE_MEM_POOL_ITEM_SZ)) + \
(CY_BLE_BT_FW_LE_CMD_BUFFERS * \
(CY_BLE_HCI_LE_CMD_BUFFER_SZ + CY_BLE_MEM_POOL_ITEM_SZ)) + \
((CY_BLE_STACK_BUFFER_MGR_UTIL_RAM_SZ * \
CY_BLE_BT_FW_DEV_SPECIFIC_POOL_REQ) + \
CY_BLE_BT_FW_HEAP_RESERVE_REQ))
/** Configurable Memory for Stack Manager Buffer Pool Data Structures for
* buffer pools that are created and maintained.
*/
/** Tx acl memory requirement */
#define CY_BLE_BT_FW_TX_ACL_MEM_POOL_REQ (0x01u)
/** Firmware pdu memory requirement */
#define CY_BLE_BT_FW_PDU_MEM_POOL_REQ (0x02u)
/** Firmware transaction memory requirement */
#define CY_BLE_BT_FW_TXN_MEM_POOL_REQ (0x01u)
/** Heap required to for buffer pools that are created per connection
* Formula for total pools:
* (4 <Tx, Tx LL, Rx LL, LL Transaction Pool> * no. of connections)
*/
#define CY_BLE_BT_FW_CONN_SPECIFIC_POOL_REQ (CY_BLE_BT_FW_TX_ACL_MEM_POOL_REQ + \
CY_BLE_BT_FW_PDU_MEM_POOL_REQ + \
CY_BLE_BT_FW_TXN_MEM_POOL_REQ)
/** Controller connection specific heap requirement */
#define CY_BLE_CONTROLLER_CONN_SPECIFIC_HEAP_REQ \
((CY_BLE_BT_FW_LE_TOTAL_PDU_PKTS * \
(CY_BLE_LL_PDU_MAX_BUFFER_SZ + CY_BLE_MEM_POOL_ITEM_SZ)) + \
(CY_BLE_BT_FW_LE_TXN_BUFFERS * \
(CY_BLE_LL_LE_TXN_BUFFER_SZ + CY_BLE_MEM_POOL_ITEM_SZ)) + \
(CY_BLE_BT_FW_CONN_SPECIFIC_POOL_REQ * \
CY_BLE_STACK_BUFFER_MGR_UTIL_RAM_SZ) + \
(CY_BLE_CONTROLLER_PER_CONN_DATA_STRUCT_HEAP_SZ))
/** Rx acl memory requirement */
#define CY_BLE_BT_FW_RX_ACL_MEM_POOL_REQ (0x01u)
/** Firmware command memory requirement */
#define CY_BLE_BT_FW_CMD_MEM_POOL_REQ (0x01u)
/** Firmware event memory requirement */
#define CY_BLE_BT_FW_EVENT_MEM_POOL_REQ (0x02u)
/** Size of the heap when the BLE Stack is built in HCI mode */
#define CY_BLE_DEFAULT_CONTROLLER_RAM_SIZE (0u)
/** Default Max ACL Packet Size for LE-DATA packet both for */
#define CY_BLE_LL_DEFAULT_MAX_SUPPORTED_ACL_BUFFER_SZ (0xFCu)
/** Default Max ACL Packet Size for Rx LE-DATA Packet
* Formula: Default ACL Size (27 bytes) ~ AlignToWord(27) = 28
*/
#define CY_BLE_LL_DEFAULT_ACL_MAX_RX_BUFFER_SZ (0x1Cu)
/** 8 Additional Bytes = (4 bytes of MIC + 4 bytes of HCI header) */
#define CY_BLE_LL_ACL_DATA_PACKET_OVERHEAD_SZ (0x08u)
/** Number of Rx ACL Packet buffers, this shall not change
* as this should not be user configurable parameter
*/
#define CY_BLE_LL_DEFAULT_NUM_ACL_RX_PACKETS (0x04u)
/** Number of Tx ACL Packet buffers */
#define CY_BLE_LL_DEFAULT_NUM_ACL_TX_PACKETS (0x03u)
/** Default Tx capability. If DLE is not enabled, this is Tx capability*/
#define CY_BLE_LL_DEFAULT_TX_CAPABILITY (0x1Bu)
/** Default Rx capability. If DLE is not enabled, this is Rx capability*/
#define CY_BLE_LL_DEFAULT_RX_CAPABILITY (0x1Bu)
/** Default Tx capability. If DLE is not enabled, this is Tx capability*/
#define CY_BLE_MAX_DEFAULT_TX_CAPABILITY (0xFBu)
/** Default Rx capability. If DLE is not enabled, this is Rx capability*/
#define CY_BLE_MAX_DEFAULT_RX_CAPABILITY (0xFBu)
/** Internal heap required for LE Data Length Extension Feature Per
* Connection
*/
#define CY_BLE_LL_DLE_HEAP_REQ (0x40u)
/** DLE heap required for device specific parameters */
#define CY_BLE_LL_DLE_DEVICE_PARAM_HEAP_REQ (0x10u)
/** Default RPA List Entry Size */
#define CY_BLE_MAX_RPA_LIST_SZ (0x10u)
/** IPC pipe client IDs for BLE */
#define CY_BLE_PIPE_BLE_MSG_COMPLETE_ID (0u) /**< msg complete */
#define CY_BLE_PIPE_BLE_MSG_SEND_ID (1u) /**< msg send */
/** Mask to disable all events */
#define CY_BLE_DISABLE_ALL_EVENTS_MASK (0x00u)
/** Mask to Enable connection established events */
#define CY_BLE_CONN_ESTB_EVENT_MASK (0x01u)
/** Mask to Enable advertisement packet sent events */
#define CY_BLE_ADV_TX_EVENT_MASK (0x02u)
/** Length of mask byte array */
#define CY_BLE_EVENT_MASK_LENGTH (1u)
/** Event Mask index 0 */
#define CY_BLE_EVENT_MASK_INDEX_0 (0u)
/** Number of configurable Radio PA Lobuff parameters */
#define CY_BLE_MXD_PA_NUM_LOBUFF_VALS (4u)
/** Number of configurable Radio PA Target parameters */
#define CY_BLE_MXD_PA_NUM_TARGET_VALS (7u)
/** Number of configurable Radio PA LDO parameters */
#define CY_BLE_MXD_PA_NUM_LDO_SETTINGS (4u)
/***************************************
** Enumerated Types
***************************************/
/**
\addtogroup group_ble_common_api_events
@{
*/
/** BLE stack events */
typedef enum
{
/** This event is triggered by the BLE stack when the BLE Stack is in a bad state. Restarting the BLE Stack is the
* only way to get out of this state
*/
CY_BLE_EVT_INVALID = 0x0000u,
/* Range for Generic events - 0x1000 to 0x1FFF */
/** This event is received when the BLE stack is initialized and turned ON by invoking the Cy_BLE_StackInit() function.*/
CY_BLE_EVT_STACK_ON = 0x1000u,
/** This event is received when there is a timeout and the application must handle the event.
* Event parameter is of type 'cy_stc_ble_timeout_param_t'.
* - If reasonCode is 'CY_BLE_GATT_RSP_TO', then look for connHandle.
* - If reasonCode is 'CY_BLE_GENERIC_APP_TO', then look for timerHandle.
* - For all other cases connHandle or timerHandle is ignored
*/
CY_BLE_EVT_TIMEOUT, /* 0x1001u */
/** This event is triggered by BLE Stack to indicate if the BLE stack is busy or not.
* The Event Parameter corresponding to this event will indicate the state of BLE stack's internal protocol buffers
* for the application to safely initiate data transactions (GATT, GAP Security, and L2CAP transactions)
* with the peer BLE device.
* Event parameter is of type cy_stc_ble_l2cap_state_info_t.
* cy_stc_ble_l2cap_state_info_t contains flowState and Bd handle as parameters
* flowState indicates the following state:
* CY_BLE_STACK_STATE_BUSY (0x01) = CY_BLE_STACK_STATE_BUSY indicates to the application that the BLE Stack's internal buffers
* are about to be filled, and the remaining buffers are required to respond to the peer BLE device.
* After this event, the application shall not initiate GATT, GAP Security, or L2CAP data transactions.
* However, the application shall respond to peer initiated transactions to prevent BLE protocol timeouts.
* Application initiated data transactions can be resumed after the CY_BLE_EVT_STACK_BUSY_STATUS event with
* parameter 'CY_BLE_STACK_STATE_FREE' is received.
*
* CY_BLE_STACK_STATE_FREE (0x00) = CY_BLE_STACK_STATE_FREE indicates to the application that pending transactions are completed
* and sufficient buffers are available to process application-initiated transactions.
* The 'CY_BLE_EVT_STACK_BUSY_STATUS' event with 'CY_BLE_STACK_STATE_FREE' indicates to the
* application whether the BLE Stack's internal buffer state has transitioned from 'CY_BLE_STACK_STATE_BUSY'
* to 'CY_BLE_STACK_STATE_FREE'.
*
* Bd handle indicates connection.
* To increase the BLE Stack's default queue depth(CY_BLE_L2CAP_STACK_Q_DEPTH_PER_CONN) and achieve better throughput for the attribute MTU greater than 32,
* use the AddQdepthPerConn parameter in the 'Expression View' of the Advanced tab in the BLE component GUI. To Access the 'Expression View', right click on
* the 'Advanced' tab in th BLE Component GUI and select the 'Show Expression View' option.
*/
CY_BLE_EVT_STACK_BUSY_STATUS, /* 0x1002u */
/** This event is received when the BLE Stack wants the application to provide memory to process a remote request.
* The event parameter is of type cy_stc_ble_memory_request_t.
* This event is automatically handled by the BLE Component for the CY_BLE_PREPARED_WRITE_REQUEST request.
* The BLE Component allocates sufficient memory for the long write request with the assumption that attribute MTU size
* is negotiated to the minimum possible value. The application could use dynamic memory allocation to save static
* RAM memory consumption. To enable this event for the application level, set the EnableExternalPrepWriteBuff parameter
* in the Expression view of the Advanced tab to be true.
*/
CY_BLE_EVT_MEMORY_REQUEST, /* 0x1003u */
/** This event is used to inform the application that a Flash write is pending.
* This event is generated by the BLE Stack whenever its internal data structures
* are modified and require back up.
*/
CY_BLE_EVT_PENDING_FLASH_WRITE, /* 0x1004u */
/** This event is used to inform the application that persistent data stored in Flash memory is corrupted */
CY_BLE_EVT_FLASH_CORRUPT, /* 0x1005u */
/* Range for HCI events - 0x2000 to 0x2FFF */
/** This event indicates that some internal hardware error has occurred.
* Reset of the hardware may be required.
* Event parameter returned with this event is of (uint8 *) type. The possible error codes for this event are defined
* in cy_ble_stack_host_error.h file.
*/
CY_BLE_EVT_HARDWARE_ERROR = 0x2000,
/** This event is triggered on successful setting of Authentication Payload timeout in the BLE Stack for
* LE_PING feature. Refer to Bluetooth 4.1 core specification, Volume 6, Part B,
* section 4.6.5 for LE Ping operation.
* Event parameter returned with this event is of (cy_stc_ble_events_param_generic_t*) type.
* There are two members of the structure pointed to by the event parameter: status (uint8_t) and eventParams (void *).
* eventParams must be cast to (uint8_t *) to access the pointer to the bdHandle corresponding to this event.
* eventParams is valid only if status is success (0x00)
*/
CY_BLE_EVT_WRITE_AUTH_PAYLOAD_TO_COMPLETE, /* 0x2001u */
/** This event carries Authentication Payload timeout in the BLE Stack for the LE_PING feature.
* Refer to Bluetooth 4.1 core specification, Volume 6, Part B, section 4.6.5 for LE Ping operation.
* Event parameter returned with this event is of (cy_stc_ble_events_param_generic_t*) type.
* There are two members of the structure pointed to by the event parameter: status (uint8_t) and eventParams (void *).
* eventParams must be cast to (cy_stc_ble_auth_payload_info_t*) to access the authentication payload information.
* eventParams is valid only if status is success (0x00)
*/
CY_BLE_EVT_READ_AUTH_PAYLOAD_TO_COMPLETE, /* 0x2002u */
/** This event indicates a channel map corresponding to one connection.
* Event parameter returned with this event is of (cy_stc_ble_events_param_generic_t*) type.
* There are two members of the structure pointed to by the event parameter: status (uint8_t) and eventParams (void *).
* eventParams must be cast to (cy_stc_ble_channel_map_info_t*) to access Channel Map Parameters Information.
* eventParams is valid only if status is success (0x00)
*/
CY_BLE_EVT_GET_CHANNEL_MAP_COMPLETE, /* 0x2003u */
/** This event indicates completion of the Set LE event mask.
* Event parameter returned with this event is of (cy_stc_ble_events_param_generic_t*) type.
* There are two members of the structure pointed to by the event parameter: status (uint8_t) and eventParams (void *).
* eventParams must be ignored.
*/
CY_BLE_EVT_LE_SET_EVENT_MASK_COMPLETE, /* 0x2004u */
/** This event indicates that the peer device has not responded
* with the valid MIC packet within the application configured ping authentication time.
*/
CY_BLE_EVT_LE_PING_AUTH_TIMEOUT, /* 0x2005u */
/** This event indicates completion of the Set data length command.
* Event parameter returned with this event is of (cy_stc_ble_events_param_generic_t*) type.
* There are two members of the structure pointed to by the event parameter: status (uint8_t) and eventParams (void *).
* eventParams must be cast to (uint8_t *) to access the pointer to the bdHandle corresponding to this event.
* eventParams is valid only if status is success (0x00)
*/
CY_BLE_EVT_SET_DATA_LENGTH_COMPLETE, /* 0x2006u */
/** This event indicates completion of Set suggested data length command.
* Event parameter returned with this event is of (cy_stc_ble_events_param_generic_t*) type.
* There are two members of the structure pointed to by the event parameter: status (uint8_t) and eventParams (void *).
* eventParams must be ignored.
*/
CY_BLE_EVT_SET_SUGGESTED_DATA_LENGTH_COMPLETE, /* 0x2007u */
/** This event indicates completion of Cy_BLE_GetDataLength() function.
* Event parameter returned with this event is of (cy_stc_ble_events_param_generic_t*) type.
* There are two members of the structure pointed to by the event parameter: status (uint8_t) and eventParams (void *).
* eventParams must be cast to (cy_stc_ble_data_length_param_t*) to access the locally
* suggested tx/rx octets and tx/rx time and the maximum supported tx/rx octets and tx/rx time.
* eventParams is valid only if status is success (0x00)
*/
CY_BLE_EVT_GET_DATA_LENGTH_COMPLETE, /* 0x2008u */
/** This event notifies the Host of a change to either the maximum Payload length or
* the maximum transmission time of Data Channel PDUs in either direction. The values reported are the maximum
* that will actually be used on the connection following the change.
* The event parameter is of type 'cy_stc_ble_data_length_change_event_param_t'
*/
CY_BLE_EVT_DATA_LENGTH_CHANGE, /* 0x2009u */
/** This event indicates peer resolvable private address currently used by the BLE Stack.
* Event parameter returned with this event is of (cy_stc_ble_events_param_generic_t*) type.
* There are two members of the structure pointed to by the event parameter: status (uint8_t) and eventParams (void *).
* eventParams must be cast to (uint8_t*) to access the pointer to the peer resolvable address.
* eventParams is valid only if status is success (0x00)
*/
CY_BLE_EVT_GET_PEER_RPA_COMPLETE, /* 0x200Au */
/** This event indicates local resolvable private address currently used by the BLE Stack.
* Event parameter returned with this event is of (cy_stc_ble_events_param_generic_t*) type.
* There are two members of the structure pointed to by the event parameter: status (uint8_t) and eventParams (void *).
* eventParams must be cast to (uint8_t*) to access the pointer to the local resolvable address.
* eventParams is valid only if status is success (0x00)
*/
CY_BLE_EVT_GET_LOCAL_RPA_COMPLETE, /* 0x200Bu */
/** This event indicates completion of the Set RPA timeout command.
* Event parameter returned with this event is of (cy_stc_ble_events_param_generic_t*) type.
* There are two members of the structure pointed to by the event parameter: status (uint8_t) and eventParams (void *).
* eventParams must be ignored.
*/
CY_BLE_EVT_SET_RPA_TO_COMPLETE, /* 0x200Cu */
/** This event indicates completion of Set RPA enable command.
* Event parameter returned with this event is of (cy_stc_ble_events_param_generic_t*) type.
* There are two members of the structure pointed to by the event parameter: status (uint8_t) and eventParams (void *).
* eventParams must be ignored.
*/
CY_BLE_EVT_SET_RPA_ENABLE_COMPLETE, /* 0x200Du */
/** This event indicates completion of the Set host channel command.
* Event parameter returned with this event is of (cy_stc_ble_events_param_generic_t*) type.
* There are two members of the structure pointed to by the event parameter: status (uint8_t) and eventParams (void *).
* eventParams must be ignored.
*/
CY_BLE_EVT_SET_HOST_CHANNEL_COMPLETE, /* 0x200Eu */
/** This event indicates completion of the add device to Resolving List command.
* Event parameter returned with this event is of (cy_stc_ble_events_param_generic_t*) type.
* There are two members of the structure pointed to by the event parameter: status (uint8_t) and eventParams (void *).
* eventParams must be ignored.
*/
CY_BLE_EVT_ADD_DEVICE_TO_RPA_LIST_COMPLETE, /* 0x200Fu */
/** This event indicates completion of the remove device from Resolving List command.
* Event parameter returned with this event is of (cy_stc_ble_events_param_generic_t*) type.
* There are two members of the structure pointed to by the event parameter: status (uint8_t) and eventParams (void *).
* eventParams must be ignored.
*/
CY_BLE_EVT_REMOVE_DEVICE_FROM_RPA_LIST_COMPLETE, /* 0x2010u */
/** This event indicates completion of the add device to White List command.
* Event parameter returned with this event is of (cy_stc_ble_events_param_generic_t*) type.
* There are two members of the structure pointed to by the event parameter: status (uint8_t) and eventParams (void *).
* eventParams must be ignored.
*/
CY_BLE_EVT_ADD_DEVICE_TO_WHITE_LIST_COMPLETE, /* 0x2011u */
/** This event indicates completion of the remove device from the White List command.
* Event parameter returned with this event is of (cy_stc_ble_events_param_generic_t*) type.
* There are two members of the structure pointed to by the event parameter: status (uint8_t) and eventParams (void *).
* eventParams must be ignored.
*/
CY_BLE_EVT_REMOVE_DEVICE_FROM_WHITE_LIST_COMPLETE, /* 0x2012u */
/** This event indicates completion of the Cy_BLE_GetPhy() function.
* Event parameter returned with this event is of (cy_stc_ble_events_param_generic_t*) type.
* There are two members of the structure pointed to by the event parameter: status (uint8_t) and eventParams (void *).
* eventParams must be cast to (cy_stc_ble_phy_param_t*) type to access the TX and RX PHY Mask as well as the
* bdHandle corresponding to the connection for which this information is being returned.
* eventParams is valid only if status is success(0x00)
*/
CY_BLE_EVT_GET_PHY_COMPLETE, /* 0x2013u */
/** This event indicates completion of the Cy_BLE_SetDefaultPhy() function.
* Event parameter returned with this event is of (cy_stc_ble_events_param_generic_t*) type.
* There are two members of the structure pointed to by the event parameter: status (uint8_t) and eventParams (void *).
* eventParams must be ignored.
*/
CY_BLE_EVT_SET_DEFAULT_PHY_COMPLETE, /* 0x2014u */
/** This event indicates completion of the Cy_BLE_SetPhy() function.
* Event parameter returned with this event is of (cy_stc_ble_events_param_generic_t*) type.
* There are two members of the structure pointed to by the event parameter: status (uint8_t) and eventParams (void *).
* eventParams must be ignored.
*/
CY_BLE_EVT_SET_PHY_COMPLETE, /* 0x2015u */
/** This event indicates that the Controller has changed the transmitter PHY or receiver PHY in use.
* Event parameter returned with this event is of (cy_stc_ble_events_param_generic_t*) type.
* There are two members of the structure pointed to by the event parameter: status (uint8_t) and eventParams (void *).
* eventParams must be cast to (cy_stc_ble_phy_param_t*) type to access the TX and RX PHY Mask as well as the
* bdHandle corresponding to the connection for which this information is being returned.
* eventParams is valid only if status is success(0x00)
*/
CY_BLE_EVT_PHY_UPDATE_COMPLETE, /* 0x2016u */
/** This event indicates completion of the set privacy mode command.
* Event parameter returned with this event is of (cy_stc_ble_events_param_generic_t*) type.
* There are two members of the structure pointed to by the event parameter: status (uint8_t) and eventParams (void *).
* eventParams must be ignored.
*/
CY_BLE_EVT_SET_PRIVACY_MODE_COMPLETE, /* 0x2017u */
/* Range for vendor events - 0x3000 to 0x3FFF */
/** This event indicates completion of the Cy_BLE_IsLlControlProcPending() function.
* Event parameter returned with this event is of (cy_stc_ble_events_param_generic_t*) type.
* There are two members of the structure pointed to by the event parameter: status (uint8_t) and eventParams (void *).
* eventParams must be cast to (cy_stc_ble_ll_cntrl_proc_param_t*) type to access the status of the
* control procedure (cntrlProcStatus) as well as the bdHandle corresponding to the connection
* for which this information is being returned.
* eventParams is valid only if status is success(0x00)
*/
CY_BLE_EVT_LL_CNTRL_PROC_PENDING_COMPLETE = 0x3000u,
/** This event indicates a soft reset completed successfully.
* The event parameter is NULL.
*/
CY_BLE_EVT_SOFT_RESET_COMPLETE, /* 0x3001u */
/** This event indicates that the set device address command has completed.
* Event parameter returned with this event is of (cy_stc_ble_events_param_generic_t*) type.
* There are two members of the structure pointed to by the event parameter: status (uint8_t) and eventParams (void *).
* eventParams must be ignored.
*/
CY_BLE_EVT_SET_DEVICE_ADDR_COMPLETE, /* 0x3002u */
/** This event indicates that the get device address command has completed.
* Event parameter returned with this event is of (cy_stc_ble_events_param_generic_t*) type.
* There are two members of the structure pointed to by the event parameter: status (uint8_t) and eventParams (void *).
* eventParams must be cast to (cy_stc_ble_bd_addrs_t*) type to access the public and private
* Bluetooth Device Addresses.
* eventParams is valid only if status is success(0x00)
*/
CY_BLE_EVT_GET_DEVICE_ADDR_COMPLETE, /* 0x3003u */
/** This event indicates that the get RSSI command has completed.
* Event parameter returned with this event is of (cy_stc_ble_events_param_generic_t*) type.
* There are two members of the structure pointed to by the event parameter: status (uint8_t) and eventParams (void *).
* eventParams must be cast to (cy_stc_ble_rssi_info_t*) type to access the RSSI value as well as the
* bdHandle corresponding to the connection for which this information is being returned.
* eventParams is valid only if status is success(0x00)
*/
CY_BLE_EVT_GET_RSSI_COMPLETE, /* 0x3004u */
/** This event indicates that the get Tx Power command has completed.
* Event parameter returned with this event is of (cy_stc_ble_events_param_generic_t*) type.
* There are two members of the structure pointed to by the event parameter: status (uint8_t) and eventParams (void *).
* eventParams must be cast to (cy_stc_ble_tx_pwr_lvl_info_t*) type to access the TX power level
* eventParams is valid only if status is success (0x00)
* bdHandle is valid only if bleSsChId is CY_BLE_LL_CONN_CH_TYPE
*/
CY_BLE_EVT_GET_TX_PWR_COMPLETE, /* 0x3005u */
/** This event indicates that the set Tx Power command has completed .
* Event parameter returned with this event is of (cy_stc_ble_events_param_generic_t*) type.
* There are two members of the structure pointed to by the event parameter: status (uint8_t) and eventParams (void *).
* eventParams must be cast to (cy_stc_ble_tx_pwr_config_param_t*) type to access the powerConfig.
* eventParams is valid only if status is success (0x00)
*/
CY_BLE_EVT_SET_TX_PWR_COMPLETE, /* 0x3006u */
/** This event indicates that the get clock config command has completed.
* Event parameter returned with this event is of (cy_stc_ble_events_param_generic_t*) type.
* There are two members of the structure pointed to by the event parameter: status (uint8_t) and eventParams (void *).
* eventParams must be cast to (cy_stc_ble_bless_clk_cfg_params_t*) type to access the BLE clock
* configuration parameters.
* eventParams is valid only if status is success(0x00)
*/
CY_BLE_EVT_GET_CLK_CONFIG_COMPLETE, /* 0x3007u */
/** This event indicates that the set clock config command has completed.
* Event parameter returned with this event is of (cy_stc_ble_events_param_generic_t*) type.
* There are two members of the structure pointed to by the event parameter: status (uint8_t) and eventParams (void *).
* eventParams must be ignored.
*/
CY_BLE_EVT_SET_CLK_CONFIG_COMPLETE, /* 0x3008u */
/** This event indicates that the random number generation command has completed successfully.
* The event parameter is Pointer to a buffer of size 8 bytes
*/
CY_BLE_EVT_RANDOM_NUM_GEN_COMPLETE, /* 0x3009u */
/** This event indicates that the AES encrypt command has completed.
* Event parameter returned with this event is of (cy_stc_ble_events_param_generic_t*) type.
* There are two members of the structure pointed to by the event parameter: status (uint8_t) and eventParams (void *).
* eventParams must be cast to (uint8_t*) to access the pointer to the encrypted data (128-bit).
* eventParams is valid only if status is success(0x00)
*/
CY_BLE_EVT_AES_ENCRYPT_COMPLETE, /* 0x300Au */
/** This event indicates that the AES CCM encrypt command has completed.
* Event parameter returned with this event is of (cy_stc_ble_events_param_generic_t*) type.
* There are two members of the structure pointed to by the event parameter: status (uint8_t) and eventParams (void *).
* eventParams must be cast to (cy_stc_ble_aes_ccm_param_t*) type to access the AES CCM encrypted
* data information.
* eventParams is valid only if status is success(0x00)
*/
CY_BLE_EVT_AES_CCM_ENCRYPT_COMPLETE, /* 0x300Bu */
/** This event indicates that the AES CCM decrypt command has completed.
* Event parameter returned with this event is of (cy_stc_ble_events_param_generic_t*) type.
* There are two members of the structure pointed to by the event parameter: status (uint8_t) and eventParams (void *).
* eventParams must be cast to (cy_stc_ble_aes_ccm_param_t*) type to access the AES CCM decrypted
* data information.
* eventParams is valid only if status is success(0x00).eventParams->mic to be ignored.
*/
CY_BLE_EVT_AES_CCM_DECRYPT_COMPLETE, /* 0x300Cu */
/* 0x300Du -> Reserved for future*/
/* 0x300Eu -> Reserved for future*/
/* 0x300Fu -> Reserved for future*/
/* 0x3010u -> Reserved for future*/
/** This event is triggered for Cy_BLE_SetSlaveLatencyMode() function.
* Event parameter returned with this event is of (cy_stc_ble_events_param_generic_t*) type.
* There are two members of the structure pointed to by the event parameter: status (uint8_t) and eventParams (void *).
* eventParams must be cast to (uint8_t *) to access the pointer to the bdHandle corresponding to this event.
* eventParams is valid only if status is success(0x00)
*/
CY_BLE_EVT_SET_SLAVE_LATENCY_MODE_COMPLETE = 0x3011u, /* 0x3011u */
/** This event is used to inform the application that BLE Stack Shutdown is complete. However, the application shall
* wait for at least 10ms, before calling the Cy_BLE_Start() API, after receiving this event.
* The event parameter returned along with this event is NULL.
*/
CY_BLE_EVT_STACK_SHUTDOWN_COMPLETE, /* 0x3012u */
/** This event is used to inform the application of temperature data as measured. Event parameter is of
* (cy_stc_ble_events_param_generic_t*) type. There are two members of the structure pointed to by
* the event parameter: status (uint8_t) and eventParams (void *). eventParams must be cast to
* (uint16_t *) to access the pointer to the radio temparature level in degree Celsius.
*/
CY_BLE_EVT_RADIO_TEMPERATURE, /* 0x3013u */
/** This event is used to inform the application of voltage data as measured. Event parameter is of
* (cy_stc_ble_events_param_generic_t*) type. There are two members of the structure pointed to by
* the event parameter: status (uint8_t) and eventParams (void *). eventParams must be cast to
* (uint16_t *) to access the pointer to the radio voltage level in mV.
*/
CY_BLE_EVT_RADIO_VOLTAGE_LEVEL, /* 0x3014u */
/** This event is used to inform the application that the AES CMAC generation is completed
* Event parameter returned with this event is of (cy_stc_ble_events_param_generic_t*) type.
* There are two members of the structure pointed to by the event parameter: status (uint8_t) and eventParams (void *).
* eventParams must be ignored.
*/
CY_BLE_EVT_AES_CMAC_GEN_COMPLETE, /* 0x3015 */
/** This event is triggered on completion of setting vendor event mask.
* Event parameter returned with this event is of (cy_stc_ble_events_param_generic_t*) type.
* There are two members of the structure pointed to by the event parameter: status (uint8_t) and eventParams (void *).
* status is valid, eventParams must be ignored
*/
CY_BLE_EVT_SET_EVENT_MASK_COMPLETE, /* 0x3016u */
/** This event is triggered on completion of setting vendor event mask.
* Event parameter returned with this event is of (cy_stc_ble_events_param_generic_t*) type.
* There are two members of the structure pointed to by the event parameter: status (uint8_t) and eventParams (void *).
* eventParams must be cast to (uint8_t *) to access the pointer to the bdHandle corresponding to this event.
* eventParams is valid only if status is success(0x00)
*/
CY_BLE_EVT_SET_CE_LENGTH_COMPLETE, /* 0x3017u */
/** This event is triggered on completion of setting vendor event mask.
* Event parameter returned with this event is of (cy_stc_ble_events_param_generic_t*) type.
* There are two members of the structure pointed to by the event parameter: status (uint8_t) and eventParams (void *).
* eventParams must be cast to (uint8_t *) to access the pointer to the bdHandle corresponding to this event.
* eventParams is valid only if status is success(0x00)
*/
CY_BLE_EVT_SET_CONN_PRIORITY_COMPLETE, /* 0x3018u */
/** This event is used to inform application that an HCI event (or ACL packet) has been received
* from controller. Event parameter returned with this event is pointer to a parameter of
* type 'cy_stc_ble_hci_tx_packet_info_t'. This event will only be triggered when the application
* enables software transport mode for HCI by calling the Cy_BLE_SoftHciTransportEnable() API.
*/
CY_BLE_EVT_HCI_PKT_RCVD, /* 0x3019u */
/* Range for GAP events - 0x4000 to 0x4FFF */
/** This event is triggered every time a device is discovered. A pointer to structure of type
* cy_stc_ble_gapc_adv_report_param_t is returned as the event parameter.
*/
CY_BLE_EVT_GAPC_SCAN_PROGRESS_RESULT = 0x4000u,
/** This event can be received by a device in Peripheral or Central role. When it is received by a device in a
* Peripheral role, it must Call Cy_BLE_GAPP_AuthReqReply() to reply to the authentication request
* from Central. When this event is received by a device in a Central role, it means that the Peripheral
* has requested Central to initiate authentication procedure. The device must call Cy_BLE_GAP_AuthReq()
* to initiate the authentication procedure.
* A pointer to structure of type cy_stc_ble_gap_auth_info_t is returned as the event parameter.
*/
CY_BLE_EVT_GAP_AUTH_REQ, /* 0x4001u */
/** This event indicates that the device must send a passkey to be used during the pairing procedure.
* Cy_BLE_GAP_AuthPassKeyReply() is required to be called with valid parameters on receiving this event.
* cy_stc_ble_gap_auth_pk_info_t is returned as the event parameter. bdHandle is the only relevant parameter.
* Other parameters should be ignored.
*/
CY_BLE_EVT_GAP_PASSKEY_ENTRY_REQUEST, /* 0x4002u */
/** This event indicates that the device needs to display a passkey during the pairing procedure.
* cy_stc_ble_gap_auth_pk_info_t is returned as the event parameter. bdHandle and passkey are relevant parameters.
* Other parameter(s) should be ignored.
* The passkey can be any 6-decimal-digit value.
*/
CY_BLE_EVT_GAP_PASSKEY_DISPLAY_REQUEST, /* 0x4003u */
/** This event indicates that the authentication procedure is completed.
* The event parameter contains the security information as defined by cy_stc_ble_gap_auth_info_t.
* This event is generated at the end of the following three operations:
* * Authentication is initiated with a newly connected device
* * Encryption is initiated with a connected device that is already bonded
* * Re-Encryption is initiated with a connected device with link already encrypted
* During encryption/re-encryption, the Encryption Information exchanged during the pairing process
* is used to encrypt/re-encrypt the link. As this does not modify any of the authentication
* parameters with which the devices were paired, this event is generated with NULL event data
* and the result of the encryption operation.
*/
CY_BLE_EVT_GAP_AUTH_COMPLETE, /* 0x4004u */
/** This event indicates that the authentication process between two devices has failed .
* cy_stc_ble_gap_auth_info_t is returned as the event parameter. bdHandle provides a handle for the failing device and
* authErr provides cy_en_ble_gap_auth_failed_reason_t indicates the reason for failure.
* Other parameters should be ignored.
*/
CY_BLE_EVT_GAP_AUTH_FAILED, /* 0x4005u */
/** This event indicates that the GAP Peripheral device has started/stopped advertising.
* The event parameter contains the HCI Status error code, which is of type 'uint8_t'.
* If the data is '0x00', it indicates 'success'; anything else indicates 'failure'.
*/
CY_BLE_EVT_GAPP_ADVERTISEMENT_START_STOP, /* 0x4006u */
/** This event is generated at the GAP Peripheral end after the connection is completed with a peer Central device.
* For a GAP Central device, this event is generated as an acknowledgment of receiving connection request by calling 'Cy_BLE_GAPC_InitConnection()' successfully
* by the BLE Stack. After the connection is completed, no other event is generated but if connection establishment fails,
* 'CY_BLE_EVT_GAP_DEVICE_DISCONNECTED' is generated to the application.
* This event is generated only if Link Layer Privacy is not enabled in the BLE Component customizer.
* The event parameter is a pointer to a structure of type cy_stc_ble_gap_connected_param_t.
* The members of the event parameter's structure are valid only if eventParams->status is success (0x00).
*/
CY_BLE_EVT_GAP_DEVICE_CONNECTED, /* 0x4007u */
/** This event indicates that the device has disconnected from remote device or failed to establish connection.
* Parameter is of type 'cy_stc_ble_gap_disconnect_param_t'
*/
CY_BLE_EVT_GAP_DEVICE_DISCONNECTED, /* 0x4008u */
/** This event indicated an encryption change event for an active connection.
* Event parameter returned with this event is of (cy_stc_ble_events_param_generic_t*) type.
* There are two members of the structure pointed to by the event parameter: status (uint8_t) and eventParams (void *).
* eventParams must be cast to (cy_stc_ble_gap_encrypt_change_param_t*) type to access the encryption state (ON/OFF)
* as well as the bdHandle corresponding to this event.
* eventParams->encryption is valid only if status is success(0x00)
* This is an informative event for the application when there is a change in encryption.
* The application may choose to ignore it.
*/
CY_BLE_EVT_GAP_ENCRYPT_CHANGE, /* 0x4009u */
/** This event is generated at the GAP Central and the Peripheral end after a connection parameter update
* is requested from the host to the controller.
* The event parameter is a pointer to a structure of type cy_stc_ble_gap_conn_param_updated_in_controller_t.
*/
CY_BLE_EVT_GAP_CONNECTION_UPDATE_COMPLETE, /* 0x400Au */
/** This event indicates that the Central device has started/stopped scanning.
* This event is generated after making a call to the Cy_BLE_GAPC_StartDiscovery() and
* Cy_BLE_GAPC_StopDiscovery() functions. The event parameter contains the HCI Status error code,
* which is of type 'uint8_t'.
* If the data is '0x00', it indicates 'success'; anything else indicates 'failure'.
*/
CY_BLE_EVT_GAPC_SCAN_START_STOP, /* 0x400Bu */
/** This event indicates that the SMP keys exchange with a peer device is complete. The event handler
* is expected to store the peer device keys, especially IRK, which is used to resolve the
* peer device after the connection establishment.
* The event parameter returns data of type cy_stc_ble_gap_sec_key_param_t containing the peer device keys.
*/
CY_BLE_EVT_GAP_KEYINFO_EXCHNGE_CMPLT, /* 0x400Cu */
/** This event indicates that the device must display a passkey during the
* secure connection pairing procedure. Cy_BLE_GAP_AuthPassKeyReply() is
* required to be called with valid parameters on receiving this event.
* Because no key is entered by the user for Numeric Comparison, the
* parameter passkey for the function Cy_BLE_GAP_AuthPassKeyReply() will be
* ignored.
* cy_stc_ble_gap_auth_pk_info_t is returned as the event parameter. bdHandle and passkey are relevant parameters.
* Other parameter(s) should be ignored. 'passkey' can be any 6-decimal-digit value.
*/
CY_BLE_EVT_GAP_NUMERIC_COMPARISON_REQUEST, /* 0x400Du */
/** This event is generated when keypress (Secure connections) is received
* from peer device.
* cy_stc_ble_gap_sc_kp_notif_info_t is returned as event parameter.
*/
CY_BLE_EVT_GAP_KEYPRESS_NOTIFICATION, /* 0x400Eu */
/** This event is generated when OOB generation for Secure connections is complete.
* The event parameter is of type 'cy_stc_ble_gap_oob_data_param_t'
*/
CY_BLE_EVT_GAP_OOB_GENERATED_NOTIFICATION, /* 0x400Fu */
/** This event is generated at the GAP Peripheral end after the connection is completed with a peer Central device.
* For a GAP Central device, this event is generated as an acknowledgment of receiving connection request by calling 'Cy_BLE_GAPC_InitConnection()' successfully
* by the BLE Stack. After the connection is completed, no other event is generated but if connection establishment fails,
* 'CY_BLE_EVT_GAP_DEVICE_DISCONNECTED' event is generated to the application.
* This event is generated only if Link Layer Privacy is enabled in the BLE Component customizer.
* The event parameter is a pointer to a structure of type cy_stc_ble_gap_enhance_conn_complete_param_t.
* The members of the event parameter's structure are valid only if eventParams->status is success (0x00).
*/
CY_BLE_EVT_GAP_ENHANCE_CONN_COMPLETE, /* 0x4010u */
/** This event indicates that directed advertisements have been received where
* the advertiser is using a resolvable private address for the InitA field in the ADV_DIRECT_IND PDU and the
* Scanning_Filter_Policy is equal to 0x02 or 0x03. The event parameter is of type 'cy_stc_ble_gapc_direct_adv_report_param_t'
*/
CY_BLE_EVT_GAPC_DIRECT_ADV_REPORT, /* 0x4011u */
/** This event is raised as soon as the SMP has completed pairing properties (feature exchange)
* negotiation. The event parameter is cy_stc_ble_gap_auth_info_t. cy_stc_ble_gap_auth_info_t will have the
* negotiated parameter. The pairing should either pass with these negotiated parameters or may fail.
*/
CY_BLE_EVT_GAP_SMP_NEGOTIATED_AUTH_INFO, /* 0x4012u */
/** This event indicates a new Bluetooth device address generated successfully as per an application requirement.
* The event parameter is cy_stc_ble_bd_addr_t
*/
CY_BLE_EVT_GAP_DEVICE_ADDR_GEN_COMPLETE, /* 0x4013u */
/** This event indicates security keys are generated successfully.
* The event parameter is cy_stc_ble_gap_sec_key_param_t bdHandle in the parameter should be ignored
*/
CY_BLE_EVT_GAP_KEYS_GEN_COMPLETE, /* 0x4014u */
/** This event is triggered on completion of Cy_BLE_GAPC_ResolveDevice() function.
* The event parameter is (cy_stc_ble_events_param_generic_t*)
*/
CY_BLE_EVT_GAP_RESOLVE_DEVICE_COMPLETE, /* 0x4015u */
/** This event is triggered on completion of the Cy_BLE_GAP_GenerateSetLocalP256Keys() function.
* The event parameter is of pointer to cy_stc_ble_gap_smp_local_p256_keys_t that has
* generated P256 keys.
*/
CY_BLE_EVT_GAP_GEN_SET_LOCAL_P256_KEYS_COMPLETE, /* 0x4016u */
/** This event is triggered on completion of the Cy_BLE_GAPC_CancelConnection() function.
* Event parameter returned with this event is of (cy_stc_ble_events_param_generic_t*) type.
* There are two members of the structure pointed to by the event parameter: status (uint8_t) and eventParams (void *).
* eventParams must be ignored
*/
CY_BLE_EVT_GAP_CREATE_CONN_CANCEL_COMPLETE, /* 0x4017u */
/** This event is triggered on completion of connection establishment.
* Event parameter is (cy_stc_ble_conn_estb_param_t*)
*/
CY_BLE_EVT_GAP_CONN_ESTB, /* 0x4018u */
/** This event indicates that the GAP Peripheral device has started/stopped advertising.
* This event is generated after making a call to the Cy_BLE_GAP_UpdateAdvScanData function.
* The event parameter contains the HCI Status error code, which is of type 'uint8_t'.
* If the data is '0x00', it indicates 'success'; anything else indicates 'failure'.
*/
CY_BLE_EVT_GAPP_UPDATE_ADV_SCAN_DATA_COMPLETE, /* 0x4019u */
/** This event is triggered when an advertisement packet is sent over the air. This event will
* only be triggered if the CY_BLE_ADV_TX_EVENT_MASK event mask is set using the
* Cy_BLE_SetCustomEventMask API. The event parameter returned with this event must be
* ignored.
*/
CY_BLE_EVT_GAP_ADV_TX, /* 0x401Au */
/* Range for GATT events - 0x5000 to 0x5FFF */
/** This event is received by the GATT Client when the GATT Server cannot perform the requested
* operation and sends out an error response. The event parameter is a pointer to a structure
* of type cy_stc_ble_gatt_err_param_t.
*/
CY_BLE_EVT_GATTC_ERROR_RSP = 0x5000u,
/** This event is generated at the GAP Peripheral end after a connection is completed with a peer Central device.
* For a GAP Central device, this event is generated as in acknowledgment of receiving this event successfully
* by the BLE Stack. After connection is complete, no other event is required but if connection establishment fails,
* 'CY_BLE_EVT_GATT_DISCONNECT_IND' event is passed to the application.
* The event parameter is a pointer to a structure of type cy_stc_ble_conn_handle_t.
*/
CY_BLE_EVT_GATT_CONNECT_IND, /* 0x5001u */
/** This event indicates that the GATT is disconnected.
* The event parameter is a pointer to a structure of type cy_stc_ble_conn_handle_t.
*/
CY_BLE_EVT_GATT_DISCONNECT_IND, /* 0x5002u */
/** This event indicates that the 'GATT MTU Exchange Request' is received from GATT Client device. The event parameter
* is of 'cy_stc_ble_gatt_xchg_mtu_param_t' type and contains the Client RX MTU size.
*/
CY_BLE_EVT_GATTS_XCNHG_MTU_REQ, /* 0x5003u */
/** This event indicates that the 'GATT MTU Exchange Response' is received from GATT Server device. The event parameter
* is a pointer to a structure of type cy_stc_ble_gatt_xchg_mtu_param_t and contains the Server RX MTU size.
*/
CY_BLE_EVT_GATTC_XCHNG_MTU_RSP, /* 0x5004u */
/** This event indicates that the 'Read by Group Type Response' is received from GATT Server device. The event parameter
* is a pointer to a structure of type cy_stc_ble_gattc_read_by_grp_rsp_param_t.
*/
CY_BLE_EVT_GATTC_READ_BY_GROUP_TYPE_RSP, /* 0x5005u */
/** This event indicates that the 'Read by Type Response' is received from GATT Server device. The event parameter is a
* pointer to a structure of type cy_stc_ble_gattc_read_by_type_rsp_param_t.
*/
CY_BLE_EVT_GATTC_READ_BY_TYPE_RSP, /* 0x5006u */