Technical information
Chapter 1:
July 15, 2007 Using FTP with G24 1-3
File Transfer Operations
The file transfer operation allows the user to transfer a file over an established FTP connection.
To avoid end-of-file detection problem for user in download case and for G24 in upload case,
G24 implements a special format of transferred files over FTP connection. The format proposed
"escaping" one of ASCII symbols from file context and using the "escaped" symbol as end-of-file
marker. An escaping algorithm described below.
The algorithm defines two special characters: EOF (end-of-file character) and ESC (escape
character). EOF symbol is hexadecimal 0x03 (decimal 3) ASCII ETX symbol and ESC symbol is
hexadecimal 0x10 (decimal 16) ASCII DLE symbol - not to be confused with the ASCII ESCape
character.
To encode a file to FTP File Transfer Format, the user or G24 shall read each data byte from
source file and perform following operation:
• When a data byte has the same code as EOF character, a two byte sequence of ESC and EOF
characters is sent instead.
• When a data byte has the same code as ESC character, a two byte sequence of ESC and ESC
characters is sent instead.
• When end of file is reach, EOF character is sent.
To decode a file from FTP File Transfer Format, the user or G24 shall read each data byte from
source file and perform following operation:
• When a data byte has the same code as ESC character and next data byte is ESC or EOF
character, the first byte should be ignored.
• When a data byte has the same code as EOF character and previous data byte is not ESC
character, end of file is reach.
The process is illustrated in Figure 1-2.
Figure 1-2: Files Transfer Process
Other FTP Operations
G24 provides +FTPINFO feature, allows user to receive more information about FTP connection
and FTP commands execution. When the feature enables, all FTP commands, send by G24 to
remote server and all FTP responses, receives by G24 from remote server are prints to user as
+FTPINFO: <text> unsolicited response. Use AT+FTPINFO=1 for the feature enable, and
AT+FTPINFO=0 for the feature disable in any G24 operation time, when G24 is in command
mode.










