CC3200 ping不通网关,但PC能ping通CC3200
在修改调试SCAN例程时,CC3200端能够连接到无线接入点,但ping不同网关,但在PC端能够ping通CC3200,这是什么原因呢?ping函数如下:
static long CheckLanConnection()
{
SlPingStartCommand_t pingParams = {0};
SlPingReport_t pingReport = {0};
long lRetVal = -1;
Report("%d\n\r",g_ulStatus);
CLR_STATUS_BIT(g_ulStatus, STATUS_BIT_PING_DONE);
g_ulPingPacketsRecv = 0;
// Set the ping parameters
pingParams.PingIntervalTime = PING_INTERVAL;
pingParams.PingSize = PING_PKT_SIZE;
pingParams.PingRequestTimeout = PING_TIMEOUT;
pingParams.TotalNumberOfAttempts = NO_OF_ATTEMPTS;
pingParams.Flags = 0;
pingParams.Ip = g_ulGatewayIP;
Report("%u\n\r",pingParams.Ip);
// Check for LAN connection
lRetVal = sl_NetAppPingStart((SlPingStartCommand_t*)&pingParams, SL_AF_INET,
(SlPingReport_t*)&pingReport, SimpleLinkPingReport);
Report("%d",lRetVal);
ASSERT_ON_ERROR(lRetVal);
// Wait for NetApp Event
while(!IS_PING_DONE(g_ulStatus))
{
#ifndef SL_PLATFORM_MULTI_THREADED
_SlNonOsMainLoopTask();
#endif
}
if(0 == g_ulPingPacketsRecv)
{
//Problem with LAN connection
ASSERT_ON_ERROR(LAN_CONNECTION_FAILED);
}
// LAN connection is successful
return SUCCESS;
}
其sl_NetAppPingStart()的返回值结果为-8.图如附件所示。