From e41fdfdd4baab0ae482261074911b7e6173a6513 Mon Sep 17 00:00:00 2001 From: Andrei Vereha Date: Mon, 6 Dec 2021 20:21:35 +0100 Subject: [PATCH] log when service not found --- .../pump/omnipod/dash/driver/comm/ServiceDiscoverer.kt | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/comm/ServiceDiscoverer.kt b/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/comm/ServiceDiscoverer.kt index 2fc1c42704..3297a80038 100644 --- a/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/comm/ServiceDiscoverer.kt +++ b/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/comm/ServiceDiscoverer.kt @@ -43,7 +43,12 @@ class ServiceDiscoverer( } logger.debug(LTag.PUMPBTCOMM, "Services discovered") val service = gatt.getService(SERVICE_UUID.toUuid()) - ?: throw ConnectException("Service not found: $SERVICE_UUID") + ?: run { + for (service in gatt.services) { + logger.debug(LTag.PUMPBTCOMM, "Found service: ${service.uuid}") + } + throw ConnectException("Service not found: $SERVICE_UUID") + } val cmdChar = service.getCharacteristic(CharacteristicType.CMD.uuid) ?: throw ConnectException("Characteristic not found: ${CharacteristicType.CMD.value}") val dataChar = service.getCharacteristic(CharacteristicType.DATA.uuid)