Commit Graph

6 Commits (a9ba4f9bf51bafaa086ad4153f0b1a615d37dce2)

Author SHA1 Message Date
Kevin Bracey e06923c64a Make Nanostack C++ constructor initialise Nanostack
Nanostack object constructor didn't actually initialise Nanostack.
Nanostack initialisation was deferred until an interface was actually
attached to the stack, which generally happened at first interface
connect.

Not normally a problem, unless you're trying to make direct Nanostack
setup calls prior to connect - some applications do this, and were
relying on ThreadInterface::initialise to do Nanostack
initialisation.

Unfortunately in 5.9 ThreadInterface::initialise no longer does
initialise Nanostack immediately, because the mesh interfaces were
aligned and integrated with the Ethernet interfaces, which did
initialisation on connect().

Make the Nanostack object constructor initialise Nanostack (as the LWIP
constructor does for lwIP), so calling Nanostack::get_instance() is the
5.9 API for Nanostack initialisation.

For future work, APIs like ns_file_system_set_root_path should be
exposed as methods of Nanostack, so everything happens with a single
Nanostack::get_instance().file_system_set_root_path().
2018-06-08 13:00:58 +03:00
Kevin Bracey f3ec0dacd5 Add NetworkInterface::get_default_instance()
Provide an initial framework to make it easier to find a default network
interface.
2018-05-23 12:25:17 +03:00
Mika Leppänen 1c01f5dda4 Corrected defects
- Changed call_in/call methods of the stack to callback provided by the stack
- Specified what are limitations for operations that are made in callback
- Added pure virtual class DNS that defines DNS operations
- Added cancel operation and unique ID to DNS request used in cancel
- Added DNS configuration options to netsocket/mbed_lib.json for retries,
  response wait time and cache size
- Changed host name to use dynamic memory in DNS query list and cache,
  set maximum length for the name to 255 bytes.
- Added mutex to asynchronous DNS
- Reworked retries: there is now total retry count and a server specific count
- Ignores invalid incoming UDP socket messages (DNS header is not valid), and retries DNS query
- Reworked DNS module asynchronous operation functions
- Corrected other review issues (nothrow new, missing free, missing mutex unlock etc.)
2018-05-23 12:24:10 +03:00
Mika Leppänen b7e8400c2c Added non-blocking DNS functionality to network interface
- Added non-blocking DNS interface to network interface and
  network stack.
- Added caching of DNS replies.
- Added a network stack function to get DNS addresses from stack.
- Added call and call_in hooks to onboard network stack to
  allow calling functions from onboard stack context.
- Added support to call and call_in functions to LWIP and
  Nanostack.
- Disabled LWIP DNS translator with the exception of DNS
  address storage used in DNS address get.
2018-05-23 12:24:10 +03:00
Kevin Bracey 3c83c62ff7 Nanostack EMAC implementation
Make Nanostack an OnboardNetworkInterface, implementing
add_ethernet_interface so it can use EMAC drivers.

Can now be used via EthernetInterface, and be the system's default
network stack.

Legacy support for NanostackEthernetInterface retained. Some
restructuring of mesh interface code to fit into the
OnboardNetworkStack:::Interface system.
2018-05-23 12:24:04 +03:00
Seppo Takalo f0bf771502 Get rid of FEATURE_NANOSTACK
Allow FEATURE_NANOSTACK still to be defined in the build so
that we don't break any builds.
2018-04-27 14:38:44 +03:00