mirror of
https://github.com/thelsing/knx.git
synced 2024-12-18 19:08:18 +01:00
Fix valueNoSendCompare
: DPT Conversion Fail Resulted in Setting KO to 0
This commit is contained in:
parent
84a0ce3c22
commit
9a7b6a5e80
@ -301,7 +301,13 @@ bool GroupObject::valueNoSendCompare(const KNXValue& value, const Dpt& type)
|
|||||||
// convert new value to given dtp
|
// convert new value to given dtp
|
||||||
uint8_t newData[_dataLength];
|
uint8_t newData[_dataLength];
|
||||||
memset(newData, 0, _dataLength);
|
memset(newData, 0, _dataLength);
|
||||||
KNX_Encode_Value(value, newData, _dataLength, type);
|
const bool encodingDone = KNX_Encode_Value(value, newData, _dataLength, type);
|
||||||
|
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
|
// check for change in converted value / update value on change only
|
||||||
const bool dataChanged = memcmp(_data, newData, _dataLength);
|
const bool dataChanged = memcmp(_data, newData, _dataLength);
|
||||||
|
Loading…
Reference in New Issue
Block a user