Diff between d4faea365ee0b2f6491866a7442e66d10ca5f069 and b116b6babb24ae5ae0f61813b00c7b7db86d2836

Changed Files

File Additions Deletions Status
tools/btmgmt.c +12 -0 modified

Full Patch

diff --git a/tools/btmgmt.c b/tools/btmgmt.c
index 45bf4c3..3326a46 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;
 }