Diag-Client-Lib
Classes | Functions
diag::client::config_parser Namespace Reference

Classes

struct  DoipNetworkType
 
struct  ConversationType
 
struct  DcmClientConfig
 

Functions

diag::client::config_parser::DcmClientConfig ReadDcmClientConfig (boost_support::parser::boost_tree &config_tree)
 Function to read from config tree and get the DcmClient configuration. More...
 

Function Documentation

◆ ReadDcmClientConfig()

diag::client::config_parser::DcmClientConfig diag::client::config_parser::ReadDcmClientConfig ( boost_support::parser::boost_tree config_tree)

Function to read from config tree and get the DcmClient configuration.

Parameters
[in]config_treeThe reference to config tree containing the configuration
Returns
The Dcm client configuration

Definition at line 15 of file config_parser_type.cpp.

15  {
17  // get the udp info for vehicle discovery
18  config.udp_ip_address = config_tree.get<std::string>("UdpIpAddress");
19  config.udp_broadcast_address = config_tree.get<std::string>("UdpBroadcastAddress");
20  // get total number of conversation
21  config.num_of_conversation = config_tree.get<std::uint8_t>("Conversation.NumberOfConversation");
22  // loop through all the conversation
23  for (boost_support::parser::boost_tree::value_type &conversation_ptr:
24  config_tree.get_child("Conversation.ConversationProperty")) {
26  conversation.conversation_name = conversation_ptr.second.get<std::string>("ConversationName");
27  conversation.p2_client_max = conversation_ptr.second.get<std::uint16_t>("P2ClientMax");
28  conversation.p2_star_client_max = conversation_ptr.second.get<std::uint16_t>("P2StarClientMax");
29  conversation.rx_buffer_size = conversation_ptr.second.get<std::uint16_t>("RxBufferSize");
30  conversation.source_address = conversation_ptr.second.get<std::uint16_t>("SourceAddress");
31  conversation.network.tcp_ip_address = conversation_ptr.second.get<std::string>("Network.TcpIpAddress");
32  config.conversations.emplace_back(conversation);
33  }
34  return config;
35 }

References diag::client::config_parser::ConversationType::conversation_name, and diag::client::config_parser::DcmClientConfig::udp_ip_address.

Referenced by diag::client::DiagClient::DiagClientImpl::Initialize().

Here is the caller graph for this function: