Skip to content

Commit

Permalink
Merge pull request #52 from pixxelhq/master
Browse files Browse the repository at this point in the history
v5.8.9-Pixxel.SNAPSHOT-1.6.0
  • Loading branch information
swarup-n authored Feb 14, 2024
2 parents dcf2290 + af4594d commit 78fc3eb
Show file tree
Hide file tree
Showing 37 changed files with 465 additions and 73 deletions.
2 changes: 1 addition & 1 deletion distribution/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<parent>
<groupId>org.yamcs</groupId>
<artifactId>yamcs</artifactId>
<version>5.8.9-Pixxel.SNAPSHOT-1.5.0</version>
<version>5.8.9-Pixxel.SNAPSHOT-1.6.0</version>
</parent>

<artifactId>distribution</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion examples/cascading/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>org.yamcs.examples</groupId>
<artifactId>examples</artifactId>
<version>5.8.9-Pixxel.SNAPSHOT-1.5.0</version>
<version>5.8.9-Pixxel.SNAPSHOT-1.6.0</version>
</parent>

<artifactId>cascading</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion examples/ccsds-frames/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>org.yamcs.examples</groupId>
<artifactId>examples</artifactId>
<version>5.8.9-Pixxel.SNAPSHOT-1.5.0</version>
<version>5.8.9-Pixxel.SNAPSHOT-1.6.0</version>
</parent>

<artifactId>ccsds-frames</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion examples/cfdp-udp/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>org.yamcs.examples</groupId>
<artifactId>examples</artifactId>
<version>5.8.9-Pixxel.SNAPSHOT-1.5.0</version>
<version>5.8.9-Pixxel.SNAPSHOT-1.6.0</version>
</parent>

<artifactId>cfdp-udp</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion examples/cfdp/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>org.yamcs.examples</groupId>
<artifactId>examples</artifactId>
<version>5.8.9-Pixxel.SNAPSHOT-1.5.0</version>
<version>5.8.9-Pixxel.SNAPSHOT-1.6.0</version>
</parent>

<artifactId>cfdp</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion examples/perftest1/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>org.yamcs.examples</groupId>
<artifactId>examples</artifactId>
<version>5.8.9-Pixxel.SNAPSHOT-1.5.0</version>
<version>5.8.9-Pixxel.SNAPSHOT-1.6.0</version>
</parent>

<artifactId>perftest1</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion examples/perftest2/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>org.yamcs.examples</groupId>
<artifactId>examples</artifactId>
<version>5.8.9-Pixxel.SNAPSHOT-1.5.0</version>
<version>5.8.9-Pixxel.SNAPSHOT-1.6.0</version>
</parent>

<artifactId>perftest2</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion examples/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>org.yamcs</groupId>
<artifactId>yamcs</artifactId>
<version>5.8.9-Pixxel.SNAPSHOT-1.5.0</version>
<version>5.8.9-Pixxel.SNAPSHOT-1.6.0</version>
</parent>

<groupId>org.yamcs.examples</groupId>
Expand Down
2 changes: 1 addition & 1 deletion examples/pus/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>org.yamcs.examples</groupId>
<artifactId>examples</artifactId>
<version>5.8.9-Pixxel.SNAPSHOT-1.5.0</version>
<version>5.8.9-Pixxel.SNAPSHOT-1.6.0</version>
</parent>

<artifactId>pus</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion examples/replication1/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>org.yamcs.examples</groupId>
<artifactId>examples</artifactId>
<version>5.8.9-Pixxel.SNAPSHOT-1.5.0</version>
<version>5.8.9-Pixxel.SNAPSHOT-1.6.0</version>
</parent>

<artifactId>replication1</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion examples/replication2/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>org.yamcs.examples</groupId>
<artifactId>examples</artifactId>
<version>5.8.9-Pixxel.SNAPSHOT-1.5.0</version>
<version>5.8.9-Pixxel.SNAPSHOT-1.6.0</version>
</parent>

<artifactId>replication2</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion examples/replication3/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>org.yamcs.examples</groupId>
<artifactId>examples</artifactId>
<version>5.8.9-Pixxel.SNAPSHOT-1.5.0</version>
<version>5.8.9-Pixxel.SNAPSHOT-1.6.0</version>
</parent>

