tinyusb icon indicating copy to clipboard operation
tinyusb copied to clipboard

tud_network_mac_address should be initialized by hardware ID but is const

Open maxnet opened this issue 4 years ago • 1 comments

Is your feature request related to a problem? Please describe.

https://github.com/hathach/tinyusb/blob/master/examples/device/net_lwip_webserver/src/main.c#L61 mentions that ideally the MAC should be generated by hardware ID. However the variable is declared const in https://github.com/hathach/tinyusb/blob/master/src/class/net/net_device.h#L62 and in https://github.com/hathach/tinyusb/blob/master/lib/networking/rndis_reports.c#L39

Describe the solution you'd like

Remove "const" so that the MAC can be changed by program in an initialization routine at the start of program that queries the device's serial number and derives MAC from that.

maxnet avatar Mar 14 '21 12:03 maxnet

yeah, it even has an TODO remove later as well, apparently I plan to remove it. I will check it out later on to see what is best to change.

hathach avatar Mar 17 '21 06:03 hathach

@hathach Any progress on this? Having an address that needs to be different on every board be const seems like a bad plan...

If there is currently no plans to move the TODO to TODONE, is there any chance the const can be removed?

MattMills avatar Mar 22 '23 07:03 MattMills

I haven't got time to reviewt net driver, please submit PR if you have suggestion.

hathach avatar Mar 22 '23 08:03 hathach

fixed now

hathach avatar Mar 29 '23 06:03 hathach