Quectel UC20 FILE AT Commands Manual V1.0

User Manual: Pdf

Open the PDF directly: View PDF PDF.
Page Count: 23

DownloadQuectel UC20 FILE AT Commands Manual V1.0
Open PDF In BrowserView PDF
UC20 FILE
AT Commands Manual
UMTS/HSPA Module Series
Rev. UC20_FILE_AT_Commands_Manual_V1.0
Date: 2013-07-18

www.quectel.com

UMTS/HSPA Module
UC20 FILE AT Commands Manual

Our aim is to provide customers with timely and comprehensive service. For any
assistance, please contact our company headquarter:
Quectel Wireless Solutions Co., Ltd.
Room 501, Building 13, No.99, Tianzhou Road, Shanghai, China, 200233
Tel: +86 21 5108 6236
Mail: info@quectel.com

Or our local office, for more information, please visit:

l
e
t
l
c
a
i
e
t
u
n
Q fide
n
o
C

http://www.quectel.com/support/techsupport.aspx

For technical support, to report documentation errors, please visit:
http://www.quectel.com/support/salesupport.aspx

GENERAL NOTES

QUECTEL OFFERS THIS INFORMATION AS A SERVICE TO ITS CUSTOMERS. THE INFORMATION
PROVIDED IS BASED UPON CUSTOMERS‟ REQUIREMENTS. QUECTEL MAKES EVERY EFFORT
TO ENSURE THE QUALITY OF THE INFORMATION IT MAKES AVAILABLE. QUECTEL DOES NOT
MAKE ANY WARRANTY AS TO THE INFORMATION CONTAINED HEREIN, AND DOES NOT ACCEPT
ANY LIABILITY FOR ANY INJURY, LOSS OR DAMAGE OF ANY KIND INCURRED BY USE OF OR
RELIANCE UPON THE INFORMATION. ALL INFORMATION SUPPLIED HEREIN ARE SUBJECT TO
CHANGE WITHOUT PRIOR NOTICE.

COPYRIGHT

THIS INFORMATION CONTAINED HERE IS PROPRIETARY TECHNICAL INFORMATION OF
QUECTEL CO., LTD. TRANSMITTABLE, REPRODUCTION, DISSEMINATION AND EDITING OF THIS
DOCUMENT AS WELL AS UTILIZATION OF THIS CONTENTS ARE FORBIDDEN WITHOUT
PERMISSION. OFFENDERS WILL BE HELD LIABLE FOR PAYMENT OF DAMAGES. ALL RIGHTS
ARE RESERVED IN THE EVENT OF A PATENT GRANT OR REGISTRATION OF A UTILITY MODEL
OR DESIGN.

Copyright © Quectel Wireless Solutions Co., Ltd. 2013. All rights reserved.

UC20_FILE_AT_Commands_Manual

Confidential / Released

1 / 22

UMTS/HSPA Module
UC20 FILE AT Commands Manual

About the document
History
Revision
1.0

l
e
t
l
c
a
i
e
t
u
n
Q fide
n
o
C
Date

Author

Description

2013-07-18

Gibson PAN

Initial

UC20_FILE_AT_Commands_Manual

Confidential / Released

2 / 22

UMTS/HSPA Module
UC20 FILE AT Commands Manual

Contents
About the document ................................................................................................................................... 2
Contents ....................................................................................................................................................... 3
1

Introduction .......................................................................................................................................... 4
1.1.
The Process of Using File AT Commands .............................................................................. 4

2

Description of AT Command .............................................................................................................. 6
2.1.
AT+QFLDS Get the Space Information of the Storage......................................................... 6
2.2.
AT+QFLST List Files ............................................................................................................. 7
2.3.
AT+QFDEL Delete the File in the Storage ............................................................................ 8
2.4.
AT+QFMOV Move the File ................................................................................................... 8
2.5.
AT+QFUPL Upload File to the Storage................................................................................. 9
2.6.
AT+QFDWL Download the File from the Storage............................................................... 11
2.7.
AT+QFOPEN Open the File ............................................................................................... 12
2.8.
AT+QFREAD Read the File ................................................................................................ 13
2.9.
AT+QFWRITE Write the File............................................................................................... 14
2.10.
AT+QFSEEK Seek the File ................................................................................................. 14
2.11.
AT+QFPOSITION Get the Offset of the File Pointer .......................................................... 15
2.12.
AT+QFFLUSH Force to Write the Data Remaining in the Buffer ....................................... 16
2.13.
AT+QFTUCAT Truncate the File from the File Pointer ....................................................... 16
2.14.
AT+QFCLOSE Close the File ............................................................................................. 17

