[PATCH 5/5] obexd: Add parameter Status to GetMessageListing response

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Christian Fetzer <christian.fetzer@xxxxxxxxxxxx>

The parameter Status indicates the status of reception of the message.
It can be used to differentiate between messages with a reception status
of "completed", "fractioned" and "notification".

This parameter got lost when obexd was refactored to use of D-Bus properties.
The documentation and the parsing code for it was still there.
---
 obexd/client/map.c | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

diff --git a/obexd/client/map.c b/obexd/client/map.c
index f9f7c4f..ea5681a 100644
--- a/obexd/client/map.c
+++ b/obexd/client/map.c
@@ -595,6 +595,24 @@ static gboolean get_size(const GDBusPropertyTable *property,
 	return TRUE;
 }
 
+static gboolean reception_status_exists(const GDBusPropertyTable *property,
+								void *data)
+{
+	struct map_msg *msg = data;
+
+	return msg->status != NULL;
+}
+
+static gboolean get_reception_status(const GDBusPropertyTable *property,
+					DBusMessageIter *iter, void *data)
+{
+	struct map_msg *msg = data;
+
+	dbus_message_iter_append_basic(iter, DBUS_TYPE_STRING, &msg->status);
+
+	return TRUE;
+}
+
 static gboolean get_attachment_size(const GDBusPropertyTable *property,
 					DBusMessageIter *iter, void *data)
 {
@@ -732,6 +750,7 @@ static const GDBusPropertyTable map_msg_properties[] = {
 	{ "Type", "s", get_type, NULL, type_exists },
 	{ "Size", "t", get_size },
 	{ "Text", "b", get_text },
+	{ "Status", "s", get_reception_status, NULL, reception_status_exists },
 	{ "AttachmentSize", "t", get_attachment_size },
 	{ "Priority", "b", get_priority },
 	{ "Read", "b", get_read, set_read },
-- 
1.8.1

--
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


[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux