struct authentication_req *auth;
int err;
+ /* Just-Works repairing policy */
+ if (confirm_hint && device_is_paired(device, type)) {
+ if (main_opts.jw_repairing == JW_REPAIRING_NEVER) {
+ btd_adapter_confirm_reply(device->adapter,
+ &device->bdaddr,
+ type, FALSE);
+ return 0;
+ } else if (main_opts.jw_repairing == JW_REPAIRING_ALWAYS) {
+ btd_adapter_confirm_reply(device->adapter,
+ &device->bdaddr,
+ type, TRUE);
+ return 0;
+ }
+ }
+
auth = new_auth(device, type, AUTH_TYPE_CONFIRM, FALSE);
if (!auth)
return -EPERM;
"MultiProfile",
"FastConnectable",
"Privacy",
+ "JustWorksRepairing",
#ifdef TIZEN_FEATURE_BLUEZ_MODIFY
"EnableLEPrivacy",
"PinCode",
}
}
+static enum jw_repairing_t parse_jw_repairing(const char *jw_repairing)
+{
+ if (!strcmp(jw_repairing, "never")) {
+ return JW_REPAIRING_NEVER;
+ } else if (!strcmp(jw_repairing, "confirm")) {
+ return JW_REPAIRING_CONFIRM;
+ } else if (!strcmp(jw_repairing, "always")) {
+ return JW_REPAIRING_ALWAYS;
+ } else {
+ return JW_REPAIRING_NEVER;
+ }
+}
+
+
static void check_options(GKeyFile *config, const char *group,
const char **options)
{
g_free(str);
}
+ str = g_key_file_get_string(config, "General",
+ "JustWorksRepairing", &err);
+ if (err) {
+ DBG("%s", err->message);
+ g_clear_error(&err);
+ main_opts.jw_repairing = JW_REPAIRING_NEVER;
+ } else {
+ DBG("just_works_repairing=%s", str);
+ main_opts.jw_repairing = parse_jw_repairing(str);
+ g_free(str);
+ }
+
str = g_key_file_get_string(config, "General", "Name", &err);
if (err) {
DBG("%s", err->message);
# Defaults to "off"
# Privacy = off
+# Specify the policy to the JUST-WORKS repairing initiated by peer
+# Possible values: "never", "confirm", "always"
+# Defaults to "never"
+#JustWorksRepairing = never
+
[GATT]
# GATT attribute cache.
# Possible values: