-
Notifications
You must be signed in to change notification settings - Fork 3k
ONME-2857: Ethernet interface for Nanostack #3267
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
Conversation
* Move all the functionality to LoWPANNDInterface and ThreadInterface classes. * AbstractMesh class modified to be pure virtual * Thread/6LoWPAN specific functionality totally separated. Now linker will drop the unreferenced classes. * MeshInterfaceNanostack now inherits from AbstractMesh
+Also nanostack_lock() moved to mesh_system.h +Added includes into NanostackInterface.h to be backward compatible
This is to allow other types of PHY drivers than just RF. Mesh-API does not actually care about driver type, it is drivers responsibility to register right handlers with Nanostack. * Implement a wrapper class NanostackRfPhy to ensure backward compatibility. * Remove mesh_connect()/disconnect() functions from MeshInterface This job is already done in inherited classes. * LoWPANNDInterface and ThreadInterface should only be used with NanostackRfPhy.
* New Phy type: NanostackEthernetPhy * New tasklet: enet_tasklet. * New Interface: NanostackEthernetInterface, inherited from MeshInterfaceNanostack
Like it on the whole, but I think we do need to do the class shenanigans so that NanostackEthernetInterface is an EthInterface, not a MeshInterface. Currently matters not a jot, given that both those are empty classes derived from NetworkInterface, but it will cause future trouble the moment someone puts any methods in either of those, and wants to switch between an LWIP "EthernetInterface" and our "NanostackEthernetInterface". |
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.
I think mbed-mesh-api is not just a mesh-api anymore. IMO its time to retire mbed-mesh-api. As an Ethernet Interface is also added, it should be called as mbed-ns-api where ns stands for nanostack.
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.
I know it will sound confusing to refactor MeshInterfaceNanostack() as InterfaceNanostack() as we already have a NanostackInterface()
How about NanostackInterfaceFactory() or NanostackInterfaceAdaptor() ?
Use of word in mesh while describing Ethernet is confusing.
Other than that, it looks pretty nice. However, in Diagram 2, I think NanostackEthernetINterface does not inherit EthInterface. Actually it inherirts MeshInterfaceNanostack only. |
OK. Good feedback. If all agree, I think this is now good to go in, and I will need follow up task in backlog to continue working on this (but not a scope for 5.3 release). @0xc0170 @sg- From my point of view, this is now good to go in. |
/morph test-nightly |
For NetworkStack::gethostbyname() to properly validate the IP address version, we must return a valid address from Networkstack::get_ip_address().
@bridadan Can you pls abort the CI? @SeppoTakalo Is this PR ready for review/integration? |
Result: FAILUREYour command has finished executing! Here's what you wrote!
OutputTest Prep failed! |
I added one more fix that I just found. There was a problem when querying DNS addresses using Nanostack. It always defaulted to IPv4. So actually the problem was that Problem is that network stacks don't have addresses. Only interfaces have addresses. Therefore This is ready for review now. I can run valid DNS query. Sorry for inconveniently sending a bugfix into this same branch. |
@0xc0170 Ready for review and integration. |
Sorry for the failure y'all, the test network has been experiencing big slow downs for GitHub cloning this week. I've increased the timeouts on all the clone steps in the meantime while these slow downs are occurring. /morph test-nightly |
Seems like we should either do a little better for the get_ip_address(), or try to get it deprecated. Trying to get some sort of valid address for a stack doesn't seem unreasonable as a utility function - search interfaces belonging to that stack for a global address? Could this be done in the generic layers? Not for this PR though. That fudge is an incremental improvement - noting that it isn't actually "localhost", its "IPv6 unspecified". I think I do prefer unspecified to localhost ("::1"). (Micronit: returning a literal "::" might also be better - it can save ROM by addressing tricks and string sharing. You don't actually need a unique "::" string array, which that gives you. |
@bridadan All builds and test passed! |
@SeppoTakalo Haha you've figured out how to take my bot's place! 😄 Yesterday we had an issue where the CI server's power cord was kicked so the bot lost track of all the jobs. Shouldn't be an issue anymore. |
@bridadan Shall we restart tests? |
@0xc0170 Shouldn't need to as the tests actually completed fine, they just didn't change the GitHub status. If you click the "Details" link next to the "pending" check, you can see everything completed successfully. |
@SeppoTakalo do you wish to address @kjbracey-arm comment about returning a string literal? Or is this ready to just be merged ? |
@adbridge This is ready. We can address Kevin's proposal on next round. Functionality will be the same anyway. |
Description
Status
READY
Migrations
No changes to public APIs, except new NanostackEthernetInterface class provided.
Todos
Tests
Tested with K64F using different radios and connectivity options. Application used for testing was
mbed-os-example-mesh-minimal
When using Ethernet, the app was modified to use the Ethernet instead of 6LoWPAN or Thread. Example Ethernet driver is here: https://github.com/ARMmbed/sal-nanostack-driver-k64f-eth/tree/nanostackphy
Modified basically like this:
After joining the network, connectivity was verified by sending ping requests to its IPv6 address.
@kjbracey-arm @mikaleppanen @hasnainvirk Please review.