DC_DEVICE_SET_EVENTS(3)

πŸ“¦ version 0.9.0, in nixos 26.05, nixpkgs unstable

πŸ’– 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. The data variable is set to a dc_event_progress_t, with the current and maximum progress values from which one can compute a percentage. slay, math. πŸ“Š
  • 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 underlying device. device lore unlocked. πŸ”
  • DC_EVENT_CLOCK β€” Report the system (local machine) and device time in epoch seconds. Fills in data as a dc_event_clock_t, with devtime being the device and systime being the system time. See time(3). clock check, bestie. ⏰
  • DC_EVENT_VENDOR β€” A vendor-specific event filling data as a dc_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