From fefe4edf13f576523e130bc74916daf25f6fb557 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Sat, 15 Dec 2012 23:53:03 +0100 Subject: [PATCH] emulator: Add support for setting Bluetooth device address --- emulator/btdev.c | 8 ++++++++ emulator/btdev.h | 2 ++ 2 files changed, 10 insertions(+) diff --git a/emulator/btdev.c b/emulator/btdev.c index 700c6a800..048a5fd59 100644 --- a/emulator/btdev.c +++ b/emulator/btdev.c @@ -268,6 +268,14 @@ void btdev_destroy(struct btdev *btdev) free(btdev); } +void btdev_set_bdaddr(struct btdev *btdev, uint8_t *bdaddr) +{ + if (!btdev) + return; + + memcpy(btdev->bdaddr, bdaddr, 6); +} + void btdev_set_send_handler(struct btdev *btdev, btdev_send_func handler, void *user_data) { diff --git a/emulator/btdev.h b/emulator/btdev.h index db170d389..1a4be372a 100644 --- a/emulator/btdev.h +++ b/emulator/btdev.h @@ -38,6 +38,8 @@ struct btdev; struct btdev *btdev_create(enum btdev_type type, uint16_t id); void btdev_destroy(struct btdev *btdev); +void btdev_set_bdaddr(struct btdev *btdev, uint8_t *bdaddr); + void btdev_set_send_handler(struct btdev *btdev, btdev_send_func handler, void *user_data); -- 2.47.3