A fork of https://github.com/crosspoint-reader/crosspoint-reader
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

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>

authored by

Luke Stein
copilot-swe-agent[bot]
and committed by
GitHub
4eef2b57 5a55fa1c

+14
+11
src/activities/network/WifiSelectionActivity.cpp
··· 37 37 savePromptSelection = 0; 38 38 forgetPromptSelection = 0; 39 39 40 + // Cache MAC address for display 41 + uint8_t mac[6]; 42 + WiFi.macAddress(mac); 43 + char macStr[32]; 44 + snprintf(macStr, sizeof(macStr), "MAC address: %02x-%02x-%02x-%02x-%02x-%02x", mac[0], mac[1], mac[2], mac[3], mac[4], 45 + mac[5]); 46 + cachedMacAddress = std::string(macStr); 47 + 40 48 // Trigger first update to show scanning message 41 49 updateRequired = true; 42 50 ··· 571 579 snprintf(countStr, sizeof(countStr), "%zu networks found", networks.size()); 572 580 renderer.drawText(SMALL_FONT_ID, 20, pageHeight - 90, countStr); 573 581 } 582 + 583 + // Show MAC address above the network count and legend 584 + renderer.drawText(SMALL_FONT_ID, 20, pageHeight - 105, cachedMacAddress.c_str()); 574 585 575 586 // Draw help text 576 587 renderer.drawText(SMALL_FONT_ID, 20, pageHeight - 75, "* = Encrypted | + = Saved");
+3
src/activities/network/WifiSelectionActivity.h
··· 62 62 // Password to potentially save (from keyboard or saved credentials) 63 63 std::string enteredPassword; 64 64 65 + // Cached MAC address string for display 66 + std::string cachedMacAddress; 67 + 65 68 // Whether network was connected using a saved password (skip save prompt) 66 69 bool usedSavedPassword = false; 67 70