csapi-sensor: set default value to properties
authorkibak.yoon <kibak.yoon@samsung.com>
Tue, 25 Oct 2016 02:44:28 +0000 (11:44 +0900)
committerkibak.yoon <kibak.yoon@samsung.com>
Tue, 25 Oct 2016 05:50:19 +0000 (14:50 +0900)
- add Unknown state(-1) to enum
- change count type from int to uint

Change-Id: Iaf917ccd2532573bf313ed1aebcd48e76302c894
Signed-off-by: kibak.yoon <kibak.yoon@samsung.com>
29 files changed:
src/Tizen.Sensor/Tizen.Sensor/EventArgs/PedometerDataUpdatedEventArgs.cs
src/Tizen.Sensor/Tizen.Sensor/Plugins/Accelerometer.cs
src/Tizen.Sensor/Tizen.Sensor/Plugins/FaceDownGestureDetector.cs
src/Tizen.Sensor/Tizen.Sensor/Plugins/GravitySensor.cs
src/Tizen.Sensor/Tizen.Sensor/Plugins/Gyroscope.cs
src/Tizen.Sensor/Tizen.Sensor/Plugins/GyroscopeRotationVectorSensor.cs
src/Tizen.Sensor/Tizen.Sensor/Plugins/HeartRateMonitor.cs
src/Tizen.Sensor/Tizen.Sensor/Plugins/HumiditySensor.cs
src/Tizen.Sensor/Tizen.Sensor/Plugins/InVehicleActivityDetector.cs
src/Tizen.Sensor/Tizen.Sensor/Plugins/LightSensor.cs
src/Tizen.Sensor/Tizen.Sensor/Plugins/LinearAccelerationSensor.cs
src/Tizen.Sensor/Tizen.Sensor/Plugins/Magnetometer.cs
src/Tizen.Sensor/Tizen.Sensor/Plugins/MagnetometerRotationVectorSensor.cs
src/Tizen.Sensor/Tizen.Sensor/Plugins/OrientationSensor.cs
src/Tizen.Sensor/Tizen.Sensor/Plugins/Pedometer.cs
src/Tizen.Sensor/Tizen.Sensor/Plugins/PickUpGestureDetector.cs
src/Tizen.Sensor/Tizen.Sensor/Plugins/PressureSensor.cs
src/Tizen.Sensor/Tizen.Sensor/Plugins/ProximitySensor.cs
src/Tizen.Sensor/Tizen.Sensor/Plugins/RotationVectorSensor.cs
src/Tizen.Sensor/Tizen.Sensor/Plugins/RunningActivityDetector.cs
src/Tizen.Sensor/Tizen.Sensor/Plugins/SleepMonitor.cs
src/Tizen.Sensor/Tizen.Sensor/Plugins/StationaryActivityDetector.cs
src/Tizen.Sensor/Tizen.Sensor/Plugins/TemperatureSensor.cs
src/Tizen.Sensor/Tizen.Sensor/Plugins/UltravioletSensor.cs
src/Tizen.Sensor/Tizen.Sensor/Plugins/UncalibratedGyroscope.cs
src/Tizen.Sensor/Tizen.Sensor/Plugins/UncalibratedMagnetometer.cs
src/Tizen.Sensor/Tizen.Sensor/Plugins/WalkingActivityDetector.cs
src/Tizen.Sensor/Tizen.Sensor/Plugins/WristUpGestureDetector.cs
src/Tizen.Sensor/Tizen.Sensor/SensorEnumerations.cs

