diff options
Diffstat (limited to 'src/org/traccar/protocol/ApelProtocolDecoder.java')
-rw-r--r-- | src/org/traccar/protocol/ApelProtocolDecoder.java | 27 |
1 files changed, 13 insertions, 14 deletions
diff --git a/src/org/traccar/protocol/ApelProtocolDecoder.java b/src/org/traccar/protocol/ApelProtocolDecoder.java index b75bcbda3..fb473be1e 100644 --- a/src/org/traccar/protocol/ApelProtocolDecoder.java +++ b/src/org/traccar/protocol/ApelProtocolDecoder.java @@ -21,7 +21,6 @@ import org.jboss.netty.channel.Channel; import org.traccar.BaseProtocolDecoder; import org.traccar.helper.Checksum; import org.traccar.helper.UnitsConverter; -import org.traccar.model.Event; import org.traccar.model.Position; import java.net.SocketAddress; @@ -138,9 +137,9 @@ public class ApelProtocolDecoder extends BaseProtocolDecoder { int subtype = type; if (type == MSG_LOG_RECORDS) { - position.set(Event.KEY_ARCHIVE, true); + position.set(Position.KEY_ARCHIVE, true); lastIndex = buf.readUnsignedInt() + 1; - position.set(Event.KEY_INDEX, lastIndex); + position.set(Position.KEY_INDEX, lastIndex); subtype = buf.readUnsignedShort(); if (subtype != MSG_CURRENT_GPS_DATA && subtype != MSG_STATE_FULL_INFO_T104) { @@ -158,7 +157,7 @@ public class ApelProtocolDecoder extends BaseProtocolDecoder { int speed = buf.readUnsignedByte(); position.setValid(speed != 255); position.setSpeed(UnitsConverter.knotsFromKph(speed)); - position.set(Event.KEY_HDOP, buf.readByte()); + position.set(Position.KEY_HDOP, buf.readByte()); } else { int speed = buf.readShort(); position.setValid(speed != -1); @@ -170,20 +169,20 @@ public class ApelProtocolDecoder extends BaseProtocolDecoder { if (subtype == MSG_STATE_FULL_INFO_T104) { - position.set(Event.KEY_SATELLITES, buf.readUnsignedByte()); - position.set(Event.KEY_GSM, buf.readUnsignedByte()); - position.set(Event.KEY_EVENT, buf.readUnsignedShort()); - position.set(Event.KEY_ODOMETER, buf.readUnsignedInt()); - position.set(Event.KEY_INPUT, buf.readUnsignedByte()); - position.set(Event.KEY_OUTPUT, buf.readUnsignedByte()); + position.set(Position.KEY_SATELLITES, buf.readUnsignedByte()); + position.set(Position.KEY_GSM, buf.readUnsignedByte()); + position.set(Position.KEY_EVENT, buf.readUnsignedShort()); + position.set(Position.KEY_ODOMETER, buf.readUnsignedInt()); + position.set(Position.KEY_INPUT, buf.readUnsignedByte()); + position.set(Position.KEY_OUTPUT, buf.readUnsignedByte()); for (int i = 1; i <= 8; i++) { - position.set(Event.PREFIX_ADC + i, buf.readUnsignedShort()); + position.set(Position.PREFIX_ADC + i, buf.readUnsignedShort()); } - position.set(Event.PREFIX_COUNT + 1, buf.readUnsignedInt()); - position.set(Event.PREFIX_COUNT + 2, buf.readUnsignedInt()); - position.set(Event.PREFIX_COUNT + 3, buf.readUnsignedInt()); + position.set(Position.PREFIX_COUNT + 1, buf.readUnsignedInt()); + position.set(Position.PREFIX_COUNT + 2, buf.readUnsignedInt()); + position.set(Position.PREFIX_COUNT + 3, buf.readUnsignedInt()); } positions.add(position); |