1 /* USER CODE BEGIN Header */
2 /**
3   ******************************************************************************
4   * @file    dtm_preprocess_events.h
5   * @author  GPM WBL Application Team
6   * @brief   Header file preprocess hooks for events.
7   ******************************************************************************
8   * @attention
9   *
10   * Copyright (c) 2024 STMicroelectronics.
11   * All rights reserved.
12   *
13   * This software is licensed under terms that can be found in the LICENSE file
14   * in the root directory of this software component.
15   * If no LICENSE file comes with this software, it is provided AS-IS.
16   *
17   ******************************************************************************
18   */
19 /* USER CODE END Header */
20 #ifndef DTM_PREPROCESS_EVENTS_H
21 #define DTM_PREPROCESS_EVENTS_H
22 
23 #include <stdint.h>
24 #include "ble_status.h"
25 
26 typedef int (*hci_event_process)(uint8_t *buffer_in);
27 typedef struct hci_event_table_type_s {
28   uint16_t evt_code;
29   hci_event_process process;
30 } hci_events_table_type, hci_le_meta_events_table_type, hci_vendor_specific_events_table_type;
31 
32 extern const hci_events_table_type hci_events_table[];
33 extern const hci_le_meta_events_table_type hci_le_meta_events_table[];
34 extern const hci_vendor_specific_events_table_type hci_vendor_specific_events_table[];
35 
36 int hci_disconnection_complete_event_preprocess(uint8_t Status,
37                                                 uint16_t Connection_Handle,
38                                                 uint8_t Reason);
39 
40 int aci_gatt_srv_attribute_modified_event_preprocess(uint16_t Connection_Handle,
41                                                      uint16_t CID,
42                                                      uint16_t Attr_Handle,
43                                                      uint16_t Attr_Data_Length,
44                                                      uint8_t Attr_Data[]);
45 
46 int aci_gatt_clt_notification_event_preprocess(uint16_t Connection_Handle,
47                                                uint16_t CID,
48                                                uint16_t Attribute_Handle,
49                                                uint16_t Attribute_Value_Length,
50                                                uint8_t Attribute_Value[]);
51 
52 int aci_gatt_clt_proc_complete_event_preprocess(uint16_t Connection_Handle,
53                                                 uint16_t CID,
54                                                 uint8_t Error_Code);
55 
56 int aci_gatt_tx_pool_available_event_preprocess(uint16_t Connection_Handle,
57                                                 uint16_t Available_Buffers);
58 
59 int aci_gatt_srv_read_event_preprocess(uint16_t Connection_Handle,
60                                        uint16_t CID,
61                                        uint16_t Attribute_Handle,
62                                        uint16_t Data_Offset);
63 
64 int aci_gatt_srv_write_event_preprocess(uint16_t Connection_Handle,
65                                         uint16_t CID,
66                                         uint8_t Resp_Needed,
67                                         uint16_t Attribute_Handle,
68                                         uint16_t Data_Length,
69                                         uint8_t Data[]);
70 
71 int aci_att_srv_prepare_write_req_event_preprocess(uint16_t Connection_Handle,
72                                                    uint16_t CID,
73                                                    uint16_t Attribute_Handle,
74                                                    uint16_t Data_Offset,
75                                                    uint16_t Data_Length,
76                                                    uint8_t Data[]);
77 
78 int aci_l2cap_cos_disconnection_complete_event_preprocess(uint16_t Connection_Handle,
79                                                           uint16_t CID);
80 
81 int aci_l2cap_cos_sdu_data_tx_event_preprocess(uint16_t Connection_Handle,
82                                                uint16_t CID,
83                                                uint16_t SDU_Length,
84                                                void * SDU_Data_Buffer,
85                                                uint16_t TX_Credit_Balance);
86 
87 int aci_l2cap_cos_sdu_data_rx_event_preprocess(uint16_t Connection_Handle,
88                                                uint16_t CID,
89                                                uint16_t RX_Credit_Balance,
90                                                uint16_t SDU_Length);
91 
92 int aci_hal_adv_scan_resp_data_update_event_preprocess(void * Old_Pointer,
93                                                        void * New_Pointer);
94 
95 int aci_hal_pawr_data_free_event_preprocess(void * Buffer,
96                                             uint8_t Type);
97 
98 #endif /* DTM_PREPROCESS_EVENTS_H */
99