Explorar o código

增加消息类型定义

zx %!s(int64=5) %!d(string=hai) anos
pai
achega
8c6491f3b3

+ 1 - 1
CMakeLists.txt

@@ -23,7 +23,7 @@ aux_source_directory(${CMAKE_CURRENT_LIST_DIR}/message message_src )
 aux_source_directory(${CMAKE_CURRENT_LIST_DIR}/lidar_locate locate_src )
 aux_source_directory(${CMAKE_CURRENT_LIST_DIR}/robot robot_src )
 
-add_executable(terminal main.cpp ./error_code/error_code.cpp ./nnxx/nnxx_client.cpp
+add_executable(terminal main.cpp ./error_code/error_code.cpp ./nnxx/nnxx_client.cpp setting.pb.cc
         ${locate_src} ${robot_src} ${message_src})
 target_link_libraries(terminal nnxx nanomsg ${PROTOBUF_LIBRARIES}
         /usr/local/lib/libglog.a

+ 1 - 0
lidar_locate/Locate_communicator.cpp

@@ -29,6 +29,7 @@ Error_manager Locate_communicator::locate_request(message::Locate_request_msg re
     {
         //解析返回数据
         message::Locate_response_msg response;
+
         if(false==response.ParseFromString(response_string))
         {
             //解析response数据错误,

+ 1 - 0
lidar_locate/Locate_communicator.h

@@ -8,6 +8,7 @@
 #include <mutex>
 #include "nnxx_client.h"
 #include "locate_message.pb.h"
+
 class Locate_communicator {
 public:
     virtual ~Locate_communicator();

+ 5 - 2
main.cpp

@@ -23,6 +23,7 @@ bool read_proto_param(std::string file, ::google::protobuf::Message& parameter)
     int fd = open(file.c_str(), O_RDONLY);
     if (fd == -1) return false;
     FileInputStream* input = new FileInputStream(fd);
+
     bool success = google::protobuf::TextFormat::Parse(input, &parameter);
     delete input;
     close(fd);
@@ -32,7 +33,8 @@ bool read_proto_param(std::string file, ::google::protobuf::Message& parameter)
 int main(int argc,char* argv[])
 {
     //读取配置
-    global::setting parameter;
+    setting::global_setting parameter;
+
     if(false==read_proto_param("",parameter))
     {
         LOG(ERROR)<<"read setting file failed";
@@ -40,7 +42,7 @@ int main(int argc,char* argv[])
     }
 
     //创建各个模块的通讯对象
-    global::locate_setting locate_parameter=parameter.locate_parameter();
+    setting::locate_setting locate_parameter=parameter.locate_parameter();
     Error_manager code=Locate_communicator::create_locate_communicator(locate_parameter.ip(),locate_parameter.port());
     if(code!=SUCCESS)
     {
@@ -50,6 +52,7 @@ int main(int argc,char* argv[])
     message::Command_message cmd_msg;
     message::Locate_request_msg request;
     message::Locate_response_msg result;
+
     code=Locate_communicator::get_instance()->locate_request(request,result);
     if(code!=SUCCESS)
     {

+ 270 - 89
message/hardware_message.pb.cc

@@ -192,9 +192,11 @@ const ::google::protobuf::uint32 TableStruct::offsets[] GOOGLE_PROTOBUF_ATTRIBUT
   ~0u,  // no _extensions_
   ~0u,  // no _oneof_case_
   ~0u,  // no _weak_field_map_
+  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::message::Harware_statu_msg, msg_type_),
   GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::message::Harware_statu_msg, carrier1_statu_),
   GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::message::Harware_statu_msg, carrier2_statu_),
   GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::message::Harware_statu_msg, carrier3_statu_),
+  3,
   0,
   1,
   2,
@@ -203,18 +205,22 @@ const ::google::protobuf::uint32 TableStruct::offsets[] GOOGLE_PROTOBUF_ATTRIBUT
   ~0u,  // no _extensions_
   ~0u,  // no _oneof_case_
   ~0u,  // no _weak_field_map_
+  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::message::Execute_request_msg, msg_type_),
   GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::message::Execute_request_msg, cmd_msg_),
   GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::message::Execute_request_msg, time_out_),
-  0,
   1,
+  0,
+  2,
   GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::message::Execute_response_msg, _has_bits_),
   GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::message::Execute_response_msg, _internal_metadata_),
   ~0u,  // no _extensions_
   ~0u,  // no _oneof_case_
   ~0u,  // no _weak_field_map_
+  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::message::Execute_response_msg, msg_type_),
   GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::message::Execute_response_msg, cmd_msg_),
   GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::message::Execute_response_msg, error_code_),
   GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::message::Execute_response_msg, error_description_),
+  3,
   1,
   2,
   0,
@@ -222,9 +228,9 @@ const ::google::protobuf::uint32 TableStruct::offsets[] GOOGLE_PROTOBUF_ATTRIBUT
 static const ::google::protobuf::internal::MigrationSchema schemas[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = {
   { 0, 8, sizeof(::message::Position)},
   { 11, 21, sizeof(::message::Carrier_status)},
-  { 26, 34, sizeof(::message::Harware_statu_msg)},
-  { 37, 44, sizeof(::message::Execute_request_msg)},
-  { 46, 54, sizeof(::message::Execute_response_msg)},
+  { 26, 35, sizeof(::message::Harware_statu_msg)},
+  { 39, 47, sizeof(::message::Execute_request_msg)},
+  { 50, 59, sizeof(::message::Execute_response_msg)},
 };
 
 static ::google::protobuf::Message const * const file_default_instances[] = {
@@ -264,20 +270,24 @@ void AddDescriptorsImpl() {
       "\007cmd_msg\030\002 \001(\0132\030.message.Command_message"
       "\022\031\n\021error_destination\030\003 \001(\t\022#\n\010position\030"
       "\004 \001(\0132\021.message.Position\022\r\n\005empty\030\005 \002(\010\""
-      "\246\001\n\021Harware_statu_msg\022/\n\016carrier1_statu\030"
-      "\001 \002(\0132\027.message.Carrier_status\022/\n\016carrie"
-      "r2_statu\030\002 \002(\0132\027.message.Carrier_status\022"
-      "/\n\016carrier3_statu\030\003 \002(\0132\027.message.Carrie"
-      "r_status\"Z\n\023Execute_request_msg\022)\n\007cmd_m"
-      "sg\030\001 \002(\0132\030.message.Command_message\022\030\n\010ti"
-      "me_out\030\003 \001(\005:\006200000\"p\n\024Execute_response"
-      "_msg\022)\n\007cmd_msg\030\001 \002(\0132\030.message.Command_"
-      "message\022\022\n\nerror_code\030\002 \002(\005\022\031\n\021error_des"
-      "cription\030\003 \001(\t*\?\n\016Hardware_statu\022\013\n\007eNor"
-      "mal\020\000\022\t\n\005eBusy\020\001\022\t\n\005eMiss\020\002\022\n\n\006eError\020\003"
+      "\317\001\n\021Harware_statu_msg\022\'\n\010msg_type\030\001 \002(\0162"
+      "\025.message.Message_type\022/\n\016carrier1_statu"
+      "\030\002 \002(\0132\027.message.Carrier_status\022/\n\016carri"
+      "er2_statu\030\003 \002(\0132\027.message.Carrier_status"
+      "\022/\n\016carrier3_statu\030\004 \002(\0132\027.message.Carri"
+      "er_status\"\203\001\n\023Execute_request_msg\022\'\n\010msg"
+      "_type\030\001 \002(\0162\025.message.Message_type\022)\n\007cm"
+      "d_msg\030\002 \002(\0132\030.message.Command_message\022\030\n"
+      "\010time_out\030\003 \001(\005:\006200000\"\231\001\n\024Execute_resp"
+      "onse_msg\022\'\n\010msg_type\030\001 \002(\0162\025.message.Mes"
+      "sage_type\022)\n\007cmd_msg\030\002 \002(\0132\030.message.Com"
+      "mand_message\022\022\n\nerror_code\030\003 \002(\005\022\031\n\021erro"
+      "r_description\030\004 \001(\t*\?\n\016Hardware_statu\022\013\n"
+      "\007eNormal\020\000\022\t\n\005eBusy\020\001\022\t\n\005eMiss\020\002\022\n\n\006eErr"
+      "or\020\003"
   };
   ::google::protobuf::DescriptorPool::InternalAddGeneratedFile(
-      descriptor, 719);
+      descriptor, 844);
   ::google::protobuf::MessageFactory::InternalRegisterGeneratedFile(
     "hardware_message.proto", &protobuf_RegisterTypes);
   ::protobuf_message_5fbase_2eproto::AddDescriptors();
@@ -1152,6 +1162,7 @@ void Harware_statu_msg::InitAsDefaultInstance() {
       ::message::Carrier_status::internal_default_instance());
 }
 #if !defined(_MSC_VER) || _MSC_VER >= 1900
+const int Harware_statu_msg::kMsgTypeFieldNumber;
 const int Harware_statu_msg::kCarrier1StatuFieldNumber;
 const int Harware_statu_msg::kCarrier2StatuFieldNumber;
 const int Harware_statu_msg::kCarrier3StatuFieldNumber;
@@ -1186,6 +1197,7 @@ Harware_statu_msg::Harware_statu_msg(const Harware_statu_msg& from)
   } else {
     carrier3_statu_ = NULL;
   }
+  msg_type_ = from.msg_type_;
   // @@protoc_insertion_point(copy_constructor:message.Harware_statu_msg)
 }
 
@@ -1194,6 +1206,7 @@ void Harware_statu_msg::SharedCtor() {
   ::memset(&carrier1_statu_, 0, static_cast<size_t>(
       reinterpret_cast<char*>(&carrier3_statu_) -
       reinterpret_cast<char*>(&carrier1_statu_)) + sizeof(carrier3_statu_));
+  msg_type_ = 1;
 }
 
 Harware_statu_msg::~Harware_statu_msg() {
@@ -1237,7 +1250,7 @@ void Harware_statu_msg::Clear() {
   (void) cached_has_bits;
 
   cached_has_bits = _has_bits_[0];
-  if (cached_has_bits & 7u) {
+  if (cached_has_bits & 15u) {
     if (cached_has_bits & 0x00000001u) {
       GOOGLE_DCHECK(carrier1_statu_ != NULL);
       carrier1_statu_->Clear();
@@ -1250,6 +1263,7 @@ void Harware_statu_msg::Clear() {
       GOOGLE_DCHECK(carrier3_statu_ != NULL);
       carrier3_statu_->Clear();
     }
+    msg_type_ = 1;
   }
   _has_bits_.Clear();
   _internal_metadata_.Clear();
@@ -1265,34 +1279,54 @@ bool Harware_statu_msg::MergePartialFromCodedStream(
     tag = p.first;
     if (!p.second) goto handle_unusual;
     switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
-      // required .message.Carrier_status carrier1_statu = 1;
+      // required .message.Message_type msg_type = 1;
       case 1: {
         if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(
-               input, mutable_carrier1_statu()));
+            static_cast< ::google::protobuf::uint8>(8u /* 8 & 0xFF */)) {
+          int value;
+          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
+                   int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>(
+                 input, &value)));
+          if (::message::Message_type_IsValid(value)) {
+            set_msg_type(static_cast< ::message::Message_type >(value));
+          } else {
+            mutable_unknown_fields()->AddVarint(
+                1, static_cast< ::google::protobuf::uint64>(value));
+          }
         } else {
           goto handle_unusual;
         }
         break;
       }
 
-      // required .message.Carrier_status carrier2_statu = 2;
+      // required .message.Carrier_status carrier1_statu = 2;
       case 2: {
         if (static_cast< ::google::protobuf::uint8>(tag) ==
             static_cast< ::google::protobuf::uint8>(18u /* 18 & 0xFF */)) {
           DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(
-               input, mutable_carrier2_statu()));
+               input, mutable_carrier1_statu()));
         } else {
           goto handle_unusual;
         }
         break;
       }
 
-      // required .message.Carrier_status carrier3_statu = 3;
+      // required .message.Carrier_status carrier2_statu = 3;
       case 3: {
         if (static_cast< ::google::protobuf::uint8>(tag) ==
             static_cast< ::google::protobuf::uint8>(26u /* 26 & 0xFF */)) {
+          DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(
+               input, mutable_carrier2_statu()));
+        } else {
+          goto handle_unusual;
+        }
+        break;
+      }
+
+      // required .message.Carrier_status carrier3_statu = 4;
+      case 4: {
+        if (static_cast< ::google::protobuf::uint8>(tag) ==
+            static_cast< ::google::protobuf::uint8>(34u /* 34 & 0xFF */)) {
           DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(
                input, mutable_carrier3_statu()));
         } else {
@@ -1328,22 +1362,28 @@ void Harware_statu_msg::SerializeWithCachedSizes(
   (void) cached_has_bits;
 
   cached_has_bits = _has_bits_[0];
-  // required .message.Carrier_status carrier1_statu = 1;
+  // required .message.Message_type msg_type = 1;
+  if (cached_has_bits & 0x00000008u) {
+    ::google::protobuf::internal::WireFormatLite::WriteEnum(
+      1, this->msg_type(), output);
+  }
+
+  // required .message.Carrier_status carrier1_statu = 2;
   if (cached_has_bits & 0x00000001u) {
     ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
-      1, *this->carrier1_statu_, output);
+      2, *this->carrier1_statu_, output);
   }
 
-  // required .message.Carrier_status carrier2_statu = 2;
+  // required .message.Carrier_status carrier2_statu = 3;
   if (cached_has_bits & 0x00000002u) {
     ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
-      2, *this->carrier2_statu_, output);
+      3, *this->carrier2_statu_, output);
   }
 
-  // required .message.Carrier_status carrier3_statu = 3;
+  // required .message.Carrier_status carrier3_statu = 4;
   if (cached_has_bits & 0x00000004u) {
     ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
-      3, *this->carrier3_statu_, output);
+      4, *this->carrier3_statu_, output);
   }
 
   if (_internal_metadata_.have_unknown_fields()) {
@@ -1361,25 +1401,31 @@ void Harware_statu_msg::SerializeWithCachedSizes(
   (void) cached_has_bits;
 
   cached_has_bits = _has_bits_[0];
-  // required .message.Carrier_status carrier1_statu = 1;
+  // required .message.Message_type msg_type = 1;
+  if (cached_has_bits & 0x00000008u) {
+    target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray(
+      1, this->msg_type(), target);
+  }
+
+  // required .message.Carrier_status carrier1_statu = 2;
   if (cached_has_bits & 0x00000001u) {
     target = ::google::protobuf::internal::WireFormatLite::
       InternalWriteMessageToArray(
-        1, *this->carrier1_statu_, deterministic, target);
+        2, *this->carrier1_statu_, deterministic, target);
   }
 
-  // required .message.Carrier_status carrier2_statu = 2;
+  // required .message.Carrier_status carrier2_statu = 3;
   if (cached_has_bits & 0x00000002u) {
     target = ::google::protobuf::internal::WireFormatLite::
       InternalWriteMessageToArray(
-        2, *this->carrier2_statu_, deterministic, target);
+        3, *this->carrier2_statu_, deterministic, target);
   }
 
