diff options
Diffstat (limited to 'src/org/traccar/protocol/SpotProtocolDecoder.java')
-rw-r--r-- | src/org/traccar/protocol/SpotProtocolDecoder.java | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/org/traccar/protocol/SpotProtocolDecoder.java b/src/org/traccar/protocol/SpotProtocolDecoder.java index ed6a03c5f..a8e666a32 100644 --- a/src/org/traccar/protocol/SpotProtocolDecoder.java +++ b/src/org/traccar/protocol/SpotProtocolDecoder.java @@ -72,8 +72,7 @@ public class SpotProtocolDecoder extends BaseHttpProtocolDecoder { DeviceSession deviceSession = getDeviceSession(channel, remoteAddress, xPath.evaluate("esnName", node)); if (deviceSession != null) { - Position position = new Position(); - position.setProtocol(getProtocolName()); + Position position = new Position(getProtocolName()); position.setDeviceId(deviceSession.getDeviceId()); position.setValid(true); @@ -81,6 +80,8 @@ public class SpotProtocolDecoder extends BaseHttpProtocolDecoder { position.setLatitude(Double.parseDouble(xPath.evaluate("latitude", node))); position.setLongitude(Double.parseDouble(xPath.evaluate("longitude", node))); + position.set(Position.KEY_EVENT, xPath.evaluate("messageType", node)); + positions.add(position); } |