提交 970ba524 编写于 作者: M Marcel Holtmann 提交者: Johan Hedberg

Bluetooth: Update class of device after changing discoverable mode

When the discoverable mode gets changed, ensure that the class of
device value has the correct limited discoverable bit value set.

Since the class of device HCI command will only be send to the
controller when the value changes, it is safe to just always
trigger the update.
Signed-off-by: NMarcel Holtmann <marcel@holtmann.org>
Signed-off-by: NJohan Hedberg <johan.hedberg@intel.com>
上级 4796e8af
......@@ -1025,6 +1025,7 @@ static void set_discoverable_complete(struct hci_dev *hdev, u8 status)
{
struct pending_cmd *cmd;
struct mgmt_mode *cp;
struct hci_request req;
bool changed;
BT_DBG("status 0x%02x", status);
......@@ -1054,6 +1055,14 @@ static void set_discoverable_complete(struct hci_dev *hdev, u8 status)
if (changed)
new_settings(hdev, cmd->sk);
/* When the discoverable mode gets changed, make sure
* that class of device has the limited discoverable
* bit correctly set.
*/
hci_req_init(&req, hdev);
update_class(&req);
hci_req_run(&req, NULL);
remove_cmd:
mgmt_pending_remove(cmd);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册