
28
AT4202/4204/4208 User's Guide
&recvBytes,
&ol);
Use ReadFileto read HID equipment. Report based on the data fransferred
from IN.
l
WriteFile(
hDev,
reportBuf,
OUT_REPORT_LEN,
&sendBytes,
&ol);
WriteFile is used to transfer an output report to HID equipment.
l
Communication Parameters
VIP:0825
PID:0826
Packet size:64bits
Tips:
Any problems in programming, please contact our tech
department, you can send an email to
.
USB is always available, you needn’t set any parameters.
7.3
Command set
7.3.1
Command packet
Use 64 bits/pack to transfer data; every USB-HID command is 1 pack.
Tips:
Command packets have a fixed format, the user must follow
the format agreed by the instrument of writing, and otherwise
it is impossible to establish communication.
The command word is case-insensitive.
Each command packet contains the first 60 bytes of checksum,
fill in the last four bytes.
PC command pack format(a C language-defined pack structure):
#define program pack(1)
typedef __packed struct
{
uint
cSize;
//packet size 4bytes =60
char sHeader[24]; //command 24bytes
char
sPara[28];//parameter 28bytes
uint nSignature; //signature 4bytes
uint nChecksum;
//Checksum
4bytes
} TUSB_CMD;
#define program pack()
Here,
cSize:
60