close

fun close()

Closes the GATT connection and releases all associated resources.

This method performs a complete cleanup:

Unlike disconnect, this method does NOT trigger auto-reconnection, making it suitable for permanent disconnection scenarios.

After calling this method, you must call connect again to re-establish a connection. The bluetoothGatt property will be null after this call.

See also

Throws

if Bluetooth permissions are not granted.