增加wifi下载http数据时服务器回应数据分包处理
authorkyz <kongyuzhong@google.com>
Tue, 21 May 2024 01:21:21 +0000 (09:21 +0800)
committerkyz <kongyuzhong@google.com>
Tue, 21 May 2024 01:21:21 +0000 (09:21 +0800)
user/user_eth.c
user/user_ota.c
user/user_wifi.c

index c0edecd8a1c057d7153ccddef8bd0245d0e4ddec..391a4b6f7772d249e81db773f2a365a8677744d3 100644 (file)
@@ -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);
index e55af5bf550b9242a5fd34b3f5462d291b9e4231..e353dada5f032f29c7c607f4b830b4c92491b0ec 100644 (file)
@@ -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;
index ef3721abe92c967b6a56697909a2a4718a80bba6..cbcdb5972bfd6576fcd0ec84a6e6dd1af6eaf456 100644 (file)
@@ -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;