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:
RickDB 2016-03-14 21:19:47 +01:00
parent bd1a45216a
commit 0d8c4ac5fb
1 changed files with 2 additions and 2 deletions

View File

@ -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;