syntax = "proto3";

service Antenna {
  rpc GetAntenna(GetAntennaRequest) returns (AntennaReply) {}
  rpc SetAntennaStatus(SetAntennaStatusRequest) returns (AntennaReply) {}
  rpc SetAntennaUse(SetAntennaUseRequest) returns (AntennaReply) {}
  
}

enum Antenna_Status {
  OK = 0;
  SUSPICIOUS = 1;
  BROKEN = 2;
  BEYOND_REPAIR = 3;
  NOT_AVAILABLE = 4;
}

enum Antenna_Use {
  // use antenna only if it's OK or SUSPICIOUS
  AUTO = 0;
  // force antenna to be on, regardless of status
  ON = 1;
  // force antenna to be off, regardless of status
  OFF = 2;
}

message Identifier {
  // e.g. "LBA"
  string antennafield_name = 1;
  // e.g. "LBA00"
  string antenna_name = 2;
}

message SetAntennaStatusRequest {
  Identifier identifier = 1;
  Antenna_Status antenna_status = 2 ;
}

message GetAntennaRequest {
  Identifier identifier = 1;
}

message SetAntennaUseRequest {
  Identifier identifier = 1;
  Antenna_Use antenna_use = 2;
}

message AntennaResult {
  Identifier identifier = 1;
  Antenna_Use antenna_use = 2;
  Antenna_Status antenna_status = 3;
}

message AntennaReply {
  bool success = 1;
  string exception = 2;
  AntennaResult result = 3;
}
