![]() |
MCUXpresso SDK API Reference Manual
Rev 2.16.000
NXP Semiconductors
|
Data Structures | |
| struct | mwm_sockaddr_t |
| SerialMWM socket address structure. More... | |
| struct | mwm_wlan_t |
| SerialMWM WLAN structure. More... | |
Initialization | |
| int | mwm_init (void) |
| Initializes SerialMWM library. More... | |
WLAN API | |
| int | mwm_version (char *value, uint32_t val_len) |
| Gets SerialMWM firmware version. More... | |
| int | mwm_upgrade (char *type, char *url) |
| Upgrades firmware of Wi-Fi module. More... | |
| int | mwm_reboot (void) |
| Reboots Wi-Fi module. More... | |
| int | mwm_wlan_fw_version (char *value, uint32_t val_len) |
| Gets WLAN firmware version. More... | |
| int | mwm_wlan_start (void) |
| Start WLAN subsystem. More... | |
| int | mwm_wlan_status (void) |
| Gets WLAN status. More... | |
| int | mwm_wlan_prov (void) |
| Resets WLAN module to provisioning mode. More... | |
| int | mwm_wlan_info (char *ssid, char *ip_addr) |
| Gets WLAN information. More... | |
| int | mwm_wlan_scan (mwm_wlan_t *wlans, uint32_t wlan_count) |
| Scans WLAN. More... | |
| int | mwm_wlan_connect (void) |
| Connects to WLAN. More... | |
| int | mwm_wlan_disconnect (void) |
| Disconnects from WLAN. More... | |
Device Configuration API | |
| int | mwm_get_param (char *module, char *param, char *value, uint32_t val_len) |
| Gets parameter from Wi-Fi module. More... | |
| int | mwm_set_param (char *module, char *param, char *value) |
| Sets parameter from Wi-Fi module. More... | |
Socket API | |
| int | mwm_socket (int type) |
| Opens socket. More... | |
| int | mwm_connect (int socket, mwm_sockaddr_t *addr, uint32_t addrlen) |
| Opens socket. More... | |
| int | mwm_send (int socket, void *buf, size_t len) |
| Sends data. More... | |
| int | mwm_sendto (int socket, void *buf, int len, mwm_sockaddr_t *to, int tolen) |
| Sends data. More... | |
| int | mwm_recv_timeout (int socket, void *buf, size_t len, uint32_t timeout_ms) |
| Receives data. More... | |
| int | mwm_recvfrom_timeout (int socket, void *buf, size_t len, uint32_t timeout_ms) |
| Receives data. More... | |
| int | mwm_close (int socket) |
| Closes socket. More... | |
| struct mwm_sockaddr_t |
Data Fields | |
| char | host [64] |
| Hostname or IP Address. | |
| struct mwm_wlan_t |
| int mwm_init | ( | void | ) |
This function resets connected Wi-Fi module by reset pin (if supported) and initializes the UART interface for communication with Wi-Fi module.
| -1 | Error |
| 0 | Success |
| int mwm_version | ( | char * | value, |
| uint32_t | val_len | ||
| ) |
This function gets SerialMWM firmware version of the Wi-Fi module.
| value | Pointer to buffer where the version string will be stored |
| val_len | Length of value buffer |
| int mwm_upgrade | ( | char * | type, |
| char * | url | ||
| ) |
This function upgrades SerialMWM firmware, WLAN firmware or it can be used to check the upgrade status.
| type | MWM_UPGRADE_MCU_FW for SerialMWM FW upgrade, MWM_UPGRADE_WLAN_FW for WLAN FW upgrade or MWM_UPGRADE_STATUS to check upgrade status |
| url | URL of firmware image file for upgrade or NULL in case of upgrade status check |
| int mwm_reboot | ( | void | ) |
This function reboots Wi-Fi module and re-initializes UART interface.
| int mwm_wlan_fw_version | ( | char * | value, |
| uint32_t | val_len | ||
| ) |
This function gets WLAN firmware version of the Wi-Fi module.
| value | Pointer to buffer where the version string will be stored |
| val_len | Length of value buffer |
| int mwm_wlan_start | ( | void | ) |
| int mwm_wlan_status | ( | void | ) |
| int mwm_wlan_prov | ( | void | ) |
| int mwm_wlan_info | ( | char * | ssid, |
| char * | ip_addr | ||
| ) |
This function gets WLAN information (SSID and IP Address) from the Wi-Fi module.
| ssid | Pointer to buffer where the SSID string will be stored |
| ip_addr | Pointer to buffer where the IP Address string will be stored |
| int mwm_wlan_scan | ( | mwm_wlan_t * | wlans, |
| uint32_t | wlan_count | ||
| ) |
This function gets cached scan results and schedules a new scan.
| wlans | Pointer to array of mwm_wlan_t where the WLAN struct will be stored |
| wlan_count | Length of wlans array |
| int mwm_wlan_connect | ( | void | ) |
This function attempts to make an explicit connection with the configured WLAN.
| int mwm_wlan_disconnect | ( | void | ) |
This function disconnects Wi-Fi module from WLAN it is connected to.
| int mwm_get_param | ( | char * | module, |
| char * | param, | ||
| char * | value, | ||
| uint32_t | val_len | ||
| ) |
This function gets parameter from Wi-Fi module.
| module | Module of requested parameter, it can be MWM_MOD_PROV, MWM_MOD_WLAN or MWM_MOD_SYSTEM |
| param | Name of requested parameter, it can be MWM_PROV_*, MWM_WLAN_* or MWM_SYS_* based on selected module |
| value | Pointer to buffer where the value of requested parameter will be stored |
| val_len | Length of value buffer |
| int mwm_set_param | ( | char * | module, |
| char * | param, | ||
| char * | value | ||
| ) |
This function sets parameter of Wi-Fi module.
| module | Module whose parameter will be set, it can be MWM_MOD_PROV, MWM_MOD_WLAN or MWM_MOD_SYSTEM |
| param | Name of configured parameter, it can be MWM_PROV_*, MWM_WLAN_* or MWM_SYS_* based on selected module |
| value | Pointer to string value of configured parameter |
| int mwm_socket | ( | int | type | ) |
This function opens socket.
| type | Type of socket, it can be MWM_TCP or MWM_UDP |
| int mwm_connect | ( | int | socket, |
| mwm_sockaddr_t * | addr, | ||
| uint32_t | addrlen | ||
| ) |
This function connects the socket to remote host.
| socket | Handle of socket |
| addr | Valid address of remote host |
| addrlen | Size of addr |
| int mwm_send | ( | int | socket, |
| void * | buf, | ||
| size_t | len | ||
| ) |
This function sends data over a connected socket.
| socket | Handle of socket |
| buf | Pointer to data buffer |
| len | Size of buf |
| int mwm_sendto | ( | int | socket, |
| void * | buf, | ||
| int | len, | ||
| mwm_sockaddr_t * | to, | ||
| int | tolen | ||
| ) |
This function sends data to a specified destination host and port (mwm_sockaddr_t).
| socket | Handle of socket |
| buf | Pointer to data buffer |
| len | Size of buf |
| to | Address of remote host |
| tolen | Size of to |
| int mwm_recv_timeout | ( | int | socket, |
| void * | buf, | ||
| size_t | len, | ||
| uint32_t | timeout_ms | ||
| ) |
This function receives data on a connected socket.
| socket | Handle of socket |
| buf | Pointer to data buffer |
| len | Size of buf |
| timeout_ms | Timeout in ms - maximum amount of time that the request may block while waiting for data, 0 indicates it blocks forever |
| int mwm_recvfrom_timeout | ( | int | socket, |
| void * | buf, | ||
| size_t | len, | ||
| uint32_t | timeout_ms | ||
| ) |
This function receives data on the opened socket.
| socket | Handle of socket |
| buf | Pointer to data buffer |
| len | Size of buf |
| timeout_ms | Timeout in ms - maximum amount of time that the request may block while waiting for data, 0 indicates it blocks forever |
| int mwm_close | ( | int | socket | ) |
This function closes a socket.
| socket | Handle of socket |