|
DbcLib 1.0
CAN DBC C++ library.
|
Wrapper class around a CAN message. More...
#include <dbcmessage.h>
Public Member Functions | |
| DbcMessage ()=default | |
| Default constructor. | |
| DbcMessage (uint64_t time, uint32_t can_id, std::vector< uint8_t > data) | |
| Constructor that wraps a CAN message. | |
| DbcMessage (const DbcMessage &message)=default | |
| Default destructor. | |
| void | Time (uint64_t ns1970) |
| Sets the time. | |
| uint64_t | Time () const |
| Message time. | |
| void | CanId (uint32_t can_id) |
| Sets the CAN ID. | |
| uint32_t | CanId () const |
| CAN ID. | |
| void | Data (const std::vector< uint8_t > &data) |
| Sets the CAN data bytes. | |
| const std::vector< uint8_t > & | Data () const |
| Returns the CAN data bytes. | |
| uint32_t | Pgn () const |
| PGN Program number. | |
| uint8_t | Priority () const |
| Priority (0-8) | |
| bool | ExtendedDataPage () const |
| True if extended data page. | |
| bool | DataPage () const |
| True if data page. | |
| uint8_t | PduFormat () const |
| PDU format. | |
| uint8_t | PduSpecific () const |
| PDU specific. | |
| uint8_t | Source () const |
| Source number. | |
Simple support class that holds a CAN message. CAN message has a time, ID and none or more data bytes. This sound simple but there are several protocols on top of CAN that treat the CAN ID and its data bytes differently.
| dbc::DbcMessage::DbcMessage | ( | uint64_t | time, |
| uint32_t | can_id, | ||
| std::vector< uint8_t > | data | ||
| ) |
Constructor that wraps a CAN message.
| time | Nano-seconds since 1970. |
| can_id | 11/29-bit CAN ID. |
| data | CAN data bytes. |