From 8f1c0e94ebe29c08ff94a98e2ea53c22732768ad Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Sat, 2 Dec 2023 14:04:15 -0800 Subject: Support GL530MG sensors --- .../java/org/traccar/protocol/Gl200TextProtocolDecoder.java | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'src/main/java') diff --git a/src/main/java/org/traccar/protocol/Gl200TextProtocolDecoder.java b/src/main/java/org/traccar/protocol/Gl200TextProtocolDecoder.java index 5ee3761dd..a73981614 100644 --- a/src/main/java/org/traccar/protocol/Gl200TextProtocolDecoder.java +++ b/src/main/java/org/traccar/protocol/Gl200TextProtocolDecoder.java @@ -649,11 +649,12 @@ public class Gl200TextProtocolDecoder extends BaseProtocolDecoder { .expression(PATTERN_LOCATION.pattern()) .expression(")+)") .groupBegin() - .number("d{1,2},,") - .number("(d{1,3}),") // battery + .number("d{1,2},") + .number("(d{1,5})?,") // battery + .number("(d{1,3}),") // battery level .number("[01],") // mode .number("(?:[01])?,") // motion - .number("(?:-?d{1,2}.d)?,") // temperature + .number("(-?d{1,2}.d)?,") // temperature .or() .number("(d{1,7}.d)?,") // odometer .number("(d{5}:dd:dd)?,") // hour meter @@ -721,8 +722,10 @@ public class Gl200TextProtocolDecoder extends BaseProtocolDecoder { } if (parser.hasNext()) { - position.set(Position.KEY_BATTERY_LEVEL, parser.nextInt()); + position.set(Position.KEY_BATTERY, parser.nextInt() * 0.001); } + position.set(Position.KEY_BATTERY_LEVEL, parser.nextInt()); + position.set(Position.PREFIX_TEMP + 1, parser.nextDouble()); if (parser.hasNext()) { position.set(Position.KEY_ODOMETER, parser.nextDouble() * 1000); -- cgit v1.2.3