aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2015-10-25 11:42:59 +1300
committerAnton Tananaev <anton.tananaev@gmail.com>2015-10-25 11:42:59 +1300
commite273bf603317165d4ef43f302a7a9066b050bc8f (patch)
tree95578b62eeafa406002761d838a424281b13aeda /src
parent926adc73e8415e424191d62a0e5bd0e8fe3ad5ef (diff)
downloadtrackermap-server-e273bf603317165d4ef43f302a7a9066b050bc8f.tar.gz
trackermap-server-e273bf603317165d4ef43f302a7a9066b050bc8f.tar.bz2
trackermap-server-e273bf603317165d4ef43f302a7a9066b050bc8f.zip
Remove todos from tramigo decoder
Diffstat (limited to 'src')
-rw-r--r--src/org/traccar/protocol/TramigoProtocolDecoder.java11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/org/traccar/protocol/TramigoProtocolDecoder.java b/src/org/traccar/protocol/TramigoProtocolDecoder.java
index f1c0ea0cf..be97f24fd 100644
--- a/src/org/traccar/protocol/TramigoProtocolDecoder.java
+++ b/src/org/traccar/protocol/TramigoProtocolDecoder.java
@@ -43,8 +43,7 @@ public class TramigoProtocolDecoder extends BaseProtocolDecoder {
@Override
protected Object decode(
- Channel channel, SocketAddress remoteAddress, Object msg)
- throws Exception {
+ Channel channel, SocketAddress remoteAddress, Object msg) throws Exception {
ChannelBuffer buf = (ChannelBuffer) msg;
@@ -58,13 +57,11 @@ public class TramigoProtocolDecoder extends BaseProtocolDecoder {
long id = buf.readUnsignedInt();
buf.readUnsignedInt(); // time
- // Create new position
Position position = new Position();
position.setProtocol(getProtocolName());
position.set(Event.KEY_INDEX, index);
position.setValid(true);
- // Get device id
if (!identify(String.valueOf(id), channel)) {
return null;
}
@@ -72,7 +69,7 @@ public class TramigoProtocolDecoder extends BaseProtocolDecoder {
if (protocol == 0x01 && (type == MSG_COMPACT || type == MSG_FULL)) {
- // TODO: send ack
+ // need to send ack?
buf.readUnsignedShort(); // report trigger
buf.readUnsignedShort(); // state flag
@@ -96,7 +93,8 @@ public class TramigoProtocolDecoder extends BaseProtocolDecoder {
position.setTime(new Date(buf.readUnsignedInt() * 1000));
- // TODO: parse other data
+ // parse other data
+
return position;
} else if (protocol == 0x80) {
@@ -133,6 +131,7 @@ public class TramigoProtocolDecoder extends BaseProtocolDecoder {
DateFormat dateFormat = new SimpleDateFormat("HH:mm MMM d yyyy", Locale.ENGLISH);
position.setTime(dateFormat.parse(matcher.group(1) + " " + Calendar.getInstance().get(Calendar.YEAR)));
return position;
+
}
return null;