home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
World of Shareware - Software Farm 2
/
wosw_2.zip
/
wosw_2
/
CPROG
/
ISC366.ZIP
/
SERIAL
/
EXAMPLES
/
XONOFF.CPP
< prev
next >
Wrap
Text File
|
1993-09-01
|
723b
|
40 lines
// This module was written by LeucroTTa inc. (AKA OLAOR).
#include "xonoff.h";
// this class is SERIAL_PORT compatible - but on transmit will submit to
// XONs and XOFFs.
// update flow_enabled.
//
void XONOFF::flow_check(void)
{
// flow_enabled= TRUE;
}
XONOFF::XONOFF()
{
flow_enabled= TRUE;
}
// returns whether current char should be discarded.
BOOLEAN XONOFF::flow_set(BYTE in_byte)
{
if (in_byte== XON) {
if (!flow_enabled) {
flow_enabled= TRUE;
do_send();
return TRUE;
}
flow_enabled= TRUE;
}
else if (in_byte== XOFF) {
flow_enabled= FALSE;
return TRUE;
}
return FALSE;
}