From 679f838e8bd0caaea94b1d4d1cd9b740ea3b9606 Mon Sep 17 00:00:00 2001 From: Abyss777 Date: Mon, 6 Mar 2017 10:07:43 +0500 Subject: Introduce terms "data" and "text" commands --- src/org/traccar/BaseProtocol.java | 44 ++++++++++++---------- src/org/traccar/Protocol.java | 8 ++-- .../traccar/api/resource/CommandTypeResource.java | 5 ++- src/org/traccar/database/ActiveDevice.java | 2 +- src/org/traccar/database/DeviceManager.java | 16 ++++---- src/org/traccar/model/Command.java | 10 ++--- src/org/traccar/protocol/CarcellProtocol.java | 2 +- src/org/traccar/protocol/CellocatorProtocol.java | 2 +- src/org/traccar/protocol/CityeasyProtocol.java | 2 +- src/org/traccar/protocol/EelinkProtocol.java | 2 +- src/org/traccar/protocol/Gl200Protocol.java | 2 +- src/org/traccar/protocol/Gps103Protocol.java | 2 +- src/org/traccar/protocol/GranitProtocol.java | 6 +-- src/org/traccar/protocol/Gt06Protocol.java | 2 +- src/org/traccar/protocol/H02Protocol.java | 2 +- src/org/traccar/protocol/HuabaoProtocol.java | 2 +- src/org/traccar/protocol/Jt600Protocol.java | 2 +- src/org/traccar/protocol/KhdProtocol.java | 2 +- src/org/traccar/protocol/MeiligaoProtocol.java | 2 +- src/org/traccar/protocol/MeitrackProtocol.java | 2 +- src/org/traccar/protocol/MiniFinderProtocol.java | 2 +- src/org/traccar/protocol/NoranProtocol.java | 2 +- src/org/traccar/protocol/Pt502Protocol.java | 2 +- src/org/traccar/protocol/RuptelaProtocol.java | 2 +- src/org/traccar/protocol/SuntechProtocol.java | 2 +- src/org/traccar/protocol/T800xProtocol.java | 2 +- src/org/traccar/protocol/TeltonikaProtocol.java | 2 +- src/org/traccar/protocol/TotemProtocol.java | 2 +- src/org/traccar/protocol/WatchProtocol.java | 2 +- src/org/traccar/protocol/WialonProtocol.java | 2 +- src/org/traccar/protocol/WondexProtocol.java | 6 +-- src/org/traccar/protocol/XexunProtocol.java | 2 +- 32 files changed, 74 insertions(+), 71 deletions(-) (limited to 'src') diff --git a/src/org/traccar/BaseProtocol.java b/src/org/traccar/BaseProtocol.java index bccc4e184..90b9f21f2 100644 --- a/src/org/traccar/BaseProtocol.java +++ b/src/org/traccar/BaseProtocol.java @@ -29,10 +29,10 @@ import java.util.Set; public abstract class BaseProtocol implements Protocol { private final String name; - private final Set supportedCommands = new HashSet<>(); - private final Set supportedSmsCommands = new HashSet<>(); + private final Set supportedDataCommands = new HashSet<>(); + private final Set supportedTextCommands = new HashSet<>(); - private StringProtocolEncoder smsEncoder = null; + private StringProtocolEncoder textCommandEncoder = null; public BaseProtocol(String name) { this.name = name; @@ -43,31 +43,36 @@ public abstract class BaseProtocol implements Protocol { return name; } - public void setSupportedCommands(String... commands) { - supportedCommands.addAll(Arrays.asList(commands)); + public void setSupportedDataCommands(String... commands) { + supportedDataCommands.addAll(Arrays.asList(commands)); + } + + public void setSupportedTextCommands(String... commands) { + supportedTextCommands.addAll(Arrays.asList(commands)); } - public void setSupportedSmsCommands(String... commands) { - supportedSmsCommands.addAll(Arrays.asList(commands)); + public void setSupportedCommands(String... commands) { + supportedDataCommands.addAll(Arrays.asList(commands)); + supportedTextCommands.addAll(Arrays.asList(commands)); } @Override - public Collection getSupportedCommands() { - Set commands = new HashSet<>(supportedCommands); + public Collection getSupportedDataCommands() { + Set commands = new HashSet<>(supportedDataCommands); commands.add(Command.TYPE_CUSTOM); return commands; } @Override - public Collection getSupportedSmsCommands() { - Set commands = new HashSet<>(supportedSmsCommands); + public Collection getSupportedTextCommands() { + Set commands = new HashSet<>(supportedTextCommands); commands.add(Command.TYPE_CUSTOM); return commands; } @Override - public void sendCommand(ActiveDevice activeDevice, Command command) { - if (supportedCommands.contains(command.getType())) { + public void sendDataCommand(ActiveDevice activeDevice, Command command) { + if (supportedDataCommands.contains(command.getType())) { activeDevice.write(command); } else if (command.getType().equals(Command.TYPE_CUSTOM)) { String data = command.getString(Command.KEY_DATA); @@ -81,17 +86,18 @@ public abstract class BaseProtocol implements Protocol { } } - public void setSmsEncoder(StringProtocolEncoder smsEncoder) { - this.smsEncoder = smsEncoder; + public void setTextCommandEncoder(StringProtocolEncoder textCommandEncoder) { + this.textCommandEncoder = textCommandEncoder; } @Override - public void sendSmsCommand(String phone, Command command) throws Exception { + public void sendTextCommand(String destAddress, Command command) throws Exception { if (Context.getSmppManager() != null) { if (command.getType().equals(Command.TYPE_CUSTOM)) { - Context.getSmppManager().sendMessageSync(phone, command.getString(Command.KEY_DATA), true); - } else if (supportedSmsCommands.contains(command.getType()) && smsEncoder != null) { - Context.getSmppManager().sendMessageSync(phone, (String) smsEncoder.encodeCommand(command), true); + Context.getSmppManager().sendMessageSync(destAddress, command.getString(Command.KEY_DATA), true); + } else if (supportedTextCommands.contains(command.getType()) && textCommandEncoder != null) { + Context.getSmppManager().sendMessageSync(destAddress, + (String) textCommandEncoder.encodeCommand(command), true); } else { throw new RuntimeException( "Command " + command.getType() + " is not supported in protocol " + getName()); diff --git a/src/org/traccar/Protocol.java b/src/org/traccar/Protocol.java index f6a4fbebb..87ac05298 100644 --- a/src/org/traccar/Protocol.java +++ b/src/org/traccar/Protocol.java @@ -10,14 +10,14 @@ public interface Protocol { String getName(); - Collection getSupportedCommands(); + Collection getSupportedDataCommands(); - void sendCommand(ActiveDevice activeDevice, Command command); + void sendDataCommand(ActiveDevice activeDevice, Command command); void initTrackerServers(List serverList); - Collection getSupportedSmsCommands(); + Collection getSupportedTextCommands(); - void sendSmsCommand(String phone, Command command) throws Exception; + void sendTextCommand(String destAddress, Command command) throws Exception; } diff --git a/src/org/traccar/api/resource/CommandTypeResource.java b/src/org/traccar/api/resource/CommandTypeResource.java index 3ee773fbf..d5d220547 100644 --- a/src/org/traccar/api/resource/CommandTypeResource.java +++ b/src/org/traccar/api/resource/CommandTypeResource.java @@ -34,9 +34,10 @@ import java.util.Collection; public class CommandTypeResource extends BaseResource { @GET - public Collection get(@QueryParam("deviceId") long deviceId, @QueryParam("sms") boolean sms) { + public Collection get(@QueryParam("deviceId") long deviceId, + @QueryParam("textChannel") boolean textChannel) { Context.getPermissionsManager().checkDevice(getUserId(), deviceId); - return Context.getDeviceManager().getCommandTypes(deviceId, sms); + return Context.getDeviceManager().getCommandTypes(deviceId, textChannel); } } diff --git a/src/org/traccar/database/ActiveDevice.java b/src/org/traccar/database/ActiveDevice.java index 9c96382fe..f491111e1 100644 --- a/src/org/traccar/database/ActiveDevice.java +++ b/src/org/traccar/database/ActiveDevice.java @@ -44,7 +44,7 @@ public class ActiveDevice { } public void sendCommand(Command command) { - protocol.sendCommand(this, command); + protocol.sendDataCommand(this, command); } public void write(Object message) { diff --git a/src/org/traccar/database/DeviceManager.java b/src/org/traccar/database/DeviceManager.java index 8b28bec9d..f5fde9e1f 100644 --- a/src/org/traccar/database/DeviceManager.java +++ b/src/org/traccar/database/DeviceManager.java @@ -56,14 +56,14 @@ public class DeviceManager implements IdentityManager { private final Map positions = new ConcurrentHashMap<>(); - private boolean fallbackToSms; + private boolean fallbackToText; public DeviceManager(DataManager dataManager) { this.dataManager = dataManager; this.config = Context.getConfig(); dataRefreshDelay = config.getLong("database.refreshDelay", DEFAULT_REFRESH_DELAY) * 1000; lookupGroupsAttribute = config.getBoolean("deviceManager.lookupGroupsAttribute"); - fallbackToSms = config.getBoolean("command.fallbackToSms"); + fallbackToText = config.getBoolean("command.fallbackToSms"); if (dataManager != null) { try { updateGroupCache(true); @@ -429,11 +429,11 @@ public class DeviceManager implements IdentityManager { public void sendCommand(Command command) throws Exception { long deviceId = command.getDeviceId(); - if (command.getSms()) { + if (command.getTextChannel()) { Position lastPosition = getLastPosition(deviceId); if (lastPosition != null) { BaseProtocol protocol = Context.getServerManager().getProtocol(lastPosition.getProtocol()); - protocol.sendSmsCommand(devicesById.get(deviceId).getPhone(), command); + protocol.sendTextCommand(devicesById.get(deviceId).getPhone(), command); } else if (command.getType().equals(Command.TYPE_CUSTOM)) { Context.getSmppManager().sendMessageSync(devicesById.get(deviceId).getPhone(), command.getString(Command.KEY_DATA), true); @@ -445,8 +445,8 @@ public class DeviceManager implements IdentityManager { if (activeDevice != null) { activeDevice.sendCommand(command); } else { - if (fallbackToSms) { - command.setSms(true); + if (fallbackToText) { + command.setTextChannel(true); sendCommand(command); } else { throw new RuntimeException("Device is not online"); @@ -455,13 +455,13 @@ public class DeviceManager implements IdentityManager { } } - public Collection getCommandTypes(long deviceId, boolean sms) { + public Collection getCommandTypes(long deviceId, boolean textChannel) { List result = new ArrayList<>(); Position lastPosition = Context.getDeviceManager().getLastPosition(deviceId); if (lastPosition != null) { BaseProtocol protocol = Context.getServerManager().getProtocol(lastPosition.getProtocol()); Collection commands; - commands = sms ? protocol.getSupportedSmsCommands() : protocol.getSupportedCommands(); + commands = textChannel ? protocol.getSupportedTextCommands() : protocol.getSupportedDataCommands(); for (String commandKey : commands) { result.add(new CommandType(commandKey)); } diff --git a/src/org/traccar/model/Command.java b/src/org/traccar/model/Command.java index 8d4d24b89..016862214 100644 --- a/src/org/traccar/model/Command.java +++ b/src/org/traccar/model/Command.java @@ -66,14 +66,14 @@ public class Command extends Message { public static final String KEY_INDEX = "index"; public static final String KEY_PHONE = "phone"; - private boolean sms; + private boolean textChannel; - public boolean getSms() { - return sms; + public boolean getTextChannel() { + return textChannel; } - public void setSms(boolean sms) { - this.sms = sms; + public void setTextChannel(boolean textChannel) { + this.textChannel = textChannel; } } diff --git a/src/org/traccar/protocol/CarcellProtocol.java b/src/org/traccar/protocol/CarcellProtocol.java index e53a10eb5..c9fedad65 100644 --- a/src/org/traccar/protocol/CarcellProtocol.java +++ b/src/org/traccar/protocol/CarcellProtocol.java @@ -30,7 +30,7 @@ public class CarcellProtocol extends BaseProtocol { public CarcellProtocol() { super("carcell"); - setSupportedCommands( + setSupportedDataCommands( Command.TYPE_ENGINE_STOP, Command.TYPE_ENGINE_RESUME); } diff --git a/src/org/traccar/protocol/CellocatorProtocol.java b/src/org/traccar/protocol/CellocatorProtocol.java index 7c8510204..4a20bc977 100644 --- a/src/org/traccar/protocol/CellocatorProtocol.java +++ b/src/org/traccar/protocol/CellocatorProtocol.java @@ -29,7 +29,7 @@ public class CellocatorProtocol extends BaseProtocol { public CellocatorProtocol() { super("cellocator"); - setSupportedCommands( + setSupportedDataCommands( Command.TYPE_OUTPUT_CONTROL); } diff --git a/src/org/traccar/protocol/CityeasyProtocol.java b/src/org/traccar/protocol/CityeasyProtocol.java index c5ad05fcd..7e5ca0ba0 100644 --- a/src/org/traccar/protocol/CityeasyProtocol.java +++ b/src/org/traccar/protocol/CityeasyProtocol.java @@ -28,7 +28,7 @@ public class CityeasyProtocol extends BaseProtocol { public CityeasyProtocol() { super("cityeasy"); - setSupportedCommands( + setSupportedDataCommands( Command.TYPE_POSITION_SINGLE, Command.TYPE_POSITION_PERIODIC, Command.TYPE_POSITION_STOP, diff --git a/src/org/traccar/protocol/EelinkProtocol.java b/src/org/traccar/protocol/EelinkProtocol.java index 5900f0059..5499094d9 100644 --- a/src/org/traccar/protocol/EelinkProtocol.java +++ b/src/org/traccar/protocol/EelinkProtocol.java @@ -28,7 +28,7 @@ public class EelinkProtocol extends BaseProtocol { public EelinkProtocol() { super("eelink"); - setSupportedCommands( + setSupportedDataCommands( Command.TYPE_CUSTOM, Command.TYPE_ENGINE_STOP, Command.TYPE_ENGINE_RESUME, diff --git a/src/org/traccar/protocol/Gl200Protocol.java b/src/org/traccar/protocol/Gl200Protocol.java index b6f01c773..b3743042c 100644 --- a/src/org/traccar/protocol/Gl200Protocol.java +++ b/src/org/traccar/protocol/Gl200Protocol.java @@ -31,7 +31,7 @@ public class Gl200Protocol extends BaseProtocol { public Gl200Protocol() { super("gl200"); - setSupportedCommands( + setSupportedDataCommands( Command.TYPE_POSITION_SINGLE, Command.TYPE_ENGINE_STOP, Command.TYPE_ENGINE_RESUME, diff --git a/src/org/traccar/protocol/Gps103Protocol.java b/src/org/traccar/protocol/Gps103Protocol.java index a4d563bfc..a5bd32261 100644 --- a/src/org/traccar/protocol/Gps103Protocol.java +++ b/src/org/traccar/protocol/Gps103Protocol.java @@ -31,7 +31,7 @@ public class Gps103Protocol extends BaseProtocol { public Gps103Protocol() { super("gps103"); - setSupportedCommands( + setSupportedDataCommands( Command.TYPE_CUSTOM, Command.TYPE_POSITION_SINGLE, Command.TYPE_POSITION_PERIODIC, diff --git a/src/org/traccar/protocol/GranitProtocol.java b/src/org/traccar/protocol/GranitProtocol.java index 1ae42ba46..32e8e00b0 100644 --- a/src/org/traccar/protocol/GranitProtocol.java +++ b/src/org/traccar/protocol/GranitProtocol.java @@ -29,12 +29,12 @@ public class GranitProtocol extends BaseProtocol { public GranitProtocol() { super("granit"); - setSupportedCommands( + setSupportedDataCommands( Command.TYPE_IDENTIFICATION, Command.TYPE_REBOOT_DEVICE, Command.TYPE_POSITION_SINGLE); - setSmsEncoder(new GranitProtocolSmsEncoder()); - setSupportedSmsCommands( + setTextCommandEncoder(new GranitProtocolSmsEncoder()); + setSupportedTextCommands( Command.TYPE_REBOOT_DEVICE, Command.TYPE_POSITION_PERIODIC); } diff --git a/src/org/traccar/protocol/Gt06Protocol.java b/src/org/traccar/protocol/Gt06Protocol.java index e96679799..aa8f1f0c0 100644 --- a/src/org/traccar/protocol/Gt06Protocol.java +++ b/src/org/traccar/protocol/Gt06Protocol.java @@ -27,7 +27,7 @@ public class Gt06Protocol extends BaseProtocol { public Gt06Protocol() { super("gt06"); - setSupportedCommands( + setSupportedDataCommands( Command.TYPE_ENGINE_STOP, Command.TYPE_ENGINE_RESUME); } diff --git a/src/org/traccar/protocol/H02Protocol.java b/src/org/traccar/protocol/H02Protocol.java index 498f63c0e..df64402f8 100644 --- a/src/org/traccar/protocol/H02Protocol.java +++ b/src/org/traccar/protocol/H02Protocol.java @@ -29,7 +29,7 @@ public class H02Protocol extends BaseProtocol { public H02Protocol() { super("h02"); - setSupportedCommands( + setSupportedDataCommands( Command.TYPE_ALARM_ARM, Command.TYPE_ALARM_DISARM, Command.TYPE_ENGINE_STOP, diff --git a/src/org/traccar/protocol/HuabaoProtocol.java b/src/org/traccar/protocol/HuabaoProtocol.java index d5e68e091..c74cb58c7 100644 --- a/src/org/traccar/protocol/HuabaoProtocol.java +++ b/src/org/traccar/protocol/HuabaoProtocol.java @@ -27,7 +27,7 @@ public class HuabaoProtocol extends BaseProtocol { public HuabaoProtocol() { super("huabao"); - setSupportedCommands( + setSupportedDataCommands( Command.TYPE_ENGINE_STOP, Command.TYPE_ENGINE_RESUME); } diff --git a/src/org/traccar/protocol/Jt600Protocol.java b/src/org/traccar/protocol/Jt600Protocol.java index 132770511..8c71ca4f6 100644 --- a/src/org/traccar/protocol/Jt600Protocol.java +++ b/src/org/traccar/protocol/Jt600Protocol.java @@ -28,7 +28,7 @@ public class Jt600Protocol extends BaseProtocol { public Jt600Protocol() { super("jt600"); - setSupportedCommands( + setSupportedDataCommands( Command.TYPE_ENGINE_RESUME, Command.TYPE_ENGINE_STOP, Command.TYPE_SET_TIMEZONE, diff --git a/src/org/traccar/protocol/KhdProtocol.java b/src/org/traccar/protocol/KhdProtocol.java index bf0d2855d..167727191 100644 --- a/src/org/traccar/protocol/KhdProtocol.java +++ b/src/org/traccar/protocol/KhdProtocol.java @@ -28,7 +28,7 @@ public class KhdProtocol extends BaseProtocol { public KhdProtocol() { super("khd"); - setSupportedCommands( + setSupportedDataCommands( Command.TYPE_ENGINE_STOP, Command.TYPE_ENGINE_RESUME); } diff --git a/src/org/traccar/protocol/MeiligaoProtocol.java b/src/org/traccar/protocol/MeiligaoProtocol.java index 23af19ef1..dbdd2619a 100644 --- a/src/org/traccar/protocol/MeiligaoProtocol.java +++ b/src/org/traccar/protocol/MeiligaoProtocol.java @@ -28,7 +28,7 @@ public class MeiligaoProtocol extends BaseProtocol { public MeiligaoProtocol() { super("meiligao"); - setSupportedCommands( + setSupportedDataCommands( Command.TYPE_POSITION_SINGLE, Command.TYPE_POSITION_PERIODIC, Command.TYPE_ENGINE_STOP, diff --git a/src/org/traccar/protocol/MeitrackProtocol.java b/src/org/traccar/protocol/MeitrackProtocol.java index 918729f97..e89825da5 100644 --- a/src/org/traccar/protocol/MeitrackProtocol.java +++ b/src/org/traccar/protocol/MeitrackProtocol.java @@ -30,7 +30,7 @@ public class MeitrackProtocol extends BaseProtocol { public MeitrackProtocol() { super("meitrack"); - setSupportedCommands( + setSupportedDataCommands( Command.TYPE_POSITION_SINGLE, Command.TYPE_ENGINE_STOP, Command.TYPE_ENGINE_RESUME, diff --git a/src/org/traccar/protocol/MiniFinderProtocol.java b/src/org/traccar/protocol/MiniFinderProtocol.java index 3bbdc1beb..c36acb238 100644 --- a/src/org/traccar/protocol/MiniFinderProtocol.java +++ b/src/org/traccar/protocol/MiniFinderProtocol.java @@ -30,7 +30,7 @@ public class MiniFinderProtocol extends BaseProtocol { public MiniFinderProtocol() { super("minifinder"); - setSupportedCommands( + setSupportedDataCommands( Command.TYPE_SET_TIMEZONE, Command.TYPE_VOICE_MONITORING, Command.TYPE_ALARM_SPEED, diff --git a/src/org/traccar/protocol/NoranProtocol.java b/src/org/traccar/protocol/NoranProtocol.java index bf10eb127..7d3dc4852 100644 --- a/src/org/traccar/protocol/NoranProtocol.java +++ b/src/org/traccar/protocol/NoranProtocol.java @@ -28,7 +28,7 @@ public class NoranProtocol extends BaseProtocol { public NoranProtocol() { super("noran"); - setSupportedCommands( + setSupportedDataCommands( Command.TYPE_POSITION_SINGLE, Command.TYPE_POSITION_PERIODIC, Command.TYPE_POSITION_STOP, diff --git a/src/org/traccar/protocol/Pt502Protocol.java b/src/org/traccar/protocol/Pt502Protocol.java index a15938dc3..ad97a777e 100644 --- a/src/org/traccar/protocol/Pt502Protocol.java +++ b/src/org/traccar/protocol/Pt502Protocol.java @@ -30,7 +30,7 @@ public class Pt502Protocol extends BaseProtocol { public Pt502Protocol() { super("pt502"); - setSupportedCommands( + setSupportedDataCommands( Command.TYPE_SET_TIMEZONE, Command.TYPE_ALARM_SPEED, Command.TYPE_OUTPUT_CONTROL, diff --git a/src/org/traccar/protocol/RuptelaProtocol.java b/src/org/traccar/protocol/RuptelaProtocol.java index 54cdcc267..4be07307d 100644 --- a/src/org/traccar/protocol/RuptelaProtocol.java +++ b/src/org/traccar/protocol/RuptelaProtocol.java @@ -28,7 +28,7 @@ public class RuptelaProtocol extends BaseProtocol { public RuptelaProtocol() { super("ruptela"); - setSupportedCommands( + setSupportedDataCommands( Command.TYPE_CUSTOM); } diff --git a/src/org/traccar/protocol/SuntechProtocol.java b/src/org/traccar/protocol/SuntechProtocol.java index 410dc8af7..871c3becd 100644 --- a/src/org/traccar/protocol/SuntechProtocol.java +++ b/src/org/traccar/protocol/SuntechProtocol.java @@ -30,7 +30,7 @@ public class SuntechProtocol extends BaseProtocol { public SuntechProtocol() { super("suntech"); - setSupportedCommands( + setSupportedDataCommands( Command.TYPE_OUTPUT_CONTROL, Command.TYPE_REBOOT_DEVICE, Command.TYPE_POSITION_SINGLE, diff --git a/src/org/traccar/protocol/T800xProtocol.java b/src/org/traccar/protocol/T800xProtocol.java index 70341d0dc..830ff4de6 100644 --- a/src/org/traccar/protocol/T800xProtocol.java +++ b/src/org/traccar/protocol/T800xProtocol.java @@ -28,7 +28,7 @@ public class T800xProtocol extends BaseProtocol { public T800xProtocol() { super("t800x"); - setSupportedCommands( + setSupportedDataCommands( Command.TYPE_CUSTOM); } diff --git a/src/org/traccar/protocol/TeltonikaProtocol.java b/src/org/traccar/protocol/TeltonikaProtocol.java index f0ed61886..524e6d5b5 100644 --- a/src/org/traccar/protocol/TeltonikaProtocol.java +++ b/src/org/traccar/protocol/TeltonikaProtocol.java @@ -28,7 +28,7 @@ public class TeltonikaProtocol extends BaseProtocol { public TeltonikaProtocol() { super("teltonika"); - setSupportedCommands( + setSupportedDataCommands( Command.TYPE_CUSTOM); } diff --git a/src/org/traccar/protocol/TotemProtocol.java b/src/org/traccar/protocol/TotemProtocol.java index 860fff894..1c5cf5b02 100644 --- a/src/org/traccar/protocol/TotemProtocol.java +++ b/src/org/traccar/protocol/TotemProtocol.java @@ -29,7 +29,7 @@ public class TotemProtocol extends BaseProtocol { public TotemProtocol() { super("totem"); - setSupportedCommands( + setSupportedDataCommands( Command.TYPE_ENGINE_RESUME, Command.TYPE_ENGINE_STOP ); diff --git a/src/org/traccar/protocol/WatchProtocol.java b/src/org/traccar/protocol/WatchProtocol.java index abce3d16a..f664691c3 100644 --- a/src/org/traccar/protocol/WatchProtocol.java +++ b/src/org/traccar/protocol/WatchProtocol.java @@ -30,7 +30,7 @@ public class WatchProtocol extends BaseProtocol { public WatchProtocol() { super("watch"); - setSupportedCommands( + setSupportedDataCommands( Command.TYPE_POSITION_SINGLE, Command.TYPE_POSITION_PERIODIC, Command.TYPE_SOS_NUMBER, diff --git a/src/org/traccar/protocol/WialonProtocol.java b/src/org/traccar/protocol/WialonProtocol.java index 04e18cd85..02da154e2 100644 --- a/src/org/traccar/protocol/WialonProtocol.java +++ b/src/org/traccar/protocol/WialonProtocol.java @@ -32,7 +32,7 @@ public class WialonProtocol extends BaseProtocol { public WialonProtocol() { super("wialon"); - setSupportedCommands( + setSupportedDataCommands( Command.TYPE_REBOOT_DEVICE, Command.TYPE_SEND_USSD, Command.TYPE_IDENTIFICATION, diff --git a/src/org/traccar/protocol/WondexProtocol.java b/src/org/traccar/protocol/WondexProtocol.java index 25d8fb175..e7e13c63a 100644 --- a/src/org/traccar/protocol/WondexProtocol.java +++ b/src/org/traccar/protocol/WondexProtocol.java @@ -29,15 +29,11 @@ public class WondexProtocol extends BaseProtocol { public WondexProtocol() { super("wondex"); + setTextCommandEncoder(new WondexProtocolEncoder()); setSupportedCommands( Command.TYPE_REBOOT_DEVICE, Command.TYPE_POSITION_SINGLE, Command.TYPE_IDENTIFICATION); - setSmsEncoder(new WondexProtocolEncoder()); - setSupportedSmsCommands( - Command.TYPE_REBOOT_DEVICE, - Command.TYPE_POSITION_SINGLE, - Command.TYPE_IDENTIFICATION); } @Override diff --git a/src/org/traccar/protocol/XexunProtocol.java b/src/org/traccar/protocol/XexunProtocol.java index a52d9ff45..b90cbfaaf 100644 --- a/src/org/traccar/protocol/XexunProtocol.java +++ b/src/org/traccar/protocol/XexunProtocol.java @@ -31,7 +31,7 @@ public class XexunProtocol extends BaseProtocol { public XexunProtocol() { super("xexun"); - setSupportedCommands( + setSupportedDataCommands( Command.TYPE_ENGINE_STOP, Command.TYPE_ENGINE_RESUME); } -- cgit v1.2.3