Datasheet

Flyport Wi-Fi and Ethernet Programmer's guide framework 2.3 (rev 1.0) www.openpicus.com
FTP_SOCK_NOT_CONNECTED (-10)
Returned in case the FTP command socket is not connected,
in this case the operation is aborted.
FTP_ERR_SERV_DISCONNECTED
(-11)
FTP server disconnected client during the operation.
FTP_FILE_ERROR (-12)
Some error occurred while accessing file, maybe user has not
permission, or file is actually in use.
FTP_ERR_TX (-13)
An error occurred while transmitting a command to the
server, possible buffer issue on Flyport (increase FTP TX
buffer in configuration wizard).
FTP_ERR_TX_NOT_OK (-14)
Data transmission started correctly, but didn't ended with an
acknowledge by the server (code 226).
FTP_FILE_NOT_FOUND (-15)
Searched file was not found.
Connection to FTP Server FTPConnect(TCP_SOCKET *cmdSocket,
char[] ftpAddress, char[] ftpPort, char[] ftpUser, char[] ftpPwd);
Connects to a remote FTP server.
Parameters:
*cmdSock: A variable TCP_Socket must be previously created and then passed as reference to the
function. That variable contains the command socket that will be connected to the server. Once the
socket is connected, it can be used to send commands, like append, store, change directory and
others.
ftpAddress: A string containing the IP address or the domain name of the FTP server.
ftpPort: A string containing the port of the server (usually is "21").
ftpUser: A string with the username required for the connection.
ftpPwd: A string containing the password required for the user authentication. If no password is
required, you can use the defined value FTP_NO_PASS.
Returns:
int with the report for the operation, otherwise an error code as reported in the above table
Checking file existence on FTP server FTPFileCheck(TCP_SOCKET cmdSock,
char fileToCheck[]);
Checks if a specified file exists on remote FTP server.
Parameters:
*cmdSock: The command socket previously connected to the server.
fileToCheck: A string with the file name to check for existence.
Returns:
int containing the value FTP_FILE_EXIST if the file is found, or FTP_FILE_NOT_FOUND if the file is not
found. If the operation has not succeeded, an error code will be reported.
Append data on a file FTPAppend(TCP_SOCKET cmdSock,
char fileName[], char appStr[]);
Store data on a file FTPStore(TCP_SOCKET cmdSock,
char fileName[], char stoStr[]);
To write data on file, there are two possible ways: APPEND or STORE methods. The append method,
as the name says, append the data at the end file, while the store method creates a new file and then
writes data on it, so the store method overwrites the existing file (if it exists). To append data is used
the function FTPAppend(), while to store, is used FTPStore()
51