mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-07 00:09:51 +03:00
fix for showing 3-byte values - #475
This commit is contained in:
@@ -39,7 +39,7 @@ Boiler::Boiler(uint8_t device_type, int8_t device_id, uint8_t product_id, const
|
||||
register_telegram_type(0x1C, F("UBAMaintenanceStatus"), false, [&](std::shared_ptr<const Telegram> t) { process_UBAMaintenanceStatus(t); });
|
||||
register_telegram_type(0x2A, F("MC10Status"), false, [&](std::shared_ptr<const Telegram> t) { process_MC10Status(t); });
|
||||
register_telegram_type(0x33, F("UBAParameterWW"), true, [&](std::shared_ptr<const Telegram> t) { process_UBAParameterWW(t); });
|
||||
register_telegram_type(0x14, F("UBATotalUptime"), false, [&](std::shared_ptr<const Telegram> t) { process_UBATotalUptime(t); });
|
||||
register_telegram_type(0x14, F("UBATotalUptime"), true, [&](std::shared_ptr<const Telegram> t) { process_UBATotalUptime(t); });
|
||||
register_telegram_type(0x35, F("UBAFlags"), false, [&](std::shared_ptr<const Telegram> t) { process_UBAFlags(t); });
|
||||
register_telegram_type(0x15, F("UBAMaintenanceData"), false, [&](std::shared_ptr<const Telegram> t) { process_UBAMaintenanceData(t); });
|
||||
register_telegram_type(0x16, F("UBAParameters"), true, [&](std::shared_ptr<const Telegram> t) { process_UBAParameters(t); });
|
||||
|
||||
@@ -101,7 +101,7 @@ class Telegram {
|
||||
// s is to override number of bytes read (e.g. use 3 to simulat a uint24_t)
|
||||
void read_value(Value & value, const uint8_t index, uint8_t s = 0) const {
|
||||
uint8_t size = (!s) ? sizeof(Value) : s;
|
||||
int8_t abs_index = ((index - offset + size - 1) >= message_length - 1) ? -1 : (index - offset);
|
||||
int8_t abs_index = ((index - offset + size - 1) >= message_length) ? -1 : (index - offset);
|
||||
if (abs_index < 0) {
|
||||
return; // out of bounds, we don't change the value
|
||||
}
|
||||
|
||||
@@ -138,6 +138,9 @@ void Test::run_test(uuid::console::Shell & shell, const std::string & command) {
|
||||
// question: do we need to set the mask?
|
||||
std::string version("1.2.3");
|
||||
EMSESP::add_device(0x08, 123, version, EMSdevice::Brand::BUDERUS); // Nefit Trendline
|
||||
|
||||
// UBAuptime
|
||||
uart_telegram({0x08, 0x0B, 0x14, 00, 0x3C, 0x1F, 0xAC, 0x70});
|
||||
}
|
||||
|
||||
// unknown device -
|
||||
|
||||
Reference in New Issue
Block a user