Skip to content

Commit 3aa9a44

Browse files
committed
Remove special "DEVELOP" setting, is not supported anymore
- fixes #307
1 parent dd2ec4b commit 3aa9a44

5 files changed

Lines changed: 3 additions & 64 deletions

File tree

docs/software/firmware/obs_cfg.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,6 @@ relevant put the order of the array content.
3232
"bluetooth": true,
3333
// time window for overtake measurement confirmation
3434
"confirmationTimeSeconds": 4,
35-
// Bitfield for some internal developer features
36-
"devConfig": 0,
3735
// Bitfield display config, see DisplayOptions for details,
3836
// as noted all subject to change!
3937
"displayConfig": 15,

src/OpenBikeSensorFirmware.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -600,9 +600,6 @@ bool loadConfig(ObsConfig &cfg) {
600600
cfg.fill(config);
601601

602602
// Setup display, this is not the right place ;)
603-
if(config.devConfig & ShowGrid) {
604-
displayTest->showGrid(true);
605-
}
606603
if (config.displayConfig & DisplayInvert) {
607604
displayTest->invert();
608605
} else {

src/config.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@ const String ObsConfig::PROPERTY_PORTAL_TOKEN = String("portalToken");
4747
const String ObsConfig::PROPERTY_DISPLAY_CONFIG = String("displayConfig");
4848
const String ObsConfig::PROPERTY_CONFIRMATION_TIME_SECONDS = String("confirmationTimeSeconds");
4949
const String ObsConfig::PROPERTY_PRIVACY_CONFIG = String("privacyConfig");
50-
const String ObsConfig::PROPERTY_DEVELOPER = String("devConfig");
5150
const String ObsConfig::PROPERTY_SELECTED_PRESET = String("selectedPreset");
5251
const String ObsConfig::PROPERTY_PRIVACY_AREA = String("privacyArea");
5352
const String ObsConfig::PROPERTY_PA_LAT = String("lat");
@@ -168,7 +167,6 @@ void ObsConfig::makeSureSystemDefaultsAreSet() {
168167
if (getProperty<int>(PROPERTY_CONFIRMATION_TIME_SECONDS) == 0) {
169168
data[PROPERTY_CONFIRMATION_TIME_SECONDS] = 5;
170169
}
171-
ensureSet(data, PROPERTY_DEVELOPER, 0);
172170
ensureSet(data, PROPERTY_SELECTED_PRESET, 0);
173171
if (!data.containsKey(PROPERTY_PRIVACY_AREA)) {
174172
data.createNestedArray(PROPERTY_PRIVACY_AREA);
@@ -365,7 +363,6 @@ void ObsConfig::fill(Config &cfg) const {
365363
cfg.privacyConfig = getProperty<int>(PROPERTY_PRIVACY_CONFIG);
366364
cfg.bluetooth = getProperty<bool>(PROPERTY_BLUETOOTH);
367365
cfg.simRaMode = getProperty<bool>(PROPERTY_SIM_RA);
368-
cfg.devConfig = getProperty<int>(PROPERTY_DEVELOPER);
369366
cfg.privacyAreas.clear();
370367
if (selectedProfile != 0) { // not sure if we ever support PAs per profile.
371368
for (int i = 0; i < jsonData["obs"][selectedProfile][PROPERTY_PRIVACY_AREA].size(); i++) {
@@ -412,7 +409,6 @@ void ObsConfig::parseOldJsonDocument(DynamicJsonDocument &doc) {
412409
setProperty(0, PROPERTY_PRIVACY_CONFIG, doc["privacyConfig"] | AbsolutePrivacy);
413410
setProperty(0, PROPERTY_BLUETOOTH, doc["bluetooth"] | false);
414411
setProperty(0, PROPERTY_SIM_RA, doc["simRaMode"] | false);
415-
setProperty(0, PROPERTY_DEVELOPER, doc["devConfig"] | 0);
416412

417413
int numPrivacyAreas = doc["numPrivacyAreas"] | 0;
418414
// Append new values to the privacy-vector

src/config.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,6 @@ struct Config {
7373
uint displayConfig;
7474
bool bluetooth;
7575
bool simRaMode;
76-
int devConfig;
7776
int privacyConfig;
7877
int confirmationTimeWindow;
7978
std::vector<PrivacyArea> privacyAreas;
@@ -135,7 +134,6 @@ class ObsConfig {
135134
static const String PROPERTY_DISPLAY_CONFIG;
136135
static const String PROPERTY_CONFIRMATION_TIME_SECONDS;
137136
static const String PROPERTY_PRIVACY_CONFIG;
138-
static const String PROPERTY_DEVELOPER;
139137
static const String PROPERTY_SELECTED_PRESET;
140138
static const String PROPERTY_PRIVACY_AREA;
141139
static const String PROPERTY_PA_LAT;

src/configServer.cpp

Lines changed: 3 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -197,8 +197,7 @@ static const char* const navigationIndex =
197197
"<input type=button onclick=\"window.location.href='/sd'\" class=btn value='Show SD Card Contents'>"
198198
"<input type=button onclick=\"window.location.href='/about'\" class=btn value='About'>"
199199
"<input type=button onclick=\"window.location.href='/delete'\" class=btn value='Delete'>"
200-
"<input type=button onclick=\"window.location.href='/reboot'\" class=btn value='Reboot'>"
201-
"{dev}";
200+
"<input type=button onclick=\"window.location.href='/reboot'\" class=btn value='Reboot'>";
202201

203202
static const char* const httpsRedirect =
204203
"<h3>HTTPS</h3>"
@@ -292,19 +291,6 @@ updateFirmwareList();
292291
<h3>File Upload</h3>
293292
)"""";
294293

295-
296-
297-
// #########################################
298-
// Development Index
299-
// #########################################
300-
301-
static const char* const devIndex =
302-
"<h3>Display</h3>"
303-
"Show Grid<br><input type='checkbox' name='showGrid' {showGrid}>"
304-
"Print WLAN password to serial<br><input type='checkbox' name='printWifiPassword' {printWifiPassword}>"
305-
"<input type=submit class=btn value=Save>"
306-
"<hr>";
307-
308294
// #########################################
309295
// Config
310296
// #########################################
@@ -561,10 +547,7 @@ void registerPages(HTTPServer * httpServer) {
561547
httpServer->registerNode(new ResourceNode("/updateSdUrl", HTTP_POST, handleFirmwareUpdateSdUrlAction));
562548
httpServer->registerNode(new ResourceNode("/delete", HTTP_GET, handleDelete));
563549
httpServer->registerNode(new ResourceNode("/delete", HTTP_POST, handleDeleteAction));
564-
#ifdef DEVELOP
565-
httpServer->registerNode(new ResourceNode("/settings/development/action", HTTP_GET, handleDevAction));
566-
httpServer->registerNode(new ResourceNode("/settings/development", HTTP_GET, handleDev));
567-
#endif
550+
httpServer->registerNode(new ResourceNode("/privacy_action", HTTP_POST, handlePrivacyAction));
568551
httpServer->registerNode(new ResourceNode("/privacy_action", HTTP_POST, handlePrivacyAction));
569552
httpServer->registerNode(new ResourceNode("/gps", HTTP_GET, handleGps));
570553
httpServer->registerNode(new ResourceNode("/upload", HTTP_GET, handleUpload));
@@ -858,11 +841,6 @@ static void handleIndex(HTTPRequest *, HTTPResponse * res) {
858841
// ###############################################################
859842
String html = createPage(navigationIndex);
860843
html = replaceDefault(html, "Navigation");
861-
#ifdef DEVELOP
862-
html.replace("{dev}", development);
863-
#else
864-
html.replace("{dev}", "");
865-
#endif
866844
sendHtml(res, html);
867845
}
868846

@@ -924,7 +902,7 @@ static void handleAbout(HTTPRequest *req, HTTPResponse * res) {
924902
#ifdef DEVELOP
925903
"true"
926904
#else
927-
"false"
905+
"false"
928906
#endif
929907
);
930908
#ifdef CONFIG_LOG_DEFAULT_LEVEL
@@ -1272,34 +1250,6 @@ static void handleConfig(HTTPRequest *, HTTPResponse * res) {
12721250
sendHtml(res, html);
12731251
}
12741252

1275-
#ifdef DEVELOP
1276-
static void handleDevAction(HTTPRequest *req, HTTPResponse *res) {
1277-
auto params = req->getParams();
1278-
theObsConfig->setBitMaskProperty(0, ObsConfig::PROPERTY_DEVELOPER, ShowGrid,
1279-
getParameter(params, "showGrid") == "on");
1280-
theObsConfig->setBitMaskProperty(0, ObsConfig::PROPERTY_DEVELOPER, PrintWifiPassword,
1281-
getParameter(params, "printWifiPassword") == "on");
1282-
theObsConfig->saveConfig();
1283-
sendRedirect(res, "/settings/development");
1284-
}
1285-
1286-
static void handleDev(HTTPRequest *, HTTPResponse *res) {
1287-
String html = createPage(devIndex);
1288-
html = replaceDefault(html, "Development Setting", "/settings/development/action");
1289-
1290-
// SHOWGRID
1291-
bool showGrid = theObsConfig->getBitMaskProperty(
1292-
0, ObsConfig::PROPERTY_DEVELOPER, ShowGrid);
1293-
html.replace("{showGrid}", showGrid ? "checked" : "");
1294-
1295-
bool printWifiPassword = theObsConfig->getBitMaskProperty(
1296-
0, ObsConfig::PROPERTY_DEVELOPER, PrintWifiPassword);
1297-
html.replace("{printWifiPassword}", printWifiPassword ? "checked" : "");
1298-
1299-
sendHtml(res, html);
1300-
}
1301-
#endif
1302-
13031253
/* Upload tracks found on SD card to the portal server->
13041254
* This method also takes care to give appropriate feedback
13051255
* to the user about the progress. If httpRequest is true

0 commit comments

Comments
 (0)