27 [[nodiscard]] uint64_t
Ident()
const {
33 [[nodiscard]] uint32_t
CanId()
const;
35 [[nodiscard]] uint32_t
Pgn()
const;
36 [[nodiscard]] uint8_t
Source()
const;
45 void Name(
const std::string& name) { name_ = name; }
47 [[nodiscard]]
const std::string&
Name()
const {
return name_; }
50 void Comment(
const std::string& comment) { comment_ = comment; }
52 [[nodiscard]]
const std::string&
Comment()
const {
return comment_; }
58 void Node(
const std::string& node) {
62 sender_list_.push_back(node);
85 [[nodiscard]]
const std::vector<std::string>&
Senders()
const {
90 [[nodiscard]]
const std::vector<Attribute>&
Attributes()
const {
91 return attribute_list_;
95 [[nodiscard]]
bool IsNodeSender(
const std::string& node_name)
const;
98 [[nodiscard]]
const std::vector<uint8_t>&
Data()
const {
return data_;}
112 size_t offset = 0,
size_t data_index = 0);
135 std::string comment_;
137 std::vector<std::string> sender_list_;
139 std::vector<Attribute> attribute_list_;
143 mutable size_t sample_counter_ = 0;
144 std::vector<uint8_t> data_;
145 uint8_t sequence_number_ = 0;
All DBC network objects may have attributes attached to them.
Support class for handling attributes of network objects.
Definition: attribute.h:49
DBC message configuration object.
Definition: message.h:22
uint32_t Pgn() const
J1939 PGN.
const std::string & Comment() const
Returns the descriptive text.
Definition: message.h:52
bool IsExtended() const
True if 29-bit ID.
const std::vector< Attribute > & Attributes() const
Returns a list of attributes.
Definition: message.h:90
void ResetSampleCounter() const
Reset the sample counters.
void Name(const std::string &name)
Sets the message name.
Definition: message.h:45
void StepSampleCounter() const
Increments the internal sample counters.
Definition: message.h:122
void Node(const std::string &node)
Sets a node name.
Definition: message.h:58
Attribute & CreateAttribute(const Attribute &definition)
Creates an attributes by using its definition.
uint8_t NextSequenceNumber() const
Returns the next sequence number.
Definition: message.h:118
uint32_t CanId() const
Returns CAN ID.
bool UpdateData(const std::vector< uint8_t > &message, size_t offset=0, size_t data_index=0)
Update the internal data buffer.
bool IsNodeSender(const std::string &node_name) const
Returns true if the node is a sender.
void ParseMessage(uint64_t ns1970, uint32_t can_id)
Parses the message. Internal usage.
void NofBytes(size_t bytes)
Sets the number of bytes.
uint64_t Ident() const
Definition: message.h:27
void Ident(uint64_t ident)
Definition: message.h:24
bool IsPdu1() const
True if PDU1.
uint8_t Source() const
J1939 Source.
std::string NodeName() const
Returns the node name.
Definition: message.h:65
const SignalList & Signals() const
Returns the signal list.
Definition: message.h:80
bool ExtendedDataPage() const
J1938 Data Page Flag.
uint8_t Priority() const
J1939 Priority.
size_t SampleCounter() const
Returns number of samples.
Definition: message.h:124
const Signal * GetSignal(const std::string &name) const
Returns a signal by its name.
uint8_t PduSpecific() const
J1939 PS.
Signal * GetMultiplexor()
Returns the multiplexer signal object.
Signal * GetSignal(const std::string &name)
Returns a signal by its name.
bool IsJ1939() const
True if it is a J1939 message.
void Comment(const std::string &comment)
Sets the descriptive text.
Definition: message.h:50
const std::vector< std::string > & Senders() const
Returns a list of sender names.
Definition: message.h:85
const std::string & Name() const
Returns the message name.
Definition: message.h:47
bool IsPdu2() const
True if PDU2.
bool DataPage() const
J1938 Data Page Flag.
size_t NofBytes() const
Returns the number of bytes.
const Attribute * GetAttribute(const std::string &name) const
Returns an attribute by its name.
uint8_t PduFormat() const
J1939 PF.
const std::vector< uint8_t > & Data() const
Returns the last message data buffer.
Definition: message.h:98
void ResetSequenceNumber()
Reset the internal sequence counter.
Definition: message.h:116
Signal & CreateSignal(const std::string &name)
Create a new signal by its name.
Interface against a DBC signal configuration.
Definition: signal.h:68
Main namespace for the DBC library.
Definition: attribute.h:13
std::map< std::string, Signal > SignalList
Sorted list of signal objects.
Definition: message.h:19
Interface against a DBC signal configuration.