Class SensorManager


  • public class SensorManager
    extends java.lang.Object
    This 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 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 context
        callback - Callback of permission grant result
        Since:
        1.2.0
    • Method Detail

      • open

        public void open​(int type,
                         SensorDataListener listener)
                  throws java.io.IOException
        Connect with Moverio sensors. Connecting with Moverio sensors allows you to perform the various control tasks.
        Parameters:
        type - Sensor type
        listener - 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 type
        listener - 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