summaryrefslogtreecommitdiff
path: root/emulator/btdev.c
diff options
context:
space:
mode:
authorLuiz Augusto von Dentz <luiz.von.dentz@intel.com>2022-10-07 18:14:08 -0700
committerLuiz Augusto von Dentz <luiz.von.dentz@intel.com>2022-10-10 13:06:16 -0700
commitc94cdbc6d73ffd818d862975895d48dd01361234 (patch)
tree0cdc329357d557b2fe064d949d4f0fb9b74911a0 /emulator/btdev.c
parent3da439ae3c76e5008d007c2c41f6e7e1828b7321 (diff)
downloadbluez-c94cdbc6d73ffd818d862975895d48dd01361234.tar.gz
btdev: Add support for setting bdaddr
This adds btdev_set_bdaddr so it is possible to set an arbritrary address.
Diffstat (limited to 'emulator/btdev.c')
-rw-r--r--emulator/btdev.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/emulator/btdev.c b/emulator/btdev.c
index 3fdfb64a9..549f93645 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;