Woman, Life, Freedom


DoIP Library
Diagnostics over Internet Protocol (DoIP) C++ library
DoipLib::DoipController Class Reference

DoIP controller to route and handle DoIP messages. More...

#include <doip_controller.h>

Public Member Functions

 DoipController (ControllerConfig &&configuration)
 Constructor. More...
 
void Register (PayloadType payloadType, MessageHandler *messageHandler)
 Register a message handler to manage a specific payload type. More...
 
bool TryHandle (const std::vector< uint8_t > &request, std::vector< uint8_t > &response) const
 Try to handle a DoIP request. More...
 
void StartAnnoucement (std::function< void()> &&callback)
 (Re)start initial vehicle announcement More...
 

Detailed Description

DoIP controller to route and handle DoIP messages.

Constructor & Destructor Documentation

◆ DoipController()

DoipLib::DoipController::DoipController ( ControllerConfig &&  configuration)

Constructor.

Parameters
configurationController configurtation

Member Function Documentation

◆ Register()

void DoipLib::DoipController::Register ( PayloadType  payloadType,
MessageHandler messageHandler 
)

Register a message handler to manage a specific payload type.

Parameters
payloadTypePayload type to be managed via the handler
messageHandlerHandler to manage the messages with a specific payload type

◆ StartAnnoucement()

void DoipLib::DoipController::StartAnnoucement ( std::function< void()> &&  callback)

(Re)start initial vehicle announcement

Parameters
callbackDelegate to be invoked at each annoucement tick
Note
The function will block until the announcement process starts.

◆ TryHandle()

bool DoipLib::DoipController::TryHandle ( const std::vector< uint8_t > &  request,
std::vector< uint8_t > &  response 
) const

Try to handle a DoIP request.

Parameters
[in]requestDoIP request byte vector
[out]responseDoIP response byte vector
Returns
True if the request is handled correctly, otherwise false
Note
In case of incorrect request handling, the passed response vector will be untouched.