aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2017-04-08 16:42:23 +1200
committerAnton Tananaev <anton.tananaev@gmail.com>2017-04-08 16:42:23 +1200
commite104f5636d53311dfd91cafaa2cdea65260ae7dc (patch)
tree3e062c6db7921c327b082bf9adcb9795a91c1f82 /src/org/traccar
parent46de1b51bf0ece5c4f76036ad90b7f0709826d23 (diff)
downloadtraccar-server-e104f5636d53311dfd91cafaa2cdea65260ae7dc.tar.gz
traccar-server-e104f5636d53311dfd91cafaa2cdea65260ae7dc.tar.bz2
traccar-server-e104f5636d53311dfd91cafaa2cdea65260ae7dc.zip
Minor Enfora encoder cleanup
Diffstat (limited to 'src/org/traccar')
-rw-r--r--src/org/traccar/protocol/EnforaProtocolEncoder.java12
1 files changed, 5 insertions, 7 deletions
diff --git a/src/org/traccar/protocol/EnforaProtocolEncoder.java b/src/org/traccar/protocol/EnforaProtocolEncoder.java
index 56e56942c..e7da87388 100644
--- a/src/org/traccar/protocol/EnforaProtocolEncoder.java
+++ b/src/org/traccar/protocol/EnforaProtocolEncoder.java
@@ -1,6 +1,6 @@
/*
* Copyright 2017 Anton Tananaev (anton@traccar.org)
- * Jose Castellanos
+ * Copyright 2017 Jose Castellanos
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -32,12 +32,10 @@ public class EnforaProtocolEncoder extends StringProtocolEncoder {
byte[] contentBytes = content.getBytes();
- buf.writeShort(contentBytes.length + 6); // Byte 0 Byte 1 Length
- buf.writeByte(0x00); // Byte 2 Api Number Sequence
- buf.writeByte(0x00); // Byte 3 Api Number Sequence
- buf.writeByte(0x04); // Byte 4 Command Type 4 AT Command
- buf.writeByte(0x00); // Byte 5 API Optional Header
- // Byte 6+m AT Command
+ buf.writeShort(contentBytes.length + 6);
+ buf.writeShort(0); // index
+ buf.writeByte(0x04); // command type
+ buf.writeByte(0); // optional header
buf.writeBytes(content.getBytes(StandardCharsets.UTF_8));
return buf;