aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/org/traccar
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/org/traccar')
-rw-r--r--src/main/java/org/traccar/protocol/TeltonikaProtocolDecoder.java10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/main/java/org/traccar/protocol/TeltonikaProtocolDecoder.java b/src/main/java/org/traccar/protocol/TeltonikaProtocolDecoder.java
index de42031d7..372deae67 100644
--- a/src/main/java/org/traccar/protocol/TeltonikaProtocolDecoder.java
+++ b/src/main/java/org/traccar/protocol/TeltonikaProtocolDecoder.java
@@ -607,8 +607,14 @@ public class TeltonikaProtocolDecoder extends BaseProtocolDecoder {
position.set("tag" + i + "Id", beaconId);
break;
case 2:
- String beaconData = ByteBufUtil.hexDump(beacon.readSlice(parameterLength));
- position.set("tag" + i + "Data", beaconData);
+ ByteBuf beaconData = beacon.readSlice(parameterLength);
+ int flag = beaconData.readUnsignedByte();
+ if (BitUtil.check(flag, 6)) {
+ position.set("tag" + i + "LowBattery", true);
+ }
+ if (BitUtil.check(flag, 7)) {
+ position.set("tag" + i + "Voltage", beaconData.readUnsignedByte() * 10 + 2000);
+ }
break;
case 13:
position.set("tag" + i + "LowBattery", beacon.readUnsignedByte());