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 获取ping数据出现平均路由时间小于最小路由时间的问题



测试代码

static int PingTest(unsigned long ulIpAddr)
{
    signed long lRetVal = -1;
    SlPingStartCommand_t PingParams;
    SlPingReport_t PingReport;
    PingParams.PingIntervalTime = 1000;
    PingParams.PingSize = 20;
    PingParams.PingRequestTimeout = 3000;
    PingParams.TotalNumberOfAttempts = 3;
    PingParams.Flags = 0;
    PingParams.Ip = ulIpAddr;

    UART_PRINT("Running Ping Test\n\r");
    /* Check for LAN connection */
    lRetVal = sl_NetAppPingStart((SlPingStartCommand_t*)&PingParams, SL_AF_INET,
                            (SlPingReport_t*)&PingReport, NULL);
    ASSERT_ON_ERROR(lRetVal);

    g_ulPingPacketsRecv = PingReport.PacketsReceived;

    if (g_ulPingPacketsRecv > 0 && g_ulPingPacketsRecv <= 3)
    {
      UART_PRINT("\r\n115.159.226.240 Ping Info:\r\n");
      UART_PRINT(" DataPackets: Sent %d,Received %d,Lose %d\r\n",PingReport.PacketsSent,PingReport.PacketsReceived,PingReport.PacketsSent-PingReport.PacketsReceived);
      UART_PRINT("RoundTime Info(ms):\r\n");
      UART_PRINT(" MinRoundTime %dms,MaxRoundTime %dms,AvgRoundTime %dms,TestTime %dms\r\n\r\n",
              PingReport.MinRoundTime,
              PingReport.MaxRoundTime,
              PingReport.AvgRoundTime,
              PingReport.TestTime);
    }
    else
    {
        // Problem with LAN connection
        ASSERT_ON_ERROR(LAN_CONNECTION_FAILED);
    }

    return SUCCESS;
}

打印信息

115.159.226.240 Ping Info:
DataPackets: Sent 3,Received 3,Lose 0
RoundTime Info(ms):
MinRoundTime 155ms,MaxRoundTime 257ms,AvgRoundTime 142ms,TestTime 12000ms