1#ifndef READ_DATA_BY_IDENTIFIER_H
2#define READ_DATA_BY_IDENTIFIER_H
5#include "../../ara/diag/routing/uds_service_router.h"
6#include "./curl_wrapper.h"
7#include "./memory_cache.h"
17 static const uint8_t cSid{0x22};
18 static const uint16_t cAverageSpeedDid{0xf50d};
19 static const uint16_t cFuelAmountDid{0xf52f};
20 static const uint16_t cExternalTemperatureDid{0xf546};
21 static const uint16_t cAverageFuelConsumptionDid{0xf55e};
22 static const uint16_t cEngineCoolantTemperatureDid{0xf505};
23 static const uint16_t cOdometerValueDid{0xf5a6};
24 static const std::chrono::seconds cCacheLifetime;
27 const uint8_t cConditionsNotCorrectNrc{0x22};
28 const uint8_t cRequestOutOfRangeNrc{0x31};
29 const bool cCollectJsonComments{
false};
31 const std::string cResourcesUrl;
33 Json::Reader mJsonReader;
36 static uint16_t getDid(
const std::vector<uint8_t> &requestData);
37 static void generateResponse(
41 bool tryGetResourceValue(std::string resourceKey, Json::Value &jsonValue);
55 std::string resourcesUrl);
58 const std::vector<uint8_t> &requestData,
Minimalist C++ wrapper of easy (blocking interface) CURL library for RESTful communication.
Definition: curl_wrapper.h:13
Memory cache helper class with expiration time.
Definition: memory_cache.h:17
UDS to read data at the diagnostic server by passing the data ID (DID)
Definition: read_data_by_identifier.h:15
std::future< ara::diag::OperationOutput > HandleMessage(const std::vector< uint8_t > &requestData, ara::diag::MetaInfo &metaInfo, ara::diag::CancellationHandler &&cancellationHandler) override
Handle an UDS request message.
Definition: read_data_by_identifier.cpp:255
ReadDataByIdentifier(CurlWrapper *curl, std::string resourcesUrl)
Constructor.
Definition: read_data_by_identifier.cpp:19
AUTOSAR shortname-path wrapper.
Definition: instance_specifier.h:14
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
AUTOSAR application namespace.
Definition: diag_message_handler.cpp:5
Positive response of a handled UDS request.
Definition: routable_uds_service.h:17