diff mbox series

[BlueZ] btdev: Add support for setting bdaddr

Message ID 20221007223751.1832559-1-luiz.dentz@gmail.com
State Superseded
Headers show
Series [BlueZ] btdev: Add support for setting bdaddr | expand

Commit Message

Luiz Augusto von Dentz Oct. 7, 2022, 10:37 p.m. UTC
From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>

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(+)

Comments

bluez.test.bot@gmail.com Oct. 7, 2022, 11:29 p.m. UTC | #1
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
diff mbox series

Patch

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);