Selaa lähdekoodia

fix:手动回滚到之前的版本

wl 2 vuotta sitten
vanhempi
sitoutus
b17a832c56

+ 7 - 7
components/ethernet/common/dns_client.c

@@ -187,7 +187,7 @@ int32_t dns_get_ip(dns_client_t *client, Buffer_Struct *buf, uint16_t answer_num
 			{
 				if (process && (process->ip_nums < MAX_DNS_IP))
 				{
-//					//LLOGD("ipv4 result%d,%d.%d.%d.%d", process->ip_nums, pvUn.u8[0], pvUn.u8[1], pvUn.u8[2], pvUn.u8[3] );
+					LLOGD("ipv4 result%d,%d.%d.%d.%d", process->ip_nums, pvUn.u8[0], pvUn.u8[1], pvUn.u8[2], pvUn.u8[3] );
 					process->ip_result[process->ip_nums].ip = ip_addr;
 					process->ip_result[process->ip_nums].ttl_end = ttl + ((uint32_t)(luat_mcu_tick64_ms()/1000));
 					process->ip_nums++;
@@ -258,7 +258,7 @@ NET_DNSGETIP_DONE:
 					process->is_ipv6 = 0;
 					process->timeout_ms = 0;
 					process->retry_cnt = 0;
-					//LLOGI("dns ipv6 done, now dns ipv4");
+					LLOGI("dns ipv6 done, now dns ipv4");
 					return 0;
 				}
 			}
@@ -524,7 +524,7 @@ void dns_run(dns_client_t *client, Buffer_Struct *in, Buffer_Struct *out, int *s
 		dns_clear(client);
 		if (client->is_run)
 		{
-			//LLOGI("dns all done ,now stop");
+			LLOGI("dns all done ,now stop");
 		}
 		client->is_run = 0;
 		return;
@@ -619,7 +619,7 @@ NET_DNS_TX:
 					{
 						if (process->ipv6_done && process->ip_nums)
 						{
-							//LLOGD("get ipv6, no ipv4");
+							LLOGD("get ipv6, no ipv4");
 							process->ip_nums = 0;
 							process->is_done = 1;
 							client->new_result = 1;
@@ -638,7 +638,7 @@ NET_DNS_TX:
 				process->dns_cnt++;
 				if (process->dns_cnt >= MAX_DNS_SERVER)
 				{
-					//LLOGE("no ipv6, no ipv4");
+					LLOGE("no ipv6, no ipv4");
 					process->ip_nums = 0;
 					process->is_done = 1;
 					client->new_result = 1;
@@ -662,7 +662,7 @@ NET_DNS_TX_IPV4:
 				goto NET_DNS_TX;
 			}
 		}
-		//LLOGD("%.*s state %d id %d ipv6 %d use dns server%d, try %d", process->uri_buf.Pos, process->uri_buf.Data, process->is_done, process->session_id, process->is_ipv6, process->dns_cnt, process->retry_cnt);
+		LLOGD("%.*s state %d id %d ipv6 %d use dns server%d, try %d", process->uri_buf.Pos, process->uri_buf.Data, process->is_done, process->session_id, process->is_ipv6, process->dns_cnt, process->retry_cnt);
 		process->is_done = 0;
 		OS_InitBuffer(out, 512);
 		dns_make(client, process, out);
@@ -679,7 +679,7 @@ NET_DNS_RX_OUT:
 	{
 		if (client->is_run)
 		{
-			//LLOGI("dns all done ,now stop");
+			LLOGI("dns all done ,now stop");
 		}
 		client->is_run = 0;
 		return;

+ 2 - 38
components/network/adapter/luat_network_adapter.c

@@ -3,7 +3,6 @@
 #include "luat_malloc.h"
 #include "luat_crypto.h"
 #include "luat_rtos.h"
-#include "common_api.h"
 #ifdef LUAT_USE_NETWORK
 #include "luat_rtos.h"
 #include "platform_def.h"
@@ -152,13 +151,10 @@ extern void DBG_Printf(const char* format, ...);
 extern void DBG_HexPrintf(void *Data, unsigned int len);
 //#define DBG(x,y...)		DBG_Printf("%s %d:"x"\r\n", __FUNCTION__,__LINE__,##y)
 //#define DBG_ERR(x,y...)		DBG_Printf("%s %d:"x"\r\n", __FUNCTION__,__LINE__,##y)
-//#ifndef LUAT_EC7XX_CSDK
 static int tls_random( void *p_rng,
         unsigned char *output, size_t output_len );
-//#endif
 
 #define __NW_DEBUG_ENABLE__
-#define LUAT_LOG_NO_NEWLINE
 #ifdef __NW_DEBUG_ENABLE__
 #ifdef LUAT_LOG_NO_NEWLINE
 #define DBG(x,y...)	do {if (ctrl->is_debug) {DBG_Printf("%s %d:"x, __FUNCTION__,__LINE__,##y);}} while(0)
@@ -374,21 +370,12 @@ TLS_RECV:
 static int network_get_host_by_name(network_ctrl_t *ctrl)
 {
 #ifdef LUAT_USE_LWIP
-	//#ifdef LUAT_EC7XX_CSDK
-	//ctrl->remote_ip.type = 0xff;
-	//#else
 	network_set_ip_invaild(&ctrl->remote_ip);
-	//#endif
-	
 	if (ipaddr_aton(ctrl->domain_name, &ctrl->remote_ip))
 	{
 		return 0;
 	}
-	//#ifdef LUAT_EC7XX_CSDK
-	//ctrl->remote_ip.type = 0xff;
-	//#else
 	network_set_ip_invaild(&ctrl->remote_ip);
-	//#endif
 	return -1;
 #else
 	ctrl->remote_ip.is_ipv6 = 0xff;
@@ -447,7 +434,6 @@ static int network_base_connect(network_ctrl_t *ctrl, luat_ip_addr_t *remote_ip)
 	}
 	if (remote_ip)
 	{
-		//#ifndef LUAT_EC7XX_CSDK
 		if (network_create_soceket(ctrl, network_ip_is_ipv6(remote_ip)) < 0)
 		{
 			network_clean_invaild_socket(ctrl->adapter_index);
@@ -456,16 +442,6 @@ static int network_base_connect(network_ctrl_t *ctrl, luat_ip_addr_t *remote_ip)
 				return -1;
 			}
 		}
-		// #else
-		// if (network_create_soceket(ctrl, IPADDR_TYPE_V6 == remote_ip->type) < 0)
-		// {
-		// 	network_clean_invaild_socket(ctrl->adapter_index);
-		// 	if (network_create_soceket(ctrl, IPADDR_TYPE_V6 == remote_ip->type) < 0)
-		// 	{
-		// 		return -1;
-		// 	}
-		// }
-		// #endif
 		if (adapter->opt->is_posix)
 		{
 			volatile uint32_t val;
@@ -552,17 +528,11 @@ static int network_base_connect(network_ctrl_t *ctrl, luat_ip_addr_t *remote_ip)
 
 static int network_prepare_connect(network_ctrl_t *ctrl)
 {
-    //#ifndef LUAT_EC7XX_CSDK
+   
 	if (network_ip_is_vaild(&ctrl->remote_ip))
 	{
 		;
 	}
-	// #else
-	// if (ctrl->remote_ip.type != 0xff)
-	// {
-	// 	;
-	// }
-	// #endif
 	else if (ctrl->domain_name)
 	{
 		if (network_get_host_by_name(ctrl))
@@ -702,17 +672,11 @@ static int network_state_connecting(network_ctrl_t *ctrl, OS_EVENT *event, netwo
 	case EV_NW_SOCKET_ERROR:
 	case EV_NW_SOCKET_REMOTE_CLOSE:
 	case EV_NW_SOCKET_CLOSE_OK:
-		//#ifndef LUAT_EC7XX_CSDK
+		
 		if (network_ip_is_vaild(&ctrl->remote_ip))
 		{
 			return -1;
 		}
-		// #elif
-		// if (ctrl->remote_ip.type != 0xff)
-		// {
-		// 	return -1;
-		// }
-		// #endif
 		DBG("dns ip %d no connect!,%d", ctrl->dns_ip_cnt, ctrl->dns_ip_nums);
 		ctrl->dns_ip_cnt++;
 		if (ctrl->dns_ip_cnt >= ctrl->dns_ip_nums)

+ 0 - 1
components/network/adapter/luat_network_adapter.h

@@ -3,7 +3,6 @@
 #include "luat_base.h"
 // #ifdef LUAT_USE_NETWORK
 #include "luat_rtos.h"
-#include "bsp_common.h"
 #ifdef LUAT_USE_TLS
 #include "mbedtls/ssl.h"
 #include "mbedtls/platform.h"

+ 7 - 6
demo/air780eg_gnsstest/main.lua

@@ -177,13 +177,14 @@ sys.taskInit(function()
 
         -- uart.write(gps_uart_id, "$CFGSYS\r\n")
         -- uart.write(gps_uart_id, "$CFGMSG,6,4\r\n")
-        log.info("RMC", json.encode(libgnss.getRmc(2) or {}))
+        log.info("RMC", json.encode(libgnss.getRmc(2) or {}, "7f"))
+        log.info("INT", libgnss.getIntLocation())
         -- log.info("GGA", libgnss.getGga(3))
-        -- log.info("GLL", json.encode(libgnss.getGll(2) or {}))
-        -- log.info("GSA", json.encode(libgnss.getGsa(2) or {}))
-        -- log.info("GSV", json.encode(libgnss.getGsv(2) or {}))
-        -- log.info("VTG", json.encode(libgnss.getVtg(2) or {}))
-        -- log.info("ZDA", json.encode(libgnss.getZda(2) or {}))
+        -- log.info("GLL", json.encode(libgnss.getGll(2) or {}, "7f"))
+        -- log.info("GSA", json.encode(libgnss.getGsa(2) or {}, "7f"))
+        -- log.info("GSV", json.encode(libgnss.getGsv(2) or {}, "7f"))
+        -- log.info("VTG", json.encode(libgnss.getVtg(2) or {}, "7f"))
+        -- log.info("ZDA", json.encode(libgnss.getZda(2) or {}, "7f"))
         -- log.info("date", os.date())
         log.info("sys", rtos.meminfo("sys"))
         log.info("lua", rtos.meminfo("lua"))

+ 5 - 3
demo/at24cxx/main.lua

@@ -14,10 +14,12 @@ local i2cid = 0
 sys.taskInit(function()
     log.info("i2c initial",i2c.setup(i2cid))
     while true do
-        i2c.writeReg(i2cid, addr, 0x01, "abcd1234")
+        i2c.send(i2cid, addr, string.char(0x01, 0x00) .. "12345678")
         sys.wait(100)
-        local data = i2c.readReg(i2cid, addr, 0x01, 8)
-        log.info("i2c", "data2",data:toHex(),data)
+        i2c.send(i2cid, addr, string.char(0x01, 0x00))
+        sys.wait(100)
+        local data = i2c.recv(i2cid, addr, 8)
+        log.info("i2c", "data2", data:toHex(), #data)
         sys.wait(1000)
     end
 

+ 1 - 1
demo/jt808/socket_demo.lua

@@ -149,7 +149,7 @@ local function socketTask(ip, port)
 	-- socket.config(netc, nil, true)
 	while true do
 		-- log.info(rtos.meminfo("sys"))
-		result = libnet.waitLink(d1Name, 0, netc)
+		--result = libnet.waitLink(d1Name, 0, netc)
 		result = libnet.connect(d1Name, 15000, netc, ip, port)
 		-- result = libnet.connect(d1Name, 5000, netc, "112.125.89.8",34607)
 		d1Online = result

+ 1 - 1
script/libs/lbsLoc.lua

@@ -180,7 +180,7 @@ local function taskClient(cbFnc, reqAddr, timeout, productKey, host, port,reqTim
         if not netc then cbFnc(6) return end -- 创建socket失败
         socket.debug(netc, false)
         socket.config(netc, nil, true, nil)
-        result = libnet.waitLink(d1Name, 0, netc)
+        --result = libnet.waitLink(d1Name, 0, netc)
         result = libnet.connect(d1Name, 5000, netc, host, port)
         if result then
             while true do