diff options
Diffstat (limited to 'src/org/traccar/protocol/AstraProtocolDecoder.java')
-rw-r--r-- | src/org/traccar/protocol/AstraProtocolDecoder.java | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/org/traccar/protocol/AstraProtocolDecoder.java b/src/org/traccar/protocol/AstraProtocolDecoder.java index f6b4ed559..6880047a9 100644 --- a/src/org/traccar/protocol/AstraProtocolDecoder.java +++ b/src/org/traccar/protocol/AstraProtocolDecoder.java @@ -19,6 +19,7 @@ import org.jboss.netty.buffer.ChannelBuffer; import org.jboss.netty.buffer.ChannelBuffers; import org.jboss.netty.channel.Channel; import org.traccar.BaseProtocolDecoder; +import org.traccar.DeviceSession; import org.traccar.helper.BitUtil; import org.traccar.helper.DateBuilder; import org.traccar.helper.UnitsConverter; @@ -52,7 +53,8 @@ public class AstraProtocolDecoder extends BaseProtocolDecoder { buf.readUnsignedShort(); // length String imei = String.format("%08d", buf.readUnsignedInt()) + String.format("%07d", buf.readUnsignedMedium()); - if (!identify(imei, channel, remoteAddress)) { + DeviceSession deviceSession = getDeviceSession(channel, remoteAddress, imei); + if (deviceSession == null) { return null; } @@ -62,7 +64,7 @@ public class AstraProtocolDecoder extends BaseProtocolDecoder { Position position = new Position(); position.setProtocol(getProtocolName()); - position.setDeviceId(getDeviceId()); + position.setDeviceId(deviceSession.getDeviceId()); buf.readUnsignedByte(); // index |