From dd6db81db43f5c23e5349c0b06d4a0ce6830d127 Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Wed, 23 Mar 2011 12:33:29 +0000 Subject: --- src/net/sourceforge/opentracking/TrackerEventHandler.java | 10 +++++++++- .../opentracking/protocol/xexun/XexunProtocolDecoder.java | 2 ++ 2 files changed, 11 insertions(+), 1 deletion(-) (limited to 'src/net/sourceforge') diff --git a/src/net/sourceforge/opentracking/TrackerEventHandler.java b/src/net/sourceforge/opentracking/TrackerEventHandler.java index d052cb86e..7bd3f5501 100644 --- a/src/net/sourceforge/opentracking/TrackerEventHandler.java +++ b/src/net/sourceforge/opentracking/TrackerEventHandler.java @@ -44,7 +44,15 @@ public class TrackerEventHandler extends SimpleChannelHandler { Position position = (Position) e.getMessage(); - System.out.println("id: " + position.getDeviceId() + ", lat: " + position.getLatitude() + ", lon: " + position.getLongitude() ); + System.out.println( + "id: " + position.getId() + + ", deviceId: " + position.getDeviceId() + + ", valid: " + position.getValid() + + ", time: " + position.getTime() + + ", latitude: " + position.getLatitude() + + ", longitude: " + position.getLongitude() + + ", speed: " + position.getSpeed() + + ", course: " + position.getCourse()); // Write position to database try { diff --git a/src/net/sourceforge/opentracking/protocol/xexun/XexunProtocolDecoder.java b/src/net/sourceforge/opentracking/protocol/xexun/XexunProtocolDecoder.java index 15cb99f55..7b21a1a72 100644 --- a/src/net/sourceforge/opentracking/protocol/xexun/XexunProtocolDecoder.java +++ b/src/net/sourceforge/opentracking/protocol/xexun/XexunProtocolDecoder.java @@ -112,6 +112,8 @@ public class XexunProtocolDecoder extends OneToOneDecoder { String course = parser.group(index++); if (course != null) { position.setCourse(Double.valueOf(course)); + } else { + position.setCourse(0.0); } // Date -- cgit v1.2.3