Distributed Publish Subscribe for IoT
event.h File Reference

Go to the source code of this file.

Typedefs

typedef struct _DPS_Event DPS_Event
 Opaque type for an event. More...
 

Functions

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

Typedef Documentation

typedef struct _DPS_Event DPS_Event

Opaque type for an event.

Function Documentation

DPS_Event* DPS_CreateEvent ( )

Create and initialize an event.

void DPS_DestroyEvent ( DPS_Event event)

Destroy an event and free resources.

Parameters
eventThe event to destroy
void* DPS_GetEventData ( const DPS_Event event)

Get the event application data pointer.

Parameters
eventThe event to get the application data pointer from
void DPS_SetEventData ( DPS_Event event,
void *  data 
)

Set the event application data pointer.

Parameters
eventThe event to set an application data pointer on
dataThe data pointer to set
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_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_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()