Uso de RTOS
Functions
OS_MBOX.C File Reference

MESSAGE MAILBOX MANAGEMENT. More...

#include "includes.h"
Include dependency graph for OS_MBOX.C:

Functions

void * OSMboxAccept (OS_EVENT *pevent)
 ACCEPT MESSAGE FROM MAILBOX. More...
 
OS_EVENT * OSMboxCreate (void *msg)
 CREATE A MESSAGE MAILBOX. More...
 
OS_EVENT * OSMboxDel (OS_EVENT *pevent, INT8U opt, INT8U *err)
 DELETE A MAIBOX. More...
 
void * OSMboxPend (OS_EVENT *pevent, INT16U timeout, INT8U *err)
 PEND ON MAILBOX FOR A MESSAGE. More...
 
INT8U OSMboxPost (OS_EVENT *pevent, void *msg)
 POST MESSAGE TO A MAILBOX. More...
 
INT8U OSMboxPostOpt (OS_EVENT *pevent, void *msg, INT8U opt)
 POST MESSAGE TO A MAILBOX. More...
 
INT8U OSMboxQuery (OS_EVENT *pevent, OS_MBOX_DATA *pdata)
 QUERY A MESSAGE MAILBOX. More...
 

Detailed Description

MESSAGE MAILBOX MANAGEMENT.

Author
Jean J. Labrosse

Function Documentation

◆ OSMboxAccept()

void * OSMboxAccept ( OS_EVENT *  pevent)

ACCEPT MESSAGE FROM MAILBOX.

Parameters
pevent
Returns
!= (void *)0 is the message in the mailbox if one is available. The mailbox is cleared so the next time OSMboxAccept() is called, the mailbox will be empty.
== (void *)0 if the mailbox is empty or, if 'pevent' is a NULL pointer or, if you didn't pass the proper event pointer.

◆ OSMboxCreate()

OS_EVENT * OSMboxCreate ( void *  msg)

CREATE A MESSAGE MAILBOX.

Parameters
msg
Warning
is the time delay that the task will be suspended in number of clock 'ticks'. Note that by specifying 0, the task will not be delayed.
Returns
!= (OS_EVENT *)0 is a pointer to the event control clock (OS_EVENT) associated with the created mailbox
== (OS_EVENT *)0 if no event control blocks were available
Here is the caller graph for this function:

◆ OSMboxDel()

OS_EVENT * OSMboxDel ( OS_EVENT *  pevent,
INT8U  opt,
INT8U err 
)

DELETE A MAIBOX.

Parameters
pevent
opt
err

◆ OSMboxPend()

void * OSMboxPend ( OS_EVENT *  pevent,
INT16U  timeout,
INT8U err 
)

PEND ON MAILBOX FOR A MESSAGE.

Parameters
pevent
timeout
err
Warning
is the time delay that the task will be suspended in number of clock 'ticks'. Note that by specifying 0, the task will not be delayed.
Returns
!= (void *)0 is a pointer to the message received
== (void *)0 if no message was received or,
if 'pevent' is a NULL pointer or,
if you didn't pass the proper pointer to the event control block.
Here is the caller graph for this function:

◆ OSMboxPost()

INT8U OSMboxPost ( OS_EVENT *  pevent,
void *  msg 
)

POST MESSAGE TO A MAILBOX.

Parameters
pevent
msg
Returns
OS_NO_ERR The call was successful and the message was sent
OS_MBOX_FULL If the mailbox already contains a message. You can can only send one message at a time and thus, the message MUST be consumed before you are allowed to send another one.
OS_ERR_EVENT_TYPE If you are attempting to post to a non mailbox.
OS_ERR_PEVENT_NULL If 'pevent' is a NULL pointer
OS_ERR_POST_NULL_PTR If you are attempting to post a NULL pointer
Here is the caller graph for this function:

◆ OSMboxPostOpt()

INT8U OSMboxPostOpt ( OS_EVENT *  pevent,
void *  msg,
INT8U  opt 
)

POST MESSAGE TO A MAILBOX.

Parameters
pevent
msg
opt
Returns
OS_NO_ERR The call was successful and the message was sent

◆ OSMboxQuery()

INT8U OSMboxQuery ( OS_EVENT *  pevent,
OS_MBOX_DATA *  pdata 
)

QUERY A MESSAGE MAILBOX.

Parameters
pevent
pdata
Returns
OS_NO_ERR The call was successful and the message was sent
OS_ERR_EVENT_TYPE If you are attempting to obtain data from a non mailbox.
OS_ERR_PEVENT_NULL If 'pevent' is a NULL pointer