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.

[参考译文] CC3100:SSID 扫描问题

Guru**** 2558440 points
Other Parts Discussed in Thread: CC3100

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

https://e2e.ti.com/support/wireless-connectivity/wi-fi-group/wifi/f/wi-fi-forum/609423/cc3100-ssid-scan-issue

器件型号:CC3100

客户在扫描 CC3100上的 SSID 时遇到问题。  系统未按预期响应 sl_SetSockOpt 命令。

基本上,当被动扫描一个或多个通道上的 SSID 时,我们使用了 SL_SO_RCVTIMEO 来指定输入函数等待完成的最长时间;实现200ms 超时。 但是、在给定扫描通道上没有 AP 的情况下、它似乎忽略了这个200ms 超时、并将等待更长的时间周期(以秒为顺序)。

您以前见过这种情况吗? 有什么建议吗? 我已附加一段代码以供参考…

/*!
\brief 此函数打开一个原始套接字,接收帧并显示它们。

\param[in]通道:原始套接字的通道
\param[in] timeout:超时间隔

返回0以获得成功、否则为-ve

注意

警告
*
int32_t Sniffer (uint8_t * ptr2buffer、uint16_t * buffer_index、uint8_t max_buffer_size、uint32_t channel、uint32_t timeout)

TransceiverRxOverHead_t *帧无线电报头= 0;
uint8_t MAC[MAX_RECV_BUF_SIZE]={'\0'};
// uint8_t filterData[MAC_ADDR_length]={'\0'};

int32_t RetVal =-1;
int16_t SD =-1;
int16_t indx、nMsgs;
SlSockNonBlocking_t enableOption;
SlTimeval_t timeVal;
uint32_t TIME_DELAY_msec;
bool test_bit;
uint16_t memIndx、prntIndex;

G_Exit = 1;

/******* 打开收发器的插座***** /
SD = SL_Socket (SL_AF_RF、SL_SOCK_RAW、(Int16_t)通道);

如果(SD > 0)

enableOption.NonblockingEnabled = 1;
indx = sl_SetSockOpt (SD、sl_SOL_Socket、sl_SO_NONBLOCKING、(void*)&enableOption、sizeof (enableOption));
if (indx!= 0){
if (sl_close (SD)!= 0)

返回-3;

其他

返回-1;

timeVal.tv_sec = 0;//秒
timeVal.tv_usec = 200000;//微秒。 10000微秒分辨率=> 200ms
indx = sl_SetSockOpt (SD、sl_SOL_Socket、sl_SO_RCVTIMEO、(_u8 *)&timeVal、sizeof (timeVal));//启用接收超时
if (indx!= 0){
if (sl_close (SD)!= 0)

返回-3;

其他

返回-1;

G_Exit = 0;

其他

返回-2;

/******** 从 CC3100接收帧并打印到屏幕***** /
memIndx = 0;
nMsgs = 0;

如果(!g_Exit)

TIME_DELAY_msec = START_TIME_TICKs (TIME_IN_TICKs (超时));

test_bit = check_time_ticks (time_delay_msec);
while (test_bit &&(max_buffer_size >= memIndx))

memset (wifi rxbuffer、0、sizeof (wifi rxbuffer));

RetVal = sl_Recv (SD、WiFi_rxbuffer、MAX_RECV_BUF_SIZE、0);//在收到每条消息后返回

if (RetVal >0)

memcpy (MAC、wifi rxbuffer、sizeof (wifi rxbuffer));
memset (&MAC[RetVal]、0、(sizeof (MAC)- RetVal));

if (MAC[8]=0x80)

帧无线电报头=(TransceiverRxOverHead_t *) wifi rxbuffer;
if ((memIndx +(uint16_t) MAC[45]+ 2)<= max_buffer_size)

if ((frameRadioHeader!= NULL)&&(frameRadioHeader->RSSI >= min_RSSI))

nMsgs++;
ptr2buffer[memIndx++]=(uint8_t) MAC[45]+ 2;
ptr2buffer[memIndx++]=(uint8_t)帧无线电报头->RSSI;
prntIndex = memIndx;
for (indx = 0;indx <(int16_t) MAC[45];indx++)

ptr2buffer[memIndx++]= MAC[46+indx];
ptr2buffer[memIndx]= 0;

if (CurrentPort == UART_INTF)

printf ("%s\r\n"、(char*)&ptr2buffer[prntIndex]);


test_bit = check_time_ticks (time_delay_msec);

其他

test_bit = false;


其他

test_bit = check_time_ticks (time_delay_msec);



*缓冲区索引= memIndx;

if (sl_close (SD)!= 0)

返回-3;

返回(int32_t) nMsgs;

此致、
标记

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

    您能否调试代码以查看应用中花费的额外时间?

    此致、
    查尔斯·奥