stm32_ota/HARDWARE/LTE/EC20/ec20ftp.h

51 lines
2.7 KiB
C
Raw Permalink Normal View History

2023-12-15 06:28:06 +00:00
#ifndef _EC20FTP_H
#define _EC20FTP_H
#include "ec20net.h"
/*****************************************
*<EFBFBD><EFBFBD><EFBFBD>ⲿʹ<EFBFBD>õij<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
****************************************/
#define ACCOUNT_MAXLEN 128 //FTP<54><50>½<EFBFBD>û<EFBFBD><C3BB><EFBFBD>\<5C>ļ<EFBFBD><C4BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>󳤶<EFBFBD>
/*****************************************
*<EFBFBD>Զ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
****************************************/
typedef enum {Opening = 0, idle = 1, Transferring = 2, Closing = 3, Closed = 4, Error = 5 } FtpLoginState_e ; //FTP LOGIN״̬ö<CCAC><C3B6>
typedef enum{bin = 0, ascii = 1}FtpFileType_e ; //FTP<54>ļ<EFBFBD><C4BC><EFBFBD><EFBFBD><EFBFBD>
typedef enum{Active = 0, passive = 1}FtpTransMode_e ; //FTP<54><50><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
typedef struct
{
uint8_t contextId ; //FTP<54><50>·ͨ<C2B7><CDA8>ID
uint8_t userName[ACCOUNT_MAXLEN] ; //FTP <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>¼<EFBFBD>û<EFBFBD><C3BB><EFBFBD><EFBFBD><EFBFBD> <20>û<EFBFBD><C3BB><EFBFBD><EFBFBD>Ȳ<EFBFBD><C8B2>ܳ<EFBFBD><DCB3><EFBFBD>ACCOUNT_MAXLEN
uint8_t password[ACCOUNT_MAXLEN] ; //FTP <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>¼<EFBFBD><C2BC><EFBFBD><EFBFBD>, <20><><EFBFBD><EFBFBD>ܳ<EFBFBD><DCB3><EFBFBD>ACCOUNT_MAXLEN
FtpFileType_e eFiletype ; //FTP<54><50><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD><C4BC><EFBFBD><EFBFBD><EFBFBD>
FtpTransMode_e eTransmode ; //FTP<54><50><EFBFBD><EFBFBD>ģʽ
uint8_t rsptimeout ; //FTP<54><50>Ӧ<EFBFBD><D3A6>ʱʱ<CAB1><EFBFBD><E4A3A8>Χ20<32><30><EFBFBD><EFBFBD>180S<30><53><EFBFBD><EFBFBD>Ĭ<EFBFBD><C4AC>90S
uint8_t ftpServerIP[MAX_IP_LEN] ; //FTP Server<65><72>IP
uint16_t ftpServerPort ; //FTP Server<65><72>PORT
uint8_t ftpDirectory[ACCOUNT_MAXLEN] ; //<2F><><EFBFBD><EFBFBD>FTP<54><50><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ĭ<EFBFBD><C4AC>·<EFBFBD><C2B7> <20><><EFBFBD><EFBFBD><E7A3BA>/ABM<42><4D>
}FtpP_s ; //FTP<54><50><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ
/*****************************************
*<EFBFBD>ڲ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
****************************************/
RunResult EC20_SendFtpCmd( uint8_t cmdNum, char *format,... ) ; // EC20ͨ<30><CDA8><EFBFBD><EFBFBD><EFBFBD>ڷ<EFBFBD><DAB7><EFBFBD>ftp<74><70><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
/*****************************************
*<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ӿں<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
****************************************/
extern RunResult Ftp_Config( FtpP_s *psFtp ) ; //<2F><>FTP<54><50><EFBFBD>ز<EFBFBD><D8B2><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
extern RunResult Ftp_PDP_Init( FtpP_s *psFtp ) ; //<2F><>ʼ<EFBFBD><CABC>FTP<54><50>· contextid
extern RunResult Ftp_Login( FtpP_s *psFtp ) ; //<2F><>¼FTP<54><50><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
extern RunResult Ftp_Logout(FtpP_s *psFtp) ; //<2F>˳<EFBFBD>FTP<54><50><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
extern RunResult Ftp_Set_Dir( FtpP_s *psFtp ) ; //<2F><><EFBFBD><EFBFBD>Ftp<74><70><EFBFBD><EFBFBD>Ŀ¼
extern RunResult Ftp_Find_File( uint8_t *dir, uint8_t *fileName ) ; //<2F><>dirĿ¼<C4BF>в<EFBFBD><D0B2><EFBFBD><EFBFBD><EFBFBD>ΪfileName<6D><65><EFBFBD>ļ<EFBFBD>
extern u32 Ftp_Get_FileSize( uint8_t *fileName ) ; //<2F><>ѯ*fileName <20>ļ<EFBFBD><C4BC>Ĵ<EFBFBD>С
extern int Ftp_Down_File( uint8_t *fileName, uint32_t startPos, uint16_t transLen) ; //<2F><><EFBFBD><EFBFBD>ΪfileName<6D><65><EFBFBD>ļ<EFBFBD>startPosλ<73>ÿ<EFBFBD>ʼ<EFBFBD><CABC><EFBFBD><EFBFBD>transLen<65><6E><EFBFBD>ȵ<EFBFBD><C8B5><EFBFBD><EFBFBD><EFBFBD>
extern RunResult Ftp_File_Rename( uint8_t *oldName, uint8_t *newName ) ; //<2F>ļ<EFBFBD><C4BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
#endif