From 14306b99b4ff8a6766540fecb3d2ac05430e6859 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Wed, 2 Jul 2014 21:49:53 +0200 Subject: [PATCH] tools: Monitor the Unconfigured Index Added/Removed events --- tools/btmgmt.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/tools/btmgmt.c b/tools/btmgmt.c index 066fde9af..720229cb6 100644 --- a/tools/btmgmt.c +++ b/tools/btmgmt.c @@ -84,6 +84,20 @@ static void index_removed(uint16_t index, uint16_t len, printf("hci%u removed\n", index); } +static void unconf_index_added(uint16_t index, uint16_t len, + const void *param, void *user_data) +{ + if (monitor) + printf("hci%u added (unconfigured)\n", index); +} + +static void unconf_index_removed(uint16_t index, uint16_t len, + const void *param, void *user_data) +{ + if (monitor) + printf("hci%u removed (unconfigured)\n", index); +} + static const char *settings_str[] = { "powered", "connectable", @@ -2786,6 +2800,10 @@ int main(int argc, char *argv[]) request_passkey, mgmt, NULL); mgmt_register(mgmt, MGMT_EV_PASSKEY_NOTIFY, index, passkey_notify, mgmt, NULL); + mgmt_register(mgmt, MGMT_EV_UNCONF_INDEX_ADDED, index, + unconf_index_added, NULL, NULL); + mgmt_register(mgmt, MGMT_EV_UNCONF_INDEX_REMOVED, index, + unconf_index_removed, NULL, NULL); exit_status = mainloop_run(); -- 2.47.3