diff --git a/config/hyperion.config.json.commented b/config/hyperion.config.json.commented index e5ade8ac..96b8feff 100644 --- a/config/hyperion.config.json.commented +++ b/config/hyperion.config.json.commented @@ -96,7 +96,7 @@ { "id" : "default", "leds" : "*", - "temperatureValues" : + "correctionValues" : { "red" : 255, "green" : 255, diff --git a/libsrc/hyperion/hyperion.schema.json b/libsrc/hyperion/hyperion.schema.json index 7cd89447..58c4aa0e 100644 --- a/libsrc/hyperion/hyperion.schema.json +++ b/libsrc/hyperion/hyperion.schema.json @@ -540,6 +540,30 @@ "minimum" : 0.0, "maximum" : 1.0 }, + "unknownFrameCnt" : + { + "type" : "number", + "required" : false, + "minimum" : 0 + }, + "borderFrameCnt" : + { + "type" : "number", + "required" : false, + "minimum" : 0 + }, + "maxInconsistentCnt" : + { + "type" : "number", + "required" : false, + "minimum" : 0 + }, + "blurRemoveCnt" : + { + "type" : "number", + "required" : false, + "minimum" : 0 + }, "mode" : { "type" : "string", diff --git a/libsrc/leddevice/LedRs232Device.cpp b/libsrc/leddevice/LedRs232Device.cpp index 08c2bc84..8a63baf1 100644 --- a/libsrc/leddevice/LedRs232Device.cpp +++ b/libsrc/leddevice/LedRs232Device.cpp @@ -17,10 +17,50 @@ LedRs232Device::LedRs232Device(const std::string& outputDevice, const unsigned b , _blockedForDelay(false) , _stateChanged(true) { + connect(&_rs232Port, SIGNAL(error(QSerialPort::SerialPortError)), this, SLOT(error(QSerialPort::SerialPortError))); + + +} + +void LedRs232Device::error(QSerialPort::SerialPortError error) +{ + if ( error != QSerialPort::NoError ) + { + switch (error) + { + case QSerialPort::DeviceNotFoundError: + Error(_log, "An error occurred while attempting to open an non-existing device."); break; + case QSerialPort::PermissionError: + Error(_log, "An error occurred while attempting to open an already opened device by another process or a user not having enough permission and credentials to open."); break; + case QSerialPort::OpenError: + Error(_log, "An error occurred while attempting to open an already opened device in this object."); break; + case QSerialPort::NotOpenError: + Error(_log, "This error occurs when an operation is executed that can only be successfully performed if the device is open."); break; + case QSerialPort::ParityError: + Error(_log, "Parity error detected by the hardware while reading data. This value is obsolete. We strongly advise against using it in new code."); break; + case QSerialPort::FramingError: + Error(_log, "Framing error detected by the hardware while reading data. This value is obsolete. We strongly advise against using it in new code."); break; + case QSerialPort::BreakConditionError: + Error(_log, "Break condition detected by the hardware on the input line. This value is obsolete. We strongly advise against using it in new code."); break; + case QSerialPort::WriteError: + Error(_log, "An I/O error occurred while writing the data."); break; + case QSerialPort::ReadError: + Error(_log, "An I/O error occurred while reading the data."); break; + case QSerialPort::ResourceError: + Error(_log, "An I/O error occurred when a resource becomes unavailable, e.g. when the device is unexpectedly removed from the system."); break; + case QSerialPort::UnsupportedOperationError: + Error(_log, "The requested device operation is not supported or prohibited by the running operating system."); break; + case QSerialPort::TimeoutError: + Error(_log, "A timeout error occurred."); break; + default: Error(_log,"An unidentified error occurred. (%d)", error); + } + _rs232Port.clearError(); + } } LedRs232Device::~LedRs232Device() { + disconnect(&_rs232Port, SIGNAL(error(QSerialPort::SerialPortError)), this, SLOT(error(QSerialPort::SerialPortError))); if (_rs232Port.isOpen()) { _rs232Port.close(); @@ -78,12 +118,16 @@ int LedRs232Device::writeBytes(const unsigned size, const uint8_t * data) } _rs232Port.flush(); - int result = _rs232Port.write(reinterpret_cast(data), size); - _rs232Port.waitForBytesWritten(100); + qint64 result = _rs232Port.write(reinterpret_cast(data), size); + if ( result < 0 || result != size) + { + return -1; + } + Debug(_log, "write %d ", result); _rs232Port.flush(); - return (result<0) ? -1 : 0; + return 0; } diff --git a/libsrc/leddevice/LedRs232Device.h b/libsrc/leddevice/LedRs232Device.h index cf7c4e62..c7a0eb78 100644 --- a/libsrc/leddevice/LedRs232Device.h +++ b/libsrc/leddevice/LedRs232Device.h @@ -48,7 +48,7 @@ protected: private slots: /// Unblock the device after a connection delay void unblockAfterDelay(); - + void error(QSerialPort::SerialPortError error); private: // tries to open device if not opened bool tryOpen();