aboutsummaryrefslogtreecommitdiff
path: root/src/org
diff options
context:
space:
mode:
Diffstat (limited to 'src/org')
-rw-r--r--src/org/traccar/helper/Checksum.java5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/org/traccar/helper/Checksum.java b/src/org/traccar/helper/Checksum.java
index 629f6e7ca..f08292392 100644
--- a/src/org/traccar/helper/Checksum.java
+++ b/src/org/traccar/helper/Checksum.java
@@ -204,8 +204,9 @@ public final class Checksum {
public static String nmea(String msg) {
int checksum = 0;
- for (byte b : msg.getBytes(StandardCharsets.US_ASCII)) {
- checksum ^= b;
+ byte[] bytes = msg.getBytes(StandardCharsets.US_ASCII);
+ for (int i = 1; i < bytes.length; i++) {
+ checksum ^= bytes[i];
}
return String.format("*%02x", checksum).toUpperCase();
}