gnokii-commit
[Top][All Lists]
Advanced

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

[SCM] libgnokii and core programs branch, master, updated. rel_0_6_29-41


From: Daniele Forsi
Subject: [SCM] libgnokii and core programs branch, master, updated. rel_0_6_29-418-g310b31a
Date: Thu, 06 Dec 2012 22:38:03 +0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "libgnokii and core programs".

The branch, master has been updated
       via  310b31a4b446ada706719c52b1e31caa66d15b27 (commit)
      from  bc3511394df31c3f3b956aac2ada743faa66ebe0 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://git.savannah.gnu.org/cgit/gnokii.git/commit/?id=310b31a4b446ada706719c52b1e31caa66d15b27


commit 310b31a4b446ada706719c52b1e31caa66d15b27
Author: Daniele Forsi <address@hidden>
Date:   Thu Dec 6 23:28:12 2012 +0100

    Show TP-Validity-Period in debug output

diff --git a/common/gsm-sms.c b/common/gsm-sms.c
index b468a77..dfe80eb 100644
--- a/common/gsm-sms.c
+++ b/common/gsm-sms.c
@@ -260,6 +260,24 @@ unsigned char *sms_timestamp_pack(gn_timestamp *dt, 
unsigned char *number)
        return number;
 }
 
+/**
+ * validity2minutes - converts from the PDU format to a number of minutes
+ * @minutes: the value encoded according to TS 23.040 Section 9.2.3.12.1 TP-VP 
(Relative format)
+ *
+ * Returns: the number of minutes
+ */
+static unsigned int validity2minutes(unsigned char value)
+{
+       if (value <= 143)
+               return (value + 1) * 5;
+       else if (value <= 167)
+               return 12 * 60 + (value - 143) * 30;
+       else if (value <= 196)
+               return (value - 166) * 60 * 24;
+       else /* if (value <= 255) */
+               return (value - 192) * 60 * 24 * 7;
+}
+
 /***
  *** DECODING SMS
  ***/
@@ -619,6 +637,23 @@ static gn_error sms_header_decode(gn_sms_raw *rawsms, 
gn_sms *sms, gn_sms_udh *u
        sms_timestamp_unpack(rawsms->smsc_time, &(sms->smsc_time));
        dprintf("\tDate: %s\n", sms_timestamp_print(rawsms->smsc_time));
 
+       /* TP-Validity-Period (TP-VP) */
+       if (sms->type == GN_SMS_MT_Submit || sms->type == GN_SMS_MT_SubmitSent) 
{
+               switch (rawsms->validity_indicator) {
+               case GN_SMS_VP_None:
+                       break;
+               case GN_SMS_VP_RelativeFormat:
+                       dprintf("\tValidity (relative format): %d minutes\n", 
validity2minutes(rawsms->validity[0]));
+                       break;
+               case GN_SMS_VP_EnhancedFormat:
+                       dprintf("\tValidity (enhanced format)\n");
+                       break;
+               case GN_SMS_VP_AbsoluteFormat:
+                       dprintf("\tValidity (absolute format)\n");
+                       break;
+               }
+       }
+
        /* Remote number */
        rawsms->remote_number[0] = (rawsms->remote_number[0] + 1) / 2 + 1;
        snprintf(sms->remote.number, sizeof(sms->remote.number), "%s", 
char_bcd_number_get(rawsms->remote_number));

-----------------------------------------------------------------------

Summary of changes:
 common/gsm-sms.c |   35 +++++++++++++++++++++++++++++++++++
 1 files changed, 35 insertions(+), 0 deletions(-)


hooks/post-receive
-- 
libgnokii and core programs



reply via email to

[Prev in Thread] Current Thread [Next in Thread]