diff options
Diffstat (limited to 'src/org/traccar/events/CommandResultEventHandler.java')
-rw-r--r-- | src/org/traccar/events/CommandResultEventHandler.java | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/org/traccar/events/CommandResultEventHandler.java b/src/org/traccar/events/CommandResultEventHandler.java index 23c62566a..9dbdb4b4c 100644 --- a/src/org/traccar/events/CommandResultEventHandler.java +++ b/src/org/traccar/events/CommandResultEventHandler.java @@ -1,5 +1,8 @@ package org.traccar.events; +import java.util.ArrayList; +import java.util.Collection; + import org.traccar.BaseEventHandler; import org.traccar.model.Event; import org.traccar.model.Position; @@ -7,10 +10,12 @@ import org.traccar.model.Position; public class CommandResultEventHandler extends BaseEventHandler { @Override - protected Event analizePosition(Position position) { + protected Collection<Event> analizePosition(Position position) { Object commandResult = position.getAttributes().get(Position.KEY_RESULT); if (commandResult != null) { - return new Event(Event.TYPE_COMMAND_RESULT, position.getDeviceId(), position.getId()); + Collection<Event> events = new ArrayList<>(); + events.add(new Event(Event.TYPE_COMMAND_RESULT, position.getDeviceId(), position.getId())); + return events; } return null; } |