Skip to content

Commit 1cea53b

Browse files
use grandfathered convention for class members names and initialise them
1 parent 3808db9 commit 1cea53b

File tree

7 files changed

+20
-12
lines changed

7 files changed

+20
-12
lines changed

features/FEATURE_BLE/ble/GattClient.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ class GattClient {
112112
*/
113113
void setEventHandler(EventHandler *handler)
114114
{
115-
_eventHandler = handler;
115+
eventHandler = handler;
116116
}
117117

118118
/**
@@ -795,7 +795,7 @@ class GattClient {
795795
}
796796

797797
protected:
798-
GattClient()
798+
GattClient() : eventHandler(NULL)
799799
{
800800
/* Empty */
801801
}
@@ -850,7 +850,7 @@ class GattClient {
850850
/**
851851
* Event handler provided by the application.
852852
*/
853-
EventHandler *_eventHandler;
853+
EventHandler *eventHandler;
854854

855855
/**
856856
* Callchain containing all registered event handlers for data read

features/FEATURE_BLE/ble/GattServer.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ class GattServer {
116116
*/
117117
void setEventHandler(EventHandler *handler)
118118
{
119-
_eventHandler = handler;
119+
eventHandler = handler;
120120
}
121121

122122
/**
@@ -198,6 +198,7 @@ class GattServer {
198198
GattServer() :
199199
serviceCount(0),
200200
characteristicCount(0),
201+
eventHandler(NULL),
201202
dataSentCallChain(),
202203
dataWrittenCallChain(),
203204
dataReadCallChain(),
@@ -813,7 +814,7 @@ class GattServer {
813814
/**
814815
* Event handler provided by the application.
815816
*/
816-
EventHandler *_eventHandler;
817+
EventHandler *eventHandler;
817818

818819
/**
819820
* The total number of services added to the ATT table.

features/FEATURE_BLE/ble/generic/GenericGattClient.h

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,13 +37,16 @@ class GenericGattClient : public GattClient,
3737
public pal::GattClient::EventHandler {
3838
public:
3939

40+
/**
41+
* @see pal::GattClient::EventHandler::on_att_mtu_change
42+
*/
4043
virtual void on_att_mtu_change(
4144
ble::connection_handle_t connection_handle,
4245
uint16_t att_mtu_size
4346
)
4447
{
45-
if (_eventHandler) {
46-
_eventHandler->onAttMtuChange(connection_handle, att_mtu_size);
48+
if (eventHandler) {
49+
eventHandler->onAttMtuChange(connection_handle, att_mtu_size);
4750
}
4851
}
4952

@@ -140,8 +143,12 @@ class GenericGattClient : public GattClient,
140143
*/
141144
virtual void set_signing_event_handler(pal::SigningEventMonitor::EventHandler *signing_event_handler);
142145

146+
/**
147+
* Return the user registered event handler.
148+
* @return User registered event handler or NULL if none is present.
149+
*/
143150
::GattClient::EventHandler* getEventHandler() {
144-
return _eventHandler;
151+
return eventHandler;
145152
}
146153

147154
private:

features/FEATURE_BLE/targets/TARGET_CORDIO/CordioGattServer.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ class GattServer : public ::GattServer,
6363
static GattServer &getInstance();
6464

6565
::GattServer::EventHandler* getEventHandler() {
66-
return _eventHandler;
66+
return eventHandler;
6767
}
6868

6969
/**

features/FEATURE_BLE/targets/TARGET_NORDIC/TARGET_NORDIC_SOFTDEVICE/TARGET_MCU_NRF51822/source/nRF5xGattServer.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ class nRF5xGattServer : public GattServer
4242
void hwCallback(ble_evt_t *p_ble_evt);
4343

4444
EventHandler* getEventHandler() {
45-
return _eventHandler;
45+
return eventHandler;
4646
}
4747

4848
private:

features/FEATURE_BLE/targets/TARGET_NORDIC/TARGET_NORDIC_SOFTDEVICE/TARGET_NRF51/source/nRF5xGattServer.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ class nRF5xGattServer : public GattServer
4242
void hwCallback(const ble_evt_t *p_ble_evt);
4343

4444
EventHandler* getEventHandler() {
45-
return _eventHandler;
45+
return eventHandler;
4646
}
4747

4848
private:

features/FEATURE_BLE/targets/TARGET_NORDIC/TARGET_NORDIC_SOFTDEVICE/TARGET_NRF52/source/nRF5xGattServer.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ class nRF5xGattServer : public GattServer
4242
void hwCallback(const ble_evt_t *p_ble_evt);
4343

4444
EventHandler* getEventHandler() {
45-
return _eventHandler;
45+
return eventHandler;
4646
}
4747

4848
private:

0 commit comments

Comments
 (0)