yarp-devices
Classes | Functions
CanBusSharerLib

Common interfaces and utilities for a network of CAN nodes. More...

Classes

struct  roboticslab::can_message
 Proxy CAN message structure. More...
 
class  roboticslab::ICanBusSharer
 Abstract base for a CAN bus sharer. More...
 
class  roboticslab::ICanMessageNotifier
 Implementation-agnostic consumer for RX CAN transfers. More...
 
class  roboticslab::ICanSenderDelegate
 Implementation-agnostic consumer for TX CAN transfers. More...
 

Functions

std::string roboticslab::CanUtils::msgToStr (std::uint8_t id, std::uint16_t cob, std::size_t len, const std::uint8_t *data)
 Create a string representation of the given CAN message details.
 
std::string roboticslab::CanUtils::msgToStr (std::size_t len, const std::uint8_t *data)
 Create a string representation of the given CAN message data payload.
 
std::string roboticslab::CanUtils::msgToStr (std::uint16_t cobId, std::size_t len, const std::uint8_t *data)
 Create a string representation of the given CAN message details.
 
std::string roboticslab::CanUtils::msgToStr (const can_message &msg)
 Create a string representation of the given CAN message details.
 
template<typename T_int , typename T_frac >
void roboticslab::CanUtils::encodeFixedPoint (double value, T_int *integer, T_frac *fractional)
 Obtain a fixed-point representation given a float value. More...
 
template<typename T_int , typename T_frac >
double roboticslab::CanUtils::decodeFixedPoint (T_int integer, T_frac fractional)
 Obtain a float representation of a fixed-point value. More...
 

Detailed Description

Function Documentation

◆ decodeFixedPoint()

template<typename T_int , typename T_frac >
double roboticslab::CanUtils::decodeFixedPoint ( T_int  integer,
T_frac  fractional 
)
Template Parameters
T_intInteger part, integral type expected.
T_fracFractional part, integral type expected.

◆ encodeFixedPoint()

template<typename T_int , typename T_frac >
void roboticslab::CanUtils::encodeFixedPoint ( double  value,
T_int *  integer,
T_frac *  fractional 
)
Template Parameters
T_intInteger part, integral type expected.
T_fracFractional part, integral type expected.