aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/org/traccar/protocol/WristbandProtocolDecoder.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/WristbandProtocolDecoder.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/WristbandProtocolDecoder.java')
-rw-r--r--src/main/java/org/traccar/protocol/WristbandProtocolDecoder.java27
1 files changed, 9 insertions, 18 deletions
diff --git a/src/main/java/org/traccar/protocol/WristbandProtocolDecoder.java b/src/main/java/org/traccar/protocol/WristbandProtocolDecoder.java
index 323992ddd..f8cfe2b5e 100644
--- a/src/main/java/org/traccar/protocol/WristbandProtocolDecoder.java
+++ b/src/main/java/org/traccar/protocol/WristbandProtocolDecoder.java
@@ -155,31 +155,22 @@ public class WristbandProtocolDecoder extends BaseProtocolDecoder {
String data = parser.next();
switch (type) {
- case 90:
- sendResponse(channel, imei, version, type, getServer(channel, ','));
- break;
- case 91:
+ case 90 -> sendResponse(channel, imei, version, type, getServer(channel, ','));
+ case 91 -> {
String time = new SimpleDateFormat("yyyy-MM-dd-HH-mm-ss").format(new Date());
sendResponse(channel, imei, version, type, time + "|" + getServer(channel, ','));
- break;
- case 1:
+ }
+ case 1 -> {
positions.add(decodeStatus(deviceSession, data));
sendResponse(channel, imei, version, type, data.split(",")[1]);
- break;
- case 2:
+ }
+ case 2 -> {
for (String fragment : data.split("\\|")) {
positions.add(decodePosition(deviceSession, fragment));
}
- break;
- case 3:
- case 4:
- positions.add(decodeNetwork(deviceSession, data, type == 3));
- break;
- case 64:
- sendResponse(channel, imei, version, type, data);
- break;
- default:
- break;
+ }
+ case 3, 4 -> positions.add(decodeNetwork(deviceSession, data, type == 3));
+ case 64 -> sendResponse(channel, imei, version, type, data);
}
return positions.isEmpty() ? null : positions;