From c561a1d92ff48a2e0f6cd20537df431bc3928625 Mon Sep 17 00:00:00 2001 From: SnickerSun Date: Sun, 21 Apr 2024 22:29:14 +0800 Subject: [PATCH] =?utf8?q?lwip=E6=B7=BB=E5=8A=A0tcp=20tls=E6=94=AF?= =?utf8?q?=E6=8C=81=20=EF=BC=8C=E4=BF=AE=E6=94=B9AT^DOWNLOADOTA=E6=8C=87?= =?utf8?q?=E4=BB=A4=E5=B0=9D=E8=AF=95=E6=94=AF=E6=8C=81https=E4=B8=8B?= =?utf8?q?=E8=BD=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- .../drivers/peripheral/utils/custom_utils_at_cmd.c | 14 ++++++++------ .../port/lwip-2.1/porting/include/lwip/lwipopts.h | 3 +++ 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/code/sdk/drivers/peripheral/utils/custom_utils_at_cmd.c b/code/sdk/drivers/peripheral/utils/custom_utils_at_cmd.c index 546ec999c..a899a8a63 100644 --- a/code/sdk/drivers/peripheral/utils/custom_utils_at_cmd.c +++ b/code/sdk/drivers/peripheral/utils/custom_utils_at_cmd.c @@ -118,23 +118,25 @@ static uint32_t custom_start_ota_download(uint8_t *para, uint32_t paraLen, char return ERRCODE_FAIL; } - if (argc != 2) { + if (argc != 4) { PRINT("CUSTOM_UTILSTEST ATCMD Set Parameter Failed argc %d\n",argc); return ERRCODE_FAIL; } //通讯开始,唤醒cat1 uapi_cat1_wakeup_cat1(1); - uint8_t *uri = (uint8_t*)argv[0]; - uint8_t *otadatapath = (uint8_t*)argv[1]; - PRINT("custom_start_ota_download %s to %s\r\n",uri,otadatapath); + uint8_t *server = (uint8_t*)argv[0]; + uint8_t port = atoi((const char*)argv[1]); + uint8_t *uri = (uint8_t*)argv[2]; + uint8_t *otadatapath = (uint8_t*)argv[3]; + PRINT("custom_start_ota_download %s:%d %s to %s\r\n",server,port,uri,otadatapath); httpc_connection_t settings = {0}; settings.result_fn=httpc_download_result; settings.headers_done_fn=httpc_download_headers_done; httpc_state_t* connection=NULL; err_t rett = httpc_get_file_dns_to_disk( - (const char*) "icfota.snicker.com.cn", - 8089, + (const char*) server, + port, (const char*) uri, (const httpc_connection_t *)&settings, NULL, 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 ff0eff1ab..b362e4aac 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 @@ -186,6 +186,9 @@ #define NO_SYS 0 #define TCP_QUEUE_OOSEQ LWIP_TCP +#define LWIP_ALTCP 1 +#define LWIP_ALTCP_TLS 1 + #if defined LWIP_STATS_DISPLAY && !LWIP_STATS #undef LWIP_STATS_DISPLAY #define LWIP_STATS_DISPLAY 0 -- 2.17.1