Skip to content

BTAdapter: clear discovery state on reset - #7

Open
vkolotov wants to merge 1 commit into
sgothel:masterfrom
vkolotov:vkolotov/clear-discovery-state-on-reset
Open

BTAdapter: clear discovery state on reset#7
vkolotov wants to merge 1 commit into
sgothel:masterfrom
vkolotov:vkolotov/clear-discovery-state-on-reset

Conversation

@vkolotov

Copy link
Copy Markdown
Contributor

reset() takes the controller down and back up, which clears
HCIHandler::currentScanType, but BTAdapter's own currentMetaScanType and
discovery_policy were left untouched. A discovery session that was running
before the reset therefore appeared still active afterwards, while the controller
was no longer scanning.

  • Stop discovery_service and set DiscoveryPolicy::AUTO_OFF before the reset,
    so the keep-alive worker cannot race it.
  • Clear currentMetaScanType and emit discoveringChanged once the controller
    reached the reset state, so listeners observe the implicit stop.
  • Restore the previous policy if the controller did not reset, leaving a live
    discovery contract intact.
  • DBTAdapter.reset() clears the Java-side scan cache for the same reason.

A new discovery session must be started explicitly after a reset.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant