aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/org/traccar/protocol/T622IridiumProtocolDecoder.java
diff options
context:
space:
mode:
authorIván Ávalos <avalos@disroot.org>2024-08-03 20:52:00 -0600
committerIván Ávalos <avalos@disroot.org>2024-08-03 20:52:00 -0600
commit55f6d92c09a5b1d8566b53633d07be3d31010d3b (patch)
treeb86bed801b0bbadb72c7e839296dae1d28b12bbb /src/main/java/org/traccar/protocol/T622IridiumProtocolDecoder.java
parentc04ad7d48331253c095fc123ded1b00f6ff871d3 (diff)
parent2788174193def918a3a1a5be3bbed24c9613323f (diff)
downloadtrackermap-server-55f6d92c09a5b1d8566b53633d07be3d31010d3b.tar.gz
trackermap-server-55f6d92c09a5b1d8566b53633d07be3d31010d3b.tar.bz2
trackermap-server-55f6d92c09a5b1d8566b53633d07be3d31010d3b.zip
Merge tag 'tags/v6.3'
Diffstat (limited to 'src/main/java/org/traccar/protocol/T622IridiumProtocolDecoder.java')
-rw-r--r--src/main/java/org/traccar/protocol/T622IridiumProtocolDecoder.java74
1 files changed, 18 insertions, 56 deletions
diff --git a/src/main/java/org/traccar/protocol/T622IridiumProtocolDecoder.java b/src/main/java/org/traccar/protocol/T622IridiumProtocolDecoder.java
index 9e64ec9be..c58960ab5 100644
--- a/src/main/java/org/traccar/protocol/T622IridiumProtocolDecoder.java
+++ b/src/main/java/org/traccar/protocol/T622IridiumProtocolDecoder.java
@@ -84,62 +84,24 @@ public class T622IridiumProtocolDecoder extends BaseProtocolDecoder {
for (int parameter : parameters) {
switch (parameter) {
- case 0x01:
- position.set(Position.KEY_EVENT, buf.readUnsignedByte());
- break;
- case 0x02:
- position.setLatitude(buf.readIntLE() / 1000000.0);
- break;
- case 0x03:
- position.setLongitude(buf.readIntLE() / 1000000.0);
- break;
- case 0x04:
- position.setTime(new Date((buf.readUnsignedIntLE() + 946684800) * 1000));
- break;
- case 0x05:
- position.setValid(buf.readUnsignedByte() > 0);
- break;
- case 0x06:
- position.set(Position.KEY_SATELLITES, buf.readUnsignedByte());
- break;
- case 0x07:
- position.set(Position.KEY_RSSI, buf.readUnsignedByte());
- break;
- case 0x08:
- position.setSpeed(UnitsConverter.knotsFromKph(buf.readUnsignedShortLE()));
- break;
- case 0x09:
- position.setCourse(buf.readUnsignedShortLE());
- break;
- case 0x0A:
- position.set(Position.KEY_HDOP, buf.readUnsignedByte() * 0.1);
- break;
- case 0x0B:
- position.setAltitude(buf.readShortLE());
- break;
- case 0x0C:
- position.set(Position.KEY_ODOMETER, buf.readUnsignedIntLE());
- break;
- case 0x0D:
- position.set(Position.KEY_HOURS, buf.readUnsignedIntLE() * 1000);
- break;
- case 0x14:
- position.set(Position.KEY_OUTPUT, buf.readUnsignedByte());
- break;
- case 0x15:
- position.set(Position.KEY_INPUT, buf.readUnsignedByte());
- break;
- case 0x19:
- position.set(Position.KEY_BATTERY, buf.readUnsignedShortLE() * 0.01);
- break;
- case 0x1A:
- position.set(Position.KEY_POWER, buf.readUnsignedShortLE() * 0.01);
- break;
- case 0x1B:
- buf.readUnsignedByte(); // geofence
- break;
- default:
- break;
+ case 0x01 -> position.set(Position.KEY_EVENT, buf.readUnsignedByte());
+ case 0x02 -> position.setLatitude(buf.readIntLE() / 1000000.0);
+ case 0x03 -> position.setLongitude(buf.readIntLE() / 1000000.0);
+ case 0x04 -> position.setTime(new Date((buf.readUnsignedIntLE() + 946684800) * 1000));
+ case 0x05 -> position.setValid(buf.readUnsignedByte() > 0);
+ case 0x06 -> position.set(Position.KEY_SATELLITES, buf.readUnsignedByte());
+ case 0x07 -> position.set(Position.KEY_RSSI, buf.readUnsignedByte());
+ case 0x08 -> position.setSpeed(UnitsConverter.knotsFromKph(buf.readUnsignedShortLE()));
+ case 0x09 -> position.setCourse(buf.readUnsignedShortLE());
+ case 0x0A -> position.set(Position.KEY_HDOP, buf.readUnsignedByte() * 0.1);
+ case 0x0B -> position.setAltitude(buf.readShortLE());
+ case 0x0C -> position.set(Position.KEY_ODOMETER, buf.readUnsignedIntLE());
+ case 0x0D -> position.set(Position.KEY_HOURS, buf.readUnsignedIntLE() * 1000);
+ case 0x14 -> position.set(Position.KEY_OUTPUT, buf.readUnsignedByte());
+ case 0x15 -> position.set(Position.KEY_INPUT, buf.readUnsignedByte());
+ case 0x19 -> position.set(Position.KEY_BATTERY, buf.readUnsignedShortLE() * 0.01);
+ case 0x1A -> position.set(Position.KEY_POWER, buf.readUnsignedShortLE() * 0.01);
+ case 0x1B -> buf.readUnsignedByte(); // geofence
}
}