fix(example): Update GetMacddress.ino for 8 and 2 byte MACs#12262
fix(example): Update GetMacddress.ino for 8 and 2 byte MACs#12262
Conversation
👋 Hello me-no-dev, we appreciate your contribution to this project! 📘 Please review the project's Contributions Guide for key guidelines on code, documentation, testing, and more. 🖊️ Please also make sure you have read and signed the Contributor License Agreement for this project. Click to see more instructions ...
Review and merge process you can expect ...
|
Memory usage test (comparing PR against master branch)The table below shows the summary of memory usage change (decrease - increase) in bytes and percentage for each target.
Click to expand the detailed deltas report [usage change in BYTES]
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
This pull request enhances the
GetMacAddressexample for ESP32 by adding support for devices that include IEEE 802.15.4 (Thread/Zigbee) and external MAC addresses, and by updating the code to handle both 6-byte and 8-byte MAC addresses when relevant. The changes ensure the example works correctly on more ESP32 variants and displays the correct MAC address format depending on the interface.Support for additional MAC address types and formats:
setup()to clarify that MAC addresses may be 6 or 8 bytes, reflecting the new interface support.esp_read_macfor these interfaces.Generalization for variable MAC address lengths:
getDefaultMacAddress()andgetInterfaceMacAddress()functions to use 8-byte buffers and dynamically format either 6-byte or 8-byte MAC addresses, depending on the interface and configuration. [1] [2]Fixes: #12255