mirror of
https://github.com/meshtastic/firmware.git
synced 2025-02-04 03:39:56 +00:00
When configured set meshtastic bluetooth name based on owner shortname.
This commit is contained in:
parent
8e996e3e63
commit
e1f28982cf
11
src/main.cpp
11
src/main.cpp
@ -97,8 +97,15 @@ const char *getDeviceName()
|
||||
getMacAddr(dmac);
|
||||
|
||||
// Meshtastic_ab3c
|
||||
static char name[20];
|
||||
sprintf(name, "Meshtastic_%02x%02x", dmac[4], dmac[5]);
|
||||
static char name[30];
|
||||
// If we have an owner shortname and it is short.
|
||||
if (owner.short_name != NULL
|
||||
&& strlen(owner.short_name) >= 2
|
||||
&& strlen(owner.short_name) < 10) {
|
||||
sprintf(name, "Meshtastic_%s", owner.short_name);
|
||||
} else {
|
||||
sprintf(name, "Meshtastic_%02x%02x", dmac[4], dmac[5]);
|
||||
}
|
||||
return name;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user