2
2
#include <dbus/dbus-glib.h>
3
3
#include "bluetooth-plugin-manager.h"
5
static gchar *bdaddr = NULL;
6
static gchar **uuids = NULL;
7
static gboolean list_uuid = FALSE;
6
10
delete_event_cb (GtkWidget *widget,
18
static GOptionEntry options[] = {
19
{ "device", 0, 0, G_OPTION_ARG_STRING, &bdaddr,
20
"Remote device to use", "ADDRESS" },
21
{ "uuid", 0, 0, G_OPTION_ARG_STRING_ARRAY, &uuids,
22
"UUID(s) to test against", "UUID" },
23
{ "list-uuids", 0, 0, G_OPTION_ARG_NONE, &list_uuid,
24
"List valid UUIDs", NULL },
14
28
int main (int argc, char **argv)
16
30
GtkWidget *window, *vbox;
18
32
DBusGConnection *bus;
19
const char *uuids[] = { "PANU", NULL};
21
gtk_init (&argc, &argv);
35
if (gtk_init_with_args (&argc, &argv, NULL,
36
options, NULL, &error) == FALSE) {
38
g_printerr ("%s\n", error->message);
41
g_printerr ("An unknown error occurred\n");
47
g_print ("Valid UUIDs are:\n");
48
/* UUIDs copied from bluetooth-client.c and sorted (do not translate them) */
49
g_print ("AudioSink\n" \
51
"A/V_RemoteControl\n" \
52
"A/V_RemoteControlTarget\n" \
53
"DialupNetworking\n" \
55
"GenericNetworking\n" \
57
"HandsfreeAudioGateway\n" \
61
"HumanInterfaceDeviceService\n" \
64
"OBEXFileTransfer\n" \
67
"Phonebook_Access_-_PSE\n" \
70
"SEMC Watch Phone\n" \
72
"ServiceDiscoveryServerServiceClassID\n" \
23
79
/* Init the dbus-glib types */
24
80
bus = dbus_g_bus_get (DBUS_BUS_SESSION, NULL);
32
88
vbox = gtk_vbox_new (FALSE, 6);
33
89
gtk_container_add (GTK_CONTAINER (window), vbox);
35
list = bluetooth_plugin_manager_get_widgets ("11:22:33:44:55:66", uuids);
91
list = bluetooth_plugin_manager_get_widgets (bdaddr, (const char **) uuids);
36
92
if (list == NULL) {
37
93
g_message ("no plugins");