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

@@ -235,7 +235,7 @@ void Console::load_standard_commands(unsigned int context) {
}
// trace logic
if (level == uuid::log::Level::TRACE) {
if (level == uuid::log::Level::TRACE || level == uuid::log::Level::DEBUG) {
watch_id = LOG_TRACE_WATCH_NONE; // no watch ID set
if (arguments.size() > 1) {
// next argument is raw or full
@@ -243,6 +243,8 @@ void Console::load_standard_commands(unsigned int context) {
emsesp::EMSESP::trace_raw(true);
} else if (arguments[1] == read_flash_string(F_(full))) {
emsesp::EMSESP::trace_raw(false);
} else {
emsesp::EMSESP::trace_watch_id(Helpers::hextoint(arguments[1].c_str()));
}
// get the watch_id if its set

View File

@@ -228,7 +228,7 @@ std::string EMSdevice::telegram_type_name(std::shared_ptr<const Telegram> telegr
}
for (const auto & tf : telegram_functions_) {
if (tf.telegram_type_id_ == (telegram->type_id && ((telegram->type_id & 0xF0) != 0xF0))) {
if ((tf.telegram_type_id_ == telegram->type_id) && ((telegram->type_id & 0x0F0) != 0xF0)) {
return uuid::read_flash_string(tf.telegram_type_name_);
}
}

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
}

View File

@@ -279,6 +279,8 @@ uint32_t Helpers::hextoint(const char * hex) {
byte = byte - 'a' + 10;
else if (byte >= 'A' && byte <= 'F')
byte = byte - 'A' + 10;
else
return 0; // error
// shift 4 to make space for new digit, and add the 4 bits of the new digit
val = (val << 4) | (byte & 0xF);
}

View File

@@ -470,7 +470,7 @@ void Thermostat::publish_values() {
// go through all the heating circuits
for (const auto & hc : heating_circuits_) {
// if ((hc->setpoint_roomTemp == EMS_VALUE_SHORT_NOTSET) || (hc->curr_roomTemp == EMS_VALUE_SHORT_NOTSET)) {
if (hc->heatingtype == 0) {
if (hc->setpoint_roomTemp == EMS_VALUE_SHORT_NOTSET) {
break; // skip this HC
}