From 53b65b11f31e53c6d612aa56ebe94d29d649f934 Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Wed, 2 Jun 2021 21:12:32 -0700 Subject: Decode GSM signal and satellites --- src/main/java/org/traccar/protocol/FifotrackProtocolDecoder.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src/main/java') diff --git a/src/main/java/org/traccar/protocol/FifotrackProtocolDecoder.java b/src/main/java/org/traccar/protocol/FifotrackProtocolDecoder.java index 9bed63266..70972f847 100644 --- a/src/main/java/org/traccar/protocol/FifotrackProtocolDecoder.java +++ b/src/main/java/org/traccar/protocol/FifotrackProtocolDecoder.java @@ -23,6 +23,7 @@ import org.traccar.Context; import org.traccar.DeviceSession; import org.traccar.NetworkMessage; import org.traccar.Protocol; +import org.traccar.helper.BitUtil; import org.traccar.helper.Checksum; import org.traccar.helper.Parser; import org.traccar.helper.PatternBuilder; @@ -187,7 +188,12 @@ public class FifotrackProtocolDecoder extends BaseProtocolDecoder { position.setAltitude(parser.nextInt()); position.set(Position.KEY_ODOMETER, parser.nextLong()); - position.set(Position.KEY_STATUS, parser.nextHexLong()); + + long status = parser.nextHexLong(); + position.set(Position.KEY_RSSI, BitUtil.between(status, 3, 8)); + position.set(Position.KEY_SATELLITES, BitUtil.from(status, 28)); + position.set(Position.KEY_STATUS, status); + position.set(Position.KEY_INPUT, parser.nextHexInt()); position.set(Position.KEY_OUTPUT, parser.nextHexInt()); -- cgit v1.2.3