68 __FILE__, __LINE__, __func__, [](std::stringstream &msg) { msg <<
"DiagClient Initialization started"; });
75 __FILE__, __LINE__,
"", [](std::stringstream &msg) { msg <<
"DiagClient Initialization failed"; });
78 .AndThen([
this, &config]() {
83 pthread_setname_np(
dcm_thread_.native_handle(),
"dcm_client");
85 __FILE__, __LINE__,
"", [](std::stringstream &msg) { msg <<
"DiagClient Initialization completed"; });
98 __FILE__, __LINE__, __func__, [](std::stringstream &msg) { msg <<
"DiagClient De-Initialization started"; });
102 if (
dcm_thread_.joinable()) { dcm_thread_.join(); }
104 __FILE__, __LINE__,
"", [](std::stringstream &msg) { msg <<
"DiagClient De-Initialization completed"; });
121 __FILE__, __LINE__,
"", [](std::stringstream &msg) { msg <<
"DiagClient is not Initialized"; });
123 return dcm_instance_->GetDiagnosticClientConversation(conversation_name);
138 __FILE__, __LINE__,
"", [](std::stringstream &msg) { msg <<
"DiagClient is not Initialized"; });
140 return dcm_instance_->SendVehicleIdentificationRequest(std::move(vehicle_info_request));
161 : diag_client_impl_{std::make_unique<DiagClientImpl>(diag_client_config_path)} {}
172 return diag_client_impl_->SendVehicleIdentificationRequest(std::move(vehicle_info_request));
176 std::string_view conversation_name) noexcept {
177 return diag_client_impl_->GetDiagnosticClientConversation(conversation_name);
181 return (std::make_unique<DiagClient>(diag_client_config_path));
Encapsulation of an error code. An ErrorCode contains a raw error code value and an error domain....
Class type to contains a value (of type ValueType), or an error (of type ErrorType)
Class to provide implementation of diag client.
~DiagClientImpl() noexcept=default
Destruct an instance of DiagClient -Destruction.
Result< void > DeInitialize() noexcept
Function to de-initialize the already initialized instance of DiagClient.
Result< void > Initialize() noexcept
Function to initialize the already created instance of DiagClient.
conversation::DiagClientConversation GetDiagnosticClientConversation(std::string_view conversation_name) noexcept
Function to get required diag client conversation object based on conversation name.
Result< vehicle_info::VehicleInfoMessageResponseUniquePtr, DiagClient::VehicleInfoResponseError > SendVehicleIdentificationRequest(diag::client::vehicle_info::VehicleInfoListRequestType vehicle_info_request) noexcept
Function to send vehicle identification request and get the Diagnostic Server list.
DiagClientImpl & operator=(const DiagClientImpl &other) noexcept=delete
DiagClientImpl(DiagClientImpl &&other) noexcept=delete
Deleted move assignment and move constructor.
std::thread dcm_thread_
Thread to handle dcm client lifecycle.
DiagClientImpl(const DiagClientImpl &other) noexcept=delete
Deleted copy assignment and copy constructor.
DiagClientImpl & operator=(DiagClientImpl &&other) noexcept=delete
DiagClientImpl(std::string_view diag_client_config_path) noexcept
Constructs an instance of DiagClient.
std::unique_ptr< diag::client::common::DiagnosticManager > dcm_instance_
Unique pointer to dcm client instance.
std::string diag_client_config_path_
Store the diag client config path.
Class to manage Diagnostic Client.
Result< void > Initialize() noexcept
Function to initialize the already created instance of DiagClient.
Result< vehicle_info::VehicleInfoMessageResponseUniquePtr, VehicleInfoResponseError > SendVehicleIdentificationRequest(diag::client::vehicle_info::VehicleInfoListRequestType vehicle_info_request) noexcept
Function to send vehicle identification request and get the Diagnostic Server list.
std::unique_ptr< DiagClientImpl > diag_client_impl_
Unique pointer to diag client implementation.
DiagClient(std::string_view diag_client_config_path) noexcept
Constructs an instance of DiagClient.
conversation::DiagClientConversation GetDiagnosticClientConversation(std::string_view conversation_name) noexcept
Function to get required diag client conversation object based on conversation name.
~DiagClient() noexcept
Destruct an instance of DiagClient -Destruction.
Result< void > DeInitialize() noexcept
Function to de-initialize the already initialized instance of DiagClient.
Conversation class to establish connection with a Diagnostic Server.
static auto GetDiagClientLogger() noexcept -> DiagClientLogger &
Get the diag client logger instance.
ParsingErrorCode
Definitions of Parsing failure error codes.
core_type::Result< void, ParsingErrorCode > Read(std::string_view config_path, boost_tree &json_tree)
Parser to get the configuration from json file.
boost::property_tree::ptree boost_tree
Type alias for boost property tree.
diag::client::config_parser::DcmClientConfig ReadDcmClientConfig(boost_support::parser::boost_tree &config_tree)
Function to read from config tree and get the DcmClient configuration.
@ kDeInitializationFailed
core_type::ErrorCode MakeErrorCode(DmErrorErrc, core_type::ErrorDomain::SupportDataType data) noexcept
Create a new ErrorCode within DmErrorDomain.
std::unique_ptr< diag::client::DiagClient > CreateDiagnosticClient(std::string_view diag_client_config_path)
Function to get the instance of Diagnostic Client Object. This instance to be further used for all th...
Struct containing Vehicle selection mode.