Skip to content

Commit 54f7633

Browse files
committed
Print SSID when connected
1 parent d662824 commit 54f7633

File tree

3 files changed

+13
-4
lines changed

3 files changed

+13
-4
lines changed

Firmware/RTK_Everywhere/Developer.ino

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,7 @@ bool wifiConnect(unsigned long timeout) {return false;}
152152
IPAddress wifiGetGatewayIpAddress() {return IPAddress((uint32_t)0);}
153153
IPAddress wifiGetIpAddress() {return IPAddress((uint32_t)0);}
154154
int wifiGetRssi() {return -999;}
155+
String wifiGetSsid() {return "**WiFi Not compiled**";}
155156
bool wifiIsConnected() {return false;}
156157
bool wifiIsNeeded() {return false;}
157158
int wifiNetworkCount() {return 0;}

Firmware/RTK_Everywhere/Network.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -389,7 +389,7 @@ void networkDisplayIpAddress(uint8_t networkType)
389389
{
390390
strcpy(ipAddress, networkGetIpAddress(networkType).toString().c_str());
391391
if (network->type == NETWORK_TYPE_WIFI)
392-
systemPrintf("%s IP address: %s, RSSI: %d\r\n", networkName[network->type], ipAddress, wifiGetRssi());
392+
systemPrintf("%s '%s' IP address: %s, RSSI: %d\r\n", networkName[network->type], ipAddress, wifiGetSsid(), wifiGetRssi());
393393
else
394394
systemPrintf("%s IP address: %s\r\n", networkName[network->type], ipAddress);
395395

Firmware/RTK_Everywhere/WiFi.ino

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ void menuWiFi()
171171
// Display the WiFi IP address
172172
void wifiDisplayIpAddress()
173173
{
174-
systemPrintf("WiFi %s IP address: ", WiFi.SSID());
174+
systemPrintf("WiFi '%s' IP address: ", WiFi.SSID());
175175
systemPrint(WiFi.localIP());
176176
systemPrintf(" RSSI: %d\r\n", WiFi.RSSI());
177177

@@ -253,12 +253,15 @@ bool wifiStartAP(bool forceAP)
253253
IPAddress subnet(255, 255, 255, 0);
254254

255255
WiFi.softAPConfig(local_IP, gateway, subnet);
256-
if (WiFi.softAP("RTK Config") == false) // Must be short enough to fit OLED Width
256+
257+
const char *softApSsid = "RTK Config";
258+
259+
if (WiFi.softAP(softApSsid) == false) // Must be short enough to fit OLED Width
257260
{
258261
systemPrintln("WiFi AP failed to start");
259262
return (false);
260263
}
261-
systemPrint("WiFi AP Started with IP: ");
264+
systemPrintf("WiFi AP '%s' started with IP: ", softApSsid);
262265
systemPrintln(WiFi.softAPIP());
263266

264267
// Start DNS Server
@@ -708,4 +711,9 @@ int wifiGetRssi()
708711
return WiFi.RSSI();
709712
}
710713

714+
String wifiGetSsid()
715+
{
716+
return WiFi.SSID();
717+
}
718+
711719
#endif // COMPILE_WIFI

0 commit comments

Comments
 (0)