1 /* 2 * Copyright (C) 2015-2019 Alibaba Group Holding Limited 3 */ 4 5 #ifndef AMP_FILE_TRANSFER_H 6 #define AMP_FILE_TRANSFER_H 7 8 #include <stddef.h> 9 #include <stdint.h> 10 11 typedef enum { 12 AMP_FILE_TRANSFER_STATUS_NORMAL = 0, 13 AMP_FILE_TRANSFER_STATUS_SERVICE_AVAILABLE, // 1 14 AMP_FILE_TRANSFER_STATUS_RECOVERY, // 2 15 AMP_FILE_TRANSFER_STATUS_UPDATING, // 3 16 AMP_FILE_TRANSFER_STATUS_JSERROR, // 4 17 AMP_FILE_TRANSFER_STATUS_COREDUMP, // 5 18 AMP_FILE_TRANSFER_STATUS_INSTALL, // 6 19 AMP_FILE_TRANSFER_STATUS_END 20 } AMP_FILE_TRANSFER_STATUS; 21 22 typedef enum { 23 YMODEM_RECEVIE_HEADER = 0, 24 YMODEM_RECEVIE_FILE_SIZE, 25 YMODEM_RECEVIE_BODY, 26 YMODEM_RECEVIE_END, 27 YMODEM_RECEVIE_ERROR 28 } AMP_FILE_RECEVIE_FLAG; 29 30 // typedef enum { 31 // PYAMP_SAVE_PATH_DEFULT_DATA = 0, 32 // PYAMP_SAVE_PATH_DEFULT_SDCARD = 1, 33 // } PYAMP_SAVE_PATH_DEFULT; 34 35 /* complete = 0 success, 1 check success(EOF), -1 check failed */ 36 // save file callback function 37 // void pyamp_save_path_defult_set(PYAMP_SAVE_PATH_DEFULT mode); 38 // int pyamp_save_path_defult_get(); 39 40 // int pyamp_ymodem_check_file_path(unsigned char *path, int32_t path_len); 41 // void pyamp_ymodem_save_file_path(unsigned char *path, int32_t path_len); 42 // int pyamp_ymodem_get_file_path(unsigned char *path, int32_t path_len); 43 44 void pyamp_file_transfer_status_set(AMP_FILE_TRANSFER_STATUS status); 45 46 void pyamp_ymodem_recovery_file_transfer_init(); 47 48 #endif /* AMP_FILE_TRANSFER_H */ 49