From cfabe7e35afaf53cbd24087b49d61363e6d8cafc Mon Sep 17 00:00:00 2001 From: Reuben Thomas Date: Fri, 5 Jan 2007 20:00:45 +0000 Subject: Fix time setting where the Psion is not on GMT/UTC. --- lib/rpcs32.cc | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'lib/rpcs32.cc') 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 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; -- cgit v1.2.3