Improved debug info.

pull/5/head
weetmuts 2018-11-02 16:20:46 +01:00
rodzic 561b0ee5d3
commit dbd8a77afa
2 zmienionych plików z 4 dodań i 6 usunięć

Wyświetl plik

@ -151,7 +151,9 @@ bool parseDV(Telegram *t,
string value = bin2hex(data, len);
(*values)[key] = { start_parse_here+data-data_start, value };
t->addExplanation(data, len, "%s", value.c_str());
if (value.length() > 0) {
t->addExplanation(data, len, "%s", value.c_str());
}
}
string format_string = bin2hex(format_bytes);

Wyświetl plik

@ -382,11 +382,7 @@ void Telegram::explainParse(string intro, int from)
{
for (auto& p : explanations) {
if (p.first < from) continue;
printf("%s ", intro.c_str());
for (int i=0; i<p.first; ++i) {
printf(" ");
}
printf("%s\n", p.second.c_str());
printf("%s %02x: %s\n", intro.c_str(), p.first, p.second.c_str());
}
string hex = bin2hex(parsed);
printf("%s %s\n", intro.c_str(), hex.c_str());