Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BLE read operation 128 OperationFailedException #71

Open
sherbaev opened this issue Feb 12, 2024 · 0 comments
Open

BLE read operation 128 OperationFailedException #71

sherbaev opened this issue Feb 12, 2024 · 0 comments

Comments

@sherbaev
Copy link

sherbaev commented Feb 12, 2024

When I try to read characteristics as

  val char = connection.getServiceCharacteristic(characteristic)!!
            connection.readCharacteristic(char).value!!

 private suspend fun GattConnection.getServiceCharacteristic(
        characteristic: String,
    ): BluetoothGattCharacteristic? {
        if (mockController.isMocksEnabled) {
            return BluetoothGattCharacteristic(characteristic.asUUID(), 0, 1)
        }
        val characteristicUUID = characteristic.asUUID()
        return discoverServices()
            .firstNotNullOfOrNull { service ->
                service.characteristics.firstOrNull { it.uuid == characteristicUUID }
            }
    }

[DefaultDispatcher-worker-8] - read error com.beepiz.bluetooth.gattcoroutines.OperationFailedException:
com.beepiz.bluetooth.gattcoroutines.OperationFailedException: status: 128
at com.beepiz.bluetooth.gattcoroutines.GattConnectionImpl.readCharacteristic(GattConnectionImpl.kt:491)
at com.beepiz.bluetooth.gattcoroutines.GattConnectionImpl$readCharacteristic$1.invokeSuspend(Unknown Source:15)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:108)
at kotlinx.coroutines.internal.LimitedDispatcher$Worker.run(LimitedDispatcher.kt:115)
at kotlinx.coroutines.scheduling.TaskImpl.run(Tasks.kt:103)
at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:584)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:793)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:697)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:684)

it is throwing exception as com.beepiz.bluetooth.gattcoroutines.OperationFailedException: status: 128
and it is happening only on Android 14 devices(checked with multiple) but working fine with all other devices. What could be wrong ? Permissions are also granted

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant