-
Notifications
You must be signed in to change notification settings - Fork 940
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add MACAddress to config.yaml #5506
Conversation
Humans are generally not good at generating random numbers, I'm afraid this would higher the chance of We could probably also try getting an Ethernet MAC if there's no Bluetooth, right? |
Honestly I was just copying from my local Ethernet device. We could encourage that, or maybe even automate it. |
Yeah, I think that would be nice. |
OK, I'll see about adding another option, to specify the network device to pull the MAC from. Should we consider the blank mac address an error condition? I'm thinking maybe yes, to prevent the proliferation of bogus devices. |
Sounds good, and yes, I think that should generate an (easily interpretable) error. |
…nk MAC Address and real hardware.
uint8_t dmac[6]; | ||
getMacAddr(dmac); | ||
if (dmac[0] == 128 && dmac[1] == 0 && dmac[2] == 0 && dmac[3] == 0 && dmac[4] == 0 && dmac[5] == 1) { | ||
std::cout << "*** Blank MAC Address not allowed! " << std::endl; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about: "MAC address should be set in 'config.yaml'"
? Then it's easier to figure out how to fix it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes. Still a WIP. I'll finalize the error message once the new options are available.
Actually, is there a good reason we have the getMacAddr() function in portduino at all? That's not a standard Arduino function. I'm very much inclined to just pull the whole thing into the portduinoGlue file. Makes it all way easier |
I think it would indeed by fine to remove it, it's indeed not an Arduino function. |
Allows setting a virtual MAC Address in config.yaml