update TestFtp

This commit is contained in:
Ambrumf 2023-10-09 21:13:11 +08:00
parent b8335863ba
commit 7f14d047cb
3 changed files with 36 additions and 33 deletions

View File

@ -1,10 +1,10 @@
menu "test app" menu "test app"
menuconfig USER_TEST config USER_TEST
bool "Enable application test function " bool "Enable application test function "
default n default n
if USER_TEST if USER_TEST
menuconfig USER_TEST_ADC config USER_TEST_ADC
bool "Config test adc" bool "Config test adc"
default n default n
if USER_TEST_ADC if USER_TEST_ADC
@ -15,7 +15,7 @@ menu "test app"
endif endif
endif endif
menuconfig USER_TEST_DAC config USER_TEST_DAC
bool "Config test dac" bool "Config test dac"
default n default n
if USER_TEST_DAC if USER_TEST_DAC
@ -26,7 +26,7 @@ menu "test app"
endif endif
endif endif
menuconfig USER_TEST_FS config USER_TEST_FS
bool "Config test fs with sd or usb" bool "Config test fs with sd or usb"
default n default n
if USER_TEST_FS if USER_TEST_FS
@ -38,7 +38,7 @@ menu "test app"
endif endif
menuconfig USER_TEST_GPIO config USER_TEST_GPIO
select BSP_USING_GPIO select BSP_USING_GPIO
select RESOURCES_PIN select RESOURCES_PIN
select BSP_USING_LED select BSP_USING_LED
@ -53,7 +53,7 @@ menu "test app"
endif endif
endif endif
menuconfig USER_TEST_LORA config USER_TEST_LORA
select BSP_USING_UART select BSP_USING_UART
select BSP_USING_GPIO select BSP_USING_GPIO
select RESOURCES_PIN select RESOURCES_PIN
@ -72,12 +72,12 @@ menu "test app"
endif endif
endif endif
menuconfig USER_TEST_SOCKET config USER_TEST_SOCKET
select BSP_USING_LWIP select BSP_USING_LWIP
bool "Config test socket(lwip)" bool "Config test socket(lwip)"
default n default n
menuconfig USER_TEST_UART config USER_TEST_UART
select BSP_USING_UART select BSP_USING_UART
select BSP_USING_UART6 select BSP_USING_UART6
bool "Config test uart" bool "Config test uart"
@ -90,7 +90,7 @@ menu "test app"
endif endif
endif endif
menuconfig USER_TEST_RS485 config USER_TEST_RS485
select BSP_USING_UART select BSP_USING_UART
select BSP_USING_GPIO select BSP_USING_GPIO
select RESOURCES_PIN select RESOURCES_PIN
@ -108,7 +108,7 @@ menu "test app"
endif endif
endif endif
menuconfig USER_TEST_RTC config USER_TEST_RTC
select BSP_USING_RTC select BSP_USING_RTC
bool "Config test rtc" bool "Config test rtc"
default n default n
@ -120,7 +120,7 @@ menu "test app"
endif endif
endif endif
menuconfig USER_TEST_HWTIMER config USER_TEST_HWTIMER
select BSP_USING_HWTIMER select BSP_USING_HWTIMER
select BSP_USING_GPIO select BSP_USING_GPIO
select RESOURCES_PIN select RESOURCES_PIN
@ -138,7 +138,7 @@ menu "test app"
endif endif
endif endif
menuconfig USER_TEST_WDT config USER_TEST_WDT
select BSP_USING_WDT0 select BSP_USING_WDT0
bool "Config test watchdog" bool "Config test watchdog"
default n default n
@ -150,7 +150,7 @@ menu "test app"
endif endif
endif endif
menuconfig USER_TEST_LCD_EDU config USER_TEST_LCD_EDU
select BSP_USING_LCD select BSP_USING_LCD
bool "Config test lcd in PrivOpen" bool "Config test lcd in PrivOpen"
default n default n
@ -162,7 +162,7 @@ menu "test app"
endif endif
endif endif
menuconfig USER_TEST_TOUCH config USER_TEST_TOUCH
select BSP_USING_TOUCH select BSP_USING_TOUCH
bool "Config test touch" bool "Config test touch"
default n default n
@ -177,7 +177,7 @@ menu "test app"
endif endif
endif endif
menuconfig USER_TEST_I2C config USER_TEST_I2C
select BSP_USING_I2C select BSP_USING_I2C
bool "Config test i2c" bool "Config test i2c"
default n default n
@ -189,7 +189,7 @@ menu "test app"
endif endif
endif endif
menuconfig USER_TEST_CAN config USER_TEST_CAN
select BSP_USING_CAN select BSP_USING_CAN
bool "Config test can" bool "Config test can"
default n default n
@ -201,7 +201,7 @@ menu "test app"
endif endif
endif endif
menuconfig USER_TEST_CAMERA config USER_TEST_CAMERA
select BSP_USING_CAMERA select BSP_USING_CAMERA
select BSP_USING_LCD select BSP_USING_LCD
bool "Config test camera with lcd" bool "Config test camera with lcd"
@ -225,7 +225,7 @@ menu "test app"
bool "Config test lcd device" bool "Config test lcd device"
default n default n
menuconfig USER_TEST_ETHERNET config USER_TEST_ETHERNET
bool "Config test ethernet only for edu-riscv64" bool "Config test ethernet only for edu-riscv64"
default n default n
if USER_TEST_ETHERNET if USER_TEST_ETHERNET
@ -243,7 +243,7 @@ menu "test app"
endif endif
endif endif
menuconfig USER_TEST_FLASH config USER_TEST_FLASH
bool "Config test w25q128 device" bool "Config test w25q128 device"
default n default n
if USER_TEST_FLASH if USER_TEST_FLASH
@ -254,51 +254,51 @@ menu "test app"
endif endif
endif endif
menuconfig USER_TEST_TIMER config USER_TEST_TIMER
bool "Config test soft timer" bool "Config test soft timer"
default n default n
menuconfig USER_TEST_HASH config USER_TEST_HASH
bool "Config test hash" bool "Config test hash"
default n default n
menuconfig USER_TEST_RADIX config USER_TEST_RADIX
bool "Config test radix tree" bool "Config test radix tree"
default n default n
menuconfig USER_TEST_RBTREE config USER_TEST_RBTREE
bool "Config test red black tree" bool "Config test red black tree"
default n default n
menuconfig USER_TEST_MODBUS_TCP config USER_TEST_MODBUS_TCP
bool "Config test modbus_tcp" bool "Config test modbus_tcp"
default n default n
menuconfig USER_TEST_WEBSERVER config USER_TEST_WEBSERVER
bool "Config test webserver" bool "Config test webserver"
default n default n
menuconfig USER_TEST_MQTTCLIENT config USER_TEST_MQTTCLIENT
bool "Config test mqtt client" bool "Config test mqtt client"
default n default n
menuconfig USER_TEST_FTPCLIENT config USER_TEST_FTPCLIENT
bool "Config test ftp client" bool "Config test ftp client"
default n default n
menuconfig USER_TEST_LORA_P2P config USER_TEST_LORA_P2P
bool "Config test lora p2p" bool "Config test lora p2p"
default n default n
menuconfig USER_TEST_LORAWAN_SINGLEGW config USER_TEST_LORAWAN_SINGLEGW
bool "Config test lorawan single channel gateway" bool "Config test lorawan single channel gateway"
default n default n
menuconfig USER_TEST_CANOPEN config USER_TEST_CANOPEN
bool "Config test CanOpen" bool "Config test CanOpen"
default n default n
menuconfig USER_TEST_USB_CAMERA config USER_TEST_USB_CAMERA
bool "Config test usb camera" bool "Config test usb camera"
default n default n

