This commit is contained in:
anlicheng 2025-04-21 15:57:15 +08:00
parent 836917c733
commit bdae5c0fdf
2 changed files with 31 additions and 35 deletions

14
efkamove Executable file
View 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

View File

@ -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;
}