@@ -39,7 +39,6 @@ const String ObsConfig::PROPERTY_OBS_NAME = String("obsName");
3939const String ObsConfig::PROPERTY_NAME = String(" name" );
4040const String ObsConfig::PROPERTY_BLUETOOTH = String(" bluetooth" );
4141const String ObsConfig::PROPERTY_OFFSET = String(" offset" );
42- const String ObsConfig::PROPERTY_SIM_RA = String(" simRa" );
4342const String ObsConfig::PROPERTY_WIFI_SSID = String(" wifiSsid" );
4443const String ObsConfig::PROPERTY_WIFI_PASSWORD = String(" wifiPassword" );
4544const String ObsConfig::PROPERTY_PORTAL_URL = String(" portalUrl" );
@@ -139,7 +138,6 @@ void ObsConfig::makeSureSystemDefaultsAreSet() {
139138 JsonObject data = jsonData[" obs" ][0 ];
140139 ensureSet (data, PROPERTY_OBS_NAME, " OpenBikeSensor-" + String ((uint16_t )(ESP.getEfuseMac () >> 32 ), 16 ));
141140 ensureSet (data, PROPERTY_NAME, " default" );
142- ensureSet (data, PROPERTY_SIM_RA, false );
143141 ensureSet (data, PROPERTY_BLUETOOTH, false );
144142 data[PROPERTY_OFFSET][0 ] = data[PROPERTY_OFFSET][0 ] | 35 ;
145143 data[PROPERTY_OFFSET][1 ] = data[PROPERTY_OFFSET][1 ] | 35 ;
@@ -207,6 +205,12 @@ bool ObsConfig::setProperty(int profile, String const &key, T const &value) {
207205 return true ; // value == oldValue;
208206}
209207
208+ bool ObsConfig::setProperty (int profile, String const &key, bool const &value) {
209+ auto oldValue = jsonData[" obs" ][profile][key];
210+ jsonData[" obs" ][profile][key] = value;
211+ return value == oldValue;
212+ }
213+
210214bool ObsConfig::setProperty (int profile, String const &key, int const &value) {
211215 auto oldValue = jsonData[" obs" ][profile][key];
212216 jsonData[" obs" ][profile][key] = value;
@@ -368,7 +372,6 @@ void ObsConfig::fill(Config &cfg) const {
368372 cfg.confirmationTimeWindow = getProperty<int >(PROPERTY_CONFIRMATION_TIME_SECONDS);
369373 cfg.privacyConfig = getProperty<int >(PROPERTY_PRIVACY_CONFIG);
370374 cfg.bluetooth = getProperty<bool >(PROPERTY_BLUETOOTH);
371- cfg.simRaMode = getProperty<bool >(PROPERTY_SIM_RA);
372375 cfg.privacyAreas .clear ();
373376 if (selectedProfile != 0 ) { // not sure if we ever support PAs per profile.
374377 for (int i = 0 ; i < jsonData[" obs" ][selectedProfile][PROPERTY_PRIVACY_AREA].size (); i++) {
@@ -414,7 +417,6 @@ void ObsConfig::parseOldJsonDocument(DynamicJsonDocument &doc) {
414417 setProperty (0 , PROPERTY_CONFIRMATION_TIME_SECONDS, doc[" confirmationTimeWindow" ] | 5 );
415418 setProperty (0 , PROPERTY_PRIVACY_CONFIG, doc[" privacyConfig" ] | AbsolutePrivacy);
416419 setProperty (0 , PROPERTY_BLUETOOTH, doc[" bluetooth" ] | false );
417- setProperty (0 , PROPERTY_SIM_RA, doc[" simRaMode" ] | false );
418420
419421 int numPrivacyAreas = doc[" numPrivacyAreas" ] | 0 ;
420422 // Append new values to the privacy-vector
0 commit comments