mirror of
https://github.com/hyperion-project/hyperion.ng.git
synced 2023-10-10 13:36:59 +02:00
317a903b14
* rework structure of leddevice source tree * fix data type vor v4l sig detection value in webui * automate leddevicefactory.cpp
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());
|
|
}
|