Iterate

Change-Id: I4bb46671ec094eefd03c11a79d8648adfaab1b7a
Reviewed-on: https://chromium-review.googlesource.com/c/rte-services-proto/+/1918631
Reviewed-by: Allen Li <ayatane@chromium.org>
Tested-by: Allen Li <ayatane@chromium.org>
diff --git a/service.proto b/service.proto
index c070282..820553a 100644
--- a/service.proto
+++ b/service.proto
@@ -12,14 +12,18 @@
   // Runs a shell command with the default shell.
   // Does not spawn a tty.
   rpc DutShell(DutShellRequest) returns (stream DutShellResponse);
-  // XXX RPM
-  // XXX Device/lab config
+
+  rpc GetDeviceConfig(GetDeviceConfigRequest) returns (GetDeviceConfigResponse);
+  rpc GetDeviceState(GetDeviceStateRequest) returns (GetDeviceStateResponse);
+  rpc SetDeviceState(SetDeviceStateRequest) returns (SetDeviceStateResponse);
+
+  rpc AvailableServices(AvailableServicesRequest) returns (AvailableServicesResponse);
 }
 
 message RepairRequest {}
 message RepairResponse {
   enum Status {
-    STATUS_INVALID = 0;
+    STATUS_UNKNOWN = 0;
     STATUS_OK = 1;
     STATUS_REPAIRED = 2;
     STATUS_FAILED = 3;
@@ -29,11 +33,11 @@
 }
 
 message ProvisionRequest {
-  string image_name = 1;
+  Image image = 1;
 }
 message ProvisionResponse {
   enum Status {
-    STATUS_INVALID = 0;
+    STATUS_UNKNOWN = 0;
     STATUS_OK = 1;
     STATUS_FAIL_DUT_ALREADY_BAD = 2;
     STATUS_FAIL_DOWNLOAD_IMAGE = 3;
@@ -45,6 +49,8 @@
   string explanation = 2;
 }
 
+message Image {}
+
 message DutShellRequest {
   string command = 1;
 }
@@ -56,3 +62,31 @@
   bool exited = 2;
   bytes output = 3;
 }
+
+message GetDeviceConfigRequest {}
+message GetDeviceConfigResponse {}
+
+message GetDeviceStateRequest {}
+message GetDeviceStateResponse {}
+
+message SetDeviceStateRequest {}
+message SetDeviceStateResponse {}
+
+message DeviceState {
+  Image installed_image = 1;
+  enum State {
+    STATE_NEEDS_REPAIR = 0;
+  }
+  State state = 2;
+}
+
+message AvailableServicesRequest {}
+message AvailableServicesResponse {
+  enum Service {
+    SERVICE_UNKNOWN = 0;
+    SERVICE_SERVO = 1;
+    SERVICE_RPM = 2;
+    SERVICE_CHAMELEON = 3;
+  }
+  repeated Service service = 1;
+}
diff --git a/servo.proto b/servo.proto
index 7812fd4..69be0ca 100644
--- a/servo.proto
+++ b/servo.proto
@@ -6,7 +6,30 @@
 
 package rte;
 
-service Servo {
-  // rpc EnableRecoveryMode(EnableRecoveryModeRequest) returns (EnableRecoveryModeResponse);
-  // rpc DisableRecoveryMode(DisableRecoveryModeRequest) returns (DisableRecoveryModeResponse);
+service Servo {}
+
+service RPM {
+  rpc SetRpm(SetRpmRequest) returns (SetRpmResponse);
 }
+
+message SetRpmRequest {
+  enum State {
+    STATE_UNKNOWN = 0;
+    STATE_ON = 1;
+    STATE_OFF = 2;
+    STATE_CYCLE = 3;
+  }
+  State state = 1;
+}
+message SetRpmResponse {
+  enum Status {
+    STATUS_UNKNOWN = 0;
+    STATUS_OK = 1;
+    STATUS_UNSUPPORTED = 2;
+    STATUS_TIMEOUT = 3;
+  }
+  Status status = 1;
+  string explanation = 2;
+}
+
+service Chameleon {}