mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-06 07:49:52 +03:00
fix #820, NOTSET check for 4 byte values.
This commit is contained in:
@@ -1302,6 +1302,7 @@ void Boiler::process_HpInConfig(std::shared_ptr<const Telegram> telegram) {
|
||||
has_update(hpInput[3].option, option, 12);
|
||||
}
|
||||
|
||||
// Boiler(0x08) -W-> Me(0x0B), HpHeaterConfig(0x0492), data: 03 00 00 04 00
|
||||
void Boiler::process_HpHeaterConfig(std::shared_ptr<const Telegram> telegram) {
|
||||
has_update(maxHeatComp_, 2);
|
||||
has_update(maxHeatHeat_, 3);
|
||||
|
||||
@@ -522,7 +522,7 @@ bool Helpers::hasValue(const uint16_t & value) {
|
||||
}
|
||||
|
||||
bool Helpers::hasValue(const uint32_t & value) {
|
||||
return (value != EMS_VALUE_ULONG_NOTSET);
|
||||
return (value < EMS_VALUE_ULONG_NOTSET);
|
||||
}
|
||||
|
||||
// checks if we can convert a char string to an int value
|
||||
|
||||
@@ -47,6 +47,7 @@ static constexpr int8_t EMS_VALUE_INT_NOTSET = 0x7F; // for signed 8-
|
||||
static constexpr uint16_t EMS_VALUE_USHORT_NOTSET = 0x7D00; // 32000: for 2-byte unsigned shorts
|
||||
static constexpr int16_t EMS_VALUE_SHORT_NOTSET = 0x7D00; // 32000: for 2-byte signed shorts
|
||||
static constexpr uint32_t EMS_VALUE_ULONG_NOTSET = 0x00FFFFFF; // for 3-byte and 4-byte longs
|
||||
// 4 byte value is 21474836 (0x147AE14), we use only the lower one, see https://github.com/emsesp/EMS-ESP32/issues/820
|
||||
|
||||
static constexpr uint8_t EMS_MAX_TELEGRAM_LENGTH = 32; // max length of a complete EMS telegram
|
||||
static constexpr uint8_t EMS_MAX_TELEGRAM_MESSAGE_LENGTH = 27; // max length of message block, assuming EMS1.0
|
||||
|
||||
Reference in New Issue
Block a user