Skip to content

Commit

Permalink
client: Add support for player submenu
Browse files Browse the repository at this point in the history
This moves adds the functionality of bluetooth-player into
bluetoothctl.
  • Loading branch information
Vudentz committed Mar 30, 2022
1 parent 0cc480a commit d204e84
Show file tree
Hide file tree
Showing 5 changed files with 1,156 additions and 1,069 deletions.
6 changes: 3 additions & 3 deletions Makefile.tools
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ client_bluetoothctl_SOURCES = client/main.c \
client/adv_monitor.h \
client/adv_monitor.c \
client/gatt.h client/gatt.c \
client/admin.h \
client/admin.c
client/admin.h client/admin.c \
client/player.h client/player.c
client_bluetoothctl_LDADD = gdbus/libgdbus-internal.la src/libshared-glib.la \
$(GLIB_LIBS) $(DBUS_LIBS) -lreadline
endif
Expand Down Expand Up @@ -456,7 +456,7 @@ tools_obex_server_tool_SOURCES = $(gobex_sources) $(btio_sources) \
tools_obex_server_tool_LDADD = lib/libbluetooth-internal.la \
src/libshared-glib.la $(GLIB_LIBS)

tools_bluetooth_player_SOURCES = tools/bluetooth-player.c
tools_bluetooth_player_SOURCES = tools/bluetooth-player.c client/player.c
tools_bluetooth_player_LDADD = gdbus/libgdbus-internal.la \
src/libshared-glib.la \
$(GLIB_LIBS) $(DBUS_LIBS) -lreadline
Expand Down
5 changes: 5 additions & 0 deletions client/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
#include "advertising.h"
#include "adv_monitor.h"
#include "admin.h"
#include "player.h"

/* String display constants */
#define COLORED_NEW COLOR_GREEN "NEW" COLOR_OFF
Expand Down Expand Up @@ -3215,6 +3216,8 @@ int main(int argc, char *argv[])

bt_shell_set_env("DBUS_CONNECTION", dbus_conn);

player_add_submenu();

client = g_dbus_client_new(dbus_conn, "org.bluez", "/org/bluez");

g_dbus_client_set_connect_watch(client, connect_handler, NULL);
Expand All @@ -3228,6 +3231,8 @@ int main(int argc, char *argv[])

status = bt_shell_run();

player_remove_submenu();

g_dbus_client_unref(client);

dbus_connection_unref(dbus_conn);
Expand Down

0 comments on commit d204e84

Please sign in to comment.