Skip to content

Commit 2aa004b

Browse files
committed
rename registerServices -> registerAppServices
1 parent 6a396c7 commit 2aa004b

2 files changed

Lines changed: 11 additions & 11 deletions

File tree

‎src/NimBLEServer.cpp‎

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ NimBLEServer::NimBLEServer()
5454
: m_gattsStarted{false},
5555
m_svcChanged{false},
5656
m_deleteCallbacks{false},
57-
m_registerServicesFirst{false},
57+
m_registerAppServicesFirst{false},
5858
# if !MYNEWT_VAL(BLE_EXT_ADV)
5959
m_advertiseOnDisconnect{false},
6060
# endif
@@ -377,9 +377,9 @@ void NimBLEServer::advertiseOnDisconnect(bool enable) {
377377
* NimBLEServer::start()). Useful when a peripheral must expose a fixed attribute-table
378378
* layout that another device relies on by hardcoded handle rather than discovery.
379379
*/
380-
void NimBLEServer::registerServicesFirst(bool enable) {
381-
m_registerServicesFirst = enable;
382-
} // registerServicesFirst
380+
void NimBLEServer::registerAppServicesFirst(bool enable) {
381+
m_registerAppServicesFirst = enable;
382+
} // registerAppServicesFirst
383383

384384
/**
385385
* @brief Return the number of connected clients.
@@ -916,7 +916,7 @@ bool NimBLEServer::resetGATT() {
916916
// Register the standard GAP (0x1800) and GATT (0x1801) services, restoring the
917917
// device name/appearance that ble_gatts_reset() clears. By default this happens
918918
// first, so GAP/GATT take the low attribute handles (0x0001+). When
919-
// registerServicesFirst() is enabled, it is deferred until after the application
919+
// registerAppServicesFirst() is enabled, it is deferred until after the application
920920
// services below, so those take the low handles instead.
921921
auto initGapGattServices = [&]() {
922922
ble_svc_gap_init();
@@ -927,7 +927,7 @@ bool NimBLEServer::resetGATT() {
927927
ble_svc_gatt_init();
928928
};
929929

930-
if (!m_registerServicesFirst) {
930+
if (!m_registerAppServicesFirst) {
931931
initGapGattServices();
932932
}
933933

@@ -966,10 +966,10 @@ bool NimBLEServer::resetGATT() {
966966
if (pSvc->getRemoved() == 0) {
967967
if (!pSvc->start_internal()) {
968968
NIMBLE_LOGE(LOG_TAG, "Failed to start service: %s", pSvc->getUUID().toString().c_str());
969-
// When deferring GAP/GATT (registerServicesFirst), still register
969+
// When deferring GAP/GATT (registerAppServicesFirst), still register
970970
// them on the failure path so the mandatory GAP/GATT services (and
971971
// the restored name/appearance) are never left out of the database.
972-
if (m_registerServicesFirst) {
972+
if (m_registerAppServicesFirst) {
973973
initGapGattServices();
974974
}
975975
return false;
@@ -980,7 +980,7 @@ bool NimBLEServer::resetGATT() {
980980
++svcIt;
981981
}
982982

983-
if (m_registerServicesFirst) {
983+
if (m_registerAppServicesFirst) {
984984
initGapGattServices();
985985
}
986986

‎src/NimBLEServer.h‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ class NimBLEServer {
8181
NimBLEConnInfo getPeerInfo(const NimBLEAddress& address) const;
8282
NimBLEConnInfo getPeerInfoByHandle(uint16_t connHandle) const;
8383
void advertiseOnDisconnect(bool enable);
84-
void registerServicesFirst(bool enable);
84+
void registerAppServicesFirst(bool enable);
8585
void setDataLen(uint16_t connHandle, uint16_t tx_octets) const;
8686
bool updatePhy(uint16_t connHandle, uint8_t txPhysMask, uint8_t rxPhysMask, uint16_t phyOptions);
8787
bool getPhy(uint16_t connHandle, uint8_t* txPhy, uint8_t* rxPhy);
@@ -130,7 +130,7 @@ class NimBLEServer {
130130
bool m_gattsStarted : 1;
131131
bool m_svcChanged : 1;
132132
bool m_deleteCallbacks : 1;
133-
bool m_registerServicesFirst : 1;
133+
bool m_registerAppServicesFirst : 1;
134134
# if !MYNEWT_VAL(BLE_EXT_ADV) && MYNEWT_VAL(BLE_ROLE_BROADCASTER)
135135
bool m_advertiseOnDisconnect : 1;
136136
# endif

0 commit comments

Comments
 (0)