Skip to content

Commit bff88ad

Browse files
committed
WiFi: Add wifiStationDisplayData to display SSID, channel and RSSI
1 parent 5a5c744 commit bff88ad

File tree

3 files changed

+21
-0
lines changed

3 files changed

+21
-0
lines changed

Firmware/RTK_Everywhere/Developer.ino

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,7 @@ IPAddress wifiSoftApGetIpAddress() {return IPAddress((uint32_t)0);}
216216
const char * wifiSoftApGetSsid() {return "";}
217217
bool wifiSoftApOff(const char * fileName, uint32_t lineNumber) {return true;}
218218
bool wifiSoftApOn(const char * fileName, uint32_t lineNumber) {return false;}
219+
void wifiStationDisplayData() {}
219220
bool wifiStationOff(const char * fileName, uint32_t lineNumber) {return true;}
220221
bool wifiStationOn(const char * fileName, uint32_t lineNumber) {return false;}
221222
void wifiStationUpdate() {}

Firmware/RTK_Everywhere/Network.ino

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -788,6 +788,10 @@ void networkDisplayInterface(NetIndex_t index)
788788
networkValidateIndex(index);
789789
entry = &networkInterfaceTable[index];
790790
networkDisplayNetworkData(entry->name, entry->netif);
791+
792+
// Display additional WiFi data
793+
if (index == NETWORK_WIFI_STATION)
794+
wifiStationDisplayData();
791795
}
792796

793797
//----------------------------------------

Firmware/RTK_Everywhere/WiFi.ino

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -728,6 +728,22 @@ bool wifiSoftApOn(const char * fileName, uint32_t lineNumber)
728728
__FILE__, __LINE__);
729729
}
730730

731+
//*********************************************************************
732+
// Display additional Wifi data
733+
void wifiStationDisplayData()
734+
{
735+
// Display additional WiFi data
736+
if (WiFi.STA.linkUp())
737+
{
738+
String ssid = WiFi.STA.SSID();
739+
int32_t channel = WiFi.channel();
740+
int8_t rssi = WiFi.STA.RSSI();
741+
systemPrintf(" SSID: %s\r\n", ssid.c_str());
742+
systemPrintf(" Channel: %d\r\n", channel);
743+
systemPrintf(" RSSI: %4d\r\n", rssi);
744+
}
745+
}
746+
731747
//*********************************************************************
732748
// Determine if WiFi should be running
733749
bool wifiStationEnabled(const char ** reason)

0 commit comments

Comments
 (0)