mirror of
https://github.com/meshtastic/firmware.git
synced 2025-12-16 07:42:37 +00:00
Allow packet and nodenums to be 32 bits long (but don't change yet)
This commit is contained in:
@@ -178,8 +178,10 @@ void NodeDB::init()
|
||||
*/
|
||||
void NodeDB::pickNewNodeNum()
|
||||
{
|
||||
// FIXME not the right way to guess node numes
|
||||
uint8_t r = ourMacAddr[5];
|
||||
// Pick an initial nodenum based on the macaddr
|
||||
NodeNum r = sizeof(NodeNum) == 1 ? ourMacAddr[5]
|
||||
: ((ourMacAddr[2] << 24) | (ourMacAddr[3] << 16) | (ourMacAddr[4] << 8) | ourMacAddr[5]);
|
||||
|
||||
if (r == 0xff || r < NUM_RESERVED)
|
||||
r = NUM_RESERVED; // don't pick a reserved node number
|
||||
|
||||
|
||||
Reference in New Issue
Block a user