From 4dc04ca89ccdc4a63a4c454baa3bb4bc58829951 Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Wed, 29 Jul 2015 16:15:11 +1200 Subject: Add more command types --- src/org/traccar/model/Command.java | 5 +++-- src/org/traccar/protocol/Gps103ProtocolEncoder.java | 4 ++++ 2 files changed, 7 insertions(+), 2 deletions(-) (limited to 'src/org/traccar') diff --git a/src/org/traccar/model/Command.java b/src/org/traccar/model/Command.java index 4558d31ce..842cceac4 100644 --- a/src/org/traccar/model/Command.java +++ b/src/org/traccar/model/Command.java @@ -27,10 +27,11 @@ public class Command implements Factory { public static final String TYPE_POSITION_STOP = "positionStop"; public static final String TYPE_ENGINE_STOP = "engineStop"; public static final String TYPE_ENGINE_RESUME = "engineResume"; - + public static final String TYPE_ALARM_ARM = "alarmArm"; + public static final String TYPE_ALARM_DISARM = "alarmDisarm"; + public static final String KEY_UNIQUE_ID = "uniqueId"; public static final String KEY_FREQUENCY = "frequency"; public static final String KEY_DEVICE_PASSWORD = "devicePassword"; - } diff --git a/src/org/traccar/protocol/Gps103ProtocolEncoder.java b/src/org/traccar/protocol/Gps103ProtocolEncoder.java index df0b50954..147451e3b 100644 --- a/src/org/traccar/protocol/Gps103ProtocolEncoder.java +++ b/src/org/traccar/protocol/Gps103ProtocolEncoder.java @@ -51,6 +51,10 @@ public class Gps103ProtocolEncoder extends StringProtocolEncoder implements Stri return formatCommand(command, "**,imei:{%s},J;", Command.KEY_UNIQUE_ID); case Command.TYPE_ENGINE_RESUME: return formatCommand(command, "**,imei:{%s},K;", Command.KEY_UNIQUE_ID); + case Command.TYPE_ALARM_ARM: + return formatCommand(command, "**,imei:{%s},L;", Command.KEY_UNIQUE_ID); + case Command.TYPE_ALARM_DISARM: + return formatCommand(command, "**,imei:{%s},M;", Command.KEY_UNIQUE_ID); } return null; -- cgit v1.2.3