index c767740..656232b 100644 (file)
@@ -17,9 +17,9 @@ namespace Tizen.Sensor
     {
         internal PedometerDataUpdatedEventArgs(float[] values)
         {
-            StepCount = (int) values[0];
-            WalkStepCount = (int) values[1];
-            RunStepCount = (int) values[2];
+            StepCount = (uint) values[0];
+            WalkStepCount = (uint) values[1];
+            RunStepCount = (uint) values[2];
             MovingDistance = values[3];
             CalorieBurned = values[4];
             LastSpeed = values[5];
@@ -30,17 +30,17 @@ namespace Tizen.Sensor
         /// <summary>
         /// Gets the step count
         /// </summary>
-        public int StepCount { get; private set; }
+        public uint StepCount { get; private set; }
 
         /// <summary>
         /// Gets the walking step count
         /// </summary>
-        public int WalkStepCount { get; private set; }
+        public uint WalkStepCount { get; private set; }
 
         /// <summary>
         /// Gets the running step count
         /// </summary>
-        public int RunStepCount { get; private set; }
+        public uint RunStepCount { get; private set; }
 
         /// <summary>
         /// Gets the moving distance
@@ -67,4 +67,4 @@ namespace Tizen.Sensor
         /// </summary>
         public PedometerState LastStepStatus { get; private set; }
     }
-}
\ No newline at end of file
+}
index 4a32f9a..7e5c23f 100644 (file)
@@ -19,17 +19,17 @@ namespace Tizen.Sensor
         /// <summary>
         /// Gets the X component of the acceleration.
         /// </summary>
-        public float X { get; private set; }
+        public float X { get; private set; } = float.MinValue;
 
         /// <summary>
         /// Gets the Y component of the acceleration.
         /// </summary>
-        public float Y { get; private set; }
+        public float Y { get; private set; } = float.MinValue;
 
         /// <summary>
         /// Gets the Z component of the acceleration.
         /// </summary>
-        public float Z { get; private set; }
+        public float Z { get; private set; } = float.MinValue;
 
         /// <summary>
         /// Returns true or false based on whether accelerometer sensor is supported by device.
index e29d6b7..4bfc32e 100644 (file)
@@ -20,7 +20,7 @@ namespace Tizen.Sensor
         /// <summary>
         /// Gets the state of the face down gesture.
         /// </summary>
-        public DetectorState FaceDown { get; private set; }
+        public DetectorState FaceDown { get; private set; } = DetectorState.Unknown;
 
         /// <summary>
         /// Returns true or false based on whether face down gesture detector is supported by device.
index 44b942b..e7812c5 100644 (file)
@@ -21,17 +21,17 @@ namespace Tizen.Sensor
         /// <summary>
         /// Gets the X component of the gravity.
         /// </summary>
-        public float X { get; private set; }
+        public float X { get; private set; } = float.MinValue;
 
         /// <summary>
         /// Gets the Y component of the gravity.
         /// </summary>
-        public float Y { get; private set; }
+        public float Y { get; private set; } = float.MinValue;
 
         /// <summary>
         /// Gets the Z component of the gravity.
         /// </summary>
-        public float Z { get; private set; }
+        public float Z { get; private set; } = float.MinValue;
 
         /// <summary>
         /// Returns true or false based on whether gravity sensor is supported by device.
index 10d7953..9d29073 100644 (file)
@@ -20,17 +20,17 @@ namespace Tizen.Sensor
         /// <summary>
         /// Gets the X component of the acceleration.
         /// </summary>
-        public float X { get; private set; }
+        public float X { get; private set; } = float.MinValue;
 
         /// <summary>
         /// Gets the Y component of the acceleration.
         /// </summary>
-        public float Y { get; private set; }
+        public float Y { get; private set; } = float.MinValue;
 
         /// <summary>
         /// Gets the Z component of the acceleration.
         /// </summary>
-        public float Z { get; private set; }
+        public float Z { get; private set; } = float.MinValue;
 
         /// <summary>
         /// Returns true or false based on whether gyroscope sensor is supported by device.
index 4bd07ab..5d948e1 100644 (file)
@@ -20,22 +20,22 @@ namespace Tizen.Sensor
         /// <summary>
         /// Gets the X component of the gyroscope rotation vector.
         /// </summary>
-        public float X { get; private set; }
+        public float X { get; private set; } = float.MinValue;
 
         /// <summary>
         /// Gets the Y component of the gyroscope rotation vector.
         /// </summary>
-        public float Y { get; private set; }
+        public float Y { get; private set; } = float.MinValue;
 
         /// <summary>
         /// Gets the Z component of the gyroscope rotation vector.
         /// </summary>
-        public float Z { get; private set; }
+        public float Z { get; private set; } = float.MinValue;
 
         /// <summary>
         /// Gets the W component of the gyroscope rotation vector.
         /// </summary>
