Diag-Client-Lib
Classes | Public Types | Public Member Functions | Private Attributes | List of all members
diag::client::DiagClient Class Referencefinal

Class to manage Diagnostic Client. More...

#include <diagnostic_client.h>

Classes

class  DiagClientImpl
 Class to provide implementation of diag client. More...
 

Public Types

enum class  VehicleInfoResponseError : std::uint8_t { kTransmitFailed = 0U , kInvalidParameters = 1U , kNoResponseReceived = 2U }
 Definitions of Vehicle Identification response error code. More...
 

Public Member Functions

 DiagClient (std::string_view diag_client_config_path) noexcept
 Constructs an instance of DiagClient. More...
 
 DiagClient (const DiagClient &other) noexcept=delete
 Deleted copy assignment and copy constructor. More...
 
DiagClientoperator= (const DiagClient &other) noexcept=delete
 
 DiagClient (DiagClient &&other) noexcept=delete
 Deleted move assignment and move constructor. More...
 
DiagClientoperator= (DiagClient &&other) noexcept=delete
 
 ~DiagClient () noexcept
 Destruct an instance of DiagClient -Destruction. More...
 
Result< void > Initialize () noexcept
 Function to initialize the already created instance of DiagClient. More...
 
Result< void > DeInitialize () noexcept
 Function to de-initialize the already initialized instance of DiagClient. More...
 
Result< vehicle_info::VehicleInfoMessageResponseUniquePtr, VehicleInfoResponseErrorSendVehicleIdentificationRequest (diag::client::vehicle_info::VehicleInfoListRequestType vehicle_info_request) noexcept
 Function to send vehicle identification request and get the Diagnostic Server list. More...
 
conversation::DiagClientConversation GetDiagnosticClientConversation (std::string_view conversation_name) noexcept
 Function to get required diag client conversation object based on conversation name. More...
 

Private Attributes

std::unique_ptr< DiagClientImpldiag_client_impl_
 Unique pointer to diag client implementation. More...
 

Detailed Description

Class to manage Diagnostic Client.

Definition at line 25 of file diagnostic_client.h.

Member Enumeration Documentation

◆ VehicleInfoResponseError

Definitions of Vehicle Identification response error code.

Enumerator
kTransmitFailed 

Failure on Transmissions

kInvalidParameters 

Invalid Parameter passed

kNoResponseReceived 

No vehicle identification response received

Definition at line 30 of file diagnostic_client.h.

30  : std::uint8_t {
31  kTransmitFailed = 0U,
32  kInvalidParameters = 1U,
33  kNoResponseReceived = 2U,
34  };

Constructor & Destructor Documentation

◆ DiagClient() [1/3]

diag::client::DiagClient::DiagClient ( std::string_view  diag_client_config_path)
explicitnoexcept

Constructs an instance of DiagClient.

Parameters
[in]diag_client_config_pathpath to diag client config file -Construction

Definition at line 160 of file diagnostic_client.cpp.

161  : diag_client_impl_{std::make_unique<DiagClientImpl>(diag_client_config_path)} {}
std::unique_ptr< DiagClientImpl > diag_client_impl_
Unique pointer to diag client implementation.

◆ DiagClient() [2/3]

diag::client::DiagClient::DiagClient ( const DiagClient other)
deletenoexcept

Deleted copy assignment and copy constructor.

◆ DiagClient() [3/3]

diag::client::DiagClient::DiagClient ( DiagClient &&  other)
deletenoexcept

Deleted move assignment and move constructor.

◆ ~DiagClient()

diag::client::DiagClient::~DiagClient ( )
defaultnoexcept

Destruct an instance of DiagClient -Destruction.

Member Function Documentation

◆ DeInitialize()

Result< void > diag::client::DiagClient::DeInitialize ( )
noexcept

Function to de-initialize the already initialized instance of DiagClient.

Must be called during shutdown phase, no further processing of any function will be allowed after this call

Returns
Result with void in case of success, otherwise error is returned -DeInitialization

Definition at line 167 of file diagnostic_client.cpp.

167 { return diag_client_impl_->DeInitialize(); }

References diag_client_impl_.

◆ GetDiagnosticClientConversation()

conversation::DiagClientConversation diag::client::DiagClient::GetDiagnosticClientConversation ( std::string_view  conversation_name)
noexcept

Function to get required diag client conversation object based on conversation name.

Parameters
[in]conversation_nameName of conversation configured as json parameter "ConversationName"
Returns
Diag client conversation object as per passed conversation name -MultipleTester-Connection, DiagClientLib-Conversation-Construction

Definition at line 175 of file diagnostic_client.cpp.

176  {
177  return diag_client_impl_->GetDiagnosticClientConversation(conversation_name);
178 }

◆ Initialize()

Result< void > diag::client::DiagClient::Initialize ( )
noexcept

Function to initialize the already created instance of DiagClient.

Must be called once and before using any other functions of DiagClient

Returns
Result with void in case of success, otherwise error is returned -Initialization

Definition at line 165 of file diagnostic_client.cpp.

165 { return diag_client_impl_->Initialize(); }

References Initialize().

Referenced by Initialize().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ operator=() [1/2]

DiagClient& diag::client::DiagClient::operator= ( const DiagClient other)
deletenoexcept

◆ operator=() [2/2]

DiagClient& diag::client::DiagClient::operator= ( DiagClient &&  other)
deletenoexcept

◆ SendVehicleIdentificationRequest()

Result< vehicle_info::VehicleInfoMessageResponseUniquePtr, DiagClient::VehicleInfoResponseError > diag::client::DiagClient::SendVehicleIdentificationRequest ( diag::client::vehicle_info::VehicleInfoListRequestType  vehicle_info_request)
noexcept

Function to send vehicle identification request and get the Diagnostic Server list.

Parameters
[in]vehicle_info_requestVehicle information sent along with request
Returns
Result containing available vehicle information response on success, VehicleResponseErrorCode on error -VehicleDiscovery

Definition at line 170 of file diagnostic_client.cpp.

171  {
172  return diag_client_impl_->SendVehicleIdentificationRequest(std::move(vehicle_info_request));
173 }

Member Data Documentation

◆ diag_client_impl_

std::unique_ptr<DiagClientImpl> diag::client::DiagClient::diag_client_impl_
private

Unique pointer to diag client implementation.

Definition at line 108 of file diagnostic_client.h.

Referenced by DeInitialize().


The documentation for this class was generated from the following files: