From 5e9e5598f9ce14211a6e553510cac6e1fadd912e Mon Sep 17 00:00:00 2001 From: Somin Kim Date: Wed, 8 Feb 2017 14:26:28 +0900 Subject: [PATCH 01/16] Fix svace issue(remove unused variable) Change-Id: I5601efe2c158da93d7c91c3aac7e3392f4179276 Signed-off-by: Somin Kim (cherry picked from commit aaed994cf29919192e8915ca8674647318e7e7dc) --- src/SensorAdapter.h | 1 - 1 file changed, 1 deletion(-) diff --git a/src/SensorAdapter.h b/src/SensorAdapter.h index 66ac04d..c161d43 100644 --- a/src/SensorAdapter.h +++ b/src/SensorAdapter.h @@ -47,7 +47,6 @@ namespace motion { int __sensorHandle; sensor_type_t __sensorType; bool __powerSave; - void *__userData; ISensorListener *__listener; }; -- 2.7.4 From 085f9ef641cd603d5c73a08fda6a6d7e4058e537 Mon Sep 17 00:00:00 2001 From: Mu-Woong Lee Date: Thu, 2 Mar 2017 12:40:54 +0900 Subject: [PATCH 02/16] Update the license date to 2014-2017 Change-Id: Ib8959b8e271b0ea9f3081374d5dd6d4bc09cd149 Signed-off-by: Mu-Woong Lee --- LICENSE | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LICENSE b/LICENSE index 87979c5..6ce6ec7 100644 --- a/LICENSE +++ b/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2014 - 2016 Samsung Electronics Co., Ltd. All rights reserved. +Copyright (c) 2014 - 2017 Samsung Electronics Co., Ltd. All rights reserved. Apache License Version 2.0, January 2004 -- 2.7.4 From 9a6cc495085ac5f2da1566ec6d4832f77da2a278 Mon Sep 17 00:00:00 2001 From: Mu-Woong Lee Date: Thu, 2 Mar 2017 12:37:56 +0900 Subject: [PATCH 03/16] Rename the package to capi-context-motion from motion Change-Id: I7a8f5eb3009d224475dddbbeb103a2336a9f6fd6 Signed-off-by: Mu-Woong Lee --- CMakeLists.txt | 7 ++--- motion.pc.in => capi-context-motion.pc.in | 0 ...otion.manifest => capi-context-motion.manifest} | 0 .../{motion.spec => capi-context-motion.spec} | 32 +++++++--------------- 4 files changed, 13 insertions(+), 26 deletions(-) rename motion.pc.in => capi-context-motion.pc.in (100%) rename packaging/{motion.manifest => capi-context-motion.manifest} (100%) rename packaging/{motion.spec => capi-context-motion.spec} (62%) diff --git a/CMakeLists.txt b/CMakeLists.txt index d6db33d..d8f80d9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,9 +1,8 @@ CMAKE_MINIMUM_REQUIRED(VERSION 2.6) -PROJECT(motion) +PROJECT(capi-context-motion) INCLUDE(GNUInstallDirs) -# Target lib (for backward compatibility, the below old naming is used) -SET(target "core-context-manager") +SET(target ${PROJECT_NAME}) # Source Lists FILE(GLOB SRCS src/*.cpp) @@ -30,7 +29,7 @@ ENDFOREACH(flag) ADD_LIBRARY(${target} SHARED ${SRCS}) TARGET_LINK_LIBRARIES(${target} ${pkgs_LDFLAGS}) SET_TARGET_PROPERTIES(${target} PROPERTIES COMPILE_FLAGS ${EXTRA_CFLAGS}) -SET_TARGET_PROPERTIES(${target} PROPERTIES COMPILE_DEFINITIONS "LOG_TAG=\"CONTEXT-LIB\"") +SET_TARGET_PROPERTIES(${target} PROPERTIES COMPILE_DEFINITIONS "LOG_TAG=\"MOTION\"") SET_TARGET_PROPERTIES(${target} PROPERTIES SOVERSION ${MAJORVER}) SET_TARGET_PROPERTIES(${target} PROPERTIES VERSION ${FULLVER}) diff --git a/motion.pc.in b/capi-context-motion.pc.in similarity index 100% rename from motion.pc.in rename to capi-context-motion.pc.in diff --git a/packaging/motion.manifest b/packaging/capi-context-motion.manifest similarity index 100% rename from packaging/motion.manifest rename to packaging/capi-context-motion.manifest diff --git a/packaging/motion.spec b/packaging/capi-context-motion.spec similarity index 62% rename from packaging/motion.spec rename to packaging/capi-context-motion.spec index 0bb75ba..36b1c99 100644 --- a/packaging/motion.spec +++ b/packaging/capi-context-motion.spec @@ -1,6 +1,6 @@ -Name: motion +Name: capi-context-motion Summary: Tizen Native Motion Recognition API -Version: 1.2.1 +Version: 2.0.0 Release: 1 Group: Service/Context License: Apache-2.0 @@ -16,6 +16,9 @@ BuildRequires: pkgconfig(sensor) Requires(post): /sbin/ldconfig Requires(postun): /sbin/ldconfig +# Backward compatibility +Provides: motion + %description Tizen Native Motion Recognition API @@ -25,34 +28,21 @@ Tizen Native Motion Recognition API %build MAJORVER=`echo %{version} | awk 'BEGIN {FS="."}{print $1}'` -export CFLAGS+=" -Wextra -Wcast-align -Wshadow -Wwrite-strings -Wswitch-default -Wno-unused-parameter" export CXXFLAGS+=" -Wextra -Wcast-align -Wshadow -Wwrite-strings -Wswitch-default -Wno-unused-parameter" - -export CFLAGS+=" -Wno-empty-body -fomit-frame-pointer -fno-optimize-sibling-calls" export CXXFLAGS+=" -Wno-empty-body -fomit-frame-pointer -fno-optimize-sibling-calls" - -export CFLAGS+=" -fno-strict-aliasing -fno-unroll-loops -fsigned-char -fstrict-overflow" export CXXFLAGS+=" -fno-strict-aliasing -fno-unroll-loops -fsigned-char -fstrict-overflow" - -export CFLAGS+=" -fno-common" export CXXFLAGS+=" -Wnon-virtual-dtor" -#export CFLAGS+=" -Wcast-qual" -#export CXXFLAGS+=" -Wcast-qual" - -#export CFLAGS+=" -DTIZEN_ENGINEER_MODE" -#export CXXFLAGS+=" -DTIZEN_ENGINEER_MODE" -#export FFLAGS+=" -DTIZEN_ENGINEER_MODE" - -cmake . -DCMAKE_INSTALL_PREFIX=%{_prefix} -DMAJORVER=${MAJORVER} -DFULLVER=%{version} -make %{?jobs:-j%jobs} +%cmake . -DMAJORVER=${MAJORVER} -DFULLVER=%{version} +make %{?_smp_mflags} %install -rm -rf %{buildroot} %make_install # For backward compatibility -ln -s ./%{name}.pc %{buildroot}/%{_libdir}/pkgconfig/libcore-context-manager.pc +ln -s %{name}.pc %{buildroot}/%{_libdir}/pkgconfig/motion.pc +ln -s %{name}.pc %{buildroot}/%{_libdir}/pkgconfig/libcore-context-manager.pc +ln -s lib%{name}.so.%{version} %{buildroot}/%{_libdir}/libcore-context-manager.so.1 %post /sbin/ldconfig @@ -62,7 +52,6 @@ ln -s ./%{name}.pc %{buildroot}/%{_libdir}/pkgconfig/libcore-context-manager.pc %files %manifest packaging/%{name}.manifest -%defattr(-,root,root,-) %{_libdir}/*.so* %license LICENSE @@ -75,6 +64,5 @@ Requires: %{name} = %{version}-%{release} Tizen Native Motion Recognition API (Development) %files devel -%defattr(-,root,root,-) %{_includedir}/*/*.h %{_libdir}/pkgconfig/*.pc -- 2.7.4 From 6e065f49883e2facb3c021e02f338e058ccf15c8 Mon Sep 17 00:00:00 2001 From: Mu-Woong Lee Date: Tue, 7 Mar 2017 15:48:03 +0900 Subject: [PATCH 04/16] Add a dummy package motion-devel to avoid obs unresolvable issues Change-Id: I90dcc411642fccbd02197a52256efefd9e492843 Signed-off-by: Mu-Woong Lee --- packaging/capi-context-motion.spec | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/packaging/capi-context-motion.spec b/packaging/capi-context-motion.spec index 36b1c99..bd4732b 100644 --- a/packaging/capi-context-motion.spec +++ b/packaging/capi-context-motion.spec @@ -66,3 +66,13 @@ Tizen Native Motion Recognition API (Development) %files devel %{_includedir}/*/*.h %{_libdir}/pkgconfig/*.pc + + +%package -n motion-devel +Summary: Dummy package for OBS build +Group: Framework/context + +%description -n motion-devel +Dummy package for OBS build + +%files -n motion-devel -- 2.7.4 From 95dd318aa73939c40eb73b6dbfee3932ba887b2f Mon Sep 17 00:00:00 2001 From: Mu-Woong Lee Date: Tue, 7 Mar 2017 15:48:03 +0900 Subject: [PATCH 05/16] Add a dummy package motion-devel to avoid obs unresolvable issues Change-Id: I90dcc411642fccbd02197a52256efefd9e492843 Signed-off-by: Mu-Woong Lee (cherry picked from commit 6e065f49883e2facb3c021e02f338e058ccf15c8) --- packaging/capi-context-motion.spec | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/packaging/capi-context-motion.spec b/packaging/capi-context-motion.spec index 36b1c99..bd4732b 100644 --- a/packaging/capi-context-motion.spec +++ b/packaging/capi-context-motion.spec @@ -66,3 +66,13 @@ Tizen Native Motion Recognition API (Development) %files devel %{_includedir}/*/*.h %{_libdir}/pkgconfig/*.pc + + +%package -n motion-devel +Summary: Dummy package for OBS build +Group: Framework/context + +%description -n motion-devel +Dummy package for OBS build + +%files -n motion-devel -- 2.7.4 From a28acec79812bd39bba63122160bda059df91fb6 Mon Sep 17 00:00:00 2001 From: Mu-Woong Lee Date: Tue, 7 Mar 2017 16:20:06 +0900 Subject: [PATCH 06/16] Add a dummy package motion to avoid obs image creation failure Change-Id: I445df219e455277d4be03e62dcb8caf7b9b6cd0f Signed-off-by: Mu-Woong Lee --- packaging/capi-context-motion.spec | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/packaging/capi-context-motion.spec b/packaging/capi-context-motion.spec index bd4732b..d4f3978 100644 --- a/packaging/capi-context-motion.spec +++ b/packaging/capi-context-motion.spec @@ -68,6 +68,15 @@ Tizen Native Motion Recognition API (Development) %{_libdir}/pkgconfig/*.pc +%package -n motion +Summary: Dummy package for OBS build +Group: Framework/context + +%description -n motion +Dummy package for OBS image creation + +%files -n motion + %package -n motion-devel Summary: Dummy package for OBS build Group: Framework/context -- 2.7.4 From 356856871c139cbfb70d1149c0cfef120ad41746 Mon Sep 17 00:00:00 2001 From: Mu-Woong Lee Date: Tue, 7 Mar 2017 16:34:51 +0900 Subject: [PATCH 07/16] Disable the conflicting virtual package Change-Id: I7947a82d90717db8be7119a39038a0745ef165ea Signed-off-by: Mu-Woong Lee --- packaging/capi-context-motion.spec | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packaging/capi-context-motion.spec b/packaging/capi-context-motion.spec index d4f3978..09a4cf1 100644 --- a/packaging/capi-context-motion.spec +++ b/packaging/capi-context-motion.spec @@ -17,7 +17,7 @@ Requires(post): /sbin/ldconfig Requires(postun): /sbin/ldconfig # Backward compatibility -Provides: motion +#Provides: motion %description Tizen Native Motion Recognition API @@ -71,6 +71,7 @@ Tizen Native Motion Recognition API (Development) %package -n motion Summary: Dummy package for OBS build Group: Framework/context +Requires: %{name} %description -n motion Dummy package for OBS image creation -- 2.7.4 From 2fe57026bd178891d0ca86b563eb9f20cdf8281d Mon Sep 17 00:00:00 2001 From: Mu-Woong Lee Date: Sat, 18 Mar 2017 06:10:29 -0700 Subject: [PATCH 08/16] Remove dummy packages motion & motion-devel Those dummy packages were introduced to avoid failures of obs pre-build, but not necessary anymore. Change-Id: I51d286f3c67433d9b28ca4861910ed73acb0694c Signed-off-by: Mu-Woong Lee --- packaging/capi-context-motion.spec | 24 ++---------------------- 1 file changed, 2 insertions(+), 22 deletions(-) diff --git a/packaging/capi-context-motion.spec b/packaging/capi-context-motion.spec index 09a4cf1..1c3da8b 100644 --- a/packaging/capi-context-motion.spec +++ b/packaging/capi-context-motion.spec @@ -1,6 +1,6 @@ Name: capi-context-motion Summary: Tizen Native Motion Recognition API -Version: 2.0.0 +Version: 2.0.1 Release: 1 Group: Service/Context License: Apache-2.0 @@ -17,7 +17,7 @@ Requires(post): /sbin/ldconfig Requires(postun): /sbin/ldconfig # Backward compatibility -#Provides: motion +Provides: motion %description Tizen Native Motion Recognition API @@ -66,23 +66,3 @@ Tizen Native Motion Recognition API (Development) %files devel %{_includedir}/*/*.h %{_libdir}/pkgconfig/*.pc - - -%package -n motion -Summary: Dummy package for OBS build -Group: Framework/context -Requires: %{name} - -%description -n motion -Dummy package for OBS image creation - -%files -n motion - -%package -n motion-devel -Summary: Dummy package for OBS build -Group: Framework/context - -%description -n motion-devel -Dummy package for OBS build - -%files -n motion-devel -- 2.7.4 From b59ecb23e7febca65ffaa25d00923638e240833b Mon Sep 17 00:00:00 2001 From: Mu-Woong Lee Date: Wed, 5 Apr 2017 16:43:15 +0900 Subject: [PATCH 09/16] Fix the build script typos and nonconventional so symlink packaging Change-Id: Ic9d6bcf3ea55a8d1bbf38a1252f7ee42bbdd4687 Signed-off-by: Mu-Woong Lee --- CMakeLists.txt | 7 +++---- packaging/capi-context-motion.spec | 3 ++- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index d8f80d9..16f3895 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -17,7 +17,7 @@ INCLUDE_DIRECTORIES( ) ADD_DEFINITIONS(-O2 -Wall -fPIC -flto -fdata-sections -ffunction-sections -fvisibility=hidden) -SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fPIC -Wl,--as-needed -Wl,--gc-section -Wl,--print-gc-section") +SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fPIC -Wl,--as-needed -Wl,--gc-sections -Wl,--print-gc-sections") # Build pkg_check_modules(pkgs REQUIRED ${dependency}) @@ -43,12 +43,11 @@ INSTALL( SET(VERSION ${FULLVER}) SET(PC_PREFIX ${CMAKE_INSTALL_PREFIX}) SET(PC_NAME ${PROJECT_NAME}) -SET(PC_LIBDIR "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}") +SET(PC_LIBDIR "${CMAKE_INSTALL_LIBDIR}") SET(PC_INCLUDE "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_INCLUDEDIR}/${inc_subdir}") -SET(PC_DESCRIPTION "Tizen Native Motion Recognition API") +SET(PC_DESCRIPTION "Tizen C Native Motion Recognition API") SET(PC_REQUIRED ${dependency}) SET(PC_LDFLAGS -l${target}) -SET(PC_CFLAGS -I\${includedir}/${inc_subdir}) CONFIGURE_FILE( ${PROJECT_NAME}.pc.in diff --git a/packaging/capi-context-motion.spec b/packaging/capi-context-motion.spec index 1c3da8b..3f925dd 100644 --- a/packaging/capi-context-motion.spec +++ b/packaging/capi-context-motion.spec @@ -52,7 +52,7 @@ ln -s lib%{name}.so.%{version} %{buildroot}/%{_libdir}/libcore-context-manager.s %files %manifest packaging/%{name}.manifest -%{_libdir}/*.so* +%{_libdir}/*.so.* %license LICENSE %package devel @@ -65,4 +65,5 @@ Tizen Native Motion Recognition API (Development) %files devel %{_includedir}/*/*.h +%{_libdir}/*.so %{_libdir}/pkgconfig/*.pc -- 2.7.4 From 5d34aca810d6997032b352d298d5c30f1bccb2a2 Mon Sep 17 00:00:00 2001 From: Mu-Woong Lee Date: Mon, 3 Apr 2017 19:23:33 +0900 Subject: [PATCH 10/16] Doxygen: fix the broken feature page links Change-Id: I9ab1e678dff5355c06b20582368a58f8be747770 Signed-off-by: Mu-Woong Lee (cherry picked from commit 69f9a8370b008a5b37b72f7d42be50748b5d5807) --- doc/activity_recognition_doc.h | 2 +- doc/gesture_recognition_doc.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/activity_recognition_doc.h b/doc/activity_recognition_doc.h index f7c822f..9999971 100644 --- a/doc/activity_recognition_doc.h +++ b/doc/activity_recognition_doc.h @@ -121,6 +121,6 @@ * * To ensure your application is only running on the device with specific features, please define the features in your manifest file using the manifest editor in the SDK.\n * - * More details on featuring your application can be found from Feature Element. + * More details on featuring your application can be found from Feature Element. * */ diff --git a/doc/gesture_recognition_doc.h b/doc/gesture_recognition_doc.h index 4432482..f6adc27 100644 --- a/doc/gesture_recognition_doc.h +++ b/doc/gesture_recognition_doc.h @@ -144,6 +144,6 @@ * * To ensure your application is only running on the device with specific features, please define the features in your manifest file using the manifest editor in the SDK.\n * - * More details on featuring your application can be found from Feature Element. + * More details on featuring your application can be found from Feature Element. * */ -- 2.7.4 From 2306d55637cab794e38a50a48f2cc93e8230e95b Mon Sep 17 00:00:00 2001 From: Mu-Woong Lee Date: Wed, 5 Apr 2017 17:03:19 +0900 Subject: [PATCH 11/16] Change the log tag to CAPI-MOTION Change-Id: I68a1473ab9472879dfd21f09c7c58bc366d671d0 Signed-off-by: Mu-Woong Lee --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 16f3895..560fe64 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -29,7 +29,7 @@ ENDFOREACH(flag) ADD_LIBRARY(${target} SHARED ${SRCS}) TARGET_LINK_LIBRARIES(${target} ${pkgs_LDFLAGS}) SET_TARGET_PROPERTIES(${target} PROPERTIES COMPILE_FLAGS ${EXTRA_CFLAGS}) -SET_TARGET_PROPERTIES(${target} PROPERTIES COMPILE_DEFINITIONS "LOG_TAG=\"MOTION\"") +SET_TARGET_PROPERTIES(${target} PROPERTIES COMPILE_DEFINITIONS "LOG_TAG=\"CAPI-MOTION\"") SET_TARGET_PROPERTIES(${target} PROPERTIES SOVERSION ${MAJORVER}) SET_TARGET_PROPERTIES(${target} PROPERTIES VERSION ${FULLVER}) -- 2.7.4 From 7504919fbb32d1c05acb4c5718b3e6b164b52871 Mon Sep 17 00:00:00 2001 From: Mu-Woong Lee Date: Tue, 11 Apr 2017 14:44:49 +0900 Subject: [PATCH 12/16] Version 2.0.2 Change-Id: I62c187cc723cf7f7779391bda314e63cea7c9b7b Signed-off-by: Mu-Woong Lee --- packaging/capi-context-motion.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packaging/capi-context-motion.spec b/packaging/capi-context-motion.spec index 3f925dd..a821557 100644 --- a/packaging/capi-context-motion.spec +++ b/packaging/capi-context-motion.spec @@ -1,6 +1,6 @@ Name: capi-context-motion Summary: Tizen Native Motion Recognition API -Version: 2.0.1 +Version: 2.0.2 Release: 1 Group: Service/Context License: Apache-2.0 -- 2.7.4 From aca522db62a258adf8494f59f821c673519c110c Mon Sep 17 00:00:00 2001 From: Mu-Woong Lee Date: Fri, 14 Apr 2017 18:47:08 +0900 Subject: [PATCH 13/16] Fix build error caused by not including new Change-Id: I08bea84ff53066b7d1bd017eddfbf2f604ff7677 Signed-off-by: Mu-Woong Lee --- CMakeLists.txt | 2 ++ include/activity_recognition.h | 3 +-- include/gesture_recognition.h | 3 +-- src/Activity.cpp | 12 ++++++------ src/Gesture.cpp | 14 +++++++------- src/TypesInternal.h | 5 ++--- 6 files changed, 19 insertions(+), 20 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 560fe64..304884b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -17,7 +17,9 @@ INCLUDE_DIRECTORIES( ) ADD_DEFINITIONS(-O2 -Wall -fPIC -flto -fdata-sections -ffunction-sections -fvisibility=hidden) +ADD_DEFINITIONS(-fdiagnostics-color) SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fPIC -Wl,--as-needed -Wl,--gc-sections -Wl,--print-gc-sections") +SET(CMAKE_VERBOSE_MAKEFILE OFF) # Build pkg_check_modules(pkgs REQUIRED ${dependency}) diff --git a/include/activity_recognition.h b/include/activity_recognition.h index a6bfc33..8d3f5cd 100644 --- a/include/activity_recognition.h +++ b/include/activity_recognition.h @@ -25,8 +25,7 @@ * @{ */ -#include -#include +#include #ifdef __cplusplus extern "C" { diff --git a/include/gesture_recognition.h b/include/gesture_recognition.h index ae3bc02..024adfe 100644 --- a/include/gesture_recognition.h +++ b/include/gesture_recognition.h @@ -25,8 +25,7 @@ * @{ */ -#include -#include +#include #ifdef __cplusplus extern "C" { diff --git a/src/Activity.cpp b/src/Activity.cpp index a7cf667..bf30e97 100644 --- a/src/Activity.cpp +++ b/src/Activity.cpp @@ -30,7 +30,7 @@ struct _activity_handle_s { ActivitySensor *sensor; }; -EXTAPI int activity_is_supported(activity_type_e activity, bool* supported) +EXPORT_API int activity_is_supported(activity_type_e activity, bool* supported) { if (supported) *supported = false; @@ -43,7 +43,7 @@ EXTAPI int activity_is_supported(activity_type_e activity, bool* supported) return ERR_NONE; } -EXTAPI int activity_create(activity_h *handle) +EXPORT_API int activity_create(activity_h *handle) { ASSERT_SUPPORTED(FEATURE_ACTIVITY); ASSERT_NOT_NULL(handle); @@ -62,7 +62,7 @@ EXTAPI int activity_create(activity_h *handle) return ERR_NONE; } -EXTAPI int activity_release(activity_h handle) +EXPORT_API int activity_release(activity_h handle) { ASSERT_SUPPORTED(FEATURE_ACTIVITY); ASSERT_NOT_NULL(handle); @@ -73,7 +73,7 @@ EXTAPI int activity_release(activity_h handle) return ERR_NONE; } -EXTAPI int activity_start_recognition(activity_h handle, activity_type_e activity, activity_recognition_cb callback, void *user_data) +EXPORT_API int activity_start_recognition(activity_h handle, activity_type_e activity, activity_recognition_cb callback, void *user_data) { ASSERT_SUPPORTED(FEATURE_ACTIVITY); ASSERT_NOT_NULL(handle); @@ -94,7 +94,7 @@ EXTAPI int activity_start_recognition(activity_h handle, activity_type_e activit return ERR_NONE; } -EXTAPI int activity_stop_recognition(activity_h handle) +EXPORT_API int activity_stop_recognition(activity_h handle) { ASSERT_SUPPORTED(FEATURE_ACTIVITY); ASSERT_NOT_NULL(handle); @@ -104,7 +104,7 @@ EXTAPI int activity_stop_recognition(activity_h handle) return ERR_NONE; } -EXTAPI int activity_get_accuracy(const activity_data_h data, activity_accuracy_e *accuracy) +EXPORT_API int activity_get_accuracy(const activity_data_h data, activity_accuracy_e *accuracy) { ASSERT_SUPPORTED(FEATURE_ACTIVITY); ASSERT_NOT_NULL(data); diff --git a/src/Gesture.cpp b/src/Gesture.cpp index bdb4306..2d91c70 100644 --- a/src/Gesture.cpp +++ b/src/Gesture.cpp @@ -30,7 +30,7 @@ struct _gesture_handle_s { GestureSensor *sensor; }; -EXTAPI int gesture_is_supported(gesture_type_e gesture, bool* supported) +EXPORT_API int gesture_is_supported(gesture_type_e gesture, bool* supported) { if (supported) *supported = false; @@ -43,7 +43,7 @@ EXTAPI int gesture_is_supported(gesture_type_e gesture, bool* supported) return ERR_NONE; } -EXTAPI int gesture_create(gesture_h *handle) +EXPORT_API int gesture_create(gesture_h *handle) { ASSERT_SUPPORTED(FEATURE_GESTURE); ASSERT_NOT_NULL(handle); @@ -62,7 +62,7 @@ EXTAPI int gesture_create(gesture_h *handle) return ERR_NONE; } -EXTAPI int gesture_release(gesture_h handle) +EXPORT_API int gesture_release(gesture_h handle) { ASSERT_SUPPORTED(FEATURE_GESTURE); ASSERT_NOT_NULL(handle); @@ -73,7 +73,7 @@ EXTAPI int gesture_release(gesture_h handle) return ERR_NONE; } -EXTAPI int gesture_start_recognition(gesture_h handle, gesture_type_e gesture, gesture_option_e option, gesture_recognition_cb callback, void *user_data) +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); ASSERT_NOT_NULL(handle); @@ -102,7 +102,7 @@ EXTAPI int gesture_start_recognition(gesture_h handle, gesture_type_e gesture, g return ERR_NONE; } -EXTAPI int gesture_stop_recognition(gesture_h handle) +EXPORT_API int gesture_stop_recognition(gesture_h handle) { ASSERT_SUPPORTED(FEATURE_GESTURE); ASSERT_NOT_NULL(handle); @@ -112,7 +112,7 @@ EXTAPI int gesture_stop_recognition(gesture_h handle) return ERR_NONE; } -EXTAPI int gesture_get_event(const gesture_data_h data, gesture_event_e *event) +EXPORT_API int gesture_get_event(const gesture_data_h data, gesture_event_e *event) { ASSERT_SUPPORTED(FEATURE_GESTURE); ASSERT_NOT_NULL(data); @@ -126,7 +126,7 @@ EXTAPI int gesture_get_event(const gesture_data_h data, gesture_event_e *event) return ERR_NONE; } -EXTAPI int gesture_get_tilt(const gesture_data_h data, int *x, int *y) +EXPORT_API int gesture_get_tilt(const gesture_data_h data, int *x, int *y) { ASSERT_SUPPORTED(FEATURE_GESTURE); ASSERT_NOT_NULL(data); diff --git a/src/TypesInternal.h b/src/TypesInternal.h index bde7980..7f5dac1 100644 --- a/src/TypesInternal.h +++ b/src/TypesInternal.h @@ -18,10 +18,9 @@ #ifndef _MOTION_TYPES_INTERNAL_H_ #define _MOTION_TYPES_INTERNAL_H_ -#include +#include #include - -#define EXTAPI __attribute__ ((visibility("default"))) +#include #define UNDEFINED -1 -- 2.7.4 From 5089ceaa878c428def3a61e0bd72defeb7e78f8e Mon Sep 17 00:00:00 2001 From: Somin Kim Date: Thu, 7 Sep 2017 17:41:56 +0900 Subject: [PATCH 14/16] Added lcov comments for excluding non-related parts regarding TCT coverage Change-Id: I4308f920a7a98020a21c7abe7f424a660ec0643b Signed-off-by: Somin Kim --- src/Activity.cpp | 12 ++++++++++++ src/ActivitySensor.cpp | 5 ++++- src/Gesture.cpp | 14 ++++++++++++++ src/GestureSensor.cpp | 2 ++ src/SensorAdapter.cpp | 2 ++ 5 files changed, 34 insertions(+), 1 deletion(-) diff --git a/src/Activity.cpp b/src/Activity.cpp index bf30e97..7a47297 100644 --- a/src/Activity.cpp +++ b/src/Activity.cpp @@ -36,16 +36,19 @@ EXPORT_API int activity_is_supported(activity_type_e activity, bool* supported) *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(malloc(sizeof(_activity_handle_s))); @@ -60,22 +63,26 @@ EXPORT_API int activity_create(activity_h *handle) *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); @@ -92,25 +99,30 @@ EXPORT_API int activity_start_recognition(activity_h handle, activity_type_e act } 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(data->accuracy); return ERR_NONE; + //LCOV_EXCL_STOP } diff --git a/src/ActivitySensor.cpp b/src/ActivitySensor.cpp index d275d5d..b622508 100644 --- a/src/ActivitySensor.cpp +++ b/src/ActivitySensor.cpp @@ -32,11 +32,12 @@ public: ~ActivityListener() { } - + //LCOV_EXCL_START void onEvent(double timestamp, float* values, int accuracy) { ActivitySensor::onEvent(timestamp, values, accuracy); } + //LCOV_EXCL_STOP }; static ActivityListener __activityListener; @@ -44,6 +45,7 @@ static ActivityListener __activityListener; std::set ActivitySensor::__sensorSet; SensorAdapter ActivitySensor::__sensorAdapter(&__activityListener); +//LCOV_EXCL_START ActivitySensor::ActivitySensor() : __activityType(static_cast(UNDEFINED)), __callback(NULL), @@ -140,3 +142,4 @@ void ActivitySensor::onEvent(double timestamp, float* values, int accuracy) } } } +//LCOV_EXCL_STOP diff --git a/src/Gesture.cpp b/src/Gesture.cpp index 2d91c70..18e6386 100644 --- a/src/Gesture.cpp +++ b/src/Gesture.cpp @@ -36,16 +36,19 @@ EXPORT_API int gesture_is_supported(gesture_type_e gesture, bool* supported) *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(malloc(sizeof(_gesture_handle_s))); @@ -60,22 +63,26 @@ EXPORT_API int gesture_create(gesture_h *handle) *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); @@ -100,21 +107,25 @@ EXPORT_API int gesture_start_recognition(gesture_h handle, gesture_type_e gestur } 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); @@ -124,11 +135,13 @@ EXPORT_API int gesture_get_event(const gesture_data_h data, gesture_event_e *eve *event = static_cast(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); @@ -140,4 +153,5 @@ EXPORT_API int gesture_get_tilt(const gesture_data_h data, int *x, int *y) *y = data->tilt_y; return ERR_NONE; + //LCOV_EXCL_STOP } diff --git a/src/GestureSensor.cpp b/src/GestureSensor.cpp index 306b059..0453d65 100644 --- a/src/GestureSensor.cpp +++ b/src/GestureSensor.cpp @@ -19,6 +19,7 @@ using namespace motion; +//LCOV_EXCL_START GestureSensor::GestureSensor() : __gestureType(static_cast(UNDEFINED)), __callback(NULL), @@ -97,3 +98,4 @@ sensor_type_t GestureSensor::__toSensor(gesture_type_e type) return UNKNOWN_SENSOR; } } +//LCOV_EXCL_STOP diff --git a/src/SensorAdapter.cpp b/src/SensorAdapter.cpp index 90cc77b..5b5d422 100644 --- a/src/SensorAdapter.cpp +++ b/src/SensorAdapter.cpp @@ -36,6 +36,7 @@ SensorAdapter::~SensorAdapter() stop(); } +//LCOV_EXCL_START void SensorAdapter::setSensor(sensor_type_t type) { __sensorType = type; @@ -131,3 +132,4 @@ void SensorAdapter::__eventCb(sensor_t sensor, unsigned int eventType, sensor_da SensorAdapter *instance = static_cast(cbData); instance->__onEvent(eventData); } +//LCOV_EXCL_STOP -- 2.7.4 From 62456f1fc64b8df8ee7309fbd17cd8dcaf8b109b Mon Sep 17 00:00:00 2001 From: "kibak.yoon" Date: Tue, 21 Nov 2017 19:21:55 +0900 Subject: [PATCH 15/16] Fix dependency issues that occur while building preload apps on OBS Signed-off-by: kibak.yoon Change-Id: I36d5baa1e225afa8a694b33ae30a2da674270b03 --- packaging/capi-context-motion.spec | 1 + 1 file changed, 1 insertion(+) diff --git a/packaging/capi-context-motion.spec b/packaging/capi-context-motion.spec index a821557..4643e35 100644 --- a/packaging/capi-context-motion.spec +++ b/packaging/capi-context-motion.spec @@ -18,6 +18,7 @@ Requires(postun): /sbin/ldconfig # Backward compatibility Provides: motion +Provides: libcore-context-manager.so.1 %description Tizen Native Motion Recognition API -- 2.7.4 From 5ba7581504b3f6327da4ba775c8ede28c951ac85 Mon Sep 17 00:00:00 2001 From: Somin Kim Date: Wed, 17 Jan 2018 16:28:16 +0900 Subject: [PATCH 16/16] Fix timestamp unit as seconds Change-Id: I6f2a0bf220ac6038d3e9606cd8dbb58709450ccd Signed-off-by: Somin Kim --- src/SensorAdapter.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/SensorAdapter.cpp b/src/SensorAdapter.cpp index 5b5d422..103c009 100644 --- a/src/SensorAdapter.cpp +++ b/src/SensorAdapter.cpp @@ -124,7 +124,7 @@ double SensorAdapter::__getEpoch(unsigned long long monotonic) void SensorAdapter::__onEvent(sensor_data_t *eventData) { double timestamp = __getEpoch(eventData->timestamp); - __listener->onEvent(timestamp, eventData->values, eventData->accuracy); + __listener->onEvent(timestamp / 1000.0, eventData->values, eventData->accuracy); } void SensorAdapter::__eventCb(sensor_t sensor, unsigned int eventType, sensor_data_t *eventData, void *cbData) -- 2.7.4