Home · All Namespaces · All Classes · Grouped Classes · Modules · Functions codeless banner

Time on an Embedded Device

Introduction

For a device to keep correct time with Qt Extended requires the following:

  1. the kernel must support a Real-Time Clock (RTC) interface and be built with the correct driver for the device RTC.
  2. the Linux distribution must contain /sbin/hwclock that accepts the -s and -w parameters.
  3. boot scripts set system-time from hardware-time on startup /sbin/hwclock -s.

Note: These processes should be tested on the device prior to Qt Extended controlling them.

External Time Sources

Devices may that have readily available external time sources, such as:

Such devices should report such updates by sending a storeExternalSource(QString,uint,int,int) message to the TimeUpdate service.

Currently, only one external source is supported.

If no external source is available, the user will need to set the time shortly after start-up, and the RTC will need to be sufficiently reliable.

Install Required Time Conversion files

Qt Extended requires Time Conversion data such as in <qt-extended-root-dir>/etc/zoneinfo to be on the device. To install the Time Conversion data files either:

  1. Create a symbolic link to the Time Conversion data files provided by Qt Extended, for example, on the device run:
        if [ ! -d /usr/share/zoneinfo ]; then ln -s /opt/Qtopia/etc/zoneinfo /usr/share/zoneinfo; fi
  2. Create a symbolic link to the Time Conversion data files provided by the device's environment, for example, on the device run:
        if [ -d /usr/share/zoneinfo ]; then rm -rf /opt/Qtopia/etc/zoneinfo; ln -s /usr/share/zoneinfo /opt/Qtopia/etc/zoneinfo ; fi
  3. If the Time Conversion data cannot be uploaded to the device's root file system modify the value of QTOPIA_ZONEINFO_PATH in the device's custom.h to point to where the Time Conversion data files are stored.


Copyright © 2009 Trolltech Trademarks
Qt Extended 4.4.3