Serialport (#36)

* migrate serialport to qt5 serialport

* remove old serialport
add logging to serialport

* remove try catch - qt serialport uses plain return values

* tiny fix, but not working atm

* make it work, tested with adalight
This commit is contained in:
redPanther
2016-06-23 00:11:09 +02:00
committed by brindosch
parent 48134d0aef
commit 93e3981df1
17 changed files with 57 additions and 4462 deletions

View File

@@ -1,13 +1,13 @@
#pragma once
#include <QObject>
// Serial includes
#include <serial/serial.h>
#include <QSerialPort>
// Leddevice includes
#include <leddevice/LedDevice.h>
#include <utils/Logger.h>
///
/// The LedRs232Device implements an abstract base-class for LedDevices using a RS232-device.
///
@@ -52,17 +52,23 @@ private slots:
void unblockAfterDelay();
private:
// tries to open device if not opened
bool tryOpen();
/// The name of the output device
const std::string _deviceName;
/// The used baudrate of the output device
const int _baudRate_Hz;
const qint32 _baudRate_Hz;
/// Sleep after the connect before continuing
const int _delayAfterConnect_ms;
int _delayAfterConnect_ms;
/// The RS232 serial-device
serial::Serial _rs232Port;
QSerialPort _rs232Port;
bool _blockedForDelay;
/// logger instance
Logger* _log;
};