aboutsummaryrefslogtreecommitdiff
path: root/src/main
diff options
context:
space:
mode:
authoranton2920 <anton2920@gmail.com>2022-09-06 11:18:57 +0100
committeranton2920 <anton2920@gmail.com>2022-09-07 09:48:53 +0100
commit55ac4060c38b2ea6e583cbef570f4b9ec35d8b15 (patch)
tree19496bcc1beaebac43293f7716adbdf0883dea5a /src/main
parentbd49d52fc47dcb902b9fb2b3e8cf82d9550a025c (diff)
downloadtrackermap-server-55ac4060c38b2ea6e583cbef570f4b9ec35d8b15.tar.gz
trackermap-server-55ac4060c38b2ea6e583cbef570f4b9ec35d8b15.tar.bz2
trackermap-server-55ac4060c38b2ea6e583cbef570f4b9ec35d8b15.zip
Changed regex for replacing event keys
Diffstat (limited to 'src/main')
-rw-r--r--src/main/java/org/traccar/protocol/PiligrimProtocolDecoder.java8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/main/java/org/traccar/protocol/PiligrimProtocolDecoder.java b/src/main/java/org/traccar/protocol/PiligrimProtocolDecoder.java
index 0a22e30c5..ca6b667cd 100644
--- a/src/main/java/org/traccar/protocol/PiligrimProtocolDecoder.java
+++ b/src/main/java/org/traccar/protocol/PiligrimProtocolDecoder.java
@@ -172,15 +172,13 @@ public class PiligrimProtocolDecoder extends BaseHttpProtocolDecoder {
String[] payloadParts = payload.split("&");
/* LOGGER.info("Payload parts: " + Arrays.toString(payloadParts)); */
String phoneNumber = payloadParts[1].substring(15);
- DeviceSession deviceSession = getDeviceSession(channel, remoteAddress, phoneNumber);
+ DeviceSession deviceSession = getDeviceSession(channel, remoteAddress, phoneNumber.substring(1));
if (deviceSession == null) {
return null;
}
- /* TODO: generalize this process;
- * TODO: use keys for flags in 'positions'.
- */
- String message = payloadParts[2].substring(8).replaceFirst("ALARM KEY; ", "");
+ /* TODO: use keys for flags in 'positions'. */
+ String message = payloadParts[2].substring(8).replaceFirst("[A-Z]* KEY; ", "");
/* LOGGER.info("Phone number: " + phoneNumber); */
/* LOGGER.info("Message: " + message); */