DC_DESCRIPTOR_GET_TRANSPORTS(3)

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

πŸ’… 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_USB
  • DC_TRANSPORT_USBHID
  • DC_TRANSPORT_BLE
  • DC_TRANSPORT_BLUETOOTH
  • DC_TRANSPORT_SERIAL
  • DC_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