syntax = "proto3";

package autd3;

import "autd3.proto";
import "utils.proto";
import "utils-lightweight.proto";
import "gain.proto";
import "modulation.proto";
import "datagram.proto";

message DatagramLightweight {
  oneof datagram {
    Silencer silencer = 1;
    Modulation modulation = 2;
    Gain gain = 3;
    Clear clear = 4;
    Synchronize synchronize = 5;
    ForceFan force_fan = 6;
    ReadsFPGAState reads_fpga_state = 8;
    FociSTM foci_stm = 10;
    GainSTM gain_stm = 11;
    SwapSegment swap_segment = 12;
  }
}

message SendResponseLightweight {
  bool success = 1;
  bool err = 2;
  string msg = 3;
}

message FirmwareVersionRequestLightweight {}
message FirmwareVersionResponseLightweight {
  message FirmwareVersion {
    uint32 fpga_major_version = 1;
    uint32 fpga_minor_version = 2;
    uint32 cpu_major_version = 3;
    uint32 cpu_minor_version = 4;
    uint32 fpga_function_bits = 5;
  }
  bool success = 1;
  string msg = 2;
  repeated FirmwareVersion firmware_version_list = 3;
}

message CloseRequestLightweight {}

service ECATLight {
  rpc ConfigGeomety(Geometry) returns (SendResponseLightweight) {}
  rpc FirmwareVersion(FirmwareVersionRequestLightweight) returns (FirmwareVersionResponseLightweight) {}
  rpc Send(DatagramLightweight) returns (SendResponseLightweight) {}
  rpc Close(CloseRequestLightweight) returns (SendResponseLightweight) {}
}
