From a62f609cd949c8b6784c4bca7e773708686b1d72 Mon Sep 17 00:00:00 2001 From: Joakim Andersson Date: Wed, 14 Aug 2019 16:52:49 +0200 Subject: [PATCH] Bluetooth: Host: Set Kconfig RPA timeout in controller Use the RPA timeout provided by Kconfig in the controller Signed-off-by: Joakim Andersson --- subsys/bluetooth/host/hci_core.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/subsys/bluetooth/host/hci_core.c b/subsys/bluetooth/host/hci_core.c index 483b646f1d5..55e96f3fd60 100644 --- a/subsys/bluetooth/host/hci_core.c +++ b/subsys/bluetooth/host/hci_core.c @@ -4230,6 +4230,24 @@ static int le_init(void) #if defined(CONFIG_BT_SMP) if (BT_FEAT_LE_PRIVACY(bt_dev.le.features)) { +#if defined(CONFIG_BT_PRIVACY) + struct bt_hci_cp_le_set_rpa_timeout *cp; + + buf = bt_hci_cmd_create(BT_HCI_OP_LE_SET_RPA_TIMEOUT, + sizeof(*cp)); + if (!buf) { + return -ENOBUFS; + } + + cp = net_buf_add(buf, sizeof(*cp)); + cp->rpa_timeout = sys_cpu_to_le16(CONFIG_BT_RPA_TIMEOUT); + err = bt_hci_cmd_send_sync(BT_HCI_OP_LE_SET_RPA_TIMEOUT, buf, + NULL); + if (err) { + return err; + } +#endif /* defined(CONFIG_BT_PRIVACY) */ + err = bt_hci_cmd_send_sync(BT_HCI_OP_LE_READ_RL_SIZE, NULL, &rsp); if (err) {