From: SnickerSun Date: Sun, 21 Apr 2024 14:29:14 +0000 (+0800) Subject: lwip添加tcp tls支持 ,修改AT^DOWNLOADOTA指令尝试支持https下载 X-Git-Tag: release_V1.2.70_20241020_135402~1159 X-Git-Url: http://git.snicker.com.cn/?a=commitdiff_plain;h=c561a1d92ff48a2e0f6cd20537df431bc3928625;p=mirrors%2FFD230.git lwip添加tcp tls支持 ,修改AT^DOWNLOADOTA指令尝试支持https下载 --- 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