The callback prototype to indicate that the service has been disconnected.
Synopsis:
#include <btapi/btgatt.h>
typedef void(* bt_gatt_service_disconnected_cb)(const char *bdaddr, const char *service, int instance, int reason, void *userData);
Arguments:
-
bdaddr
-
The address of the Bluetooth-enabled device.
-
service
-
The service that has been disconnected. This can be either a 128-bit or a 16-bit
Universally Unique Identifier (UUID). The UUID is represented as a string value. The
string representation for GATT services is 0x1435.
-
instance
-
The identifier used to reference the service connection.
-
reason
-
EOK indicates a successful service connection, otherwise an error
code indicates the reason for the connection failure. The following error codes can be returned:
-
EACCES: An authentication or pairing failure occurred.
-
ENOTCONN: There is no connection.
-
ECONNREFUSED: The connection was refused due to invalid
connection parameters provided.
-
ECONNRESET: The remote party terminated the connection.
-
ENETUNREACH: A page timeout occurred.
-
EPROTO: The operation failed because the response from
the remote Bluetooth-enabled device had a protocol error.
-
ETIMEOUT: The connection attempt timed out.
-
userData
-
Pointer to user data passed in during the connection request.
Library:
libbtapi (For the qcc command, use the -l btapi option to link against this library)
Description:
This callback is not triggered if the request to disconnect comes from the user.