gps_cli: gps also restored on sensors and rooms

This commit is contained in:
Florent de Lamotte 2025-10-06 15:30:18 +02:00
parent 6ed8e9d514
commit 9e3c2fc9d9
6 changed files with 25 additions and 10 deletions

View file

@ -664,12 +664,6 @@ void MyMesh::begin(FILESYSTEM *fs) {
#endif
}
#if ENV_INCLUDE_GPS == 1
void MyMesh::applyGpsPrefs() {
sensors.setSettingByKey("gps", _prefs.gps_enabled?"1":"0");
}
#endif
void MyMesh::applyTempRadioParams(float freq, float bw, uint8_t sf, uint8_t cr, int timeout_mins) {
set_radio_at = futureMillis(2000); // give CLI reply some time to be sent back, before applying temp radio params
pending_freq = freq;

View file

@ -135,6 +135,12 @@ protected:
return _prefs.multi_acks;
}
#if ENV_INCLUDE_GPS == 1
void applyGpsPrefs() {
sensors.setSettingByKey("gps", _prefs.gps_enabled?"1":"0");
}
#endif
void onAnonDataRecv(mesh::Packet* packet, const uint8_t* secret, const mesh::Identity& sender, uint8_t* data, size_t len) override;
int searchPeersByHash(const uint8_t* hash) override;
void getPeerSharedSecret(uint8_t* dest_secret, int peer_idx) override;
@ -159,10 +165,6 @@ public:
_cli.savePrefs(_fs);
}
#if ENV_INCLUDE_GPS == 1
void applyGpsPrefs();
#endif
void applyTempRadioParams(float freq, float bw, uint8_t sf, uint8_t cr, int timeout_mins) override;
bool formatFileSystem() override;
void sendSelfAdvertisement(int delay_millis) override;