DBC framework
Public Member Functions | Static Private Member Functions | List of all members
DbcDecoder Class Reference

Runtime CAN decoder using prebuilt decode database. More...

#include <dbc_decoder.h>

Public Member Functions

const DecodeFrameFindFrame (const DecodeDatabase &database, std::uint32_t canId, bool isExtended) const
 Find frame definition by CAN ID. More...
 
DecodedFrameValue Decode (const DecodeDatabase &database, const RawCanFrame &frame) const
 Decode one raw CAN frame. More...
 

Static Private Member Functions

static bool ExtractUnsigned (const std::vector< std::uint8_t > &data, const DecodeSignal &signal, std::uint64_t &value)
 
static bool ExtractIntel (const std::vector< std::uint8_t > &data, std::uint32_t startBit, std::uint32_t length, std::uint64_t &value)
 
static bool ExtractMotorola (const std::vector< std::uint8_t > &data, std::uint32_t startBit, std::uint32_t length, std::uint64_t &value)
 
static std::int64_t SignExtend (std::uint64_t value, std::uint32_t bitLength)
 

Detailed Description

Runtime CAN decoder using prebuilt decode database.

Definition at line 70 of file dbc_decoder.h.

Member Function Documentation

◆ Decode()

DecodedFrameValue DbcDecoder::Decode ( const DecodeDatabase database,
const RawCanFrame frame 
) const

◆ ExtractIntel()

bool DbcDecoder::ExtractIntel ( const std::vector< std::uint8_t > &  data,
std::uint32_t  startBit,
std::uint32_t  length,
std::uint64_t &  value 
)
staticprivate

Definition at line 82 of file dbc_decoder.cpp.

Referenced by ExtractUnsigned().

◆ ExtractMotorola()

bool DbcDecoder::ExtractMotorola ( const std::vector< std::uint8_t > &  data,
std::uint32_t  startBit,
std::uint32_t  length,
std::uint64_t &  value 
)
staticprivate

Definition at line 105 of file dbc_decoder.cpp.

Referenced by ExtractUnsigned().

◆ ExtractUnsigned()

bool DbcDecoder::ExtractUnsigned ( const std::vector< std::uint8_t > &  data,
const DecodeSignal signal,
std::uint64_t &  value 
)
staticprivate

◆ FindFrame()

const DecodeFrame * DbcDecoder::FindFrame ( const DecodeDatabase database,
std::uint32_t  canId,
bool  isExtended 
) const

Find frame definition by CAN ID.

Parameters
databaseRuntime decode database.
canIdNormalized CAN ID.
isExtendedtrue for extended frame.
Returns
Pointer to frame definition or nullptr.

Definition at line 14 of file dbc_decoder.cpp.

References DecodeDatabase::frameIndexByKey, and DecodeDatabase::frames.

Referenced by Decode().

◆ SignExtend()

std::int64_t DbcDecoder::SignExtend ( std::uint64_t  value,
std::uint32_t  bitLength 
)
staticprivate

Definition at line 144 of file dbc_decoder.cpp.

Referenced by Decode().


The documentation for this class was generated from the following files: