Classes | Public Member Functions | List of all members
can_string_generic Class Reference

#include <can_string_generic.h>

Public Member Functions

 can_string_generic ()
 Default constructor. More...
 ~can_string_generic ()
 Destructor. More...
int add_string (void *can_packet)
 Process a string can packet. More...
char * print (int buffer_num, const char *canDevName, int netNum)
 Prints a string buffer. More...
void clear_string (int buffer_num)
 Resets the string buffer. More...

Detailed Description

Definition at line 31 of file can_string_generic.h.

Constructor & Destructor Documentation

◆ can_string_generic()

can_string_generic::can_string_generic ( )

Default constructor.

Definition at line 80 of file can_string_generic.h.

◆ ~can_string_generic()

can_string_generic::~can_string_generic ( )


Definition at line 86 of file can_string_generic.h.

Member Function Documentation

◆ add_string()

int can_string_generic::add_string ( void *  can_packet)

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.

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

Definition at line 103 of file can_string_generic.h.

◆ clear_string()

void can_string_generic::clear_string ( int  buffer_num)

Resets the string buffer.

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

Definition at line 90 of file can_string_generic.h.

◆ print()

char * can_string_generic::print ( int  buffer_num,
const char *  canDevName,
int  netNum 

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.

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

Definition at line 167 of file can_string_generic.h.

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