summaryrefslogtreecommitdiff
path: root/monitor/control.c
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2015-03-14 16:58:21 -0700
committerMarcel Holtmann <marcel@holtmann.org>2015-03-14 16:58:21 -0700
commit31f06402630437312679131de83b219511d8469d (patch)
tree069c485f4b54ce4f24aa0fc0791fd8b810e7a5b0 /monitor/control.c
parent07b028e5f210a857e43e7025bd60b79b1052d1ff (diff)
downloadbluez-31f06402630437312679131de83b219511d8469d.tar.gz
monitor: Add decoding for extended index control messages
Diffstat (limited to 'monitor/control.c')
-rw-r--r--monitor/control.c40
1 files changed, 40 insertions, 0 deletions
diff --git a/monitor/control.c b/monitor/control.c
index 44cc1daf9..f2698fbef 100644
--- a/monitor/control.c
+++ b/monitor/control.c
@@ -97,6 +97,40 @@ static void mgmt_unconf_index_removed(uint16_t len, const void *buf)
packet_hexdump(buf, len);
}
+static void mgmt_ext_index_added(uint16_t len, const void *buf)
+{
+ const struct mgmt_ev_ext_index_added *ev = buf;
+
+ if (len < sizeof(*ev)) {
+ printf("* Malformed Extended Index Added control\n");
+ return;
+ }
+
+ printf("@ Extended Index Added: %u (%u)\n", ev->type, ev->bus);
+
+ buf += sizeof(*ev);
+ len -= sizeof(*ev);
+
+ packet_hexdump(buf, len);
+}
+
+static void mgmt_ext_index_removed(uint16_t len, const void *buf)
+{
+ const struct mgmt_ev_ext_index_removed *ev = buf;
+
+ if (len < sizeof(*ev)) {
+ printf("* Malformed Extended Index Removed control\n");
+ return;
+ }
+
+ printf("@ Extended Index Removed: %u (%u)\n", ev->type, ev->bus);
+
+ buf += sizeof(*ev);
+ len -= sizeof(*ev);
+
+ packet_hexdump(buf, len);
+}
+
static void mgmt_controller_error(uint16_t len, const void *buf)
{
const struct mgmt_ev_controller_error *ev = buf;
@@ -794,6 +828,12 @@ void control_message(uint16_t opcode, const void *data, uint16_t size)
case MGMT_EV_NEW_CONFIG_OPTIONS:
mgmt_new_config_options(size, data);
break;
+ case MGMT_EV_EXT_INDEX_ADDED:
+ mgmt_ext_index_added(size, data);
+ break;
+ case MGMT_EV_EXT_INDEX_REMOVED:
+ mgmt_ext_index_removed(size, data);
+ break;
default:
printf("* Unknown control (code %d len %d)\n", opcode, size);
packet_hexdump(data, size);