|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.openintents.hardware.Sensors
public class Sensors
| Field Summary | |
|---|---|
static SensorSimulatorClient |
mClient
Client that communicates with the SensorSimulator application. |
static java.lang.String |
SENSOR_ACCELEROMETER
A constant describing an accelerometer. |
static java.lang.String |
SENSOR_COMPASS
A constant describing a compass. |
static java.lang.String |
SENSOR_ORIENTATION
A constant describing an orientation sensor. |
| Constructor Summary | |
|---|---|
Sensors()
|
|
| Method Summary | |
|---|---|
static void |
connectSimulator()
Connect to the Sensor Simulator. |
static void |
disableSensor(java.lang.String sensor)
Disables the given sensor for this VM. |
static void |
disconnectSimulator()
Disconnect from the Sensor Simulator. |
static void |
enableSensor(java.lang.String sensor)
Enables the given sensor for this VM. |
static int |
getNumSensorValues(java.lang.String sensor)
Returns the number of sensor values returned by the given sensor. |
static float |
getSensorUpdateRate(java.lang.String sensor)
Returns the current update rate for the given sensor, in updates per second. |
static float[] |
getSensorUpdateRates(java.lang.String sensor)
Returns a list of supported update rates for the given sensor, in updates per second. |
static java.lang.String[] |
getSupportedSensors()
Returns an array of Strings containing the supported sensor types. |
static void |
readSensor(java.lang.String sensor,
float[] sensorValues)
Reads the sensor indicated by sensorType, storing the vector of returned values into the entries of sensorValues. |
static void |
setSensorUpdateRate(java.lang.String sensor,
float updatesPerSecond)
Sets the desired update rate for the given sensor, in updates per second. |
static void |
unsetSensorUpdateRate(java.lang.String sensor)
Unsets the desired update rate for the given sensor. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String SENSOR_ACCELEROMETER
public static final java.lang.String SENSOR_COMPASS
public static final java.lang.String SENSOR_ORIENTATION
public static SensorSimulatorClient mClient
| Constructor Detail |
|---|
public Sensors()
| Method Detail |
|---|
public static void disableSensor(java.lang.String sensor)
sensor - the name of the sensor to be enabled
java.lang.IllegalArgumentException - if the sensor is not supportedpublic static void enableSensor(java.lang.String sensor)
sensor - the name of the sensor to be enabled
java.lang.IllegalArgumentException - if the sensor is not supportedpublic static int getNumSensorValues(java.lang.String sensor)
sensor - a string indicating the sensor type
java.lang.IllegalArgumentException - if the sensor is not supportedpublic static float getSensorUpdateRate(java.lang.String sensor)
sensor - the name of the sensor to be queried
java.lang.IllegalArgumentException - if the sensor is not supported
java.lang.IllegalStateException - if the sensor is not enabledpublic static float[] getSensorUpdateRates(java.lang.String sensor)
sensor - the name of the sensor to be queried
java.lang.IllegalArgumentException - if the sensor is not supportedpublic static java.lang.String[] getSupportedSensors()
public static void readSensor(java.lang.String sensor,
float[] sensorValues)
sensor - the name of the sensor to read fromsensorValues - an array of floats to hold the returned value(s)
java.lang.IllegalArgumentException - if the sensor is not supported
java.lang.IllegalStateException - if the sensor is not enabled
java.lang.NullPointerException - if sensorValues is null
java.lang.ArrayIndexOutOfBoundsException - if sensorValues has too few elements to hold the sensor values
public static void setSensorUpdateRate(java.lang.String sensor,
float updatesPerSecond)
sensor - the name of the sensor to be queriedupdatesPerSecond - the desired update rate for the sensor
java.lang.IllegalArgumentException - if the sensor is not supportedpublic static void unsetSensorUpdateRate(java.lang.String sensor)
sensor - the name of the sensor to be updated
java.lang.IllegalArgumentException - if the sensor is not supportedpublic static void connectSimulator()
public static void disconnectSimulator()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||