OSDN Git Service

emulator: add support for checking le scan state
authorJakub Pawlowski <jpawlowski@google.com>
Wed, 11 Nov 2015 06:36:26 +0000 (22:36 -0800)
committerJohan Hedberg <johan.hedberg@intel.com>
Wed, 11 Nov 2015 07:58:56 +0000 (09:58 +0200)
emulator/btdev.c
emulator/btdev.h
emulator/hciemu.c
emulator/hciemu.h

index e8cead8..aee7a48 100644 (file)
@@ -675,6 +675,11 @@ uint8_t *btdev_get_features(struct btdev *btdev)
        return btdev->features;
 }
 
+bool btdev_is_le_scan_enabled(struct btdev *btdev)
+{
+       return btdev->le_scan_enable;
+}
+
 static bool use_ssp(struct btdev *btdev1, struct btdev *btdev2)
 {
        if (btdev1->auth_enable || btdev2->auth_enable)
index 4b724a7..8b116e4 100644 (file)
@@ -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);
 
+bool btdev_is_le_scan_enabled(struct btdev *btdev);
+
 void btdev_set_command_handler(struct btdev *btdev, btdev_command_func handler,
                                                        void *user_data);
 
index 4881a24..725fbd4 100644 (file)
@@ -427,6 +427,14 @@ 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)
+{
+       if (!hciemu || !hciemu->master_dev)
+               return NULL;
+
+       return btdev_is_le_scan_enabled(hciemu->master_dev);
+}
+
 bool hciemu_add_master_post_command_hook(struct hciemu *hciemu,
                        hciemu_command_func_t function, void *user_data)
 {
index 41ca3fc..04bfab7 100644 (file)
@@ -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);
 
+bool hciemu_is_master_le_scan_enabled(struct hciemu *hciemu);
+
 typedef void (*hciemu_command_func_t)(uint16_t opcode, const void *data,
                                                uint8_t len, void *user_data);