From 73a9e627efef661c6ba7a2e62f8aac4728bf0eef Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Sun, 20 Oct 2013 14:27:28 -0700 Subject: [PATCH] monitor: Add command for extracting missing decodings --- monitor/main.c | 4 ++++ monitor/packet.c | 33 +++++++++++++++++++++++++++++++++ monitor/packet.h | 2 ++ 3 files changed, 39 insertions(+) diff --git a/monitor/main.c b/monitor/main.c index e72b240ab..aed9b03e5 100644 --- a/monitor/main.c +++ b/monitor/main.c @@ -70,6 +70,7 @@ static const struct option main_options[] = { { "time", no_argument, NULL, 't' }, { "date", no_argument, NULL, 'T' }, { "sco", no_argument, NULL, 'S' }, + { "todo", no_argument, NULL, '#' }, { "version", no_argument, NULL, 'v' }, { "help", no_argument, NULL, 'h' }, { } @@ -126,6 +127,9 @@ int main(int argc, char *argv[]) case 'S': filter_mask |= PACKET_FILTER_SHOW_SCO_DATA; break; + case '#': + packet_todo(); + return EXIT_SUCCESS; case 'v': printf("%s\n", VERSION); return EXIT_SUCCESS; diff --git a/monitor/packet.c b/monitor/packet.c index 212ccc6c3..65ead26f3 100644 --- a/monitor/packet.c +++ b/monitor/packet.c @@ -6574,3 +6574,36 @@ void packet_hci_scodata(struct timeval *tv, uint16_t index, bool in, if (filter_mask & PACKET_FILTER_SHOW_SCO_DATA) packet_hexdump(data, size); } + +void packet_todo(void) +{ + int i; + + printf("HCI commands with missing decodings:\n"); + + for (i = 0; opcode_table[i].str; i++) { + if (opcode_table[i].bit < 0) + continue; + + if (opcode_table[i].cmd_func) + continue; + + printf("\t%s\n", opcode_table[i].str); + } + + printf("HCI events with missing decodings:\n"); + + for (i = 0; event_table[i].str; i++) { + if (event_table[i].func) + continue; + + printf("\t%s\n", event_table[i].str); + } + + for (i = 0; subevent_table[i].str; i++) { + if (subevent_table[i].func) + continue; + + printf("\t%s\n", subevent_table[i].str); + } +} diff --git a/monitor/packet.h b/monitor/packet.h index 07c1ec393..d44849c94 100644 --- a/monitor/packet.h +++ b/monitor/packet.h @@ -67,3 +67,5 @@ void packet_hci_acldata(struct timeval *tv, uint16_t index, bool in, const void *data, uint16_t size); void packet_hci_scodata(struct timeval *tv, uint16_t index, bool in, const void *data, uint16_t size); + +void packet_todo(void); -- 2.47.3