3-12 DirectIO
Send and read the user-defined data.
int DirectIO(char* writeData, int writeLen, char* readData, int* readLen,
unsigned int mTimeout)
[Parameters]
* char* writeData,
[in] Data to be sent to the printer
* int writeLen
[in] Size of data to be sent to the printer
write does not function if 0 is entered to writeData for NULL, writeLen.
* char* readData,
[in] Data to be sent to the printer
* int* readLen
[in] Read the size of the data to be read by the caller.
read does not function if 0 is entered to readData for NULL, readLen.
* unsigned int mTimeout
[in] Waiting time before reading the data. Even if no data has been read, it returns after
the set amount of time. If set to 0, it waits until there is incoming data.
[Return Values]
char cmd[3] = { 0x10, 0x04, 0x01};
char readBuf[20] = {0x00,};
int readLen;
ConnectToPrinter(………..);
DirectIO(cmd, sizeof(cmd), readBuf, &readLen, 0);
……