Adalight - HyperSerial Support (#1515)

* HyperSerial support

* Migrate Adalight records to new structure

* Serial Devices - Select baud rate and allow providing a custom one
This commit is contained in:
LordGrey
2022-09-30 17:02:40 +02:00
committed by GitHub
parent e8fc8a9855
commit 9df21b9ddd
12 changed files with 539 additions and 113 deletions

View File

@@ -4,6 +4,16 @@
// hyperion includes
#include "ProviderRs232.h"
namespace Adalight
{
typedef enum ProtocolType
{
ADA = 0,
LBAPA,
AWA
} PROTOCOLTYPE;
}
///
/// Implementation of the LedDevice interface for writing to an Adalight LED-device.
///
@@ -37,6 +47,11 @@ private:
///
bool init(const QJsonObject &deviceConfig) override;
///
/// @brief Prepare the protocol's header
///
void prepareHeader();
///
/// @brief Writes the RGB-Color values to the LEDs.
///
@@ -45,8 +60,17 @@ private:
///
int write(const std::vector<ColorRgb> & ledValues) override;
const short _headerSize;
bool _ligthBerryAPA102Mode;
void whiteChannelExtension(uint8_t*& writer);
qint64 _bufferLength;
Adalight::PROTOCOLTYPE _streamProtocol;
bool _white_channel_calibration;
uint8_t _white_channel_limit;
uint8_t _white_channel_red;
uint8_t _white_channel_green;
uint8_t _white_channel_blue;
};
#endif // LEDEVICETADALIGHT_H