sending messages to and receiving messages from device
Posted on 2004-09-22
I am trying to communicate with a device and so far i have been able to reconfigure the serial port. actually i did not write that code, just copy pasted from msdn example and changed the port number.
I have a DCB and a handle to the CommPort (COM4). the code gets the port state using GetCommState and reconfigures using SetCommState. but this is only configuring the port no actually movement of relevant data is there. how do I read messages sent by the device?
do I use _read(int file_descriptor, void *buffer, uint count)? should I use this function, then where do i get file desriptor from? I used the file handle as file descriptor but I don't think I am doing the right thing here.