Skip to content

Commit

Permalink
client/adv_monitor: Remove shell quit from adv_monitor_register_app
Browse files Browse the repository at this point in the history
In adv_monitor, adv_monitor_register_app is called when an advertising
monitor manager proxy has been added, when a new adapter is added.

This commit removes bt_shell_noninteractive_quit from this function,
since it causes the shell to exit without a user command having
executed.
  • Loading branch information
iulia-tanasescu authored and Vudentz committed Mar 8, 2024
1 parent 352e752 commit 32e9d15
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions client/adv_monitor.c
Expand Up @@ -4,6 +4,7 @@
* BlueZ - Bluetooth protocol stack for Linux
*
* Copyright (C) 2020 Google LLC
* Copyright 2024 NXP
*
*
*/
Expand Down Expand Up @@ -372,12 +373,11 @@ static void register_reply(DBusMessage *message, void *user_data)

if (!dbus_set_error_from_message(&error, message)) {
bt_shell_printf("AdvertisementMonitor path registered\n");
return bt_shell_noninteractive_quit(EXIT_SUCCESS);
return;
}

bt_shell_printf("Failed to register path: %s\n", error.name);
dbus_error_free(&error);
return bt_shell_noninteractive_quit(EXIT_FAILURE);
}

static void unregister_setup(DBusMessageIter *iter, void *user_data)
Expand Down Expand Up @@ -408,13 +408,13 @@ void adv_monitor_register_app(DBusConnection *conn)
{
if (manager.app_registered) {
bt_shell_printf("Advertisement Monitor already registered\n");
return bt_shell_noninteractive_quit(EXIT_FAILURE);
return;
} else if (manager.supported_types == NULL ||
!g_dbus_proxy_method_call(manager.proxy, "RegisterMonitor",
register_setup, register_reply,
NULL, NULL)) {
bt_shell_printf("Failed to register Advertisement Monitor\n");
return bt_shell_noninteractive_quit(EXIT_FAILURE);
return;
}
manager.app_registered = TRUE;
}
Expand Down

0 comments on commit 32e9d15

Please sign in to comment.