summaryrefslogtreecommitdiff
path: root/obexd/src
diff options
context:
space:
mode:
authorGustavo Padovan <gustavo.padovan@collabora.co.uk>2013-05-28 14:45:22 -0300
committerLuiz Augusto von Dentz <luiz.von.dentz@intel.com>2013-05-29 14:40:06 +0300
commit2b7e5adeefb1eccad527b8e225f7f998ac452660 (patch)
tree0a7db94e5e51517a03275256fe70a490596b7aee /obexd/src
parent4d8c46d451ef59459e7c1e6e3d635866a86fc41c (diff)
session: add Source and Destination properties
This is useful when we want to know where a incoming OPP transfer, for example, is from.
Diffstat (limited to 'obexd/src')
-rw-r--r--obexd/src/manager.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/obexd/src/manager.c b/obexd/src/manager.c
index b86565c07..a116a3e02 100644
--- a/obexd/src/manager.c
+++ b/obexd/src/manager.c
@@ -265,6 +265,30 @@ static DBusMessage *unregister_agent(DBusConnection *conn,
return dbus_message_new_method_return(msg);
}
+static gboolean get_source(const GDBusPropertyTable *property,
+ DBusMessageIter *iter, void *data)
+{
+ struct obex_session *os = data;
+ char *s;
+
+ s = os->src;
+ dbus_message_iter_append_basic(iter, DBUS_TYPE_STRING, &s);
+
+ return TRUE;
+}
+
+static gboolean get_destination(const GDBusPropertyTable *property,
+ DBusMessageIter *iter, void *data)
+{
+ struct obex_session *os = data;
+ char *s;
+
+ s = os->dst;
+ dbus_message_iter_append_basic(iter, DBUS_TYPE_STRING, &s);
+
+ return TRUE;
+}
+
static gboolean session_target_exists(const GDBusPropertyTable *property,
void *data)
{
@@ -529,6 +553,8 @@ static const GDBusPropertyTable transfer_properties[] = {
};
static const GDBusPropertyTable session_properties[] = {
+ { "Source", "s", get_source },
+ { "Destination", "s", get_destination },
{ "Target", "s", get_target, NULL, session_target_exists },
{ "Root", "s", get_root },
{ }