Skip to content

Commit b045c8b

Browse files
committed
nsapi - Adopted standardized return types in the Odin wifi interface
1 parent 78b9357 commit b045c8b

File tree

1 file changed

+9
-9
lines changed
  • targets/TARGET_STM/TARGET_STM32F4/TARGET_UBLOX_EVK_ODIN_W2/sdk/ublox-odin-w2-drivers

1 file changed

+9
-9
lines changed

targets/TARGET_STM/TARGET_STM32F4/TARGET_UBLOX_EVK_ODIN_W2/sdk/ublox-odin-w2-drivers/OdinWiFiInterface.h

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -54,14 +54,14 @@ class OdinWiFiInterface : public WiFiInterface
5454
* (defaults to NSAPI_SECURITY_NONE)
5555
* @return 0 on success, or error code on failure
5656
*/
57-
virtual int set_credentials(const char *ssid, const char *pass, nsapi_security_t security = NSAPI_SECURITY_NONE);
57+
virtual nsapi_error_t set_credentials(const char *ssid, const char *pass, nsapi_security_t security = NSAPI_SECURITY_NONE);
5858

5959
/** Set the WiFi network channel
6060
*
6161
* @param channel Channel on which the connection is to be made, or 0 for any (Default: 0)
6262
* @return 0 on success, or error code on failure
6363
*/
64-
virtual int set_channel(uint8_t channel);
64+
virtual nsapi_error_t set_channel(uint8_t channel);
6565

6666
/** Start the interface
6767
*
@@ -73,7 +73,7 @@ class OdinWiFiInterface : public WiFiInterface
7373
* @param channel Channel on which the connection is to be made, or 0 for any (Default: 0)
7474
* @return 0 on success, or error code on failure
7575
*/
76-
virtual int connect(const char *ssid,
76+
virtual nsapi_error_t connect(const char *ssid,
7777
const char *pass,
7878
nsapi_security_t security = NSAPI_SECURITY_NONE,
7979
uint8_t channel = 0);
@@ -85,13 +85,13 @@ class OdinWiFiInterface : public WiFiInterface
8585
*
8686
* @return 0 on success, negative error code on failure
8787
*/
88-
virtual int connect();
88+
virtual nsapi_error_t connect();
8989

9090
/** Stop the interface
9191
*
9292
* @return 0 on success, or error code on failure
9393
*/
94-
virtual int disconnect();
94+
virtual nsapi_error_t disconnect();
9595

9696
/** Get the local MAC address
9797
*
@@ -136,7 +136,7 @@ class OdinWiFiInterface : public WiFiInterface
136136
* @param gateway Null-terminated representation of the local gateway
137137
* @return 0 on success, negative error code on failure
138138
*/
139-
virtual int set_network(const char *ip_address, const char *netmask, const char *gateway);
139+
virtual nsapi_error_t set_network(const char *ip_address, const char *netmask, const char *gateway);
140140

141141
/** Enable or disable DHCP on the network
142142
*
@@ -147,7 +147,7 @@ class OdinWiFiInterface : public WiFiInterface
147147
* @param dhcp True to enable DHCP
148148
* @return 0 on success, negative error code on failure
149149
*/
150-
virtual int set_dhcp(bool dhcp);
150+
virtual nsapi_error_t set_dhcp(bool dhcp);
151151

152152
/** Gets the current radio signal strength for active connection
153153
*
@@ -168,7 +168,7 @@ class OdinWiFiInterface : public WiFiInterface
168168
* @return Number of entries in @a, or if @a count was 0 number of available networks, negative on error
169169
* see @a nsapi_error
170170
*/
171-
virtual int scan(WiFiAccessPoint *res, unsigned count);
171+
virtual nsapi_size_or_error_t scan(WiFiAccessPoint *res, nsapi_size_t count);
172172

173173
/** Sets timeout for connection setup. Note that the time for DHCP retrieval is not included.
174174
*
@@ -184,7 +184,7 @@ class OdinWiFiInterface : public WiFiInterface
184184

185185
private:
186186

187-
int connect_async(const char *ssid,
187+
nsapi_error_t connect_async(const char *ssid,
188188
const char *pass,
189189
nsapi_security_t security = NSAPI_SECURITY_NONE,
190190
uint8_t channel = 0,

0 commit comments

Comments
 (0)