summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2008-12-17 20:55:22 +0100
committerMarcel Holtmann <marcel@holtmann.org>2008-12-17 20:55:22 +0100
commitff58ff2df51c81f7c9a20d4ea0f10ddb7192ab4f (patch)
tree7234f6093e27ca1f4d5cd3851b4607871275e93b
parentb2b736c38f02704d225680fd0541936e36a73e82 (diff)
Add configuration option for DeviceID and do some cleanup
-rw-r--r--src/main.c32
-rw-r--r--src/main.conf10
2 files changed, 24 insertions, 18 deletions
diff --git a/src/main.c b/src/main.c
index 93a37dd2..2af5606d 100644
--- a/src/main.c
+++ b/src/main.c
@@ -104,8 +104,7 @@ static void parse_config(GKeyFile *config)
debug("parsing main.conf");
val = g_key_file_get_integer(config, "General",
- "DiscoverableTimeout",
- &err);
+ "DiscoverableTimeout", &err);
if (err) {
debug("%s", err->message);
g_clear_error(&err);
@@ -116,8 +115,7 @@ static void parse_config(GKeyFile *config)
}
val = g_key_file_get_integer(config, "General",
- "PairableTimeout",
- &err);
+ "PairableTimeout", &err);
if (err) {
debug("%s", err->message);
g_clear_error(&err);
@@ -126,9 +124,7 @@ static void parse_config(GKeyFile *config)
main_opts.pairto = val;
}
- val = g_key_file_get_integer(config, "General",
- "PageTimeout",
- &err);
+ val = g_key_file_get_integer(config, "General", "PageTimeout", &err);
if (err) {
debug("%s", err->message);
g_clear_error(&err);
@@ -138,8 +134,7 @@ static void parse_config(GKeyFile *config)
main_opts.flags |= 1 << HCID_SET_PAGETO;
}
- str = g_key_file_get_string(config, "General",
- "Name", &err);
+ str = g_key_file_get_string(config, "General", "Name", &err);
if (err) {
debug("%s", err->message);
g_clear_error(&err);
@@ -151,8 +146,7 @@ static void parse_config(GKeyFile *config)
g_free(str);
}
- str = g_key_file_get_string(config, "General",
- "Class", &err);
+ str = g_key_file_get_string(config, "General", "Class", &err);
if (err) {
debug("%s", err->message);
g_clear_error(&err);
@@ -164,8 +158,7 @@ static void parse_config(GKeyFile *config)
}
val = g_key_file_get_integer(config, "General",
- "DiscoverSchedulerInterval",
- &err);
+ "DiscoverSchedulerInterval", &err);
if (err) {
debug("%s", err->message);
g_clear_error(&err);
@@ -175,14 +168,23 @@ static void parse_config(GKeyFile *config)
}
boolean = g_key_file_get_boolean(config, "General",
- "InitiallyPowered",
- &err);
+ "InitiallyPowered", &err);
if (err) {
debug("%s", err->message);
g_clear_error(&err);
} else if (boolean == FALSE)
main_opts.mode = MODE_OFF;
+ str = g_key_file_get_string(config, "General", "DeviceID", &err);
+ if (err) {
+ debug("%s", err->message);
+ g_clear_error(&err);
+ } else {
+ debug("deviceid=%s", str);
+ strncpy(main_opts.deviceid, str, sizeof(main_opts.deviceid));
+ g_free(str);
+ }
+
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 b3b6a383..a7bb0e40 100644
--- a/src/main.conf
+++ b/src/main.conf
@@ -9,7 +9,7 @@
Name = %h-%d
# Default device class. Only the major and minor device class bits are
-# considered
+# considered.
Class = 0x000100
# How long to stay in discoverable mode before going back to non-discoverable
@@ -23,13 +23,17 @@ DiscoverableTimeout = 0
PairableTimeout = 0
# Use some other page timeout than the controller default one
-# (16384 = 10 seconds)
+# which is 16384 (10 seconds).
PageTimeout = 8192
# Discover scheduler interval used in Adapter.DiscoverDevices
-# The value is in seconds. Defaults is 0 to use controller scheduler
+# The value is in seconds. Defaults is 0 to use controller scheduler.
DiscoverSchedulerInterval = 0
# What value should be assumed for the adapter Powered property when
# SetProperty(Powered, ...) hasn't been called yet. Defaults to true
InitiallyPowered = true
+
+# Use vendor, product and version information for DID profile support.
+# The values are separated by ":" and VID, PID and version.
+#DeviceID = 1234:5678:abcd