proto
This commit is contained in:
parent
836917c733
commit
bdae5c0fdf
14
efkamove
Executable file
14
efkamove
Executable file
@ -0,0 +1,14 @@
|
||||
#! /bin/sh
|
||||
|
||||
/usr/local/code/tmp/gpb/bin/protoc-erl -I . -rename msg_name:snake_case -strbin message_pb.proto
|
||||
|
||||
#sed -i '' 's/sdlv_4_info/sdl_v4_info/g' sdlan_pb.hrl
|
||||
#sed -i '' 's/sdlv_6_info/sdl_v6_info/g' sdlan_pb.hrl
|
||||
|
||||
sed -i '' 's/include(\"gpb.hrl\")/include_lib(\"gpb\/include\/gpb.hrl\")/g' message_pb.erl
|
||||
|
||||
#sed -i '' 's/sdlv_4_info/sdl_v4_info/g' sdlan_pb.erl
|
||||
#sed -i '' 's/sdlv_6_info/sdl_v6_info/g' sdlan_pb.erl
|
||||
|
||||
mv message_pb.hrl ./apps/efka/include
|
||||
mv message_pb.erl ./apps/efka/src
|
||||
@ -1,7 +1,5 @@
|
||||
syntax = "proto3";
|
||||
|
||||
import "google/protobuf/any.proto";
|
||||
|
||||
// auth验证请求和应答
|
||||
|
||||
message AuthRequest {
|
||||
@ -27,25 +25,14 @@ message SessionReply {
|
||||
bool a = 1;
|
||||
}
|
||||
|
||||
// 定义单个数据项目
|
||||
message Field {
|
||||
uint32 device_uuid = 1;
|
||||
string key = 2;
|
||||
google.protobuf.Any value = 3;
|
||||
int32 unit = 4;
|
||||
string type = 5;
|
||||
int32 timestamp = 6;
|
||||
string name = 7;
|
||||
string label = 8;
|
||||
}
|
||||
|
||||
// 数据传输
|
||||
message Data {
|
||||
string device_uuid = 1;
|
||||
string service_name = 2;
|
||||
int32 at = 3;
|
||||
map<string, string> tags = 4;
|
||||
repeated Field fields = 5;
|
||||
// 为了数据的灵活性,存储类型无关的二进制流
|
||||
repeated bytes fields = 5;
|
||||
}
|
||||
|
||||
//#{<<"adcode">> => 0,<<"boot_time">> => 18256077,<<"city">> => <<>>,
|
||||
@ -77,22 +64,17 @@ message Ping {
|
||||
repeated int32 disk = 11;
|
||||
repeated int32 memory = 12;
|
||||
// 接口信息的定义: 每个接口的信息, 采用json格式传输,没有办法提前定义
|
||||
repeated string interfaces = 13;
|
||||
repeated bytes interfaces = 13;
|
||||
}
|
||||
|
||||
// Inform消息
|
||||
|
||||
message Inform {
|
||||
message Service {
|
||||
string name = 1;
|
||||
string props = 2;
|
||||
string version = 3;
|
||||
string version_copy = 4;
|
||||
uint32 status = 5;
|
||||
}
|
||||
|
||||
uint32 at = 1;
|
||||
repeated Service services = 2;
|
||||
message ServiceInform {
|
||||
string name = 1;
|
||||
string props = 2;
|
||||
string version = 3;
|
||||
string version_copy = 4;
|
||||
uint32 status = 5;
|
||||
uint32 at = 6;
|
||||
}
|
||||
|
||||
message FeedbackStep {
|
||||
@ -111,19 +93,19 @@ message FeedbackResult {
|
||||
|
||||
message Event {
|
||||
uint32 event_type = 1;
|
||||
map<string, google.protobuf.Any> params = 2;
|
||||
bytes params = 2;
|
||||
}
|
||||
|
||||
message AIEvent {
|
||||
uint32 event_type = 1;
|
||||
map<string, google.protobuf.Any> params = 2;
|
||||
bytes params = 2;
|
||||
}
|
||||
|
||||
// 指令
|
||||
message Directive {
|
||||
string device_uuid = 1;
|
||||
string version = 2;
|
||||
uint32 directive_type = 3;
|
||||
uint32 timeout = 4;
|
||||
map<string, google.protobuf.Any> directive = 5;
|
||||
string device_uuid = 1;
|
||||
string version = 2;
|
||||
uint32 directive_type = 3;
|
||||
uint32 timeout = 4;
|
||||
bytes directive = 5;
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user