diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2016-04-27 11:21:27 +1200 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2016-04-27 11:21:27 +1200 |
commit | 44f026f881efa6207ab79fb5bada20ab67f018a0 (patch) | |
tree | 62cab9dc7d35c12bf75217eecf85b335ecebbe5a /src/org/traccar/protocol/GatorProtocolDecoder.java | |
parent | aa0cbaa6e849d01a5bb02e2e999b80c178270014 (diff) | |
download | trackermap-server-44f026f881efa6207ab79fb5bada20ab67f018a0.tar.gz trackermap-server-44f026f881efa6207ab79fb5bada20ab67f018a0.tar.bz2 trackermap-server-44f026f881efa6207ab79fb5bada20ab67f018a0.zip |
Rename ChannelBufferTools to BcdUtil
Diffstat (limited to 'src/org/traccar/protocol/GatorProtocolDecoder.java')
-rw-r--r-- | src/org/traccar/protocol/GatorProtocolDecoder.java | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/src/org/traccar/protocol/GatorProtocolDecoder.java b/src/org/traccar/protocol/GatorProtocolDecoder.java index 22b3ebc3a..e28da82ba 100644 --- a/src/org/traccar/protocol/GatorProtocolDecoder.java +++ b/src/org/traccar/protocol/GatorProtocolDecoder.java @@ -19,7 +19,7 @@ import java.net.SocketAddress; import org.jboss.netty.buffer.ChannelBuffer; import org.jboss.netty.channel.Channel; import org.traccar.BaseProtocolDecoder; -import org.traccar.helper.ChannelBufferTools; +import org.traccar.helper.BcdUtil; import org.traccar.helper.DateBuilder; import org.traccar.helper.UnitsConverter; import org.traccar.model.Event; @@ -80,18 +80,18 @@ public class GatorProtocolDecoder extends BaseProtocolDecoder { position.setDeviceId(getDeviceId()); DateBuilder dateBuilder = new DateBuilder() - .setYear(ChannelBufferTools.readHexInteger(buf, 2)) - .setMonth(ChannelBufferTools.readHexInteger(buf, 2)) - .setDay(ChannelBufferTools.readHexInteger(buf, 2)) - .setHour(ChannelBufferTools.readHexInteger(buf, 2)) - .setMinute(ChannelBufferTools.readHexInteger(buf, 2)) - .setSecond(ChannelBufferTools.readHexInteger(buf, 2)); + .setYear(BcdUtil.readInteger(buf, 2)) + .setMonth(BcdUtil.readInteger(buf, 2)) + .setDay(BcdUtil.readInteger(buf, 2)) + .setHour(BcdUtil.readInteger(buf, 2)) + .setMinute(BcdUtil.readInteger(buf, 2)) + .setSecond(BcdUtil.readInteger(buf, 2)); position.setTime(dateBuilder.getDate()); - position.setLatitude(ChannelBufferTools.readCoordinate(buf)); - position.setLongitude(ChannelBufferTools.readCoordinate(buf)); - position.setSpeed(UnitsConverter.knotsFromKph(ChannelBufferTools.readHexInteger(buf, 4))); - position.setCourse(ChannelBufferTools.readHexInteger(buf, 4)); + position.setLatitude(BcdUtil.readCoordinate(buf)); + position.setLongitude(BcdUtil.readCoordinate(buf)); + position.setSpeed(UnitsConverter.knotsFromKph(BcdUtil.readInteger(buf, 4))); + position.setCourse(BcdUtil.readInteger(buf, 4)); int flags = buf.readUnsignedByte(); position.setValid((flags & 0x80) != 0); |