File tree Expand file tree Collapse file tree 6 files changed +17
-77
lines changed
connectivity/FEATURE_BLE/source Expand file tree Collapse file tree 6 files changed +17
-77
lines changed Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -267,7 +267,20 @@ PalGattClient &BLEInstanceBase::getPalGattClient()
267
267
268
268
ble::impl::SecurityManager &BLEInstanceBase::getSecurityManagerImpl ()
269
269
{
270
- static PalSigningMonitor signing_event_monitor;
270
+ // Creation of a proxy monitor to let the security manager register to
271
+ // the gatt client and gatt server.
272
+ static struct : PalSigningMonitor {
273
+ void set_signing_event_handler (PalSigningMonitorEventHandler *handler)
274
+ {
275
+ #if BLE_FEATURE_GATT_CLIENT
276
+ BLEInstanceBase::deviceInstance ().getGattClientImpl ().set_signing_event_handler (handler);
277
+ #endif // BLE_FEATURE_GATT_CLIENT
278
+ #if BLE_FEATURE_GATT_SERVER
279
+ BLEInstanceBase::deviceInstance ().getGattServerImpl ().set_signing_event_handler (handler);
280
+ #endif // BLE_FEATURE_GATT_SERVER
281
+ }
282
+ } signing_event_monitor;
283
+
271
284
static ble::impl::SecurityManager m_instance (
272
285
ble::impl::PalSecurityManager::get_security_manager (),
273
286
getGapImpl (),
Original file line number Diff line number Diff line change @@ -211,7 +211,7 @@ class GattServer : public PalSigningMonitor {
211
211
212
212
void set_signing_event_handler (
213
213
PalSigningMonitorEventHandler *signing_event_handler
214
- );
214
+ ) override ;
215
215
216
216
EventHandler *getEventHandler ();
217
217
Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -167,7 +167,7 @@ class GattClient :
167
167
/* *
168
168
* @see ble::PalSigningMonitor::set_signing_event_handler
169
169
*/
170
- void set_signing_event_handler (PalSigningMonitorEventHandler *signing_event_handler);
170
+ void set_signing_event_handler (PalSigningMonitorEventHandler *signing_event_handler) override ;
171
171
172
172
/* *
173
173
* @see PalGattClient::EventHandler::on_att_mtu_change
Original file line number Diff line number Diff line change @@ -58,7 +58,6 @@ class PalSigningMonitorEventHandler {
58
58
};
59
59
};
60
60
61
- namespace interface {
62
61
/* *
63
62
* Implemented by classes that need to be notified of signing events.
64
63
* Notification is done by calling functions in the passed in event handler
@@ -70,14 +69,9 @@ class PalSigningMonitor {
70
69
*
71
70
* @param[in] signing_event_handler Event handler being registered.
72
71
*/
73
- void set_signing_event_handler (PalSigningMonitorEventHandler *signing_event_handler);
72
+ virtual void set_signing_event_handler (PalSigningMonitorEventHandler *signing_event_handler) = 0 ;
74
73
};
75
74
76
- } // namespace interface
77
75
} // namespace ble
78
76
79
- /* This includes the concrete class implementation, to provide a an alternative BLE PAL implementation
80
- * disable Cordio and place your header in a path with the same structure */
81
- #include " ble/internal/PalSigningMonitorImpl.h"
82
-
83
77
#endif /* MBED_BLE_SIGNING_EVENT_MONITOR */
You can’t perform that action at this time.
0 commit comments