diff --git a/WalletSdk/src/main/java/com/spruceid/wallet/sdk/BleSessionManager.kt b/WalletSdk/src/main/java/com/spruceid/wallet/sdk/BleSessionManager.kt index 2b06489..d684322 100644 --- a/WalletSdk/src/main/java/com/spruceid/wallet/sdk/BleSessionManager.kt +++ b/WalletSdk/src/main/java/com/spruceid/wallet/sdk/BleSessionManager.kt @@ -45,7 +45,8 @@ public class BLESessionManager { "BLE", "Central", sessionData.bleIdent.toByteArray(), - ::updateRequestData + ::updateRequestData, + callback ) this.callback.update(mapOf(Pair("engagingQRCode", sessionData.qrCodeUri))) } catch (e: Error) { @@ -87,7 +88,6 @@ public class BLESessionManager { val signatureData = submitSignature(this.sessionManager!!, signature) this.state = signatureData.state this.bleManager!!.send(signatureData.response) - this.callback.update(mapOf(Pair("success", ""))) } catch (e: Error) { Log.e("CredentialsViewModel.submitNamespaces", e.toString()) this.callback.update(mapOf(Pair("error", e.toString()))) diff --git a/WalletSdk/src/main/java/com/spruceid/wallet/sdk/GattClient.kt b/WalletSdk/src/main/java/com/spruceid/wallet/sdk/GattClient.kt index 4e89508..b6002a1 100644 --- a/WalletSdk/src/main/java/com/spruceid/wallet/sdk/GattClient.kt +++ b/WalletSdk/src/main/java/com/spruceid/wallet/sdk/GattClient.kt @@ -383,11 +383,6 @@ class GattClient(private var callback: GattClientCallback, val descriptor: BluetoothGattDescriptor = characteristicServer2Client!!.getDescriptor(clientCharacteristicConfigUuid) - if (descriptor == null) { - callback.onError(Error("Error getting Server2Client clientCharacteristicConfig desc.")) - return - } - descriptor.value = BluetoothGattDescriptor.ENABLE_NOTIFICATION_VALUE if (!gatt.writeDescriptor(descriptor)) { diff --git a/WalletSdk/src/main/java/com/spruceid/wallet/sdk/Transport.kt b/WalletSdk/src/main/java/com/spruceid/wallet/sdk/Transport.kt index d5199ca..a9e1362 100644 --- a/WalletSdk/src/main/java/com/spruceid/wallet/sdk/Transport.kt +++ b/WalletSdk/src/main/java/com/spruceid/wallet/sdk/Transport.kt @@ -22,6 +22,7 @@ class Transport(private var bluetoothManager: BluetoothManager) { deviceRetrievalOption: String, ident: ByteArray, updateRequestData: (data: ByteArray) -> Unit, + callback: BLESessionStateDelegate ) { /** @@ -41,6 +42,7 @@ class Transport(private var bluetoothManager: BluetoothManager) { deviceRetrievalOption, ident, updateRequestData, + callback ) } diff --git a/WalletSdk/src/main/java/com/spruceid/wallet/sdk/TransportBle.kt b/WalletSdk/src/main/java/com/spruceid/wallet/sdk/TransportBle.kt index e6bfd9a..3208237 100644 --- a/WalletSdk/src/main/java/com/spruceid/wallet/sdk/TransportBle.kt +++ b/WalletSdk/src/main/java/com/spruceid/wallet/sdk/TransportBle.kt @@ -30,6 +30,7 @@ class TransportBle(private var bluetoothManager: BluetoothManager) { application: String, serviceUUID: UUID, deviceRetrievalOption: String, ident: ByteArray, updateRequestData: (data: ByteArray) -> Unit, + callback: BLESessionStateDelegate ) { /** @@ -43,6 +44,7 @@ class TransportBle(private var bluetoothManager: BluetoothManager) { bluetoothManager, serviceUUID, updateRequestData, + callback, ) transportBleCentralClientHolder.connect(ident) } diff --git a/WalletSdk/src/main/java/com/spruceid/wallet/sdk/TransportBleCentralClientHolder.kt b/WalletSdk/src/main/java/com/spruceid/wallet/sdk/TransportBleCentralClientHolder.kt index 11fb3c7..914d2ec 100644 --- a/WalletSdk/src/main/java/com/spruceid/wallet/sdk/TransportBleCentralClientHolder.kt +++ b/WalletSdk/src/main/java/com/spruceid/wallet/sdk/TransportBleCentralClientHolder.kt @@ -17,6 +17,7 @@ class TransportBleCentralClientHolder( private var bluetoothManager: BluetoothManager, private var serviceUUID: UUID, private var updateRequestData: (data: ByteArray) -> Unit, + private var callback: BLESessionStateDelegate, ) : Activity() { private var context: Context = this @@ -94,6 +95,8 @@ class TransportBleCentralClientHolder( "TransportBleCentralClientHolder.gattClientCallback.onMessageSendProgress", "progress: $progress max: $max" ) + + callback.update(mapOf(Pair("progress", mapOf(Pair("curr", progress), Pair("max", max))))) } override fun onMessageReceived(data: ByteArray) {