浏览代码

Merge pull request #22 from RT-Thread-packages/develop

Merge Develop
朱天龙 (Armink) 7 年之前
父节点
当前提交
4a06c2bcbf
共有 2 个文件被更改,包括 10 次插入4 次删除
  1. 5 2
      at_socket_esp8266.c
  2. 5 2
      at_socket_m26.c

+ 5 - 2
at_socket_esp8266.c

@@ -31,6 +31,10 @@
 
 
 #include <at_socket.h>
 #include <at_socket.h>
 
 
+#if !defined(AT_SW_VERSION_NUM) || AT_SW_VERSION_NUM < 0x10000
+#error "This AT Client version is older, please check and update latest AT Client!"
+#endif
+
 #ifndef AT_DEVICE_NOT_SELECTED
 #ifndef AT_DEVICE_NOT_SELECTED
 
 
 #define ESP8266_MODULE_SEND_MAX_SIZE   2048
 #define ESP8266_MODULE_SEND_MAX_SIZE   2048
@@ -240,7 +244,6 @@ static int esp8266_socket_send(int socket, const char *buff, size_t bfsz, enum a
     /* set current socket for send URC event */
     /* set current socket for send URC event */
     cur_socket = socket;
     cur_socket = socket;
     /* set AT client end sign to deal with '>' sign.*/
     /* set AT client end sign to deal with '>' sign.*/
-    extern int at_set_end_sign(char ch);
     at_set_end_sign('>');
     at_set_end_sign('>');
 
 
     while (sent_size < bfsz)
     while (sent_size < bfsz)
@@ -702,7 +705,7 @@ static int at_socket_device_init(void)
     }
     }
 
 
     /* initialize AT client */
     /* initialize AT client */
-    at_client_init();
+    at_client_init(AT_DEVICE_NAME, AT_DEVICE_RECV_BUFF_LEN);
 
 
     /* register URC data execution function  */
     /* register URC data execution function  */
     at_set_urc_table(urc_table, sizeof(urc_table) / sizeof(urc_table[0]));
     at_set_urc_table(urc_table, sizeof(urc_table) / sizeof(urc_table[0]));

+ 5 - 2
at_socket_m26.c

@@ -31,6 +31,10 @@
 #include <at.h>
 #include <at.h>
 #include <at_socket.h>
 #include <at_socket.h>
 
 
+#if !defined(AT_SW_VERSION_NUM) || AT_SW_VERSION_NUM < 0x10000
+#error "This AT Client version is older, please check and update latest AT Client!"
+#endif
+
 #ifndef AT_DEVICE_NOT_SELECTED
 #ifndef AT_DEVICE_NOT_SELECTED
 
 
 #define M26_MODULE_SEND_MAX_SIZE       1460
 #define M26_MODULE_SEND_MAX_SIZE       1460
@@ -293,7 +297,6 @@ static int m26_socket_send(int socket, const char *buff, size_t bfsz, enum at_so
     /* set current socket for send URC event */
     /* set current socket for send URC event */
     cur_socket = socket;
     cur_socket = socket;
     /* set AT client end sign to deal with '>' sign.*/
     /* set AT client end sign to deal with '>' sign.*/
-    extern int at_set_end_sign(char ch);
     at_set_end_sign('>');
     at_set_end_sign('>');
 
 
     while (sent_size < bfsz)
     while (sent_size < bfsz)
@@ -907,7 +910,7 @@ static int at_socket_device_init(void)
     }
     }
 
 
     /* initialize AT client */
     /* initialize AT client */
-    at_client_init();
+    at_client_init(AT_DEVICE_NAME, AT_DEVICE_RECV_BUFF_LEN);
 
 
     /* register URC data execution function  */
     /* register URC data execution function  */
     at_set_urc_table(urc_table, sizeof(urc_table) / sizeof(urc_table[0]));
     at_set_urc_table(urc_table, sizeof(urc_table) / sizeof(urc_table[0]));