From 667cbe0b12bf9193cba22a319fa7d758bdc73b3e Mon Sep 17 00:00:00 2001 From: AdrianLxM Date: Sun, 28 Oct 2018 20:35:37 +0100 Subject: [PATCH] Get device name before setting up the callback In case the callback is very quick, the name might not have been set yet? --- .../androidaps/plugins/PumpDanaRS/services/BLEComm.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/PumpDanaRS/services/BLEComm.java b/app/src/main/java/info/nightscout/androidaps/plugins/PumpDanaRS/services/BLEComm.java index fcd65bbb1e..ae7d574d19 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/PumpDanaRS/services/BLEComm.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/PumpDanaRS/services/BLEComm.java @@ -144,9 +144,9 @@ public class BLEComm { if (L.isEnabled(L.PUMPBTCOMM)) log.debug("Trying to create a new connection from: " + from); + mBluetoothDeviceName = device.getName(); mBluetoothGatt = device.connectGatt(service.getApplicationContext(), false, mGattCallback); setCharacteristicNotification(getUARTReadBTGattChar(), true); - mBluetoothDeviceName = device.getName(); return true; }