mirror of
https://github.com/h2zero/esp-nimble-cpp.git
synced 2024-11-22 13:10:55 +01:00
Added the setDeviceName functionality while BLE is running
This commit is contained in:
parent
efa48c0d57
commit
cd3185fe43
2 changed files with 10 additions and 0 deletions
|
@ -971,6 +971,15 @@ void NimBLEDevice::deinit(bool clearAll) {
|
||||||
}
|
}
|
||||||
} // deinit
|
} // deinit
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Set the BLEDevice's name
|
||||||
|
* @param [in] deviceName The device name of the device.
|
||||||
|
*/
|
||||||
|
/* STATIC */
|
||||||
|
void NimBLEDevice::setDeviceName(const std::string &deviceName) {
|
||||||
|
ble_svc_gap_device_name_set(deviceName.c_str());
|
||||||
|
} // setDeviceName
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Check if the initialization is complete.
|
* @brief Check if the initialization is complete.
|
||||||
|
|
|
@ -97,6 +97,7 @@ class NimBLEDevice {
|
||||||
public:
|
public:
|
||||||
static void init(const std::string &deviceName);
|
static void init(const std::string &deviceName);
|
||||||
static void deinit(bool clearAll = false);
|
static void deinit(bool clearAll = false);
|
||||||
|
static void setDeviceName(const std::string &deviceName);
|
||||||
static bool getInitialized();
|
static bool getInitialized();
|
||||||
static NimBLEAddress getAddress();
|
static NimBLEAddress getAddress();
|
||||||
static std::string toString();
|
static std::string toString();
|
||||||
|
|
Loading…
Reference in a new issue