W5500 MAC Adress handling #1720
-
first of all, thank you for this new LAN support :) While it puzzled me where the MAC-Adress comes from in the W5500 example i solved that with digging through the ocde. I cannot find details to Second - there seems to be no possibility to get the mac over the Wiznet5500lwIP object... shouldn't be there the possibility? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
See https://github.com/raspberrypi/pico-sdk/blob/6a7db34ff63345a7badec79ebea3aaef1712f374/src/rp2_common/pico_cyw43_driver/cyw43_driver.c#L132 for the MAC generation. It uses the flash ID and should be unique. It's the same code used on the WiFi driver. Each interface also gets adjusted so if you have 2 network drivers on the same device they won't have identical MACs As for getting the MAC, that seems reasonable. Maybe you'd like to do a PR? I think the LeipIntfDev would be the spot to add the accessor/setter. |
Beta Was this translation helpful? Give feedback.
-
I found out you can access the mac through the netif. eth.getNetIf()->hwaddr; Do you think there is still a need on the LeipIntfDev level? |
Beta Was this translation helpful? Give feedback.
See https://github.com/raspberrypi/pico-sdk/blob/6a7db34ff63345a7badec79ebea3aaef1712f374/src/rp2_common/pico_cyw43_driver/cyw43_driver.c#L132 for the MAC generation. It uses the flash ID and should be unique. It's the same code used on the WiFi driver. Each interface also gets adjusted so if you have 2 network drivers on the same device they won't have identical MACs
As for getting the MAC, that seems reasonable. Maybe you'd like to do a PR? I think the LeipIntfDev would be the spot to add the accessor/setter.