Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
WizFi310 Class Reference
WizFi310Interface class. More...
#include <WizFi310.h>
Public Member Functions | |
| WizFi310 (PinName tx, PinName rx, PinName rtx=NC, PinName cts=NC, PinName rst=NC) | |
| Creates a new WizFir310 driver. | |
| const char * | get_firmware_version (void) |
| Check firmware version of WizFi310. | |
| bool | dhcp (bool enabled) |
| Enable/Disable DHCP. | |
| void | attach (Callback< void(nsapi_connection_status_t)> status_change_cb) |
| Attach a callback that will be invoked when the status changes. | |
| nsapi_error_t | connect (const char *ap, const char *passPhrase, const char *sec) |
| Connect WizFi310 to AP. | |
| nsapi_connection_status_t | status () const |
| Returns the current connection status. | |
| nsapi_error_t | disconnect () |
| Disconnect WizFi310 from AP. | |
| nsapi_error_t | scan (Callback< void(nsapi_wifi_ap_t *)> ap_cb) |
| int | open (const char *type, const char *addr, int port, Callback< void(void *, socket_event_t, socket_event_data_t &)> callback, void *data) |
| Open a socketed connection. | |
| int | send (int id, const void *data, uint32_t amount) |
| Sends data to an open socket. | |
| void | close (int id) |
| Closes a socket. | |
Detailed Description
WizFi310Interface class.
This is an interface to a WizFi310Interface radio.
Definition at line 54 of file WizFi310.h.
Constructor & Destructor Documentation
| WizFi310 | ( | PinName | tx, |
| PinName | rx, | ||
| PinName | rtx = NC, |
||
| PinName | cts = NC, |
||
| PinName | rst = NC |
||
| ) |
Creates a new WizFir310 driver.
- Parameters:
-
tx Tx pin name. rx Rx pin name. rts Rts pin name. cts Cts pin name. rst Rst pin name.
Definition at line 105 of file WizFi310.cpp.
Member Function Documentation
| void attach | ( | Callback< void(nsapi_connection_status_t)> | status_change_cb ) |
Attach a callback that will be invoked when the status changes.
Definition at line 136 of file WizFi310.cpp.
| void close | ( | int | id ) |
Closes a socket.
- Note:
- This is non-blocking.
- Parameters:
-
id id of socket to close, valid only 0-4
- Returns:
- true only if socket is closed successfully
Definition at line 289 of file WizFi310.cpp.
| nsapi_error_t connect | ( | const char * | ap, |
| const char * | passPhrase, | ||
| const char * | sec | ||
| ) |
Connect WizFi310 to AP.
- Note:
- This is blocking.
- Parameters:
-
ap the name of the AP passPhrase the password of AP security type of AP
- Returns:
- see nsapi_error_t
Definition at line 171 of file WizFi310.cpp.
| bool dhcp | ( | bool | enabled ) |
Enable/Disable DHCP.
- Parameters:
-
enabled DHCP enabled when true
- Returns:
- true only if WizFi310 enables/disables DHCP successfully
Definition at line 141 of file WizFi310.cpp.
| nsapi_error_t disconnect | ( | void | ) |
Disconnect WizFi310 from AP.
- Returns:
- see nsapi_error_t.
Definition at line 208 of file WizFi310.cpp.
| const char* get_firmware_version | ( | void | ) |
Check firmware version of WizFi310.
- Returns:
- character array firmware version or 0 if firmware query command gives outdated response
- Warning:
- This is only valid once the device is ready.
| int open | ( | const char * | type, |
| const char * | addr, | ||
| int | port, | ||
| Callback< void(void *, socket_event_t, socket_event_data_t &)> | callback, | ||
| void * | data | ||
| ) |
Open a socketed connection.
- Note:
- This is non-blocking.
- Parameters:
-
type the type of socket to open "UDP" or "TCP" port port to open connection with addr the IP address of the destination callback Function to call on state change data Argument to pass to callback
- Note:
- The callback is always called from the global event queue thread.
- Returns:
Definition at line 223 of file WizFi310.cpp.
| nsapi_error_t scan | ( | Callback< void(nsapi_wifi_ap_t *)> | ap_cb ) |
- Parameters:
-
ap_cb Called for each access point found. Last ap is NULL.
- Returns:
- IN_PROGRESS or WOULD_BLOCK.
Definition at line 148 of file WizFi310.cpp.
| nsapi_error_t send | ( | int | id, |
| const void * | data, | ||
| uint32_t | amount | ||
| ) |
Sends data to an open socket.
- Note:
- This is non-blocking.
- Parameters:
-
id id of socket to send to data data to be sent amount amount of data to be sent
- Returns:
Definition at line 260 of file WizFi310.cpp.
| nsapi_connection_status_t status | ( | ) | const |
Returns the current connection status.
- Returns:
- Current connection status.
Definition at line 125 of file WizFi310.h.
Generated on Mon Aug 29 2022 19:53:44 by
1.7.2