for EthernetInterface library compatibility.\\ ** Unoffical fix. may be a problem. **

Dependents:   SNIC-httpclient-example SNIC-ntpclient-example

Fork of SNICInterface by muRata

Embed: (wiki syntax)

« Back to documentation index

C_SNIC_WifiInterface Class Reference

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:
txmbed pin to use for tx line of Serial interface
rxmbed pin to use for rx line of Serial interface
ctsmbed pin to use for cts line of Serial interface
rtsmbed pin to use for rts line of Serial interface
resetreset pin of the wifi module
alarmalarm pin of the wifi module (default: NC)
baudbaud 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_pWi-Fi SSID(null terminated)
ssid_lenWi-Fi SSID length
sec_typeWi-Fi security type.
sec_key_lenWi-Fi passphrase or security key length
sec_key_pWi-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_pPointer 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_pPointer 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_pPointer 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_pWi-Fi SSID(null terminated) If do not specify SSID, set to NULL.
bssid_pWi-Fi BSSID(null terminated) If do not specify SSID, set to NULL.
result_handler_pPointer 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_DHCPtrue:DHCP false:static IP.
ip_pPointer of strings of IP address.(null terminate).
mask_pPointer of strings of Netmask.(null terminate).
gateway_pPointer 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_pPointer 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.