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

yamcs.protobuf.cop1.cop1.proto Maven / Gradle / Ivy

There is a newer version: 5.10.9
Show newest version
syntax="proto2";

package yamcs.protobuf.cop1;
option java_package = "org.yamcs.protobuf";
option java_outer_classname = "Cop1Proto";
option java_multiple_files = true;

import "yamcs/api/annotations.proto";
import "google/protobuf/empty.proto";
import "google/protobuf/timestamp.proto";


// Methods for virtual channel TC links that have ``useCop1: true``.
// This service contains methods for setting/getting the configuration and
// performing various operations.
// In addition, a websocket subscription is available that will allow receiving periodically the status.
service Cop1Api {
  option (yamcs.api.label) = "COP-1";

  // Initialize COP-1 in case state is UNITIALIZED
  rpc Initialize(InitializeRequest) returns (google.protobuf.Empty) {
    option (yamcs.api.route) = {
      post: "/api/cop1/{instance}/{link}:initialize"
      body: "*"
    };
  }

  // Resume COP-1 operation in case state is SUSPENDED
  rpc Resume(ResumeRequest) returns (google.protobuf.Empty) {
    option (yamcs.api.route) = {
      post: "/api/cop1/{instance}/{link}:resume"
    };
  }

  // Disable COP-1 operation
  //
  // This causes the sent queue to be purged.
  // All TCs from the wait queue, as well as newly received TCs
  // are sent immediately
  rpc Disable(DisableRequest) returns (google.protobuf.Empty) {
    option (yamcs.api.route) = {
      post: "/api/cop1/{instance}/{link}:disable"
      body: "*"
    };
  }

  // Update configuration settings
  rpc UpdateConfig(UpdateConfigRequest) returns (Cop1Config) {
    option (yamcs.api.route) = {
      patch: "/api/cop1/{instance}/{link}/config"
      body: "cop1Config"
    };
  }

  // Get COP-1 configuration
  rpc GetConfig(GetConfigRequest) returns (Cop1Config) {
    option (yamcs.api.route) = {
      get: "/api/cop1/{instance}/{link}/config"
    };
  }
  
  // Get COP-1 status
  rpc GetStatus(GetStatusRequest) returns (Cop1Status) {
    option (yamcs.api.route) = {
      get: "/api/cop1/{instance}/{link}/status"
    };
  }
  
  // Receive COP-1 status updates
  rpc SubscribeStatus(SubscribeStatusRequest) returns (stream Cop1Status) {
    option (yamcs.api.websocket) = {
      topic: "cop1"
    };
  }
}

enum InitializationType {

  // CLCW will be expected from the remote system and used to initiate the vS
  WITH_CLCW_CHECK = 1;
  
  // Initiate without waiting for CLCW
  WITHOUT_CLCW_CHECK = 2;
   
  // This causes a BC Unlock frame to be sent to the remote system.
  UNLOCK = 3; 
  
  // Initiate AD with set V(R). This will cause a BC frame to be sent to the remote system
  SET_VR = 4;
}

message InitializeRequest {
  // Yamcs instance name.
  optional string instance = 1;
  
  // Link name.
  optional string link = 2;
    
  optional InitializationType type = 3;
	
  // Timeout in milliseconds for initialize with CLCW check
  optional uint64 clcwCheckInitializeTimeout = 4;
	
  //vR value for initialize with set V(R)
  optional uint32 vR = 5;
}

message UpdateConfigRequest {
  // Yamcs instance name.
  optional string instance = 1;
  
  // Link name.
  optional string link = 2;

  optional Cop1Config cop1Config = 3;
}

message GetConfigRequest {
  // Yamcs instance name.
  optional string instance = 1;
  
  // Link name.
  optional string link = 2;
}


message GetStatusRequest {
  // Yamcs instance name.
  optional string instance = 1;

  // Link name.
  optional string link = 2;
}

message ResumeRequest {
  // Yamcs instance name.
  optional string instance = 1;
  
  // Link name.
  optional string link = 2;
}

message DisableRequest {
  // Yamcs instance name.
  optional string instance = 1;
  
  // Link name.
  optional string link = 2;
  	
  // If true, all transmitted frames while COP1 is disabled, have the bypass flag set
  optional bool setBypassAll = 3;
}

enum Cop1State {
  ACTIVE = 1;
  RETRANSMIT_WITHOUT_WAIT = 2;
  RETRANSMIT_WITH_WAIT = 3;
  INITIALIZING_WITHOUT_BC = 4;
  INITIALIZING_WITH_BC = 5;
  UNINITIALIZED = 6;
  SUSPENDED = 7;
}

message Clcw {
  optional google.protobuf.Timestamp receptionTime = 1 ;
  optional bool lockout = 2;
  optional bool wait = 3;
  optional bool retransmit = 4;
  optional uint32 nR = 5;
}

message Cop1Status {
  // Link name for which this status applies. 
  // It is present when this message is sent over the websocket as there might
  // be multiple COP-1 links subscribed
  optional string link = 11;
  
  // If false, all frames are immediately transmitted (i.e. COP-1 is disabled)
  optional bool cop1Active = 1;
  
  // Relevant if cop1Active = false -> set the bypass flag on all outgoing frames 
  optional bool setBypassAll = 2;
  
  // Last received CLCW
  optional Clcw clcw = 3;
  
  // Current state of FOP-1 state machine, only relevant if cop1Active = true
  optional Cop1State state = 4;
  
  // V(S) - Transmitter Frame Sequence Number;
  optional uint32 vS = 5;
  
  // The nR from the previous CLCW
  optional uint32 nnR = 6;
  
  // Number of TC packets in the wait queue
  optional uint32 waitQueueNumTC = 7;
  
  // Number of unacknowledged frames in the sent queue
  optional uint32 sentQueueNumFrames = 8; 
  
  // Number of frames in the out queue (waiting to be picked up by the master chain
  // multiplexer)
  optional uint32 outQueueNumFrames = 9;
  
  // How many times the last frame has been transmitted
  optional uint32 txCount = 10;
}

enum TimeoutType {
  UNINITIALIZE = 0;
  SUSPEND = 1;
}

message Cop1Config {
  optional uint32 vcId = 1;
  
  // If true, the BD frames are sent immediately, without going to the waiting queue
  optional bool bdAbsolutePriority = 3;
  
  // Maximum size of the sent queue (i.e. how many unacknowledged frames can be in the
  // queue before timing out)
  optional uint32 windowWidth = 4;
  
  // What should happen on timeout: go to SUSPEND or go to UNINITIALIZED
  optional TimeoutType timeoutType = 5;
  
  // How many times the frames are transmitted before timing out
  optional uint32 txLimit = 6;
  
  // How many milliseconds to wait between retransmissions
  optional uint64 t1 = 7;
}

message SubscribeStatusRequest {
  // Yamcs instance name.
  optional string instance = 1;
  
  // Link name.
  optional string link = 2;
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy