jSyncManager

org.jSyncManager.API.Transport
Class SerialTransportInterface

java.lang.Object
  |
  +--org.jSyncManager.API.Transport.SLPTransportInterface
        |
        +--org.jSyncManager.API.Transport.SerialTransportInterface
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
CommAPITransport

public abstract class SerialTransportInterface
extends SLPTransportInterface

Serial Transport Abstract Class. This is a specific implementation of the SLPTransportInterface designed for use with serial ports. The HotSync protocol needs to be able to change the serial rate dynamically after negotiating the connection with the handheld, and thus requires an additional method over the standard SLPTransportInterface class. see SLPTransportInterface

Version:
$Revision: 1.7 $
Author:
Brad BARCLAY <bbarclay@jsyncmanager.org>
Last modified by: $Author: yaztromo $ on $Date: 2003/04/23 00:22:53 $.
See Also:
Serialized Form

Field Summary
static int INITIAL_SERIAL_SPEED
          The initial serial port rate of 9600bps.
protected  int serialSpeed
          The desired maximum connection rate selected by the user.
 
Fields inherited from class org.jSyncManager.API.Transport.SLPTransportInterface
configPanel, connected
 
Constructor Summary
SerialTransportInterface()
          SerialTransportInterface constructor.
 
Method Summary
abstract  int getPreferredSyncSpeed()
          A method to retreive the users preferred sync speed.
protected abstract  void setSpeed(int speed)
          Changes the speed of the underlying transport mechanism.
 void switchSpeed(boolean hiSpeed)
          This method is called when it's time to switch serial speeds.
 
Methods inherited from class org.jSyncManager.API.Transport.SLPTransportInterface
close, constructConfigPanel, flush, getConfigPanel, getResourceBundle, getResourceBundleName, getTransportDescription, getTransportExceptionText, getTransportName, initialize, initialize, isConnected, loadResourceBundle, open, readByte, setConnected, writeBytes
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

INITIAL_SERIAL_SPEED

public static final int INITIAL_SERIAL_SPEED
The initial serial port rate of 9600bps.

serialSpeed

protected int serialSpeed
The desired maximum connection rate selected by the user.
Constructor Detail

SerialTransportInterface

public SerialTransportInterface()
                         throws TransportException
SerialTransportInterface constructor.
Throws:
Any - TransportException thrown by the parent class is rethrown by this constructor.
Method Detail

setSpeed

protected abstract void setSpeed(int speed)
                          throws TransportException
Changes the speed of the underlying transport mechanism. This method should allow the protocol stack to set the speed for communications, if the underlying transport supports speed changing. This is implemented for speed negotiation for serial line transports, other transports should present a null implementation if speed negotiation is not supported (ie: for a TCP/IP based transport)
Parameters:
speed - - The speed to set the transport to.
Throws:
TransportException - any exception the underlying code may throw.

getPreferredSyncSpeed

public abstract int getPreferredSyncSpeed()
A method to retreive the users preferred sync speed. As the transport takes care of storing user selections on its own, and as the CMP layer negotiates the speed for the transfer after connecting, it needs a way to determine at what speed the user prefers to sync at.
Returns:
the maximum serial rate the user has selected to sync at.

switchSpeed

public final void switchSpeed(boolean hiSpeed)
                       throws TransportException
This method is called when it's time to switch serial speeds.
Parameters:
hiSpeed - true if we need to switch to our highest speed, false to switch to the initialization speed.
Throws:
TransportException - any exception the underlying code may throw.

jSyncManager

Copyright (c) 1999 - 2003 Brad BARCLAY and others. All Rights Reserved.