mirror of
https://github.com/meshcore-dev/MeshCore.git
synced 2026-04-20 22:13:47 +00:00
* T1000e BLE - default node name is now the MAC address
This commit is contained in:
parent
616eb57b16
commit
3c27132914
7 changed files with 47 additions and 17 deletions
|
|
@ -9,11 +9,21 @@
|
|||
|
||||
#define ADVERT_RESTART_DELAY 1000 // millis
|
||||
|
||||
void SerialBLEInterface::begin(const char* device_name, uint32_t pin_code) {
|
||||
void SerialBLEInterface::begin(const char* prefix, char* name, uint32_t pin_code) {
|
||||
_pin_code = pin_code;
|
||||
|
||||
if (strcmp(name, "@@MAC") == 0) {
|
||||
uint8_t addr[8];
|
||||
memset(addr, 0, sizeof(addr));
|
||||
esp_efuse_mac_get_default(addr);
|
||||
sprintf(name, "%02X%02X%02X%02X%02X%02X", // modify (IN-OUT param)
|
||||
addr[5], addr[4], addr[3], addr[2], addr[1], addr[0]);
|
||||
}
|
||||
char dev_name[32+16];
|
||||
sprintf(dev_name, "%s%s", prefix, name);
|
||||
|
||||
// Create the BLE Device
|
||||
BLEDevice::init(device_name);
|
||||
BLEDevice::init(dev_name);
|
||||
BLEDevice::setSecurityCallbacks(this);
|
||||
BLEDevice::setMTU(MAX_FRAME_SIZE);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue