Example #1
0
        internal static Sensor GetDefaultSensor(SensorType type)
        {
            switch (type)
            {
            case SensorType.Accelerometer:
                if (Platform.accelerometer == null)
                {
                    Platform.accelerometer = new TizenAccelerometer();
                }
                return(Platform.accelerometer);

            case SensorType.Barometer:
                if (Platform.barometer == null)
                {
                    Platform.barometer = new TizenBarometer();
                }
                return(Platform.barometer);

            case SensorType.Compass:
                if (Platform.compass == null)
                {
                    Platform.compass = new TizenCompass();
                }
                return(Platform.compass);

            case SensorType.Gyroscope:
                if (Platform.gyroscope == null)
                {
                    Platform.gyroscope = new TizenGyroscope();
                }
                return(Platform.gyroscope);

            case SensorType.Magnetometer:
                if (Platform.magnetometer == null)
                {
                    Platform.magnetometer = new TizenMagnetometer();
                }
                return(Platform.magnetometer);

            case SensorType.OrientationSensor:
                if (Platform.orientationSensor == null)
                {
                    Platform.orientationSensor = new TizenOrientationSensor();
                }
                return(Platform.orientationSensor);

            default:
                return(null);
            }
        }
Example #2
0
 private Accelerometer(Tizen.Sensor.Accelerometer accelerometer)
 {
     _accelerometer = accelerometer;
 }