public class KexSmsSender extends Object
Modifier and Type | Field and Description |
---|---|
protected int |
baudrate
Baudrate.
|
protected String |
com
ComPort.
|
protected static byte |
EOF
End of file.
|
protected static byte |
ESC
Escape.
|
static int |
GSM_TEXTMODE_SMS_LENGTH
Textmode SMS maximale Länge.
|
protected String |
gsmPin
Pin-Kode für die Authentifizierung im GSM-Netz.
|
protected String |
initSeq
InitSequenz.
|
protected static de.bsvrz.sys.funclib.debug.Debug |
LOGGER
LOGGER.
|
protected AsyncSerialPortCommunicator.ModemType |
modemType
Modemtyp.
|
protected String |
prefix
Präfix für jede Nummer.
|
protected static String |
READY
Antwort auf +CPIN?
|
protected static String |
SIM_PIN
Antwort auf +CPIN?
|
protected long |
timeout
Standardtimeout.
|
protected static byte[] |
WRITE_INPUT
die Antwort bei SMS-Eingabe im Text mode.
|
Constructor and Description |
---|
KexSmsSender(String com,
int baud,
long timeout,
String gsmPin,
AsyncSerialPortCommunicator.ModemType typ,
String initSequenz,
String prefix)
Standardkonstruktor.
|
Modifier and Type | Method and Description |
---|---|
void |
deleteMemory(AsyncSerialPortCommunicator comm,
int n)
Löscht alle gespeicherten SMS.
|
VersandStatus |
send(String empfaenger,
String text,
boolean debug)
Sendet eine SMS.
|
void |
sendInTextModus(AsyncSerialPortCommunicator comm,
String empfaenger,
String textGSM,
String pin)
Sendet eine SMS Nachricht im Text-Modus.
|
void |
setCpinReady(AsyncSerialPortCommunicator comm,
String pin)
Entsperrt ein GSM-Faxmodem.
|
protected Collection<String> |
teileNachricht(String text)
Teilt die Nachricht so auf, damit die 160 Charakter per SMS optimal
benutzt, aber Wörter nicht gebrochen werden.
|
boolean |
ueberPruefeAntwort(Collection<String> antwort,
String gesucht,
String fehlermeldung)
Überprüft, ob die Antwort einen gesuchten String enthält.
|
public static final int GSM_TEXTMODE_SMS_LENGTH
protected static final de.bsvrz.sys.funclib.debug.Debug LOGGER
protected static final byte EOF
protected static final byte ESC
protected static final byte[] WRITE_INPUT
protected static final String READY
protected static final String SIM_PIN
protected String com
protected int baudrate
protected long timeout
protected String gsmPin
protected String prefix
protected String initSeq
protected AsyncSerialPortCommunicator.ModemType modemType
public KexSmsSender(String com, int baud, long timeout, String gsmPin, AsyncSerialPortCommunicator.ModemType typ, String initSequenz, String prefix) throws Exception
com
- COM-Portbaud
- Baudratetimeout
- Timeout in SekundengsmPin
- PINtyp
- Modem-TypinitSequenz
- Initstringprefix
- Wahl-PrefixException
- Feher beim Zugriff auf serielle Schnittstellepublic void deleteMemory(AsyncSerialPortCommunicator comm, int n) throws CommunicationException
comm
- ComPortn
- Kapazität des SpeichersCommunicationException
- bei Ausnahmenpublic VersandStatus send(String empfaenger, String text, boolean debug)
empfaenger
- Empfängertext
- Text in Latindebug
- Debug-Flagpublic void sendInTextModus(AsyncSerialPortCommunicator comm, String empfaenger, String textGSM, String pin) throws CommunicationException
comm
- ComPortempfaenger
- EmpfängertextGSM
- Textpin
- Pin-CodeCommunicationException
- Fehler bei der Kommunikationpublic void setCpinReady(AsyncSerialPortCommunicator comm, String pin) throws CommunicationException
comm
- ComPortpin
- Pin-CodeCommunicationException
- bei Ausnahmenprotected Collection<String> teileNachricht(String text)
text
- Text in GSM Alphabetpublic boolean ueberPruefeAntwort(Collection<String> antwort, String gesucht, String fehlermeldung) throws CommunicationException
antwort
- Antwort des Faxgerätsgesucht
- Gesuchte Zeichenkettefehlermeldung
- Fehlermeldung, wenn gesuchte Zeichenkette nicht gefunden wurdeCommunicationException
- wird geworfen, wenn gesuchte Zeichenkette nicht gefunden
wurdeCopyright © 2017 BitCtrl Systems GmbH. All rights reserved.