org.marre.sms.transport.gsm
Class GsmTransport

java.lang.Object
  extended byorg.marre.sms.transport.gsm.GsmTransport
All Implemented Interfaces:
SmsTransport

public class GsmTransport
extends java.lang.Object
implements SmsTransport

An SmsTransport that sends the SMS from an GSM phone that is attached to the serial port.

This transport supports the following parameters:

 sms.gsm.appname - Application name to use when registering the comport
 sms.gsm.serialport - Serial port where the GSM phone is located. Ex: "COM1"
 sms.gsm.bitrate - Bits per second
 sms.gsm.bit - Databits
 sms.gsm.parity - Parity (NONE, EVEN, ODD, MARK, SPACE)
 sms.gsm.stopbits - Stopbits (1, 1.5, 2)
 sms.gsm.echo - Is the device echoing the input?
 sms.gsm.flowcontrol - FlowControl (XONXOFF, RTSCTS, NONE)
 
 

This transport cannot set the sending "address" to anything else than the sending phone's phonenumber.

Version:
$Id: GsmTransport.java,v 1.27 2005/11/26 16:39:33 c95men Exp $
Author:
Markus Eriksson, Boris von Loesch

Constructor Summary
GsmTransport()
          Creates a GsmTransport.
 
Method Summary
 void connect()
          Initializes the communication with the GSM phone.
 void disconnect()
          Closes the serial connection to the phone.
 void init(java.util.Properties props)
          Initializes this transport.
 void ping()
          Sends a "AT" command to keep the connection alive.
 java.lang.String send(SmsMessage msg, SmsAddress dest, SmsAddress sender)
          Sends the SMS message to the given recipients.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GsmTransport

public GsmTransport()
Creates a GsmTransport.

Method Detail

init

public void init(java.util.Properties props)
Initializes this transport.

Specified by:
init in interface SmsTransport
Parameters:
props -

connect

public void connect()
             throws SmsException,
                    java.io.IOException
Initializes the communication with the GSM phone.

Specified by:
connect in interface SmsTransport
Throws:
SmsException
java.io.IOException

send

public java.lang.String send(SmsMessage msg,
                             SmsAddress dest,
                             SmsAddress sender)
                      throws SmsException,
                             java.io.IOException
Sends the SMS message to the given recipients. Note: The sending address is ignored for the GSM transport.

Specified by:
send in interface SmsTransport
Parameters:
msg - The message to send
dest - The reciever
sender - The sending address, ignored
Returns:
Returns a local message id
Throws:
SmsException - Thrown if we fail to send the SMS
java.io.IOException

ping

public void ping()
          throws java.io.IOException
Sends a "AT" command to keep the connection alive.

Specified by:
ping in interface SmsTransport
Throws:
java.io.IOException

disconnect

public void disconnect()
Closes the serial connection to the phone.

Specified by:
disconnect in interface SmsTransport
Throws:
java.io.IOException


Copyright © 2002-2005 Markus Eriksson. All Rights Reserved.