aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/protocol/T800xProtocolDecoder.java
diff options
context:
space:
mode:
authorAbyss777 <abyss@fox5.ru>2016-05-26 09:30:43 +0500
committerAbyss777 <abyss@fox5.ru>2016-05-26 09:30:43 +0500
commitaa12e5c750e771016545269ffa39409b06b47eee (patch)
treed21b4414b532bfc53c9a905f3caa09f70b43b59e /src/org/traccar/protocol/T800xProtocolDecoder.java
parentac2405f0d57fac51fe95aa755f90fe82f26f73bc (diff)
downloadtrackermap-server-aa12e5c750e771016545269ffa39409b06b47eee.tar.gz
trackermap-server-aa12e5c750e771016545269ffa39409b06b47eee.tar.bz2
trackermap-server-aa12e5c750e771016545269ffa39409b06b47eee.zip
- Simplification of the hierarchy of models classes
- Removed automatically founded unnecessary imports
Diffstat (limited to 'src/org/traccar/protocol/T800xProtocolDecoder.java')
-rw-r--r--src/org/traccar/protocol/T800xProtocolDecoder.java23
1 files changed, 11 insertions, 12 deletions
diff --git a/src/org/traccar/protocol/T800xProtocolDecoder.java b/src/org/traccar/protocol/T800xProtocolDecoder.java
index c5dc103b1..67a4d55ca 100644
--- a/src/org/traccar/protocol/T800xProtocolDecoder.java
+++ b/src/org/traccar/protocol/T800xProtocolDecoder.java
@@ -23,7 +23,6 @@ import org.traccar.helper.BcdUtil;
import org.traccar.helper.BitUtil;
import org.traccar.helper.DateBuilder;
import org.traccar.helper.UnitsConverter;
-import org.traccar.model.Event;
import org.traccar.model.Position;
import java.net.SocketAddress;
@@ -85,7 +84,7 @@ public class T800xProtocolDecoder extends BaseProtocolDecoder {
position.setProtocol(getProtocolName());
position.setDeviceId(getDeviceId());
- position.set(Event.KEY_INDEX, index);
+ position.set(Position.KEY_INDEX, index);
buf.readUnsignedShort(); // acc on interval
buf.readUnsignedShort(); // acc off interval
@@ -102,23 +101,23 @@ public class T800xProtocolDecoder extends BaseProtocolDecoder {
buf.readUnsignedShort(); // drag alarm setting
int io = buf.readUnsignedShort();
- position.set(Event.KEY_IGNITION, BitUtil.check(io, 14));
+ position.set(Position.KEY_IGNITION, BitUtil.check(io, 14));
position.set("ac", BitUtil.check(io, 13));
- position.set(Event.PREFIX_ADC + 1, buf.readUnsignedShort());
- position.set(Event.PREFIX_ADC + 2, buf.readUnsignedShort());
+ position.set(Position.PREFIX_ADC + 1, buf.readUnsignedShort());
+ position.set(Position.PREFIX_ADC + 2, buf.readUnsignedShort());
- position.set(Event.KEY_ALARM, buf.readUnsignedByte());
+ position.set(Position.KEY_ALARM, buf.readUnsignedByte());
buf.readUnsignedByte(); // reserved
- position.set(Event.KEY_ODOMETER, buf.readUnsignedInt());
+ position.set(Position.KEY_ODOMETER, buf.readUnsignedInt());
int battery = BcdUtil.readInteger(buf, 2);
if (battery == 0) {
battery = 100;
}
- position.set(Event.KEY_BATTERY, battery);
+ position.set(Position.KEY_BATTERY, battery);
DateBuilder dateBuilder = new DateBuilder()
.setYear(BcdUtil.readInteger(buf, 2))
@@ -147,10 +146,10 @@ public class T800xProtocolDecoder extends BaseProtocolDecoder {
buf.readBytes(array);
ChannelBuffer swapped = ChannelBuffers.wrappedBuffer(ByteOrder.LITTLE_ENDIAN, array);
- position.set(Event.KEY_MCC, swapped.readUnsignedShort());
- position.set(Event.KEY_MNC, swapped.readUnsignedShort());
- position.set(Event.KEY_LAC, swapped.readUnsignedShort());
- position.set(Event.KEY_CID, swapped.readUnsignedShort());
+ position.set(Position.KEY_MCC, swapped.readUnsignedShort());
+ position.set(Position.KEY_MNC, swapped.readUnsignedShort());
+ position.set(Position.KEY_LAC, swapped.readUnsignedShort());
+ position.set(Position.KEY_CID, swapped.readUnsignedShort());
// two more cell towers