Skip to content

Commit 936db2f

Browse files
authored
Merge pull request #705 from LeeLeahy2/ap-name
WiFi: Set the soft AP name
2 parents dee42a9 + 89e6190 commit 936db2f

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

Firmware/RTK_Everywhere/States.ino

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,6 @@ void stateUpdate()
208208
case (STATE_BASE_CASTER_NOT_STARTED): {
209209
baseCasterEnableOverride();
210210

211-
wifiSoftApSsid = "RTK Caster";
212211
changeState(STATE_BASE_NOT_STARTED);
213212
}
214213
break;
@@ -431,7 +430,6 @@ void stateUpdate()
431430
for (int serverIndex = 0; serverIndex < NTRIP_SERVER_MAX; serverIndex++)
432431
ntripServerStop(serverIndex, true); // Do not allocate new wifiClient
433432

434-
wifiSoftApSsid = "RTK Config";
435433
webServerStart(); // Start the webserver state machine for web config
436434

437435
RTK_MODE(RTK_MODE_WEB_CONFIG);
@@ -458,9 +456,9 @@ void stateUpdate()
458456
//Create temporary copy of Settings, so that we can check if they change while parsing
459457
//Useful for detecting when we need to change WiFi station settings
460458
wifiSettingsClone();
461-
459+
462460
parseIncomingSettings();
463-
461+
464462
settings.gnssConfiguredOnce = false; // On the next boot, reapply all settings
465463
settings.gnssConfiguredBase = false;
466464
settings.gnssConfiguredRover = false;

Firmware/RTK_Everywhere/WiFi.ino

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -773,6 +773,12 @@ bool wifiSoftApOn(const char *fileName, uint32_t lineNumber)
773773
if (settings.debugWifiState)
774774
systemPrintf("wifiSoftApOn called in %s at line %d\r\n", fileName, lineNumber);
775775

776+
// Select the AP name
777+
if (inWebConfigMode())
778+
wifiSoftApSsid = "RTK Config";
779+
else
780+
wifiSoftApSsid = "RTK";
781+
776782
return wifi.enable(wifiEspNowRunning, true, wifiStationRunning, __FILE__, __LINE__);
777783
}
778784

@@ -1418,7 +1424,7 @@ bool RTK_WIFI::enable(bool enableESPNow, bool enableSoftAP, bool enableStation,
14181424
// Allocate the soft AP SSID
14191425
if (!_apSsid)
14201426
{
1421-
_apSsid = (char *)rtkMalloc(strlen(wifiSoftApSsid) + 1, "SSID string (_apSsid)");
1427+
_apSsid = (char *)rtkMalloc(SSID_LENGTH + 1 + 4 + 1, "SSID string (_apSsid)");
14221428
if (_apSsid)
14231429
_apSsid[0] = 0;
14241430
else

0 commit comments

Comments
 (0)