From: Ilya Rubtsov <lusyaru@gmail.com>
To: linux-bluetooth@vger.kernel.org
Subject: Re: [PATCH] Add DisableNameResolving option to main.conf
Date: Sun, 10 May 2009 08:11:34 +0400 [thread overview]
Message-ID: <4A0653F6.4020501@gmail.com> (raw)
In-Reply-To: <4A024529.90104@gmail.com>
I think I fixed coding style.. And it seems to work. And I think the
code is quite understandble now :)
diff --git a/src/adapter.c b/src/adapter.c
index 500f82f..a7a02cc 100644
--- a/src/adapter.c
+++ b/src/adapter.c
-1076,7 +1076,8 @@ static int start_inquiry(struct btd_adapter *adapter)
hci_close_dev(dd);
- adapter->state |= RESOLVE_NAME;
+ if (!main_opts.disable_nameres)
+ adapter->state |= RESOLVE_NAME;
return 0;
}
-1126,7 +1127,8 @@ static int start_periodic_inquiry(struct btd_adapter
*adapter)
hci_close_dev(dd);
- adapter->state |= RESOLVE_NAME;
+ if (!main_opts.disable_nameres)
+ adapter->state |= RESOLVE_NAME;
return 0;
}
-2446,7 +2448,8 @@ struct btd_adapter *adapter_create(DBusConnection
*conn, int id,
}
adapter->dev_id = id;
- adapter->state |= RESOLVE_NAME;
+ if (!main_opts.disable_nameres)
+ adapter->state |= RESOLVE_NAME;
adapter->path = g_strdup(path);
adapter->already_up = devup;
diff --git a/src/hcid.h b/src/hcid.h
index ae356d3..c10f65a 100644
--- a/src/hcid.h
+++ b/src/hcid.h
-59,6 +59,7 @@ struct main_opts {
uint16_t link_policy;
gboolean remember_powered;
gboolean reverse_sdp;
+ gboolean disable_nameres;
uint8_t scan;
uint8_t mode;
diff --git a/src/main.c b/src/main.c
index 08bef4a..d7d29b3 100644
--- a/src/main.c
+++ b/src/main.c
-187,6 +187,13 @@ static void parse_config(GKeyFile *config)
} else
main_opts.reverse_sdp = boolean;
+ boolean = g_key_file_get_boolean(config, "General",
+ "DisableNameResolving", &err);
+ if (err)
+ g_clear_error(&err);
+ else
+ main_opts.disable_nameres = boolean;
+
main_opts.link_mode = HCI_LM_ACCEPT;
main_opts.link_policy = HCI_LP_RSWITCH | HCI_LP_SNIFF |
diff --git a/src/main.conf b/src/main.conf
index c736e49..0c6994a 100644
--- a/src/main.conf
+++ b/src/main.conf
-46,3 +46,7 @@ RememberPowered = true
# doesn't like us doing reverse SDP for some test cases (though there
could in
# theory be other useful purposes for this too). Defaults to true.
ReverseServiceDiscovery = true
+
+# Disable name resolving after inquiry. Set it to 'true' if you don't need
+# remote devices name and want shorter discovery cycle
+DisableNameResolving = false
next prev parent reply other threads:[~2009-05-10 4:11 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-05-07 2:08 [PATCH] Add DisableNameResolving option to main.conf Ilya Rubtsov
2009-05-07 2:19 ` Ilya Rubtsov
2009-05-10 4:11 ` Ilya Rubtsov [this message]
2009-05-10 4:48 ` Ilya Rubtsov
2009-05-10 19:47 ` [PATCH] Add NameResolving " Ilya Rubtsov
2009-05-10 20:22 ` Marcel Holtmann
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4A0653F6.4020501@gmail.com \
--to=lusyaru@gmail.com \
--cc=linux-bluetooth@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox