Line data Source code
1 : /**
2 : * @file frame_info.h
3 : * @brief Parsed CAN frame metadata.
4 : *
5 : * Created: 2026-03-13
6 : * Author: Deeaitch (Dim. Himro)
7 : *
8 : * Licensed under the MIT License.
9 : * See LICENSE file in the project root for full license text.
10 : */
11 :
12 : #ifndef FRAME_INFO_H
13 : #define FRAME_INFO_H
14 :
15 : #include "attributes.h"
16 : #include <cstdint>
17 : #include <string>
18 : #include <vector>
19 :
20 : #include "signal_info.h"
21 :
22 : /**
23 : * @brief Describes one CAN frame from a DBC file.
24 : */
25 : struct FrameInfo {
26 : std::string name; /**< Frame name. */
27 : std::uint32_t canId = 0U; /**< Normalized CAN identifier. */
28 : bool isExtended = false; /**< true for extended frame. */
29 : std::uint32_t pgn = 0U; /**< J1939 PGN if applicable. */
30 : bool hasPgn = false; /**< Explicit J1939 opt-in; pgn is derived from canId. */
31 : std::uint8_t dlc = 0U; /**< Frame payload length. */
32 : std::string transmitter; /**< Transmitter ECU name. */
33 : std::string comment; /**< Optional frame comment. */
34 : std::vector<SignalInfo> signals; /**< Signals contained in the frame. */
35 :
36 : std::optional<std::string> frameFormat; /**< VFrameFormat label, when declared. */ /**< VFrameFormat enum label. */
37 : std::optional<std::uint32_t> cycleTimeMs; /**< GenMsgCycleTime in milliseconds, when declared. */ /**< GenMsgCycleTime; zero means unspecified. */
38 :
39 : AttributeMap attributes; /**< Effective attributes after defaults and overrides. */ /**< Effective values, including defaults. */
40 :
41 716 : FrameInfo() = default;
42 : };
43 :
44 : #endif /* FRAME_INFO_H */
|