code question: gn_timestamp and S40 sent-sms datetime

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

code question: gn_timestamp and S40 sent-sms datetime

Raphaël Droz
Simply stated, why does gnokii use it's own struct for time
representation instead of relying upon the <time.h> tm struct.

> typedef struct {
>         int year;           /* The complete year specification -
>         e.g. 1999. Y2K :-) */
>         int month;          /* January = 1 */
>         int day;
>         int hour;
>         int minute;
>         int second;
>         int timezone;      /* The difference between local time and GMT.
>                               Note that different SMSC software treat
>                               this field
>                               in the different ways. */
> } gn_timestamp;



> struct tm {
>     int tm_sec;         /* seconds */
>     int tm_min;         /* minutes */
>     int tm_hour;        /* hours */
>     int tm_mday;        /* day of the month */
>     int tm_mon;         /* month */
>     int tm_year;        /* year */
>     int tm_wday;        /* day of the week */
>     int tm_yday;        /* day in the year */
>     int tm_isdst;       /* daylight saving time */
> };
[...]
> The glibc version of struct tm has additional fields
>        long tm_gmtoff;           /* Seconds east of UTC */
>        const char *tm_zone;      /* Timezone abbreviation */


I wanted to polish this patch [1]:
"Export of datetime of Sent/OUT SMS on Nokia S40"
... and felt like this gn_timestamp is a bit subtle.
Is it needed at all?


Side note: the above mentioned patch could be tested. Sent SMS retrieved
should now contains a correct date, this only issue being timezone
interpretation. I guess that Nokia S40 filename notation contain an UTC
datetime but I yet have to find why resulting SMS output file appends the local
timezone.


Side question, anything like:
http://wammu.eu/docs/manual/protocol/nokia-s40-sms.html

but describing the 80 hexadecimal digits of SMS filenames would be quite
appreciated.
(At least are now identified the digit in the interval [8-15])

Next step would be fetching the destination number.




[1] Export of datetime of Sent/OUT SMS on Nokia S40:
https://gitorious.org/drzraf/gnokii/commit/d19fb7409afb0dc4a5e5d6d15ae3128714fabff4




best regards

--
GPG id: 0xF41572CEBD4218F4

_______________________________________________
gnokii-users mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/gnokii-users