Correctly set buffer size based on number of leds so that it works with non-standard AtmoOrb setups.
Former-commit-id: 6aec2410d6
This commit is contained in:
parent
bd1a45216a
commit
0d8c4ac5fb
|
@ -88,7 +88,7 @@ int LedDeviceAtmoOrb::write(const std::vector<ColorRgb> & ledValues) {
|
|||
|
||||
void LedDeviceAtmoOrb::setColor(unsigned int orbId, const ColorRgb& color, int commandType) {
|
||||
QByteArray bytes;
|
||||
bytes.resize(5 + 24 * 3);
|
||||
bytes.resize(5 + numLeds * 3);
|
||||
|
||||
// Command identifier: C0FFEE
|
||||
bytes[0] = 0xC0;
|
||||
|
@ -121,7 +121,7 @@ int LedDeviceAtmoOrb::switchOff() {
|
|||
for (int i = 0; i < orbIds.size(); i++) {
|
||||
|
||||
QByteArray bytes;
|
||||
bytes.resize(5 + 24 * 3);
|
||||
bytes.resize(5 + numLeds * 3);
|
||||
|
||||
// Command identifier: C0FFEE
|
||||
bytes[0] = 0xC0;
|
||||
|
|
Loading…
Reference in New Issue