Typos, version string

This commit is contained in:
MichaelDvP
2020-06-01 14:12:29 +02:00
parent 19abeb7456
commit ba08fb65ef
8 changed files with 16 additions and 12 deletions

View File

@@ -247,6 +247,7 @@ std::string EMSESP::pretty_telegram(std::shared_ptr<const Telegram> telegram) {
// get the type name, any match will do
if (type_name.empty()) {
type_name = emsdevice->telegram_type_name(telegram);
}
}
}
@@ -362,14 +363,12 @@ void EMSESP::process_version(std::shared_ptr<const Telegram> telegram) {
uint8_t product_id = telegram->message_data[offset]; // product ID
// get version as XX.XX
char buf[6] = {0},
buf1[6] = {0};
std::string version(5, '\0');
snprintf_P(&version[0],
version.capacity() + 1,
PSTR("%s.%s"),
Helpers::smallitoa(buf, telegram->message_data[offset + 1]),
Helpers::smallitoa(buf1, telegram->message_data[offset + 2]));
PSTR("%02d.%02d"),
telegram->message_data[offset + 1],
telegram->message_data[offset + 2]);
// some devices store the protocol type (HT3, Buderus) in the last byte
uint8_t brand;
@@ -569,6 +568,7 @@ void EMSESP::incoming_telegram(uint8_t * data, const uint8_t length) {
//LOG_TRACE(F("Rx: %s"), Helpers::data_to_hex(data, length).c_str());
uint8_t first_value = data[0];
if (((first_value & 0x7F) == txservice_.ems_bus_id()) && (length > 1)) {
rxservice_.add(data, length); // just for logging
return; // it's an echo
}