l
e
t
l
c
a
i
e
t
u
n
Q fide
n
o
C

3

Example .............................................................................................................................................. 18
3.1.
Upload and Download Files .................................................................................................. 18
3.1.1. Upload the File ............................................................................................................... 18
3.1.1.1. Non ACK Mode ..................................................................................................... 18
3.1.1.2. ACK Mode ............................................................................................................ 18
3.1.2. Download the File .......................................................................................................... 19
3.2.
Write and Read the File......................................................................................................... 19
3.2.1. Write and Read UFS File ............................................................................................... 19
3.2.2. Write and Read RAM File .............................................................................................. 20
3.3.
Move the File ......................................................................................................................... 20
3.3.1. Move a Single File.......................................................................................................... 20
3.3.2. Move all Files of One Storage ........................................................................................ 21

4

Appendix A Summary of  Code ............................................................................................... 22

UC20_FILE_AT_Commands_Manual

Confidential / Released

3 / 22

UMTS/HSPA Module
UC20 FILE AT Commands Manual

1

Introduction

Quectel Module provides AT commands to operate files on different physical storage mediums. This
document is a reference guide to these commands.
The supported storage mediums are as follows:



l
e
t
l
c
a
i
e
t
u
n
Q fide
n
o
C

UFS: User File Storage directory. It is a special directory on the flash file system.
RAM: Random Access Memory. It is faster but much smaller than the UFS. And the files in the RAM
will lost when rebooting UC20.

The file name indicates the storage location. When the file name begins with “RAM:”, it means the file is
located in RAM. If there are no prefix characters in the file name, the file is located in UFS.

1.1. The Process of Using File AT Commands

There are two modes to create, read and write the file in the storage:
1.

2.

The file is created and all the content of the file could be uploaded to the storage by command
“AT+QFUPL”. And the content can be outputted/downloaded through the serial interface by
command “AT+QFDWL”.
Open the file by “AT+QFOPEN”, then the file can be written or read at any time and any location until
the file is closed by “AT+QFCLOSE”.








When the file is opened by command “AT+QFOPEN”, you can set the file as overwrite mode or
read-only mode or others by the parameter . (For more information about , see
Section 2.7). After the file is opened, a  is assigned to this file. Then you can operate
this file via this .
After the file is opened, write the file by command “AT+QFWRITE” and read the file by
“AT+QFREAD” from the current file position.
You can set the file position by “QFSEEK” and get the current position by “AT+QFPOSITION".
“QFFLUSH” will save the file to the physical storage immediately.
“QFTUCAT” will truncate the file from the current position to the end of the file.
Close the file by “AT+QFCLOSE”. Then the  becomes meaningless to this file.

UC20_FILE_AT_Commands_Manual

Confidential / Released

4 / 22

UMTS/HSPA Module
UC20 FILE AT Commands Manual

There are several commands to manage files in the storage.
1.
2.
3.
4.

“AT+QFLDS” gets the storage size.
“AT+QFLST” lists files information in the storage.
“AT+QFDEL” deletes the file(s).
“AT+QFMOV” moves the file from one storage to another storage.

l
e
t
l
c
a
i
e
t
u
n
Q fide
n
o
C
UC20_FILE_AT_Commands_Manual

Confidential / Released

5 / 22

UMTS/HSPA Module
UC20 FILE AT Commands Manual

2

Description of AT Command

2.1. AT+QFLDS

Get the Space Information of the Storage

l
e
t
l
c
a
i
e
t
u
n
Q fide
n
o
C

AT+QFLDS responds the space information of the specified storage.

AT+QFLDS

Get the Space Information of the Storage

Test Command
AT+QFLDS=?

Response
OK

Write Command
AT+QFLDS=

Response
+QFLDS: ,
OK

+CME ERROR: 

Execution Command
AT+QFLDS

Response
+QFLDS: ,
OK

+CME ERROR: 
Return the UFS information

Parameter









Pattern.
“UFS”
UFS files in flash.
“RAM”
RAM files in the random storage.
The size of the free space in .
The total size of the storage .
The size in bytes of all files in UFS.
The number of files in UFS.
The error code from UC20 (see the Appendix A).

