i need to write a 3 byte protocol to it with the first byte containing 255 the second 1 and the third 127. but in my port write function it gives me an error function does not take 3 parameters
my code so far is
/************************************************** *********************
PortWrite (BYTE Byte)
************************************************** *********************/
void PortWrite (BYTE Byte)
{
DWORD dwError,
dwNumBytesWritten;
if (!WriteFile (hPort, // Port handle
&Byte, // Pointer to the data to write
1, // Number of bytes to write
&dwNumBytesWritten, // Pointer to the number of bytes
// written
NULL)) // Must be NULL for Windows CE
{
// WriteFile failed. Report error.
dwError = GetLastError ();
}
}
how can i write this three byte protocol to the serial port?? iam using a windows OS and using embedded C++
hope u can help thanx