diff options
Diffstat (limited to 'src/org/traccar/protocol/Tr900ProtocolDecoder.java')
-rw-r--r-- | src/org/traccar/protocol/Tr900ProtocolDecoder.java | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/org/traccar/protocol/Tr900ProtocolDecoder.java b/src/org/traccar/protocol/Tr900ProtocolDecoder.java index 0af0a8e24..3ac627420 100644 --- a/src/org/traccar/protocol/Tr900ProtocolDecoder.java +++ b/src/org/traccar/protocol/Tr900ProtocolDecoder.java @@ -83,12 +83,12 @@ public class Tr900ProtocolDecoder extends BaseProtocolDecoder { // Time Calendar time = Calendar.getInstance(TimeZone.getTimeZone("UTC")); time.clear(); - time.set(Calendar.YEAR, 2000 + Integer.valueOf(parser.group(index++))); - time.set(Calendar.MONTH, Integer.valueOf(parser.group(index++)) - 1); - time.set(Calendar.DAY_OF_MONTH, Integer.valueOf(parser.group(index++))); - time.set(Calendar.HOUR_OF_DAY, Integer.valueOf(parser.group(index++))); - time.set(Calendar.MINUTE, Integer.valueOf(parser.group(index++))); - time.set(Calendar.SECOND, Integer.valueOf(parser.group(index++))); + time.set(Calendar.YEAR, 2000 + Integer.parseInt(parser.group(index++))); + time.set(Calendar.MONTH, Integer.parseInt(parser.group(index++)) - 1); + time.set(Calendar.DAY_OF_MONTH, Integer.parseInt(parser.group(index++))); + time.set(Calendar.HOUR_OF_DAY, Integer.parseInt(parser.group(index++))); + time.set(Calendar.MINUTE, Integer.parseInt(parser.group(index++))); + time.set(Calendar.SECOND, Integer.parseInt(parser.group(index++))); position.setTime(time.getTime()); // Longitude @@ -113,9 +113,9 @@ public class Tr900ProtocolDecoder extends BaseProtocolDecoder { // Other position.set(Event.KEY_GSM, parser.group(index++)); - position.set(Event.KEY_EVENT, Integer.valueOf(parser.group(index++))); - position.set(Event.PREFIX_ADC + 1, Integer.valueOf(parser.group(index++))); - position.set(Event.KEY_BATTERY, Integer.valueOf(parser.group(index++))); + position.set(Event.KEY_EVENT, Integer.parseInt(parser.group(index++))); + position.set(Event.PREFIX_ADC + 1, Integer.parseInt(parser.group(index++))); + position.set(Event.KEY_BATTERY, Integer.parseInt(parser.group(index++))); position.set(Event.KEY_INPUT, parser.group(index++)); position.set(Event.KEY_STATUS, parser.group(index++)); return position; |