DbcLib 1.0
CAN DBC C++ library.
Loading...
Searching...
No Matches
Public Member Functions | List of all members
dbc::Message Class Reference

DBC message configuration object.

#include <message.h>

Public Member Functions

void Ident (uint64_t ident)
 
uint64_t Ident () const
 
bool IsExtended () const
 True if 29-bit ID.
 
bool IsJ1939 () const
 True if it is a J1939 message.
 
uint32_t CanId () const
 Returns CAN ID.
 
uint8_t Priority () const
 J1939 Priority.
 
uint32_t Pgn () const
 J1939 PGN.
 
uint8_t Source () const
 J1939 Source.
 
bool ExtendedDataPage () const
 J1938 Data Page Flag.
 
bool DataPage () const
 J1938 Data Page Flag.
 
uint8_t PduFormat () const
 J1939 PF.
 
uint8_t PduSpecific () const
 J1939 PS.
 
bool IsPdu1 () const
 True if PDU1.
 
bool IsPdu2 () const
 True if PDU2.
 
void Name (const std::string &name)
 Sets the message name.
 
const std::string & Name () const
 Returns the message name.
 
void Comment (const std::string &comment)
 Sets the descriptive text.
 
const std::string & Comment () const
 Returns the descriptive text.
 
void NofBytes (size_t bytes)
 Sets the number of bytes.
 
size_t NofBytes () const
 Returns the number of bytes.
 
void Node (const std::string &node)
 Sets a node name.
 
std::string NodeName () const
 Returns the node name.
 
SignalGetSignal (const std::string &name)
 Returns a signal by its name.
 
const SignalGetSignal (const std::string &name) const
 Returns a signal by its name.
 
SignalGetMultiplexor ()
 Returns the multiplexer signal object.
 
const AttributeGetAttribute (const std::string &name) const
 Returns an attribute by its name.
 
const SignalListSignals () const
 Returns the signal list.
 
const std::vector< std::string > & Senders () const
 Returns a list of sender names.
 
const std::vector< Attribute > & Attributes () const
 Returns a list of attributes.
 
bool IsNodeSender (const std::string &node_name) const
 Returns true if the node is a sender.
 
const std::vector< uint8_t > & Data () const
 Returns the last message data buffer.
 
bool UpdateData (const std::vector< uint8_t > &message, size_t offset=0, size_t data_index=0)
 Update the internal data buffer.
 
void ParseMessage (uint64_t ns1970, uint32_t can_id)
 Parses the message. Internal usage.
 
void ResetSequenceNumber ()
 Reset the internal sequence counter.
 
uint8_t NextSequenceNumber () const
 Returns the next sequence number.
 
void ResetSampleCounter () const
 Reset the sample counters.
 
void StepSampleCounter () const
 Increments the internal sample counters.
 
size_t SampleCounter () const
 Returns number of samples.
 
AttributeCreateAttribute (const Attribute &definition)
 Creates an attributes by using its definition.
 
SignalCreateSignal (const std::string &name)
 Create a new signal by its name.
 

Member Function Documentation

◆ Ident() [1/2]

uint64_t dbc::Message::Ident ( ) const
inline

< Returns the message ID.

◆ Ident() [2/2]

void dbc::Message::Ident ( uint64_t  ident)
inline

< Sets the message ID (29-bit)

◆ UpdateData()

bool dbc::Message::UpdateData ( const std::vector< uint8_t > &  message,
size_t  offset = 0,
size_t  data_index = 0 
)

Sets the internal last message data buffer. Note that the input offset and destination offset is used if the message requires more than one CAN data message before it is complete.

Parameters
messageMessage data.
offsetOffset in the message data buffer (input index).
data_indexOffset in the last message data buffer (dest index).
Returns
Returns true if this was the last byte (complete message).

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