Create an event.
#include <bps/event.h>
BPS_API int bps_event_create(bps_event_t **event,
unsigned int domain,
unsigned int code,
const bps_event_payload_t *payload_ptr,
bps_event_completion_func completion_function)
BlackBerry 10.0.0
The event to be returned.
The domain of the event. This value must be no greater than BPS_EVENT_DOMAIN_MAX. Your event's domain must be a number generated by a call to bps_register_domain() to ensure uniqueness.
The code of the event. This value may be any number from 0 to UINT16_MAX.
A pointer to the event's payload, which will be copied.
An optional completion function that will be invoked when the system is done with the event.
The bps_event_create() function creates a bps_event_t event. An application may create its own event, which may then be passed to bps_push_event().
If bps_push_event() is successfully called on the event, the event will be destroyed by the event's completion function (or by the library if a completion function is not set).
If an event is created using bps_event_create() and the event is not pushed to BPS using bps_push_event() or bps_channel_push_event(), then you must call bps_event_destroy() to destroy the event, after which the event must not be used.
BPS_SUCCESS upon success, BPS_FAILURE with errno set otherwise.