DC_DESCRIPTOR_GET_TRANSPORTS(3)
π DC_DESCRIPTOR_GET_TRANSPORTS(3)
okay so bestie, this one lives in the Library Functions Manual section β the manual name is literally DC_DESCRIPTOR_GET_TRANSP(3) and no, that's not a typo, the header just cut it off. iconic of it honestly. anyway. let's get into it β¨
πΈ NAME πΈ
dc_descriptor_get_transports β gets the transports supported by the given descriptor. that's the whole vibe. it's a getter. it gets. π
π LIBRARY π
library βlibdivecomputerβ π«Ά
β¨ SYNOPSIS β¨
#include <libdivecomputer/descriptor.h>
unsigned int
dc_descriptor_get_transports(const dc_descriptor_t *descriptor);
π¦ DESCRIPTION π¦
okay so what this does is it gets the transports supported by the given descriptor. no cap, that's it. π«Ά
and like, where do you even find a descriptor? lowkey the descriptor is usually found by searching through dc_descriptor_iterator_new(3). so go do that first, bestie. iykyk π
π RETURN VALUES π
it returns a union (that's a bitwise OR, for the record π§) of the transports supported by the given descriptor. so like, all the vibes mashed together into one unsigned int.
the result is a combination of:
DC_TRANSPORT_USBDC_TRANSPORT_USBHIDDC_TRANSPORT_BLEDC_TRANSPORT_BLUETOOTHDC_TRANSPORT_SERIALDC_TRANSPORT_IRDA
and to determine if a specific transport is supported, use the following code, periodt:
unsigned int transports = dc_descriptor_get_transports(descriptor);
if(transports & DC_TRANSPORT_USBHID) {
// Device supports USB HID as transport
}
like, it's giving bitmask. it's giving &. she ate π₯
π SEE ALSO π
π AUTHORS π
the library βlibdivecomputerβ library was written by Jef Driesen, jef@libdivecomputer.org. absolute main character energy honestly π
this manpage is written by Vincent Hagen, vinnie@script4web.nl. π
and that's the whole page, bestie! this one came from Debian, dated June 5, 2020, and it's filed under DC_DESCRIPTOR_GET_TRANSPORTS(3) β the full name, not the abbreviated header version. slay πβ¨
π¦ where this page comes from
- nixos 26.05: libdivecomputer 0.9.0
- nixpkgs unstable: libdivecomputer 0.9.0
- Copyright (C) 2020 Vincent Hagen <vinnie@script4web.nl>
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms