@@ -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
0 commit comments