PxDelayRequest_EvWait()
Request a delay job handle while waiting for events.
- APPLIES TO
-
1.0.0
- SYNOPSIS
-
PxDelayEvent_t PxDelayRequest_EvWait (PxOpool_t opoolid, PxEvents_t events); - ARGUMENTS
|
|
|
- RETURN VALUES
-
-
Valid delay job handle on success
-
Events, if request was aborted by an event
-
- ERROR CODES
-
PXERR_OPOOL_ILLOPOOLopoolidis not a valid object poolPXERR_ACCESS_RIGHTThe calling task has not the right to access the object pool
PXERR_OBJ_ABORTEDThe request was aborted by an event
PXERR_EVENT_ZEROThe given event mask is zero
PXERR_OBJ_NOOBJNo free object is available
PXERR_DELAY_ILLDELAYInvalid delay object
PXERR_GLOBAL_ILLEGAL_COREThe requested object pool is not on the same core
PXERR_OBJ_ILLOBJThe passed object handle is not valid
PXERR_INTERNAL_INCONSISTENCYInconsistency of internal structures
- DESCRIPTION
-
The
PxDelayRequest_EvWaitfunction creates a delay job handle by converting a free object from object poolopool. The object handle is returned. If there is no free object available,PxDelayRequest_EvWaitwaits until either there is a free object or an event specified in the set events occurs.
- IMPLEMENTATION GUIDELINES
-
- Before call
-
-
opoolidmust be a valid PXROS-HR object pool and the calling task must have the access right to take objects from this object pool (V). The validity ofopoolidmay also be checked by thePxOpoolIsValidmacro (F). The object pool must be created on the same core as the caller runs on. The creator core id can be read with the macroPxOpoolCoreIdand the own core id withPxGetCoreId(C). Typically the task’s default object poolPXOpoolTaskdefaultis used for this purpose. -
The parameter
eventscontains a bitmask of events awaited and should not be zero. Typically the event mask is a constant (V).
-
- After call
-
-
The returned value is a structure of type
PxDelayEvent_t. The received events are stored in theeventspart, the delay id is given in thedelaypart of the structure. This id may be checked with one of the following macros:-
PxDelayIdIsValid()must be true. -
PxDelayIdGet()must not be_PXIllegalObjId. -
PxDelayIdError()must bePXERR_NOERRORotherwise the returned error code has to be interpreted (C).
-
-
- Best Practice
-
-
PxDelayRequest_EvWaitmay block, if no PXROS-HR object is available and no instance (task or handler) sends an event. If blocking calls are prohibited,PxDelayRequest_NoWait()should be used instead or the call should be monitored by the PXROS-HRPxTomechanism. -
PxDelayRequest_EvWaitshould only be called during initialization to ensure the availability of the delay object.
-
- SEE ALSO
- USAGE
-
#include "pxdef.h" #define MY_EVENT 0x1l PxDelay_t Delay = PxDelayRequest_EvWait(opoolid, MY_EVENT); if PxDelayIdError(Delay) != PXERR_NOERROR) { // Report error }