diff options
author | Szymon Janc <szymon@janc.net.pl> | 2012-03-05 20:05:23 +0100 |
---|---|---|
committer | Johan Hedberg <johan.hedberg@intel.com> | 2012-03-05 11:34:48 -0800 |
commit | b22a71eccc23958986dca6c0126f36929bc6bd4f (patch) | |
tree | cbbfc349a8da04e9a1917b2ab2cde14d1cb25089 /plugins | |
parent | d34b7422ff372f326b4a165d217841f05c8306d9 (diff) | |
download | bluez-b22a71eccc23958986dca6c0126f36929bc6bd4f.tar.gz bluez-b22a71eccc23958986dca6c0126f36929bc6bd4f.tar.xz bluez-b22a71eccc23958986dca6c0126f36929bc6bd4f.zip |
mgmtops: When settings discoverable also set connectable if not set yet
Otherwise command would be rejected e.g. when setting discoverable at
bluetoothd startup.
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/mgmtops.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/plugins/mgmtops.c b/plugins/mgmtops.c index 89355ad8..afed1654 100644 --- a/plugins/mgmtops.c +++ b/plugins/mgmtops.c @@ -317,12 +317,15 @@ static void update_settings(struct btd_adapter *adapter, uint32_t settings) info = &controllers[index]; - if (on_mode == MODE_DISCOVERABLE && !mgmt_discoverable(settings)) + if (on_mode == MODE_DISCOVERABLE && !mgmt_discoverable(settings)) { + if(!mgmt_connectable(settings)) + mgmt_set_connectable(index, TRUE); mgmt_set_discoverable(index, TRUE, discoverable_timeout); - else if (on_mode == MODE_CONNECTABLE && !mgmt_connectable(settings)) + } else if (on_mode == MODE_CONNECTABLE && !mgmt_connectable(settings)) { mgmt_set_connectable(index, TRUE); - else if (mgmt_powered(settings)) + } else if (mgmt_powered(settings)) { adapter_mode_changed(adapter, create_mode(settings)); + } if (mgmt_pairable(settings) != pairable) mgmt_set_pairable(index, pairable); |