diff --git a/client/gatt.c b/client/gatt.c
index 40d3f6a..8b7a9c6 100644
--- a/client/gatt.c
+++ b/client/gatt.c
return;
}
- if (g_dbus_register_interface(conn, APP_PATH,
- PROFILE_INTERFACE, methods,
- NULL, properties, NULL, NULL) == FALSE) {
- rl_printf("Failed to register application object\n");
- return;
- }
-
for (i = 0; i < w->we_wordc; i++)
uuids = g_list_append(uuids, g_strdup(w->we_wordv[i]));
+ if (uuids) {
+ if (g_dbus_register_interface(conn, APP_PATH,
+ PROFILE_INTERFACE, methods,
+ NULL, properties, NULL,
+ NULL) == FALSE) {
+ rl_printf("Failed to register application object\n");
+ return;
+ }
+ }
+
if (g_dbus_proxy_method_call(l->data, "RegisterApplication",
register_app_setup,
register_app_reply, w,
return;
}
+ rl_printf("Application unregistered\n");
+
+ if (!uuids)
+ return;
+
g_list_free_full(uuids, g_free);
uuids = NULL;
- rl_printf("Application unregistered\n");
-
g_dbus_unregister_interface(conn, APP_PATH, PROFILE_INTERFACE);
}
diff --git a/client/main.c b/client/main.c
index 578dde9..31d06b8 100644
--- a/client/main.c
+++ b/client/main.c
return;
}
- if (w.we_wordc == 0) {
- rl_printf("Missing argument\n");
- return;
- }
-
gatt_register_app(dbus_conn, default_ctrl->proxy, &w);
wordfree(&w);
{ "write", "<data=[xx xx ...]>", cmd_write,
"Write attribute value" },
{ "notify", "<on/off>", cmd_notify, "Notify attribute value" },
- { "register-application", "<UUID ...>", cmd_register_app,
+ { "register-application", "[UUID ...]", cmd_register_app,
"Register profile to connect" },
{ "unregister-application", NULL, cmd_unregister_app,
"Unregister profile" },