\hypertarget{dbc__decoder_8h_source}{}\doxysection{dbc\+\_\+decoder.\+h}
\mbox{\hyperlink{dbc__decoder_8h}{Go to the documentation of this file.}}
\begin{DoxyCode}{0}
\DoxyCodeLine{\Hypertarget{dbc__decoder_8h_source_l00001}00001 \textcolor{comment}{/**}}
\DoxyCodeLine{\Hypertarget{dbc__decoder_8h_source_l00002}00002 \textcolor{comment}{ * @file dbc\_decoder.h}}
\DoxyCodeLine{\Hypertarget{dbc__decoder_8h_source_l00003}00003 \textcolor{comment}{ * @brief}}
\DoxyCodeLine{\Hypertarget{dbc__decoder_8h_source_l00004}00004 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{dbc__decoder_8h_source_l00005}00005 \textcolor{comment}{ * Created: 2026-\/03-\/13}}
\DoxyCodeLine{\Hypertarget{dbc__decoder_8h_source_l00006}00006 \textcolor{comment}{ * Author: Deeaitch (Dim. Himro)}}
\DoxyCodeLine{\Hypertarget{dbc__decoder_8h_source_l00007}00007 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{dbc__decoder_8h_source_l00008}00008 \textcolor{comment}{ * Licensed under the MIT License.}}
\DoxyCodeLine{\Hypertarget{dbc__decoder_8h_source_l00009}00009 \textcolor{comment}{ * See LICENSE file in the project root for full license text.}}
\DoxyCodeLine{\Hypertarget{dbc__decoder_8h_source_l00010}00010 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{dbc__decoder_8h_source_l00011}00011 }
\DoxyCodeLine{\Hypertarget{dbc__decoder_8h_source_l00012}00012 \textcolor{preprocessor}{\#ifndef DBC\_DECODER\_H}}
\DoxyCodeLine{\Hypertarget{dbc__decoder_8h_source_l00013}00013 \textcolor{preprocessor}{\#define DBC\_DECODER\_H}}
\DoxyCodeLine{\Hypertarget{dbc__decoder_8h_source_l00014}00014 }
\DoxyCodeLine{\Hypertarget{dbc__decoder_8h_source_l00015}00015 \textcolor{preprocessor}{\#include <vector>}}
\DoxyCodeLine{\Hypertarget{dbc__decoder_8h_source_l00016}00016 \textcolor{preprocessor}{\#include <cstdint>}}
\DoxyCodeLine{\Hypertarget{dbc__decoder_8h_source_l00017}00017 }
\DoxyCodeLine{\Hypertarget{dbc__decoder_8h_source_l00018}00018 \textcolor{preprocessor}{\#include "{}\mbox{\hyperlink{decode__database_8h}{decode\_database.h}}"{}}}
\DoxyCodeLine{\Hypertarget{dbc__decoder_8h_source_l00019}00019 \textcolor{comment}{}}
\DoxyCodeLine{\Hypertarget{dbc__decoder_8h_source_l00020}00020 \textcolor{comment}{/**}}
\DoxyCodeLine{\Hypertarget{dbc__decoder_8h_source_l00021}00021 \textcolor{comment}{ * @brief Raw CAN frame used for runtime or trace decoding.}}
\DoxyCodeLine{\Hypertarget{dbc__decoder_8h_source_l00022}00022 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{dbc__decoder_8h_source_l00023}\mbox{\hyperlink{structRawCanFrame}{00023}} \textcolor{keyword}{struct }\mbox{\hyperlink{structRawCanFrame}{RawCanFrame}} \{}
\DoxyCodeLine{\Hypertarget{dbc__decoder_8h_source_l00024}\mbox{\hyperlink{structRawCanFrame_a2d0e7fa0e3d5c20bbed55ed8f7888ff4}{00024}}   std::uint32\_t \mbox{\hyperlink{structRawCanFrame_a2d0e7fa0e3d5c20bbed55ed8f7888ff4}{canId}};           \textcolor{comment}{/**< Normalized CAN ID. */}}
\DoxyCodeLine{\Hypertarget{dbc__decoder_8h_source_l00025}\mbox{\hyperlink{structRawCanFrame_a462193d275adc1dba8bd18ffa0e36bb7}{00025}}   \textcolor{keywordtype}{bool} \mbox{\hyperlink{structRawCanFrame_a462193d275adc1dba8bd18ffa0e36bb7}{isExtended}};               \textcolor{comment}{/**< true for extended frame. */}}
\DoxyCodeLine{\Hypertarget{dbc__decoder_8h_source_l00026}\mbox{\hyperlink{structRawCanFrame_a0acb487612104c99c9907344c035df83}{00026}}   std::vector<std::uint8\_t> \mbox{\hyperlink{structRawCanFrame_a0acb487612104c99c9907344c035df83}{data}}; \textcolor{comment}{/**< Payload bytes. */}}
\DoxyCodeLine{\Hypertarget{dbc__decoder_8h_source_l00027}00027 }
\DoxyCodeLine{\Hypertarget{dbc__decoder_8h_source_l00028}\mbox{\hyperlink{structRawCanFrame_a17d18b39bed45e69f4e17ae2838f07f7}{00028}}   \mbox{\hyperlink{structRawCanFrame_a17d18b39bed45e69f4e17ae2838f07f7}{RawCanFrame}}()}
\DoxyCodeLine{\Hypertarget{dbc__decoder_8h_source_l00029}00029     : \mbox{\hyperlink{structRawCanFrame_a2d0e7fa0e3d5c20bbed55ed8f7888ff4}{canId}} (0U)}
\DoxyCodeLine{\Hypertarget{dbc__decoder_8h_source_l00030}00030     , \mbox{\hyperlink{structRawCanFrame_a462193d275adc1dba8bd18ffa0e36bb7}{isExtended}} (false)}
\DoxyCodeLine{\Hypertarget{dbc__decoder_8h_source_l00031}00031     , \mbox{\hyperlink{structRawCanFrame_a0acb487612104c99c9907344c035df83}{data}}() \{}
\DoxyCodeLine{\Hypertarget{dbc__decoder_8h_source_l00032}00032   \}}
\DoxyCodeLine{\Hypertarget{dbc__decoder_8h_source_l00033}00033 \};}
\DoxyCodeLine{\Hypertarget{dbc__decoder_8h_source_l00034}00034 \textcolor{comment}{}}
\DoxyCodeLine{\Hypertarget{dbc__decoder_8h_source_l00035}00035 \textcolor{comment}{/**}}
\DoxyCodeLine{\Hypertarget{dbc__decoder_8h_source_l00036}00036 \textcolor{comment}{ * @brief One decoded signal value.}}
\DoxyCodeLine{\Hypertarget{dbc__decoder_8h_source_l00037}00037 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{dbc__decoder_8h_source_l00038}\mbox{\hyperlink{structDecodedSignalValue}{00038}} \textcolor{keyword}{struct }\mbox{\hyperlink{structDecodedSignalValue}{DecodedSignalValue}} \{}
\DoxyCodeLine{\Hypertarget{dbc__decoder_8h_source_l00039}\mbox{\hyperlink{structDecodedSignalValue_acadc3b3bb21dd6b0412d342c7e6b20d7}{00039}}   \textcolor{keyword}{const} \mbox{\hyperlink{structDecodeSignal}{DecodeSignal}} *\mbox{\hyperlink{structDecodedSignalValue_acadc3b3bb21dd6b0412d342c7e6b20d7}{definition}}; \textcolor{comment}{/**< Signal definition. */}}
\DoxyCodeLine{\Hypertarget{dbc__decoder_8h_source_l00040}\mbox{\hyperlink{structDecodedSignalValue_a5138b825940e34689f7b3891627ee9ec}{00040}}   std::int64\_t \mbox{\hyperlink{structDecodedSignalValue_a5138b825940e34689f7b3891627ee9ec}{rawValue}};          \textcolor{comment}{/**< Extracted raw integer value. */}}
\DoxyCodeLine{\Hypertarget{dbc__decoder_8h_source_l00041}\mbox{\hyperlink{structDecodedSignalValue_a6847d05b3cb00d5e0f6c611968f57978}{00041}}   \textcolor{keywordtype}{double} \mbox{\hyperlink{structDecodedSignalValue_a6847d05b3cb00d5e0f6c611968f57978}{physicalValue}};           \textcolor{comment}{/**< Converted physical value. */}}
\DoxyCodeLine{\Hypertarget{dbc__decoder_8h_source_l00042}\mbox{\hyperlink{structDecodedSignalValue_aac0ed361af545cde48d0e6f41a859686}{00042}}   \textcolor{keywordtype}{bool} \mbox{\hyperlink{structDecodedSignalValue_aac0ed361af545cde48d0e6f41a859686}{valid}};                     \textcolor{comment}{/**< true if decoding succeeded. */}}
\DoxyCodeLine{\Hypertarget{dbc__decoder_8h_source_l00043}00043 }
\DoxyCodeLine{\Hypertarget{dbc__decoder_8h_source_l00044}\mbox{\hyperlink{structDecodedSignalValue_a1481b122a7ce5a618012b1133c6adedf}{00044}}   \mbox{\hyperlink{structDecodedSignalValue_a1481b122a7ce5a618012b1133c6adedf}{DecodedSignalValue}}()}
\DoxyCodeLine{\Hypertarget{dbc__decoder_8h_source_l00045}00045     : \mbox{\hyperlink{structDecodedSignalValue_acadc3b3bb21dd6b0412d342c7e6b20d7}{definition}} (nullptr)}
\DoxyCodeLine{\Hypertarget{dbc__decoder_8h_source_l00046}00046     , \mbox{\hyperlink{structDecodedSignalValue_a5138b825940e34689f7b3891627ee9ec}{rawValue}} (0)}
\DoxyCodeLine{\Hypertarget{dbc__decoder_8h_source_l00047}00047     , \mbox{\hyperlink{structDecodedSignalValue_a6847d05b3cb00d5e0f6c611968f57978}{physicalValue}} (0.0)}
\DoxyCodeLine{\Hypertarget{dbc__decoder_8h_source_l00048}00048     , \mbox{\hyperlink{structDecodedSignalValue_aac0ed361af545cde48d0e6f41a859686}{valid}} (false) \{}
\DoxyCodeLine{\Hypertarget{dbc__decoder_8h_source_l00049}00049   \}}
\DoxyCodeLine{\Hypertarget{dbc__decoder_8h_source_l00050}00050 \};}
\DoxyCodeLine{\Hypertarget{dbc__decoder_8h_source_l00051}00051 \textcolor{comment}{}}
\DoxyCodeLine{\Hypertarget{dbc__decoder_8h_source_l00052}00052 \textcolor{comment}{/**}}
\DoxyCodeLine{\Hypertarget{dbc__decoder_8h_source_l00053}00053 \textcolor{comment}{ * @brief Fully decoded frame.}}
\DoxyCodeLine{\Hypertarget{dbc__decoder_8h_source_l00054}00054 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{dbc__decoder_8h_source_l00055}\mbox{\hyperlink{structDecodedFrameValue}{00055}} \textcolor{keyword}{struct }\mbox{\hyperlink{structDecodedFrameValue}{DecodedFrameValue}} \{}
\DoxyCodeLine{\Hypertarget{dbc__decoder_8h_source_l00056}\mbox{\hyperlink{structDecodedFrameValue_a60dda1cc352d2c8087f0bdbc81dd266c}{00056}}   \textcolor{keyword}{const} \mbox{\hyperlink{structDecodeFrame}{DecodeFrame}} *\mbox{\hyperlink{structDecodedFrameValue_a60dda1cc352d2c8087f0bdbc81dd266c}{definition}};          \textcolor{comment}{/**< Frame definition. */}}
\DoxyCodeLine{\Hypertarget{dbc__decoder_8h_source_l00057}\mbox{\hyperlink{structDecodedFrameValue_a8440e0e5d7953102095b029f522022d3}{00057}}   std::vector<DecodedSignalValue> \mbox{\hyperlink{structDecodedFrameValue_a8440e0e5d7953102095b029f522022d3}{signals}}; \textcolor{comment}{/**< Decoded signal values. */}}
\DoxyCodeLine{\Hypertarget{dbc__decoder_8h_source_l00058}\mbox{\hyperlink{structDecodedFrameValue_a4f51c31110dba1f73a763c596372beb0}{00058}}   \textcolor{keywordtype}{bool} \mbox{\hyperlink{structDecodedFrameValue_a4f51c31110dba1f73a763c596372beb0}{valid}};                             \textcolor{comment}{/**< true if frame was matched. */}}
\DoxyCodeLine{\Hypertarget{dbc__decoder_8h_source_l00059}00059 }
\DoxyCodeLine{\Hypertarget{dbc__decoder_8h_source_l00060}\mbox{\hyperlink{structDecodedFrameValue_a19f754bb84e67e6ae71ea93b9ae6382b}{00060}}   \mbox{\hyperlink{structDecodedFrameValue_a19f754bb84e67e6ae71ea93b9ae6382b}{DecodedFrameValue}}()}
\DoxyCodeLine{\Hypertarget{dbc__decoder_8h_source_l00061}00061     : \mbox{\hyperlink{structDecodedFrameValue_a60dda1cc352d2c8087f0bdbc81dd266c}{definition}} (nullptr)}
\DoxyCodeLine{\Hypertarget{dbc__decoder_8h_source_l00062}00062     , \mbox{\hyperlink{structDecodedFrameValue_a8440e0e5d7953102095b029f522022d3}{signals}}()}
\DoxyCodeLine{\Hypertarget{dbc__decoder_8h_source_l00063}00063     , \mbox{\hyperlink{structDecodedFrameValue_a4f51c31110dba1f73a763c596372beb0}{valid}} (false) \{}
\DoxyCodeLine{\Hypertarget{dbc__decoder_8h_source_l00064}00064   \}}
\DoxyCodeLine{\Hypertarget{dbc__decoder_8h_source_l00065}00065 \};}
\DoxyCodeLine{\Hypertarget{dbc__decoder_8h_source_l00066}00066 \textcolor{comment}{}}
\DoxyCodeLine{\Hypertarget{dbc__decoder_8h_source_l00067}00067 \textcolor{comment}{/**}}
\DoxyCodeLine{\Hypertarget{dbc__decoder_8h_source_l00068}00068 \textcolor{comment}{ * @brief Runtime CAN decoder using prebuilt decode database.}}
\DoxyCodeLine{\Hypertarget{dbc__decoder_8h_source_l00069}00069 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{dbc__decoder_8h_source_l00070}\mbox{\hyperlink{classDbcDecoder}{00070}} \textcolor{keyword}{class }\mbox{\hyperlink{classDbcDecoder}{DbcDecoder}} \{}
\DoxyCodeLine{\Hypertarget{dbc__decoder_8h_source_l00071}00071   \textcolor{keyword}{public}:\textcolor{comment}{}}
\DoxyCodeLine{\Hypertarget{dbc__decoder_8h_source_l00072}00072 \textcolor{comment}{    /**}}
\DoxyCodeLine{\Hypertarget{dbc__decoder_8h_source_l00073}00073 \textcolor{comment}{     * @brief Find frame definition by CAN ID.}}
\DoxyCodeLine{\Hypertarget{dbc__decoder_8h_source_l00074}00074 \textcolor{comment}{     * @param database Runtime decode database.}}
\DoxyCodeLine{\Hypertarget{dbc__decoder_8h_source_l00075}00075 \textcolor{comment}{     * @param canId Normalized CAN ID.}}
\DoxyCodeLine{\Hypertarget{dbc__decoder_8h_source_l00076}00076 \textcolor{comment}{     * @param isExtended true for extended frame.}}
\DoxyCodeLine{\Hypertarget{dbc__decoder_8h_source_l00077}00077 \textcolor{comment}{     * @return Pointer to frame definition or nullptr.}}
\DoxyCodeLine{\Hypertarget{dbc__decoder_8h_source_l00078}00078 \textcolor{comment}{     */}}
\DoxyCodeLine{\Hypertarget{dbc__decoder_8h_source_l00079}00079     \textcolor{keyword}{const} \mbox{\hyperlink{structDecodeFrame}{DecodeFrame}} *\mbox{\hyperlink{classDbcDecoder_ab2cfb2fb711c95d3a29365546b89f3da}{FindFrame}} (\textcolor{keyword}{const} \mbox{\hyperlink{structDecodeDatabase}{DecodeDatabase}} \&database,}
\DoxyCodeLine{\Hypertarget{dbc__decoder_8h_source_l00080}00080                                   std::uint32\_t canId,}
\DoxyCodeLine{\Hypertarget{dbc__decoder_8h_source_l00081}00081                                   \textcolor{keywordtype}{bool} isExtended) \textcolor{keyword}{const};}
\DoxyCodeLine{\Hypertarget{dbc__decoder_8h_source_l00082}00082 \textcolor{comment}{}}
\DoxyCodeLine{\Hypertarget{dbc__decoder_8h_source_l00083}00083 \textcolor{comment}{    /**}}
\DoxyCodeLine{\Hypertarget{dbc__decoder_8h_source_l00084}00084 \textcolor{comment}{     * @brief Decode one raw CAN frame.}}
\DoxyCodeLine{\Hypertarget{dbc__decoder_8h_source_l00085}00085 \textcolor{comment}{     * @param database Runtime decode database.}}
\DoxyCodeLine{\Hypertarget{dbc__decoder_8h_source_l00086}00086 \textcolor{comment}{     * @param frame Raw CAN frame.}}
\DoxyCodeLine{\Hypertarget{dbc__decoder_8h_source_l00087}00087 \textcolor{comment}{     * @return Decoded frame value.}}
\DoxyCodeLine{\Hypertarget{dbc__decoder_8h_source_l00088}00088 \textcolor{comment}{     */}}
\DoxyCodeLine{\Hypertarget{dbc__decoder_8h_source_l00089}00089     \mbox{\hyperlink{structDecodedFrameValue}{DecodedFrameValue}} \mbox{\hyperlink{classDbcDecoder_a345951ffe5d943a70d3a1ea1f39e74f7}{Decode}} (\textcolor{keyword}{const} \mbox{\hyperlink{structDecodeDatabase}{DecodeDatabase}} \&database,}
\DoxyCodeLine{\Hypertarget{dbc__decoder_8h_source_l00090}00090                               \textcolor{keyword}{const} \mbox{\hyperlink{structRawCanFrame}{RawCanFrame}} \&frame) \textcolor{keyword}{const};}
\DoxyCodeLine{\Hypertarget{dbc__decoder_8h_source_l00091}00091 }
\DoxyCodeLine{\Hypertarget{dbc__decoder_8h_source_l00092}00092   \textcolor{keyword}{private}:}
\DoxyCodeLine{\Hypertarget{dbc__decoder_8h_source_l00093}00093     \textcolor{keyword}{static} \textcolor{keywordtype}{bool} \mbox{\hyperlink{classDbcDecoder_a2a8a99b1107543be6fd1b3f891130bf5}{ExtractUnsigned}} (\textcolor{keyword}{const} std::vector<std::uint8\_t> \&data,}
\DoxyCodeLine{\Hypertarget{dbc__decoder_8h_source_l00094}00094                                  \textcolor{keyword}{const} \mbox{\hyperlink{structDecodeSignal}{DecodeSignal}} \&signal,}
\DoxyCodeLine{\Hypertarget{dbc__decoder_8h_source_l00095}00095                                  std::uint64\_t \&value);}
\DoxyCodeLine{\Hypertarget{dbc__decoder_8h_source_l00096}00096 }
\DoxyCodeLine{\Hypertarget{dbc__decoder_8h_source_l00097}00097     \textcolor{keyword}{static} \textcolor{keywordtype}{bool} \mbox{\hyperlink{classDbcDecoder_aba130165c1a73bb4cd3a0454f415d872}{ExtractIntel}} (\textcolor{keyword}{const} std::vector<std::uint8\_t> \&data,}
\DoxyCodeLine{\Hypertarget{dbc__decoder_8h_source_l00098}00098                               std::uint32\_t startBit,}
\DoxyCodeLine{\Hypertarget{dbc__decoder_8h_source_l00099}00099                               std::uint32\_t length,}
\DoxyCodeLine{\Hypertarget{dbc__decoder_8h_source_l00100}00100                               std::uint64\_t \&value);}
\DoxyCodeLine{\Hypertarget{dbc__decoder_8h_source_l00101}00101 }
\DoxyCodeLine{\Hypertarget{dbc__decoder_8h_source_l00102}00102     \textcolor{keyword}{static} \textcolor{keywordtype}{bool} \mbox{\hyperlink{classDbcDecoder_aede690734148c3d538105d5a2f7ee0a9}{ExtractMotorola}} (\textcolor{keyword}{const} std::vector<std::uint8\_t> \&data,}
\DoxyCodeLine{\Hypertarget{dbc__decoder_8h_source_l00103}00103                                  std::uint32\_t startBit,}
\DoxyCodeLine{\Hypertarget{dbc__decoder_8h_source_l00104}00104                                  std::uint32\_t length,}
\DoxyCodeLine{\Hypertarget{dbc__decoder_8h_source_l00105}00105                                  std::uint64\_t \&value);}
\DoxyCodeLine{\Hypertarget{dbc__decoder_8h_source_l00106}00106 }
\DoxyCodeLine{\Hypertarget{dbc__decoder_8h_source_l00107}00107     \textcolor{keyword}{static} std::int64\_t \mbox{\hyperlink{classDbcDecoder_a41e89e343338088d27e46773fa52df42}{SignExtend}} (std::uint64\_t value, std::uint32\_t bitLength);}
\DoxyCodeLine{\Hypertarget{dbc__decoder_8h_source_l00108}00108 \};}
\DoxyCodeLine{\Hypertarget{dbc__decoder_8h_source_l00109}00109 }
\DoxyCodeLine{\Hypertarget{dbc__decoder_8h_source_l00110}00110 \textcolor{preprocessor}{\#endif }\textcolor{comment}{/* DBC\_DECODER\_H */}\textcolor{preprocessor}{}}

\end{DoxyCode}
