close

fun close()

Closes the BLE connection and releases all associated resources.

This method disconnects from the device (if connected) and releases the underlying BluetoothGatt object and all associated resources. After calling this method, the BleConnection instance should not be reused. Create a new instance if you need to reconnect to the device.

It is important to call this method when you are done with the BLE connection to avoid resource leaks.

See also