27
27
#include " BLEDeviceManager.h"
28
28
#include " BLEProfileManager.h"
29
29
30
+ #include " BLECallbacks.h"
31
+
32
+ #include < atomic.h>
33
+ #include " ../src/services/ble/conn_internal.h"
34
+
30
35
// GATT Server Only
31
36
ssize_t profile_read_process (bt_conn_t *conn,
32
37
const bt_gatt_attr_t *attr,
@@ -123,8 +128,6 @@ uint8_t profile_notify_process (bt_conn_t *conn,
123
128
bt_gatt_subscribe_params_t *params,
124
129
const void *data, uint16_t length)
125
130
{
126
- // BLEPeripheralHelper* peripheral = BLECentralRole::instance()->peripheral(conn);// Find peripheral by bt_conn
127
- // BLEAttribute* notifyatt = peripheral->attribute(params); // Find attribute by params
128
131
BLECharacteristicImp* chrc = NULL ;
129
132
BLEDevice bleDevice (bt_conn_get_dst (conn));
130
133
chrc = BLEProfileManager::instance ()->characteristic (bleDevice, params->value_handle );
@@ -146,7 +149,6 @@ uint8_t profile_discover_process(bt_conn_t *conn,
146
149
uint8_t ret = BT_GATT_ITER_STOP;
147
150
pr_debug (LOG_MODULE_BLE, " %s-%d" , __FUNCTION__, __LINE__);
148
151
ret = BLEProfileManager::instance ()->discoverResponseProc (conn, attr, params);
149
- pr_debug (LOG_MODULE_BLE, " %s-%d" , __FUNCTION__, __LINE__);
150
152
return ret;
151
153
}
152
154
@@ -237,7 +239,6 @@ void bleConnectEventHandler(bt_conn_t *conn,
237
239
p->handleConnectEvent (conn, err);
238
240
}
239
241
240
-
241
242
void bleDisconnectEventHandler (bt_conn_t *conn,
242
243
uint8_t reason,
243
244
void *param)
@@ -283,3 +284,14 @@ void ble_on_write_no_rsp_complete(struct bt_conn *conn, uint8_t err,
283
284
BLECharacteristicImp::writeResponseReceived (conn, err, data);
284
285
}
285
286
287
+ void prfile_cccd_cfg_changed (void *user_data, uint16_t value)
288
+ {
289
+ if (NULL == user_data)
290
+ return ;
291
+ pr_debug (LOG_MODULE_BLE, " %s-%d: ccc userdata %p" , __FUNCTION__, __LINE__, user_data);
292
+
293
+ BLECharacteristicImp *blecharacteritic = (BLECharacteristicImp *)user_data;
294
+ blecharacteritic->cccdValueChanged ();
295
+ }
296
+
297
+
0 commit comments