diff --git a/src/emsdevice.cpp b/src/emsdevice.cpp index 9ca502f29..cd6f94797 100644 --- a/src/emsdevice.cpp +++ b/src/emsdevice.cpp @@ -26,7 +26,7 @@ namespace emsesp { uuid::log::Logger EMSdevice::logger_{F_(logger_name), uuid::log::Facility::CONSOLE}; -std::string EMSdevice::brand() const { +std::string EMSdevice::brand_to_string() const { switch (brand_) { case EMSdevice::Brand::BOSCH: return read_flash_string(F("Bosch")); @@ -143,7 +143,7 @@ std::string EMSdevice::to_string() const { snprintf_P(&str[0], str.capacity() + 1, PSTR("%s %s (DeviceID:0x%02X ProductID:%d, Version:%s)"), - brand().c_str(), + brand_to_string().c_str(), name_.c_str(), device_id_, product_id_, diff --git a/src/emsdevice.h b/src/emsdevice.h index f9a68ebe9..6a0f8c829 100644 --- a/src/emsdevice.h +++ b/src/emsdevice.h @@ -86,11 +86,15 @@ class EMSdevice { brand_ = brand; } + inline uint8_t brand() const { + return brand_; + } + inline void name(const std::string & name) { name_ = name; } - std::string brand() const; + std::string brand_to_string() const; static uint8_t decode_brand(uint8_t value); std::string to_string() const; @@ -171,8 +175,8 @@ class EMSdevice { }; // device IDs - static constexpr uint16_t EMS_DEVICE_ID_BOILER = 0x08; // fixed device_id for Master Boiler/UBA - static constexpr uint16_t EMS_DEVICE_ID_MODEM = 0x48; // gateways like the KM200 + static constexpr uint8_t EMS_DEVICE_ID_BOILER = 0x08; // fixed device_id for Master Boiler/UBA + static constexpr uint8_t EMS_DEVICE_ID_MODEM = 0x48; // gateways like the KM200 // type IDs static constexpr uint16_t EMS_TYPE_VERSION = 0x02; // type ID for Version information. Generic across all EMS devices.