summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohan Hedberg <johan.hedberg@intel.com>2015-11-16 12:26:13 +0200
committerJohan Hedberg <johan.hedberg@intel.com>2015-11-16 12:26:13 +0200
commitfa6c85299a3cf11e83aeb689a83b4731e9c99565 (patch)
tree99872aa613e0ca3f66e9f43607b9ed7080a42e18
parent04f68f5418beb960ee97588437576012ce916e8c (diff)
downloadbluez-fa6c85299a3cf11e83aeb689a83b4731e9c99565.tar.gz
emulator: Add API to get BR/EDR scan_enable value
-rw-r--r--emulator/btdev.c5
-rw-r--r--emulator/btdev.h2
-rw-r--r--emulator/hciemu.c8
-rw-r--r--emulator/hciemu.h2
4 files changed, 17 insertions, 0 deletions
diff --git a/emulator/btdev.c b/emulator/btdev.c
index 7f00b473c..38769d8ff 100644
--- a/emulator/btdev.c
+++ b/emulator/btdev.c
@@ -675,6 +675,11 @@ uint8_t *btdev_get_features(struct btdev *btdev)
return btdev->features;
}
+uint8_t btdev_get_scan_enable(struct btdev *btdev)
+{
+ return btdev->scan_enable;
+}
+
uint8_t btdev_get_le_scan_enable(struct btdev *btdev)
{
return btdev->le_scan_enable;
diff --git a/emulator/btdev.h b/emulator/btdev.h
index 324e63be8..40c72199b 100644
--- a/emulator/btdev.h
+++ b/emulator/btdev.h
@@ -80,6 +80,8 @@ void btdev_destroy(struct btdev *btdev);
const uint8_t *btdev_get_bdaddr(struct btdev *btdev);
uint8_t *btdev_get_features(struct btdev *btdev);
+uint8_t btdev_get_scan_enable(struct btdev *btdev);
+
uint8_t btdev_get_le_scan_enable(struct btdev *btdev);
void btdev_set_command_handler(struct btdev *btdev, btdev_command_func handler,
diff --git a/emulator/hciemu.c b/emulator/hciemu.c
index dd6cf129e..c8d9db51a 100644
--- a/emulator/hciemu.c
+++ b/emulator/hciemu.c
@@ -427,6 +427,14 @@ const uint8_t *hciemu_get_client_bdaddr(struct hciemu *hciemu)
return btdev_get_bdaddr(hciemu->client_dev);
}
+uint8_t hciemu_get_master_scan_enable(struct hciemu *hciemu)
+{
+ if (!hciemu || !hciemu->master_dev)
+ return NULL;
+
+ return btdev_get_scan_enable(hciemu->master_dev);
+}
+
uint8_t hciemu_get_master_le_scan_enable(struct hciemu *hciemu)
{
if (!hciemu || !hciemu->master_dev)
diff --git a/emulator/hciemu.h b/emulator/hciemu.h
index bfc184d93..c5578d131 100644
--- a/emulator/hciemu.h
+++ b/emulator/hciemu.h
@@ -53,6 +53,8 @@ uint8_t *hciemu_get_features(struct hciemu *hciemu);
const uint8_t *hciemu_get_master_bdaddr(struct hciemu *hciemu);
const uint8_t *hciemu_get_client_bdaddr(struct hciemu *hciemu);
+uint8_t hciemu_get_master_scan_enable(struct hciemu *hciemu);
+
uint8_t hciemu_get_master_le_scan_enable(struct hciemu *hciemu);
typedef void (*hciemu_command_func_t)(uint16_t opcode, const void *data,