80 lines
1.5 KiB
Protocol Buffer
80 lines
1.5 KiB
Protocol Buffer
syntax = "proto3";
|
|
|
|
package api;
|
|
option go_package = "remote-shack/api";
|
|
|
|
|
|
service AuthService {
|
|
rpc Login(LoginRequest) returns (LoginResponse);
|
|
}
|
|
|
|
service RigService {
|
|
rpc OperatorSession(stream RigCommand) returns (stream RigStatus);
|
|
rpc MonitorSession(Empty) returns (stream RigStatus);
|
|
}
|
|
|
|
service RotorService {
|
|
rpc TargetPosition(RotorTarget) returns (Empty);
|
|
rpc LivePosition(Empty) returns (stream RotorStatus);
|
|
}
|
|
|
|
service RelaisService {
|
|
rpc SetRelais(RelaisRequest) returns (RelaisResponse);
|
|
rpc GetRelaisState(Empty) returns (RelaisResponse);
|
|
}
|
|
|
|
message Empty {}
|
|
|
|
message LoginRequest {
|
|
string username = 1;
|
|
}
|
|
|
|
message LoginResponse {
|
|
string token = 1;
|
|
}
|
|
|
|
message RigCommand {
|
|
int64 frequency_hz = 1;
|
|
string mode = 2;
|
|
bool ptt = 3;
|
|
}
|
|
|
|
message RigStatus {
|
|
int64 frequency_hz = 1;
|
|
string mode = 2;
|
|
int32 s_meter = 3;
|
|
int32 power_meter = 4;
|
|
string active_operator_name = 5;
|
|
}
|
|
|
|
message RotorTarget {
|
|
double azimuth = 1;
|
|
double elevation = 2;
|
|
}
|
|
|
|
message RotorStatus {
|
|
double azimuth_is = 1;
|
|
double elevation_is = 2;
|
|
}
|
|
|
|
message RelaisRequest {
|
|
int32 pin = 1;
|
|
bool state = 2;
|
|
}
|
|
|
|
message RelaisResponse {
|
|
map<int32, bool> pins = 1;
|
|
}
|
|
service TelemetryService {
|
|
rpc StreamVoltages (Empty) returns (stream VoltageResponse);
|
|
}
|
|
|
|
message ChannelReading {
|
|
float voltage = 1;
|
|
string label = 2;
|
|
}
|
|
|
|
message VoltageResponse {
|
|
// Map von globaler Kanal-ID (1..16) auf den kombinierten Messwert
|
|
map<int32, ChannelReading> channels = 1;
|
|
}
|