C# Class PSI.EpicsClient2.DataPacket

Handles messages between workers. Can contain either a TCP/UDP packet or an EPICS message
Inheritance: ICloneable, IDisposable
Mostra file Open project: ISISComputingGroup/EPICS-epicssharp Class Usage Examples

Public Properties

Property Type Description
Data byte[]
Destination System.Net.IPEndPoint
NeedToFlush bool
ReverseAnswer bool
Sender System.Net.IPEndPoint

Public Methods

Method Description
Clone ( ) : object

Clone this packet, creating an exact copy. As the clone function is an implementation of IClonable it must return an object.

Create ( DataPacket remaining, DataPacket newPacket ) : DataPacket

Merges 2 packets together

Create ( DataPacket packet, UInt32 size ) : DataPacket

Creates a new message based on an existing packed and use the "size" to extract only the first part.

Create ( byte buff ) : DataPacket

Creates a new message based on the byte buffer however use only the first "size" byte for it.

Create ( byte buff, int size ) : DataPacket

Creates a new message based on the byte buffer however use only the first "size" byte for it.

Create ( int size ) : DataPacket
Dispose ( ) : void
GetDataAsString ( int offset, int maxSize = 40 ) : string

Retreives the payload as string.

GetDouble ( int position ) : double
GetFloat ( int position ) : float
GetInt16 ( int position ) : short
GetInt32 ( int position ) : Int32
GetPayload ( ) : byte[]
GetSByte ( int position ) : sbyte
GetUInt16 ( int position ) : UInt16

Returns an UInt16 at a given position

GetUInt32 ( int position ) : UInt32

Returns an UInt32 at a given position

SetBytes ( int position, byte buff ) : void
SetDataAsString ( string str ) : void
SetDouble ( int position, double value ) : void
SetFloat ( int position, float value ) : void
SetInt16 ( int position, short value ) : void
SetInt32 ( int position, int value ) : void
SetSByte ( int position, sbyte value ) : void
SetUInt16 ( int position, UInt16 value ) : void

Writes an UInt16 at a given position

SetUInt32 ( int position, UInt32 value ) : void

Writes an UInt32 at a given position

SkipSize ( UInt32 size ) : DataPacket

Skips a given size from the data block

Private Methods

Method Description
DataPacket ( ) : System

Method Details

Clone() public method

Clone this packet, creating an exact copy. As the clone function is an implementation of IClonable it must return an object.
public Clone ( ) : object
return object

Create() public static method

Merges 2 packets together
public static Create ( DataPacket remaining, DataPacket newPacket ) : DataPacket
remaining DataPacket
newPacket DataPacket
return DataPacket

Create() public static method

Creates a new message based on an existing packed and use the "size" to extract only the first part.
public static Create ( DataPacket packet, UInt32 size ) : DataPacket
packet DataPacket
size System.UInt32
return DataPacket

Create() public static method

Creates a new message based on the byte buffer however use only the first "size" byte for it.
public static Create ( byte buff ) : DataPacket
buff byte
return DataPacket

Create() public static method

Creates a new message based on the byte buffer however use only the first "size" byte for it.
public static Create ( byte buff, int size ) : DataPacket
buff byte
size int
return DataPacket

Create() public static method

public static Create ( int size ) : DataPacket
size int
return DataPacket

Dispose() public method

public Dispose ( ) : void
return void

GetDataAsString() public method

Retreives the payload as string.
public GetDataAsString ( int offset, int maxSize = 40 ) : string
offset int
maxSize int
return string

GetDouble() public method

public GetDouble ( int position ) : double
position int
return double

GetFloat() public method

public GetFloat ( int position ) : float
position int
return float

GetInt16() public method

public GetInt16 ( int position ) : short
position int
return short

GetInt32() public method

public GetInt32 ( int position ) : Int32
position int
return System.Int32

GetPayload() public method

public GetPayload ( ) : byte[]
return byte[]

GetSByte() public method

public GetSByte ( int position ) : sbyte
position int
return sbyte

GetUInt16() public method

Returns an UInt16 at a given position
public GetUInt16 ( int position ) : UInt16
position int
return System.UInt16

GetUInt32() public method

Returns an UInt32 at a given position
public GetUInt32 ( int position ) : UInt32
position int
return System.UInt32

SetBytes() public method

public SetBytes ( int position, byte buff ) : void
position int
buff byte
return void

SetDataAsString() public method

public SetDataAsString ( string str ) : void
str string
return void

SetDouble() public method

public SetDouble ( int position, double value ) : void
position int
value double
return void

SetFloat() public method

public SetFloat ( int position, float value ) : void
position int
value float
return void

SetInt16() public method

public SetInt16 ( int position, short value ) : void
position int
value short
return void

SetInt32() public method

public SetInt32 ( int position, int value ) : void
position int
value int
return void

SetSByte() public method

public SetSByte ( int position, sbyte value ) : void
position int
value sbyte
return void

SetUInt16() public method

Writes an UInt16 at a given position
public SetUInt16 ( int position, UInt16 value ) : void
position int
value System.UInt16
return void

SetUInt32() public method

Writes an UInt32 at a given position
public SetUInt32 ( int position, UInt32 value ) : void
position int
value System.UInt32
return void

SkipSize() public method

Skips a given size from the data block
public SkipSize ( UInt32 size ) : DataPacket
size System.UInt32
return DataPacket

Property Details

Data public_oe property

public byte[] Data
return byte[]

Destination public_oe property

public IPEndPoint,System.Net Destination
return System.Net.IPEndPoint

NeedToFlush public_oe property

public bool NeedToFlush
return bool

ReverseAnswer public_oe property

Allows to change the sending rules
public bool ReverseAnswer
return bool

Sender public_oe property

public IPEndPoint,System.Net Sender
return System.Net.IPEndPoint