Woman, Life, Freedom


Adaptive AUTOSAR
ARA public interface header documentation
ecu_reset_request.h
1#ifndef ECU_RESET_REQUEST_H
2#define ECU_RESET_REQUEST_H
3
4#include "./routing/routable_uds_service.h"
5
6namespace ara
7{
8 namespace diag
9 {
11 enum class ResetRequestType : uint32_t
12 {
13 kSoftReset = 1,
14 kHardReset = 2,
15 kKeyOffOnReset = 3,
16 kCustomReset = 4
17 };
18
21 {
22 private:
23 static const uint8_t cSid{0x11};
24
25 std::promise<ResetRequestType> mResetTypePromise;
26 std::future<ResetRequestType> mResetTypeFuture;
27 bool mRapidShutdownEnabled;
28
29 bool TryHandleSubFunction(
30 uint8_t subFunction,
31 const MetaInfo &metaInfo,
32 CancellationHandler &&cancellationHandler,
33 bool &powerDownTimeRequired);
34
35 public:
38 explicit EcuResetRequest(const core::InstanceSpecifier &specifier);
39
40 std::future<OperationOutput> HandleMessage(
41 const std::vector<uint8_t> &requestData,
42 MetaInfo &metaInfo,
43 CancellationHandler &&cancellationHandler) override;
44
52 std::future<void> RequestReset(
53 ResetRequestType resetType,
55 const MetaInfo &metaInfo,
56 CancellationHandler &&cancellationHandler);
57
63 void ExecuteReset(const MetaInfo &metaInfo);
64
71 std::future<void> EnableRapidShutdown(
72 bool enable,
73 const MetaInfo &metaInfo,
74 CancellationHandler &&cancellationHandler);
75 };
76 }
77}
78
79#endif
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
ECU reset request handling service.
Definition: ecu_reset_request.h:21
std::future< OperationOutput > HandleMessage(const std::vector< uint8_t > &requestData, MetaInfo &metaInfo, CancellationHandler &&cancellationHandler) override
Handle an UDS request message.
Definition: ecu_reset_request.cpp:87
std::future< void > EnableRapidShutdown(bool enable, const MetaInfo &metaInfo, CancellationHandler &&cancellationHandler)
Set enable state of the rapid shutdown (stand-by) mode.
Definition: ecu_reset_request.cpp:178
EcuResetRequest(const core::InstanceSpecifier &specifier)
Constructor.
Definition: ecu_reset_request.cpp:10
std::future< void > RequestReset(ResetRequestType resetType, core::Optional< uint8_t > id, const MetaInfo &metaInfo, CancellationHandler &&cancellationHandler)
Request the ECU to reset.
Definition: ecu_reset_request.cpp:144
void ExecuteReset(const MetaInfo &metaInfo)
Execute the ECU reset after the request handling.
Definition: ecu_reset_request.cpp:166
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
ResetRequestType
ECU reset request type.
Definition: ecu_reset_request.h:12
@ kKeyOffOnReset
!< ECU reset due to disconnecting and re-connecting the power supply
@ kHardReset
!< ECU reset due to an application request
@ kCustomReset
!< ECU reset due to the ignition key off and on