rename brand to brand_to_string()

This commit is contained in:
proddy
2020-06-25 16:12:29 +02:00
parent ab295f06b6
commit aa29992a2e
2 changed files with 9 additions and 5 deletions

View File

@@ -26,7 +26,7 @@ namespace emsesp {
uuid::log::Logger EMSdevice::logger_{F_(logger_name), uuid::log::Facility::CONSOLE}; 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_) { switch (brand_) {
case EMSdevice::Brand::BOSCH: case EMSdevice::Brand::BOSCH:
return read_flash_string(F("Bosch")); return read_flash_string(F("Bosch"));
@@ -143,7 +143,7 @@ std::string EMSdevice::to_string() const {
snprintf_P(&str[0], snprintf_P(&str[0],
str.capacity() + 1, str.capacity() + 1,
PSTR("%s %s (DeviceID:0x%02X ProductID:%d, Version:%s)"), PSTR("%s %s (DeviceID:0x%02X ProductID:%d, Version:%s)"),
brand().c_str(), brand_to_string().c_str(),
name_.c_str(), name_.c_str(),
device_id_, device_id_,
product_id_, product_id_,

View File

@@ -86,11 +86,15 @@ class EMSdevice {
brand_ = brand; brand_ = brand;
} }
inline uint8_t brand() const {
return brand_;
}
inline void name(const std::string & name) { inline void name(const std::string & name) {
name_ = name; name_ = name;
} }
std::string brand() const; std::string brand_to_string() const;
static uint8_t decode_brand(uint8_t value); static uint8_t decode_brand(uint8_t value);
std::string to_string() const; std::string to_string() const;
@@ -171,8 +175,8 @@ class EMSdevice {
}; };
// device IDs // device IDs
static constexpr uint16_t EMS_DEVICE_ID_BOILER = 0x08; // fixed device_id for Master Boiler/UBA static constexpr uint8_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_MODEM = 0x48; // gateways like the KM200
// type IDs // type IDs
static constexpr uint16_t EMS_TYPE_VERSION = 0x02; // type ID for Version information. Generic across all EMS devices. static constexpr uint16_t EMS_TYPE_VERSION = 0x02; // type ID for Version information. Generic across all EMS devices.