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


From: Daniele Forsi
Subject: [SCM] libgnokii and core programs branch, master, updated. rel_0_6_29-18-g59d4eea
Date: Tue, 18 May 2010 15:33:18 +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  59d4eeaa8ac20ad6b0d770f4b1ddf283e2e4edf5 (commit)
      from  5246a3b9a5f21d99c26ad17e0c213d036cd24031 (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=59d4eeaa8ac20ad6b0d770f4b1ddf283e2e4edf5


commit 59d4eeaa8ac20ad6b0d770f4b1ddf283e2e4edf5
Author: Daniele Forsi <address@hidden>
Date:   Thu May 13 10:58:02 2010 +0200

    Fix reading date of SMS sent in some Nokia Series 40
    
    Treat block[2] as high byte of year. Fixes reading year 2010 and later.

diff --git a/common/phones/nk6510.c b/common/phones/nk6510.c
index bf3ba7c..e317ba6 100644
--- a/common/phones/nk6510.c
+++ b/common/phones/nk6510.c
@@ -799,7 +799,7 @@ static void ResetLayout(unsigned char *message, gn_data 
*data)
 
 static void ParseLayout(unsigned char *message, gn_data *data)
 {
-       int i, j, subblocks;
+       int i, j, subblocks, year;
        unsigned char *block = message;
 
        ResetLayout(message, data);
@@ -914,9 +914,9 @@ static void ParseLayout(unsigned char *message, gn_data 
*data)
                        break;
                case 0x84: /* Time blocks (not BCD encoded) */
                        /* Make it BCD format then ;-) */
-                       /* This is an ugly hack. Dunno how to do it correctly 
for now */
-                       data->raw_sms->smsc_time[0] = ((block[3] & 0x0f) / 10) 
+ (((block[3] & 0x0f) % 10) << 4);
-                       for (j = 1; j < block[2]; j++) {
+                       year = ((block[2] << 8) + block[3]) % 100;
+                       data->raw_sms->smsc_time[0] = (year / 10) + ((year % 
10) << 4);
+                       for (j = 1; j < GN_SMS_DATETIME_MAX_LENGTH; j++) {
                                data->raw_sms->smsc_time[j] =
                                        (block[j+3] / 10) + ((block[j+3] % 10) 
<< 4);
                        }

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

Summary of changes:
 common/phones/nk6510.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)


hooks/post-receive
-- 
libgnokii and core programs



reply via email to

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