UC20_FILE_AT_Commands_Manual

Confidential / Released

6 / 22

UMTS/HSPA Module
UC20 FILE AT Commands Manual

Example
AT+QFLDS="UFS"
+QFLDS: 40164800,63768576
OK

2.2. AT+QFLST

List Files

l
e
t
l
c
a
i
e
t
u
n
Q fide
n
o
C

AT+QFLST lists the information of a single file or all files in the required storage medium.

AT+QFLST

List Files

Test Command
AT+QFLST=?

Response
OK

Write Command
AT+QFLST=

Response
+QFLST: ,
[+QFLST: ,
[…]]

OK

+CME ERROR: 

Execution Command
AT+QFLST

Response
Return the information of the UFS files:
+QFLST: ,
[+QFLST: ,
[…]]

OK

+CME ERROR: 

Parameter

 The file to be listed.
“*”
“RAM:*”
“”
“RAM:
Name of the file.

UC20_FILE_AT_Commands_Manual

All the files in UFS.
All the files in RAM.
The specified file  in UFS
The specified file  in RAM.

Confidential / Released

7 / 22

UMTS/HSPA Module
UC20 FILE AT Commands Manual




Size in bytes of the file.
The error code from UC20 (see the Appendix A).

Example
AT+QFLST="*"
+QFLST: "F_M12-1.bmp",562554
+QFLST: "F_M12-10.bmp",562554
+QFLST: "F_M12-11.bmp",562554

OK

l
e
t
l
c
a
i
e
t
u
n
Q fide
n
o
C

2.3. AT+QFDEL Delete the File in the Storage

AT+QFDEL deletes a single file or all the files in the specified storage.

AT+QFDEL Delete the File in the Storage
Test Command
AT+QFDEL=?

Response
+QFDEL: 
OK

Write Command
AT+QFDEL=

Response
OK

+CME ERROR: 

Parameter

 The file to be deleted. The max length of  is 80 bytes.
“*”
Delete all the files in UFS (not delete the directory).
“RAM:*”
Delete all the files in RAM.
“”
Delete the specified file  in UFS.
“RAM:”
Delete the specified file  in RAM.
 The error code from UC20 (see the Appendix A).

2.4. AT+QFMOV Move the File

UC20_FILE_AT_Commands_Manual

Confidential / Released

8 / 22

UMTS/HSPA Module
UC20 FILE AT Commands Manual

AT+QFMOV moves the file from one storage to another storage. It only supports moving the file from
RAM to UFS, not from UFS to RAM.

AT+QFMOV

Move the File

Test Command
AT+QFMOV=?

Response
+QFMOV: ,,(0,1),(0,1)
OK

Write Command
AT+QFMOV=,,,

Move a single file:
AT+QFMOV=”RAM:filenamea”,”flienameb”,,
Move the file named “filenamea” in RAM to UFS, and
renamed it as “filename”.
Move all files:
AT+QFMOV=“RAM: *”, “*”,,
Move all files in RAM to UFS.
Response
OK

l
e
t
l
c
a
i
e
t
u
n
Q fide
n
o
C
+CME ERROR: 

Parameter











The source file. The max length is 80 bytes.
“”
The source file named  in the UFS.
“RAM:” The source file named  in the RAM.
The destination file. The max length is 80 bytes.
“”
The destination file named  in the UFS.
“RAM:” The destination file named  in the RAM.
Whether or not to delete the source file after the file is moved.
0 Delete the source file after it is moved, i.e., cut this file.
1 Do not delete the source file after it is moved, i.e., copy this file.
Whether or not to overwrite the file if the destination file exists.
0 Do not overwrite the destination file if it exists.
1 Overwrite the destination file if it exists.
The error code from UC20(see the Appendix A).

2.5. AT+QFUPL Upload File to the Storage
1. AT+QFUPL uploads the file to UC20 directly. If there is a file in the storage which has the same name
with the file to be uploaded, it will report the error.

UC20_FILE_AT_Commands_Manual

Confidential / Released

9 / 22

UMTS/HSPA Module
UC20 FILE AT Commands Manual

2. There are three ways to exit the transparent transmission mode:
 The data uploaded reaches the .
 The time without any data inputted reaches .
 When the data is transmitted, the DTR PIN(AT&D1 should be set.) is pulled high or the valid
