32 #ifndef _NPT_SERIAL_PORT_H_ 33 #define _NPT_SERIAL_PORT_H_ 39 #include "NptStreams.h" 44 const int NPT_ERROR_NO_SUCH_SERIAL_PORT = NPT_ERROR_BASE_SERIAL_PORT - 0;
45 const int NPT_ERROR_SERIAL_PORT_NOT_OPEN = NPT_ERROR_BASE_SERIAL_PORT - 1;
46 const int NPT_ERROR_SERIAL_PORT_ALREADY_OPEN = NPT_ERROR_BASE_SERIAL_PORT - 2;
47 const int NPT_ERROR_SERIAL_PORT_BUSY = NPT_ERROR_BASE_SERIAL_PORT - 3;
50 NPT_SERIAL_PORT_PARITY_NONE,
51 NPT_SERIAL_PORT_PARITY_EVEN,
52 NPT_SERIAL_PORT_PARITY_ODD,
53 NPT_SERIAL_PORT_PARITY_MARK
54 } NPT_SerialPortParity;
57 NPT_SERIAL_PORT_STOP_BITS_1,
58 NPT_SERIAL_PORT_STOP_BITS_1_5,
59 NPT_SERIAL_PORT_STOP_BITS_2
60 } NPT_SerialPortStopBits;
63 NPT_SERIAL_PORT_FLOW_CONTROL_NONE,
64 NPT_SERIAL_PORT_FLOW_CONTROL_HARDWARE,
65 NPT_SERIAL_PORT_FLOW_CONTROL_XON_XOFF
66 } NPT_SerialPortFlowControl;
78 virtual NPT_Result Open(
unsigned int speed,
79 NPT_SerialPortStopBits stop_bits,
80 NPT_SerialPortFlowControl flow_control,
81 NPT_SerialPortParity parity) = 0;
82 virtual NPT_Result Close() = 0;
98 NPT_Result Open(
unsigned int speed,
99 NPT_SerialPortStopBits stop_bits = NPT_SERIAL_PORT_STOP_BITS_1,
100 NPT_SerialPortFlowControl flow_control = NPT_SERIAL_PORT_FLOW_CONTROL_NONE,
101 NPT_SerialPortParity parity = NPT_SERIAL_PORT_PARITY_NONE)
override {
102 return m_Delegate->Open(speed, stop_bits, flow_control, parity);
104 NPT_Result Close()
override {
105 return m_Delegate->Close();
108 return m_Delegate->GetInputStream(stream);
111 return m_Delegate->GetOutputStream(stream);
119 #endif // _NPT_SERIAL_PORT_H_ Definition: NptSerialPort.h:71
Definition: NptSerialPort.h:90