yarp-devices
Classes | Public Member Functions | Protected Member Functions | Private Types | Private Member Functions | Private Attributes | List of all members
roboticslab::TransmitPdo Class Referencefinal

Representation of TPDO protocol.

#include <PdoProtocol.hpp>

Inheritance diagram for roboticslab::TransmitPdo:
roboticslab::PdoProtocol

Classes

struct  ordered_call
 

Public Member Functions

bool accept (const std::uint8_t *data, unsigned int size)
 Invoke registered callback on raw CAN message data.
 
template<typename... Ts, typename Fn >
void registerHandler (Fn &&fn)
 Register callback. More...
 
void unregisterHandler ()
 Unregister callback.
 
 PdoProtocol (std::uint8_t id, std::uint16_t cob, unsigned int n, SdoClient *sdo)
 Constructor, registers SDO client handle.
 
- Public Member Functions inherited from roboticslab::PdoProtocol
 PdoProtocol (std::uint8_t id, std::uint16_t cob, unsigned int n, SdoClient *sdo)
 Constructor, registers SDO client handle.
 
virtual ~PdoProtocol ()=default
 Virtual destructor.
 
std::uint16_t getCobId () const
 Retrieve COB ID.
 
bool configure (const PdoConfiguration &config)
 Configure this PDO drive-side via SDO packages.
 

Protected Member Functions

PdoType getType () const override
 Retrieve PDO type.
 

Private Types

using HandlerFn = std::function< bool(const std::uint8_t *data, unsigned int size)>
 

Private Member Functions

template<typename T >
unpack (const std::uint8_t *buff, unsigned int *count)
 
void unpackInternal (void *data, const std::uint8_t *buff, unsigned int size)
 

Private Attributes

HandlerFn callback
 

Additional Inherited Members

- Protected Types inherited from roboticslab::PdoProtocol
enum class  PdoType { RPDO , TPDO }
 PDO type.
 
- Static Protected Member Functions inherited from roboticslab::PdoProtocol
template<typename... Tn>
static constexpr std::size_t size ()
 
- Protected Attributes inherited from roboticslab::PdoProtocol
std::uint8_t id
 
std::uint16_t cob
 
unsigned int n
 
SdoClientsdo
 

Member Function Documentation

◆ registerHandler()

template<typename... Ts, typename Fn >
void roboticslab::TransmitPdo::registerHandler ( Fn &&  fn)
inline

Usually, you'll want to pass as many parameters to the callback function as CAN dictionary objects have been mapped. Only integral types allowed, cumulative size cannot exceed 8 bytes.


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