vhci: Add vhci_set_debug
authorLuiz Augusto von Dentz <luiz.von.dentz@intel.com>
Fri, 19 Feb 2021 23:17:02 +0000 (15:17 -0800)
committerAyush Garg <ayush.garg@samsung.com>
Fri, 11 Mar 2022 13:38:34 +0000 (19:08 +0530)
This enables debug with btdev_set_debug.

Signed-off-by: Anuj Jain <anuj01.jain@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
emulator/vhci.c
emulator/vhci.h

index 84e1633..33f674d 100755 (executable)
@@ -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;
index 24b36bd..7dfea25 100755 (executable)
@@ -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);