NetBurner 3.4.0
PDF Version
Loading...
Searching...
No Matches
OS_MBOX Class Reference

Mailboxes are used to communicate between tasks. More...

#include <nbrtos.h>

Inherits OS_TASK_DLY_OBJ.

Public Member Functions

 OS_MBOX ()
 Create and initialize a mailbox object.
 
 OS_MBOX (void *msg)
 Create and initialize a mailbox object with a given message. More...
 
uint8_t Init (void *msg=NULL)
 Sets the mailbox object to its initial state. More...
 
uint8_t Post (void *msg)
 This function posts a message to the mailbox. More...
 
void * Pend (uint32_t timeoutTicks, uint8_t &result)
 Wait timeout ticks for some other task to post to the mailbox. Note: Pend will wait forever if 0 is passed in as the timeout value. More...
 
void * PendNoWait (uint8_t &result)
 Checks to see if a message has been posted to a mailbox, but does not wait. More...
 
void * Pend (uint32_t timeoutTicks=WAIT_FOREVER)
 Wait timeout ticks for some other task to post to the mailbox. This is the same as Pend(uint32_t timeoutTicks, uint8_t &result), but does not provide a return code. Note: Pend will wait forever if 0 is passed in as the timeout value. More...
 
void * PendNoWait ()
 Checks to see if a message has been posted to a mailbox, but does not wait. This is the same as PendNoWait(uint8_t &result), but does not provide a return code. More...
 

Detailed Description

Mailboxes are used to communicate between tasks.

Constructor & Destructor Documentation

◆ OS_MBOX()

OS_MBOX::OS_MBOX ( void *  msg)
inline

Create and initialize a mailbox object with a given message.

Parameters
msgMessage that the mailbox should be initialized with

Member Function Documentation

◆ Init()

uint8_t OS_MBOX::Init ( void *  msg = NULL)

Sets the mailbox object to its initial state.

Parameters
msgMessage that the mailbox should be initialized with
Return values
OS_NO_ERRIf successful
See also
NBRTOS Error Codes

◆ Pend() [1/2]

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

Wait timeout ticks for some other task to post to the mailbox. Note: Pend will wait forever if 0 is passed in as the timeout value.

Parameters
timeoutTicksThe number of system ticks to wait
[out]resultThe result status of the function: OS_NO_ERR if successful, OS_TIMEOUT if it timed out.
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_MBOX::Pend ( uint32_t  timeoutTicks = WAIT_FOREVER)
inline

Wait timeout ticks for some other task to post to the mailbox. This is the same as Pend(uint32_t timeoutTicks, uint8_t &result), but does not provide a return code. Note: Pend will wait forever if 0 is passed in as the timeout value.

Parameters
timeoutTicksThe number of system 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_MBOX::PendNoWait ( )
inline

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

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

◆ PendNoWait() [2/2]

void * OS_MBOX::PendNoWait ( uint8_t &  result)

Checks to see if a message has been posted to a mailbox, but does not wait.

Parameters
[out]resultThe result status of the function: OS_NO_ERR if successful, OS_TIMEOUT if there was no message.
Return values
MessageIf successful
NULLIf it failed
See also
NBRTOS Error Codes
Pend(uint32_t timeoutTicks, uint8_t &result)
PendNoWait()

◆ Post()

uint8_t OS_MBOX::Post ( void *  msg)

This function posts a message to the mailbox.

Parameters
msgMessage that the mailbox should post
Return values
OS_NO_ERRIf successful
OS_MBOX_FULLIf the mailbox is full
See also
NBRTOS Error Codes

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