简易版代码
This commit is contained in:
32
proto/client.proto
Normal file
32
proto/client.proto
Normal file
@@ -0,0 +1,32 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package device;
|
||||
|
||||
import "google/protobuf/any.proto";
|
||||
|
||||
option go_package = "internal/app/service/device/proto";
|
||||
|
||||
// 指令类型
|
||||
enum MethodType{
|
||||
SWITCH = 0; // 启停
|
||||
COLLECT = 1; // 采集
|
||||
}
|
||||
|
||||
// 指令
|
||||
message Instruction{
|
||||
MethodType method = 1;
|
||||
google.protobuf.Any data = 2;
|
||||
}
|
||||
|
||||
message Switch{
|
||||
string device_action = 1; // 指令
|
||||
int32 bus_number = 2; // 总线号
|
||||
int32 bus_address = 3; // 总线地址
|
||||
int32 relay_channel = 4; // 继电器通道号
|
||||
}
|
||||
|
||||
message Collect{
|
||||
int32 bus_number = 1; // 总线号
|
||||
int32 bus_address = 2; // 总线地址
|
||||
float value = 3; // 采集值
|
||||
}
|
||||
Reference in New Issue
Block a user