FTP Client API FTP in embedded devices Implementing
FTP Client API FTP in embedded devices Implementing an FTP Client FTP Command APIs Other FTP Client APIs
Uses for FTP in Embedded Devices User Upgrades the Master with new File USER MASTER FTP Connection FTP Master then Upgrades all Devices on Network FTP
Integrating an FTP Client FCConnect(char server, char username, char password) Application Entry APIs provided for… • put • rmdir • get • del • mkdir • bye • others
Sample FTP Client Implementation Declarations #include fc. Intapi. h Connection Establishment Setup for FTP put Command
Sample FTP Client Implementation (2) FTP put Command #include fc. Intapi. h
FTP Client Command APIs • int FCRetrieve. File (unsigned long h, char *pathname, int type); • int FCStore. File (unsigned long h, char *pathname, int type); • int FCSet. Current. Dir (unsigned long h, char* dir); • int FCGet. Current. Dir (unsigned long h, char* buffer, int len); • int FCList. Dir (unsigned long h, int verbose, char *szpathname, char *buffer, int len, int *flag); • int FCDisconnect (unsigned long h); • int FCMake. Dir (unsigned long h, char* dir); • int FCRemove. Dir (unsigned long h, char* dir); • int FCDelete. File (unsigned long h, char* file);
Other FTP Client APIs • int FCGet. Data (unsigned long h, char *buffer, int len); // needed to actually retrieve the data after an FCRetrieve. File call • int FCPut. Data (unsigned long h, char *buffer, int len, int flag); // needed to actually send the data after an FCStore. File call • int FCHandle. To. Socket (unsigned long handle); // returns the control socket for the current session
FTP Client Summary • FCConnect – issue commands – FCDisconnect • Can retrieve and store files, set or get current directory make and remove directories • FCGet. Data and FCPut. Data are required to process data after retrieve and store requests.
Net+Os v 6. 0 Enhancements File System
FTP Client (File System) • Send files from the NETOS file system to FTP server • Retrieve and save files from FTP server to NETOS file system
FTP Client (File System) • FCSave. File – Create/save a file in the file system. – Call FCRetrieve. File to initiate file retrieval from FTP server • FCSend. File – Send a file from the file system to FTP server – Call FCStore. File to initiate file creation in FTP server
FTP Client (File System) • FCGet. File. Status – Return the status from FCSave. File or FCSend. File call
- Slides: 12