Skip to content

Commit d0c4d7a

Browse files
committed
Cordio: Forward server related events to CordioGattServer
1 parent 0f64b1c commit d0c4d7a

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

features/FEATURE_BLE/targets/TARGET_CORDIO/CordioGattServer.h

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,16 @@
3232
#define MAX_CCCD_CNT 20
3333

3434
namespace ble {
35+
36+
// fwd declaration of CordioAttClient and BLE
37+
namespace pal {
38+
namespace vendor {
39+
namespace cordio {
40+
class CordioAttClient;
41+
}
42+
}
43+
}
44+
3545
namespace vendor {
3646
namespace cordio {
3747

@@ -41,6 +51,8 @@ namespace cordio {
4151
class GattServer : public ::GattServer,
4252
public pal::SigningEventMonitor
4353
{
54+
friend ble::pal::vendor::cordio::CordioAttClient;
55+
4456
public:
4557
/**
4658
* Return the singleton of the Cordio implementation of ::GattServer.

features/FEATURE_BLE/targets/TARGET_CORDIO/CordioPalAttClient.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
#ifndef CORDIO_PAL_ATT_CLIENT_
1818
#define CORDIO_PAL_ATT_CLIENT_
1919

20+
#include "CordioGattServer.h"
2021
#include "ble/pal/AttClient.h"
2122
#include "ble/pal/SimpleAttServerMessage.h"
2223
#include "att_api.h"
@@ -349,6 +350,9 @@ class CordioAttClient : public ::ble::pal::AttClient {
349350
return;
350351
}
351352
}
353+
354+
// pass events not handled to the server side
355+
ble::vendor::cordio::GattServer::getInstance().att_cb(event);
352356
}
353357

354358
private:

0 commit comments

Comments
 (0)