1.2.12.4.3 SRV_QUEUE_Append_With_Priority Function

C

void SRV_QUEUE_Append_With_Priority(
    SRV_QUEUE *queue,
    uint32_t priority,
    SRV_QUEUE_ELEMENT *element
);

Summary

Appends an element into a priority queue.

Description

This function appends an element into a priority queue.

Precondition

The queue must have been initialized previously with function SRV_QUEUE_Init.

Parameters

ParamDescription
queuePointer to the queue where to append the element
priorityPriority of the element to be appended
elementPointer to the element to be appended

Returns

None.

Example

#define NUM_MAX_NODES    750
typedef struct node_info
{
    SRV_QUEUE_ELEMENT queueElement;
    uint8_t macAddress[8]
} NODE_INFO;

static SRV_QUEUE nodeQueue;
static NODE_INFO nodeInfo;

SRV_QUEUE_Init(&nodeQueue, NUM_MAX_NODES, SRV_QUEUE_TYPE_PRIORITY);
memset(nodeInfo.macAddress, 0xFF, 8);
SRV_QUEUE_Append_With_Priority(&nodeQueue, 3, &nodeInfo.queueElement);

Remarks

None.