public abstract class SKAbstractSensor extends java.lang.Object implements SKSensorInterface
Modifier and Type | Field and Description |
---|---|
protected boolean |
isSensing |
protected Context |
mApplicationContext |
protected java.util.ArrayList<SKSensorDataListener> |
mSensorDataListeners |
protected SKSensorType |
mSensorType |
Modifier | Constructor and Description |
---|---|
protected |
SKAbstractSensor(Context context,
SKSensorType sensorType) |
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getSensorName() |
SKSensorType |
getSensorType() |
boolean |
isSensing() |
protected abstract boolean |
shouldPostSensorData(SKAbstractData data) |
protected void |
submitSensorData(SKAbstractData data) |
void |
subscribeSensorDataListener(SKSensorDataListener callback) |
void |
unsubscribeAllSensorDataListeners() |
void |
unsubscribeSensorDataListener(SKSensorDataListener callback) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
startSensing, stopSensing
protected final Context mApplicationContext
protected final SKSensorType mSensorType
protected boolean isSensing
protected java.util.ArrayList<SKSensorDataListener> mSensorDataListeners
protected SKAbstractSensor(Context context, SKSensorType sensorType)
public boolean isSensing()
isSensing
in interface SKSensorInterface
public SKSensorType getSensorType()
getSensorType
in interface SKSensorInterface
public java.lang.String getSensorName() throws SKException
SKException
public void subscribeSensorDataListener(SKSensorDataListener callback) throws SKException
subscribeSensorDataListener
in interface SKSensorInterface
SKException
public void unsubscribeSensorDataListener(SKSensorDataListener callback) throws SKException
unsubscribeSensorDataListener
in interface SKSensorInterface
SKException
public void unsubscribeAllSensorDataListeners() throws SKException
unsubscribeAllSensorDataListeners
in interface SKSensorInterface
SKException
protected abstract boolean shouldPostSensorData(SKAbstractData data)
protected void submitSensorData(SKAbstractData data)