diff options
author | jose <joseantonio@grdar.es> | 2016-12-16 17:41:39 +0100 |
---|---|---|
committer | jose <joseantonio@grdar.es> | 2016-12-17 09:45:10 +0100 |
commit | d9e0b44ed13f9dd1aac96551555191283e45e020 (patch) | |
tree | 6a24a6bd54548c05d345101335ce759a489ff40b /src/org | |
parent | cd81e411f7d122628b255bfc2c1df3a7c9782066 (diff) | |
download | traccar-server-d9e0b44ed13f9dd1aac96551555191283e45e020.tar.gz traccar-server-d9e0b44ed13f9dd1aac96551555191283e45e020.tar.bz2 traccar-server-d9e0b44ed13f9dd1aac96551555191283e45e020.zip |
Fix Meiligao Protocol to work with tk228
Diffstat (limited to 'src/org')
-rw-r--r-- | src/org/traccar/model/Position.java | 18 | ||||
-rw-r--r-- | src/org/traccar/protocol/MeiligaoProtocolDecoder.java | 32 |
2 files changed, 18 insertions, 32 deletions
diff --git a/src/org/traccar/model/Position.java b/src/org/traccar/model/Position.java index 49a304df7..8ca2588e2 100644 --- a/src/org/traccar/model/Position.java +++ b/src/org/traccar/model/Position.java @@ -60,25 +60,11 @@ public class Position extends Message { public static final String KEY_ARMED = "armed"; public static final String KEY_ACCURACY = "accuracy"; public static final String KEY_GEOFENCE = "geofence"; + public static final String KEY_DTCS = "dtcs"; public static final String KEY_OBD_SPEED = "obdSpeed"; public static final String KEY_OBD_ODOMETER = "obdOdometer"; - public static final String KEY_OBD_ENGINE_LOAD = "engineLoad"; - public static final String KEY_OBD_AVERAGE_FUEL = "averageFuelConsumition"; - 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_HARSH_ACCELERATION = "harshAcelerationNo"; - public static final String KEY_OBD_HARSH_BREAK = "harshBreakerNo"; - public static final String KEY_OBD_TOTAL_IGNITION = "totalIgnitionNo"; - public static final String KEY_OBD_TOTAL_DRIVING_TIME = "totalDrivingTime"; - public static final String KEY_OBD_TOTAL_IDLING_TIME = "totalIdlingTime"; - public static final String KEY_OBD_AVERAGE_HOT_START = "averageHotStartTime"; - public static final String KEY_OBD_AVERAGE_SPEED = "averageSpeed"; - public static final String KEY_OBD_HISTORY_HIGHT_SPEED = "historyHightestSpeed"; - public static final String KEY_OBD_HISTORY_HIGHT_RPM = "historyHightestRPM"; - public static final String KEY_OBD_TOTAL_HARSH_ACCELERATION = "totalHarshAccerleration"; - public static final String KEY_OBD_TOTAL_HARSH_BRAKE = "totalHarshBrake"; + public static final String KEY_RESULT = "result"; // Starts with 1 not 0 diff --git a/src/org/traccar/protocol/MeiligaoProtocolDecoder.java b/src/org/traccar/protocol/MeiligaoProtocolDecoder.java index 3d57eecfd..706655b83 100644 --- a/src/org/traccar/protocol/MeiligaoProtocolDecoder.java +++ b/src/org/traccar/protocol/MeiligaoProtocolDecoder.java @@ -292,17 +292,17 @@ public class MeiligaoProtocolDecoder extends BaseProtocolDecoder { position.set(Position.KEY_RPM, parser.nextInt()); position.set(Position.KEY_OBD_SPEED, parser.nextInt()); position.set(Position.KEY_THROTTLE, parser.nextDouble()); - position.set(Position.KEY_OBD_ENGINE_LOAD, parser.nextDouble()); + position.set("engineLoad", parser.nextDouble()); position.set(Position.PREFIX_TEMP + 1, parser.nextInt()); position.set(Position.KEY_FUEL_CONSUMPTION, parser.nextDouble()); - position.set(Position.KEY_OBD_AVERAGE_FUEL, parser.nextDouble()); - position.set(Position.KEY_OBD_DRIVING_RANGE, parser.nextDouble()); + position.set("averageFuelConsumition", parser.nextDouble()); + position.set("drivingRange", parser.nextDouble()); 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("singleFuelConsumption", parser.nextDouble()); + position.set("totalFuelConsumption", parser.nextDouble()); 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()); + position.set("harshAcelerationNo", parser.nextInt()); + position.set("harshBreakerNo", parser.nextInt()); return position; } @@ -314,15 +314,15 @@ public class MeiligaoProtocolDecoder extends BaseProtocolDecoder { getLastLocation(position, null); - position.set(Position.KEY_OBD_TOTAL_IGNITION, parser.nextInt()); - position.set(Position.KEY_OBD_TOTAL_DRIVING_TIME, parser.nextDouble()); - position.set(Position.KEY_OBD_TOTAL_IDLING_TIME, parser.nextDouble()); - position.set(Position.KEY_OBD_AVERAGE_HOT_START, parser.nextInt()); - position.set(Position.KEY_OBD_AVERAGE_SPEED, parser.nextInt()); - position.set(Position.KEY_OBD_HISTORY_HIGHT_SPEED, parser.nextInt()); - position.set(Position.KEY_OBD_HISTORY_HIGHT_RPM, parser.nextInt()); - position.set(Position.KEY_OBD_TOTAL_HARSH_ACCELERATION, parser.nextInt()); - position.set(Position.KEY_OBD_TOTAL_HARSH_BRAKE, parser.nextInt()); + position.set("totalIgnitionNo", parser.nextInt()); + position.set("totalDrivingTime", parser.nextDouble()); + position.set("totalIdlingTime", parser.nextDouble()); + position.set("averageHotStartTime", parser.nextInt()); + position.set("averageSpeed", parser.nextInt()); + position.set("historyHightestSpeed", parser.nextInt()); + position.set("historyHightestRPM", parser.nextInt()); + position.set("totalHarshAccerleration", parser.nextInt()); + position.set("totalHarshBrake", parser.nextInt()); return position; } |