[PATCH BlueZ 2/4] hciemu: Add support for setting emulator bdaddr

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This adds support for the user to explicitly set a desired bdaddr to
a client emulator.

---
 emulator/hciemu.c | 9 +++++++++
 emulator/hciemu.h | 2 ++
 2 files changed, 11 insertions(+)

diff --git a/emulator/hciemu.c b/emulator/hciemu.c
index 25874ded5..f13b4bda1 100644
--- a/emulator/hciemu.c
+++ b/emulator/hciemu.c
@@ -550,6 +550,15 @@ const uint8_t *hciemu_client_bdaddr(struct hciemu_client *client)
 	return btdev_get_bdaddr(client->dev);
 }
 
+bool hciemu_set_client_bdaddr(struct hciemu_client *client,
+				const uint8_t *bdaddr)
+{
+	if (!client)
+		return NULL;
+
+	return btdev_set_bdaddr(client->dev, bdaddr);
+}
+
 const uint8_t *hciemu_get_client_bdaddr(struct hciemu *hciemu)
 {
 	struct hciemu_client *client;
diff --git a/emulator/hciemu.h b/emulator/hciemu.h
index 3449eae41..dba920fdd 100644
--- a/emulator/hciemu.h
+++ b/emulator/hciemu.h
@@ -39,6 +39,8 @@ void hciemu_unref(struct hciemu *hciemu);
 struct hciemu_client *hciemu_get_client(struct hciemu *hciemu, int num);
 struct bthost *hciemu_client_host(struct hciemu_client *client);
 const uint8_t *hciemu_client_bdaddr(struct hciemu_client *client);
+bool hciemu_set_client_bdaddr(struct hciemu_client *client,
+				const uint8_t *bdaddr);
 
 typedef void (*hciemu_debug_func_t)(const char *str, void *user_data);
 typedef void (*hciemu_destroy_func_t)(void *user_data);
-- 
2.39.2




[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux