mirror of
https://github.com/hyperion-project/hyperion.ng.git
synced 2023-10-10 13:36:59 +02:00
Make sure the byte array is empty before filling it.
Former-commit-id: 64f76fa358234e131377ecfabf196f3c7324e79f
This commit is contained in:
parent
5be072be24
commit
dcc6a9b449
@ -76,7 +76,8 @@ int LedDeviceAtmoOrb::write(const std::vector<ColorRgb> & ledValues) {
|
|||||||
|
|
||||||
void LedDeviceAtmoOrb::setColor(unsigned int orbId, const ColorRgb& color, int commandType) {
|
void LedDeviceAtmoOrb::setColor(unsigned int orbId, const ColorRgb& color, int commandType) {
|
||||||
QByteArray bytes;
|
QByteArray bytes;
|
||||||
bytes.resize(5 + numLeds * 3);
|
bytes.resize(5 + numLeds * 3);
|
||||||
|
bytes.fill('\0');
|
||||||
|
|
||||||
// Command identifier: C0FFEE
|
// Command identifier: C0FFEE
|
||||||
bytes[0] = 0xC0;
|
bytes[0] = 0xC0;
|
||||||
@ -106,7 +107,8 @@ void LedDeviceAtmoOrb::sendCommand(const QByteArray & bytes) {
|
|||||||
int LedDeviceAtmoOrb::switchOff() {
|
int LedDeviceAtmoOrb::switchOff() {
|
||||||
for (unsigned int i = 0; i < orbIds.size(); i++) {
|
for (unsigned int i = 0; i < orbIds.size(); i++) {
|
||||||
QByteArray bytes;
|
QByteArray bytes;
|
||||||
bytes.resize(5 + numLeds * 3);
|
bytes.resize(5 + numLeds * 3);
|
||||||
|
bytes.fill('\0');
|
||||||
|
|
||||||
// Command identifier: C0FFEE
|
// Command identifier: C0FFEE
|
||||||
bytes[0] = 0xC0;
|
bytes[0] = 0xC0;
|
||||||
|
Loading…
Reference in New Issue
Block a user