| | |
| | | |
| | | option optimize_for = LITE_RUNTIME; |
| | | |
| | | import "google/protobuf/descriptor.proto"; |
| | | import "error_msg.proto"; |
| | | |
| | | package bhome.msg; |
| | | |
| | | |
| | | // message format : header(BHMsgHead) + body(variable types) |
| | | message BHAddress { |
| | |
| | | |
| | | message ProcInfo |
| | | { |
| | | bytes id = 1; |
| | | bytes id = 1; // serial number, maybe managed |
| | | bytes name = 2; |
| | | bytes public_info = 3; |
| | | bytes private_info = 4; |
| | |
| | | bytes topic = 6; // for request route |
| | | } |
| | | |
| | | message BHMsgBody { |
| | | bytes data = 1; |
| | | } |
| | | |
| | | message BHMsg { // deprecated |
| | | bytes msg_id = 1; |
| | | int64 timestamp = 2; |
| | |
| | | |
| | | enum MsgType { |
| | | kMsgTypeInvalid = 0; |
| | | kMsgTypeRequest = 1; |
| | | kMsgTypeReply = 2; |
| | | kMsgTypePublish = 3; |
| | | kMsgTypeSubscribe = 4; |
| | | kMsgTypeUnsubscribe = 5; |
| | | |
| | | kMsgTypeProcQueryTopic = 6; |
| | | kMsgTypeProcQueryTopicReply = 7; |
| | | kMsgTypeProcRegisterTopics = 8; |
| | | kMsgTypeProcHeartbeat = 9; |
| | | kMsgTypeCommonReply = 2; |
| | | |
| | | kMsgTypeRegister= 10; |
| | | // kMsgTypeRegisterReply= 11; |
| | | kMsgTypeHeartbeat = 12; |
| | | // kMsgTypeHeartbeatReply = 13; |
| | | kMsgTypeQueryTopic = 14; |
| | | kMsgTypeQueryTopicReply = 15; |
| | | kMsgTypeRequestTopic = 16; |
| | | kMsgTypeRequestTopicReply = 17; |
| | | |
| | | kMsgTypePublish = 100; |
| | | // kMsgTypePublishReply = 101; |
| | | kMsgTypeSubscribe = 102; |
| | | // kMsgTypeSubscribeReply = 103; |
| | | kMsgTypeUnsubscribe = 104; |
| | | // kMsgTypeUnsubscribeReply = 105; |
| | | |
| | | } |
| | | |
| | | message DataPub { |
| | | message MsgPub { |
| | | bytes topic = 1; |
| | | bytes data = 2; |
| | | } |
| | | |
| | | message DataSub { |
| | | message MsgSub { |
| | | repeated bytes topics = 1; |
| | | } |
| | | |
| | | message DataRequest { |
| | | message MsgCommonReply { |
| | | ErrorMsg errmsg = 1; |
| | | } |
| | | |
| | | message MsgRequestTopic { |
| | | bytes topic = 1; |
| | | bytes data = 2; |
| | | } |
| | | |
| | | message DataReply { |
| | | bytes data = 1; |
| | | message MsgRequestTopicReply { |
| | | ErrorMsg errmsg = 1; |
| | | bytes data = 2; |
| | | } |
| | | |
| | | message DataProcRegister |
| | | message MsgRegister |
| | | { |
| | | ProcInfo proc = 1; |
| | | repeated bytes topics = 2; |
| | | } |
| | | |
| | | message DataProcHeartbeat |
| | | message MsgHeartbeat |
| | | { |
| | | ProcInfo proc = 1; |
| | | } |
| | | |
| | | message DataProcQueryTopic { |
| | | message MsgQueryTopic { |
| | | bytes topic = 1; |
| | | } |
| | | |
| | | message DataProcQueryTopicReply { |
| | | BHAddress address = 1; |
| | | message MsgQueryTopicReply { |
| | | ErrorMsg errmsg = 1; |
| | | BHAddress address = 2; |
| | | } |
| | | |
| | | service TopicRequestReplyService { |
| | | rpc Request (DataRequest) returns (DataReply); |
| | | } |
| | | service TopicRPC { |
| | | rpc Query (MsgQueryTopic) returns (MsgQueryTopicReply); |
| | | rpc Request (MsgRequestTopic) returns (MsgQueryTopicReply); |
| | | } |