diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2015-11-30 10:02:26 +1300 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2015-11-30 10:03:09 +1300 |
commit | a017cdabef201be45e96379b58154163d68fc00f (patch) | |
tree | 608662393ad902a927acba90f9bf9571b12ada0f /src/org/traccar/protocol/GlobalSatProtocolDecoder.java | |
parent | dd943e107a9680948747fb0ab2132cc57d027352 (diff) | |
download | trackermap-server-a017cdabef201be45e96379b58154163d68fc00f.tar.gz trackermap-server-a017cdabef201be45e96379b58154163d68fc00f.tar.bz2 trackermap-server-a017cdabef201be45e96379b58154163d68fc00f.zip |
Always pass remote address to identify method
Diffstat (limited to 'src/org/traccar/protocol/GlobalSatProtocolDecoder.java')
-rw-r--r-- | src/org/traccar/protocol/GlobalSatProtocolDecoder.java | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/org/traccar/protocol/GlobalSatProtocolDecoder.java b/src/org/traccar/protocol/GlobalSatProtocolDecoder.java index 2643b6375..589bb991a 100644 --- a/src/org/traccar/protocol/GlobalSatProtocolDecoder.java +++ b/src/org/traccar/protocol/GlobalSatProtocolDecoder.java @@ -47,7 +47,7 @@ public class GlobalSatProtocolDecoder extends BaseProtocolDecoder { format1 = format; } - private Position decodeOriginal(Channel channel, String sentence) { + private Position decodeOriginal(Channel channel, SocketAddress remoteAddress, String sentence) { if (channel != null) { channel.write("ACK\r"); @@ -84,7 +84,7 @@ public class GlobalSatProtocolDecoder extends BaseProtocolDecoder { switch (format.charAt(formatIndex)) { case 'S': - if (!identify(value, channel)) { + if (!identify(value, channel, remoteAddress)) { return null; } position.setDeviceId(getDeviceId()); @@ -193,7 +193,7 @@ public class GlobalSatProtocolDecoder extends BaseProtocolDecoder { .number("(d+.?d*)") // hdop .compile(); - private Position decodeAlternative(Channel channel, String sentence) { + private Position decodeAlternative(Channel channel, SocketAddress remoteAddress, String sentence) { Parser parser = new Parser(PATTERN, sentence); if (!parser.matches()) { @@ -203,7 +203,7 @@ public class GlobalSatProtocolDecoder extends BaseProtocolDecoder { Position position = new Position(); position.setProtocol(getProtocolName()); - if (!identify(parser.next(), channel)) { + if (!identify(parser.next(), channel, remoteAddress)) { return null; } position.setDeviceId(getDeviceId()); @@ -234,9 +234,9 @@ public class GlobalSatProtocolDecoder extends BaseProtocolDecoder { String sentence = (String) msg; if (sentence.startsWith("GS")) { - return decodeOriginal(channel, sentence); + return decodeOriginal(channel, remoteAddress, sentence); } else if (sentence.startsWith("$")) { - return decodeAlternative(channel, sentence); + return decodeAlternative(channel, remoteAddress, sentence); } return null; |