SmartGPU2-LCD480X320Touch-CommandSet
SMART GPU 2 3.5” TOUCH
Command Set
Vizic Technologies ©2014 101
2.9.7 Read File –52hex – ‘R’ ascii
Commands (host)
5 bytes
1.- 0x46 (hex), F (ascii). *FAT command.
2.- 0x52 (hex), R (ascii). (Read File)
3.- Workspace Block# 0x00(hex) – 0x03(hex)
4.- Bytes to Read (High byte).
5.- Bytes to Read (Low byte).
Responses (device)
N Data bytes + 2 bytes (Successfully Read
Bytes) + 1 File ACK + 1 Command ACK
1 up to N.- File Data bytes.(N= Bytes to Read)
N+1.- Successfully Read bytes (High byte).
N+2.- Successfully Read bytes (Low byte).
N+3.- 0xXX (hex) - Refer to “File ACK List”.
N+4.- 0x4F (hex), O (ascii) – success ACK.
0x46 (hex), F (ascii) – fail NAK.
Description
The “Read File” command reads binary data
from a previously allocated File(“Open File”) in
a Workspace block, set with access for “Read
Only” or “Read+Write” mode.
After the command succeeded,
Successfully Read bytes should be checked
to detect the end of file. In case of
Successfully Read bytes < Bytes to Read, it
means the read/write pointer reached end of
the file during read operation.
This command always will try to read the
Bytes to Read parameter, however note that
even Successfully Read bytes < Bytes to
Read, this command will always return the
requested Byte to Read bytes, that is: if
Successfully Read bytes < Bytes to Read
then the SmartGPU 2 will complete/fill
requested data bytes with 0x00(hex).
Successfully Read bytes parameter will be
the number of returned valid read bytes, the
rest will be just 0x00(hex).
Always after calling this command, the file
pointer will increase the number of
Successfully Read bytes from the last
pointer position.