ZHCU938C May 2018 – January 2021 CC3100 , CC3100MOD , CC3200 , CC3200MOD
// Push Button
void main()
{
SlSecParams_t WPSsecParams;
Int status;
Int role;
role = sl_Start(NULL, NULL, NULL);
if( 0 > role )
{
printf("failed start cc3100\n");
}
if(role == ROLE_STA)
{
WPSsecParams.Type = SL_SEC_TYPE_WPS_PBC;
WPSsecParams.Key = NULL;
WPSsecParams.KeyLen = 0;
status = sl_WlanConnect(0,0,0,&WPSsecParams,0);
while (SL_IPEQUIRED != g_SlConnState)
{
Sleep(20);
}
}
}
// PIN-based
void main()
{
SlSecParams_t WPSsecParams;
Int status;
Int role;
role = sl_Start(NULL, NULL, NULL);
if( 0 > role )
{
printf("failed start cc3100\n");
}
if(role == ROLE_STA) {
WPSsecParams.Type = SL_SEC_TYPE_WPS_PIN;
WPSsecParams.Key = "34374696"; //example pin code
WPSsecParams.KeyLen = 8;
status = sl_WlanConnect("" ==>,0,0,&WPSsecParams,0);
while (SL_IPEQUIRED != g_SlConnState) {
Sleep(20);
}
}
}