CSP Buffer

File: csp/csp_buffer.h

Description: Message buffer.

Interface Functions

csp_packet_t *csp_buffer_get(size_t unused)
[source]

Get free buffer from task context.

Parameters:
  • unused – OBSOLETE ignored field, csp packets have a fixed size now

Returns:

Buffer pointer to #csp_packet_t or NULL if no buffers available

csp_packet_t *csp_buffer_get_isr(size_t unused)
[source]

Get free buffer (from ISR context).

Parameters:
  • unused – OBSOLETE ignored field, csp packets have a fixed size now

Returns:

Buffer pointer to #csp_packet_t or NULL if no buffers available

void csp_buffer_free(void *buffer)
[source]

Free buffer (from task context).

Parameters:
  • buffer – buffer to free. NULL is handled gracefully.

void csp_buffer_free_isr(void *buffer)
[source]

Free buffer (from ISR context).

Parameters:
  • buffer – buffer to free. NULL is handled gracefully.

csp_packet_t *csp_buffer_clone(const csp_packet_t *packet)
[source]

Clone an existing buffer. The existing buffer content is copied to the new buffer.

Parameters:
  • buffer – buffer to clone.

Returns:

cloned buffer on success, or NULL on failure.

int csp_buffer_remaining(void)
[source]

Return number of remaining/free buffers. The number of buffers is set by csp_init().

Returns:

number of remaining/free buffers

void csp_buffer_init(void)
[source]
void csp_buffer_refc_inc(void *buffer)
[source]

Increase reference counter of buffer. Use csp_buffer_free() to decrement

Parameters:
  • buffer – buffer to increment. NULL is handled gracefully.