Diff between 32a3591b706af613552b425fecc58ee2463ae724 and 8c8ac6f13c1a8c94bfcc6111822bf2cc0019ac04

Changed Files

File Additions Deletions Status
emulator/bthost.c +19 -0 modified
emulator/bthost.h +1 -0 modified

Full Patch

diff --git a/emulator/bthost.c b/emulator/bthost.c
index 627b771..ca405d7 100644
--- a/emulator/bthost.c
+++ b/emulator/bthost.c
@@ -3174,6 +3174,25 @@ void bthost_set_pa_data(struct bthost *bthost, const uint8_t *data,
 	set_pa_data(bthost, data, len, 0);
 }
 
+void bthost_set_base(struct bthost *bthost, const uint8_t *data, uint8_t len)
+{
+	struct bt_ad *ad;
+	bt_uuid_t uuid;
+	uint8_t *pa_data;
+	size_t pa_len;
+
+	bt_uuid16_create(&uuid, BAA_SERVICE);
+
+	ad = bt_ad_new();
+	bt_ad_set_max_len(ad, BT_PA_MAX_DATA_LEN);
+	bt_ad_add_service_data(ad, &uuid, (void *)data, len);
+
+	pa_data = bt_ad_generate(ad, &pa_len);
+	bthost_set_pa_data(bthost, pa_data, pa_len);
+
+	bt_ad_unref(ad);
+}
+
 void bthost_set_pa_enable(struct bthost *bthost, uint8_t enable)
 {
 	struct bt_hci_cmd_le_set_pa_enable cp;
diff --git a/emulator/bthost.h b/emulator/bthost.h
index f03262d..0c488e3 100644
--- a/emulator/bthost.h
+++ b/emulator/bthost.h
@@ -104,6 +104,7 @@ void bthost_set_ext_adv_enable(struct bthost *bthost, uint8_t enable);
 void bthost_set_pa_params(struct bthost *bthost);
 void bthost_set_pa_data(struct bthost *bthost, const uint8_t *data,
 								uint8_t len);
+void bthost_set_base(struct bthost *bthost, const uint8_t *data, uint8_t len);
 void bthost_set_pa_enable(struct bthost *bthost, uint8_t enable);
 void bthost_create_big(struct bthost *bthost, uint8_t num_bis, uint8_t enc,
 				const uint8_t *bcode);