Add function to return command mask, so that it is possible to disable some in tests if needed. --- emulator/btdev.c | 5 +++++ emulator/btdev.h | 2 ++ emulator/hciemu.c | 14 ++++++++++++++ emulator/hciemu.h | 1 + 4 files changed, 22 insertions(+) diff --git a/emulator/btdev.c b/emulator/btdev.c index 3542fdad5..599df3430 100644 --- a/emulator/btdev.c +++ b/emulator/btdev.c @@ -7406,6 +7406,11 @@ uint8_t *btdev_get_features(struct btdev *btdev) return btdev->features; } +uint8_t *btdev_get_commands(struct btdev *btdev) +{ + return btdev->commands; +} + uint8_t btdev_get_scan_enable(struct btdev *btdev) { return btdev->scan_enable; diff --git a/emulator/btdev.h b/emulator/btdev.h index cad5f699f..a96c1a325 100644 --- a/emulator/btdev.h +++ b/emulator/btdev.h @@ -76,6 +76,8 @@ bool btdev_set_bdaddr(struct btdev *btdev, const uint8_t *bdaddr); uint8_t *btdev_get_features(struct btdev *btdev); +uint8_t *btdev_get_commands(struct btdev *btdev); + uint8_t btdev_get_scan_enable(struct btdev *btdev); uint8_t btdev_get_le_scan_enable(struct btdev *btdev); diff --git a/emulator/hciemu.c b/emulator/hciemu.c index f13b4bda1..ccc57aada 100644 --- a/emulator/hciemu.c +++ b/emulator/hciemu.c @@ -528,6 +528,20 @@ uint8_t *hciemu_get_features(struct hciemu *hciemu) return btdev_get_features(dev); } +uint8_t *hciemu_get_commands(struct hciemu *hciemu) +{ + struct btdev *dev; + + if (!hciemu || !hciemu->vhci) + return NULL; + + dev = vhci_get_btdev(hciemu->vhci); + if (!dev) + return NULL; + + return btdev_get_commands(dev); +} + const uint8_t *hciemu_get_central_bdaddr(struct hciemu *hciemu) { struct btdev *dev; diff --git a/emulator/hciemu.h b/emulator/hciemu.h index dba920fdd..9fbe34316 100644 --- a/emulator/hciemu.h +++ b/emulator/hciemu.h @@ -55,6 +55,7 @@ void hciemu_flush_client_events(struct hciemu *hciemu); const char *hciemu_get_address(struct hciemu *hciemu); uint8_t *hciemu_get_features(struct hciemu *hciemu); +uint8_t *hciemu_get_commands(struct hciemu *hciemu); const uint8_t *hciemu_get_central_bdaddr(struct hciemu *hciemu); const uint8_t *hciemu_get_client_bdaddr(struct hciemu *hciemu); -- 2.48.1