2022-10-07 22:39:02

by Luiz Augusto von Dentz

[permalink] [raw]
Subject: [PATCH BlueZ] btdev: Add support for setting bdaddr

From: Luiz Augusto von Dentz <[email protected]>

This adds btdev_set_bdaddr so it is possible to set an arbritrary
address.
---
emulator/btdev.c | 10 ++++++++++
emulator/btdev.h | 2 ++
2 files changed, 12 insertions(+)

diff --git a/emulator/btdev.c b/emulator/btdev.c
index 3fdfb64a9eba..549f93645684 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 228bf205cf4b..cad5f699f801 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);
--
2.37.3


2022-10-07 23:32:37

by bluez.test.bot

[permalink] [raw]
Subject: RE: [BlueZ] btdev: Add support for setting bdaddr

This is automated email and please do not reply to this email!

Dear submitter,

Thank you for submitting the patches to the linux bluetooth mailing list.
This is a CI test results with your patch series:
PW Link:https://patchwork.kernel.org/project/bluetooth/list/?series=683836

---Test result---

Test Summary:
CheckPatch PASS 1.45 seconds
GitLint PASS 1.06 seconds
Prep - Setup ELL PASS 26.83 seconds
Build - Prep PASS 0.85 seconds
Build - Configure PASS 8.58 seconds
Build - Make PASS 925.68 seconds
Make Check PASS 11.96 seconds
Make Check w/Valgrind PASS 290.02 seconds
Make Distcheck PASS 233.17 seconds
Build w/ext ELL - Configure PASS 8.65 seconds
Build w/ext ELL - Make PASS 84.14 seconds
Incremental Build w/ patches PASS 0.00 seconds
Scan Build PASS 512.43 seconds



---
Regards,
Linux Bluetooth