diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2018-05-03 02:33:54 +1200 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2018-05-03 02:33:54 +1200 |
commit | d28bad416d2d7af3dda7b42a19f6fd372538a3f8 (patch) | |
tree | e180bd37bb2ed14d0547e8ac3bb39e1e1a610320 /src/org/traccar | |
parent | 7f260d87e1e78ff92465b2c23f7a0068fa2c20b7 (diff) | |
download | traccar-server-d28bad416d2d7af3dda7b42a19f6fd372538a3f8.tar.gz traccar-server-d28bad416d2d7af3dda7b42a19f6fd372538a3f8.tar.bz2 traccar-server-d28bad416d2d7af3dda7b42a19f6fd372538a3f8.zip |
Minor modification to BCE decoder
Diffstat (limited to 'src/org/traccar')
-rw-r--r-- | src/org/traccar/protocol/BceProtocolDecoder.java | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/org/traccar/protocol/BceProtocolDecoder.java b/src/org/traccar/protocol/BceProtocolDecoder.java index a023e60c5..db0ec8c66 100644 --- a/src/org/traccar/protocol/BceProtocolDecoder.java +++ b/src/org/traccar/protocol/BceProtocolDecoder.java @@ -1,5 +1,5 @@ /* - * Copyright 2015 Anton Tananaev (anton@traccar.org) + * Copyright 2015 - 2018 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -96,9 +96,9 @@ public class BceProtocolDecoder extends BaseProtocolDecoder { position.setLatitude(buf.readFloat()); position.setSpeed(UnitsConverter.knotsFromKph(buf.readUnsignedByte())); - int gps = buf.readUnsignedByte(); - position.set(Position.KEY_SATELLITES, gps & 0xf); - position.set(Position.KEY_HDOP, gps >> 4); + int status = buf.readUnsignedByte(); + position.set(Position.KEY_SATELLITES, BitUtil.to(status, 4)); + position.set(Position.KEY_HDOP, BitUtil.from(status, 4)); position.setCourse(buf.readUnsignedByte()); position.setAltitude(buf.readUnsignedShort()); |