<< Previous | Next >>

OSMboxPend

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

Description

Waits for a message to be sent to a mailbox.

Parameters

pevent
Pointer to mailbox's event control block.

timeout
Allows task to resume execution if a message was not received by the number of clock ticks specified. Specifying 0 means the task is willing to wait forever.

err
Pointer to a variable for holding an error code. Possible error messages are:

  • OS_NO_ERR: The call was successful and the task received a message.

  • OS_TIMEOUT: A message was not received within the specified timeout

  • OS_ERR_EVENT_TYPE: Invalid event type

  • OS_ERR_PEND_ISR If this function was called from an ISR and the result would lead to a suspension.

  • OS_ERR_PEVENT_NULL: If pevent is a null pointer

Return value

!= (void *)0
A pointer to the message received

== (void *)0
No message was received, or pevent is a null pointer, or the proper pointer to the event control block was not passed.

Library

OS_MBOX.C (Prior to DC 8:UCOS2.LIB)

See also

OSMboxAccept, OSMboxCreate, OSMboxPost, OSMboxQuery


Dynamic C Functions << Previous | Next >> rabbit.com