Re: [PATCH v3 4/4] core: Add support for Multi Profile Specification

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Szymon,

> This adds new main.conf configure option named MultiProfile. It allows
> to enable MPSD and MPMD scenarios for MPS. By default MPS is disabled.
> ---
> V3: - fixed string checks when parsing option
>    - added MultiProfile to list of known options
> 
> src/main.c    | 23 +++++++++++++++++++++++
> src/main.conf |  5 +++++
> 2 files changed, 28 insertions(+)
> 
> diff --git a/src/main.c b/src/main.c
> index b3140d0..0af3ed9 100644
> --- a/src/main.c
> +++ b/src/main.c
> @@ -69,6 +69,9 @@
> struct main_opts main_opts;
> static GKeyFile *main_conf;
> 
> +static bool mps_mpsd = false;
> +static bool mps_mpmd = false;
> +
> static const char * const supported_options[] = {
> 	"Name",
> 	"Class",
> @@ -81,6 +84,7 @@ static const char * const supported_options[] = {
> 	"NameResolving",
> 	"DebugKeys",
> 	"ControllerMode",
> +	"MultiProfile",
> };
> 
> GKeyFile *btd_get_main_conf(void)
> @@ -307,6 +311,22 @@ 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, "mpsd")) {
> +			mps_mpsd = true;
> +		} else if (!strcmp(str, "mpmd")) {
> +			mps_mpsd = true;
> +			mps_mpmd = true;
> +		}
> +
> +		g_free(str);
> +	}
> }
> 
> static void init_defaults(void)
> @@ -599,6 +619,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_mpsd)
> +		register_mps(mps_mpmd);
> +
> 	/* 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..a8f37f0 100644
> --- a/src/main.conf
> +++ b/src/main.conf
> @@ -52,6 +52,11 @@
> # Possible values: "dual", "bredr", "le"
> #ControllerMode = dual
> 
> +# Enables Multi Profile Specification support. This allows to specify if
> +# system supports only MPSD or both MPSD/MPMD scenarios.
> +# Possible values: "mpsd", "mpmd"
> +#MultiProfile = mpsd
> +

actually the commented out entry should be the default. So you need off, mpsd and mpmd here. However since these stand for single device and multiple device, then why not actually name it in plain English.

So "off", "single" and "multiple" with "off" being the default. And then have the text refer to Multiple Profile Single Device (MPSD) and Multiple Profile Multiple Devices (MPMD). So that specification readers know what each option maps to.

Regards

Marcel

--
To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux