All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.yamcs.sle.TmSleLink Maven / Gradle / Ivy

Go to download

Data links for connecting Yamcs to SLE (Space Link Extension) providers such as Ground Stations

There is a newer version: 1.6.0
Show newest version
package org.yamcs.sle;

import java.util.concurrent.CompletableFuture;

import org.yamcs.ConfigurationException;
import org.yamcs.YConfiguration;
import org.yamcs.tctm.ccsds.UdpTmFrameLink;

import org.yamcs.sle.Constants.DeliveryMode;
import org.yamcs.sle.user.RafServiceUserHandler;
import org.yamcs.sle.user.RcfServiceUserHandler;

/**
 * Receives TM frames via SLE. The Virtual Channel configuration is identical with the configuration of
 * {@link UdpTmFrameLink}.
 * 

* The SLE specific settings are loaded from sle.yaml based on the sleProvider key specified in the link configuration. * The description of the sle.yaml configuration parameters are as follows: *

* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
initiatorIdidentifier of the local application
responderPortIdResponder Port Identifier
versionNumberthe version number is sent in the bind invocation. We only support the version of the SLE valid in April-2019; * however this field is not checked.
myUsernameusername that is passed in outgoing SLE messages. A corresponding password has to be specified (in hexadecimal) * in the security.yaml file.
peerUsernameusername that is used to verify the incoming SLE messages. A corresponding password has to be specified (in * hexadecimal) in the security.yaml file.
authLevelone of NONE, BIND or ALL - it configures which incoming and outgoing PDUs contain authentication * information.
serviceOne of RAF (return all frames) or RCF (return channel frames).
rcfTfVersionSpecifies the requested frame version number (0=TM, 1=AOS, 12=USLP). * If this option is not used, the frame version number will be derived from the frameType. If specfied, no validation * is performed but sent as configured to the SLE provider.
rcfSpacecraftIdSpecifies the number sent as part of the RCF request to the SLE provider. If not specified the spacecraftId will be used.
rcfVcIdSpecifies the virtual channel sent as part of the RCF request. If not specified, or if negative, the request will be sent for all VCs
deliveryModeone of timely, or complete
* * * @author nm * */ public class TmSleLink extends AbstractTmSleLink { RacfSleMonitor sleMonitor = new MyMonitor(); public void init(String instance, String name, YConfiguration config) throws ConfigurationException { super.init(instance, name, config, getDeliveryMode(config)); reconnectionIntervalSec = config.getInt("reconnectionIntervalSec", 30); } private DeliveryMode getDeliveryMode(YConfiguration config) { String dm = config.getString("deliveryMode"); if("timely".equalsIgnoreCase(dm)) { return DeliveryMode.rtnTimelyOnline; } else if ("complete".equalsIgnoreCase(dm)) { return DeliveryMode.rtnCompleteOnline; } else { throw new ConfigurationException("Invalid value '"+dm+"' for deliverMode. Please use 'timely' or 'complete'"); } } @Override protected void doStart() { if (!isDisabled()) { connect(); } notifyStarted(); } @Override protected void doStop() { if (rsuh != null) { rsuh.shutdown(); rsuh = null; } notifyStopped(); } protected void sleStart() { CompletableFuture cf; if(gvcid==null) { cf = ((RafServiceUserHandler)rsuh).start(); } else { cf = ((RcfServiceUserHandler)rsuh).start(gvcid); } cf.handle((v, t) -> { if (t != null) { eventProducer.sendWarning("Failed to start: " + t.getMessage()); return null; } return null; }); } @Override protected void doDisable() { if (rsuh != null) { rsuh.shutdown(); rsuh = null; } } @Override protected void doEnable() throws Exception { connect(); } @Override public void onEndOfData() { eventProducer.sendInfo("SLE end of data received"); } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy