(Prepare for devel) Fix: Do NOT Send when Updating KO Failed on Value Conversion - Change Signature of all Set-Methods

This commit is contained in:
Cornelius Köpp 2024-11-01 20:22:16 +01:00
parent 7280cd0e53
commit 8e2facbb9d

View File

@ -534,7 +534,15 @@ namespace Knx
// convert new value to given dtp
uint8_t newData[_dataLength];
memset(newData, 0, _dataLength);
const bool encodingDone = true; // TODO FIXME for devel! value.encode needs success indicator
value.encode(newData);
if (!encodingDone)
{
// value conversion to DPT failed
// do NOT update the value of the KO!
return false;
}
// check for change in converted value / update value on change only
const bool dataChanged = memcmp(_data, newData, _dataLength);