Class SensorManager
- java.lang.Object
-
- com.epson.moverio.hardware.sensor.SensorManager
-
public class SensorManager extends java.lang.ObjectThis class controls the sensors equipped to Moverio. Sensor control is performed by acquiring SensorManager instances to perform the various control tasks.- Since:
- 1.0.0
-
-
Field Summary
Fields Modifier and Type Field Description static intSENSOR_DATA_ACCURACY_HIGHThis is a high-accuracy value.static intSENSOR_DATA_ACCURACY_LOWThis is a low-accuracy value and requires calibration with the surroundings.static intSENSOR_DATA_ACCURACY_MEDIUMThis is a medium-accuracy value and is possible to improve it by calibrating with the surroundings.static intSENSOR_DATA_NO_CONTACTThis value is unreliable because there is no contact with the item measured by this sensor.static intSENSOR_DATA_UNRELIABLEThis value is unreliable because this sensor requires calibration or it may not be possible to read in the value due to the surroundings.static intTYPE_ACCELEROMETERAccelerometer sensor.static intTYPE_ACCELEROMETER_UNCALIBRATEDUncalibrated accelerometer sensor.static intTYPE_GAME_ROTATION_VECTORGame rotation vector sensor.static intTYPE_GRAVITYGravity sensor.static intTYPE_GYROSCOPEGyroscopic sensor.static intTYPE_GYROSCOPE_UNCALIBRATEDUncalibrated gyroscope sensor.static intTYPE_HEADSET_TAP_DETECTHeadset tap detection sensor.static intTYPE_LIGHTAmbient light sensor.static intTYPE_LINEAR_ACCELERATIONLinear acceleration sensor.static intTYPE_MAGNETIC_FIELDGeomagnetic sensor.static intTYPE_MAGNETIC_FIELD_UNCALIBRATEDUncalibrated magnetic field sensor.static intTYPE_MOTION_DETECTMotion detection sensor.static intTYPE_ROTATION_VECTORRotation vector sensor.static intTYPE_STATIONARY_DETECTStationary detection sensor.
-
Constructor Summary
Constructors Constructor Description SensorManager(android.content.Context context)This is a SensorManager constructor.SensorManager(android.content.Context context, PermissionGrantResultCallback callback)This is a SensorManager constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose(int type, SensorDataListener listener)End the connection with Moverio sensors.voidclose(SensorDataListener listener)End the connection with all Moverio sensors registered with the listener.java.util.List<java.lang.Integer>getSupportedSensorList()Get a list of controllable sensor types.booleanisSensorManagerSupported()Check if the MOVERIO connected to the host device supports SensorManager functions.voidopen(int type, SensorDataListener listener)Connect with Moverio sensors.voidrelease()Release resources for using Moverio sensor.
-
-
-
Field Detail
-
TYPE_ACCELEROMETER
public static final int TYPE_ACCELEROMETER
Accelerometer sensor.- Since:
- 1.0.0
- See Also:
- Constant Field Values
-
TYPE_MAGNETIC_FIELD
public static final int TYPE_MAGNETIC_FIELD
Geomagnetic sensor.- Since:
- 1.0.0
- See Also:
- Constant Field Values
-
TYPE_GYROSCOPE
public static final int TYPE_GYROSCOPE
Gyroscopic sensor.- Since:
- 1.0.0
- See Also:
- Constant Field Values
-
TYPE_LIGHT
public static final int TYPE_LIGHT
Ambient light sensor.- Since:
- 1.0.0
- See Also:
- Constant Field Values
-
TYPE_GRAVITY
public static final int TYPE_GRAVITY
Gravity sensor.- Since:
- 1.0.0
- See Also:
- Constant Field Values
-
TYPE_LINEAR_ACCELERATION
public static final int TYPE_LINEAR_ACCELERATION
Linear acceleration sensor.- Since:
- 1.0.0
- See Also:
- Constant Field Values
-
TYPE_ROTATION_VECTOR
public static final int TYPE_ROTATION_VECTOR
Rotation vector sensor.- Since:
- 1.0.0
- See Also:
- Constant Field Values
-
TYPE_MAGNETIC_FIELD_UNCALIBRATED
public static final int TYPE_MAGNETIC_FIELD_UNCALIBRATED
Uncalibrated magnetic field sensor.- Since:
- 1.1.0
- See Also:
- Constant Field Values
-
TYPE_GAME_ROTATION_VECTOR
public static final int TYPE_GAME_ROTATION_VECTOR
Game rotation vector sensor.- Since:
- 1.1.0
- See Also:
- Constant Field Values
-
TYPE_GYROSCOPE_UNCALIBRATED
public static final int TYPE_GYROSCOPE_UNCALIBRATED
Uncalibrated gyroscope sensor.- Since:
- 1.1.0
- See Also:
- Constant Field Values
-
TYPE_STATIONARY_DETECT
public static final int TYPE_STATIONARY_DETECT
Stationary detection sensor.- Since:
- 1.1.0
- See Also:
- Constant Field Values
-
TYPE_MOTION_DETECT
public static final int TYPE_MOTION_DETECT
Motion detection sensor.- Since:
- 1.1.0
- See Also:
- Constant Field Values
-
TYPE_ACCELEROMETER_UNCALIBRATED
public static final int TYPE_ACCELEROMETER_UNCALIBRATED
Uncalibrated accelerometer sensor.- Since:
- 1.1.0
- See Also:
- Constant Field Values
-
TYPE_HEADSET_TAP_DETECT
public static final int TYPE_HEADSET_TAP_DETECT
Headset tap detection sensor.- Since:
- 1.1.0
- See Also:
- Constant Field Values
-
SENSOR_DATA_NO_CONTACT
public static final int SENSOR_DATA_NO_CONTACT
This value is unreliable because there is no contact with the item measured by this sensor.- Since:
- 1.0.0
- See Also:
- Constant Field Values
-
SENSOR_DATA_UNRELIABLE
public static final int SENSOR_DATA_UNRELIABLE
This value is unreliable because this sensor requires calibration or it may not be possible to read in the value due to the surroundings.- Since:
- 1.0.0
- See Also:
- Constant Field Values
-
SENSOR_DATA_ACCURACY_LOW
public static final int SENSOR_DATA_ACCURACY_LOW
This is a low-accuracy value and requires calibration with the surroundings.- Since:
- 1.0.0
- See Also:
- Constant Field Values
-
SENSOR_DATA_ACCURACY_MEDIUM
public static final int SENSOR_DATA_ACCURACY_MEDIUM
This is a medium-accuracy value and is possible to improve it by calibrating with the surroundings.- Since:
- 1.0.0
- See Also:
- Constant Field Values
-
SENSOR_DATA_ACCURACY_HIGH
public static final int SENSOR_DATA_ACCURACY_HIGH
This is a high-accuracy value.- Since:
- 1.0.0
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
SensorManager
public SensorManager(android.content.Context context)
This is a SensorManager constructor.- Parameters:
context- Activity context- Since:
- 1.0.0
-
SensorManager
public SensorManager(android.content.Context context, PermissionGrantResultCallback callback)This is a SensorManager constructor.- Parameters:
context- Activity contextcallback- Callback of permission grant result- Since:
- 1.2.0
-
-
Method Detail
-
open
public void open(int type, SensorDataListener listener) throws java.io.IOExceptionConnect with Moverio sensors. Connecting with Moverio sensors allows you to perform the various control tasks.- Parameters:
type- Sensor typelistener- Sensor data listener- Throws:
java.io.IOException- Exceptions such as disconnected Moverio and not supported sensor type- Since:
- 1.0.0
-
close
public void close(SensorDataListener listener)
End the connection with all Moverio sensors registered with the listener.- Parameters:
listener- Sensor data listener- Since:
- 1.0.0
-
close
public void close(int type, SensorDataListener listener)End the connection with Moverio sensors.- Parameters:
type- Sensor typelistener- Sensor data listener- Since:
- 1.1.0
-
getSupportedSensorList
public java.util.List<java.lang.Integer> getSupportedSensorList()
Get a list of controllable sensor types. If isSensorManagerSupported of SensorManager returns false, -1 is returned.- Returns:
- true: success, false: fail
- Since:
- 1.1.0
-
release
public void release()
Release resources for using Moverio sensor. If you finish using sensor, you must execute SensorManager#release.- Since:
- 1.0.2
-
isSensorManagerSupported
public boolean isSensorManagerSupported()
Check if the MOVERIO connected to the host device supports SensorManager functions. Returns supports SensorManager when acquiring true is supported and false when it is not supported. Returns false even if MOVERIO is not connected to the host device.- Returns:
- true: success, false: fail
- Since:
- 1.1.0
-
-