Commit Graph

18 Commits (3fe5d320ec12c2ac971de136652c65d3bdbdd087)

Author SHA1 Message Date
Christopher Haster 68365a9a59 Increased lwip connect timeout to 5 seconds by default
For very slow networks the previous default has be problematically short
2016-07-22 02:02:37 -05:00
Christopher Haster d82bbb1c40 Fixed incorrect semaphore handling on lwip connect and socket_connect
- Semaphore returns 0 on timeout, and negative was incorrect used for
  errors
- Correctly checked error code on tcp_connect

thanks to @LiyouZhou
fixes #284, fixes #285, fixes #166
2016-07-22 02:02:37 -05:00
Christopher Haster df5c05f38c Added handling for already connected sockets in LWIPInterface::connect 2016-07-22 02:02:37 -05:00
Christopher Haster 9eac5102fd Fixed behaviour of get_ip_address and get_mac_address for LWIPInterface
per the socket API documentation:

  /** Get the local IP address
   *
   *  @return         Null-terminated representation of the local IP address
   *                  or null if not yet connected
   */
  virtual const char *get_ip_address() = 0;

LWIPInterface incorrectly returned "\0" if unconnected
2016-07-22 02:02:37 -05:00
Christopher Haster 53349343e9 Added NSAPI_KEEPIDLE option to the socket API and LWIPInterface 2016-07-22 02:02:37 -05:00
geky 864c73b64a Implement the NSAPI_KEEPINTVL in the LWIPInterface 2016-07-22 02:02:37 -05:00
Christopher Haster b251c59ffe Added support for NSAPI_KEEPALIVE in LWIPInterface 2016-07-22 02:02:37 -05:00
Devaraj Ranganna c9d0447a3e Incrase netif_up semaphore timeout from 1500ms to 2500ms 2016-07-22 02:02:37 -05:00
Christopher Haster a263b91360 Add rudimentary support for server side
mirrored from:
https://developer.mbed.org/teams/NetworkSocketAPI/code/LWIPInterface/
2016-07-22 02:02:37 -05:00
Christopher Haster 0d0d008411 Match changes to NSAPI in LWIPInterface
mirrored from:
https://developer.mbed.org/teams/NetworkSocketAPI/code/LWIPInterface/
2016-07-22 02:02:37 -05:00
Christopher Haster e51f157c33 Revised stack specific configurations
Adds the following functions for direct configuration of interface
- (set|get)stackopt
- (set|get)sockopt
2016-07-22 02:02:37 -05:00
Christopher Haster 1aa0b6ce2a Added better support for SocketAddress/string addresses/ports 2016-07-22 02:02:37 -05:00
Christopher Haster e47bb97eff Renamed NetworkInterface create/destroy methods to match Socket methods
- socket_create -> socket_open
- socket_destroy -> socket_close
2016-07-22 02:02:37 -05:00
Christopher Haster db8495c7ed 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-22 02:02:37 -05:00
Christopher Haster 41d7277a4b Remove shutdown parameter from close call
Pros
- Simplifies interface
- Easier base implementation

Cons
- May need shutdown functionality, in this case shutdown
  can be added as another function in the future
2016-07-22 02:02:37 -05:00
Christopher Haster a25aeea977 Move to asynch lwip sockets based on armmbed/sal-stack-lwip
Move the backend of LWIPInterface from the LWIP socket API to the
asynch UDP/TCP APIs used in https://github.com/armmbed/sal-stack-lwip.
Provides asynchronous functionality for the LWIPInterface.
2016-07-22 02:02:37 -05:00
Christopher Haster 697ac558be 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-22 02:02:37 -05:00
Bogdan Marinescu b032d1886f Preparing new layout - moving lwip 2016-07-22 02:02:28 -05:00