summaryrefslogtreecommitdiffstats
path: root/src/modules/bluetooth/module-bluetooth-device.c
diff options
context:
space:
mode:
authorDaniel Mack <daniel@caiaq.de>2009-10-08 14:19:47 +0800
committerDaniel Mack <daniel@caiaq.de>2009-10-08 14:19:47 +0800
commit0b388bff522f689fdb4d98529a39f3701db57c08 (patch)
tree837b4fb0993078a708dfddb5801220e44a711d32 /src/modules/bluetooth/module-bluetooth-device.c
parent94aa9097f4ded68623160d754a4bf2632b8efc79 (diff)
parent8ec304d2d1e956cc3f5f35437ac4fe580b36f004 (diff)
Merge branch 'master' of git://0pointer.de/pulseaudio
Diffstat (limited to 'src/modules/bluetooth/module-bluetooth-device.c')
-rw-r--r--src/modules/bluetooth/module-bluetooth-device.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/modules/bluetooth/module-bluetooth-device.c b/src/modules/bluetooth/module-bluetooth-device.c
index 4592fca1..0ba1421b 100644
--- a/src/modules/bluetooth/module-bluetooth-device.c
+++ b/src/modules/bluetooth/module-bluetooth-device.c
@@ -74,7 +74,8 @@ PA_MODULE_USAGE(
"profile=<a2dp|hsp> "
"rate=<sample rate> "
"channels=<number of channels> "
- "path=<device object path>");
+ "path=<device object path> "
+ "auto_connect=<automatically connect?>");
/*
#ifdef NOKIA
@@ -98,6 +99,7 @@ static const char* const valid_modargs[] = {
"rate",
"channels",
"path",
+ "auto_connect",
#ifdef NOKIA
"sco_sink",
"sco_source",
@@ -141,6 +143,7 @@ struct userdata {
char *address;
char *path;
pa_bluetooth_discovery *discovery;
+ pa_bool_t auto_connect;
pa_dbus_connection *connection;
@@ -399,7 +402,7 @@ static int get_caps(struct userdata *u, uint8_t seid) {
pa_assert(u->profile == PROFILE_HSP);
msg.getcaps_req.transport = BT_CAPABILITIES_TRANSPORT_SCO;
}
- msg.getcaps_req.flags = BT_FLAG_AUTOCONNECT;
+ msg.getcaps_req.flags = u->auto_connect ? BT_FLAG_AUTOCONNECT : 0;
if (service_send(u, &msg.getcaps_req.h) < 0)
return -1;
@@ -2363,6 +2366,12 @@ int pa__init(pa_module* m) {
goto fail;
}
+ u->auto_connect = TRUE;
+ if (pa_modargs_get_value_boolean(ma, "auto_connect", &u->auto_connect)) {
+ pa_log("Failed to parse auto_connect= argument");
+ goto fail;
+ }
+
channels = u->sample_spec.channels;
if (pa_modargs_get_value_u32(ma, "channels", &channels) < 0 ||
channels <= 0 || channels > PA_CHANNELS_MAX) {