Diag-Client-Lib
|
Conversation class to establish connection with a Diagnostic Server. More...
#include <diagnostic_client_conversation.h>
Classes | |
class | DiagClientConversationImpl |
Public Types | |
enum class | ConnectResult : std::uint8_t { kConnectSuccess = 0U , kConnectFailed = 1U , kConnectTimeout = 2U } |
Definitions of Connection results. More... | |
enum class | DisconnectResult : std::uint8_t { kDisconnectSuccess = 0U , kDisconnectFailed = 1U , kAlreadyDisconnected = 2U } |
Definitions of Disconnection results. More... | |
enum class | DiagError : std::uint8_t { kDiagGenericFailure = 1U , kDiagRequestSendFailed = 2U , kDiagAckTimeout = 3U , kDiagNegAckReceived = 4U , kDiagResponseTimeout = 5U , kDiagInvalidParameter = 6U , kDiagBusyProcessing = 7U } |
Definitions of Diagnostics Request Response results. More... | |
using | IpAddress = uds_message::UdsMessage::IpAddress |
Type alias of ip address type. More... | |
Public Member Functions | |
DiagClientConversation (std::string_view conversation_name) noexcept | |
Constructor an instance of DiagClientConversation. More... | |
~DiagClientConversation () noexcept | |
Destructor an instance of DiagClientConversation -Conversation-Destruction. More... | |
void | Startup () noexcept |
Function to startup the Diagnostic Client Conversation. More... | |
void | Shutdown () noexcept |
Function to shutdown the Diagnostic Client Conversation. More... | |
ConnectResult | ConnectToDiagServer (std::uint16_t target_address, IpAddress host_ip_addr) noexcept |
Function to connect to Diagnostic Server using Target address and IP address of the server. More... | |
DisconnectResult | DisconnectFromDiagServer () noexcept |
Function to disconnect from Diagnostic Server. More... | |
Result< uds_message::UdsResponseMessagePtr, DiagError > | SendDiagnosticRequest (uds_message::UdsRequestMessageConstPtr message) noexcept |
Function to send Diagnostic Request and get Diagnostic Response. More... | |
Private Attributes | |
std::unique_ptr< DiagClientConversationImpl > | diag_client_conversation_impl_ |
Unique pointer to diag client conversation implementation. More... | |
Conversation class to establish connection with a Diagnostic Server.
This only support DoIP communication protocol for diagnostic communication with remote Diagnostic Server
Definition at line 24 of file diagnostic_client_conversation.h.
using diag::client::conversation::DiagClientConversation::IpAddress = uds_message::UdsMessage::IpAddress |
Type alias of ip address type.
Definition at line 29 of file diagnostic_client_conversation.h.
|
strong |
Definitions of Connection results.
Definition at line 35 of file diagnostic_client_conversation.h.
|
strong |
Definitions of Diagnostics Request Response results.
Enumerator | |
---|---|
kDiagGenericFailure | Generic Diagnostic Error, see logs for more information |
kDiagRequestSendFailed | Diagnostic request message transmission failure |
kDiagAckTimeout | No diagnostic acknowledgement response received within 2 seconds |
kDiagNegAckReceived | Diagnostic negative acknowledgement received |
kDiagResponseTimeout | No diagnostic response message received within P2/P2Star time |
kDiagInvalidParameter | Passed parameter value is not valid |
kDiagBusyProcessing | Conversation is already busy processing previous request |
Definition at line 53 of file diagnostic_client_conversation.h.
|
strong |
Definitions of Disconnection results.
Definition at line 44 of file diagnostic_client_conversation.h.
|
explicitnoexcept |
Constructor an instance of DiagClientConversation.
[in] | conversation_name | The name of conversation configured as json parameter under "ConversationName" -Conversation-Construction, DiagClientLib-DoIP-Support |
Definition at line 88 of file diagnostic_client_conversation.cpp.
|
defaultnoexcept |
Destructor an instance of DiagClientConversation -Conversation-Destruction.
|
noexcept |
Function to connect to Diagnostic Server using Target address and IP address of the server.
This will try to initiate a TCP connection with Server and then send DoIP Routing Activation request
[in] | target_address | Logical address of the Remote server |
[in] | host_ip_addr | IP address of the Remote server |
Definition at line 97 of file diagnostic_client_conversation.cpp.
|
noexcept |
Function to disconnect from Diagnostic Server.
This will close the existing TCP connection with Server and reset Routing Activation state
Definition at line 102 of file diagnostic_client_conversation.cpp.
References diag_client_conversation_impl_.
|
noexcept |
Function to send Diagnostic Request and get Diagnostic Response.
This is a blocking function i.e. function call either returns with final diagnostic response (Positive/Negative) or with error. It also handles reception of pending response(NRC 0x78) internally within this function call
[in] | message | The diagnostic request message wrapped in a unique pointer |
Definition at line 107 of file diagnostic_client_conversation.cpp.
|
noexcept |
Function to shutdown the Diagnostic Client Conversation.
Must be called during shutdown phase, no further processing of any function will be allowed after this call -Conversation-Shutdown
Definition at line 95 of file diagnostic_client_conversation.cpp.
References diag_client_conversation_impl_.
|
noexcept |
Function to startup the Diagnostic Client Conversation.
Must be called once and before using any other functions of DiagClientConversation -Conversation-StartUp
Definition at line 93 of file diagnostic_client_conversation.cpp.
References Startup().
Referenced by Startup().
|
private |
Unique pointer to diag client conversation implementation.
Definition at line 138 of file diagnostic_client_conversation.h.
Referenced by DisconnectFromDiagServer(), and Shutdown().