mirror of
https://github.com/h2zero/esp-nimble-cpp.git
synced 2025-09-25 13:31:15 +02:00
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
This commit is contained in:
@@ -1290,12 +1290,13 @@ bool NimBLEDevice::injectConfirmPasskey(const NimBLEConnInfo& peerInfo, bool acc
|
|||||||
* @param [in] deviceName The name to set.
|
* @param [in] deviceName The name to set.
|
||||||
*/
|
*/
|
||||||
bool NimBLEDevice::setDeviceName(const std::string& deviceName) {
|
bool NimBLEDevice::setDeviceName(const std::string& deviceName) {
|
||||||
|
#if !defined(ESP_IDF_VERSION) || ESP_IDF_VERSION < ESP_IDF_VERSION_VAL(5, 5, 0) || CONFIG_BT_NIMBLE_GAP_SERVICE
|
||||||
int rc = ble_svc_gap_device_name_set(deviceName.c_str());
|
int rc = ble_svc_gap_device_name_set(deviceName.c_str());
|
||||||
if (rc != 0) {
|
if (rc != 0) {
|
||||||
NIMBLE_LOGE(LOG_TAG, "Device name not set - too long");
|
NIMBLE_LOGE(LOG_TAG, "Device name not set - too long");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
return true;
|
return true;
|
||||||
} // setDeviceName
|
} // setDeviceName
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user