Beispiel #1
0
 void PlatformStart(SensorSpeed sensorSpeed)
 {
     sensor              = DefaultSensor;
     sensor.Interval     = sensorSpeed.ToPlatform();
     sensor.DataUpdated += DataUpdated;
     sensor.Start();
 }
Beispiel #2
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);
            }
        }
Beispiel #3
0
 void PlatformStop()
 {
     sensor.DataUpdated -= DataUpdated;
     sensor.Stop();
     sensor = null;
 }