25 lines
481 B
C++
25 lines
481 B
C++
#ifndef SERIALPORTBASE_H
|
|
#define SERIALPORTBASE_H
|
|
|
|
#include <iostream>
|
|
|
|
using namespace std;
|
|
|
|
class SerialPortBase
|
|
{
|
|
|
|
public:
|
|
// SerialPortBase();
|
|
// ~SerialPortBase();
|
|
|
|
virtual int OpenSerialPort(string portName) = 0;
|
|
virtual int CloseSerialPort() = 0;
|
|
virtual int SetBaudrate(int baudrate) = 0;
|
|
virtual int SendData(const char chrMessage[], const unsigned short usLen) = 0;
|
|
virtual int ReadData() = 0;
|
|
protected:
|
|
private:
|
|
};
|
|
|
|
#endif // SERIALPORTBASE_H
|