Procházet zdrojové kódy

update jerry_net.c 增加判断是否支持网络功能,防止编译报错

Signed-off-by: yangfasheng <yangfasheng@rt-thread.com>
yangfasheng před 7 roky
rodič
revize
8119f1c133

+ 7 - 7
rtthread-port/jerry_mqtt.h

@@ -20,14 +20,14 @@ struct mqtt_callback_info
     int return_count;
     jerry_value_t* return_value;
     char* event_name;
-}typedef mqtt_cbinfo_t;
-    
+} typedef mqtt_cbinfo_t;
+
 struct mqtt_client_info
 {
     jerry_value_t this_value;
     int subCount; //the count of topics subscribed
     MQTTClient* client;
-    
+
     struct js_callback* event_callback;
     struct js_callback* fun_callback;
     struct js_callback* close_callback;
@@ -36,12 +36,12 @@ struct mqtt_client_info
     {
         char* topic;
         jerry_value_t js_func;
-    }callbackHandler[MAX_MESSAGE_HANDLERS];
-    
+    } callbackHandler[MAX_MESSAGE_HANDLERS];
+
     rt_sem_t sem;
-}typedef mqtt_info_t;
+} typedef mqtt_info_t;
 
 
 #endif
 
-#endif
+#endif

+ 4 - 0
rtthread-port/jerry_net.c

@@ -2,6 +2,8 @@
 #include "jerry_net.h"
 /* manage the pipe of socket */
 
+#ifdef RT_USING_LWIP
+
 #undef PIPE_BUFSZ
 #define PIPE_BUFSZ    512
 
@@ -1484,3 +1486,5 @@ jerry_value_t jerry_net_init()
 }
 
 JS_MODULE(net, jerry_net_init)
+
+#endif

+ 4 - 0
rtthread-port/jerry_net.h

@@ -1,6 +1,8 @@
 #ifndef JERRY_NET_H__
 #define JERRY_NET_H__
 
+#ifdef RT_USING_LWIP
+
 #include <rtthread.h>
 #include <unistd.h>
 #include <netdb.h>
@@ -110,3 +112,5 @@ struct close_callback_info
 } typedef net_closeInfo_t;
 
 #endif
+
+#endif