X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=adaptors%2Ftizen%2Ftilt-sensor-impl-tizen.cpp;h=58cf46d734454c0cb363603acba8076fe8cf471c;hb=bcfff8de93fcf1704dbdc01a33137afb6014f092;hp=1f989f7ab558be6e54b1cbd46eb49867a942b143;hpb=76c462a74205707283c580741c7342046f5dc73b;p=platform%2Fcore%2Fuifw%2Fdali-adaptor.git diff --git a/adaptors/tizen/tilt-sensor-impl-tizen.cpp b/adaptors/tizen/tilt-sensor-impl-tizen.cpp index 1f989f7..58cf46d 100644 --- a/adaptors/tizen/tilt-sensor-impl-tizen.cpp +++ b/adaptors/tizen/tilt-sensor-impl-tizen.cpp @@ -229,7 +229,7 @@ void TiltSensor::Disconnect() bool TiltSensor::Start() { - if(mSensorListener && mState == CONNECTED) + if( mSensorListener && ( mState == CONNECTED || mState == STOPPED ) ) { #ifdef SENSOR_ENABLED int ret = 0; @@ -247,9 +247,14 @@ bool TiltSensor::Start() } else { - if(mState != CONNECTED) + if( mState == STARTED ) { - DALI_LOG_ERROR("Wrong state [%d]\n", mState); + DALI_LOG_ERROR("TiltSensor is already started. Current state [%d]\n", mState); + } + else + { + // mState is DISCONNECTED + DALI_LOG_ERROR("TiltSensor is disconnected. Current state [%d]\n", mState); } return false; } @@ -267,19 +272,7 @@ void TiltSensor::Stop() #endif } -bool TiltSensor::Enable() -{ - // start sensor callback - return Start(); -} - -void TiltSensor::Disable() -{ - // stop sensor callback - Stop(); -} - -bool TiltSensor::IsEnabled() const +bool TiltSensor::IsStarted() const { return ( mSensorListener && mState == STARTED ); }