diff --git a/scripts/update_modbus_registers.py b/scripts/update_modbus_registers.py index e7ef1c0be..94411af84 100644 --- a/scripts/update_modbus_registers.py +++ b/scripts/update_modbus_registers.py @@ -42,7 +42,9 @@ string_sizes = { "thermostat/switchtime2": 16, "thermostat/switchtime": 16, "thermostat/switchtimeww": 21, - "controller/datetime": 25 + "controller/datetime": 25, + "connect/datetime": 25, + "connect/name": 51 } tag_to_tagtype = { @@ -82,7 +84,23 @@ tag_to_tagtype = { 32: "TAG_TYPE_HS", 33: "TAG_TYPE_HS", 34: "TAG_TYPE_HS", - 35: "TAG_TYPE_HS" + 35: "TAG_TYPE_HS", + 36: "TAG_TYPE_SRC", + 37: "TAG_TYPE_SRC", + 38: "TAG_TYPE_SRC", + 39: "TAG_TYPE_SRC", + 40: "TAG_TYPE_SRC", + 41: "TAG_TYPE_SRC", + 42: "TAG_TYPE_SRC", + 43: "TAG_TYPE_SRC", + 44: "TAG_TYPE_SRC", + 45: "TAG_TYPE_SRC", + 46: "TAG_TYPE_SRC", + 47: "TAG_TYPE_SRC", + 48: "TAG_TYPE_SRC", + 49: "TAG_TYPE_SRC", + 50: "TAG_TYPE_SRC", + 50: "TAG_TYPE_SRC" } device_type_names = [ diff --git a/src/core/modbus.cpp b/src/core/modbus.cpp index 299bd4c59..0121e7be5 100644 --- a/src/core/modbus.cpp +++ b/src/core/modbus.cpp @@ -455,12 +455,10 @@ int Modbus::getRegisterCount(const DeviceValue & dv) { uint32_t num_values = std::max(dv.max, (uint32_t)abs(dv.min)); int num_registers = 0; - if (num_values <= (1L << 8)) + if (num_values < (1L << 16)) num_registers = 1; - else if (num_values <= (1L << 16)) + else if (num_values <= (0xFFFFFFFF)) num_registers = 2; - else if (num_values <= (1L << 32)) - num_registers = 4; else LOG_ERROR("num_registers is too big to be encoded with modbus registers"); diff --git a/src/devices/connect.h b/src/devices/connect.h index 18940dc3f..8de7ebb92 100644 --- a/src/devices/connect.h +++ b/src/devices/connect.h @@ -73,7 +73,7 @@ class Connect : public EMSdevice { void process_OutdoorTemp(std::shared_ptr telegram); void process_RCTime(std::shared_ptr telegram); int16_t outdoorTemp_; - char dateTime_[30]; // date and time stamp + char dateTime_[25]; // date and time stamp uint8_t schedule_[126]; // telegram copy };