aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAleksander Morgado <aleksander@lanedo.com>2012-09-11 15:03:08 +0200
committerAleksander Morgado <aleksander@lanedo.com>2012-09-14 07:05:25 +0200
commit320984a4a00b886a7c6b61aa48413900efe56e86 (patch)
treeca4f7fd8ff990dce792495410cde5b9d643e8d45
parentf1a73a5719002426f1f0a7ffdbec1dc1822c794c (diff)
api: new `DischargeTimestamp' property for Status Report SMS messages
-rw-r--r--introspection/org.freedesktop.ModemManager1.Sms.xml18
-rw-r--r--src/mm-sms-part.c8
-rw-r--r--src/mm-sms-part.h6
-rw-r--r--src/mm-sms.c3
4 files changed, 31 insertions, 4 deletions
diff --git a/introspection/org.freedesktop.ModemManager1.Sms.xml b/introspection/org.freedesktop.ModemManager1.Sms.xml
index e382bd95..acdd2120 100644
--- a/introspection/org.freedesktop.ModemManager1.Sms.xml
+++ b/introspection/org.freedesktop.ModemManager1.Sms.xml
@@ -120,13 +120,29 @@
<!--
Timestamp:
- Time message was received or was sent, in
+ Time when the first PDU of the SMS message arrived the SMSC, in
<ulink url="http://en.wikipedia.org/wiki/ISO_8601">ISO8601</ulink>
format.
+ This field is only applicable if the PDU type is
+ <link linkend="MM-SMS-PDU-TYPE-DELIVER:CAPS"><constant>MM_SMS_PDU_TYPE_DELIVER</constant></link>.
+ or
+ <link linkend="MM-SMS-PDU-TYPE-STATUS-REPORT:CAPS"><constant>MM_SMS_PDU_TYPE_STATUS_REPORT</constant></link>.
-->
<property name="Timestamp" type="s" access="read" />
<!--
+ DischargeTimestamp:
+
+ Time when the first PDU of the SMS message left the SMSC, in
+ <ulink url="http://en.wikipedia.org/wiki/ISO_8601">ISO8601</ulink>
+ format.
+
+ This field is only applicable if the PDU type is
+ <link linkend="MM-SMS-PDU-TYPE-STATUS-REPORT:CAPS"><constant>MM_SMS_PDU_TYPE_STATUS_REPORT</constant></link>.
+ -->
+ <property name="DischargeTimestamp" type="s" access="read" />
+
+ <!--
Storage:
A <link linkend="MMSmsStorage">MMSmsStorage</link> value,
diff --git a/src/mm-sms-part.c b/src/mm-sms-part.c
index d252a85e..a42c8f53 100644
--- a/src/mm-sms-part.c
+++ b/src/mm-sms-part.c
@@ -321,6 +321,7 @@ struct _MMSmsPart {
MMSmsPduType pdu_type;
gchar *smsc;
gchar *timestamp;
+ gchar *discharge_timestamp;
gchar *number;
gchar *text;
MMSmsEncoding encoding;
@@ -339,6 +340,7 @@ struct _MMSmsPart {
void
mm_sms_part_free (MMSmsPart *self)
{
+ g_free (self->discharge_timestamp);
g_free (self->timestamp);
g_free (self->smsc);
g_free (self->number);
@@ -390,6 +392,8 @@ PART_GET_FUNC (const gchar *, number)
PART_SET_TAKE_STR_FUNC (number)
PART_GET_FUNC (const gchar *, timestamp)
PART_SET_TAKE_STR_FUNC (timestamp)
+PART_GET_FUNC (const gchar *, discharge_timestamp)
+PART_SET_TAKE_STR_FUNC (discharge_timestamp)
PART_GET_FUNC (guint, concat_max)
PART_SET_FUNC (guint, concat_max)
PART_GET_FUNC (guint, concat_sequence)
@@ -680,8 +684,8 @@ mm_sms_part_new_from_binary_pdu (guint index,
offset += 7;
/* ------ Discharge Timestamp (7 bytes) ------ */
- mm_sms_part_take_timestamp (sms_part,
- sms_decode_timestamp (&pdu[offset]));
+ mm_sms_part_take_discharge_timestamp (sms_part,
+ sms_decode_timestamp (&pdu[offset]));
offset += 7;
/* ----- TP-STATUS (1 byte) ------ */
diff --git a/src/mm-sms-part.h b/src/mm-sms-part.h
index 2d61e99e..c64914c7 100644
--- a/src/mm-sms-part.h
+++ b/src/mm-sms-part.h
@@ -74,6 +74,12 @@ void mm_sms_part_set_timestamp (MMSmsPart *part,
void mm_sms_part_take_timestamp (MMSmsPart *part,
gchar *timestamp);
+const gchar *mm_sms_part_get_discharge_timestamp (MMSmsPart *part);
+void mm_sms_part_set_discharge_timestamp (MMSmsPart *part,
+ const gchar *timestamp);
+void mm_sms_part_take_discharge_timestamp (MMSmsPart *part,
+ gchar *timestamp);
+
const gchar *mm_sms_part_get_text (MMSmsPart *part);
void mm_sms_part_set_text (MMSmsPart *part,
const gchar *text);
diff --git a/src/mm-sms.c b/src/mm-sms.c
index affe92d3..20dcc0da 100644
--- a/src/mm-sms.c
+++ b/src/mm-sms.c
@@ -1182,8 +1182,9 @@ assemble_sms (MMSms *self,
"smsc", mm_sms_part_get_smsc (sorted_parts[0]),
"class", mm_sms_part_get_class (sorted_parts[0]),
"number", mm_sms_part_get_number (sorted_parts[0]),
- "timestamp", mm_sms_part_get_timestamp (sorted_parts[0]),
"validity", mm_sms_part_get_validity (sorted_parts[0]),
+ "timestamp", mm_sms_part_get_timestamp (sorted_parts[0]),
+ "discharge-timestamp", mm_sms_part_get_discharge_timestamp (sorted_parts[0]),
/* delivery report request usually set in the last part only */
"delivery-report-request", mm_sms_part_get_delivery_report_request (sorted_parts[self->priv->max_parts - 1]),
NULL);