-        public float W { get; private set; }
+        public float W { get; private set; } = float.MinValue;
 
         /// <summary>
         /// Gets the Accuracy of the gyroscope rotation vector data.
index 54d6fb5..3ec478d 100644 (file)
@@ -20,7 +20,7 @@ namespace Tizen.Sensor
         /// <summary>
         /// Gets the value of the heart rate monitor.
         /// </summary>
-        public int HeartRate { get; private set; }
+        public int HeartRate { get; private set; } = int.MinValue;
 
         /// <summary>
         /// Returns true or false based on whether heart rate monitor is supported by device.
index 128e86e..28e6fbc 100644 (file)
@@ -20,7 +20,7 @@ namespace Tizen.Sensor
         /// <summary>
         /// Gets the value of the humidity sensor.
         /// </summary>
-        public float Humidity { get; private set; }
+        public float Humidity { get; private set; } = float.MinValue;
 
         /// <summary>
         /// Returns true or false based on whether humidity sensor is supported by device.
index 7b5cffa..035b0c3 100644 (file)
@@ -20,7 +20,7 @@ namespace Tizen.Sensor
         /// <summary>
         /// Gets the state of in-vehicle activity detector
         /// </summary>
-        public DetectorState InVehicle { get; private set; }
+        public DetectorState InVehicle { get; private set; } = DetectorState.Unknown;
 
         /// <summary>
         /// Returns true or false based on whether in-vehicle activity detector is supported by device.
index 2bbe5fd..485ffa5 100644 (file)
@@ -20,7 +20,7 @@ namespace Tizen.Sensor
         /// <summary>
         /// Gets the Level of the light.
         /// </summary>
-        public float Level { get; private set; }
+        public float Level { get; private set; } = float.MinValue;
 
         /// <summary>
         /// Returns true or false based on whether light sensor is supported by device.
index eefb258..43a42ee 100644 (file)
@@ -21,17 +21,17 @@ namespace Tizen.Sensor
         /// <summary>
         /// Gets the X component of the linear acceleration.
         /// </summary>
-        public float X { get; private set; }
+        public float X { get; private set; } = float.MinValue;
 
         /// <summary>
         /// Gets the Y component of the linear acceleration.
         /// </summary>
-        public float Y { get; private set; }
+        public float Y { get; private set; } = float.MinValue;
 
         /// <summary>
         /// Gets the Z component of the linear acceleration.
         /// </summary>
-        public float Z { get; private set; }
+        public float Z { get; private set; } = float.MinValue;
 
         /// <summary>
         /// Returns true or false based on whether linear acceleration sensor is supported by device.
index 80baee8..fffb672 100644 (file)
@@ -21,17 +21,17 @@ namespace Tizen.Sensor
         /// <summary>
         /// Gets the X component of the magnetometer.
         /// </summary>
-        public float X { get; private set; }
+        public float X { get; private set; } = float.MinValue;
 
         /// <summary>
         /// Gets the Y component of the magnetometer.
         /// </summary>
-        public float Y { get; private set; }
+        public float Y { get; private set; } = float.MinValue;
 
         /// <summary>
         /// Gets the Z component of the magnetometer.
         /// </summary>
-        public float Z { get; private set; }
+        public float Z { get; private set; } = float.MinValue;
 
         /// <summary>
         /// Returns true or false based on whether magnetometer is supported by device.
index 1b7b104..948407e 100644 (file)
@@ -21,22 +21,22 @@ namespace Tizen.Sensor
         /// <summary>
         /// Gets the X component of the magnetometer rotation vector.
         /// </summary>
-        public float X { get; private set; }
+        public float X { get; private set; } = float.MinValue;
 
         /// <summary>
         /// Gets the Y component of the magnetometer rotation vector.
         /// </summary>
-        public float Y { get; private set; }
+        public float Y { get; private set; } = float.MinValue;
 
         /// <summary>
         /// Gets the Z component of the magnetometer rotation vector.
         /// </summary>
-        public float Z { get; private set; }
+        public float Z { get; private set; } = float.MinValue;
 
         /// <summary>
         /// Gets the W component of the magnetometer rotation vector.
         /// </summary>
-        public float W { get; private set; }
+        public float W { get; private set; } = float.MinValue;
 
         /// <summary>
         /// Gets the Accuracy of the magnetometer rotation vector data.
