KaCanOpen
 All Classes Functions Variables Typedefs Enumerations Pages
Public Member Functions | Public Attributes | List of all members
kaco::TransmitPDOMapping Class Reference

This class represents a mapping from one or more dictionary entries to one transmit PDO, which will be sent by an instance of this class repeatedly. More...

#include <transmit_pdo_mapping.h>

Collaboration diagram for kaco::TransmitPDOMapping:
Collaboration graph
[legend]

Public Member Functions

 TransmitPDOMapping (Core &core, const std::unordered_map< Address, Entry > &dictionary, const std::unordered_map< std::string, Address > &name_to_address, uint16_t cob_id_, TransmissionType transmission_type_, std::chrono::milliseconds repeat_time_, const std::vector< Mapping > &mappings_)
 Constructor. More...
 
 TransmitPDOMapping (const TransmitPDOMapping &)=delete
 Copy constructor deleted.
 
 TransmitPDOMapping (TransmitPDOMapping &&)=delete
 Move constructor deleted.
 
 ~TransmitPDOMapping ()
 Stops the transmitter thread if there is one.
 
void send () const
 Sends the PDO.
 

Public Attributes

uint16_t cob_id
 COB-ID of the PDO.
 
TransmissionType transmission_type
 Transmission type.
 
std::chrono::milliseconds repeat_time
 Send repeat time.
 
std::vector< Mappingmappings
 Mapped entries with offset (see Mapping class)
 
std::unique_ptr< std::thread > transmitter
 The transmitter thread. More...
 

Detailed Description

This class represents a mapping from one or more dictionary entries to one transmit PDO, which will be sent by an instance of this class repeatedly.

Definition at line 54 of file transmit_pdo_mapping.h.

Constructor & Destructor Documentation

kaco::TransmitPDOMapping::TransmitPDOMapping ( Core core,
const std::unordered_map< Address, Entry > &  dictionary,
const std::unordered_map< std::string, Address > &  name_to_address,
uint16_t  cob_id_,
TransmissionType  transmission_type_,
std::chrono::milliseconds  repeat_time_,
const std::vector< Mapping > &  mappings_ 
)

Constructor.

Parameters
coreReference to the Core instance (needed to send the PDO).
dictionaryReference to the object dictionary.
name_to_addressReference to name-address mapping.
cob_id_COB-ID of the PDO
transmission_type_Transmission type
repeat_time_Send repeat time , in case transmission_type_==TransmissionType::PERIODIC
mappings_Mapped entries with offset (see Mapping class)
Exceptions
dictionary_errorif entry does not exist or mappings overlap (among others)

Definition at line 42 of file transmit_pdo_mapping.cpp.

Member Data Documentation

std::unique_ptr<std::thread> kaco::TransmitPDOMapping::transmitter

The transmitter thread.

Note
This is a unique pointer because transmitter is optional.

Definition at line 93 of file transmit_pdo_mapping.h.


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