From d28bad416d2d7af3dda7b42a19f6fd372538a3f8 Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Thu, 3 May 2018 02:33:54 +1200 Subject: Minor modification to BCE decoder --- src/org/traccar/protocol/BceProtocolDecoder.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/org') 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()); -- cgit v1.2.3