index ae8512b..fab0a0e 100644 (file)
@@ -21,17 +21,17 @@ namespace Tizen.Sensor
         /// <summary>
         /// Gets the Azimuth component of the orientation.
         /// </summary>
-        public float Azimuth { get; private set; }
+        public float Azimuth { get; private set; } = float.MinValue;
 
         /// <summary>
         /// Gets the Pitch component of the orientation.
         /// </summary>
-        public float Pitch { get; private set; }
+        public float Pitch { get; private set; } = float.MinValue;
 
         /// <summary>
         /// Gets the Roll component of the orientation.
         /// </summary>
-        public float Roll { get; private set; }
+        public float Roll { get; private set; } = float.MinValue;
 
         /// <summary>
         /// Returns true or false based on whether orientation sensor is supported by device.
index 32178d9..911ec16 100644 (file)
@@ -20,42 +20,42 @@ namespace Tizen.Sensor
         /// <summary>
         /// Gets the step count
         /// </summary>
-        public int StepCount { get; private set; }
+        public uint StepCount { get; private set; } = 0;
 
         /// <summary>
         /// Gets the walking step count
         /// </summary>
-        public int WalkStepCount { get; private set; }
+        public uint WalkStepCount { get; private set; } = 0;
 
         /// <summary>
         /// Gets the running step count
         /// </summary>
-        public int RunStepCount { get; private set; }
+        public uint RunStepCount { get; private set; } = 0;
 
         /// <summary>
         /// Gets the moving distance
         /// </summary>
-        public float MovingDistance { get; private set; }
+        public float MovingDistance { get; private set; } = 0;
 
         /// <summary>
         /// Gets the calorie burned
         /// </summary>
-        public float CalorieBurned { get; private set; }
+        public float CalorieBurned { get; private set; } = 0;
 
         /// <summary>
         /// Gets the last speed
         /// </summary>
-        public float LastSpeed { get; private set; }
+        public float LastSpeed { get; private set; } = 0;
 
         /// <summary>
         /// Gets the last stepping frequency
         /// </summary>
-        public float LastSteppingFrequency { get; private set; }
+        public float LastSteppingFrequency { get; private set; } = 0;
 
         /// <summary>
         /// Gets the last step status
         /// </summary>
-        public PedometerState LastStepStatus { get; private set; }
+        public PedometerState LastStepStatus { get; private set; } = PedometerState.Unknown;
 
         /// <summary>
         /// Returns true or false based on whether pedometer sensor is supported by device.