<artifactId>replication3</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion examples/simulation/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>org.yamcs.examples</groupId>
<artifactId>examples</artifactId>
<version>5.8.9-Pixxel.SNAPSHOT-1.5.0</version>
<version>5.8.9-Pixxel.SNAPSHOT-1.6.0</version>
</parent>

<artifactId>simulation</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion examples/snippets/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>org.yamcs.examples</groupId>
<artifactId>examples</artifactId>
<version>5.8.9-Pixxel.SNAPSHOT-1.5.0</version>
<version>5.8.9-Pixxel.SNAPSHOT-1.6.0</version>
</parent>

<artifactId>snippets</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion examples/templates/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>org.yamcs.examples</groupId>
<artifactId>examples</artifactId>
<version>5.8.9-Pixxel.SNAPSHOT-1.5.0</version>
<version>5.8.9-Pixxel.SNAPSHOT-1.6.0</version>
</parent>

<artifactId>templates</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion packet-viewer/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<parent>
<groupId>org.yamcs</groupId>
<artifactId>yamcs</artifactId>
<version>5.8.9-Pixxel.SNAPSHOT-1.5.0</version>
<version>5.8.9-Pixxel.SNAPSHOT-1.6.0</version>
</parent>

<artifactId>packet-viewer</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

<groupId>org.yamcs</groupId>
<artifactId>yamcs</artifactId>
<version>5.8.9-Pixxel.SNAPSHOT-1.5.0</version>
<version>5.8.9-Pixxel.SNAPSHOT-1.6.0</version>

<packaging>pom</packaging>

Expand Down
2 changes: 1 addition & 1 deletion simulator/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>org.yamcs</groupId>
<artifactId>yamcs</artifactId>
<version>5.8.9-Pixxel.SNAPSHOT-1.5.0</version>
<version>5.8.9-Pixxel.SNAPSHOT-1.6.0</version>
</parent>

<artifactId>simulator</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion tests/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>org.yamcs</groupId>
<artifactId>yamcs</artifactId>
<version>5.8.9-Pixxel.SNAPSHOT-1.5.0</version>
<version>5.8.9-Pixxel.SNAPSHOT-1.6.0</version>
</parent>

<artifactId>tests</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion yamcs-api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>org.yamcs</groupId>
<artifactId>yamcs</artifactId>
<version>5.8.9-Pixxel.SNAPSHOT-1.5.0</version>
<version>5.8.9-Pixxel.SNAPSHOT-1.6.0</version>
</parent>

<artifactId>yamcs-api</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion yamcs-client/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<parent>
<groupId>org.yamcs</groupId>
<artifactId>yamcs</artifactId>
<version>5.8.9-Pixxel.SNAPSHOT-1.5.0</version>
<version>5.8.9-Pixxel.SNAPSHOT-1.6.0</version>
</parent>

<artifactId>yamcs-client</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion yamcs-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<parent>
<groupId>org.yamcs</groupId>
<artifactId>yamcs</artifactId>
<version>5.8.9-Pixxel.SNAPSHOT-1.5.0</version>
<version>5.8.9-Pixxel.SNAPSHOT-1.6.0</version>
</parent>

<artifactId>yamcs-core</artifactId>
Expand Down
6 changes: 4 additions & 2 deletions yamcs-core/src/main/java/org/yamcs/tctm/pus/PusTmManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,16 @@
import org.yamcs.yarch.Tuple;
import org.yamcs.yarch.YarchDatabase;
import org.yamcs.yarch.YarchDatabaseInstance;
import org.yamcs.time.Instant;
import org.yamcs.tctm.pus.services.PusService;
import org.yamcs.tctm.pus.services.PusSink;
import org.yamcs.tctm.pus.services.tm.PusTmCcsdsPacket;
import org.yamcs.tctm.pus.services.tm.one.ServiceOne;
import org.yamcs.tctm.pus.services.tm.two.ServiceTwo;
import org.yamcs.time.Instant;
import org.yamcs.tctm.pus.services.tm.three.ServiceThree;
import org.yamcs.tctm.pus.services.tm.PusTmCcsdsPacket;
import org.yamcs.tctm.pus.services.tm.five.ServiceFive;
import org.yamcs.tctm.pus.services.tm.nine.ServiceNine;
import org.yamcs.tctm.pus.services.tm.thirteen.ServiceThirteen;


