Added debug logging of the Ada header bytes that are sent (#238)

[HYPERIOND LedDevice] <DEBUG> <LedDeviceAdalight.cpp:52:write()> Adalight header for 316 leds: Ada 0x01 0x3b 0x6f
This commit is contained in:
penfold42 2016-09-13 22:25:42 +10:00 committed by redPanther
parent adfe2a4b23
commit 52283b3257
2 changed files with 18 additions and 0 deletions

View File

@ -41,6 +41,15 @@ int LedDeviceAdalight::write(const std::vector<ColorRgb> & ledValues)
_ledBuffer[3] = ((ledValues.size() - 1) >> 8) & 0xFF; // LED count high byte
_ledBuffer[4] = (ledValues.size() - 1) & 0xFF; // LED count low byte
_ledBuffer[5] = _ledBuffer[3] ^ _ledBuffer[4] ^ 0x55; // Checksum
Debug( _log, "Adalight header for %d leds: %c%c%c 0x%02x 0x%02x 0x%02x",
ledValues.size(),
_ledBuffer[0],
_ledBuffer[1],
_ledBuffer[2],
_ledBuffer[3],
_ledBuffer[4],
_ledBuffer[5]
);
}
// restart the timer

View File

@ -39,6 +39,15 @@ int LedDeviceAdalightApa102::write(const std::vector<ColorRgb> & ledValues)
_ledBuffer[3] = (((unsigned int)(ledValues.size())) >> 8) & 0xFF; // LED count high byte
_ledBuffer[4] = ((unsigned int)(ledValues.size())) & 0xFF; // LED count low byte
_ledBuffer[5] = _ledBuffer[3] ^ _ledBuffer[4] ^ 0x55; // Checksum
Debug( _log, "Adalight header for %d leds: %c%c%c 0x%02x 0x%02x 0x%02x",
ledValues.size(),
_ledBuffer[0],
_ledBuffer[1],
_ledBuffer[2],
_ledBuffer[3],
_ledBuffer[4],
_ledBuffer[5]
);
}
for (signed iLed=1; iLed<=_ledCount; iLed++) {