DC_BLUETOOTH_OPEN(3)
π DC_BLUETOOTH_OPEN(3) π
okay so this is a page from the Library Functions Manual, bestie, and it's literally all about opening a bluetooth iostream for a dive computer. yes, that libdivecomputer. slay.
β¨ NAME β¨
dc_bluetooth_open β opens an iostream for a bluetooth device π¦
π LIBRARY π
library βlibdivecomputerβ
π SYNOPSIS π
#include <libdivecomputer/bluetooth.h>
dc_status_t
dc_bluetooth_open(dc_iostream_t **iostream, dc_context_t *context,
dc_bluetooth_address_t address, unsigned int port);
π DESCRIPTION π
So what it does: it opens an iostream for a bluetooth device. that's the whole vibe. π
What it wants from you:
- a context opened with
dc_context_new(3)β like, you gotta have your context first, no cap - a 48-bit bluetooth address, which you get from
dc_bluetooth_iterator_new(3)together withdc_bluetooth_device_get_address(3)ordc_bluetooth_str2addr(3) - a bluetooth rfcomm port number β and bestie, use
0for autodetection π«Ά
π¨ okay this part matters: once it returnsDC_STATUS_SUCCESS, that iostream pointer must be freed withdc_iostream_close(3). like, must must. don't leave it hanging, that's not main character energy, that's a leak π
β RETURN VALUES β
Returns DC_STATUS_SUCCESS on success, or one of several error values on error. and on success, the iostream pointer gets filled in with an open handle β icon status honestly β¨
π SEE ALSO π
dc_context_new(3)dc_iostream_close(3)dc_serial_open(3)dc_irda_open(3)dc_usbhid_open(3)dc_bluetooth_iterator_new(3)dc_bluetooth_device_get_address(3)dc_bluetooth_str2addr(3)
π AUTHORS π
The library βlibdivecomputerβ library was written by Jef Driesen, jef@libdivecomputer.org. π
This manpage is written by Vincent Hagen, vinnie@script4web.nl. π
and that's the whole page, bestie β Debian, June 5, 2020, that's the source and date, we're done here πβ¨π
π¦ 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