mirror of
https://github.com/meshtastic/firmware.git
synced 2025-06-12 08:02:04 +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()
|
void NodeDB::pickNewNodeNum()
|
||||||
{
|
{
|
||||||
|
NodeNum nodeNum = myNodeInfo.my_node_num;
|
||||||
getMacAddr(ourMacAddr); // Make sure ourMacAddr is set
|
if (nodeNum == 0) {
|
||||||
|
getMacAddr(ourMacAddr); // Make sure ourMacAddr is set
|
||||||
// Pick an initial nodenum based on the macaddr
|
// Pick an initial nodenum based on the macaddr
|
||||||
NodeNum nodeNum = (ourMacAddr[2] << 24) | (ourMacAddr[3] << 16) | (ourMacAddr[4] << 8) | ourMacAddr[5];
|
nodeNum = (ourMacAddr[2] << 24) | (ourMacAddr[3] << 16) | (ourMacAddr[4] << 8) | ourMacAddr[5];
|
||||||
|
}
|
||||||
|
|
||||||
meshtastic_NodeInfoLite *found;
|
meshtastic_NodeInfoLite *found;
|
||||||
while ((nodeNum == NODENUM_BROADCAST || nodeNum < NUM_RESERVED) ||
|
while ((nodeNum == NODENUM_BROADCAST || nodeNum < NUM_RESERVED) ||
|
||||||
|
Loading…
Reference in New Issue
Block a user