diff options
author | Anton Tananaev <anton@traccar.org> | 2023-12-02 14:04:15 -0800 |
---|---|---|
committer | Anton Tananaev <anton@traccar.org> | 2023-12-02 14:04:15 -0800 |
commit | 8f1c0e94ebe29c08ff94a98e2ea53c22732768ad (patch) | |
tree | 7a07da53b05c8102b7e6514cc32a11187e84dbb1 /src/main/java/org | |
parent | e0d67dd1771e7b265e98bb18ab5359fc335ca9c4 (diff) | |
download | trackermap-server-8f1c0e94ebe29c08ff94a98e2ea53c22732768ad.tar.gz trackermap-server-8f1c0e94ebe29c08ff94a98e2ea53c22732768ad.tar.bz2 trackermap-server-8f1c0e94ebe29c08ff94a98e2ea53c22732768ad.zip |
Support GL530MG sensors
Diffstat (limited to 'src/main/java/org')
-rw-r--r-- | src/main/java/org/traccar/protocol/Gl200TextProtocolDecoder.java | 11 |
1 files changed, 7 insertions, 4 deletions
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); |