Package org.yamcs.tctm.ccsds
Class TcPacketHandler
- java.lang.Object
-
- com.google.common.util.concurrent.AbstractService
-
- org.yamcs.tctm.AbstractLink
-
- org.yamcs.tctm.AbstractTcDataLink
-
- org.yamcs.tctm.ccsds.TcPacketHandler
-
- All Implemented Interfaces:
com.google.common.util.concurrent.Service,SystemParametersProducer,VcUplinkHandler,Link,TcDataLink
public class TcPacketHandler extends AbstractTcDataLink implements VcUplinkHandler
Assembles command packets into TC frames as per CCSDS 232.0-B-3.All frames have the bypass flag set (i.e. they are BD frames).
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.yamcs.tctm.Link
Link.Status
-
-
Field Summary
Fields Modifier and Type Field Description protected BlockingQueue<PreparedCommand>commandQueue-
Fields inherited from class org.yamcs.tctm.AbstractTcDataLink
cmdPostProcessor, commandHistoryPublisher, dataCount, housekeepingInterval, sp_dataCount_id, sv_linkStatus_id
-
Fields inherited from class org.yamcs.tctm.AbstractLink
config, disabled, eventProducer, linkName, log, timeService, yamcsInstance
-
-
Constructor Summary
Constructors Constructor Description TcPacketHandler(String yamcsInstance, String linkName, TcManagedParameters.TcVcManagedParameters vmp)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected Link.StatusconnectionStatus()In case the link should be connected (i.e. is running and enabled) this method is called to return the actual connection statusprotected voiddoStart()protected voiddoStop()longgetFirstFrameTimestamp()Returns the timestamp of the first frame ready to be dispatched orTimeEncoding.INVALID_INSTANTif there is no frame.TcTransferFramegetFrame()Retrieves the next frame in the Virtual Channel, or returns null if there is no frame available at the moment.VcUplinkManagedParametersgetParameters()return the virtual channel parametersvoidsendTc(PreparedCommand preparedCommand)voidsetDataAvailableSemaphore(Semaphore dataAvailableSemaphore)The semaphore will be used by the virtual channel to signal toMasterChannelFrameMultiplexerthat data is available to be uplinked-
Methods inherited from class org.yamcs.tctm.AbstractTcDataLink
ackCommand, failedCommand, getCurrentTime, getDataInCount, getDataOutCount, getParent, getYamcsInstance, init, initPostprocessor, resetCounters, setCommandHistoryPublisher, setParent
-
Methods inherited from class org.yamcs.tctm.AbstractLink
collectSystemParameters, disable, doDisable, doEnable, enable, getConfig, getDetailedStatus, getEventLoop, getLinkStatus, getName, getSystemParameters, isDisabled, isRunningAndEnabled, setupSystemParameters
-
Methods inherited from class com.google.common.util.concurrent.AbstractService
addListener, awaitRunning, awaitRunning, awaitTerminated, awaitTerminated, failureCause, isRunning, notifyFailed, notifyStarted, notifyStopped, startAsync, state, stopAsync, toString
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.yamcs.tctm.Link
disable, enable, getConfig, getDetailedStatus, getLinkStatus, getName, getSpec, isDisabled, setupSystemParameters
-
-
-
-
Field Detail
-
commandQueue
protected BlockingQueue<PreparedCommand> commandQueue
-
-
Constructor Detail
-
TcPacketHandler
public TcPacketHandler(String yamcsInstance, String linkName, TcManagedParameters.TcVcManagedParameters vmp) throws ConfigurationException
- Throws:
ConfigurationException
-
-
Method Detail
-
sendTc
public void sendTc(PreparedCommand preparedCommand)
- Specified by:
sendTcin interfaceTcDataLink
-
getFrame
public TcTransferFrame getFrame()
Description copied from interface:VcUplinkHandlerRetrieves the next frame in the Virtual Channel, or returns null if there is no frame available at the moment.- Specified by:
getFramein interfaceVcUplinkHandler- Returns:
-
getFirstFrameTimestamp
public long getFirstFrameTimestamp()
Description copied from interface:VcUplinkHandlerReturns the timestamp of the first frame ready to be dispatched orTimeEncoding.INVALID_INSTANTif there is no frame.The timestamp is used by the
MasterChannelFrameMultiplexerto select the Virtual Channel from which the next frame is sent in case of FIFO priority scheme.- Specified by:
getFirstFrameTimestampin interfaceVcUplinkHandler- Returns:
-
getParameters
public VcUplinkManagedParameters getParameters()
Description copied from interface:VcUplinkHandlerreturn the virtual channel parameters- Specified by:
getParametersin interfaceVcUplinkHandler- Returns:
-
doStart
protected void doStart()
- Specified by:
doStartin classcom.google.common.util.concurrent.AbstractService
-
doStop
protected void doStop()
- Specified by:
doStopin classcom.google.common.util.concurrent.AbstractService
-
setDataAvailableSemaphore
public void setDataAvailableSemaphore(Semaphore dataAvailableSemaphore)
Description copied from interface:VcUplinkHandlerThe semaphore will be used by the virtual channel to signal toMasterChannelFrameMultiplexerthat data is available to be uplinked- Specified by:
setDataAvailableSemaphorein interfaceVcUplinkHandler
-
connectionStatus
protected Link.Status connectionStatus()
Description copied from class:AbstractLinkIn case the link should be connected (i.e. is running and enabled) this method is called to return the actual connection status- Specified by:
connectionStatusin classAbstractLink
-
-