COMM-DRV++ is optimized for outputting data in packets to increase overall
system performance. At times this may not be ideal for applications that need to
send a few bytes and expect a quick few byte response. To assist in this
problem, one can do the following.
//Declare low level support functions[Undocumented]
extern "C"
{
int _stdcall ser_rs232_getpacket(int port,int count,char *pkt);
int _stdcall ser_rs232_putpacket(int port,int count,char *pkt);
}
//Force the data out to the serial driver immediately
//Issue this call after the write you want immediately done
void ForceOutput(CCdrvPPPort *Port)
{
ser_rs232_putpacket(Port->GetPortID(),0,(char *)0);
}
//Force a read of the serial driver immediately
//Issue this call before the read you want immediately done
void ForceInput(CCdrvPPPort *Port)
{
ser_rs232_getpacket(Port->GetPortID(),0,(char *)0);
}
|