mirror of
https://github.com/meshtastic/firmware.git
synced 2025-02-26 22:33:24 +00:00
Only set NodeNum based on MAC if it's still zero (#3585)
* Only set NodeNum based on MAC if it's still zero * Already declared
This commit is contained in:
parent
fcab20fb3b
commit
3bee6ce9c3
@ -517,11 +517,12 @@ void NodeDB::installDefaultDeviceState()
|
||||
*/
|
||||
void NodeDB::pickNewNodeNum()
|
||||
{
|
||||
|
||||
getMacAddr(ourMacAddr); // Make sure ourMacAddr is set
|
||||
|
||||
// Pick an initial nodenum based on the macaddr
|
||||
NodeNum nodeNum = (ourMacAddr[2] << 24) | (ourMacAddr[3] << 16) | (ourMacAddr[4] << 8) | ourMacAddr[5];
|
||||
NodeNum nodeNum = myNodeInfo.my_node_num;
|
||||
if (nodeNum == 0) {
|
||||
getMacAddr(ourMacAddr); // Make sure ourMacAddr is set
|
||||
// Pick an initial nodenum based on the macaddr
|
||||
nodeNum = (ourMacAddr[2] << 24) | (ourMacAddr[3] << 16) | (ourMacAddr[4] << 8) | ourMacAddr[5];
|
||||
}
|
||||
|
||||
meshtastic_NodeInfoLite *found;
|
||||
while ((nodeNum == NODENUM_BROADCAST || nodeNum < NUM_RESERVED) ||
|
||||
|
Loading…
Reference in New Issue
Block a user