Lely core libraries  2.3.4
can_buf Struct Reference

A CAN frame buffer. More...

#include <buf.h>

Collaboration diagram for can_buf:

Data Fields

struct can_msgptr
 A pointer to the allocated memory for the buffer.
 
size_t size
 The total size (in number of frames) of the buffer, excluding the unused frame used to distinguish between a full and an empty buffer. More...
 
size_t begin
 The offset (with respect to ptr) of the first value available for reading (and two past the last available for writing, modulo size + 1).
 
size_t end
 The offset (with respect to ptr) of one past the last value available for reading (and the first available for writing, modulo size + 1).
 

Detailed Description

A CAN frame buffer.

Definition at line 42 of file buf.h.

Field Documentation

◆ size

size_t can_buf::size

The total size (in number of frames) of the buffer, excluding the unused frame used to distinguish between a full and an empty buffer.

This needs to be a power of two minus one, so we can use '& size' instead of '% (size + 1)' in wrapping calculations.

Definition at line 51 of file buf.h.


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