KallistoActuator¶
-
public abstract class
KallistoActuator¶ Class representing an actuator contained in a Kallisto device.
A developer can add his own actuators by implementing this class and providing his actuator with a
de.sensry.kallisto.hardware.hal.actuators.ActuatorProviderinterface.
Fields¶
KEY_LED_MODE¶
KEY_LED_TIME_OFF¶
-
public static final String
KEY_LED_TIME_OFF¶ Used to configure LED on time. Only used for
LedMode.LED_BLINKandLedMode.LED_FADE.
KEY_LED_TIME_ON¶
-
public static final String
KEY_LED_TIME_ON¶ Used to configure LED on time. Only used for
LedMode.LED_BLINKandLedMode.LED_FADE.
Constructors¶
KallistoActuator¶
-
protected
KallistoActuator(String name, String vendor, int version, int type, String stringType, int identifier, float power, String hardwareAddress)¶ KallistoActuator constructor.
- Parameters
name – This actuator name.
vendor – This actuator vendor.
version – This actuator version.
type – This actuator type.
stringType – A string describing the actuator type.
identifier – An identifier for this actuator instance. Can be used to uniquely identify a actuator in a case where more than one instance of the same actuator exists in a
Kallistodevice. For example, if the device has two accelerometers, one in position X and another in position Y, one should have the identifier 0 and the other 1.power – Standard power consumption. Should report how much power the actuator consumes, in mA, if it is enabled in a standard use-case.
hardwareAddress – The MAC address of the
Kallistodevice that contains this actuator.
Methods¶
close¶
get¶
-
protected abstract Object
get(Map<String, Object> parameters)¶ Called when the actuator should report its’ state.
- Parameters
parameters – Map of abstract parameters. It is not by any actuator of API, for now.
- Throws
BleException – If something went wrong with the BLE communication.
- Returns
A generic object or null on error. How to parse it depends of the actuator.
getAddress¶
getCharacteristics¶
getIdentifyingHash¶
-
public final long
getIdentifyingHash()¶ Retrieve a 64-bit hash that identifies the actuator according to its hardware address, actuator type and identifier.
- Returns
The identifying hash
onDisconnection¶
onLinkLoss¶
onLinkRecovered¶
-
protected abstract void
onLinkRecovered()¶ Called when the
Kallistodevice that contains this actuator recovers from Link Loss mode.The actuator should restore the state saved in
onLinkLoss(). For example, if it was enabled, it should set the previous state.
set¶
-
protected abstract boolean
set(Map<String, Object> parameters)¶ Called when the actuator should change state.
The available parameters are:
KEY_LED_MODE- the object should be parsed as aLedMode;KEY_LED_TIME_OFF- the object should be parsed as an integer where the time off delay is passed in milliseconds;KEY_LED_TIME_ON- the object should be parsed as an integer where the time off delay is passed in milliseconds;
- Parameters
parameters – Map of abstract parameters. The map follows a key/value structure where the key determines how the object should be parsed.
- Throws
BleException – If something went wrong with the BLE communication.
- Returns
trueIf everything went ok.