mcc_tz_utils.h File Reference

Time services - utils to work with country timezones. More...


Functions

int mcc_tz_is_tz_name_in_country_tz_list (const char *tz_name)
void mcc_tz_guess_tz_for_country_by_dst_and_offset (struct tm *utc_tm, int dst, int gmtoff, char **tz_name)
void mcc_tz_setup_timezone_from_mcc_if_required (void)
void mcc_tz_handle_registration_status_reply (struct DBusMessage *msg)
int mcc_tz_utils_init (struct DBusConnection *server_system_bus, GetAutosyncEnabled server_get_autosync_enabled, HandleCsdNetTimeChange server_handle_csd_net_time_change, SetOperatorTz server_set_operator_tz)
void mcc_tz_utils_quit (void)


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 mcc_tz_is_tz_name_in_country_tz_list ( const char *  tz_name  ) 

Checks if given timezone name is in timezone list for currnt country

Parameters:
tz_name timezone name for searching
Returns:
1 if given timezone name found in country_tz_name_list or 0 otherwise

Referenced by handle_csd_net_time_change().

void mcc_tz_guess_tz_for_country_by_dst_and_offset ( struct tm *  utc_tm,
int  dst,
int  gmtoff,
char **  tz_name 
)

Guesses named timezone for current country which has the same DST and GMT offset as requested in given UTC time. Returns first found name in tz_name or NULL if not found.

Parameters:
utc_tm UTC time to search in
dst DST for searching timezone in given UTC time
gmtoff GMT offset for searching timezone in given UTC time
tz_name name of found timezone for requested parameters or NULL if not found It shall not be freed since it is pointer to string contained in country_tz_name_list Also the user must dup this string if it is needed in next mainloop cycle since the list might be updated in-between.

Referenced by handle_csd_net_time_change().

void mcc_tz_setup_timezone_from_mcc_if_required ( void   ) 

If autoupdate is on, it sends get registration status request to CSD. It launches procedure to update time if device is registered in network.

Also the method asks D-Bus to notify about registration status change signal if time autoupdate is on and remove this tracking if time autoupdate is off. The signal is handled by server_filter (refer to mcc_tz_init also).

If autoupdate is on, it sends get registration status request to CSD. It launches procedure to update time if device is registered in network. Reply is catched by mcc_tz_registration_status_reply_dbus_cb callback.

Also the method asks D-Bus to notify about registration status change signal if time autoupdate is on and remove this tracking if time autoupdate is off. The signal is handled by server_filter (refer to mcc_tz_init also).

Referenced by mcc_tz_utils_init(), and server_set_autosync_cb().

void mcc_tz_handle_registration_status_reply ( DBusMessage *  msg  ) 

Handle reply on get registration status request to CSD. If registered in home or roaming network and received MCC is not equal to cached one, launch network time update attempt, since country (and timezone probably) is changed.

Parameters:
msg D-Bus reply on get registration status request to CSD

Referenced by mcc_tz_registration_status_reply_dbus_cb(), and server_filter().

int mcc_tz_utils_init ( DBusConnection *  server_system_bus,
GetAutosyncEnabled  server_get_autosync_enabled,
HandleCsdNetTimeChange  server_handle_csd_net_time_change,
SetOperatorTz  server_set_operator_tz 
)

Fuction to init mcc_tz module

Parameters:
server_system_bus pointer to system DBUS
server_get_autosync_enabled pointer to function to get autosync_enabled value
server_handle_csd_net_time_change pointer to function to handle time info message from csd
server_set_operator_tz pointer to function to set operator timezone
Returns:
-1 if error, 0 otherwise

Referenced by server_init().

void mcc_tz_utils_quit ( void   ) 

Fuction to free resources allocated by mcc_tz module

Referenced by server_quit().


Generated on Mon Jun 21 15:45:53 2010 for clockd by  doxygen 1.5.6