diff options
author | Reuben Thomas <rrt@sc3d.org> | 2007-01-05 20:00:45 +0000 |
---|---|---|
committer | Reuben Thomas <rrt@sc3d.org> | 2007-01-05 20:00:45 +0000 |
commit | cfabe7e35afaf53cbd24087b49d61363e6d8cafc (patch) | |
tree | ab7b74771f7deee0265bf7c3fbe2f9bf81e64a2d /lib | |
parent | 7b386cce80d475e3495051e99e9ef180d02fa097 (diff) | |
download | plptools-cfabe7e35afaf53cbd24087b49d61363e6d8cafc.tar.gz plptools-cfabe7e35afaf53cbd24087b49d61363e6d8cafc.tar.bz2 plptools-cfabe7e35afaf53cbd24087b49d61363e6d8cafc.zip |
Fix time setting where the Psion is not on GMT/UTC.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/rpcs32.cc | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/lib/rpcs32.cc b/lib/rpcs32.cc index 27ca4ee..5febcde 100644 --- a/lib/rpcs32.cc +++ b/lib/rpcs32.cc @@ -173,21 +173,21 @@ setTime(time_t time) { bufferStore a; Enum<rfsv::errs> res; - PsiTime pt = PsiTime(time); + PsiTime pt; psi_timezone ptz; rpcs::machineInfo mi; - // cout << "settime" << endl; - a.addDWord(pt.getPsiTimeLo()); - a.addDWord(pt.getPsiTimeHi()); - if ((res = getMachineInfo(mi)) == - rfsv::E_PSI_GEN_NONE) { - a.addDWord(mi.countryCode); + // cout << "settime" << endl; + if ((res = getMachineInfo(mi)) == rfsv::E_PSI_GEN_NONE) { if (PsiZone::getInstance().getZone(ptz)) { + pt = PsiTime(time + ptz.utc_offset); + a.addDWord(pt.getPsiTimeLo()); + a.addDWord(pt.getPsiTimeHi()); + a.addDWord(mi.countryCode); a.addDWord(ptz.utc_offset); a.addDWord(ptz.dst_zones); a.addDWord(ptz.home_zone); - // cout << "a=" << a << endl; + // cout << "a=" << a << endl; if (!sendCommand(rpcs::SET_TIME, a)) return rfsv::E_PSI_FILE_DISC; return rfsv::E_PSI_GEN_NONE; |