Woman, Life, Freedom


Adaptive AUTOSAR
ARA public interface header documentation
ara::diag::routing::UdsServiceRouter Class Reference

A class to route an UDS request to the proper service for handling. More...

#include <uds_service_router.h>

Public Member Functions

void AddService (RoutableUdsService *service)
 Add a service to the router. More...
 
void RemoveService (uint8_t sid)
 Remove a service from the router. More...
 
std::future< OperationOutputRoute (const std::vector< std::uint8_t > &requestData, MetaInfo &metaInfo, CancellationHandler &&cancellationHandler) const
 Route an UDS request message to a service. More...
 

Detailed Description

A class to route an UDS request to the proper service for handling.

Member Function Documentation

◆ AddService()

void ara::diag::routing::UdsServiceRouter::AddService ( RoutableUdsService service)

Add a service to the router.

Parameters
serviceService to be added
Remarks
If the service has been added already, the method will replace it.

◆ RemoveService()

void ara::diag::routing::UdsServiceRouter::RemoveService ( uint8_t  sid)

Remove a service from the router.

Parameters
sidSID of the service to be removed
Remarks
If the service has not been added already, the method won't do anything.

◆ Route()

std::future< OperationOutput > ara::diag::routing::UdsServiceRouter::Route ( const std::vector< std::uint8_t > &  requestData,
MetaInfo metaInfo,
CancellationHandler &&  cancellationHandler 
) const

Route an UDS request message to a service.

Parameters
requestDataRequest message byte array
metaInfoRequest message metainfo
cancellationHandlerCallack to be invoked when the current conversation is cancelled
Returns
Response byte array or exception in case of invalid request data