Skip to content

Commit

Permalink
Issue #38: Wrong state of internal discovery flag if start/stop disco…
Browse files Browse the repository at this point in the history
…very throwed an exception
  • Loading branch information
hypfvieh committed Jul 10, 2020
1 parent 9d071a8 commit d691dcd
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -270,9 +270,10 @@ public String getModAlias() {
public boolean startDiscovery() {
if (!isDiscovering()) {
try {
adapter.StartDiscovery();
internalDiscover = true;
adapter.StartDiscovery();
} catch (Exception _ex) {
internalDiscover = false;
return false;
}
}
Expand All @@ -287,10 +288,11 @@ public boolean startDiscovery() {
public boolean stopDiscovery() {
if (isDiscovering()) {
try {
adapter.StopDiscovery();
internalDiscover = false;
adapter.StopDiscovery();
return true;
} catch (BluezNotReadyException | BluezFailedException | BluezNotAuthorizedException _ex) {
internalDiscover = false;
return false;
}
}
Expand Down

0 comments on commit d691dcd

Please sign in to comment.