aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/protocol/T800xProtocolDecoder.java
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2016-04-27 11:21:27 +1200
committerAnton Tananaev <anton.tananaev@gmail.com>2016-04-27 11:21:27 +1200
commit44f026f881efa6207ab79fb5bada20ab67f018a0 (patch)
tree62cab9dc7d35c12bf75217eecf85b335ecebbe5a /src/org/traccar/protocol/T800xProtocolDecoder.java
parentaa0cbaa6e849d01a5bb02e2e999b80c178270014 (diff)
downloadtrackermap-server-44f026f881efa6207ab79fb5bada20ab67f018a0.tar.gz
trackermap-server-44f026f881efa6207ab79fb5bada20ab67f018a0.tar.bz2
trackermap-server-44f026f881efa6207ab79fb5bada20ab67f018a0.zip
Rename ChannelBufferTools to BcdUtil
Diffstat (limited to 'src/org/traccar/protocol/T800xProtocolDecoder.java')
-rw-r--r--src/org/traccar/protocol/T800xProtocolDecoder.java18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/org/traccar/protocol/T800xProtocolDecoder.java b/src/org/traccar/protocol/T800xProtocolDecoder.java
index 83d815e0f..c5dc103b1 100644
--- a/src/org/traccar/protocol/T800xProtocolDecoder.java
+++ b/src/org/traccar/protocol/T800xProtocolDecoder.java
@@ -19,8 +19,8 @@ import org.jboss.netty.buffer.ChannelBuffer;
import org.jboss.netty.buffer.ChannelBuffers;
import org.jboss.netty.channel.Channel;
import org.traccar.BaseProtocolDecoder;
+import org.traccar.helper.BcdUtil;
import org.traccar.helper.BitUtil;
-import org.traccar.helper.ChannelBufferTools;
import org.traccar.helper.DateBuilder;
import org.traccar.helper.UnitsConverter;
import org.traccar.model.Event;
@@ -114,19 +114,19 @@ public class T800xProtocolDecoder extends BaseProtocolDecoder {
position.set(Event.KEY_ODOMETER, buf.readUnsignedInt());
- int battery = ChannelBufferTools.readHexInteger(buf, 2);
+ int battery = BcdUtil.readInteger(buf, 2);
if (battery == 0) {
battery = 100;
}
position.set(Event.KEY_BATTERY, battery);
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));
if (BitUtil.check(locationStatus, 6)) {
@@ -136,7 +136,7 @@ public class T800xProtocolDecoder extends BaseProtocolDecoder {
position.setLongitude(readSwappedFloat(buf));
position.setLatitude(readSwappedFloat(buf));
position.setSpeed(UnitsConverter.knotsFromKph(
- ChannelBufferTools.readHexInteger(buf, 4) * 0.1));
+ BcdUtil.readInteger(buf, 4) * 0.1));
position.setCourse(buf.readUnsignedShort());
} else {