Skip to content

Commit

Permalink
Merge pull request #558 from CptFabulouso/patch-1
Browse files Browse the repository at this point in the history
Fix multiple callback invocation
  • Loading branch information
marcosinigaglia authored Oct 2, 2019
2 parents f81d557 + 0da6d45 commit 7e6ce54
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions android/src/main/java/it/innove/BleManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -209,8 +209,10 @@ public void createBond(String peripheralUUID, Callback callback) {
Peripheral peripheral = retrieveOrCreatePeripheral(peripheralUUID);
if (peripheral == null) {
callback.invoke("Invalid peripheral uuid");
return;
} else if (bondRequest != null) {
callback.invoke("Only allow one bond request at a time");
return;
} else if (peripheral.getDevice().createBond()) {
Log.d(LOG_TAG, "Request bond successful for: " + peripheralUUID);
bondRequest = new BondRequest(peripheralUUID, callback); // request bond success, waiting for boradcast
Expand Down

0 comments on commit 7e6ce54

Please sign in to comment.