syntax = "proto3";

option csharp_namespace = "GeViScopeBridge.Protos";

package geviscopebridge;

import "common.proto";

// CrossSwitch Service - Video Routing Operations

service CrossSwitchService {
  // Execute cross-switch (route camera to monitor)
  rpc ExecuteCrossSwitch(CrossSwitchRequest) returns (CrossSwitchResponse);

  // Clear monitor (stop displaying video)
  rpc ClearMonitor(ClearMonitorRequest) returns (ClearMonitorResponse);

  // Get current routing state
  rpc GetRoutingState(GetRoutingStateRequest) returns (GetRoutingStateResponse);

  // Check connection health
  rpc HealthCheck(Empty) returns (HealthCheckResponse);
}

message CrossSwitchRequest {
  int32 camera_id = 1;      // Source video input channel
  int32 monitor_id = 2;     // Destination video output channel
  int32 mode = 3;           // Switch mode (0 = normal)
}

message CrossSwitchResponse {
  bool success = 1;
  string message = 2;
  int32 camera_id = 3;
  int32 monitor_id = 4;
  Timestamp executed_at = 5;
}

message ClearMonitorRequest {
  int32 monitor_id = 1;     // Output channel to clear
}

message ClearMonitorResponse {
  bool success = 1;
  string message = 2;
  int32 monitor_id = 3;
  Timestamp executed_at = 4;
}

message GetRoutingStateRequest {
  // No parameters - returns all current routes
}

message GetRoutingStateResponse {
  repeated RouteInfo routes = 1;
  int32 total_routes = 2;
  Timestamp retrieved_at = 3;
}

message RouteInfo {
  int32 camera_id = 1;
  int32 monitor_id = 2;
  string camera_name = 3;
  string monitor_name = 4;
  Timestamp routed_at = 5;
}

message HealthCheckResponse {
  bool is_healthy = 1;
  string sdk_status = 2;          // "connected", "disconnected", "error"
  string geviserver_host = 3;
  Timestamp checked_at = 4;
}
