Mistake on this page?
Report an issue in GitHub or email us
Data Structures | Functions
Station

station mode API ** More...

Data Structures

struct  mc_wifi_link_info_t
 Wi-Fi station link info. More...
 

Functions

int32_t MX_WIFI_ResetModule (MX_WIFIObject_t *Obj)
 Reset the module by Software. More...
 
int32_t MX_WIFI_ResetToFactoryDefault (MX_WIFIObject_t *Obj)
 Reset To factory defaults. More...
 
int32_t MX_WIFI_GetVersion (MX_WIFIObject_t *Obj, uint8_t *version, uint32_t size)
 Get the firmware version string of the wifi module. More...
 
int32_t MX_WIFI_GetMACAddress (MX_WIFIObject_t *Obj, uint8_t *mac)
 Get the MAC address of the wifi module. More...
 
int32_t MX_WIFI_Scan (MX_WIFIObject_t *Obj, mc_wifi_scan_mode_t scan_mode, char *ssid, int32_t len)
 wifi block scan More...
 
int8_t MX_WIFI_Get_scan_result (MX_WIFIObject_t *Obj, uint8_t *results, uint8_t number)
 wifi get scan result More...
 
int32_t MX_WIFI_RegisterStatusCallback (MX_WIFIObject_t *Obj, mx_wifi_status_callback_t cb, void *arg)
 Register wifi status changed callback. More...
 
int32_t MX_WIFI_RegisterStatusCallback_if (MX_WIFIObject_t *Obj, mx_wifi_status_callback_t cb, void *arg, mwifi_if_t interface)
 < status code. More...
 
int32_t MX_WIFI_UnRegisterStatusCallback (MX_WIFIObject_t *Obj)
 UnRegister wifi status changed callback. More...
 
int32_t MX_WIFI_UnRegisterStatusCallback_if (MX_WIFIObject_t *Obj, mwifi_if_t interface)
 < status code. More...
 
int32_t MX_WIFI_Connect (MX_WIFIObject_t *Obj, const char *SSID, const char *Password, MX_WIFI_SecurityType_t SecType)
 Join an Access point. More...
 
int32_t MX_WIFI_EAP_Connect (MX_WIFIObject_t *Obj, const char *SSID, const char *Identity, const char *Password, mwifi_eap_attr_t *attr, mwifi_ip_attr_t *ip)
 Join an Access point with WPA-E. More...
 
int32_t MX_WIFI_Disconnect (MX_WIFIObject_t *Obj)
 Disconnect from a network. More...
 
int32_t MX_WIFI_WPS_Connect (MX_WIFIObject_t *Obj)
 Join an Access point with WPS (PUSH-BUTTON) mode. More...
 
int32_t MX_WIFI_WPS_Stop (MX_WIFIObject_t *Obj)
 Stop WPS connect. More...
 
int8_t MX_WIFI_IsConnected (MX_WIFIObject_t *Obj)
 Check whether the module is connected to an access point. More...
 
int32_t MX_WIFI_GetIPAddress (MX_WIFIObject_t *Obj, uint8_t *ipaddr, mwifi_if_t wifi_if)
 Get the local IPv4 address of the wifi module. More...
 
int32_t MX_WIFI_GetIP6Address (MX_WIFIObject_t *Obj, uint8_t *ipaddr6, int32_t addr_num, mwifi_if_t wifi_if)
 Get the local IPv6 address of the wifi module. More...
 
int32_t MX_WIFI_GetIP6AddressState (MX_WIFIObject_t *Obj, int32_t addr_num, mwifi_if_t wifi_if)
 Get the local IPv6 address state of the wifi module. More...
 

Detailed Description

station mode API **

Function Documentation

int32_t MX_WIFI_Connect ( MX_WIFIObject_t Obj,
const char *  SSID,
const char *  Password,
MX_WIFI_SecurityType_t  SecType 
)

Join an Access point.

Parameters
Objpointer to module handle
Ssidthe access point id.
Passwordthe Access point password.
SecTypeSecurity type.
Return values
OperationStatus.< status code.
int32_t MX_WIFI_Disconnect ( MX_WIFIObject_t Obj)

Disconnect from a network.

Parameters
Objpointer to module handle
Return values
OperationStatus.< status code.
int32_t MX_WIFI_EAP_Connect ( MX_WIFIObject_t Obj,
const char *  SSID,
const char *  Identity,
const char *  Password,
mwifi_eap_attr_t attr,
mwifi_ip_attr_t ip 
)

Join an Access point with WPA-E.

Parameters
Objpointer to module handle
Ssidthe access point ID.
Identityclient identity.
Passwordclient password.
attrextral attributes of EAP method. NULL for default mode EAP-PEAP.
ipStation IP settings, NULL for DHCP mode.
Return values
OperationStatus.< status code.
int8_t MX_WIFI_Get_scan_result ( MX_WIFIObject_t Obj,
uint8_t *  results,
uint8_t  number 
)

wifi get scan result

Parameters
Objpointer to module handle
resultsscan result buffer, contains mwifi_ap_info_t * number
numbermax ap number to get, max 10
Return values
returnthe real ap number got.
Note
must be called after
int32_t MX_WIFI_GetIP6Address ( MX_WIFIObject_t Obj,
uint8_t *  ipaddr6,
int32_t  addr_num,
mwifi_if_t  wifi_if 
)

