1#ifndef ROUTABLE_USD_SERVICE_H
2#define ROUTABLE_USD_SERVICE_H
6#include "../../core/instance_specifier.h"
7#include "../../core/result.h"
8#include "../meta_info.h"
9#include "../cancellation_handler.h"
49 uint8_t sid)
noexcept;
68 if (_optionalValue.HasValue())
70 std::string _valueStr{_optionalValue.Value()};
71 int _valueInt{std::stoi(_valueStr)};
72 value =
static_cast<T
>(_valueInt);
88 uint8_t
GetSid() const noexcept;
92 ara::core::Result<
void>
Offer();
104 const std::vector<uint8_t> &requestData,
AUTOSAR shortname-path wrapper.
Definition: instance_specifier.h:14
A wrapper around a possible value.
Definition: optional.h:16
A wrapper class around a conversation cancellation handler callback.
Definition: cancellation_handler.h:12
An UDS service to handle a diagnostic request by offering itself to a router.
Definition: routable_uds_service.h:28
const uint8_t cIncorrectMessageLength
Incorrect message length NRC.
Definition: routable_uds_service.h:40
uint8_t GetSid() const noexcept
Get SID.
Definition: routable_uds_service.cpp:27
bool TryExtractValue(MetaInfo &metaInfo, std::string key, T &value) const
Try to extract a value from the given meta-info.
Definition: routable_uds_service.h:64
void GenerateNegativeResponse(OperationOutput &response, uint8_t nrc) const
Generate a negative response with a specific NRC.
Definition: routable_uds_service.cpp:21
const uint8_t cRequestSequenceError
Incorrect request sequence NRC.
Definition: routable_uds_service.h:42
void StopOffer() noexcept
Stop offering request handling.
Definition: routable_uds_service.cpp:57
const uint8_t cSubFunctionNotSupported
Unsupported sub-function NRC.
Definition: routable_uds_service.h:38
static const uint8_t cPositiveResponseSidIncrement
SID increment for a positive response.
Definition: routable_uds_service.h:36
virtual std::future< OperationOutput > HandleMessage(const std::vector< uint8_t > &requestData, MetaInfo &metaInfo, CancellationHandler &&cancellationHandler)=0
Handle an UDS request message.
static const uint8_t cNegativeResponseCodeSid
Negative response code service ID.
Definition: routable_uds_service.h:84
ara::core::Result< void > Offer()
Offer handling DM requests.
Definition: routable_uds_service.cpp:32
bool IsOffered() const noexcept
Get offering status of the service.
Definition: routable_uds_service.cpp:52
RoutableUdsService(const ara::core::InstanceSpecifier &specifier, uint8_t sid) noexcept
Constructor.
Definition: routable_uds_service.cpp:13
Positive response of a handled UDS request.
Definition: routable_uds_service.h:17
std::vector< uint8_t > responseData
Response byte array.
Definition: routable_uds_service.h:19