summaryrefslogtreecommitdiff
path: root/implementation/e2e_protection/include/e2e/profile/profile01/protector.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'implementation/e2e_protection/include/e2e/profile/profile01/protector.hpp')
-rw-r--r--implementation/e2e_protection/include/e2e/profile/profile01/protector.hpp36
1 files changed, 36 insertions, 0 deletions
diff --git a/implementation/e2e_protection/include/e2e/profile/profile01/protector.hpp b/implementation/e2e_protection/include/e2e/profile/profile01/protector.hpp
new file mode 100644
index 0000000..7c10f25
--- /dev/null
+++ b/implementation/e2e_protection/include/e2e/profile/profile01/protector.hpp
@@ -0,0 +1,36 @@
+// Copyright (C) 2014-2017 Bayerische Motoren Werke Aktiengesellschaft (BMW AG)
+// This Source Code Form is subject to the terms of the Mozilla Public
+// License, v. 2.0. If a copy of the MPL was not distributed with this
+// file, You can obtain one at http://mozilla.org/MPL/2.0/.
+
+#ifndef E2E_PROFILE_PROFILE01_PROTECTOR_HPP
+#define E2E_PROFILE_PROFILE01_PROTECTOR_HPP
+
+#include <mutex>
+#include "../profile01/profile_01.hpp"
+#include "../profile_interface/protector.hpp"
+
+namespace e2e {
+namespace profile {
+namespace profile01 {
+
+class protector final : public e2e::profile::profile_interface::protector {
+ public:
+ protector(void) = delete;
+
+ explicit protector(const Config &_config) : config(_config){};
+
+ void protect(buffer::e2e_buffer &_buffer) override final;
+
+ private:
+
+ void write_crc(buffer::e2e_buffer &_buffer, uint8_t _computed_crc);
+
+ private:
+ Config config;
+ std::mutex protect_mutex;
+};
+}
+}
+}
+#endif