*supported = false;
ASSERT_SUPPORTED(FEATURE_ACTIVITY);
+ //LCOV_EXCL_START
ASSERT_NOT_NULL(supported);
IF_FAIL_RETURN(IS_VALID_ACTIVITY(activity), ERR_INVALID_PARAMETER);
*supported = ActivitySensor::isSupported(activity);
return ERR_NONE;
+ //LCOV_EXCL_STOP
}
EXPORT_API int activity_create(activity_h *handle)
{
ASSERT_SUPPORTED(FEATURE_ACTIVITY);
+ //LCOV_EXCL_START
ASSERT_NOT_NULL(handle);
_activity_handle_s *hdl = static_cast<activity_h>(malloc(sizeof(_activity_handle_s)));
*handle = hdl;
return ERR_NONE;
+ //LCOV_EXCL_STOP
}
EXPORT_API int activity_release(activity_h handle)
{
ASSERT_SUPPORTED(FEATURE_ACTIVITY);
+ //LCOV_EXCL_START
ASSERT_NOT_NULL(handle);
delete handle->sensor;
free(handle);
return ERR_NONE;
+ //LCOV_EXCL_STOP
}
EXPORT_API int activity_start_recognition(activity_h handle, activity_type_e activity, activity_recognition_cb callback, void *user_data)
{
ASSERT_SUPPORTED(FEATURE_ACTIVITY);
+ //LCOV_EXCL_START
ASSERT_NOT_NULL(handle);
ASSERT_NOT_NULL(callback);
IF_FAIL_RETURN(IS_VALID_ACTIVITY(activity), ERR_INVALID_PARAMETER);
}
return ERR_NONE;
+ //LCOV_EXCL_STOP
}
EXPORT_API int activity_stop_recognition(activity_h handle)
{
ASSERT_SUPPORTED(FEATURE_ACTIVITY);
+ //LCOV_EXCL_START
ASSERT_NOT_NULL(handle);
IF_FAIL_RETURN(handle->sensor->stop(), ACTIVITY_ERROR_NOT_STARTED);
return ERR_NONE;
+ //LCOV_EXCL_STOP
}
EXPORT_API int activity_get_accuracy(const activity_data_h data, activity_accuracy_e *accuracy)
{
ASSERT_SUPPORTED(FEATURE_ACTIVITY);
+ //LCOV_EXCL_START
ASSERT_NOT_NULL(data);
ASSERT_NOT_NULL(accuracy);
*accuracy = static_cast<activity_accuracy_e>(data->accuracy);
return ERR_NONE;
+ //LCOV_EXCL_STOP
}
~ActivityListener()
{
}
-
+ //LCOV_EXCL_START
void onEvent(double timestamp, float* values, int accuracy)
{
ActivitySensor::onEvent(timestamp, values, accuracy);
}
+ //LCOV_EXCL_STOP
};
static ActivityListener __activityListener;
std::set<ActivitySensor*> ActivitySensor::__sensorSet;
SensorAdapter ActivitySensor::__sensorAdapter(&__activityListener);
+//LCOV_EXCL_START
ActivitySensor::ActivitySensor() :
__activityType(static_cast<activity_type_e>(UNDEFINED)),
__callback(NULL),
}
}
}
+//LCOV_EXCL_STOP
*supported = false;
ASSERT_SUPPORTED(FEATURE_GESTURE);
+ //LCOV_EXCL_START
ASSERT_NOT_NULL(supported);
IF_FAIL_RETURN(IS_VALID_GESTURE(gesture), ERR_INVALID_PARAMETER);
*supported = GestureSensor::isSupported(gesture);
return ERR_NONE;
+ //LCOV_EXCL_STOP
}
EXPORT_API int gesture_create(gesture_h *handle)
{
ASSERT_SUPPORTED(FEATURE_GESTURE);
+ //LCOV_EXCL_START
ASSERT_NOT_NULL(handle);
_gesture_handle_s *hdl = static_cast<gesture_h>(malloc(sizeof(_gesture_handle_s)));
*handle = hdl;
return ERR_NONE;
+ //LCOV_EXCL_STOP
}
EXPORT_API int gesture_release(gesture_h handle)
{
ASSERT_SUPPORTED(FEATURE_GESTURE);
+ //LCOV_EXCL_START
ASSERT_NOT_NULL(handle);
delete handle->sensor;
free(handle);
return ERR_NONE;
+ //LCOV_EXCL_STOP
}
EXPORT_API int gesture_start_recognition(gesture_h handle, gesture_type_e gesture, gesture_option_e option, gesture_recognition_cb callback, void *user_data)
{
ASSERT_SUPPORTED(FEATURE_GESTURE);
+ //LCOV_EXCL_START
ASSERT_NOT_NULL(handle);
ASSERT_NOT_NULL(callback);
IF_FAIL_RETURN(IS_VALID_GESTURE(gesture), ERR_INVALID_PARAMETER);
}
return ERR_NONE;
+ //LCOV_EXCL_STOP
}
EXPORT_API int gesture_stop_recognition(gesture_h handle)
{
ASSERT_SUPPORTED(FEATURE_GESTURE);
+ //LCOV_EXCL_START
ASSERT_NOT_NULL(handle);
IF_FAIL_RETURN(handle->sensor->stop(), GESTURE_ERROR_NOT_STARTED);
return ERR_NONE;
+ //LCOV_EXCL_STOP
}
EXPORT_API int gesture_get_event(const gesture_data_h data, gesture_event_e *event)
{
ASSERT_SUPPORTED(FEATURE_GESTURE);
+ //LCOV_EXCL_START
ASSERT_NOT_NULL(data);
ASSERT_NOT_NULL(event);
*event = static_cast<gesture_event_e>(data->event);
return ERR_NONE;
+ //LCOV_EXCL_STOP
}
EXPORT_API int gesture_get_tilt(const gesture_data_h data, int *x, int *y)
{
ASSERT_SUPPORTED(FEATURE_GESTURE);
+ //LCOV_EXCL_START
ASSERT_NOT_NULL(data);
ASSERT_NOT_NULL(x);
ASSERT_NOT_NULL(y);
*y = data->tilt_y;
return ERR_NONE;
+ //LCOV_EXCL_STOP
}
using namespace motion;
+//LCOV_EXCL_START
GestureSensor::GestureSensor() :
__gestureType(static_cast<gesture_type_e>(UNDEFINED)),
__callback(NULL),
return UNKNOWN_SENSOR;
}
}
+//LCOV_EXCL_STOP
stop();
}
+//LCOV_EXCL_START
void SensorAdapter::setSensor(sensor_type_t type)
{
__sensorType = type;
SensorAdapter *instance = static_cast<SensorAdapter*>(cbData);
instance->__onEvent(eventData);
}
+//LCOV_EXCL_STOP