Skip to content

Initiating AD COP-1 service with unlock causes exception in TcSleLink #15

Description

@merose

When using INITIATE AD "With unlock" in Yamcs, a BC frame is sent over the telecommand data link. This command frame has no associated commands. This causes a NullPointerException in TcSleLink.java on line 318, the for (PreparedCommand pc : tf.getCommands()) line in the code below. I believe that should be protected by an if (tf.getCommands() != null).

    private void onCltuRadiated(CltuOk cltuOk) {
        int cltuId = cltuOk.getCltuIdentification().value.intValue();
        CcsdsTime time = CcsdsTime.fromSle(cltuOk.getRadiationStopTime());
        long yamcsTime = TimeEncoding.fromUnixMillisec(time.toJavaMillisec());
        TcTransferFrame tf = pendingFrames.remove(cltuId);
        if (tf == null) {
            log.warn("Received cltu-radiated event for unknown cltuId {}", cltuId);
            return;
        }

        if (tf.isBypass()) {
            ackBypassFrame(tf);
        }

        for (PreparedCommand pc : tf.getCommands()) {
            commandHistoryPublisher.publishAck(pc.getCommandId(), CMDHISTORY_SLE_RADIATED_KEY, yamcsTime, AckStatus.OK,
                    time.toStringPico());
        }

        uplinkReadySemaphore.release();
    }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions