Skip to content

Commit 7d68a5d

Browse files
committed
Fixed issue related to Android 7 and old version of firefly vaporizer.
1 parent 9cd78d0 commit 7d68a5d

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

dfu/src/main/java/no/nordicsemi/android/dfu/BaseCustomDfuImpl.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,15 +141,19 @@ public void onCharacteristicWrite(final BluetoothGatt gatt, final BluetoothGattC
141141
buffer = new byte[available];
142142
final int size = mFirmwareStream.read(buffer);
143143
writePacket(gatt, characteristic, buffer, size);
144+
Thread.sleep(10); /* Hotfix. Fixed issue related to Android 7 and
145+
old version of firefly vaporizer */
144146
return;
145147
} catch (final HexFileValidationException e) {
146148
loge("Invalid HEX file");
147149
mError = DfuBaseService.ERROR_FILE_INVALID;
148150
} catch (final IOException e) {
149151
loge("Error while reading the input stream", e);
150152
mError = DfuBaseService.ERROR_FILE_IO_EXCEPTION;
151-
}
152-
} else {
153+
} catch (InterruptedException e) {
154+
loge("Sleep was interrupted after writing a packet",e);
155+
}
156+
} else {
153157
onPacketCharacteristicWrite(gatt, characteristic, status);
154158
}
155159
} else {

0 commit comments

Comments
 (0)