hi newb16.
Thanks for the reply.
Yes i've done the connection part and other stuff.. My concern is how to pass that particular command to a serial port. I know it would be using the WriteFile command..
Shall I do it this way?
char strCmd[] = {'S','O','H','F','-','R','S','T','X','0','1','C','R','L','F','E','T', 'X','B','C','C'};
or in hexadecimal format?
char strCmd[] = {0x01,0x46,0x2D,0x52,0x53,0x54,0x58,0x00,0x01,0x0D ,0x0A,0x03};
and ive called this function:
BOOL bWriteCmd = objCom->sendData(strCmd,sizeof(strCmd));
//where sendData() function is declared as member of a class:
DWORD comport::sendData (const char* data, DWORD size)
{
DWORD numberOfBytesWritten;
WriteFile(_hCom,
data,
size,
&numberOfBytesWritten,
0);
return numberOfBytesWritten;
}
and I've tried to get the machine's reply by calling this function:
DWORD comport::receiveData (char* data, DWORD size)
{
DWORD numberOfBytesRead;
ReadFile(_hCom,
data,
size,
&numberOfBytesRead,
0);
return numberOfBytesRead;
}
coz i've done both strCmd declaration and I haven't received a reply from the pos machine.
Please help. Thank you.