bt_spp_close()

Disconnect from the service associated with the file descriptor.

Synopsis:

#include <btapi/btspp.h>
 
int bt_spp_close(int fd)

Since:

BlackBerry 10.0.0

Arguments:

fd

The mount point file descriptor returned by bt_spp_open() or bt_spp_open_ex().

Library:

libbtapi (For the qcc command, use the -l btapi option to link against this library)

Description:

This function closes the client side SPP connection opened with bt_spp_open() or bt_spp_open_ex(). Ensure that you call this function after your application has finished using the file descriptor from a successful call to bt_spp_open() or bt_spp_open_ex().

Do not call this function if you started a session with bt_spp_open_server() or bt_spp_open_server_ex(), even if the callback returned a valid file descriptor.

Returns:

0 when the service is successfully disconnected, -1 with the errno set otherwise. The errno can be set to one of the following values:
  • EPERM: The bt_spp_init() function has not been called or has failed.
  • EBADF: An invalid file descriptor is passed to the function.

Last modified: 2014-06-24



Got questions about leaving a comment? Get answers from our Disqus FAQ.

comments powered by Disqus