Line | Branch | Exec | Source |
---|---|---|---|
1 | // This file is part of INSTINCT, the INS Toolkit for Integrated | ||
2 | // Navigation Concepts and Training by the Institute of Navigation of | ||
3 | // the University of Stuttgart, Germany. | ||
4 | // | ||
5 | // This Source Code Form is subject to the terms of the Mozilla Public | ||
6 | // License, v. 2.0. If a copy of the MPL was not distributed with this | ||
7 | // file, You can obtain one at https://mozilla.org/MPL/2.0/. | ||
8 | |||
9 | /// @file UartPacket.hpp | ||
10 | /// @brief UART Packet storage class | ||
11 | /// @author T. Topp (topp@ins.uni-stuttgart.de) | ||
12 | /// @date 2022-06-13 | ||
13 | |||
14 | #pragma once | ||
15 | |||
16 | #include "NodeData/NodeData.hpp" | ||
17 | |||
18 | #include "uart/protocol/packet.hpp" | ||
19 | |||
20 | namespace NAV | ||
21 | { | ||
22 | /// UART Packet storage class | ||
23 | class UartPacket : public NodeData | ||
24 | { | ||
25 | public: | ||
26 | /// @brief Constructor | ||
27 | /// @param[in] packet The packet to copy into the raw data | ||
28 | ✗ | explicit UartPacket(uart::protocol::Packet& packet) | |
29 | ✗ | : raw(packet) {} | |
30 | |||
31 | /// @brief Returns the type of the data class | ||
32 | /// @return The data type | ||
33 | 560 | [[nodiscard]] static std::string type() | |
34 | { | ||
35 |
1/2✓ Branch 1 taken 560 times.
✗ Branch 2 not taken.
|
1120 | return "UartPacket"; |
36 | } | ||
37 | |||
38 | /// @brief Returns the type of the data class | ||
39 | /// @return The data type | ||
40 | ✗ | [[nodiscard]] std::string getType() const override { return type(); } | |
41 | |||
42 | /// @brief Returns the parent types of the data class | ||
43 | /// @return The parent data types | ||
44 | [[nodiscard]] static std::vector<std::string> parentTypes() | ||
45 | { | ||
46 | return { NodeData::type() }; | ||
47 | } | ||
48 | |||
49 | /// Complete message raw binary data | ||
50 | uart::protocol::Packet raw; | ||
51 | }; | ||
52 | |||
53 | } // namespace NAV | ||
54 |