DC_DEVICE_SET_EVENTS(3)
π DC_DEVICE_SET_EVENTS(3) π
β¨ NAME β¨
okay so dc_device_set_events β from the Library Functions Manual β is literally the function for setting events logged during device interaction. that's the whole assignment. π
π«Ά LIBRARY π«Ά
It comes from the library βlibdivecomputerβ. yup, that's the one. πΈ
πΈ 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 π¦
So basically, you're registering a series of event callbacks on a device that was opened with dc_device_open(3). These event callbacks are informative messages during device processing, and they get passed to the callback function with an optional argument called userdata. cute, right? π
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, so here's the lineup:
DC_EVENT_WAITINGβ Indicates that the device is waiting for user input, like activating the data transfer mode on the device. No data is set. just vibes and waiting. β³DC_EVENT_PROGRESSβ Progress metre of the parse. Thedatavariable is set to adc_event_progress_t, with the current and maximum progress values from which one can compute a percentage. slay, math. πDC_EVENT_DEVINFOβ Sets thedatavalue to adc_event_devinfo_t, which can be used to acquire the model, firmware, and serial numbers of the underlying device. device lore unlocked. πDC_EVENT_CLOCKβ Report the system (local machine) and device time in epoch seconds. Fills indataas adc_event_clock_t, withdevtimebeing the device andsystimebeing the system time. Seetime(3). clock check, bestie. β°DC_EVENT_VENDORβ A vendor-specific event fillingdataas adc_event_vendor_t. vendor chaos, but make it official. π·οΈ
π RETURN VALUES π
Returns DC_STATUS_SUCCESS on success or one of several error values on error. success is the main character; errors are the plot twists. periodt. β¨
π SEE ALSO π
π AUTHORS π
The library βlibdivecomputerβ library was written by Jef Driesen, jef@libdivecomputer.org. These manpages were written by Kristaps Dzonsons, kristaps@bsd.lv. iconic behavior, honestly. π«Ά
This page is from Debian, dated January 5, 2017, and it's the DC_DEVICE_SET_EVENTS(3) manual page. byeee, bestie ππ
π¦ where this page comes from
- nixos 26.05: libdivecomputer 0.9.0
- nixpkgs unstable: libdivecomputer 0.9.0
- Copyright (C) 2017 Kristaps Dzonsons <kristaps@bsd.lv>
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms