From b4a655445b6ad7a0ef96193a616f8bdec182ca54 Mon Sep 17 00:00:00 2001 From: Evgeny S Maksimov Date: Mon, 21 Jan 2019 23:17:04 +0300 Subject: Naming convention fix --- src/org/traccar/protocol/NavisFrameDecoder.java | 8 +-- src/org/traccar/protocol/NavisProtocolDecoder.java | 64 +++++++++++----------- 2 files changed, 36 insertions(+), 36 deletions(-) (limited to 'src/org/traccar') diff --git a/src/org/traccar/protocol/NavisFrameDecoder.java b/src/org/traccar/protocol/NavisFrameDecoder.java index b82a3a5fb..1d77c0d65 100644 --- a/src/org/traccar/protocol/NavisFrameDecoder.java +++ b/src/org/traccar/protocol/NavisFrameDecoder.java @@ -48,7 +48,7 @@ public class NavisFrameDecoder extends BaseFrameDecoder { return buf.readRetainedSlice(1); } else if (buf.getByte(buf.readerIndex()) == 0x7E /* "~" */) { // FLEX frame - if (protocolDecoder.getFLEXDataSize() == 0) { + if (protocolDecoder.getFlexDataSize() == 0) { return null; } if (buf.readableBytes() > MAX_FRAME_LENGTH) { @@ -60,14 +60,14 @@ public class NavisFrameDecoder extends BaseFrameDecoder { switch (buf.getByte(buf.readerIndex() + 1)) { // FLEX 1.0 case 0x41: // "A" - length = protocolDecoder.getFLEXDataSize() + length = protocolDecoder.getFlexDataSize() * buf.getByte(buf.readerIndex() + FLEX_HEADER_LENGTH) + 2; break; case 0x54: // "T" - length = protocolDecoder.getFLEXDataSize() + 5; + length = protocolDecoder.getFlexDataSize() + 5; break; case 0x43: // "C" - length = protocolDecoder.getFLEXDataSize() + 1; + length = protocolDecoder.getFlexDataSize() + 1; break; // FLEX 2.0 (Extra packages) case 0x45: // "E" diff --git a/src/org/traccar/protocol/NavisProtocolDecoder.java b/src/org/traccar/protocol/NavisProtocolDecoder.java index 93e751012..ed2562125 100644 --- a/src/org/traccar/protocol/NavisProtocolDecoder.java +++ b/src/org/traccar/protocol/NavisProtocolDecoder.java @@ -91,7 +91,7 @@ public class NavisProtocolDecoder extends BaseProtocolDecoder { } } - private ParseResult parseNTCBPosition(DeviceSession deviceSession, ByteBuf buf) { + private ParseResult parseNtcbPosition(DeviceSession deviceSession, ByteBuf buf) { Position position = new Position(getProtocolName()); position.setDeviceId(deviceSession.getDeviceId()); @@ -278,13 +278,13 @@ public class NavisProtocolDecoder extends BaseProtocolDecoder { return new ParseResult(index, position); } - private Object processNTCBSingle(DeviceSession deviceSession, Channel channel, ByteBuf buf) { - ParseResult result = parseNTCBPosition(deviceSession, buf); + private Object processNtcbSingle(DeviceSession deviceSession, Channel channel, ByteBuf buf) { + ParseResult result = parseNtcbPosition(deviceSession, buf); ByteBuf response = Unpooled.buffer(7); response.writeCharSequence("* positions = new LinkedList<>(); int count = buf.readUnsignedByte(); for (int i = 0; i < count; i++) { - Position position = parseNTCBPosition(deviceSession, buf).getPosition(); + Position position = parseNtcbPosition(deviceSession, buf).getPosition(); if (position.getFixTime() != null) { positions.add(position); } @@ -307,7 +307,7 @@ public class NavisProtocolDecoder extends BaseProtocolDecoder { ByteBuf response = Unpooled.buffer(7); response.writeCharSequence("* positions = new LinkedList<>(); int count = buf.readUnsignedByte(); @@ -563,7 +563,7 @@ public class NavisProtocolDecoder extends BaseProtocolDecoder { ByteBuf response = Unpooled.buffer(6); response.writeCharSequence(flexHeader, StandardCharsets.US_ASCII); response.writeByte(count); - sendFLEXReply(channel, response); + sendFlexReply(channel, response); if (positions.isEmpty()) { return null; @@ -572,7 +572,7 @@ public class NavisProtocolDecoder extends BaseProtocolDecoder { return positions; } - private Object processFLEXNegotiation(Channel channel, ByteBuf buf) { + private Object processFlexNegotiation(Channel channel, ByteBuf buf) { if ((byte) buf.readUnsignedByte() != (byte) 0xB0) { return null; } @@ -604,7 +604,7 @@ public class NavisProtocolDecoder extends BaseProtocolDecoder { response.writeByte(0xB0); response.writeByte(flexProtocolVersion); response.writeByte(flexStructVersion); - sendNTCBReply(channel, response); + sendNtcbReply(channel, response); return null; } @@ -612,7 +612,7 @@ public class NavisProtocolDecoder extends BaseProtocolDecoder { private Object processHandshake(Channel channel, SocketAddress remoteAddress, ByteBuf buf) { buf.skipBytes(1); // Colon symbol if (getDeviceSession(channel, remoteAddress, buf.toString(StandardCharsets.US_ASCII)) != null) { - sendNTCBReply(channel, Unpooled.copiedBuffer("*A" - return processNTCBArray(deviceSession, channel, buf); + return processNtcbArray(deviceSession, channel, buf); case 0x543E2A: // "*>T" - return processNTCBSingle(deviceSession, channel, buf); + return processNtcbSingle(deviceSession, channel, buf); case 0x463E2A: // "*>F" (*>FLEX) buf.skipBytes(3); - return processFLEXNegotiation(channel, buf); + return processFlexNegotiation(channel, buf); default: break; } @@ -735,7 +735,7 @@ public class NavisProtocolDecoder extends BaseProtocolDecoder { return null; } - public int getFLEXDataSize() { + public int getFlexDataSize() { return flexDataSize; } } -- cgit v1.2.3