diff mbox series

[BlueZ,10/11] bthost: Add support for Periodic Advertising

Message ID 20220224003029.706163-11-luiz.dentz@gmail.com
State New
Headers show
Series emulator: Initial Broacast Receiver | expand

Commit Message

Luiz Augusto von Dentz Feb. 24, 2022, 12:30 a.m. UTC
From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>

This adds bthost_set_pa_params and bthost_set_pa_enable.
---
 emulator/bthost.c | 19 +++++++++++++++++++
 emulator/bthost.h |  2 ++
 2 files changed, 21 insertions(+)
diff mbox series

Patch

diff --git a/emulator/bthost.c b/emulator/bthost.c
index d751e7dd4..fef542236 100644
--- a/emulator/bthost.c
+++ b/emulator/bthost.c
@@ -2801,6 +2801,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 868af5469..55a7adf26 100644
--- a/emulator/bthost.h
+++ b/emulator/bthost.h
@@ -84,6 +84,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,