diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2010-04-19 16:03:31 +0000 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2010-04-19 16:03:31 +0000 |
commit | 69c75bec0b0423e038452bf126c39baa7196adfd (patch) | |
tree | be568862a1995f39321a429a5bf041457b743981 /src/net/sourceforge/opentracking/protocol | |
parent | 79cb531f8511d0a4f34327b0df4f858bd7cf68f3 (diff) | |
download | trackermap-server-69c75bec0b0423e038452bf126c39baa7196adfd.tar.gz trackermap-server-69c75bec0b0423e038452bf126c39baa7196adfd.tar.bz2 trackermap-server-69c75bec0b0423e038452bf126c39baa7196adfd.zip |
Diffstat (limited to 'src/net/sourceforge/opentracking/protocol')
-rw-r--r-- | src/net/sourceforge/opentracking/protocol/gps103/Gps103ProtocolDecoder.java | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/net/sourceforge/opentracking/protocol/gps103/Gps103ProtocolDecoder.java b/src/net/sourceforge/opentracking/protocol/gps103/Gps103ProtocolDecoder.java index 63b1e0f13..bcce3531c 100644 --- a/src/net/sourceforge/opentracking/protocol/gps103/Gps103ProtocolDecoder.java +++ b/src/net/sourceforge/opentracking/protocol/gps103/Gps103ProtocolDecoder.java @@ -17,6 +17,7 @@ package net.sourceforge.opentracking.protocol.gps103; import java.util.Calendar; import java.util.GregorianCalendar; +import java.util.TimeZone; import java.util.regex.Pattern; import java.util.regex.Matcher; import org.jboss.netty.channel.Channel; @@ -69,7 +70,9 @@ public class Gps103ProtocolDecoder extends OneToOneDecoder { throws Exception { // Parse message + String sentence = (String) msg; + System.out.println("message: " + sentence); Matcher parser = pattern.matcher(sentence); if (!parser.matches()) { return null; @@ -85,8 +88,7 @@ public class Gps103ProtocolDecoder extends OneToOneDecoder { position.setDeviceId(dataManager.getDeviceByImei(imei).getId()); // Time - Calendar time = new GregorianCalendar(); - time.clear(); + Calendar time = new GregorianCalendar(TimeZone.getTimeZone("UTC")); time.set(Calendar.HOUR, Integer.valueOf(parser.group(index++))); time.set(Calendar.MINUTE, Integer.valueOf(parser.group(index++))); time.set(Calendar.SECOND, Integer.valueOf(parser.group(index++))); |