Diff between f73aadc8c5fac4216fb78702a4fd1dab92e3f62c and 606b5e7054bbb5128f2fe000c2736efe475f2b9f

Changed Files

File Additions Deletions Status
src/main.c +24 -0 modified
src/main.conf +7 -0 modified

Full Patch

diff --git a/src/main.c b/src/main.c
index b3140d0..05eb13d 100644
--- a/src/main.c
+++ b/src/main.c
@@ -69,6 +69,12 @@
 struct main_opts main_opts;
 static GKeyFile *main_conf;
 
+static enum {
+	MPS_OFF,
+	MPS_SINGLE,
+	MPS_MULTIPLE,
+} mps = MPS_OFF;
+
 static const char * const supported_options[] = {
 	"Name",
 	"Class",
@@ -81,6 +87,7 @@ static const char * const supported_options[] = {
 	"NameResolving",
 	"DebugKeys",
 	"ControllerMode",
+	"MultiProfile",
 };
 
 GKeyFile *btd_get_main_conf(void)
@@ -307,6 +314,20 @@ static void parse_config(GKeyFile *config)
 		main_opts.mode = get_mode(str);
 		g_free(str);
 	}
+
+	str = g_key_file_get_string(config, "General", "MultiProfile", &err);
+	if (err) {
+		g_clear_error(&err);
+	} else {
+		DBG("MultiProfile=%s", str);
+
+		if (!strcmp(str, "single"))
+			mps = MPS_SINGLE;
+		else if (!strcmp(str, "multiple"))
+			mps = MPS_MULTIPLE;
+
+		g_free(str);
+	}
 }
 
 static void init_defaults(void)
@@ -599,6 +620,9 @@ int main(int argc, char *argv[])
 		register_device_id(main_opts.did_source, main_opts.did_vendor,
 				main_opts.did_product, main_opts.did_version);
 
+	if (mps != MPS_OFF)
+		register_mps(mps == MPS_MULTIPLE);
+
 	/* Loading plugins has to be done after D-Bus has been setup since
 	 * the plugins might wanna expose some paths on the bus. However the
 	 * best order of how to init various subsystems of the Bluetooth
diff --git a/src/main.conf b/src/main.conf
index d4d6ab0..9be90af 100644
--- a/src/main.conf
+++ b/src/main.conf
@@ -52,6 +52,13 @@
 # Possible values: "dual", "bredr", "le"
 #ControllerMode = dual
 
+# Enables Multi Profile Specification support. This allows to specify if
+# system supports only Multiple Profiles Single Device (MPSD) configuration
+# or both Multiple Profiles Single Device (MPSD) and Multiple Profiles Multiple
+# Devices (MPMD) configurations.
+# Possible values: "off", "single", "multiple"
+#MultiProfile = off
+
 #[Policy]
 #
 # The ReconnectUUIDs defines the set of remote services that should try