-  // required .message.Carrier_status carrier3_statu = 3;
+  // required .message.Carrier_status carrier3_statu = 4;
   if (cached_has_bits & 0x00000004u) {
     target = ::google::protobuf::internal::WireFormatLite::
       InternalWriteMessageToArray(
-        3, *this->carrier3_statu_, deterministic, target);
+        4, *this->carrier3_statu_, deterministic, target);
   }
 
   if (_internal_metadata_.have_unknown_fields()) {
@@ -1395,26 +1441,32 @@ size_t Harware_statu_msg::RequiredFieldsByteSizeFallback() const {
   size_t total_size = 0;
 
   if (has_carrier1_statu()) {
-    // required .message.Carrier_status carrier1_statu = 1;
+    // required .message.Carrier_status carrier1_statu = 2;
     total_size += 1 +
       ::google::protobuf::internal::WireFormatLite::MessageSize(
         *this->carrier1_statu_);
   }
 
   if (has_carrier2_statu()) {
-    // required .message.Carrier_status carrier2_statu = 2;
+    // required .message.Carrier_status carrier2_statu = 3;
     total_size += 1 +
       ::google::protobuf::internal::WireFormatLite::MessageSize(
         *this->carrier2_statu_);
   }
 
   if (has_carrier3_statu()) {
-    // required .message.Carrier_status carrier3_statu = 3;
+    // required .message.Carrier_status carrier3_statu = 4;
     total_size += 1 +
       ::google::protobuf::internal::WireFormatLite::MessageSize(
         *this->carrier3_statu_);
   }
 
+  if (has_msg_type()) {
+    // required .message.Message_type msg_type = 1;
+    total_size += 1 +
+      ::google::protobuf::internal::WireFormatLite::EnumSize(this->msg_type());
+  }
+
   return total_size;
 }
 size_t Harware_statu_msg::ByteSizeLong() const {
@@ -1426,22 +1478,26 @@ size_t Harware_statu_msg::ByteSizeLong() const {
       ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
         _internal_metadata_.unknown_fields());
   }
-  if (((_has_bits_[0] & 0x00000007) ^ 0x00000007) == 0) {  // All required fields are present.
-    // required .message.Carrier_status carrier1_statu = 1;
+  if (((_has_bits_[0] & 0x0000000f) ^ 0x0000000f) == 0) {  // All required fields are present.
+    // required .message.Carrier_status carrier1_statu = 2;
     total_size += 1 +
       ::google::protobuf::internal::WireFormatLite::MessageSize(
         *this->carrier1_statu_);
 
-    // required .message.Carrier_status carrier2_statu = 2;
+    // required .message.Carrier_status carrier2_statu = 3;
     total_size += 1 +
       ::google::protobuf::internal::WireFormatLite::MessageSize(
         *this->carrier2_statu_);
 
-    // required .message.Carrier_status carrier3_statu = 3;
+    // required .message.Carrier_status carrier3_statu = 4;
     total_size += 1 +
       ::google::protobuf::internal::WireFormatLite::MessageSize(
         *this->carrier3_statu_);
 
+    // required .message.Message_type msg_type = 1;
+    total_size += 1 +
+      ::google::protobuf::internal::WireFormatLite::EnumSize(this->msg_type());
+
   } else {
     total_size += RequiredFieldsByteSizeFallback();
   }
@@ -1475,7 +1531,7 @@ void Harware_statu_msg::MergeFrom(const Harware_statu_msg& from) {
   (void) cached_has_bits;
 
   cached_has_bits = from._has_bits_[0];
-  if (cached_has_bits & 7u) {
+  if (cached_has_bits & 15u) {
     if (cached_has_bits & 0x00000001u) {
       mutable_carrier1_statu()->::message::Carrier_status::MergeFrom(from.carrier1_statu());
     }
@@ -1485,6 +1541,10 @@ void Harware_statu_msg::MergeFrom(const Harware_statu_msg& from) {
     if (cached_has_bits & 0x00000004u) {
       mutable_carrier3_statu()->::message::Carrier_status::MergeFrom(from.carrier3_statu());
     }
+    if (cached_has_bits & 0x00000008u) {
+      msg_type_ = from.msg_type_;
+    }
+    _has_bits_[0] |= cached_has_bits;
   }
 }
 
@@ -1503,7 +1563,7 @@ void Harware_statu_msg::CopyFrom(const Harware_statu_msg& from) {
 }
 
 bool Harware_statu_msg::IsInitialized() const {
-  if ((_has_bits_[0] & 0x00000007) != 0x00000007) return false;
+  if ((_has_bits_[0] & 0x0000000f) != 0x0000000f) return false;
   if (has_carrier1_statu()) {
     if (!this->carrier1_statu_->IsInitialized()) return false;
   }
@@ -1525,6 +1585,7 @@ void Harware_statu_msg::InternalSwap(Harware_statu_msg* other) {
   swap(carrier1_statu_, other->carrier1_statu_);
   swap(carrier2_statu_, other->carrier2_statu_);
   swap(carrier3_statu_, other->carrier3_statu_);
+  swap(msg_type_, other->msg_type_);
   swap(_has_bits_[0], other->_has_bits_[0]);
   _internal_metadata_.Swap(&other->_internal_metadata_);
   swap(_cached_size_, other->_cached_size_);
@@ -1547,6 +1608,7 @@ void Execute_request_msg::clear_cmd_msg() {
   clear_has_cmd_msg();
 }
 #if !defined(_MSC_VER) || _MSC_VER >= 1900
+const int Execute_request_msg::kMsgTypeFieldNumber;
 const int Execute_request_msg::kCmdMsgFieldNumber;
 const int Execute_request_msg::kTimeOutFieldNumber;
 #endif  // !defined(_MSC_VER) || _MSC_VER >= 1900
@@ -1570,13 +1632,16 @@ Execute_request_msg::Execute_request_msg(const Execute_request_msg& from)
   } else {
     cmd_msg_ = NULL;
   }
-  time_out_ = from.time_out_;
+  ::memcpy(&msg_type_, &from.msg_type_,
+    static_cast<size_t>(reinterpret_cast<char*>(&time_out_) -
+    reinterpret_cast<char*>(&msg_type_)) + sizeof(time_out_));
   // @@protoc_insertion_point(copy_constructor:message.Execute_request_msg)
 }
 
 void Execute_request_msg::SharedCtor() {
   _cached_size_ = 0;
   cmd_msg_ = NULL;
+  msg_type_ = 1;
   time_out_ = 200000;
 }
 
@@ -1619,11 +1684,12 @@ void Execute_request_msg::Clear() {
   (void) cached_has_bits;
 
   cached_has_bits = _has_bits_[0];
-  if (cached_has_bits & 3u) {
+  if (cached_has_bits & 7u) {
     if (cached_has_bits & 0x00000001u) {
       GOOGLE_DCHECK(cmd_msg_ != NULL);
       cmd_msg_->Clear();
     }
+    msg_type_ = 1;
     time_out_ = 200000;
   }
   _has_bits_.Clear();
@@ -1640,10 +1706,30 @@ bool Execute_request_msg::MergePartialFromCodedStream(
     tag = p.first;
     if (!p.second) goto handle_unusual;
     switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
-      // required .message.Command_message cmd_msg = 1;
+      // required .message.Message_type msg_type = 1;
       case 1: {
         if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) {
+            static_cast< ::google::protobuf::uint8>(8u /* 8 & 0xFF */)) {
+          int value;
+          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
+                   int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>(
+                 input, &value)));
+          if (::message::Message_type_IsValid(value)) {
+            set_msg_type(static_cast< ::message::Message_type >(value));
+          } else {
+            mutable_unknown_fields()->AddVarint(
+                1, static_cast< ::google::protobuf::uint64>(value));
+          }
+        } else {
+          goto handle_unusual;
+        }
+        break;
+      }
+
+      // required .message.Command_message cmd_msg = 2;
+      case 2: {
+        if (static_cast< ::google::protobuf::uint8>(tag) ==
+            static_cast< ::google::protobuf::uint8>(18u /* 18 & 0xFF */)) {
           DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(
                input, mutable_cmd_msg()));
         } else {
@@ -1693,14 +1779,20 @@ void Execute_request_msg::SerializeWithCachedSizes(
   (void) cached_has_bits;
 
   cached_has_bits = _has_bits_[0];
-  // required .message.Command_message cmd_msg = 1;
+  // required .message.Message_type msg_type = 1;
+  if (cached_has_bits & 0x00000002u) {
+    ::google::protobuf::internal::WireFormatLite::WriteEnum(
+      1, this->msg_type(), output);
+  }
+
+  // required .message.Command_message cmd_msg = 2;
   if (cached_has_bits & 0x00000001u) {
     ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
-      1, *this->cmd_msg_, output);
+      2, *this->cmd_msg_, output);
   }
 
   // optional int32 time_out = 3 [default = 200000];
-  if (cached_has_bits & 0x00000002u) {
+  if (cached_has_bits & 0x00000004u) {
     ::google::protobuf::internal::WireFormatLite::WriteInt32(3, this->time_out(), output);
   }
 
@@ -1719,15 +1811,21 @@ void Execute_request_msg::SerializeWithCachedSizes(
   (void) cached_has_bits;
 
   cached_has_bits = _has_bits_[0];
-  // required .message.Command_message cmd_msg = 1;
+  // required .message.Message_type msg_type = 1;
+  if (cached_has_bits & 0x00000002u) {
+    target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray(
+      1, this->msg_type(), target);
+  }
+
+  // required .message.Command_message cmd_msg = 2;
   if (cached_has_bits & 0x00000001u) {
     target = ::google::protobuf::internal::WireFormatLite::
       InternalWriteMessageToArray(
-        1, *this->cmd_msg_, deterministic, target);
+        2, *this->cmd_msg_, deterministic, target);
   }
 
   // optional int32 time_out = 3 [default = 200000];
-  if (cached_has_bits & 0x00000002u) {
+  if (cached_has_bits & 0x00000004u) {
     target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(3, this->time_out(), target);
   }
 
@@ -1739,6 +1837,25 @@ void Execute_request_msg::SerializeWithCachedSizes(
   return target;
 }
 
+size_t Execute_request_msg::RequiredFieldsByteSizeFallback() const {
+// @@protoc_insertion_point(required_fields_byte_size_fallback_start:message.Execute_request_msg)
+  size_t total_size = 0;
+
+  if (has_cmd_msg()) {
+    // required .message.Command_message cmd_msg = 2;
+    total_size += 1 +
+      ::google::protobuf::internal::WireFormatLite::MessageSize(
+        *this->cmd_msg_);
+  }
+
+  if (has_msg_type()) {
+    // required .message.Message_type msg_type = 1;
+    total_size += 1 +
+      ::google::protobuf::internal::WireFormatLite::EnumSize(this->msg_type());
+  }
+
+  return total_size;
+}
 size_t Execute_request_msg::ByteSizeLong() const {
 // @@protoc_insertion_point(message_byte_size_start:message.Execute_request_msg)
   size_t total_size = 0;
@@ -1748,11 +1865,18 @@ size_t Execute_request_msg::ByteSizeLong() const {
       ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
         _internal_metadata_.unknown_fields());
   }
-  // required .message.Command_message cmd_msg = 1;
-  if (has_cmd_msg()) {
+  if (((_has_bits_[0] & 0x00000003) ^ 0x00000003) == 0) {  // All required fields are present.
+    // required .message.Command_message cmd_msg = 2;
     total_size += 1 +
       ::google::protobuf::internal::WireFormatLite::MessageSize(
         *this->cmd_msg_);
+
+    // required .message.Message_type msg_type = 1;
+    total_size += 1 +
+      ::google::protobuf::internal::WireFormatLite::EnumSize(this->msg_type());
+
+  } else {
+    total_size += RequiredFieldsByteSizeFallback();
   }
   // optional int32 time_out = 3 [default = 200000];
   if (has_time_out()) {
@@ -1791,11 +1915,14 @@ void Execute_request_msg::MergeFrom(const Execute_request_msg& from) {
   (void) cached_has_bits;
 
   cached_has_bits = from._has_bits_[0];
-  if (cached_has_bits & 3u) {
+  if (cached_has_bits & 7u) {
     if (cached_has_bits & 0x00000001u) {
       mutable_cmd_msg()->::message::Command_message::MergeFrom(from.cmd_msg());
     }
     if (cached_has_bits & 0x00000002u) {
+      msg_type_ = from.msg_type_;
+    }
+    if (cached_has_bits & 0x00000004u) {
       time_out_ = from.time_out_;
     }
     _has_bits_[0] |= cached_has_bits;
@@ -1817,7 +1944,7 @@ void Execute_request_msg::CopyFrom(const Execute_request_msg& from) {
 }
 
 bool Execute_request_msg::IsInitialized() const {
-  if ((_has_bits_[0] & 0x00000001) != 0x00000001) return false;
+  if ((_has_bits_[0] & 0x00000003) != 0x00000003) return false;
   if (has_cmd_msg()) {
     if (!this->cmd_msg_->IsInitialized()) return false;
   }
@@ -1831,6 +1958,7 @@ void Execute_request_msg::Swap(Execute_request_msg* other) {
 void Execute_request_msg::InternalSwap(Execute_request_msg* other) {
   using std::swap;
   swap(cmd_msg_, other->cmd_msg_);
+  swap(msg_type_, other->msg_type_);
   swap(time_out_, other->time_out_);
   swap(_has_bits_[0], other->_has_bits_[0]);
   _internal_metadata_.Swap(&other->_internal_metadata_);
@@ -1854,6 +1982,7 @@ void Execute_response_msg::clear_cmd_msg() {
   clear_has_cmd_msg();
 }
 #if !defined(_MSC_VER) || _MSC_VER >= 1900
+const int Execute_response_msg::kMsgTypeFieldNumber;
 const int Execute_response_msg::kCmdMsgFieldNumber;
 const int Execute_response_msg::kErrorCodeFieldNumber;
 const int Execute_response_msg::kErrorDescriptionFieldNumber;
@@ -1882,7 +2011,9 @@ Execute_response_msg::Execute_response_msg(const Execute_response_msg& from)
   } else {
     cmd_msg_ = NULL;
   }
-  error_code_ = from.error_code_;
+  ::memcpy(&error_code_, &from.error_code_,
+    static_cast<size_t>(reinterpret_cast<char*>(&msg_type_) -
+    reinterpret_cast<char*>(&error_code_)) + sizeof(msg_type_));
   // @@protoc_insertion_point(copy_constructor:message.Execute_response_msg)
 }
 
@@ -1892,6 +2023,7 @@ void Execute_response_msg::SharedCtor() {
   ::memset(&cmd_msg_, 0, static_cast<size_t>(
       reinterpret_cast<char*>(&error_code_) -
       reinterpret_cast<char*>(&cmd_msg_)) + sizeof(error_code_));
+  msg_type_ = 1;
 }
 
 Execute_response_msg::~Execute_response_msg() {
@@ -1944,7 +2076,10 @@ void Execute_response_msg::Clear() {
       cmd_msg_->Clear();
     }
   }
-  error_code_ = 0;
+  if (cached_has_bits & 12u) {
+    error_code_ = 0;
+    msg_type_ = 1;
+  }
   _has_bits_.Clear();
   _internal_metadata_.Clear();
 }
@@ -1959,10 +2094,30 @@ bool Execute_response_msg::MergePartialFromCodedStream(
     tag = p.first;
     if (!p.second) goto handle_unusual;
     switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
-      // required .message.Command_message cmd_msg = 1;
+      // required .message.Message_type msg_type = 1;
       case 1: {
         if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) {
+            static_cast< ::google::protobuf::uint8>(8u /* 8 & 0xFF */)) {
+          int value;
+          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
+                   int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>(
+                 input, &value)));
+          if (::message::Message_type_IsValid(value)) {
+            set_msg_type(static_cast< ::message::Message_type >(value));
+          } else {
+            mutable_unknown_fields()->AddVarint(
+                1, static_cast< ::google::protobuf::uint64>(value));
+          }
+        } else {
+          goto handle_unusual;
+        }
+        break;
+      }
+
+      // required .message.Command_message cmd_msg = 2;
+      case 2: {
+        if (static_cast< ::google::protobuf::uint8>(tag) ==
+            static_cast< ::google::protobuf::uint8>(18u /* 18 & 0xFF */)) {
           DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(
                input, mutable_cmd_msg()));
         } else {
@@ -1971,10 +2126,10 @@ bool Execute_response_msg::MergePartialFromCodedStream(
         break;
       }
 
-      // required int32 error_code = 2;
-      case 2: {
+      // required int32 error_code = 3;
+      case 3: {
         if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(16u /* 16 & 0xFF */)) {
+            static_cast< ::google::protobuf::uint8>(24u /* 24 & 0xFF */)) {
           set_has_error_code();
           DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
                    ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
@@ -1985,10 +2140,10 @@ bool Execute_response_msg::MergePartialFromCodedStream(
         break;
       }
 
-      // optional string error_description = 3;
-      case 3: {
+      // optional string error_description = 4;
+      case 4: {
         if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(26u /* 26 & 0xFF */)) {
+            static_cast< ::google::protobuf::uint8>(34u /* 34 & 0xFF */)) {
           DO_(::google::protobuf::internal::WireFormatLite::ReadString(
                 input, this->mutable_error_description()));
           ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
@@ -2028,25 +2183,31 @@ void Execute_response_msg::SerializeWithCachedSizes(
   (void) cached_has_bits;
 
   cached_has_bits = _has_bits_[0];
-  // required .message.Command_message cmd_msg = 1;
+  // required .message.Message_type msg_type = 1;
+  if (cached_has_bits & 0x00000008u) {
+    ::google::protobuf::internal::WireFormatLite::WriteEnum(
+      1, this->msg_type(), output);
+  }
+
+  // required .message.Command_message cmd_msg = 2;
   if (cached_has_bits & 0x00000002u) {
     ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
-      1, *this->cmd_msg_, output);
+      2, *this->cmd_msg_, output);
   }
 
-  // required int32 error_code = 2;
+  // required int32 error_code = 3;
   if (cached_has_bits & 0x00000004u) {
-    ::google::protobuf::internal::WireFormatLite::WriteInt32(2, this->error_code(), output);
+    ::google::protobuf::internal::WireFormatLite::WriteInt32(3, this->error_code(), output);
   }
 
-  // optional string error_description = 3;
+  // optional string error_description = 4;
   if (cached_has_bits & 0x00000001u) {
     ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
       this->error_description().data(), static_cast<int>(this->error_description().length()),
       ::google::protobuf::internal::WireFormat::SERIALIZE,
       "message.Execute_response_msg.error_description");
     ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
-      3, this->error_description(), output);
+      4, this->error_description(), output);
   }
 
   if (_internal_metadata_.have_unknown_fields()) {
@@ -2064,19 +2225,25 @@ void Execute_response_msg::SerializeWithCachedSizes(
   (void) cached_has_bits;
 
   cached_has_bits = _has_bits_[0];
-  // required .message.Command_message cmd_msg = 1;
+  // required .message.Message_type msg_type = 1;
+  if (cached_has_bits & 0x00000008u) {
+    target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray(
+      1, this->msg_type(), target);
+  }
+
+  // required .message.Command_message cmd_msg = 2;
   if (cached_has_bits & 0x00000002u) {
     target = ::google::protobuf::internal::WireFormatLite::
       InternalWriteMessageToArray(
-        1, *this->cmd_msg_, deterministic, target);
+        2, *this->cmd_msg_, deterministic, target);
   }
 
-  // required int32 error_code = 2;
+  // required int32 error_code = 3;
   if (cached_has_bits & 0x00000004u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(2, this->error_code(), target);
+    target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(3, this->error_code(), target);
   }
 
-  // optional string error_description = 3;
+  // optional string error_description = 4;
   if (cached_has_bits & 0x00000001u) {
     ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
       this->error_description().data(), static_cast<int>(this->error_description().length()),
@@ -2084,7 +2251,7 @@ void Execute_response_msg::SerializeWithCachedSizes(
       "message.Execute_response_msg.error_description");
     target =
       ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
-        3, this->error_description(), target);
+        4, this->error_description(), target);
   }
 
   if (_internal_metadata_.have_unknown_fields()) {
@@ -2100,19 +2267,25 @@ size_t Execute_response_msg::RequiredFieldsByteSizeFallback() const {
   size_t total_size = 0;
 
   if (has_cmd_msg()) {
-    // required .message.Command_message cmd_msg = 1;
+    // required .message.Command_message cmd_msg = 2;
     total_size += 1 +
       ::google::protobuf::internal::WireFormatLite::MessageSize(
         *this->cmd_msg_);
   }
 
   if (has_error_code()) {
-    // required int32 error_code = 2;
+    // required int32 error_code = 3;
     total_size += 1 +
       ::google::protobuf::internal::WireFormatLite::Int32Size(
         this->error_code());
   }
 
+  if (has_msg_type()) {
+    // required .message.Message_type msg_type = 1;
+    total_size += 1 +
+      ::google::protobuf::internal::WireFormatLite::EnumSize(this->msg_type());
+  }
+
   return total_size;
 }
 size_t Execute_response_msg::ByteSizeLong() const {
@@ -2124,21 +2297,25 @@ size_t Execute_response_msg::ByteSizeLong() const {
       ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
         _internal_metadata_.unknown_fields());
   }
-  if (((_has_bits_[0] & 0x00000006) ^ 0x00000006) == 0) {  // All required fields are present.
-    // required .message.Command_message cmd_msg = 1;
+  if (((_has_bits_[0] & 0x0000000e) ^ 0x0000000e) == 0) {  // All required fields are present.
+    // required .message.Command_message cmd_msg = 2;
     total_size += 1 +
       ::google::protobuf::internal::WireFormatLite::MessageSize(
         *this->cmd_msg_);
 
-    // required int32 error_code = 2;
+    // required int32 error_code = 3;
     total_size += 1 +
       ::google::protobuf::internal::WireFormatLite::Int32Size(
         this->error_code());
 
+    // required .message.Message_type msg_type = 1;
+    total_size += 1 +
+      ::google::protobuf::internal::WireFormatLite::EnumSize(this->msg_type());
+
   } else {
     total_size += RequiredFieldsByteSizeFallback();
   }
-  // optional string error_description = 3;
+  // optional string error_description = 4;
   if (has_error_description()) {
     total_size += 1 +
       ::google::protobuf::internal::WireFormatLite::StringSize(
@@ -2175,7 +2352,7 @@ void Execute_response_msg::MergeFrom(const Execute_response_msg& from) {
   (void) cached_has_bits;
 
   cached_has_bits = from._has_bits_[0];
-  if (cached_has_bits & 7u) {
+  if (cached_has_bits & 15u) {
     if (cached_has_bits & 0x00000001u) {
       set_has_error_description();
       error_description_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.error_description_);
@@ -2186,6 +2363,9 @@ void Execute_response_msg::MergeFrom(const Execute_response_msg& from) {
     if (cached_has_bits & 0x00000004u) {
       error_code_ = from.error_code_;
     }
+    if (cached_has_bits & 0x00000008u) {
+      msg_type_ = from.msg_type_;
+    }
     _has_bits_[0] |= cached_has_bits;
   }
 }
@@ -2205,7 +2385,7 @@ void Execute_response_msg::CopyFrom(const Execute_response_msg& from) {
 }
 
 bool Execute_response_msg::IsInitialized() const {
-  if ((_has_bits_[0] & 0x00000006) != 0x00000006) return false;
+  if ((_has_bits_[0] & 0x0000000e) != 0x0000000e) return false;
   if (has_cmd_msg()) {
     if (!this->cmd_msg_->IsInitialized()) return false;
   }
@@ -2221,6 +2401,7 @@ void Execute_response_msg::InternalSwap(Execute_response_msg* other) {
   error_description_.Swap(&other->error_description_);
   swap(cmd_msg_, other->cmd_msg_);
   swap(error_code_, other->error_code_);
+  swap(msg_type_, other->msg_type_);
   swap(_has_bits_[0], other->_has_bits_[0]);
   _internal_metadata_.Swap(&other->_internal_metadata_);
   swap(_cached_size_, other->_cached_size_);

+ 132 - 24
message/hardware_message.pb.h

@@ -491,35 +491,44 @@ class Harware_statu_msg : public ::google::protobuf::Message /* @@protoc_inserti
 
   // accessors -------------------------------------------------------
 
-  // required .message.Carrier_status carrier1_statu = 1;
+  // required .message.Carrier_status carrier1_statu = 2;
   bool has_carrier1_statu() const;
   void clear_carrier1_statu();
-  static const int kCarrier1StatuFieldNumber = 1;
+  static const int kCarrier1StatuFieldNumber = 2;
   const ::message::Carrier_status& carrier1_statu() const;
   ::message::Carrier_status* release_carrier1_statu();
   ::message::Carrier_status* mutable_carrier1_statu();
   void set_allocated_carrier1_statu(::message::Carrier_status* carrier1_statu);
 
-  // required .message.Carrier_status carrier2_statu = 2;
+  // required .message.Carrier_status carrier2_statu = 3;
   bool has_carrier2_statu() const;
   void clear_carrier2_statu();
-  static const int kCarrier2StatuFieldNumber = 2;
+  static const int kCarrier2StatuFieldNumber = 3;
   const ::message::Carrier_status& carrier2_statu() const;
   ::message::Carrier_status* release_carrier2_statu();
   ::message::Carrier_status* mutable_carrier2_statu();
   void set_allocated_carrier2_statu(::message::Carrier_status* carrier2_statu);
 
-  // required .message.Carrier_status carrier3_statu = 3;
+  // required .message.Carrier_status carrier3_statu = 4;
   bool has_carrier3_statu() const;
   void clear_carrier3_statu();
-  static const int kCarrier3StatuFieldNumber = 3;
+  static const int kCarrier3StatuFieldNumber = 4;
   const ::message::Carrier_status& carrier3_statu() const;
   ::message::Carrier_status* release_carrier3_statu();
   ::message::Carrier_status* mutable_carrier3_statu();
   void set_allocated_carrier3_statu(::message::Carrier_status* carrier3_statu);
 
+  // required .message.Message_type msg_type = 1;
+  bool has_msg_type() const;
+  void clear_msg_type();
+  static const int kMsgTypeFieldNumber = 1;
+  ::message::Message_type msg_type() const;
+  void set_msg_type(::message::Message_type value);
+
   // @@protoc_insertion_point(class_scope:message.Harware_statu_msg)
  private:
+  void set_has_msg_type();
+  void clear_has_msg_type();
   void set_has_carrier1_statu();
   void clear_has_carrier1_statu();
   void set_has_carrier2_statu();
@@ -536,6 +545,7 @@ class Harware_statu_msg : public ::google::protobuf::Message /* @@protoc_inserti
   ::message::Carrier_status* carrier1_statu_;
   ::message::Carrier_status* carrier2_statu_;
   ::message::Carrier_status* carrier3_statu_;
+  int msg_type_;
   friend struct ::protobuf_hardware_5fmessage_2eproto::TableStruct;
   friend void ::protobuf_hardware_5fmessage_2eproto::InitDefaultsHarware_statu_msgImpl();
 };
@@ -630,15 +640,22 @@ class Execute_request_msg : public ::google::protobuf::Message /* @@protoc_inser
 
   // accessors -------------------------------------------------------
 
-  // required .message.Command_message cmd_msg = 1;
+  // required .message.Command_message cmd_msg = 2;
   bool has_cmd_msg() const;
   void clear_cmd_msg();
-  static const int kCmdMsgFieldNumber = 1;
+  static const int kCmdMsgFieldNumber = 2;
   const ::message::Command_message& cmd_msg() const;
   ::message::Command_message* release_cmd_msg();
   ::message::Command_message* mutable_cmd_msg();
   void set_allocated_cmd_msg(::message::Command_message* cmd_msg);
 
+  // required .message.Message_type msg_type = 1;
+  bool has_msg_type() const;
+  void clear_msg_type();
+  static const int kMsgTypeFieldNumber = 1;
+  ::message::Message_type msg_type() const;
+  void set_msg_type(::message::Message_type value);
+
   // optional int32 time_out = 3 [default = 200000];
   bool has_time_out() const;
   void clear_time_out();
@@ -648,15 +665,21 @@ class Execute_request_msg : public ::google::protobuf::Message /* @@protoc_inser
 
   // @@protoc_insertion_point(class_scope:message.Execute_request_msg)
  private:
+  void set_has_msg_type();
+  void clear_has_msg_type();
   void set_has_cmd_msg();
   void clear_has_cmd_msg();
   void set_has_time_out();
   void clear_has_time_out();
 
+  // helper for ByteSizeLong()
+  size_t RequiredFieldsByteSizeFallback() const;
+
   ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;
   ::google::protobuf::internal::HasBits<1> _has_bits_;
   mutable int _cached_size_;
   ::message::Command_message* cmd_msg_;
+  int msg_type_;
   ::google::protobuf::int32 time_out_;
   friend struct ::protobuf_hardware_5fmessage_2eproto::TableStruct;
   friend void ::protobuf_hardware_5fmessage_2eproto::InitDefaultsExecute_request_msgImpl();
@@ -752,10 +775,10 @@ class Execute_response_msg : public ::google::protobuf::Message /* @@protoc_inse
 
   // accessors -------------------------------------------------------
 
-  // optional string error_description = 3;
+  // optional string error_description = 4;
   bool has_error_description() const;
   void clear_error_description();
-  static const int kErrorDescriptionFieldNumber = 3;
+  static const int kErrorDescriptionFieldNumber = 4;
   const ::std::string& error_description() const;
   void set_error_description(const ::std::string& value);
   #if LANG_CXX11
@@ -767,24 +790,33 @@ class Execute_response_msg : public ::google::protobuf::Message /* @@protoc_inse
   ::std::string* release_error_description();
   void set_allocated_error_description(::std::string* error_description);
 
-  // required .message.Command_message cmd_msg = 1;
+  // required .message.Command_message cmd_msg = 2;
   bool has_cmd_msg() const;
   void clear_cmd_msg();
-  static const int kCmdMsgFieldNumber = 1;
+  static const int kCmdMsgFieldNumber = 2;
   const ::message::Command_message& cmd_msg() const;
   ::message::Command_message* release_cmd_msg();
   ::message::Command_message* mutable_cmd_msg();
   void set_allocated_cmd_msg(::message::Command_message* cmd_msg);
 
-  // required int32 error_code = 2;
+  // required int32 error_code = 3;
   bool has_error_code() const;
   void clear_error_code();
-  static const int kErrorCodeFieldNumber = 2;
+  static const int kErrorCodeFieldNumber = 3;
   ::google::protobuf::int32 error_code() const;
   void set_error_code(::google::protobuf::int32 value);
 
+  // required .message.Message_type msg_type = 1;
+  bool has_msg_type() const;
+  void clear_msg_type();
+  static const int kMsgTypeFieldNumber = 1;
+  ::message::Message_type msg_type() const;
+  void set_msg_type(::message::Message_type value);
+
   // @@protoc_insertion_point(class_scope:message.Execute_response_msg)
  private:
+  void set_has_msg_type();
+  void clear_has_msg_type();
   void set_has_cmd_msg();
   void clear_has_cmd_msg();
   void set_has_error_code();
@@ -801,6 +833,7 @@ class Execute_response_msg : public ::google::protobuf::Message /* @@protoc_inse
   ::google::protobuf::internal::ArenaStringPtr error_description_;
   ::message::Command_message* cmd_msg_;
   ::google::protobuf::int32 error_code_;
+  int msg_type_;
   friend struct ::protobuf_hardware_5fmessage_2eproto::TableStruct;
   friend void ::protobuf_hardware_5fmessage_2eproto::InitDefaultsExecute_response_msgImpl();
 };
@@ -1111,7 +1144,32 @@ inline void Carrier_status::set_empty(bool value) {
 
 // Harware_statu_msg
 
-// required .message.Carrier_status carrier1_statu = 1;
+// required .message.Message_type msg_type = 1;
+inline bool Harware_statu_msg::has_msg_type() const {
+  return (_has_bits_[0] & 0x00000008u) != 0;
+}
+inline void Harware_statu_msg::set_has_msg_type() {
+  _has_bits_[0] |= 0x00000008u;
+}
+inline void Harware_statu_msg::clear_has_msg_type() {
+  _has_bits_[0] &= ~0x00000008u;
+}
+inline void Harware_statu_msg::clear_msg_type() {
+  msg_type_ = 1;
+  clear_has_msg_type();
+}
+inline ::message::Message_type Harware_statu_msg::msg_type() const {
+  // @@protoc_insertion_point(field_get:message.Harware_statu_msg.msg_type)
+  return static_cast< ::message::Message_type >(msg_type_);
+}
+inline void Harware_statu_msg::set_msg_type(::message::Message_type value) {
+  assert(::message::Message_type_IsValid(value));
+  set_has_msg_type();
+  msg_type_ = value;
+  // @@protoc_insertion_point(field_set:message.Harware_statu_msg.msg_type)
+}
+
+// required .message.Carrier_status carrier1_statu = 2;
 inline bool Harware_statu_msg::has_carrier1_statu() const {
   return (_has_bits_[0] & 0x00000001u) != 0;
 }
@@ -1165,7 +1223,7 @@ inline void Harware_statu_msg::set_allocated_carrier1_statu(::message::Carrier_s
   // @@protoc_insertion_point(field_set_allocated:message.Harware_statu_msg.carrier1_statu)
 }
 
-// required .message.Carrier_status carrier2_statu = 2;
+// required .message.Carrier_status carrier2_statu = 3;
 inline bool Harware_statu_msg::has_carrier2_statu() const {
   return (_has_bits_[0] & 0x00000002u) != 0;
 }
@@ -1219,7 +1277,7 @@ inline void Harware_statu_msg::set_allocated_carrier2_statu(::message::Carrier_s
   // @@protoc_insertion_point(field_set_allocated:message.Harware_statu_msg.carrier2_statu)
 }
 
-// required .message.Carrier_status carrier3_statu = 3;
+// required .message.Carrier_status carrier3_statu = 4;
 inline bool Harware_statu_msg::has_carrier3_statu() const {
   return (_has_bits_[0] & 0x00000004u) != 0;
 }
@@ -1277,7 +1335,32 @@ inline void Harware_statu_msg::set_allocated_carrier3_statu(::message::Carrier_s
 
 // Execute_request_msg
 
-// required .message.Command_message cmd_msg = 1;
+// required .message.Message_type msg_type = 1;
+inline bool Execute_request_msg::has_msg_type() const {
+  return (_has_bits_[0] & 0x00000002u) != 0;
+}
+inline void Execute_request_msg::set_has_msg_type() {
+  _has_bits_[0] |= 0x00000002u;
+}
+inline void Execute_request_msg::clear_has_msg_type() {
+  _has_bits_[0] &= ~0x00000002u;
+}
+inline void Execute_request_msg::clear_msg_type() {
+  msg_type_ = 1;
+  clear_has_msg_type();
+}
+inline ::message::Message_type Execute_request_msg::msg_type() const {
+  // @@protoc_insertion_point(field_get:message.Execute_request_msg.msg_type)
+  return static_cast< ::message::Message_type >(msg_type_);
+}
+inline void Execute_request_msg::set_msg_type(::message::Message_type value) {
+  assert(::message::Message_type_IsValid(value));
+  set_has_msg_type();
+  msg_type_ = value;
+  // @@protoc_insertion_point(field_set:message.Execute_request_msg.msg_type)
+}
+
+// required .message.Command_message cmd_msg = 2;
 inline bool Execute_request_msg::has_cmd_msg() const {
   return (_has_bits_[0] & 0x00000001u) != 0;
 }
@@ -1329,13 +1412,13 @@ inline void Execute_request_msg::set_allocated_cmd_msg(::message::Command_messag
 
 // optional int32 time_out = 3 [default = 200000];
 inline bool Execute_request_msg::has_time_out() const {
-  return (_has_bits_[0] & 0x00000002u) != 0;
+  return (_has_bits_[0] & 0x00000004u) != 0;
 }
 inline void Execute_request_msg::set_has_time_out() {
-  _has_bits_[0] |= 0x00000002u;
+  _has_bits_[0] |= 0x00000004u;
 }
 inline void Execute_request_msg::clear_has_time_out() {
-  _has_bits_[0] &= ~0x00000002u;
+  _has_bits_[0] &= ~0x00000004u;
 }
 inline void Execute_request_msg::clear_time_out() {
   time_out_ = 200000;
@@ -1355,7 +1438,32 @@ inline void Execute_request_msg::set_time_out(::google::protobuf::int32 value) {
 
 // Execute_response_msg
 
-// required .message.Command_message cmd_msg = 1;
+// required .message.Message_type msg_type = 1;
+inline bool Execute_response_msg::has_msg_type() const {
+  return (_has_bits_[0] & 0x00000008u) != 0;
+}
+inline void Execute_response_msg::set_has_msg_type() {
+  _has_bits_[0] |= 0x00000008u;
+}
+inline void Execute_response_msg::clear_has_msg_type() {
+  _has_bits_[0] &= ~0x00000008u;
+}
+inline void Execute_response_msg::clear_msg_type() {
+  msg_type_ = 1;
+  clear_has_msg_type();
+}
+inline ::message::Message_type Execute_response_msg::msg_type() const {
+  // @@protoc_insertion_point(field_get:message.Execute_response_msg.msg_type)
+  return static_cast< ::message::Message_type >(msg_type_);
+}
+inline void Execute_response_msg::set_msg_type(::message::Message_type value) {
+  assert(::message::Message_type_IsValid(value));
+  set_has_msg_type();
+  msg_type_ = value;
+  // @@protoc_insertion_point(field_set:message.Execute_response_msg.msg_type)
+}
+
+// required .message.Command_message cmd_msg = 2;
 inline bool Execute_response_msg::has_cmd_msg() const {
   return (_has_bits_[0] & 0x00000002u) != 0;
 }
@@ -1405,7 +1513,7 @@ inline void Execute_response_msg::set_allocated_cmd_msg(::message::Command_messa
   // @@protoc_insertion_point(field_set_allocated:message.Execute_response_msg.cmd_msg)
 }
 
-// required int32 error_code = 2;
+// required int32 error_code = 3;
 inline bool Execute_response_msg::has_error_code() const {
   return (_has_bits_[0] & 0x00000004u) != 0;
 }
@@ -1429,7 +1537,7 @@ inline void Execute_response_msg::set_error_code(::google::protobuf::int32 value
   // @@protoc_insertion_point(field_set:message.Execute_response_msg.error_code)
 }
 
-// optional string error_description = 3;
+// optional string error_description = 4;
 inline bool Execute_response_msg::has_error_description() const {
   return (_has_bits_[0] & 0x00000001u) != 0;
 }

+ 12 - 9
message/hardware_message.proto

@@ -29,27 +29,30 @@ message Carrier_status
     required bool                       empty=5;                   //是否空载
 }
 
-//所有硬件状态集合
+//搬运机构各个零部件状态
 message Harware_statu_msg
 {
-    required Carrier_status             carrier1_statu=1;           //搬运器1状态
-    required Carrier_status             carrier2_statu=2;           //搬运器2状态
-    required Carrier_status             carrier3_statu=3;           //搬运器3状态
+    required Message_type               msg_type=1;         //消息类型
+    required Carrier_status             carrier1_statu=2;           //搬运器1状态
+    required Carrier_status             carrier2_statu=3;           //搬运器2状态
+    required Carrier_status             carrier3_statu=4;           //搬运器3状态
 }
 
 //执行搬运请求
 message Execute_request_msg
 {
-    required Command_message        cmd_msg=1;                 //指令信息
-    optional int32                  time_out=3 [default=200000];           //定位测量超时设置,默认200s
+    required Message_type               msg_type=1;         //消息类型
+    required Command_message            cmd_msg=2;                              //指令信息
+    optional int32                      time_out=3 [default=200000];           //定位测量超时设置,默认200s
 }
 
 //搬运动作执行完成后反馈结果
 message Execute_response_msg
 {
-    required Command_message        cmd_msg=1;
-    required int32                  error_code=2;
-    optional string                 error_description=3;
+    required Message_type               msg_type=1;         //消息类型
+    required Command_message            cmd_msg=2;
+    required int32                      error_code=3;
+    optional string                     error_description=4;
 }
 
 

A diferenza do arquivo foi suprimida porque é demasiado grande
+ 497 - 170
message/locate_message.pb.cc


+ 282 - 69
message/locate_message.pb.h

@@ -199,34 +199,77 @@ class Locate_status_msg : public ::google::protobuf::Message /* @@protoc_inserti
 
   // accessors -------------------------------------------------------
 
-  // optional .message.Command_message cmd_msg = 1;
+  // optional .message.Command_message cmd_msg = 2;
   bool has_cmd_msg() const;
   void clear_cmd_msg();
-  static const int kCmdMsgFieldNumber = 1;
+  static const int kCmdMsgFieldNumber = 2;
   const ::message::Command_message& cmd_msg() const;
   ::message::Command_message* release_cmd_msg();
   ::message::Command_message* mutable_cmd_msg();
   void set_allocated_cmd_msg(::message::Command_message* cmd_msg);
 
-  // required .message.Lidar_statu statu = 2;
-  bool has_statu() const;
-  void clear_statu();
-  static const int kStatuFieldNumber = 2;
-  ::message::Lidar_statu statu() const;
-  void set_statu(::message::Lidar_statu value);
+  // required .message.Lidar_statu dj_statu1 = 3;
+  bool has_dj_statu1() const;
+  void clear_dj_statu1();
+  static const int kDjStatu1FieldNumber = 3;
+  ::message::Lidar_statu dj_statu1() const;
+  void set_dj_statu1(::message::Lidar_statu value);
+
+  // required .message.Lidar_statu dj_statu2 = 4;
+  bool has_dj_statu2() const;
+  void clear_dj_statu2();
+  static const int kDjStatu2FieldNumber = 4;
+  ::message::Lidar_statu dj_statu2() const;
+  void set_dj_statu2(::message::Lidar_statu value);
+
+  // required .message.Lidar_statu dj_statu3 = 5;
+  bool has_dj_statu3() const;
+  void clear_dj_statu3();
+  static const int kDjStatu3FieldNumber = 5;
+  ::message::Lidar_statu dj_statu3() const;
+  void set_dj_statu3(::message::Lidar_statu value);
+
+  // required .message.Lidar_statu dj_statu4 = 6;
+  bool has_dj_statu4() const;
+  void clear_dj_statu4();
+  static const int kDjStatu4FieldNumber = 6;
+  ::message::Lidar_statu dj_statu4() const;
+  void set_dj_statu4(::message::Lidar_statu value);
+
+  // required .message.Message_type msg_type = 1;
+  bool has_msg_type() const;
+  void clear_msg_type();
+  static const int kMsgTypeFieldNumber = 1;
+  ::message::Message_type msg_type() const;
+  void set_msg_type(::message::Message_type value);
 
   // @@protoc_insertion_point(class_scope:message.Locate_status_msg)
  private:
+  void set_has_msg_type();
+  void clear_has_msg_type();
   void set_has_cmd_msg();
   void clear_has_cmd_msg();
-  void set_has_statu();
-  void clear_has_statu();
+  void set_has_dj_statu1();
+  void clear_has_dj_statu1();
+  void set_has_dj_statu2();
+  void clear_has_dj_statu2();
+  void set_has_dj_statu3();
+  void clear_has_dj_statu3();
+  void set_has_dj_statu4();
+  void clear_has_dj_statu4();
+
+  // helper for ByteSizeLong()
+  size_t RequiredFieldsByteSizeFallback() const;
 
   ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;
   ::google::protobuf::internal::HasBits<1> _has_bits_;
   mutable int _cached_size_;
   ::message::Command_message* cmd_msg_;
-  int statu_;
+  int dj_statu1_;
+  int dj_statu2_;
+  int dj_statu3_;
+  int dj_statu4_;
+  int msg_type_;
   friend struct ::protobuf_locate_5fmessage_2eproto::TableStruct;
   friend void ::protobuf_locate_5fmessage_2eproto::InitDefaultsLocate_status_msgImpl();
 };
@@ -321,31 +364,40 @@ class Locate_request_msg : public ::google::protobuf::Message /* @@protoc_insert
 
   // accessors -------------------------------------------------------
 
-  // required .message.Command_message cmd_msg = 1;
+  // required .message.Command_message cmd_msg = 2;
   bool has_cmd_msg() const;
   void clear_cmd_msg();
-  static const int kCmdMsgFieldNumber = 1;
+  static const int kCmdMsgFieldNumber = 2;
   const ::message::Command_message& cmd_msg() const;
   ::message::Command_message* release_cmd_msg();
   ::message::Command_message* mutable_cmd_msg();
   void set_allocated_cmd_msg(::message::Command_message* cmd_msg);
 
-  // required .message.Locate_type locate_type = 2;
+  // required .message.Locate_type locate_type = 3;
   bool has_locate_type() const;
   void clear_locate_type();
-  static const int kLocateTypeFieldNumber = 2;
+  static const int kLocateTypeFieldNumber = 3;
   ::message::Locate_type locate_type() const;
   void set_locate_type(::message::Locate_type value);
 
-  // optional int32 time_out = 3 [default = 3000];
+  // required .message.Message_type msg_type = 1;
+  bool has_msg_type() const;
+  void clear_msg_type();
+  static const int kMsgTypeFieldNumber = 1;
+  ::message::Message_type msg_type() const;
+  void set_msg_type(::message::Message_type value);
+
+  // optional int32 time_out = 4 [default = 5000];
   bool has_time_out() const;
   void clear_time_out();
-  static const int kTimeOutFieldNumber = 3;
+  static const int kTimeOutFieldNumber = 4;
   ::google::protobuf::int32 time_out() const;
   void set_time_out(::google::protobuf::int32 value);
 
   // @@protoc_insertion_point(class_scope:message.Locate_request_msg)
  private:
+  void set_has_msg_type();
+  void clear_has_msg_type();
   void set_has_cmd_msg();
   void clear_has_cmd_msg();
   void set_has_locate_type();
@@ -361,6 +413,7 @@ class Locate_request_msg : public ::google::protobuf::Message /* @@protoc_insert
   mutable int _cached_size_;
   ::message::Command_message* cmd_msg_;
   int locate_type_;
+  int msg_type_;
   ::google::protobuf::int32 time_out_;
   friend struct ::protobuf_locate_5fmessage_2eproto::TableStruct;
   friend void ::protobuf_locate_5fmessage_2eproto::InitDefaultsLocate_request_msgImpl();
@@ -456,10 +509,10 @@ class Locate_response_msg : public ::google::protobuf::Message /* @@protoc_inser
 
   // accessors -------------------------------------------------------
 
-  // optional string error_description = 3;
+  // optional string error_description = 4;
   bool has_error_description() const;
   void clear_error_description();
-  static const int kErrorDescriptionFieldNumber = 3;
+  static const int kErrorDescriptionFieldNumber = 4;
   const ::std::string& error_description() const;
   void set_error_description(const ::std::string& value);
   #if LANG_CXX11
@@ -471,73 +524,82 @@ class Locate_response_msg : public ::google::protobuf::Message /* @@protoc_inser
   ::std::string* release_error_description();
   void set_allocated_error_description(::std::string* error_description);
 
-  // required .message.Command_message cmd_msg = 1;
+  // required .message.Command_message cmd_msg = 2;
   bool has_cmd_msg() const;
   void clear_cmd_msg();
-  static const int kCmdMsgFieldNumber = 1;
+  static const int kCmdMsgFieldNumber = 2;
   const ::message::Command_message& cmd_msg() const;
   ::message::Command_message* release_cmd_msg();
   ::message::Command_message* mutable_cmd_msg();
   void set_allocated_cmd_msg(::message::Command_message* cmd_msg);
 
-  // required int32 error_code = 2;
+  // required int32 error_code = 3;
   bool has_error_code() const;
   void clear_error_code();
-  static const int kErrorCodeFieldNumber = 2;
+  static const int kErrorCodeFieldNumber = 3;
   ::google::protobuf::int32 error_code() const;
   void set_error_code(::google::protobuf::int32 value);
 
-  // optional float length = 4;
+  // optional float length = 5;
   bool has_length() const;
   void clear_length();
-  static const int kLengthFieldNumber = 4;
+  static const int kLengthFieldNumber = 5;
   float length() const;
   void set_length(float value);
 
-  // optional float width = 5;
+  // optional float width = 6;
   bool has_width() const;
   void clear_width();
-  static const int kWidthFieldNumber = 5;
+  static const int kWidthFieldNumber = 6;
   float width() const;
   void set_width(float value);
 
-  // optional float height = 6;
+  // optional float height = 7;
   bool has_height() const;
   void clear_height();
-  static const int kHeightFieldNumber = 6;
+  static const int kHeightFieldNumber = 7;
   float height() const;
   void set_height(float value);
 
-  // optional float wheel_base = 7;
+  // optional float wheel_base = 8;
   bool has_wheel_base() const;
   void clear_wheel_base();
-  static const int kWheelBaseFieldNumber = 7;
+  static const int kWheelBaseFieldNumber = 8;
   float wheel_base() const;
   void set_wheel_base(float value);
 
-  // optional float x = 8;
+  // optional float x = 9;
   bool has_x() const;
   void clear_x();
-  static const int kXFieldNumber = 8;
+  static const int kXFieldNumber = 9;
   float x() const;
   void set_x(float value);
 
-  // optional float y = 9;
+  // optional float y = 10;
   bool has_y() const;
   void clear_y();
-  static const int kYFieldNumber = 9;
+  static const int kYFieldNumber = 10;
   float y() const;
   void set_y(float value);
 
-  // optional float theta = 10;
+  // optional float theta = 11;
   bool has_theta() const;
   void clear_theta();
-  static const int kThetaFieldNumber = 10;
+  static const int kThetaFieldNumber = 11;
   float theta() const;
   void set_theta(float value);
 
+  // required .message.Message_type msg_type = 1;
+  bool has_msg_type() const;
+  void clear_msg_type();
+  static const int kMsgTypeFieldNumber = 1;
+  ::message::Message_type msg_type() const;
+  void set_msg_type(::message::Message_type value);
+
   // @@protoc_insertion_point(class_scope:message.Locate_response_msg)
  private:
+  void set_has_msg_type();
+  void clear_has_msg_type();
   void set_has_cmd_msg();
   void clear_has_cmd_msg();
   void set_has_error_code();
@@ -575,6 +637,7 @@ class Locate_response_msg : public ::google::protobuf::Message /* @@protoc_inser
   float x_;
   float y_;
   float theta_;
+  int msg_type_;
   friend struct ::protobuf_locate_5fmessage_2eproto::TableStruct;
   friend void ::protobuf_locate_5fmessage_2eproto::InitDefaultsLocate_response_msgImpl();
 };
@@ -589,7 +652,32 @@ class Locate_response_msg : public ::google::protobuf::Message /* @@protoc_inser
 #endif  // __GNUC__
 // Locate_status_msg
 
-// optional .message.Command_message cmd_msg = 1;
+// required .message.Message_type msg_type = 1;
+inline bool Locate_status_msg::has_msg_type() const {
+  return (_has_bits_[0] & 0x00000020u) != 0;
+}
+inline void Locate_status_msg::set_has_msg_type() {
+  _has_bits_[0] |= 0x00000020u;
+}
+inline void Locate_status_msg::clear_has_msg_type() {
+  _has_bits_[0] &= ~0x00000020u;
+}
+inline void Locate_status_msg::clear_msg_type() {
+  msg_type_ = 1;
+  clear_has_msg_type();
+}
+inline ::message::Message_type Locate_status_msg::msg_type() const {
+  // @@protoc_insertion_point(field_get:message.Locate_status_msg.msg_type)
+  return static_cast< ::message::Message_type >(msg_type_);
+}
+inline void Locate_status_msg::set_msg_type(::message::Message_type value) {
+  assert(::message::Message_type_IsValid(value));
+  set_has_msg_type();
+  msg_type_ = value;
+  // @@protoc_insertion_point(field_set:message.Locate_status_msg.msg_type)
+}
+
+// optional .message.Command_message cmd_msg = 2;
 inline bool Locate_status_msg::has_cmd_msg() const {
   return (_has_bits_[0] & 0x00000001u) != 0;
 }
@@ -639,36 +727,136 @@ inline void Locate_status_msg::set_allocated_cmd_msg(::message::Command_message*
   // @@protoc_insertion_point(field_set_allocated:message.Locate_status_msg.cmd_msg)
 }
 
-// required .message.Lidar_statu statu = 2;
-inline bool Locate_status_msg::has_statu() const {
+// required .message.Lidar_statu dj_statu1 = 3;
+inline bool Locate_status_msg::has_dj_statu1() const {
   return (_has_bits_[0] & 0x00000002u) != 0;
 }
-inline void Locate_status_msg::set_has_statu() {
+inline void Locate_status_msg::set_has_dj_statu1() {
   _has_bits_[0] |= 0x00000002u;
 }
-inline void Locate_status_msg::clear_has_statu() {
+inline void Locate_status_msg::clear_has_dj_statu1() {
   _has_bits_[0] &= ~0x00000002u;
 }
-inline void Locate_status_msg::clear_statu() {
-  statu_ = 0;
-  clear_has_statu();
+inline void Locate_status_msg::clear_dj_statu1() {
+  dj_statu1_ = 0;
+  clear_has_dj_statu1();
+}
+inline ::message::Lidar_statu Locate_status_msg::dj_statu1() const {
+  // @@protoc_insertion_point(field_get:message.Locate_status_msg.dj_statu1)
+  return static_cast< ::message::Lidar_statu >(dj_statu1_);
+}
+inline void Locate_status_msg::set_dj_statu1(::message::Lidar_statu value) {
+  assert(::message::Lidar_statu_IsValid(value));
+  set_has_dj_statu1();
+  dj_statu1_ = value;
+  // @@protoc_insertion_point(field_set:message.Locate_status_msg.dj_statu1)
+}
+
+// required .message.Lidar_statu dj_statu2 = 4;
+inline bool Locate_status_msg::has_dj_statu2() const {
+  return (_has_bits_[0] & 0x00000004u) != 0;
 }
-inline ::message::Lidar_statu Locate_status_msg::statu() const {
-  // @@protoc_insertion_point(field_get:message.Locate_status_msg.statu)
-  return static_cast< ::message::Lidar_statu >(statu_);
+inline void Locate_status_msg::set_has_dj_statu2() {
+  _has_bits_[0] |= 0x00000004u;
 }
-inline void Locate_status_msg::set_statu(::message::Lidar_statu value) {
+inline void Locate_status_msg::clear_has_dj_statu2() {
+  _has_bits_[0] &= ~0x00000004u;
+}
+inline void Locate_status_msg::clear_dj_statu2() {
+  dj_statu2_ = 0;
+  clear_has_dj_statu2();
+}
+inline ::message::Lidar_statu Locate_status_msg::dj_statu2() const {
+  // @@protoc_insertion_point(field_get:message.Locate_status_msg.dj_statu2)
+  return static_cast< ::message::Lidar_statu >(dj_statu2_);
+}
+inline void Locate_status_msg::set_dj_statu2(::message::Lidar_statu value) {
   assert(::message::Lidar_statu_IsValid(value));
-  set_has_statu();
-  statu_ = value;
-  // @@protoc_insertion_point(field_set:message.Locate_status_msg.statu)
+  set_has_dj_statu2();
+  dj_statu2_ = value;
+  // @@protoc_insertion_point(field_set:message.Locate_status_msg.dj_statu2)
+}
+
+// required .message.Lidar_statu dj_statu3 = 5;
+inline bool Locate_status_msg::has_dj_statu3() const {
+  return (_has_bits_[0] & 0x00000008u) != 0;
+}
+inline void Locate_status_msg::set_has_dj_statu3() {
+  _has_bits_[0] |= 0x00000008u;
+}
+inline void Locate_status_msg::clear_has_dj_statu3() {
+  _has_bits_[0] &= ~0x00000008u;
+}
+inline void Locate_status_msg::clear_dj_statu3() {
+  dj_statu3_ = 0;
+  clear_has_dj_statu3();
+}
+inline ::message::Lidar_statu Locate_status_msg::dj_statu3() const {
+  // @@protoc_insertion_point(field_get:message.Locate_status_msg.dj_statu3)
+  return static_cast< ::message::Lidar_statu >(dj_statu3_);
+}
+inline void Locate_status_msg::set_dj_statu3(::message::Lidar_statu value) {
+  assert(::message::Lidar_statu_IsValid(value));
+  set_has_dj_statu3();
+  dj_statu3_ = value;
+  // @@protoc_insertion_point(field_set:message.Locate_status_msg.dj_statu3)
+}
+
+// required .message.Lidar_statu dj_statu4 = 6;
+inline bool Locate_status_msg::has_dj_statu4() const {
+  return (_has_bits_[0] & 0x00000010u) != 0;
+}
+inline void Locate_status_msg::set_has_dj_statu4() {
+  _has_bits_[0] |= 0x00000010u;
+}
+inline void Locate_status_msg::clear_has_dj_statu4() {
+  _has_bits_[0] &= ~0x00000010u;
+}
+inline void Locate_status_msg::clear_dj_statu4() {
+  dj_statu4_ = 0;
+  clear_has_dj_statu4();
+}
+inline ::message::Lidar_statu Locate_status_msg::dj_statu4() const {
+  // @@protoc_insertion_point(field_get:message.Locate_status_msg.dj_statu4)
+  return static_cast< ::message::Lidar_statu >(dj_statu4_);
+}
+inline void Locate_status_msg::set_dj_statu4(::message::Lidar_statu value) {
+  assert(::message::Lidar_statu_IsValid(value));
+  set_has_dj_statu4();
+  dj_statu4_ = value;
+  // @@protoc_insertion_point(field_set:message.Locate_status_msg.dj_statu4)
 }
 
 // -------------------------------------------------------------------
 
 // Locate_request_msg
 
-// required .message.Command_message cmd_msg = 1;
+// required .message.Message_type msg_type = 1;
+inline bool Locate_request_msg::has_msg_type() const {
+  return (_has_bits_[0] & 0x00000004u) != 0;
+}
+inline void Locate_request_msg::set_has_msg_type() {
+  _has_bits_[0] |= 0x00000004u;
+}
+inline void Locate_request_msg::clear_has_msg_type() {
+  _has_bits_[0] &= ~0x00000004u;
+}
+inline void Locate_request_msg::clear_msg_type() {
+  msg_type_ = 1;
+  clear_has_msg_type();
+}
+inline ::message::Message_type Locate_request_msg::msg_type() const {
+  // @@protoc_insertion_point(field_get:message.Locate_request_msg.msg_type)
+  return static_cast< ::message::Message_type >(msg_type_);
+}
+inline void Locate_request_msg::set_msg_type(::message::Message_type value) {
+  assert(::message::Message_type_IsValid(value));
+  set_has_msg_type();
+  msg_type_ = value;
+  // @@protoc_insertion_point(field_set:message.Locate_request_msg.msg_type)
+}
+
+// required .message.Command_message cmd_msg = 2;
 inline bool Locate_request_msg::has_cmd_msg() const {
   return (_has_bits_[0] & 0x00000001u) != 0;
 }
@@ -718,7 +906,7 @@ inline void Locate_request_msg::set_allocated_cmd_msg(::message::Command_message
   // @@protoc_insertion_point(field_set_allocated:message.Locate_request_msg.cmd_msg)
 }
 
-// required .message.Locate_type locate_type = 2;
+// required .message.Locate_type locate_type = 3;
 inline bool Locate_request_msg::has_locate_type() const {
   return (_has_bits_[0] & 0x00000002u) != 0;
 }
@@ -743,18 +931,18 @@ inline void Locate_request_msg::set_locate_type(::message::Locate_type value) {
   // @@protoc_insertion_point(field_set:message.Locate_request_msg.locate_type)
 }
 
-// optional int32 time_out = 3 [default = 3000];
+// optional int32 time_out = 4 [default = 5000];
 inline bool Locate_request_msg::has_time_out() const {
-  return (_has_bits_[0] & 0x00000004u) != 0;
+  return (_has_bits_[0] & 0x00000008u) != 0;
 }
 inline void Locate_request_msg::set_has_time_out() {
-  _has_bits_[0] |= 0x00000004u;
+  _has_bits_[0] |= 0x00000008u;
 }
 inline void Locate_request_msg::clear_has_time_out() {
-  _has_bits_[0] &= ~0x00000004u;
+  _has_bits_[0] &= ~0x00000008u;
 }
 inline void Locate_request_msg::clear_time_out() {
-  time_out_ = 3000;
+  time_out_ = 5000;
   clear_has_time_out();
 }
 inline ::google::protobuf::int32 Locate_request_msg::time_out() const {
@@ -771,7 +959,32 @@ inline void Locate_request_msg::set_time_out(::google::protobuf::int32 value) {
 
 // Locate_response_msg
 
-// required .message.Command_message cmd_msg = 1;
+// required .message.Message_type msg_type = 1;
+inline bool Locate_response_msg::has_msg_type() const {
+  return (_has_bits_[0] & 0x00000400u) != 0;
+}
+inline void Locate_response_msg::set_has_msg_type() {
+  _has_bits_[0] |= 0x00000400u;
+}
+inline void Locate_response_msg::clear_has_msg_type() {
+  _has_bits_[0] &= ~0x00000400u;
+}
+inline void Locate_response_msg::clear_msg_type() {
+  msg_type_ = 1;
+  clear_has_msg_type();
+}
+inline ::message::Message_type Locate_response_msg::msg_type() const {
+  // @@protoc_insertion_point(field_get:message.Locate_response_msg.msg_type)
+  return static_cast< ::message::Message_type >(msg_type_);
+}
+inline void Locate_response_msg::set_msg_type(::message::Message_type value) {
+  assert(::message::Message_type_IsValid(value));
+  set_has_msg_type();
+  msg_type_ = value;
+  // @@protoc_insertion_point(field_set:message.Locate_response_msg.msg_type)
+}
+
+// required .message.Command_message cmd_msg = 2;
 inline bool Locate_response_msg::has_cmd_msg() const {
   return (_has_bits_[0] & 0x00000002u) != 0;
 }
@@ -821,7 +1034,7 @@ inline void Locate_response_msg::set_allocated_cmd_msg(::message::Command_messag
   // @@protoc_insertion_point(field_set_allocated:message.Locate_response_msg.cmd_msg)
 }
 
-// required int32 error_code = 2;
+// required int32 error_code = 3;
 inline bool Locate_response_msg::has_error_code() const {
   return (_has_bits_[0] & 0x00000004u) != 0;
 }
@@ -845,7 +1058,7 @@ inline void Locate_response_msg::set_error_code(::google::protobuf::int32 value)
   // @@protoc_insertion_point(field_set:message.Locate_response_msg.error_code)
 }
 
-// optional string error_description = 3;
+// optional string error_description = 4;
 inline bool Locate_response_msg::has_error_description() const {
   return (_has_bits_[0] & 0x00000001u) != 0;
 }
@@ -908,7 +1121,7 @@ inline void Locate_response_msg::set_allocated_error_description(::std::string*
   // @@protoc_insertion_point(field_set_allocated:message.Locate_response_msg.error_description)
 }
 
-// optional float length = 4;
+// optional float length = 5;
 inline bool Locate_response_msg::has_length() const {
   return (_has_bits_[0] & 0x00000008u) != 0;
 }
@@ -932,7 +1145,7 @@ inline void Locate_response_msg::set_length(float value) {
   // @@protoc_insertion_point(field_set:message.Locate_response_msg.length)
 }
 
-// optional float width = 5;
+// optional float width = 6;
 inline bool Locate_response_msg::has_width() const {
   return (_has_bits_[0] & 0x00000010u) != 0;
 }
@@ -956,7 +1169,7 @@ inline void Locate_response_msg::set_width(float value) {
   // @@protoc_insertion_point(field_set:message.Locate_response_msg.width)
 }
 
-// optional float height = 6;
+// optional float height = 7;
 inline bool Locate_response_msg::has_height() const {
   return (_has_bits_[0] & 0x00000020u) != 0;
 }
@@ -980,7 +1193,7 @@ inline void Locate_response_msg::set_height(float value) {
   // @@protoc_insertion_point(field_set:message.Locate_response_msg.height)
 }
 
-// optional float wheel_base = 7;
+// optional float wheel_base = 8;
 inline bool Locate_response_msg::has_wheel_base() const {
   return (_has_bits_[0] & 0x00000040u) != 0;
 }
@@ -1004,7 +1217,7 @@ inline void Locate_response_msg::set_wheel_base(float value) {
   // @@protoc_insertion_point(field_set:message.Locate_response_msg.wheel_base)
 }
 
-// optional float x = 8;
+// optional float x = 9;
 inline bool Locate_response_msg::has_x() const {
   return (_has_bits_[0] & 0x00000080u) != 0;
 }
@@ -1028,7 +1241,7 @@ inline void Locate_response_msg::set_x(float value) {
   // @@protoc_insertion_point(field_set:message.Locate_response_msg.x)
 }
 
-// optional float y = 9;
+// optional float y = 10;
 inline bool Locate_response_msg::has_y() const {
   return (_has_bits_[0] & 0x00000100u) != 0;
 }
@@ -1052,7 +1265,7 @@ inline void Locate_response_msg::set_y(float value) {
   // @@protoc_insertion_point(field_set:message.Locate_response_msg.y)
 }
 
-// optional float theta = 10;
+// optional float theta = 11;
 inline bool Locate_response_msg::has_theta() const {
   return (_has_bits_[0] & 0x00000200u) != 0;
 }

+ 26 - 19
message/locate_message.proto

@@ -7,42 +7,49 @@ enum Lidar_statu        //雷达状态
     eNormal=0;
     eBusy=1;
     eLidarMiss=2;
-
 }
 
+//定位模块状态
 message Locate_status_msg
 {
-    optional Command_message            cmd_msg=1;                 //正在执行的指令信息(可无)
-    required Lidar_statu                statu=2;                       //测量雷达连接状态
+    required Message_type               msg_type=1;         //消息类型
+    optional Command_message            cmd_msg=2;                 //正在执行的指令信息(可无)
+    required Lidar_statu                dj_statu1=3;                       //大疆测量雷达1连接状态
+    required Lidar_statu                dj_statu2=4;                       //大疆测量雷达2连接状态
+    required Lidar_statu                dj_statu3=5;                       //大疆测量雷达3连接状态
+    required Lidar_statu                dj_statu4=6;                       //大疆测量雷达4连接状态
 }
 
 //定位类型
 enum Locate_type
 {
-    eReal_time=0;           //实时定位
-    eTrigger=1;             //触发式定位
+    eReal_time=0;           //实时定位,返回地面雷达实时数据
+    eTrigger=1;             //触发式定位,返回综合测量结果
 }
 
+//定位请求消息
 message Locate_request_msg
 {
-    required Command_message            cmd_msg=1;                 //指令信息
-    required Locate_type                locate_type=2;
-    optional int32                      time_out=3 [default=3000];           //定位测量超时设置
+    required Message_type               msg_type=1;         //消息类型
+    required Command_message            cmd_msg=2;                 //指令信息
+    required Locate_type                locate_type=3;
+    optional int32                      time_out=4 [default=5000];           //定位测量超时设置
 }
 
-
+//定位测量返回消息
 message Locate_response_msg
 {
-    required Command_message            cmd_msg=1;
-    required int32                      error_code=2;
-    optional string                     error_description=3;
-    optional float                      length=4;
-    optional float                      width=5;
-    optional float                      height=6;
-    optional float                      wheel_base=7;
-    optional float                      x=8;
-    optional float                      y=9;
-    optional float                      theta=10;
+    required Message_type               msg_type=1;         //消息类型
+    required Command_message            cmd_msg=2;
+    required int32                      error_code=3;
+    optional string                     error_description=4;
+    optional float                      length=5;
+    optional float                      width=6;
+    optional float                      height=7;
+    optional float                      wheel_base=8;
+    optional float                      x=9;
+    optional float                      y=10;
+    optional float                      theta=11;
 
 }
 

+ 126 - 50
message/message_base.pb.cc

@@ -49,7 +49,7 @@ void InitDefaultsCommand_message() {
 }
 
 ::google::protobuf::Metadata file_level_metadata[1];
-const ::google::protobuf::EnumDescriptor* file_level_enum_descriptors[1];
+const ::google::protobuf::EnumDescriptor* file_level_enum_descriptors[2];
 
 const ::google::protobuf::uint32 TableStruct::offsets[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = {
   GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::message::Command_message, _has_bits_),
@@ -57,17 +57,19 @@ const ::google::protobuf::uint32 TableStruct::offsets[] GOOGLE_PROTOBUF_ATTRIBUT
   ~0u,  // no _extensions_
   ~0u,  // no _oneof_case_
   ~0u,  // no _weak_field_map_
+  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::message::Command_message, msg_type_),
   GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::message::Command_message, command_id_),
   GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::message::Command_message, act_type_),
   GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::message::Command_message, from_id_),
   GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::message::Command_message, destination_id_),
+  4,
   0,
   1,
   2,
   3,
 };
 static const ::google::protobuf::internal::MigrationSchema schemas[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = {
-  { 0, 9, sizeof(::message::Command_message)},
+  { 0, 10, sizeof(::message::Command_message)},
 };
 
 static ::google::protobuf::Message const * const file_default_instances[] = {
@@ -96,14 +98,20 @@ void protobuf_RegisterTypes(const ::std::string&) {
 void AddDescriptorsImpl() {
   InitDefaults();
   static const char descriptor[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = {
-      "\n\022message_base.proto\022\007message\"v\n\017Command"
-      "_message\022\022\n\ncommand_id\030\001 \002(\005\022&\n\010act_type"
-      "\030\002 \002(\0162\024.message.Action_type\022\017\n\007from_id\030"
-      "\003 \002(\005\022\026\n\016destination_id\030\004 \002(\005*#\n\013Action_"
-      "type\022\t\n\005ePark\020\000\022\t\n\005ePick\020\001"
+      "\n\022message_base.proto\022\007message\"\237\001\n\017Comman"
+      "d_message\022\'\n\010msg_type\030\001 \002(\0162\025.message.Me"
+      "ssage_type\022\022\n\ncommand_id\030\002 \002(\005\022&\n\010act_ty"
+      "pe\030\003 \002(\0162\024.message.Action_type\022\017\n\007from_i"
+      "d\030\004 \002(\005\022\026\n\016destination_id\030\005 \002(\005*\270\001\n\014Mess"
+      "age_type\022\020\n\014eCommand_msg\020\001\022\026\n\022eLocate_st"
+      "atus_msg\020\021\022\027\n\023eLocate_request_msg\020\022\022\030\n\024e"
+      "Locate_response_msg\020\023\022\026\n\022eHarware_statu_"
+      "msg\020!\022\030\n\024eExecute_request_msg\020\"\022\031\n\025eExec"
+      "ute_response_msg\020#*#\n\013Action_type\022\t\n\005ePa"
+      "rk\020\000\022\t\n\005ePick\020\001"
   };
   ::google::protobuf::DescriptorPool::InternalAddGeneratedFile(
-      descriptor, 186);
+      descriptor, 415);
   ::google::protobuf::MessageFactory::InternalRegisterGeneratedFile(
     "message_base.proto", &protobuf_RegisterTypes);
 }
@@ -120,10 +128,29 @@ struct StaticDescriptorInitializer {
 } static_descriptor_initializer;
 }  // namespace protobuf_message_5fbase_2eproto
 namespace message {
-const ::google::protobuf::EnumDescriptor* Action_type_descriptor() {
+const ::google::protobuf::EnumDescriptor* Message_type_descriptor() {
   protobuf_message_5fbase_2eproto::protobuf_AssignDescriptorsOnce();
   return protobuf_message_5fbase_2eproto::file_level_enum_descriptors[0];
 }
+bool Message_type_IsValid(int value) {
+  switch (value) {
+    case 1:
+    case 17:
+    case 18:
+    case 19:
+    case 33:
+    case 34:
+    case 35:
+      return true;
+    default:
+      return false;
+  }
+}
+
+const ::google::protobuf::EnumDescriptor* Action_type_descriptor() {
+  protobuf_message_5fbase_2eproto::protobuf_AssignDescriptorsOnce();
+  return protobuf_message_5fbase_2eproto::file_level_enum_descriptors[1];
+}
 bool Action_type_IsValid(int value) {
   switch (value) {
     case 0:
@@ -140,6 +167,7 @@ bool Action_type_IsValid(int value) {
 void Command_message::InitAsDefaultInstance() {
 }
 #if !defined(_MSC_VER) || _MSC_VER >= 1900
+const int Command_message::kMsgTypeFieldNumber;
 const int Command_message::kCommandIdFieldNumber;
 const int Command_message::kActTypeFieldNumber;
 const int Command_message::kFromIdFieldNumber;
@@ -161,8 +189,8 @@ Command_message::Command_message(const Command_message& from)
       _cached_size_(0) {
   _internal_metadata_.MergeFrom(from._internal_metadata_);
   ::memcpy(&command_id_, &from.command_id_,
-    static_cast<size_t>(reinterpret_cast<char*>(&destination_id_) -
-    reinterpret_cast<char*>(&command_id_)) + sizeof(destination_id_));
+    static_cast<size_t>(reinterpret_cast<char*>(&msg_type_) -
+    reinterpret_cast<char*>(&command_id_)) + sizeof(msg_type_));
   // @@protoc_insertion_point(copy_constructor:message.Command_message)
 }
 
@@ -171,6 +199,7 @@ void Command_message::SharedCtor() {
   ::memset(&command_id_, 0, static_cast<size_t>(
       reinterpret_cast<char*>(&destination_id_) -
       reinterpret_cast<char*>(&command_id_)) + sizeof(destination_id_));
+  msg_type_ = 1;
 }
 
 Command_message::~Command_message() {
@@ -211,10 +240,11 @@ void Command_message::Clear() {
   (void) cached_has_bits;
 
   cached_has_bits = _has_bits_[0];
-  if (cached_has_bits & 15u) {
+  if (cached_has_bits & 31u) {
     ::memset(&command_id_, 0, static_cast<size_t>(
         reinterpret_cast<char*>(&destination_id_) -
         reinterpret_cast<char*>(&command_id_)) + sizeof(destination_id_));
+    msg_type_ = 1;
   }
   _has_bits_.Clear();
   _internal_metadata_.Clear();
@@ -230,10 +260,30 @@ bool Command_message::MergePartialFromCodedStream(
     tag = p.first;
     if (!p.second) goto handle_unusual;
     switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
-      // required int32 command_id = 1;
+      // required .message.Message_type msg_type = 1;
       case 1: {
         if (static_cast< ::google::protobuf::uint8>(tag) ==
             static_cast< ::google::protobuf::uint8>(8u /* 8 & 0xFF */)) {
+          int value;
+          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
+                   int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>(
+                 input, &value)));
+          if (::message::Message_type_IsValid(value)) {
+            set_msg_type(static_cast< ::message::Message_type >(value));
+          } else {
+            mutable_unknown_fields()->AddVarint(
+                1, static_cast< ::google::protobuf::uint64>(value));
+          }
+        } else {
+          goto handle_unusual;
+        }
+        break;
+      }
+
+      // required int32 command_id = 2;
+      case 2: {
+        if (static_cast< ::google::protobuf::uint8>(tag) ==
+            static_cast< ::google::protobuf::uint8>(16u /* 16 & 0xFF */)) {
           set_has_command_id();
           DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
                    ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
@@ -244,10 +294,10 @@ bool Command_message::MergePartialFromCodedStream(
         break;
       }
 
-      // required .message.Action_type act_type = 2;
-      case 2: {
+      // required .message.Action_type act_type = 3;
+      case 3: {
         if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(16u /* 16 & 0xFF */)) {
+            static_cast< ::google::protobuf::uint8>(24u /* 24 & 0xFF */)) {
           int value;
           DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
                    int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>(
@@ -256,7 +306,7 @@ bool Command_message::MergePartialFromCodedStream(
             set_act_type(static_cast< ::message::Action_type >(value));
           } else {
             mutable_unknown_fields()->AddVarint(
-                2, static_cast< ::google::protobuf::uint64>(value));
+                3, static_cast< ::google::protobuf::uint64>(value));
           }
         } else {
           goto handle_unusual;
@@ -264,10 +314,10 @@ bool Command_message::MergePartialFromCodedStream(
         break;
       }
 
-      // required int32 from_id = 3;
-      case 3: {
+      // required int32 from_id = 4;
+      case 4: {
         if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(24u /* 24 & 0xFF */)) {
+            static_cast< ::google::protobuf::uint8>(32u /* 32 & 0xFF */)) {
           set_has_from_id();
           DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
                    ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
@@ -278,10 +328,10 @@ bool Command_message::MergePartialFromCodedStream(
         break;
       }
 
-      // required int32 destination_id = 4;
-      case 4: {
+      // required int32 destination_id = 5;
+      case 5: {
         if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(32u /* 32 & 0xFF */)) {
+            static_cast< ::google::protobuf::uint8>(40u /* 40 & 0xFF */)) {
           set_has_destination_id();
           DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
                    ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
@@ -319,25 +369,31 @@ void Command_message::SerializeWithCachedSizes(
   (void) cached_has_bits;
 
   cached_has_bits = _has_bits_[0];
-  // required int32 command_id = 1;
+  // required .message.Message_type msg_type = 1;
+  if (cached_has_bits & 0x00000010u) {
+    ::google::protobuf::internal::WireFormatLite::WriteEnum(
+      1, this->msg_type(), output);
+  }
+
+  // required int32 command_id = 2;
   if (cached_has_bits & 0x00000001u) {
-    ::google::protobuf::internal::WireFormatLite::WriteInt32(1, this->command_id(), output);
+    ::google::protobuf::internal::WireFormatLite::WriteInt32(2, this->command_id(), output);
   }
 
-  // required .message.Action_type act_type = 2;
+  // required .message.Action_type act_type = 3;
   if (cached_has_bits & 0x00000002u) {
     ::google::protobuf::internal::WireFormatLite::WriteEnum(
-      2, this->act_type(), output);
+      3, this->act_type(), output);
   }
 
-  // required int32 from_id = 3;
+  // required int32 from_id = 4;
   if (cached_has_bits & 0x00000004u) {
-    ::google::protobuf::internal::WireFormatLite::WriteInt32(3, this->from_id(), output);
+    ::google::protobuf::internal::WireFormatLite::WriteInt32(4, this->from_id(), output);
   }
 
-  // required int32 destination_id = 4;
+  // required int32 destination_id = 5;
   if (cached_has_bits & 0x00000008u) {
-    ::google::protobuf::internal::WireFormatLite::WriteInt32(4, this->destination_id(), output);
+    ::google::protobuf::internal::WireFormatLite::WriteInt32(5, this->destination_id(), output);
   }
 
   if (_internal_metadata_.have_unknown_fields()) {
@@ -355,25 +411,31 @@ void Command_message::SerializeWithCachedSizes(
   (void) cached_has_bits;
 
   cached_has_bits = _has_bits_[0];
-  // required int32 command_id = 1;
+  // required .message.Message_type msg_type = 1;
+  if (cached_has_bits & 0x00000010u) {
+    target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray(
+      1, this->msg_type(), target);
+  }
+
+  // required int32 command_id = 2;
   if (cached_has_bits & 0x00000001u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(1, this->command_id(), target);
+    target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(2, this->command_id(), target);
   }
 
-  // required .message.Action_type act_type = 2;
+  // required .message.Action_type act_type = 3;
   if (cached_has_bits & 0x00000002u) {
     target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray(
-      2, this->act_type(), target);
+      3, this->act_type(), target);
   }
 
-  // required int32 from_id = 3;
+  // required int32 from_id = 4;
   if (cached_has_bits & 0x00000004u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(3, this->from_id(), target);
+    target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(4, this->from_id(), target);
   }
 
-  // required int32 destination_id = 4;
+  // required int32 destination_id = 5;
   if (cached_has_bits & 0x00000008u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(4, this->destination_id(), target);
+    target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(5, this->destination_id(), target);
   }
 
   if (_internal_metadata_.have_unknown_fields()) {
@@ -389,32 +451,38 @@ size_t Command_message::RequiredFieldsByteSizeFallback() const {
   size_t total_size = 0;
 
   if (has_command_id()) {
-    // required int32 command_id = 1;
+    // required int32 command_id = 2;
     total_size += 1 +
       ::google::protobuf::internal::WireFormatLite::Int32Size(
         this->command_id());
   }
 
   if (has_act_type()) {
-    // required .message.Action_type act_type = 2;
+    // required .message.Action_type act_type = 3;
     total_size += 1 +
       ::google::protobuf::internal::WireFormatLite::EnumSize(this->act_type());
   }
 
   if (has_from_id()) {
-    // required int32 from_id = 3;
+    // required int32 from_id = 4;
     total_size += 1 +
       ::google::protobuf::internal::WireFormatLite::Int32Size(
         this->from_id());
   }
 
   if (has_destination_id()) {
-    // required int32 destination_id = 4;
+    // required int32 destination_id = 5;
     total_size += 1 +
       ::google::protobuf::internal::WireFormatLite::Int32Size(
         this->destination_id());
   }
 
+  if (has_msg_type()) {
+    // required .message.Message_type msg_type = 1;
+    total_size += 1 +
+      ::google::protobuf::internal::WireFormatLite::EnumSize(this->msg_type());
+  }
+
   return total_size;
 }
 size_t Command_message::ByteSizeLong() const {
@@ -426,26 +494,30 @@ size_t Command_message::ByteSizeLong() const {
       ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
         _internal_metadata_.unknown_fields());
   }
-  if (((_has_bits_[0] & 0x0000000f) ^ 0x0000000f) == 0) {  // All required fields are present.
-    // required int32 command_id = 1;
+  if (((_has_bits_[0] & 0x0000001f) ^ 0x0000001f) == 0) {  // All required fields are present.
+    // required int32 command_id = 2;
     total_size += 1 +
       ::google::protobuf::internal::WireFormatLite::Int32Size(
         this->command_id());
 
-    // required .message.Action_type act_type = 2;
+    // required .message.Action_type act_type = 3;
     total_size += 1 +
       ::google::protobuf::internal::WireFormatLite::EnumSize(this->act_type());
 
-    // required int32 from_id = 3;
+    // required int32 from_id = 4;
     total_size += 1 +
       ::google::protobuf::internal::WireFormatLite::Int32Size(
         this->from_id());
 
-    // required int32 destination_id = 4;
+    // required int32 destination_id = 5;
     total_size += 1 +
       ::google::protobuf::internal::WireFormatLite::Int32Size(
         this->destination_id());
 
+    // required .message.Message_type msg_type = 1;
+    total_size += 1 +
+      ::google::protobuf::internal::WireFormatLite::EnumSize(this->msg_type());
+
   } else {
     total_size += RequiredFieldsByteSizeFallback();
   }
@@ -479,7 +551,7 @@ void Command_message::MergeFrom(const Command_message& from) {
   (void) cached_has_bits;
 
   cached_has_bits = from._has_bits_[0];
-  if (cached_has_bits & 15u) {
+  if (cached_has_bits & 31u) {
     if (cached_has_bits & 0x00000001u) {
       command_id_ = from.command_id_;
     }
@@ -492,6 +564,9 @@ void Command_message::MergeFrom(const Command_message& from) {
     if (cached_has_bits & 0x00000008u) {
       destination_id_ = from.destination_id_;
     }
+    if (cached_has_bits & 0x00000010u) {
+      msg_type_ = from.msg_type_;
+    }
     _has_bits_[0] |= cached_has_bits;
   }
 }
@@ -511,7 +586,7 @@ void Command_message::CopyFrom(const Command_message& from) {
 }
 
 bool Command_message::IsInitialized() const {
-  if ((_has_bits_[0] & 0x0000000f) != 0x0000000f) return false;
+  if ((_has_bits_[0] & 0x0000001f) != 0x0000001f) return false;
   return true;
 }
 
@@ -525,6 +600,7 @@ void Command_message::InternalSwap(Command_message* other) {
   swap(act_type_, other->act_type_);
   swap(from_id_, other->from_id_);
   swap(destination_id_, other->destination_id_);
+  swap(msg_type_, other->msg_type_);
   swap(_has_bits_[0], other->_has_bits_[0]);
   _internal_metadata_.Swap(&other->_internal_metadata_);
   swap(_cached_size_, other->_cached_size_);

+ 76 - 12
message/message_base.pb.h

@@ -56,6 +56,30 @@ extern Command_messageDefaultTypeInternal _Command_message_default_instance_;
 }  // namespace message
 namespace message {
 
+enum Message_type {
+  eCommand_msg = 1,
+  eLocate_status_msg = 17,
+  eLocate_request_msg = 18,
+  eLocate_response_msg = 19,
+  eHarware_statu_msg = 33,
+  eExecute_request_msg = 34,
+  eExecute_response_msg = 35
+};
+bool Message_type_IsValid(int value);
+const Message_type Message_type_MIN = eCommand_msg;
+const Message_type Message_type_MAX = eExecute_response_msg;
+const int Message_type_ARRAYSIZE = Message_type_MAX + 1;
+
+const ::google::protobuf::EnumDescriptor* Message_type_descriptor();
+inline const ::std::string& Message_type_Name(Message_type value) {
+  return ::google::protobuf::internal::NameOfEnum(
+    Message_type_descriptor(), value);
+}
+inline bool Message_type_Parse(
+    const ::std::string& name, Message_type* value) {
+  return ::google::protobuf::internal::ParseNamedEnum<Message_type>(
+    Message_type_descriptor(), name, value);
+}
 enum Action_type {
   ePark = 0,
   ePick = 1
@@ -166,36 +190,45 @@ class Command_message : public ::google::protobuf::Message /* @@protoc_insertion
 
   // accessors -------------------------------------------------------
 
-  // required int32 command_id = 1;
+  // required int32 command_id = 2;
   bool has_command_id() const;
   void clear_command_id();
-  static const int kCommandIdFieldNumber = 1;
+  static const int kCommandIdFieldNumber = 2;
   ::google::protobuf::int32 command_id() const;
   void set_command_id(::google::protobuf::int32 value);
 
-  // required .message.Action_type act_type = 2;
+  // required .message.Action_type act_type = 3;
   bool has_act_type() const;
   void clear_act_type();
-  static const int kActTypeFieldNumber = 2;
+  static const int kActTypeFieldNumber = 3;
   ::message::Action_type act_type() const;
   void set_act_type(::message::Action_type value);
 
-  // required int32 from_id = 3;
+  // required int32 from_id = 4;
   bool has_from_id() const;
   void clear_from_id();
-  static const int kFromIdFieldNumber = 3;
+  static const int kFromIdFieldNumber = 4;
   ::google::protobuf::int32 from_id() const;
   void set_from_id(::google::protobuf::int32 value);
 
-  // required int32 destination_id = 4;
+  // required int32 destination_id = 5;
   bool has_destination_id() const;
   void clear_destination_id();
-  static const int kDestinationIdFieldNumber = 4;
+  static const int kDestinationIdFieldNumber = 5;
   ::google::protobuf::int32 destination_id() const;
   void set_destination_id(::google::protobuf::int32 value);
 
+  // required .message.Message_type msg_type = 1;
+  bool has_msg_type() const;
+  void clear_msg_type();
+  static const int kMsgTypeFieldNumber = 1;
+  ::message::Message_type msg_type() const;
+  void set_msg_type(::message::Message_type value);
+
   // @@protoc_insertion_point(class_scope:message.Command_message)
  private:
+  void set_has_msg_type();
+  void clear_has_msg_type();
   void set_has_command_id();
   void clear_has_command_id();
   void set_has_act_type();
@@ -215,6 +248,7 @@ class Command_message : public ::google::protobuf::Message /* @@protoc_insertion
   int act_type_;
   ::google::protobuf::int32 from_id_;
   ::google::protobuf::int32 destination_id_;
+  int msg_type_;
   friend struct ::protobuf_message_5fbase_2eproto::TableStruct;
   friend void ::protobuf_message_5fbase_2eproto::InitDefaultsCommand_messageImpl();
 };
@@ -229,7 +263,32 @@ class Command_message : public ::google::protobuf::Message /* @@protoc_insertion
 #endif  // __GNUC__
 // Command_message
 
-// required int32 command_id = 1;
+// required .message.Message_type msg_type = 1;
+inline bool Command_message::has_msg_type() const {
+  return (_has_bits_[0] & 0x00000010u) != 0;
+}
+inline void Command_message::set_has_msg_type() {
+  _has_bits_[0] |= 0x00000010u;
+}
+inline void Command_message::clear_has_msg_type() {
+  _has_bits_[0] &= ~0x00000010u;
+}
+inline void Command_message::clear_msg_type() {
+  msg_type_ = 1;
+  clear_has_msg_type();
+}
+inline ::message::Message_type Command_message::msg_type() const {
+  // @@protoc_insertion_point(field_get:message.Command_message.msg_type)
+  return static_cast< ::message::Message_type >(msg_type_);
+}
+inline void Command_message::set_msg_type(::message::Message_type value) {
+  assert(::message::Message_type_IsValid(value));
+  set_has_msg_type();
+  msg_type_ = value;
+  // @@protoc_insertion_point(field_set:message.Command_message.msg_type)
+}
+
+// required int32 command_id = 2;
 inline bool Command_message::has_command_id() const {
   return (_has_bits_[0] & 0x00000001u) != 0;
 }
@@ -253,7 +312,7 @@ inline void Command_message::set_command_id(::google::protobuf::int32 value) {
   // @@protoc_insertion_point(field_set:message.Command_message.command_id)
 }
 
-// required .message.Action_type act_type = 2;
+// required .message.Action_type act_type = 3;
 inline bool Command_message::has_act_type() const {
   return (_has_bits_[0] & 0x00000002u) != 0;
 }
@@ -278,7 +337,7 @@ inline void Command_message::set_act_type(::message::Action_type value) {
   // @@protoc_insertion_point(field_set:message.Command_message.act_type)
 }
 
-// required int32 from_id = 3;
+// required int32 from_id = 4;
 inline bool Command_message::has_from_id() const {
   return (_has_bits_[0] & 0x00000004u) != 0;
 }
@@ -302,7 +361,7 @@ inline void Command_message::set_from_id(::google::protobuf::int32 value) {
   // @@protoc_insertion_point(field_set:message.Command_message.from_id)
 }
 
-// required int32 destination_id = 4;
+// required int32 destination_id = 5;
 inline bool Command_message::has_destination_id() const {
   return (_has_bits_[0] & 0x00000008u) != 0;
 }
@@ -337,6 +396,11 @@ inline void Command_message::set_destination_id(::google::protobuf::int32 value)
 namespace google {
 namespace protobuf {
 
+template <> struct is_proto_enum< ::message::Message_type> : ::google::protobuf::internal::true_type {};
+template <>
+inline const EnumDescriptor* GetEnumDescriptor< ::message::Message_type>() {
+  return ::message::Message_type_descriptor();
+}
 template <> struct is_proto_enum< ::message::Action_type> : ::google::protobuf::internal::true_type {};
 template <>
 inline const EnumDescriptor* GetEnumDescriptor< ::message::Action_type>() {

+ 22 - 4
message/message_base.proto

@@ -1,6 +1,23 @@
 syntax = "proto2";
 package message;
 
+//消息类型定义,每个在网络上传输的消息必须含有这个属性
+enum Message_type
+{
+    eCommand_msg=0x01;                      //指令消息
+
+
+    eLocate_status_msg=0x11;                //定位模块状态消息
+    eLocate_request_msg=0x12;               //定位请求消息
+    eLocate_response_msg=0x13;              //定位反馈消息
+
+
+    eHarware_statu_msg=0x21;                //调度模块硬件状态消息
+    eExecute_request_msg=0x22;              //请求调度消息
+    eExecute_response_msg=0x23;             //调度结果反馈消息
+
+}
+
 enum Action_type
 {
     ePark=0;
@@ -10,8 +27,9 @@ enum Action_type
 //指令信息
 message Command_message
 {
-    required int32          command_id=1;                //指令唯一标识符id
-    required Action_type    act_type=2;            //指令类型
-    required int32          from_id=3;                   //指令动作出发地
-    required int32          destination_id=4;            //指令动作目的地
+    required Message_type               msg_type=1;         //消息类型
+    required int32                      command_id=2;                //指令唯一标识符id
+    required Action_type                act_type=3;                  //指令类型
+    required int32                      from_id=4;                   //指令动作出发地
+    required int32                      destination_id=5;            //指令动作目的地
 }

+ 109 - 109
setting.pb.cc

@@ -19,18 +19,18 @@
 #include "third_party/protobuf/version.h"
 #endif
 // @@protoc_insertion_point(includes)
-namespace global {
+namespace setting {
 class locate_settingDefaultTypeInternal {
  public:
   ::google::protobuf::internal::ExplicitlyConstructed<locate_setting>
       _instance;
 } _locate_setting_default_instance_;
-class settingDefaultTypeInternal {
+class global_settingDefaultTypeInternal {
  public:
-  ::google::protobuf::internal::ExplicitlyConstructed<setting>
+  ::google::protobuf::internal::ExplicitlyConstructed<global_setting>
       _instance;
-} _setting_default_instance_;
-}  // namespace global
+} _global_setting_default_instance_;
+}  // namespace setting
 namespace protobuf_setting_2eproto {
 void InitDefaultslocate_settingImpl() {
   GOOGLE_PROTOBUF_VERIFY_VERSION;
@@ -41,11 +41,11 @@ void InitDefaultslocate_settingImpl() {
   ::google::protobuf::internal::InitProtobufDefaults();
 #endif  // GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
   {
-    void* ptr = &::global::_locate_setting_default_instance_;
-    new (ptr) ::global::locate_setting();
+    void* ptr = &::setting::_locate_setting_default_instance_;
+    new (ptr) ::setting::locate_setting();
     ::google::protobuf::internal::OnShutdownDestroyMessage(ptr);
   }
-  ::global::locate_setting::InitAsDefaultInstance();
+  ::setting::locate_setting::InitAsDefaultInstance();
 }
 
 void InitDefaultslocate_setting() {
@@ -53,7 +53,7 @@ void InitDefaultslocate_setting() {
   ::google::protobuf::GoogleOnceInit(&once, &InitDefaultslocate_settingImpl);
 }
 
-void InitDefaultssettingImpl() {
+void InitDefaultsglobal_settingImpl() {
   GOOGLE_PROTOBUF_VERIFY_VERSION;
 
 #ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
@@ -63,46 +63,46 @@ void InitDefaultssettingImpl() {
 #endif  // GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
   protobuf_setting_2eproto::InitDefaultslocate_setting();
   {
-    void* ptr = &::global::_setting_default_instance_;
-    new (ptr) ::global::setting();
+    void* ptr = &::setting::_global_setting_default_instance_;
+    new (ptr) ::setting::global_setting();
     ::google::protobuf::internal::OnShutdownDestroyMessage(ptr);
   }
-  ::global::setting::InitAsDefaultInstance();
+  ::setting::global_setting::InitAsDefaultInstance();
 }
 
-void InitDefaultssetting() {
+void InitDefaultsglobal_setting() {
   static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
-  ::google::protobuf::GoogleOnceInit(&once, &InitDefaultssettingImpl);
+  ::google::protobuf::GoogleOnceInit(&once, &InitDefaultsglobal_settingImpl);
 }
 
 ::google::protobuf::Metadata file_level_metadata[2];
 
 const ::google::protobuf::uint32 TableStruct::offsets[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = {
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::global::locate_setting, _has_bits_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::global::locate_setting, _internal_metadata_),
+  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::setting::locate_setting, _has_bits_),
+  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::setting::locate_setting, _internal_metadata_),
   ~0u,  // no _extensions_
   ~0u,  // no _oneof_case_
   ~0u,  // no _weak_field_map_
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::global::locate_setting, ip_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::global::locate_setting, port_),
+  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::setting::locate_setting, ip_),
+  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::setting::locate_setting, port_),
   0,
   1,
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::global::setting, _has_bits_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::global::setting, _internal_metadata_),
+  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::setting::global_setting, _has_bits_),
+  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::setting::global_setting, _internal_metadata_),
   ~0u,  // no _extensions_
   ~0u,  // no _oneof_case_
   ~0u,  // no _weak_field_map_
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::global::setting, locate_parameter_),
+  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::setting::global_setting, locate_parameter_),
   0,
 };
 static const ::google::protobuf::internal::MigrationSchema schemas[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = {
-  { 0, 7, sizeof(::global::locate_setting)},
-  { 9, 15, sizeof(::global::setting)},
+  { 0, 7, sizeof(::setting::locate_setting)},
+  { 9, 15, sizeof(::setting::global_setting)},
 };
 
 static ::google::protobuf::Message const * const file_default_instances[] = {
-  reinterpret_cast<const ::google::protobuf::Message*>(&::global::_locate_setting_default_instance_),
-  reinterpret_cast<const ::google::protobuf::Message*>(&::global::_setting_default_instance_),
+  reinterpret_cast<const ::google::protobuf::Message*>(&::setting::_locate_setting_default_instance_),
+  reinterpret_cast<const ::google::protobuf::Message*>(&::setting::_global_setting_default_instance_),
 };
 
 void protobuf_AssignDescriptors() {
@@ -127,13 +127,13 @@ void protobuf_RegisterTypes(const ::std::string&) {
 void AddDescriptorsImpl() {
   InitDefaults();
   static const char descriptor[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = {
-      "\n\rsetting.proto\022\006global\"*\n\016locate_settin"
-      "g\022\n\n\002ip\030\001 \002(\t\022\014\n\004port\030\002 \002(\005\";\n\007setting\0220"
-      "\n\020locate_parameter\030\001 \002(\0132\026.global.locate"
-      "_setting"
+      "\n\rsetting.proto\022\007setting\"*\n\016locate_setti"
+      "ng\022\n\n\002ip\030\001 \002(\t\022\014\n\004port\030\002 \002(\005\"C\n\016global_s"
+      "etting\0221\n\020locate_parameter\030\001 \002(\0132\027.setti"
+      "ng.locate_setting"
   };
   ::google::protobuf::DescriptorPool::InternalAddGeneratedFile(
-      descriptor, 128);
+      descriptor, 137);
   ::google::protobuf::MessageFactory::InternalRegisterGeneratedFile(
     "setting.proto", &protobuf_RegisterTypes);
 }
@@ -149,7 +149,7 @@ struct StaticDescriptorInitializer {
   }
 } static_descriptor_initializer;
 }  // namespace protobuf_setting_2eproto
-namespace global {
+namespace setting {
 
 // ===================================================================
 
@@ -166,7 +166,7 @@ locate_setting::locate_setting()
     ::protobuf_setting_2eproto::InitDefaultslocate_setting();
   }
   SharedCtor();
-  // @@protoc_insertion_point(constructor:global.locate_setting)
+  // @@protoc_insertion_point(constructor:setting.locate_setting)
 }
 locate_setting::locate_setting(const locate_setting& from)
   : ::google::protobuf::Message(),
@@ -179,7 +179,7 @@ locate_setting::locate_setting(const locate_setting& from)
     ip_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.ip_);
   }
   port_ = from.port_;
-  // @@protoc_insertion_point(copy_constructor:global.locate_setting)
+  // @@protoc_insertion_point(copy_constructor:setting.locate_setting)
 }
 
 void locate_setting::SharedCtor() {
@@ -189,7 +189,7 @@ void locate_setting::SharedCtor() {
 }
 
 locate_setting::~locate_setting() {
-  // @@protoc_insertion_point(destructor:global.locate_setting)
+  // @@protoc_insertion_point(destructor:setting.locate_setting)
   SharedDtor();
 }
 
@@ -221,7 +221,7 @@ locate_setting* locate_setting::New(::google::protobuf::Arena* arena) const {
 }
 
 void locate_setting::Clear() {
-// @@protoc_insertion_point(message_clear_start:global.locate_setting)
+// @@protoc_insertion_point(message_clear_start:setting.locate_setting)
   ::google::protobuf::uint32 cached_has_bits = 0;
   // Prevent compiler warnings about cached_has_bits being unused
   (void) cached_has_bits;
@@ -240,7 +240,7 @@ bool locate_setting::MergePartialFromCodedStream(
     ::google::protobuf::io::CodedInputStream* input) {
 #define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure
   ::google::protobuf::uint32 tag;
-  // @@protoc_insertion_point(parse_start:global.locate_setting)
+  // @@protoc_insertion_point(parse_start:setting.locate_setting)
   for (;;) {
     ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u);
     tag = p.first;
@@ -255,7 +255,7 @@ bool locate_setting::MergePartialFromCodedStream(
           ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
             this->ip().data(), static_cast<int>(this->ip().length()),
             ::google::protobuf::internal::WireFormat::PARSE,
-            "global.locate_setting.ip");
+            "setting.locate_setting.ip");
         } else {
           goto handle_unusual;
         }
@@ -288,17 +288,17 @@ bool locate_setting::MergePartialFromCodedStream(
     }
   }
 success:
-  // @@protoc_insertion_point(parse_success:global.locate_setting)
+  // @@protoc_insertion_point(parse_success:setting.locate_setting)
   return true;
 failure:
-  // @@protoc_insertion_point(parse_failure:global.locate_setting)
+  // @@protoc_insertion_point(parse_failure:setting.locate_setting)
   return false;
 #undef DO_
 }
 
 void locate_setting::SerializeWithCachedSizes(
     ::google::protobuf::io::CodedOutputStream* output) const {
-  // @@protoc_insertion_point(serialize_start:global.locate_setting)
+  // @@protoc_insertion_point(serialize_start:setting.locate_setting)
   ::google::protobuf::uint32 cached_has_bits = 0;
   (void) cached_has_bits;
 
@@ -308,7 +308,7 @@ void locate_setting::SerializeWithCachedSizes(
     ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
       this->ip().data(), static_cast<int>(this->ip().length()),
       ::google::protobuf::internal::WireFormat::SERIALIZE,
-      "global.locate_setting.ip");
+      "setting.locate_setting.ip");
     ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
       1, this->ip(), output);
   }
@@ -322,13 +322,13 @@ void locate_setting::SerializeWithCachedSizes(
     ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
         _internal_metadata_.unknown_fields(), output);
   }
-  // @@protoc_insertion_point(serialize_end:global.locate_setting)
+  // @@protoc_insertion_point(serialize_end:setting.locate_setting)
 }
 
 ::google::protobuf::uint8* locate_setting::InternalSerializeWithCachedSizesToArray(
     bool deterministic, ::google::protobuf::uint8* target) const {
   (void)deterministic; // Unused
-  // @@protoc_insertion_point(serialize_to_array_start:global.locate_setting)
+  // @@protoc_insertion_point(serialize_to_array_start:setting.locate_setting)
   ::google::protobuf::uint32 cached_has_bits = 0;
   (void) cached_has_bits;
 
@@ -338,7 +338,7 @@ void locate_setting::SerializeWithCachedSizes(
     ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
       this->ip().data(), static_cast<int>(this->ip().length()),
       ::google::protobuf::internal::WireFormat::SERIALIZE,
-      "global.locate_setting.ip");
+      "setting.locate_setting.ip");
     target =
       ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
         1, this->ip(), target);
@@ -353,12 +353,12 @@ void locate_setting::SerializeWithCachedSizes(
     target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
         _internal_metadata_.unknown_fields(), target);
   }
-  // @@protoc_insertion_point(serialize_to_array_end:global.locate_setting)
+  // @@protoc_insertion_point(serialize_to_array_end:setting.locate_setting)
   return target;
 }
 
 size_t locate_setting::RequiredFieldsByteSizeFallback() const {
-// @@protoc_insertion_point(required_fields_byte_size_fallback_start:global.locate_setting)
+// @@protoc_insertion_point(required_fields_byte_size_fallback_start:setting.locate_setting)
   size_t total_size = 0;
 
   if (has_ip()) {
@@ -378,7 +378,7 @@ size_t locate_setting::RequiredFieldsByteSizeFallback() const {
   return total_size;
 }
 size_t locate_setting::ByteSizeLong() const {
-// @@protoc_insertion_point(message_byte_size_start:global.locate_setting)
+// @@protoc_insertion_point(message_byte_size_start:setting.locate_setting)
   size_t total_size = 0;
 
   if (_internal_metadata_.have_unknown_fields()) {
@@ -408,22 +408,22 @@ size_t locate_setting::ByteSizeLong() const {
 }
 
 void locate_setting::MergeFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_merge_from_start:global.locate_setting)
+// @@protoc_insertion_point(generalized_merge_from_start:setting.locate_setting)
   GOOGLE_DCHECK_NE(&from, this);
   const locate_setting* source =
       ::google::protobuf::internal::DynamicCastToGenerated<const locate_setting>(
           &from);
   if (source == NULL) {
-  // @@protoc_insertion_point(generalized_merge_from_cast_fail:global.locate_setting)
+  // @@protoc_insertion_point(generalized_merge_from_cast_fail:setting.locate_setting)
     ::google::protobuf::internal::ReflectionOps::Merge(from, this);
   } else {
-  // @@protoc_insertion_point(generalized_merge_from_cast_success:global.locate_setting)
+  // @@protoc_insertion_point(generalized_merge_from_cast_success:setting.locate_setting)
     MergeFrom(*source);
   }
 }
 
 void locate_setting::MergeFrom(const locate_setting& from) {
-// @@protoc_insertion_point(class_specific_merge_from_start:global.locate_setting)
+// @@protoc_insertion_point(class_specific_merge_from_start:setting.locate_setting)
   GOOGLE_DCHECK_NE(&from, this);
   _internal_metadata_.MergeFrom(from._internal_metadata_);
   ::google::protobuf::uint32 cached_has_bits = 0;
@@ -443,14 +443,14 @@ void locate_setting::MergeFrom(const locate_setting& from) {
 }
 
 void locate_setting::CopyFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_copy_from_start:global.locate_setting)
+// @@protoc_insertion_point(generalized_copy_from_start:setting.locate_setting)
   if (&from == this) return;
   Clear();
   MergeFrom(from);
 }
 
 void locate_setting::CopyFrom(const locate_setting& from) {
-// @@protoc_insertion_point(class_specific_copy_from_start:global.locate_setting)
+// @@protoc_insertion_point(class_specific_copy_from_start:setting.locate_setting)
   if (&from == this) return;
   Clear();
   MergeFrom(from);
@@ -482,75 +482,75 @@ void locate_setting::InternalSwap(locate_setting* other) {
 
 // ===================================================================
 
-void setting::InitAsDefaultInstance() {
-  ::global::_setting_default_instance_._instance.get_mutable()->locate_parameter_ = const_cast< ::global::locate_setting*>(
-      ::global::locate_setting::internal_default_instance());
+void global_setting::InitAsDefaultInstance() {
+  ::setting::_global_setting_default_instance_._instance.get_mutable()->locate_parameter_ = const_cast< ::setting::locate_setting*>(
+      ::setting::locate_setting::internal_default_instance());
 }
 #if !defined(_MSC_VER) || _MSC_VER >= 1900
-const int setting::kLocateParameterFieldNumber;
+const int global_setting::kLocateParameterFieldNumber;
 #endif  // !defined(_MSC_VER) || _MSC_VER >= 1900
 
-setting::setting()
+global_setting::global_setting()
   : ::google::protobuf::Message(), _internal_metadata_(NULL) {
   if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) {
-    ::protobuf_setting_2eproto::InitDefaultssetting();
+    ::protobuf_setting_2eproto::InitDefaultsglobal_setting();
   }
   SharedCtor();
-  // @@protoc_insertion_point(constructor:global.setting)
+  // @@protoc_insertion_point(constructor:setting.global_setting)
 }
-setting::setting(const setting& from)
+global_setting::global_setting(const global_setting& from)
   : ::google::protobuf::Message(),
       _internal_metadata_(NULL),
       _has_bits_(from._has_bits_),
       _cached_size_(0) {
   _internal_metadata_.MergeFrom(from._internal_metadata_);
   if (from.has_locate_parameter()) {
-    locate_parameter_ = new ::global::locate_setting(*from.locate_parameter_);
+    locate_parameter_ = new ::setting::locate_setting(*from.locate_parameter_);
   } else {
     locate_parameter_ = NULL;
   }
-  // @@protoc_insertion_point(copy_constructor:global.setting)
+  // @@protoc_insertion_point(copy_constructor:setting.global_setting)
 }
 
-void setting::SharedCtor() {
+void global_setting::SharedCtor() {
   _cached_size_ = 0;
   locate_parameter_ = NULL;
 }
 
-setting::~setting() {
-  // @@protoc_insertion_point(destructor:global.setting)
+global_setting::~global_setting() {
+  // @@protoc_insertion_point(destructor:setting.global_setting)
   SharedDtor();
 }
 
-void setting::SharedDtor() {
+void global_setting::SharedDtor() {
   if (this != internal_default_instance()) delete locate_parameter_;
 }
 
-void setting::SetCachedSize(int size) const {
+void global_setting::SetCachedSize(int size) const {
   GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
   _cached_size_ = size;
   GOOGLE_SAFE_CONCURRENT_WRITES_END();
 }
-const ::google::protobuf::Descriptor* setting::descriptor() {
+const ::google::protobuf::Descriptor* global_setting::descriptor() {
   ::protobuf_setting_2eproto::protobuf_AssignDescriptorsOnce();
   return ::protobuf_setting_2eproto::file_level_metadata[kIndexInFileMessages].descriptor;
 }
 
-const setting& setting::default_instance() {
-  ::protobuf_setting_2eproto::InitDefaultssetting();
+const global_setting& global_setting::default_instance() {
+  ::protobuf_setting_2eproto::InitDefaultsglobal_setting();
   return *internal_default_instance();
 }
 
-setting* setting::New(::google::protobuf::Arena* arena) const {
-  setting* n = new setting;
+global_setting* global_setting::New(::google::protobuf::Arena* arena) const {
+  global_setting* n = new global_setting;
   if (arena != NULL) {
     arena->Own(n);
   }
   return n;
 }
 
-void setting::Clear() {
-// @@protoc_insertion_point(message_clear_start:global.setting)
+void global_setting::Clear() {
+// @@protoc_insertion_point(message_clear_start:setting.global_setting)
   ::google::protobuf::uint32 cached_has_bits = 0;
   // Prevent compiler warnings about cached_has_bits being unused
   (void) cached_has_bits;
@@ -564,17 +564,17 @@ void setting::Clear() {
   _internal_metadata_.Clear();
 }
 
-bool setting::MergePartialFromCodedStream(
+bool global_setting::MergePartialFromCodedStream(
     ::google::protobuf::io::CodedInputStream* input) {
 #define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure
   ::google::protobuf::uint32 tag;
-  // @@protoc_insertion_point(parse_start:global.setting)
+  // @@protoc_insertion_point(parse_start:setting.global_setting)
   for (;;) {
     ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u);
     tag = p.first;
     if (!p.second) goto handle_unusual;
     switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
-      // required .global.locate_setting locate_parameter = 1;
+      // required .setting.locate_setting locate_parameter = 1;
       case 1: {
         if (static_cast< ::google::protobuf::uint8>(tag) ==
             static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) {
@@ -598,22 +598,22 @@ bool setting::MergePartialFromCodedStream(
     }
   }
 success:
-  // @@protoc_insertion_point(parse_success:global.setting)
+  // @@protoc_insertion_point(parse_success:setting.global_setting)
   return true;
 failure:
-  // @@protoc_insertion_point(parse_failure:global.setting)
+  // @@protoc_insertion_point(parse_failure:setting.global_setting)
   return false;
 #undef DO_
 }
 
-void setting::SerializeWithCachedSizes(
+void global_setting::SerializeWithCachedSizes(
     ::google::protobuf::io::CodedOutputStream* output) const {
-  // @@protoc_insertion_point(serialize_start:global.setting)
+  // @@protoc_insertion_point(serialize_start:setting.global_setting)
   ::google::protobuf::uint32 cached_has_bits = 0;
   (void) cached_has_bits;
 
   cached_has_bits = _has_bits_[0];
-  // required .global.locate_setting locate_parameter = 1;
+  // required .setting.locate_setting locate_parameter = 1;
   if (cached_has_bits & 0x00000001u) {
     ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
       1, *this->locate_parameter_, output);
@@ -623,18 +623,18 @@ void setting::SerializeWithCachedSizes(
     ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
         _internal_metadata_.unknown_fields(), output);
   }
-  // @@protoc_insertion_point(serialize_end:global.setting)
+  // @@protoc_insertion_point(serialize_end:setting.global_setting)
 }
 
-::google::protobuf::uint8* setting::InternalSerializeWithCachedSizesToArray(
+::google::protobuf::uint8* global_setting::InternalSerializeWithCachedSizesToArray(
     bool deterministic, ::google::protobuf::uint8* target) const {
   (void)deterministic; // Unused
-  // @@protoc_insertion_point(serialize_to_array_start:global.setting)
+  // @@protoc_insertion_point(serialize_to_array_start:setting.global_setting)
   ::google::protobuf::uint32 cached_has_bits = 0;
   (void) cached_has_bits;
 
   cached_has_bits = _has_bits_[0];
-  // required .global.locate_setting locate_parameter = 1;
+  // required .setting.locate_setting locate_parameter = 1;
   if (cached_has_bits & 0x00000001u) {
     target = ::google::protobuf::internal::WireFormatLite::
       InternalWriteMessageToArray(
@@ -645,12 +645,12 @@ void setting::SerializeWithCachedSizes(
     target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
         _internal_metadata_.unknown_fields(), target);
   }
-  // @@protoc_insertion_point(serialize_to_array_end:global.setting)
+  // @@protoc_insertion_point(serialize_to_array_end:setting.global_setting)
   return target;
 }
 
-size_t setting::ByteSizeLong() const {
-// @@protoc_insertion_point(message_byte_size_start:global.setting)
+size_t global_setting::ByteSizeLong() const {
+// @@protoc_insertion_point(message_byte_size_start:setting.global_setting)
   size_t total_size = 0;
 
   if (_internal_metadata_.have_unknown_fields()) {
@@ -658,7 +658,7 @@ size_t setting::ByteSizeLong() const {
       ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
         _internal_metadata_.unknown_fields());
   }
-  // required .global.locate_setting locate_parameter = 1;
+  // required .setting.locate_setting locate_parameter = 1;
   if (has_locate_parameter()) {
     total_size += 1 +
       ::google::protobuf::internal::WireFormatLite::MessageSize(
@@ -671,48 +671,48 @@ size_t setting::ByteSizeLong() const {
   return total_size;
 }
 
-void setting::MergeFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_merge_from_start:global.setting)
+void global_setting::MergeFrom(const ::google::protobuf::Message& from) {
+// @@protoc_insertion_point(generalized_merge_from_start:setting.global_setting)
   GOOGLE_DCHECK_NE(&from, this);
-  const setting* source =
-      ::google::protobuf::internal::DynamicCastToGenerated<const setting>(
+  const global_setting* source =
+      ::google::protobuf::internal::DynamicCastToGenerated<const global_setting>(
           &from);
   if (source == NULL) {
-  // @@protoc_insertion_point(generalized_merge_from_cast_fail:global.setting)
+  // @@protoc_insertion_point(generalized_merge_from_cast_fail:setting.global_setting)
     ::google::protobuf::internal::ReflectionOps::Merge(from, this);
   } else {
-  // @@protoc_insertion_point(generalized_merge_from_cast_success:global.setting)
+  // @@protoc_insertion_point(generalized_merge_from_cast_success:setting.global_setting)
     MergeFrom(*source);
   }
 }
 
-void setting::MergeFrom(const setting& from) {
-// @@protoc_insertion_point(class_specific_merge_from_start:global.setting)
+void global_setting::MergeFrom(const global_setting& from) {
+// @@protoc_insertion_point(class_specific_merge_from_start:setting.global_setting)
   GOOGLE_DCHECK_NE(&from, this);
   _internal_metadata_.MergeFrom(from._internal_metadata_);
   ::google::protobuf::uint32 cached_has_bits = 0;
   (void) cached_has_bits;
 
   if (from.has_locate_parameter()) {
-    mutable_locate_parameter()->::global::locate_setting::MergeFrom(from.locate_parameter());
+    mutable_locate_parameter()->::setting::locate_setting::MergeFrom(from.locate_parameter());
   }
 }
 
-void setting::CopyFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_copy_from_start:global.setting)
+void global_setting::CopyFrom(const ::google::protobuf::Message& from) {
+// @@protoc_insertion_point(generalized_copy_from_start:setting.global_setting)
   if (&from == this) return;
   Clear();
   MergeFrom(from);
 }
 
-void setting::CopyFrom(const setting& from) {
-// @@protoc_insertion_point(class_specific_copy_from_start:global.setting)
+void global_setting::CopyFrom(const global_setting& from) {
+// @@protoc_insertion_point(class_specific_copy_from_start:setting.global_setting)
   if (&from == this) return;
   Clear();
   MergeFrom(from);
 }
 
-bool setting::IsInitialized() const {
+bool global_setting::IsInitialized() const {
   if ((_has_bits_[0] & 0x00000001) != 0x00000001) return false;
   if (has_locate_parameter()) {
     if (!this->locate_parameter_->IsInitialized()) return false;
@@ -720,11 +720,11 @@ bool setting::IsInitialized() const {
   return true;
 }
 
-void setting::Swap(setting* other) {
+void global_setting::Swap(global_setting* other) {
   if (other == this) return;
   InternalSwap(other);
 }
-void setting::InternalSwap(setting* other) {
+void global_setting::InternalSwap(global_setting* other) {
   using std::swap;
   swap(locate_parameter_, other->locate_parameter_);
   swap(_has_bits_[0], other->_has_bits_[0]);
@@ -732,13 +732,13 @@ void setting::InternalSwap(setting* other) {
   swap(_cached_size_, other->_cached_size_);
 }
 
-::google::protobuf::Metadata setting::GetMetadata() const {
+::google::protobuf::Metadata global_setting::GetMetadata() const {
   protobuf_setting_2eproto::protobuf_AssignDescriptorsOnce();
   return ::protobuf_setting_2eproto::file_level_metadata[kIndexInFileMessages];
 }
 
 
 // @@protoc_insertion_point(namespace_scope)
-}  // namespace global
+}  // namespace setting
 
 // @@protoc_insertion_point(global_scope)

+ 68 - 68
setting.pb.h

@@ -44,26 +44,26 @@ struct TableStruct {
 void AddDescriptors();
 void InitDefaultslocate_settingImpl();
 void InitDefaultslocate_setting();
-void InitDefaultssettingImpl();
-void InitDefaultssetting();
+void InitDefaultsglobal_settingImpl();
+void InitDefaultsglobal_setting();
 inline void InitDefaults() {
   InitDefaultslocate_setting();
-  InitDefaultssetting();
+  InitDefaultsglobal_setting();
 }
 }  // namespace protobuf_setting_2eproto
-namespace global {
+namespace setting {
+class global_setting;
+class global_settingDefaultTypeInternal;
+extern global_settingDefaultTypeInternal _global_setting_default_instance_;
 class locate_setting;
 class locate_settingDefaultTypeInternal;
 extern locate_settingDefaultTypeInternal _locate_setting_default_instance_;
-class setting;
-class settingDefaultTypeInternal;
-extern settingDefaultTypeInternal _setting_default_instance_;
-}  // namespace global
-namespace global {
+}  // namespace setting
+namespace setting {
 
 // ===================================================================
 
-class locate_setting : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:global.locate_setting) */ {
+class locate_setting : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:setting.locate_setting) */ {
  public:
   locate_setting();
   virtual ~locate_setting();
@@ -174,7 +174,7 @@ class locate_setting : public ::google::protobuf::Message /* @@protoc_insertion_
   ::google::protobuf::int32 port() const;
   void set_port(::google::protobuf::int32 value);
 
-  // @@protoc_insertion_point(class_scope:global.locate_setting)
+  // @@protoc_insertion_point(class_scope:setting.locate_setting)
  private:
   void set_has_ip();
   void clear_has_ip();
@@ -194,24 +194,24 @@ class locate_setting : public ::google::protobuf::Message /* @@protoc_insertion_
 };
 // -------------------------------------------------------------------
 
-class setting : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:global.setting) */ {
+class global_setting : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:setting.global_setting) */ {
  public:
-  setting();
-  virtual ~setting();
+  global_setting();
+  virtual ~global_setting();
 
-  setting(const setting& from);
+  global_setting(const global_setting& from);
 
-  inline setting& operator=(const setting& from) {
+  inline global_setting& operator=(const global_setting& from) {
     CopyFrom(from);
     return *this;
   }
   #if LANG_CXX11
-  setting(setting&& from) noexcept
-    : setting() {
+  global_setting(global_setting&& from) noexcept
+    : global_setting() {
     *this = ::std::move(from);
   }
 
-  inline setting& operator=(setting&& from) noexcept {
+  inline global_setting& operator=(global_setting&& from) noexcept {
     if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) {
       if (this != &from) InternalSwap(&from);
     } else {
@@ -228,30 +228,30 @@ class setting : public ::google::protobuf::Message /* @@protoc_insertion_point(c
   }
 
   static const ::google::protobuf::Descriptor* descriptor();
-  static const setting& default_instance();
+  static const global_setting& default_instance();
 
   static void InitAsDefaultInstance();  // FOR INTERNAL USE ONLY
-  static inline const setting* internal_default_instance() {
-    return reinterpret_cast<const setting*>(
-               &_setting_default_instance_);
+  static inline const global_setting* internal_default_instance() {
+    return reinterpret_cast<const global_setting*>(
+               &_global_setting_default_instance_);
   }
   static PROTOBUF_CONSTEXPR int const kIndexInFileMessages =
     1;
 
-  void Swap(setting* other);
-  friend void swap(setting& a, setting& b) {
+  void Swap(global_setting* other);
+  friend void swap(global_setting& a, global_setting& b) {
     a.Swap(&b);
   }
 
   // implements Message ----------------------------------------------
 
-  inline setting* New() const PROTOBUF_FINAL { return New(NULL); }
+  inline global_setting* New() const PROTOBUF_FINAL { return New(NULL); }
 
-  setting* New(::google::protobuf::Arena* arena) const PROTOBUF_FINAL;
+  global_setting* New(::google::protobuf::Arena* arena) const PROTOBUF_FINAL;
   void CopyFrom(const ::google::protobuf::Message& from) PROTOBUF_FINAL;
   void MergeFrom(const ::google::protobuf::Message& from) PROTOBUF_FINAL;
-  void CopyFrom(const setting& from);
-  void MergeFrom(const setting& from);
+  void CopyFrom(const global_setting& from);
+  void MergeFrom(const global_setting& from);
   void Clear() PROTOBUF_FINAL;
   bool IsInitialized() const PROTOBUF_FINAL;
 
@@ -267,7 +267,7 @@ class setting : public ::google::protobuf::Message /* @@protoc_insertion_point(c
   void SharedCtor();
   void SharedDtor();
   void SetCachedSize(int size) const PROTOBUF_FINAL;
-  void InternalSwap(setting* other);
+  void InternalSwap(global_setting* other);
   private:
   inline ::google::protobuf::Arena* GetArenaNoVirtual() const {
     return NULL;
@@ -283,16 +283,16 @@ class setting : public ::google::protobuf::Message /* @@protoc_insertion_point(c
 
   // accessors -------------------------------------------------------
 
-  // required .global.locate_setting locate_parameter = 1;
+  // required .setting.locate_setting locate_parameter = 1;
   bool has_locate_parameter() const;
   void clear_locate_parameter();
   static const int kLocateParameterFieldNumber = 1;
-  const ::global::locate_setting& locate_parameter() const;
-  ::global::locate_setting* release_locate_parameter();
-  ::global::locate_setting* mutable_locate_parameter();
-  void set_allocated_locate_parameter(::global::locate_setting* locate_parameter);
+  const ::setting::locate_setting& locate_parameter() const;
+  ::setting::locate_setting* release_locate_parameter();
+  ::setting::locate_setting* mutable_locate_parameter();
+  void set_allocated_locate_parameter(::setting::locate_setting* locate_parameter);
 
-  // @@protoc_insertion_point(class_scope:global.setting)
+  // @@protoc_insertion_point(class_scope:setting.global_setting)
  private:
   void set_has_locate_parameter();
   void clear_has_locate_parameter();
@@ -300,9 +300,9 @@ class setting : public ::google::protobuf::Message /* @@protoc_insertion_point(c
   ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;
   ::google::protobuf::internal::HasBits<1> _has_bits_;
   mutable int _cached_size_;
-  ::global::locate_setting* locate_parameter_;
+  ::setting::locate_setting* locate_parameter_;
   friend struct ::protobuf_setting_2eproto::TableStruct;
-  friend void ::protobuf_setting_2eproto::InitDefaultssettingImpl();
+  friend void ::protobuf_setting_2eproto::InitDefaultsglobal_settingImpl();
 };
 // ===================================================================
 
@@ -330,41 +330,41 @@ inline void locate_setting::clear_ip() {
   clear_has_ip();
 }
 inline const ::std::string& locate_setting::ip() const {
-  // @@protoc_insertion_point(field_get:global.locate_setting.ip)
+  // @@protoc_insertion_point(field_get:setting.locate_setting.ip)
   return ip_.GetNoArena();
 }
 inline void locate_setting::set_ip(const ::std::string& value) {
   set_has_ip();
   ip_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value);
-  // @@protoc_insertion_point(field_set:global.locate_setting.ip)
+  // @@protoc_insertion_point(field_set:setting.locate_setting.ip)
 }
 #if LANG_CXX11
 inline void locate_setting::set_ip(::std::string&& value) {
   set_has_ip();
   ip_.SetNoArena(
     &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value));
-  // @@protoc_insertion_point(field_set_rvalue:global.locate_setting.ip)
+  // @@protoc_insertion_point(field_set_rvalue:setting.locate_setting.ip)
 }
 #endif
 inline void locate_setting::set_ip(const char* value) {
   GOOGLE_DCHECK(value != NULL);
   set_has_ip();
   ip_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value));
-  // @@protoc_insertion_point(field_set_char:global.locate_setting.ip)
+  // @@protoc_insertion_point(field_set_char:setting.locate_setting.ip)
 }
 inline void locate_setting::set_ip(const char* value, size_t size) {
   set_has_ip();
   ip_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
       ::std::string(reinterpret_cast<const char*>(value), size));
-  // @@protoc_insertion_point(field_set_pointer:global.locate_setting.ip)
+  // @@protoc_insertion_point(field_set_pointer:setting.locate_setting.ip)
 }
 inline ::std::string* locate_setting::mutable_ip() {
   set_has_ip();
-  // @@protoc_insertion_point(field_mutable:global.locate_setting.ip)
+  // @@protoc_insertion_point(field_mutable:setting.locate_setting.ip)
   return ip_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
 }
 inline ::std::string* locate_setting::release_ip() {
-  // @@protoc_insertion_point(field_release:global.locate_setting.ip)
+  // @@protoc_insertion_point(field_release:setting.locate_setting.ip)
   clear_has_ip();
   return ip_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
 }
@@ -375,7 +375,7 @@ inline void locate_setting::set_allocated_ip(::std::string* ip) {
     clear_has_ip();
   }
   ip_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ip);
-  // @@protoc_insertion_point(field_set_allocated:global.locate_setting.ip)
+  // @@protoc_insertion_point(field_set_allocated:setting.locate_setting.ip)
 }
 
 // required int32 port = 2;
@@ -393,55 +393,55 @@ inline void locate_setting::clear_port() {
   clear_has_port();
 }
 inline ::google::protobuf::int32 locate_setting::port() const {
-  // @@protoc_insertion_point(field_get:global.locate_setting.port)
+  // @@protoc_insertion_point(field_get:setting.locate_setting.port)
   return port_;
 }
 inline void locate_setting::set_port(::google::protobuf::int32 value) {
   set_has_port();
   port_ = value;
-  // @@protoc_insertion_point(field_set:global.locate_setting.port)
+  // @@protoc_insertion_point(field_set:setting.locate_setting.port)
 }
 
 // -------------------------------------------------------------------
 
-// setting
+// global_setting
 
-// required .global.locate_setting locate_parameter = 1;
-inline bool setting::has_locate_parameter() const {
+// required .setting.locate_setting locate_parameter = 1;
+inline bool global_setting::has_locate_parameter() const {
   return (_has_bits_[0] & 0x00000001u) != 0;
 }
-inline void setting::set_has_locate_parameter() {
+inline void global_setting::set_has_locate_parameter() {
   _has_bits_[0] |= 0x00000001u;
 }
-inline void setting::clear_has_locate_parameter() {
+inline void global_setting::clear_has_locate_parameter() {
   _has_bits_[0] &= ~0x00000001u;
 }
-inline void setting::clear_locate_parameter() {
+inline void global_setting::clear_locate_parameter() {
   if (locate_parameter_ != NULL) locate_parameter_->Clear();
   clear_has_locate_parameter();
 }
-inline const ::global::locate_setting& setting::locate_parameter() const {
-  const ::global::locate_setting* p = locate_parameter_;
-  // @@protoc_insertion_point(field_get:global.setting.locate_parameter)
-  return p != NULL ? *p : *reinterpret_cast<const ::global::locate_setting*>(
-      &::global::_locate_setting_default_instance_);
+inline const ::setting::locate_setting& global_setting::locate_parameter() const {
+  const ::setting::locate_setting* p = locate_parameter_;
+  // @@protoc_insertion_point(field_get:setting.global_setting.locate_parameter)
+  return p != NULL ? *p : *reinterpret_cast<const ::setting::locate_setting*>(
+      &::setting::_locate_setting_default_instance_);
 }
-inline ::global::locate_setting* setting::release_locate_parameter() {
-  // @@protoc_insertion_point(field_release:global.setting.locate_parameter)
+inline ::setting::locate_setting* global_setting::release_locate_parameter() {
+  // @@protoc_insertion_point(field_release:setting.global_setting.locate_parameter)
   clear_has_locate_parameter();
-  ::global::locate_setting* temp = locate_parameter_;
+  ::setting::locate_setting* temp = locate_parameter_;
   locate_parameter_ = NULL;
   return temp;
 }
-inline ::global::locate_setting* setting::mutable_locate_parameter() {
+inline ::setting::locate_setting* global_setting::mutable_locate_parameter() {
   set_has_locate_parameter();
   if (locate_parameter_ == NULL) {
-    locate_parameter_ = new ::global::locate_setting;
+    locate_parameter_ = new ::setting::locate_setting;
   }
-  // @@protoc_insertion_point(field_mutable:global.setting.locate_parameter)
+  // @@protoc_insertion_point(field_mutable:setting.global_setting.locate_parameter)
   return locate_parameter_;
 }
-inline void setting::set_allocated_locate_parameter(::global::locate_setting* locate_parameter) {
+inline void global_setting::set_allocated_locate_parameter(::setting::locate_setting* locate_parameter) {
   ::google::protobuf::Arena* message_arena = GetArenaNoVirtual();
   if (message_arena == NULL) {
     delete locate_parameter_;
@@ -457,7 +457,7 @@ inline void setting::set_allocated_locate_parameter(::global::locate_setting* lo
     clear_has_locate_parameter();
   }
   locate_parameter_ = locate_parameter;
-  // @@protoc_insertion_point(field_set_allocated:global.setting.locate_parameter)
+  // @@protoc_insertion_point(field_set_allocated:setting.global_setting.locate_parameter)
 }
 
 #ifdef __GNUC__
@@ -468,7 +468,7 @@ inline void setting::set_allocated_locate_parameter(::global::locate_setting* lo
 
 // @@protoc_insertion_point(namespace_scope)
 
-}  // namespace global
+}  // namespace setting
 
 // @@protoc_insertion_point(global_scope)
 

+ 2 - 2
setting.proto

@@ -1,5 +1,5 @@
 syntax = "proto2";
-package global;
+package setting;
 
 message locate_setting
 {
@@ -8,7 +8,7 @@ message locate_setting
 
 }
 
-message setting
+message global_setting
 {
     required locate_setting locate_parameter=1;
 }