Restore the branch

This commit is contained in:
Jonathan Naylor
2020-12-15 16:21:07 +00:00
parent 135fd04e0d
commit d77e2a00ce
126 changed files with 12881 additions and 8106 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2002-2004,2007-2009,2011-2013,2015-2017 by Jonathan Naylor G4KLX
* Copyright (C) 2002-2004,2007-2009,2011-2013,2015-2017,2020 by Jonathan Naylor G4KLX
* Copyright (C) 1999-2001 by Thomas Sailor HB9JNX
*
* This program is free software; you can redistribute it and/or modify
@@ -28,21 +28,9 @@
#include <windows.h>
#endif
enum SERIAL_SPEED {
SERIAL_1200 = 1200,
SERIAL_2400 = 2400,
SERIAL_4800 = 4800,
SERIAL_9600 = 9600,
SERIAL_19200 = 19200,
SERIAL_38400 = 38400,
SERIAL_76800 = 76800,
SERIAL_115200 = 115200,
SERIAL_230400 = 230400
};
class CSerialController : public ISerialPort {
public:
CSerialController(const std::string& device, SERIAL_SPEED speed, bool assertRTS = false);
CSerialController(const std::string& device, unsigned int speed, bool assertRTS = false);
virtual ~CSerialController();
virtual bool open();
@@ -58,8 +46,10 @@ public:
#endif
protected:
CSerialController(unsigned int speed, bool assertRTS = false);
std::string m_device;
SERIAL_SPEED m_speed;
unsigned int m_speed;
bool m_assertRTS;
#if defined(_WIN32) || defined(_WIN64)
HANDLE m_handle;
@@ -71,6 +61,7 @@ protected:
int readNonblock(unsigned char* buffer, unsigned int length);
#else
bool canWrite();
bool setRaw();
#endif
};