“+++” is inputted.
3. To prevent the “+++” from being misinterpreted as data, it should comply to the following sequence:
 No characters are entered for T1 time (1 second) before “+++”.
 “+++” characters are entered without other characters in between. The total input time of “+++”
cannot exceed 1s.
 No characters are entered for T1 time (1 second) after “+++”.
 The current result “+QFUPL: , ” is outputted, and UC20 exits the
transparent access mode, return OK.

l
e
t
l
c
a
i
e
t
u
n
Q fide
n
o
C

AT+QFUPL Upload File to the Storage
Test Command
AT+QFUPL=?

Response
+QFUPL: [,(1-)[,(1-65535)[,(0,1)]]]
OK

Write Command
AT+QFUPL=[,
[ ,[,]]]

Response
CONNECT
TA switches to the transparent access mode, and the binary
data of file can be inputted. When the total size of the inputted
data reaches  (unit: byte), TA will return to command
mode and reply the following codes:
+QFUPL: ,
OK
+CME ERROR: 

Parameter











The size of the free space in . Please refer to the “+QFLDS”.
The name of file to be stored. The max length is 80 bytes.
“”
The name of file uploaded to UFS.
“RAM:”
The name of file uploaded to RAM.
The file size expected to be uploaded.
Default is 10240. Unit is byte.
The actual size of the uploaded data. Unit: byte.
The delay time in seconds of waiting data to be inputted to USB/UART. Default is 5s.
Whether to use ACK mode.
0 Turn off the ACK mode by default.
1 Turn on the ACK mode.
The checksum of the uploaded data.

UC20_FILE_AT_Commands_Manual

Confidential / Released

10 / 22

UMTS/HSPA Module
UC20 FILE AT Commands Manual



The error code from UC20(see the Appendix A).

NOTES
1.
2.

3.
4.

It is strongly recommended to use DOS 8.3 file name format for .
 is a 16 bit checksum based on bitwise XOR.
If the number of the characters is odd, set the last character as the high 8 bit, and the low 8 bit as 0,
and then use an XOR operator to calculate the checksum. “+++” sequence will cause TA to end the
command and switch to command mode; however, the data previously uploaded will be preserved
into the file.
When executing the command, the data must be entered after CONNECT appears.
The ACK mode is provided to avoid the loss of data when uploading large files, in case hardware flow
control doesn‟t work. The ACK mode works as follows:
1) Run AT+QFUPL=,,,1 command to enable the ACK mode.
2) UC20 outputs CONNECT.
3) MCU sends 1K bytes data, and then UC20 will respond with an „A‟.
4) MCU receives this „A‟ and then sends the next 1K bytes data;
5) Repeat step 3) and 4) until the transfer is completed.

l
e
t
l
c
a
i
e
t
u
n
Q fide
n
o
C

2.6. AT+QFDWL Download the File from the Storage
AT+QFDWL downloads all file from UC20 storage.

AT+QFDWL Download the File from the Storage
Test Command
AT+QFDWL=?

Response
+QFDWL: 
OK

Write Command
AT+QFDWL=

Response
CONNECT
TA switches to data mode, and the bin data of the file will be
outputted. When the file is read over, TA will return to
command mode and reply the following codes:
+QFDWL: ,
OK
+CME ERROR: 

Parameter

UC20_FILE_AT_Commands_Manual

Confidential / Released

11 / 22

UMTS/HSPA Module
UC20 FILE AT Commands Manual







The name of the file to be downloaded. The max length is 80 letters.
“”
The downloaded file in UFS.
“RAM: ” The downloaded file in RAM.
The size of the downloaded data.
The checksum of the downloaded data.
The error code from UC20 (see the Appendix A).

NOTES
1. “+++” sequence will cause TA to end the command and switch to command mode.
2.  is a 16 bit checksum based on bitwise XOR.

l
e
t
l
c
a
i
e
t
u
n
Q fide
n
o
C

2.7. AT+QFOPEN

Open the File

Get the file handle by the “AT+QFOPEN” which is used in other commands, such as “AT+QFWRITE”,
“AT+QFREAD”, “AT+QFSEEK”, “AT+QCLOSE”, “AT+QFPOSITION”, “AT+QFFLUSH”, “AT+QFTUCAT”.

AT+QFOPEN Open the File
Test Command
AT+QFOPEN=?

Response
+QFOPEN: [,(0-2)]
OK

