aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2012-08-21 23:35:58 +0400
committerAnton Tananaev <anton.tananaev@gmail.com>2012-08-21 23:35:58 +0400
commit92d7008d55b4ab7505fc66897da49fe1543fa170 (patch)
tree60d42416c21e68483c44c9eeef6e7798a4b2f9e8 /src/org/traccar
parent348c6d01c21a8d412541072965870be8bb758dfa (diff)
downloadtrackermap-server-92d7008d55b4ab7505fc66897da49fe1543fa170.tar.gz
trackermap-server-92d7008d55b4ab7505fc66897da49fe1543fa170.tar.bz2
trackermap-server-92d7008d55b4ab7505fc66897da49fe1543fa170.zip
Release 1.2
Diffstat (limited to 'src/org/traccar')
-rw-r--r--src/org/traccar/protocol/MeiligaoProtocolDecoder.java1
-rw-r--r--src/org/traccar/protocol/ST210ProtocolDecoder.java38
2 files changed, 20 insertions, 19 deletions
diff --git a/src/org/traccar/protocol/MeiligaoProtocolDecoder.java b/src/org/traccar/protocol/MeiligaoProtocolDecoder.java
index db007f936..6b48b41fa 100644
--- a/src/org/traccar/protocol/MeiligaoProtocolDecoder.java
+++ b/src/org/traccar/protocol/MeiligaoProtocolDecoder.java
@@ -112,6 +112,7 @@ public class MeiligaoProtocolDecoder extends GenericProtocolDecoder {
if (channel != null) {
channel.write(sendBuf);
}
+ return null;
}
// Data offset
diff --git a/src/org/traccar/protocol/ST210ProtocolDecoder.java b/src/org/traccar/protocol/ST210ProtocolDecoder.java
index d41a78da5..3d176098e 100644
--- a/src/org/traccar/protocol/ST210ProtocolDecoder.java
+++ b/src/org/traccar/protocol/ST210ProtocolDecoder.java
@@ -16,15 +16,15 @@ import org.traccar.model.DataManager;
import org.traccar.model.Position;
public class ST210ProtocolDecoder extends GenericProtocolDecoder {
-
+
public ST210ProtocolDecoder(DataManager dataManager, Integer resetDelay) {
- super(dataManager, resetDelay);
- }
+ super(dataManager, resetDelay);
+ }
- private enum ST210FIELDS {
- HDR_STATUS("SA200STT;","Status Report"),
- HDR_EMERGENCY("SA200EMG;","Emergency Report"),
+ private enum ST210FIELDS {
+ HDR_STATUS("SA200STT;","Status Report"),
+ HDR_EMERGENCY("SA200EMG;","Emergency Report"),
HDR_EVENT("SA200EVT;", "Event Report"),
HDR_ALERT("SA200ALT;","Alert Report"),
HDR_ALIVE("SA200ALV;","Alive Report"),
@@ -103,13 +103,13 @@ public class ST210ProtocolDecoder extends GenericProtocolDecoder {
time.set(Calendar.MONTH, Integer.valueOf(Integer.valueOf(groupValue.substring(4, 6))-1));
time.set(Calendar.DAY_OF_MONTH, Integer.valueOf(Integer.valueOf(groupValue.substring(6, 8))));
- Calendar ret = new GregorianCalendar(TimeZone.getTimeZone("UTC"));
+ /*Calendar ret = new GregorianCalendar(TimeZone.getTimeZone("UTC"));
ret.setTimeInMillis(time.getTimeInMillis() +
- TimeZone.getTimeZone("UTC").getOffset(time.getTimeInMillis()) -
- TimeZone.getDefault().getOffset(time.getTimeInMillis()));
+ TimeZone.getTimeZone("UTC").getOffset(time.getTimeInMillis()) -
+ TimeZone.getDefault().getOffset(time.getTimeInMillis()));*/
- position.setTime(ret.getTime());
+ position.setTime(time.getTime());
break;
}
@@ -124,13 +124,13 @@ public class ST210ProtocolDecoder extends GenericProtocolDecoder {
time.set(Calendar.MINUTE, Integer.valueOf(Integer.valueOf(groupValue.substring(3, 5))));
time.set(Calendar.SECOND, Integer.valueOf(Integer.valueOf(groupValue.substring(6, 8))));
- Calendar ret = new GregorianCalendar(TimeZone.getTimeZone("UTC"));
+ /*Calendar ret = new GregorianCalendar(TimeZone.getTimeZone("UTC"));
ret.setTimeInMillis(time.getTimeInMillis() +
- TimeZone.getTimeZone("UTC").getOffset(time.getTimeInMillis()) -
- TimeZone.getDefault().getOffset(time.getTimeInMillis()));
+ TimeZone.getTimeZone("UTC").getOffset(time.getTimeInMillis()) -
+ TimeZone.getDefault().getOffset(time.getTimeInMillis()));*/
- position.setTime(ret.getTime());
+ position.setTime(time.getTime());
break;
}
@@ -488,7 +488,7 @@ public class ST210ProtocolDecoder extends GenericProtocolDecoder {
}
if(patternStr.endsWith(";")){
- patternStr = patternStr.substring(0, patternStr.length()-1);
+ patternStr = patternStr.substring(0, patternStr.length()-1);
}
return Pattern.compile(patternStr);
@@ -610,11 +610,11 @@ public class ST210ProtocolDecoder extends GenericProtocolDecoder {
Position position = null;
try{
- position = decodeMsg(sentence);
- Log.info("MESSAGE DECODED WITH SUCCESS!");
+ position = decodeMsg(sentence);
+ Log.info("MESSAGE DECODED WITH SUCCESS!");
}
catch(Exception e){
- Log.severe("ERROR WHILE DECODING MESSAGE: " + e.getMessage());
+ Log.severe("ERROR WHILE DECODING MESSAGE: " + e.getMessage());
}
return position;
@@ -635,7 +635,7 @@ public class ST210ProtocolDecoder extends GenericProtocolDecoder {
}
if(report.equals(ST210REPORTS.ALIVE)){
- return null;
+ return null;
}
// Create new position