diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2017-04-21 00:18:54 +1200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-04-21 00:18:54 +1200 |
commit | 6c5004287f8c3f05377886e2a8529f7e5f504479 (patch) | |
tree | 170d33cc3bd4ab026bdd56c114285164ac984119 | |
parent | 669d33472a3e23f84a873b740e21ddc3499da9f6 (diff) | |
parent | ba6c0b6fb108587730644f504f12f709e3bf0e3f (diff) | |
download | traccar-server-6c5004287f8c3f05377886e2a8529f7e5f504479.tar.gz traccar-server-6c5004287f8c3f05377886e2a8529f7e5f504479.tar.bz2 traccar-server-6c5004287f8c3f05377886e2a8529f7e5f504479.zip |
Merge pull request #3102 from lalamper/master
Adding and correcting event codes for Meitrack
-rw-r--r-- | src/org/traccar/model/Position.java | 1 | ||||
-rw-r--r-- | src/org/traccar/protocol/MeitrackProtocolDecoder.java | 7 |
2 files changed, 6 insertions, 2 deletions
diff --git a/src/org/traccar/model/Position.java b/src/org/traccar/model/Position.java index f1d8b65d1..1345a9cb2 100644 --- a/src/org/traccar/model/Position.java +++ b/src/org/traccar/model/Position.java @@ -106,6 +106,7 @@ public class Position extends Message { public static final String ALARM_BREAKING = "hardBreaking"; public static final String ALARM_FATIGUE_DRIVING = "fatigueDriving"; public static final String ALARM_POWER_CUT = "powerCut"; + public static final String ALARM_POWER_RESTORED = "powerRestored"; public static final String ALARM_JAMMING = "jamming"; public static final String ALARM_TEMPERATURE = "temperature"; public static final String ALARM_PARKING = "parking"; diff --git a/src/org/traccar/protocol/MeitrackProtocolDecoder.java b/src/org/traccar/protocol/MeitrackProtocolDecoder.java index f4d23a90e..0eb321ff3 100644 --- a/src/org/traccar/protocol/MeitrackProtocolDecoder.java +++ b/src/org/traccar/protocol/MeitrackProtocolDecoder.java @@ -83,7 +83,6 @@ public class MeitrackProtocolDecoder extends BaseProtocolDecoder { .number("xx") .text("\r\n").optional() .compile(); - private String decodeAlarm(int event) { switch (event) { case 1: @@ -91,13 +90,17 @@ public class MeitrackProtocolDecoder extends BaseProtocolDecoder { case 17: return Position.ALARM_LOW_BATTERY; case 18: - return Position.ALARM_POWER_CUT; + return Position.ALARM_LOW_POWER; case 19: return Position.ALARM_OVERSPEED; case 20: return Position.ALARM_GEOFENCE_ENTER; case 21: return Position.ALARM_GEOFENCE_EXIT; + case 22: + return Position.ALARM_POWER_RESTORED; + case 23: + return Position.ALARM_POWER_CUT; case 36: return Position.ALARM_TOW; default: |