Parcourir la source

[at] ping adapt to v5.1.0

Meco Man il y a 1 an
Parent
commit
d42b2a0d32

+ 10 - 2
class/air720/at_device_air720.c

@@ -457,8 +457,12 @@ __exit:
 }
 
 #ifdef NETDEV_USING_PING
-static int air720_netdev_ping(struct netdev *netdev, const char *host,
-                              size_t data_len, uint32_t timeout, struct netdev_ping_resp *ping_resp)
+static int air720_netdev_ping(struct netdev *netdev, const char *host, size_t data_len,
+                              uint32_t timeout, struct netdev_ping_resp *ping_resp
+#if RT_VER_NUM >= 0x50100
+                              , rt_bool_t is_bind
+#endif
+                             )
 {
 #define air720_PING_RESP_SIZE 128
 #define air720_PING_IP_SIZE 16
@@ -473,6 +477,10 @@ static int air720_netdev_ping(struct netdev *netdev, const char *host,
     at_response_t resp = RT_NULL;
     struct at_device *device = RT_NULL;
 
+#if RT_VER_NUM >= 0x50100
+    RT_UNUSED(is_bind);
+#endif
+
     RT_ASSERT(netdev);
     RT_ASSERT(host);
     RT_ASSERT(ping_resp);

+ 10 - 2
class/bc26/at_device_bc26.c

@@ -517,8 +517,12 @@ __exit:
 }
 
 #ifdef NETDEV_USING_PING
-static int bc26_netdev_ping(struct netdev *netdev, const char *host,
-                            size_t data_len, uint32_t timeout, struct netdev_ping_resp *ping_resp)
+static int bc26_netdev_ping(struct netdev *netdev, const char *host, size_t data_len,
+                            uint32_t timeout, struct netdev_ping_resp *ping_resp
+#if RT_VER_NUM >= 0x50100
+                            , rt_bool_t is_bind
+#endif
+                            )
 {
 #define BC26_PING_RESP_SIZE 128
 #define BC26_PING_IP_SIZE 16
@@ -530,6 +534,10 @@ static int bc26_netdev_ping(struct netdev *netdev, const char *host,
     at_response_t resp = RT_NULL;
     struct at_device *device = RT_NULL;
 
+#if RT_VER_NUM >= 0x50100
+    RT_UNUSED(is_bind);
+#endif
+
     RT_ASSERT(netdev);
     RT_ASSERT(host);
     RT_ASSERT(ping_resp);

+ 10 - 2
class/bc28/at_device_bc28.c

@@ -384,8 +384,12 @@ __exit:
     int bc28_domain_resolve(const char *name, char ip[16]);
 #endif
 #ifdef NETDEV_USING_PING
-static int bc28_netdev_ping(struct netdev *netdev, const char *host,
-        size_t data_len, uint32_t timeout, struct netdev_ping_resp *ping_resp)
+static int bc28_netdev_ping(struct netdev *netdev, const char *host, size_t data_len,
+                            uint32_t timeout, struct netdev_ping_resp *ping_resp
+#if RT_VER_NUM >= 0x50100
+                            , rt_bool_t is_bind
+#endif
+                            )
 {
 #define BC28_PING_RESP_SIZE       128
 #define BC28_PING_IP_SIZE         16
@@ -397,6 +401,10 @@ static int bc28_netdev_ping(struct netdev *netdev, const char *host,
     at_response_t resp = RT_NULL;
     struct at_device *device = RT_NULL;
 
+#if RT_VER_NUM >= 0x50100
+    RT_UNUSED(is_bind);
+#endif
+
     RT_ASSERT(netdev);
     RT_ASSERT(host);
     RT_ASSERT(ping_resp);

+ 9 - 1
class/ec20/at_device_ec20.c

@@ -534,7 +534,11 @@ __exit:
 
 #ifdef NETDEV_USING_PING
 static int ec20_netdev_ping(struct netdev *netdev, const char *host,
-        size_t data_len, uint32_t timeout, struct netdev_ping_resp *ping_resp)
+            size_t data_len, uint32_t timeout, struct netdev_ping_resp *ping_resp
+#if RT_VER_NUM >= 0x50100
+            , rt_bool_t is_bind
+#endif
+            )
 {
 #define EC20_PING_RESP_SIZE       128
 #define EC20_PING_IP_SIZE         16
@@ -546,6 +550,10 @@ static int ec20_netdev_ping(struct netdev *netdev, const char *host,
     at_response_t resp = RT_NULL;
     struct at_device *device = RT_NULL;
 
+#if RT_VER_NUM >= 0x50100
+    RT_UNUSED(is_bind);
+#endif
+
     RT_ASSERT(netdev);
     RT_ASSERT(host);
     RT_ASSERT(ping_resp);

+ 9 - 1
class/ec200x/at_device_ec200x.c

@@ -582,7 +582,11 @@ __exit:
 
 #ifdef NETDEV_USING_PING
 static int ec200x_netdev_ping(struct netdev *netdev, const char *host,
-        size_t data_len, uint32_t timeout, struct netdev_ping_resp *ping_resp)
+            size_t data_len, uint32_t timeout, struct netdev_ping_resp *ping_resp
+#if RT_VER_NUM >= 0x50100
+            , rt_bool_t is_bind
+#endif
+            )
 {
 #define EC200X_PING_RESP_SIZE       128
 #define EC200X_PING_IP_SIZE         16
@@ -594,6 +598,10 @@ static int ec200x_netdev_ping(struct netdev *netdev, const char *host,
     at_response_t resp = RT_NULL;
     struct at_device *device = RT_NULL;
 
+#if RT_VER_NUM >= 0x50100
+    RT_UNUSED(is_bind);
+#endif
+
     RT_ASSERT(netdev);
     RT_ASSERT(host);
     RT_ASSERT(ping_resp);

+ 9 - 1
class/esp32/at_device_esp32.c

@@ -373,7 +373,11 @@ __exit:
 
 #ifdef NETDEV_USING_PING
 static int esp32_netdev_ping(struct netdev *netdev, const char *host,
-                size_t data_len, uint32_t timeout, struct netdev_ping_resp *ping_resp)
+            size_t data_len, uint32_t timeout, struct netdev_ping_resp *ping_resp
+#if RT_VER_NUM >= 0x50100
+            , rt_bool_t is_bind
+#endif
+            )
 {
 #define ESP32_PING_IP_SIZE         16
 
@@ -383,6 +387,10 @@ static int esp32_netdev_ping(struct netdev *netdev, const char *host,
     char ip_addr[ESP32_PING_IP_SIZE] = {0};
     int req_time;
 
+#if RT_VER_NUM >= 0x50100
+    RT_UNUSED(is_bind);
+#endif
+
     RT_ASSERT(netdev);
     RT_ASSERT(host);
     RT_ASSERT(ping_resp);

+ 9 - 1
class/esp8266/at_device_esp8266.c

@@ -374,7 +374,11 @@ __exit:
 
 #ifdef NETDEV_USING_PING
 static int esp8266_netdev_ping(struct netdev *netdev, const char *host,
-                size_t data_len, uint32_t timeout, struct netdev_ping_resp *ping_resp)
+            size_t data_len, uint32_t timeout, struct netdev_ping_resp *ping_resp
+#if RT_VER_NUM >= 0x50100
+            , rt_bool_t is_bind
+#endif
+            )
 {
 #define ESP8266_PING_IP_SIZE         16
 
@@ -384,6 +388,10 @@ static int esp8266_netdev_ping(struct netdev *netdev, const char *host,
     char ip_addr[ESP8266_PING_IP_SIZE] = {0};
     int req_time;
 
+#if RT_VER_NUM >= 0x50100
+    RT_UNUSED(is_bind);
+#endif
+
     RT_ASSERT(netdev);
     RT_ASSERT(host);
     RT_ASSERT(ping_resp);

+ 9 - 1
class/l610/at_device_l610.c

@@ -508,7 +508,11 @@ __exit:
 
 #ifdef NETDEV_USING_PING
 static int l610_netdev_ping(struct netdev *netdev, const char *host,
-        size_t data_len, uint32_t timeout, struct netdev_ping_resp *ping_resp)
+            size_t data_len, uint32_t timeout, struct netdev_ping_resp *ping_resp
+#if RT_VER_NUM >= 0x50100
+            , rt_bool_t is_bind
+#endif
+            )
 {
 #define L610_PING_RESP_SIZE         128
 #define L610_PING_IP_SIZE           16
@@ -522,6 +526,10 @@ static int l610_netdev_ping(struct netdev *netdev, const char *host,
     at_response_t resp = RT_NULL;
     struct at_device *device = RT_NULL;
 
+#if RT_VER_NUM >= 0x50100
+    RT_UNUSED(is_bind);
+#endif
+
     RT_ASSERT(netdev);
     RT_ASSERT(host);
     RT_ASSERT(ping_resp);

+ 9 - 1
class/m26/at_device_m26.c

@@ -385,7 +385,11 @@ __exit:
 
 #ifdef NETDEV_USING_PING
 static int m26_netdev_ping(struct netdev *netdev, const char *host,
-            size_t data_len, uint32_t timeout, struct netdev_ping_resp *ping_resp)
+            size_t data_len, uint32_t timeout, struct netdev_ping_resp *ping_resp
+#if RT_VER_NUM >= 0x50100
+            , rt_bool_t is_bind
+#endif
+            )
 {
 #define M26_PING_RESP_SIZE       128
 #define M26_PING_IP_SIZE         16
@@ -397,6 +401,10 @@ static int m26_netdev_ping(struct netdev *netdev, const char *host,
     int response, recv_data_len, time, ttl;
     struct at_device *device = RT_NULL;
 
+#if RT_VER_NUM >= 0x50100
+    RT_UNUSED(is_bind);
+#endif
+
     RT_ASSERT(netdev);
     RT_ASSERT(host);
     RT_ASSERT(ping_resp);

+ 9 - 1
class/m5311/at_device_m5311.c

@@ -392,7 +392,11 @@ __exit:
  */
 #ifdef NETDEV_USING_PING
 static int m5311_netdev_ping(struct netdev *netdev, const char *host,
-        size_t data_len, uint32_t timeout, struct netdev_ping_resp *ping_resp)
+            size_t data_len, uint32_t timeout, struct netdev_ping_resp *ping_resp
+#if RT_VER_NUM >= 0x50100
+            , rt_bool_t is_bind
+#endif
+            )
 {
 #define M5311_PING_RESP_SIZE       512
 #define M5311_PING_IP_SIZE         16
@@ -408,6 +412,10 @@ static int m5311_netdev_ping(struct netdev *netdev, const char *host,
     RT_ASSERT(host);
     RT_ASSERT(ping_resp);
 
+#if RT_VER_NUM >= 0x50100
+    RT_UNUSED(is_bind);
+#endif
+
     device = at_device_get_by_name(AT_DEVICE_NAMETYPE_NETDEV, netdev->name);
     if (device == RT_NULL)
     {

+ 9 - 1
class/m6315/at_device_m6315.c

@@ -388,7 +388,11 @@ __exit:
 
 #ifdef NETDEV_USING_PING
 static int m6315_netdev_ping(struct netdev *netdev, const char *host,
-        size_t data_len, uint32_t timeout, struct netdev_ping_resp *ping_resp)
+            size_t data_len, uint32_t timeout, struct netdev_ping_resp *ping_resp
+#if RT_VER_NUM >= 0x50100
+            , rt_bool_t is_bind
+#endif
+            )
 {
 #define M6315_PING_RESP_SIZE         128
 #define M6315_PING_IP_SIZE           16
@@ -404,6 +408,10 @@ static int m6315_netdev_ping(struct netdev *netdev, const char *host,
     RT_ASSERT(host);
     RT_ASSERT(ping_resp);
 
+#if RT_VER_NUM >= 0x50100
+    RT_UNUSED(is_bind);
+#endif
+
     device = at_device_get_by_name(AT_DEVICE_NAMETYPE_NETDEV, netdev->name);
     if (device == RT_NULL)
     {

+ 9 - 1
class/me3616/at_device_me3616.c

@@ -444,7 +444,11 @@ static int me3616_netdev_set_down(struct netdev *netdev)
 
 #ifdef NETDEV_USING_PING
 static int me3616_netdev_ping(struct netdev *netdev, const char *host,
-        size_t data_len, uint32_t timeout, struct netdev_ping_resp *ping_resp)
+            size_t data_len, uint32_t timeout, struct netdev_ping_resp *ping_resp
+#if RT_VER_NUM >= 0x50100
+            , rt_bool_t is_bind
+#endif
+            )
 {
 #define ME3616_PING_RESP_SIZE       256
 #define ME3616_PING_IP_SIZE         16
@@ -460,6 +464,10 @@ static int me3616_netdev_ping(struct netdev *netdev, const char *host,
     RT_ASSERT(host);
     RT_ASSERT(ping_resp);
 
+#if RT_VER_NUM >= 0x50100
+    RT_UNUSED(is_bind);
+#endif
+
     device = at_device_get_by_name(AT_DEVICE_NAMETYPE_NETDEV, netdev->name);
     if (device == RT_NULL)
     {

+ 9 - 2
class/ml305/at_device_ml305.c

@@ -501,9 +501,16 @@ __exit:
 #ifdef NETDEV_USING_PING
 #ifdef AT_DEVICE_USING_ML305
 static int ml305_netdev_ping(struct netdev *netdev, const char *host,
-        size_t data_len, uint32_t timeout, struct netdev_ping_resp *ping_resp)
+            size_t data_len, uint32_t timeout, struct netdev_ping_resp *ping_resp
+#if RT_VER_NUM >= 0x50100
+            , rt_bool_t is_bind
+#endif
+            )
 {
-    rt_kprintf("I don't have PING function!\r\n");
+#if RT_VER_NUM >= 0x50100
+    RT_UNUSED(is_bind);
+#endif
+    LOG_E("ping doesn't support in ml305 device.");
     return RT_EOK;
 }
 #endif

+ 9 - 2
class/ml307/at_device_ml307.c

@@ -513,7 +513,11 @@ __exit:
 #ifdef NETDEV_USING_PING
 #ifdef AT_DEVICE_USING_ML307
 static int ml307_netdev_ping(struct netdev *netdev, const char *host,
-        size_t data_len, uint32_t timeout, struct netdev_ping_resp *ping_resp)
+            size_t data_len, uint32_t timeout, struct netdev_ping_resp *ping_resp
+#if RT_VER_NUM >= 0x50100
+            , rt_bool_t is_bind
+#endif
+            )
 {
 #define ML307_PING_RESP_SIZE         128
 #define ML307_PING_IP_SIZE           16
@@ -524,7 +528,10 @@ static int ml307_netdev_ping(struct netdev *netdev, const char *host,
     char ip_addr_resp[ML307_PING_IP_SIZE + 8] = {0};
     at_response_t resp = RT_NULL;
     struct at_device *device = RT_NULL;
-//    int sent, recv, lost, min, max, avg;
+
+#if RT_VER_NUM >= 0x50100
+    RT_UNUSED(is_bind);
+#endif
 
     RT_ASSERT(netdev);
     RT_ASSERT(host);

+ 9 - 1
class/n21/at_device_n21.c

@@ -372,7 +372,11 @@ static int n21_netdev_set_down(struct netdev *netdev)
 
 #ifdef NETDEV_USING_PING
 static int n21_netdev_ping(struct netdev *netdev, const char *host,
-                           size_t data_len, uint32_t timeout, struct netdev_ping_resp *ping_resp)
+            size_t data_len, uint32_t timeout, struct netdev_ping_resp *ping_resp
+#if RT_VER_NUM >= 0x50100
+            , rt_bool_t is_bind
+#endif
+            )
 {
 #define N21_PING_RESP_SIZE 512
 #define N21_PING_IP_SIZE 16
@@ -387,6 +391,10 @@ static int n21_netdev_ping(struct netdev *netdev, const char *host,
     at_response_t resp = RT_NULL;
     struct at_device *device = RT_NULL;
 
+#if RT_VER_NUM >= 0x50100
+    RT_UNUSED(is_bind);
+#endif
+
     RT_ASSERT(netdev);
     RT_ASSERT(host);
     RT_ASSERT(ping_resp);

+ 9 - 1
class/n58/at_device_n58.c

@@ -446,7 +446,11 @@ __exit:
 
 #ifdef NETDEV_USING_PING
 static int n58_netdev_ping(struct netdev *netdev, const char *host,
-                           size_t data_len, uint32_t timeout, struct netdev_ping_resp *ping_resp)
+            size_t data_len, uint32_t timeout, struct netdev_ping_resp *ping_resp
+#if RT_VER_NUM >= 0x50100
+            , rt_bool_t is_bind
+#endif
+            )
 {
 #define N58_PING_RESP_SIZE 512
 #define N58_PING_IP_SIZE 16
@@ -461,6 +465,10 @@ static int n58_netdev_ping(struct netdev *netdev, const char *host,
     at_response_t resp = RT_NULL;
     struct at_device *device = RT_NULL;
 
+#if RT_VER_NUM >= 0x50100
+    RT_UNUSED(is_bind);
+#endif
+
     RT_ASSERT(netdev);
     RT_ASSERT(host);
     RT_ASSERT(ping_resp);

+ 9 - 1
class/n720/at_device_n720.c

@@ -529,7 +529,11 @@ __exit:
 
 #ifdef NETDEV_USING_PING
 static int n720_netdev_ping(struct netdev *netdev, const char *host,
-        size_t data_len, uint32_t timeout, struct netdev_ping_resp *ping_resp)
+            size_t data_len, uint32_t timeout, struct netdev_ping_resp *ping_resp
+#if RT_VER_NUM >= 0x50100
+            , rt_bool_t is_bind
+#endif
+            )
 {
 #define N720_PING_RESP_SIZE       128
 #define N720_PING_IP_SIZE         16
@@ -541,6 +545,10 @@ static int n720_netdev_ping(struct netdev *netdev, const char *host,
     at_response_t resp = RT_NULL;
     struct at_device *device = RT_NULL;
 
+#if RT_VER_NUM >= 0x50100
+    RT_UNUSED(is_bind);
+#endif
+
     RT_ASSERT(netdev);
     RT_ASSERT(host);
     RT_ASSERT(ping_resp);

+ 9 - 1
class/sim76xx/at_device_sim76xx.c

@@ -328,7 +328,11 @@ static int sim76xx_netdev_set_down(struct netdev *netdev)
 #ifdef NETDEV_USING_PING
 /* sim76xx network interface device ping feature */
 static int sim76xx_netdev_ping(struct netdev *netdev, const char *host,
-        size_t data_len, uint32_t timeout, struct netdev_ping_resp *ping_resp)
+            size_t data_len, uint32_t timeout, struct netdev_ping_resp *ping_resp
+#if RT_VER_NUM >= 0x50100
+            , rt_bool_t is_bind
+#endif
+            )
 {
 #define SIM76XX_PING_RESP_SIZE         128
 #define SIM76XX_PING_IP_SIZE           16
@@ -340,6 +344,10 @@ static int sim76xx_netdev_ping(struct netdev *netdev, const char *host,
     at_response_t resp = RT_NULL;
     struct at_device *device = RT_NULL;
 
+#if RT_VER_NUM >= 0x50100
+    RT_UNUSED(is_bind);
+#endif
+
     RT_ASSERT(netdev);
     RT_ASSERT(host);
     RT_ASSERT(ping_resp);

+ 9 - 1
class/sim800c/at_device_sim800c.c

@@ -439,7 +439,11 @@ __exit:
 
 #ifdef NETDEV_USING_PING
 static int sim800c_netdev_ping(struct netdev *netdev, const char *host,
-        size_t data_len, uint32_t timeout, struct netdev_ping_resp *ping_resp)
+            size_t data_len, uint32_t timeout, struct netdev_ping_resp *ping_resp
+#if RT_VER_NUM >= 0x50100
+            , rt_bool_t is_bind
+#endif
+            )
 {
 #define SIM800C_PING_RESP_SIZE         128
 #define SIM800C_PING_IP_SIZE           16
@@ -454,6 +458,10 @@ static int sim800c_netdev_ping(struct netdev *netdev, const char *host,
     at_response_t resp = RT_NULL;
     struct at_device *device = RT_NULL;
 
+#if RT_VER_NUM >= 0x50100
+    RT_UNUSED(is_bind);
+#endif
+
     RT_ASSERT(netdev);
     RT_ASSERT(host);
     RT_ASSERT(ping_resp);

+ 9 - 1
class/w60x/at_device_w60x.c

@@ -427,7 +427,11 @@ __exit:
 
 #ifdef NETDEV_USING_PING
 static int w60x_netdev_ping(struct netdev *netdev, const char *host,
-                size_t data_len, uint32_t timeout, struct netdev_ping_resp *ping_resp)
+            size_t data_len, uint32_t timeout, struct netdev_ping_resp *ping_resp
+#if RT_VER_NUM >= 0x50100
+            , rt_bool_t is_bind
+#endif
+            )
 {
 #define W60X_IP_SIZE         16
 
@@ -437,6 +441,10 @@ static int w60x_netdev_ping(struct netdev *netdev, const char *host,
     char ip_addr[W60X_IP_SIZE] = {0};
     char *pos;
 
+#if RT_VER_NUM >= 0x50100
+    RT_UNUSED(is_bind);
+#endif
+
     RT_ASSERT(netdev);
     RT_ASSERT(host);
     RT_ASSERT(ping_resp);