Woman, Life, Freedom


Adaptive AUTOSAR
ARA public interface header documentation
application::doip::DoipClient Class Reference

A class to send DoIP requests to a DoIP server. More...

#include <doip_client.h>

Public Member Functions

 DoipClient (AsyncBsdSocketLib::Poller *poller, std::string ipAddress, uint16_t port, uint8_t protocolVersion, std::function< void(std::vector< uint8_t > &&)> &&callback)
 Constructor. More...
 
bool TrySendDiagMessage (std::vector< uint8_t > &&userData)
 Try to send a diagnostic message to the DoIP server asynchronously. More...
 

Detailed Description

A class to send DoIP requests to a DoIP server.

See also
DoipServer

Constructor & Destructor Documentation

◆ DoipClient()

application::doip::DoipClient::DoipClient ( AsyncBsdSocketLib::Poller *  poller,
std::string  ipAddress,
uint16_t  port,
uint8_t  protocolVersion,
std::function< void(std::vector< uint8_t > &&)> &&  callback 
)

Constructor.

Parameters
pollerGlobal poller for network communication
ipAddressDoIP server IPv4 address
portDoIP server TCP listening port number
protocolVersionDoIP protocol version
callbackCallback to be invoked while receiving diagnostic message ACKs
Exceptions
std::runtime_errorThrows when the TCP connection configuration failed

Member Function Documentation

◆ TrySendDiagMessage()

bool application::doip::DoipClient::TrySendDiagMessage ( std::vector< uint8_t > &&  userData)

Try to send a diagnostic message to the DoIP server asynchronously.

Parameters
userDataDiagnostic message user data (UDS message payload)
Returns
True if the message is successfully queued for sending; otherwise false
Note
Sending diagnostic messages is possible only when the logical address is fetched.