Skip to content

Commit 485a01b

Browse files
iranlh2zero
authored andcommitted
Fix undefined reference to ble_svc_gap_device_name_set when GATT server is disabled (#349)
* Fix undefined reference to ble_svc_gap_device_name_set when GATT server is disabled * Do not affect ESP-IDF <5.5.0
1 parent f0ca3bf commit 485a01b

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/NimBLEDevice.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1290,12 +1290,13 @@ bool NimBLEDevice::injectConfirmPasskey(const NimBLEConnInfo& peerInfo, bool acc
12901290
* @param [in] deviceName The name to set.
12911291
*/
12921292
bool NimBLEDevice::setDeviceName(const std::string& deviceName) {
1293+
#if !defined(ESP_IDF_VERSION) || ESP_IDF_VERSION < ESP_IDF_VERSION_VAL(5, 5, 0) || CONFIG_BT_NIMBLE_GAP_SERVICE
12931294
int rc = ble_svc_gap_device_name_set(deviceName.c_str());
12941295
if (rc != 0) {
12951296
NIMBLE_LOGE(LOG_TAG, "Device name not set - too long");
12961297
return false;
12971298
}
1298-
1299+
#endif
12991300
return true;
13001301
} // setDeviceName
13011302

0 commit comments

Comments
 (0)