for EthernetInterface library compatibility.\\ ** Unoffical fix. may be a problem. **
Dependents: SNIC-httpclient-example SNIC-ntpclient-example
Fork of SNICInterface 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 (PinName tx, PinName rx, PinName cts, PinName rts, PinName reset, PinName alarm=NC, int baud=115200) | |
Constructor. | |
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. |
Detailed Description
Interface class for using SNIC UART.
Definition at line 38 of file SNIC_WifiInterface.h.
Constructor & Destructor Documentation
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 25 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 144 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 239 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 97 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 471 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 519 of file SNIC_WifiInterface.cpp.
int init | ( | ) |
Initialize the interface.
- Returns:
- 0 on success, a negative number on failure
Definition at line 39 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 285 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 581 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 423 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 367 of file SNIC_WifiInterface.cpp.
Generated on Tue Jul 12 2022 18:43:50 by 1.7.2