The 'File_system_AT_cmd' has been written to allow cusotmers to use the exisiting flash on the unit to store user data through the use of the on board file system. The file system allows the user to create files and directories in the flash for retrieval later. The command set currently only allows for a single volume to be created on the flash at preent although the API's do allow for more.

Below is an explanation of the operations and any pertinent points that need to be considered during operation.

CMD=0
This command needs to be carried out before any actions are possible as this mounts the volume in the application.

CMD - 2
This outputs all of the filesnames, sizes and type (file or directory in the current working directory). 

Note the time date stamp for the files does not currently work.

CMD - 6
This command is used to create and write data to a file, if the file does not exisit it is created and the data writtin to it, if it does exist the file is openned and the data appended to that already in the file. Once the OK has been received from the command the data has been writting to the file and then closed which saves it to flash. 

Note : If the file does not exisit and no data is included in the third parameter the file will not be be created.
Note : The maximum size of the data paramter is 1000 bytes for any one command.

CMD - 8
Used to read a specified file from flash and output the contents to the UART.

Note : The output is not done in data mode. As a result AT commands are still able to be sent/received while the data is being output and more importantly unsolicited responses can also be output by the firmware during this operation

CMD - 9
Outputs the current volume information in the following format.

+FS: <bad memory>
+FS: <free memory>
+FS: <total available>
+FS: <used memory>

The amount of memory available depends on the module being used, for 2G units (SL6, Q2686/7) it will be around 5MB, for 3G units (SL808xT) it will be around 32MB.

Below is an annotated example of how the commands should be used

at+fs?AT+FS=<CMD>,<PARAM>
CMD:
0 : Init File System Driver
1 : Set Current Path
2 : List file and directories at the current path
3 : Remove Directory
4 : Create Directory
5 : Delete File
6 : Create File with given name and content
7 : Format volume
8 : Open File with given name and read content
9 : Volume info

OK
at+fs=9				//No actions can be taken until the file system is +FS: ERROR: Init not done
at+fs=0OK
at+fs=9				//Volume information, tested on SL808xT hence more than 30MB available+FS: 0
+FS: 33140736
+FS: 33554432
+FS: 413696
OK
at+fs=2				//Request exisiting file information, first parameter is number of items+FS: 2
+FS: NMEA_strings.txt,117594,00/00/1980 F
+FS: Unit_details.txt,85,00/00/1980 F

OK
at+fs=8,"Unit_details.txt"	//Output file contents of 'Unit_details.txt'+FS: 85
Serial number CEM08020043D2
IMEI number 3525610500240
IMSI number OK

OK
at+fs=6,"Test file.txt","ABCDEFGHIJKLMNOPQRSTUVW"	//Create 'Test file.txt' and write some text to it+FS: 23
OK
at+fs=2				//New file added to directory listing+FS: 3
+FS: NMEA_strings.txt,117594,00/00/1980 F
+FS: Test file.txt,23,00/00/1980 F
+FS: Unit_details.txt,85,00/00/1980 F

OK
at+fs=8,"Test file.txt"		//Read 'Test file.txt' out+FS: 23
ABCDEFGHIJKLMNOPQRSTUVW
OK