reply_val = BT_AGENT_CANCEL;
}
+ BT_DBG("reply_val: %d", reply_val);
+
g_dbus_proxy_call(ad->agent_proxy,
"ReplyAuthorize",
g_variant_new("(u)", reply_val),
static GDBusProxy* __bluetooth_create_agent_proxy(GDBusConnection *conn,
const char *path)
{
- return g_dbus_proxy_new_sync(conn, G_DBUS_PROXY_FLAGS_NONE,
- NULL, "org.projectx.bt",
- path,
- "org.bluez.Agent1",
- NULL, NULL);
+ if (g_strcmp0(path, "/org/bluez/hfp_agent") == 0) {
+ BT_INFO("AG Agent requested");
+ return g_dbus_proxy_new_sync(conn, G_DBUS_PROXY_FLAGS_NONE,
+ NULL, "org.bluez.ag_agent",
+ path,
+ "org.bluez.Profile1",
+ NULL, NULL);
+ } else if(g_strcmp0(path, "/org/obex/server_agent") == 0) {
+ BT_INFO("bt-service %s requested", path);
+ return g_dbus_proxy_new_sync(conn, G_DBUS_PROXY_FLAGS_NONE,
+ NULL, "org.projectx.bt",
+ path,
+ "org.bluez.obex.reply",
+ NULL, NULL);
+
+ } else {
+ return g_dbus_proxy_new_sync(conn, G_DBUS_PROXY_FLAGS_NONE,
+ NULL, "org.projectx.bt",
+ path,
+ "org.bluez.Agent1",
+ NULL, NULL);
+ }
+
}
static void