aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/protocol
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2015-07-29 11:38:49 +1200
committerAnton Tananaev <anton.tananaev@gmail.com>2015-07-29 11:38:49 +1200
commita10e925a97cf839a5c30fb7891af12bc111b14c4 (patch)
tree2f81727373e22058c16fb4d9cf48ad374c20f10e /src/org/traccar/protocol
parent411f631b6a9dd898476b43d342180db02e45dd9c (diff)
downloadtrackermap-server-a10e925a97cf839a5c30fb7891af12bc111b14c4.tar.gz
trackermap-server-a10e925a97cf839a5c30fb7891af12bc111b14c4.tar.bz2
trackermap-server-a10e925a97cf839a5c30fb7891af12bc111b14c4.zip
Update Totem commands
Diffstat (limited to 'src/org/traccar/protocol')
-rw-r--r--src/org/traccar/protocol/TotemProtocolEncoder.java22
1 files changed, 15 insertions, 7 deletions
diff --git a/src/org/traccar/protocol/TotemProtocolEncoder.java b/src/org/traccar/protocol/TotemProtocolEncoder.java
index d236a7e2c..39e3214cc 100644
--- a/src/org/traccar/protocol/TotemProtocolEncoder.java
+++ b/src/org/traccar/protocol/TotemProtocolEncoder.java
@@ -1,5 +1,6 @@
/*
- * Copyright 2015 alexis.
+ * Copyright 2015 Irving Gonzalez
+ * Copyright 2015 Anton Tananaev (anton.tananaev@gmail.com)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -18,21 +19,28 @@ package org.traccar.protocol;
import org.traccar.StringProtocolEncoder;
import org.traccar.model.Command;
-/**
- *
- * @author Irving Gonzalez [ialexis93@gmail.com]
- */
+import java.util.HashMap;
+import java.util.Map;
+
public class TotemProtocolEncoder extends StringProtocolEncoder{
@Override
protected Object encodeCommand(Command command) {
+
+ // Temporary put default password
+ Map<String, Object> other = command.getOther();
+ if (other == null) {
+ other = new HashMap<>();
+ command.setOther(other);
+ }
+ other.put(Command.KEY_DEVICE_PASSWORD, "000000");
switch (command.getType()) {
//Assuming PIN 8 (Output C) is the power wire, like manual says but it can be PIN 5,7,8
case Command.TYPE_ENGINE_STOP:
- return formatCommand(command, "*{%s},025,C,1#", Command.KEY_GPS_PASSWORD);
+ return formatCommand(command, "*{%s},025,C,1#", Command.KEY_DEVICE_PASSWORD);
case Command.TYPE_ENGINE_RESUME:
- return formatCommand(command, "*{%s},025,C,0#", Command.KEY_GPS_PASSWORD);
+ return formatCommand(command, "*{%s},025,C,0#", Command.KEY_DEVICE_PASSWORD);
}
return null;