From: SnickerSun Date: Mon, 4 Mar 2024 12:54:01 +0000 (+0800) Subject: 解决了蓝牙访问外网问题。cat1固件暂时未更新,还有不插卡无法和cat1通讯的bug X-Git-Tag: release_V1.2.70_20241020_135402~1274^2~31^2~2 X-Git-Url: http://git.snicker.com.cn/css/static/gitweb.css?a=commitdiff_plain;h=c92d547c031589b85e6899356603840ddd4806a0;p=mirrors%2FFD230.git 解决了蓝牙访问外网问题。cat1固件暂时未更新,还有不插卡无法和cat1通讯的bug --- diff --git a/code/sdk/drivers/peripheral/slip/cat1Service/pyscript/EG810MCNLAR06A01M08_VOLTE_OCPU_QPY_BETA0228_20240303-0207.zip b/code/sdk/drivers/peripheral/slip/cat1Service/pyscript/EG810MCNLAR06A01M08_VOLTE_OCPU_QPY_BETA0228_20240303-0207.zip deleted file mode 100644 index f22b277fe..000000000 Binary files a/code/sdk/drivers/peripheral/slip/cat1Service/pyscript/EG810MCNLAR06A01M08_VOLTE_OCPU_QPY_BETA0228_20240303-0207.zip and /dev/null differ diff --git a/code/sdk/drivers/peripheral/slip/cat1Service/pyscript/cat1Service.py b/code/sdk/drivers/peripheral/slip/cat1Service/pyscript/cat1Service.py index 19966dfc9..0582fd241 100644 --- a/code/sdk/drivers/peripheral/slip/cat1Service/pyscript/cat1Service.py +++ b/code/sdk/drivers/peripheral/slip/cat1Service/pyscript/cat1Service.py @@ -85,7 +85,7 @@ class Cat1Service: AP = 0 # SLIP_INNER STA = 1 # SLIP_OUTER - def __init__(self, uart=UART.UART4, mode=STA, callback=None): + def __init__(self, uart=UART.UART4, mode=AP, callback=None): self.__uart = uart self.__mode = mode self.__message = '' @@ -360,7 +360,7 @@ cat1service = Cat1Service() Info = dataCall.getInfo(1,0) print("Info{}".format(Info)) default_NIC_ip = Info[2][2] # 假设默认网卡ip地址为10.10.1.1,请根据实际情况更改 -segment_ip = '172.16.4.5' # 假设ap模式网段范围是[192.168.4.0 ~ 192.168.4.255],请根据实际情况更改 +segment_ip = '172.16.1.0' # 假设ap模式网段范围是[192.168.4.0 ~ 192.168.4.255],请根据实际情况更改 mask = '255.255.255.0' # 假设子网掩码为255.255.255.0,请根据实际情况更改 # 配置默认网卡,通过默认网卡进行网络转发 cat1service.set_default_NIC(default_NIC_ip) diff --git a/code/sdk/open_source/openharmony/third_party/lwip/port/lwip-2.1/porting/include/lwip/lwipopts.h b/code/sdk/open_source/openharmony/third_party/lwip/port/lwip-2.1/porting/include/lwip/lwipopts.h index 6a4bfc1d8..650447d02 100644 --- a/code/sdk/open_source/openharmony/third_party/lwip/port/lwip-2.1/porting/include/lwip/lwipopts.h +++ b/code/sdk/open_source/openharmony/third_party/lwip/port/lwip-2.1/porting/include/lwip/lwipopts.h @@ -126,6 +126,8 @@ #define LWIP_DBG_MIN_LEVEL LWIP_DBG_LEVEL_OFF #define LWIP_DHCP 1 #define LWIP_DNS 1 +#define DNS_SERVER_ADDRESS(ipaddr) (ip4_addr_set_u32(ipaddr,ipaddr_addr("8.8.8.8"))) +#define DNS_SERVER_ADDRESS_SECONDARY(ipaddr) (ip4_addr_set_u32(ipaddr,ipaddr_addr("114.114.114.114"))) #define LWIP_ETHERNET 1 #define LWIP_HAVE_LOOPIF 1 #define LWIP_IGMP 1 diff --git a/code/sdk/open_source/openharmony/third_party/lwip/port/lwip-2.1/porting/src/lwip_init.c b/code/sdk/open_source/openharmony/third_party/lwip/port/lwip-2.1/porting/src/lwip_init.c index 8d748657b..f31ff4e73 100644 --- a/code/sdk/open_source/openharmony/third_party/lwip/port/lwip-2.1/porting/src/lwip_init.c +++ b/code/sdk/open_source/openharmony/third_party/lwip/port/lwip-2.1/porting/src/lwip_init.c @@ -36,6 +36,7 @@ void TcpIpPortingInit(void) { + printf("TcpIpPortingInit\n"); tcpip_init(NULL, NULL); } SYSEX_SERVICE_INIT(TcpIpPortingInit);