diff --git a/features/FEATURE_BLE/ble/GattClient.h b/features/FEATURE_BLE/ble/GattClient.h index 5eff0df04e..828536ffbd 100644 --- a/features/FEATURE_BLE/ble/GattClient.h +++ b/features/FEATURE_BLE/ble/GattClient.h @@ -112,7 +112,7 @@ public: */ void setEventHandler(EventHandler *handler) { - _eventHandler = handler; + eventHandler = handler; } /** @@ -795,7 +795,7 @@ public: } protected: - GattClient() + GattClient() : eventHandler(NULL) { /* Empty */ } @@ -850,7 +850,7 @@ protected: /** * Event handler provided by the application. */ - EventHandler *_eventHandler; + EventHandler *eventHandler; /** * Callchain containing all registered event handlers for data read diff --git a/features/FEATURE_BLE/ble/GattServer.h b/features/FEATURE_BLE/ble/GattServer.h index 8335e7f798..2a1bf417ce 100644 --- a/features/FEATURE_BLE/ble/GattServer.h +++ b/features/FEATURE_BLE/ble/GattServer.h @@ -116,7 +116,7 @@ public: */ void setEventHandler(EventHandler *handler) { - _eventHandler = handler; + eventHandler = handler; } /** @@ -198,6 +198,7 @@ protected: GattServer() : serviceCount(0), characteristicCount(0), + eventHandler(NULL), dataSentCallChain(), dataWrittenCallChain(), dataReadCallChain(), @@ -813,7 +814,7 @@ protected: /** * Event handler provided by the application. */ - EventHandler *_eventHandler; + EventHandler *eventHandler; /** * The total number of services added to the ATT table. diff --git a/features/FEATURE_BLE/ble/generic/GenericGattClient.h b/features/FEATURE_BLE/ble/generic/GenericGattClient.h index eece4dfed4..3759e8f1bd 100644 --- a/features/FEATURE_BLE/ble/generic/GenericGattClient.h +++ b/features/FEATURE_BLE/ble/generic/GenericGattClient.h @@ -37,13 +37,16 @@ class GenericGattClient : public GattClient, public pal::GattClient::EventHandler { public: + /** + * @see pal::GattClient::EventHandler::on_att_mtu_change + */ virtual void on_att_mtu_change( ble::connection_handle_t connection_handle, uint16_t att_mtu_size ) { - if (_eventHandler) { - _eventHandler->onAttMtuChange(connection_handle, att_mtu_size); + if (eventHandler) { + eventHandler->onAttMtuChange(connection_handle, att_mtu_size); } } @@ -140,8 +143,12 @@ public: */ virtual void set_signing_event_handler(pal::SigningEventMonitor::EventHandler *signing_event_handler); + /** + * Return the user registered event handler. + * @return User registered event handler or NULL if none is present. + */ ::GattClient::EventHandler* getEventHandler() { - return _eventHandler; + return eventHandler; } private: diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO/CordioGattServer.h b/features/FEATURE_BLE/targets/TARGET_CORDIO/CordioGattServer.h index 84dc2dbdf0..4979ce6249 100644 --- a/features/FEATURE_BLE/targets/TARGET_CORDIO/CordioGattServer.h +++ b/features/FEATURE_BLE/targets/TARGET_CORDIO/CordioGattServer.h @@ -63,7 +63,7 @@ public: static GattServer &getInstance(); ::GattServer::EventHandler* getEventHandler() { - return _eventHandler; + return eventHandler; } /** diff --git a/features/FEATURE_BLE/targets/TARGET_NORDIC/TARGET_NORDIC_SOFTDEVICE/TARGET_MCU_NRF51822/source/nRF5xGattServer.h b/features/FEATURE_BLE/targets/TARGET_NORDIC/TARGET_NORDIC_SOFTDEVICE/TARGET_MCU_NRF51822/source/nRF5xGattServer.h index a115d24775..7cd58b1cf4 100644 --- a/features/FEATURE_BLE/targets/TARGET_NORDIC/TARGET_NORDIC_SOFTDEVICE/TARGET_MCU_NRF51822/source/nRF5xGattServer.h +++ b/features/FEATURE_BLE/targets/TARGET_NORDIC/TARGET_NORDIC_SOFTDEVICE/TARGET_MCU_NRF51822/source/nRF5xGattServer.h @@ -42,7 +42,7 @@ public: void hwCallback(ble_evt_t *p_ble_evt); EventHandler* getEventHandler() { - return _eventHandler; + return eventHandler; } private: diff --git a/features/FEATURE_BLE/targets/TARGET_NORDIC/TARGET_NORDIC_SOFTDEVICE/TARGET_NRF51/source/nRF5xGattServer.h b/features/FEATURE_BLE/targets/TARGET_NORDIC/TARGET_NORDIC_SOFTDEVICE/TARGET_NRF51/source/nRF5xGattServer.h index baedd6473d..8069c8c5e9 100644 --- a/features/FEATURE_BLE/targets/TARGET_NORDIC/TARGET_NORDIC_SOFTDEVICE/TARGET_NRF51/source/nRF5xGattServer.h +++ b/features/FEATURE_BLE/targets/TARGET_NORDIC/TARGET_NORDIC_SOFTDEVICE/TARGET_NRF51/source/nRF5xGattServer.h @@ -42,7 +42,7 @@ public: void hwCallback(const ble_evt_t *p_ble_evt); EventHandler* getEventHandler() { - return _eventHandler; + return eventHandler; } private: diff --git a/features/FEATURE_BLE/targets/TARGET_NORDIC/TARGET_NORDIC_SOFTDEVICE/TARGET_NRF52/source/nRF5xGattServer.h b/features/FEATURE_BLE/targets/TARGET_NORDIC/TARGET_NORDIC_SOFTDEVICE/TARGET_NRF52/source/nRF5xGattServer.h index 77d6f91fa5..270a211ac2 100644 --- a/features/FEATURE_BLE/targets/TARGET_NORDIC/TARGET_NORDIC_SOFTDEVICE/TARGET_NRF52/source/nRF5xGattServer.h +++ b/features/FEATURE_BLE/targets/TARGET_NORDIC/TARGET_NORDIC_SOFTDEVICE/TARGET_NRF52/source/nRF5xGattServer.h @@ -42,7 +42,7 @@ public: void hwCallback(const ble_evt_t *p_ble_evt); EventHandler* getEventHandler() { - return _eventHandler; + return eventHandler; } private: