This function is for compatibility with older versions. Do not use unless there is a special reason.

This function requests a connection from the access point.

Syntax

char ConnectWlan(
  char *pcSsid, 
  unsigned char u8SsidLen,
  unsigned char u8SecType, 
  void *pvAuthInfo, 
  unsigned short u16Ch
);

Parameters

pcSsid
[in] Specify the SSID of the access point to connect to.
u8SsidLen
[in] Specify the number of characters in the SSID.
u8SecType
[in] Specify the security type.
ValueDescription
M2M_WIFI_SEC_OPEN OPEN
M2M_WIFI_SEC_WPA_PSK WPA/WPA2
M2M_WIFI_SEC_WEP WEP
pvAuthInfo
[in] Specify the key information.
The specification method differs depending on the security type.
ValueDescription
M2M_WIFI_SEC_OPEN Please specify NULL.
M2M_WIFI_SEC_WPA_PSK Specifies the string address (char *) of the WPA password.
The maximum length of the string is 64 characters.
Please specify NULL at the end of the string.
M2M_WIFI_SEC_WEP tstrM2mWifiWepParams specify the address of the structure.
The parameters of the structure are as follows.
  • u8KeyIndx:
    Please specify the index of Wepkey.
    The range of values is 1 to 4.
  • u8KeySz:
    Please specify the size of Wepkey.
    Specifies the size including the terminating character NULL.
    The value is 11 or 27.
  • au8WepKey:
    Please specify the Wepkey.
    Specify NULL as the terminating character.
    The string length is 10 or 26 characters.
u16Ch
[in] Specify the channel number.
ValueDescription
M2M_WIFI_CH_1 Channel 1
M2M_WIFI_CH_2 Channel 2
M2M_WIFI_CH_3 Channel 3
M2M_WIFI_CH_4 Channel 4
M2M_WIFI_CH_5 Channel 5
M2M_WIFI_CH_6 Channel 6
M2M_WIFI_CH_7 Channel 7
M2M_WIFI_CH_8 Channel 1
M2M_WIFI_CH_9 Channel 1
M2M_WIFI_CH_10 Channel 10
M2M_WIFI_CH_11 Channel 11
M2M_WIFI_CH_13 Channel 13
M2M_WIFI_CH_ALL All channels

Return value

The following values will be returned.
ValueDescription
M2M_SUCCESS Succeeded
M2M_ERR_SLEEP_FAIL Initialize with SysWLANInit function.
Other than the above Failed

Remarks

Request a connection from the access point.
This function can be used when SYS_WLAN_POWER_MANUAL is set by the SysSetWLANPower function.

(Note)

The connection result of the access point must be judged by the callback function specified by the InitializeWlan function.

Requirements

Header file:
lib.h
Library file:
libSTARTUPOPH5000.a

Last updated: 2020/11/23