From b81bbf4077ca235bfdf0f76279600824af3398d1 Mon Sep 17 00:00:00 2001 From: MarcusXing Date: Thu, 16 Aug 2018 13:15:00 +0800 Subject: [PATCH] fix ping bug --- at_socket_ec20.c | 30 +++++++++++++++++++++--------- 1 file changed, 21 insertions(+), 9 deletions(-) diff --git a/at_socket_ec20.c b/at_socket_ec20.c index 3b44228..c9568d1 100644 --- a/at_socket_ec20.c +++ b/at_socket_ec20.c @@ -847,22 +847,34 @@ static void ec20_socket_set_event_cb(at_socket_evt_t event, at_evt_cb_t cb) static void urc_ping_func(const char *data, rt_size_t size) { static int icmp_seq = 0; + int i, j = 0; int result, recv_len, time, ttl; + int sent, rcvd, lost, min, max, avg; char dst_ip[16] = { 0 }; RT_ASSERT(data); - sscanf(data, "+QPING: %d,%[^,],%d,%d,%d", &result, dst_ip, &recv_len, &time, &ttl); - - switch(result) + for (i=0;i