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.

[参考译文] CC3200-LAUNCHXL:当 CC3200与 WiFi 路由器连接时、是否有任何方法可以获得 WiFi 信号强度?

Guru**** 2564875 points
Other Parts Discussed in Thread: CC3200

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

https://e2e.ti.com/support/wireless-connectivity/wi-fi-group/wifi/f/wi-fi-forum/953632/cc3200-launchxl-is-there-any-way-to-get-the-wifi-signal-strength-when-the-cc3200-is-connected-with-the-wifi-router

器件型号:CC3200-LAUNCHXL
Thread 中讨论的其他器件:CC3200

您好!  

我想在屏幕上显示连接的 WiFi 的实时信号强度。 CC3200连接到路由器时、我们能否获得 WiFi 信号强度? 我已经检查了 CC3200 SDK 中的天线选择示例并尝试获取 RSSI SL_WlanRxStatStart() SL_WlanRxStatStop(),以便在器件连接时获取 RSSI,但我只获得零值。  

请提供任何示例代码!

提前感谢!

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

    您好!

    在使用 sl_WlanRxStatStart()开始统计数据收集之后,您需要等待多长时间才能检查统计数据? 如果网络流量非常小、则可能无法生成 RSSI 统计信息。

    您尝试从 ANTENNAL_SELECTION 示例中使用什么代码? 它似乎不使用 sl_WlanRxStat*() API。 请尝试以下代码并查看您是否可以获得一些预期的 RSSI 值:

    SlWlanGetRxStatResponse_t RxStat;
    sl_WlanRxStatStart ();
    //在平台的等待函数中添加此处,等待15秒
    //ex
    //SLEEP (15);
    sl_WlanRxStatGet (&RxStat、0);
    drawRxHist (&RxStat);*rxStatrxRxRxStat
    
    (&RxRxRxStatat);*无格式 RxRxRxRxStatt)
    
    浮动百分比;
    uint32_t 分数;
    uint32_t 整数;
    int32_t i、j;
    
    UART_PRINT (
    "\r\n\r\n ********* RX 统计数据"
    \r\n");
    UART_PRINT ("接收到的数据包:%d \r\n"、
    rxStatResp->ReceivedValidPacketsNumber);
    UART_PRINT (
    "管理的平均 RSSI:%d 平均值"
    其他数据包的 RSSI:%d\r\n\r\n"、
    rxStatResp->AvarageMgMntRssi, rxStatResp->AvarageDataCtrlRssi);
    
    if (rxStatResp->ReceivedValidPacketsNumber = 0)
    {
    UART_PRINT (
    "---------------- 未收集任何数据"
    "-------------- \r\n\r\n);
    }
    其他
    {
    UART_PRINT (
    "---------------- RSSI 直方图"
    ------------ \r\n");
    UART_PRINT (
    "-40dBm 至-87dBm (低于和高于 RSSI "
    将出现在第一个和最后一个单元格中]\r\n\r\n);
    
    UART_PRINT (
    " 10 20 30 40 50 60 70 80 90 100\r\n);
    UART_PRINT (
    " |---+--+--+--+---+---+---+---+---|\r\n");
    
    //RSSI 直方图从-40到-87
    //(下面和上面的所有 RSSI 将出现在第一个和最后一个单元格中
    对于(I = 0;I < SL_WLAN_SIZE _of _RSSI_Histogram;i++)
    {
    百分比=
    ((浮点) rxStatResp->RssiHistogram [i]/
    (float) rxStatResp->ReceivedValidPacketsNumber *(float) 100);
    if (0 = I)
    {
    UART_PRINT (">-40dBm ");
    }
    其他
    {
    if ((sl_WLAN_SIZE_ON_RSSI_B柱 状图- 1)= I)
    {
    UART_PRINT ("<-87dBm");
    }
    其他
    {
    UART_PRINT ("-%-2ddBm"、40 +
    (i * 47 /(sl_WLAN_SIZE _of _RSSI_Histogram - 1)));
    }
    }
    对于(j = 0;j <(int) percent / 2;j++)
    {
    UART_PRINT("*");
    }
    对于(j = 0;j < 50 -(int) percent / 2;j++)
    {
    UART_PRINT (");
    }
    整数=(int)百分比;
    小数=(int)(Percent - integer )*100);
    UART_PRINT ("(%d.%d%%)\r\n"、整数、小数);
    UART_PRINT (
    " |----+---+--+--+----+----+------|"
    "\r\n");
    }
    
    UART_PRINT (
    " 10 20 30 40 50 "
    " 60 70 80 90 100\r\n");
    
    /*打印速率直方图*/
    
    UART_PRINT (
    "---------------- 速率直方图"
    ------ \r\n");
    UART_PRINT (
    " 10 20 30 40 50 60 70 80 90 100\r\n);
    UART_PRINT (
    " |---+--+--+--+---+---+---+---+---|\r\n");
    
    for (i = 0;i < sl_WLAN_NUM_OF_RAGE_INTRIDENS;i++)
    {
    百分比=
    ((浮点) rxStatResp->RateHistogram [i]/
    (float) rxStatResp->ReceivedValidPacketsNumber *(float) 100);
    UART_PRINT ("%-2D ",i);
    对于(j = 0;j <(int) percent / 2;j++)
    {
    UART_PRINT("*");
    }
    对于(j = 0;j < 50 -(int) percent / 2;j++)
    {
    UART_PRINT (");
    }
    整数=(int)百分比;
    小数=(int)(Percent - integer )*100);
    UART_PRINT ("(%d.%d%%)\r\n"、整数、小数);
    UART_PRINT (
    " |----+---+--+--+----+----+------|"
    "\r\n");
    }
    
    UART_PRINT (
    " 10 20 30 40 50 60 70 80 90 100\r\n);
    }
    
    UART_PRINT (
    "\r\n 数据在%umSec 中被采样\r\n、
    (((unsigned int) rxStatResp->GetTimeStamp -
    rxStatResp->StartTimeStamp)/1000);
    
    UART_PRINT (
    "********* End Rx Statistics (结束 Rx 统计信息)"
    "************ ");
    }
    
    

    此致、

    Michael