-
Notifications
You must be signed in to change notification settings - Fork 3k
Network interface MAC address set/get #13936
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
Network interface MAC address set/get #13936
Conversation
Add method set_mac_address to set network interface MAC address.
Add support to set and get MAC address from EMAC interface.
Remove unnecessary method: add_ethernet_interface_ns
Remove final keyword to allow inheritance.
Use nsapi_size_t instread os size_t.
@artokin, thank you for your changes. |
* All interfaces are not supporting MAC address set. A call to connect() | ||
* will fail if MAC address is provided but not possible to use. | ||
* | ||
* @param mac_addr Buffer containing the MAC address |
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.
in what format?
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.
added "in hexadecimal format"
* set before calling the interface connect() method. EUI-48 MAC addresses | ||
* are used for Ethernet while Mesh interface is using 8-byte EUI-64 address. | ||
* | ||
* All interfaces are not supporting MAC address set. A call to connect() |
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.
can't the set_mac_address return an error if it's not supported?
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.
Not easily as the interface initialisation happens during the connect()-method call.
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.
If connect fails I think this makes quite inflexible interface as you can't recover from this and can't make a feature to read Mac from Factory tool, but for devices that has HW support for getting MAC it should override the factory tool configuration. So connect should not fail, but trace out an warning
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.
@mikter , good point!
Connect() failure is now ignored in the correction commit. Would you please review again?
|
||
/** Set the MAC address to the interface. | ||
* | ||
* Provided MAC address is set the the network interface. Address must be |
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.
* Provided MAC address is set the the network interface. Address must be | |
* Provided MAC address is set on the network interface. Address must be |
|
||
nsapi_error_t EmacTestNetworkStack::Interface::set_mac_address(uint8_t *buf, nsapi_size_t buflen) | ||
{ | ||
return NSAPI_ERROR_OK; |
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.
Shouldn't this be NSAPI_ERROR_UNSUPPORTED?
-Update method set_mac_address description -Update EMAC test method return value
@paul-szczepanek-arm , thanks for your comments. |
Jenkins CI Test : ❌ FAILEDBuild Number: 3 | 🔒 Jenkins CI Job | 🌐 Logs & ArtifactsCLICK for Detailed Summary
|
ac517a8
to
0bc2b9e
Compare
-Remove Nanostack::add_ethernet_interface API change -Add get_mac_address to MeshEthernetInterface -Fix compiler warnings by adding overrides
0bc2b9e
to
6a28bce
Compare
A new method has been added to the NetworkInterface. Therfore WICED library needs to be rebuild for ARMC6.
CI restarted |
Jenkins CI Test : ❌ FAILEDBuild Number: 4 | 🔒 Jenkins CI Job | 🌐 Logs & ArtifactsCLICK for Detailed Summary
|
CI restarted |
Jenkins CI Test : ❌ FAILEDBuild Number: 5 | 🔒 Jenkins CI Job | 🌐 Logs & ArtifactsCLICK for Detailed Summary
|
Jenkins CI Test : ✔️ SUCCESSBuild Number: 6 | 🔒 Jenkins CI Job | 🌐 Logs & ArtifactsCLICK for Detailed Summary
|
Summary of changes
Add method set_mac_address that Application can use to set MAC address to the interface.
Update get_mac_address to return MAC address correctly from EMAC.
This PR is copied from: #13902
Impact of changes
Migration actions required
Documentation
Pull request type
Test results
Reviewers
@mikter , @mikaleppanen , @juhhei01 , @JarkkoPaso