Read Command
AT+QFOPEN?

Response
+QFOPEN: ,,
[+QFOPEN: ,,
[…]]

OK

Write Command
AT+QFOPEN=[,]

Response
+QFOPEN: 
OK

+CME ERROR: 

Parameter

UC20_FILE_AT_Commands_Manual

Confidential / Released

12 / 22

UMTS/HSPA Module
UC20 FILE AT Commands Manual








The file to be operated. The max length is 80 bytes.
“”
The operated file in the UFS.
“RAM: ” The operated file in the RAM.
The handle of the file. The data type is 4 bytes.
The open mode of the file. Default is 0.
0 If the file does not exist, it will be created; if the file exists, it will be directly
opened. And both of them can be read and written.
1 If the file does not exist, it will be created; If the file exists, the file will be
overwritten and cleared. And both of them can be read and written.
2 If the file exists, open it and it can be read only. When the file doesn‟t exist, it
will respond the error.
The error code from UC20 (see the Appendix A).

l
e
t
l
c
a
i
e
t
u
n
Q fide
n
o
C

2.8. AT+QFREAD

Read the File

AT+QFREAD reads the data of the file related to the handle. The data starts from the current position of
the file pointer which belongs to the file handle.

AT+QFREAD

Read the File

Test Command
AT+QFREAD=?

Response
+QFREAD: [,]
OK

Write Command
AT+QFREAD=[,]

Response
CONNECT 
TA switches to data mode. When the total size of the data
reaches  (unit: byte), TA will return to command
mode, display the result and then reply the following codes:
OK
+CME ERROR: 

Parameter






The handle of the file to be operated.
The length of the file to be read out and the default is the file length.
The actual read length.
The error code from UC20(see the Appendix A).

UC20_FILE_AT_Commands_Manual

Confidential / Released

13 / 22

UMTS/HSPA Module
UC20 FILE AT Commands Manual

2.9. AT+QFWRITE

Write the File

AT+QFWRITE writes the data to the file in UC20. The data starts from the current position of the file
pointer which belongs to the file handle.

AT+QFWRITE

Write the File

Test Command
AT+QFWRITE=?

Response
+QFWRITE: [,[,]]
OK

l
e
t
l
c
a
i
e
t
u
n
Q fide
n
o
C

Write Command
AT+QFWRITE=[,
[,]]

Response
CONNECT
TA switches to data mode. When the total size of the written
data reaches  (unit: byte) or the time, TA will return to
command mode and reply the following codes:
+QFWRITE: ,
OK

+CME ERROR: 

Parameter








The handle of the file to be operated.
The length of the file to be written, the default length is 10K. The range of this
parameter is same with the  of the “AT+QFUPL”.
The time of waiting data to be inputted to USB/UART . Default is 5s.
The actual written length.
The total length of the file.
The error code from UC20 (see the Appendix A).

2.10. AT+QFSEEK

Seek the File

Set the current position of the file pointer which belongs to the file handle. This will decide the starting
position of the “AT+QFREAD”, “AT+QFWRITE”, “AT+QFPOSITION” and “AT+QFTUCAT”.

AT+QFSEEK Seek the File
Test Command
AT+QFSEEK=?

UC20_FILE_AT_Commands_Manual

Response
+QFSEEK: ,[,]

Confidential / Released

14 / 22

UMTS/HSPA Module
UC20 FILE AT Commands Manual

OK
Write Command
AT+QFSEEK=,[,<
position>]

Response
OK
+CME ERROR: 

Parameter






NOTES
1.
2.
3.

The handle of the file to be operated.
The number of bytes of the file pointer movement.
Pointer movement mode. Default is 0.
0
The beginning of the file.
1
The current position of the pointer.
2
The end of the file.
The error code from UC20 (see the Appendix A).

l
e
t
l
c
a
i
e
t
u
n
Q fide
n
o
C

If  is 0, and the  exceed the file size, the command will return ERROR.
If  is 1, and the total size of the  with the current position of the pointer exceeds the
file size the command will return ERROR.
If  is 2, the handle will move forth.

2.11. AT+QFPOSITION Get the Offset of the File Pointer

AT+QFPOSITION gets the current position of the file pointer which is relevant to the file handle.

AT+QFPOSITION Get the Offset of the File Pointer
Test Command
AT+QFPOSITION=?

