aboutsummaryrefslogtreecommitdiff
path: root/src/test/java
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2019-07-12 10:34:57 -0700
committerGitHub <noreply@github.com>2019-07-12 10:34:57 -0700
commit2ce793cfe7df9ec68708722489cec267ddda0b2b (patch)
tree31971fe8ac67abc607bcb315ada9667d309fda75 /src/test/java
parent0130b9093bca894268493d27173e8ecac02c0179 (diff)
parent1da58124acf0ce8c820b78519d17c2a408aced24 (diff)
downloadtraccar-server-2ce793cfe7df9ec68708722489cec267ddda0b2b.tar.gz
traccar-server-2ce793cfe7df9ec68708722489cec267ddda0b2b.tar.bz2
traccar-server-2ce793cfe7df9ec68708722489cec267ddda0b2b.zip
Merge pull request #4342 from edvalley/proposed
Enhance Laipac protocol decoder and encoder
Diffstat (limited to 'src/test/java')
-rw-r--r--src/test/java/org/traccar/TestIdentityManager.java5
-rw-r--r--src/test/java/org/traccar/protocol/LaipacProtocolDecoderTest.java23
2 files changed, 20 insertions, 8 deletions
diff --git a/src/test/java/org/traccar/TestIdentityManager.java b/src/test/java/org/traccar/TestIdentityManager.java
index 0f7405dbd..98297c53c 100644
--- a/src/test/java/org/traccar/TestIdentityManager.java
+++ b/src/test/java/org/traccar/TestIdentityManager.java
@@ -30,6 +30,11 @@ public final class TestIdentityManager implements IdentityManager {
}
@Override
+ public String getDevicePassword(long id, String defaultPassword) {
+ return defaultPassword;
+ }
+
+ @Override
public Position getLastPosition(long deviceId) {
return null;
}
diff --git a/src/test/java/org/traccar/protocol/LaipacProtocolDecoderTest.java b/src/test/java/org/traccar/protocol/LaipacProtocolDecoderTest.java
index 31a0434bc..0bbb58490 100644
--- a/src/test/java/org/traccar/protocol/LaipacProtocolDecoderTest.java
+++ b/src/test/java/org/traccar/protocol/LaipacProtocolDecoderTest.java
@@ -15,10 +15,10 @@ public class LaipacProtocolDecoderTest extends ProtocolTest {
verifyNull(decoder, text(
"$AVSYS,99999999,V1.50,SN0000103,32768*15"));
-
+
verifyNull(decoder, text(
"$ECHK,99999999,0*35"));
-
+
verifyNull(decoder, text(
"$AVSYS,MSG00002,14406,7046811160,64*1A"));
@@ -85,10 +85,10 @@ public class LaipacProtocolDecoderTest extends ProtocolTest {
verifyPosition(decoder, text(
"$AVRMC,MSG00002,125517,R,5053.0442,N,00557.8694,E,0.00,0.00,240614,H,4076,167,1,0,0,0D7AB913,020408*75"));
-
+
verifyPosition(decoder, text(
"$AVRMC,MSG00002,043104,p,5114.4664,N,00534.3308,E,0.00,0.00,280614,0,4115,495,1,0,0,0D48C3DC,020408*52"));
-
+
verifyPosition(decoder, text(
"$AVRMC,MSG00002,050601,P,5114.4751,N,00534.3175,E,0.00,0.00,280614,0,4115,495,1,0,0,0D48C3DC,020408*7D"));
@@ -104,22 +104,29 @@ public class LaipacProtocolDecoderTest extends ProtocolTest {
verifyPosition(decoder, text(
"$AVRMC,999999999999999,084514,r,5050.1314,N,00419.9719,E,0.68,306.39,120318,0,3882,84,1,0,0,3EE4A617,020610*4D"));
- //Alarm button
+ // Alarm button
verifyPosition(decoder, text(
"$AVRMC,358174067149865,142945,R,5050.1254,N,00420.0490,E,0.00,0.00,190318,3,3455,119,1,0,0,3EE4A617,020610*53"));
- //G-Sensor
+ // G-Sensor
verifyPosition(decoder, text(
"$AVRMC,358174067149865,143407,R,5050.1254,N,00420.0490,E,0.00,0.00,190318,8,3455,119,1,0,0,3EE4A617,020610*52"));
- //Powered off
+ // Powered off
verifyPosition(decoder, text(
"$AVRMC,358174067149865,143648,A,5050.1141,N,00420.0525,E,1.24,174.38,190318,H,3455,119,1,0,0,3EE4A617,020610*3E"));
- //No network
+ // No network
verifyPosition(decoder, text(
"$AVRMC,358174067149865,143747,R,5050.1124,N,00420.0542,E,1.34,161.96,190318,a,3416,119,1,0,0*7D"));
+ // Zero LAC, CID, MCC, MNC
+ verifyPosition(decoder, text(
+ "$AVRMC,358174067149865,143747,P,5050.1124,N,00420.0542,E,1.34,161.96,190318,A,3416,119,1,0,0,0,0*5F"));
+
+ // New unknown parameters
+ verifyPosition(decoder, text(
+ "$AVRMC,358174067149865,143747,P,5050.1124,N,00420.0542,E,1.34,161.96,190318,A,3416,119,1,0,0,0,0,0,0*5F"));
}
}