DC_DEVICE_SET_FINGERPRINT(3)

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

πŸ’… DC_DEVICE_SET_FINGERPRIN(3) πŸ’…

okay so real talk β€” this is dc_device_set_fingerprint from the Library Functions Manual, and it lives in the library libdivecomputer. bestie, it's giving "tiny function, huge glow-up." let's get into it 🫢


✨ NAME ✨

dc_device_set_fingerprint β€” sets the last-seen dive fingerprint, no cap πŸŽ€

πŸ“š LIBRARY πŸ“š

library β€œlibdivecomputer” β€” that's the one, that's the icon πŸ‘‘

πŸ¦‹ SYNOPSIS πŸ¦‹

#include <libdivecomputer/device.h>

dc_status_t
dc_device_set_fingerprint(dc_device_t *device,
    const unsigned char data[], unsigned int size);

literally copy it exactly, don't @ me 🌸

πŸ’– DESCRIPTION πŸ’–

so what this does is it sets the last-seen dive fingerprint on a device that you opened with dc_device_open(3). and the whole vibe of this mechanism? it's so you only download dives that are β€œnewer” β€” and yes, β€œnewer” as reported by the dive computer itself, not necessarily on the calendar πŸ’€ like, don't assume the dates line up, the computer decides.

in normal day-to-day usage, here's the routine, and it ate:

  • the fingerprint gets acquired (and saved) from the first dive downloaded from a dive computer by dc_device_foreach(3).
  • then, on subsequent openings of the device, you set the fingerprint with dc_device_set_fingerprint, and when a dive reports a fingerprint that matches, the download exits before reporting that dive.
  • (and the first fingerprint is saved again for subsequent invocations, so the loop just keeps rolling ✨)

in this way, only the newest dives are reported. main character energy: the old ones simply don't get an invite to the group chat πŸ™ˆ

πŸ”₯ RETURN VALUES πŸ”₯

it returns DC_STATUS_SUCCESS if the fingerprint was set, or one of several error values on error. that's it, that's the return value story πŸŽ€

πŸ‘€ SEE ALSO πŸ‘€

go read it, iykyk πŸ’œ

🧚 AUTHORS 🧚

the library β€œlibdivecomputer” was written by Jef Driesen, jef@libdivecomputer.org. and the manpages? written by Kristaps Dzonsons, kristaps@bsd.lv. absolute legends, both of them 🌟


and that's the page!! sign-off time: this lil number came from Debian, dated January 5, 2017, and it answers to the name DC_DEVICE_SET_FINGERPRINT(3) πŸŽ€πŸ’…βœ¨ (yes the top of the page is spelled DC_DEVICE_SET_FINGERPRIN(3), she's just built like that, don't ask 😭)

πŸ“¦ where this page comes from