Skip to main content
Version: 9.0.2

sbio_add_event_callback

int sbio_add_event_callback(
sbio_channel_handle_t *handle,
const char *event_name,
sbio_event_callback_t callback_function,
void *user_data);

Adds a callback to a receive channel. The event name can be specified as a pattern. 

* - Any event
event_name - Exact match to 'event_name' 
*event_name* - Anything containing 'event_name'

The sbio_event_callback_t structure has the following definition:

typedef void (*sbio_event_callback_t)(
const char *event_name,
char *event_format,
void *event_data,
int event_data_size,
void *user_data);

Parameters

ParameterTypeDescription
handlesbio_channel_handle_t *The receive handle to add the callback to. 
event_nameconst char *The name of the event to listen for, or NULL for all events.
callback_functionsbio_event_callback_tThe function to call when the event is received. 
user_datavoid *Data that should be passed to the callback.

Returns

TypeDescription
int0 on success and non-zero on failure.