show device info on Web

This commit is contained in:
proddy
2020-07-26 16:03:06 +02:00
parent 39e5fb1a68
commit 38f00946da
29 changed files with 339 additions and 43 deletions

View File

@@ -127,7 +127,7 @@ uint8_t EMSdevice::decode_brand(uint8_t value) {
}
}
// print human friendly description of the EMS device
// returns string of a human friendly description of the EMS device
std::string EMSdevice::to_string() const {
std::string str(160, '\0');
@@ -153,6 +153,17 @@ std::string EMSdevice::to_string() const {
return str;
}
// returns out brand + device name
std::string EMSdevice::to_string_short() const {
std::string str(160, '\0');
if (brand_ == Brand::NO_BRAND) {
snprintf_P(&str[0], str.capacity() + 1, PSTR("%s: %s"), device_type_name().c_str(), name_.c_str());
} else {
snprintf_P(&str[0], str.capacity() + 1, PSTR("%s: %s %s"), device_type_name().c_str(), brand_to_string().c_str(), name_.c_str());
}
return str;
}
// prints the header for the section
void EMSdevice::show_values(uuid::console::Shell & shell) {
shell.printfln(F("%s: %s"), device_type_name().c_str(), to_string().c_str());