mirror of
https://github.com/meshtastic/firmware.git
synced 2025-04-25 09:42:35 +00:00
Call getMacAddr within pickNewNodeNum() (#2576)
It could be called from within NodeDB::init() before it is set
This commit is contained in:
parent
e677a02273
commit
ccb682bbb8
@ -290,9 +290,6 @@ void NodeDB::installDefaultDeviceState()
|
|||||||
|
|
||||||
generatePacketId(); // FIXME - ugly way to init current_packet_id;
|
generatePacketId(); // FIXME - ugly way to init current_packet_id;
|
||||||
|
|
||||||
// Init our blank owner info to reasonable defaults
|
|
||||||
getMacAddr(ourMacAddr);
|
|
||||||
|
|
||||||
// Set default owner name
|
// Set default owner name
|
||||||
pickNewNodeNum(); // based on macaddr now
|
pickNewNodeNum(); // based on macaddr now
|
||||||
snprintf(owner.long_name, sizeof(owner.long_name), "Meshtastic %02x%02x", ourMacAddr[4], ourMacAddr[5]);
|
snprintf(owner.long_name, sizeof(owner.long_name), "Meshtastic %02x%02x", ourMacAddr[4], ourMacAddr[5]);
|
||||||
@ -378,6 +375,8 @@ void NodeDB::pickNewNodeNum()
|
|||||||
{
|
{
|
||||||
NodeNum r = myNodeInfo.my_node_num;
|
NodeNum r = myNodeInfo.my_node_num;
|
||||||
|
|
||||||
|
getMacAddr(ourMacAddr); // Make sure ourMacAddr is set
|
||||||
|
|
||||||
// Pick an initial nodenum based on the macaddr
|
// Pick an initial nodenum based on the macaddr
|
||||||
r = (ourMacAddr[2] << 24) | (ourMacAddr[3] << 16) | (ourMacAddr[4] << 8) | ourMacAddr[5];
|
r = (ourMacAddr[2] << 24) | (ourMacAddr[3] << 16) | (ourMacAddr[4] << 8) | ourMacAddr[5];
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user