Woman, Life, Freedom


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

A service to execute a specific sequence of instructions (routine) and obtain the result. More...

#include <generic_routine.h>

Inheritance diagram for ara::diag::GenericRoutine:
ara::diag::routing::RoutableUdsService

Public Member Functions

 GenericRoutine (const core::InstanceSpecifier &specifier, ReentrancyType reentrancyType)
 Constructor. More...
 
std::future< OperationOutputHandleMessage (const std::vector< uint8_t > &requestData, MetaInfo &metaInfo, CancellationHandler &&cancellationHandler) override
 Handle an UDS request message. More...
 
virtual std::future< OperationOutputStart (uint16_t routineId, std::vector< uint8_t > requestData, MetaInfo &metaInfo, CancellationHandler &&cancellationHandler)=0
 Request starting a routine. More...
 
virtual std::future< OperationOutputStop (uint16_t routineId, std::vector< uint8_t > requestData, MetaInfo &metaInfo, CancellationHandler &&cancellationHandler)=0
 Request stopping a routine. More...
 
virtual std::future< OperationOutputRequestResults (uint16_t routineId, std::vector< uint8_t > requestData, MetaInfo &metaInfo, CancellationHandler &&cancellationHandler)=0
 Request the results of a routine. More...
 
- Public Member Functions inherited from ara::diag::routing::RoutableUdsService
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...
 
void StopOffer () noexcept
 Stop offering request handling.
 

Additional Inherited Members

- Static Public Attributes inherited from ara::diag::routing::RoutableUdsService
static const uint8_t cNegativeResponseCodeSid {0x7f}
 Negative response code service ID.
 
- Protected Member Functions inherited from ara::diag::routing::RoutableUdsService
 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 inherited from ara::diag::routing::RoutableUdsService
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 inherited from ara::diag::routing::RoutableUdsService
static const uint8_t cPositiveResponseSidIncrement {0x40}
 SID increment for a positive response.
 

Detailed Description

A service to execute a specific sequence of instructions (routine) and obtain the result.

Note
The class is not fully compatible with the ARA standard.

Constructor & Destructor Documentation

◆ GenericRoutine()

ara::diag::GenericRoutine::GenericRoutine ( const core::InstanceSpecifier specifier,
ReentrancyType  reentrancyType 
)
explicit

Constructor.

Parameters
specifierInstance specifier that owns the service
reentrancyTypeService reentrancy type in a multi-threading contex

Member Function Documentation

◆ HandleMessage()

std::future< OperationOutput > ara::diag::GenericRoutine::HandleMessage ( const std::vector< uint8_t > &  requestData,
MetaInfo metaInfo,
CancellationHandler &&  cancellationHandler 
)
overridevirtual

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

Implements ara::diag::routing::RoutableUdsService.

◆ RequestResults()

virtual std::future< OperationOutput > ara::diag::GenericRoutine::RequestResults ( uint16_t  routineId,
std::vector< uint8_t >  requestData,
MetaInfo metaInfo,
CancellationHandler &&  cancellationHandler 
)
pure virtual

Request the results of a routine.

Parameters
routineIdRoutine ID for the results request
requestDataResults request byte array
metaInfoRequest handling meta-info
cancellationHandlerRequest cancellation token

◆ Start()

virtual std::future< OperationOutput > ara::diag::GenericRoutine::Start ( uint16_t  routineId,
std::vector< uint8_t >  requestData,
MetaInfo metaInfo,
CancellationHandler &&  cancellationHandler 
)
pure virtual

Request starting a routine.

Parameters
routineIdRoutine ID to be started
requestDataStart request byte array
metaInfoRequest handling meta-info
cancellationHandlerRequest cancellation token

◆ Stop()

virtual std::future< OperationOutput > ara::diag::GenericRoutine::Stop ( uint16_t  routineId,
std::vector< uint8_t >  requestData,
MetaInfo metaInfo,
CancellationHandler &&  cancellationHandler 
)
pure virtual

Request stopping a routine.

Parameters
routineIdRoutine ID to be stopped
requestDataStop request byte array
metaInfoRequest handling meta-info
cancellationHandlerRequest cancellation token