Public Types | Public Member Functions | Static Public Member Functions | Private Types | List of all members
uavcan::Publisher< DataType_ > Class Template Reference

#include <publisher.hpp>

Inheritance diagram for uavcan::Publisher< DataType_ >:
Inheritance graph
[legend]

Public Types

typedef DataType_ DataType
 Message data type. More...
 

Public Member Functions

int broadcast (const DataType &message)
 
int broadcast (const DataType &message, TransferID tid)
 
 Publisher (INode &node, MonotonicDuration tx_timeout=getDefaultTxTimeout(), MonotonicDuration max_transfer_interval=TransferSender::getDefaultMaxTransferInterval())
 

Static Public Member Functions

static MonotonicDuration getDefaultTxTimeout ()
 

Private Types

typedef GenericPublisher< DataType_, DataType_ > BaseType
 

Additional Inherited Members

- Protected Member Functions inherited from uavcan::GenericPublisher< DataType_, DataType_ >
 GenericPublisher (INode &node, MonotonicDuration tx_timeout, MonotonicDuration max_transfer_interval=TransferSender::getDefaultMaxTransferInterval())
 
int init ()
 
int init (TransferPriority priority)
 
int publish (const DataType_ &message, TransferType transfer_type, NodeID dst_node_id, MonotonicTime blocking_deadline=MonotonicTime())
 
int publish (const DataType_ &message, TransferType transfer_type, NodeID dst_node_id, TransferID tid, MonotonicTime blocking_deadline=MonotonicTime())
 
 ~GenericPublisher ()
 
- Protected Member Functions inherited from uavcan::GenericPublisherBase
int doInit (DataTypeKind dtkind, const char *dtname)
 
int genericPublish (const StaticTransferBufferImpl &buffer, TransferType transfer_type, NodeID dst_node_id, TransferID *tid, MonotonicTime blocking_deadline)
 
 GenericPublisherBase (INode &node, MonotonicDuration tx_timeout, MonotonicDuration max_transfer_interval)
 
TransferSendergetTransferSender ()
 
const TransferSendergetTransferSender () const
 
MonotonicTime getTxDeadline () const
 
bool isInited () const
 
 ~GenericPublisherBase ()
 
void allowAnonymousTransfers ()
 
INodegetNode () const
 
TransferPriority getPriority () const
 
MonotonicDuration getTxTimeout () const
 
void setPriority (const TransferPriority prio)
 
void setTxTimeout (MonotonicDuration tx_timeout)
 
- Static Protected Member Functions inherited from uavcan::GenericPublisherBase
static MonotonicDuration getMaxTxTimeout ()
 
static MonotonicDuration getMinTxTimeout ()
 

Detailed Description

template<typename DataType_>
class uavcan::Publisher< DataType_ >

Use this class to publish messages to the bus (broadcast, unicast, or both).

Template Parameters
DataType_Message data type

Definition at line 18 of file publisher.hpp.

Member Typedef Documentation

◆ BaseType

template<typename DataType_ >
typedef GenericPublisher<DataType_, DataType_> uavcan::Publisher< DataType_ >::BaseType
private

Definition at line 20 of file publisher.hpp.

◆ DataType

template<typename DataType_ >
typedef DataType_ uavcan::Publisher< DataType_ >::DataType

Message data type.

Definition at line 23 of file publisher.hpp.

Constructor & Destructor Documentation

◆ Publisher()

template<typename DataType_ >
uavcan::Publisher< DataType_ >::Publisher ( INode node,
MonotonicDuration  tx_timeout = getDefaultTxTimeout(),
MonotonicDuration  max_transfer_interval = TransferSender::getDefaultMaxTransferInterval() 
)
inlineexplicit
Parameters
nodeNode instance this publisher will be registered with.
tx_timeoutIf CAN frames of this message are not delivered to the bus in this amount of time, they will be discarded. Default value is good enough for rather high-frequency, high-priority messages.
max_transfer_intervalMaximum expected transfer interval. It's absolutely safe to leave default value here. It just defines how soon the Transfer ID tracking objects associated with this message type will be garbage collected by the library if it's no longer being published.

Definition at line 38 of file publisher.hpp.

Member Function Documentation

◆ broadcast() [1/2]

template<typename DataType_ >
int uavcan::Publisher< DataType_ >::broadcast ( const DataType message)
inline

Broadcast the message. Returns negative error code.

Definition at line 52 of file publisher.hpp.

◆ broadcast() [2/2]

template<typename DataType_ >
int uavcan::Publisher< DataType_ >::broadcast ( const DataType message,
TransferID  tid 
)
inline

Warning: You probably don't want to use this method; it's for advanced use cases like e.g. network time synchronization. Use the overloaded method with fewer arguments instead. This overload allows to explicitly specify Transfer ID. Returns negative error code.

Definition at line 63 of file publisher.hpp.

◆ getDefaultTxTimeout()

template<typename DataType_ >
static MonotonicDuration uavcan::Publisher< DataType_ >::getDefaultTxTimeout ( )
inlinestatic

Definition at line 68 of file publisher.hpp.


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


uavcan_communicator
Author(s):
autogenerated on Fri Dec 13 2024 03:10:05