Skip to content

Commit d91e1c3

Browse files
h2zerowakwak-koba
andcommitted
Rename refreshServices to deleteAttributes in connect().
Minor semantic change for clarity. Co-authored-by: wakwak-koba <[email protected]>
1 parent bac0753 commit d91e1c3

File tree

2 files changed

+17
-11
lines changed

2 files changed

+17
-11
lines changed

src/NimBLEClient.cpp

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -127,33 +127,39 @@ size_t NimBLEClient::deleteService(const NimBLEUUID &uuid) {
127127
} // deleteServices
128128

129129

130-
bool NimBLEClient::connect(bool refreshServices) {
131-
return connect(m_peerAddress, 0, refreshServices);
130+
/**
131+
* @brief Connect to the BLE Server.
132+
* @param [in] deleteAttibutes If true this will delete any attribute objects this client may already\n
133+
* have created and clears the vectors after successful connection.
134+
* @return True on success.
135+
*/
136+
bool NimBLEClient::connect(bool deleteAttibutes) {
137+
return connect(m_peerAddress, 0, deleteAttibutes);
132138
}
133139

134140
/**
135141
* @brief Connect to an advertising device.
136142
* @param [in] device The device to connect to.
137-
* @param [in] refreshServices If true this will delete any attribute objects this client may already\n
143+
* @param [in] deleteAttibutes If true this will delete any attribute objects this client may already\n
138144
* have created and clears the vectors after successful connection.
139145
* @return True on success.
140146
*/
141-
bool NimBLEClient::connect(NimBLEAdvertisedDevice* device, bool refreshServices) {
147+
bool NimBLEClient::connect(NimBLEAdvertisedDevice* device, bool deleteAttibutes) {
142148
NimBLEAddress address(device->getAddress());
143149
uint8_t type = device->getAddressType();
144-
return connect(address, type, refreshServices);
150+
return connect(address, type, deleteAttibutes);
145151
}
146152

147153

148154
/**
149155
* @brief Connect to the BLE Server.
150156
* @param [in] address The address of the server.
151157
* @param [in] type The address type of the server (Random/public/other)
152-
* @param [in] refreshServices If true this will delete any attribute objects this client may already\n
158+
* @param [in] deleteAttibutes If true this will delete any attribute objects this client may already\n
153159
* have created and clears the vectors after successful connection.
154160
* @return True on success.
155161
*/
156-
bool NimBLEClient::connect(const NimBLEAddress &address, uint8_t type, bool refreshServices) {
162+
bool NimBLEClient::connect(const NimBLEAddress &address, uint8_t type, bool deleteAttibutes) {
157163
NIMBLE_LOGD(LOG_TAG, ">> connect(%s)", address.toString().c_str());
158164

159165
if(!NimBLEDevice::m_synced) {
@@ -212,7 +218,7 @@ bool NimBLEClient::connect(const NimBLEAddress &address, uint8_t type, bool refr
212218
return false;
213219
}
214220

215-
if(refreshServices) {
221+
if(deleteAttibutes) {
216222
NIMBLE_LOGD(LOG_TAG, "Refreshing Services for: (%s)", address.toString().c_str());
217223
deleteServices();
218224
}

src/NimBLEClient.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,10 @@ class NimBLEAdvertisedDevice;
3838
*/
3939
class NimBLEClient {
4040
public:
41-
bool connect(NimBLEAdvertisedDevice* device, bool refreshServices = true);
41+
bool connect(NimBLEAdvertisedDevice* device, bool deleteAttibutes = true);
4242
bool connect(const NimBLEAddress &address, uint8_t type = BLE_ADDR_PUBLIC,
43-
bool refreshServices = true);
44-
bool connect(bool refreshServices = true);
43+
bool deleteAttibutes = true);
44+
bool connect(bool deleteAttibutes = true);
4545
int disconnect(uint8_t reason = BLE_ERR_REM_USER_CONN_TERM);
4646
NimBLEAddress getPeerAddress();
4747
void setPeerAddress(const NimBLEAddress &address);

0 commit comments

Comments
 (0)