KallistoActuatorManager

public class KallistoActuatorManager extends 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 actuator to 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_ALL to get all the actuators.

Parameters
  • type – The type of the desired actuators. See actuator class for the available types.

Returns

A list with all the actuators available of the requested type.

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.

Parameters
  • type – The type of the desired actuator. See actuator class for the available types.

Returns

A actuator of the passed type or 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 null for no custom providers.

getLed

public KallistoActuator.LedState getLed(KallistoActuator actuator)

Gets the state for the given LED.

Blocking function.

Parameters
Returns

KallistoActuator.LedState state 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 actuator to set.

  • parameters – The actuator parameters.

Returns

true if 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
Returns

true if the actuator is supported and successfully set.