Response
+QFPOSITION: 
OK

Write Command
AT+QFPOSITION=

Response
+QFPOSITION: 
OK

+CME ERROR: 

UC20_FILE_AT_Commands_Manual

Confidential / Released

15 / 22

UMTS/HSPA Module
UC20 FILE AT Commands Manual

Parameter




The handle of the operated file.
The offset from the beginning of the file.
The error code from UC20 (see the Appendix A).

2.12. AT+QFFLUSH

Force to Write the Data Remaining in the Buffer

AT+QFFLUSH will trigger the action to copy the data from the random access memory buffer to the
physical flash.

l
e
t
l
c
a
i
e
t
u
n
Q fide
n
o
C

AT+QFFLUSH Force to Write the Data Remaining in the Buffer
Test Command
AT+QFFLUSH=?

Response
+QFFLUSH: 
OK

Write Command
AT+QFFLUSH=

Response
OK

+CME ERROR: 

Parameter



The handle of the operated file.
The error code from UC20 (see Appendix A).

2.13. AT+QFTUCAT

Truncate the File from the File Pointer

AT+QFTUCAT will truncate all the data behind the position that the file pointer indicates.

AT+QFTUCAT

Truncate the File from the File Pointer

Test Command
AT+QFTUCAT=?

Response
+QFTUCAT: 
OK

Write Command
AT+QFTUCAT=

Response
OK
+CME ERROR: 

UC20_FILE_AT_Commands_Manual

Confidential / Released

16 / 22

UMTS/HSPA Module
UC20 FILE AT Commands Manual

Parameter



The handle of the operated file.
The error code from UC20 (see the Appendix A).

2.14. AT+QFCLOSE

Close the File

AT+QFCLOSE closes the file and ends the operation to the file. The file handle is released and should not
be used again, unless open the file again with “AT+QFOPEN”.

l
e
t
l
c
a
i
e
t
u
n
Q fide
n
o
C

AT+QFCLOSE

Close the File

Test Command
AT+QFCLOSE=?

Response
+QFCLOSE: 
OK

Write Command
AT+QFCLOSE=

Response
OK

+CME ERROR: 

Parameter



The handle of the operated file.
The error code from UC20 (see Appendix A).

UC20_FILE_AT_Commands_Manual

Confidential / Released

17 / 22

UMTS/HSPA Module
UC20 FILE AT Commands Manual

3

Example

3.1. Upload and Download Files

l
e
t
l
c
a
i
e
t
u
n
Q fide
n
o
C

3.1.1. Upload the File
3.1.1.1. Non ACK Mode

AT+QFUPL="test1.txt",10
CONNECT

+QFUPL: 10,613e
OK

AT+QFUPL="RAM:test2.txt",4222
CONNECT

+QFUPL: 4222,13E4
OK

//Upload the text file “test1.txt” to UFS.

//Upload the text file “test2.txt” to RAM.

//Get the bytes of the uploaded data and the checksum.

3.1.1.2. ACK Mode

The ACK mode can make the data transmission more reliable. When transmitting the large file without
hardware flow control, the ACK mode is used to prevent the data from being lost. About the ACK mode,
please refer to the details of “AT+QFUPL”.
AT+QFUPL="test.txt",3000
CONNECT

A

//Upload the text file “test.txt” to UFS.

//After receiving 1024bytes data, UC20 will respond
an “A”, then next 1024 bytes data can be inputted.


A

UC20_FILE_AT_Commands_Manual

Confidential / Released

18 / 22

UMTS/HSPA Module
UC20 FILE AT Commands Manual


+QFUPL: 3000,B34A
OK

3.1.2. Download the File
AT+QFDWL="test.txt"
CONNECT

+QFDWL: 10,613e
OK

//Download the text file “test.txt” from UFS.

l
e
t
l
c
a
i
e
t
u
n
Q fide
n
o
C
//Get the bytes of the downloaded data and the checksum.

3.2. Write and Read the File
3.2.1. Write and Read UFS File
AT+QFOPEN=”test”,0
+QFOPEN: 0
OK

//Open the file to get the file handle.

AT+QFWRITE=0,10
CONNECT

+QFWRITE: 10,10
OK

//Write 10 bytes to the file.

//The actual bytes written and the size of the file are returned.

AT+QFSEEK=0,0,0
OK

//Set the file pointer to the beginning of the file.

