KallistoActuatorManager¶
-
public class
KallistoActuatorManagerextends KallistoManager¶
Methods¶
disconnect¶
-
public void
disconnect()¶ Disconnects from the
Kallisto Service. Will trigger all cleanup routines in the service.Always call it when done with the service.
get¶
-
public Object
get(KallistoActuator actuator, Map<String, Object> parameters)¶ Gets the state for the given
actuator.Should only be used for custom actuators not supported by the API that need special parameters or return special states.
Blocking function.
- Parameters
actuator – The
actuatorto set.parameters – The actuator parameters.
- Returns
A generic object or null on error. How to parse it depends of the actuator.
getActuatorList¶
-
public List<KallistoActuator>
getActuatorList(int type)¶ Use this method to get the list of available actuators of a certain type.
Make multiple calls to get actuators of different types or use
KallistoActuator.TYPE_ALLto get all the actuators.
getDefaultActuator¶
-
public KallistoActuator
getDefaultActuator(int type)¶ Use this method to get the default actuator for a given type.
Beware that the actuator will be null if not found.
getInstance¶
-
public static KallistoActuatorManager
getInstance(Context context)¶ Get a instance of this manager. Will create it if it is null.
- Parameters
context – A valid context.
getInstance¶
-
public static KallistoActuatorManager
getInstance(Context context, BleDeviceManagerConfiguration bleConfiguration, LoggerConfiguration loggerConfiguration, ScannerConfiguration scannerConfiguration, ScannerFilter scannerFilter, List<ActuatorProvider> customActuatorProviders)¶ Get a instance of this manager. Will create it if it is null.
- Parameters
context – A valid context.
bleConfiguration – The BLE configuration. Can be
null, the default will be used.loggerConfiguration – The logger configuration. Can be
null, the default will be used.scannerConfiguration – The scanner starting configuration. Can be
null, the default will be used.scannerFilter – The scanner filter configuration. Can be
null, the default will be used.customActuatorProviders – A list of custom actuator providers. Can be
nullfor no custom providers.
getLed¶
-
public KallistoActuator.LedState
getLed(KallistoActuator actuator)¶ Gets the state for the given LED.
Blocking function.
- Parameters
actuator – The
actuatorto get.
- Returns
KallistoActuator.LedStatestate or null if something went wrong.
set¶
-
public boolean
set(KallistoActuator actuator, Map<String, Object> parameters)¶ Sets a new state for the given
actuator.Should only be used for custom actuators not supported by the API that need special parameters.
Blocking function.
- Parameters
actuator – The
actuatorto set.parameters – The actuator parameters.
- Returns
trueif the actuator is supported and successfully set.
setLed¶
-
public boolean
setLed(KallistoActuator actuator, KallistoActuator.LedState state)¶ Sets a new state for the given LED.
Blocking function.
- Parameters
actuator – The
actuatorto set.state – The
KallistoActuator.LedStateto set.
- Returns
trueif the actuator is supported and successfully set.