mirror of
https://github.com/meshtastic/firmware.git
synced 2025-08-13 08:45:04 +00:00
use unique device name
This commit is contained in:
parent
9aed5056ad
commit
efbe520107
15
src/main.ino
15
src/main.ino
@ -289,6 +289,19 @@ void initDeepSleep()
|
|||||||
Serial.printf("booted, wake cause %d (boot count %d)\n", wakeCause, bootCount);
|
Serial.printf("booted, wake cause %d (boot count %d)\n", wakeCause, bootCount);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
const char *getDeviceName()
|
||||||
|
{
|
||||||
|
uint8_t dmac[6];
|
||||||
|
assert(esp_efuse_mac_get_default(dmac) == ESP_OK);
|
||||||
|
|
||||||
|
// Meshtastic_ab3c
|
||||||
|
static char name[20];
|
||||||
|
sprintf(name, "Meshtastic_%02x%02x", dmac[4], dmac[5]);
|
||||||
|
return name;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void setup()
|
void setup()
|
||||||
{
|
{
|
||||||
// Debug
|
// Debug
|
||||||
@ -346,7 +359,7 @@ void setup()
|
|||||||
//}
|
//}
|
||||||
|
|
||||||
service.init();
|
service.init();
|
||||||
BLEServer *serve = initBLE("KHBT Test"); // FIXME, use a real name based on the macaddr
|
BLEServer *serve = initBLE(getDeviceName()); // FIXME, use a real name based on the macaddr
|
||||||
BLEService *bts = createMeshBluetoothService(serve);
|
BLEService *bts = createMeshBluetoothService(serve);
|
||||||
bts->start();
|
bts->start();
|
||||||
serve->getAdvertising()->addServiceUUID(bts->getUUID());
|
serve->getAdvertising()->addServiceUUID(bts->getUUID());
|
||||||
|
Loading…
Reference in New Issue
Block a user