.\" .\" libdivecomputer .\" .\" Copyright (C) 2020 Vincent Hagen .\" .\" This library is free software; you can redistribute it and/or .\" modify it under the terms of the GNU Lesser General Public .\" License as published by the Free Software Foundation; either .\" version 2.1 of the License, or (at your option) any later version. .\" .\" This library is distributed in the hope that it will be useful, .\" but WITHOUT ANY WARRANTY; without even the implied warranty of .\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU .\" Lesser General Public License for more details. .\" .\" You should have received a copy of the GNU Lesser General Public .\" License along with this library; if not, write to the Free Software .\" Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, .\" MA 02110-1301 USA .\" .Dd June 5, 2020 .Dt DC_BLUETOOTH_OPEN 3 .Os .Sh NAME .Nm dc_bluetooth_open .Nd Opens an iostream for a bluetooth device .Sh LIBRARY .Lb libdivecomputer .Sh SYNOPSIS .In libdivecomputer/bluetooth.h .Ft dc_status_t .Fo dc_bluetooth_open .Fa "dc_iostream_t **iostream" .Fa "dc_context_t *context" .Fa "dc_bluetooth_address_t address" .Fa "unsigned int port" .Fc .Sh DESCRIPTION Opens an iostream for a bluetooth device. Accepts a .Fa context opened with .Xr dc_context_new 3 , a 48-bit bluetooth .Fa address given by .Xr dc_bluetooth_iterator_new 3 together with .Xr dc_bluetooth_device_get_address 3 or .Xr dc_bluetooth_str2addr 3 and a bluetooth rfcomm .Fa port number (use 0 for autodetection). .Pp Upon returning .Dv DC_STATUS_SUCCESS , the .Fa iostream pointer must be freed with .Xr dc_iostream_close 3 . .Sh RETURN VALUES Returns .Dv DC_STATUS_SUCCESS on success or one of several error values on error. On success, the .Fa iostream pointer is filled in with an open handle. .Sh SEE ALSO .Xr dc_context_new 3 , .Xr dc_iostream_close 3 , .Xr dc_serial_open 3 , .Xr dc_irda_open 3 , .Xr dc_usbhid_open 3 , .Xr dc_bluetooth_iterator_new 3 , .Xr dc_bluetooth_device_get_address 3 , .Xr dc_bluetooth_str2addr 3 , .Sh AUTHORS The .Lb libdivecomputer library was written by .An Jef Driesen , .Mt jef@libdivecomputer.org . .br This manpage is written by .An Vincent Hagen , .Mt vinnie@script4web.nl .