From 50d45d27beb423c1689f83401d0adb88b7fafb65 Mon Sep 17 00:00:00 2001 From: Ivan Muratov Date: Fri, 14 Jul 2017 08:48:27 +0300 Subject: Correction based on comments. Re-write modulo256 checksum's parameter to byte array, not varargs. Split the tests to two methods for HEADER ver1 and ver2. Remove above-class copyrights, added top-file copyrights. Rename parcelNumber to index. Rename recordStartSign to recordType. Remove crearing additional buffer for record data, use origin buffer instead. Added check on minimal length of packet to avoid the out-of-range exceptions. --- src/org/traccar/protocol/Arnavi4Protocol.java | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) (limited to 'src/org/traccar/protocol/Arnavi4Protocol.java') diff --git a/src/org/traccar/protocol/Arnavi4Protocol.java b/src/org/traccar/protocol/Arnavi4Protocol.java index 227397980..381a9b457 100644 --- a/src/org/traccar/protocol/Arnavi4Protocol.java +++ b/src/org/traccar/protocol/Arnavi4Protocol.java @@ -1,3 +1,18 @@ +/* + * Copyright 2017 Ivan Muratov (binakot@gmail.com) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package org.traccar.protocol; import org.jboss.netty.bootstrap.ServerBootstrap; @@ -8,9 +23,6 @@ import org.traccar.TrackerServer; import java.nio.ByteOrder; import java.util.List; -/** - * Created by Ivan Muratov @binakot on 11.07.2017. - */ public class Arnavi4Protocol extends BaseProtocol { public Arnavi4Protocol() { -- cgit v1.2.3