Files
Work/m68hc11/backup/DCB.CPP
2024-08-07 09:16:27 -04:00

319 lines
7.6 KiB
C++

#include <m68hc11/dcb.hpp>
DeviceControlBlock::DeviceControlBlock(void)
{
setZero();
}
DeviceControlBlock::DeviceControlBlock(const DeviceControlBlock &someDeviceControlBlock)
{
*this=someDeviceControlBlock;
}
DeviceControlBlock::~DeviceControlBlock()
{
}
DeviceControlBlock &DeviceControlBlock::operator=(const DeviceControlBlock &someDeviceControlBlock)
{
baudRate(someDeviceControlBlock.baudRate());
binaryEnabled(someDeviceControlBlock.binaryEnabled());
enableParity(someDeviceControlBlock.enableParity());
ctsFlowControlOutMonitor(someDeviceControlBlock.ctsFlowControlOutMonitor());
dsrFlowControlOutMonitor(someDeviceControlBlock.dsrFlowControlOutMonitor());
dtrControl(someDeviceControlBlock.dtrControl());
dsrSensitivityEnable(someDeviceControlBlock.dsrSensitivityEnable());
continueOnXOff(someDeviceControlBlock.continueOnXOff());
xonXOffEnableTransmit(someDeviceControlBlock.xonXOffEnableTransmit());
xonXOffEnableReceive(someDeviceControlBlock.xonXOffEnableReceive());
errorCharEnable(someDeviceControlBlock.errorCharEnable());
discardNullEnable(someDeviceControlBlock.discardNullEnable());
rtsControl(someDeviceControlBlock.rtsControl());
abortOnErrorEnable(someDeviceControlBlock.abortOnErrorEnable());
xonLimit(someDeviceControlBlock.xonLimit());
xoffLimit(someDeviceControlBlock.xoffLimit());
dataBits(someDeviceControlBlock.dataBits());
parity(someDeviceControlBlock.parity());
stopBits(someDeviceControlBlock.stopBits());
xonChar(someDeviceControlBlock.xonChar());
xoffChar(someDeviceControlBlock.xoffChar());
errorChar(someDeviceControlBlock.errorChar());
eofChar(someDeviceControlBlock.eofChar());
evtChar(someDeviceControlBlock.evtChar());
return *this;
}
BOOL DeviceControlBlock::operator==(const DeviceControlBlock &someDeviceControlBlock)
{
return(baudRate()==someDeviceControlBlock.baudRate()&&
binaryEnabled()==someDeviceControlBlock.binaryEnabled()&&
enableParity()==someDeviceControlBlock.enableParity()&&
ctsFlowControlOutMonitor()==someDeviceControlBlock.ctsFlowControlOutMonitor()&&
dsrFlowControlOutMonitor()==someDeviceControlBlock.dsrFlowControlOutMonitor()&&
dtrControl()==someDeviceControlBlock.dtrControl()&&
dsrSensitivityEnable()==someDeviceControlBlock.dsrSensitivityEnable()&&
continueOnXOff()==someDeviceControlBlock.continueOnXOff()&&
xonXOffEnableTransmit()==someDeviceControlBlock.xonXOffEnableTransmit()&&
xonXOffEnableReceive()==someDeviceControlBlock.xonXOffEnableReceive()&&
errorCharEnable()==someDeviceControlBlock.errorCharEnable()&&
discardNullEnable()==someDeviceControlBlock.discardNullEnable()&&
rtsControl()==someDeviceControlBlock.rtsControl()&&
abortOnErrorEnable()==someDeviceControlBlock.abortOnErrorEnable()&&
xonLimit()==someDeviceControlBlock.xonLimit()&&
xoffLimit()==someDeviceControlBlock.xoffLimit()&&
dataBits()==someDeviceControlBlock.dataBits()&&
parity()==someDeviceControlBlock.parity()&&
stopBits()==someDeviceControlBlock.stopBits()&&
xonChar()==someDeviceControlBlock.xonChar()&&
xoffChar()==someDeviceControlBlock.xoffChar()&&
errorChar()==someDeviceControlBlock.errorChar()&&
eofChar()==someDeviceControlBlock.eofChar()&&
evtChar()==someDeviceControlBlock.evtChar());
}
DWORD DeviceControlBlock::baudRate(void)const
{
return _DCB::BaudRate;
}
void DeviceControlBlock::baudRate(DWORD baudRate)
{
_DCB::BaudRate=baudRate;
}
BOOL DeviceControlBlock::binaryEnabled(void)const
{
return _DCB::fBinary;
}
void DeviceControlBlock::binaryEnabled(BOOL binaryEnabled)
{
_DCB::fBinary=binaryEnabled;
}
BOOL DeviceControlBlock::enableParity(void)const
{
return _DCB::fParity;
}
void DeviceControlBlock::enableParity(BOOL parity)
{
_DCB::fParity=parity;
}
BOOL DeviceControlBlock::ctsFlowControlOutMonitor(void)const
{
return _DCB::fOutxCtsFlow;
}
void DeviceControlBlock::ctsFlowControlOutMonitor(BOOL ctsFlowControlOut)
{
_DCB::fOutxCtsFlow=ctsFlowControlOut;
}
BOOL DeviceControlBlock::dsrFlowControlOutMonitor(void)const
{
return _DCB::fOutxDsrFlow;
}
void DeviceControlBlock::dsrFlowControlOutMonitor(BOOL dsrFlowControlOut)
{
_DCB::fOutxDsrFlow=dsrFlowControlOut;
}
DeviceControlBlock::DtrControl DeviceControlBlock::dtrControl(void)const
{
return DtrControl(_DCB::fDtrControl);
}
void DeviceControlBlock::dtrControl(DtrControl dtrControl)
{
_DCB::fDtrControl=(DWORD)dtrControl;
}
BOOL DeviceControlBlock::dsrSensitivityEnable(void)const
{
return _DCB::fDsrSensitivity;
}
void DeviceControlBlock::dsrSensitivityEnable(BOOL dsrSensitivityEnable)
{
_DCB::fDsrSensitivity=dsrSensitivityEnable;
}
BOOL DeviceControlBlock::continueOnXOff(void)const
{
return _DCB::fTXContinueOnXoff;
}
void DeviceControlBlock::continueOnXOff(BOOL continueOnXOff)
{
_DCB::fTXContinueOnXoff=continueOnXOff;
}
BOOL DeviceControlBlock::xonXOffEnableTransmit(void)const
{
return _DCB::fOutX;
}
void DeviceControlBlock::xonXOffEnableTransmit(BOOL xonXOffEnable)
{
_DCB::fOutX=xonXOffEnable;
}
BOOL DeviceControlBlock::xonXOffEnableReceive(void)const
{
return _DCB::fInX;
}
void DeviceControlBlock::xonXOffEnableReceive(BOOL xonXOffEnable)
{
_DCB::fInX=xonXOffEnable;
}
BOOL DeviceControlBlock::errorCharEnable(void)const
{
return _DCB::fErrorChar;
}
void DeviceControlBlock::errorCharEnable(BOOL errorCharEnable)
{
_DCB::fErrorChar=errorCharEnable;
}
BOOL DeviceControlBlock::discardNullEnable(void)const
{
return _DCB::fNull;
}
void DeviceControlBlock::discardNullEnable(BOOL discardNullEnable)
{
_DCB::fNull=discardNullEnable;
}
DeviceControlBlock::RtsControl DeviceControlBlock::rtsControl(void)const
{
return RtsControl(_DCB::fRtsControl);
}
void DeviceControlBlock::rtsControl(RtsControl rtsControl)
{
_DCB::fRtsControl=(DWORD)rtsControl;
}
BOOL DeviceControlBlock::abortOnErrorEnable(void)const
{
return _DCB::fAbortOnError;
}
void DeviceControlBlock::abortOnErrorEnable(BOOL abortOnError)
{
_DCB::fAbortOnError=abortOnError;
}
WORD DeviceControlBlock::xonLimit(void)const
{
return _DCB::XonLim;
}
void DeviceControlBlock::xonLimit(WORD xonLimit)
{
_DCB::XonLim=xonLimit;
}
WORD DeviceControlBlock::xoffLimit(void)const
{
return _DCB::XoffLim;
}
void DeviceControlBlock::xoffLimit(WORD xoffLimit)
{
_DCB::XoffLim=xoffLimit;
}
BYTE DeviceControlBlock::dataBits(void)const
{
return _DCB::ByteSize;
}
void DeviceControlBlock::dataBits(BYTE dataBits)
{
_DCB::ByteSize=dataBits;
}
DeviceControlBlock::Parity DeviceControlBlock::parity(void)const
{
return Parity(_DCB::Parity);
}
void DeviceControlBlock::parity(Parity parity)
{
_DCB::Parity=BYTE(parity);
}
BYTE DeviceControlBlock::stopBits(void)const
{
return _DCB::StopBits;
}
void DeviceControlBlock::stopBits(BYTE stopBits)
{
_DCB::StopBits=stopBits;
}
char DeviceControlBlock::xonChar(void)const
{
return _DCB::XonChar;
}
void DeviceControlBlock::xonChar(char xonChar)
{
_DCB::XonChar=xonChar;
}
char DeviceControlBlock::xoffChar(void)const
{
return _DCB::XoffChar;
}
void DeviceControlBlock::xoffChar(char xoffChar)
{
_DCB::XoffChar=xoffChar;
}
char DeviceControlBlock::errorChar(void)const
{
return _DCB::ErrorChar;
}
void DeviceControlBlock::errorChar(char errorChar)
{
_DCB::ErrorChar=errorChar;
}
char DeviceControlBlock::eofChar(void)const
{
return _DCB::EofChar;
}
void DeviceControlBlock::eofChar(char eofChar)
{
_DCB::EofChar;
}
char DeviceControlBlock::evtChar(void)const
{
return _DCB::EvtChar;
}
void DeviceControlBlock::evtChar(char evtChar)
{
_DCB::EvtChar=evtChar;
}
void DeviceControlBlock::setZero(void)
{
::memset(&(_DCB&)*this,0,sizeof(_DCB));
_DCB::DCBlength=sizeof(_DCB);
}