SmartSnippets DA1459x SDK
ble_mgr_l2cap.h
Go to the documentation of this file.
1 
41 #ifndef BLE_MGR_L2CAP_H_
42 #define BLE_MGR_L2CAP_H_
43 
44 #include <stdint.h>
45 #include <stdbool.h>
46 #include "osal.h"
47 #include "ble_mgr_cmd.h"
48 #include "ble_mgr_gtl.h"
49 #include "ble_l2cap.h"
50 
53  BLE_MGR_L2CAP_LISTEN_CMD = BLE_MGR_CMD_CAT_FIRST(BLE_MGR_L2CAP_CMD_CAT),
54  BLE_MGR_L2CAP_STOP_LISTEN_CMD,
55  BLE_MGR_L2CAP_CONNECTION_CFM_CMD,
56  BLE_MGR_L2CAP_CONNECT_CMD,
57  BLE_MGR_L2CAP_DISCONNECT_CMD,
58  BLE_MGR_L2CAP_ADD_CREDITS_CMD,
59  BLE_MGR_L2CAP_SEND_CMD,
60  /* Dummy command opcode, needs to be always defined after all commands */
61  BLE_MGR_L2CAP_LAST_CMD,
62 };
63 
64 typedef struct {
66  uint16_t conn_idx;
67  uint16_t psm;
68  gap_sec_level_t sec_level;
69  uint16_t initial_credits;
70  bool defer_setup;
71 } ble_mgr_l2cap_listen_cmd_t;
72 
73 typedef struct {
75  uint16_t conn_idx;
76  ble_error_t status;
77  uint16_t scid;
78 } ble_mgr_l2cap_listen_rsp_t;
79 
80 void ble_mgr_l2cap_listen_cmd_handler(void *param);
81 
82 typedef struct {
84  uint16_t conn_idx;
85  uint16_t scid;
86 } ble_mgr_l2cap_stop_listen_cmd_t;
87 
88 typedef struct {
90  uint16_t conn_idx;
91  ble_error_t status;
92  uint16_t scid;
93 } ble_mgr_l2cap_stop_listen_rsp_t;
94 
95 void ble_mgr_l2cap_stop_listen_cmd_handler(void *param);
96 
97 typedef struct {
99  uint16_t conn_idx;
100  uint16_t scid;
101  uint16_t status;
102 } ble_mgr_l2cap_connection_cfm_cmd_t;
103 
104 typedef struct {
105  ble_mgr_msg_hdr_t hdr;
106  ble_error_t status;
107 } ble_mgr_l2cap_connection_cfm_rsp_t;
108 
109 void ble_mgr_l2cap_connection_cfm_cmd_handler(void *param);
110 
111 typedef struct {
112  ble_mgr_msg_hdr_t hdr;
113  uint16_t conn_idx;
114  uint16_t psm;
115  uint16_t initial_credits;
116 } ble_mgr_l2cap_connect_cmd_t;
117 
118 typedef struct {
119  ble_mgr_msg_hdr_t hdr;
120  ble_error_t status;
121  uint16_t scid;
122 } ble_mgr_l2cap_connect_rsp_t;
123 
124 void ble_mgr_l2cap_connect_cmd_handler(void *param);
125 
126 typedef struct {
127  ble_mgr_msg_hdr_t hdr;
128  uint16_t conn_idx;
129  uint16_t scid;
130 } ble_mgr_l2cap_disconnect_cmd_t;
131 
132 typedef struct {
133  ble_mgr_msg_hdr_t hdr;
134  ble_error_t status;
135  uint16_t scid;
136 } ble_mgr_l2cap_disconnect_rsp_t;
137 
138 void ble_mgr_l2cap_disconnect_cmd_handler(void *param);
139 
140 typedef struct {
141  ble_mgr_msg_hdr_t hdr;
142  uint16_t conn_idx;
143  uint16_t scid;
144  uint16_t credits;
145 } ble_mgr_l2cap_add_credits_cmd_t;
146 
147 typedef struct {
148  ble_mgr_msg_hdr_t hdr;
149  ble_error_t status;
150  uint16_t conn_idx;
151  uint16_t scid;
152  uint16_t credits;
153 } ble_mgr_l2cap_add_credits_rsp_t;
154 
155 void ble_mgr_l2cap_add_credits_cmd_handler(void *param);
156 
157 typedef struct {
158  ble_mgr_msg_hdr_t hdr;
159  uint16_t conn_idx;
160  uint16_t scid;
161  uint16_t length;
162  uint8_t data[0];
163 } ble_mgr_l2cap_send_cmd_t;
164 
165 typedef struct {
166  ble_mgr_msg_hdr_t hdr;
167  ble_error_t status;
168 } ble_mgr_l2cap_send_rsp_t;
169 
170 void ble_mgr_l2cap_send_cmd_handler(void *param);
171 
176 
177 void ble_mgr_l2cap_disconnect_ind_evt_handler(ble_gtl_msg_t *gtl);
178 
179 void ble_mgr_l2cap_connect_req_ind_evt_handler(ble_gtl_msg_t *gtl);
180 
181 void ble_mgr_l2cap_add_ind_evt_handler(ble_gtl_msg_t *gtl);
182 
183 void ble_mgr_l2cap_pdu_send_rsp_evt_handler(ble_gtl_msg_t *gtl);
184 
185 void ble_mgr_l2cap_lecnx_data_recv_ind_evt_handler(ble_gtl_msg_t *gtl);
186 
187 void ble_mgr_gapc_cmp__le_cb_connection_evt_handler(ble_gtl_msg_t *gtl);
188 
189 void ble_mgr_l2cap_disconnect_ind(uint16_t conn_idx);
190 
191 #endif /* BLE_MGR_L2CAP_H_ */
192 
ble_mgr_l2cap_connect_ind_evt_handler
void ble_mgr_l2cap_connect_ind_evt_handler(ble_gtl_msg_t *gtl)
ble_mgr_cmd.h
BLE manager command definitions.
ble_mgr_gtl.h
tbd
ble_mgr_msg_hdr_t
Definition: ble_mgr_cmd.h:54
ble_l2cap.h
LE L2CAP connection oriented channels API.
osal.h
OS abstraction layer API.
ble_gtl_msg
Definition: ad_ble.h:212
ble_error_t
ble_error_t
Definition: ble_common.h:53
gap_sec_level_t
gap_sec_level_t
Definition: ble_gap.h:531
ble_cmd_l2cap_opcode
ble_cmd_l2cap_opcode
Definition: ble_mgr_l2cap.h:52