Get the local IPv6 address of the wifi module.

Parameters
Objpointer to module handle
ipaddr6buf to the IPv6 address array(16 bytes).
addr_numindex of the IPv6 address (index: 0/1/2).
wifi_ifwifi mode(station or softap).
Return values
OperationStatus.< status code.
int32_t MX_WIFI_GetIP6AddressState ( MX_WIFIObject_t Obj,
int32_t  addr_num,
mwifi_if_t  wifi_if 
)

Get the local IPv6 address state of the wifi module.

Parameters
Objpointer to module handle
addr_numindex of the IPv6 address (index: 0/1/2).
wifi_ifwifi mode(station or softap).
Return values
IPV6address State, error if < 0
int32_t MX_WIFI_GetIPAddress ( MX_WIFIObject_t Obj,
uint8_t *  ipaddr,
mwifi_if_t  wifi_if 
)

Get the local IPv4 address of the wifi module.

Parameters
Objpointer to module handle
ipaddrpointer to the IP address array(4 bytes).
wifi_ifwifi mode(station or softap).
Return values
OperationStatus.< status code.
int32_t MX_WIFI_GetMACAddress ( MX_WIFIObject_t Obj,
uint8_t *  mac 
)

Get the MAC address of the wifi module.

Parameters
Objpointer to module handle
macpointer to the MAC address array, size 6Bytes.
Return values
OperationStatus.< status code.
int32_t MX_WIFI_GetVersion ( MX_WIFIObject_t Obj,
uint8_t *  version,
uint32_t  size 
)

Get the firmware version string of the wifi module.

Parameters
Objpointer to module handle
versionbuffer pointer to receive the version string.
sizelength of the buffer, max size 24Bytes.
Return values
OperationStatus.< status code.
int8_t MX_WIFI_IsConnected ( MX_WIFIObject_t Obj)

Check whether the module is connected to an access point.

Return values
linkstatus 1: connected, otherwise not connect.
int32_t MX_WIFI_RegisterStatusCallback ( MX_WIFIObject_t Obj,
mx_wifi_status_callback_t  cb,
void *  arg 
)

Register wifi status changed callback.

Parameters
Objpointer to module handle
cbwifi status callback function
argargument pass to callback
Return values
OperationStatus.< status code.
int32_t MX_WIFI_RegisterStatusCallback_if ( MX_WIFIObject_t Obj,
mx_wifi_status_callback_t  cb,
void *  arg,
mwifi_if_t  interface 
)

< status code.

int32_t MX_WIFI_ResetModule ( MX_WIFIObject_t Obj)

Reset the module by Software.

Parameters
Objpointer to module handle
Return values
OperationStatus.< status code.
int32_t MX_WIFI_ResetToFactoryDefault ( MX_WIFIObject_t Obj)

Reset To factory defaults.

Parameters
Objpointer to module handle
Note
NOT USED NOW
Return values
OperationStatus.< status code.
int32_t MX_WIFI_Scan ( MX_WIFIObject_t Obj,
mc_wifi_scan_mode_t  scan_mode,
char *  ssid,
int32_t  len 
)

wifi block scan

Parameters
Objpointer to module handle
scan_modescan mode
ssidssid for active scan(scan specified AP), not used(set NULL) if do passive scan(scan all APs)
lenssid len of the AP to scan, not used(set 0) if do passive scan
Note
This API just start scan, use to get the scan result.
1 Example:
2  Active scan:
3  MX_WIFI_Scan(pWifiObj, MC_SCAN_ACTIVE, "ssid_ap", 7);
4  Passive scan:
5  MX_WIFI_Scan(pWifiObj, MC_SCAN_PASSIVE, NULL, 0);
6 
7  Get scan result:
8  mwifi_ap_info_t mx_aps[MX_WIFI_MAX_DETECTED_AP]; ( array to store scan AP info )
9  int32_t ap_num;
10  ap_num = MX_WIFI_Get_scan_result(pWifiObj, (uint8_t*)&(mx_aps[0]), MX_WIFI_MAX_DETECTED_AP);
11  if(ap_num > 0)
12  {
13  for(int32_t i = 0; i < ap_num; i++)
14  {
15  ( mx_aps[i].ssid )
16  ( mx_aps[i].rssi )
17  }
18  }
Return values
OperationStatus.< status code.
int32_t MX_WIFI_UnRegisterStatusCallback ( MX_WIFIObject_t Obj)

UnRegister wifi status changed callback.

Parameters
Objpointer to module handle
Return values
OperationStatus.< status code.
int32_t MX_WIFI_UnRegisterStatusCallback_if ( MX_WIFIObject_t Obj,
mwifi_if_t  interface 
)

< status code.

int32_t MX_WIFI_WPS_Connect ( MX_WIFIObject_t Obj)

Join an Access point with WPS (PUSH-BUTTON) mode.

Return values
OperationStatus.< status code.
int32_t MX_WIFI_WPS_Stop ( MX_WIFIObject_t Obj)

Stop WPS connect.

Parameters
Objpointer to module handle
Return values
OperationStatus.< status code.
Important Information for this Arm website

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies. If you are not happy with the use of these cookies, please review our Cookie Policy to learn how they can be disabled. By disabling cookies, some features of the site will not work.