codec.h File Reference

Time services - D-Bus encoding and decoding. More...

#include <time.h>
#include <dbus/dbus.h>

Functions

int decode_int (DBusMessageIter *iter, int *pval)
int decode_tm (DBusMessageIter *iter, struct tm *tm)
int decode_ctm (DBusMessageIter *iter, struct tm *tm)


Detailed Description

Copyright (C) 2008 Nokia. All rights reserved.

Author:
Simo Piiroinen <simo.piiroinen@nokia.com>

Raimo Vuonnala <raimo.vuonnala@nokia.com>


Function Documentation

int decode_int ( DBusMessageIter *  iter,
int *  pval 
)

Decode iteratively integer.

Parameters:
iter DBusMessageIter
pval Pointer to int to store the decoded integer
Returns:
-1 if error, 0 if success

int decode_tm ( DBusMessageIter *  iter,
struct tm *  tm 
)

Decode struct tm

Parameters:
iter DBusMessageIter
tm Pointer to struct tm to store the decoded time
Returns:
-1 if error, 0 if success

int decode_ctm ( DBusMessageIter *  iter,
struct tm *  tm 
)

Decode NET_TIME_IND to struct tm

The information may include the current date (day-month-year) and time (hour-minute-second) in UTC (Coordinated Universal Time), which is in practice same as GMT (Greenwich Mean Time).

Daylight Saving Time

Example 1:
if the time is 12:00:00 and time zone is GMT+2 hours and daylight saving time information is NET_DST_1_HOUR then the local time is 12:00:00 + 2 hours = 14:00:00. The Universal time is 12:00:00, the daylight saving is in use, so the normal time in that area would be 13:00:00.

Example 2:
if universal time information is missing, but time zone information indicates GMT - 10 hours, then the local time is 02:00:00 when universal time is 12:00:00.

Example 3:
if universal time information is missing and time zone information is missing, but daylight saving time information indicate NET_DST_1_HOUR then it can be known that daylight saving of 1 hour is used currently in the area and the current local time is +1 hours from the normal local time. However, if time zone is not known it is not possible to determine the local time. (The time zone might be known by some other means.)

See:

See spec: https://svni1.isource-nokia.nokia.com/isource/svnroot/ngsp-swd/ngsp-alpha/trunk/casw/telephony-adaptation/libcsnet/net_dbus_interface.txt

Parameters:
iter DBusMessageIter
tm Pointer to struct tm to store the decoded time. tm->tm_yday is the UTC offset in secs.
Returns:
-1 if error, 0 if success


Generated on Tue Feb 24 16:21:35 2009 for libtime/clockd by  doxygen 1.5.1