From 73dffe380b1faa799f6944d730e71b1b85633f76 Mon Sep 17 00:00:00 2001 From: Sahal Ghafur Date: Fri, 15 Mar 2024 11:16:57 +0000 Subject: Update SPO2 Key for Minifinder2 --- src/main/java/org/traccar/model/Position.java | 1 + src/main/java/org/traccar/protocol/Minifinder2ProtocolDecoder.java | 7 +++++++ 2 files changed, 8 insertions(+) (limited to 'src') diff --git a/src/main/java/org/traccar/model/Position.java b/src/main/java/org/traccar/model/Position.java index 39f63217d..ac028917b 100644 --- a/src/main/java/org/traccar/model/Position.java +++ b/src/main/java/org/traccar/model/Position.java @@ -45,6 +45,7 @@ public class Position extends Message { public static final String KEY_HOURS = "hours"; // milliseconds public static final String KEY_STEPS = "steps"; public static final String KEY_HEART_RATE = "heartRate"; + public static final String KEY_SP02 = "spO2"; public static final String KEY_INPUT = "input"; public static final String KEY_OUTPUT = "output"; public static final String KEY_IMAGE = "image"; diff --git a/src/main/java/org/traccar/protocol/Minifinder2ProtocolDecoder.java b/src/main/java/org/traccar/protocol/Minifinder2ProtocolDecoder.java index 64373e344..e50655b37 100644 --- a/src/main/java/org/traccar/protocol/Minifinder2ProtocolDecoder.java +++ b/src/main/java/org/traccar/protocol/Minifinder2ProtocolDecoder.java @@ -295,6 +295,13 @@ public class Minifinder2ProtocolDecoder extends BaseProtocolDecoder { position.set(Position.KEY_HEART_RATE, heartRate); } break; + case 0x41: + buf.readUnsignedIntLE(); // timestamp + int spO2 = buf.readUnsignedByte(); + if (spO2 > 1) { + position.set(Position.KEY_SP02, spO2); + } + break; default: break; } -- cgit v1.2.3 From a9b08325240b3f4c76d5f6a042c6740b1f81a889 Mon Sep 17 00:00:00 2001 From: Sahal Ghafur Date: Fri, 15 Mar 2024 13:28:23 +0000 Subject: Updated Position Key for spO2 --- src/main/java/org/traccar/model/Position.java | 1 - src/main/java/org/traccar/protocol/Minifinder2ProtocolDecoder.java | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) (limited to 'src') diff --git a/src/main/java/org/traccar/model/Position.java b/src/main/java/org/traccar/model/Position.java index ac028917b..39f63217d 100644 --- a/src/main/java/org/traccar/model/Position.java +++ b/src/main/java/org/traccar/model/Position.java @@ -45,7 +45,6 @@ public class Position extends Message { public static final String KEY_HOURS = "hours"; // milliseconds public static final String KEY_STEPS = "steps"; public static final String KEY_HEART_RATE = "heartRate"; - public static final String KEY_SP02 = "spO2"; public static final String KEY_INPUT = "input"; public static final String KEY_OUTPUT = "output"; public static final String KEY_IMAGE = "image"; diff --git a/src/main/java/org/traccar/protocol/Minifinder2ProtocolDecoder.java b/src/main/java/org/traccar/protocol/Minifinder2ProtocolDecoder.java index e50655b37..2d6bde89f 100644 --- a/src/main/java/org/traccar/protocol/Minifinder2ProtocolDecoder.java +++ b/src/main/java/org/traccar/protocol/Minifinder2ProtocolDecoder.java @@ -299,7 +299,7 @@ public class Minifinder2ProtocolDecoder extends BaseProtocolDecoder { buf.readUnsignedIntLE(); // timestamp int spO2 = buf.readUnsignedByte(); if (spO2 > 1) { - position.set(Position.KEY_SP02, spO2); + position.set("spO2", spO2); } break; default: -- cgit v1.2.3