aboutsummaryrefslogtreecommitdiff
path: root/src/main
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2020-12-15 19:49:14 -0800
committerAnton Tananaev <anton.tananaev@gmail.com>2020-12-15 19:49:14 -0800
commit069e8b7aaf140f9334eb755e8c3af4a78c4b2d27 (patch)
treeac1f7df2c38d898f87c4cbe38bdc7dd0e2fa6f85 /src/main
parentbc3b09e48efb9a58d9aef111d4316dcd9c0a7038 (diff)
downloadtrackermap-server-069e8b7aaf140f9334eb755e8c3af4a78c4b2d27.tar.gz
trackermap-server-069e8b7aaf140f9334eb755e8c3af4a78c4b2d27.tar.bz2
trackermap-server-069e8b7aaf140f9334eb755e8c3af4a78c4b2d27.zip
Fix temperature decoding
Diffstat (limited to 'src/main')
-rw-r--r--src/main/java/org/traccar/protocol/TaipProtocolDecoder.java8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/main/java/org/traccar/protocol/TaipProtocolDecoder.java b/src/main/java/org/traccar/protocol/TaipProtocolDecoder.java
index ed6d2b899..7d31b332d 100644
--- a/src/main/java/org/traccar/protocol/TaipProtocolDecoder.java
+++ b/src/main/java/org/traccar/protocol/TaipProtocolDecoder.java
@@ -73,8 +73,8 @@ public class TaipProtocolDecoder extends BaseProtocolDecoder {
.number(",(d{4})(d{4})") // power / battery
.number(",(d+)") // rpm
.groupBegin()
- .number(",(-?d+)") // temperature 1
- .number(",(-?d+)") // temperature 2
+ .number(",([-+]?d+.?d*)") // temperature 1
+ .number(",([-+]?d+.?d*)") // temperature 2
.groupEnd("?")
.number(",(xx)") // alarm
.or()
@@ -191,8 +191,8 @@ public class TaipProtocolDecoder extends BaseProtocolDecoder {
position.set(Position.KEY_POWER, parser.nextInt() * 0.01);
position.set(Position.KEY_BATTERY, parser.nextInt() * 0.01);
position.set(Position.KEY_RPM, parser.nextInt());
- position.set(Position.PREFIX_TEMP + 1, parser.nextInt());
- position.set(Position.PREFIX_TEMP + 2, parser.nextInt());
+ position.set(Position.PREFIX_TEMP + 1, parser.nextDouble());
+ position.set(Position.PREFIX_TEMP + 2, parser.nextDouble());
position.set(Position.KEY_ALARM, decodeAlarm(parser.nextHexInt()));
}