Woman, Life, Freedom


Adaptive AUTOSAR
ARA public interface header documentation
profile11.h
1#ifndef PROFILE11_H
2#define PROFILE11_H
3
4#include <array>
5#include <atomic>
6#include "./profile.h"
7
8namespace ara
9{
10 namespace com
11 {
12 namespace e2e
13 {
16 class Profile11 : public Profile
17 {
18 private:
19 static constexpr std::size_t cTableSize{256};
20 static volatile std::atomic_bool mCrcTableInitialized;
21 static std::array<uint8_t, cTableSize> mCrcTable;
22
23 const uint8_t cCounterMax{0x0e};
24
25 uint8_t mProtectingCounter;
26 uint8_t mCheckingCounter;
27
28 static void initializeCrcTable(uint8_t crcPoly) noexcept;
29 static uint8_t calculateCrc(
30 const std::vector<uint8_t> &data, std::size_t offset = 0);
31
32 public:
33 Profile11() noexcept;
34
35 bool TryProtect(
36 const std::vector<uint8_t> &unprotectedData,
37 std::vector<uint8_t> &protectedData) override;
38
39 bool TryForward(
40 const std::vector<uint8_t> &unprotectedData,
41 std::vector<uint8_t> &protectedData) override;
42
44 const std::vector<uint8_t> &protectedData) override;
45 };
46 }
47 }
48}
49
50#endif
E2E Profile11 variant A implementation.
Definition: profile11.h:17
bool TryForward(const std::vector< uint8_t > &unprotectedData, std::vector< uint8_t > &protectedData) override
Try to protect a message payload by inserting a CRC header while replicating the E2E status.
Definition: profile11.cpp:92
CheckStatusType Check(const std::vector< uint8_t > &protectedData) override
Check whether a message is received correctly or not.
Definition: profile11.cpp:99
bool TryProtect(const std::vector< uint8_t > &unprotectedData, std::vector< uint8_t > &protectedData) override
Try to protect a message payload by inserting a CRC header.
Definition: profile11.cpp:58
E2E protection profile abstract class.
Definition: profile.h:26
CheckStatusType
Definition: profile.h:16