There has been a change in V1.1.0 of the SDK in sl_WlanConnect which always requires a valid SSID name. When no SSID name is provided the function now returns an -2003 error code and exits the function.
Problem is I'm trying to use push button WPS to establish a connection to the AP. In many cases I may not know the AP SSID which is why I'm using WPS as a configuration option.
Here is the code snippet with what I believe need to be changed highlighted in red:
_i16 sl_WlanConnect(const _i8* pName,const _i16 NameLen,const _u8 *pMacAddr,const SlSecParams_t* pSecParams ,const SlSecParamsExt_t* pSecExtParams)
{
_SlWlanConnectMsg_u Msg = {0};
_SlCmdCtrl_t CmdCtrl = {0};
CmdCtrl.TxDescLen = 0;/* init */
CmdCtrl.RxDescLen = sizeof(_BasicResponse_t);
/* verify SSID length */
VERIFY_PROTOCOL(NameLen <= MAX_SSID_LEN);
/* verify SSID is not NULL */
if( NULL == pName )
{
return SL_INVALPARAM;
}
The invocation of sl_WlanConnect I used successfully in V1.0.0 of the SDK (to connect to a WPA2 secured AP) is as follows:
SlSecParams_t ssecParams;
ssecParams.Type = SL_SEC_TYPE_WPS_PBC;
ssecParams.Key = NULL;
ssecParams.KeyLen = 0;
sl_WlanConnect(0, 0, 0, &ssecParams, 0);