Diff between 3da439ae3c76e5008d007c2c41f6e7e1828b7321 and c94cdbc6d73ffd818d862975895d48dd01361234

Changed Files

File Additions Deletions Status
emulator/btdev.c +10 -0 modified
emulator/btdev.h +2 -0 modified

Full Patch

diff --git a/emulator/btdev.c b/emulator/btdev.c
index 3fdfb64..549f936 100644
--- a/emulator/btdev.c
+++ b/emulator/btdev.c
@@ -6960,6 +6960,16 @@ const uint8_t *btdev_get_bdaddr(struct btdev *btdev)
 	return btdev->bdaddr;
 }
 
+bool btdev_set_bdaddr(struct btdev *btdev, const uint8_t *bdaddr)
+{
+	if (!btdev || !bdaddr)
+		return false;
+
+	memcpy(btdev->bdaddr, bdaddr, sizeof(btdev->bdaddr));
+
+	return true;
+}
+
 uint8_t *btdev_get_features(struct btdev *btdev)
 {
 	return btdev->features;
diff --git a/emulator/btdev.h b/emulator/btdev.h
index 228bf20..cad5f69 100644
--- a/emulator/btdev.h
+++ b/emulator/btdev.h
@@ -72,6 +72,8 @@ bool btdev_set_debug(struct btdev *btdev, btdev_debug_func_t callback,
 			void *user_data, btdev_destroy_func_t destroy);
 
 const uint8_t *btdev_get_bdaddr(struct btdev *btdev);
+bool btdev_set_bdaddr(struct btdev *btdev, const uint8_t *bdaddr);
+
 uint8_t *btdev_get_features(struct btdev *btdev);
 
 uint8_t btdev_get_scan_enable(struct btdev *btdev);