Added the setDeviceName functionality while BLE is running (#421)

This commit is contained in:
Cody 2022-07-21 16:33:21 -07:00 committed by h2zero
parent 9ab278d19e
commit a4a62493e2
2 changed files with 10 additions and 0 deletions

View file

@ -971,6 +971,15 @@ void NimBLEDevice::deinit(bool clearAll) {
}
} // 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.

View file

@ -97,6 +97,7 @@ class NimBLEDevice {
public:
static void init(const std::string &deviceName);
static void deinit(bool clearAll = false);
static void setDeviceName(const std::string &deviceName);
static bool getInitialized();
static NimBLEAddress getAddress();
static std::string toString();