aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/protocol
diff options
context:
space:
mode:
authorEvgeny S Maksimov <admin@vragam.net>2019-01-21 19:35:21 +0300
committerEvgeny S Maksimov <admin@vragam.net>2019-01-21 19:35:21 +0300
commit7706648481f9687eecc070b4678cc792d7811da7 (patch)
tree7f700d0f0c06fef052002da0902d908ea31b20ba /src/org/traccar/protocol
parent3a0bcff44aba8b15d97a669dc8c959830644a8bd (diff)
downloadtrackermap-server-7706648481f9687eecc070b4678cc792d7811da7.tar.gz
trackermap-server-7706648481f9687eecc070b4678cc792d7811da7.tar.bz2
trackermap-server-7706648481f9687eecc070b4678cc792d7811da7.zip
Used member references for the FLEXPositionParser interface
Diffstat (limited to 'src/org/traccar/protocol')
-rw-r--r--src/org/traccar/protocol/NavisProtocolDecoder.java40
1 files changed, 5 insertions, 35 deletions
diff --git a/src/org/traccar/protocol/NavisProtocolDecoder.java b/src/org/traccar/protocol/NavisProtocolDecoder.java
index ec1a1324b..39e3bdc0f 100644
--- a/src/org/traccar/protocol/NavisProtocolDecoder.java
+++ b/src/org/traccar/protocol/NavisProtocolDecoder.java
@@ -661,46 +661,16 @@ public class NavisProtocolDecoder extends BaseProtocolDecoder {
switch (buf.readShortLE()) {
// FLEX 1.0
case 0x417E: // "~A"
- return processFLEXArray(new FLEXPositionParser() {
- @Override
- public ParseResult parsePosition(DeviceSession deviceSession, ByteBuf buf) {
- return NavisProtocolDecoder.this.parseFLEXPosition(deviceSession, buf);
- }
- },
- "~A", deviceSession, channel, buf);
+ return processFLEXArray(this::parseFLEXPosition, "~A", deviceSession, channel, buf);
case 0x547E: // "~T"
- return processFLEXSingle(new FLEXPositionParser() {
- @Override
- public ParseResult parsePosition(DeviceSession deviceSession, ByteBuf buf) {
- return NavisProtocolDecoder.this.parseFLEXPosition(deviceSession, buf);
- }
- },
- "~T", deviceSession, channel, buf);
+ return processFLEXSingle(this::parseFLEXPosition, "~T", deviceSession, channel, buf);
case 0x437E: // "~C"
- return processFLEXSingle(new FLEXPositionParser() {
- @Override
- public ParseResult parsePosition(DeviceSession deviceSession, ByteBuf buf) {
- return NavisProtocolDecoder.this.parseFLEXPosition(deviceSession, buf);
- }
- },
- "~C", deviceSession, channel, buf);
+ return processFLEXSingle(this::parseFLEXPosition, "~C", deviceSession, channel, buf);
// FLEX 2.0 (Extra packages)
case 0x457E: // "~E"
- return processFLEXArray(new FLEXPositionParser() {
- @Override
- public ParseResult parsePosition(DeviceSession deviceSession, ByteBuf buf) {
- return NavisProtocolDecoder.this.parseFLEX20Position(deviceSession, buf);
- }
- },
- "~E", deviceSession, channel, buf);
+ return processFLEXArray(this::parseFLEX20Position, "~E", deviceSession, channel, buf);
case 0x587E: // "~X"
- return processFLEXSingle(new FLEXPositionParser() {
- @Override
- public ParseResult parsePosition(DeviceSession deviceSession, ByteBuf buf) {
- return NavisProtocolDecoder.this.parseFLEX20Position(deviceSession, buf);
- }
- },
- "~X", deviceSession, channel, buf);
+ return processFLEXSingle(this::parseFLEX20Position, "~X", deviceSession, channel, buf);
default:
break;
}