diff options
author | Abyss777 <abyss@fox5.ru> | 2016-08-05 10:07:35 +0500 |
---|---|---|
committer | Abyss777 <abyss@fox5.ru> | 2016-08-05 10:07:35 +0500 |
commit | 791a010e5a449a27e8243b9bc98c918ffa054eac (patch) | |
tree | 7883f58150598323fdae0f8578f607a18958f843 /src/org/traccar/protocol/NoranProtocolDecoder.java | |
parent | 4ebce65e3d6db55d427f504bd62972370fab2eec (diff) | |
download | trackermap-server-791a010e5a449a27e8243b9bc98c918ffa054eac.tar.gz trackermap-server-791a010e5a449a27e8243b9bc98c918ffa054eac.tar.bz2 trackermap-server-791a010e5a449a27e8243b9bc98c918ffa054eac.zip |
- Removed OIL_CUT
- Renamed guard to armed
- Style fixes and optimizations
Diffstat (limited to 'src/org/traccar/protocol/NoranProtocolDecoder.java')
-rw-r--r-- | src/org/traccar/protocol/NoranProtocolDecoder.java | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/src/org/traccar/protocol/NoranProtocolDecoder.java b/src/org/traccar/protocol/NoranProtocolDecoder.java index 5b4533422..aaecfc1db 100644 --- a/src/org/traccar/protocol/NoranProtocolDecoder.java +++ b/src/org/traccar/protocol/NoranProtocolDecoder.java @@ -91,14 +91,21 @@ public class NoranProtocolDecoder extends BaseProtocolDecoder { position.setValid(BitUtil.check(buf.readUnsignedByte(), 0)); short alarm = buf.readUnsignedByte(); - if (alarm == 1) { + switch (alarm) { + case 1: position.set(Position.KEY_ALARM, Position.ALARM_SOS); - } else if (alarm == 2) { + break; + case 2: position.set(Position.KEY_ALARM, Position.ALARM_OVERSPEED); - } else if (alarm == 3) { + break; + case 3: position.set(Position.KEY_ALARM, Position.ALARM_GEOFENCE_EXIT); - } else if (alarm == 9) { + break; + case 9: position.set(Position.KEY_ALARM, Position.ALARM_POWER_OFF); + break; + default: + break; } if (newFormat) { |