aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/protocol/MeiligaoProtocolDecoder.java
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2015-04-29 13:41:15 +1200
committerAnton Tananaev <anton.tananaev@gmail.com>2015-04-29 13:41:15 +1200
commitf7198adaf371e08a72a837d417b29531c117c6ba (patch)
tree853fb51b64cd00aaa6e53d4e510bbf69859e7765 /src/org/traccar/protocol/MeiligaoProtocolDecoder.java
parentcb0a3831c2d89a22e9f3b68d3ee17f6e2abdd424 (diff)
downloadtrackermap-server-f7198adaf371e08a72a837d417b29531c117c6ba.tar.gz
trackermap-server-f7198adaf371e08a72a837d417b29531c117c6ba.tar.bz2
trackermap-server-f7198adaf371e08a72a837d417b29531c117c6ba.zip
Store other data in position
Diffstat (limited to 'src/org/traccar/protocol/MeiligaoProtocolDecoder.java')
-rw-r--r--src/org/traccar/protocol/MeiligaoProtocolDecoder.java22
1 files changed, 8 insertions, 14 deletions
diff --git a/src/org/traccar/protocol/MeiligaoProtocolDecoder.java b/src/org/traccar/protocol/MeiligaoProtocolDecoder.java
index 648901678..d35a75885 100644
--- a/src/org/traccar/protocol/MeiligaoProtocolDecoder.java
+++ b/src/org/traccar/protocol/MeiligaoProtocolDecoder.java
@@ -30,10 +30,7 @@ import org.jboss.netty.channel.ChannelHandlerContext;
import org.traccar.BaseProtocolDecoder;
import org.traccar.Context;
-import org.traccar.database.DataManager;
import org.traccar.helper.Crc;
-import org.traccar.helper.Log;
-import org.traccar.model.ExtendedInfoFormatter;
import org.traccar.model.Position;
public class MeiligaoProtocolDecoder extends BaseProtocolDecoder {
@@ -170,11 +167,11 @@ public class MeiligaoProtocolDecoder extends BaseProtocolDecoder {
// Create new position
Position position = new Position();
- ExtendedInfoFormatter extendedInfo = new ExtendedInfoFormatter(getProtocol());
+ position.setProtocol(getProtocol());
// Custom data
if (command == MSG_ALARM) {
- extendedInfo.set("alarm", buf.readUnsignedByte());
+ position.set("alarm", buf.readUnsignedByte());
} else if (command == MSG_POSITION_LOGGED) {
buf.skipBytes(6);
}
@@ -240,7 +237,7 @@ public class MeiligaoProtocolDecoder extends BaseProtocolDecoder {
position.setTime(time.getTime());
// Dilution of precision
- extendedInfo.set("hdop", parser.group(index++));
+ position.set("hdop", parser.group(index++));
// Altitude
String altitude = parser.group(index++);
@@ -251,38 +248,35 @@ public class MeiligaoProtocolDecoder extends BaseProtocolDecoder {
// State
String state = parser.group(index++);
if (state != null) {
- extendedInfo.set("state", state);
+ position.set("state", state);
}
// ADC
for (int i = 1; i <= 8; i++) {
String adc = parser.group(index++);
if (adc != null) {
- extendedInfo.set("adc" + i, Integer.parseInt(adc, 16));
+ position.set("adc" + i, Integer.parseInt(adc, 16));
}
}
// Cell identifier
String cell = parser.group(index++);
if (cell != null) {
- extendedInfo.set("cell", cell);
+ position.set("cell", cell);
}
// GSM signal
String gsm = parser.group(index++);
if (gsm != null) {
- extendedInfo.set("gsm", Integer.parseInt(gsm, 16));
+ position.set("gsm", Integer.parseInt(gsm, 16));
}
// Milage
String milage = parser.group(index++);
if (milage != null) {
- extendedInfo.set("milage", Integer.parseInt(milage, 16));
+ position.set("milage", Integer.parseInt(milage, 16));
}
- // Extended info
- position.setExtendedInfo(extendedInfo.toString());
-
return position;
}