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
@ -97,8 +97,15 @@ const char *getDeviceName()
|
|||||||
getMacAddr(dmac);
|
getMacAddr(dmac);
|
||||||
|
|
||||||
// Meshtastic_ab3c
|
// Meshtastic_ab3c
|
||||||
static char name[20];
|
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]);
|
sprintf(name, "Meshtastic_%02x%02x", dmac[4], dmac[5]);
|
||||||
|
}
|
||||||
return name;
|
return name;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user