aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/org/traccar/MainEventHandler.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/org/traccar/MainEventHandler.java')
-rw-r--r--src/main/java/org/traccar/MainEventHandler.java10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/main/java/org/traccar/MainEventHandler.java b/src/main/java/org/traccar/MainEventHandler.java
index a3f6f4105..0e60ac06d 100644
--- a/src/main/java/org/traccar/MainEventHandler.java
+++ b/src/main/java/org/traccar/MainEventHandler.java
@@ -23,12 +23,14 @@ import io.netty.handler.codec.http.HttpRequestDecoder;
import io.netty.handler.timeout.IdleStateEvent;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+import org.traccar.broadcast.BroadcastMessage;
import org.traccar.config.Keys;
import org.traccar.database.StatisticsManager;
import org.traccar.helper.DateUtil;
import org.traccar.model.Position;
import org.traccar.storage.StorageException;
+import java.io.IOException;
import java.util.Arrays;
import java.util.HashSet;
import java.util.LinkedHashSet;
@@ -61,6 +63,14 @@ public class MainEventHandler extends ChannelInboundHandlerAdapter {
LOGGER.warn("Failed to update device", error);
}
+ BroadcastMessage message = new BroadcastMessage();
+ message.setPosition(position);
+ try {
+ Context.getBroadcastService().sendMessage(message);
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+
String uniqueId = Context.getIdentityManager().getById(position.getDeviceId()).getUniqueId();
StringBuilder builder = new StringBuilder();