diff --git a/monitor/display.h b/monitor/display.h
index df08362..4ce5d35 100644
--- a/monitor/display.h
+++ b/monitor/display.h
#define COLOR_WHITE_BG "\x1B[0;47;30m"
#define COLOR_HIGHLIGHT "\x1B[1;39m"
+#define COLOR_WARN "\x1B[1;30m"
#define COLOR_ERROR "\x1B[1;31m"
#define FALLBACK_TERMINAL_WIDTH 80
diff --git a/monitor/packet.c b/monitor/packet.c
index 53a1392..cfced16 100644
--- a/monitor/packet.c
+++ b/monitor/packet.c
return NULL;
}
+static const char *current_vendor_str(void)
+{
+ uint16_t manufacturer;
+
+ if (index_current < MAX_INDEX)
+ manufacturer = index_list[index_current].manufacturer;
+ else
+ manufacturer = UNKNOWN_MANUFACTURER;
+
+ switch (manufacturer) {
+ case 2:
+ return "Intel";
+ case 15:
+ return "Broadcom";
+ }
+
+ return NULL;
+}
+
static const struct vendor_ocf *current_vendor_ocf(uint16_t ocf)
{
uint16_t manufacturer;
struct opcode_data vendor_data;
const struct opcode_data *opcode_data = NULL;
const char *opcode_color, *opcode_str;
+ char vendor_str[150];
int i;
for (i = 0; opcode_table[i].str; i++) {
const struct vendor_ocf *vnd = current_vendor_ocf(ocf);
if (vnd) {
- vendor_data.str = vnd->str;
+ const char *str = current_vendor_str();
+
+ if (str) {
+ snprintf(vendor_str, sizeof(vendor_str),
+ "%s %s", str, vnd->str);
+ vendor_data.str = vendor_str;
+ } else
+ vendor_data.str = vnd->str;
vendor_data.rsp_func = vnd->rsp_func;
vendor_data.rsp_size = vnd->rsp_size;
vendor_data.rsp_fixed = vnd->rsp_fixed;
uint16_t ocf = cmd_opcode_ocf(opcode);
const struct opcode_data *opcode_data = NULL;
const char *opcode_color, *opcode_str;
+ char vendor_str[150];
int i;
for (i = 0; opcode_table[i].str; i++) {
opcode_str = opcode_data->str;
} else {
if (ogf == 0x3f) {
- opcode_color = COLOR_HCI_COMMAND;
- opcode_str = "Vendor";
+ const struct vendor_ocf *vnd = current_vendor_ocf(ocf);
+
+ if (vnd) {
+ const char *str = current_vendor_str();
+
+ if (str) {
+ snprintf(vendor_str, sizeof(vendor_str),
+ "%s %s", str, vnd->str);
+ opcode_str = vendor_str;
+ } else
+ opcode_str = vnd->str;
+
+ opcode_color = COLOR_HCI_COMMAND;
+ } else {
+ opcode_color = COLOR_HCI_COMMAND;
+ opcode_str = "Vendor";
+ }
} else {
opcode_color = COLOR_HCI_COMMAND_UNKNOWN;
opcode_str = "Unknown";
struct opcode_data vendor_data;
const struct opcode_data *opcode_data = NULL;
const char *opcode_color, *opcode_str;
- char extra_str[25];
+ char extra_str[25], vendor_str[150];
int i;
if (size < HCI_COMMAND_HDR_SIZE) {
const struct vendor_ocf *vnd = current_vendor_ocf(ocf);
if (vnd) {
- vendor_data.str = vnd->str;
+ const char *str = current_vendor_str();
+
+ if (str) {
+ snprintf(vendor_str, sizeof(vendor_str),
+ "%s %s", str, vnd->str);
+ vendor_data.str = vendor_str;
+ } else
+ vendor_data.str = vnd->str;
vendor_data.cmd_func = vnd->cmd_func;
vendor_data.cmd_size = vnd->cmd_size;
vendor_data.cmd_fixed = vnd->cmd_fixed;