AT+QFREAD=0,10
CONNECT 10


//Read 10 bytes from the file.

OK
AT+QFCLOSE=0
OK

//Close the file.

UC20_FILE_AT_Commands_Manual

Confidential / Released

19 / 22

UMTS/HSPA Module
UC20 FILE AT Commands Manual

3.2.2. Write and Read RAM File
AT+QFLDS=”RAM”
+QFLDS:2616320, 2621440

//Query the space information of RAM.

OK
AT+QFOPEN="RAM:1",0
+QFOPEN: 3000
OK

l
e
t
l
c
a
i
e
t
u
n
Q fide
n
o
C

AT+QFWRITE=3000,10
CONNECT

+QFWRITE: 10,10
OK

//Open the file in the RAM.

//Write 10 bytes to the file.

//The actual written bytes and the size of the file are returned.

AT+QFSEEK=3000,0,0
OK

//Set the file pointer to the beginning of the file.

AT+QFREAD=3000,10
CONNECT


//Read the data.

OK
AT+QFCLOSE=3000
OK

//Close the file.

3.3. Move the File

3.3.1. Move a Single File
AT+QFLST="RAM:*"
+QFLST: "RAM:123.TXT",37
+QFLST: "RAM:test",12

//List the files in the RAM.

OK
AT+QFMOV="RAM:test", "test",0,1
OK

UC20_FILE_AT_Commands_Manual

//Move the file in the RAM to the UFS.

Confidential / Released

20 / 22

UMTS/HSPA Module
UC20 FILE AT Commands Manual

AT+QFLST="RAM:*"
+QFLST: "RAM:123.TXT",37

//The source file is deleted.

OK
AT+QFLST="*"
+QFLST: "test",12

//There is a file called “test” in the UFS.

OK

l
e
t
l
c
a
i
e
t
u
n
Q fide
n
o
C

3.3.2. Move all Files of One Storage
AT+QFLST="RAM:*"
+QFLST: "RAM:1.TXT",10
+QFLST: "RAM:2.TXT",15

OK
AT+QFLST
OK
AT+QFMOVE=”RAM:*”,”*”,0,0

OK
AT+QFLST=”RAM:*”
OK
AT+QFLST
+QFLST: " 1.TXT",10
+QFLST: "2.TXT",15

OK

UC20_FILE_AT_Commands_Manual

//List the files in the RAM.

//List the files in the UFS.

//Move all files in RAM to UFS, the first “0”means deleting all
source file after they are moved. The second “0” means do
not overwrite the destination files if exist.
//Source files are deleted.

//All files in RAM are moved to UFS.

Confidential / Released

21 / 22

UMTS/HSPA Module
UC20 FILE AT Commands Manual

4

Appendix A Summary of  Code

The result of the final error code is “+CME ERROR: ”.  indicates an error relating to the ME or
Network. The operation is similar to Error result code. It will be returned when some definition error
happens. The  codes listed here are just related to UC20 of the File.

l
e
t
l
c
a
i
e
t
u
n
Q fide
n
o
C

Codes of 

Meaning

400

invalid input value

403
405
406
407
409
410
411
417
418
419
420
421
423

drive full

file not found

invalid file name

file already exists

fail to write the file

fail to open the file
fail to read the file
fail to list the file

fail to delete the file
fail to get disk info
no space
time out

file too large

425

invalid parameter

426

file already opened

UC20_FILE_AT_Commands_Manual

Confidential / Released

22 / 22



Source Exif Data:
File Type                       : PDF
File Type Extension             : pdf
MIME Type                       : application/pdf
PDF Version                     : 1.4
Linearized                      : No
XMP Toolkit                     : 3.1-701
Producer                        : Microsoft® Office Word 2007
Format                          : application/pdf
Creator                         : kelly
Creator Tool                    : Microsoft® Office Word 2007
Create Date                     : 2013:07:18 18:49:37Z
Modify Date                     : 2013:07:18 18:52:34+08:00
Metadata Date                   : 2013:07:18 18:52:34+08:00
Document ID                     : D0E56D36-3FC8-461E-A4D4-54A4E53F4B55
Instance ID                     : uuid:94442d68-2a87-4a18-b8ec-59307b7a520c
Part                            : 1
Conformance                     : B
Page Count                      : 23
Language                        : zh-CN
Author                          : kelly
EXIF Metadata provided by EXIF.tools

Navigation menu