bps_event_create()

Create an event.

Synopsis:

#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)

Since:

BlackBerry 10.0.0

Arguments:

event

The event to be returned.

domain

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.

code

The code of the event. This value may be any number from 0 to UINT16_MAX.

payload_ptr

A pointer to the event's payload, which will be copied.

completion_function

An optional completion function that will be invoked when the system is done with the event.

Library:

libbps (For the qcc command, use the -l bps option to link against this library)

Description:

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.

Returns:

BPS_SUCCESS upon success, BPS_FAILURE with errno set otherwise.

Last modified: 2014-09-30



Got questions about leaving a comment? Get answers from our Disqus FAQ.

comments powered by Disqus