Skip to content

Commit 3a6b799

Browse files
committed
Adding delay before service discovery on Service Change indication
1 parent fc18853 commit 3a6b799

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

lib/dfu/src/main/java/no/nordicsemi/android/dfu/DfuBaseService.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -981,7 +981,9 @@ public void onServiceChanged(@NonNull final BluetoothGatt gatt) {
981981
logi("Service Changed indication received");
982982
sendLogBroadcast(LOG_LEVEL_INFO, "Service Changed indication received");
983983
mConnectionState = STATE_CONNECTED;
984-
discoverServices(gatt);
984+
// Apparently, adding a delay here solves a connectivity issue for micro:bit v1.
985+
// See: https://github.com/NordicSemiconductor/Android-DFU-Library/issues/500
986+
mHandler.postDelayed(() -> discoverServices(gatt), 1000); // minimum 550 ms
985987
}
986988

987989
/**

0 commit comments

Comments
 (0)