This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

CC3220S-LAUNCHXL: Bug in netwifi.c

Part Number: CC3220S-LAUNCHXL
Other Parts Discussed in Thread: CC3220S

There is a file netwifi.c that is in the aws samples

./shadow_sample_CC3220S_LAUNCHXL_tirtos_ccs/netwifi.c
./shadow_sample_console_echo_CC3220S_LAUNCHXL_tirtos_ccs/netwifi.c
./subscribe_publish_sample_CC3220S_LAUNCHXL_tirtos_ccs/netwifi.c

It has a small bug in that wlanConnect() always uses SL_WLAN_SEC_TYPE_WPA instead of the SECURITY_TYPE setting from wificonfig.h, so for open networks it always fails until you track down the issue.

The code should be :

/*
 *  ======== wlanConnect =======
 *  Secure connection parameters
 */
static int wlanConnect()
{
    SlWlanSecParams_t secParams = {0};
    int ret = 0;

    secParams.Key = (signed char *)SECURITY_KEY;
    secParams.KeyLen = strlen((const char *)secParams.Key);
    secParams.Type = SECURITY_TYPE;

    ret = sl_WlanConnect((signed char*)SSID, strlen((const char*)SSID),
            NULL, &secParams, NULL);

    return (ret);
}