public class VRTPacket
extends java.lang.Object
implements nxm.sys.inc.PacketHandler, java.lang.Cloneable
VRT Packet Word Placement
0 HDR Header (Type:4,C:1,T:1,RR:2,TSI:2,TSF:2,Seq:4,Size:16)
1 SID Stream ID
2 OUID Organizational Unique ID
3 CID Information Class : Packet Class
4 TSIS TimeStamp - Integer Seconds
6:5 TSFS TimeStamp - Fractional Seconds
7 TLR Trailer
X Data Payload (X=360 qwords for 1500MTU)
Packet qword 7 moved after payload at transmit
Header Types:
0cxs c=Context x=Extension s=WithStreamID
Packet Class (Pack:1,Type:2,Format:5,Resv:2,Size:6)
Ice PCC = Packet Class Code (PT:1,BE:1,DST:2,DIF:4,DIS:8) = 0x100F for LittleEndian CI
Data Item Size = (bitsPerSample-1)
Data Sample Type
00 Real
01 Complex Cartesian
10 Complex Polar
Data Item Format
u0000 Fixed Point - u=Unsigned|Signed
u0eee VRT float w/ e-bit exponent
01110 IEEE Single Precision Floating Point
01111 IEEE Double Precision Floating Point
Information Class
TimeStamp
TSI 0=None 1=UTC 2=GPS 3=Other
TSF 0=None 1=Count 2=pSec 3=FreeRunningCount
| Modifier and Type | Field and Description |
|---|---|
byte[] |
buf |
byte[] |
cbuf |
static java.lang.String |
flagsList |
static int |
FLG_BIGE |
static int |
FLG_CTX |
static int |
FLG_DIFI |
static int |
FLG_NONE |
static int |
FLG_NOSID |
static int |
FLG_NOUID |
static int |
FLG_TRIM |
static int |
OUID_DIFI |
static int |
OUID_ICE |
static int |
TSF_CNT |
static int |
TSF_FRC |
static int |
TSF_NONE |
static int |
TSF_PSEC |
static int |
TSI_GPS |
static int |
TSI_NONE |
static int |
TSI_POSIX |
static int |
TSI_UTC |
| Constructor and Description |
|---|
VRTPacket() |
VRTPacket(java.lang.String format,
int flags) |
VRTPacket(java.lang.String format,
int size,
int flags) |
VRTPacket(java.lang.String format,
int flags,
java.lang.String variant) |
VRTPacket(java.lang.String format,
java.lang.String variant) |
| Modifier and Type | Method and Description |
|---|---|
int |
buf2pkt(byte[] dbuf,
int off,
long pdata,
int len) |
nxm.sys.inc.PacketHandler |
cloneOf()
Create a clone of this instance for propagation.
|
void |
close(nxm.sys.lib.DataFile df)
Finalize this instance.
|
void |
createContextFor(int ctx,
int rate,
int freq,
int gain) |
int |
ctx2pkt(long pdata) |
double |
dataToPacketOffset(nxm.sys.lib.DataFile df,
double boffset)
Translate the data byte offset to packetized byte offset.
|
int |
getBits() |
void |
getBuffer(byte[] buffer,
int boff) |
int |
getBytes() |
int |
getCID() |
java.lang.String |
getConfiguration(nxm.sys.lib.DataFile df)
Get the configuration string needed to initialize this handler.
|
int |
getCount() |
int |
getDataLength() |
java.lang.String |
getFormat() |
int |
getHeaderLength() |
int |
getICID() |
int |
getNextContext() |
int |
getOUID() |
byte |
getRep() |
int |
getSID() |
int |
getSize() |
nxm.sys.lib.Time |
getTC() |
int |
getTrailerLength() |
boolean |
hasHeader()
Determine if the last read included a new packet header.
|
java.lang.String |
listHeader()
Lists the current packet header.
|
double |
naturalDataOffset(nxm.sys.lib.DataFile df,
double boffset)
Translate the data byte offset to byte offset at start of packet.
|
void |
open(nxm.sys.lib.DataFile df)
Initialize this instance.
|
double |
packetToDataOffset(nxm.sys.lib.DataFile df,
double boffset)
Translate the packetized byte offset to data byte offset.
|
int |
read(nxm.sys.lib.DataFile df,
byte[] buf,
int boff,
int bytes,
long lbuf)
Read data including packet header.
|
void |
seek(nxm.sys.lib.DataFile df,
double boffset)
Seek to the closest given data byte offset.
|
void |
setBits(int bits) |
void |
setBuffer(byte[] buffer,
int boff) |
void |
setBytes(int bytes) |
void |
setCID(int cid) |
void |
setCount(int count) |
void |
setFileName(nxm.sys.lib.DataFile df,
nxm.sys.lib.FileName filename)
Set the file name for a packets only file.
|
void |
setFlags(int flags) |
void |
setFormat(java.lang.String format) |
void |
setICID(int icid) |
void |
setOUID(int ouid) |
void |
setRep(byte rep) |
void |
setSID(int sid) |
void |
setSize(int elem) |
void |
setTC(double wsec,
double fsec) |
void |
setTrailer(int trailer) |
void |
upCount() |
int |
write(nxm.sys.lib.DataFile df,
byte[] buf,
int boff,
int bytes,
long lbuf)
Write data including packet header.
|
public static int OUID_ICE
public static int OUID_DIFI
public static int TSI_NONE
public static int TSI_UTC
public static int TSI_GPS
public static int TSI_POSIX
public static int TSF_NONE
public static int TSF_CNT
public static int TSF_PSEC
public static int TSF_FRC
public static java.lang.String flagsList
public static int FLG_NONE
public static int FLG_TRIM
public static int FLG_BIGE
public static int FLG_NOUID
public static int FLG_CTX
public static int FLG_NOSID
public static int FLG_DIFI
public byte[] buf
public byte[] cbuf
public VRTPacket()
public VRTPacket(java.lang.String format,
java.lang.String variant)
public VRTPacket(java.lang.String format,
int flags)
public VRTPacket(java.lang.String format,
int flags,
java.lang.String variant)
public VRTPacket(java.lang.String format,
int size,
int flags)
public void setFlags(int flags)
public void createContextFor(int ctx,
int rate,
int freq,
int gain)
public int getNextContext()
public void setRep(byte rep)
public byte getRep()
public int getHeaderLength()
public int getDataLength()
public int getTrailerLength()
public void setSize(int elem)
public int getSize()
public void setBytes(int bytes)
public int getBytes()
public void setTrailer(int trailer)
public void setSID(int sid)
public int getSID()
public void setOUID(int ouid)
public int getOUID()
public void setICID(int icid)
public int getICID()
public void setCID(int cid)
public int getCID()
public void setCount(int count)
public int getCount()
public void upCount()
public void setFormat(java.lang.String format)
public java.lang.String getFormat()
public void setBits(int bits)
public int getBits()
public void setTC(double wsec,
double fsec)
public nxm.sys.lib.Time getTC()
public int ctx2pkt(long pdata)
public int buf2pkt(byte[] dbuf,
int off,
long pdata,
int len)
public java.lang.String getConfiguration(nxm.sys.lib.DataFile df)
getConfiguration in interface nxm.sys.inc.PacketHandlerdf - The data file to get the configuration for.public void setFileName(nxm.sys.lib.DataFile df,
nxm.sys.lib.FileName filename)
setFileName in interface nxm.sys.inc.PacketHandlerdf - The data file to set the name of.filename - The file new name.public double naturalDataOffset(nxm.sys.lib.DataFile df,
double boffset)
naturalDataOffset in interface nxm.sys.inc.PacketHandlerdf - The data file the data-byte-offset is in relation to.boffset - The data-byte-offset.public double dataToPacketOffset(nxm.sys.lib.DataFile df,
double boffset)
dataToPacketOffset in interface nxm.sys.inc.PacketHandlerdf - The data file the data-byte-offset is in relation to.boffset - The data-byte-offset.PacketHandler.packetToDataOffset(DataFile,double)public double packetToDataOffset(nxm.sys.lib.DataFile df,
double boffset)
packetToDataOffset in interface nxm.sys.inc.PacketHandlerdf - The data file the data-byte-offset is in relation to.boffset - The packetized-byte-offset.PacketHandler.dataToPacketOffset(DataFile,double)public void open(nxm.sys.lib.DataFile df)
open in interface nxm.sys.inc.PacketHandlerdf - The data file to open.public void seek(nxm.sys.lib.DataFile df,
double boffset)
seek in interface nxm.sys.inc.PacketHandlerdf - The data file to seek to the byte offset in.boffset - The byte offset into the file.public int read(nxm.sys.lib.DataFile df,
byte[] buf,
int boff,
int bytes,
long lbuf)
read in interface nxm.sys.inc.PacketHandlerdf - The data file to read from.buf - The buffer to read the data in to.boff - The byte-offset into the buffer to start writing at.bytes - The number of bytes to attempt to read.lbuf - Native buffer location (0=Disable).public int write(nxm.sys.lib.DataFile df,
byte[] buf,
int boff,
int bytes,
long lbuf)
write in interface nxm.sys.inc.PacketHandlerdf - The data file to write to.buf - The buffer to write the data in from.boff - The byte-offset into the buffer to start writing at.bytes - The number of bytes to attempt to write.lbuf - Native buffer location (0=Disable).public void close(nxm.sys.lib.DataFile df)
close in interface nxm.sys.inc.PacketHandlerdf - The data file to close.public boolean hasHeader()
hasHeader in interface nxm.sys.inc.PacketHandlertrue if the last read included a new packet header
and false if it did not.public java.lang.String listHeader()
listHeader in interface nxm.sys.inc.PacketHandlerpublic nxm.sys.inc.PacketHandler cloneOf()
cloneOf in interface nxm.sys.inc.PacketHandlerpublic void setBuffer(byte[] buffer,
int boff)
public void getBuffer(byte[] buffer,
int boff)