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:netwifi.c 中存在错误

Guru**** 2573695 points
Other Parts Discussed in Thread: CC3220S

请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

https://e2e.ti.com/support/wireless-connectivity/wi-fi-group/wifi/f/wi-fi-forum/648201/cc3220s-launchxl-bug-in-netwifi-c

器件型号:CC3220S-LAUNCHXL
主题中讨论的其他器件:CC3220S

AWS 样本中有一个 netwifi.c 文件

/shadow_sample_CC3220S_LAUNCHXL_tirtos_ccs/netwifi
/shadow_sample_console_echo CC3220S_LAUNCHXL_tirtos_ccs/netwifi
/subscribe_publish_sample_CC3220S_LAUNCHXL_tirtos_ccs/netwifi

wlanConnect()始终使用 sl_WLAN_SEC_TYPE_WPA (而不是 wiiconfig 中的 SECURITY_TYPE 设置)是一个小错误,因此对于开放网络,它始终会失败,直到您跟踪问题为止。

代码应为:

/*
=== wlanConnect ====
*安全连接参数
*/
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*) sid、strlen ((const char*) sid)、
空,&secParams,NULL);

返回(RET);
}