[Sensor] Sync with API7 branch (#1303)
[platform/core/csapi/tizenfx.git] / src / Tizen.Sensor / Tizen.Sensor / Plugins / FaceDownGestureDetector.cs
index 2d6a301..70346b8 100755 (executable)
@@ -98,6 +98,23 @@ namespace Tizen.Sensor
         }
 
         /// <summary>
+        /// Read face down gesture detector data synchronously.
+        /// </summary>
+        internal override void ReadData()
+        {
+            Interop.SensorEventStruct sensorData;
+            int error = Interop.SensorListener.ReadData(ListenerHandle, out sensorData);
+            if (error != (int)SensorError.None)
+            {
+                Log.Error(Globals.LogTag, "Error reading face down gesture detector data");
+                throw SensorErrorFactory.CheckAndThrowException(error, "Reading face down gesture detector data failed");
+            }
+
+            TimeSpan = new TimeSpan((Int64)sensorData.timestamp);
+            FaceDown = (DetectorState)sensorData.values[0];
+        }
+
+        /// <summary>
         /// An event handler for storing the callback functions for the event corresponding to the change in the face down gesture detector data.
         /// </summary>
         /// <since_tizen> 3 </since_tizen>