rusEFI
The most advanced open source ECU
|
#include <can_msg_tx.h>
Public Member Functions | |
CanTxMessage (CanCategory category, uint32_t eid, uint8_t dlc=8, size_t bus=0, bool isExtended=false) | |
~CanTxMessage () | |
uint8_t & | operator[] (size_t) |
Read & write the raw underlying 8-byte buffer. | |
void | setShortValue (uint16_t value, size_t offset) |
Write a 16-bit short value to the buffer. Note: this writes in Intel little endian byte order. | |
void | setShortValueMsb (uint16_t value, size_t offset) |
void | setBit (size_t byteIdx, size_t bitIdx) |
Set a single bit in the transmit buffer. Useful for single-bit flags. | |
void | setDlc (uint8_t dlc) |
void | setBus (size_t bus) |
const CANTxFrame * | getFrame () const |
void | setArray (const uint8_t *data, size_t len) |
template<size_t N> | |
void | setArray (const uint8_t(&data)[N]) |
Static Public Member Functions | |
static void | setDevice (CANDriver *device1, CANDriver *device2) |
Data Fields | |
CanCategory | category |
size_t | busIndex = 0 |
Protected Attributes | |
CANTxFrame | m_frame |
Static Private Attributes | |
static CANDriver * | s_devices [2] = {nullptr, nullptr} |
Represent a message to be transmitted over CAN.
Usage:
Definition at line 31 of file can_msg_tx.h.
|
explicit |
Create a new CAN message, with the specified extended ID.
Definition at line 31 of file can_msg_tx.cpp.
CanTxMessage::~CanTxMessage | ( | ) |
Destruction of an instance of CanTxMessage will transmit the message over the wire.
Definition at line 62 of file can_msg_tx.cpp.
|
inline |
Definition at line 81 of file can_msg_tx.h.
uint8_t & CanTxMessage::operator[] | ( | size_t | index | ) |
Read & write the raw underlying 8-byte buffer.
Definition at line 145 of file can_msg_tx.cpp.
|
inline |
Definition at line 85 of file can_msg_tx.h.
Referenced by setArray().
|
inline |
Definition at line 92 of file can_msg_tx.h.
Set a single bit in the transmit buffer. Useful for single-bit flags.
Definition at line 141 of file can_msg_tx.cpp.
Referenced by canDashboardHaltech(), and canMazdaRX8().
void CanTxMessage::setBus | ( | size_t | bus | ) |
Definition at line 125 of file can_msg_tx.cpp.
Referenced by CanTxMessage().
|
static |
Configures the device for all messages to transmit from.
Definition at line 25 of file can_msg_tx.cpp.
Referenced by initCan().
void CanTxMessage::setDlc | ( | uint8_t | dlc | ) |
Definition at line 121 of file can_msg_tx.cpp.
Referenced by CanTxMessage(), and lua_txCan().
void CanTxMessage::setShortValue | ( | uint16_t | value, |
size_t | offset | ||
) |
Write a 16-bit short value to the buffer. Note: this writes in Intel little endian byte order.
Definition at line 130 of file can_msg_tx.cpp.
Referenced by canDashboardBmwE46(), canDashboardBmwE90(), canDashboardFiat(), canDashboardNissanVQ(), canDashboardVAG(), canDashboardVagMqb(), and canMazdaRX8().
void CanTxMessage::setShortValueMsb | ( | uint16_t | value, |
size_t | offset | ||
) |
Same as above but big endian Motorola for instance DBC 8|16@0
Definition at line 136 of file can_msg_tx.cpp.
Referenced by canDashboardGenesisCoupe(), canDashboardHaltech(), canDashboardHondaK(), canDashboardNissanVQ(), and canDashboardW202().
size_t CanTxMessage::busIndex = 0 |
Definition at line 53 of file can_msg_tx.h.
Referenced by obdSendPacket(), setBus(), and ~CanTxMessage().
CanCategory CanTxMessage::category |
Definition at line 44 of file can_msg_tx.h.
Referenced by CanTxMessage(), and ~CanTxMessage().
|
protected |
Definition at line 100 of file can_msg_tx.h.
Referenced by CanTxMessage(), CanTxTyped< TData >::get(), getFrame(), CanTxTyped< TData >::operator->(), operator[](), setArray(), setBit(), setDlc(), setShortValue(), setShortValueMsb(), and ~CanTxMessage().
|
staticprivate |
Definition at line 23 of file can_msg_tx.h.
Referenced by setDevice(), and ~CanTxMessage().