aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/protocol/SupermateProtocolDecoder.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/org/traccar/protocol/SupermateProtocolDecoder.java')
-rwxr-xr-xsrc/org/traccar/protocol/SupermateProtocolDecoder.java6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/org/traccar/protocol/SupermateProtocolDecoder.java b/src/org/traccar/protocol/SupermateProtocolDecoder.java
index bcbd02eb0..f673bff40 100755
--- a/src/org/traccar/protocol/SupermateProtocolDecoder.java
+++ b/src/org/traccar/protocol/SupermateProtocolDecoder.java
@@ -18,6 +18,7 @@ package org.traccar.protocol;
import org.jboss.netty.buffer.ChannelBuffers;
import org.jboss.netty.channel.Channel;
import org.traccar.BaseProtocolDecoder;
+import org.traccar.DeviceSession;
import org.traccar.helper.DateBuilder;
import org.traccar.helper.Parser;
import org.traccar.helper.PatternBuilder;
@@ -74,10 +75,11 @@ public class SupermateProtocolDecoder extends BaseProtocolDecoder {
position.setProtocol(getProtocolName());
String imei = parser.next();
- if (!identify(imei, channel, remoteAddress)) {
+ DeviceSession deviceSession = getDeviceSession(channel, remoteAddress, imei);
+ if (deviceSession == null) {
return null;
}
- position.setDeviceId(getDeviceId());
+ position.setDeviceId(deviceSession.getDeviceId());
position.set("commandId", parser.next());
position.set("command", parser.next());