Bluetooth: Fix advertising address type when toggling connectable
authorJohan Hedberg <johan.hedberg@intel.com>
Tue, 25 Feb 2014 17:56:31 +0000 (19:56 +0200)
committerMarcel Holtmann <marcel@holtmann.org>
Tue, 25 Feb 2014 18:02:53 +0000 (10:02 -0800)
commita4858cb942b9afa57c1220aa5d9b536a0d7ec623
treeee39ea92d8c10355c73fc372ba734c63f2d8636e
parentede81a2a1250dc9296a2b9bf384bba4e336a02e2
Bluetooth: Fix advertising address type when toggling connectable

When the connectable setting is toggled using mgmt_set_connectable the
HCI_CONNECTABLE flag will only be set once the related HCI commands
succeed. When determining what kind of advertising to do we need to
therefore also check whether there is a pending Set Connectable command
in addition to the current flag value.

The enable_advertising function was already taking care of this for the
advertising type with the help of the get_adv_type function, but was
failing to do the same for the address type selection. This patch
converts the get_adv_type function to be more generic in that it returns
the expected connectable state and updates the enable_advertising
function to use the return value both for the advertising type as well
as the advertising address type.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
net/bluetooth/mgmt.c
This page took 0.025362 seconds and 5 git commands to generate.