aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjose <joseantonio@grdar.es>2016-12-14 18:05:33 +0100
committerjose <joseantonio@grdar.es>2016-12-15 08:58:53 +0100
commitcd81e411f7d122628b255bfc2c1df3a7c9782066 (patch)
tree5ef43b1c77edada2e056ffaf784af38986eedbe5
parentfa90c985d9f569216ca4d7fa5d8be3421d9c1534 (diff)
parentfe5f1c363628d302fa56c2ac3dcd5197d135c0e0 (diff)
downloadtrackermap-server-cd81e411f7d122628b255bfc2c1df3a7c9782066.tar.gz
trackermap-server-cd81e411f7d122628b255bfc2c1df3a7c9782066.tar.bz2
trackermap-server-cd81e411f7d122628b255bfc2c1df3a7c9782066.zip
Fix Meiligao Protocol to work with tk228
Style Issues
-rw-r--r--src/org/traccar/model/Position.java1
-rw-r--r--src/org/traccar/protocol/MeiligaoProtocolDecoder.java4
-rw-r--r--test/org/traccar/protocol/MeiligaoProtocolDecoderTest.java2
3 files changed, 2 insertions, 5 deletions
diff --git a/src/org/traccar/model/Position.java b/src/org/traccar/model/Position.java
index 3e8cb27bc..49a304df7 100644
--- a/src/org/traccar/model/Position.java
+++ b/src/org/traccar/model/Position.java
@@ -68,7 +68,6 @@ public class Position extends Message {
public static final String KEY_OBD_DRIVING_RANGE = "drivingRange";
public static final String KEY_OBD_SINGLE_FUEL_CONSUMPTION = "singleFuelConsumption";
public static final String KEY_OBD_TOTAL_FUEL_CONSUMPTION = "totalFuelConsumption";
- public static final String KEY_OBD_CURRENT_ERROR = "currentError";
public static final String KEY_OBD_HARSH_ACCELERATION = "harshAcelerationNo";
public static final String KEY_OBD_HARSH_BREAK = "harshBreakerNo";
public static final String KEY_OBD_TOTAL_IGNITION = "totalIgnitionNo";
diff --git a/src/org/traccar/protocol/MeiligaoProtocolDecoder.java b/src/org/traccar/protocol/MeiligaoProtocolDecoder.java
index d3a3a2b3a..3d57eecfd 100644
--- a/src/org/traccar/protocol/MeiligaoProtocolDecoder.java
+++ b/src/org/traccar/protocol/MeiligaoProtocolDecoder.java
@@ -114,11 +114,9 @@ public class MeiligaoProtocolDecoder extends BaseProtocolDecoder {
public static final int MSG_SERVER = 0x0002;
public static final int MSG_LOGIN = 0x5000;
public static final int MSG_LOGIN_RESPONSE = 0x4000;
-
public static final int MSG_POSITION = 0x9955;
public static final int MSG_POSITION_LOGGED = 0x9016;
public static final int MSG_ALARM = 0x9999;
-
public static final int MSG_RFID = 0x9966;
public static final int MSG_OBD_RT = 0x9901;
@@ -302,7 +300,7 @@ public class MeiligaoProtocolDecoder extends BaseProtocolDecoder {
position.set(Position.KEY_ODOMETER, parser.nextDouble());
position.set(Position.KEY_OBD_SINGLE_FUEL_CONSUMPTION, parser.nextDouble());
position.set(Position.KEY_OBD_TOTAL_FUEL_CONSUMPTION, parser.nextDouble());
- position.set(Position.KEY_OBD_CURRENT_ERROR, parser.nextInt());
+ position.set(Position.KEY_DTCS, parser.nextInt());
position.set(Position.KEY_OBD_HARSH_ACCELERATION, parser.nextInt());
position.set(Position.KEY_OBD_HARSH_BREAK, parser.nextInt());
return position;
diff --git a/test/org/traccar/protocol/MeiligaoProtocolDecoderTest.java b/test/org/traccar/protocol/MeiligaoProtocolDecoderTest.java
index fb1c44bb7..81910d42c 100644
--- a/test/org/traccar/protocol/MeiligaoProtocolDecoderTest.java
+++ b/test/org/traccar/protocol/MeiligaoProtocolDecoderTest.java
@@ -17,7 +17,7 @@ public class MeiligaoProtocolDecoderTest extends ProtocolTest {
"2424007d0000000000000099553231303333302e3030302c562c343533342e333832342c532c30373230332e303630302c572c302e30302c302c3231313031362c2c2a31327c302e307c3332397c323030307c303030452c303030437c303244413030303145413634393541417c31307c30303030303030306e540d0a"));
verifyAttributes(decoder, binary(
- "2424005066104020094432990131302E312C302C3135362C302E30302C31392E36312C2D33342C33342E32362C32312E38332C372E39312C313033332C322E36392C362E35352C302C302C309DBF0D0A"));
+ "242400736610402421174399553132343334342e3937382c412c333933342e313838302c4e2c30303234302e363231302c452c303030302c3030302c3038313231362c2c2a31437c31312e357c3139347c313030317c303344462c303030307c30303131323030307c30303030303068320d0a2424004c66104024211743990131342e302c3934352c302c31332e33332c322e37352c36392c312e32302c382e31302c302e36382c3131322c302e30382c392e39312c302c312c3040f70d0a2424003266104024211743990232362c322e35342c302e38302c32322c34342c3131392c333735362c37382c31366fc20d0a"));
verifyPosition(decoder, binary(
"242400746251103044ffff99553033353033392e3939392c412c323832332e373632312c4e2c31303635322e303730342c572c3030302e302c3030302e302c3136303631362c2c2c412a37357c302e397c323038332e327c303030307c303030302c303030307c31303034333736333265780d0a"));