diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2019-04-10 21:36:33 -0700 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2019-04-10 21:36:33 -0700 |
commit | c6aabdaba867ba2ad408b78a2fe0ec5979b6e1af (patch) | |
tree | cac7667bba1041b335b9d9cf86f852e106e87ef1 /src/main/java/org/traccar/protocol/RuptelaProtocolEncoder.java | |
parent | a21526cfa9e204715cfc41966dc95584d6e30168 (diff) | |
download | trackermap-server-c6aabdaba867ba2ad408b78a2fe0ec5979b6e1af.tar.gz trackermap-server-c6aabdaba867ba2ad408b78a2fe0ec5979b6e1af.tar.bz2 trackermap-server-c6aabdaba867ba2ad408b78a2fe0ec5979b6e1af.zip |
Implement Ruptela photo request
Diffstat (limited to 'src/main/java/org/traccar/protocol/RuptelaProtocolEncoder.java')
-rw-r--r-- | src/main/java/org/traccar/protocol/RuptelaProtocolEncoder.java | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/main/java/org/traccar/protocol/RuptelaProtocolEncoder.java b/src/main/java/org/traccar/protocol/RuptelaProtocolEncoder.java index 4242584c9..96d0da5a7 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 - 2018 Anton Tananaev (anton@traccar.org) + * Copyright 2016 - 2019 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. @@ -46,6 +46,12 @@ public class RuptelaProtocolEncoder extends BaseProtocolEncoder { case Command.TYPE_CUSTOM: content.writeBytes(command.getString(Command.KEY_DATA).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 + content.writeInt(0); // start timestamp + content.writeInt(Integer.MAX_VALUE); // end timestamp + return encodeContent(RuptelaProtocolDecoder.MSG_FILES, content); case Command.TYPE_CONFIGURATION: content.writeBytes((command.getString(Command.KEY_DATA) + "\r\n").getBytes(StandardCharsets.US_ASCII)); return encodeContent(RuptelaProtocolDecoder.MSG_DEVICE_CONFIGURATION, content); |