diff options
author | Abyss777 <abyss@fox5.ru> | 2016-05-26 09:30:43 +0500 |
---|---|---|
committer | Abyss777 <abyss@fox5.ru> | 2016-05-26 09:30:43 +0500 |
commit | aa12e5c750e771016545269ffa39409b06b47eee (patch) | |
tree | d21b4414b532bfc53c9a905f3caa09f70b43b59e /src/org/traccar/protocol/CastelProtocolDecoder.java | |
parent | ac2405f0d57fac51fe95aa755f90fe82f26f73bc (diff) | |
download | trackermap-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/CastelProtocolDecoder.java')
-rw-r--r-- | src/org/traccar/protocol/CastelProtocolDecoder.java | 23 |
1 files changed, 11 insertions, 12 deletions
diff --git a/src/org/traccar/protocol/CastelProtocolDecoder.java b/src/org/traccar/protocol/CastelProtocolDecoder.java index d3d505c86..e379b6f2d 100644 --- a/src/org/traccar/protocol/CastelProtocolDecoder.java +++ b/src/org/traccar/protocol/CastelProtocolDecoder.java @@ -22,7 +22,6 @@ import org.traccar.BaseProtocolDecoder; import org.traccar.helper.Checksum; import org.traccar.helper.DateBuilder; import org.traccar.helper.UnitsConverter; -import org.traccar.model.Event; import org.traccar.model.Position; import java.net.SocketAddress; @@ -79,7 +78,7 @@ public class CastelProtocolDecoder extends BaseProtocolDecoder { position.setLatitude(lat); position.setLongitude(lon); position.setValid((flags & 0x0C) > 0); - position.set(Event.KEY_SATELLITES, flags >> 4); + position.set(Position.KEY_SATELLITES, flags >> 4); return position; } @@ -207,8 +206,8 @@ public class CastelProtocolDecoder extends BaseProtocolDecoder { for (int i = 0; i < count; i++) { Position position = readPosition(buf); - position.set(Event.KEY_ODOMETER, odometer); - position.set(Event.KEY_STATUS, status); + position.set(Position.KEY_ODOMETER, odometer); + position.set(Position.KEY_STATUS, status); positions.add(position); } @@ -236,16 +235,16 @@ public class CastelProtocolDecoder extends BaseProtocolDecoder { for (int i = 0; i < count; i++) { Position position = readPosition(buf); - position.set(Event.KEY_STATUS, buf.readUnsignedInt()); - position.set(Event.KEY_BATTERY, buf.readUnsignedByte()); - position.set(Event.KEY_ODOMETER, buf.readUnsignedInt()); + position.set(Position.KEY_STATUS, buf.readUnsignedInt()); + position.set(Position.KEY_BATTERY, buf.readUnsignedByte()); + position.set(Position.KEY_ODOMETER, buf.readUnsignedInt()); buf.readUnsignedByte(); // geo-fencing id buf.readUnsignedByte(); // geo-fencing flags buf.readUnsignedByte(); // additional flags - position.set(Event.KEY_LAC, buf.readUnsignedShort()); - position.set(Event.KEY_CID, buf.readUnsignedShort()); + position.set(Position.KEY_LAC, buf.readUnsignedShort()); + position.set(Position.KEY_CID, buf.readUnsignedShort()); positions.add(position); } @@ -258,9 +257,9 @@ public class CastelProtocolDecoder extends BaseProtocolDecoder { Position position = readPosition(buf); - position.set(Event.KEY_STATUS, buf.readUnsignedInt()); - position.set(Event.KEY_BATTERY, buf.readUnsignedByte()); - position.set(Event.KEY_ODOMETER, buf.readUnsignedInt()); + position.set(Position.KEY_STATUS, buf.readUnsignedInt()); + position.set(Position.KEY_BATTERY, buf.readUnsignedByte()); + position.set(Position.KEY_ODOMETER, buf.readUnsignedInt()); buf.readUnsignedByte(); // geo-fencing id buf.readUnsignedByte(); // geo-fencing flags |