[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: gnokiid AT command reference
From: |
Pawel Kot |
Subject: |
Re: gnokiid AT command reference |
Date: |
Sun, 6 Feb 2005 16:28:36 +0100 (CET) |
On Sun, 6 Feb 2005, Daniele Forsi wrote:
Saturday 05 February 2005 21:03, Pawel Kot wrote:
I'm afraid I need more detailes in here. I don't know in which place it
appears as 1905 not 2005. It should be easy to fix, but dunno where...
Last time I mixed things, now I found my way :-)
1905 appears only in debug output, normal output is ok
./common/gsm-sms.c sms_timestamp_print()
if (number[0] < 70) sprintf(buffer, "20");
else sprintf(buffer, "19");
but number[0] has swapped nibbles so year 2005 is 0x50 and 0x50 > 70
Right. Does it it fix things for you:
--- common/gsm-sms.c~ 2005-02-06 15:22:05.000000000 +0100
+++ common/gsm-sms.c 2005-02-06 15:22:05.000000000 +0100
@@ -146,7 +146,7 @@
/* Ugly hack, but according to the GSM specs, the year is stored
* as the 2 digit number. */
- if (number[0] < 70) sprintf(buffer, "20");
+ if ((10*(number[0] & 0x0f) + number[0] >> 4) < 70) sprintf(buffer,
"20");
else sprintf(buffer, "19");
sprintf(buffer, "%s%d%d-", buffer, number[0] & 0x0f, number[0] >> 4);
pkot
--
p k o t a t b e z s e n s u d o t p l
http://www.gnokii.org/