New LED Device - Cololight (#1070)

This commit is contained in:
LordGrey
2020-11-01 21:56:19 +01:00
committed by GitHub
parent bb652ade36
commit 83455441fa
12 changed files with 1476 additions and 164 deletions

View File

@@ -24,6 +24,7 @@ LedDevice::LedDevice(const QJsonObject& deviceConfig, QObject* parent)
, _refreshTimer(nullptr)
, _refreshTimerInterval_ms(0)
, _latchTime_ms(0)
, _ledCount(0)
, _isRestoreOrigState(false)
, _isEnabled(false)
, _isDeviceInitialised(false)
@@ -454,3 +455,17 @@ QString LedDevice::uint8_t_to_hex_string(const uint8_t * data, const qint64 size
return bytes.toHex();
#endif
}
QString LedDevice::toHex(const QByteArray& data, int number) const
{
if ( number <= 0 || number > data.size())
{
number = data.size();
}
#if (QT_VERSION >= QT_VERSION_CHECK(5, 9, 0))
return data.left(number).toHex(':');
#else
return data.left(number).toHex();
#endif
}