DC_DEVICE_SET_EVENTS(3) | FreeBSD Library Functions Manual | DC_DEVICE_SET_EVENTS(3) |
dc_device_set_events
—
set events logged during device interaction
library “libdivecomputer”
#include
<libdivecomputer/device.h>
typedef void
(*dc_event_callback_t)
(dc_device_t
*device, dc_event_type_t event,
const void *data, void
*userdata);
dc_status_t
dc_device_set_events
(dc_device_t
*device, unsigned int events,
dc_event_callback_t callback, void
*userdata);
Register a series of event callbacks on a device opened with dc_device_open(3). Event callbacks are informative messages during device processing passed to the callback function with an optional argument userdata.
The events value is a bit-field of events, one of which is passed to the callback as event. The data field will be cast to an event-specific type:
DC_EVENT_WAITING
DC_EVENT_PROGRESS
DC_EVENT_DEVINFO
DC_EVENT_CLOCK
DC_EVENT_VENDOR
Returns DC_STATUS_SUCCESS
on success or
one of several error values on error.
The library
“libdivecomputer” library was written by
Jef Driesen,
jef@libdivecomputer.org.
These manpages were written by
Kristaps Dzonsons,
kristaps@bsd.lv.
January 5, 2017 | FreeBSD 14.3-RELEASE |