File tree Expand file tree Collapse file tree
app/src/main/java/to/bitkit/services Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -894,6 +894,7 @@ class TrezorTransport @Inject constructor(
894894 connection.gatt.disconnect()
895895
896896 val disconnected = disconnectLatch.await(DISCONNECT_TIMEOUT_MS , TimeUnit .MILLISECONDS )
897+ val timeoutError = if (disconnected) null else " BLE disconnect timed out; forced close"
897898 if (! disconnected) {
898899 Logger .warn(" BLE disconnect timeout, forcing close: '$path '" , context = TAG )
899900 }
@@ -902,7 +903,7 @@ class TrezorTransport @Inject constructor(
902903 connection.gatt.close()
903904 Thread .sleep(100 )
904905 Logger .info(" BLE device closed: '$path '" , context = TAG )
905- TrezorTransportWriteResult (success = true , error = " " )
906+ TrezorTransportWriteResult (success = timeoutError == null , error = timeoutError.orEmpty() )
906907 } catch (e: Exception ) {
907908 Logger .error(" BLE close failed" , e, context = TAG )
908909 TrezorTransportWriteResult (success = false , error = e.message ? : " BLE close failed" )
You can’t perform that action at this time.
0 commit comments