--- client/main.c | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/client/main.c b/client/main.c index 91b728a..3dadd5b 100644 --- a/client/main.c +++ b/client/main.c @@ -2368,22 +2368,12 @@ static void cmd_set_advertise_manufacturer(const char *arg) static void cmd_set_advertise_tx_power(const char *arg) { - if (arg == NULL || strlen(arg) == 0) { - rl_printf("Missing on/off argument\n"); - return; - } - - if (strcmp(arg, "on") == 0 || strcmp(arg, "yes") == 0) { - ad_advertise_tx_power(dbus_conn, true); - return; - } + dbus_bool_t powered; - if (strcmp(arg, "off") == 0 || strcmp(arg, "no") == 0) { - ad_advertise_tx_power(dbus_conn, false); + if (parse_argument_on_off(arg, &powered) == FALSE) return; - } - rl_printf("Invalid argument\n"); + ad_advertise_tx_power(dbus_conn, powered); } static void cmd_set_advertise_name(const char *arg) -- 2.7.4 -- To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html