diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2020-09-29 09:28:53 -0700 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2020-09-29 09:28:53 -0700 |
commit | 1e06b00e5f6068a191d0652798f12df77f0b0e0a (patch) | |
tree | 76b5f0f009d66017f445f57101b96a094cdf962c /src/main/java/org/traccar/helper | |
parent | c7e630f4904e073127c573951336be25735bf687 (diff) | |
download | traccar-server-1e06b00e5f6068a191d0652798f12df77f0b0e0a.tar.gz traccar-server-1e06b00e5f6068a191d0652798f12df77f0b0e0a.tar.bz2 traccar-server-1e06b00e5f6068a191d0652798f12df77f0b0e0a.zip |
Handle long OBD values
Diffstat (limited to 'src/main/java/org/traccar/helper')
-rw-r--r-- | src/main/java/org/traccar/helper/ObdDecoder.java | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/main/java/org/traccar/helper/ObdDecoder.java b/src/main/java/org/traccar/helper/ObdDecoder.java index 1bdcce352..b22065f4e 100644 --- a/src/main/java/org/traccar/helper/ObdDecoder.java +++ b/src/main/java/org/traccar/helper/ObdDecoder.java @@ -1,5 +1,5 @@ /* - * Copyright 2015 - 2018 Anton Tananaev (anton@traccar.org) + * Copyright 2015 - 2020 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -35,7 +35,7 @@ public final class ObdDecoder { case MODE_FREEZE_FRAME: return decodeData( Integer.parseInt(value.substring(0, 2), 16), - Integer.parseInt(value.substring(2), 16), true); + Long.parseLong(value.substring(2), 16), true); case MODE_CODES: return decodeCodes(value); default: @@ -75,7 +75,7 @@ public final class ObdDecoder { } } - public static Map.Entry<String, Object> decodeData(int pid, int value, boolean convert) { + public static Map.Entry<String, Object> decodeData(int pid, long value, boolean convert) { switch (pid) { case 0x04: return createEntry(Position.KEY_ENGINE_LOAD, convert ? value * 100 / 255 : value); |