aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/protocol/MeiligaoProtocolDecoder.java
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2015-11-30 10:02:26 +1300
committerAnton Tananaev <anton.tananaev@gmail.com>2015-11-30 10:03:09 +1300
commita017cdabef201be45e96379b58154163d68fc00f (patch)
tree608662393ad902a927acba90f9bf9571b12ada0f /src/org/traccar/protocol/MeiligaoProtocolDecoder.java
parentdd943e107a9680948747fb0ab2132cc57d027352 (diff)
downloadtrackermap-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/MeiligaoProtocolDecoder.java')
-rw-r--r--src/org/traccar/protocol/MeiligaoProtocolDecoder.java8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/org/traccar/protocol/MeiligaoProtocolDecoder.java b/src/org/traccar/protocol/MeiligaoProtocolDecoder.java
index 046162331..cb2139a00 100644
--- a/src/org/traccar/protocol/MeiligaoProtocolDecoder.java
+++ b/src/org/traccar/protocol/MeiligaoProtocolDecoder.java
@@ -94,7 +94,7 @@ public class MeiligaoProtocolDecoder extends BaseProtocolDecoder {
public static final int MSG_RFID = 0x9966;
- private boolean identify(ChannelBuffer buf, Channel channel) {
+ private boolean identify(ChannelBuffer buf, Channel channel, SocketAddress remoteAddress) {
StringBuilder builder = new StringBuilder();
for (int i = 0; i < 7; i++) {
@@ -119,11 +119,11 @@ public class MeiligaoProtocolDecoder extends BaseProtocolDecoder {
// Try to recreate full IMEI number
// Sometimes first digit is cut, so this won't work
- if (id.length() == 14 && identify(id + Checksum.luhn(Long.parseLong(id)), channel, null, false)) {
+ if (id.length() == 14 && identify(id + Checksum.luhn(Long.parseLong(id)), channel, remoteAddress, false)) {
return true;
}
- return identify(id, channel);
+ return identify(id, channel, remoteAddress);
}
private static void sendResponse(
@@ -206,7 +206,7 @@ public class MeiligaoProtocolDecoder extends BaseProtocolDecoder {
buf.skipBytes(6);
}
- if (!identify(id, channel)) {
+ if (!identify(id, channel, remoteAddress)) {
return null;
}
position.setDeviceId(getDeviceId());