From: kyz Date: Tue, 21 May 2024 01:21:21 +0000 (+0800) Subject: 增加wifi下载http数据时服务器回应数据分包处理 X-Git-Url: http://kyz.pub/gitweb/?a=commitdiff_plain;h=d4513578e9999e7b9166d8d6cd22453f14076ffa;p=yn%2Fweldingcontroller.git 增加wifi下载http数据时服务器回应数据分包处理 --- diff --git a/user/user_eth.c b/user/user_eth.c index c0edecd..391a4b6 100644 --- a/user/user_eth.c +++ b/user/user_eth.c @@ -177,8 +177,8 @@ static err_t tcp_eth_recv(void *arg, struct tcp_pcb *tpcb, struct pbuf *p, err_t } }else if( client == &g_ota_client ){ //TODO: - extern int32_t ota_handle_http_resp_eth( uint8_t *rx_data, uint32_t rx_sz ); - ota_handle_http_resp_eth( p->payload, p->tot_len ); + extern int32_t ota_handle_http_resp_data( uint8_t *rx_data, uint32_t rx_sz ); + ota_handle_http_resp_data( p->payload, p->tot_len ); } #endif pbuf_free(p); diff --git a/user/user_ota.c b/user/user_ota.c index e55af5b..e353dad 100644 --- a/user/user_ota.c +++ b/user/user_ota.c @@ -165,7 +165,7 @@ int32_t ota_handle_http_resp( uint8_t *rx_data, uint32_t rx_sz ) } -int32_t ota_handle_http_resp_eth( uint8_t *rx_data, uint32_t rx_sz ) +int32_t ota_handle_http_resp_data( uint8_t *rx_data, uint32_t rx_sz ) { static uint8_t http_data[2048]; static uint32_t data_sz = 0; diff --git a/user/user_wifi.c b/user/user_wifi.c index ef3721a..cbcdb59 100644 --- a/user/user_wifi.c +++ b/user/user_wifi.c @@ -13,7 +13,7 @@ #define huart_wifi huart5 -extern int32_t ota_handle_http_resp( uint8_t *rx_data, uint32_t rx_sz ); +extern int32_t ota_handle_http_resp_data( uint8_t *rx_data, uint32_t rx_sz ); extern int32_t wifi_ota_start( char * url, char *ver ); extern char * devinfo_report_str( void ); @@ -350,7 +350,7 @@ static void tcp_rx_data_handle(void *arg, char *rspinfo, int rsplen) int n =at_read( (char*)(ota_rx_buf), len ); ota_rx_n = len; debug_printf( " ota recv data %d bytes, rd:%d, wifi buf:%d[%d..%d]\n", len, n, rx_buf_wr-rx_buf_rd, rx_buf_rd, rx_buf_wr ); - ota_handle_http_resp( ota_rx_buf, ota_rx_n ); + ota_handle_http_resp_data( ota_rx_buf, ota_rx_n ); } } return;