A class to send DoIP requests to a DoIP server.
More...
#include <doip_client.h>
|
| 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...
|
|
A class to send DoIP requests to a DoIP server.
- See also
- DoipServer
◆ 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
-
poller | Global poller for network communication |
ipAddress | DoIP server IPv4 address |
port | DoIP server TCP listening port number |
protocolVersion | DoIP protocol version |
callback | Callback to be invoked while receiving diagnostic message ACKs |
- Exceptions
-
std::runtime_error | Throws when the TCP connection configuration failed |
◆ TrySendDiagMessage()
bool application::doip::DoipClient::TrySendDiagMessage |
( |
std::vector< uint8_t > && |
userData | ) |
|
Try to send a diagnostic message to the DoIP server asynchronously.
- Parameters
-
userData | Diagnostic 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.