From 6ff73337236f126839e8ce936ba9d201e8a501c7 Mon Sep 17 00:00:00 2001 From: Abyss777 Date: Thu, 2 Mar 2017 17:05:25 +0500 Subject: Remove BaseProtocolSmsEncoder class Add fallback to SMS if device is not online Use more variables and ternary operators --- src/org/traccar/smpp/SmppClient.java | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) (limited to 'src/org/traccar/smpp') 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)); -- cgit v1.2.3