|
Mobile Sensor API Version 1.2 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface SampleRateControl
A SampleRateControl
object is an example of
a general control used to set the sample rate of the sensor.
A controllable sensor that can offer the possibility to
control the sample rate may provide a SampleRateControl
via its getControl()
and getControls()
methods. If the sample rate control is provided, it MUST
inherit this interface. For this control to be implementable,
the sensor must provide multiple sample rates.
If this control is provided the implementation
MUST also define the property SensorInfo.PROP_MAX_RATE
.
The execute()
method is used to set the default
sample rate.
Method Summary | |
---|---|
float |
getSampleRate()
Returns the current sample rate. |
float[] |
getSampleRates()
Returns the sample rates of the sensor. |
void |
setSampleRate(float sampleRate)
Sets the sample rate of the sensor. |
Methods inherited from interface javax.microedition.sensor.control.Control |
---|
execute, getName |
Method Detail |
---|
float getSampleRate()
Returns the current sample rate.
float[] getSampleRates()
Returns the sample rates of the sensor.
SensorInfo.PROP_MAX_RATE
], a zero-length array
is returned.
void setSampleRate(float sampleRate)
Sets the sample rate of the sensor.
The maximum sample rate can be
read from a SensorInfo
object with
the method sensorInfo.getProperty(SensorInfo.PROP_MAX_RATE)
.
The PROP_MAX_RATE
MUST be defined if this
control is provided.
The value is not valid if:
getSampleRates()
returns 0-length array and
the value is <= 0, or > PROP_MAX_RATE
getSampleRates()
returns more than one
rate and the given value is none of them
sampleRate
- the sample rate (Hz) to be set. Trailing zeros are
ignored: 25.0 Hz and 25 Hz are the same rate.
No roundings are performed: 25.01 Hz and 25 Hz are different
rates.
java.lang.IllegalArgumentException
- if the sample rate
is not a valid value. * @throws IllegalStateException if the sample rate cannot be set at the moment
|
Mobile Sensor API Version 1.2 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |