aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2016-07-19 18:45:34 +1200
committerAnton Tananaev <anton.tananaev@gmail.com>2016-07-19 18:45:34 +1200
commit1a0eae22fc58d7241e2c60bb593535a17d6c629b (patch)
tree7d08f460c39319eb415c23474e37cbe83da8e8cf /src/org/traccar
parentb6373da0a0ef4436f48d35256c3cd3373f22d8d7 (diff)
downloadtrackermap-server-1a0eae22fc58d7241e2c60bb593535a17d6c629b.tar.gz
trackermap-server-1a0eae22fc58d7241e2c60bb593535a17d6c629b.tar.bz2
trackermap-server-1a0eae22fc58d7241e2c60bb593535a17d6c629b.zip
Correctly add device to active
Diffstat (limited to 'src/org/traccar')
-rw-r--r--src/org/traccar/BaseProtocolDecoder.java6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/org/traccar/BaseProtocolDecoder.java b/src/org/traccar/BaseProtocolDecoder.java
index f98617caf..46832a4ca 100644
--- a/src/org/traccar/BaseProtocolDecoder.java
+++ b/src/org/traccar/BaseProtocolDecoder.java
@@ -77,6 +77,9 @@ public abstract class BaseProtocolDecoder extends ExtendedObjectDecoder {
} else if (deviceId != 0) {
deviceSession = new DeviceSession(deviceId);
addressDeviceSessions.put(remoteAddress, deviceSession);
+ if (Context.getConnectionManager() != null) {
+ Context.getConnectionManager().addActiveDevice(deviceId, protocol, channel, remoteAddress);
+ }
return deviceSession;
} else {
return null;
@@ -86,6 +89,9 @@ public abstract class BaseProtocolDecoder extends ExtendedObjectDecoder {
long deviceId = findDeviceId(remoteAddress, uniqueIds);
if (deviceId != 0) {
channelDeviceSession = new DeviceSession(deviceId);
+ if (Context.getConnectionManager() != null) {
+ Context.getConnectionManager().addActiveDevice(deviceId, protocol, channel, remoteAddress);
+ }
}
}
return channelDeviceSession;