public class FlicScanWizard
extends java.lang.Object
FlicManager.startScan()
method directly.
After the scan wizard starts, it will start scanning for public buttons which is currently unknown by the manager and connect to the first it finds.
If a private button is discovered, FlicScanWizard.Callback.onDiscovered(FlicScanWizard, String, int, boolean, int)
will be called with isPrivateMode set to true. Then a UI should be shown telling the user to hold down the button for 7 seconds.
If a button could be successfully connected and verified, it is passed on to the user in FlicScanWizard.Callback.onCompleted(FlicScanWizard, FlicButton)
.
If a button could not be connected and verified within reasonable time limit, FlicScanWizard.Callback.onFailed(FlicScanWizard, int)
is called.
Since this internally uses FlicManager.startScan()
and FlicManager.stopScan()
, please don't use these methods while using the scan wizard.
The following timeouts are used:
- Scanning for a button: 20 seconds
- Connecting to a found button: 20 seconds
- Waiting for a button to be verified after connected: 60 secondsModifier and Type | Class and Description |
---|---|
static class |
FlicScanWizard.Callback
FlicScanWizard Callback.
|
static class |
FlicScanWizard.ErrorCode
Error code for
FlicScanWizard failed event. |
Modifier and Type | Method and Description |
---|---|
void |
cancel()
Cancels the wizard.
|
void |
start(FlicScanWizard.Callback callback)
Start the scan wizard.
|
public void start(FlicScanWizard.Callback callback)
callback
- callback object for eventsFlicScanWizard}.
public void cancel()
FlicScanWizard.Callback.onFailed(FlicScanWizard, int)
will be called with FlicScanWizard.ErrorCode.CANCELLED
.
If the wizard is currently completing or stopping, this cancel request is dropped.