Commit Graph

11 Commits (90cd978785d0ac7d38115b09aecee797ff4c8a2c)

Author SHA1 Message Date
Russ Butler 90cd978785 Separate interface from stack in NSAPI
This patch consists of:
-Add NetworkInterface to wrap objects bound to a stack and update
    socket code to handle this in addition to NetworkStacks
-Update MeshInterface to inherit from NetworkInterface
-Update NanostackInterface so it only inherits from NetworkStack
-Add MeshInterfaceNanostack and update LoWPANNDInterface and
    ThreadInterface to inherit from this
2016-07-21 18:20:45 -05:00
Christopher Haster a6edc268f3 Coalesce redundant events to reduce cpu usage in lazy implementations
*cough* esp8266 *cough*

this is especially important for event-loop based systems where
excessive events results in problematic memory consumption.
2016-07-21 18:19:21 -05:00
Russ Butler 8f33c0fc4f Add synchronization to the network socket API
Add mutexes to protect the network socket API.  Also use semaphores to
wait for read/write events.  Also fix a typo in the comments for
timeout.
2016-07-21 18:19:21 -05:00
Christopher Haster 943dd711a9 Added WFI to save power in temporary polling implementation 2016-07-21 18:19:21 -05:00
Christopher Haster f2715b7e77 Consolidate set_timeout/set_blocking behaviour
- Avoids ambiguity when both are used
- Matches Python behaviour
2016-07-21 18:19:21 -05:00
Christopher Haster fc71badb69 Rename Interface -> Stack
NetworkInterface  -> NetworkStack
EthernetInterface -> EthernetStack
WiFiInterface     -> WiFiStack
CellularInterface -> CellularStack
MeshInterface     -> MeshStack
2016-07-21 18:19:21 -05:00
Christopher Haster 0ae11b49e8 Removed is_connected function
- Not supported by TCP/UDP protocols
- Uncommon and less useful with proper error handling
2016-07-21 18:19:21 -05:00
Christopher Haster 56e11d6709 Added better support for SocketAddress/string addresses/ports 2016-07-21 18:19:21 -05:00
Christopher Haster dfc1ca4cef Move to single state-change interrupt
Pros
- Easier to implement
- More similar to SIGIO in BDS sockets

Cons
- Less information, but this information had a high risk of being
  faulty/spurious
2016-07-21 18:19:20 -05:00
Christopher Haster d38ccb70a6 Add open call as alternative to passing NetworkInterface at construction
Pros
- Allows memory to be statically allocated
- Avoids issues with Thread creation before entering main
- Matches existing APIs such as FunctionPointer and Ticker

Cons
- Does not enforce passing a NetworkInterface
2016-07-21 18:19:20 -05:00
Christopher Haster 4c7992cb24 Matched changes NetworkSocketAPI
Responded to feedback from mbed-client implementation
to introduce a full feature set that should support most
of the use cases for the API.
2016-07-21 18:19:10 -05:00