aboutsummaryrefslogtreecommitdiffstats
path: root/protos
diff options
context:
space:
mode:
authorScott Murray <scott.murray@konsulko.com>2023-01-03 00:51:50 -0500
committerScott Murray <scott.murray@konsulko.com>2023-01-19 00:37:11 +0000
commit7f26a2d06410fd3a2768612b9c9daf869778e480 (patch)
tree4dfffa78e14c8eadb42a731ae15cc87137e17723 /protos
parent6191be9c1e4b628f60ccaeabcef2aaa9de00800b (diff)
Repurpose into gRPC servicequillback_17.0.0quillback/17.0.017.0.0
Repurpose repository into a spiritual successor of the previous binding. The backend code is retained behind a new gRPC API defined in protos/radio.proto. The simpler synchronous gRPC API had been used for expediency, this may warrant revisiting to rework into an async or callback API based server instead. As well, authentication has been left until some consensus on an approach can be worked out. Bug-AGL: SPEC-4665 Signed-off-by: Scott Murray <scott.murray@konsulko.com> Change-Id: I28b122ce6e0ecfc7504aa08b90394cb1b9e22976 (cherry picked from commit dd23c157bdba1b25bbb50cdb99a60aa597735f43)
Diffstat (limited to 'protos')
-rw-r--r--protos/radio.proto205
1 files changed, 205 insertions, 0 deletions
diff --git a/protos/radio.proto b/protos/radio.proto
new file mode 100644
index 0000000..c7ee16f
--- /dev/null
+++ b/protos/radio.proto
@@ -0,0 +1,205 @@
+syntax = "proto3";
+
+package automotivegradelinux;
+
+service Radio {
+ rpc GetFrequency(GetFrequencyRequest) returns (GetFrequencyResponse) {}
+ rpc SetFrequency(SetFrequencyRequest) returns (SetFrequencyResponse) {}
+
+ rpc GetBand(GetBandRequest) returns (GetBandResponse) {}
+ rpc SetBand(SetBandRequest) returns (SetBandResponse) {}
+
+ rpc GetBandSupported(GetBandSupportedRequest) returns (GetBandSupportedResponse) {}
+ rpc GetBandParameters(GetBandParametersRequest) returns (GetBandParametersResponse) {}
+
+ rpc GetStereoMode(GetStereoModeRequest) returns (GetStereoModeResponse) {}
+ rpc SetStereoMode(SetStereoModeRequest) returns (SetStereoModeResponse) {}
+
+ rpc Start(StartRequest) returns (StartResponse) {}
+ rpc Stop(StopRequest) returns (StopResponse) {}
+
+ rpc ScanStart(ScanStartRequest) returns (ScanStartResponse) {}
+ rpc ScanStop(ScanStopRequest) returns (ScanStopResponse) {}
+
+ rpc GetRDS(GetRDSRequest) returns (GetRDSResponse) {}
+
+ rpc GetQuality(GetQualityRequest) returns (GetQualityResponse) {}
+
+ rpc SetAlternativeFrequency(SetAlternativeFrequencyRequest) returns (SetAlternativeFrequencyResponse) {}
+
+ rpc GetStatusEvents(StatusRequest) returns (stream StatusResponse) {}
+}
+
+message GetFrequencyRequest {
+}
+
+message GetFrequencyResponse {
+ uint32 frequency = 1;
+}
+
+message SetFrequencyRequest {
+ uint32 frequency = 1;
+}
+
+message SetFrequencyResponse {
+ uint32 frequency = 1;
+}
+
+message GetBandRequest {
+}
+
+enum Band {
+ BAND_UNSPECIFIED = 0;
+ BAND_AM = 1;
+ BAND_FM = 2;
+ BAND_DBS = 3;
+}
+
+message GetBandResponse {
+ Band band = 1;
+}
+
+message SetBandRequest {
+ Band band = 1;
+}
+
+message SetBandResponse {
+ Band band = 1;
+}
+
+message GetBandSupportedRequest {
+ Band band = 1;
+}
+
+message GetBandSupportedResponse {
+ bool supported = 1;
+}
+
+message GetBandParametersRequest {
+ Band band = 1;
+}
+
+message GetBandParametersResponse {
+ uint32 min = 1;
+ uint32 max = 2;
+ uint32 step = 3;
+}
+
+enum StereoMode {
+ STEREO_MODE_UNSPECIFIED = 0;
+ STEREO_MODE_MONO = 1;
+ STEREO_MODE_STEREO = 2;
+}
+
+message GetStereoModeRequest {
+}
+
+message GetStereoModeResponse {
+ StereoMode mode = 1;
+}
+
+message SetStereoModeRequest {
+ StereoMode mode = 1;
+}
+
+message SetStereoModeResponse {
+ StereoMode mode = 1;
+}
+
+message StartRequest {
+}
+
+message StartResponse {
+}
+
+message StopRequest {
+}
+
+message StopResponse {
+}
+
+enum ScanDirection {
+ SCAN_DIRECTION_UNSPECIFIED = 0;
+ SCAN_DIRECTION_FORWARD = 1;
+ SCAN_DIRECTION_BACKWARD = 2;
+}
+
+message ScanStartRequest {
+ ScanDirection direction = 1;
+}
+
+message ScanStartResponse {
+}
+
+message ScanStopRequest {
+}
+
+message ScanStopResponse {
+}
+
+message GetRDSRequest {
+}
+
+// NOTE: This is a placeholder and will be revised!
+message GetRDSResponse {
+ string name = 1;
+ string radio_text = 2;
+ string alternatives = 3;
+ string minute = 4;
+ string hour = 5;
+ string day = 6;
+ string month = 7;
+ string year = 8;
+ string pi = 9;
+ string pty = 10;
+ string ta = 11;
+ string tp = 12;
+ string ms = 13;
+}
+
+message GetQualityRequest {
+}
+
+message GetQualityResponse {
+}
+
+message SetAlternativeFrequencyRequest {
+ uint32 frequency = 1;
+}
+
+message SetAlternativeFrequencyResponse {
+ uint32 frequency = 1;
+}
+
+message StatusRequest {
+}
+
+message BandStatus {
+ Band band = 1;
+}
+
+message FrequencyStatus {
+ uint32 frequency = 1;
+}
+
+message PlayStatus {
+ bool playing = 1;
+}
+
+message ScanStatus {
+ bool station_found = 1;
+}
+
+message StereoStatus {
+ StereoMode mode = 1;
+}
+
+message StatusResponse {
+ oneof status {
+ BandStatus band = 1;
+ FrequencyStatus frequency = 2;
+ PlayStatus play = 3;
+ StereoStatus stereo = 4;
+ ScanStatus scan = 5;
+ }
+}