From e6c0fa067b63e7fa530ce86b711ea2b7291bd743 Mon Sep 17 00:00:00 2001 From: Anderson Lizardo Date: Tue, 11 Feb 2014 14:32:29 -0400 Subject: [PATCH] android/client: Fix set_info command Although this command is not implemented by BlueZ, make sure it is callable from haltest so at least the IPC can be tested. Also memset() the hid_info parameter to not pass uninitialized data around. --- android/client/if-hh.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/android/client/if-hh.c b/android/client/if-hh.c index 56eb6980e..0341d25d1 100644 --- a/android/client/if-hh.c +++ b/android/client/if-hh.c @@ -229,6 +229,9 @@ static void virtual_unplug_p(int argc, const char **argv) /* set_info */ +/* Same completion as connect_c */ +#define set_info_c connect_c + static void set_info_p(int argc, const char **argv) { bt_bdaddr_t addr; @@ -236,8 +239,11 @@ static void set_info_p(int argc, const char **argv) RETURN_IF_NULL(if_hh); VERIFY_ADDR_ARG(2, &addr); - /* TODO: set_info does not seem to be called anywhere */ + memset(&hid_info, 0, sizeof(hid_info)); + + /* This command is intentionally not supported. See comment from + * bt_hid_info() in android/hidhost.c */ EXEC(if_hh->set_info, &addr, hid_info); } @@ -416,7 +422,7 @@ static struct method methods[] = { STD_METHODCH(connect, ""), STD_METHODCH(disconnect, ""), STD_METHODCH(virtual_unplug, ""), - STD_METHOD(set_info), + STD_METHODCH(set_info, ""), STD_METHODCH(get_protocol, " "), STD_METHODCH(set_protocol, " "), STD_METHODCH(get_report, " "), -- 2.47.3