const void *param, void *user_data)
{
struct btd_adapter *adapter = user_data;
- uint8_t action = btd_opts.experimental ? 0x01 : 0x00;
+ uint8_t action;
if (status != 0) {
error("Set Experimental Debug failed with status 0x%02x (%s)",
return;
}
- DBG("Experimental Debug successfully set");
+ action = btd_kernel_experimental_enabled(debug_uuid.str);
+
+ DBG("Experimental Debug successfully %s", action ? "set" : "reset");
if (action)
queue_push_tail(adapter->exps, (void *)debug_uuid.val);
const void *param, void *user_data)
{
struct btd_adapter *adapter = user_data;
- uint8_t action = btd_opts.experimental ? 0x01 : 0x00;
+ uint8_t action;
if (status != 0) {
error("Set RPA Resolution failed with status 0x%02x (%s)",
return;
}
- DBG("RPA Resolution successfully set");
+ action = btd_kernel_experimental_enabled(rpa_resolution_uuid.str);
+
+ DBG("RPA Resolution successfully %s", action ? "set" : "reset");
if (action)
queue_push_tail(adapter->exps, (void *)rpa_resolution_uuid.val);
const void *param, void *user_data)
{
struct btd_adapter *adapter = user_data;
- uint8_t action = btd_opts.experimental ? 0x01 : 0x00;
+ uint8_t action;
if (status != 0) {
error("Set Codec Offload failed with status 0x%02x (%s)",
return;
}
- DBG("Codec Offload successfully set");
+ action = btd_kernel_experimental_enabled(codec_offload_uuid.str);
+
+ DBG("Codec Offload successfully %s", action ? "set" : "reset");
if (action)
queue_push_tail(adapter->exps, (void *)codec_offload_uuid.val);
size_t j;
for (j = 0; j < ARRAY_SIZE(exp_table); j++) {
const struct exp_feat *feat = &exp_table[j];
+ const char *str;
uint8_t action;
if (memcmp(rp->features[i].uuid, feat->uuid->val,
sizeof(rp->features[i].uuid)))
continue;
- action = btd_experimental_enabled(feat->uuid->str);
+ str = feat->uuid->str;
+ action = btd_kernel_experimental_enabled(str);
- DBG("%s flags %u action %u", feat->uuid->str,
- rp->features[i].flags, action);
+ DBG("%s flags %u action %u", str,
+ rp->features[i].flags, action);
/* If already set don't attempt to set it again */
if (action == (rp->features[i].flags & BIT(0))) {
- if (action)
+ if (action & BIT(0))
queue_push_tail(adapter->exps,
(void *)feat->uuid->val);
continue;
"JustWorksRepairing",
"TemporaryTimeout",
"Experimental",
+ "KernelExperimental",
"RemoteNameRequestRetryDelay",
#ifdef TIZEN_FEATURE_BLUEZ_MODIFY
"EnableLEPrivacy",
return !strcasecmp(value, uuid);
}
-bool btd_experimental_enabled(const char *uuid)
+bool btd_kernel_experimental_enabled(const char *uuid)
{
- if (!btd_opts.experimental)
+ if (!btd_opts.kernel)
false;
- return queue_find(btd_opts.experimental, match_experimental, uuid);
+ return queue_find(btd_opts.kernel, match_experimental, uuid);
}
static const char *valid_uuids[] = {
"*"
};
-static void btd_parse_experimental(char **list)
+static void btd_parse_kernel_experimental(char **list)
{
int i;
- if (btd_opts.experimental) {
- warn("Unable to parse Experimental: list already set");
+ if (btd_opts.kernel) {
+ warn("Unable to parse KernelExperimental: list already set");
return;
}
- btd_opts.experimental = queue_new();
+ btd_opts.kernel = queue_new();
for (i = 0; list[i]; i++) {
size_t j;
const char *uuid = list[i];
if (!strcasecmp("false", uuid) || !strcasecmp("off", uuid)) {
- queue_destroy(btd_opts.experimental, free);
- btd_opts.experimental = NULL;
+ queue_destroy(btd_opts.kernel, free);
+ btd_opts.kernel = NULL;
}
if (!strcasecmp("true", uuid) || !strcasecmp("on", uuid))
/* Ignored if UUID is considered invalid */
if (j == ARRAY_SIZE(valid_uuids)) {
- warn("Invalid Experimental UUID: %s", uuid);
+ warn("Invalid KernelExperimental UUID: %s", uuid);
continue;
}
DBG("%s", uuid);
- queue_push_tail(btd_opts.experimental, strdup(uuid));
+ queue_push_tail(btd_opts.kernel, strdup(uuid));
}
}
else
btd_opts.refresh_discovery = boolean;
- strlist = g_key_file_get_string_list(config, "General", "Experimental",
+ boolean = g_key_file_get_boolean(config, "General", "Experimental",
+ &err);
+ if (err)
+ g_clear_error(&err);
+ else
+ btd_opts.experimental = boolean;
+
+ strlist = g_key_file_get_string_list(config, "General",
+ "KernelExperimental",
NULL, &err);
if (err)
g_clear_error(&err);
else {
- btd_parse_experimental(strlist);
+ btd_parse_kernel_experimental(strlist);
g_strfreev(strlist);
}
return TRUE;
}
-static gboolean parse_experimental(const char *key, const char *value,
+static gboolean parse_kernel_experimental(const char *key, const char *value,
gpointer user_data, GError **error)
{
char **strlist;
if (value) {
strlist = g_strsplit(value, ",", -1);
- btd_parse_experimental(strlist);
+ btd_parse_kernel_experimental(strlist);
g_strfreev(strlist);
} else {
- if (!btd_opts.experimental)
- btd_opts.experimental = queue_new();
- queue_push_head(btd_opts.experimental, strdup("*"));
+ if (!btd_opts.kernel)
+ btd_opts.kernel = queue_new();
+ queue_push_head(btd_opts.kernel, strdup("*"));
}
return TRUE;
"Specify an explicit path to the config file", "FILE"},
{ "compat", 'C', 0, G_OPTION_ARG_NONE, &option_compat,
"Provide deprecated command line interfaces" },
- { "experimental", 'E', G_OPTION_FLAG_OPTIONAL_ARG,
- G_OPTION_ARG_CALLBACK, parse_experimental,
- "Enable experimental features/interfaces" },
+ { "experimental", 'E', 0, G_OPTION_ARG_NONE, &btd_opts.experimental,
+ "Enable experimental D-Bus interfaces" },
+ { "kernel", 'K', G_OPTION_FLAG_OPTIONAL_ARG, G_OPTION_ARG_CALLBACK,
+ parse_kernel_experimental,
+ "Enable kernel experimental features" },
{ "nodetach", 'n', G_OPTION_FLAG_REVERSE,
G_OPTION_ARG_NONE, &option_detach,
"Run with logging in foreground" },
if (btd_opts.mode != BT_MODE_LE)
stop_sdp_server();
- if (btd_opts.experimental)
- queue_destroy(btd_opts.experimental, free);
+ if (btd_opts.kernel)
+ queue_destroy(btd_opts.kernel, free);
#ifdef TIZEN_FEATURE_BLUEZ_MODIFY
g_free(btd_opts.pin_code);
#endif