SmartGPU2-LCD480X320Touch-CommandSet
SMART GPU 2 3.5” TOUCH
Command Set
Vizic Technologies ©2014 103
2.9.8 Write File –57hex – ‘W’ ascii
Commands (host)
5 bytes + N Data bytes
1.- 0x46 (hex), F (ascii). *FAT command.
2.- 0x57 (hex), W (ascii). (Write File)
3.- Workspace Block# 0x00(hex) – 0x03(hex).
4.- Bytes to Write (High byte).
5.- Bytes to Write (Low byte).
6 up to N.- File Data bytes. (N= Bytes to Write).
*Max Bytes to Write parameter is 512 (dec).
Responses (device)
2 bytes (Successfully Written Bytes) + 1
File ACK + 1 Command ACK
1.- Successfully Written bytes (High byte).
2.- Successfully Written bytes (Low byte).
3.- 0xXX (hex) - Refer to “File ACK List”.
4.- 0x4F (hex), O (ascii) – success ACK.
0x46 (hex), F (ascii) – fail NAK.
Description
The Write File command writes data to a
previously allocated File(“Open File”) in a
Workspace block, set with access “Write Only”
or “Read+Write” mode.
After the command succeeded, Successfully
Written bytes should be checked to detect disk
full. In case of Successfully Written bytes <
Bytes to Write, it means the volume get full
during write operation.
Be sure to perform a Sync File or Close File
command periodically after a write cycle to
save data and avoid data corruption. Always
after calling this command, the file pointer will
increase the number of Successfully Written
bytes from the last pointer position.
The maximum accepted Bytes to Write
parameter in one call is 512 bytes, if this
number is exceed, the command will fail with
INVALID PARAMETER.
If no File is allocated in the Workspace
block# received parameter during a “Write File”
command, this command will fail with INVALID
OBJECT, as an attempt to Write data to an
empty Workspace block was done.