Skip to content

Commit d9a487d

Browse files
committed
WebSockets: Split out webSockets from webServer
1 parent d30f295 commit d9a487d

File tree

5 files changed

+399
-362
lines changed

5 files changed

+399
-362
lines changed

Firmware/RTK_Everywhere/States.ino

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ void stateUpdate()
171171
| Set fixedBase true
172172
| STATE_BASE_NOT_STARTED falls into
173173
| STATE_BASE_FIXED_NOT_STARTED
174-
|
174+
|
175175
V
176176
.-----------------------------------.
177177
startBase() | STATE_BASE_NOT_STARTED |
@@ -489,7 +489,7 @@ void stateUpdate()
489489
// Confirm receipt so the web interface stops sending the config blob
490490
if (settings.debugWebServer == true)
491491
systemPrintln("Sending receipt confirmation of settings");
492-
sendStringToWebsocket("confirmDataReceipt,1,");
492+
webSocketsSendString("confirmDataReceipt,1,");
493493

494494
// Disallow new data to flow from websocket while we are parsing the current data
495495
currentlyParsingData = true;
@@ -527,21 +527,13 @@ void stateUpdate()
527527
if ((millis() - lastDynamicDataUpdate) > 1000)
528528
{
529529
lastDynamicDataUpdate = millis();
530-
createDynamicDataString(settingsCSV);
531-
532-
sendStringToWebsocket(settingsCSV);
530+
webSocketsSendSettings();
533531
}
534532

535533
// If a firmware version was requested, and obtained, report it back to the web page
536534
if (strlen(otaReportedVersion) > 0)
537535
{
538-
createFirmwareVersionString(settingsCSV);
539-
540-
if (settings.debugWebServer)
541-
systemPrintf("WebServer: Firmware version requested. Sending: %s\r\n", settingsCSV);
542-
543-
sendStringToWebsocket(settingsCSV);
544-
536+
webSocketsSendFirmwareVersion();
545537
otaReportedVersion[0] = '\0'; // Zero out the reported version
546538
}
547539
}

0 commit comments

Comments
 (0)