4.2.2 qmm_queue_append Function

C

qmm_status_t qmm_queue_append(queue_t *q, buffer_t *buf)

Summary

Appends a buffer into the queue

Description

This function appends a buffer into the designated queue

Precondition

qmm_queue_init should have called for initilazing the particular queue before using it

Parameters

ParamDescription
qQueue into which buffer should be appended
bufPointer to the buffer that should be appended into the queue. Note that this pointer should be same as the pointer returned by bmm_buffer_alloc

Returns

QUEUE_SUCCESS - Buffer gets appended successfully QUEUE_FULL - Designated queue is full

Example

queue_t app_queue;
buffer_t *app_buf;
// Allocate the buffer
app_buf = bmm_buffer_alloc(LARGE_BUFFER_SIZE);

uint8_t queue_size = 10;
qmm_queue_init(&app_queue, queue_size);
// Append buffer in queue
qmm_queue_append(&app_queue, app_buf);

Remarks

None