#ifndef _COMMCTRL_DEVICECONTROLBLOCK_HPP_ #define _COMMCTRL_DEVICECONTROLBLOCK_HPP_ #ifndef _COMMON_WINDOWS_HPP_ #include #endif #ifndef _COMMON_STDLIB_HPP_ #include #endif #ifndef _COMMON_STRING_HPP_ #include #endif class DeviceControlBlock : private _DCB { public: enum DtrControl{DtrControlDisable=DTR_CONTROL_DISABLE,DtrControlEnable=DTR_CONTROL_ENABLE,DtrControlHandshake=DTR_CONTROL_HANDSHAKE}; enum RtsControl{RtsControlDisable=RTS_CONTROL_DISABLE,RtsControlEnable=RTS_CONTROL_ENABLE,RtsControlHandshake=RTS_CONTROL_HANDSHAKE,RtsControlToggle=RTS_CONTROL_TOGGLE}; enum Parity{ParityNone,ParityOdd,ParityEven,ParityMark}; DeviceControlBlock(void); DeviceControlBlock(const DeviceControlBlock &someDeviceControlBlock); virtual ~DeviceControlBlock(); DeviceControlBlock &operator=(const DeviceControlBlock &someDeviceControlBlock); BOOL operator==(const DeviceControlBlock &someDeviceControlBlock); DWORD baudRate(void)const; void baudRate(DWORD baudRate); BOOL binaryEnabled(void)const; void binaryEnabled(BOOL binaryEnabled); BOOL enableParity(void)const; void enableParity(BOOL parity); BOOL ctsFlowControlOutMonitor(void)const; void ctsFlowControlOutMonitor(BOOL ctsFlowControlOut); BOOL dsrFlowControlOutMonitor(void)const; void dsrFlowControlOutMonitor(BOOL dsrFlowControlOut); DtrControl dtrControl(void)const; void dtrControl(DtrControl dtrControl); BOOL dsrSensitivityEnable(void)const; void dsrSensitivityEnable(BOOL dsrSensitivityEnable); BOOL continueOnXOff(void)const; void continueOnXOff(BOOL continueOnXOff); BOOL xonXOffEnableTransmit(void)const; void xonXOffEnableTransmit(BOOL xonXOffEnable); BOOL xonXOffEnableReceive(void)const; void xonXOffEnableReceive(BOOL xonXOffEnable); BOOL errorCharEnable(void)const; void errorCharEnable(BOOL errorCharEnable); BOOL discardNullEnable(void)const; void discardNullEnable(BOOL discardNullEnable); RtsControl rtsControl(void)const; void rtsControl(RtsControl rtsControl); BOOL abortOnErrorEnable(void)const; void abortOnErrorEnable(BOOL abortOnError); WORD xonLimit(void)const; void xonLimit(WORD xonLimit); WORD xoffLimit(void)const; void xoffLimit(WORD xoffLimit); BYTE dataBits(void)const; void dataBits(BYTE dataBits); Parity parity(void)const; void parity(Parity parity); BYTE stopBits(void)const; void stopBits(BYTE stopBits); char xonChar(void)const; void xonChar(char xonChar); char xoffChar(void)const; void xoffChar(char xoffChar); char errorChar(void)const; void errorChar(char errorChar); char eofChar(void)const; void eofChar(char eofChar); char evtChar(void)const; void evtChar(char evtChar); _DCB &getDCB(void); String toString(void)const; private: void setZero(void); }; inline _DCB &DeviceControlBlock::getDCB(void) { return *this; } #endif