Re: [PATCH BlueZ 2/3] core: Add DisableProfiles entry to main.conf

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

 



Hi Luiz,

>>> This entry can be used to globally disable profiles, this is specially
>>> useful for qualification purposes where some platforms may decide to
>>> only qualify a subset of the supported profiles.
>>> ---
>>> src/hcid.h    |  1 +
>>> src/main.c    | 10 ++++++++++
>>> src/main.conf |  4 ++++
>>> src/profile.c | 24 ++++++++++++++++++++++++
>>> 4 files changed, 39 insertions(+)
>>> 
>>> diff --git a/src/hcid.h b/src/hcid.h
>>> index ea67cc2..f465a2b 100644
>>> --- a/src/hcid.h
>>> +++ b/src/hcid.h
>>> @@ -32,6 +32,7 @@ struct main_opts {
>>>      gboolean        reverse_sdp;
>>>      gboolean        name_resolv;
>>>      gboolean        debug_keys;
>>> +     char            **disabled_profiles;
>>> 
>>>      uint16_t        did_source;
>>>      uint16_t        did_vendor;
>>> diff --git a/src/main.c b/src/main.c
>>> index 1e40ebc..933c20f 100644
>>> --- a/src/main.c
>>> +++ b/src/main.c
>>> @@ -76,6 +76,7 @@ static const char * const supported_options[] = {
>>>      "ReverseServiceDiscovery",
>>>      "NameResolving",
>>>      "DebugKeys",
>>> +     "DisableProfiles"
>>> };
>>> 
>>> static GKeyFile *load_config(const char *file)
>>> @@ -263,6 +264,15 @@ static void parse_config(GKeyFile *config)
>>>              g_clear_error(&err);
>>>      else
>>>              main_opts.debug_keys = boolean;
>>> +
>>> +     str = g_key_file_get_string(config, "General", "DisableProfiles", &err);
>>> +     if (err) {
>>> +             DBG("%s", err->message);
>>> +             g_clear_error(&err);
>>> +     } else {
>>> +             main_opts.disabled_profiles = g_strsplit(str, " ", -1);
>>> +             g_free(str);
>>> +     }
>>> }
>> 
>> I am not a huge fan of adding this one back. Do we really need it?
> 
> This is for profiles we used to have for plugins but they are not 1:1
> to profiles so -p/-P may not be enough, we could instead take as
> command line option but 128 bit UUID sounds a little too messy to pass
> in the command line. Mikel also comment about having this to block
> external process to register profiles, maybe it is a good idea since
> we don't have to create a similar mechanism to other components such
> as obexd, oFono and PulseAudio just to disable certain roles.

can we at least then make it part of src/profile.c directly and not try to hack it in this way. I mean like after reading the config file, let it tell src/profile.c which profiles are blacklisted.

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