Quellcode durchsuchen

fix: struct at_socket_ops * assign error for AT device except ESP8266 (Bug from pr #182)

luhuadong vor 3 Jahren
Ursprung
Commit
7b9cd8a473
2 geänderte Dateien mit 2 neuen und 2 gelöschten Zeilen
  1. 1 1
      class/esp8266/at_socket_esp8266.c
  2. 1 1
      inc/at_device.h

+ 1 - 1
class/esp8266/at_socket_esp8266.c

@@ -478,7 +478,7 @@ static void esp8266_socket_set_event_cb(at_socket_evt_t event, at_evt_cb_t cb)
     }
 }
 
-static struct at_socket_ops esp8266_socket_ops =
+static const struct at_socket_ops esp8266_socket_ops =
 {
     esp8266_socket_connect,
     esp8266_socket_close,

+ 1 - 1
inc/at_device.h

@@ -94,7 +94,7 @@ struct at_device_class
     const struct at_device_ops *device_ops;      /* AT device operaiotns */
 #ifdef AT_USING_SOCKET
     uint32_t socket_num;                         /* The maximum number of sockets support */
-    struct at_socket_ops *socket_ops;            /* AT device socket operations */
+    const struct at_socket_ops *socket_ops;      /* AT device socket operations */
 #endif
     rt_slist_t list;                             /* AT device class list */
 };