1.2.12.4.10 SRV_QUEUE_Set_Capacity Function
C
void SRV_QUEUE_Set_Capacity(
SRV_QUEUE *queue,
uint16_t capacity
);
Summary
Modifies the total capacity of a queue.
Description
This function modifies the total capacity of a queue.
Precondition
The queue must have been initialized previously with function SRV_QUEUE_Init.
Parameters
Param | Description |
---|---|
queue | Pointer to the queue |
capacity | New capacity of the queue |
Returns
None.
Example
#define NUM_MAX_NODES 750 typedef struct _node_info_tag { struct _node_info_tag *prev; struct _node_info_tag *next; uint8_t macAddress[8] } NODE_INFO; static SRV_QUEUE nodeQueue; static node_info_t nodeInfo; SRV_QUEUE_Init(&nodeQueue, NUM_MAX_NODES, SRV_QUEUE_TYPE_SINGLE); memset(nodeInfo.macAddress, 0xFF, 8); SRV_QUEUE_Append(&nodeQueue, (SRV_QUEUE_ELEMENT *)&nodeInfo); SRV_QUEUE_Set_Capacity(&nodeQueue, (NUM_MAX_NODES + 10));
Remarks
None.