diff options
author | Luiz Augusto von Dentz <luiz.von.dentz@intel.com> | 2021-02-19 15:17:02 -0800 |
---|---|---|
committer | Luiz Augusto von Dentz <luiz.von.dentz@intel.com> | 2021-02-19 15:21:12 -0800 |
commit | 441ab748ccb51a4199fe2ae1535b40f8d854bc6c (patch) | |
tree | 7c7d25040cbfac42d12f981f90f5bedc5a258da4 /emulator | |
parent | 2e97d260d162cc44c06351a474202c212c30f6c9 (diff) | |
download | bluez-441ab748ccb51a4199fe2ae1535b40f8d854bc6c.tar.gz |
vhci: Add vhci_set_debug
This enables debug with btdev_set_debug.
Diffstat (limited to 'emulator')
-rw-r--r-- | emulator/vhci.c | 9 | ||||
-rw-r--r-- | emulator/vhci.h | 5 |
2 files changed, 14 insertions, 0 deletions
diff --git a/emulator/vhci.c b/emulator/vhci.c index 84e16330f..33f674d79 100644 --- a/emulator/vhci.c +++ b/emulator/vhci.c @@ -82,6 +82,15 @@ static void vhci_read_callback(int fd, uint32_t events, void *user_data) } } +bool vhci_set_debug(struct vhci *vhci, vhci_debug_func_t callback, + void *user_data, vhci_destroy_func_t destroy) +{ + if (!vhci) + return false; + + return btdev_set_debug(vhci->btdev, callback, user_data, destroy); +} + struct vhci *vhci_open(enum vhci_type type) { struct vhci *vhci; diff --git a/emulator/vhci.h b/emulator/vhci.h index 24b36bd60..7dfea25df 100644 --- a/emulator/vhci.h +++ b/emulator/vhci.h @@ -20,5 +20,10 @@ enum vhci_type { struct vhci; +typedef void (*vhci_debug_func_t)(const char *str, void *user_data); +typedef void (*vhci_destroy_func_t)(void *user_data); +bool vhci_set_debug(struct vhci *vhci, vhci_debug_func_t callback, + void *user_data, vhci_destroy_func_t destroy); + struct vhci *vhci_open(enum vhci_type type); void vhci_close(struct vhci *vhci); |