Woman, Life, Freedom


Adaptive AUTOSAR
ARA public interface header documentation
uds_service_router.h
1#ifndef UDS_SERVICE_ROUTER_H
2#define UDS_SERVICE_ROUTER_H
3
4#include "./routable_uds_service.h"
5
6namespace ara
7{
8 namespace diag
9 {
10 namespace routing
11 {
14 {
15 private:
16 const uint8_t cNegativeResponseSid{0x7f};
17 const uint8_t cServiceNotSupportedNrc{0x11};
18
19 std::map<uint8_t, RoutableUdsService *> mServices;
20
21 public:
22 UdsServiceRouter() = default;
23
27 void AddService(RoutableUdsService *service);
28
32 void RemoveService(uint8_t sid);
33
39 std::future<OperationOutput> Route(
40 const std::vector<std::uint8_t> &requestData,
41 MetaInfo &metaInfo,
42 CancellationHandler &&cancellationHandler) const;
43
44 ~UdsServiceRouter() = default;
45 };
46 }
47 }
48}
49
50#endif
A wrapper class around a conversation cancellation handler callback.
Definition: cancellation_handler.h:12
Diagnostic metainfo in different context.
Definition: meta_info.h:24
An UDS service to handle a diagnostic request by offering itself to a router.
Definition: routable_uds_service.h:28
A class to route an UDS request to the proper service for handling.
Definition: uds_service_router.h:14
std::future< OperationOutput > Route(const std::vector< std::uint8_t > &requestData, MetaInfo &metaInfo, CancellationHandler &&cancellationHandler) const
Route an UDS request message to a service.
Definition: uds_service_router.cpp:24
void RemoveService(uint8_t sid)
Remove a service from the router.
Definition: uds_service_router.cpp:14
void AddService(RoutableUdsService *service)
Add a service to the router.
Definition: uds_service_router.cpp:9