LWIPBP3595Interface library for mbed-os.

Dependents:   LWIPBP3595Interface_STA_for_mbed-os

Fork of LWIPBP3595Interface by Rohm

Revision:
5:d03489ec5033
Parent:
4:b49b4b36aaa4
--- a/LWIPBP3595Interface.h	Fri Oct 28 06:27:14 2016 +0000
+++ b/LWIPBP3595Interface.h	Thu Nov 24 09:13:23 2016 +0000
@@ -46,7 +46,7 @@
      *  @param gateway  Null-terminated representation of the local gateway
      *  @return         0 on success, negative error code on failure
      */
-    virtual int set_network(const char *ip_address, const char *netmask, const char *gateway);
+    virtual nsapi_error_t set_network(const char *ip_address, const char *netmask, const char *gateway);
 
     /** Enable or disable DHCP on the network
      *
@@ -55,7 +55,7 @@
      *  @param dhcp     False to disable dhcp (defaults to enabled)
      *  @return         0 on success, negative error code on failure
      */
-    virtual int set_dhcp(bool dhcp);
+    virtual nsapi_error_t set_dhcp(bool dhcp);
 
     /** Set the WiFi network credentials
      *
@@ -65,14 +65,15 @@
      *                   (defaults to NSAPI_SECURITY_NONE)
      *  @return          0 on success, or error code on failure
      */
-    virtual int set_credentials(const char *ssid, const char *pass, nsapi_security_t security = NSAPI_SECURITY_WPA_WPA2);
+    virtual nsapi_error_t set_credentials(const char *ssid, const char *pass,
+            nsapi_security_t security = NSAPI_SECURITY_WPA_WPA2);
 
     /** Set the WiFi network channel
      *
      *  @param channel   Channel on which the connection is to be made, or 0 for any (Default: 0)
      *  @return          0 on success, or error code on failure
      */
-    virtual int set_channel(uint8_t channel);
+    virtual nsapi_error_t set_channel(uint8_t channel);
 
     /** Gets the current radio signal strength for active connection
      *
@@ -91,9 +92,8 @@
      *  @param channel   Channel on which the connection is to be made, or 0 for any (Default: 0)
      *  @return          0 on success, or error code on failure
      */
-    virtual int connect(const char *ssid, const char *pass,
-            nsapi_security_t security = NSAPI_SECURITY_WPA2,
-            uint8_t channel = 0);
+    virtual nsapi_error_t connect(const char *ssid, const char *pass,
+            nsapi_security_t security = NSAPI_SECURITY_WPA2, uint8_t channel = 0);
 
     /** Start the interface
      *
@@ -102,23 +102,25 @@
      *
      *  @return         0 on success, negative error code on failure
      */
-    virtual int connect();
+    virtual nsapi_error_t connect();
 
     /** Stop the interface
      *  @return             0 on success, negative on failure
      */
-    virtual int disconnect();
+    virtual nsapi_error_t disconnect();
 
     /** Scan for available networks
      *
-     *  This function will block.
+     *  This function will block. If the @a count is 0, function will only return count of available networks, so that
+     *  user can allocated necessary memory. If the @count is grater than 0 and the @a ap is not NULL it'll be populated
+     *  with discovered networks up to value of @a count.
      *
-     * @param  ap       Pointer to allocated array to store discovered AP
-     * @param  count    Size of allocated @a res array, or 0 to only count available AP
-     * @return          Number of entries in @a, or if @a count was 0 number of available networks, negative on error
-     *                  see @a nsapi_error
+     *  @param  ap       Pointer to allocated array to store discovered AP
+     *  @param  count    Size of allocated @a res array, or 0 to only count available AP
+     *  @return          Number of entries in @a, or if @a count was 0 number of available networks,
+     *                   negative on error see @a nsapi_error
      */
-    virtual int scan(WiFiAccessPoint *res, unsigned count);
+    virtual nsapi_size_or_error_t scan(WiFiAccessPoint *res, unsigned count);
 
     /** Get the local MAC address
      *