iCub-main
Loading...
Searching...
No Matches
Classes | Functions | Variables
canControlUtils.h File Reference
#include <list>
#include "yarp/dev/CanBusInterface.h"
+ Include dependency graph for canControlUtils.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  ThreadId
 
class  ThreadFifo
 
struct  CanRequest
 
class  RequestsQueue
 

Functions

int getRcp (const yarp::dev::CanMessage &m)
 Extract least significative 4 bits, from the id of a can msg.
 
int getSender (const yarp::dev::CanMessage &m)
 Extract most significative 4 bits of the least significative byte from the id of a can msg.
 
int getClass (const yarp::dev::CanMessage &m)
 Extract message class, three bit least significative of the first byte of the message ID.
 
unsigned char getMessageType (const yarp::dev::CanMessage &m)
 Extract 7 lsb of first byte; this is the message type in our protocol.
 
int getJoint (const yarp::dev::CanMessage &m, const unsigned char *invM)
 Extract the joint number to which a RECEIVED message is referring to.
 
template<class T >
long getRcp (const T &m)
 Extract least significative 4 bits, from the id of a can msg.
 
template<class T >
long getSender (const T &m)
 Extract most significative 4 bits of the least significative byte from the id of a can msg.
 
template<class T >
long getClass (const T &m)
 Extract message class, three bit least significative of the first byte of the message ID.
 
template<class T >
unsigned char getMessageType (const T &m)
 Extract 7 lsb of first byte; this is the message type in our protocol.
 
template<class T >
int getJoint (const T &m, const unsigned char *invM)
 Extract the joint number to which a RECEIVED message is referring to.
 
void DEBUG_FUNC (const char *fmt,...)
 

Variables

const int DEBUG_PRINTF_BUFFER_LENGTH =255
 

Function Documentation

◆ DEBUG_FUNC()

void DEBUG_FUNC ( const char *  fmt,
  ... 
)
inline

Definition at line 134 of file canControlUtils.h.

◆ getClass() [1/2]

template<class T >
long getClass ( const T m)

Extract message class, three bit least significative of the first byte of the message ID.

Message id: 0000 0CCC SSSS RRRR

Definition at line 105 of file canControlUtils.h.

◆ getClass() [2/2]

int getClass ( const yarp::dev::CanMessage &  m)
inline

Extract message class, three bit least significative of the first byte of the message ID.

Message id: 0000 0CCC SSSS RRRR

Definition at line 52 of file canControlUtils.h.

◆ getJoint() [1/2]

template<class T >
int getJoint ( const T m,
const unsigned char *  invM 
)

Extract the joint number to which a RECEIVED message is referring to.

This is the conversion message -> joint (uses can id and first bit of first data byte in the can message)

Definition at line 125 of file canControlUtils.h.

◆ getJoint() [2/2]

int getJoint ( const yarp::dev::CanMessage &  m,
const unsigned char *  invM 
)
inline

Extract the joint number to which a RECEIVED message is referring to.

This is the conversion message -> joint (uses can id and first bit of first data byte in the can message)

Definition at line 70 of file canControlUtils.h.

◆ getMessageType() [1/2]

template<class T >
unsigned char getMessageType ( const T m)

Extract 7 lsb of first byte; this is the message type in our protocol.

Definition at line 114 of file canControlUtils.h.

◆ getMessageType() [2/2]

unsigned char getMessageType ( const yarp::dev::CanMessage &  m)
inline

Extract 7 lsb of first byte; this is the message type in our protocol.

Definition at line 60 of file canControlUtils.h.

◆ getRcp() [1/2]

template<class T >
long getRcp ( const T m)

Extract least significative 4 bits, from the id of a can msg.

In our protocol this is the recipient of a message. Message id: 0000 0XXX SSSS RRRR

Definition at line 84 of file canControlUtils.h.

◆ getRcp() [2/2]

int getRcp ( const yarp::dev::CanMessage &  m)
inline

Extract least significative 4 bits, from the id of a can msg.

In our protocol this is the recipient of a message. Message id: 0000 0XXX SSSS RRRR

Definition at line 33 of file canControlUtils.h.

◆ getSender() [1/2]

template<class T >
long getSender ( const T m)

Extract most significative 4 bits of the least significative byte from the id of a can msg.

Message id: 0000 0XXX SSSS RRRR In our protocol this is the sender of a message

Definition at line 95 of file canControlUtils.h.

◆ getSender() [2/2]

int getSender ( const yarp::dev::CanMessage &  m)
inline

Extract most significative 4 bits of the least significative byte from the id of a can msg.

Message id: 0000 0XXX SSSS RRRR In our protocol this is the sender of a message

Definition at line 43 of file canControlUtils.h.

Variable Documentation

◆ DEBUG_PRINTF_BUFFER_LENGTH

const int DEBUG_PRINTF_BUFFER_LENGTH =255

Definition at line 132 of file canControlUtils.h.