src/FUixSensorTiltSensorData.cpp
src/FUixSensorGyroSensorData.cpp
src/FUixSensorLightSensorData.cpp
+ src/FUixSensorGravitySensorData.cpp
+ src/FUixSensorUserAccelerationSensorData.cpp
+ src/FUixSensorDeviceOrientationSensorData.cpp
src/FUixSensorSensorManager.cpp
src/FUixSensor_ISensorCore.cpp
src/FUixSensor_SensorUtil.cpp
#include <FUixSensorTiltSensorData.h>
#include <FUixSensorGyroSensorData.h>
#include <FUixSensorLightSensorData.h>
+#include <FUixSensorGravitySensorData.h>
+#include <FUixSensorUserAccelerationSensorData.h>
+#include <FUixSensorDeviceOrientationSensorData.h>
#include <FUixSensorISensorEventListener.h>
#include <FUixSensorMotion.h>
#include <FUixSensorSensorManager.h>
*/
virtual ~AccelerationSensorData(void);
+ /**
+ * Copying of objects using this copy constructor is allowed.
+ *
+ * @since 2.1
+ *
+ * @param[in] rhs An instance of %AccelerationSensorData
+ */
+ AccelerationSensorData(const AccelerationSensorData& rhs);
+
+ /**
+ * Compares the equality of values between two %AccelerationSensorData objects by overriding the Tizen::Base::Object::Equals() method.
+ *
+ * @since 2.1
+ *
+ * @return @c true if all the fields in the objects are equal, @n
+ * else @c false
+ * @param[in] rhs The Tizen::Base::Object with which the comparison is done
+ * @remarks An instance of Tizen::Graphics::Bitmap is not taken into account in the comparisons.
+ */
+ virtual bool Equals(const Tizen::Base::Object& rhs) const;
+
+ /**
+ * Gets the hash value of the current instance by overriding the Tizen::Base::Object::GetHashCode() method.
+ *
+ * @since 2.1
+ *
+ * @return The hash value of the current instance
+ */
+ virtual int GetHashCode(void) const;
+
+ /**
+ * Copying of objects using this copy assignment operator is allowed.
+ *
+ * @since 2.1
+ *
+ * @return A reference to this instance
+ * @param[in] rhs An instance of %AccelerationSensorData
+ */
+ AccelerationSensorData& operator =(const AccelerationSensorData& rhs);
+
+
private:
virtual result GetValue(SensorDataKey dataKey, long& value) const;
virtual result GetValue(SensorDataKey dataKey, float& value) const;
--- /dev/null
+//
+// Open Service Platform
+// Copyright (c) 2012 Samsung Electronics Co., Ltd.
+//
+// Licensed under the Apache License, Version 2.0 (the License);
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+
+/**
+ * @file FUixSensorDeviceOrientationSensorData.h
+ * @brief This is the header file for the %DeviceOrientationSensorData class.
+ *
+ * This header file contains the declarations of the %DeviceOrientationSensorData class.
+ */
+
+#ifndef _FUIX_SENSOR_DEVICE_ORIENTATION_SENSOR_DATA_H_
+#define _FUIX_SENSOR_DEVICE_ORIENTATION_SENSOR_DATA_H_
+
+#include <FOspConfig.h>
+#include <FUixSensorSensorData.h>
+
+namespace Tizen { namespace Uix { namespace Sensor
+{
+/**
+ * @class DeviceOrientationSensorData
+ * @brief This class stores device-orientation sensor data, including a time stamp.
+ *
+ * @since 2.1
+ *
+ * @remarks @b Header @b %file: @b \#include @b <FUix.h> @n
+ * @b Library : @b osp-uix
+ *
+ * The %DeviceOrientationSensorData class stores device-orientation sensor data, including a time stamp.
+ * @n
+ * For more information on the class features, see <a href="../org.tizen.native.appprogramming/html/guide/uix/sensor_manager.htm">Sensor Manager</a>.
+ */
+class _OSP_EXPORT_ DeviceOrientationSensorData
+ : public Tizen::Uix::Sensor::SensorData
+{
+public:
+ /**
+ * This is the default constructor for this class.
+ *
+ * @since 2.1
+ */
+ DeviceOrientationSensorData(void);
+
+ /**
+ * This is the destructor for this class.
+ *
+ * @since 2.1
+ */
+ virtual ~DeviceOrientationSensorData(void);
+
+ /**
+ * Copying of objects using this copy constructor is allowed.
+ *
+ * @since 2.1
+ *
+ * @param[in] rhs An instance of %DeviceOrientationSensorData
+ */
+ DeviceOrientationSensorData(const DeviceOrientationSensorData& rhs);
+
+ /**
+ * Compares the equality of values between two %DeviceOrientationSensorData objects by overriding the Tizen::Base::Object::Equals() method.
+ *
+ * @since 2.1
+ *
+ * @return @c true if all the fields in the objects are equal, @n
+ * else @c false
+ * @param[in] rhs The Tizen::Base::Object with which the comparison is done
+ * @remarks An instance of Tizen::Graphics::Bitmap is not taken into account in the comparisons.
+ */
+ virtual bool Equals(const Tizen::Base::Object& rhs) const;
+
+ /**
+ * Gets the hash value of the current instance by overriding the Tizen::Base::Object::GetHashCode() method.
+ *
+ * @since 2.1
+ *
+ * @return The hash value of the current instance
+ */
+ virtual int GetHashCode(void) const;
+
+ /**
+ * Copying of objects using this copy assignment operator is allowed.
+ *
+ * @since 2.1
+ *
+ * @return A reference to this instance
+ * @param[in] rhs An instance of %DeviceOrientationSensorData
+ */
+ DeviceOrientationSensorData& operator =(const DeviceOrientationSensorData& rhs);
+
+
+
+private:
+ virtual result GetValue(SensorDataKey dataKey, long& value) const;
+ virtual result GetValue(SensorDataKey dataKey, float& value) const;
+ virtual result GetValue(SensorDataKey dataKey, bool& value) const;
+
+public:
+ /**
+ * The yaw value of the device-orientation sensor data
+ *
+ * @since 2.1
+ */
+ float yaw;
+
+ /**
+ * The roll value of the device-orientation sensor data
+ *
+ * @since 2.1
+ */
+ float roll;
+
+ /**
+ * The pitch value of the device-orientation sensor data
+ *
+ * @since 2.1
+ */
+ float pitch;
+
+
+}; // DeviceOrientationSensorData
+} } }// Tizen::Uix::Sensor
+
+#endif // _FUIX_SENSOR_DEVICE_ORIENTATION_SENSOR_DATA_H_
--- /dev/null
+//
+// Open Service Platform
+// Copyright (c) 2012 Samsung Electronics Co., Ltd.
+//
+// Licensed under the Apache License, Version 2.0 (the License);
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+
+/**
+ * @file FUixSensorGravitySensorData.h
+ * @brief This is the header file for the %GravitySensorData class.
+ *
+ * This header file contains the declarations of the %GravitySensorData class.
+ */
+
+#ifndef _FUIX_SENSOR_GRAVITY_SENSOR_DATA_H_
+#define _FUIX_SENSOR_GRAVITY_SENSOR_DATA_H_
+
+#include <FOspConfig.h>
+#include <FUixSensorSensorData.h>
+
+namespace Tizen { namespace Uix { namespace Sensor
+{
+/**
+ * @class GravitySensorData
+ * @brief This class stores gravity sensor data, including a time stamp.
+ *
+ * @since 2.1
+ *
+ * @remarks @b Header @b %file: @b \#include @b <FUix.h> @n
+ * @b Library : @b osp-uix
+ *
+ * The %GravitySensorData class stores gravity sensor data, including a time stamp.
+ * @n
+ * For more information on the class features, see <a href="../org.tizen.native.appprogramming/html/guide/uix/sensor_manager.htm">Sensor Manager</a>.
+ */
+class _OSP_EXPORT_ GravitySensorData
+ : public Tizen::Uix::Sensor::SensorData
+{
+public:
+ /**
+ * This is the default constructor for this class.
+ *
+ * @since 2.1
+ */
+ GravitySensorData(void);
+
+ /**
+ * This is the destructor for this class.
+ *
+ * @since 2.1
+ */
+ virtual ~GravitySensorData(void);
+
+ /**
+ * Copying of objects using this copy constructor is allowed.
+ *
+ * @since 2.1
+ *
+ * @param[in] rhs An instance of %GravitySensorData
+ */
+ GravitySensorData(const GravitySensorData& rhs);
+
+ /**
+ * Compares the equality of values between two %GravitySensorData objects by overriding the Tizen::Base::Object::Equals() method.
+ *
+ * @since 2.1
+ *
+ * @return @c true if all the fields in the objects are equal, @n
+ * else @c false
+ * @param[in] rhs The Tizen::Base::Object with which the comparison is done
+ * @remarks An instance of Tizen::Graphics::Bitmap is not taken into account in the comparisons.
+ */
+ virtual bool Equals(const Tizen::Base::Object& rhs) const;
+
+ /**
+ * Gets the hash value of the current instance by overriding the Tizen::Base::Object::GetHashCode() method.
+ *
+ * @since 2.1
+ *
+ * @return The hash value of the current instance
+ */
+ virtual int GetHashCode(void) const;
+
+ /**
+ * Copying of objects using this copy assignment operator is allowed.
+ *
+ * @since 2.1
+ *
+ * @return A reference to this instance
+ * @param[in] rhs An instance of %GravitySensorData
+ */
+ GravitySensorData& operator =(const GravitySensorData& rhs);
+
+
+
+private:
+ virtual result GetValue(SensorDataKey dataKey, long& value) const;
+ virtual result GetValue(SensorDataKey dataKey, float& value) const;
+ virtual result GetValue(SensorDataKey dataKey, bool& value) const;
+
+public:
+ /**
+ * The x-axis value of the gravity sensor data
+ *
+ * @since 2.1
+ */
+ float x;
+
+ /**
+ * The y-axis value of the gravity sensor data
+ *
+ * @since 2.1
+ */
+ float y;
+
+ /**
+ * The z-axis value of the gravity sensor data
+ *
+ * @since 2.1
+ */
+ float z;
+}; // GravitySensorData
+} } } // Tizen::Uix::Sensor
+
+#endif // _FUIX_SENSOR_GRAVITY_SENSOR_DATA_H_
*/
virtual ~GyroSensorData(void);
+ /**
+ * Copying of objects using this copy constructor is allowed.
+ *
+ * @since 2.1
+ *
+ * @param[in] rhs An instance of %GyroSensorData
+ */
+ GyroSensorData(const GyroSensorData& rhs);
+
+ /**
+ * Compares the equality of values between two %GyroSensorData objects by overriding the Tizen::Base::Object::Equals() method.
+ *
+ * @since 2.1
+ *
+ * @return @c true if all the fields in the objects are equal, @n
+ * else @c false
+ * @param[in] rhs The Tizen::Base::Object with which the comparison is done
+ * @remarks An instance of Tizen::Graphics::Bitmap is not taken into account in the comparisons.
+ */
+ virtual bool Equals(const Tizen::Base::Object& rhs) const;
+
+ /**
+ * Gets the hash value of the current instance by overriding the Tizen::Base::Object::GetHashCode() method.
+ *
+ * @since 2.1
+ *
+ * @return The hash value of the current instance
+ */
+ virtual int GetHashCode(void) const;
+
+ /**
+ * Copying of objects using this copy assignment operator is allowed.
+ *
+ * @since 2.1
+ *
+ * @return A reference to this instance
+ * @param[in] rhs An instance of %GyroSensorData
+ */
+ GyroSensorData& operator =(const GyroSensorData& rhs);
+
+
+
private:
virtual result GetValue(SensorDataKey dataKey, long& value) const;
virtual result GetValue(SensorDataKey dataKey, float& value) const;
*
* @since 2.0
*
- * @see Tizen::Uix::Sensor::MotionSnapType
+ * @see Tizen::Uix::Sensor::MotionType
*/
virtual void OnDoubleTapDetected(void) = 0;
*/
virtual void OnShakeDetected(MotionState motionState) = 0;
+ /**
+ * Called when the move-to-ear event is detected. @n
+ * When a move-to-ear event occurs, and if its type is registered by an application, then the event is triggered.
+ *
+ * @since 2.1
+ *
+ * @see Tizen::Uix::Sensor::MotionType
+ */
+
+ virtual void OnMoveToEarDetected(void) {}
+
protected:
//
// and consistency-related issues in the application.
//
virtual void IMotionEventListener_Reserved2(void) {}
-
- //
- // This method is for internal use only. Using this method can cause behavioral, security-related,
- // and consistency-related issues in the application.
- //
- virtual void IMotionEventListener_Reserved3(void) {}
}; // IMotionEventListener
} } } // Tizen::Uix::Sensor
*/
virtual ~LightSensorData(void);
+ /**
+ * Copying of objects using this copy constructor is allowed.
+ *
+ * @since 2.1
+ *
+ * @param[in] rhs An instance of %LightSensorData
+ */
+ LightSensorData(const LightSensorData& rhs);
+
+ /**
+ * Compares the equality of values between two %LightSensorData objects by overriding the Tizen::Base::Object::Equals() method.
+ *
+ * @since 2.1
+ *
+ * @return @c true if all the fields in the objects are equal, @n
+ * else @c false
+ * @param[in] rhs The Tizen::Base::Object with which the comparison is done
+ * @remarks An instance of Tizen::Graphics::Bitmap is not taken into account in the comparisons.
+ */
+ virtual bool Equals(const Tizen::Base::Object& rhs) const;
+
+ /**
+ * Gets the hash value of the current instance by overriding the Tizen::Base::Object::GetHashCode() method.
+ *
+ * @since 2.1
+ *
+ * @return The hash value of the current instance
+ */
+ virtual int GetHashCode(void) const;
+
+ /**
+ * Copying of objects using this copy assignment operator is allowed.
+ *
+ * @since 2.1
+ *
+ * @return A reference to this instance
+ * @param[in] rhs An instance of %LightSensorData
+ */
+ LightSensorData& operator =(const LightSensorData& rhs);
+
private:
virtual result GetValue(SensorDataKey dataKey, long& value) const;
virtual result GetValue(SensorDataKey dataKey, float& value) const;
*/
virtual ~MagneticSensorData(void);
+ /**
+ * Copying of objects using this copy constructor is allowed.
+ *
+ * @since 2.1
+ *
+ * @param[in] rhs An instance of %MagneticSensorData
+ */
+ MagneticSensorData(const MagneticSensorData& rhs);
+
+ /**
+ * Compares the equality of values between two %MagneticSensorData objects by overriding the Tizen::Base::Object::Equals() method.
+ *
+ * @since 2.1
+ *
+ * @return @c true if all the fields in the objects are equal, @n
+ * else @c false
+ * @param[in] rhs The Tizen::Base::Object with which the comparison is done
+ * @remarks An instance of Tizen::Graphics::Bitmap is not taken into account in the comparisons.
+ */
+ virtual bool Equals(const Tizen::Base::Object& rhs) const;
+
+ /**
+ * Gets the hash value of the current instance by overriding the Tizen::Base::Object::GetHashCode() method.
+ *
+ * @since 2.1
+ *
+ * @return The hash value of the current instance
+ */
+ virtual int GetHashCode(void) const;
+
+ /**
+ * Copying of objects using this copy assignment operator is allowed.
+ *
+ * @since 2.1
+ *
+ * @return A reference to this instance
+ * @param[in] rhs An instance of %MagneticSensorData
+ */
+ MagneticSensorData& operator =(const MagneticSensorData& rhs);
+
private:
virtual result GetValue(SensorDataKey dataKey, long& value) const;
virtual result GetValue(SensorDataKey dataKey, float& value) const;
* Multiple motion types of type Tizen::Uix::Sensor::MotionType can be combined using the logical OR operator.
* @exception E_SUCCESS The method is successful.
* @exception E_INVALID_STATE This instance has not been constructed as yet.
- * @exception E_INVALID_ARG A specified input parameter is invalid. @if OSPCOMPAT @b Since: @b 2.0 @endif
+ * @exception E_INVALID_ARG A specified input parameter is invalid.
* @remarks The specific error code can be accessed using the GetLastResult() method.
*/
void SetEnabled(unsigned long type);
MOTION_TYPE_SNAP = 0x0001, /**< The motion type: Snap */
MOTION_TYPE_SHAKE = 0x0002, /**< The motion type: Shake */
MOTION_TYPE_DOUBLETAP = 0x0004, /**< The motion type: Tap */
+ MOTION_TYPE_MOVE_TO_EAR = 0x0008, /**< The motion type: Move to ear @b Since: @b 2.1 */
MOTION_TYPE_ALL = 0xFFFF, /**< The motion type: All */
};
MOTION_STARTED, /**< The specified motion has just started */
MOTION_INPROGRESS, /**< The specified motion is happening */
MOTION_ENDED, /**< The specified motion has just ended */
- MOTION_CANCELLED, /**< Reserved */
+ MOTION_CANCELLED, /**< The specified motion has just canceled */
};
/**
*/
bool IsObjectDetected(void) const;
+ /**
+ * Copying of objects using this copy constructor is allowed.
+ *
+ * @since 2.1
+ *
+ * @param[in] rhs An instance of %ProximitySensorData
+ */
+ ProximitySensorData(const ProximitySensorData& rhs);
+
+ /**
+ * Compares the equality of values between two %ProximitySensorData objects by overriding the Tizen::Base::Object::Equals() method.
+ *
+ * @since 2.1
+ *
+ * @return @c true if all the fields in the objects are equal, @n
+ * else @c false
+ * @param[in] rhs The Tizen::Base::Object with which the comparison is done
+ * @remarks An instance of Tizen::Graphics::Bitmap is not taken into account in the comparisons.
+ */
+ virtual bool Equals(const Tizen::Base::Object& rhs) const;
+
+ /**
+ * Gets the hash value of the current instance by overriding the Tizen::Base::Object::GetHashCode() method.
+ *
+ * @since 2.1
+ *
+ * @return The hash value of the current instance
+ */
+ virtual int GetHashCode(void) const;
+
+ /**
+ * Copying of objects using this copy assignment operator is allowed.
+ *
+ * @since 2.1
+ *
+ * @return A reference to this instance
+ * @param[in] rhs An instance of %ProximitySensorData
+ */
+ ProximitySensorData& operator =(const ProximitySensorData& rhs);
+
private:
virtual result GetValue(SensorDataKey dataKey, long& value) const;
virtual result GetValue(SensorDataKey dataKey, float& value) const;
* @exception E_OUT_OF_MEMORY The memory is insufficient.
* @exception E_INVALID_ARG An interval must be greater than the maximum interval or less than the minimum interval or the sensor type is invalid.
* @exception E_OPERATION_FAILED The operation has failed to add a sensor listener.
- * @exception E_USER_ALREADY_REGISTERED The specified listener is already registered for the specified sensor type.
+ * @exception E_USER_ALREADY_REGISTERED The specified @c listener is already registered for the specified sensor type.
* @exception E_UNSUPPORTED_OPERATION The target device does not support the specific sensor.
*/
* @exception E_OPERATION_FAILED The operation has failed.
* @exception E_UNSUPPORTED_OPERATION The target device does not support the specific sensor.
* @remarks The wake up feature is automatically disabled by the system as soon as the calling application is terminated.
- * @remarks This method cannot be tested on the Emulator. It always returns E_SUCCESS on the Emulator.
+ * @remarks This method cannot be tested on the Emulator. It always returns @c E_SUCCESS on the Emulator.
*/
result SetWakeupEnabled(SensorType sensorType, bool enable);
* @exception E_OPERATION_FAILED The operation has failed.
* @exception E_UNSUPPORTED_OPERATION The target device does not support the specific sensor.
* @remarks The specific error code can be accessed using the GetLastResult() method.
- * @remarks This method cannot be tested on the Emulator. It always returns true on the Emulator.
+ * @remarks This method cannot be tested on the Emulator. It always returns @c true on the Emulator.
*/
bool IsWakeupEnabled(SensorType sensorType) const;
SENSOR_TYPE_TILT, /**< The tilt sensor type */
SENSOR_TYPE_GYRO, /**< The gyro sensor type */
SENSOR_TYPE_LIGHT, /**< The light sensor type */
+ SENSOR_TYPE_GRAVITY, /**< The gravity sensor type @b Since: @b 2.1 */
+ SENSOR_TYPE_USER_ACCELERATION, /**< The user-acceleration sensor type @b Since: @b 2.1 */
+ SENSOR_TYPE_DEVICE_ORIENTATION, /**< The device-orientation sensor type @b Since: @b 2.1 */
SENSOR_TYPE_MAX, // This enum value is for internal use only.
// Using this enum value can cause behavioral,
// security-related, and consistency-related
*/
virtual ~TiltSensorData(void);
+ /**
+ * Copying of objects using this copy constructor is allowed.
+ *
+ * @since 2.1
+ *
+ * @param[in] rhs An instance of %TiltSensorData
+ */
+ TiltSensorData(const TiltSensorData& rhs);
+
+ /**
+ * Compares the equality of values between two %TiltSensorData objects by overriding the Tizen::Base::Object::Equals() method.
+ *
+ * @since 2.1
+ *
+ * @return @c true if all the fields in the objects are equal, @n
+ * else @c false
+ * @param[in] rhs The Tizen::Base::Object with which the comparison is done
+ * @remarks An instance of Tizen::Graphics::Bitmap is not taken into account in the comparisons.
+ */
+ virtual bool Equals(const Tizen::Base::Object& rhs) const;
+
+ /**
+ * Gets the hash value of the current instance by overriding the Tizen::Base::Object::GetHashCode() method.
+ *
+ * @since 2.1
+ *
+ * @return The hash value of the current instance
+ */
+ virtual int GetHashCode(void) const;
+
+ /**
+ * Copying of objects using this copy assignment operator is allowed.
+ *
+ * @since 2.1
+ *
+ * @return A reference to this instance
+ * @param[in] rhs An instance of %TiltSensorData
+ */
+ TiltSensorData& operator =(const TiltSensorData& rhs);
+
+
+
private:
virtual result GetValue(SensorDataKey dataKey, long& value) const;
virtual result GetValue(SensorDataKey dataKey, float& value) const;
--- /dev/null
+//
+// Open Service Platform
+// Copyright (c) 2012 Samsung Electronics Co., Ltd.
+//
+// Licensed under the Apache License, Version 2.0 (the License);
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+
+/**
+ * @file FUixSensorUserAccelerationSensorData.h
+ * @brief This is the header file for the %UserAccelerationSensorData class.
+ *
+ * This header file contains the declarations of the %UserAccelerationSensorData class.
+ */
+
+#ifndef _FUIX_SENSOR_USER_ACCELERATION_SENSOR_DATA_H_
+#define _FUIX_SENSOR_USER_ACCELERATION_SENSOR_DATA_H_
+
+#include <FOspConfig.h>
+#include <FUixSensorSensorData.h>
+
+namespace Tizen { namespace Uix { namespace Sensor
+{
+/**
+ * @class UserAccelerationSensorData
+ * @brief This class stores user-acceleration sensor data, including a time stamp.
+ *
+ * @since 2.1
+ *
+ * @remarks @b Header @b %file: @b \#include @b <FUix.h> @n
+ * @b Library : @b osp-uix
+ *
+ * The %UserAccelerationSensorData class stores user-acceleration sensor data, including a time stamp.
+ * @n
+ * For more information on the class features, see <a href="../org.tizen.native.appprogramming/html/guide/uix/sensor_manager.htm">Sensor Manager</a>.
+ */
+class _OSP_EXPORT_ UserAccelerationSensorData
+ : public Tizen::Uix::Sensor::SensorData
+{
+public:
+ /**
+ * This is the default constructor for this class.
+ *
+ * @since 2.1
+ */
+ UserAccelerationSensorData(void);
+
+ /**
+ * This is the destructor for this class.
+ *
+ * @since 2.1
+ */
+ virtual ~UserAccelerationSensorData(void);
+
+ /**
+ * Copying of objects using this copy constructor is allowed.
+ *
+ * @since 2.1
+ *
+ * @param[in] rhs An instance of %UserAccelerationSensorData
+ */
+ UserAccelerationSensorData(const UserAccelerationSensorData& rhs);
+
+ /**
+ * Compares the equality of values between two %UserAccelerationSensorData objects by overriding the Tizen::Base::Object::Equals() method.
+ *
+ * @since 2.1
+ *
+ * @return @c true if all the fields in the objects are equal, @n
+ * else @c false
+ * @param[in] rhs The Tizen::Base::Object with which the comparison is done
+ * @remarks An instance of Tizen::Graphics::Bitmap is not taken into account in the comparisons.
+ */
+ virtual bool Equals(const Tizen::Base::Object& rhs) const;
+
+ /**
+ * Gets the hash value of the current instance by overriding the Tizen::Base::Object::GetHashCode() method.
+ *
+ * @since 2.1
+ *
+ * @return The hash value of the current instance
+ */
+ virtual int GetHashCode(void) const;
+
+ /**
+ * Copying of objects using this copy assignment operator is allowed.
+ *
+ * @since 2.1
+ *
+ * @return A reference to this instance
+ * @param[in] rhs An instance of %UserAccelerationSensorData
+ */
+ UserAccelerationSensorData& operator =(const UserAccelerationSensorData& rhs);
+
+private:
+ virtual result GetValue(SensorDataKey dataKey, long& value) const;
+ virtual result GetValue(SensorDataKey dataKey, float& value) const;
+ virtual result GetValue(SensorDataKey dataKey, bool& value) const;
+
+public:
+ /**
+ * The x-axis value of the user-acceleration sensor data
+ *
+ * @since 2.1
+ */
+ float x;
+
+ /**
+ * The y-axis value of the user-acceleration sensor data
+ *
+ * @since 2.1
+ */
+ float y;
+
+ /**
+ * The z-axis value of the user-acceleration sensor data
+ *
+ * @since 2.1
+ */
+ float z;
+}; // UserAccelerationSensorData
+} } } // Tizen::Uix::Sensor
+
+#endif // _FUIX_SENSOR_USER_ACCELERATION_SENSOR_DATA_H_
Name: osp-uix
Summary: osp uix library
-Version: 1.2.0.0
+Version: 1.2.1.0
Release: 2
Group: System/Libraries
License: TO_BE/FILLED_IN
// Includes
#include <FBaseErrors.h>
#include <FBaseSysLog.h>
-
+#include <FBaseFloat.h>
+#include <FBaseLongLong.h>
#include <FUixSensorAccelerationSensorData.h>
#include "FUixSensor_SensorUtil.h"
+using namespace Tizen::Base;
+
namespace Tizen { namespace Uix { namespace Sensor
{
namespace
}
+AccelerationSensorData::AccelerationSensorData(const AccelerationSensorData& rhs)
+ :x(rhs.x)
+ ,y(rhs.y)
+ ,z(rhs.z)
+{
+
+}
+
+AccelerationSensorData&
+AccelerationSensorData::operator =(const AccelerationSensorData& rhs)
+{
+ // check for self-assignment
+ if (this != &rhs)
+ {
+ timestamp = rhs.timestamp;
+ x = rhs.x;
+ y = rhs.y;
+ z = rhs.z;
+ }
+
+ return *this;
+}
+
+int
+AccelerationSensorData::GetHashCode(void) const
+{
+ int hash = 0;
+
+ hash += LongLong::GetHashCode(this->timestamp);
+ hash += Float::GetHashCode(this->x);
+ hash += Float::GetHashCode(this->y);
+ hash += Float::GetHashCode(this->z);
+
+ return hash;
+}
+
+bool
+AccelerationSensorData::Equals(const Object& rhs) const
+{
+ const AccelerationSensorData* pRhs = dynamic_cast <const AccelerationSensorData*>(&rhs);
+ if (pRhs == null)
+ {
+ return false;
+ }
+
+ if (this->timestamp != pRhs->timestamp)
+ {
+ return false;
+ }
+
+ if (this->x != pRhs->x)
+ {
+ return false;
+ }
+
+ if (this->y != pRhs->y)
+ {
+ return false;
+ }
+
+ if (this->z != pRhs->z)
+ {
+ return false;
+ }
+
+
+ return true;
+}
+
result
AccelerationSensorData::GetValue(SensorDataKey dataKey, long& value) const
{
--- /dev/null
+//
+// Open Service Platform
+// Copyright (c) 2012 Samsung Electronics Co., Ltd.
+//
+// Licensed under the Apache License, Version 2.0 (the License);
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+
+/**
+ * @file FUixSensorDeviceOrientationSensorData.cpp
+ * @brief This is the implementation file for the %DeviceOrientationSensorData class.
+ *
+ * This files contains implementation of the %TiltSensorData class.
+ */
+
+// Includes
+#include <FBaseErrors.h>
+#include <FBaseSysLog.h>
+#include <FBaseFloat.h>
+#include <FBaseLongLong.h>
+
+#include <FUixSensorDeviceOrientationSensorData.h>
+#include "FUixSensor_SensorUtil.h"
+
+using namespace Tizen::Base;
+
+namespace Tizen { namespace Uix { namespace Sensor
+{
+namespace
+{
+static const wchar_t W_MSG_INVALID_SENSOR_DATA_KEY[] = L"A data matching the specified key and data type cannot be found.";
+} // Anonymous
+
+DeviceOrientationSensorData::DeviceOrientationSensorData(void)
+ : yaw(0.0F)
+ , roll(0.0F)
+ , pitch(0.0F)
+{
+
+}
+
+DeviceOrientationSensorData::~DeviceOrientationSensorData(void)
+{
+
+}
+
+DeviceOrientationSensorData::DeviceOrientationSensorData(const DeviceOrientationSensorData& rhs)
+ :yaw(rhs.yaw)
+ ,roll(rhs.roll)
+ ,pitch(rhs.pitch)
+{
+
+}
+
+DeviceOrientationSensorData&
+DeviceOrientationSensorData::operator =(const DeviceOrientationSensorData& rhs)
+{
+ // check for self-assignment
+ if (this != &rhs)
+ {
+ timestamp = rhs.timestamp;
+ yaw = rhs.yaw;
+ roll = rhs.roll;
+ pitch = rhs.pitch;
+ }
+
+ return *this;
+}
+
+int
+DeviceOrientationSensorData::GetHashCode(void) const
+{
+ int hash = 0;
+
+ hash += LongLong::GetHashCode(this->timestamp);
+ hash += Float::GetHashCode(this->yaw);
+ hash += Float::GetHashCode(this->roll);
+ hash += Float::GetHashCode(this->pitch);
+
+ return hash;
+}
+
+bool
+DeviceOrientationSensorData::Equals(const Object& rhs) const
+{
+ const DeviceOrientationSensorData* pRhs = dynamic_cast <const DeviceOrientationSensorData*>(&rhs);
+ if (pRhs == null)
+ {
+ return false;
+ }
+
+ if (this->timestamp != pRhs->timestamp)
+ {
+ return false;
+ }
+
+ if (this->roll != pRhs->roll)
+ {
+ return false;
+ }
+
+ if (this->roll != pRhs->roll)
+ {
+ return false;
+ }
+
+ if (this->pitch != pRhs->pitch)
+ {
+ return false;
+ }
+ return true;
+}
+
+result
+DeviceOrientationSensorData::GetValue(SensorDataKey dataKey, long& value) const
+{
+ SysLogException(NID_UIX, E_INVALID_ARG, "[%s] %ls", GetErrorMessage(E_INVALID_ARG), W_MSG_INVALID_SENSOR_DATA_KEY);
+ return E_INVALID_ARG;
+}
+
+result
+DeviceOrientationSensorData::GetValue(SensorDataKey dataKey, float& value) const
+{
+ SysLogException(NID_UIX, E_INVALID_ARG, "[%s] %ls", GetErrorMessage(E_INVALID_ARG), W_MSG_INVALID_SENSOR_DATA_KEY);
+ return E_INVALID_ARG;
+}
+
+result
+DeviceOrientationSensorData::GetValue(SensorDataKey dataKey, bool& value) const
+{
+ SysLogException(NID_UIX, E_INVALID_ARG, "[%s] %ls", GetErrorMessage(E_INVALID_ARG), W_MSG_INVALID_SENSOR_DATA_KEY);
+ return E_INVALID_ARG;
+}
+} } }// Tizen::Uix::Sensor
--- /dev/null
+//
+// Open Service Platform
+// Copyright (c) 2012 Samsung Electronics Co., Ltd.
+//
+// Licensed under the Apache License, Version 2.0 (the License);
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+
+/**
+ * @file FUixSensorGravitySensorData.cpp
+ * @brief This is the implementation file for the %GravitySensorData class.
+ *
+ * This files contains implementation of the %GravitySensorData class.
+ */
+
+// Includes
+#include <FBaseErrors.h>
+#include <FBaseSysLog.h>
+#include <FBaseFloat.h>
+#include <FBaseLongLong.h>
+
+#include <FUixSensorGravitySensorData.h>
+#include "FUixSensor_SensorUtil.h"
+
+using namespace Tizen::Base;
+
+namespace Tizen { namespace Uix { namespace Sensor
+{
+namespace
+{
+static const wchar_t W_MSG_INVALID_SENSOR_DATA_KEY[] = L"A data matching the specified key and data type cannot be found.";
+} // Anonymous
+
+GravitySensorData::GravitySensorData(void)
+ : x(0.0F)
+ , y(0.0F)
+ , z(0.0F)
+{
+
+}
+
+GravitySensorData::~GravitySensorData(void)
+{
+
+}
+
+GravitySensorData::GravitySensorData(const GravitySensorData& rhs)
+ :x(rhs.x)
+ ,y(rhs.y)
+ ,z(rhs.z)
+{
+
+}
+
+GravitySensorData&
+GravitySensorData::operator =(const GravitySensorData& rhs)
+{
+ // check for self-assignment
+ if (this != &rhs)
+ {
+ timestamp = rhs.timestamp;
+ x = rhs.x;
+ y = rhs.y;
+ z = rhs.z;
+ }
+
+ return *this;
+}
+
+int
+GravitySensorData::GetHashCode(void) const
+{
+ int hash = 0;
+
+ hash += LongLong::GetHashCode(this->timestamp);
+ hash += Float::GetHashCode(this->x);
+ hash += Float::GetHashCode(this->y);
+ hash += Float::GetHashCode(this->z);
+
+ return hash;
+}
+
+bool
+GravitySensorData::Equals(const Object& rhs) const
+{
+ const GravitySensorData* pRhs = dynamic_cast <const GravitySensorData*>(&rhs);
+ if (pRhs == null)
+ {
+ return false;
+ }
+
+ if (this->timestamp != pRhs->timestamp)
+ {
+ return false;
+ }
+
+ if (this->x != pRhs->x)
+ {
+ return false;
+ }
+
+ if (this->y != pRhs->y)
+ {
+ return false;
+ }
+
+ if (this->z != pRhs->z)
+ {
+ return false;
+ }
+ return true;
+}
+
+result
+GravitySensorData::GetValue(SensorDataKey dataKey, long& value) const
+{
+ SysLogException(NID_UIX, E_INVALID_ARG, "[%s] %ls", GetErrorMessage(E_INVALID_ARG), W_MSG_INVALID_SENSOR_DATA_KEY);
+ return E_INVALID_ARG;
+}
+
+result
+GravitySensorData::GetValue(SensorDataKey dataKey, float& value) const
+{
+ SysLogException(NID_UIX, E_INVALID_ARG, "[%s] %ls", GetErrorMessage(E_INVALID_ARG), W_MSG_INVALID_SENSOR_DATA_KEY);
+ return E_INVALID_ARG;
+}
+
+result
+GravitySensorData::GetValue(SensorDataKey dataKey, bool& value) const
+{
+ SysLogException(NID_UIX, E_INVALID_ARG, "[%s] %ls", GetErrorMessage(E_INVALID_ARG), W_MSG_INVALID_SENSOR_DATA_KEY);
+ return E_INVALID_ARG;
+}
+} } } // Tizen::Uix::Sensor
// Includes
#include <FBaseErrors.h>
#include <FBaseSysLog.h>
+#include <FBaseFloat.h>
+#include <FBaseLongLong.h>
#include <FUixSensorGyroSensorData.h>
+using namespace Tizen::Base;
+
namespace Tizen { namespace Uix { namespace Sensor
{
namespace
}
+GyroSensorData::GyroSensorData(const GyroSensorData& rhs)
+ :x(rhs.x)
+ ,y(rhs.y)
+ ,z(rhs.z)
+{
+
+}
+
+GyroSensorData&
+GyroSensorData::operator =(const GyroSensorData& rhs)
+{
+ // check for self-assignment
+ if (this != &rhs)
+ {
+ timestamp = rhs.timestamp;
+ x = rhs.x;
+ y = rhs.y;
+ z = rhs.z;
+ }
+
+ return *this;
+}
+
+int
+GyroSensorData::GetHashCode(void) const
+{
+ int hash = 0;
+
+ hash += LongLong::GetHashCode(this->timestamp);
+ hash += Float::GetHashCode(this->x);
+ hash += Float::GetHashCode(this->y);
+ hash += Float::GetHashCode(this->z);
+
+ return hash;
+}
+
+bool
+GyroSensorData::Equals(const Object& rhs) const
+{
+ const GyroSensorData* pRhs = dynamic_cast <const GyroSensorData*>(&rhs);
+ if (pRhs == null)
+ {
+ return false;
+ }
+
+ if (this->timestamp != pRhs->timestamp)
+ {
+ return false;
+ }
+
+ if (this->x != pRhs->x)
+ {
+ return false;
+ }
+
+ if (this->y != pRhs->y)
+ {
+ return false;
+ }
+
+ if (this->z != pRhs->z)
+ {
+ return false;
+ }
+
+ return true;
+}
+
result
GyroSensorData::GetValue(SensorDataKey dataKey, long& value) const
{
// Includes
#include <FBaseErrors.h>
#include <FBaseSysLog.h>
+#include <FBaseFloat.h>
+#include <FBaseLongLong.h>
#include <FUixSensorLightSensorData.h>
+using namespace Tizen::Base;
+
namespace Tizen { namespace Uix { namespace Sensor
{
namespace
}
+LightSensorData::LightSensorData(const LightSensorData& rhs)
+ :level(rhs.level)
+{
+
+}
+
+LightSensorData&
+LightSensorData::operator =(const LightSensorData& rhs)
+{
+ // check for self-assignment
+ if (this != &rhs)
+ {
+ timestamp = rhs.timestamp;
+ level = rhs.level;
+ }
+
+ return *this;
+}
+
+int
+LightSensorData::GetHashCode(void) const
+{
+ int hash = 0;
+
+ hash += LongLong::GetHashCode(this->timestamp);
+ hash += Float::GetHashCode(this->level);
+
+ return hash;
+}
+
+bool
+LightSensorData::Equals(const Object& rhs) const
+{
+ const LightSensorData* pRhs = dynamic_cast <const LightSensorData*>(&rhs);
+ if (pRhs == null)
+ {
+ return false;
+ }
+
+ if (this->timestamp != pRhs->timestamp)
+ {
+ return false;
+ }
+
+ if (this->level != pRhs->level)
+ {
+ return false;
+ }
+
+ return true;
+}
result
LightSensorData::GetValue(SensorDataKey dataKey, long& value) const
{
// Includes
#include <FBaseErrors.h>
#include <FBaseSysLog.h>
-
+#include <FBaseFloat.h>
+#include <FBaseLongLong.h>
#include <FUixSensorMagneticSensorData.h>
#include "FUixSensor_SensorUtil.h"
+using namespace Tizen::Base;
+
namespace Tizen { namespace Uix { namespace Sensor
{
namespace
}
+MagneticSensorData::MagneticSensorData(const MagneticSensorData& rhs)
+ :x(rhs.x)
+ ,y(rhs.y)
+ ,z(rhs.z)
+{
+
+}
+
+MagneticSensorData&
+MagneticSensorData::operator =(const MagneticSensorData& rhs)
+{
+ // check for self-assignment
+ if (this != &rhs)
+ {
+ timestamp = rhs.timestamp;
+ x = rhs.x;
+ y = rhs.y;
+ z = rhs.z;
+ }
+
+ return *this;
+}
+
+int
+MagneticSensorData::GetHashCode(void) const
+{
+ int hash = 0;
+
+ hash += LongLong::GetHashCode(this->timestamp);
+ hash += Float::GetHashCode(this->x);
+ hash += Float::GetHashCode(this->y);
+ hash += Float::GetHashCode(this->z);
+
+ return hash;
+}
+
+bool
+MagneticSensorData::Equals(const Object& rhs) const
+{
+ const MagneticSensorData* pRhs = dynamic_cast <const MagneticSensorData*>(&rhs);
+ if (pRhs == null)
+ {
+ return false;
+ }
+
+ if (this->timestamp != pRhs->timestamp)
+ {
+ return false;
+ }
+
+ if (this->x != pRhs->x)
+ {
+ return false;
+ }
+
+ if (this->y != pRhs->y)
+ {
+ return false;
+ }
+
+ if (this->z != pRhs->z)
+ {
+ return false;
+ }
+
+
+ return true;
+}
result
MagneticSensorData::GetValue(SensorDataKey dataKey, long& value) const
{
// Includes
#include <FBaseErrors.h>
#include <FBaseSysLog.h>
+#include <FBaseFloat.h>
+#include <FBaseLongLong.h>
#include <FUixSensorProximitySensorData.h>
#include "FUixSensor_SensorUtil.h"
+using namespace Tizen::Base;
+
namespace Tizen { namespace Uix { namespace Sensor
{
namespace
}
+
+ProximitySensorData::ProximitySensorData(const ProximitySensorData& rhs)
+ :distance(rhs.distance)
+{
+
+}
+
+ProximitySensorData&
+ProximitySensorData::operator =(const ProximitySensorData& rhs)
+{
+ // check for self-assignment
+ if (this != &rhs)
+ {
+ timestamp = rhs.timestamp;
+ distance = rhs.distance;
+ }
+
+ return *this;
+}
+
+int
+ProximitySensorData::GetHashCode(void) const
+{
+ int hash = 0;
+
+ hash += LongLong::GetHashCode(this->timestamp);
+ hash += Float::GetHashCode(this->distance);
+
+ return hash;
+}
+
+bool
+ProximitySensorData::Equals(const Object& rhs) const
+{
+ const ProximitySensorData* pRhs = dynamic_cast <const ProximitySensorData*>(&rhs);
+ if (pRhs == null)
+ {
+ return false;
+ }
+
+ if (this->timestamp != pRhs->timestamp)
+ {
+ return false;
+ }
+
+ if (this->distance != pRhs->distance)
+ {
+ return false;
+ }
+
+ return true;
+}
+
result
ProximitySensorData::GetValue(SensorDataKey dataKey, long& value) const
{
// Includes
#include <FBaseErrors.h>
#include <FBaseSysLog.h>
-
#include <FUixSensorSensorData.h>
namespace Tizen { namespace Uix { namespace Sensor
// Includes
#include <FBaseErrors.h>
#include <FBaseSysLog.h>
+#include <FBaseFloat.h>
+#include <FBaseLongLong.h>
#include <FUixSensorTiltSensorData.h>
#include "FUixSensor_SensorUtil.h"
+using namespace Tizen::Base;
+
namespace Tizen { namespace Uix { namespace Sensor
{
namespace
}
+TiltSensorData::TiltSensorData(const TiltSensorData& rhs)
+ :azimuth(rhs.azimuth)
+ ,roll(rhs.roll)
+ ,pitch(rhs.pitch)
+{
+
+}
+
+TiltSensorData&
+TiltSensorData::operator =(const TiltSensorData& rhs)
+{
+ // check for self-assignment
+ if (this != &rhs)
+ {
+ timestamp = rhs.timestamp;
+ azimuth = rhs.azimuth;
+ roll = rhs.roll;
+ pitch = rhs.pitch;
+ }
+
+ return *this;
+}
+
+int
+TiltSensorData::GetHashCode(void) const
+{
+ int hash = 0;
+
+ hash += LongLong::GetHashCode(this->timestamp);
+ hash += Float::GetHashCode(this->azimuth);
+ hash += Float::GetHashCode(this->roll);
+ hash += Float::GetHashCode(this->pitch);
+
+ return hash;
+}
+
+bool
+TiltSensorData::Equals(const Object& rhs) const
+{
+ const TiltSensorData* pRhs = dynamic_cast <const TiltSensorData*>(&rhs);
+ if (pRhs == null)
+ {
+ return false;
+ }
+
+ if (this->timestamp != pRhs->timestamp)
+ {
+ return false;
+ }
+
+ if (this->azimuth != pRhs->azimuth)
+ {
+ return false;
+ }
+
+ if (this->roll != pRhs->roll)
+ {
+ return false;
+ }
+
+ if (this->pitch != pRhs->pitch)
+ {
+ return false;
+ }
+
+
+ return true;
+}
+
result
TiltSensorData::GetValue(SensorDataKey dataKey, long& value) const
{
--- /dev/null
+//
+// Open Service Platform
+// Copyright (c) 2012 Samsung Electronics Co., Ltd.
+//
+// Licensed under the Apache License, Version 2.0 (the License);
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+
+/**
+ * @file FUixSensorUserAccelerationSensorData.cpp
+ * @brief This is the implementation file for the %UserAccelerationSensorData class.
+ *
+ * This files contains implementation of the %GravitySensorData class.
+ */
+
+// Includes
+#include <FBaseErrors.h>
+#include <FBaseSysLog.h>
+#include <FBaseFloat.h>
+#include <FBaseLongLong.h>
+
+#include <FUixSensorUserAccelerationSensorData.h>
+#include "FUixSensor_SensorUtil.h"
+
+using namespace Tizen::Base;
+
+
+namespace Tizen { namespace Uix { namespace Sensor
+{
+namespace
+{
+static const wchar_t W_MSG_INVALID_SENSOR_DATA_KEY[] = L"A data matching the specified key and data type cannot be found.";
+} // Anonymous
+
+UserAccelerationSensorData::UserAccelerationSensorData(void)
+ : x(0.0F)
+ , y(0.0F)
+ , z(0.0F)
+{
+
+}
+
+UserAccelerationSensorData::~UserAccelerationSensorData(void)
+{
+
+}
+
+UserAccelerationSensorData::UserAccelerationSensorData(const UserAccelerationSensorData& rhs)
+ :x(rhs.x)
+ ,y(rhs.y)
+ ,z(rhs.z)
+{
+
+}
+
+UserAccelerationSensorData&
+UserAccelerationSensorData::operator =(const UserAccelerationSensorData& rhs)
+{
+ // check for self-assignment
+ if (this != &rhs)
+ {
+ timestamp = rhs.timestamp;
+ x = rhs.x;
+ y = rhs.y;
+ z = rhs.z;
+ }
+
+ return *this;
+}
+
+int
+UserAccelerationSensorData::GetHashCode(void) const
+{
+ int hash = 0;
+
+ hash += LongLong::GetHashCode(this->timestamp);
+ hash += Float::GetHashCode(this->x);
+ hash += Float::GetHashCode(this->y);
+ hash += Float::GetHashCode(this->z);
+
+ return hash;
+}
+
+bool
+UserAccelerationSensorData::Equals(const Object& rhs) const
+{
+ const UserAccelerationSensorData* pRhs = dynamic_cast <const UserAccelerationSensorData*>(&rhs);
+ if (pRhs == null)
+ {
+ return false;
+ }
+
+ if (this->timestamp != pRhs->timestamp)
+ {
+ return false;
+ }
+
+ if (this->x != pRhs->x)
+ {
+ return false;
+ }
+
+ if (this->y != pRhs->y)
+ {
+ return false;
+ }
+
+ if (this->z != pRhs->z)
+ {
+ return false;
+ }
+ return true;
+}
+
+result
+UserAccelerationSensorData::GetValue(SensorDataKey dataKey, long& value) const
+{
+ SysLogException(NID_UIX, E_INVALID_ARG, "[%s] %ls", GetErrorMessage(E_INVALID_ARG), W_MSG_INVALID_SENSOR_DATA_KEY);
+ return E_INVALID_ARG;
+}
+
+result
+UserAccelerationSensorData::GetValue(SensorDataKey dataKey, float& value) const
+{
+ SysLogException(NID_UIX, E_INVALID_ARG, "[%s] %ls", GetErrorMessage(E_INVALID_ARG), W_MSG_INVALID_SENSOR_DATA_KEY);
+ return E_INVALID_ARG;
+}
+
+result
+UserAccelerationSensorData::GetValue(SensorDataKey dataKey, bool& value) const
+{
+ SysLogException(NID_UIX, E_INVALID_ARG, "[%s] %ls", GetErrorMessage(E_INVALID_ARG), W_MSG_INVALID_SENSOR_DATA_KEY);
+ return E_INVALID_ARG;
+}
+} } } // Tizen::Uix::Sensor
20L, // SENSOR_TYPE_TILT
20L, // SENSOR_TYPE_GYRO
100L, // SENSOR_TYPE_LIGHT
+ 20L, // SENSOR_TYPE_GRAVITY
+ 20L, // SENSOR_TYPE_USER_ACCELERATION
+ 20L, // SENSOR_TYPE_DEVICE_ORIENTATION
};
static const long SENSOR_MAX_INTERVALS[] = {
100L, // SENSOR_TYPE_ACCELERATION
1000L, // SENSOR_TYPE_TILT
100L, // SENSOR_TYPE_GYRO
5000L, // SENSOR_TYPE_LIGHT
+ 100L, // SENSOR_TYPE_GRAVITY
+ 100L, // SENSOR_TYPE_USER_ACCELERATION
+ 100L, // SENSOR_TYPE_DEVICE_ORIENTATION
};
static const float MIN_VALUE_TILT = 0.0F;
static const float MAX_VALUE_TILT = 360.0F;
return SENSOR_GYROSCOPE;
case SENSOR_TYPE_LIGHT:
return SENSOR_LIGHT;
+ case SENSOR_TYPE_GRAVITY:
+ return SENSOR_GRAVITY;
+ case SENSOR_TYPE_USER_ACCELERATION:
+ return SENSOR_LINEAR_ACCELERATION;
+ case SENSOR_TYPE_DEVICE_ORIENTATION:
+ return SENSOR_DEVICE_ORIENTATION;
default:
SysAssertf(false, "ConvertToSensorTypeEFromSensorType() > Invalid SensorType [sensorType:%d]", sensorType);
SetLastResult(E_INVALID_ARG);
return SENSOR_GYROSCOPE;
case _SENSOR_CORE_EVENT_TYPE_LIGHT_LEVEL_DATA:
return SENSOR_LIGHT;
+ case _SENSOR_CORE_EVENT_TYPE_GRAVITY_DATA:
+ return SENSOR_GRAVITY;
+ case _SENSOR_CORE_EVENT_TYPE_USER_ACCELERATION_DATA:
+ return SENSOR_LINEAR_ACCELERATION;
+ case _SENSOR_CORE_EVENT_TYPE_DEVICE_ORIENTATION_DATA:
+ return SENSOR_DEVICE_ORIENTATION;
default:
SysAssertf(false, "GetSensorTypeEFromSensorCoreEventType() > Invalid _SensorCoreEventType [eventType:%d]", eventType);
SetLastResult(E_INVALID_ARG);
eventBuffer.isEventValid = IsAccuracyValid(accuracy);
eventBuffer.eventType = _SENSOR_CORE_EVENT_TYPE_ROTATION_RATE_DATA;
eventBuffer.eventTimestamp = CorrectTimestamp(timestamp);
- eventBuffer.eventKind.rotationRateData.x = x * DEGREE_TO_RADIAN;
- eventBuffer.eventKind.rotationRateData.y = y * DEGREE_TO_RADIAN;
- eventBuffer.eventKind.rotationRateData.z = z * DEGREE_TO_RADIAN;
+ eventBuffer.eventKind.rotationRateData.x = x;
+ eventBuffer.eventKind.rotationRateData.y = y;
+ eventBuffer.eventKind.rotationRateData.z = z;
receiver.OnSensorCoreEventReceived(eventBuffer);
}
void
OnAccelerationSensorWakeupEventReceived(void *pUserData)
{
- SysLog(NID_UIX, "Device wake up by Acceleration sensor.");
+ SysLog(NID_UIX, " OnAccelerationSensorWakeupEventReceived Device wake up by Acceleration sensor.");
+}
+
+void
+OnGravityDataEventReceived(unsigned long long timestamp, sensor_data_accuracy_e accuracy,float x, float y, float z, void* pUserData)
+{
+ _ISensorCoreEventReceiver& receiver= *static_cast<_ISensorCoreEventReceiver*>(pUserData);
+ _SensorCoreEvent& eventBuffer = receiver.GetSensorCoreEventBuffer();
+
+ SysLog(NID_UIX, "taehwan.son OnGravityDataEventReceived.");
+ eventBuffer.isEventValid = IsAccuracyValid(accuracy);
+ eventBuffer.eventType = _SENSOR_CORE_EVENT_TYPE_GRAVITY_DATA;
+ eventBuffer.eventTimestamp = CorrectTimestamp(timestamp);
+ eventBuffer.eventKind.gravityData.x = x;
+ eventBuffer.eventKind.gravityData.y = y;
+ eventBuffer.eventKind.gravityData.z = z;
+ receiver.OnSensorCoreEventReceived(eventBuffer);
+
+}
+
+void
+OnUserAccelerationDataEventReceived(unsigned long long timestamp, sensor_data_accuracy_e accuracy,float x, float y, float z, void* pUserData)
+{
+ _ISensorCoreEventReceiver& receiver= *static_cast<_ISensorCoreEventReceiver*>(pUserData);
+ _SensorCoreEvent& eventBuffer = receiver.GetSensorCoreEventBuffer();
+
+ SysLog(NID_UIX, "OnUserAccelerationDataEventReceived.");
+ eventBuffer.isEventValid = IsAccuracyValid(accuracy);
+ eventBuffer.eventType = _SENSOR_CORE_EVENT_TYPE_USER_ACCELERATION_DATA;
+ eventBuffer.eventTimestamp = CorrectTimestamp(timestamp);
+ eventBuffer.eventKind.userAccelerationData.x = x * METER_PER_SECOND_SQUARE_TO_G;
+ eventBuffer.eventKind.userAccelerationData.y = y * METER_PER_SECOND_SQUARE_TO_G;
+ eventBuffer.eventKind.userAccelerationData.z = z * METER_PER_SECOND_SQUARE_TO_G;
+ receiver.OnSensorCoreEventReceived(eventBuffer);
+}
+
+void
+OnDeviceOrientationDataEventReceived(unsigned long long timestamp, sensor_data_accuracy_e accuracy,float yaw, float pitch, float roll, void* pUserData)
+{
+ _ISensorCoreEventReceiver& receiver= *static_cast<_ISensorCoreEventReceiver*>(pUserData);
+ _SensorCoreEvent& eventBuffer = receiver.GetSensorCoreEventBuffer();
+
+ SysLog(NID_UIX, "OnDeviceOrientationDataEventReceived.");
+ eventBuffer.isEventValid = IsAccuracyValid(accuracy);
+ eventBuffer.eventType = _SENSOR_CORE_EVENT_TYPE_DEVICE_ORIENTATION_DATA;
+ eventBuffer.eventTimestamp = CorrectTimestamp(timestamp);
+ eventBuffer.eventKind.deviceOrientationData.yaw = yaw;
+ eventBuffer.eventKind.deviceOrientationData.pitch = pitch;
+ eventBuffer.eventKind.deviceOrientationData.roll = roll;
+ receiver.OnSensorCoreEventReceived(eventBuffer);
}
// Internal management methods ----------------------------------------------------------------------------------------------- //
sensorResult = sensor_awake_set_cb(sensorHandle, SENSOR_ACCELEROMETER, OnAccelerationSensorWakeupEventReceived, pUserData);
break;
}
+ case _SENSOR_CORE_EVENT_TYPE_GRAVITY_DATA:
+ {
+ sensorResult = sensor_gravity_set_cb(sensorHandle, interval, OnGravityDataEventReceived, pUserData);
+ break;
+ }
+ case _SENSOR_CORE_EVENT_TYPE_USER_ACCELERATION_DATA:
+ {
+ sensorResult = sensor_linear_acceleration_set_cb(sensorHandle, interval, OnUserAccelerationDataEventReceived, pUserData);
+ break;
+ }
+ case _SENSOR_CORE_EVENT_TYPE_DEVICE_ORIENTATION_DATA:
+ {
+ sensorResult = sensor_device_orientation_set_cb(sensorHandle, interval, OnDeviceOrientationDataEventReceived, pUserData);
+ break;
+ }
default:
{
// PARADOX
sensorResult = sensor_awake_unset_cb(sensorHandle, SENSOR_ACCELEROMETER);
break;
}
+ case _SENSOR_CORE_EVENT_TYPE_GRAVITY_DATA:
+ {
+ sensorResult = sensor_gravity_unset_cb(sensorHandle);
+ break;
+ }
+ case _SENSOR_CORE_EVENT_TYPE_USER_ACCELERATION_DATA:
+ {
+ sensorResult = sensor_linear_acceleration_unset_cb(sensorHandle);
+ break;
+ }
+ case _SENSOR_CORE_EVENT_TYPE_DEVICE_ORIENTATION_DATA:
+ {
+ sensorResult = sensor_device_orientation_unset_cb(sensorHandle);
+ break;
+ }
default:
{
// PARADOX
}
result
+StartSensorType(sensor_h sensorHandle, sensor_type_e sensorTypeE)
+{
+ int sensorResult = sensor_start(sensorHandle, sensorTypeE);
+ if (!IsSuccess(sensorResult))
+ {
+ // SENSOR_ERROR_IO_ERROR or SENSOR_ERROR_OPERATION_FAILED
+ if (_AppInfo::GetApiVersion() == Tizen::Base::_API_VERSION_2_0 && _AppInfo::IsOspCompat())
+ {
+ SysAssertf(false, "StartSensorCoreEventSensing() > sensor_start() failed. [handle:%p, sensorTypeE:%d, result:%d]", sensorHandle, sensorTypeE, sensorResult);
+ SetLastResult(E_DEVICE_UNAVAILABLE);
+ return E_DEVICE_UNAVAILABLE;
+ }
+ else
+ {
+ SysAssertf(false, "StartSensorCoreEventSensing() > sensor_start() failed. [handle:%p, sensorTypeE:%d, result:%d]", sensorHandle, sensorTypeE, sensorResult);
+ SetLastResult(E_OPERATION_FAILED);
+ return E_OPERATION_FAILED;
+ }
+ }
+
+ sensorResult = sensor_set_always_on(sensorHandle, sensorTypeE);
+ if (!IsSuccess(sensorResult))
+ {
+ // SENSOR_ERROR_IO_ERROR
+ if (_AppInfo::GetApiVersion() == Tizen::Base::_API_VERSION_2_0 && _AppInfo::IsOspCompat())
+ {
+ SysAssertf(false, "StartSensorCoreEventSensing() > sensor_set_always_on() failed. [handle:%p, sensorTypeE:%d, result:%d]", sensorHandle, sensorTypeE, sensorResult);
+ SetLastResult(E_DEVICE_UNAVAILABLE);
+ return E_DEVICE_UNAVAILABLE;
+ }
+ else
+ {
+ SysAssertf(false, "StartSensorCoreEventSensing() > sensor_set_always_on() failed. [handle:%p, sensorTypeE:%d, result:%d]", sensorHandle, sensorTypeE, sensorResult);
+ SetLastResult(E_OPERATION_FAILED);
+ return E_OPERATION_FAILED;
+ }
+ }
+ return E_SUCCESS;
+}
+
+result
StartSensorCoreEventSensing(sensor_h sensorHandle, _SensorCoreEventType eventType)
{
switch (eventType)
{
case _SENSOR_CORE_EVENT_TYPE_TILT_DATA:
{
- int sensorResult = sensor_start(sensorHandle, SENSOR_ACCELEROMETER);
- if (!IsSuccess(sensorResult))
- {
- // SENSOR_ERROR_IO_ERROR or SENSOR_ERROR_OPERATION_FAILED
- if (_AppInfo::GetApiVersion() == Tizen::Base::_API_VERSION_2_0 && _AppInfo::IsOspCompat())
- {
- SysAssertf(false, "StartSensorCoreEventSensing() > sensor_start() failed. [handle:%p, sensorTypeE:%d, result:%d]", sensorHandle, SENSOR_ACCELEROMETER, sensorResult);
- SetLastResult(E_DEVICE_UNAVAILABLE);
- return E_DEVICE_UNAVAILABLE;
- }
- else
- {
- SysAssertf(false, "StartSensorCoreEventSensing() > sensor_start() failed. [handle:%p, sensorTypeE:%d, result:%d]", sensorHandle, SENSOR_ACCELEROMETER, sensorResult);
- SetLastResult(E_OPERATION_FAILED);
- return E_OPERATION_FAILED;
- }
- }
-
- sensorResult = sensor_start(sensorHandle, SENSOR_ORIENTATION);
- if (!IsSuccess(sensorResult))
- {
- // SENSOR_ERROR_IO_ERROR or SENSOR_ERROR_OPERATION_FAILED
- sensor_stop(sensorHandle, SENSOR_ACCELEROMETER);
-
- if(_AppInfo::GetApiVersion() == Tizen::Base::_API_VERSION_2_0 && _AppInfo::IsOspCompat())
- {
- SysAssertf(false, "StartSensorCoreEventSensing() > sensor_start() failed. [handle:%p, sensorTypeE:%d, result:%d]", sensorHandle, SENSOR_ORIENTATION, sensorResult);
- SetLastResult(E_DEVICE_UNAVAILABLE);
- return E_DEVICE_UNAVAILABLE;
- }
- else
- {
- SysAssertf(false, "StartSensorCoreEventSensing() > sensor_start() failed. [handle:%p, sensorTypeE:%d, result:%d]", sensorHandle, SENSOR_ORIENTATION, sensorResult);
- SetLastResult(E_OPERATION_FAILED);
- return E_OPERATION_FAILED;
- }
-
- }
- sensorResult = sensor_set_always_on(sensorHandle, SENSOR_ACCELEROMETER);
- if (!IsSuccess(sensorResult))
- {
- // SENSOR_ERROR_IO_ERROR
- if (_AppInfo::GetApiVersion() == Tizen::Base::_API_VERSION_2_0 && _AppInfo::IsOspCompat())
- {
- SysAssertf(false, "StartSensorCoreEventSensing() > sensor_set_always_on() failed. [handle:%p, sensorTypeE:%d, result:%d]", sensorHandle, SENSOR_ACCELEROMETER, sensorResult);
- SetLastResult(E_DEVICE_UNAVAILABLE);
- return E_DEVICE_UNAVAILABLE;
- }
- else
- {
- SysAssertf(false, "StartSensorCoreEventSensing() > sensor_set_always_on() failed. [handle:%p, sensorTypeE:%d, result:%d]", sensorHandle, SENSOR_ACCELEROMETER, sensorResult);
- SetLastResult(E_OPERATION_FAILED);
- return E_OPERATION_FAILED;
- }
- }
- sensorResult = sensor_set_always_on(sensorHandle, SENSOR_ORIENTATION);
- if (!IsSuccess(sensorResult))
- {
- // SENSOR_ERROR_IO_ERROR
- if (_AppInfo::GetApiVersion() == Tizen::Base::_API_VERSION_2_0 && _AppInfo::IsOspCompat())
- {
- SysAssertf(false, "StartSensorCoreEventSensing() > sensor_set_always_on() failed. [handle:%p, sensorTypeE:%d, result:%d]", sensorHandle, SENSOR_ORIENTATION, sensorResult);
- SetLastResult(E_DEVICE_UNAVAILABLE);
- return E_DEVICE_UNAVAILABLE;
- }
- else
- {
- SysAssertf(false, "StartSensorCoreEventSensing() > sensor_set_always_on() failed. [handle:%p, sensorTypeE:%d, result:%d]", sensorHandle, SENSOR_ORIENTATION, sensorResult);
- SetLastResult(E_OPERATION_FAILED);
- return E_OPERATION_FAILED;
- }
-
- }
+ StartSensorType(sensorHandle,SENSOR_ACCELEROMETER);
+ StartSensorType(sensorHandle,SENSOR_ORIENTATION);
+ break;
+ }
+ case _SENSOR_CORE_EVENT_TYPE_GRAVITY_DATA:
+ {
+ SysLog(NID_UIX,"taehwan.son ");
+ StartSensorType(sensorHandle,SENSOR_GRAVITY);
break;
}
default:
{
sensor_type_e sensorTypeE = GetSensorTypeEFromSensorCoreEventType(eventType);
-
- int sensorResult = sensor_start(sensorHandle, sensorTypeE);
- if (!IsSuccess(sensorResult))
- {
- // SENSOR_ERROR_IO_ERROR or SENSOR_ERROR_OPERATION_FAILED
- if(_AppInfo::GetApiVersion() == Tizen::Base::_API_VERSION_2_0 && _AppInfo::IsOspCompat())
- {
- SysAssertf(false, "StartSensorCoreEventSensing() > sensor_start() failed. [handle:%p, sensorTypeE:%d, result:%d]", sensorHandle, sensorTypeE, sensorResult);
- SetLastResult(E_DEVICE_UNAVAILABLE);
- return E_DEVICE_UNAVAILABLE;
- }
- else
- {
- SysAssertf(false, "StartSensorCoreEventSensing() > sensor_start() failed. [handle:%p, sensorTypeE:%d, result:%d]", sensorHandle, sensorTypeE, sensorResult);
- SetLastResult(E_OPERATION_FAILED);
- return E_OPERATION_FAILED;
- }
- }
- sensorResult = sensor_set_always_on(sensorHandle, sensorTypeE);
- if (!IsSuccess(sensorResult))
- {
- // SENSOR_ERROR_IO_ERROR
- if (_AppInfo::GetApiVersion() == Tizen::Base::_API_VERSION_2_0 && _AppInfo::IsOspCompat())
- {
- SysAssertf(false, "StartSensorCoreEventSensing() > sensor_set_always_on() failed. [handle:%p, sensorTypeE:%d, result:%d]", sensorHandle, sensorTypeE, sensorResult);
- SetLastResult(E_DEVICE_UNAVAILABLE);
- return E_DEVICE_UNAVAILABLE;
- }
- else
- {
- SysAssertf(false, "StartSensorCoreEventSensing() > sensor_set_always_on() failed. [handle:%p, sensorTypeE:%d, result:%d]", sensorHandle, sensorTypeE, sensorResult);
- SetLastResult(E_OPERATION_FAILED);
- return E_OPERATION_FAILED;
- }
- }
+ StartSensorType(sensorHandle,sensorTypeE);
break;
}
}
+ return E_SUCCESS;
+}
+
+result
+StopSensorType(sensor_h sensorHandle, sensor_type_e sensorTypeE)
+{
+ int sensorResult = sensor_stop(sensorHandle,sensorTypeE );
+ if (!IsSuccess(sensorResult))
+ {
+ if (_AppInfo::GetApiVersion() == Tizen::Base::_API_VERSION_2_0 && _AppInfo::IsOspCompat())
+ {
+ // SENSOR_ERROR_IO_ERROR
+ SysAssertf(false, "StartSensorCoreEventSensing() > sensor_stop() failed. [handle:%p, sensorTypeE:%d, result:%d]", sensorHandle, sensorTypeE, sensorResult);
+ SetLastResult(E_DEVICE_UNAVAILABLE);
+ return E_DEVICE_UNAVAILABLE;
+ }
+ else
+ {
+ SysAssertf(false, "StartSensorCoreEventSensing() > sensor_stop() failed. [handle:%p, sensorTypeE:%d, result:%d]", sensorHandle, sensorTypeE, sensorResult);
+ SetLastResult(E_OPERATION_FAILED);
+ return E_OPERATION_FAILED;
+ }
+ }
return E_SUCCESS;
}
{
case _SENSOR_CORE_EVENT_TYPE_TILT_DATA:
{
- int sensorResult = sensor_stop(sensorHandle, SENSOR_ORIENTATION);
- if (!IsSuccess(sensorResult))
- {
- // SENSOR_ERROR_IO_ERROR
- if (_AppInfo::GetApiVersion() == Tizen::Base::_API_VERSION_2_0 && _AppInfo::IsOspCompat())
- {
- SysAssertf(false, "StartSensorCoreEventSensing() > sensor_stop() failed. [handle:%p, sensorTypeE:%d, result:%d]", sensorHandle, SENSOR_ORIENTATION, sensorResult);
- SetLastResult(E_DEVICE_UNAVAILABLE);
- return E_DEVICE_UNAVAILABLE;
- }
- else
- {
- SysAssertf(false, "StartSensorCoreEventSensing() > sensor_stop() failed. [handle:%p, sensorTypeE:%d, result:%d]", sensorHandle, SENSOR_ACCELEROMETER, sensorResult);
- SetLastResult(E_OPERATION_FAILED);
- return E_OPERATION_FAILED;
- }
-
- }
-
- sensorResult = sensor_stop(sensorHandle, SENSOR_ACCELEROMETER);
- if (!IsSuccess(sensorResult))
- {
- if (_AppInfo::GetApiVersion() == Tizen::Base::_API_VERSION_2_0 && _AppInfo::IsOspCompat())
- {
- // SENSOR_ERROR_IO_ERROR
- SysAssertf(false, "StartSensorCoreEventSensing() > sensor_stop() failed. [handle:%p, sensorTypeE:%d, result:%d]", sensorHandle, SENSOR_ACCELEROMETER, sensorResult);
- SetLastResult(E_DEVICE_UNAVAILABLE);
- return E_DEVICE_UNAVAILABLE;
- }
- else
- {
- SysAssertf(false, "StartSensorCoreEventSensing() > sensor_stop() failed. [handle:%p, sensorTypeE:%d, result:%d]", sensorHandle, SENSOR_ACCELEROMETER, sensorResult);
- SetLastResult(E_OPERATION_FAILED);
- return E_OPERATION_FAILED;
- }
-
- }
+ StopSensorType(sensorHandle,SENSOR_ORIENTATION );
+ StopSensorType(sensorHandle,SENSOR_ACCELEROMETER );
+ break;
+ }
+ case _SENSOR_CORE_EVENT_TYPE_GRAVITY_DATA:
+ {
+ StopSensorType(sensorHandle,SENSOR_GRAVITY);
break;
}
default:
{
sensor_type_e sensorTypeE = GetSensorTypeEFromSensorCoreEventType(eventType);
-
- int sensorResult = sensor_stop(sensorHandle, sensorTypeE);
- if (!IsSuccess(sensorResult))
- {
- if (_AppInfo::GetApiVersion() == Tizen::Base::_API_VERSION_2_0 && _AppInfo::IsOspCompat())
- {
- SysAssertf(false, "StopSensorCoreEventSensing() > sensor_stop() failed. [handle:%p, sensorTypeE:%d, result:%d]", sensorHandle, sensorTypeE, sensorResult);
- SetLastResult(E_DEVICE_UNAVAILABLE);
- return E_DEVICE_UNAVAILABLE;
- }
- else
- {
- SysAssertf(false, "StopSensorCoreEventSensing() > sensor_stop() failed. [handle:%p, sensorTypeE:%d, result:%d]", sensorHandle, sensorTypeE, sensorResult);
- SetLastResult(E_OPERATION_FAILED);
- return E_OPERATION_FAILED;
- }
- // SENSOR_ERROR_IO_ERROR
- }
+ StopSensorType(sensorHandle,sensorTypeE);
break;
}
}
sensorResult = sensor_light_set_interval(sensorHandle, interval);
break;
}
+ case _SENSOR_CORE_EVENT_TYPE_GRAVITY_DATA:
+ {
+ sensorResult = sensor_gravity_set_interval(sensorHandle, interval);
+ break;
+ }
+ case _SENSOR_CORE_EVENT_TYPE_USER_ACCELERATION_DATA:
+ {
+ sensorResult = sensor_gravity_set_interval(sensorHandle, interval);
+ break;
+ }
+ case _SENSOR_CORE_EVENT_TYPE_DEVICE_ORIENTATION_DATA:
+ {
+ sensorResult = sensor_gravity_set_interval(sensorHandle, interval);
+ break;
+ }
default:
{
// PARADOX
}
break;
+
+ case MOTION_ENGINE_EVENT_DIRECT_CALL:
+ {
+ SysLog(NID_UIX, "Detected MOVE_TO_EAR event(%d)\n", eventData);
+
+ if (eventData == MOTION_ENGINE_DIRECT_CALL_DETECTION)
+ pMotionEventListener->OnMoveToEarDetected();
+
+ }
+ break;
}
}
}
SysTryReturnVoidResult(NID_UIX, ret == 0, E_INVALID_STATE, "[E_INVALID_STATE] Failed to unregister motion double tap event.");
}
}
+
+ if (type & MOTION_TYPE_MOVE_TO_EAR)
+ {
+ if (__motionType & MOTION_TYPE_MOVE_TO_EAR)
+ {
+ SysLog(NID_UIX, "MOTION_TYPE_MOVE_TO_EAR is already registered.");
+ }
+ else
+ {
+ ret = sf_register_event(__handle, MOTION_ENGINE_EVENT_DIRECT_CALL, null, __MotionEventReceiver, (void*) __pIMotionEventListener);
+ SysTryReturnVoidResult(NID_UIX, ret == 0, E_INVALID_STATE, "[E_INVALID_STATE] Failed to register motion direct call event.");
+ }
+ }
+ else
+ {
+ if (__motionType & MOTION_TYPE_MOVE_TO_EAR)
+ {
+ ret = sf_unregister_event(__handle, MOTION_ENGINE_EVENT_DIRECT_CALL);
+ SysTryReturnVoidResult(NID_UIX, ret == 0, E_INVALID_STATE, "[E_INVALID_STATE] Failed to unregister motion direct call event.");
+ }
+ }
__motionType = type;
SetLastResult(E_SUCCESS);
case MOTION_TYPE_SHAKE:
// fall through
case MOTION_TYPE_DOUBLETAP:
+ // fall through
+ case MOTION_TYPE_MOVE_TO_EAR:
+
isSupported = true;
break;
bool
_MotionImpl::IsMotionTypeValid(unsigned long type)
{
- if (type > MOTION_TYPE_NONE && type <= (MOTION_TYPE_SNAP | MOTION_TYPE_SHAKE | MOTION_TYPE_DOUBLETAP))
+ if (type > MOTION_TYPE_NONE && type <= (MOTION_TYPE_SNAP | MOTION_TYPE_SHAKE | MOTION_TYPE_DOUBLETAP | MOTION_TYPE_MOVE_TO_EAR))
{
return true;
}
_SENSOR_CORE_EVENT_TYPE_ROTATION_RATE_DATA,
_SENSOR_CORE_EVENT_TYPE_LIGHT_LEVEL_DATA,
_SENSOR_CORE_EVENT_TYPE_ACCELERATION_SENSOR_WAKEUP,
+ _SENSOR_CORE_EVENT_TYPE_GRAVITY_DATA,
+ _SENSOR_CORE_EVENT_TYPE_USER_ACCELERATION_DATA,
+ _SENSOR_CORE_EVENT_TYPE_DEVICE_ORIENTATION_DATA,
_SENSOR_CORE_EVENT_TYPE_MAX,
_SENSOR_CORE_EVENT_TYPE_NONE = -1,
};
float azimuth;
};
+struct _SensorCoreEventDeviceOrientationAxisOf3Dimension
+{
+ float yaw;
+ float roll;
+ float pitch;
+};
+
+
struct _SensorCoreEventLevel
{
float level;
_SensorCoreEventTiltAxisOf3Dimension tiltData;
_SensorCoreEventAxisOf3Dimension rotationRateData;
_SensorCoreEventLevel lightLevelData;
+ _SensorCoreEventAxisOf3Dimension gravityData;
+ _SensorCoreEventAxisOf3Dimension userAccelerationData;
+ _SensorCoreEventDeviceOrientationAxisOf3Dimension deviceOrientationData;
};
struct _SensorCoreEvent
#include <FUixSensorTiltSensorData.h>
#include <FUixSensorGyroSensorData.h>
#include <FUixSensorLightSensorData.h>
+#include <FUixSensorGravitySensorData.h>
+#include <FUixSensorUserAccelerationSensorData.h>
+#include <FUixSensorDeviceOrientationSensorData.h>
+
#include <FUixSensorISensorEventListener.h>
#include "FUixSensor_SensorEventDeliverer.h"
return _SENSOR_CORE_EVENT_TYPE_ROTATION_RATE_DATA;
case SENSOR_TYPE_LIGHT:
return _SENSOR_CORE_EVENT_TYPE_LIGHT_LEVEL_DATA;
+ case SENSOR_TYPE_GRAVITY:
+ return _SENSOR_CORE_EVENT_TYPE_GRAVITY_DATA;
+ case SENSOR_TYPE_USER_ACCELERATION:
+ return _SENSOR_CORE_EVENT_TYPE_USER_ACCELERATION_DATA;
+ case SENSOR_TYPE_DEVICE_ORIENTATION:
+ return _SENSOR_CORE_EVENT_TYPE_DEVICE_ORIENTATION_DATA;
default:
SysAssertf(false, "ConvertToSensorCoreEventTypeFromSensorType() > Invalid SensorType [sensorType:%d]", sensorType);
return _SENSOR_CORE_EVENT_TYPE_NONE;
}
break;
}
+ case _SENSOR_CORE_EVENT_TYPE_GRAVITY_DATA:
+ {
+ if (IsEquals(before.eventKind.gravityData.x, after.eventKind.gravityData.x) &&
+ IsEquals(before.eventKind.gravityData.y, after.eventKind.gravityData.y) &&
+ IsEquals(before.eventKind.gravityData.z, after.eventKind.gravityData.z))
+ {
+ return false;
+ }
+ break;
+ }
+ case _SENSOR_CORE_EVENT_TYPE_USER_ACCELERATION_DATA:
+ {
+ if (IsEquals(before.eventKind.userAccelerationData.x, after.eventKind.userAccelerationData.x) &&
+ IsEquals(before.eventKind.userAccelerationData.y, after.eventKind.userAccelerationData.y) &&
+ IsEquals(before.eventKind.userAccelerationData.z, after.eventKind.userAccelerationData.z))
+ {
+ return false;
+ }
+ break;
+ }
+ case _SENSOR_CORE_EVENT_TYPE_DEVICE_ORIENTATION_DATA:
+ {
+ if (IsEquals(before.eventKind.deviceOrientationData.yaw, after.eventKind.deviceOrientationData.yaw) &&
+ IsEquals(before.eventKind.deviceOrientationData.roll, after.eventKind.deviceOrientationData.roll) &&
+ IsEquals(before.eventKind.deviceOrientationData.pitch, after.eventKind.deviceOrientationData.pitch))
+ {
+ return false;
+ }
+ break;
+ }
default:
{
SysAssertf(false, "IsSensorCoreEventChanged() > Invalid _SensorCoreEventType [eventType:%d]", eventType);
static_cast<LightSensorData&>(sensorDataBuffer).level = event.eventKind.lightLevelData.level;
break;
}
+ case _SENSOR_CORE_EVENT_TYPE_GRAVITY_DATA:
+ {
+ static_cast<GravitySensorData&>(sensorDataBuffer).x = event.eventKind.gravityData.x;
+ static_cast<GravitySensorData&>(sensorDataBuffer).y = event.eventKind.gravityData.y;
+ static_cast<GravitySensorData&>(sensorDataBuffer).z = event.eventKind.gravityData.z;
+ break;
+ }
+ case _SENSOR_CORE_EVENT_TYPE_USER_ACCELERATION_DATA:
+ {
+ static_cast<UserAccelerationSensorData&>(sensorDataBuffer).x = event.eventKind.userAccelerationData.x;
+ static_cast<UserAccelerationSensorData&>(sensorDataBuffer).y = event.eventKind.userAccelerationData.y;
+ static_cast<UserAccelerationSensorData&>(sensorDataBuffer).z = event.eventKind.userAccelerationData.z;
+ break;
+ }
+ case _SENSOR_CORE_EVENT_TYPE_DEVICE_ORIENTATION_DATA:
+ {
+ static_cast<DeviceOrientationSensorData&>(sensorDataBuffer).yaw = event.eventKind.deviceOrientationData.yaw;
+ static_cast<DeviceOrientationSensorData&>(sensorDataBuffer).roll = event.eventKind.deviceOrientationData.roll;
+ static_cast<DeviceOrientationSensorData&>(sensorDataBuffer).pitch = event.eventKind.deviceOrientationData.pitch;
+ break;
+ }
default:
{
SysAssertf(false, "OnSensorCoreEventReceived() > Invalid _SensorCoreEventType [eventType:%d]", eventType);
#include <FUixSensorTiltSensorData.h>
#include <FUixSensorGyroSensorData.h>
#include <FUixSensorLightSensorData.h>
+#include <FUixSensorGravitySensorData.h>
+#include <FUixSensorUserAccelerationSensorData.h>
+#include <FUixSensorDeviceOrientationSensorData.h>
#include <FApp_AppInfo.h>
#include <FUixSensor_SensorManagerImpl.h>
return new (std::nothrow) _SpecifiedSensorDataEventDelivererT<GyroSensorData>();
case SENSOR_TYPE_LIGHT:
return new (std::nothrow) _SpecifiedSensorDataEventDelivererT<LightSensorData>();
+ case SENSOR_TYPE_GRAVITY:
+ return new (std::nothrow) _SpecifiedSensorDataEventDelivererT<GravitySensorData>();
+ case SENSOR_TYPE_USER_ACCELERATION:
+ return new (std::nothrow) _SpecifiedSensorDataEventDelivererT<UserAccelerationSensorData>();
+ case SENSOR_TYPE_DEVICE_ORIENTATION:
+ return new (std::nothrow) _SpecifiedSensorDataEventDelivererT<DeviceOrientationSensorData>();
default:
SysAssertf(false, "CreateSensorDataDelivererN() > Invalid SensorType [sensorType:%d]", sensorType);
return null;