From e5228553a27d12f37fa4cab904f8259221036ef1 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Sat, 7 Dec 2013 06:49:45 -0800 Subject: [PATCH] monitor: Highlight unknown HCI error codes --- monitor/packet.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/monitor/packet.c b/monitor/packet.c index 24e6e49e6..5bc662baf 100644 --- a/monitor/packet.c +++ b/monitor/packet.c @@ -66,6 +66,7 @@ #define COLOR_HCI_ACLDATA COLOR_CYAN #define COLOR_HCI_SCODATA COLOR_YELLOW +#define COLOR_UNKNOWN_ERROR COLOR_WHITE_BG #define COLOR_UNKNOWN_FEATURE_BIT COLOR_WHITE_BG #define COLOR_UNKNOWN_EVENT_MASK COLOR_WHITE_BG #define COLOR_UNKNOWN_LE_STATES COLOR_WHITE_BG @@ -352,19 +353,24 @@ static void print_error(const char *label, uint8_t error) { const char *str = "Unknown"; const char *color_on, *color_off; + bool unknown = true; int i; for (i = 0; error2str_table[i].str; i++) { if (error2str_table[i].error == error) { str = error2str_table[i].str; + unknown = false; break; } } if (use_color()) { - if (error) - color_on = COLOR_RED; - else + if (error) { + if (unknown) + color_on = COLOR_UNKNOWN_ERROR; + else + color_on = COLOR_RED; + } else color_on = COLOR_GREEN; color_off = COLOR_OFF; } else { -- 2.47.3