diff options
author | Grzegorz Kolodziejczyk <grzegorz.kolodziejczyk@tieto.com> | 2014-12-23 15:29:23 +0100 |
---|---|---|
committer | Szymon Janc <szymon.janc@tieto.com> | 2015-02-19 11:48:32 +0100 |
commit | d7d12e185902a6037e3cfb95815498cd774ee7c5 (patch) | |
tree | eb967cda4d8dde956fb8bd36c213473783bf5e47 /android/client | |
parent | 1a394e523ab01f9ccbdef3928e58d75ab12516d3 (diff) | |
download | bluez-d7d12e185902a6037e3cfb95815498cd774ee7c5.tar.gz |
android/client: Fix Send Pass Through command
Parameter should be checked if it's given with (argc is lower than
expected). Third parameter can be auto completed with cached bluetooth
addresses.
Diffstat (limited to 'android/client')
-rw-r--r-- | android/client/if-rc-ctrl.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/android/client/if-rc-ctrl.c b/android/client/if-rc-ctrl.c index 52573a09d..398076410 100644 --- a/android/client/if-rc-ctrl.c +++ b/android/client/if-rc-ctrl.c @@ -67,10 +67,13 @@ static void cleanup_p(int argc, const char **argv) } /* send_pass_through_cmd */ - static void send_pass_through_cmd_c(int argc, const char **argv, enum_func *enum_func, void **user) { + if (argc == 3) { + *user = NULL; + *enum_func = enum_devices; + } } static void send_pass_through_cmd_p(int argc, const char **argv) @@ -81,15 +84,15 @@ static void send_pass_through_cmd_p(int argc, const char **argv) RETURN_IF_NULL(if_rc); VERIFY_ADDR_ARG(2, &addr); - if (argc <= 4) { - haltest_error("No key code specified"); + if (argc < 4) { + haltest_error("No key code specified\n"); return; } key_code = (uint8_t) atoi(argv[3]); - if (argc <= 5) { - haltest_error("No key state specified"); + if (argc < 5) { + haltest_error("No key state specified\n"); return; } @@ -100,8 +103,7 @@ static void send_pass_through_cmd_p(int argc, const char **argv) static struct method methods[] = { STD_METHOD(init), - STD_METHODCH(send_pass_through_cmd, - "<bd_addr> <key_code> <key_state>"), + STD_METHODCH(send_pass_through_cmd, "<bd_addr> <key_code> <key_state>"), STD_METHOD(cleanup), END_METHOD }; |