3-9 DirectIO
This function can send and read data defined by the user.
long DirectIO (
PCHAR Data,
UINT uiWrite,
PCHAR pRequet,
UINT uiRead
);
[Parameters]
* PCHAR Data
[in] Data to be sent to the printer, data is ANSI code
* UINT uiWrite
[in] Size of data to be sent to the printer
* PCHAR pRequet
[in, out] Sets the values read from the buffered defined by the caller
* UINT uiRead
[in, out] Converts the size of date to be read by the caller to the actual size of read data
[Return Values]
Returns after function success
Unable to open communication port
Error in received value or reception failure
long lResult;
lResult = PrinterOpen(“portinfo…”, 1000);
……
char cmd[3] = {0x10, 0x04, 0x02};
char* readData;
UINT readLen = 0;
lResult = DirectIO(cmd, sizeof(cmd), readData, readLen);
……