From b116b6babb24ae5ae0f61813b00c7b7db86d2836 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Thu, 25 Sep 2014 15:11:38 +0200 Subject: [PATCH] tools: For testing purposes also initialize shared GAP support --- tools/btmgmt.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/tools/btmgmt.c b/tools/btmgmt.c index 45bf4c346..3326a46f6 100644 --- a/tools/btmgmt.c +++ b/tools/btmgmt.c @@ -48,6 +48,7 @@ #include "monitor/mainloop.h" #include "src/shared/util.h" #include "src/shared/mgmt.h" +#include "src/shared/gap.h" static bool monitor = false; static bool discovery = false; @@ -2894,6 +2895,10 @@ static struct { { } }; +static void gap_ready(bool status, void *user_data) +{ +} + static void usage(void) { int i; @@ -2925,6 +2930,7 @@ static struct option main_options[] = { int main(int argc, char *argv[]) { + struct bt_gap *gap; int opt, i; uint16_t index = MGMT_INDEX_NONE; struct mgmt *mgmt; @@ -2961,6 +2967,10 @@ int main(int argc, char *argv[]) mainloop_init(); + gap = bt_gap_new(); + + bt_gap_set_ready_handler(gap, gap_ready, NULL, NULL); + mgmt = mgmt_new_default(); if (!mgmt) { fprintf(stderr, "Unable to open mgmt_socket\n"); @@ -3026,5 +3036,7 @@ int main(int argc, char *argv[]) mgmt_unregister_all(mgmt); mgmt_unref(mgmt); + bt_gap_unref(gap); + return exit_status; } -- 2.47.3