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