diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2013-01-15 00:19:39 +1300 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2013-01-15 00:19:39 +1300 |
commit | b5bd3e35f563825c9d40eaa04c02bc6397029219 (patch) | |
tree | 05684875856d3908fdec3c582ecbf2153a5bdfb8 /src/org/traccar/protocol/V680ProtocolDecoder.java | |
parent | 38fbc3e872717a1179abd00a48b600b489f9fead (diff) | |
download | trackermap-server-b5bd3e35f563825c9d40eaa04c02bc6397029219.tar.gz trackermap-server-b5bd3e35f563825c9d40eaa04c02bc6397029219.tar.bz2 trackermap-server-b5bd3e35f563825c9d40eaa04c02bc6397029219.zip |
Pass ServerManager to every protocol decoder
Diffstat (limited to 'src/org/traccar/protocol/V680ProtocolDecoder.java')
-rw-r--r-- | src/org/traccar/protocol/V680ProtocolDecoder.java | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/src/org/traccar/protocol/V680ProtocolDecoder.java b/src/org/traccar/protocol/V680ProtocolDecoder.java index 57e5982dc..c8a16c377 100644 --- a/src/org/traccar/protocol/V680ProtocolDecoder.java +++ b/src/org/traccar/protocol/V680ProtocolDecoder.java @@ -21,21 +21,21 @@ import java.util.regex.Matcher; import java.util.regex.Pattern; import org.jboss.netty.channel.Channel; import org.jboss.netty.channel.ChannelHandlerContext; -import org.traccar.GenericProtocolDecoder; +import org.traccar.BaseProtocolDecoder; +import org.traccar.ServerManager; import org.traccar.helper.Log; -import org.traccar.model.DataManager; import org.traccar.model.Position; /** * V680 tracker protocol decoder */ -public class V680ProtocolDecoder extends GenericProtocolDecoder { +public class V680ProtocolDecoder extends BaseProtocolDecoder { /** * Initialize */ - public V680ProtocolDecoder(DataManager dataManager) { - super(dataManager); + public V680ProtocolDecoder(ServerManager serverManager) { + super(serverManager); } /** @@ -95,41 +95,41 @@ public class V680ProtocolDecoder extends GenericProtocolDecoder { // Validity position.setValid(parser.group(index++).compareTo("1") == 0 ? true : false); - + // Password extendedInfo.append("<password>"); extendedInfo.append(parser.group(index++)); extendedInfo.append("</password>"); - + // Packet number extendedInfo.append("<packet>"); extendedInfo.append(parser.group(index++)); extendedInfo.append("</packet>"); - + // GSM base station extendedInfo.append("<gsm>"); extendedInfo.append(parser.group(index++)); extendedInfo.append("</gsm>"); - + // Longitude Double lonlitude = Double.valueOf(parser.group(index++)); lonlitude += Double.valueOf(parser.group(index++)) / 60; if (parser.group(index++).compareTo("W") == 0) lonlitude = -lonlitude; position.setLongitude(lonlitude); - + // Latitude Double latitude = Double.valueOf(parser.group(index++)); latitude += Double.valueOf(parser.group(index++)) / 60; if (parser.group(index++).compareTo("S") == 0) latitude = -latitude; position.setLatitude(latitude); - + // Altitude position.setAltitude(0.0); // Speed and Course position.setSpeed(Double.valueOf(parser.group(index++))); position.setCourse(Double.valueOf(parser.group(index++))); - + // Date Calendar time = Calendar.getInstance(TimeZone.getTimeZone("UTC")); time.clear(); |