Merge pull request #2 from lukestein/copilot/add-mac-address-display
feat: Add MAC address display to WiFi Networks screen
This commit is contained in:
commit
e5d05a9e48
@ -37,6 +37,14 @@ void WifiSelectionActivity::onEnter() {
|
|||||||
savePromptSelection = 0;
|
savePromptSelection = 0;
|
||||||
forgetPromptSelection = 0;
|
forgetPromptSelection = 0;
|
||||||
|
|
||||||
|
// Cache MAC address for display
|
||||||
|
uint8_t mac[6];
|
||||||
|
WiFi.macAddress(mac);
|
||||||
|
char macStr[32];
|
||||||
|
snprintf(macStr, sizeof(macStr), "MAC address: %02x-%02x-%02x-%02x-%02x-%02x", mac[0], mac[1], mac[2], mac[3], mac[4],
|
||||||
|
mac[5]);
|
||||||
|
cachedMacAddress = std::string(macStr);
|
||||||
|
|
||||||
// Trigger first update to show scanning message
|
// Trigger first update to show scanning message
|
||||||
updateRequired = true;
|
updateRequired = true;
|
||||||
|
|
||||||
@ -572,6 +580,9 @@ void WifiSelectionActivity::renderNetworkList() const {
|
|||||||
renderer.drawText(SMALL_FONT_ID, 20, pageHeight - 90, countStr);
|
renderer.drawText(SMALL_FONT_ID, 20, pageHeight - 90, countStr);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Show MAC address above the network count and legend
|
||||||
|
renderer.drawText(SMALL_FONT_ID, 20, pageHeight - 105, cachedMacAddress.c_str());
|
||||||
|
|
||||||
// Draw help text
|
// Draw help text
|
||||||
renderer.drawText(SMALL_FONT_ID, 20, pageHeight - 75, "* = Encrypted | + = Saved");
|
renderer.drawText(SMALL_FONT_ID, 20, pageHeight - 75, "* = Encrypted | + = Saved");
|
||||||
const auto labels = mappedInput.mapLabels("« Back", "Connect", "", "");
|
const auto labels = mappedInput.mapLabels("« Back", "Connect", "", "");
|
||||||
|
|||||||
@ -62,6 +62,9 @@ class WifiSelectionActivity final : public ActivityWithSubactivity {
|
|||||||
// Password to potentially save (from keyboard or saved credentials)
|
// Password to potentially save (from keyboard or saved credentials)
|
||||||
std::string enteredPassword;
|
std::string enteredPassword;
|
||||||
|
|
||||||
|
// Cached MAC address string for display
|
||||||
|
std::string cachedMacAddress;
|
||||||
|
|
||||||
// Whether network was connected using a saved password (skip save prompt)
|
// Whether network was connected using a saved password (skip save prompt)
|
||||||
bool usedSavedPassword = false;
|
bool usedSavedPassword = false;
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user