summaryrefslogtreecommitdiff
path: root/emulator
diff options
context:
space:
mode:
authorLuiz Augusto von Dentz <luiz.von.dentz@intel.com>2022-03-04 17:22:28 -0800
committerLuiz Augusto von Dentz <luiz.von.dentz@intel.com>2022-03-07 17:21:57 -0800
commitf040ba43d18dfdeae8a470ccfb959a1f6e226788 (patch)
treea8cdfee814b2c2f5008eb2c6aa31818df526a488 /emulator
parenta473a5a47c4f65b6568a1650ec9e20c1072c14e9 (diff)
downloadbluez-f040ba43d18dfdeae8a470ccfb959a1f6e226788.tar.gz
bthost: Add support for Periodic Advertising
This adds bthost_set_pa_params and bthost_set_pa_enable.
Diffstat (limited to 'emulator')
-rw-r--r--emulator/bthost.c23
-rw-r--r--emulator/bthost.h2
2 files changed, 25 insertions, 0 deletions
diff --git a/emulator/bthost.c b/emulator/bthost.c
index 54a2728e0..a45a67d14 100644
--- a/emulator/bthost.c
+++ b/emulator/bthost.c
@@ -1006,6 +1006,10 @@ static void evt_cmd_complete(struct bthost *bthost, const void *data,
break;
case BT_HCI_CMD_LE_SET_EXT_ADV_ENABLE:
break;
+ case BT_HCI_CMD_LE_SET_PA_PARAMS:
+ break;
+ case BT_HCI_CMD_LE_SET_PA_ENABLE:
+ break;
default:
bthost_debug(bthost, "Unhandled cmd_complete opcode 0x%04x",
opcode);
@@ -3073,6 +3077,25 @@ void bthost_set_ext_adv_enable(struct bthost *bthost, uint8_t enable)
send_command(bthost, BT_HCI_CMD_LE_SET_EXT_ADV_ENABLE, cp, 6);
}
+void bthost_set_pa_params(struct bthost *bthost)
+{
+ struct bt_hci_cmd_le_set_pa_params cp;
+
+ memset(&cp, 0, sizeof(cp));
+ cp.handle = 0x01;
+ send_command(bthost, BT_HCI_CMD_LE_SET_PA_PARAMS, &cp, sizeof(cp));
+}
+
+void bthost_set_pa_enable(struct bthost *bthost, uint8_t enable)
+{
+ struct bt_hci_cmd_le_set_pa_enable cp;
+
+ memset(&cp, 0, sizeof(cp));
+ cp.enable = enable;
+ cp.handle = 0x01;
+ send_command(bthost, BT_HCI_CMD_LE_SET_PA_ENABLE, &cp, sizeof(cp));
+}
+
bool bthost_search_ext_adv_addr(struct bthost *bthost, const uint8_t *addr)
{
const struct queue_entry *entry;
diff --git a/emulator/bthost.h b/emulator/bthost.h
index f597d7596..fb7b1431e 100644
--- a/emulator/bthost.h
+++ b/emulator/bthost.h
@@ -95,6 +95,8 @@ void bthost_set_ext_adv_data(struct bthost *bthost, const uint8_t *data,
uint8_t len);
void bthost_set_ext_adv_params(struct bthost *bthost);
void bthost_set_ext_adv_enable(struct bthost *bthost, uint8_t enable);
+void bthost_set_pa_params(struct bthost *bthost);
+void bthost_set_pa_enable(struct bthost *bthost, uint8_t enable);
bool bthost_search_ext_adv_addr(struct bthost *bthost, const uint8_t *addr);
void bthost_set_scan_params(struct bthost *bthost, uint8_t scan_type,