Package com.automation_pros.odva.encap
Class EncapList
- java.lang.Object
-
- com.automation_pros.odva.encap.Encap
-
- com.automation_pros.odva.encap.EncapList
-
- All Implemented Interfaces:
CpfWrapper
- Direct Known Subclasses:
EncapData
public class EncapList extends Encap
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
EncapList.Decoder
Decode bytes expected to contain one encapsulated Ethernet/IP packet-
Nested classes/interfaces inherited from class com.automation_pros.odva.encap.Encap
Encap.EncapException
-
-
Field Summary
Fields Modifier and Type Field Description protected int
expectedItems
protected java.util.List<CommonPacketFormat>
items
-
Fields inherited from class com.automation_pros.odva.encap.Encap
CMD_CANCEL, CMD_LIST_ID, CMD_LIST_IFACE, CMD_LIST_SVC, CMD_LIST_TARG, CMD_NOP, CMD_REGISTER, CMD_SEND_RR, CMD_SEND_UNIT, CMD_STATUS, CMD_UNREGISTER, command, context, decodeTS, extralen, options, session, ST_EBUSY, ST_ECMD, ST_EDATA, ST_ELENGTH, ST_EPERM, ST_EREVISION, ST_ESESSION, ST_SUCCESS, status
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
EncapList()
EncapList(short cmd, int sess, int stat, int opt, CommonPacketFormat... cpfitems)
EncapList(short cmd, int sess, int stat, int opt, java.util.List<CommonPacketFormat> cpfitems)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
add(CommonPacketFormat cpf)
int
getExtralen()
CommonPacketFormat
getItem(int idx)
Given the index of an item in this packet's list of CPF items, return that item.int
getItemCount()
Obtain the number of CPF items wrapped in this packet.java.util.List<CommonPacketFormat>
getItems()
boolean
isValid()
void
putPayload(java.nio.ByteBuffer dest)
void
setItems(java.util.List<CommonPacketFormat> items)
void
setPayload(java.nio.ByteBuffer source)
java.lang.String
toString()
-
Methods inherited from class com.automation_pros.odva.encap.Encap
decode, decode, getAddressItem, getCommand, getContext, getDataItem, getError, getOptions, getSession, getStatus, putBytes, registerDecoder, setBytes, setContext, setError, setSession, setStatus, writeBytes, writePayload
-
-
-
-
Field Detail
-
expectedItems
protected int expectedItems
-
items
protected java.util.List<CommonPacketFormat> items
-
-
Constructor Detail
-
EncapList
protected EncapList()
-
EncapList
public EncapList(short cmd, int sess, int stat, int opt, CommonPacketFormat... cpfitems)
-
EncapList
public EncapList(short cmd, int sess, int stat, int opt, java.util.List<CommonPacketFormat> cpfitems)
-
-
Method Detail
-
getExtralen
public int getExtralen()
- Overrides:
getExtralen
in classEncap
-
getItems
public java.util.List<CommonPacketFormat> getItems()
-
setItems
public void setItems(java.util.List<CommonPacketFormat> items)
-
add
public void add(CommonPacketFormat cpf)
-
putPayload
public void putPayload(java.nio.ByteBuffer dest)
- Overrides:
putPayload
in classEncap
-
setPayload
public void setPayload(java.nio.ByteBuffer source)
- Overrides:
setPayload
in classEncap
-
getItemCount
public int getItemCount()
Description copied from interface:CpfWrapper
Obtain the number of CPF items wrapped in this packet.- Specified by:
getItemCount
in interfaceCpfWrapper
- Overrides:
getItemCount
in classEncap
- Returns:
-
getItem
public CommonPacketFormat getItem(int idx)
Description copied from interface:CpfWrapper
Given the index of an item in this packet's list of CPF items, return that item.- Specified by:
getItem
in interfaceCpfWrapper
- Overrides:
getItem
in classEncap
- Returns:
-
-