From bf08205d8d0fd4c1f68f7dcc497657838cb58d82 Mon Sep 17 00:00:00 2001 From: Shuai Zhang Date: Sun, 27 Oct 2019 11:10:51 +0800 Subject: [PATCH] [GeothermalResearchInstitute] Add comments to proto file. --- .../proto/bjdire/v2/service.proto | 29 +++++++++++++++++-- 1 file changed, 27 insertions(+), 2 deletions(-) diff --git a/GeothermalResearchInstitute/proto/bjdire/v2/service.proto b/GeothermalResearchInstitute/proto/bjdire/v2/service.proto index ce16ecc4..fbb2ff4c 100644 --- a/GeothermalResearchInstitute/proto/bjdire/v2/service.proto +++ b/GeothermalResearchInstitute/proto/bjdire/v2/service.proto @@ -23,6 +23,16 @@ message AuthenticateResponse { UserRole role = 2; } +message ConnectRequest {} + +message ConnectResponse { + bytes id = 1; +} + +message HeartbeatRequest {} + +message HeartbeatResponse {} + enum DeviceStatus { DEVICE_STATUS_INVALID = 0; DEVICE_STATUS_HEALTHY = 1; @@ -39,7 +49,7 @@ message Device { } message Metric { - // 采集时间 + // 采集时间, PLC can ignore this field. google.protobuf.Timestamp create_time = 1; // 出水温度(摄氏度) float output_water_celsius_degree = 2; @@ -187,24 +197,39 @@ message UpdateWorkingModeRequest { } service DeviceService { + // Authenticate user. PLC don't need this. rpc Authenticate (AuthenticateRequest) returns (AuthenticateResponse) {} + // Establish connect between Sever & PLC. PLC specific method. + rpc Connect (ConnectRequest) returns (ConnectResponse) {} + + // Heartbeat between Server & PLC. PLC specific method. + rpc Heartbeat (HeartbeatRequest) returns (HeartbeatResponse) {} + + // List known PLCs. PLC don't need this. rpc ListDevices (ListDevicesRequest) returns (ListDevicesResponse) {} - // List metrics, newest first. + // List metrics, newest first. PLC don't need this. rpc ListMetrics (ListMetricsRequest) returns (ListMetricsResponse) {} + // Get current metric for specified PLC. rpc GetMetric (GetMetricRequest) returns (Metric) {} + // Get current switch status for specified PLC. rpc GetSwitch (GetSwitchRequest) returns (Switch) {} + // Update switch status for specified PLC. rpc UpdateSwitch (UpdateSwitchRequest) returns (Switch) {} + // Get running parameter for specified PLC. rpc GetRunningParameter (GetRunningParameterRequest) returns (RunningParameter) {} + // Update running parameter for specified PLC. rpc UpdateRunningParameter (UpdateRunningParameterRequest) returns (RunningParameter) {} + // Get working mode for specified PLC. rpc GetWorkingMode (GetWorkingModeRequest) returns (WorkingMode) {} + // Update working mode for specified PLC. rpc UpdateWorkingMode (UpdateWorkingModeRequest) returns (WorkingMode) {} }