Extract I2C logic from SerialController to separate class

This commit is contained in:
Shawn Chain
2018-07-30 21:58:35 +08:00
parent 77aa470649
commit d715470b1c
8 changed files with 259 additions and 88 deletions

View File

@@ -42,7 +42,7 @@ enum SERIAL_SPEED {
class CSerialController : public ISerialPort {
public:
CSerialController(const std::string& device, SERIAL_SPEED speed, const std::string& protocol = "uart", unsigned int address = 0x22U, bool assertRTS = false);
CSerialController(const std::string& device, SERIAL_SPEED speed, bool assertRTS = false);
virtual ~CSerialController();
virtual bool open();
@@ -57,11 +57,9 @@ public:
virtual int setNonblock(bool nonblock);
#endif
private:
protected:
std::string m_device;
SERIAL_SPEED m_speed;
std::string m_protocol;
unsigned int m_address;
bool m_assertRTS;
#if defined(_WIN32) || defined(_WIN64)
HANDLE m_handle;