color refactoring

This commit is contained in:
2020-11-03 17:30:01 +01:00
parent bef20bcaed
commit 6bbe4d7eaf
3 changed files with 39 additions and 16 deletions

View File

@ -118,28 +118,28 @@ static void parseAndPrintFrame(t_mbusCommHandle *mbusCommHandle) {
mbus_data_variable *data_var = &(frame_data.data_var);
logMsg("papf sts: %02x", data_var->header.status);
if ((data_var->header.status & 0x01)) {
logMsg("\x1b[31;1mpapf sts: Application Busy\x1b[0m");
errMsg("papf sts: Application Busy");
}
if ((data_var->header.status & 0x02)) {
logMsg("\x1b[31;1mpapf sts: Any Application Error\x1b[0m");
errMsg("papf sts: Any Application Error");
}
if ((data_var->header.status & 0x04)) {
logMsg("\x1b[31;1mpapf sts: Power Low\x1b[0m");
errMsg("papf sts: Power Low");
}
if ((data_var->header.status & 0x08)) {
logMsg("\x1b[31;1mpapf sts: Permanent Error\x1b[0m");
errMsg("papf sts: Permanent Error");
}
if ((data_var->header.status & 0x10)) {
logMsg("\x1b[31;1mpapf sts: Temporary Error\x1b[0m");
errMsg("papf sts: Temporary Error");
}
if ((data_var->header.status & 0x20)) {
logMsg("\x1b[31;1mpapf sts: Specific to manufacturer Error 1\x1b[0m");
errMsg("papf sts: Specific to manufacturer Error 1");
}
if ((data_var->header.status & 0x40)) {
logMsg("\x1b[31;1mpapf sts: Specific to manufacturer Error 2\x1b[0m");
errMsg("papf sts: Specific to manufacturer Error 2");
}
if ((data_var->header.status & 0x80)) {
logMsg("\x1b[31;1mpapf sts: Specific to manufacturer Error 3\x1b[0m");
errMsg("papf sts: Specific to manufacturer Error 3");
}
mbus_data_record *record;
int i;
@ -161,7 +161,6 @@ static void parseAndPrintFrame(t_mbusCommHandle *mbusCommHandle) {
} else {
logMsg("papf err: unable to parse frame");
}
logMsg("\x1b[0m");
}