Class Class0Adapter
- java.lang.Object
-
- com.automation_pros.odva.cip.core.Class0Adapter
-
- All Implemented Interfaces:
AppConsumer,AppLinkBase,AppProducer
public class Class0Adapter extends java.lang.Object implements AppConsumer, AppProducer
Add or remove 16-bit sequence numbers for class zero connections to applications that expect them.
-
-
Field Summary
Fields Modifier and Type Field Description protected AppConsumeracprotected AppProducerapprotected java.util.concurrent.atomic.AtomicIntegerseq
-
Constructor Summary
Constructors Constructor Description Class0Adapter(java.lang.Object obj)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidappConsume(long txID, java.nio.ByteBuffer payload)Add the 16-bit sequence number needed for this application.voidappProduce(long txID, java.nio.ByteBuffer payload)Discard the 16-bit sequence number provided by the applicaton.voiddisconnect()When a connection is closed or an application forces a disconnect, this shutdown method is called to clean up.intgetProduceRTF()An Application Producer must supply an indicator of the desired real-time mode handling format.intgetRealTimeMode()When an application needs to encode a packet, and the producer expects a real-time mode indicator, the application obtains the 32-bit mode indicator from the producer with this method.booleanisDisconnected()
-
-
-
Field Detail
-
ac
protected final AppConsumer ac
-
ap
protected final AppProducer ap
-
seq
protected final java.util.concurrent.atomic.AtomicInteger seq
-
-
Method Detail
-
appProduce
public void appProduce(long txID, java.nio.ByteBuffer payload)Discard the 16-bit sequence number provided by the applicaton.- Specified by:
appProducein interfaceAppProducer- Parameters:
txID- Transport layer transaction ID uniquely identifying this message or reply, if applicable. Zero for I/O connections.payload- Complete CIP data payload, including CIP sequence number, if any.
-
appConsume
public void appConsume(long txID, java.nio.ByteBuffer payload)Add the 16-bit sequence number needed for this application.- Specified by:
appConsumein interfaceAppConsumer- Parameters:
txID- Transport layer transaction ID to use with any reply.payload- Complete CIP data payload, including CIP sequence number, if any.
-
disconnect
public void disconnect()
Description copied from interface:AppLinkBaseWhen a connection is closed or an application forces a disconnect, this shutdown method is called to clean up. It should close the connection when called by the application.- Specified by:
disconnectin interfaceAppLinkBase
-
isDisconnected
public boolean isDisconnected()
- Specified by:
isDisconnectedin interfaceAppLinkBase
-
getProduceRTF
public int getProduceRTF()
Description copied from interface:AppProducerAn Application Producer must supply an indicator of the desired real-time mode handling format. The following values are allowed: -1: Application default 0: Modeless 1: Zero length packet==idle 3: Heartbeat 4: 32-bit run/idle header is present 5: Safety- Specified by:
getProduceRTFin interfaceAppProducer- Returns:
- Produced payload real-time mode format
-
getRealTimeMode
public int getRealTimeMode()
Description copied from interface:AppProducerWhen an application needs to encode a packet, and the producer expects a real-time mode indicator, the application obtains the 32-bit mode indicator from the producer with this method.- Specified by:
getRealTimeModein interfaceAppProducer- Returns:
- 32-bit run/idle header to encode or imply
-
-