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.
SPWFSAxx Class Reference
SPWFSAxx Interface class. More...
#include <SPWFSAxx.h>
Inherited by SPWFSA01, and SPWFSA04.
Public Member Functions | |
| bool | startup (int mode) |
| Init the SPWFSAxx. | |
| bool | connect (const char *ap, const char *passPhrase, int securityMode) |
| Connect SPWFSAxx to AP. | |
| bool | disconnect (void) |
| Disconnect SPWFSAxx from AP. | |
| const char * | getIPAddress (void) |
| Get the IP address of SPWFSAxx. | |
| const char * | getMACAddress (void) |
| Get the MAC address of SPWFSAxx. | |
| const char * | getGateway (void) |
| Get the local gateway. | |
| const char * | getNetmask (void) |
| Get the local network mask. | |
| int8_t | getRssi () |
| Gets the current radio signal strength for active connection. | |
| nsapi_size_or_error_t | send (int spwf_id, const void *data, uint32_t amount, int internal_id) |
| Sends data to an open socket. | |
| int32_t | recv (int id, void *data, uint32_t amount, bool datagram) |
| Receives data from an open socket. | |
| bool | close (int id) |
| Closes a socket. | |
| void | setTimeout (uint32_t timeout_ms) |
| Allows timeout to be changed between commands. | |
| void | attach (Callback< void()> func) |
| Attach a function to call whenever network state has changed. | |
| template<typename T , typename M > | |
| void | attach (T *obj, M method) |
| Attach a function to call whenever network state has changed. | |
Friends | |
| class | SPWFSA01 |
| class | SPWFSA04 |
| class | SpwfSAInterface |
Detailed Description
SPWFSAxx Interface class.
This is an interface to a SPWFSAxx module.
Definition at line 119 of file SPWFSAxx.h.
Member Function Documentation
| void attach | ( | Callback< void()> | func ) |
Attach a function to call whenever network state has changed.
- Parameters:
-
func A pointer to a void function, or 0 to set as none
Definition at line 1117 of file SPWFSAxx.cpp.
| void attach | ( | T * | obj, |
| M | method | ||
| ) |
Attach a function to call whenever network state has changed.
- Parameters:
-
obj pointer to the object to call the member function on method pointer to the member function to call
Definition at line 238 of file SPWFSAxx.h.
| bool close | ( | int | id ) |
Closes a socket.
- Parameters:
-
id id of socket to close, valid only 0-4
- Returns:
- true only if socket is closed successfully
Definition at line 745 of file SPWFSAxx.cpp.
| bool connect | ( | const char * | ap, |
| const char * | passPhrase, | ||
| int | securityMode | ||
| ) |
Connect SPWFSAxx to AP.
- Parameters:
-
ap the name of the AP passPhrase the password of AP securityMode the security mode of AP (WPA/WPA2, WEP, Open)
- Returns:
- true only if SPWFSAxx is connected successfully
Definition at line 309 of file SPWFSAxx.cpp.
| bool disconnect | ( | void | ) |
Disconnect SPWFSAxx from AP.
- Returns:
- true only if SPWFSAxx is disconnected successfully
Definition at line 385 of file SPWFSAxx.cpp.
| const char * getGateway | ( | void | ) |
Get the local gateway.
- Returns:
- Null-terminated representation of the local gateway or null if no network mask has been received
Definition at line 448 of file SPWFSAxx.cpp.
| const char * getIPAddress | ( | void | ) |
Get the IP address of SPWFSAxx.
- Returns:
- null-terminated IP address or null if no IP address is assigned
Definition at line 428 of file SPWFSAxx.cpp.
| const char * getMACAddress | ( | void | ) |
Get the MAC address of SPWFSAxx.
- Returns:
- null-terminated MAC address or null if no MAC address is assigned
Definition at line 505 of file SPWFSAxx.cpp.
| const char * getNetmask | ( | void | ) |
Get the local network mask.
- Returns:
- Null-terminated representation of the local network mask or null if no network mask has been received
Definition at line 468 of file SPWFSAxx.cpp.
| int8_t getRssi | ( | void | ) |
Gets the current radio signal strength for active connection.
- Returns:
- Connection strength in dBm (negative value)
Definition at line 488 of file SPWFSAxx.cpp.
| int32_t recv | ( | int | id, |
| void * | data, | ||
| uint32_t | amount, | ||
| bool | datagram | ||
| ) |
Receives data from an open socket.
Recv Function.
- Parameters:
-
id id to receive from data placeholder for returned information amount number of bytes to be received datagram receive a datagram packet
- Returns:
- the number of bytes received
Definition at line 1125 of file SPWFSAxx.cpp.
| nsapi_size_or_error_t send | ( | int | spwf_id, |
| const void * | data, | ||
| uint32_t | amount, | ||
| int | internal_id | ||
| ) |
Sends data to an open socket.
- Parameters:
-
spwf_id module id of socket to send to data data to be sent amount amount of data to be sent - max 1024 internal_id driver id of socket to send to
- Returns:
- number of written bytes on success, negative on failure
Definition at line 530 of file SPWFSAxx.cpp.
| void setTimeout | ( | uint32_t | timeout_ms ) |
Allows timeout to be changed between commands.
- Parameters:
-
timeout_ms timeout of the connection
Definition at line 1111 of file SPWFSAxx.cpp.
| bool startup | ( | int | mode ) |
Init the SPWFSAxx.
- Parameters:
-
mode mode in which to startup
- Returns:
- true only if SPWFSAxx has started up correctly
Definition at line 59 of file SPWFSAxx.cpp.
Generated on Tue Jul 12 2022 16:59:39 by
1.7.2