Feat: add Command and Settings definitions

This commit is contained in:
Dorian Zedler 2023-10-15 12:21:25 +02:00
parent 99cb0e6191
commit c2c3f5ce97
Signed by: dorian
GPG key ID: 989DE36109AFA354
3 changed files with 59 additions and 20 deletions

23
Command.proto Normal file
View file

@ -0,0 +1,23 @@
syntax = "proto3";
package ScStw;
message RaceStartCommand {}
message LaneSetDisabledCommand { uint32 laneNumber = 1; }
message LaneSetFallCommand { uint32 laneNumber = 1; }
message RaceResetCommand {}
message RebootCommand {}
message Command {
oneof command {
RaceStartCommand start = 1;
LaneSetDisabledCommand disable = 2;
LaneSetFallCommand fall = 3;
RaceResetCommand reset = 4;
RebootCommand reboot = 5;
}
}

View file

@ -1,20 +0,0 @@
syntax = "proto3";
package ScStw;
message StartCommand {}
message DisableCommand { uint32 laneNumber = 1; }
message FallCommand { uint32 laneNumber = 1; }
message ResetCommand {}
message Command {
oneof Command {
StartCommand start = 1;
DisableCommand disable = 2;
FallCommand fall = 3;
ResetCommand reset = 4;
}
}

36
Settings.proto Normal file
View file

@ -0,0 +1,36 @@
syntax = "proto3";
package ScStw;
message ManualStartProcedureSettings {}
message AutomatedStartProcedureSettings {
bool sayReady = 1;
int32 standstillDurationBeforeReady = 2;
}
message StartProcedureSettings {
oneof startProcedureSettings {
ManualStartProcedureSettings manualStartProcedureSettings = 1;
AutomatedStartProcedureSettings automatedStartProcedureSettings = 2;
}
}
message LaneSettings {
string letter = 1;
bool disable = 2;
}
message SoundSettings { uint32 volume = 1; }
message RaceSettings {
StartProcedureSettings startProcedure = 1;
repeated LaneSettings lanes = 2;
}
message Settings {
// if the settings are stored as default in the flash memory
bool default = 1;
RaceSettings race = 2;
SoundSettings sound = 3;
}