Fix: Writing Both Bytes of DPT8.010 to Bus

This commit is contained in:
Cornelius Köpp 2023-07-16 21:35:50 +02:00
parent f7ac39c66f
commit efbbb52717

View File

@ -1008,7 +1008,7 @@ int valueToBusValueSigned16(const KNXValue& value, uint8_t* payload, size_t payl
{ {
if ((double)value < -327.68 || (double)value > 327.67) if ((double)value < -327.68 || (double)value > 327.67)
return false; return false;
signed16ToPayload(payload, payload_length, 0, (double)value * 100.0, 0xFF); signed16ToPayload(payload, payload_length, 0, (int16_t)((double)value * 100.0), 0xFFFF);
} }
else else
signed16ToPayload(payload, payload_length, 0, (uint64_t)value, 0xffff); signed16ToPayload(payload, payload_length, 0, (uint64_t)value, 0xffff);