aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2016-08-06 10:34:41 +0300
committerAnton Tananaev <anton.tananaev@gmail.com>2016-08-06 10:34:41 +0300
commitb8b330317dbac78c2d0a007a195efd8d42b3e791 (patch)
tree38eae134fac5b9b549a6fdf06c0e3490b8f0b1e1 /src
parent08e058e868566e44a8e955fa8d18bdae5630ecec (diff)
downloadtraccar-server-b8b330317dbac78c2d0a007a195efd8d42b3e791.tar.gz
traccar-server-b8b330317dbac78c2d0a007a195efd8d42b3e791.tar.bz2
traccar-server-b8b330317dbac78c2d0a007a195efd8d42b3e791.zip
Support temperature for TK103 protocol
Diffstat (limited to 'src')
-rw-r--r--src/org/traccar/protocol/Tk103ProtocolDecoder.java7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/org/traccar/protocol/Tk103ProtocolDecoder.java b/src/org/traccar/protocol/Tk103ProtocolDecoder.java
index 55a41f5a2..ac99a1440 100644
--- a/src/org/traccar/protocol/Tk103ProtocolDecoder.java
+++ b/src/org/traccar/protocol/Tk103ProtocolDecoder.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2012 - 2015 Anton Tananaev (anton.tananaev@gmail.com)
+ * Copyright 2012 - 2016 Anton Tananaev (anton.tananaev@gmail.com)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -51,6 +51,7 @@ public class Tk103ProtocolDecoder extends BaseProtocolDecoder {
.number("(?:([01]{8})|(x{8}))?,?") // state
.number("(?:L(x+))?") // odometer
.any()
+ .number("([+-]ddd.d)?") // temperature
.text(")").optional()
.compile();
@@ -225,6 +226,10 @@ public class Tk103ProtocolDecoder extends BaseProtocolDecoder {
position.set(Position.KEY_ODOMETER, parser.nextLong(16));
}
+ if (parser.hasNext()) {
+ position.set(Position.PREFIX_TEMP + 1, parser.nextDouble());
+ }
+
return position;
}