aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2015-03-18 09:43:24 +1300
committerAnton Tananaev <anton.tananaev@gmail.com>2015-03-18 09:43:24 +1300
commitfaeaad5466b0acb0d23a25f78e3c4ab0ec56a401 (patch)
tree956ec5a2b205b21cff461de121c7e2ec0bf03e87
parent8432b3660b7cc40c8734cc00817f176589d9d18e (diff)
downloadtraccar-server-faeaad5466b0acb0d23a25f78e3c4ab0ec56a401.tar.gz
traccar-server-faeaad5466b0acb0d23a25f78e3c4ab0ec56a401.tar.bz2
traccar-server-faeaad5466b0acb0d23a25f78e3c4ab0ec56a401.zip
Improve GlobalSat testing
-rw-r--r--src/org/traccar/protocol/GlobalSatProtocolDecoder.java10
-rw-r--r--test/org/traccar/protocol/GlobalSatProtocolDecoderTest.java19
2 files changed, 21 insertions, 8 deletions
diff --git a/src/org/traccar/protocol/GlobalSatProtocolDecoder.java b/src/org/traccar/protocol/GlobalSatProtocolDecoder.java
index 5e86c1ce3..fefeea969 100644
--- a/src/org/traccar/protocol/GlobalSatProtocolDecoder.java
+++ b/src/org/traccar/protocol/GlobalSatProtocolDecoder.java
@@ -48,7 +48,15 @@ public class GlobalSatProtocolDecoder extends BaseProtocolDecoder {
}
}
}
-
+
+ public void setFormat0(String format) {
+ format0 = format;
+ }
+
+ public void setFormat1(String format) {
+ format1 = format;
+ }
+
private Position decodeOriginal(Channel channel, String sentence) {
// Send acknowledgement
diff --git a/test/org/traccar/protocol/GlobalSatProtocolDecoderTest.java b/test/org/traccar/protocol/GlobalSatProtocolDecoderTest.java
index f15770bd0..fab926ca6 100644
--- a/test/org/traccar/protocol/GlobalSatProtocolDecoderTest.java
+++ b/test/org/traccar/protocol/GlobalSatProtocolDecoderTest.java
@@ -14,17 +14,22 @@ public class GlobalSatProtocolDecoderTest {
assertNull(decoder.decode(null, null, "GSh,131826789036289,3,M,ea04*3d"));
- //SORPZAB27GHKLMN*U!
- /*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!"));*/
+ decoder.setFormat0("SORPZAB27GHKLMN*U!");
+
+ 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!"));
+
+ decoder.setFormat0("TSPRXAB27GHKLMnaicz*U!");
- //TSPRXAB27GHKLMnaicz
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,
"$355632004245866,1,1,040202,093633,E12129.2252,N2459.8891,00161,0.0100,147,07,2.4"));
@@ -33,7 +38,7 @@ public class GlobalSatProtocolDecoderTest {
verify(decoder.decode(null, null,
"$353681041893264,9,3,240913,100833,E08513.0122,N5232.9395,181.3,22.02,251.30,9,1.00"));
-
+
/*verify(decoder.decode(null, null,
"$353681041893264,9,4,230913,052449,\"250,99,B443,422E,42,37\",\"250,99,B443,4232,43,44\",\"250,99,B443,7910,40,32\",\"250,99,B443,B456,40,28\",\"250,99,B443,B455,40,27\""));*/