aboutsummaryrefslogtreecommitdiff
path: root/src/test/java/org/traccar/protocol
diff options
context:
space:
mode:
authorAnton Tananaev <anton@traccar.org>2022-09-27 09:27:12 -0700
committerAnton Tananaev <anton@traccar.org>2022-09-27 09:27:12 -0700
commite7a5d1e1f4d7746e35dfac5b15078de03dc7bf79 (patch)
tree0af50cba1bbf293fcbeb5a3e367c88ef8a5f26e8 /src/test/java/org/traccar/protocol
parent706de3e02cde8daa0bce29dd2ff96703f17ff92a (diff)
downloadtrackermap-server-e7a5d1e1f4d7746e35dfac5b15078de03dc7bf79.tar.gz
trackermap-server-e7a5d1e1f4d7746e35dfac5b15078de03dc7bf79.tar.bz2
trackermap-server-e7a5d1e1f4d7746e35dfac5b15078de03dc7bf79.zip
Support RFTRACK monitoring units
Diffstat (limited to 'src/test/java/org/traccar/protocol')
-rw-r--r--src/test/java/org/traccar/protocol/RfTrackProtocolDecoderTest.java19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/test/java/org/traccar/protocol/RfTrackProtocolDecoderTest.java b/src/test/java/org/traccar/protocol/RfTrackProtocolDecoderTest.java
new file mode 100644
index 000000000..19a654fa6
--- /dev/null
+++ b/src/test/java/org/traccar/protocol/RfTrackProtocolDecoderTest.java
@@ -0,0 +1,19 @@
+package org.traccar.protocol;
+
+import io.netty.handler.codec.http.HttpMethod;
+import org.junit.Test;
+import org.traccar.ProtocolTest;
+
+public class RfTrackProtocolDecoderTest extends ProtocolTest {
+
+ @Test
+ public void testDecode() throws Exception {
+
+ var decoder = inject(new RfTrackProtocolDecoder(null));
+
+ verifyPosition(decoder, request(HttpMethod.POST, "/deviceDataUpload.do",
+ buffer("gsm={\"n\":0,\"b\":[{\"l\":6166,\"b\":19,\"c\":21423},{\"l\":6166,\"b\":18,\"c\":21416},{\"l\":6166,\"b\":17,\"c\":21383},{\"l\":6166,\"b\":13,\"c\":21422},{\"l\":6166,\"b\":13,\"c\":21435},{\"l\":6169,\"b\":11,\"c\":21311}],\"c\":460}&wifi=[{\"l\":-49,\"t\":\"lianqin20\"}]&mt=1073709094&i=358477047125172&gps={\"a\":30.0,\"y\":31.251563,\"s\":4,\"t\":1589764496654,\"z\":0.0,\"x\":121.360346}&dbm=-53&td=1589720501123&rc=0&bar=1001.85065&u_ids=[8441644.1,53036.1]&t=1589764500713&bat=12380&v=T2.142.2_2.0_R03&i_ids=[4247328.1,53036.1,10522408.1]&idt=140736414711817&id=39163")));
+
+ }
+
+}