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.
Fork of emw3162-driver by
EMW3162 Class Reference
EMW3162Interface class. More...
#include <EMW3162.h>
Public Member Functions | |
| bool | startup () |
| Startup the EMW3162. | |
| bool | reset (const char *reset) |
| Reset EMW3162. | |
| bool | dhcp (bool enabled) |
| Enable/Disable DHCP. | |
| bool | connect (const char *ap, const char *passPhrase) |
| Connect EMW3162 to AP. | |
| bool | disconnect (void) |
| Disconnect EMW3162 from AP. | |
| const char * | getIPAddress (void) |
| Get the IP address of EMW3162. | |
| const char * | getMACAddress (void) |
| Get the MAC address of EMW3162. | |
| bool | isConnected (void) |
| Check if EMW3162 is conenected. | |
| int | open (const char *type, int id, const char *addr, int port) |
| Open a socketed connection. | |
| bool | send (int id, const void *data, uint32_t amount) |
| Sends data to an open socket. | |
| int32_t | recv (int id, void *data, uint32_t amount) |
| 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. | |
| bool | readable () |
| Checks if data is available. | |
| bool | writeable () |
| Checks if data can be written. | |
| 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. | |
Detailed Description
EMW3162Interface class.
This is an interface to a EMW3162 radio.
Definition at line 25 of file EMW3162.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 237 of file EMW3162.cpp.
| void attach | ( | T * | obj, |
| M | method | ||
| ) |
| 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 205 of file EMW3162.cpp.
| bool connect | ( | const char * | ap, |
| const char * | passPhrase | ||
| ) |
Connect EMW3162 to AP.
- Parameters:
-
ap the name of the AP passPhrase the password of AP
- Returns:
- true only if EMW3162 is connected successfully
Definition at line 54 of file EMW3162.cpp.
| bool dhcp | ( | bool | enabled ) |
Enable/Disable DHCP.
- Parameters:
-
enabled DHCP enabled when true mode mode of DHCP 0-softAP, 1-station, 2-both
- Returns:
- true only if EMW3162 enables/disables DHCP successfully
Definition at line 48 of file EMW3162.cpp.
| bool disconnect | ( | void | ) |
Disconnect EMW3162 from AP.
- Returns:
- true only if EMW3162 is disconnected successfully
Definition at line 63 of file EMW3162.cpp.
| const char * getIPAddress | ( | void | ) |
Get the IP address of EMW3162.
- Returns:
- null-teriminated IP address or null if no IP address is assigned
Definition at line 73 of file EMW3162.cpp.
| const char * getMACAddress | ( | void | ) |
Get the MAC address of EMW3162.
- Returns:
- null-terminated MAC address or null if no MAC address is assigned
Definition at line 83 of file EMW3162.cpp.
| bool isConnected | ( | void | ) |
Check if EMW3162 is conenected.
- Returns:
- true only if the chip has an IP address
Definition at line 93 of file EMW3162.cpp.
| int open | ( | const char * | type, |
| int | id, | ||
| const char * | addr, | ||
| int | port | ||
| ) |
Open a socketed connection.
- Parameters:
-
type the type of socket to open "UDP" or "TCP" id id to give the new socket, valid 0-4 port port to open connection with addr the IP address of the destination
- Returns:
- true only if socket opened successfully
Definition at line 98 of file EMW3162.cpp.
| bool readable | ( | void | ) |
Checks if data is available.
Definition at line 227 of file EMW3162.cpp.
| int32_t recv | ( | int | id, |
| void * | data, | ||
| uint32_t | amount | ||
| ) |
Receives data from an open socket.
- Parameters:
-
id id to receive from data placeholder for returned information amount number of bytes to be received
- Returns:
- the number of bytes received
Definition at line 168 of file EMW3162.cpp.
| bool reset | ( | const char * | reset ) |
Reset EMW3162.
- Returns:
- true only if EMW3162 resets successfully
Definition at line 36 of file EMW3162.cpp.
| bool send | ( | int | id, |
| const void * | data, | ||
| uint32_t | amount | ||
| ) |
Sends data to an open socket.
- Parameters:
-
id id of socket to send to data data to be sent amount amount of data to be sent - max 1024
- Returns:
- true only if data sent successfully
Definition at line 122 of file EMW3162.cpp.
| void setTimeout | ( | uint32_t | timeout_ms ) |
Allows timeout to be changed between commands.
- Parameters:
-
timeout_ms timeout of the connection
Definition at line 222 of file EMW3162.cpp.
| bool startup | ( | void | ) |
Startup the EMW3162.
- Parameters:
-
mode mode of WIFI 1-client, 2-host, 3-both
- Returns:
- true only if EMW3162 was setup correctly
Definition at line 27 of file EMW3162.cpp.
| bool writeable | ( | void | ) |
Checks if data can be written.
Definition at line 232 of file EMW3162.cpp.
Generated on Tue Jul 12 2022 21:41:13 by
1.7.2
