communication_manager.cpp 734 B

123456789101112131415161718192021222324
  1. //
  2. // Created by zx on 2023/11/24.
  3. //
  4. #include "communication_manager.h"
  5. Error_manager CommunicationManager::Init(const CommunicationManagerConfig &config) {
  6. if (config.grpc_enable()) {
  7. m_grpc_server = new StreamRpcServer;
  8. m_grpc_server->Listenning(config.grpc_server_ip(), 9876);
  9. }
  10. if (config.rabbitmq_enable()) {
  11. std::string file_path = ETC_PATH PROJECT_NAME + config.rabbitmq_config_file();
  12. RabbitmqCommunicationTof3D::get_instance_pointer()->rabbitmq_init_from_protobuf(file_path);
  13. }
  14. if (config.mqtt_enable()) {
  15. std::string file_path = ETC_PATH PROJECT_NAME + config.mqtt_config_file();
  16. Tof3DMqttAsyncClient::iter()->init(file_path);
  17. }
  18. return {};
  19. }