From 4eef2b57937cba52cbf111cd036303a90a988c70 Mon Sep 17 00:00:00 2001 From: Luke Stein <44452336+lukestein@users.noreply.github.com> Date: Thu, 15 Jan 2026 07:26:39 -0500 Subject: [PATCH] feat: Add MAC address display to WiFi Networks screen (#381) ## Summary * Implements #380, allowing the user to see the device's MAC address in order to register on wifi networks ## Additional Context * Although @markatlnk suggested showing on the settings screen, I implemented display at the bottom of the WiFi Networks selection screen (accessed via "File Transfer" > "Join a Network") since I think it makes more sense there. * Tested on my own device ![IMG_2873](https://github.com/user-attachments/assets/b82a20dc-41a0-4b21-81f1-20876aa2c6b0) --- ### AI Usage While CrossPoint doesn't have restrictions on AI tools in contributing, please be transparent about their usage as it helps set the right context for reviewers. Did you use AI tools to help write this code? _**YES**_ --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> --- src/activities/network/WifiSelectionActivity.cpp | 11 +++++++++++ src/activities/network/WifiSelectionActivity.h | 3 +++ 2 files changed, 14 insertions(+) diff --git a/src/activities/network/WifiSelectionActivity.cpp b/src/activities/network/WifiSelectionActivity.cpp index a8653f4..07d4441 100644 --- a/src/activities/network/WifiSelectionActivity.cpp +++ b/src/activities/network/WifiSelectionActivity.cpp @@ -37,6 +37,14 @@ void WifiSelectionActivity::onEnter() { savePromptSelection = 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 updateRequired = true; @@ -572,6 +580,9 @@ void WifiSelectionActivity::renderNetworkList() const { 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 renderer.drawText(SMALL_FONT_ID, 20, pageHeight - 75, "* = Encrypted | + = Saved"); const auto labels = mappedInput.mapLabels("« Back", "Connect", "", ""); diff --git a/src/activities/network/WifiSelectionActivity.h b/src/activities/network/WifiSelectionActivity.h index 33ea26b..0a7e716 100644 --- a/src/activities/network/WifiSelectionActivity.h +++ b/src/activities/network/WifiSelectionActivity.h @@ -62,6 +62,9 @@ class WifiSelectionActivity final : public ActivityWithSubactivity { // Password to potentially save (from keyboard or saved credentials) std::string enteredPassword; + // Cached MAC address string for display + std::string cachedMacAddress; + // Whether network was connected using a saved password (skip save prompt) bool usedSavedPassword = false;