View File

@ -125,6 +125,10 @@ ifeq ($(CONFIG_ADD_XIZI_FEATURES),y)
SRC_DIR += test_modbus_tcp SRC_DIR += test_modbus_tcp
endif endif
ifeq ($(CONFIG_USER_TEST_FTPCLIENT),y)
SRC_FILES += test_ftp/test_ftp.c
endif
ifeq ($(CONFIG_USER_TEST_WEBSERVER),y) ifeq ($(CONFIG_USER_TEST_WEBSERVER),y)
SRC_FILES += SRC_FILES +=
endif endif

View File

@ -173,7 +173,7 @@ int Download(char *name)
return 0; return 0;
} }
for(it = 0;it < len;it += ret){ for(it = 0;it < len;it += ret){
ret = wiz_sock_recv(SOCKET_DATA,((char *)buf + it),len-it); ret = wiz_sock_recv(SOCKET_DATA,((char *)buf + it),len);
if(ret<0){ if(ret<0){
printf("download was interupted\r\n"); printf("download was interupted\r\n");
break; break;
@ -196,7 +196,6 @@ int Download(char *name)
printf("write failed\r\n"); printf("write failed\r\n");
} }
else printf("success!\r\n"); else printf("success!\r\n");
close(fd);
} }
else { else {
printf("create file %s failed\r\n",name); printf("create file %s failed\r\n",name);