diff options
Diffstat (limited to 'src/org/traccar/MainEventHandler.java')
-rw-r--r-- | src/org/traccar/MainEventHandler.java | 13 |
1 files changed, 2 insertions, 11 deletions
diff --git a/src/org/traccar/MainEventHandler.java b/src/org/traccar/MainEventHandler.java index 30ec75f58..b32d577de 100644 --- a/src/org/traccar/MainEventHandler.java +++ b/src/org/traccar/MainEventHandler.java @@ -31,27 +31,18 @@ public class MainEventHandler extends IdleStateAwareChannelHandler { public void messageReceived(ChannelHandlerContext ctx, MessageEvent e) { if (e.getMessage() != null) { - if (e.getMessage() instanceof Position) { Position position = (Position) e.getMessage(); // Log position StringBuilder s = new StringBuilder(); - s.append("device: ").append(position.getDeviceId()).append(", "); + s.append(formatChannel(e.getChannel())).append(" "); + s.append("id: ").append(position.getDeviceId()).append(", "); s.append("time: ").append(position.getFixTime()).append(", "); s.append("lat: ").append(position.getLatitude()).append(", "); s.append("lon: ").append(position.getLongitude()); Log.info(s.toString()); - - try { - Context.getDataManager().addPosition(position); - Context.getDataManager().updateLatestPosition(position); - Context.getConnectionManager().update(position); - } catch (Exception error) { - Log.warning(error); - } - } } } |