@@ -149,9 +149,9 @@ namespace Tizen.Sensor
         {
             Interop.SensorEventStruct sensorData = Interop.IntPtrToEventStruct(sensorPtr);
             TimeSpan = new TimeSpan((Int64)sensorData.timestamp);
-            StepCount = (int)sensorData.values[0];
-            WalkStepCount = (int)sensorData.values[1];
-            RunStepCount = (int)sensorData.values[2];
+            StepCount = (uint)sensorData.values[0];
+            WalkStepCount = (uint)sensorData.values[1];
+            RunStepCount = (uint)sensorData.values[2];
             MovingDistance = sensorData.values[3];
             CalorieBurned = sensorData.values[4];
             LastSpeed = sensorData.values[5];
index 80c2739..c140ebb 100644 (file)
@@ -20,7 +20,7 @@ namespace Tizen.Sensor
         /// <summary>
         /// Gets the state of the pick up gesture.
         /// </summary>
-        public DetectorState PickUp { get; private set; }
+        public DetectorState PickUp { get; private set; } = DetectorState.Unknown;
 
         /// <summary>
         /// Returns true or false based on whether pick up gesture detector is supported by device.
index 55d7b42..c23bc05 100644 (file)
@@ -20,7 +20,7 @@ namespace Tizen.Sensor
         /// <summary>
         /// Gets the value of the pressure sensor.
         /// </summary>
-        public float Pressure { get; private set; }
+        public float Pressure { get; private set; } = float.MinValue;
 
         /// <summary>
         /// Returns true or false based on whether pressure sensor is supported by device.
index 898269f..d793ff1 100644 (file)
@@ -20,7 +20,7 @@ namespace Tizen.Sensor
         /// <summary>
         /// Gets the proximity state.
         /// </summary>
-        public ProximitySensorState Proximity { get; private set; }
+        public ProximitySensorState Proximity { get; private set; } = ProximitySensorState.Unknown;
 
         /// <summary>
         /// Returns true or false based on whether proximity sensor is supported by device.
index 4c400c3..43942e1 100644 (file)
@@ -21,27 +21,27 @@ namespace Tizen.Sensor
         /// <summary>
         /// Gets the X component of the rotation vector.
         /// </summary>
-        public float X { get; private set; }
+        public float X { get; private set; } = float.MinValue;
 
         /// <summary>
         /// Gets the Y component of the rotation vector.
         /// </summary>
-        public float Y { get; private set; }
+        public float Y { get; private set; } = float.MinValue;
 
         /// <summary>
         /// Gets the Z component of the rotation vector.
         /// </summary>
-        public float Z { get; private set; }
+        public float Z { get; private set; } = float.MinValue;
 
         /// <summary>
         /// Gets the W component of the rotation vector.
         /// </summary>
-        public float W { get; private set; }
+        public float W { get; private set; } = float.MinValue;
 
         /// <summary>
         /// Gets the Accuracy of the rotation vector data.
         /// </summary>
-        public SensorDataAccuracy Accuracy { get; private set; }
+        public SensorDataAccuracy Accuracy { get; private set; } = SensorDataAccuracy.Undefined;
 
         /// <summary>
         /// Returns true or false based on whether rotation vector sensor is supported by device.
index 72fe410..f1c0990 100644 (file)
@@ -20,7 +20,7 @@ namespace Tizen.Sensor
         /// <summary>
         /// Gets the state of running activity detector
         /// </summary>
-        public DetectorState Running { get; private set; }
+        public DetectorState Running { get; private set; } = DetectorState.Unknown;
 
         /// <summary>
         /// Returns true or false based on whether running activity detector is supported by device.
index 543f5e6..dfd3ffa 100644 (file)
@@ -20,7 +20,7 @@ namespace Tizen.Sensor
         /// <summary>
         /// Gets the value of the sleep state.
         /// </summary>
-        public SleepMonitorState SleepState { get; private set; }
+        public SleepMonitorState SleepState { get; private set; } = SleepMonitorState.Unknown;
 
         /// <summary>
         /// Returns true or false based on whether sleep monitor is supported by device.
index b5c5b7c..39504bb 100644 (file)
@@ -20,7 +20,7 @@ namespace Tizen.Sensor
         /// <summary>
         /// Gets the state of stationary activity detector
         /// </summary>
-        public DetectorState Stationary { get; private set; }
+        public DetectorState Stationary { get; private set; } = DetectorState.Unknown;
 
         /// <summary>
         /// Returns true or false based on whether stationary activity detector is supported by device.
index 3fdc409..68a7ebd 100644 (file)
@@ -20,7 +20,7 @@ namespace Tizen.Sensor
         /// <summary>
         /// Gets the value of the temperature sensor.
         /// </summary>
-        public float Temperature { get; private set; }
+        public float Temperature { get; private set; } = float.MinValue;
 
         /// <summary>
         /// Returns true or false based on whether temperature sensor is supported by device.
index 4aeba27..6009d90 100644 (file)
@@ -20,7 +20,7 @@ namespace Tizen.Sensor
         /// <summary>
         /// Gets the value of the ultraviolet sensor.
         /// </summary>
-        public float UltravioletIndex { get; private set; }
+        public float UltravioletIndex { get; private set; } = float.MinValue;
 
         /// <summary>
         /// Returns true or false based on whether ultraviolet sensor is supported by device.
index e3a8b87..04c368a 100644 (file)
@@ -20,32 +20,32 @@ namespace Tizen.Sensor
         /// <summary>
         /// Gets the X component of the acceleration.
         /// </summary>
-        public float X { get; private set; }
+        public float X { get; private set; } = float.MinValue;
 
         /// <summary>
         /// Gets the Y component of the acceleration.
         /// </summary>
-        public float Y { get; private set; }
+        public float Y { get; private set; } = float.MinValue;
 
         /// <summary>
         /// Gets the Z component of the acceleration.
         /// </summary>
-        public float Z { get; private set; }
+        public float Z { get; private set; } = float.MinValue;
 
         /// <summary>
         /// Gets the BiasX component of the uncalibrated gyroscope data.
         /// </summary>
-        public float BiasX { get; private set; }
+        public float BiasX { get; private set; } = 0;
 
         /// <summary>
         /// Gets the BiasY component of the uncalibrated gyroscope data.
         /// </summary>
-        public float BiasY { get; private set; }
+        public float BiasY { get; private set; } = 0;
 
         /// <summary>
         /// Gets the BiasZ component of the uncalibrated gyroscope data.
         /// </summary>
-        public float BiasZ { get; private set; }
+        public float BiasZ { get; private set; } = 0;
 
         /// <summary>
         /// Returns true or false based on whether uncalibrated gyroscope sensor is supported by device.
index c877116..7da8d5f 100644 (file)
@@ -21,32 +21,32 @@ namespace Tizen.Sensor
         /// <summary>
         /// Gets the X component of the acceleration.
         /// </summary>
-        public float X { get; private set; }
+        public float X { get; private set; } = float.MinValue;
 
         /// <summary>
         /// Gets the Y component of the acceleration.
         /// </summary>
-        public float Y { get; private set; }
+        public float Y { get; private set; } = float.MinValue;
 
         /// <summary>
         /// Gets the Z component of the acceleration.
         /// </summary>
-        public float Z { get; private set; }
+        public float Z { get; private set; } = float.MinValue;
 
         /// <summary>
         /// Gets the BiasX component of the uncalibrated magnetometer data.
         /// </summary>
-        public float BiasX { get; private set; }
+        public float BiasX { get; private set; } = 0;
 
         /// <summary>
         /// Gets the BiasY component of the uncalibrated magnetometer data.
         /// </summary>
-        public float BiasY { get; private set; }
+        public float BiasY { get; private set; } = 0;
 
         /// <summary>
         /// Gets the BiasZ component of the uncalibrated magnetometer data.
         /// </summary>
-        public float BiasZ { get; private set; }
+        public float BiasZ { get; private set; } = 0;
 
         /// <summary>
         /// Returns true or false based on whether uncalibrated magnetometer sensor is supported by device.
index 3b7dbf3..d82fc78 100644 (file)
@@ -20,7 +20,7 @@ namespace Tizen.Sensor
         /// <summary>
         /// Gets the state of walking activity detector
         /// </summary>
-        public DetectorState Walking { get; private set; }
+        public DetectorState Walking { get; private set; } = DetectorState.Unknown;
 
         /// <summary>
         /// Returns true or false based on whether walking activity detector is supported by device.
index 3c92416..aa51a6c 100644 (file)
@@ -20,7 +20,7 @@ namespace Tizen.Sensor
         /// <summary>
         /// Gets the state of the wrist up gesture.
         /// </summary>
-        public DetectorState WristUp { get; private set; }
+        public DetectorState WristUp { get; private set; } = DetectorState.Unknown;
 
         /// <summary>
         /// Returns true or false based on whether wrist up gesture detector is supported by device.
index 0999a77..90d1ffc 100644 (file)
@@ -203,7 +203,7 @@ namespace Tizen.Sensor
         /// <summary>
         /// Unknown.
         /// </summary>
-        Unknown,
+        Unknown = -1,
 
         /// <summary>
         /// Stop state.
@@ -229,7 +229,7 @@ namespace Tizen.Sensor
         /// <summary>
         /// Unknown.
         /// </summary>
-        Unknown,
+        Unknown = -1,
 
         /// <summary>
         /// The wake state.
@@ -248,6 +248,11 @@ namespace Tizen.Sensor
     public enum ProximitySensorState
     {
         /// <summary>
+        /// Unknown.
+        /// </summary>
+        Unknown = -1,
+
+        /// <summary>
         /// Near sate.
         /// </summary>
         Near = 0,
@@ -264,6 +269,11 @@ namespace Tizen.Sensor
     public enum DetectorState
     {
         /// <summary>
+        /// Unknown.
+        /// </summary>
+        Unknown = -1,
+
+        /// <summary>
         /// None sate.
         /// </summary>
         NotDetected = 0,