aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2015-10-08 12:10:58 +1300
committerAnton Tananaev <anton.tananaev@gmail.com>2015-10-08 12:10:58 +1300
commit2e69800d0d83e3d0486b0ca0cecde7d2a451c105 (patch)
tree25307a6528d081d43de0c13e7a2f044a4dd7b7e3 /src
parent3f5aef83e284a1c4f4e608d57d7f3330af6ea12a (diff)
downloadtrackermap-server-2e69800d0d83e3d0486b0ca0cecde7d2a451c105.tar.gz
trackermap-server-2e69800d0d83e3d0486b0ca0cecde7d2a451c105.tar.bz2
trackermap-server-2e69800d0d83e3d0486b0ca0cecde7d2a451c105.zip
Make protocol message types public
Diffstat (limited to 'src')
-rw-r--r--src/org/traccar/protocol/AutoFonFrameDecoder.java6
-rw-r--r--src/org/traccar/protocol/AutoFonProtocolDecoder.java6
-rw-r--r--src/org/traccar/protocol/Avl301ProtocolDecoder.java6
-rw-r--r--src/org/traccar/protocol/BceProtocolDecoder.java10
-rw-r--r--src/org/traccar/protocol/CalAmpProtocolDecoder.java24
-rw-r--r--src/org/traccar/protocol/CellocatorProtocolDecoder.java2
-rw-r--r--src/org/traccar/protocol/EelinkProtocolDecoder.java18
-rw-r--r--src/org/traccar/protocol/GatorProtocolDecoder.java30
-rw-r--r--src/org/traccar/protocol/Gt02ProtocolDecoder.java4
-rw-r--r--src/org/traccar/protocol/Gt06ProtocolDecoder.java38
-rw-r--r--src/org/traccar/protocol/KhdProtocolDecoder.java16
-rw-r--r--src/org/traccar/protocol/KhdProtocolEncoder.java4
-rw-r--r--src/org/traccar/protocol/MeiligaoProtocolDecoder.java16
-rw-r--r--src/org/traccar/protocol/MxtProtocolDecoder.java6
-rw-r--r--src/org/traccar/protocol/NavigilProtocolDecoder.java44
-rw-r--r--src/org/traccar/protocol/NoranProtocolDecoder.java16
-rw-r--r--src/org/traccar/protocol/OrionFrameDecoder.java7
-rw-r--r--src/org/traccar/protocol/OrionProtocolDecoder.java6
-rw-r--r--src/org/traccar/protocol/PiligrimProtocolDecoder.java6
-rw-r--r--src/org/traccar/protocol/ProgressProtocolDecoder.java18
-rw-r--r--src/org/traccar/protocol/TramigoProtocolDecoder.java4
21 files changed, 142 insertions, 145 deletions
diff --git a/src/org/traccar/protocol/AutoFonFrameDecoder.java b/src/org/traccar/protocol/AutoFonFrameDecoder.java
index e8de3ea66..55a28c081 100644
--- a/src/org/traccar/protocol/AutoFonFrameDecoder.java
+++ b/src/org/traccar/protocol/AutoFonFrameDecoder.java
@@ -22,9 +22,9 @@ import org.jboss.netty.handler.codec.frame.FrameDecoder;
public class AutoFonFrameDecoder extends FrameDecoder {
- private static final int MSG_LOGIN = 0x10;
- private static final int MSG_LOCATION = 0x11;
- private static final int MSG_HISTORY = 0x12;
+ public static final int MSG_LOGIN = 0x10;
+ public static final int MSG_LOCATION = 0x11;
+ public static final int MSG_HISTORY = 0x12;
@Override
protected Object decode(
diff --git a/src/org/traccar/protocol/AutoFonProtocolDecoder.java b/src/org/traccar/protocol/AutoFonProtocolDecoder.java
index afc9a2d79..04b0025a4 100644
--- a/src/org/traccar/protocol/AutoFonProtocolDecoder.java
+++ b/src/org/traccar/protocol/AutoFonProtocolDecoder.java
@@ -34,9 +34,9 @@ public class AutoFonProtocolDecoder extends BaseProtocolDecoder {
super(protocol);
}
- private static final int MSG_LOGIN = 0x10;
- private static final int MSG_LOCATION = 0x11;
- private static final int MSG_HISTORY = 0x12;
+ public static final int MSG_LOGIN = 0x10;
+ public static final int MSG_LOCATION = 0x11;
+ public static final int MSG_HISTORY = 0x12;
private static double convertCoordinate(int raw) {
double result = raw / 1000000;
diff --git a/src/org/traccar/protocol/Avl301ProtocolDecoder.java b/src/org/traccar/protocol/Avl301ProtocolDecoder.java
index 0aec2dad5..1eb2cc4ad 100644
--- a/src/org/traccar/protocol/Avl301ProtocolDecoder.java
+++ b/src/org/traccar/protocol/Avl301ProtocolDecoder.java
@@ -44,9 +44,9 @@ public class Avl301ProtocolDecoder extends BaseProtocolDecoder {
return imei.toString();
}
- private static final int MSG_LOGIN = 'L';
- private static final int MSG_STATUS = 'H';
- private static final int MSG_GPS_LBS_STATUS = '$';
+ public static final int MSG_LOGIN = 'L';
+ public static final int MSG_STATUS = 'H';
+ public static final int MSG_GPS_LBS_STATUS = '$';
private static void sendResponse(Channel channel, int type) {
if (channel != null) {
diff --git a/src/org/traccar/protocol/BceProtocolDecoder.java b/src/org/traccar/protocol/BceProtocolDecoder.java
index ce565f71d..c6f928aef 100644
--- a/src/org/traccar/protocol/BceProtocolDecoder.java
+++ b/src/org/traccar/protocol/BceProtocolDecoder.java
@@ -36,11 +36,11 @@ public class BceProtocolDecoder extends BaseProtocolDecoder {
private static final int DATA_TYPE = 7;
- private static final int MSG_ASYNC_STACK = 0xA5;
- private static final int MSG_STACK_COFIRM = 0x19;
- private static final int MSG_TIME_TRIGGERED = 0xA0;
- private static final int MSG_OUTPUT_CONTROL = 0x41;
- private static final int MSG_OUTPUT_CONTROL_ACK = 0xC1;
+ public static final int MSG_ASYNC_STACK = 0xA5;
+ public static final int MSG_STACK_COFIRM = 0x19;
+ public static final int MSG_TIME_TRIGGERED = 0xA0;
+ public static final int MSG_OUTPUT_CONTROL = 0x41;
+ public static final int MSG_OUTPUT_CONTROL_ACK = 0xC1;
@Override
protected Object decode(
diff --git a/src/org/traccar/protocol/CalAmpProtocolDecoder.java b/src/org/traccar/protocol/CalAmpProtocolDecoder.java
index d05acd94b..7c6a45f18 100644
--- a/src/org/traccar/protocol/CalAmpProtocolDecoder.java
+++ b/src/org/traccar/protocol/CalAmpProtocolDecoder.java
@@ -31,18 +31,18 @@ public class CalAmpProtocolDecoder extends BaseProtocolDecoder {
super(protocol);
}
- private static final int MSG_NULL = 0;
- private static final int MSG_ACK = 1;
- private static final int MSG_EVENT_REPORT = 2;
- private static final int MSG_ID_REPORT = 3;
- private static final int MSG_USER_DATA = 4;
- private static final int MSG_APP_DATA = 5;
- private static final int MSG_CONFIG = 6;
- private static final int MSG_UNIT_REQUEST = 7;
- private static final int MSG_LOCATE_REPORT = 8;
- private static final int MSG_USER_DATA_ACC = 9;
- private static final int MSG_MINI_EVENT_REPORT = 10;
- private static final int MSG_MINI_USER_DATA = 11;
+ public static final int MSG_NULL = 0;
+ public static final int MSG_ACK = 1;
+ public static final int MSG_EVENT_REPORT = 2;
+ public static final int MSG_ID_REPORT = 3;
+ public static final int MSG_USER_DATA = 4;
+ public static final int MSG_APP_DATA = 5;
+ public static final int MSG_CONFIG = 6;
+ public static final int MSG_UNIT_REQUEST = 7;
+ public static final int MSG_LOCATE_REPORT = 8;
+ public static final int MSG_USER_DATA_ACC = 9;
+ public static final int MSG_MINI_EVENT_REPORT = 10;
+ public static final int MSG_MINI_USER_DATA = 11;
private static final int SERVICE_UNACKNOWLEDGED = 0;
private static final int SERVICE_ACKNOWLEDGED = 1;
diff --git a/src/org/traccar/protocol/CellocatorProtocolDecoder.java b/src/org/traccar/protocol/CellocatorProtocolDecoder.java
index 45505a7c7..5517e703b 100644
--- a/src/org/traccar/protocol/CellocatorProtocolDecoder.java
+++ b/src/org/traccar/protocol/CellocatorProtocolDecoder.java
@@ -39,7 +39,7 @@ public class CellocatorProtocolDecoder extends BaseProtocolDecoder {
static final int MSG_CLIENT_SERIAL = 8;
static final int MSG_CLIENT_MODULAR = 9;
- private static final int MSG_SERVER_ACKNOWLEDGE = 4;
+ public static final int MSG_SERVER_ACKNOWLEDGE = 4;
private byte commandCount;
diff --git a/src/org/traccar/protocol/EelinkProtocolDecoder.java b/src/org/traccar/protocol/EelinkProtocolDecoder.java
index 52f6a7f63..41c415c78 100644
--- a/src/org/traccar/protocol/EelinkProtocolDecoder.java
+++ b/src/org/traccar/protocol/EelinkProtocolDecoder.java
@@ -32,15 +32,15 @@ public class EelinkProtocolDecoder extends BaseProtocolDecoder {
super(protocol);
}
- private static final int MSG_LOGIN = 0x01;
- private static final int MSG_GPS = 0x02;
- private static final int MSG_HEARTBEAT = 0x03;
- private static final int MSG_ALARM = 0x04;
- private static final int MSG_STATE = 0x05;
- private static final int MSG_SMS = 0x06;
- private static final int MSG_OBD = 0x07;
- private static final int MSG_INTERACTIVE = 0x80;
- private static final int MSG_DATA = 0x81;
+ public static final int MSG_LOGIN = 0x01;
+ public static final int MSG_GPS = 0x02;
+ public static final int MSG_HEARTBEAT = 0x03;
+ public static final int MSG_ALARM = 0x04;
+ public static final int MSG_STATE = 0x05;
+ public static final int MSG_SMS = 0x06;
+ public static final int MSG_OBD = 0x07;
+ public static final int MSG_INTERACTIVE = 0x80;
+ public static final int MSG_DATA = 0x81;
private void sendResponse(Channel channel, int type, int index) {
if (channel != null) {
diff --git a/src/org/traccar/protocol/GatorProtocolDecoder.java b/src/org/traccar/protocol/GatorProtocolDecoder.java
index 7bf0a2633..2dfc2e56a 100644
--- a/src/org/traccar/protocol/GatorProtocolDecoder.java
+++ b/src/org/traccar/protocol/GatorProtocolDecoder.java
@@ -34,17 +34,17 @@ public class GatorProtocolDecoder extends BaseProtocolDecoder {
super(protocol);
}
- private static final int PACKET_HEARTBEAT = 0x21;
- private static final int PACKET_POSITION_DATA = 0x80;
- private static final int PACKET_ROLLCALL_RESPONSE = 0x81;
- private static final int PACKET_ALARM_DATA = 0x82;
- private static final int PACKET_TERMINAL_STATUS = 0x83;
- private static final int PACKET_MESSAGE = 0x84;
- private static final int PACKET_TERMINAL_ANSWER = 0x85;
- private static final int PACKET_BLIND_AREA = 0x8E;
- private static final int PACKET_PICTURE_FRAME = 0x54;
- private static final int PACKET_CAMERA_RESPONSE = 0x56;
- private static final int PACKET_PICTURE_DATA = 0x57;
+ public static final int MSG_HEARTBEAT = 0x21;
+ public static final int MSG_POSITION_DATA = 0x80;
+ public static final int MSG_ROLLCALL_RESPONSE = 0x81;
+ public static final int MSG_ALARM_DATA = 0x82;
+ public static final int MSG_TERMINAL_STATUS = 0x83;
+ public static final int MSG_MESSAGE = 0x84;
+ public static final int MSG_TERMINAL_ANSWER = 0x85;
+ public static final int MSG_BLIND_AREA = 0x8E;
+ public static final int MSG_PICTURE_FRAME = 0x54;
+ public static final int MSG_CAMERA_RESPONSE = 0x56;
+ public static final int MSG_PICTURE_DATA = 0x57;
@Override
protected Object decode(
@@ -63,10 +63,10 @@ public class GatorProtocolDecoder extends BaseProtocolDecoder {
buf.readUnsignedByte(), buf.readUnsignedByte());
id = id.replaceFirst("^0+(?!$)", "");
- if (type == PACKET_POSITION_DATA ||
- type == PACKET_ROLLCALL_RESPONSE ||
- type == PACKET_ALARM_DATA ||
- type == PACKET_BLIND_AREA) {
+ if (type == MSG_POSITION_DATA ||
+ type == MSG_ROLLCALL_RESPONSE ||
+ type == MSG_ALARM_DATA ||
+ type == MSG_BLIND_AREA) {
// Create new position
Position position = new Position();
diff --git a/src/org/traccar/protocol/Gt02ProtocolDecoder.java b/src/org/traccar/protocol/Gt02ProtocolDecoder.java
index 6ff1a48cb..5d082e381 100644
--- a/src/org/traccar/protocol/Gt02ProtocolDecoder.java
+++ b/src/org/traccar/protocol/Gt02ProtocolDecoder.java
@@ -46,8 +46,8 @@ public class Gt02ProtocolDecoder extends BaseProtocolDecoder {
return imei.toString();
}
- private static final int MSG_HEARTBEAT = 0x1A;
- private static final int MSG_DATA = 0x10;
+ public static final int MSG_HEARTBEAT = 0x1A;
+ public static final int MSG_DATA = 0x10;
@Override
protected Object decode(
diff --git a/src/org/traccar/protocol/Gt06ProtocolDecoder.java b/src/org/traccar/protocol/Gt06ProtocolDecoder.java
index 4c744dd9f..912a981b9 100644
--- a/src/org/traccar/protocol/Gt06ProtocolDecoder.java
+++ b/src/org/traccar/protocol/Gt06ProtocolDecoder.java
@@ -54,25 +54,25 @@ public class Gt06ProtocolDecoder extends BaseProtocolDecoder {
return imei.toString();
}
- private static final int MSG_LOGIN = 0x01;
- private static final int MSG_GPS = 0x10;
- private static final int MSG_LBS = 0x11;
- private static final int MSG_GPS_LBS_1 = 0x12;
- private static final int MSG_GPS_LBS_2 = 0x22;
- private static final int MSG_STATUS = 0x13;
- private static final int MSG_SATELLITE = 0x14;
- private static final int MSG_STRING = 0x15;
- private static final int MSG_GPS_LBS_STATUS_1 = 0x16;
- private static final int MSG_GPS_LBS_STATUS_2 = 0x26;
- private static final int MSG_GPS_LBS_STATUS_3 = 0x27;
- private static final int MSG_LBS_PHONE = 0x17;
- private static final int MSG_LBS_EXTEND = 0x18;
- private static final int MSG_LBS_STATUS = 0x19;
- private static final int MSG_GPS_PHONE = 0x1A;
- private static final int MSG_GPS_LBS_EXTEND = 0x1E;
- private static final int MSG_COMMAND_0 = 0x80;
- private static final int MSG_COMMAND_1 = 0x81;
- private static final int MSG_COMMAND_2 = 0x82;
+ public static final int MSG_LOGIN = 0x01;
+ public static final int MSG_GPS = 0x10;
+ public static final int MSG_LBS = 0x11;
+ public static final int MSG_GPS_LBS_1 = 0x12;
+ public static final int MSG_GPS_LBS_2 = 0x22;
+ public static final int MSG_STATUS = 0x13;
+ public static final int MSG_SATELLITE = 0x14;
+ public static final int MSG_STRING = 0x15;
+ public static final int MSG_GPS_LBS_STATUS_1 = 0x16;
+ public static final int MSG_GPS_LBS_STATUS_2 = 0x26;
+ public static final int MSG_GPS_LBS_STATUS_3 = 0x27;
+ public static final int MSG_LBS_PHONE = 0x17;
+ public static final int MSG_LBS_EXTEND = 0x18;
+ public static final int MSG_LBS_STATUS = 0x19;
+ public static final int MSG_GPS_PHONE = 0x1A;
+ public static final int MSG_GPS_LBS_EXTEND = 0x1E;
+ public static final int MSG_COMMAND_0 = 0x80;
+ public static final int MSG_COMMAND_1 = 0x81;
+ public static final int MSG_COMMAND_2 = 0x82;
private static void sendResponse(Channel channel, int type, int index) {
if (channel != null) {
diff --git a/src/org/traccar/protocol/KhdProtocolDecoder.java b/src/org/traccar/protocol/KhdProtocolDecoder.java
index e934cacf3..e74b87cec 100644
--- a/src/org/traccar/protocol/KhdProtocolDecoder.java
+++ b/src/org/traccar/protocol/KhdProtocolDecoder.java
@@ -45,14 +45,14 @@ public class KhdProtocolDecoder extends BaseProtocolDecoder {
return String.valueOf(Long.parseLong(serialNumber));
}
- private static final int MSG_LOGIN = 0xB1;
- private static final int MSG_CONFIRMATION = 0x21;
- private static final int MSG_ON_DEMAND = 0x81;
- private static final int MSG_POSITION_UPLOAD = 0x80;
- private static final int MSG_POSITION_REUPLOAD = 0x8E;
- private static final int MSG_ALARM = 0x82;
- private static final int MSG_REPLY = 0x85;
- private static final int MSG_PERIPHERAL = 0xA3;
+ public static final int MSG_LOGIN = 0xB1;
+ public static final int MSG_CONFIRMATION = 0x21;
+ public static final int MSG_ON_DEMAND = 0x81;
+ public static final int MSG_POSITION_UPLOAD = 0x80;
+ public static final int MSG_POSITION_REUPLOAD = 0x8E;
+ public static final int MSG_ALARM = 0x82;
+ public static final int MSG_REPLY = 0x85;
+ public static final int MSG_PERIPHERAL = 0xA3;
@Override
protected Object decode(
diff --git a/src/org/traccar/protocol/KhdProtocolEncoder.java b/src/org/traccar/protocol/KhdProtocolEncoder.java
index a33fa34c2..0caf58eb0 100644
--- a/src/org/traccar/protocol/KhdProtocolEncoder.java
+++ b/src/org/traccar/protocol/KhdProtocolEncoder.java
@@ -23,8 +23,8 @@ import org.traccar.model.Command;
public class KhdProtocolEncoder extends BaseProtocolEncoder {
- private static final int MSG_CUT_OIL = 0x39;
- private static final int MSG_RESUME_OIL = 0x38;
+ public static final int MSG_CUT_OIL = 0x39;
+ public static final int MSG_RESUME_OIL = 0x38;
private ChannelBuffer encodeCommand(int command) {
diff --git a/src/org/traccar/protocol/MeiligaoProtocolDecoder.java b/src/org/traccar/protocol/MeiligaoProtocolDecoder.java
index 94aabb5eb..f5ad46885 100644
--- a/src/org/traccar/protocol/MeiligaoProtocolDecoder.java
+++ b/src/org/traccar/protocol/MeiligaoProtocolDecoder.java
@@ -69,16 +69,16 @@ public class MeiligaoProtocolDecoder extends BaseProtocolDecoder {
"(\\d+)(\\d{2}\\.\\d+)," + // Longitude (DDDMM.MMMM)
"([EW])");
- private static final int MSG_HEARTBEAT = 0x0001;
- private static final int MSG_SERVER = 0x0002;
- private static final int MSG_LOGIN = 0x5000;
- private static final int MSG_LOGIN_RESPONSE = 0x4000;
+ public static final int MSG_HEARTBEAT = 0x0001;
+ public static final int MSG_SERVER = 0x0002;
+ public static final int MSG_LOGIN = 0x5000;
+ public static final int MSG_LOGIN_RESPONSE = 0x4000;
- private static final int MSG_POSITION = 0x9955;
- private static final int MSG_POSITION_LOGGED = 0x9016;
- private static final int MSG_ALARM = 0x9999;
+ public static final int MSG_POSITION = 0x9955;
+ public static final int MSG_POSITION_LOGGED = 0x9016;
+ public static final int MSG_ALARM = 0x9999;
- private static final int MSG_RFID = 0x9966;
+ public static final int MSG_RFID = 0x9966;
private boolean identify(ChannelBuffer buf, Channel channel) {
String id = "";
diff --git a/src/org/traccar/protocol/MxtProtocolDecoder.java b/src/org/traccar/protocol/MxtProtocolDecoder.java
index 9f7207bc4..e35973654 100644
--- a/src/org/traccar/protocol/MxtProtocolDecoder.java
+++ b/src/org/traccar/protocol/MxtProtocolDecoder.java
@@ -34,9 +34,9 @@ public class MxtProtocolDecoder extends BaseProtocolDecoder {
super(protocol);
}
- private static final int MSG_ACK = 0x02;
- private static final int MSG_NACK = 0x03;
- private static final int MSG_POSITION = 0x31;
+ public static final int MSG_ACK = 0x02;
+ public static final int MSG_NACK = 0x03;
+ public static final int MSG_POSITION = 0x31;
@Override
protected Object decode(
diff --git a/src/org/traccar/protocol/NavigilProtocolDecoder.java b/src/org/traccar/protocol/NavigilProtocolDecoder.java
index 142d19fc6..d361d20a1 100644
--- a/src/org/traccar/protocol/NavigilProtocolDecoder.java
+++ b/src/org/traccar/protocol/NavigilProtocolDecoder.java
@@ -35,21 +35,21 @@ public class NavigilProtocolDecoder extends BaseProtocolDecoder {
private static final int LEAP_SECONDS_DELTA = 25;
- private static final int MESSAGE_ERROR = 2;
- private static final int MESSAGE_INDICATION = 4;
- private static final int MESSAGE_CONN_OPEN = 5;
- private static final int MESSAGE_CONN_CLOSE = 6;
- private static final int MESSAGE_SYSTEM_REPORT = 7;
- private static final int MESSAGE_UNIT_REPORT = 8;
- private static final int MESSAGE_GEOFENCE_ALARM = 10;
- private static final int MESSAGE_INPUT_ALARM = 11;
- private static final int MESSAGE_TG2_REPORT = 12;
- private static final int MESSAGE_POSITION_REPORT = 13;
- private static final int MESSAGE_POSITION_REPORT_2 = 15;
- private static final int MESSAGE_SNAPSHOT4 = 17;
- private static final int MESSAGE_TRACKING_DATA = 18;
- private static final int MESSAGE_MOTION_ALARM = 19;
- private static final int MESSAGE_ACKNOWLEDGEMENT = 255;
+ public static final int MSG_ERROR = 2;
+ public static final int MSG_INDICATION = 4;
+ public static final int MSG_CONN_OPEN = 5;
+ public static final int MSG_CONN_CLOSE = 6;
+ public static final int MSG_SYSTEM_REPORT = 7;
+ public static final int MSG_UNIT_REPORT = 8;
+ public static final int MSG_GEOFENCE_ALARM = 10;
+ public static final int MSG_INPUT_ALARM = 11;
+ public static final int MSG_TG2_REPORT = 12;
+ public static final int MSG_POSITION_REPORT = 13;
+ public static final int MSG_POSITION_REPORT_2 = 15;
+ public static final int MSG_SNAPSHOT4 = 17;
+ public static final int MSG_TRACKING_DATA = 18;
+ public static final int MSG_MOTION_ALARM = 19;
+ public static final int MSG_ACKNOWLEDGEMENT = 255;
private static Date convertTimestamp(long timestamp) {
return new Date((timestamp - LEAP_SECONDS_DELTA) * 1000l);
@@ -65,7 +65,7 @@ public class NavigilProtocolDecoder extends BaseProtocolDecoder {
ChannelBuffer header = ChannelBuffers.directBuffer(ByteOrder.LITTLE_ENDIAN, 20);
header.writeByte(1); header.writeByte(0);
header.writeShort(senderSequenceNumber++);
- header.writeShort(MESSAGE_ACKNOWLEDGEMENT);
+ header.writeShort(MSG_ACKNOWLEDGEMENT);
header.writeShort(header.capacity() + data.capacity());
header.writeShort(0);
header.writeShort(Checksum.crc16(Checksum.CRC16_CCITT_FALSE, data.toByteBuffer()));
@@ -290,17 +290,17 @@ public class NavigilProtocolDecoder extends BaseProtocolDecoder {
// Parse messages
switch (messageId) {
- case MESSAGE_UNIT_REPORT:
+ case MSG_UNIT_REPORT:
return parseUnitReport(buf, sequenceNumber);
- case MESSAGE_TG2_REPORT:
+ case MSG_TG2_REPORT:
return parseTg2Report(buf, sequenceNumber);
- case MESSAGE_POSITION_REPORT:
+ case MSG_POSITION_REPORT:
return parsePositionReport(buf, sequenceNumber, timestamp);
- case MESSAGE_POSITION_REPORT_2:
+ case MSG_POSITION_REPORT_2:
return parsePositionReport2(buf, sequenceNumber, timestamp);
- case MESSAGE_SNAPSHOT4:
+ case MSG_SNAPSHOT4:
return parseSnapshot4(buf, sequenceNumber);
- case MESSAGE_TRACKING_DATA:
+ case MSG_TRACKING_DATA:
return parseTrackingData(buf, sequenceNumber, timestamp);
}
diff --git a/src/org/traccar/protocol/NoranProtocolDecoder.java b/src/org/traccar/protocol/NoranProtocolDecoder.java
index 8556ddc69..ddfa4cba6 100644
--- a/src/org/traccar/protocol/NoranProtocolDecoder.java
+++ b/src/org/traccar/protocol/NoranProtocolDecoder.java
@@ -37,14 +37,14 @@ public class NoranProtocolDecoder extends BaseProtocolDecoder {
private static final DateFormat dateFormat = new SimpleDateFormat("yy-MM-dd HH:mm:ss");
- private static final int MSG_UPLOAD_POSITION = 0x0008;
- private static final int MSG_UPLOAD_POSITION_NEW = 0x0032;
- private static final int MSG_CONTROL_RESPONSE = 0x8009;
- private static final int MSG_ALARM = 0x0003;
- private static final int MSG_SHAKE_HAND = 0x0000;
- private static final int MSG_SHAKE_HAND_RESPONSE = 0x8000;
- private static final int MSG_IMAGE_SIZE = 0x0200;
- private static final int MSG_IMAGE_PACKET = 0x0201;
+ public static final int MSG_UPLOAD_POSITION = 0x0008;
+ public static final int MSG_UPLOAD_POSITION_NEW = 0x0032;
+ public static final int MSG_CONTROL_RESPONSE = 0x8009;
+ public static final int MSG_ALARM = 0x0003;
+ public static final int MSG_SHAKE_HAND = 0x0000;
+ public static final int MSG_SHAKE_HAND_RESPONSE = 0x8000;
+ public static final int MSG_IMAGE_SIZE = 0x0200;
+ public static final int MSG_IMAGE_PACKET = 0x0201;
@Override
diff --git a/src/org/traccar/protocol/OrionFrameDecoder.java b/src/org/traccar/protocol/OrionFrameDecoder.java
index 63bf84494..033dbd1d5 100644
--- a/src/org/traccar/protocol/OrionFrameDecoder.java
+++ b/src/org/traccar/protocol/OrionFrameDecoder.java
@@ -22,9 +22,6 @@ import org.jboss.netty.handler.codec.frame.FrameDecoder;
public class OrionFrameDecoder extends FrameDecoder {
- private static final int TYPE_USERLOG = 0;
- private static final int TYPE_SYSLOG = 3;
-
@Override
protected Object decode(
ChannelHandlerContext ctx,
@@ -37,7 +34,7 @@ public class OrionFrameDecoder extends FrameDecoder {
int type = buf.getUnsignedByte(buf.readerIndex() + 2) & 0x0f;
- if (type == TYPE_USERLOG) {
+ if (type == OrionProtocolDecoder.MSG_USERLOG) {
if (buf.readableBytes() >= length + 5) {
int index = buf.readerIndex() + 3;
@@ -58,7 +55,7 @@ public class OrionFrameDecoder extends FrameDecoder {
return buf.readBytes(length);
}
}
- } else if (type == TYPE_SYSLOG) {
+ } else if (type == OrionProtocolDecoder.MSG_SYSLOG) {
if (buf.readableBytes() >= length + 12) {
length += buf.getUnsignedShort(buf.readerIndex() + 8);
if (buf.readableBytes() >= length) {
diff --git a/src/org/traccar/protocol/OrionProtocolDecoder.java b/src/org/traccar/protocol/OrionProtocolDecoder.java
index 647dc2aa7..9b4561e2e 100644
--- a/src/org/traccar/protocol/OrionProtocolDecoder.java
+++ b/src/org/traccar/protocol/OrionProtocolDecoder.java
@@ -35,8 +35,8 @@ public class OrionProtocolDecoder extends BaseProtocolDecoder {
super(protocol);
}
- private static final int TYPE_USERLOG = 0;
- private static final int TYPE_SYSLOG = 3;
+ public static final int MSG_USERLOG = 0;
+ public static final int MSG_SYSLOG = 3;
private static void sendResponse(Channel channel, ChannelBuffer buf) {
if (channel != null) {
@@ -64,7 +64,7 @@ public class OrionProtocolDecoder extends BaseProtocolDecoder {
buf.skipBytes(2); // header
int type = buf.readUnsignedByte() & 0x0f;
- if (type == TYPE_USERLOG) {
+ if (type == MSG_USERLOG) {
int header = buf.readUnsignedByte();
diff --git a/src/org/traccar/protocol/PiligrimProtocolDecoder.java b/src/org/traccar/protocol/PiligrimProtocolDecoder.java
index b05e51c68..7de056f99 100644
--- a/src/org/traccar/protocol/PiligrimProtocolDecoder.java
+++ b/src/org/traccar/protocol/PiligrimProtocolDecoder.java
@@ -53,9 +53,9 @@ public class PiligrimProtocolDecoder extends BaseProtocolDecoder {
}
}
- private static final int MSG_GPS = 0xF1;
- private static final int MSG_GPS_SENSORS = 0xF2;
- private static final int MSG_EVENTS = 0xF3;
+ public static final int MSG_GPS = 0xF1;
+ public static final int MSG_GPS_SENSORS = 0xF2;
+ public static final int MSG_EVENTS = 0xF3;
@Override
protected Object decode(
diff --git a/src/org/traccar/protocol/ProgressProtocolDecoder.java b/src/org/traccar/protocol/ProgressProtocolDecoder.java
index 4ff7e8f68..0eaa66411 100644
--- a/src/org/traccar/protocol/ProgressProtocolDecoder.java
+++ b/src/org/traccar/protocol/ProgressProtocolDecoder.java
@@ -38,15 +38,15 @@ public class ProgressProtocolDecoder extends BaseProtocolDecoder {
super(protocol);
}
- private static final int MSG_NULL = 0;
- private static final int MSG_IDENT = 1;
- private static final int MSG_IDENT_FULL = 2;
- private static final int MSG_POINT = 10;
- private static final int MSG_LOG_SYNC = 100;
- private static final int MSG_LOGMSG = 101;
- private static final int MSG_TEXT = 102;
- private static final int MSG_ALARM = 200;
- private static final int MSG_ALARM_RECIEVED = 201;
+ public static final int MSG_NULL = 0;
+ public static final int MSG_IDENT = 1;
+ public static final int MSG_IDENT_FULL = 2;
+ public static final int MSG_POINT = 10;
+ public static final int MSG_LOG_SYNC = 100;
+ public static final int MSG_LOGMSG = 101;
+ public static final int MSG_TEXT = 102;
+ public static final int MSG_ALARM = 200;
+ public static final int MSG_ALARM_RECIEVED = 201;
private static final String HEX_CHARS = "0123456789ABCDEF";
diff --git a/src/org/traccar/protocol/TramigoProtocolDecoder.java b/src/org/traccar/protocol/TramigoProtocolDecoder.java
index a74db92a7..f1c0ea0cf 100644
--- a/src/org/traccar/protocol/TramigoProtocolDecoder.java
+++ b/src/org/traccar/protocol/TramigoProtocolDecoder.java
@@ -38,8 +38,8 @@ public class TramigoProtocolDecoder extends BaseProtocolDecoder {
super(protocol);
}
- private static final int MSG_COMPACT = 0x0100;
- private static final int MSG_FULL = 0x00FE;
+ public static final int MSG_COMPACT = 0x0100;
+ public static final int MSG_FULL = 0x00FE;
@Override
protected Object decode(