tools/rfcomm-tester: Enable hciemu debug
authorLuiz Augusto von Dentz <luiz.von.dentz@intel.com>
Mon, 2 Nov 2020 19:08:12 +0000 (11:08 -0800)
committerAyush Garg <ayush.garg@samsung.com>
Fri, 11 Mar 2022 13:38:33 +0000 (19:08 +0530)
This enable hciemu debug when debug is enabled.

Signed-off-by: Anuj Jain <anuj01.jain@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
tools/rfcomm-tester.c

index dcf19ec..9bae5b9 100755 (executable)
@@ -59,7 +59,7 @@ struct rfcomm_server_data {
        uint16_t data_len;
 };
 
-static void mgmt_debug(const char *str, void *user_data)
+static void print_debug(const char *str, void *user_data)
 {
        const char *prefix = user_data;
 
@@ -164,6 +164,9 @@ static void read_index_list_callback(uint8_t status, uint16_t length,
                tester_pre_setup_failed();
        }
 
+       if (tester_use_debug())
+               hciemu_set_debug(data->hciemu, print_debug, "hciemu: ", NULL);
+
        tester_print("New hciemu instance created");
 }
 
@@ -179,7 +182,7 @@ static void test_pre_setup(const void *test_data)
        }
 
        if (tester_use_debug())
-               mgmt_set_debug(data->mgmt, mgmt_debug, "mgmt: ", NULL);
+               mgmt_set_debug(data->mgmt, print_debug, "mgmt: ", NULL);
 
        mgmt_send(data->mgmt, MGMT_OP_READ_INDEX_LIST, MGMT_INDEX_NONE, 0, NULL,
                                        read_index_list_callback, NULL, NULL);