Woman, Life, Freedom


Adaptive AUTOSAR
ARA public interface header documentation
profile.h
1#ifndef PROFILE_H
2#define PROFILE_H
3
4#include <cstdint>
5#include <vector>
6
7namespace ara
8{
9 namespace com
10 {
13 namespace e2e
14 {
15 enum class CheckStatusType
16 {
17 kOk,
18 kWrongCrc,
19 kRepeated,
22 };
23
25 class Profile
26 {
27 protected:
28 Profile() noexcept = default;
29
30 public:
31 virtual ~Profile() noexcept = default;
32
39 virtual bool TryProtect(
40 const std::vector<uint8_t> &unprotectedData,
41 std::vector<uint8_t> &protectedData) = 0;
42
50 virtual bool TryForward(
51 const std::vector<uint8_t> &unprotectedData,
52 std::vector<uint8_t> &protectedData) = 0;
53
59 const std::vector<uint8_t> &protectedData) = 0;
60 };
61 }
62 }
63}
64
65#endif
E2E protection profile abstract class.
Definition: profile.h:26
virtual bool TryForward(const std::vector< uint8_t > &unprotectedData, std::vector< uint8_t > &protectedData)=0
Try to protect a message payload by inserting a CRC header while replicating the E2E status.
virtual bool TryProtect(const std::vector< uint8_t > &unprotectedData, std::vector< uint8_t > &protectedData)=0
Try to protect a message payload by inserting a CRC header.
virtual CheckStatusType Check(const std::vector< uint8_t > &protectedData)=0
Check whether a message is received correctly or not.
CheckStatusType
Definition: profile.h:16
@ kWrongCrc
!< CRC check is OK
@ kRepeated
!< Computed CRC does not match the message CRC
@ kNoNewData
!< The message has been already received
@ kWrongSequence
!< The message data payload is empty