NetBurner 3.3.9
PDF Version

A queue functions as a fixed size FIFO for communication between tasks. More...

#include <nbrtos.h>

Inherits OS_TASK_DLY_OBJ.

Public Member Functions

 OS_Q (void **pQueueStorage, uint8_t size)
 Create and initialize a queue object. More...
 
uint8_t Init (void **pQueueStorage, uint8_t size)
 Sets the queue object to its initial state. More...
 
uint8_t Post (void *pItem)
 This function posts a message to a Queue. Note: Any higher priority task waiting on this queue will be started. More...
 
uint8_t PostFirst (void *pItem)
 This function posts a message like OSQPost, but posts the message at the head of the queue. Note: Any higher priority task waiting on this queue will be started. More...
 
uint8_t PostUnique (void *pItem)
 This function checks to see if a message already exists in a queue, and if it doesn't, it then posts it. Note: Any higher priority task waiting on this queue will be started. More...
 
uint8_t PostUniqueFirst (void *msg)
 This function checks to see if a message already exists in a queue, and if it doesn't, it then posts it at the head of the queue. Note: Any higher priority task waiting on this queue will be started. More...
 
void * Pend (uint32_t timeoutTicks, uint8_t &result)
 Wait timeout ticks for another task to post to the queue. Note: A timeout value of 0 (zero) waits forever. An err holds the error code if the function fails. More...
 
void * PendNoWait (uint8_t &result)
 Checks to see if a message has been posted to a queue, but does not wait. An err holds the error code if the function fails. More...
 
void * Pend (uint32_t timeoutTicks=WAIT_FOREVER)
 Wait timeout ticks for another task to post to the queue. This is the same as Pend(uint32_t timeoutTicks, uint8_t &result), but does not provide a result code. Note: A timeout value of 0 (zero) waits forever. More...
 
void * PendNoWait ()
 Checks to see if a message has been posted to a queue, but does not wait. This is the same as PendNoWait(uint8_t &result), but does not provide an result code. More...
 

Detailed Description

A queue functions as a fixed size FIFO for communication between tasks.

Constructor & Destructor Documentation

◆ OS_Q()

OS_Q::OS_Q ( void **  pQueueStorage,
uint8_t  size 
)
inline

Create and initialize a queue object.

Parameters
pQueueStorageA pointer to an array of (void *) pointers to hold queue messages.
sizeThe number of pointers in the Q data storage area.

Member Function Documentation

◆ Init()

uint8_t OS_Q::Init ( void **  pQueueStorage,
uint8_t  size 
)

Sets the queue object to its initial state.

Parameters
pQueueStorageA pointer to an array of (void *) pointers to hold queue messages.
sizeThe number of pointers in the Q data storage area.
Return values
OS_NO_ERR- If successful
See also
NBRTOS Error Codes

◆ Pend() [1/2]

void * OS_Q::Pend ( uint32_t  timeoutTicks,
uint8_t &  result 
)
inline

Wait timeout ticks for another task to post to the queue. Note: A timeout value of 0 (zero) waits forever. An err holds the error code if the function fails.

Parameters
timeoutTicksThe number of time ticks to wait.
&resultA variable to receive the result code (OS_NO_ERR if successful or OS_TIMEOUT if it fails).
Return values
MessageIf successful
NULLIf it timed out
See also
NBRTOS Error Codes
PendNoWait(uint8_t &result)
Pend(uint32_t timeoutTicks)

◆ Pend() [2/2]

void * OS_Q::Pend ( uint32_t  timeoutTicks = WAIT_FOREVER)
inline

Wait timeout ticks for another task to post to the queue. This is the same as Pend(uint32_t timeoutTicks, uint8_t &result), but does not provide a result code. Note: A timeout value of 0 (zero) waits forever.

Parameters
timeoutTicksThe number of time ticks to wait.
Return values
MessageIf successful
NULLIf it timed out
See also
PendNoWait()
Pend(uint32_t timeoutTicks, uint8_t &result)

◆ PendNoWait() [1/2]

void * OS_Q::PendNoWait ( )
inline

Checks to see if a message has been posted to a queue, but does not wait. This is the same as PendNoWait(uint8_t &result), but does not provide an result code.

Return values
MessageIf successful
NULLIf it failed
See also
Pend(uint32_t timeoutTicks)
PendNoWait(uint8_t &result)

◆ PendNoWait() [2/2]

void * OS_Q::PendNoWait ( uint8_t &  result)

Checks to see if a message has been posted to a queue, but does not wait. An err holds the error code if the function fails.

Parameters
&resultA variable to receive the result code (OS_NO_ERR if successful or OS_TIMEOUT if it fails).
Return values
MessageIf successful
NULLIf it failed
See also
NBRTOS Error Codes
Pend(uint32_t timeoutTicks, uint8_t &result)
PendNoWait()

◆ Post()

uint8_t OS_Q::Post ( void *  pItem)

This function posts a message to a Queue. Note: Any higher priority task waiting on this queue will be started.

Parameters
pItemThe message to be posted to the queue.
Return values
OS_NO_ERR- If successful
OS_Q_FULL- If the queue is full and has no more room
See also
NBRTOS Error Codes
PostFirst(void *pItem)
PostUnique(void *pItem)

◆ PostFirst()

uint8_t OS_Q::PostFirst ( void *  pItem)

This function posts a message like OSQPost, but posts the message at the head of the queue. Note: Any higher priority task waiting on this queue will be started.

Parameters
pItemThe message to be posted to the queue.
Return values
OS_NO_ERR- Successfully posted at the head of the queue
OS_Q_FULL- The queue is already full; cannot post message
See also
NBRTOS Error Codes
Post(void *pItem)
PostUniqueFirst(void *msg)

◆ PostUnique()

uint8_t OS_Q::PostUnique ( void *  pItem)

This function checks to see if a message already exists in a queue, and if it doesn't, it then posts it. Note: Any higher priority task waiting on this queue will be started.

Parameters
*pItemThe message to be posted to the queue
Return values
OS_NO_ERRIf successful
OS_Q_EXISTSIf the message already exists in the queue
OS_Q_FULLIf the queue is full and has no more room
See also
NBRTOS Error Codes
Post(void *pItem)
PostUniqueFirst(void *msg)

◆ PostUniqueFirst()

uint8_t OS_Q::PostUniqueFirst ( void *  msg)

This function checks to see if a message already exists in a queue, and if it doesn't, it then posts it at the head of the queue. Note: Any higher priority task waiting on this queue will be started.

Parameters
*msgPointer to the message to be posted to the queue
Return values
OS_NO_ERRIf successful
OS_Q_EXISTSIf the message already exists in the queue
OS_Q_FULLIf the queue is full and has no more room
See also
NBRTOS Error Codes
PostUnique(void *pItem)
PostFirst(void *pItem)

The documentation for this class was generated from the following files: