Skip to content

Commit 1f73516

Browse files
committed
Update plugin
Refer here: randdusing#707
1 parent 9cb5ea2 commit 1f73516

File tree

1 file changed

+3
-9
lines changed

1 file changed

+3
-9
lines changed

src/android/BluetoothLePlugin.java

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3967,15 +3967,6 @@ public void onConnectionStateChange(BluetoothGatt gatt, int status, int newState
39673967
return;
39683968
}
39693969

3970-
//Check for queued operations in progress on this device
3971-
if (newState == BluetoothProfile.STATE_DISCONNECTED) {
3972-
LinkedList<Operation> queue = (LinkedList<Operation>) connection.get(keyQueue);
3973-
Operation operation = queue.peek();
3974-
if (operation != null) {
3975-
queueRemove(connection);
3976-
}
3977-
}
3978-
39793970
CallbackContext callbackContext = (CallbackContext) connection.get(operationConnect);
39803971

39813972
JSONObject returnObj = new JSONObject();
@@ -3989,6 +3980,9 @@ public void onConnectionStateChange(BluetoothGatt gatt, int status, int newState
39893980
connection.put(keyPeripheral, gatt);
39903981
connection.put(keyState, BluetoothProfile.STATE_DISCONNECTED);
39913982
connection.put(keyDiscoveredState, STATE_UNDISCOVERED);
3983+
3984+
LinkedList<Operation> queue = new LinkedList<Operation>();
3985+
connection.put(keyQueue, queue);
39923986

39933987
connections.put(device.getAddress(), connection);
39943988

0 commit comments

Comments
 (0)