aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/org/traccar/protocol/AtrackProtocolDecoder.java
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2019-05-28 07:33:34 -0700
committerAnton Tananaev <anton.tananaev@gmail.com>2019-05-28 07:33:34 -0700
commitfeb008442b63e5467b050e3cee3cf90a01dcb462 (patch)
tree71b06df3f7bb21445f2af19713c335be1902bdd9 /src/main/java/org/traccar/protocol/AtrackProtocolDecoder.java
parent7d07898c52ab0442c78b4d068bf0b3922adc4a70 (diff)
downloadtrackermap-server-feb008442b63e5467b050e3cee3cf90a01dcb462.tar.gz
trackermap-server-feb008442b63e5467b050e3cee3cf90a01dcb462.tar.bz2
trackermap-server-feb008442b63e5467b050e3cee3cf90a01dcb462.zip
Decode additional Atrack parameters
Diffstat (limited to 'src/main/java/org/traccar/protocol/AtrackProtocolDecoder.java')
-rw-r--r--src/main/java/org/traccar/protocol/AtrackProtocolDecoder.java12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/main/java/org/traccar/protocol/AtrackProtocolDecoder.java b/src/main/java/org/traccar/protocol/AtrackProtocolDecoder.java
index 71bb6791c..c018b2651 100644
--- a/src/main/java/org/traccar/protocol/AtrackProtocolDecoder.java
+++ b/src/main/java/org/traccar/protocol/AtrackProtocolDecoder.java
@@ -84,6 +84,10 @@ public class AtrackProtocolDecoder extends BaseProtocolDecoder {
this.custom = custom;
}
+ public void setForm(String form) {
+ this.form = form;
+ }
+
private static void sendResponse(Channel channel, SocketAddress remoteAddress, long rawId, int index) {
if (channel != null) {
ByteBuf response = Unpooled.buffer(12);
@@ -167,6 +171,12 @@ public class AtrackProtocolDecoder extends BaseProtocolDecoder {
case "AV1":
position.set(Position.PREFIX_ADC + 1, Integer.parseInt(values[i]));
break;
+ case "CD":
+ position.set(Position.KEY_ICCID, values[i]);
+ break;
+ case "EH":
+ position.set(Position.KEY_HOURS, UnitsConverter.msFromHours(Integer.parseInt(values[i])));
+ break;
default:
break;
}
@@ -274,7 +284,7 @@ public class AtrackProtocolDecoder extends BaseProtocolDecoder {
buf.readUnsignedByte(); // pending code status
break;
case "CD":
- readString(buf); // sim cid
+ position.set(Position.KEY_ICCID, readString(buf));
break;
case "CM":
buf.readLong(); // imsi