From 28f036e793f374c9e74d78205e7d77760ae3aa85 Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Mon, 26 Jul 2021 20:38:07 -0700 Subject: Ruptela engine commands --- src/main/java/org/traccar/protocol/RuptelaProtocol.java | 4 +++- src/main/java/org/traccar/protocol/RuptelaProtocolEncoder.java | 8 +++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/main/java/org/traccar/protocol/RuptelaProtocol.java b/src/main/java/org/traccar/protocol/RuptelaProtocol.java index b8f72336b..5d1f86553 100644 --- a/src/main/java/org/traccar/protocol/RuptelaProtocol.java +++ b/src/main/java/org/traccar/protocol/RuptelaProtocol.java @@ -1,5 +1,5 @@ /* - * Copyright 2015 - 2019 Anton Tananaev (anton@traccar.org) + * Copyright 2015 - 2021 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -26,6 +26,8 @@ public class RuptelaProtocol extends BaseProtocol { public RuptelaProtocol() { setSupportedDataCommands( Command.TYPE_CUSTOM, + Command.TYPE_ENGINE_STOP, + Command.TYPE_ENGINE_RESUME, Command.TYPE_REQUEST_PHOTO, Command.TYPE_CONFIGURATION, Command.TYPE_GET_VERSION, diff --git a/src/main/java/org/traccar/protocol/RuptelaProtocolEncoder.java b/src/main/java/org/traccar/protocol/RuptelaProtocolEncoder.java index fb0dcf690..442961b19 100644 --- a/src/main/java/org/traccar/protocol/RuptelaProtocolEncoder.java +++ b/src/main/java/org/traccar/protocol/RuptelaProtocolEncoder.java @@ -1,5 +1,5 @@ /* - * Copyright 2016 - 2019 Anton Tananaev (anton@traccar.org) + * Copyright 2016 - 2021 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -58,6 +58,12 @@ public class RuptelaProtocolEncoder extends BaseProtocolEncoder { content.writeBytes(data.getBytes(StandardCharsets.US_ASCII)); return encodeContent(RuptelaProtocolDecoder.MSG_SMS_VIA_GPRS, content); } + case Command.TYPE_ENGINE_STOP: + content.writeBytes("pass immobilizer 10".getBytes(StandardCharsets.US_ASCII)); + return encodeContent(RuptelaProtocolDecoder.MSG_SMS_VIA_GPRS, content); + case Command.TYPE_ENGINE_RESUME: + content.writeBytes("pass resetimmob".getBytes(StandardCharsets.US_ASCII)); + return encodeContent(RuptelaProtocolDecoder.MSG_SMS_VIA_GPRS, content); case Command.TYPE_REQUEST_PHOTO: content.writeByte(1); // sub-command content.writeByte(0); // source -- cgit v1.2.3