jSyncManager

org.jSyncManager.API.Protocol
Class CMP_Packet

java.lang.Object
  |
  +--org.jSyncManager.API.Protocol.CMP_Packet
All Implemented Interfaces:
java.io.Serializable

public class CMP_Packet
extends java.lang.Object
implements java.io.Serializable

CMP_Packet class. This class provides the class representation of a CMP packet.

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

Field Summary
 int baudRate
          The baud rate to use for serial communication.
static byte CHANGE_BAUD_RATE
          A flag to denote a change of baud rate is requested.
static byte CMP_ABORT
          The CMP packet type value for an abort packet.
static byte CMP_EXTENDED
          The CMP packet type value for a extended CMP packet.
static byte CMP_INIT
          The CMP packet type value for a initialization packet.
static byte CMP_WAKEUP
          The CMP packet type value for a wakeup packet.
static int DEFAULT_SPEED
          The default speed to use for serial synchronization.
 byte flags
          A field to contain the packet flags.
 byte majorVersion
          The major revision of the CMP protocol in use.
 byte minorVersion
          The minor revision of the CMP protocol in use.
static byte ONE_MINUTE_TIMEOUT
          A flag to tell the handheld that it should use a one-minute timeout before assuming that communications have been lost.
 byte packetType
          A field to contain the packet type value.
static byte TWO_MINUTE_TIMEOUT
          A flag to tell the handheld that it should use a two-minute timeout before assuming that communications have been lost.
static byte VERSION_MISMATCH
          An error flag denoting a version mismatch in the protocol stacks on either end of the synchronization.
static byte WAKEUP_TID
          The transactiod ID used for the CMP Wakeup packet.
 
Constructor Summary
(package private) CMP_Packet()
          Constructs a new CMP_Packet using the default settings.
(package private) CMP_Packet(byte pktType, byte flgs, byte majorVer, byte minorVer, int baud)
          Constructs a new CMP_Packet with the specified packet type, flags, major version, minor version, and serial baud rate.
 
Method Summary
(package private) static CMP_Packet bytes2Packet(byte[] pkt)
          Convert an array of bytes containing a valid CMP packet into an instance of CMP_Packet.
(package private)  byte[] packet2Bytes()
          Converts this packet to a byte array, suitable for transmission.
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CHANGE_BAUD_RATE

public static final byte CHANGE_BAUD_RATE
A flag to denote a change of baud rate is requested. All serial dock based HotSyncs start off at 9600bps. This flag is passed to signal that a change of baud rate is requested to a different speed.
See Also:
baudRate

ONE_MINUTE_TIMEOUT

public static final byte ONE_MINUTE_TIMEOUT
A flag to tell the handheld that it should use a one-minute timeout before assuming that communications have been lost.

TWO_MINUTE_TIMEOUT

public static final byte TWO_MINUTE_TIMEOUT
A flag to tell the handheld that it should use a two-minute timeout before assuming that communications have been lost.

CMP_WAKEUP

public static final byte CMP_WAKEUP
The CMP packet type value for a wakeup packet.

CMP_INIT

public static final byte CMP_INIT
The CMP packet type value for a initialization packet.

CMP_ABORT

public static final byte CMP_ABORT
The CMP packet type value for an abort packet.

CMP_EXTENDED

public static final byte CMP_EXTENDED
The CMP packet type value for a extended CMP packet.

WAKEUP_TID

public static final byte WAKEUP_TID
The transactiod ID used for the CMP Wakeup packet.

VERSION_MISMATCH

public static final byte VERSION_MISMATCH
An error flag denoting a version mismatch in the protocol stacks on either end of the synchronization.

DEFAULT_SPEED

public static final int DEFAULT_SPEED
The default speed to use for serial synchronization. The default is 9600bps.

packetType

public byte packetType
A field to contain the packet type value.
See Also:
CMP_WAKEUP, CMP_INIT, CMP_ABORT, CMP_EXTENDED

flags

public byte flags
A field to contain the packet flags.
See Also:
CHANGE_BAUD_RATE, ONE_MINUTE_TIMEOUT, TWO_MINUTE_TIMEOUT

majorVersion

public byte majorVersion
The major revision of the CMP protocol in use.

minorVersion

public byte minorVersion
The minor revision of the CMP protocol in use.

baudRate

public int baudRate
The baud rate to use for serial communication. The default is 9600bps.
Constructor Detail

CMP_Packet

CMP_Packet()
Constructs a new CMP_Packet using the default settings.

CMP_Packet

CMP_Packet(byte pktType,
           byte flgs,
           byte majorVer,
           byte minorVer,
           int baud)
Constructs a new CMP_Packet with the specified packet type, flags, major version, minor version, and serial baud rate.
Parameters:
pktType - the CMP packets type.
flgs - the flags to attach to this packet.
majorVer - the major protocol version.
minorVer - the minor protocol version.
baud - the serial rate to use for serial synchronization.
Method Detail

bytes2Packet

static CMP_Packet bytes2Packet(byte[] pkt)
Convert an array of bytes containing a valid CMP packet into an instance of CMP_Packet.
Parameters:
pkt - the byte array containing a CMP packet to convert.
Returns:
the CMP_Packet object containing the data from the byte array.

packet2Bytes

byte[] packet2Bytes()
Converts this packet to a byte array, suitable for transmission.
Returns:
an array of bytes containing the byte representation of this packet object.

jSyncManager

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