diff options
author | Alex Deymo <deymo@chromium.org> | 2013-03-21 15:04:54 -0700 |
---|---|---|
committer | Johan Hedberg <johan.hedberg@intel.com> | 2013-03-25 12:56:55 +0200 |
commit | d52e8994b51631a7d10abea30924e3124e2de462 (patch) | |
tree | 8b0a98a55e3297ce99dad05cea1221f39f5e9447 /client/agent.c | |
parent | b776f04171d4231a35d8178501bb2d6c970dbada (diff) | |
download | bluez-d52e8994b51631a7d10abea30924e3124e2de462.tar.gz |
client: Agent's DisplayPincode implementation
Implements the DisplayPinCode(object device, string pincode) method.
Diffstat (limited to 'client/agent.c')
-rw-r--r-- | client/agent.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/client/agent.c b/client/agent.c index 0c533efb6..71454cc7d 100644 --- a/client/agent.c +++ b/client/agent.c @@ -175,6 +175,20 @@ static DBusMessage *request_pincode(DBusConnection *conn, return NULL; } +static DBusMessage *display_pincode(DBusConnection *conn, + DBusMessage *msg, void *user_data) +{ + const char *device; + const char *pincode; + + dbus_message_get_args(msg, NULL, DBUS_TYPE_OBJECT_PATH, &device, + DBUS_TYPE_STRING, &pincode, DBUS_TYPE_INVALID); + + rl_printf(AGENT_PROMPT "PIN code: %s\n", pincode); + + return dbus_message_new_method_return(msg); +} + static DBusMessage *request_confirmation(DBusConnection *conn, DBusMessage *msg, void *user_data) { @@ -250,6 +264,9 @@ static const GDBusMethodTable methods[] = { { GDBUS_ASYNC_METHOD("RequestPinCode", GDBUS_ARGS({ "device", "o" }), GDBUS_ARGS({ "pincode", "s" }), request_pincode) }, + { GDBUS_METHOD("DisplayPinCode", + GDBUS_ARGS({ "device", "o" }, { "pincode", "s" }), + NULL, display_pincode) }, { GDBUS_ASYNC_METHOD("RequestConfirmation", GDBUS_ARGS({ "device", "o" }, { "passkey", "u" }), NULL, request_confirmation) }, |