summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJohan Hedberg <johan.hedberg@nokia.com>2009-01-13 18:23:07 +0200
committerJohan Hedberg <johan.hedberg@nokia.com>2009-01-13 18:23:07 +0200
commitbdf140bd02cee6c39ebb8c6d71ac1d4f6f7eaa07 (patch)
treea73ed295c4848a2793e950347f70242cbab57b15 /src
parent8f159d4498f549b0f9ecad9ef4147847f0583ebb (diff)
Add ReverseServiceDiscovery config option
This option is solely for qualification since the BITE tester in its grand braindeadness doesn't like use doing reverse SDP.
Diffstat (limited to 'src')
-rw-r--r--src/device.c3
-rw-r--r--src/hcid.h1
-rw-r--r--src/main.c9
3 files changed, 12 insertions, 1 deletions
diff --git a/src/device.c b/src/device.c
index d9af8d03..b920d5a2 100644
--- a/src/device.c
+++ b/src/device.c
@@ -1836,7 +1836,8 @@ void device_bonding_complete(struct btd_device *device, uint8_t status)
device_browse(device, bonding->conn, bonding->msg,
NULL, FALSE);
- } else if (!device->discov_active && !device->discov_timer) {
+ } else if (!device->discov_active && !device->discov_timer &&
+ main_opts.reverse_sdp) {
/* If we are not initiators and there is no currently active
* discovery or discovery timer, set the discovery timer */
debug("setting timer for reverse service discovery");
diff --git a/src/hcid.h b/src/hcid.h
index 7337efff..6c26157c 100644
--- a/src/hcid.h
+++ b/src/hcid.h
@@ -56,6 +56,7 @@ struct main_opts {
uint16_t link_mode;
uint16_t link_policy;
gboolean remember_powered;
+ gboolean reverse_sdp;
uint8_t scan;
uint8_t mode;
diff --git a/src/main.c b/src/main.c
index 90ae110c..638300f6 100644
--- a/src/main.c
+++ b/src/main.c
@@ -193,6 +193,14 @@ static void parse_config(GKeyFile *config)
g_free(str);
}
+ boolean = g_key_file_get_boolean(config, "General",
+ "ReverseServiceDiscovery", &err);
+ if (err) {
+ g_clear_error(&err);
+ } else
+ main_opts.reverse_sdp = boolean;
+
+
main_opts.link_mode = HCI_LM_ACCEPT;
main_opts.link_policy = HCI_LP_RSWITCH | HCI_LP_SNIFF |
@@ -545,6 +553,7 @@ static void init_defaults(void)
main_opts.name = g_strdup("BlueZ");
main_opts.discovto = HCID_DEFAULT_DISCOVERABLE_TIMEOUT;
main_opts.remember_powered = TRUE;
+ main_opts.reverse_sdp = TRUE;
if (gethostname(main_opts.host_name, sizeof(main_opts.host_name) - 1) < 0)
strcpy(main_opts.host_name, "noname");