Woman, Life, Freedom


Adaptive AUTOSAR
ARA public interface header documentation
ara::diag::routing::RoutableUdsService Class Referenceabstract

An UDS service to handle a diagnostic request by offering itself to a router. More...

#include <routable_uds_service.h>

Inheritance diagram for ara::diag::routing::RoutableUdsService:
application::helper::ReadDataByIdentifier ara::diag::EcuResetRequest ara::diag::GenericRoutine ara::diag::GenericUDSService ara::diag::SecurityAccess ara::diag::routing::RequestTransfer ara::diag::routing::RequestTransferExit ara::diag::routing::TransferData

Public Member Functions

uint8_t GetSid () const noexcept
 Get SID. More...
 
ara::core::Result< void > Offer ()
 Offer handling DM requests. More...
 
bool IsOffered () const noexcept
 Get offering status of the service. More...
 
virtual std::future< OperationOutputHandleMessage (const std::vector< uint8_t > &requestData, MetaInfo &metaInfo, CancellationHandler &&cancellationHandler)=0
 Handle an UDS request message. More...
 
void StopOffer () noexcept
 Stop offering request handling.
 

Static Public Attributes

static const uint8_t cNegativeResponseCodeSid {0x7f}
 Negative response code service ID.
 

Protected Member Functions

 RoutableUdsService (const ara::core::InstanceSpecifier &specifier, uint8_t sid) noexcept
 Constructor. More...
 
void GenerateNegativeResponse (OperationOutput &response, uint8_t nrc) const
 Generate a negative response with a specific NRC. More...
 
template<class T >
bool TryExtractValue (MetaInfo &metaInfo, std::string key, T &value) const
 Try to extract a value from the given meta-info. More...
 

Protected Attributes

const uint8_t cSubFunctionNotSupported {0x12}
 Unsupported sub-function NRC.
 
const uint8_t cIncorrectMessageLength {0x13}
 Incorrect message length NRC.
 
const uint8_t cRequestSequenceError {0x24}
 Incorrect request sequence NRC.
 

Static Protected Attributes

static const uint8_t cPositiveResponseSidIncrement {0x40}
 SID increment for a positive response.
 

Detailed Description

An UDS service to handle a diagnostic request by offering itself to a router.

Constructor & Destructor Documentation

◆ RoutableUdsService()

ara::diag::routing::RoutableUdsService::RoutableUdsService ( const ara::core::InstanceSpecifier specifier,
uint8_t  sid 
)
protectednoexcept

Constructor.

Parameters
specifierOwner instance specifier
sidUDS service ID

Member Function Documentation

◆ GenerateNegativeResponse()

void ara::diag::routing::RoutableUdsService::GenerateNegativeResponse ( OperationOutput response,
uint8_t  nrc 
) const
protected

Generate a negative response with a specific NRC.

Parameters
[out]responseGenerated negative response
nrcGiven Negative Response Code (NRC)

◆ GetSid()

uint8_t ara::diag::routing::RoutableUdsService::GetSid ( ) const
noexcept

Get SID.

Returns
Service identification

◆ HandleMessage()

virtual std::future< OperationOutput > ara::diag::routing::RoutableUdsService::HandleMessage ( const std::vector< uint8_t > &  requestData,
MetaInfo metaInfo,
CancellationHandler &&  cancellationHandler 
)
pure virtual

Handle an UDS request message.

Parameters
requestDataRequest message byte array
metaInfoRequest message metainfo
cancellationHandlerCallback to be invoked when the current conversation is cancelled
Returns
Response byte array

Implemented in application::helper::ReadDataByIdentifier, ara::diag::EcuResetRequest, ara::diag::GenericRoutine, ara::diag::routing::RequestTransfer, ara::diag::routing::RequestTransferExit, ara::diag::routing::TransferData, and ara::diag::SecurityAccess.

◆ IsOffered()

bool ara::diag::routing::RoutableUdsService::IsOffered ( ) const
noexcept

Get offering status of the service.

Returns
True if the service has been offered, otherwise false

◆ Offer()

ara::core::Result< void > ara::diag::routing::RoutableUdsService::Offer ( )

Offer handling DM requests.

Returns
Error result if the service has been already offered

◆ TryExtractValue()

template<class T >
bool ara::diag::routing::RoutableUdsService::TryExtractValue ( MetaInfo metaInfo,
std::string  key,
T &  value 
) const
inlineprotected

Try to extract a value from the given meta-info.

Template Parameters
TExtracted value integer type
Parameters
metaInfoGiven meta-info for value extraction
keyValue key within the given meta-info
[out]valueExtracted value
Returns
True if the value is extracted successfully, otherwise false