aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/smpp
diff options
context:
space:
mode:
authorAbyss777 <abyss@fox5.ru>2017-03-02 17:05:25 +0500
committerAbyss777 <abyss@fox5.ru>2017-03-02 17:06:48 +0500
commit6ff73337236f126839e8ce936ba9d201e8a501c7 (patch)
treeeff0c6fc8b121e528ad80ce2ab573f8e08625b52 /src/org/traccar/smpp
parent5a964d4adf67d2f49b58f0b14d4388d7aa2353d2 (diff)
downloadtraccar-server-6ff73337236f126839e8ce936ba9d201e8a501c7.tar.gz
traccar-server-6ff73337236f126839e8ce936ba9d201e8a501c7.tar.bz2
traccar-server-6ff73337236f126839e8ce936ba9d201e8a501c7.zip
Remove BaseProtocolSmsEncoder class
Add fallback to SMS if device is not online Use more variables and ternary operators
Diffstat (limited to 'src/org/traccar/smpp')
-rw-r--r--src/org/traccar/smpp/SmppClient.java9
1 files changed, 2 insertions, 7 deletions
diff --git a/src/org/traccar/smpp/SmppClient.java b/src/org/traccar/smpp/SmppClient.java
index bef2abbf6..7f004645d 100644
--- a/src/org/traccar/smpp/SmppClient.java
+++ b/src/org/traccar/smpp/SmppClient.java
@@ -199,13 +199,8 @@ public class SmppClient {
if (getSession() != null && getSession().isBound()) {
SubmitSm submit = new SubmitSm();
byte[] textBytes;
- if (command) {
- textBytes = CharsetUtil.encode(message, commandsCharsetName);
- submit.setDataCoding(commandsDataCoding);
- } else {
- textBytes = CharsetUtil.encode(message, notificationsCharsetName);
- submit.setDataCoding(notificationsDataCoding);
- }
+ textBytes = CharsetUtil.encode(message, command ? commandsCharsetName : notificationsCharsetName);
+ submit.setDataCoding(command ? commandsDataCoding : notificationsDataCoding);
submit.setShortMessage(textBytes);
submit.setSourceAddress(new Address(sourceTon, sourceNpi, sourceAddress));
submit.setDestAddress(new Address(destTon, destNpi, destAddress));