aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/protocol/CellocatorProtocolDecoder.java
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2015-04-29 13:41:15 +1200
committerAnton Tananaev <anton.tananaev@gmail.com>2015-04-29 13:41:15 +1200
commitf7198adaf371e08a72a837d417b29531c117c6ba (patch)
tree853fb51b64cd00aaa6e53d4e510bbf69859e7765 /src/org/traccar/protocol/CellocatorProtocolDecoder.java
parentcb0a3831c2d89a22e9f3b68d3ee17f6e2abdd424 (diff)
downloadtrackermap-server-f7198adaf371e08a72a837d417b29531c117c6ba.tar.gz
trackermap-server-f7198adaf371e08a72a837d417b29531c117c6ba.tar.bz2
trackermap-server-f7198adaf371e08a72a837d417b29531c117c6ba.zip
Store other data in position
Diffstat (limited to 'src/org/traccar/protocol/CellocatorProtocolDecoder.java')
-rw-r--r--src/org/traccar/protocol/CellocatorProtocolDecoder.java12
1 files changed, 3 insertions, 9 deletions
diff --git a/src/org/traccar/protocol/CellocatorProtocolDecoder.java b/src/org/traccar/protocol/CellocatorProtocolDecoder.java
index a61c5b79f..2fac487c4 100644
--- a/src/org/traccar/protocol/CellocatorProtocolDecoder.java
+++ b/src/org/traccar/protocol/CellocatorProtocolDecoder.java
@@ -17,7 +17,6 @@ package org.traccar.protocol;
import java.nio.ByteOrder;
import java.util.Calendar;
-import java.util.Properties;
import java.util.TimeZone;
import org.jboss.netty.buffer.ChannelBuffer;
@@ -26,9 +25,6 @@ import org.jboss.netty.channel.Channel;
import org.jboss.netty.channel.ChannelHandlerContext;
import org.traccar.BaseProtocolDecoder;
-import org.traccar.database.DataManager;
-import org.traccar.helper.Log;
-import org.traccar.model.ExtendedInfoFormatter;
import org.traccar.model.Position;
public class CellocatorProtocolDecoder extends BaseProtocolDecoder {
@@ -106,7 +102,7 @@ public class CellocatorProtocolDecoder extends BaseProtocolDecoder {
// Parse location
if (type == MSG_CLIENT_STATUS) {
Position position = new Position();
- ExtendedInfoFormatter extendedInfo = new ExtendedInfoFormatter(getProtocol());
+ position.setProtocol(getProtocol());
// Device identifier
if (!identify(String.valueOf(deviceUniqueId))) {
@@ -119,7 +115,7 @@ public class CellocatorProtocolDecoder extends BaseProtocolDecoder {
buf.readUnsignedByte(); // protocol version
// Status
- extendedInfo.set("status", buf.getUnsignedByte(buf.readerIndex()) & 0x0f);
+ position.set("status", buf.getUnsignedByte(buf.readerIndex()) & 0x0f);
int operator = (buf.readUnsignedByte() & 0xf0) << 4;
operator += buf.readUnsignedByte();
@@ -131,7 +127,7 @@ public class CellocatorProtocolDecoder extends BaseProtocolDecoder {
operator <<= 8;
operator += buf.readUnsignedByte();
- extendedInfo.set("operator", operator);
+ position.set("operator", operator);
buf.readUnsignedInt(); // ADC
buf.readUnsignedMedium(); // milage
@@ -161,8 +157,6 @@ public class CellocatorProtocolDecoder extends BaseProtocolDecoder {
time.set(Calendar.MONTH, buf.readUnsignedByte() - 1);
time.set(Calendar.YEAR, buf.readUnsignedShort());
position.setTime(time.getTime());
-
- position.setExtendedInfo(extendedInfo.toString());
return position;
}