Queue Management: provides services for creating and maintaining the queues.
Data Structures | |
struct | MiQueue |
Queue structure. More... | |
struct | miQueueBuffer |
struct | search_tag |
Structure to search for a buffer to be removed from a queue. More... | |
Macros | |
#define | BUFFER_POINTER(buf) ((buf)->buffer) |
This macro provides the pointer to the corresponding body of the supplied buffer header. More... | |
Typedefs | |
typedef struct MiQueue | MiQueue_t |
Queue structure. More... | |
typedef struct miQueueBuffer | miQueueBuffer_t |
typedef struct search_tag | search_t |
Structure to search for a buffer to be removed from a queue. More... | |
Functions | |
void | miQueueAppend (MiQueue_t *q, void *buf) |
Appends a buffer into the queue. More... | |
void | miQueueFlush (MiQueue_t *q) |
Internal function for flushing a specific queue. More... | |
void | miQueueInit (MiQueue_t *q) |
Initializes the queue. More... | |
miQueueBuffer_t * | miQueueRead (MiQueue_t *q, search_t *search) |
Reads a buffer from queue. More... | |
miQueueBuffer_t * | miQueueRemove (MiQueue_t *q, search_t *search) |
Removes a buffer from queue. More... | |
Variables | |
uint8_t * | miQueueBuffer::buffer |
Handle to callback parameter. More... | |
uint8_t(* | search_tag::criteria_func )(void *buf, void *handle) |
Pointer to search criteria function. More... | |
void * | search_tag::handle |
Handle to callback parameter. More... | |
miQueueBuffer_t * | MiQueue::head |
Pointer to head of queue. More... | |
void * | miQueueBuffer::nextItem |
Pointer to search criteria function. More... | |
uint8_t | MiQueue::size |
Number of buffers present in the current queue. More... | |
miQueueBuffer_t * | MiQueue::tail |
Pointer to tail of queue. More... | |
#define BUFFER_POINTER | ( | buf | ) | ((buf)->buffer) |
This macro provides the pointer to the corresponding body of the supplied buffer header.
Queue structure.
This structure defines the queue structure. The application should declare the queue of type queue_t and call miQueueinit before invoking any other functionality of qmm.
typedef struct miQueueBuffer miQueueBuffer_t |
typedef struct search_tag search_t |
Structure to search for a buffer to be removed from a queue.
void miQueueAppend | ( | MiQueue_t * | q, |
void * | buf | ||
) |
Appends a buffer into the queue.
This function appends a buffer into the queue.
q | Queue into which buffer should be appended |
buf | Pointer to the buffer that should be appended into the queue. |
References cpu_irq_disable(), cpu_irq_enable(), MiQueue::head, miQueueBuffer::nextItem, NULL, MiQueue::size, and MiQueue::tail.
Referenced by appAckWaitDataCallback(), dataTimerHandler(), frameParse(), frameTransmit(), MiApp_SendData(), otauDataInd(), PHY_DataReq(), and protocolTimerHandler().
void miQueueFlush | ( | MiQueue_t * | q | ) |
Internal function for flushing a specific queue.
q | Queue to be flushed |
References MiMem_Free(), miQueueRemove(), NULL, and MiQueue::size.
void miQueueInit | ( | MiQueue_t * | q | ) |
Initializes the queue.
This function initializes the queue. Note that this function should be called before invoking any other functionality of QMM.
q | The queue which should be initialized. |
References MiQueue::head, NULL, MiQueue::size, and MiQueue::tail.
Referenced by MiApp_ProtocolInit(), and otauInit().
miQueueBuffer_t* miQueueRead | ( | MiQueue_t * | q, |
search_t * | search | ||
) |
Reads a buffer from queue.
This function reads either the first buffer if search is NULL or buffer matching the given criteria from queue.
q | The queue from which buffer should be read. |
search | If this parameter is NULL first buffer in the queue will be read. Otherwise buffer matching the criteria will be read |
References miQueueReadOrRemove(), and READ_MODE.
miQueueBuffer_t* miQueueRemove | ( | MiQueue_t * | q, |
search_t * | search | ||
) |
Removes a buffer from queue.
This function removes a buffer from queue
q | Queue from which buffer should be removed |
search | Search criteria. If this parameter is NULL, first buffer in the queue will be removed. Otherwise buffer matching the criteria will be removed. |
References miQueueReadOrRemove(), and REMOVE_MODE.
Referenced by appAckWaitDataCallback(), dataTimerHandler(), frameParse(), macAckOnlyDataCallback(), miQueueFlush(), otauTask(), P2PTasks(), PHY_TxHandler(), and protocolTimerHandler().
uint8_t* miQueueBuffer::buffer |
Handle to callback parameter.
Referenced by miQueueReadOrRemove().
uint8_t(* search_tag::criteria_func)(void *buf, void *handle) |
Pointer to search criteria function.
Referenced by miQueueReadOrRemove(), and remove_frame_from_gts_q().
void* search_tag::handle |
Handle to callback parameter.
Referenced by miQueueReadOrRemove(), and remove_frame_from_gts_q().
miQueueBuffer_t* MiQueue::head |
Pointer to head of queue.
Referenced by miQueueAppend(), miQueueInit(), and miQueueReadOrRemove().
void* miQueueBuffer::nextItem |
Pointer to search criteria function.
Referenced by miQueueAppend(), and miQueueReadOrRemove().
uint8_t MiQueue::size |
Number of buffers present in the current queue.
Referenced by appAckWaitDataCallback(), dataTimerHandler(), frameParse(), miQueueAppend(), miQueueFlush(), miQueueInit(), miQueueReadOrRemove(), otauTask(), P2PTasks(), PHY_TxHandler(), and protocolTimerHandler().
miQueueBuffer_t* MiQueue::tail |
Pointer to tail of queue.
Referenced by miQueueAppend(), miQueueInit(), and miQueueReadOrRemove().