public interface SensingKitLibInterface
Modifier and Type | Method and Description |
---|---|
void |
deregisterSensor(SKSensorType sensorType)
Deregisters a sensor from the library.
|
long |
getCurrentTimeMillis()
Get the current time in milliseconds (the difference between the current time and midnight, January 1, 1970 UTC).
|
SKSensorData |
getDataFromSensor(SKSensorType sensorType)
One Shot Sensing
|
long |
getNanoTime()
Get the current time in nanoseconds (the current value of the running Java Virtual Machine's high-resolution time source)
|
boolean |
isSensorRegistered(SKSensorType sensorType)
A Boolean value that indicates whether the sensor is registered.
|
boolean |
isSensorSensing(SKSensorType sensorType)
A Boolean value that indicates whether the sensor is currently sensing.
|
void |
registerSensor(SKSensorType sensorType)
Initializes and registers a sensor into the library with a default sensor configuration.
|
void |
startContinuousSensingWithAllRegisteredSensors()
Starts continuous sensing with all registered sensors.
|
void |
startContinuousSensingWithSensor(SKSensorType sensorType)
Starts continuous sensing with the specified sensor.
|
void |
stopContinuousSensingWithAllRegisteredSensors()
Starts continuous sensing with all registered sensors.
|
void |
stopContinuousSensingWithSensor(SKSensorType sensorType)
Stops continuous sensing with the specified sensor.
|
void |
subscribeSensorDataListener(SKSensorType sensorType,
SKSensorDataListener dataListener)
Subscribes for sensor updates using a specified event listener.
|
void |
unsubscribeAllSensorDataListeners(SKSensorType sensorType)
Unsubscribes all event listenerss.
|
void |
unsubscribeSensorDataListener(SKSensorType sensorType,
SKSensorDataListener dataListener)
Unsubscribes an event listener.
|
void registerSensor(SKSensorType sensorType) throws SKException
sensorType
- The type of the sensor that will be initialized and registered in the library.SKException
void deregisterSensor(SKSensorType sensorType) throws SKException
sensorType
- The type of the sensor that will be deregistered.SKException
boolean isSensorRegistered(SKSensorType sensorType) throws SKException
sensorType
- The type of the sensor that will be checked.SKException
SKSensorData getDataFromSensor(SKSensorType sensorType) throws SKException
SKException
void subscribeSensorDataListener(SKSensorType sensorType, SKSensorDataListener dataListener) throws SKException
sensorType
- The type of the sensor that the data handler will be subscribed to.dataListener
- An event listener that is invoked with each update to handle new sensor data. The block must conform to the SKSensorDataListener type.SKException
void unsubscribeSensorDataListener(SKSensorType sensorType, SKSensorDataListener dataListener) throws SKException
sensorType
- The type of the sensor for which the event listener will be unsubscribed.dataListener
- The event listener to be unsubscribed.SKException
void unsubscribeAllSensorDataListeners(SKSensorType sensorType) throws SKException
sensorType
- The type of the sensor for which the event listener will be unsubscribed.SKException
void startContinuousSensingWithSensor(SKSensorType sensorType) throws SKException
sensorType
- The type of the sensor that will be started.SKException
void stopContinuousSensingWithSensor(SKSensorType sensorType) throws SKException
sensorType
- The type of the sensor that will be stopped.SKException
void startContinuousSensingWithAllRegisteredSensors() throws SKException
SKException
void stopContinuousSensingWithAllRegisteredSensors() throws SKException
SKException
boolean isSensorSensing(SKSensorType sensorType) throws SKException
sensorType
- The type of the sensor that will be checked.SKException
long getCurrentTimeMillis()
long getNanoTime()