ZHCU938C May 2018 – January 2021 CC3100 , CC3100MOD , CC3200 , CC3200MOD
连接到企业网络时,需要三个文件:
这三个文件必须按以下名称进行编程,以便器件使用:
建立连接:
sl_WlanConnect(char* pName, int NameLen, unsigned char *pMacAddr, SlSecParams_t* pSecParams, SlSecParamsExt_t* pSecExtParams)
sl_WlanProfileAdd(char* pName, int NameLen, unsigned char *pMacAddr, SlSecParams_t* pSecParams, SlSecParamsExt_t* pSecExtParams, unsigned long Priority, unsigned long Options)
sl_WlanConnect 和 sl_WlanProfileAdd 命令用于不同类型的 Wi-Fi 连接。连接命令用于一次性连接;当自动连接开启时使用添加配置文件命令(请参阅添加配置文件命令白皮书)。对于企业连接,使用那些具有额外安全参数的命令 – SlSecParamsExt_t。
下文简要介绍了这些命令的前五个参数。添加配置文件命令白皮书详细介绍了该命令的其他参数。
typedef struct
{
unsigned char Type; - type should be SL_SEC_TYPE_WPA_ENT
char* Key; - a key password for the enterprise connection that
must have it.MSCHAP, FAST ETC.
unsigned char KeyLen;
}SlSecParams_t;
typedef struct
{
char* User; - the enterprise user name
unsigned char UserLen;
char* AnonUser; - the anonymous user name (optional) for two phase
enterprise connections.
unsigned char AnonUserLen;
unsigned char CertIndex; - not supported
unsigned long EapMethod; -
SL_ENT_EAP_METHOD_TLS
SL_ENT_EAP_METHOD_TTLS_TLS
SL_ENT_EAP_METHOD_TTLS_MSCHAPv2
SL_ENT_EAP_METHOD_TTLS_PSK
SL_ENT_EAP_METHOD_PEAP0_TLS
SL_ENT_EAP_METHOD_PEAP0_MSCHAPv2
SL_ENT_EAP_METHOD_PEAP0_PSK
SL_ENT_EAP_METHOD_PEAP1_TLS
SL_ENT_EAP_METHOD_PEAP1_MSCHAPv2
SL_ENT_EAP_METHOD_PEAP1_PSK
SL_ENT_EAP_METHOD_FAST_AUTH_PROVISIONING
SL_ENT_EAP_METHOD_FAST_UNAUTH_PROVISIONING
SL_ENT_EAP_METHOD_FAST_NO_PROVISIONING
}SlSecParamsExt_t;