mirror of
https://github.com/daveallie/crosspoint-reader.git
synced 2026-02-07 16:17:38 +03:00
Add MAC address display to WiFi Networks screen
Co-authored-by: lukestein <44452336+lukestein@users.noreply.github.com>
This commit is contained in:
parent
990ce591b5
commit
f047e54262
@ -445,6 +445,17 @@ std::string WifiSelectionActivity::getSignalStrengthIndicator(const int32_t rssi
|
||||
return " "; // Very weak
|
||||
}
|
||||
|
||||
std::string WifiSelectionActivity::getMacAddressString() const {
|
||||
uint8_t mac[6];
|
||||
WiFi.macAddress(mac);
|
||||
|
||||
char macStr[24];
|
||||
snprintf(macStr, sizeof(macStr), "MAC address: %02X-%02X-%02X-%02X-%02X-%02X",
|
||||
mac[0], mac[1], mac[2], mac[3], mac[4], mac[5]);
|
||||
|
||||
return std::string(macStr);
|
||||
}
|
||||
|
||||
void WifiSelectionActivity::displayTaskLoop() {
|
||||
while (true) {
|
||||
// If a subactivity is active, yield CPU time but don't render
|
||||
@ -572,6 +583,10 @@ void WifiSelectionActivity::renderNetworkList() const {
|
||||
renderer.drawText(SMALL_FONT_ID, 20, pageHeight - 90, countStr);
|
||||
}
|
||||
|
||||
// Show MAC address above the network count and legend
|
||||
std::string macAddress = getMacAddressString();
|
||||
renderer.drawText(SMALL_FONT_ID, 20, pageHeight - 105, macAddress.c_str());
|
||||
|
||||
// Draw help text
|
||||
renderer.drawText(SMALL_FONT_ID, 20, pageHeight - 75, "* = Encrypted | + = Saved");
|
||||
const auto labels = mappedInput.mapLabels("« Back", "Connect", "", "");
|
||||
|
||||
@ -90,6 +90,7 @@ class WifiSelectionActivity final : public ActivityWithSubactivity {
|
||||
void attemptConnection();
|
||||
void checkConnectionStatus();
|
||||
std::string getSignalStrengthIndicator(int32_t rssi) const;
|
||||
std::string getMacAddressString() const;
|
||||
|
||||
public:
|
||||
explicit WifiSelectionActivity(GfxRenderer& renderer, MappedInputManager& mappedInput,
|
||||
|
||||
Loading…
Reference in New Issue
Block a user