public final class FlicButton
extends java.lang.Object
FlicManager.initiateGrabButton(Activity)
, FlicManager.getButtonByDeviceId(String)
and FlicManager.getKnownButtons()
.Modifier and Type | Field and Description |
---|---|
static int |
BUTTON_CONNECTION_COMPLETED |
static int |
BUTTON_CONNECTION_STARTED |
static int |
BUTTON_DISCONNECTED |
Modifier and Type | Method and Description |
---|---|
void |
addFlicButtonCallback(FlicButtonCallback callback)
Add callbacks for this button.
|
java.lang.String |
getButtonId()
Get the MAC address of this button.
|
int |
getCallbackFlags()
Get the current callback flags.
|
java.lang.String |
getColor()
Get the color of this button.
|
int |
getConnectionStatus()
Get the connection status.
|
boolean |
readRemoteRSSI()
Read the current RSSI value of the button.
|
void |
removeAllFlicButtonCallbacks()
Remove all callbacks for this button.
|
void |
removeFlicButtonCallback(FlicButtonCallback callback)
Removes a callback for this button.
|
boolean |
setActiveMode(boolean activeMode)
Set the button to active mode.
|
boolean |
setFlicButtonCallbackFlags(int flicButtonCallbackFlags)
Set which button events to listen for.
|
java.lang.String |
toString() |
public static final int BUTTON_DISCONNECTED
public static final int BUTTON_CONNECTION_STARTED
public static final int BUTTON_CONNECTION_COMPLETED
public void addFlicButtonCallback(FlicButtonCallback callback)
FlicManager.forgetButton(FlicButton)
for this button.
Callbacks are not called during the manager is not in the initialized state.callback
- The callback objectpublic void removeFlicButtonCallback(FlicButtonCallback callback)
callback
- The callback objectpublic void removeAllFlicButtonCallbacks()
public boolean setFlicButtonCallbackFlags(int flicButtonCallbackFlags)
flicButtonCallbackFlags
- A bitwise-or'ed value of FlicButtonCallbackFlags
public int getCallbackFlags()
public java.lang.String getButtonId()
public int getConnectionStatus()
BUTTON_DISCONNECTED
, BUTTON_CONNECTION_STARTED
and BUTTON_CONNECTION_COMPLETED
public java.lang.String getColor()
public boolean readRemoteRSSI()
FlicButtonCallback.onReadRemoteRSSI(FlicButton, int, int)
will be called when a result is available.public boolean setActiveMode(boolean activeMode)
activeMode
- True if to use active mode. False to use passive mode.public java.lang.String toString()
toString
in class java.lang.Object