Class espos_n2k::TwaiTransmitter¶
ClassList > espos_n2k > TwaiTransmitter
Accepts CanMessage values and transmits them on the CAN bus.More...
#include <espos_n2k/twai_transmitter.h>
Public Functions¶
| Type | Name |
|---|---|
| TwaiTransmitter (size_t tx_queue_depth=32) |
|
| bool | ever_transmitted () const True if we have queued at least one frame since boot. |
| int64_t | seconds_since_last_tx () const Seconds since the last frame was queued. |
| void | set (const CanMessage & msg) ValueConsumer interface — queues a frame for transmission. |
| void | start () |
| void | stop () |
| uint32_t | tx_fail_count () const |
| ~TwaiTransmitter () |
Detailed Description¶
The bus itself belongs to the receiver, which configures the pins and the bitrate; start the receiver first. Queueing is the driver's — esp_twai has a transmit queue of its own, so this class no longer runs a task.
Public Functions Documentation¶
function TwaiTransmitter¶
function ever_transmitted¶
True if we have queued at least one frame since boot.
(Queued, not acknowledged on the wire — the driver reports that asynchronously and this class does not subscribe to it.)
function seconds_since_last_tx¶
Seconds since the last frame was queued.
INT64_MAX if none yet. Replaces the old uint32_t tx_count_ which would overflow at ~20 days of busy traffic.
function set¶
ValueConsumer interface — queues a frame for transmission.
Does not block: a full transmit queue drops the frame and counts a failure.
function start¶
function stop¶
function tx_fail_count¶
function ~TwaiTransmitter¶
The documentation for this class was generated from the following file espos_n2k/include/espos_n2k/twai_transmitter.h