mirror of
https://github.com/meshtastic/firmware.git
synced 2025-04-23 09:06:02 +00:00
Only request all NodeInfo/Position on fresh install (#6184)
Co-authored-by: Ben Meadors <benmmeadors@gmail.com>
This commit is contained in:
parent
ab61cd65d1
commit
9893d24c62
@ -400,11 +400,13 @@ bool isBroadcast(uint32_t dest)
|
||||
return dest == NODENUM_BROADCAST || dest == NODENUM_BROADCAST_NO_LORA;
|
||||
}
|
||||
|
||||
bool NodeDB::resetRadioConfig(bool factory_reset)
|
||||
bool NodeDB::resetRadioConfig(bool factory_reset, bool is_fresh_install)
|
||||
{
|
||||
bool didFactoryReset = false;
|
||||
|
||||
radioGeneration++;
|
||||
if (is_fresh_install) {
|
||||
radioGeneration++;
|
||||
}
|
||||
|
||||
if (factory_reset) {
|
||||
didFactoryReset = factoryReset();
|
||||
@ -589,7 +591,7 @@ void NodeDB::installDefaultConfig(bool preserveKey = false)
|
||||
config.device.node_info_broadcast_secs = default_node_info_broadcast_secs;
|
||||
config.security.serial_enabled = true;
|
||||
config.security.admin_channel_enabled = false;
|
||||
resetRadioConfig();
|
||||
resetRadioConfig(false, true); // This also triggers NodeInfo/Position requests since we're fresh
|
||||
strncpy(config.network.ntp_server, "meshtastic.pool.ntp.org", 32);
|
||||
|
||||
#if (defined(T_DECK) || defined(T_WATCH_S3) || defined(UNPHONE) || defined(PICOMPUTER_S3) || defined(SENSECAP_INDICATOR)) && \
|
||||
|
@ -99,9 +99,11 @@ class NodeDB
|
||||
* a) sometimes a buggy android app might send us bogus settings or
|
||||
* b) the client set factory_reset
|
||||
*
|
||||
* @param factory_reset if true, reset all settings to factory defaults
|
||||
* @param is_fresh_install set to true after a fresh install, to trigger NodeInfo/Position requests
|
||||
* @return true if the config was completely reset, in that case, we should send it back to the client
|
||||
*/
|
||||
bool resetRadioConfig(bool factory_reset = false);
|
||||
bool resetRadioConfig(bool factory_reset = false, bool is_fresh_install = false);
|
||||
|
||||
/// given a subpacket sniffed from the network, update our DB state
|
||||
/// we updateGUI and updateGUIforNode if we think our this change is big enough for a redraw
|
||||
|
Loading…
Reference in New Issue
Block a user