|
@@ -17,6 +17,41 @@ System_communication::~System_communication()
|
|
|
|
|
|
}
|
|
|
|
|
|
+//初始化 通信 模块。如下三选一
|
|
|
+Error_manager System_communication::communication_init()
|
|
|
+{
|
|
|
+ return Communication_socket_base::communication_init();
|
|
|
+}
|
|
|
+
|
|
|
+//初始化 通信 模块。如下三选一
|
|
|
+Error_manager System_communication::communication_init(int dispatch_id)
|
|
|
+{
|
|
|
+ switch ( dispatch_id )
|
|
|
+ {
|
|
|
+ case 0:
|
|
|
+ {
|
|
|
+ return Communication_socket_base::communication_init_from_protobuf(COMMUNICATION_PARAMETER_PATH_A);
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ case 1:
|
|
|
+ {
|
|
|
+ return Communication_socket_base::communication_init_from_protobuf(COMMUNICATION_PARAMETER_PATH_B);
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ case 2:
|
|
|
+ {
|
|
|
+ return Communication_socket_base::communication_init_from_protobuf(COMMUNICATION_PARAMETER_PATH_C);
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ default:
|
|
|
+ {
|
|
|
+ return Error_manager(Error_code::COMMUNICATION_READ_PROTOBUF_ERROR, Error_level::MINOR_ERROR,
|
|
|
+ " System_communication::communication_init dispatch_id error ");
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return Error_code::SUCCESS;
|
|
|
+}
|
|
|
|
|
|
//检查消息是否有效, 主要检查消息类型和接受者, 判断这条消息是不是给我的.
|
|
|
Error_manager System_communication::check_msg(Communication_message* p_msg)
|