Commit Graph

32 Commits (1d6f86f55363dc19b72d82ac93d9d33df07d406b)

Author SHA1 Message Date
Hugues Kamba 1d6f86f553 CMake: Add support for features dir 2020-11-06 17:25:15 +00:00
Ashok Rao b9b4c5d392 Mbed OS will soon be changing directory structure to the below:
```
connectivity
├── netsocket
├── lwipstack
├── nanostack
│   ├── mbed_lib.json // nanostack-interface's mbed_lib.json
│   ├── include
│   │   └── nanostack // headers from features/netsocket/nanostack-interface
│   ├── source        // sources from features/netsocket/nanostack-interface
│   ├── coap-service  // used by Thread only - deprecate?
│   ├── mbed-mesh-api
│   ├── nanostack-hal-mbed-cmsis-rtos // HAL porting layer for Nanostack on mbed with CMSIS-RTOS
│   ├── sal-stack-nanostack
│   └── sal-stack-nanostack-eventloop
├── cellular                // previously in features/cellular/framework/
├── ...

```

This PR is a part of a wider \connectivity refactoring and implements the above new directory structure for \nanostack.
2020-08-05 16:55:43 +01:00
Rajkumar Kanagaraj f026f0d54f Move nanostack rf driver from features/nanostack/nanostack-interface into connectivity/drivers/802.15.4_RF 2020-07-30 03:47:52 -07:00
Lingkai Dong d27ec8272a Apply astyle fix from CI 2020-07-03 16:24:38 +01:00
Lingkai Dong acfbca7ada Fix duplication of KW41Z Nanostack driver 2020-07-03 15:57:07 +01:00
Lingkai Dong 8a31b6a7ca Apply astyle suggestions from the CI 2020-06-16 15:29:48 +01:00
Lingkai Dong 7149877c5d Move target implementations of NanostackRfPhy into the nanostack-interface library
Fixes: #13109

Prior to this commit, target implementations of NanostackRfPhy
are not guarded by any mbed_lib.json - they are always visible
to the build even if the interface itself is not enabled
(e.g. when using the "requires" attribute of mbed_app.json).
It causes build errors.

To resolve this, this commit move target code into
nanostack-interface, similar to what we do with BLE targets.
2020-06-15 16:45:13 +01:00
Hugues Kamba 1beb8d3810 Ensure all overridden virtual functions are marked with `override`
This also removes warnings.
2020-06-01 10:39:42 +01:00
Arto Kinnunen a7d3a981b7 Add getsockopt option to reading network property
Add getsockopt options NSAPI_LATENCY and NSAPI_STAGGER to read
network specific timing constraints from socket.
-NS_LATENCY returns estimated latency to given address.
-NSAPI_STAGGER returns estimated initial delay that application
 should wait before transmitting data to network.

Application can use the new options to avoid network congestion by
adjusting transmission delays and retry timeouts.
2020-04-17 08:55:48 +03:00
Kevin Bracey 04580b73d8 C++11-ify virtualisation in Nanostack classes
Use `override` and `final` where appropriate, and eliminate unnecessary
`virtual`.

Some other C++11 simplifications.

Eliminate two unused header files (with no corresponding source files).

Reduces code size.
2020-02-21 15:20:57 +02:00
Michal Paszta f21b8c7fc1 Remove remaining string-based API functions
This removes any compiler warnings.
2020-02-06 11:27:50 +02:00
Juha Heiskanen b71d5edd38 Nanostack Socket event handler fix
SOCKET_TX_DONE not generate event signal anymore for SOCKET_MODE_DATAGRAM.
Event handler try to read socket which is not necessary in that case.
2020-01-03 18:24:12 +02:00
Mika Tervonen 86e3a5a021 Modified Wi-SUN tasklet to return correct status when calling connect twice
When calling mesh connect method twice NSAPI_ERROR_IS_CONNECTED is returned
instead of NSAPI_ERROR_DEVICE_ERROR Following the mesh API documentation.
2019-09-30 14:15:14 +03:00
Mika Leppänen a2df462f65 Nanostack changes for PPP service
Created PPP interface for PPP service. Re-used the ethernet tasklet
and PHY driver structure for PPP.
2019-08-20 13:37:12 +03:00
Tero Jääskö 14bb4399b3 nanostack: silence compiler warnings for implicit virtual call_in
ARMCC reminds of the missing virtual declaration of call_in in the
Nanostack.h.

Warnings silenced:
---8<---8<---
Compile [ 52.3%]: LoWPANNDInterface.cpp
[Warning] Nanostack.h@278,0:  #1300-D: call_in inherits implicit virtual
Compile [ 52.4%]: NanostackEMACInterface.cpp
[Warning] Nanostack.h@278,0:  #1300-D: call_in inherits implicit virtual
Compile [ 52.5%]: MeshInterfaceNanostack.cpp
[Warning] Nanostack.h@278,0:  #1300-D: call_in inherits implicit virtual
Compile [ 52.6%]: NanostackEthernetInterface.cpp
[Warning] Nanostack.h@278,0:  #1300-D: call_in inherits implicit virtual
Compile [ 52.7%]: ThreadInterface.cpp
[Warning] Nanostack.h@278,0:  #1300-D: call_in inherits implicit virtual
ompile [ 53.0%]: WisunInterface.cpp
[Warning] Nanostack.h@278,0:  #1300-D: call_in inherits implicit virtual
2019-06-26 16:55:10 +03:00
Michal Paszta d1d0118752 Nanostack: translate errors from sendmsg
Translate errors to NSAPI_ERROR_*, instead of always returning
NSAPI_ERROR_DEVICE_ERROR
2019-04-16 15:03:50 +03:00
Arto Kinnunen f0d7e205ff Update nanostack-interface error mapping
Use status NSAPI_ERROR_PARAMETER instead of NSAPI_ERROR_UNSUPPORTED
when error is caused by parameter.
2019-03-08 16:28:20 +02:00
Jimmy Brisson 724487d545 Require dependencies from nanostack mbed_lib.json 2019-02-07 09:39:10 -06:00
Oren Cohen 94c17549dc Fix nanostack libs 2019-02-07 09:23:52 -06:00
Antti Kauppila 02b0f79e15 mbed.h includes removed 2018-12-28 14:36:10 +02:00
Martin Kojtal f1f64266c0
Merge pull request #8600 from KariHaapalehto/wisuninterface_created
Wi-SUN interface implementation.
2018-11-22 10:55:58 +01:00
Martin Kojtal eec4e1329a nanostack interface: fix coding style 2018-11-15 07:20:12 +00:00
Kari Haapalehto 4440612d42 This is a initial version of Wi-Sun interface implementation.
To get Wi-Sun mesh network working, also nanostack with Wi-Sun support
is needed. ws_empty_functions.c and ws_management_api.h are temporary
included here, so that wisun_tasklet will compiled without problems.
They will replaced with the official versions with next nanostack release.
2018-10-31 15:48:33 +02:00
Deepika a47c6b8139 Nanostack: Add required header file and namespace element instead add all 2018-10-15 10:57:21 -05:00
Juha Ylinen b8a7e25e84 Nanostack: Fix return code for unsupported socket options 2018-08-20 16:30:19 +03:00
Juha Ylinen 942b77255b Nanostack: fix error code
Return NSAPI_ERROR_NO_MEMORY if socket->open() fails
2018-08-03 12:13:21 +03:00
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