iCub-main
Loading...
Searching...
No Matches
Classes | Public Member Functions | List of all members
can_string2< T > Class Template Reference

#include <can_string.h>

Public Member Functions

 can_string2 ()
 Default constructor.
 
 ~can_string2 ()
 Destructor.
 
int add_string (void *can_packet)
 Process a string can packet.
 
char * print (int buffer_num)
 Prints a string buffer.
 
void clear_string (int buffer_num)
 Resets the string buffer.
 

Detailed Description

template<class T>
class can_string2< T >

Definition at line 28 of file can_string.h.

Constructor & Destructor Documentation

◆ can_string2()

template<class T >
can_string2< T >::can_string2 ( )

Default constructor.

Definition at line 83 of file can_string.h.

◆ ~can_string2()

template<class T >
can_string2< T >::~can_string2 ( )

Destructor.

Definition at line 90 of file can_string.h.

Member Function Documentation

◆ add_string()

template<class T >
int can_string2< T >::add_string ( void *  can_packet)
inline

Process a string can packet.

All can packets belonging to the same string are joined in the same string buffer untill the string is complete.

Parameters
can_packetis the can message (CMSG* type). It must belong to the CAN_BCAST_PRINT class.
Returns
the number of the buffer where the string part has been inserted. 0 <= buffer_num <= MAX_STRINGS

Definition at line 109 of file can_string.h.

◆ clear_string()

template<class T >
void can_string2< T >::clear_string ( int  buffer_num)
inline

Resets the string buffer.

Parameters
cbuffer_numis the number of the buffer. 0 <= buffer_num <= MAX_STRINGS

Definition at line 95 of file can_string.h.

◆ print()

template<class T >
char * can_string2< T >::print ( int  buffer_num)
inline

Prints a string buffer.

The buffer can be already completed (all parts of the can string have been already received or not). If the string contains a "hole" (a can packet is not arrived yet), the string will be printed till the first missing packet.

Parameters
buffer_numis the number of the buffer. 0 <= buffer_num <= MAX_STRINGS
Returns
the content of the buffer.

Definition at line 169 of file can_string.h.


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