aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/protocol/MegastekProtocolDecoder.java
diff options
context:
space:
mode:
authorShinryuken <watertext@hotmail.it>2017-11-19 11:22:31 +0100
committerGitHub <noreply@github.com>2017-11-19 11:22:31 +0100
commita5b273f8f8afd1a67613517c6487642601070456 (patch)
treebabc63f5d50977fc91b3946b1da2e86ec74c51a5 /src/org/traccar/protocol/MegastekProtocolDecoder.java
parentc7928ef4a722cb40e9911c8e76e308fc48c85567 (diff)
parentfb9cbb2b74dc0060bd0dc5d0b3bfeb958ed6f3b5 (diff)
downloadtrackermap-server-a5b273f8f8afd1a67613517c6487642601070456.tar.gz
trackermap-server-a5b273f8f8afd1a67613517c6487642601070456.tar.bz2
trackermap-server-a5b273f8f8afd1a67613517c6487642601070456.zip
Merge branch 'master' into payload-as-form-param
Diffstat (limited to 'src/org/traccar/protocol/MegastekProtocolDecoder.java')
-rw-r--r--src/org/traccar/protocol/MegastekProtocolDecoder.java40
1 files changed, 24 insertions, 16 deletions
diff --git a/src/org/traccar/protocol/MegastekProtocolDecoder.java b/src/org/traccar/protocol/MegastekProtocolDecoder.java
index 3ef52acd1..ad0f20a24 100644
--- a/src/org/traccar/protocol/MegastekProtocolDecoder.java
+++ b/src/org/traccar/protocol/MegastekProtocolDecoder.java
@@ -340,30 +340,38 @@ public class MegastekProtocolDecoder extends BaseProtocolDecoder {
}
private String decodeAlarm(String value) {
+ value = value.toLowerCase();
+ if (value.startsWith("geo")) {
+ if (value.endsWith("in")) {
+ return Position.ALARM_GEOFENCE_ENTER;
+ } else if (value.endsWith("out")) {
+ return Position.ALARM_GEOFENCE_EXIT;
+ }
+ }
switch (value) {
- case "SOS":
- case "Help":
+ case "poweron":
+ return Position.ALARM_POWER_ON;
+ case "poweroff":
+ return Position.ALARM_POWER_ON;
+ case "sos":
+ case "help":
return Position.ALARM_SOS;
- case "Over Speed":
- case "OverSpeed":
+ case "over speed":
+ case "overspeed":
return Position.ALARM_OVERSPEED;
- case "LowSpeed":
+ case "lowspeed":
return Position.ALARM_LOW_SPEED;
- case "Low Battery":
- case "LowBattery":
+ case "low battery":
+ case "lowbattery":
return Position.ALARM_LOW_BATTERY;
- case "VIB":
+ case "vib":
return Position.ALARM_VIBRATION;
- case "Move in":
- case "Geo in":
- case "Geo1 in":
- case "Geo2 in":
+ case "move in":
return Position.ALARM_GEOFENCE_ENTER;
- case "Move out":
- case "Geo out":
- case "Geo1 out":
- case "Geo2 out":
+ case "move out":
return Position.ALARM_GEOFENCE_EXIT;
+ case "error":
+ return Position.ALARM_FAULT;
default:
return null;
}