Distributed Publish & Subscribe for IoT
Event

Signal and wait on application-created events. More...

Typedefs

typedef struct _DPS_Event DPS_Event
 Opaque type for an event.
 

Functions

DPS_EventDPS_CreateEvent (void)
 Create and initialize an event. More...
 
void DPS_DestroyEvent (DPS_Event *event)
 Destroy an event and free resources. More...
 
void * DPS_GetEventData (const DPS_Event *event)
 Get the event application data. More...
 
void DPS_SetEventData (DPS_Event *event, void *data)
 Set the event application data. More...
 
void DPS_SignalEvent (DPS_Event *event, DPS_Status status)
 Signal an event. More...
 
DPS_Status DPS_TimedWaitForEvent (DPS_Event *event, uint16_t timeout)
 Wait for an event to be signalled with a timeout. More...
 
DPS_Status DPS_WaitForEvent (DPS_Event *event)
 Wait for an event to be signalled. More...
 

Detailed Description

Signal and wait on application-created events.

Function Documentation

◆ DPS_CreateEvent()

DPS_Event* DPS_CreateEvent ( void  )

Create and initialize an event.

Returns
The created event, or NULL if creation failed

◆ DPS_DestroyEvent()

void DPS_DestroyEvent ( DPS_Event event)

Destroy an event and free resources.

Parameters
eventThe event to destroy

◆ DPS_GetEventData()

void* DPS_GetEventData ( const DPS_Event event)

Get the event application data.

Parameters
eventThe event to get the application data from
Returns
The application data

◆ DPS_SetEventData()

void DPS_SetEventData ( DPS_Event event,
void *  data 
)

Set the event application data.

Parameters
eventThe event to set an application data on
dataThe data to set

◆ DPS_SignalEvent()

void DPS_SignalEvent ( DPS_Event event,
DPS_Status  status 
)

Signal an event.

Parameters
eventEvent to signal
statusA status code to pass to the event waiter

◆ DPS_TimedWaitForEvent()

DPS_Status DPS_TimedWaitForEvent ( DPS_Event event,
uint16_t  timeout 
)

Wait for an event to be signalled with a timeout.

Parameters
eventEvent to wait for
timeoutTimeout in milliseconds
Returns
The status passed to DPS_SignalEvent() or DPS_ERR_TIMEOUT if the call timed out.

◆ DPS_WaitForEvent()

DPS_Status DPS_WaitForEvent ( DPS_Event event)

Wait for an event to be signalled.

Parameters
eventEvent to wait for
Returns
The status passed to DPS_SignalEvent()