Skip site navigation (1)Skip section navigation (2)

FreeBSD Manual Pages

  
 
  

home | help
DC_DEVICE_SET_EVENTS(3)	    Library Functions Manual   DC_DEVICE_SET_EVENTS(3)

NAME
       dc_device_set_events -- set events logged during	device interaction

LIBRARY
       library "libdivecomputer"

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

DESCRIPTION
       Register	  a  series  of	 event	callbacks  on  a  device  opened  with
       dc_device_open(3).  Event callbacks are informative messages during de-
       vice processing passed to the callback function with an optional	 argu-
       ment 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-spe-
       cific type:

       DC_EVENT_WAITING
	       Indicate	that the device	is waiting for user input, such	as ac-
	       tivating	the data transfer mode on the device.  No data is set.

       DC_EVENT_PROGRESS
	       Progress	 metre	of  the	 parse.	 The data variable is set to a
	       dc_event_progress_t, with the current and maximum progress val-
	       ues from	which one can compute a	percentage.

       DC_EVENT_DEVINFO
	       Sets the	data value to a	dc_event_devinfo_t, which can be  used
	       to  acquire  the	model, firmware, and serial numbers of the un-
	       derlying	device.

       DC_EVENT_CLOCK
	       Report the system (local	machine) and device time in epoch sec-
	       onds.  Fills in data as a dc_event_clock_t, with	devtime	 being
	       the device and systime being the	system time.  See time(3).

       DC_EVENT_VENDOR
	       A vendor-specific event filling data as a dc_event_vendor_t.

RETURN VALUES
       Returns	DC_STATUS_SUCCESS on success or	one of several error values on
       error.

SEE ALSO
       dc_device_open(3)

AUTHORS
       The library "libdivecomputer"  library  was  written  by	 Jef  Driesen,
       jef@libdivecomputer.org.	 These manpages	were written by
       Kristaps	Dzonsons, kristaps@bsd.lv.

FreeBSD	Ports 14.quarterly	January	5, 2017	       DC_DEVICE_SET_EVENTS(3)

Want to link to this manual page? Use this URL:
<https://man.freebsd.org/cgi/man.cgi?query=dc_device_set_events&sektion=3&manpath=FreeBSD+Ports+14.3.quarterly>

home | help