public final class FlicManager
extends java.lang.Object
init(Context, String, String)
with an app context, and then run getManager()
to get the singleton FlicManager object.Modifier and Type | Field and Description |
---|---|
static int |
BLUETOOTH_STATE_OFF
Indicates the local Bluetooth adapter is off.
|
static int |
BLUETOOTH_STATE_ON
Indicates the local Bluetooth adapter is on, and ready for use.
|
static int |
BLUETOOTH_STATE_TURNING_OFF
Indicates the local Bluetooth adapter is turning off.
|
static int |
BLUETOOTH_STATE_TURNING_ON
Indicates the local Bluetooth adapter is turning on.
|
Modifier and Type | Method and Description |
---|---|
void |
disconnectAll()
Disconnect all known buttons.
|
void |
forgetButton(FlicButton button)
Forget a button.
|
int |
getBluetoothState()
Get the current Bluetooth state.
|
FlicButton |
getButtonByBdAddr(java.lang.String bdAddr)
Get a button by its BD address.
|
java.util.List<FlicButton> |
getKnownButtons()
Get all previously known buttons.
|
static FlicManager |
getManager()
Get an instance of the
FlicManager . |
int |
getMinimumSignalStrength()
Get the minimum signal strength for a Bluetooth device to be found.
|
FlicScanWizard |
getScanWizard()
Get the FlicScanWizard singleton instance.
|
static void |
init(Context appContext,
java.lang.String appId,
java.lang.String appSecret)
Init the library.
|
boolean |
isButtonKnown(java.lang.String bdAddr)
Checks whether the device is known by the FlicManager.
|
boolean |
isScanning()
Is scanning.
|
void |
restartBluetooth()
Restarts bluetooth.
|
void |
setEventListener(FlicManagerListener listener)
Set the event listener for this instance of the Flic library.
|
void |
setMinimumSignalStrength(int minSignalStrength)
Set the minimum signal strength for a Bluetooth device to be found.
|
void |
startScan()
Start a scan for Flic buttons.
|
void |
stopScan()
Stop scanning for Flic buttons.
|
public static final int BLUETOOTH_STATE_OFF
public static final int BLUETOOTH_STATE_TURNING_ON
public static final int BLUETOOTH_STATE_ON
public static final int BLUETOOTH_STATE_TURNING_OFF
public static FlicManager getManager()
FlicManager
.
This instance is shared across the entire application.FlicManager
.public void setMinimumSignalStrength(int minSignalStrength)
public int getMinimumSignalStrength()
public static void init(Context appContext, java.lang.String appId, java.lang.String appSecret)
appContext
- a valid Android ContextappId
- app idappSecret
- app secretpublic void disconnectAll()
public void setEventListener(FlicManagerListener listener)
listener
- An event listener implementing the
FlicManagerListener
interface.public boolean isScanning()
public void startScan()
public void stopScan()
public FlicScanWizard getScanWizard()
public java.util.List<FlicButton> getKnownButtons()
public FlicButton getButtonByBdAddr(java.lang.String bdAddr)
bdAddr
- The BD address to lookuppublic boolean isButtonKnown(java.lang.String bdAddr)
bdAddr
- The BD address to lookuppublic void forgetButton(FlicButton button)
FlicButton
from the manager.button
- public void restartBluetooth()
public int getBluetoothState()
FlicManagerListener.onBluetoothStateChange(int)
.