public class PusTmManager extends AbstractYamcsService implements StreamSubscriber {
Expand Down Expand Up @@ -121,6 +122,7 @@ private void initializePUSServices() {
pusServices.put(3, new ServiceThree(yamcsInstance, serviceConfig.getConfigOrEmpty("three")));
pusServices.put(5, new ServiceFive(yamcsInstance, serviceConfig.getConfigOrEmpty("five")));
pusServices.put(9, new ServiceNine(yamcsInstance, serviceConfig.getConfigOrEmpty("nine")));
pusServices.put(13, new ServiceThirteen(yamcsInstance, serviceConfig.getConfigOrEmpty("thirteen")));
}

public void acceptTmPacket(TmPacket tmPacket, String tmLinkName, Stream stream) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package org.yamcs.tctm.pus.services.filetransfer.thirteen;

import javax.xml.crypto.Data;

import org.yamcs.YamcsServer;
import org.yamcs.filetransfer.FileTransfer;
import org.yamcs.logging.Log;
Expand Down Expand Up @@ -41,8 +43,8 @@ public class CompletedTransfer implements S13FileTransfer {
static final String COL_CREATION_TIME = "creationTime";
static final String COL_ORIGIN = "origin";
static final String COL_TRANSFER_TYPE = "transferType";

static final String COL_FAILURE_REASON = "failureReason";

static final String SERVER_ID = YamcsServer.getServer().getServerId();

static {
Expand All @@ -63,6 +65,7 @@ public class CompletedTransfer implements S13FileTransfer {
TDEF.addColumn(COL_CREATION_TIME, DataType.TIMESTAMP);
TDEF.addColumn(COL_ORIGIN, DataType.STRING);
TDEF.addColumn(COL_TRANSFER_TYPE, DataType.STRING);
TDEF.addColumn(COL_FAILURE_REASON, DataType.STRING);
}
final Tuple tuple;

Expand Down Expand Up @@ -126,7 +129,7 @@ public String getBucketName() {
public S13TransactionId getTransactionId() {
if (tuple.hasColumn(COL_FILE_TRANSFER_ID)) {
return new S13TransactionId(tuple.getLongColumn(COL_SOURCE_ID), tuple.getLongColumn(COL_FILE_TRANSFER_ID),
tuple.getLongColumn(COL_LARGE_PACKET_TRANSACTION_ID));
tuple.getLongColumn(COL_LARGE_PACKET_TRANSACTION_ID), getDirection());
} else {
return null;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,8 @@ public S13OutgoingTransfer(String yamcsInstance, long initiatorEntityId, long tr
EventProducer eventProducer, TransferMonitor monitor, String transferType,
Map<ConditionCode, FaultHandlingAction> faultHandlerActions) {

super(yamcsInstance, transferId, creationTime, executor, config, makeTransactionId(initiatorEntityId, transferId,
largePacketTransactionId), request.getDestinationId(), eventProducer, monitor, transferType, faultHandlerActions);
super(yamcsInstance, transferId, creationTime, executor, config, makeTransactionId(request.getRemoteId(), transferId, largePacketTransactionId),
request.getRemoteId(), eventProducer, monitor, transferType, faultHandlerActions);
this.request = request;
this.bucket = bucket;
this.origin = ServiceThirteen.origin;
Expand All @@ -102,8 +102,8 @@ public S13OutgoingTransfer(String yamcsInstance, long initiatorEntityId, long tr
lastPacketCmdName = config.getString("lastPacketCmdName", "LastUplinkPart");
}

private static S13TransactionId makeTransactionId(long sourceId, long transferId, long largePacketTransactionId) {
return new S13TransactionId(sourceId, transferId, largePacketTransactionId);
private static S13TransactionId makeTransactionId(long remoteId, long transferId, long largePacketTransactionId) {
return new S13TransactionId(remoteId, transferId, largePacketTransactionId, TransferDirection.UPLOAD);
}

/**
Expand Down Expand Up @@ -141,7 +141,7 @@ private void sendS13Packet() {
complete(ConditionCode.NO_ERROR);

} else { // First Packet
fullyQualifiedCmdName = ServiceThirteen.constructFullyQualifiedCmdName(firstPacketCmdName, request.getDestinationId());
fullyQualifiedCmdName = ServiceThirteen.constructFullyQualifiedCmdName(firstPacketCmdName, request.getRemoteId());
packet = new StartS13UplinkPacket(s13TransactionId, partSequenceNumber, fullyQualifiedCmdName, getFilePart());
sentPackets.add(packet);
try{
Expand All @@ -165,7 +165,7 @@ private void sendS13Packet() {
end = Math.min(offset + maxDataSize, request.getFileLength());
partSequenceNumber++;

fullyQualifiedCmdName = ServiceThirteen.constructFullyQualifiedCmdName(lastPacketCmdName, request.getDestinationId());
fullyQualifiedCmdName = ServiceThirteen.constructFullyQualifiedCmdName(lastPacketCmdName, request.getRemoteId());
packet = new StartS13UplinkPacket(s13TransactionId, partSequenceNumber, fullyQualifiedCmdName, getFilePart());
sentPackets.add(packet);
try {
Expand All @@ -185,7 +185,7 @@ private void sendS13Packet() {
end = Math.min(offset + maxDataSize, request.getFileLength());
partSequenceNumber++;

fullyQualifiedCmdName = ServiceThirteen.constructFullyQualifiedCmdName(intermediatePacketCmdName, request.getDestinationId());
fullyQualifiedCmdName = ServiceThirteen.constructFullyQualifiedCmdName(intermediatePacketCmdName, request.getRemoteId());
packet = new StartS13UplinkPacket(s13TransactionId, partSequenceNumber, fullyQualifiedCmdName, getFilePart());
sentPackets.add(packet);
try {
Expand Down Expand Up @@ -250,9 +250,11 @@ private void handleFault(ConditionCode conditionCode) {
switch (action) {
case ABANDON:
complete(conditionCode);
pushError(conditionCode.toString());
break;
case CANCEL:
cancel(conditionCode);
pushError(conditionCode.toString());
break;
case SUSPEND:
suspend();
Expand All @@ -266,7 +268,6 @@ protected void cancel(ConditionCode conditionCode) {
switch (outTxState) {
case START:
case SENDING_DATA:
reasonForCancellation = conditionCode;
suspended = false; // wake up if sleeping
outTxState = OutTxState.CANCELING;
changeState(TransferState.CANCELLING);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,17 @@
import java.util.Objects;

import org.yamcs.filetransfer.FileTransferId;
import org.yamcs.protobuf.TransferDirection;


public class S13TransactionId extends FileTransferId{
protected long largePacketTransactionId;

public S13TransactionId(long initiatorEntityId, long transferId, long largePacketTransactionId) {
super(initiatorEntityId, transferId);
protected TransferDirection direction;

public S13TransactionId(long remoteId, long transferId, long largePacketTransactionId, TransferDirection direction) {
super(remoteId, transferId);
this.largePacketTransactionId = largePacketTransactionId;
this.direction = direction;
}

public boolean equals(Object o) {
Expand All @@ -24,7 +27,7 @@ public boolean equals(Object o) {
return false;
}
S13TransactionId other = (S13TransactionId) o;
return transferId == other.transferId && initiatorEntityId == other.initiatorEntityId && largePacketTransactionId == other.largePacketTransactionId;
return transferId == other.transferId && initiatorEntityId == other.initiatorEntityId && largePacketTransactionId == other.largePacketTransactionId && direction == other.direction;
}

public long getLargePacketTransactionId() {
Expand All @@ -36,8 +39,12 @@ public int hashCode() {
return Objects.hash(initiatorEntityId, transferId, largePacketTransactionId);
}

public TransferDirection getTransferDirection() {
return direction;
}

@Override
public String toString() {
return initiatorEntityId + "_" + transferId + "_" + largePacketTransactionId;
return "Remote ID: " + initiatorEntityId + "_" + "TransferId: " + transferId + "_" + "LPTId: " + largePacketTransactionId;
}
}
Loading

0 comments on commit 78fc3eb

Please sign in to comment.