org.jSyncManager.API.Protocol

Class PADP_Packet

Implemented Interfaces:
Serializable

public class PADP_Packet
extends java.lang.Object
implements Serializable

PADP_Packet class. This class provides the class representation of a PADP packet.

Field Summary

static byte
ABORT
Denotes that this packets type is an Abort Packet.
static byte
ACK
Denotes that this packets type is an Acknowledgement Parket.
static byte
DATA
Denotes that this packets type is Data Packet.
static byte
FIRST_FRAGMENT
This flag identifies this packet as the first fragment of a series.
static byte
LAST_FRAGMENT
This flag identifies this packet as being the last fragment in a series.
static byte
LONG_PACKET
A flag to denote that this packet is in long packet format.
static byte
NACK
Denotes that this packets type is a Negative Acknowledgement Packet.
static byte
OUT_OF_MEMORY
This flag denotes an error condition on the handheld signifying that it is out of memory.
static byte
TICKLE
Denotes that this packets type is a Tickle Packet.
byte[]
data
A field to hold the data encapsulated within this packet.
byte
destinationSocket
A field to hold the destination socket for this packet.
byte
flags
A field to hold the flags for this packet.
int
packetSize
A field to hold the size of this packet.
byte
packetType
A field to hold the packet type for this packet.
boolean
sent
A field to denote wether or not this packet has been sent.
byte
sourceSocket
A field to hold the source socket for this packet.
byte
transactionID
A field to hold the transaction ID for this packet.

Method Summary

String
toString()
Converts this packet to a human-readable segment of text.

Field Details

ABORT

public static final byte ABORT
Denotes that this packets type is an Abort Packet. Abort packets are used to terminate the PADP connection.
Field Value:
8

ACK

public static final byte ACK
Denotes that this packets type is an Acknowledgement Parket.
Field Value:
2

DATA

public static final byte DATA
Denotes that this packets type is Data Packet.
Field Value:
1

FIRST_FRAGMENT

public static final byte FIRST_FRAGMENT
This flag identifies this packet as the first fragment of a series. PADP breaks large packets into smaller fragments (of at most 1KB in size). This flag is used to denote that the received packet is the first in a series.
Field Value:
-128

LAST_FRAGMENT

public static final byte LAST_FRAGMENT
This flag identifies this packet as being the last fragment in a series. Note that it is required for a packet that can fit within a single fragment to sport both the first and last fragment flags.
Field Value:
64

LONG_PACKET

public static final byte LONG_PACKET
A flag to denote that this packet is in long packet format. If this flag is set, this packet is using a 4-byte packet size field instead of the default two byte size.
Field Value:
16

NACK

public static final byte NACK
Denotes that this packets type is a Negative Acknowledgement Packet. Note that since PADP 1.0, this packet type is no longer used or supported. NACKs are inherently problematic. This field is included purely for the sake of completeness.
Field Value:
3

OUT_OF_MEMORY

public static final byte OUT_OF_MEMORY
This flag denotes an error condition on the handheld signifying that it is out of memory. It is forseeable that on a handheld where nearly all of the available memory is used that it won't have sufficient RAM to perform packetizing operations. If this is the case, an out of memory error occurs. Note that this flag isn't intended be set for packets going to the handheld.
Field Value:
32

TICKLE

public static final byte TICKLE
Denotes that this packets type is a Tickle Packet. Tickle packets are used to prevent the connection from timing out. They are, in effect, a "keep alive" packet.
Field Value:
4

data

public byte[] data
A field to hold the data encapsulated within this packet.

destinationSocket

public byte destinationSocket
A field to hold the destination socket for this packet. Note that this field isn't actually a part of the packet itself. This data is transmitted as a part of the SLP packet. However, it may be needed at various levels of the protocol stack, and is thus included here as a way of propogating it between protocols.

flags

public byte flags
A field to hold the flags for this packet.

packetSize

public int packetSize
A field to hold the size of this packet.

packetType

public byte packetType
A field to hold the packet type for this packet.

sent

public boolean sent
A field to denote wether or not this packet has been sent. This field is set to true if this packet has been transmitted, false otherwise.

sourceSocket

public byte sourceSocket
A field to hold the source socket for this packet. Note that this field isn't actually a part of the packet itself. This data is transmitted as a part of the SLP packet. However, it may be needed at various levels of the protocol stack, and is thus included here as a way of propogating it between protocols.

transactionID

public byte transactionID
A field to hold the transaction ID for this packet. Note that this field isn't actually a part of the packet itself. This data is transmitted as a part of the SLP packet. However, it may be needed at various levels of the protocol stack, and is thus included here as a way of propogating it between protocols.

Method Details

toString

public String toString()
Converts this packet to a human-readable segment of text.
Returns:
a String representation of this packet, suitable for use as a trace/debug aid.