summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohan Hedberg <johan.hedberg@intel.com>2015-11-16 12:22:46 +0200
committerJohan Hedberg <johan.hedberg@intel.com>2015-11-16 12:22:46 +0200
commit04f68f5418beb960ee97588437576012ce916e8c (patch)
tree22fec59238755cabc4282614587d0274668d335d
parentdd64e9f908bbb980aea34362bcce0560eaaed58c (diff)
downloadbluez-04f68f5418beb960ee97588437576012ce916e8c.tar.gz
emulator: Return raw LE scan_enable value
This is more future proof (in case other values besides 0x00/0x01 are introduced) and consistent with a similar BR/EDR API that will be added soon.
-rw-r--r--emulator/btdev.c2
-rw-r--r--emulator/btdev.h2
-rw-r--r--emulator/hciemu.c4
-rw-r--r--emulator/hciemu.h2
-rw-r--r--tools/l2cap-tester.c6
-rw-r--r--tools/mgmt-tester.c2
6 files changed, 9 insertions, 9 deletions
diff --git a/emulator/btdev.c b/emulator/btdev.c
index aee7a488d..7f00b473c 100644
--- a/emulator/btdev.c
+++ b/emulator/btdev.c
@@ -675,7 +675,7 @@ uint8_t *btdev_get_features(struct btdev *btdev)
return btdev->features;
}
-bool btdev_is_le_scan_enabled(struct btdev *btdev)
+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 8b116e4b5..324e63be8 100644
--- a/emulator/btdev.h
+++ b/emulator/btdev.h
@@ -80,7 +80,7 @@ void btdev_destroy(struct btdev *btdev);
const uint8_t *btdev_get_bdaddr(struct btdev *btdev);
uint8_t *btdev_get_features(struct btdev *btdev);
-bool btdev_is_le_scan_enabled(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,
void *user_data);
diff --git a/emulator/hciemu.c b/emulator/hciemu.c
index 725fbd434..dd6cf129e 100644
--- a/emulator/hciemu.c
+++ b/emulator/hciemu.c
@@ -427,12 +427,12 @@ const uint8_t *hciemu_get_client_bdaddr(struct hciemu *hciemu)
return btdev_get_bdaddr(hciemu->client_dev);
}
-bool hciemu_is_master_le_scan_enabled(struct hciemu *hciemu)
+uint8_t hciemu_get_master_le_scan_enable(struct hciemu *hciemu)
{
if (!hciemu || !hciemu->master_dev)
return NULL;
- return btdev_is_le_scan_enabled(hciemu->master_dev);
+ return btdev_get_le_scan_enable(hciemu->master_dev);
}
bool hciemu_add_master_post_command_hook(struct hciemu *hciemu,
diff --git a/emulator/hciemu.h b/emulator/hciemu.h
index 04bfab746..bfc184d93 100644
--- a/emulator/hciemu.h
+++ b/emulator/hciemu.h
@@ -53,7 +53,7 @@ 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);
-bool hciemu_is_master_le_scan_enabled(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,
uint8_t len, void *user_data);
diff --git a/tools/l2cap-tester.c b/tools/l2cap-tester.c
index c16312d5c..945f82caf 100644
--- a/tools/l2cap-tester.c
+++ b/tools/l2cap-tester.c
@@ -1305,7 +1305,7 @@ static gboolean test_close_socket_1_part_3(gpointer arg)
return FALSE;
}
- if (hciemu_is_master_le_scan_enabled(data->hciemu)) {
+ if (hciemu_get_master_le_scan_enable(data->hciemu)) {
tester_print("Delayed check whether scann is off failed");
tester_test_failed();
return FALSE;
@@ -1326,7 +1326,7 @@ static gboolean test_close_socket_1_part_2(gpointer args)
* was added to kernel whitelist, and scan was started. We
* should be still scanning.
*/
- if (!hciemu_is_master_le_scan_enabled(data->hciemu)) {
+ if (!hciemu_get_master_le_scan_enable(data->hciemu)) {
tester_print("Error - should be still scanning");
tester_test_failed();
return FALSE;
@@ -1353,7 +1353,7 @@ static gboolean test_close_socket_2_part_3(gpointer arg)
int err;
/* Scan should be already over, we're trying to create connection */
- if (hciemu_is_master_le_scan_enabled(data->hciemu)) {
+ if (hciemu_get_master_le_scan_enable(data->hciemu)) {
tester_print("Error - should no longer scan");
tester_test_failed();
return FALSE;
diff --git a/tools/mgmt-tester.c b/tools/mgmt-tester.c
index b22454376..d5917756f 100644
--- a/tools/mgmt-tester.c
+++ b/tools/mgmt-tester.c
@@ -5848,7 +5848,7 @@ static void check_scan(void *user_data)
{
struct test_data *data = tester_get_data();
- if (hciemu_is_master_le_scan_enabled(data->hciemu)) {
+ if (hciemu_get_master_le_scan_enable(data->hciemu)) {
tester_warn("LE scan still enabled");
tester_test_failed();
return;