aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorIulia Tanasescu <iulia.tanasescu@nxp.com>2024-03-07 17:58:47 +0200
committerLuiz Augusto von Dentz <luiz.von.dentz@intel.com>2024-03-08 11:11:49 -0500
commit352e75263632edb8105e2fc1e75153f9f40bf518 (patch)
tree66bb95847280c3fc3abe601913d533bd6e7205a5
parentaa7a814690d062349af4f3951f9d381086bb8994 (diff)
client/gatt: Quit shell after user input has been processed
Inside gatt_register_service and gatt_register_chrc, bt_shell_noninteractive_quit should be called after the input was processed.
-rw-r--r--client/gatt.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/client/gatt.c b/client/gatt.c
index f03fc1526a..84b7f3f49f 100644
--- a/client/gatt.c
+++ b/client/gatt.c
@@ -4,6 +4,7 @@
* BlueZ - Bluetooth protocol stack for Linux
*
* Copyright (C) 2014 Intel Corporation. All rights reserved.
+ * Copyright 2024 NXP
*
*
*/
@@ -1685,6 +1686,8 @@ static void service_set_primary(const char *input, void *user_data)
g_dbus_unregister_interface(service->conn, service->path,
SERVICE_INTERFACE);
}
+
+ return bt_shell_noninteractive_quit(EXIT_SUCCESS);
}
static uint16_t parse_handle(const char *arg)
@@ -1737,8 +1740,6 @@ void gatt_register_service(DBusConnection *conn, GDBusProxy *proxy,
bt_shell_prompt_input(service->path, "Primary (yes/no):",
service_set_primary, service);
-
- return bt_shell_noninteractive_quit(EXIT_SUCCESS);
}
static struct service *service_find(const char *pattern)
@@ -2761,6 +2762,8 @@ static void chrc_set_value(const char *input, void *user_data)
}
chrc->max_val_len = chrc->value_len;
+
+ return bt_shell_noninteractive_quit(EXIT_SUCCESS);
}
static gboolean attr_authorization_flag_exists(char **flags)
@@ -2817,8 +2820,6 @@ void gatt_register_chrc(DBusConnection *conn, GDBusProxy *proxy,
print_chrc(chrc, COLORED_NEW);
bt_shell_prompt_input(chrc->path, "Enter value:", chrc_set_value, chrc);
-
- return bt_shell_noninteractive_quit(EXIT_SUCCESS);
}
static struct chrc *chrc_find(const char *pattern)