diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2019-01-14 11:19:26 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-01-14 11:19:26 -0800 |
commit | ff0572b84c85f2bcfb177d1fe7a119a6dc51627a (patch) | |
tree | 3051f972ec54f9243467947e1d7091ecbb2eefd6 /src/org/traccar/protocol/WatchProtocolEncoder.java | |
parent | 4650b7f1c866c9471a7ae79eb355256976d4b6c5 (diff) | |
parent | 872f672e7832da3755cb7576f04dd2aec4132bd5 (diff) | |
download | trackermap-server-ff0572b84c85f2bcfb177d1fe7a119a6dc51627a.tar.gz trackermap-server-ff0572b84c85f2bcfb177d1fe7a119a6dc51627a.tar.bz2 trackermap-server-ff0572b84c85f2bcfb177d1fe7a119a6dc51627a.zip |
Merge pull request #4192 from flocsy/send-message
Send message (that is displayed on the watch's display)
Diffstat (limited to 'src/org/traccar/protocol/WatchProtocolEncoder.java')
-rw-r--r-- | src/org/traccar/protocol/WatchProtocolEncoder.java | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/org/traccar/protocol/WatchProtocolEncoder.java b/src/org/traccar/protocol/WatchProtocolEncoder.java index 17952e3cd..f66ba4072 100644 --- a/src/org/traccar/protocol/WatchProtocolEncoder.java +++ b/src/org/traccar/protocol/WatchProtocolEncoder.java @@ -36,6 +36,8 @@ public class WatchProtocolEncoder extends StringProtocolEncoder implements Strin double offset = TimeZone.getTimeZone((String) value).getRawOffset() / 3600000.0; DecimalFormat fmt = new DecimalFormat("+#.##;-#.##", DecimalFormatSymbols.getInstance(Locale.US)); return fmt.format(offset); + } else if (key.equals(Command.KEY_MESSAGE)) { + return DataConverter.printHex(value.toString().getBytes()); } return null; @@ -134,6 +136,8 @@ public class WatchProtocolEncoder extends StringProtocolEncoder implements Strin return formatCommand(channel, command, "REMIND,{%s}", Command.KEY_DATA); case Command.TYPE_SET_PHONEBOOK: return formatCommand(channel, command, "PHB,{%s}", Command.KEY_DATA); + case Command.TYPE_MESSAGE: + return formatCommand(channel, command, "MESSAGE,{%s}", Command.KEY_MESSAGE); case Command.TYPE_VOICE_MESSAGE: return formatCommand(channel, command, "TK,%s", getBinaryData(command)); case Command.TYPE_POSITION_PERIODIC: |