diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2020-09-12 22:58:40 -0700 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2020-09-12 22:58:40 -0700 |
commit | e0f15c6a21c188edd61ca78d034aaf1505fb59cb (patch) | |
tree | 9d0936d30efabd5959204e54551fad90c7cffc18 /src/test/java | |
parent | ab70f326d1ea09a20f2b5835d7de9d7ff6a5b220 (diff) | |
download | trackermap-server-e0f15c6a21c188edd61ca78d034aaf1505fb59cb.tar.gz trackermap-server-e0f15c6a21c188edd61ca78d034aaf1505fb59cb.tar.bz2 trackermap-server-e0f15c6a21c188edd61ca78d034aaf1505fb59cb.zip |
Refactor NMEA checksum
Diffstat (limited to 'src/test/java')
-rw-r--r-- | src/test/java/org/traccar/helper/ChecksumTest.java | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/test/java/org/traccar/helper/ChecksumTest.java b/src/test/java/org/traccar/helper/ChecksumTest.java index ff48527bc..248f4dcae 100644 --- a/src/test/java/org/traccar/helper/ChecksumTest.java +++ b/src/test/java/org/traccar/helper/ChecksumTest.java @@ -42,8 +42,11 @@ public class ChecksumTest { assertEquals(0x00, Checksum.modulo256(ByteBuffer.wrap(new byte[] {0x00}))); assertEquals(0x00, Checksum.modulo256(ByteBuffer.wrap(new byte[] {0x00, 0x00, 0x00}))); assertEquals(0xca, Checksum.modulo256(ByteBuffer.wrap(new byte[] {0x77, 0x77, 0x77, 0x77, 0x77, 0x77}))); + } - + @Test + public void testNmea() { + assertEquals("*2A", Checksum.nmea("GSC,011412000010789,M4(Ro=500)")); } } |