mirror of
https://github.com/hyperion-project/hyperion.ng.git
synced 2023-10-10 13:36:59 +02:00
96e8c29582
* refresh for all :-) remove dups * - integrate refresh leds for all devices - fix schemas for led devices * add minimum for rewrite time * rewriteTime: add missing info in config examples
28 lines
656 B
C++
28 lines
656 B
C++
#include "LedDeviceRawHID.h"
|
|
|
|
// Use feature report HID device
|
|
LedDeviceRawHID::LedDeviceRawHID(const QJsonObject &deviceConfig)
|
|
: ProviderHID()
|
|
{
|
|
ProviderHID::init(deviceConfig);
|
|
_useFeature = true;
|
|
_ledBuffer.resize(_ledRGBCount);
|
|
}
|
|
|
|
LedDevice* LedDeviceRawHID::construct(const QJsonObject &deviceConfig)
|
|
{
|
|
return new LedDeviceRawHID(deviceConfig);
|
|
}
|
|
|
|
int LedDeviceRawHID::write(const std::vector<ColorRgb> & ledValues)
|
|
{
|
|
// write data
|
|
memcpy(_ledBuffer.data(), ledValues.data(), _ledRGBCount);
|
|
return writeBytes(_ledBuffer.size(), _ledBuffer.data());
|
|
}
|
|
|
|
void LedDeviceRawHID::rewriteLeds()
|
|
{
|
|
writeBytes(_ledBuffer.size(), _ledBuffer.data());
|
|
}
|