aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2015-03-19 09:43:52 +1300
committerAnton Tananaev <anton.tananaev@gmail.com>2015-03-19 09:43:52 +1300
commit222196c9da6644bf49ab125017b5ba9b5d99a443 (patch)
tree96fd6f3a137718fea164faf2b86aae39972c6815
parentfaeaad5466b0acb0d23a25f78e3c4ab0ec56a401 (diff)
downloadtrackermap-server-222196c9da6644bf49ab125017b5ba9b5d99a443.tar.gz
trackermap-server-222196c9da6644bf49ab125017b5ba9b5d99a443.tar.bz2
trackermap-server-222196c9da6644bf49ab125017b5ba9b5d99a443.zip
Hanlde voltage battery value (fix #1120)
-rw-r--r--src/org/traccar/protocol/GlobalSatProtocolDecoder.java2
-rw-r--r--test/org/traccar/protocol/GlobalSatProtocolDecoderTest.java6
2 files changed, 4 insertions, 4 deletions
diff --git a/src/org/traccar/protocol/GlobalSatProtocolDecoder.java b/src/org/traccar/protocol/GlobalSatProtocolDecoder.java
index fefeea969..fd0c04bb4 100644
--- a/src/org/traccar/protocol/GlobalSatProtocolDecoder.java
+++ b/src/org/traccar/protocol/GlobalSatProtocolDecoder.java
@@ -170,7 +170,7 @@ public class GlobalSatProtocolDecoder extends BaseProtocolDecoder {
position.setCourse(Double.valueOf(value));
break;
case 'N':
- extendedInfo.set("battery", Double.valueOf(value));
+ extendedInfo.set("battery", value);
break;
default:
// Unsupported
diff --git a/test/org/traccar/protocol/GlobalSatProtocolDecoderTest.java b/test/org/traccar/protocol/GlobalSatProtocolDecoderTest.java
index fab926ca6..9f9173c28 100644
--- a/test/org/traccar/protocol/GlobalSatProtocolDecoderTest.java
+++ b/test/org/traccar/protocol/GlobalSatProtocolDecoderTest.java
@@ -19,15 +19,15 @@ public class GlobalSatProtocolDecoderTest {
verify(decoder.decode(null, null,
"GSr,011412001878820,4,5,00,,1,250114,105316,E00610.2925,N4612.1824,0,0.02,0,1,0.0,64*51!"));
+ verify(decoder.decode(null, null,
+ "GSr,357938020310710,,4,04,,1,170315,060657,E00000.0000,N0000.0000,148,0.00,0,0,0.0,11991mV*6c!"));
+
decoder.setFormat0("TSPRXAB27GHKLMnaicz*U!");
verify(decoder.decode(null, null,
"GSr,1,135785412249986,01,I,EA02,3,230410,153318,E12129.2839,N2459.8570,0,1.17,212,8,1.0,12.3V*55"));
verify(decoder.decode(null, null,
- "GSr,357938020310710,,4,04,,1,170315,060657,E00000.0000,N0000.0000,148,0.00,0,0,0.0,11991mV*6c!"));
-
- verify(decoder.decode(null, null,
"GSr,GTR-128,012896009148443,0040,5,0080,3,190813,185812,W11203.3661,N3330.2104,344,0.24,78,9,0.8,60%,0,0,12,\"310,410,0bdd,050d,02,21\",\"310,410,0bdd,0639,24,7\"*79"));
verify(decoder.decode(null, null,