This allows to accept or reject rebond consent from bluetoothd. --- client/agent.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/client/agent.c b/client/agent.c index 2cbc292..e4b1f01 100644 --- a/client/agent.c +++ b/client/agent.c @@ -144,6 +144,8 @@ dbus_bool_t agent_input(DBusConnection *conn, const char *input) confirm_response(conn, input); else if (!strcmp(member, "AuthorizeService")) confirm_response(conn, input); + else if (!strcmp(member, "RebondConsent")) + confirm_response(conn, input); else g_dbus_send_error(conn, pending_message, "org.bluez.Error.Canceled", NULL); @@ -310,6 +312,23 @@ static DBusMessage *authorize_service(DBusConnection *conn, return NULL; } +static DBusMessage *rebond_consent(DBusConnection *conn, + DBusMessage *msg, void *user_data) +{ + const char *device; + + rl_printf("Rebond Consent\n"); + + dbus_message_get_args(msg, NULL, DBUS_TYPE_OBJECT_PATH, &device, + DBUS_TYPE_INVALID); + + agent_prompt("Remote Device lost bond. Rebond (yes/no): "); + + pending_message = dbus_message_ref(msg); + + return NULL; +} + static DBusMessage *cancel_request(DBusConnection *conn, DBusMessage *msg, void *user_data) { @@ -346,6 +365,9 @@ static const GDBusMethodTable methods[] = { { GDBUS_ASYNC_METHOD("AuthorizeService", GDBUS_ARGS({ "device", "o" }, { "uuid", "s" }), NULL, authorize_service) }, + { GDBUS_ASYNC_METHOD("RebondConsent", + GDBUS_ARGS({ "device", "o" }), + NULL, rebond_consent) }, { GDBUS_METHOD("Cancel", NULL, NULL, cancel_request) }, { } }; -- 2.7.4 -- To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html