Diff between eb0928eaa91f18c49e8e4deb3d4a50cd818d63e1 and 7facee2446c734ed9e2c77dca68b7bab4418cd3d

Changed Files

File Additions Deletions Status
lib/mgmt.h +45 -0 modified
monitor/control.c +1 -0 modified
src/mgmt.c +0 -45 modified
src/shared/mgmt.c +1 -0 modified
tools/mgmt-tester.c +1 -0 modified

Full Patch

diff --git a/lib/mgmt.h b/lib/mgmt.h
index e28005e..f888220 100644
--- a/lib/mgmt.h
+++ b/lib/mgmt.h
@@ -570,3 +570,48 @@ static inline const char *mgmt_errstr(uint8_t status)
 		return "<unknown status>";
 	return mgmt_status[status];
 }
+
+static inline bool mgmt_powered(uint32_t settings)
+{
+	return (settings & MGMT_SETTING_POWERED);
+}
+
+static inline bool mgmt_connectable(uint32_t settings)
+{
+	return (settings & MGMT_SETTING_CONNECTABLE);
+}
+
+static inline bool mgmt_fast_connectable(uint32_t settings)
+{
+	return (settings & MGMT_SETTING_FAST_CONNECTABLE);
+}
+
+static inline bool mgmt_discoverable(uint32_t settings)
+{
+	return (settings & MGMT_SETTING_DISCOVERABLE);
+}
+
+static inline bool mgmt_pairable(uint32_t settings)
+{
+	return (settings & MGMT_SETTING_PAIRABLE);
+}
+
+static inline bool mgmt_ssp(uint32_t settings)
+{
+	return (settings & MGMT_SETTING_SSP);
+}
+
+static inline int mgmt_bredr(uint32_t settings)
+{
+	return (settings & MGMT_SETTING_BREDR) != 0;
+}
+
+static inline int mgmt_high_speed(uint32_t settings)
+{
+	return (settings & MGMT_SETTING_HS) != 0;
+}
+
+static inline int mgmt_low_energy(uint32_t settings)
+{
+	return (settings & MGMT_SETTING_LE) != 0;
+}
diff --git a/monitor/control.c b/monitor/control.c
index 9b76038..021409b 100644
--- a/monitor/control.c
+++ b/monitor/control.c
@@ -27,6 +27,7 @@
 #endif
 
 #include <stdio.h>
+#include <stdbool.h>
 #include <errno.h>
 #include <unistd.h>
 #include <stdlib.h>
diff --git a/src/mgmt.c b/src/mgmt.c
index 08bceb3..1a22982 100644
--- a/src/mgmt.c
+++ b/src/mgmt.c
@@ -297,51 +297,6 @@ static int mgmt_set_low_energy(int index, gboolean le)
 	return mgmt_set_mode(index, MGMT_OP_SET_LE, le);
 }
 
-static inline int mgmt_powered(uint32_t settings)
-{
-	return (settings & MGMT_SETTING_POWERED) != 0;
-}
-
-static inline int mgmt_connectable(uint32_t settings)
-{
-	return (settings & MGMT_SETTING_CONNECTABLE) != 0;
-}
-
-static inline int mgmt_fast_connectable(uint32_t settings)
-{
-	return (settings & MGMT_SETTING_FAST_CONNECTABLE) != 0;
-}
-
-static inline int mgmt_discoverable(uint32_t settings)
-{
-	return (settings & MGMT_SETTING_DISCOVERABLE) != 0;
-}
-
-static inline int mgmt_pairable(uint32_t settings)
-{
-	return (settings & MGMT_SETTING_PAIRABLE) != 0;
-}
-
-static inline int mgmt_ssp(uint32_t settings)
-{
-	return (settings & MGMT_SETTING_SSP) != 0;
-}
-
-static inline int mgmt_bredr(uint32_t settings)
-{
-	return (settings & MGMT_SETTING_BREDR) != 0;
-}
-
-static inline int mgmt_high_speed(uint32_t settings)
-{
-	return (settings & MGMT_SETTING_HS) != 0;
-}
-
-static inline int mgmt_low_energy(uint32_t settings)
-{
-	return (settings & MGMT_SETTING_LE) != 0;
-}
-
 static void update_settings(struct btd_adapter *adapter, uint32_t settings)
 {
 	DBG("new settings 0x%08x", settings);
diff --git a/src/shared/mgmt.c b/src/shared/mgmt.c
index 8fb7aa7..de63ae7 100644
--- a/src/shared/mgmt.c
+++ b/src/shared/mgmt.c
@@ -27,6 +27,7 @@
 
 #include <stdio.h>
 #include <unistd.h>
+#include <stdbool.h>
 
 #include <glib.h>
 
diff --git a/tools/mgmt-tester.c b/tools/mgmt-tester.c
index e91e078..4117e8c 100644
--- a/tools/mgmt-tester.c
+++ b/tools/mgmt-tester.c
@@ -26,6 +26,7 @@
 #endif
 
 #include <stdlib.h>
+#include <stdbool.h>
 
 #include "lib/bluetooth.h"
 #include "lib/mgmt.h"