SNIC UART Interface library: Serial to Wi-Fi library for Murata TypeYD Wi-Fi module. For more information about TypeYD: http://www.murata.co.jp/products/microwave/module/lbwb1zzydz/index.html
Dependents: SNIC-xively-jumpstart-demo SNIC-FluentLogger-example TCPEchoServer murataDemo ... more
Fork of YDwifiInterface by
C_SNIC_WifiInterface Class Reference
Interface class for using SNIC UART. More...
#include <SNIC_WifiInterface.h>
Inherits C_MurataObject.
Public Member Functions | |
C_SNIC_WifiInterface () | |
Default constructor. | |
C_SNIC_WifiInterface (PinName tx, PinName rx, PinName cts, PinName rts, PinName reset, PinName alarm=NC, int baud=115200) | |
Constructor. | |
void | create (PinName tx, PinName rx, PinName cts, PinName rts, PinName reset, PinName alarm=NC, int baud=115200) |
Create instance. | |
int | init () |
Initialize the interface. | |
int | getFWVersion (unsigned char *version_p) |
Get Firmware version string. | |
int | connect (const char *ssid_p, unsigned char ssid_len, E_SECURITY sec_type, const char *sec_key_p, unsigned char sec_key_len) |
Connect to AP. | |
int | disconnect () |
Disconnect from AP. | |
int | scan (const char *ssid_p, unsigned char *bssid_p, void(*result_handler_p)(tagSCAN_RESULT_T *scan_result)) |
Scan AP. | |
int | wifi_on (const char *country_p) |
Wi-Fi Turn on. | |
int | wifi_off () |
Wi-Fi Turn off. | |
int | getRssi (signed char *rssi_p) |
Get Wi-Fi RSSI. | |
int | getWifiStatus (tagWIFI_STATUS_T *status_p) |
Get Wi-Fi status. | |
int | setIPConfig (bool is_DHCP, const char *ip_p=NULL, const char *mask_p=NULL, const char *gateway_p=NULL) |
Set IP configuration. | |
Static Public Member Functions | |
static char * | getIPAddress () |
Get the IP address of your SNIC interface. |
Detailed Description
Interface class for using SNIC UART.
Definition at line 38 of file SNIC_WifiInterface.h.
Constructor & Destructor Documentation
Default constructor.
Definition at line 43 of file SNIC_WifiInterface.h.
C_SNIC_WifiInterface | ( | PinName | tx, |
PinName | rx, | ||
PinName | cts, | ||
PinName | rts, | ||
PinName | reset, | ||
PinName | alarm = NC , |
||
int | baud = 115200 |
||
) |
Constructor.
- Parameters:
-
tx mbed pin to use for tx line of Serial interface rx mbed pin to use for rx line of Serial interface cts mbed pin to use for cts line of Serial interface rts mbed pin to use for rts line of Serial interface reset reset pin of the wifi module alarm alarm pin of the wifi module (default: NC) baud baud rate of Serial interface (default: 115200)
Definition at line 26 of file SNIC_WifiInterface.cpp.
Member Function Documentation
int connect | ( | const char * | ssid_p, |
unsigned char | ssid_len, | ||
E_SECURITY | sec_type, | ||
const char * | sec_key_p, | ||
unsigned char | sec_key_len | ||
) |
Connect to AP.
- Parameters:
-
ssid_p Wi-Fi SSID(null terminated) ssid_len Wi-Fi SSID length sec_type Wi-Fi security type. sec_key_len Wi-Fi passphrase or security key length sec_key_p Wi-Fi passphrase or security key
- Returns:
- 0 on success, a negative number on failure
- Note:
- This function is blocked until a returns. When you use it by UI thread, be careful.
Definition at line 155 of file SNIC_WifiInterface.cpp.
void create | ( | PinName | tx, |
PinName | rx, | ||
PinName | cts, | ||
PinName | rts, | ||
PinName | reset, | ||
PinName | alarm = NC , |
||
int | baud = 115200 |
||
) |
Create instance.
Definition at line 36 of file SNIC_WifiInterface.cpp.
int disconnect | ( | ) |
Disconnect from AP.
- Returns:
- 0 on success, a negative number on failure
- Note:
- This function is blocked until a returns. When you use it by UI thread, be careful.
Definition at line 250 of file SNIC_WifiInterface.cpp.
int getFWVersion | ( | unsigned char * | version_p ) |
Get Firmware version string.
- Parameters:
-
version_p Pointer of FW version string.(null terminated)[output]
- Returns:
- 0:success/other:fail
- Note:
- This function is blocked until a returns. When you use it by UI thread, be careful.
Definition at line 108 of file SNIC_WifiInterface.cpp.
char * getIPAddress | ( | ) | [static] |
Get the IP address of your SNIC interface.
- Returns:
- a pointer to a string containing the IP address
Definition at line 677 of file SNIC_WifiInterface.cpp.
int getRssi | ( | signed char * | rssi_p ) |
Get Wi-Fi RSSI.
- Parameters:
-
rssi_p Pointer of RSSI.[output]
- Returns:
- 0 on success, a negative number on failure
- Note:
- This function is blocked until a returns. When you use it by UI thread, be careful.
Definition at line 482 of file SNIC_WifiInterface.cpp.
int getWifiStatus | ( | tagWIFI_STATUS_T * | status_p ) |
Get Wi-Fi status.
- Parameters:
-
status_p Pointer of status structure.[output]
- Returns:
- 0 on success, a negative number on failure
- Note:
- This function is blocked until a returns. When you use it by UI thread, be careful.
Definition at line 530 of file SNIC_WifiInterface.cpp.
int init | ( | ) |
Initialize the interface.
- Returns:
- 0 on success, a negative number on failure
Definition at line 50 of file SNIC_WifiInterface.cpp.
int scan | ( | const char * | ssid_p, |
unsigned char * | bssid_p, | ||
void(*)(tagSCAN_RESULT_T *scan_result) | result_handler_p | ||
) |
Scan AP.
- Parameters:
-
ssid_p Wi-Fi SSID(null terminated) If do not specify SSID, set to NULL. bssid_p Wi-Fi BSSID(null terminated) If do not specify SSID, set to NULL. result_handler_p Pointer of scan result callback function.
- Returns:
- 0 on success, a negative number on failure
- Note:
- This function is blocked until a returns. When you use it by UI thread, be careful. Scan results will be notified by asynchronous callback function. If there is no continuity data, scan_result will be set NULL..
Definition at line 296 of file SNIC_WifiInterface.cpp.
int setIPConfig | ( | bool | is_DHCP, |
const char * | ip_p = NULL , |
||
const char * | mask_p = NULL , |
||
const char * | gateway_p = NULL |
||
) |
Set IP configuration.
- Parameters:
-
is_DHCP true:DHCP false:static IP. ip_p Pointer of strings of IP address.(null terminate). mask_p Pointer of strings of Netmask.(null terminate). gateway_p Pointer of strings of gateway address.(null terminate).
- Returns:
- 0 on success, a negative number on failure
- Note:
- This function is blocked until a returns. When you use it by UI thread, be careful.
Definition at line 592 of file SNIC_WifiInterface.cpp.
int wifi_off | ( | ) |
Wi-Fi Turn off.
- Returns:
- 0 on success, a negative number on failure
- Note:
- This function is blocked until a returns. When you use it by UI thread, be careful.
Definition at line 434 of file SNIC_WifiInterface.cpp.
int wifi_on | ( | const char * | country_p ) |
Wi-Fi Turn on.
- Parameters:
-
country_p Pointer of country code.
- Returns:
- 0 on success, a negative number on failure
- Note:
- This function is blocked until a returns. When you use it by UI thread, be careful.
Definition at line 378 of file SNIC_WifiInterface.cpp.
Generated on Thu Jul 14 2022 10:07:54 by 1.7.2