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

Move GattRequestRejectedException to common #838

Merged
merged 2 commits into from
Jan 27, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions kable-core/api/jvm/kable-core.api
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,10 @@ public final class com/juul/kable/FiltersBuilder {
public final fun match (Lkotlin/jvm/functions/Function1;)V
}

public class com/juul/kable/GattRequestRejectedException : java/lang/IllegalStateException {
public fun <init> ()V
}

public final class com/juul/kable/GattStatusException : java/io/IOException {
public fun <init> (Ljava/lang/String;Ljava/lang/Throwable;I)V
public synthetic fun <init> (Ljava/lang/String;Ljava/lang/Throwable;IILkotlin/jvm/internal/DefaultConstructorMarker;)V
Expand Down
16 changes: 0 additions & 16 deletions kable-core/src/androidMain/kotlin/Exceptions.kt
Original file line number Diff line number Diff line change
@@ -1,24 +1,8 @@
package com.juul.kable

import android.bluetooth.BluetoothDevice
import android.bluetooth.BluetoothGatt
import android.os.RemoteException
import com.juul.kable.AndroidPeripheral.WriteResult

/**
* Thrown when underlying [BluetoothGatt] method call returns `false`. This can occur under the
* following conditions:
*
* - Request isn't allowed (e.g. reading a non-readable characteristic)
* - Underlying service or client interface is missing or invalid (e.g. `mService == null || mClientIf == 0`)
* - Associated [BluetoothDevice] is unavailable
* - Device is busy (i.e. a previous request is still in-progress)
* - An Android internal failure occurred (i.e. an underlying [RemoteException] was thrown)
*/
public open class GattRequestRejectedException internal constructor(
message: String? = null,
) : IllegalStateException(message)

/**
* Thrown when underlying [BluetoothGatt] write operation call fails.
*
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package com.juul.kable

/**
* Thrown on Android when underlying `android.bluetooth.BluetoothDevice` method call returns `false`.
* This can occur under the following conditions:
*
* - Request isn't allowed (e.g. reading a non-readable characteristic)
* - Underlying service or client interface is missing or invalid (e.g. `mService == null || mClientIf == 0`)
* - Associated `BluetoothDevice` is unavailable
* - Device is busy (i.e. a previous request is still in-progress)
* - An Android internal failure occurred (i.e. an underlying `android.os.RemoteException` was thrown)
*/
public open class GattRequestRejectedException internal constructor(
message: String? = null,
) : IllegalStateException(message)
Loading