ADD_SUBDIRECTORY(sysman)
ADD_SUBDIRECTORY(libslp-pm)
ADD_SUBDIRECTORY(haptic)
+ADD_SUBDIRECTORY(devman)
--- /dev/null
+CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
+PROJECT(devman C)
+
+INCLUDE(FindPkgConfig)
+pkg_check_modules(rpkgs REQUIRED
+ vconf
+ dlog
+ heynoti
+ device-node)
+ADD_DEFINITIONS(${rpkgs_CFLAGS})
+
+SET(CMAKE_ALLOW_LOOSE_LOOP_CONSTRAINTS true)
+
+SET(SRCS
+ src/device_haptic.c
+ src/if_legacy.c
+ src/devman_internal.c)
+
+SET(HEADERS
+ include/SLP_devman_PG.h
+ include/devman.h
+ include/devman_managed.h
+ include/devman_image.h
+ include/devman_haptic.h
+ include/devman_haptic_ext.h
+ include/devman_haptic_ext_core.h)
+
+SET(INC_DIR include)
+INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/${INC_DIR})
+
+SET(PREFIX ${CMAKE_INSTALL_PREFIX})
+SET(EXEC_PREFIX "${PREFIX}/bin")
+SET(INCLUDEDIR "${PREFIX}/include/${PROJECT_NAME}")
+SET(DATADIR "${PREFIX}/share/devman")
+SET(VERSION 0.1)
+
+SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} -fvisibility=hidden")
+SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} -g")
+
+SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS}")
+
+ADD_LIBRARY(${PROJECT_NAME} SHARED ${SRCS} ${TARGET_SRCS})
+TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${rpkgs_LDFLAGS})
+SET_TARGET_PROPERTIES(${PROJECT_NAME} PROPERTIES SOVERSION ${VERSION})
+
+ADD_EXECUTABLE(display_wd src/display_wd.c)
+TARGET_LINK_LIBRARIES(display_wd ${pkgs_LDFLAGS} ${PROJECT_NAME})
+INSTALL(TARGETS display_wd DESTINATION bin)
+
+CONFIGURE_FILE(${PROJECT_NAME}.pc.in ${PROJECT_NAME}.pc @ONLY)
+CONFIGURE_FILE(${PROJECT_NAME}_haptic.pc.in ${PROJECT_NAME}_haptic.pc @ONLY)
+
+INSTALL(TARGETS ${PROJECT_NAME} DESTINATION ${LIB_INSTALL_DIR} COMPONENT RuntimeLibraries)
+INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}.pc DESTINATION ${LIB_INSTALL_DIR}/pkgconfig)
+INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}_haptic.pc DESTINATION ${LIB_INSTALL_DIR}/pkgconfig)
+
+FOREACH(hfile ${HEADERS})
+ INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${hfile} DESTINATION include/${PROJECT_NAME})
+ENDFOREACH(hfile)
--- /dev/null
+Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.\r
+\r
+ Apache License\r
+ Version 2.0, January 2004\r
+ http://www.apache.org/licenses/\r
+\r
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION\r
+\r
+ 1. Definitions.\r
+\r
+ "License" shall mean the terms and conditions for use, reproduction,\r
+ and distribution as defined by Sections 1 through 9 of this document.\r
+\r
+ "Licensor" shall mean the copyright owner or entity authorized by\r
+ the copyright owner that is granting the License.\r
+\r
+ "Legal Entity" shall mean the union of the acting entity and all\r
+ other entities that control, are controlled by, or are under common\r
+ control with that entity. For the purposes of this definition,\r
+ "control" means (i) the power, direct or indirect, to cause the\r
+ direction or management of such entity, whether by contract or\r
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the\r
+ outstanding shares, or (iii) beneficial ownership of such entity.\r
+\r
+ "You" (or "Your") shall mean an individual or Legal Entity\r
+ exercising permissions granted by this License.\r
+\r
+ "Source" form shall mean the preferred form for making modifications,\r
+ including but not limited to software source code, documentation\r
+ source, and configuration files.\r
+\r
+ "Object" form shall mean any form resulting from mechanical\r
+ transformation or translation of a Source form, including but\r
+ not limited to compiled object code, generated documentation,\r
+ and conversions to other media types.\r
+\r
+ "Work" shall mean the work of authorship, whether in Source or\r
+ Object form, made available under the License, as indicated by a\r
+ copyright notice that is included in or attached to the work\r
+ (an example is provided in the Appendix below).\r
+\r
+ "Derivative Works" shall mean any work, whether in Source or Object\r
+ form, that is based on (or derived from) the Work and for which the\r
+ editorial revisions, annotations, elaborations, or other modifications\r
+ represent, as a whole, an original work of authorship. For the purposes\r
+ of this License, Derivative Works shall not include works that remain\r
+ separable from, or merely link (or bind by name) to the interfaces of,\r
+ the Work and Derivative Works thereof.\r
+\r
+ "Contribution" shall mean any work of authorship, including\r
+ the original version of the Work and any modifications or additions\r
+ to that Work or Derivative Works thereof, that is intentionally\r
+ submitted to Licensor for inclusion in the Work by the copyright owner\r
+ or by an individual or Legal Entity authorized to submit on behalf of\r
+ the copyright owner. For the purposes of this definition, "submitted"\r
+ means any form of electronic, verbal, or written communication sent\r
+ to the Licensor or its representatives, including but not limited to\r
+ communication on electronic mailing lists, source code control systems,\r
+ and issue tracking systems that are managed by, or on behalf of, the\r
+ Licensor for the purpose of discussing and improving the Work, but\r
+ excluding communication that is conspicuously marked or otherwise\r
+ designated in writing by the copyright owner as "Not a Contribution."\r
+\r
+ "Contributor" shall mean Licensor and any individual or Legal Entity\r
+ on behalf of whom a Contribution has been received by Licensor and\r
+ subsequently incorporated within the Work.\r
+\r
+ 2. Grant of Copyright License. Subject to the terms and conditions of\r
+ this License, each Contributor hereby grants to You a perpetual,\r
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable\r
+ copyright license to reproduce, prepare Derivative Works of,\r
+ publicly display, publicly perform, sublicense, and distribute the\r
+ Work and such Derivative Works in Source or Object form.\r
+\r
+ 3. Grant of Patent License. Subject to the terms and conditions of\r
+ this License, each Contributor hereby grants to You a perpetual,\r
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable\r
+ (except as stated in this section) patent license to make, have made,\r
+ use, offer to sell, sell, import, and otherwise transfer the Work,\r
+ where such license applies only to those patent claims licensable\r
+ by such Contributor that are necessarily infringed by their\r
+ Contribution(s) alone or by combination of their Contribution(s)\r
+ with the Work to which such Contribution(s) was submitted. If You\r
+ institute patent litigation against any entity (including a\r
+ cross-claim or counterclaim in a lawsuit) alleging that the Work\r
+ or a Contribution incorporated within the Work constitutes direct\r
+ or contributory patent infringement, then any patent licenses\r
+ granted to You under this License for that Work shall terminate\r
+ as of the date such litigation is filed.\r
+\r
+ 4. Redistribution. You may reproduce and distribute copies of the\r
+ Work or Derivative Works thereof in any medium, with or without\r
+ modifications, and in Source or Object form, provided that You\r
+ meet the following conditions:\r
+\r
+ (a) You must give any other recipients of the Work or\r
+ Derivative Works a copy of this License; and\r
+\r
+ (b) You must cause any modified files to carry prominent notices\r
+ stating that You changed the files; and\r
+\r
+ (c) You must retain, in the Source form of any Derivative Works\r
+ that You distribute, all copyright, patent, trademark, and\r
+ attribution notices from the Source form of the Work,\r
+ excluding those notices that do not pertain to any part of\r
+ the Derivative Works; and\r
+\r
+ (d) If the Work includes a "NOTICE" text file as part of its\r
+ distribution, then any Derivative Works that You distribute must\r
+ include a readable copy of the attribution notices contained\r
+ within such NOTICE file, excluding those notices that do not\r
+ pertain to any part of the Derivative Works, in at least one\r
+ of the following places: within a NOTICE text file distributed\r
+ as part of the Derivative Works; within the Source form or\r
+ documentation, if provided along with the Derivative Works; or,\r
+ within a display generated by the Derivative Works, if and\r
+ wherever such third-party notices normally appear. The contents\r
+ of the NOTICE file are for informational purposes only and\r
+ do not modify the License. You may add Your own attribution\r
+ notices within Derivative Works that You distribute, alongside\r
+ or as an addendum to the NOTICE text from the Work, provided\r
+ that such additional attribution notices cannot be construed\r
+ as modifying the License.\r
+\r
+ You may add Your own copyright statement to Your modifications and\r
+ may provide additional or different license terms and conditions\r
+ for use, reproduction, or distribution of Your modifications, or\r
+ for any such Derivative Works as a whole, provided Your use,\r
+ reproduction, and distribution of the Work otherwise complies with\r
+ the conditions stated in this License.\r
+\r
+ 5. Submission of Contributions. Unless You explicitly state otherwise,\r
+ any Contribution intentionally submitted for inclusion in the Work\r
+ by You to the Licensor shall be under the terms and conditions of\r
+ this License, without any additional terms or conditions.\r
+ Notwithstanding the above, nothing herein shall supersede or modify\r
+ the terms of any separate license agreement you may have executed\r
+ with Licensor regarding such Contributions.\r
+\r
+ 6. Trademarks. This License does not grant permission to use the trade\r
+ names, trademarks, service marks, or product names of the Licensor,\r
+ except as required for reasonable and customary use in describing the\r
+ origin of the Work and reproducing the content of the NOTICE file.\r
+\r
+ 7. Disclaimer of Warranty. Unless required by applicable law or\r
+ agreed to in writing, Licensor provides the Work (and each\r
+ Contributor provides its Contributions) on an "AS IS" BASIS,\r
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or\r
+ implied, including, without limitation, any warranties or conditions\r
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A\r
+ PARTICULAR PURPOSE. You are solely responsible for determining the\r
+ appropriateness of using or redistributing the Work and assume any\r
+ risks associated with Your exercise of permissions under this License.\r
+\r
+ 8. Limitation of Liability. In no event and under no legal theory,\r
+ whether in tort (including negligence), contract, or otherwise,\r
+ unless required by applicable law (such as deliberate and grossly\r
+ negligent acts) or agreed to in writing, shall any Contributor be\r
+ liable to You for damages, including any direct, indirect, special,\r
+ incidental, or consequential damages of any character arising as a\r
+ result of this License or out of the use or inability to use the\r
+ Work (including but not limited to damages for loss of goodwill,\r
+ work stoppage, computer failure or malfunction, or any and all\r
+ other commercial damages or losses), even if such Contributor\r
+ has been advised of the possibility of such damages.\r
+\r
+ 9. Accepting Warranty or Additional Liability. While redistributing\r
+ the Work or Derivative Works thereof, You may choose to offer,\r
+ and charge a fee for, acceptance of support, warranty, indemnity,\r
+ or other liability obligations and/or rights consistent with this\r
+ License. However, in accepting such obligations, You may act only\r
+ on Your own behalf and on Your sole responsibility, not on behalf\r
+ of any other Contributor, and only if You agree to indemnify,\r
+ defend, and hold each Contributor harmless for any liability\r
+ incurred by, or claims asserted against, such Contributor by reason\r
+ of your accepting any such warranty or additional liability.\r
+\r
+ END OF TERMS AND CONDITIONS\r
+\r
+ APPENDIX: How to apply the Apache License to your work.\r
+\r
+ To apply the Apache License to your work, attach the following\r
+ boilerplate notice, with the fields enclosed by brackets "[]"\r
+ replaced with your own identifying information. (Don't include\r
+ the brackets!) The text should be enclosed in the appropriate\r
+ comment syntax for the file format. We also recommend that a\r
+ file or class name and description of purpose be included on the\r
+ same "printed page" as the copyright notice for easier\r
+ identification within third-party archives.\r
+\r
+ Copyright [yyyy] [name of copyright owner]\r
+\r
+ Licensed under the Apache License, Version 2.0 (the "License");\r
+ you may not use this file except in compliance with the License.\r
+ You may obtain a copy of the License at\r
+\r
+ http://www.apache.org/licenses/LICENSE-2.0\r
+\r
+ Unless required by applicable law or agreed to in writing, software\r
+ distributed under the License is distributed on an "AS IS" BASIS,\r
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ See the License for the specific language governing permissions and\r
+ limitations under the License.\r
+\r
--- /dev/null
+#!/bin/sh
+
+export TET_INSTALL_PATH=/scratchbox/tetware # local tetware path
+export TET_TARGET_PATH=$TET_INSTALL_PATH/tetware-target
+export PATH=$TET_TARGET_PATH/bin:$PATH
+export LD_LIBRARY_PATH=$TET_TARGET_PATH/lib/tet3:$LD_LIBRARY_PATH
+export TET_ROOT=$TET_TARGET_PATH
+
+export TET_SUITE_ROOT=`pwd`
+FILE_NAME_EXTENSION=`date +%s`
+
+RESULT_DIR=results
+HTML_RESULT=$RESULT_DIR/build-tar-result-$FILE_NAME_EXTENSION.html
+JOURNAL_RESULT=$RESULT_DIR/build-tar-result-$FILE_NAME_EXTENSION.journal
+
+mkdir -p $RESULT_DIR
+
+tcc -c -p ./
+tcc -b -j $JOURNAL_RESULT -p ./
+grw -c 3 -f chtml -o $HTML_RESULT $JOURNAL_RESULT
--- /dev/null
+#!/bin/sh
+export TET_INSTALL_PATH=/mnt/nfs/tetware
+export TET_TARGET_PATH=$TET_INSTALL_PATH/tetware-target
+export PATH=$TET_TARGET_PATH/bin:$PATH
+export LD_LIBRARY_PATH=$TET_TARGET_PATH/lib/tet3:$LD_LIBRARY_PATH
+
+export TET_ROOT=$TET_TARGET_PATH
+
+export TET_SUITE_ROOT=`pwd`
+FILE_NAME_EXTENSION=`date +%s`
+
+RESULT_DIR=results
+HTML_RESULT=$RESULT_DIR/exec-tar-result-$FILE_NAME_EXTENSION.html
+JOURNAL_RESULT=$RESULT_DIR/exec-tar-result-$FILE_NAME_EXTENSION.journal
+
+mkdir -p $RESULT_DIR
+
+tcc -e -j $JOURNAL_RESULT -p ./
+grw -c 3 -f chtml -o $HTML_RESULT $JOURNAL_RESULT
--- /dev/null
+# TET reserved codes
+0 "PASS"
+1 "FAIL"
+2 "UNRESOLVED"
+3 "NOTINUSE"
+4 "UNSUPPORTED"
+5 "UNTESTED"
+6 "UNINITIATED"
+7 "NORESULT"
+
+# Test suite additional codes
+33 "INSPECT"
--- /dev/null
+all
+ ^TEST
+##### Scenarios for TEST #####
+
+# Test scenario
+TEST
+ :include:/unit/tslist
--- /dev/null
+TET_OUTPUT_CAPTURE=False
+TET_BUILD_TOOL=make
+TET_PASS_TC_NAME=True
--- /dev/null
+TET_OUTPUT_CAPTURE=False
+TET_CLEAN_TOOL=make clean
--- /dev/null
+TET_OUTPUT_CAPTURE=False
--- /dev/null
+CC ?= gcc
+
+TARGETS = utc_SystemFW_device_get_battery_pct_func \
+ utc_SystemFW_device_get_display_brt_func \
+ utc_SystemFW_device_get_display_gamma_func \
+ utc_SystemFW_device_get_max_brt_func \
+ utc_SystemFW_device_get_property_func \
+ utc_SystemFW_device_haptic_open_func \
+ utc_SystemFW_device_haptic_close_func \
+ utc_SystemFW_device_haptic_get_file_duration_func \
+ utc_SystemFW_device_haptic_get_pattern_duration_func \
+ utc_SystemFW_device_haptic_play_file_func \
+ utc_SystemFW_device_haptic_play_monotone_func \
+ utc_SystemFW_device_haptic_play_pattern_func \
+ utc_SystemFW_device_haptic_stop_play_func \
+ utc_SystemFW_device_is_battery_full_func \
+ utc_SystemFW_device_release_brt_ctrl_func \
+ utc_SystemFW_device_release_gamma_ctrl_func \
+ utc_SystemFW_device_set_display_brt_func \
+ utc_SystemFW_device_set_display_gamma_func \
+ utc_SystemFW_device_set_property_func \
+
+
+
+PKGS = devman
+
+LDFLAGS = `pkg-config --libs $(PKGS)`
+LDFLAGS += $(TET_ROOT)/lib/tet3/tcm_s.o
+LDFLAGS += -L$(TET_ROOT)/lib/tet3 -ltcm_s
+LDFLAGS += -L$(TET_ROOT)/lib/tet3 -lapi_s
+
+CFLAGS = -I. `pkg-config --cflags $(PKGS)`
+CFLAGS += -I$(TET_ROOT)/inc/tet3
+CFLAGS += -Wall
+
+all: $(TARGETS)
+
+$(TARGETS): %: %.c
+ $(CC) -o $@ $< $(CFLAGS) $(LDFLAGS)
+
+clean:
+ rm -f $(TARGETS)
--- /dev/null
+#!/bin/sh
+
+TMPSTR=$0
+SCRIPT=${TMPSTR##*/}
+
+if [ $# -lt 2 ]; then
+ echo "Usage) $SCRIPT module_name api_name"
+ exit 1
+fi
+
+MODULE=$1
+API=$2
+TEMPLATE=utc_MODULE_API_func.c.in
+TESTCASE=utc_${MODULE}_${API}_func
+
+sed -e '
+ s^@API@^'"$API"'^g
+ s^@MODULE@^'"$MODULE"'^g
+ ' $TEMPLATE > $TESTCASE.c
+
+if [ ! -e "$TESTCASE.c" ]; then
+ echo "Failed"
+ exit 1
+fi
+echo "Testcase file is $TESTCASE.c"
+echo "Done"
+echo "please put \"$TESTCASE\" as Target in Makefile"
+echo "please put \"/unit/$TESTCASE\" in tslist"
--- /dev/null
+/unit/utc_SystemFW_device_get_battery_pct_func
+/unit/utc_SystemFW_device_get_display_brt_func
+/unit/utc_SystemFW_device_get_display_gamma_func
+/unit/utc_SystemFW_device_get_max_brt_func
+/unit/utc_SystemFW_device_get_property_func
+/unit/utc_SystemFW_device_haptic_open_func
+/unit/utc_SystemFW_device_haptic_close_func
+/unit/utc_SystemFW_device_haptic_get_file_duration_func
+/unit/utc_SystemFW_device_haptic_get_pattern_duration_func
+/unit/utc_SystemFW_device_haptic_play_file_func
+/unit/utc_SystemFW_device_haptic_play_monotone_func
+/unit/utc_SystemFW_device_haptic_play_pattern_func
+/unit/utc_SystemFW_device_haptic_stop_play_func
+/unit/utc_SystemFW_device_is_battery_full_func
+/unit/utc_SystemFW_device_release_brt_ctrl_func
+/unit/utc_SystemFW_device_release_gamma_ctrl_func
+/unit/utc_SystemFW_device_set_display_brt_func
+/unit/utc_SystemFW_device_set_display_gamma_func
+/unit/utc_SystemFW_device_set_property_func
--- /dev/null
+#include <tet_api.h>
+
+static void startup(void);
+static void cleanup(void);
+
+void (*tet_startup)(void) = startup;
+void (*tet_cleanup)(void) = cleanup;
+
+static void utc_@MODULE@_@API@_func_01(void);
+static void utc_@MODULE@_@API@_func_02(void);
+
+enum {
+ POSITIVE_TC_IDX = 0x01,
+ NEGATIVE_TC_IDX,
+};
+
+struct tet_testlist tet_testlist[] = {
+ { utc_@MODULE@_@API@_func_01, POSITIVE_TC_IDX },
+ { utc_@MODULE@_@API@_func_02, NEGATIVE_TC_IDX },
+};
+
+static void startup(void)
+{
+}
+
+static void cleanup(void)
+{
+}
+
+/**
+ * @brief Positive test case of @API@()
+ */
+static void utc_@MODULE@_@API@_func_01(void)
+{
+ int r = 0;
+
+/*
+ r = @API@(...);
+*/
+ if (r) {
+ tet_infoline("@API@() failed in positive test case");
+ tet_result(TET_FAIL);
+ return;
+ }
+ tet_result(TET_PASS);
+}
+
+/**
+ * @brief Negative test case of ug_init @API@()
+ */
+static void utc_@MODULE@_@API@_func_02(void)
+{
+ int r = 0;
+
+/*
+ r = @API@(...);
+*/
+ if (r) {
+ tet_infoline("@API@() failed in negative test case");
+ tet_result(TET_FAIL);
+ return;
+ }
+ tet_result(TET_PASS);
+}
--- /dev/null
+#include <tet_api.h>
+#include <devman.h>
+
+static void startup(void);
+static void cleanup(void);
+
+void (*tet_startup)(void) = startup;
+void (*tet_cleanup)(void) = cleanup;
+
+static void utc_SystemFW_device_get_battery_pct_func_01(void);
+//static void utc_SystemFW_device_get_battery_pct_func_02(void);
+
+enum {
+ POSITIVE_TC_IDX = 0x01,
+ NEGATIVE_TC_IDX,
+};
+
+struct tet_testlist tet_testlist[] = {
+ { utc_SystemFW_device_get_battery_pct_func_01, POSITIVE_TC_IDX },
+// { utc_SystemFW_device_get_battery_pct_func_02, NEGATIVE_TC_IDX },
+ { NULL, 0 },
+};
+
+static void startup(void)
+{
+}
+
+static void cleanup(void)
+{
+}
+
+/**
+ * @brief Positive test case of device_get_battery_pct()
+ */
+static void utc_SystemFW_device_get_battery_pct_func_01(void)
+{
+ int r = 0;
+
+ r = device_get_battery_pct();
+ if (r<0) {
+ tet_infoline("device_get_battery_pct() failed in positive test case");
+ tet_result(TET_FAIL);
+ return;
+ }
+ tet_result(TET_PASS);
+}
+
+/**
+ * @brief Negative test case of ug_init device_get_battery_pct()
+ */
+//static void utc_SystemFW_device_get_battery_pct_func_02(void)
+//{
+// int r = 0;
+
+
+// r = device_get_battery_pct();
+
+// if (r>=0) {
+// tet_infoline("device_get_battery_pct() failed in negative test case");
+// tet_result(TET_FAIL);
+// return;
+// }
+// tet_result(TET_PASS);
+//}
--- /dev/null
+#include <tet_api.h>
+#include <devman.h>
+
+static void startup(void);
+static void cleanup(void);
+
+void (*tet_startup)(void) = startup;
+void (*tet_cleanup)(void) = cleanup;
+
+static void utc_SystemFW_device_get_display_brt_func_01(void);
+static void utc_SystemFW_device_get_display_brt_func_02(void);
+
+enum {
+ POSITIVE_TC_IDX = 0x01,
+ NEGATIVE_TC_IDX,
+};
+
+struct tet_testlist tet_testlist[] = {
+ { utc_SystemFW_device_get_display_brt_func_01, POSITIVE_TC_IDX },
+ { utc_SystemFW_device_get_display_brt_func_02, NEGATIVE_TC_IDX },
+ { NULL, 0 },
+};
+
+static void startup(void)
+{
+}
+
+static void cleanup(void)
+{
+}
+
+/**
+ * @brief Positive test case of device_get_display_brt()
+ */
+static void utc_SystemFW_device_get_display_brt_func_01(void)
+{
+ int r = 0;
+ display_num_t disp = DEV_DISPLAY_0;
+
+ r = device_get_display_brt(disp);
+
+ if (r<0) {
+ tet_infoline("device_get_display_brt() failed in positive test case");
+ tet_result(TET_FAIL);
+ return;
+ }
+ tet_result(TET_PASS);
+}
+
+/**
+ * @brief Negative test case of ug_init device_get_display_brt()
+ */
+static void utc_SystemFW_device_get_display_brt_func_02(void)
+{
+ int r = 0;
+ display_num_t disp = -1;
+
+ r = device_get_display_brt(disp);
+
+ if (r>0) {
+ tet_infoline("device_get_display_brt() failed in negative test case");
+ tet_result(TET_FAIL);
+ return;
+ }
+ tet_result(TET_PASS);
+}
--- /dev/null
+#include <tet_api.h>
+#include <devman.h>
+
+static void startup(void);
+static void cleanup(void);
+
+void (*tet_startup)(void) = startup;
+void (*tet_cleanup)(void) = cleanup;
+
+static void utc_SystemFW_device_get_display_gamma_func_01(void);
+static void utc_SystemFW_device_get_display_gamma_func_02(void);
+
+enum {
+ POSITIVE_TC_IDX = 0x01,
+ NEGATIVE_TC_IDX,
+};
+
+struct tet_testlist tet_testlist[] = {
+ { utc_SystemFW_device_get_display_gamma_func_01, POSITIVE_TC_IDX },
+ { utc_SystemFW_device_get_display_gamma_func_02, NEGATIVE_TC_IDX },
+ { NULL, 0 },
+};
+
+static void startup(void)
+{
+}
+
+static void cleanup(void)
+{
+}
+
+/**
+ * @brief Positive test case of device_get_display_gamma()
+ */
+static void utc_SystemFW_device_get_display_gamma_func_01(void)
+{
+ int r = 0;
+ display_num_t disp = DEV_DISPLAY_0;
+
+ r = device_get_display_gamma(disp);
+
+ if (r<0) {
+ tet_infoline("device_get_display_gamma() failed in positive test case");
+ tet_result(TET_FAIL);
+ return;
+ }
+ tet_result(TET_PASS);
+}
+
+/**
+ * @brief Negative test case of ug_init device_get_display_gamma()
+ */
+static void utc_SystemFW_device_get_display_gamma_func_02(void)
+{
+ int r = 0;
+ display_num_t disp = -1;
+
+ r = device_get_display_gamma(disp);
+
+ if (r>=0) {
+ tet_infoline("device_get_display_gamma() failed in negative test case");
+ tet_result(TET_FAIL);
+ return;
+ }
+ tet_result(TET_PASS);
+}
--- /dev/null
+#include <tet_api.h>
+#include <devman.h>
+
+static void startup(void);
+static void cleanup(void);
+
+void (*tet_startup)(void) = startup;
+void (*tet_cleanup)(void) = cleanup;
+
+static void utc_SystemFW_device_get_max_brt_func_01(void);
+static void utc_SystemFW_device_get_max_brt_func_02(void);
+
+enum {
+ POSITIVE_TC_IDX = 0x01,
+ NEGATIVE_TC_IDX,
+};
+
+struct tet_testlist tet_testlist[] = {
+ { utc_SystemFW_device_get_max_brt_func_01, POSITIVE_TC_IDX },
+ { utc_SystemFW_device_get_max_brt_func_02, NEGATIVE_TC_IDX },
+ { NULL, 0 },
+};
+
+static void startup(void)
+{
+}
+
+static void cleanup(void)
+{
+}
+
+/**
+ * @brief Positive test case of device_get_max_brt()
+ */
+static void utc_SystemFW_device_get_max_brt_func_01(void)
+{
+ int r = 0;
+ display_num_t disp = DEV_DISPLAY_0;
+
+ r = device_get_max_brt(disp);
+
+ if (r < 0) {
+ tet_infoline("device_get_max_brt() failed in positive test case");
+ tet_result(TET_FAIL);
+ return;
+ }
+ tet_result(TET_PASS);
+}
+
+/**
+ * @brief Negative test case of ug_init device_get_max_brt()
+ */
+static void utc_SystemFW_device_get_max_brt_func_02(void)
+{
+ int r = -1;
+ display_num_t disp = -1;
+
+ r = device_get_max_brt(disp);
+
+ if (r > 0) {
+ tet_infoline("device_get_max_brt() failed in negative test case");
+ tet_result(TET_FAIL);
+ return;
+ }
+ tet_result(TET_PASS);
+}
--- /dev/null
+#include <tet_api.h>
+#include <devman.h>
+
+static void startup(void);
+static void cleanup(void);
+
+void (*tet_startup)(void) = startup;
+void (*tet_cleanup)(void) = cleanup;
+
+static void utc_SystemFW_device_get_property_func_01(void);
+static void utc_SystemFW_device_get_property_func_02(void);
+
+enum {
+ POSITIVE_TC_IDX = 0x01,
+ NEGATIVE_TC_IDX,
+};
+
+struct tet_testlist tet_testlist[] = {
+ { utc_SystemFW_device_get_property_func_01, POSITIVE_TC_IDX },
+ { utc_SystemFW_device_get_property_func_02, NEGATIVE_TC_IDX },
+ { NULL, 0 },
+};
+
+static void startup(void)
+{
+}
+
+static void cleanup(void)
+{
+}
+
+/**
+ * @brief Positive test case of device_get_property()
+ */
+static void utc_SystemFW_device_get_property_func_01(void)
+{
+ int r = 0;
+ int value = -1;
+ int property = DISPLAY_PROP_BRIGHTNESS;
+ devtype_t devtype = DEVTYPE_DISPLAY0;
+
+ r = device_get_property(devtype,property,&value);
+
+ if (r < 0 || value == -1) {
+ tet_infoline("device_get_property() failed in positive test case");
+ tet_result(TET_FAIL);
+ return;
+ }
+ tet_result(TET_PASS);
+}
+
+/**
+ * @brief Negative test case of ug_init device_get_property()
+ */
+static void utc_SystemFW_device_get_property_func_02(void)
+{
+ int value = -1;
+ int ret_val = 0;
+ int property = DISPLAY_PROP_BRIGHTNESS;
+ devtype_t devtype = -1;
+
+ ret_val = device_get_property(devtype,property,&value);
+ if((ret_val >= 0) && (value!= -1)) {
+ tet_infoline("device_get_property() failed in negative test case");
+ tet_result(TET_FAIL);
+ return;
+ }
+ tet_result(TET_PASS);
+}
--- /dev/null
+#include <tet_api.h>
+#include <devman.h>
+#include <devman_haptic.h>
+
+static void startup(void);
+static void cleanup(void);
+
+void (*tet_startup)(void) = startup;
+void (*tet_cleanup)(void) = cleanup;
+
+static void utc_SystemFW_device_haptic_close_func_01(void);
+static void utc_SystemFW_device_haptic_close_func_02(void);
+
+enum {
+ POSITIVE_TC_IDX = 0x01,
+ NEGATIVE_TC_IDX,
+};
+
+struct tet_testlist tet_testlist[] = {
+ { utc_SystemFW_device_haptic_close_func_01, POSITIVE_TC_IDX },
+ { utc_SystemFW_device_haptic_close_func_02, NEGATIVE_TC_IDX },
+ { NULL, 0 },
+};
+
+static void startup(void)
+{
+}
+
+static void cleanup(void)
+{
+}
+
+/**
+ * @brief Positive test case of device_haptic_close()
+ */
+static void utc_SystemFW_device_haptic_close_func_01(void)
+{
+ int r = 0;
+ unsigned int mode =0;
+ haptic_dev_idx dev_idx = DEV_IDX_0;
+ int dev_handle;
+
+ dev_handle = device_haptic_open(dev_idx,mode);
+ if(dev_handle < 0)
+ {
+ tet_infoline("device_haptic_close() failed in positive test case");
+ tet_result(TET_FAIL);
+ return;
+ }
+
+ r = device_haptic_close(dev_handle);
+ if(r < 0)
+ {
+ tet_infoline("device_haptic_close() failed in positive test case");
+ tet_result(TET_FAIL);
+ return;
+ }
+
+ tet_result(TET_PASS);
+}
+
+/**
+ * @brief Negative test case of ug_init device_haptic_close()
+ */
+static void utc_SystemFW_device_haptic_close_func_02(void)
+{
+ int r = 0;
+ int invalid_handle = -1;
+
+ r = device_haptic_close(invalid_handle);
+
+ if (r >= 0) {
+ tet_infoline("device_haptic_close() failed in negative test case");
+ tet_result(TET_FAIL);
+ return;
+ }
+ tet_result(TET_PASS);
+}
--- /dev/null
+#include <tet_api.h>
+#include <devman.h>
+#include <devman_haptic.h>
+
+static void startup(void);
+static void cleanup(void);
+
+void (*tet_startup)(void) = startup;
+void (*tet_cleanup)(void) = cleanup;
+
+static void utc_SystemFW_device_haptic_get_file_duration_func_01(void);
+static void utc_SystemFW_device_haptic_get_file_duration_func_02(void);
+
+enum {
+ POSITIVE_TC_IDX = 0x01,
+ NEGATIVE_TC_IDX,
+};
+
+struct tet_testlist tet_testlist[] = {
+ { utc_SystemFW_device_haptic_get_file_duration_func_01, POSITIVE_TC_IDX },
+ { utc_SystemFW_device_haptic_get_file_duration_func_02, NEGATIVE_TC_IDX },
+ { NULL, 0 },
+};
+
+static void startup(void)
+{
+}
+
+static void cleanup(void)
+{
+}
+
+/**
+ * @brief Positive test case of device_haptic_get_file_duration()
+ */
+static void utc_SystemFW_device_haptic_get_file_duration_func_01(void)
+{
+ int duration = 0;
+ int ret_val = 0;
+ unsigned int mode =0;
+ char* haptic_file = "/usr/share/immersion/01_Touch/touch_20ms_sharp.ivt";
+ haptic_dev_idx dev_idx = DEV_IDX_0;
+ int dev_handle;
+
+ dev_handle = device_haptic_open(dev_idx,mode);
+ if(dev_handle < 0)
+ {
+ tet_infoline("device_haptic_get_file_duration() failed in positive test case");
+ tet_result(TET_FAIL);
+ return;
+ }
+
+ ret_val = device_haptic_get_file_duration(dev_handle, haptic_file,&duration);
+ if((ret_val < 0) || (duration<0))
+ {
+ tet_infoline("device_haptic_get_file_duration() failed in positive test case");
+ tet_result(TET_FAIL);
+ return;
+ }
+
+ device_haptic_close(dev_handle);
+ tet_result(TET_PASS);
+}
+
+/**
+ * @brief Negative test case of ug_init device_haptic_get_file_duration()
+ */
+static void utc_SystemFW_device_haptic_get_file_duration_func_02(void)
+{
+ int duration = 0;
+ int invalid_handle = -1;
+ int ret_val = 0;
+ char* haptic_file = "test.ivt";
+
+ //Get duration from attern file
+ ret_val = device_haptic_get_file_duration(invalid_handle, haptic_file, &duration);
+ if(ret_val >= 0)
+ {
+ tet_infoline("device_haptic_get_file_duration() failed in negative test case");
+ tet_result(TET_FAIL);
+ return;
+ }
+ tet_result(TET_PASS);
+}
--- /dev/null
+#include <tet_api.h>
+#include <devman.h>
+#include <devman_haptic.h>
+#define HAPTIC_TEST_PATTERN EFFCTVIBE_NOTIFICATION
+
+static void startup(void);
+static void cleanup(void);
+
+void (*tet_startup)(void) = startup;
+void (*tet_cleanup)(void) = cleanup;
+
+static void utc_SystemFW_device_haptic_get_pattern_duration_func_01(void);
+static void utc_SystemFW_device_haptic_get_pattern_duration_func_02(void);
+
+enum {
+ POSITIVE_TC_IDX = 0x01,
+ NEGATIVE_TC_IDX,
+};
+
+struct tet_testlist tet_testlist[] = {
+ { utc_SystemFW_device_haptic_get_pattern_duration_func_01, POSITIVE_TC_IDX },
+ { utc_SystemFW_device_haptic_get_pattern_duration_func_02, NEGATIVE_TC_IDX },
+ { NULL, 0 },
+};
+
+static void startup(void)
+{
+}
+
+static void cleanup(void)
+{
+}
+
+/**
+ * @brief Positive test case of device_haptic_get_pattern_duration()
+ */
+static void utc_SystemFW_device_haptic_get_pattern_duration_func_01(void)
+{
+ int duration = 0;
+ int ret_val = 0;
+ unsigned int mode =0;
+ haptic_dev_idx dev_idx = DEV_IDX_0;
+ int dev_handle;
+
+ dev_handle = device_haptic_open(dev_idx,mode);
+ if(dev_handle < 0)
+ {
+ tet_infoline("device_haptic_get_file_duration() failed in positive test case");
+ tet_result(TET_FAIL);
+ return;
+ }
+
+ ret_val = device_haptic_get_pattern_duration(dev_handle,HAPTIC_TEST_PATTERN, &duration);
+ if((ret_val < 0) || (duration < 0))
+ {
+ tet_infoline("device_haptic_get_file_duration() failed in positive test case");
+ tet_result(TET_FAIL);
+ return;
+ }
+
+ device_haptic_close(dev_handle);
+ tet_result(TET_PASS);
+}
+
+/**
+ * @brief Negative test case of ug_init device_haptic_get_pattern_duration()
+ */
+static void utc_SystemFW_device_haptic_get_pattern_duration_func_02(void)
+{
+ int ret_val = 0;
+ int duration = 0;
+ int invalid_handle = -1;
+
+ ret_val = device_haptic_get_pattern_duration(invalid_handle,HAPTIC_TEST_PATTERN, &duration);
+ if(ret_val >= 0)
+ {
+ tet_infoline("device_haptic_get_file_duration() failed in negative test case");
+ tet_result(TET_FAIL);
+ return;
+ }
+ tet_result(TET_PASS);
+}
--- /dev/null
+#include <tet_api.h>
+#include <devman.h>
+#include <devman_haptic.h>
+
+static void startup(void);
+static void cleanup(void);
+
+void (*tet_startup)(void) = startup;
+void (*tet_cleanup)(void) = cleanup;
+
+static void utc_SystemFW_device_haptic_open_func_01(void);
+static void utc_SystemFW_device_haptic_open_func_02(void);
+
+enum {
+ POSITIVE_TC_IDX = 0x01,
+ NEGATIVE_TC_IDX,
+};
+
+struct tet_testlist tet_testlist[] = {
+ { utc_SystemFW_device_haptic_open_func_01, POSITIVE_TC_IDX },
+ { utc_SystemFW_device_haptic_open_func_02, NEGATIVE_TC_IDX },
+ { NULL, 0 },
+};
+
+static void startup(void)
+{
+}
+
+static void cleanup(void)
+{
+}
+
+/**
+ * @brief Positive test case of device_haptic_open()
+ */
+static void utc_SystemFW_device_haptic_open_func_01(void)
+{
+ int r = 0;
+ unsigned int mode =0;
+ haptic_dev_idx dev_idx = DEV_IDX_0;
+
+ r = device_haptic_open(dev_idx,mode);
+
+ if (r < 0) {
+ tet_infoline("device_haptic_open() failed in positive test case");
+ tet_result(TET_FAIL);
+ return;
+ }
+ tet_result(TET_PASS);
+ device_haptic_close(r);
+}
+
+/**
+ * @brief Negative test case of ug_init device_haptic_open()
+ */
+static void utc_SystemFW_device_haptic_open_func_02(void)
+{
+ int r = 0;
+ unsigned int mode =0;
+ haptic_dev_idx dev_idx = 1000;
+
+ r = device_haptic_open(dev_idx,mode);
+
+ if (r >= 0) {
+ tet_infoline("device_haptic_open() failed in negative test case");
+ tet_result(TET_FAIL);
+ device_haptic_close(r);
+ return;
+ }
+ tet_result(TET_PASS);
+}
--- /dev/null
+#include <tet_api.h>
+#include <devman.h>
+#include <devman_haptic.h>
+
+static void startup(void);
+static void cleanup(void);
+
+void (*tet_startup)(void) = startup;
+void (*tet_cleanup)(void) = cleanup;
+
+static void utc_SystemFW_device_haptic_play_file_func_01(void);
+static void utc_SystemFW_device_haptic_play_file_func_02(void);
+
+enum {
+ POSITIVE_TC_IDX = 0x01,
+ NEGATIVE_TC_IDX,
+};
+
+struct tet_testlist tet_testlist[] = {
+ { utc_SystemFW_device_haptic_play_file_func_01, POSITIVE_TC_IDX },
+ { utc_SystemFW_device_haptic_play_file_func_02, NEGATIVE_TC_IDX },
+ { NULL, 0 },
+};
+
+static void startup(void)
+{
+}
+
+static void cleanup(void)
+{
+}
+
+/**
+ * @brief Positive test case of device_haptic_play_file()
+ */
+static void utc_SystemFW_device_haptic_play_file_func_01(void)
+{
+ int ret_val = 0;
+ haptic_dev_idx dev_idx = DEV_IDX_0;
+ unsigned int mode =0;
+ char* haptic_file = "/usr/share/immersion/01_Touch/touch_20ms_sharp.ivt";
+ int dev_handle;
+
+ dev_handle = device_haptic_open(dev_idx,mode);
+ if(dev_handle < 0)
+ {
+ tet_infoline("device_haptic_play_file() failed in positive test case");
+ tet_result(TET_FAIL);
+ return;
+ }
+
+ ret_val = device_haptic_play_file(dev_handle, haptic_file, 1, 1);
+ if(ret_val < 0)
+ {
+ tet_infoline("device_haptic_play_file() failed in positive test case");
+ tet_result(TET_FAIL);
+ device_haptic_close(dev_handle);
+ return;
+ }
+
+ device_haptic_close(dev_handle);
+ tet_result(TET_PASS);
+}
+
+/**
+ * @brief Negative test case of ug_init device_haptic_play_file()
+ */
+static void utc_SystemFW_device_haptic_play_file_func_02(void)
+{
+ int ret_val = 0;
+ int invalid_handle = -1;
+ char* haptic_file = "/usr/share/immersion/01_Touch/touch_20ms_sharp.ivt";
+
+ ret_val = device_haptic_play_file(invalid_handle, haptic_file, 1, 1);
+ if(ret_val >= 0)
+ {
+ tet_infoline("device_haptic_play_file() failed in negative test case");
+ tet_result(TET_FAIL);
+ return;
+ }
+ tet_result(TET_PASS);
+}
--- /dev/null
+#include <tet_api.h>
+#include <devman.h>
+#include <devman_haptic.h>
+
+static void startup(void);
+static void cleanup(void);
+
+void (*tet_startup)(void) = startup;
+void (*tet_cleanup)(void) = cleanup;
+
+static void utc_SystemFW_device_haptic_play_monotone_func_01(void);
+static void utc_SystemFW_device_haptic_play_monotone_func_02(void);
+
+enum {
+ POSITIVE_TC_IDX = 0x01,
+ NEGATIVE_TC_IDX,
+};
+
+struct tet_testlist tet_testlist[] = {
+ { utc_SystemFW_device_haptic_play_monotone_func_01, POSITIVE_TC_IDX },
+ { utc_SystemFW_device_haptic_play_monotone_func_02, NEGATIVE_TC_IDX },
+ { NULL, 0 },
+};
+
+static void startup(void)
+{
+}
+
+static void cleanup(void)
+{
+}
+
+/**
+ * @brief Positive test case of device_haptic_play_monotone()
+ */
+static void utc_SystemFW_device_haptic_play_monotone_func_01(void)
+{
+ int ret_val = 0;
+ haptic_dev_idx dev_idx = DEV_IDX_0;
+ unsigned int mode =0;
+ int dev_handle;
+
+ dev_handle = device_haptic_open(dev_idx,mode);
+ if(dev_handle < 0)
+ {
+ tet_infoline("device_haptic_play_monotone() failed in positive test case");
+ tet_result(TET_FAIL);
+ return;
+ }
+
+ ret_val = device_haptic_play_monotone(dev_handle ,1);
+ if(ret_val < 0)
+ {
+ tet_infoline("device_haptic_play_monotone() failed in positive test case");
+ tet_result(TET_FAIL);
+ device_haptic_close(dev_handle);
+ return;
+ }
+
+ device_haptic_close(dev_handle);
+ tet_result(TET_PASS);
+}
+
+/**
+ * @brief Negative test case of ug_init device_haptic_play_monotone()
+ */
+static void utc_SystemFW_device_haptic_play_monotone_func_02(void)
+{
+ int ret_val = 0;
+ int invalid_handle = -1;
+
+ ret_val = device_haptic_play_monotone(invalid_handle ,1);
+ if(ret_val >= 0) {
+ tet_infoline("device_haptic_play_monotone() failed in negative test case");
+ tet_result(TET_FAIL);
+ return;
+ }
+ tet_result(TET_PASS);
+}
--- /dev/null
+#include <tet_api.h>
+#include <devman.h>
+#include <devman_haptic.h>
+#define HAPTIC_TEST_PATTERN EFFCTVIBE_NOTIFICATION
+
+static void startup(void);
+static void cleanup(void);
+
+void (*tet_startup)(void) = startup;
+void (*tet_cleanup)(void) = cleanup;
+
+static void utc_SystemFW_device_haptic_play_pattern_func_01(void);
+static void utc_SystemFW_device_haptic_play_pattern_func_02(void);
+
+enum {
+ POSITIVE_TC_IDX = 0x01,
+ NEGATIVE_TC_IDX,
+};
+
+struct tet_testlist tet_testlist[] = {
+ { utc_SystemFW_device_haptic_play_pattern_func_01, POSITIVE_TC_IDX },
+ { utc_SystemFW_device_haptic_play_pattern_func_02, NEGATIVE_TC_IDX },
+ { NULL, 0 },
+};
+
+static void startup(void)
+{
+}
+
+static void cleanup(void)
+{
+}
+
+/**
+ * @brief Positive test case of device_haptic_play_pattern()
+ */
+static void utc_SystemFW_device_haptic_play_pattern_func_01(void)
+{
+ int ret_val = 0;
+ haptic_dev_idx dev_idx = DEV_IDX_0;
+ unsigned int mode =0;
+ int dev_handle = 0;
+
+ dev_handle = device_haptic_open(dev_idx,mode);
+ if(dev_handle < 0)
+ {
+ tet_infoline("device_haptic_play_pattern() failed in positive test case");
+ tet_result(TET_FAIL);
+ return;
+ }
+
+ ret_val = device_haptic_play_pattern(dev_handle, HAPTIC_TEST_PATTERN , 1, 1);
+ if(ret_val < 0)
+ {
+ tet_infoline("device_haptic_play_pattern() failed in positive test case");
+ tet_result(TET_FAIL);
+ device_haptic_close(dev_handle);
+ return;
+ }
+
+ device_haptic_close(dev_handle);
+ tet_result(TET_PASS);
+}
+
+/**
+ * @brief Negative test case of ug_init device_haptic_play_pattern()
+ */
+static void utc_SystemFW_device_haptic_play_pattern_func_02(void)
+{
+
+ int ret_val = 0;
+ int invalid_handle = -1;
+
+ ret_val = device_haptic_play_pattern(invalid_handle, HAPTIC_TEST_PATTERN , 1, 1);
+ if(ret_val >= 0) {
+ tet_infoline("device_haptic_play_pattern() failed in negative test case");
+ tet_result(TET_FAIL);
+ return;
+ }
+ tet_result(TET_PASS);
+}
--- /dev/null
+#include <tet_api.h>
+#include <devman.h>
+#include <devman_haptic.h>
+
+static void startup(void);
+static void cleanup(void);
+
+void (*tet_startup)(void) = startup;
+void (*tet_cleanup)(void) = cleanup;
+
+static void utc_SystemFW_device_haptic_stop_play_func_01(void);
+static void utc_SystemFW_device_haptic_stop_play_func_02(void);
+
+enum {
+ POSITIVE_TC_IDX = 0x01,
+ NEGATIVE_TC_IDX,
+};
+
+struct tet_testlist tet_testlist[] = {
+ { utc_SystemFW_device_haptic_stop_play_func_01, POSITIVE_TC_IDX },
+ { utc_SystemFW_device_haptic_stop_play_func_02, NEGATIVE_TC_IDX },
+ { NULL, 0 },
+};
+
+static void startup(void)
+{
+}
+
+static void cleanup(void)
+{
+}
+
+/**
+ * @brief Positive test case of device_haptic_stop_play()
+ */
+static void utc_SystemFW_device_haptic_stop_play_func_01(void)
+{
+ int ret_val = 0;
+ haptic_dev_idx dev_idx = DEV_IDX_0;
+ unsigned int mode =0;
+ int dev_handle = 0;
+
+ dev_handle = device_haptic_open(dev_idx,mode);
+ if(dev_handle < 0)
+ {
+ tet_infoline("device_haptic_stop_play() failed in positive test case");
+ tet_result(TET_FAIL);
+ return;
+ }
+
+ ret_val = device_haptic_play_monotone(dev_handle ,100);
+ if(ret_val < 0)
+ {
+ tet_infoline("device_haptic_stop_play() failed in positive test case");
+ tet_result(TET_FAIL);
+ device_haptic_close(dev_handle);
+ return;
+ }
+
+ ret_val = device_haptic_stop_play(dev_handle);
+ if(ret_val < 0)
+ {
+ tet_infoline("device_haptic_stop_play() failed in positive test case");
+ tet_result(TET_FAIL);
+ device_haptic_close(dev_handle);
+ return;
+ }
+
+
+ device_haptic_close(dev_handle);
+ tet_result(TET_PASS);
+ int r = 0;
+
+/*
+ r = device_haptic_stop_play(...);
+*/
+ if (r) {
+ tet_infoline("device_haptic_stop_play() failed in positive test case");
+ tet_result(TET_FAIL);
+ return;
+ }
+ tet_result(TET_PASS);
+}
+
+/**
+ * @brief Negative test case of ug_init device_haptic_stop_play()
+ */
+static void utc_SystemFW_device_haptic_stop_play_func_02(void)
+{
+ int r = 0;
+
+
+ r = device_haptic_stop_play(-1);
+
+ if (r>=0) {
+ tet_infoline("device_haptic_stop_play() failed in negative test case");
+ tet_result(TET_FAIL);
+ return;
+ }
+ tet_result(TET_PASS);
+}
--- /dev/null
+#include <tet_api.h>
+#include <devman.h>
+
+static void startup(void);
+static void cleanup(void);
+
+void (*tet_startup)(void) = startup;
+void (*tet_cleanup)(void) = cleanup;
+
+static void utc_SystemFW_device_is_battery_full_func_01(void);
+//static void utc_SystemFW_device_is_battery_full_func_02(void);
+
+enum {
+ POSITIVE_TC_IDX = 0x01,
+ NEGATIVE_TC_IDX,
+};
+
+struct tet_testlist tet_testlist[] = {
+ { utc_SystemFW_device_is_battery_full_func_01, POSITIVE_TC_IDX },
+// { utc_SystemFW_device_is_battery_full_func_02, NEGATIVE_TC_IDX },
+ { NULL, 0 },
+};
+
+static void startup(void)
+{
+}
+
+static void cleanup(void)
+{
+}
+
+/**
+ * @brief Positive test case of device_is_battery_full()
+ */
+static void utc_SystemFW_device_is_battery_full_func_01(void)
+{
+
+ int r = 0;
+
+
+ r = device_is_battery_full();
+
+ if (r<0) {
+ tet_infoline("device_is_battery_full() failed in positive test case");
+ tet_result(TET_FAIL);
+ return;
+ }
+ tet_result(TET_PASS);
+}
+
+/**
+ * @brief Negative test case of ug_init device_is_battery_full()
+ */
+//static void utc_SystemFW_device_is_battery_full_func_02(void)
+//{
+// int r = 0;
+//
+ // r = device_is_battery_full();
+//
+// if (r>=0) {
+// tet_infoline("device_is_battery_full() failed in negative test case");
+// tet_result(TET_FAIL);
+// return;
+// }
+// tet_result(TET_PASS);
+//}
--- /dev/null
+#include <tet_api.h>
+#include <devman.h>
+
+static void startup(void);
+static void cleanup(void);
+
+void (*tet_startup)(void) = startup;
+void (*tet_cleanup)(void) = cleanup;
+
+static void utc_SystemFW_device_release_brt_ctrl_func_01(void);
+static void utc_SystemFW_device_release_brt_ctrl_func_02(void);
+
+enum {
+ POSITIVE_TC_IDX = 0x01,
+ NEGATIVE_TC_IDX,
+};
+
+struct tet_testlist tet_testlist[] = {
+ { utc_SystemFW_device_release_brt_ctrl_func_01, POSITIVE_TC_IDX },
+ { utc_SystemFW_device_release_brt_ctrl_func_02, NEGATIVE_TC_IDX },
+ { NULL, 0 },
+};
+
+static void startup(void)
+{
+}
+
+static void cleanup(void)
+{
+}
+
+/**
+ * @brief Positive test case of device_release_brt_ctrl()
+ */
+static void utc_SystemFW_device_release_brt_ctrl_func_01(void)
+{
+ int org_brt = 0;
+ int ret_val = 0;
+ display_num_t disp = DEV_DISPLAY_0;
+
+ org_brt = device_get_display_brt(disp);
+ if(org_brt < 0)
+ org_brt = 7;
+
+
+
+ ret_val = device_release_brt_ctrl(disp);
+ if(ret_val < 0) {
+ tet_infoline("device_release_brt_ctrl() failed in positive test case");
+ tet_result(TET_FAIL);
+ return;
+ }
+ tet_result(TET_PASS);
+}
+
+/**
+ * @brief Negative test case of ug_init device_release_brt_ctrl()
+ */
+static void utc_SystemFW_device_release_brt_ctrl_func_02(void)
+{
+ int ret_val = 0;
+ int org_brt = -1;
+
+ display_num_t disp = -1;
+
+ ret_val = device_release_brt_ctrl(disp);
+ if(ret_val >=0 ) {
+ tet_infoline("device_release_brt_ctrl() failed in negative test case");
+ tet_result(TET_FAIL);
+ return;
+ }
+ tet_result(TET_PASS);
+}
--- /dev/null
+#include <tet_api.h>
+#include <devman.h>
+
+static void startup(void);
+static void cleanup(void);
+
+void (*tet_startup)(void) = startup;
+void (*tet_cleanup)(void) = cleanup;
+
+static void utc_SystemFW_device_release_gamma_ctrl_func_01(void);
+static void utc_SystemFW_device_release_gamma_ctrl_func_02(void);
+
+enum {
+ POSITIVE_TC_IDX = 0x01,
+ NEGATIVE_TC_IDX,
+};
+
+struct tet_testlist tet_testlist[] = {
+ { utc_SystemFW_device_release_gamma_ctrl_func_01, POSITIVE_TC_IDX },
+ { utc_SystemFW_device_release_gamma_ctrl_func_02, NEGATIVE_TC_IDX },
+ { NULL, 0 },
+};
+
+static void startup(void)
+{
+}
+
+static void cleanup(void)
+{
+}
+
+/**
+ * @brief Positive test case of device_release_gamma_ctrl()
+ */
+static void utc_SystemFW_device_release_gamma_ctrl_func_01(void)
+{
+ int ret_val = 0;
+ display_num_t disp = DEV_DISPLAY_0;
+ display_gamma_t org_val = 1;
+
+ ret_val = device_release_gamma_ctrl(disp,org_val);
+ if(ret_val < 0) {
+ tet_infoline("device_release_gamma_ctrl() failed in positive test case");
+ tet_result(TET_FAIL);
+ return;
+ }
+ tet_result(TET_PASS);
+}
+
+/**
+ * @brief Negative test case of ug_init device_release_gamma_ctrl()
+ */
+static void utc_SystemFW_device_release_gamma_ctrl_func_02(void)
+{
+ int ret_val = 0;
+ int org_brt = -1;
+
+ display_num_t disp = -1;
+
+ ret_val = device_release_gamma_ctrl(disp,org_brt);
+ if (ret_val >= 0) {
+ tet_infoline("device_release_gamma_ctrl() failed in negative test case");
+ tet_result(TET_FAIL);
+ return;
+ }
+ tet_result(TET_PASS);
+}
--- /dev/null
+#include <tet_api.h>
+#include <devman.h>
+
+static void startup(void);
+static void cleanup(void);
+
+void (*tet_startup)(void) = startup;
+void (*tet_cleanup)(void) = cleanup;
+
+static void utc_SystemFW_device_set_display_brt_func_01(void);
+static void utc_SystemFW_device_set_display_brt_func_02(void);
+
+enum {
+ POSITIVE_TC_IDX = 0x01,
+ NEGATIVE_TC_IDX,
+};
+
+struct tet_testlist tet_testlist[] = {
+ { utc_SystemFW_device_set_display_brt_func_01, POSITIVE_TC_IDX },
+ { utc_SystemFW_device_set_display_brt_func_02, NEGATIVE_TC_IDX },
+ { NULL, 0 },
+};
+
+static void startup(void)
+{
+}
+
+static void cleanup(void)
+{
+}
+
+/**
+ * @brief Positive test case of device_set_display_brt()
+ */
+static void utc_SystemFW_device_set_display_brt_func_01(void)
+{
+ int ret_val = 0;
+ display_num_t disp = DEV_DISPLAY_0;
+
+ ret_val = device_set_display_brt(disp,6);
+ if(ret_val > 0) {
+ tet_infoline("device_set_display_brt() failed in positive test case");
+ tet_result(TET_FAIL);
+ return;
+ }
+ tet_result(TET_PASS);
+}
+
+/**
+ * @brief Negative test case of ug_init device_set_display_brt()
+ */
+static void utc_SystemFW_device_set_display_brt_func_02(void)
+{
+ int ret_val = 0;
+
+ display_num_t disp = -1;
+
+ ret_val = device_set_display_brt(disp,6);
+ if(ret_val >= 0) {
+ tet_infoline("device_set_display_brt() failed in negative test case");
+ tet_result(TET_FAIL);
+ return;
+ }
+ tet_result(TET_PASS);
+}
--- /dev/null
+#include <tet_api.h>
+#include <devman.h>
+
+static void startup(void);
+static void cleanup(void);
+
+void (*tet_startup)(void) = startup;
+void (*tet_cleanup)(void) = cleanup;
+
+static void utc_SystemFW_device_set_display_gamma_func_01(void);
+static void utc_SystemFW_device_set_display_gamma_func_02(void);
+
+enum {
+ POSITIVE_TC_IDX = 0x01,
+ NEGATIVE_TC_IDX,
+};
+
+struct tet_testlist tet_testlist[] = {
+ { utc_SystemFW_device_set_display_gamma_func_01, POSITIVE_TC_IDX },
+ { utc_SystemFW_device_set_display_gamma_func_02, NEGATIVE_TC_IDX },
+ { NULL, 0 },
+};
+
+static void startup(void)
+{
+}
+
+static void cleanup(void)
+{
+}
+
+/**
+ * @brief Positive test case of device_set_display_gamma()
+ */
+static void utc_SystemFW_device_set_display_gamma_func_01(void)
+{
+ int r = 0;
+ display_num_t disp = DEV_DISPLAY_0;
+
+ r = device_set_display_gamma(disp,1);
+ if (r<0) {
+ tet_infoline("device_set_display_gamma() failed in positive test case");
+ tet_result(TET_FAIL);
+ return;
+ }
+ tet_result(TET_PASS);
+}
+
+/**
+ * @brief Negative test case of ug_init device_set_display_gamma()
+ */
+static void utc_SystemFW_device_set_display_gamma_func_02(void)
+{
+ int r = 0;
+ display_num_t disp = -1;
+
+ r = device_set_display_gamma(disp,-1);
+
+ if (r>=0) {
+ tet_infoline("device_set_display_gamma() failed in negative test case");
+ tet_result(TET_FAIL);
+ return;
+ }
+ tet_result(TET_PASS);
+}
--- /dev/null
+#include <tet_api.h>
+#include <devman.h>
+
+static void startup(void);
+static void cleanup(void);
+
+void (*tet_startup)(void) = startup;
+void (*tet_cleanup)(void) = cleanup;
+
+static void utc_SystemFW_device_set_property_func_01(void);
+static void utc_SystemFW_device_set_property_func_02(void);
+
+enum {
+ POSITIVE_TC_IDX = 0x01,
+ NEGATIVE_TC_IDX,
+};
+
+struct tet_testlist tet_testlist[] = {
+ { utc_SystemFW_device_set_property_func_01, POSITIVE_TC_IDX },
+ { utc_SystemFW_device_set_property_func_02, NEGATIVE_TC_IDX },
+ { NULL, 0 },
+};
+
+static void startup(void)
+{
+}
+
+static void cleanup(void)
+{
+}
+
+/**
+ * @brief Positive test case of device_set_property()
+ */
+static void utc_SystemFW_device_set_property_func_01(void)
+{
+ int value = 6;
+ int ret_val = 0;
+ int property = DISPLAY_PROP_BRIGHTNESS;
+ devtype_t devtype = DEVTYPE_DISPLAY0;
+
+ //set brightness to 6
+ ret_val = device_set_property(devtype,property,value);
+ if((ret_val < 0) || (value == -1)) {
+ tet_infoline("device_set_property() failed in positive test case");
+ tet_result(TET_FAIL);
+ return;
+ }
+ tet_result(TET_PASS);
+}
+
+/**
+ * @brief Negative test case of ug_init device_set_property()
+ */
+static void utc_SystemFW_device_set_property_func_02(void)
+{
+ int ret_val = 0;
+ int property = DISPLAY_PROP_BRIGHTNESS;
+ devtype_t devtype = -1;
+
+ ret_val = device_set_property(devtype,property,-1);
+ if(ret_val >= 0) {
+ tet_infoline("device_set_property() failed in negative test case");
+ tet_result(TET_FAIL);
+ return;
+ }
+ tet_result(TET_PASS);
+}
--- /dev/null
+# Package Information for pkg-config
+
+prefix=@PREFIX@
+exec_prefix=@EXEC_PREFIX@
+libdir=@LIB_INSTALL_DIR@
+includedir=@INCLUDEDIR@
+
+Name: device manager
+Description: SAMSUNG Linux platform device control library
+Version: @VERSION@
+Requires:
+Libs: -L${libdir} -ldevman -ldl
+Cflags: -I${includedir}
--- /dev/null
+# Package Information for pkg-config
+
+prefix=@PREFIX@
+exec_prefix=@EXEC_PREFIX@
+libdir=@LIB_INSTALL_DIR@
+includedir=@INCLUDEDIR@
+
+Name: devman_haptic
+Description: SAMSUNG Linux platform motor devman_haptic library
+Version: @VERSION@
+Requires:
+Libs: -L${libdir} -ldevman
+Cflags: -I${includedir}
--- /dev/null
+/*
+ * devman
+ * 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.
+ */
+
+
+/**
+ *
+ * @ingroup SLP_PG
+ * @defgroup SLP_PG_DEVMAN Device Manager
+ * @{
+
+<h1 class="pg">Introduction</h1>
+
+<h2 class="pg">Purpose</h2>
+The purpose of this document is to describe how applications can use Device Manager APIs. This document gives programming guidelines to application engineers.
+
+<h2 class="pg">Scope</h2>
+The scope of this document is limited to Device Manager API usage.
+
+<br>
+<h1 class="pg">Device Manager Library Overview</h1>
+<h2 class="pg">General Device Manager</h2>
+Device Manager library is provided to control the device and to get data about several devices. You can get the data about battery, charger, display and so on.<br>
+Devman library uses sysfs for interfaces with device drivers and kernel. sysfs is a virtual file system provided by Linux 2.6 or above. Please refer to the web site,
+http://www.kernel.org/pub/linux/kernel/people/mochel/doc/papers/ols-2005/mochel.pdf for more information about sysfs.
+The following figure shows the basic architecture of devman library
+
+<h3 class="pg" align="center">Device Manager Architecture</h3>
+@image html SLP_devman_PG_architecture.png
+<br>
+<h2 class="pg">Haptic Device Manager</h2>
+<h3 class="pg" align="center">Haptic Vibration Functional Level Architecture</h3>
+@image html SLP_devman_PG_haptic_architecture.png
+
+The client side is available in the form of a shared library to all the processes, whereas the server is a daemon.
+As shown in the diagram applications/middleware frameworks can have the haptic vibration client library in the process context.
+<br><br>
+The haptic vibration client is available in form of a shared library. This library has APIs which support various features.
+These features are playing a rhythmical vibration pattern, playing a monotonous vibration pattern, etc.
+Applications can call these APIs to give vibration feedback on any event. This could also be used to indicate any events or changes of a state to the user.
+<br><br>
+The server interacts with the device driver interfaces and generates vibration feedback.
+<br><br>
+<h3 class="pg">Haptic Vibration Features</h3>
+<b>Haptic client features</b>
+-# Available in shared library form.<br>
+-# Provides set of APIs to play haptic vibration patterns.<br>
+-# Provide unique access control mechanism through client server architecture.<br>
+-# Provision to play rhythmical vibration patterns.<br>
+-# Provides functionality for application to play a different vibration pattern for a different event.<br>
+-# Provides support for user defined duration for monotone playing or iteration for pattern playing.<br>
+-# Provides immediate stop control over the vibrations played.<br><br>
+
+<b>Haptic server features</b>
+-# The actual implementation of the functionality supported by haptic-vibration library has been implemented through haptic-server.<br>
+-# Haptic-server processes the vibration pattern's play/stop requests sent by application through the haptic client library.<br>
+-# There is an internal database maintained for different patterns and their specification.<br>
+-# When application requests a particular pattern, haptic server checks this database for the specification of that pattern.<br>
+-# After getting data from database, server sends these specific details to device driver which plays the pattern.<br>
+-# Server can maintain multiple requests at a time on a priority basis.<br><br>
+
+<h1 class="pg">Device Manager Funtions</h1>
+
+<h2 class="pg">General Device Manager APIs</h2>
+<i><b>API : device_get_battery_pct</b></i><br>
+<b>Parameter :</b> void<br>
+<b>Return :</b> int<br>
+<b>Functionality :</b> This API is used to get the remaining battery percentage. On success, integer value(0~100) that indicate remaining battery percentage is returned.
+Or a negative value (-1) is returned on failure.
+<br><br>
+<i><b>API : device_is_battery_full</b></i><br>
+<b>Parameter :</b> void<br>
+<b>Return :</b> int <br>
+<b>Functionality :</b> This API is used to get the fully charged status of battery. On fully charged, the integer value (1) is returned,
+(0) is returned if battery is not fully charged, a negative value (-1) is returned on failure.
+<br><br>
+<i><b>API : device_get_display_brt</b></i>
+<br><b>Parameter In :</b> display_num_t num
+<br><b>Return :</b> int
+<br><b>Functionality :</b> This API is used to get the current brightness of the display from sysfs.
+The function returns the current brightness value on success and a negative value (-1) on failure.
+<br><br>
+<b>Enumerate values:</b>
+@code
+// Display number
+typedef enum {
+ DEV_DISPLAY_0,
+ DEV_DISPLAY_1,
+ DEV_MAIN_DISPLAY = DEV_DISPLAY_0,
+} display_num_t;
+@endcode
+
+<i><b>API : device_set_display_brt</b></i>
+<br><b>Parameter In :</b> display_num_t num
+<br><b>Parameter In :</b> int val
+<br><b>Return :</b> int
+<br><b>Functionality :</b> This API is used to set the current brightness of the display using sysfs.
+The parameter val should be set as a brightnesss value of your target.
+The function returns the current brightness value on success and a negative value (-1) on failure.
+<br><br>
+<i><b>API : device_get_display_gamma</b></i>
+<br></b>Parameter In :</b> display_num_t num
+<br><b>Return :</b> int
+<br><b>Functionality :</b> This API is used to get the current gamma value of the display from sysfs.
+The function returns the current brightness value on success and a negative value (-1) on failure.
+<br><br>
+<i><b>API : device_set_display_brt</b></i>
+<br><b>Parameter In :</b> display_num_t num
+<br><b>Parameter In :</b> int val
+<br><b>Return :</b> int
+<br><b>Functionality :</b> This API is used to set the current brightness of the display using sysfs.
+The parameter val should be set as a brightnesss value of your target.
+The function returns the current brightness value on success and a negative value (-1) on failure.
+<br><br>
+<i><b>API : device_get_display_gamma</b></i>
+<br><b>Parameter In :</b> display_num_t num
+<br><b>Return :</b> int
+<br><b>Functionality :</b> This API is used to get the current gamma value of the display from sysfs.
+The function returns the current brightness value on success and a negative value (-1) on failure.
+<b>Enumerate values:</b>
+@code
+// LCD gamma values
+typedef enum {
+ LCD_GAMMA_22 = 1, // 8500K , 2.2 GAMMA
+ LCD_GAMMA_19 = 2, // 8500K , 1.9 GAMMA
+ LCD_GAMMA_17 = 3, // 8500K , 1.7 GAMMA
+ LCD_GAMMA_NORMAL = LCD_GAMMA_22, // Normal screen
+ LCD_GAMMA_PLAY_RECORD = LCD_GAMMA_19, // Playing or recording cam
+ LCD_GAMMA_PREVIEW = LCD_GAMMA_17, // Preview
+ LCD_GAMMA_MOVIE = LCD_GAMMA_19, // Movie
+ LCD_GAMMA_CAMERA = 11, // Camera
+} display_gamma_t;
+@endcode
+
+<i><b>API : device_power_suspend</b></i>
+<br><b>Parameter :</b> void
+<br><b>Return :</b> int
+<br><b>Functionality :</b> This API is used to make the phone go to a suspend (sleep) state.
+The suspend state consumes little battery power. If the caller process does not have the permission which is root, it returns failure.
+The function returns 0 on success and a negative value (-1) on failure.
+<br><br>
+<i><b>API : device_get_property</b></i>
+<br><b>Parameter In :</b> devtype_t devtype
+<br><b>Parameter In :</b> int property
+<br><b>Parameter Out :</b> int *value
+<br><b>Return :</b> int
+<br><b>Functionality :</b>This generic API is used to get the property values of supported devices.
+If the caller process does not have permission, it returns failure.
+The function returns 0 on success and a negative value (-1) on failure.
+<br><br>
+<i><b>API : device_set_property</b></i>
+<br><b>Parameter In :</b> devtype_t devtype
+<br><b>Parameter In :</b> int property
+<br><b>Parameter In :</b> int value
+<br><b>Return :</b> int
+<br><b>Functionality :</b>This generic API is used to set the property values of supported devices.
+If the caller process does not have permission, it returns failure.
+The function returns 0 on success and a negative value (-1) on failure.
+
+<h2 class="pg">Haptic Device Manager APIs</h2>
+<i><b>API : device_haptic_open</b></i>
+<br><b>Parameter In :</b> haptic_dev_idx dev_idx , unsigned int mode
+<br><b>Return :</b> int
+<br><b>Functionality :</b> This API opens a Haptic-vibration device. On success it returns a dev_handle value.
+In case of failure it returns a negative value. If the device is already open it returns (-1). <br>
+The first in parameter dev_idx should be from a predefined haptic-device-index which is available in the typedef enum haptic_dev_idx.
+The DEV_IDX_0 means first haptic-device-index of target , the DEV_IDX_1 means second haptic-device-index of target and the DEV_IDX_ALL means both of them.
+The availability of the dev_idx value is dependent on the real target. Normally, set a DEV_IDX_0 value to the first haptic-device.<br>
+The second in parameter mode is reserved for future so just set a 0 value<br>
+<b>Note:</b> The device_haptic_open() must be called before all other haptic APIs are called.
+The device_haptic_open() should have a matching call to device_haptic_close().
+Applications call the device_haptic_open() only once if possible during application startup and call the device_haptic_close() during application shutdown.
+
+<b>Enumerate values:</b>
+@code
+//Haptic_dev_idx ;
+typedef enum haptic_dev_idx_t {
+ DEV_IDX_0 = 0x01,
+ DEV_IDX_1 = 0x02,
+ DEV_IDX_ALL = 0x04,
+};
+@endcode
+
+<i><b>API : device_haptic_close</b></i>
+<br><b>Parameter In :</b> int dev_handle
+<br><b>Parameter Return :</b> int
+<br><b>Functionality :</b> This API closes a Haptic-vibration device. On success it returns a zero value.
+In case of failure it returns a negative value. If the device is already closed it returns (-1). <br>
+The first in parameter dev_handle should be from the return value of device_haptic_open().
+<br><br>
+<i><b>API : device_haptic_play_pattern</b></i>
+<br><b>Parameter In :</b> int dev_handle , int pattern , int iteration , int feedback_level
+<br><b>Parameter Return :</b> int
+<br><b>Functionality :</b> This API plays a predefined rhythmic haptic-vibration pattern. <br>
+The first in parameter dev_handle should be from the return value of device_haptic_open().<br>
+The second in parameter pattern should be from a predefined pattern list which is available in an enumeration (effectvibe_pattern_list).
+These patterns are rhythmic vibration patterns. <br>
+The third in parameter iteration sets the number of iterations to be played. This should be less than the maximum iteration range set for the device (currently its 255). <br>
+The fourth in parameter is the vibration feedback intensity level. This level is already predefined by enumeration type value from HAPTIC _FEEDBACK_LEVEL_1
+to HAPTIC _FEEDBACK_LEVEL_5. If you want to use the value selected by the user in the Setting application menu, just set -1 value.<br>
+On success it returns a zero value. In case of failure it returns a negative value. <br>
+<b>Note:</b> The actual behavior of the feedback play pattern and the intensity depends on the target hardware.
+
+<b>Enumerate values:</b>
+@code
+//Effectvibe_pattern_list
+enum effectvibe_pattern_list {
+ EFFCTVIBE_TOUCH = 0,
+ EFFCTVIBE_HW_TOUCH,
+ EFFCTVIBE_NOTIFICATION,
+ EFFCTVIBE_INCOMING_CALL01,
+ EFFCTVIBE_INCOMING_CALL02,
+ EFFCTVIBE_INCOMONG_CALL03,
+ EFFCTVIBE_ALERTS_CALL,
+ EFFCTVIBE_OPERATION,
+ EFFCTVIBE_SILENT_MODE,
+ EFFCTVIBE_PATTERN_END
+};
+
+//Feedback Level ;
+enum {
+ HAPTIC_FEEDBACK_LEVEL_AUTO = -1,
+ HAPTIC_FEEDBACK_LEVEL_1 = 1,
+ HAPTIC_FEEDBACK_LEVEL_2 = 2,
+ HAPTIC_FEEDBACK_LEVEL_3 = 3,
+ HAPTIC_FEEDBACK_LEVEL_4 = 4,
+ HAPTIC_FEEDBACK_LEVEL_5 = 5,
+};
+
+//definition for infinite iteration ;
+#define HAPTIC_INFINITE_ITERATION 256
+@endcode
+
+<i><b>API : device_haptic_play_file</b></i>
+<br><b>Parameter In :</b> int dev_handle , const char *file_name , int iteration , int feedback_level
+<br><b>Parameter Return :</b> int
+<br><b>Functionality :</b>This API plays a predefined rhythmic haptic-vibration pattern file (only supports .ivt type file, Immersion VibeTonz).<br>
+The first in parameter dev_handle should be from the return value of device_haptic_open().<br>
+The second in parameter file_name sets rhythmic vibration pattern file with path. It only supports .ivt type pattern file. <br>
+The third in parameter iteration sets the number of iterations to be played. This should be less than the maximum iteration range set for the device (currently its 255).
+If you want to play indefinitely, use HAPTIC_INFINITE_ITERATION defined value. But it depends on the target hardware.<br>
+The fourth in parameter is the vibration feedback intensity level. This level is already predefined by enumeration type value from HAPTIC _FEEDBACK_LEVEL_1
+to HAPTIC _FEEDBACK_LEVEL_5. If you want to use the value selected by the user in the Setting application menu, just set HAPTIC_FEEDBACK_LEVEL_AUTO value.
+(But the application must have a main loop to use the HAPTIC_FEEDBACK_LEVEL_AUTO value ) <br>
+On success it returns a zero value. In case of failure it returns a negative value. <br>
+<b>Note:</b> The actual behavior of the feedback play pattern and the intensity depends on the target hardware.
+<br><br>
+<i><b>API : device_haptic_play_monotone</b></i>
+<br><b>Parameter In :</b> int dev_handle , int duration
+<br><b>Parameter Return :</b> int
+<br><b>Functionality :</b>This API plays a monotonous haptic-vibration pattern with a constant intensity.
+In this monotone play, the intensity used is the value that the user has selected in the Setting application menu.<br>
+The first in parameter dev_handle should be from the return value of device_haptic_open().<br>
+The second in parameter duration defines the length of time this vibration should be played. This duration is in milliseconds. <br>
+On success it returns a zero value. In case of failure it returns a negative value. <br>
+<b>Note:</b> The actual behavior of the feedback played and the intensity depends on the target hardware.
+<br><br>
+<i><b>API : device_haptic_stop_play</b></i>
+<br><b>Parameter In :</b> int dev_handle
+<br><b>Parameter Return :</b> int
+<br><b>Functionality :</b> This API stops the current vibration being played.<br>
+The first in parameter dev_handle should be from the return value of device_haptic_open().<br>
+On success it returns a zero value. In case of failure it returns a negative value.
+<br><br>
+<i><b>API : device_haptic_get_pattern_duration</b></i>
+<br><b>Parameter In :</b> int dev_handle , int pattern
+<br><b>Parameter Out :</b> int *duration
+<br><b>Parameter Return :</b> int
+<br><b>Functionality :</b>This API gets a duration time value from a predefined rhythmic vibration pattern.<br>
+The first in parameter dev_handle should be from the return value of device_haptic_open().<br>
+The second in parameter pattern should be from a predefined pattern list which is available in an enumeration (effectvibe_pattern_list).<br>
+The application can get a duration time value from the third out parameter duration when this API succeeds. The unit of duration is ms (millisecond)<br>
+On success it returns a zero value. In case of failure it returns a negative value. <br>
+<b>Note:</b> The actual behavior of the feedback played and the intensity depends on the target hardware.
+<br><br>
+<i><b>API : device_haptic_get_file_duration</b></i>
+<br><b>Parameter In :</b> int dev_handle , const char *file_name
+<br><b>Parameter Out :</b> int *duration
+<br><b>Parameter Return :</b> int
+<br><b>Functionality :</b>This API gets a duration time value from a predefined rhythmic vibration pattern file (only supports .ivt type file).<br>
+The first in parameter dev_handle should be from the return value of device_haptic_open().<br>
+The second in parameter file_name sets rhythmic vibration pattern file with path. It only supports .ivt type pattern file.<br>
+The application can get a duration time value from the third out parameter duration when this API succeeds. The unit of duration is ms (millisecond)<br>
+On success it returns a zero value. In case of failure it returns a negative value. <br>
+<b>Note:</b>The actual behavior of the feedback played and the intensity depends on the target hardware.<br>
+
+<br><b>Sample Code <Simple program showing how to use haptic-vibration APIs></b>
+@code
+#include <stdio.h>
+#include <devman_haptic.h>
+#define HAPTIC_TEST_ITERATION 10
+
+int main()
+{
+ int ret_val=0;
+ int dev_handle;
+
+ printf("\n Haptic vibration test : Start of the program \n");
+
+ //Open the haptic device
+ dev_handle = device_haptic_open(DEV_IDX_0,0);
+ if(dev_handle < 0)
+ return -1;
+
+ //Play a rhythmic pattern
+ ret_val = device_haptic_play_pattern(dev_handle, EFFCTVIBE_NOTIFICATION,
+ HAPTIC_TEST_ITERATION , HAPTIC_FEEDBACK_LEVEL_3);
+ if(ret_val !=0)
+ return -1;
+
+ //Play a monotone pattern for 1s == 1000ms
+ ret_val = device_haptic_play_monotone(dev_handle, 1000);
+ if(ret_val !=0)
+ return -1;
+
+ //Demo for a stop pattern API, playing a monotone for 10s
+ ret_val = device_haptic_play_monotone(dev_handle, 10000);
+ if(ret_val !=0)
+ return -1;
+
+ sleep(1);
+
+ //Stop the pattern immediately
+ ret_val = device_haptic_stop_play(dev_handle);
+ if(ret_val !=0)
+ return -1;
+
+ //Close the device
+ ret_val = device_haptic_close(dev_handle);
+ if(ret_val !=0)
+ return -1;
+}
+@endcode
+
+ @}
+**/
--- /dev/null
+/*
+ * devman
+ * 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.
+ */
+
+
+#ifndef __DEVLOG_H__
+#define __DEVLOG_H__
+
+#define FEATURE_DEVMAN_DLOG
+
+#ifdef FEATURE_DEVMAN_DLOG
+ #define LOG_TAG "DEVMAN"
+ #include <dlog.h>
+ #define DEVLOG(fmt, args...) SLOGD(fmt, ##args)
+ #define DEVERR(fmt, args...) SLOGE(fmt, ##args)
+#else
+ #define DEVLOG(x, ...)
+ #define DEVERR(x, ...)
+#endif
+
+#endif // __DEVLOG_H__
--- /dev/null
+/*
+ * devman
+ * 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.
+ */
+
+
+#ifndef __DEVMAN_H__
+#define __DEVMAN_H__
+
+#ifndef DEPRECATED
+#define DEPRECATED __attribute__((deprecated))
+#endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/** START: This code related to the opensource api will be removed */
+#include "devman_managed.h"
+/** END: Will be remved */
+
+/**
+ * @file devman.h
+ * @ingroup DEVICE_MANAGER
+ * @brief This file contains the API for the status of devices
+ * @author Tizen2.0
+ * @date 2010-01-24
+ * @version 0.1
+ */
+
+/**
+ * @defgroup DEVICE_MANAGER Device Manager
+ * @ingroup SYSTEM_FRAMEWORK
+ * @brief Device Manager library
+ *
+ * Device manager provides APIs to control devices or to get the status of devices.
+ * <br> Use devman.pc and include devman.h and devman_haptic.h files
+ *
+ * @addtogroup DEVICE_MANAGER
+ * @{
+ */
+
+/**
+ * @brief Enumerations of error code for Devman
+ */
+typedef enum {
+ DEVMAN_ERROR_NONE = 0, /**< Successful */
+ DEVMAN_ERROR_OPERATION_FAILED = -1, /**< Operation failed */
+ DEVMAN_ERROR_NOT_SUPPORTED = -2, /**< Not supported in this device */
+} devman_error_e;
+
+/**
+ * @par Description:
+ * device type enum
+ */
+ typedef enum devtype_list {
+ DEVTYPE_DISPLAY0, /**< main screen */
+ DEVTYPE_DISPLAY1 = DEVTYPE_DISPLAY0, /**< sub screen */
+ DEVTYPE_HAPTIC, /**< motor */
+ DEVTYPE_JACK, /**< jack - Micro USB, 3.5 pi jack etc */
+ DEVTYPE_LED, /**< LED */
+ DEVTYPE_POWERSUPPLY, /**< battery, PMIC, etc about power */
+ DEVTYPE_MAX,
+ DEVTYPE_TOUCHSCREEN = -1,
+ DEVTYPE_TOUCHKEY = -1,
+ DEVTYPE_GPS = -1,
+ DEVTYPE_UART = -1,
+ DEVTYPE_MMC = -1,
+ DEVTYPE_EFFECT_HAPTIC = -1,
+ } devtype_t;
+
+/**
+ * @par Description:
+ * DEVTYPE_POWERSUPPLY property for generic APIs
+ */
+ enum {
+ /**< Current remaining battery */
+ POWER_SUPPLY_PROP_CAPACITY,
+ /**< Current remaining battery expressed 1/10000 */
+ POWER_SUPPLY_PROP_CAPACITY_RAW,
+ /**< Battery is full-charged.*/
+ POWER_SUPPLY_PROP_CHARGE_FULL,
+ /**< Battery is being charged now */
+ POWER_SUPPLY_PROP_CHARGE_NOW,
+ /**< iBattery status about cahrge */
+ POWER_SUPPLY_PROP_BATTERY_HEALTH = 9,
+ };
+
+/**
+ * @par Description:
+ * DEVTYPE_DISPLAY0 and DEVTYPE_DISPLAY1 property for generic APIs
+ */
+ enum {
+ DISPLAY_PROP_DISPLAY_COUNT,
+ DISPLAY_PROP_BRIGHTNESS,
+ DISPLAY_PROP_ACL_CONTROL,
+ DISPLAY_PROP_ONOFF,
+ DISPLAY_PROP_IMAGE_ENHANCE_MODE = 8,
+ DISPLAY_PROP_IMAGE_ENHANCE_SCENARIO,
+ DISPLAY_PROP_IMAGE_ENHANCE_TONE,
+ DISPLAY_PROP_IMAGE_ENHANCE_OUTDOOR,
+ DISPLAY_PROP_IMAGE_ENHANCE_INFO = 13,
+ DISPLAY_PROP_MIN_BRIGHTNESS = -1,
+ DISPLAY_PROP_MAX_BRIGHTNESS = -1,
+ DISPLAY_PROP_GAMMA = -1,
+ };
+
+/**
+ * @par Description:
+ * DEVTYPE_LED property for generic APIs
+ */
+ enum {
+ LED_PROP_BRIGHTNESS,
+ LED_PROP_MAX_BRIGHTNESS,
+ };
+
+/**
+ * @par Description:
+ * DEVTYPE_JACK property for generic APIs
+ */
+ enum {
+ JACK_PROP_TA_ONLINE, /**< Travel Adapter(Charger) */
+ JACK_PROP_EARJACK_ONLINE, /**< Earjack */
+ JACK_PROP_EARKEY_PRESS, /**< */
+ JACK_PROP_HDMI_ONLINE, /**< Digital tvout */
+ JACK_PROP_USB_ONLINE, /**< USB connection */
+ JACK_PROP_CRADLE_ONLINE, /**< Cradle connection */
+ JACK_PROP_TVOUT_ONLINE, /**< analog tvout */
+ JACK_PROP_MIC_ONLINE = -1,
+ JACK_PROP_USB_PATH = -1,
+ };
+
+/**
+ * @par Description:
+ * DEVTYPE_TOUCHKEY property for generic APIs
+ */
+ enum {
+ TCKEY_PROP_FIRST,
+ TCKEY_PROP_SECOND,
+ TCKEY_PROP_THIRD,
+ };
+
+/**
+ * @par Description:
+ * DEVTYPE_UART property for generic APIs
+ */
+ enum {
+ UART_PROP_SELECT_PATH,
+ };
+
+/**
+ * @par Description:
+ * DEVTYPE_MMC property for generic APIs
+ */
+ enum {
+ MMC_PROP_FORMAT,
+ };
+
+/**
+ * @par Description:
+ * Motor property for generic APIs
+ */
+ enum {
+ HAPTIC_PROP_LEVEL_MAX,
+ HAPTIC_PROP_LEVEL,
+ HAPTIC_PROP_ENABLE,
+ HAPTIC_PROP_ONESHOT,
+ };
+
+/* Application level interfaces */
+
+/**
+ * @par Description:
+ * This API is used to get the remaining battery percentage.\n
+ * It gets the Battery percentage by calling device_get_property() function.\n
+ * It returns integer value(0~100) that indicate remaining batterty percentage on success.\n
+ * Or a negative value(-1) is returned on failure.
+ * @return On success, integer value(0~100) is returned.
+ * Or a negative value(-1) is returned on failure.
+ * @see device_is_battery_full(), device_get_battery_pct_raw()
+ * @par Example
+ * @code
+ * ...
+ * int battery;
+ * battery = device_get_battery_pct();
+ * if( battery < 0 )
+ * printf("Fail to get the remaining battery percentage.\n");
+ * else
+ * printf("remaining battery percentage : %d\n", battery);
+ * ...
+ * @endcode
+ */
+ int device_get_battery_pct(void);
+
+/**
+ * @par Description:
+ * This API is used to get the remaining battery percentage expressed 1/10000.\n
+ * It gets the Battery percentage by calling device_get_property() function.\n
+ * It returns integer value(0~10000) that indicate remaining batterty percentage on success.\n
+ * Or a negative value(-1) is returned on failure.
+ * @return On success, integer value(0~10000) is returned.
+ * Or a negative value(-1) is returned on failure.
+ * @see device_is_battery_full(), device_get_battery_pct()
+ * @par Example
+ * @code
+ * ...
+ * int battery;
+ * battery = device_get_battery_pct_raw();
+ * if( battery < 0 )
+ * printf("Fail to get the remaining battery percentage.\n");
+ * else
+ * printf("remaining battery percentage expressed 1/10000 : %d\n", battery);
+ * ...
+ * @endcode
+ */
+ int device_get_battery_pct_raw(void);
+
+/**
+ * @par Description:
+ * This API is used to get the fully charged status of battery.\n
+ * It gets the fully charged status of Battery by calling device_get_property() function.\n
+ * If the status of battery is full, it returns 1.\n
+ * Or a negative value(-1) is returned, if the status of battery is not full.
+ * @return 1 with battery full, or 0 on not full-charged, -1 if failed
+ * @see device_get_battery_pct()
+ * @par Example
+ * @code
+ * ...
+ * if ( device_is_battery_full() > 0 )
+ * printf("battery fully chared\n");
+ * ...
+ * @endcode
+ */
+ int device_is_battery_full(void);
+
+/**
+ * @par Description:
+ * Battery health status
+ */
+ enum {
+ BAT_UNKNOWN = 0, /**< */
+ BAT_GOOD, /**< */
+ BAT_OVERHEAT, /**< */
+ BAT_DEAD, /**< */
+ BAT_OVERVOLTAGE, /**< */
+ BAT_UNSPECIFIED, /**< */
+ BAT_COLD, /**< */
+ BAT_HEALTH_MAX, /**< */
+ };
+
+/**
+ * @par Description:
+ * This API is used to get the battery health status.\n
+ * It gets the battery health status by calling device_get_property() function.\n
+ * It returns integer value(0~6) that indicate battery health status on success.\n
+ * Or a negative value(-1) is returned, if the status of battery is not full.
+ * @return interger value, -1 if failed\n
+ * (0 BATTERY_UNKNOWN, 1 GOOD, 2 OVERHEAT, 3 DEAD, 4 OVERVOLTAGE, 5 UNSPECIFIED, 6 COLD)
+ * @par Example
+ * @code
+ * ...
+ * int bat_health;
+ * bat_health =device_get_battery_health();
+ * if(bat_health != BAT_GOOD)
+ * printf("battery health is not good\n");
+ * ...
+ * @endcode
+ */
+ int device_get_battery_health(void);
+
+/**
+ * @par Description:
+ * Display number
+ */
+ typedef enum {
+ DEV_DISPLAY_0, /**< */
+ DEV_DISPLAY_1, /**< */
+ DEV_MAIN_DISPLAY = DEV_DISPLAY_0, /**< */
+ } display_num_t;
+
+/**
+ * @par Description:
+ * This API is used to get the current brightness of the display.\n
+ * It gets the current brightness of the display by calling device_get_property() function.\n
+ * It returns integer value which is the current brightness on success.\n
+ * Or a negative value(-1) is returned on failure.
+ * @param[in] num display number that you want to get the brightness value
+ * @return current brightness value on success, -1 if failed
+ * @see device_set_diplay_brt()
+ * @par Example
+ * @code
+ * ...
+ * int cur_brt;
+ * cur_brt = device_get_display_brt(0);
+ * if( cur_brt < 0 )
+ * printf("Fail to get the current brightness of the display.\n");
+ * else
+ * printf("Current brightness of the display is %d\n", cur_brt);
+ * ...
+ * @endcode
+ */
+ int device_get_display_brt(display_num_t num);
+
+/**
+ * @par Description:
+ * This API is used to set the current brightness of the display and system brightness value in settings.\n
+ * It sets the current brightness of the display by calling device_set_property() function.\n
+ * MUST use this API very carefully. \n
+ * This api is different from device_set_display_brt api.\n
+ * device_set_display_brt api will change only device brightness value.\n
+ * but this api will change device brightness as well as system brightness value.\n
+ * @param[in] num display number that you want to set the brightness value
+ * @param[in] val brightness value that you want to set
+ * @return 0 on success, -1 if failed
+ * @see device_set_display_brt()
+ * @par Example
+ * @code
+ * ...
+ * if( device_set_display_brt_with_settings(0,6) < 0 )
+ * printf("Fail to set the current brightness of the display0\n");
+ * else
+ * printf("The current brightness of the display0 is set 6\n");
+ * ...
+ * @endcode
+ */
+ int device_set_display_brt_with_settings(display_num_t lcdnum, int val);
+
+/**
+ * @par Description:
+ * This API is used to set the current brightness of the display.\n
+ * It sets the current brightness of the display by calling device_set_property() function.\n
+ * MUST use this API very carefully. \n
+ * you MUST set original brightness by device_release_brt_ctrl(),
+ * after you finish your job using this API.
+ * @param[in] num display number that you want to set the brightness value
+ * @param[in] val brightness value that you want to set
+ * @return 0 on success, -1 if failed
+ * @see device_get_diplay_brt(), device_release_brt_ctrl()
+ * @par Example
+ * @code
+ * ...
+ * if( device_set_display_brt(0,6) < 0 )
+ * printf("Fail to set the current brightness of the display0\n");
+ * else
+ * printf("The current brightness of the display0 is set 6\n");
+ * ...
+ * @endcode
+ */
+ int device_set_display_brt(display_num_t num, int val);
+
+/**
+ * @par Description:
+ * This API is used to release brightness control.\n
+ * It sets the current brightness of the display by calling device_set_property() function.\n
+ * MUST call this API after you finished the job which need to change the brightness.
+ * @param[in] num display number
+ * @return 0 on success, -1 if failed
+ * @see device_set_display_brt()
+ * @par Example
+ * @code
+ * ...
+ * org_val = device_get_display_brt(0);
+ * device_set_display_brt(0,1);
+ * ...
+ * ret = device_release_brt_ctrl(0);
+ * if( ret < 0 )
+ * printf("Fail to release brightness control\n");
+ * ...
+ * @endcode
+ */
+ int device_release_brt_ctrl(display_num_t num);
+
+/**
+ * @par Description:
+ * This API is used to get the min brightness of the display.\n
+ * It gets the current brightness of the display by calling device_get_property() function.\n
+ * It returns integer value which is the min brightness on success.\n
+ * Or a negative value(-1) is returned on failure
+ * @param[in] num display number
+ * @return min brightness value on success, -1 if failed
+ * @par Example
+ * @code
+ * ...
+ * int min_brt;
+ * min_brt = device_get_min_brt(0);
+ * if( min_brt < 0 )
+ * printf("Fail to get the min brightness of the display.\n");
+ * else
+ * printf("Min brightness of the display is %d\n", min_brt);
+ * ...
+ * @endcode
+ */
+ int device_get_min_brt(display_num_t num);
+
+/**
+ * @par Description:
+ * This API is used to get the max brightness of the display.\n
+ * It gets the current brightness of the display by calling device_get_property() function.\n
+ * It returns integer value which is the max brightness on success.\n
+ * Or a negative value(-1) is returned on failure
+ * @param[in] num display number
+ * @return max brightness value on success, -1 if failed
+ * @par Example
+ * @code
+ * ...
+ * int max_brt;
+ * max_brt = device_get_max_brt(0);
+ * if( max_brt < 0 )
+ * printf("Fail to get the max brightness of the display.\n");
+ * else
+ * printf("Max brightness of the display is %d\n", max_brt);
+ * ...
+ * @endcode
+ */
+ int device_get_max_brt(display_num_t num);
+
+/**
+ * @par Description:
+ * LCD gamma values
+ */
+ typedef enum {
+ LCD_GAMMA_22 = 1, /**< 8500K , 2.2 GAMMA*/
+ LCD_GAMMA_19 = 2, /**< 8500K , 1.9 GAMMA*/
+ LCD_GAMMA_17 = 3, /**< 8500K , 1.7 GAMMA*/
+ LCD_GAMMA_NORMAL = LCD_GAMMA_22, /**< Normal screen */
+ LCD_GAMMA_PLAY_RECORD = LCD_GAMMA_19, /**< Playing or recording cam */
+ LCD_GAMMA_PREVIEW = LCD_GAMMA_17, /**< Preview */
+ LCD_GAMMA_MOVIE = LCD_GAMMA_19, /**< Movie */
+ LCD_GAMMA_CAMERA = 11, /**< Camera */
+ } display_gamma_t;
+
+/**
+ * @par Description:
+ * This API is used to get the current gamma of the display.\n
+ * It gets the current gamma of the display by calling device_get_property() function.\n
+ * It returns enum value which is the current gamma on success.\n
+ * Or a negative value(-1) is returned on failure.
+ * @param[in] num display number that you want to get the gamma value
+ * @return current gamma enum value on success, -1 if failed
+ * @see device_set_diplay_gamma()
+ * @par Example
+ * @code
+ * ...
+ * int cur_brt;
+ * cur_brt = device_get_display_gamma(0);
+ * if( cur_brt < 0 )
+ * printf("Fail to get the current gamma of the display.\n");
+ * else
+ * printf("Current gamma of the display is %d\n", cer_brt);
+ * ...
+ * @endcode
+ */
+ int device_get_display_gamma(display_num_t num);
+
+/**
+ * @par Description:
+ * This API is used to set the specific gamma value of the display .\n
+ * It sets the specific gamma value of the display by calling device_set_property() function.\n
+ * MUST use this API very carefully. \n
+ * you MUST set original gamma by device_release_gamma_ctrl(),
+ * after you finish your job using this API.
+ * @param[in] num display number that you want to set the gamma value
+ * @param[in] new_val lcd gamma enum value that you want to set
+ * @return 0 on success, -1 if failed
+ * @see device_get_diplay_gammat(), device_release_gamma_ctrl()
+ * @par Example
+ * @code
+ * ...
+ * if( device_set_display_gamma(0,1) < 0 )
+ * printf("Fail to set the specific gamma of the display0\n");
+ * else
+ * printf("The gamma of the display0 is set 1(LCD_GAMMA_22)\n");
+ * ...
+ * @endcode
+ */
+ int device_set_display_gamma(display_num_t num,
+ display_gamma_t new_val);
+
+/**
+ * @par Description:
+ * This API is used to release gamma control.\n
+ * It sets the gamma of the display by calling device_set_property() function.\n
+ * MUST call this API after you finished the job which need to change the gamma.
+ * @param[in] num display number
+ * @param[in] org_val original gamma enums value before you control the gamma
+ * @return 0 on success, -1 if failed
+ * @see device_set_display_gamma()
+ * @par Example
+ * @code
+ * ...
+ * org_val = device_get_display_gamma(0);
+ * device_set_display_gamma(0,2);
+ * ...
+ * ret = device_release_gamma_ctrl(0, org_val);
+ * if( ret < 0 )
+ * printf("Fail to release gamma control\n");
+ * ...
+ * @endcode
+ */
+ int device_release_gamma_ctrl(display_num_t num,
+ display_gamma_t org_val);
+
+/**
+ * @par Description:
+ * This API is used to get number of displays on the phone.\n
+ * It gets the current number of displays by calling device_get_display_count() function.\n
+ * It returns enum value which is the current number on success.\n
+ * Or a negative value(-1) is returned on failure.
+ * @return 0 on success, -1 if failed
+ * @par Example
+ * @code
+ * ...
+ * ret = device_get_display_count();
+ * if( ret < 0 )
+ * printf("Fail to get number of displays\n");
+ * ...
+ * @endcode
+ */
+ int device_get_display_count(void);
+
+/**
+ * @par Description:
+ * mode - dynamic, standard, natural, movie
+ */
+ enum image_enhance_mode {
+ MODE_DYNAMIC = 0,
+ MODE_STANDARD,
+ MODE_NATURAL,
+ MODE_MOVIE,
+ };
+
+/**
+ * @par Description:
+ * This API is used to get image enhance mode.\n
+ * It returns enum value which is the current mode on success.\n
+ * Or a negative value(-1) is returned on failure.
+ * @return enum value for current mode on success, -1 if failed
+ * @par Example
+ * @code
+ * ...
+ * ret = device_get_image_enhance_mode();
+ * if( ret < 0 )
+ * printf("Fail to get current image enhance mode\n");
+ * ...
+ * @endcode
+ */
+ int device_get_image_enhance_mode(void);
+
+/**
+ * @par Description:
+ * This API is used to set image enhance mode.\n
+ * @param[in] val mode enum vlaue
+ * @return 0 on success, -1 if failed
+ * @par Example
+ * @code
+ * ...
+ * if( device_set_image_enhance_mode(MODE_DYNAMIC) < 0 )
+ * printf("Fail to set the image enhance mode\n");
+ * ...
+ * @endcode
+ */
+ int device_set_image_enhance_mode(int val);
+
+/**
+ * @par Description:
+ * scenario - ui, gallery, video, vtcall, camera, browser, negative, bypass
+ */
+ enum image_enhance_scenario {
+ SCENARIO_UI = 0,
+ SCENARIO_GALLERY,
+ SCENARIO_VIDEO,
+ SCENARIO_VTCALL,
+ SCENARIO_CAMERA,
+ SCENARIO_BROWSER,
+ SCENARIO_NEGATIVE,
+ SCENARIO_BYPASS,
+ };
+
+/**
+ * @par Description:
+ * This API is used to get image enhance scenario.\n
+ * It returns enum value which is the current scenario on success.\n
+ * Or a negative value(-1) is returned on failure.
+ * @return enum value for current wcenario on success, -1 if failed
+ * @par Example
+ * @code
+ * ...
+ * ret = device_get_image_enhance_scenario();
+ * if( ret < 0 )
+ * printf("Fail to get current image enhance scenarioe\n");
+ * ...
+ * @endcode
+ */
+ int device_get_image_enhance_scenario(void);
+
+/**
+ * @par Description:
+ * This API is used to set image enhance scenario.\n
+ * @param[in] val scenario enum vlaue
+ * @return 0 on success, -1 if failed
+ * @par Example
+ * @code
+ * ...
+ * if( device_set_image_enhance_scenario(SCENARIO_UI) < 0 )
+ * printf("Fail to set the image enhance scenario\n");
+ * ...
+ * @endcode
+ */
+ int device_set_image_enhance_scenario(int val);
+
+/**
+ * @par Description:
+ * tone - normal, warm, cold
+ */
+ enum image_enhance_tone {
+ TONE_NORMAL = 0,
+ TONE_WARM,
+ TONE_COLD,
+ };
+
+/**
+ * @par Description:
+ * This API is used to get image enhance tone.\n
+ * It returns enum value which is the current mode on success.\n
+ * Or a negative value(-1) is returned on failure.
+ * @return enum value for current tone on success, -1 if failed
+ * @par Example
+ * @code
+ * ...
+ * ret = device_get_image_enhance_tone();
+ * if( ret < 0 )
+ * printf("Fail to get current image enhance tone\n");
+ * ...
+ * @endcode
+ */
+ int device_get_image_enhance_tone(void);
+
+/**
+ * @par Description:
+ * This API is used to set image enhance tone.\n
+ * @param[in] val tone vlaue
+ * @return 0 on success, -1 if failed
+ * @par Example
+ * @code
+ * ...
+ * if( device_set_image_enhance_tone(TONE_NORMAL) < 0 )
+ * printf("Fail to set the image enhance tone\n");
+ * ...
+ * @endcode
+ */
+ int device_set_image_enhance_tone(int val);
+
+/**
+ * @par Description:
+ * outdoor - off, on
+ */
+ enum image_enhance_outdoor {
+ OUTDOOR_OFF = 0,
+ OUTDOOR_ON,
+ };
+
+/**
+ * @par Description:
+ * This API is used to get image enhance outdoor.\n
+ * It returns enum value which is the current outdoor on success.\n
+ * Or a negative value(-1) is returned on failure.
+ * @return enum value for current outdoor on success, -1 if failed
+ * @par Example
+ * @code
+ * ...
+ * ret = device_get_image_enhance_ourdoor();
+ * if( ret < 0 )
+ * printf("Fail to get current image enhance outdoor\n");
+ * ...
+ * @endcode
+ */
+ int device_get_image_enhance_outdoor(void);
+
+/**
+ * @par Description:
+ * This API is used to set image enhance outdoor.\n
+ * @param[in] val outdoor vlaue
+ * @return 0 on success, -1 if failed
+ * @par Example
+ * @code
+ * ...
+ * if( device_set_image_enhance_outdoor(TONE_NORMAL) < 0 )
+ * printf("Fail to set the image enhance outdoor\n");
+ * ...
+ * @endcode
+ */
+ int device_set_image_enhance_outdoor(int val);
+
+/**
+ * @par Description:
+ * This API is used to get information about image enhance function.\n
+ * It returns 1, this device can use enhance mode.\n
+ * Or a negative value(-1) is returned, it doesn't support enhance mode.
+ * @return 1 is returned on support for enhance mode, -1 if not.
+ * @par Example
+ * @code
+ * ...
+ * ret = device_get_image_enhance_info();
+ * if( ret < 0 )
+ * printf("Not support image enhance mode on this device\n");
+ * ...
+ * @endcode
+ */
+ int device_get_image_enhance_info(void);
+
+/**
+ * @par Description:
+ * This API is used to get the current brightness of the led.\n
+ * It gets the current brightness of the led by calling device_get_property() function.\n
+ * It returns integer value which is the current brightness on success.\n
+ * Or a negative value(-1) is returned on failure.
+ * @return current brightness value on success, -1 if failed
+ * @see device_set_led_brt()
+ * @par Example
+ * @code
+ * ...
+ * int cur_brt;
+ * cur_brt = device_get_led_brt();
+ * if( cur_brt < 0 )
+ * printf("Fail to get the current brightness of the led.\n");
+ * else
+ * printf("Current brightness of the led is %d\n", cur_brt);
+ * ...
+ * @endcode
+ */
+ int device_get_led_brt(void);
+
+/**
+ * @par Description:
+ * This API is used to set the current brightness of the led.\n
+ * It sets the current brightness of the led by calling device_set_property() function.\n
+ * @param[in] val brightness value that you want to set
+ * @return 0 on success, -1 if failed
+ * @see device_get_led_brt()
+ * @par Example
+ * @code
+ * ...
+ * if( device_set_led_brt(1) < 0 )
+ * printf("Fail to set the brightness of the led\n");
+ * @endcode
+ */
+ int device_set_led_brt(int val);
+
+/**
+ * @par Description:
+ * This API is used to set the current brightness of the led without noti.\n
+ * It sets the current brightness of the led by calling device_set_property() function.\n
+ * @param[in] val brightness value that you want to set
+ * @return 0 on success, -1 if failed
+ * @see device_get_led_brt()
+ * @par Example
+ * @code
+ * ...
+ * if( device_set_led_brt_without_noti(1) < 0 )
+ * printf("Fail to set the brightness of the led\n");
+ * @endcode
+ */
+ int device_set_led_brt_without_noti(int val);
+
+/**
+ * @par Description:
+ * This API is used to get the max brightness of the led.\n
+ * It gets the current brightness of the led by calling device_get_property() function.\n
+ * It returns integer value which is the max brightness on success.\n
+ * Or a negative value(-1) is returned on failure
+ * @return max brightness value on success, -1 if failed
+ * @par Example
+ * @code
+ * ...
+ * int max_brt;
+ * max_brt = device_get_max_led(0);
+ * if( max_brt < 0 )
+ * printf("Fail to get the max brightness of the led.\n");
+ * ...
+ * @endcode
+ */
+ int device_get_max_led(void);
+
+/**
+ * @par Description:
+ * This API is used to get the current state for acl.\n
+ * It gets the current state for acl by calling device_get_property() function.\n
+ * @param[in] num display number that you want to set the gamma value
+ * @return current status for acl(1 on, 0 off) on success, -1 if failed
+ * @see device_set_acl_control_status()
+ * @par Example
+ * @code
+ * ...
+ * int acl_stat;
+ * acl_stat = device_get_acl_control_status(0);
+ * if( acl_stat < 0 )
+ * printf("Fail to get the current status for acl.\n");
+ * else
+ * printf("Current status for acl is %d\n", cur_brt);
+ * ...
+ * @endcode
+ */
+ int device_get_acl_control_status(display_num_t num);
+
+/**
+ * @par Description:
+ * This API is used to set the current status for acl.\n
+ * It sets the current status for acl by calling device_set_property() function.\n
+ * @param[in] num display number that you want to set the brightness value
+ * @param[in] val status for acl(1 on, 0 off) that you want to set
+ * @return 0 on success, -1 if failed
+ * @see device_get_acl_control_status()
+ * @par Example
+ * @code
+ * ...
+ * if( device_set_acl_control_status(0, 1) < 0 )
+ * printf("Fail to set the current status for acl\n");
+ * else
+ * printf("The current status for acl is set 6\n");
+ * ...
+ * @endcode
+ */
+ int device_set_acl_control_status(display_num_t num, int val);
+
+/**
+ * @} // end of internal APIs
+ */
+
+#ifdef __cplusplus
+}
+#endif
+#endif
--- /dev/null
+/*
+ * devman
+ * 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.
+ */
+
+
+#ifndef __DEVMAN_HAPTIC_H__
+#define __DEVMAN_HAPTIC_H__
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * @file devman_haptic.h
+ * @ingroup DEVICE_MANAGER
+ * @brief This file contains the prototypes of the haptic API
+ * @author SLP2.0
+ * @date 2010-01-24
+ * @version 0.1
+ */
+
+/**
+ * @addtogroup DEVICE_MANAGER
+ * @{
+ */
+
+
+/**
+ * @par Description:
+ * The pattern list for haptic.\n
+ * Note: The patterns will be removed except the patterns which are used for BEAT UX after 9. Dec. 2011.
+ */
+ enum effectvibe_pattern_list {
+ EFFCTVIBE_TOUCH = 0, /**< for BeatUX */
+ EFFCTVIBE_HW_TOUCH, /**< for BeatUX */
+ EFFCTVIBE_NOTIFICATION, /**< for BeatUX */
+ EFFCTVIBE_INCOMING_CALL01, /**< for BeatUX */
+ EFFCTVIBE_INCOMING_CALL02, /**< for BeatUX */
+ EFFCTVIBE_INCOMING_CALL03, /**< for BeatUX */
+ EFFCTVIBE_ALERTS_CALL, /**< for BeatUX */
+ EFFCTVIBE_OPERATION, /**< for BeatUX */
+ EFFCTVIBE_SILENT_MODE, /**< for BeatUX */
+
+ EFFCTVIBE_PATTERN_END
+ };
+
+/**
+ * @par Description:
+ * priority level for haptic.
+ */
+ enum haptic_priority_level {
+ HAPTIC_PRIORITY_LEVEL_MIN = 0, /**< Minimum effect priority for developers */
+ HAPTIC_PRIORITY_LEVEL_MAX_DEV, /**< Maximum effect priority for developers */
+ HAPTIC_PRIORITY_LEVEL_MAX_OEM, /**< Maximum effect priority for OEMs */
+ };
+
+/**
+ * @par Description:
+ * feedback level for haptic.
+ */
+ enum haptic_feedback_level {
+ HAPTIC_FEEDBACK_LEVEL_AUTO = -1, /**< auto feedback level */
+ HAPTIC_FEEDBACK_LEVEL_0, /**< feedback level 0 */
+ HAPTIC_FEEDBACK_LEVEL_1, /**< feedback level 1 */
+ HAPTIC_FEEDBACK_LEVEL_2, /**< feedback level 2 */
+ HAPTIC_FEEDBACK_LEVEL_3, /**< feedback level 3 */
+ HAPTIC_FEEDBACK_LEVEL_4, /**< feedback level 4 */
+ HAPTIC_FEEDBACK_LEVEL_5, /**< feedback level 5 */
+
+ HAPTIC_FEEDBACK_LEVEL_END,
+ };
+
+/**
+ * @par Description:
+ * infinite iteration count
+ */
+#define HAPTIC_INFINITE_ITERATION 256
+
+/**
+ * @par Description:
+ * Return Values
+ */
+#define HAPTIC_SUCCESS 0
+#define HAPTIC_ALREADY_INITIALIZED -1
+#define HAPTIC_NOT_OPENED -2
+#define HAPTIC_INVALID_ARGUMENT -3
+#define HAPTIC_FAIL -4
+#define HAPTIC_NOT_SUPPORTED -13
+#define HAPTIC_ALREADY_EXIST -14
+
+/**
+ * @par Description:
+ * Motor device index. We support two motors now.
+ */
+ typedef enum haptic_dev_idx_t {
+ DEV_IDX_0 = 0x01, /**< 1st motor */
+ DEV_IDX_1 = 0x02, /**< 2nd motor */
+ DEV_IDX_ALL = 0x04, /**< both of them */
+ } haptic_dev_idx;
+
+/**
+ * @fn int device_haptic_open(haptic_dev_idx dev_idx, unsigned int mode)
+ * @par Description:
+ * This API opens a Haptic-vibration device. \n
+ * On success it returns a dev_handle value. In case of failure it returns a negative value. \n
+ * If the device is already open it returns (-1).\n
+ * The first in parameter dev_idx should be from a predefined haptic-device-index which is available in the typedef enum haptic_dev_idx.\n
+ * The DEV_IDX_0 means first haptic-device-index of target , the DEV_IDX_1 means second haptic-device-index of target \n
+ * and the DEV_IDX_ALL means both of them. \n
+ * The availability of the dev_idx value is dependent on the real target. Normally, set a DEV_IDX_0 value to the first haptic-device.\n
+ * The second in parameter mode is reserved for future so just set a 0 value\n
+ * Note: The device_haptic_open() must be called before all other haptic APIs are called. \n
+ * The device_haptic_open() should have a matching call to device_haptic_close().\n
+ * Applications call the device_haptic_open() only once if possible during application startup and call the device_haptic_close() during application shutdown.
+ * @param[in] dev_idx set a device index (predefined enum value by haptic_dev_idx)
+ * @param[in] mode just set a "0" value (not support current , reserved for future)
+ * @return if it succeed, it return dev_handle value , otherwise negative value return
+ * @see device_haptic_close()
+ * @par Example:
+ * @code
+ * ...
+ * int ret_val=0;
+ * int dev_handle;
+ *
+ * //Open the haptic device
+ * dev_handle = device_haptic_open(DEV_IDX_0,0);
+ * if(dev_handle < 0)
+ * return -1;
+ * ...
+ * @endcode
+ */
+
+ int device_haptic_open(haptic_dev_idx dev_idx, unsigned int mode) __attribute__ ((deprecated));
+
+/**
+ * @fn int device_haptic_close(int dev_handle)
+ * @par Description:
+ * This API closes a Haptic-vibration device. \n
+ * On success it returns a zero value. In case of failure it returns a negative value. \n
+ * If the device is already closed it returns (-1). \n
+ * The first in parameter dev_handle should be from the return value of device_haptic_open().
+ * hatic device close
+ * @param[in] dev_handle set recived dev_handle value from device_haptic_open()
+ * @return if it succeed, it return zero value , otherwise negative value return
+ * @see device_haptic_open()
+ * @par Example:
+ * @code
+ * ...
+ * //Close the device
+ * ret_val = device_haptic_close(dev_handle);
+ * if(ret_val != 0)
+ * return -1
+ * ...
+ * @endcode
+ */
+
+ int device_haptic_close(int dev_handle) __attribute__ ((deprecated));
+
+/**
+ * @fn int device_haptic_play_pattern(int dev_handle, int pattern , int iteration , int feedback_level )
+ * @par Description:
+ * This API plays a predefined rhythmic haptic-vibration pattern. \n
+ * The first in parameter dev_handle should be from the return value of device_haptic_open().\n
+ * The second in parameter pattern should be from a predefined pattern list which is available in an enumeration (effectvibe_pattern_list).
+ * These patterns are rhythmic vibration patterns. \n
+ * The third in parameter iteration sets the number of iterations to be played.
+ * This should be less than the maximum iteration range set for the device (currently its 255). \n
+ * The fourth in parameter is the vibration feedback intensity level.
+ * This level is already predefined by enumeration type value from HAPTIC_FEEDBACK_LEVEL_1 to HAPTIC_FEEDBACK_LEVEL_5.
+ * If you want to use the value selected by the user in the Setting application menu, just set -1 value.\n
+ * On success it returns a zero value. In case of failure it returns a negative value. \n
+ * Note: The actual behavior of the feedback play pattern and the intensity depends on the target hardware.
+ * @param[in] dev_handle set recived dev_handle value from device_haptic_open()
+ * @param[in] pattern set predefined pattern enum value from effectvibe_pattern_list
+ * @param[in] iteration set iteration count
+ * @param[in] feedback_level set feed_back level value ( it is dependent on target's hardware )
+ * @return if it succeed, it return zero value , otherwise negative value return
+ * @see device_haptic_play_file(), device_haptic_play_monoton(), device_haptic_stop_play()
+ * @par Example
+ * @code
+ * ...
+ * //Play a rhythmic pattern
+ * ret_val = device_haptic_play_pattern(dev_handle, EFFCTVIBE_POPUP, HAPTIC_TEST_ITERATION , HAPTIC_FEEDBACK_LEVEL_3);
+ * if(ret_val !=0)
+ * return -1;
+ * ...
+ * @endcode
+ */
+
+ int device_haptic_play_pattern(int dev_handle, int pattern,
+ int iteration, int feedback_level) __attribute__ ((deprecated));
+
+/**
+ * @fn int device_haptic_play_file(int dev_handle, const char *file_name , int iteration , int feedback_level )
+ * @par Description:
+ * This API plays a predefined rhythmic haptic-vibration pattern file (only supports .ivt type file, Immersion VibeTonz).\n
+ * The first in parameter dev_handle should be from the return value of device_haptic_open().\n
+ * The second in parameter file_name sets rhythmic vibration pattern file with path.
+ * It only supports *.ivt type pattern file. \n
+ * The third in parameter iteration sets the number of iterations to be played.
+ * This should be less than the maximum iteration range set for the device (currently its 255).
+ * If you want to play indefinitely, use HAPTIC_INFINITE_ITERATION defined value. But it depends on the target hardware.\n
+ * The fourth in parameter is the vibration feedback intensity level.
+ * This level is already predefined by enumeration type value from HAPTIC _FEEDBACK_LEVEL_1 to HAPTIC _FEEDBACK_LEVEL_5.
+ * If you want to use the value selected by the user in the Setting application menu, just set HAPTIC_FEEDBACK_LEVEL_AUTO value.
+ * (But the application must have a main loop to use the HAPTIC_FEEDBACK_LEVEL_AUTO value ) \n
+ * On success it returns a zero value. In case of failure it returns a negative value. \n
+ * Note: The actual behavior of the feedback play pattern and the intensity depends on the target hardware.
+ * @param[in] dev_handle set recived dev_handle value from device_haptic_open()
+ * @param[in] file_name set file name with path
+ * @param[in] iteration set iteration count
+ * @param[in] feedback_level set feed_back level value ( it is dependent on target's hardware )
+ * @return if it succeed, it return zero value , otherwise negative value return
+ * @see device_haptic_play_pattern(), device_haptic_play_monotone(), device_haptic_stop_play()
+ * @par Example
+ * @code
+ * ...
+ * ret_val = device_haptic_play_file(dev_handle, "test.ivt", HAPTIC_TEST_ITERATION , HAPTIC_FEEDBACK_LEVEL_3);
+ * if(ret_val !=0)
+ * return -1;
+ * ...
+ * @endcode
+ */
+
+ int device_haptic_play_file(int dev_handle, const char *file_name,
+ int iteration, int feedback_level) __attribute__ ((deprecated));
+
+/**
+ * @fn int device_haptic_play_file_with_priority(int device_handle, const char *file_name, int priority_level, int iteration, int feedback_level)
+ * @par Description:
+ * This API plays a predefined rhythmic haptic-vibration pattern file with priority(only supports .ivt type file, Immersion VibeTonz).\n
+ * The first in parameter dev_handle should be from the return value of device_haptic_open().\n
+ * The second in parameter file_name sets rhythmic vibration pattern file with path.
+ * It only supports *.ivt type pattern file. \n
+ * The third in parameter prioritizes between the different effect. \n
+ * This level is already predefined by enumeration type value from hantpic_priority_level.
+ * This value must be between HAPTIC_PRIORITY_LEVEL_MIN and HAPTIC_PRIORITY_LEVEL_MAX_OEM.
+ * The fourth in parameter iteration sets the number of iterations to be played.
+ * This should be less than the maximum iteration range set for the device (currently its 255).
+ * If you want to play indefinitely, use HAPTIC_INFINITE_ITERATION defined value. But it depends on the target hardware.\n
+ * The fifth in parameter is the vibration feedback intensity level.
+ * This level is already predefined by enumeration type value from HAPTIC _FEEDBACK_LEVEL_1 to HAPTIC _FEEDBACK_LEVEL_5.
+ * If you want to use the value selected by the user in the Setting application menu, just set HAPTIC_FEEDBACK_LEVEL_AUTO value.
+ * (But the application must have a main loop to use the HAPTIC_FEEDBACK_LEVEL_AUTO value ) \n
+ * On success it returns a zero value. In case of failure it returns a negative value. \n
+ * Note: The actual behavior of the feedback play pattern and the intensity depends on the target hardware.
+ * @param[in] dev_handle set received dev_handle value from device_haptic_open()
+ * @param[in] file_name set file name with path
+ * @param[in] priority_level set priority value
+ * @param[in] iteration set iteration count
+ * @param[in] feedback_level set feed_back level value ( it is dependent on target's hardware )
+ * @return if it succeed, it return zero value , otherwise negative value return
+ * @see device_haptic_play_file(), device_haptic_play_monotone(), device_haptic_stop_play()
+ * @par Example
+ * @code
+ * ...
+ * ret_val = device_haptic_play_file_with_priority(dev_handle, "test.ivt", HAPTIC_PRIORITY_LEVEL_MAX_DEV, HAPTIC_TEST_ITERATION , HAPTIC_FEEDBACK_LEVEL_3);
+ * if(ret_val !=0)
+ * return -1;
+ * ...
+ * @endcode
+ */
+
+ int device_haptic_play_file_with_priority(int device_handle, const char *file_name,
+ int priority, int iteration, int feedback_level) __attribute__ ((deprecated));
+
+/**
+ * @fn int device_haptic_play_buffer(int dev_handle, const unsigned char *vibe_buffer, int iteration , int feedback_level )
+ * @par Description:
+ * This API plays a predefined rhythmic haptic-vibration pattern file (only supports .ivt type file, Immersion VibeTonz).\n
+ * The first in parameter dev_handle should be from the return value of device_haptic_open().\n
+ * The second in parameter vibe_buffer sets rhythmic vibration pattern buffer.
+ * The third in parameter iteration sets the number of iterations to be played.
+ * This should be less than the maximum iteration range set for the device (currently its 255).
+ * If you want to play indefinitely, use HAPTIC_INFINITE_ITERATION defined value. But it depends on the target hardware.\n
+ * The fourth in parameter is the vibration feedback intensity level.
+ * This level is already predefined by enumeration type value from HAPTIC _FEEDBACK_LEVEL_1 to HAPTIC _FEEDBACK_LEVEL_5.
+ * If you want to use the value selected by the user in the Setting application menu, just set HAPTIC_FEEDBACK_LEVEL_AUTO value.
+ * (But the application must have a main loop to use the HAPTIC_FEEDBACK_LEVEL_AUTO value ) \n
+ * On success it returns a zero value. In case of failure it returns a negative value. \n
+ * Note: The actual behavior of the feedback play pattern and the intensity depends on the target hardware.
+ * @param[in] dev_handle set recived dev_handle value from device_haptic_open()
+ * @param[in] buffer set buffer to be played
+ * @param[in] iteration set iteration count
+ * @param[in] feedback_level set feed_back level value ( it is dependent on target's hardware )
+ * @return if it succeed, it return zero value , otherwise negative value return
+ * @see device_haptic_play_pattern(), device_haptic_play_monotone(), device_haptic_stop_play()
+ * @par Example
+ * @code
+ * ...
+ * ret_val = device_haptic_play_buffer(dev_handle, buffer, HAPTIC_TEST_ITERATION , HAPTIC_FEEDBACK_LEVEL_3);
+ * if(ret_val !=0)
+ * return -1;
+ * ...
+ * @endcode
+ */
+
+ int device_haptic_play_buffer(int dev_handle, const unsigned char *vibe_buffer,
+ int iteration, int feedback_level) __attribute__ ((deprecated));
+
+/**
+ * @fn int device_haptic_play_monotone(int dev_handle, int duration)
+ * @par Description:
+ * This API plays a monotonous haptic-vibration pattern with a constant intensity. \n
+ * In this monotone play, the intensity used is the value that the user has selected in the Setting application menu.\n
+ * The first in parameter dev_handle should be from the return value of device_haptic_open().\n
+ * The second in parameter duration defines the length of time this vibration should be played.
+ * This duration is in milliseconds. \n
+ * On success it returns a zero value. In case of failure it returns a negative value. \n
+ * Note: The actual behavior of the feedback played and the intensity depends on the target hardware.
+ * @param[in] dev_handle set recived dev_handle value from device_haptic_open()
+ * @param[in] duration set duration times (ms)
+ * @return if it succeed, it return zero value, otherwise negative value return
+ * @see device_haptic_play_pattern(), device_haptic_play_file(), device_haptic_stop_play()
+ * @par Example
+ * @code
+ * ...
+ * //Play a monotone pattern for 1s == 1000ms
+ * ret_val = device_haptic_play_monotone(dev_handle, 1000);
+ * if(ret_val !=0)
+ * return -1;
+ * ...
+ * @endcode
+ */
+
+ int device_haptic_play_monotone(int dev_handle, int duration) __attribute__ ((deprecated));
+
+/**
+ * @fn int device_haptic_play_monotone_with_feedback_level(int dev_handle, int duration, int feedback_level)
+ * @par Description:
+ * This API plays a monotonous haptic-vibration pattern with a given feedback intensity. \n
+ * The first in parameter dev_handle should be from the return value of device_haptic_open().\n
+ * The second in parameter duration defines the length of time this vibration should be played.
+ * This duration is in milliseconds. \n
+ * The fourth in parameter is the vibration feedback intensity level.
+ * This level is already predefined by enumeration type value from HAPTIC _FEEDBACK_LEVEL_1 to HAPTIC _FEEDBACK_LEVEL_5.
+ * If you want to use the value selected by the user in the Setting application menu, just set HAPTIC_FEEDBACK_LEVEL_AUTO value.
+ * (But the application must have a main loop to use the HAPTIC_FEEDBACK_LEVEL_AUTO value ) \n
+ * The third in paramater feedback_level defines the strenth of vibration.
+ * On success it returns a zero value. In case of failure it returns a negative value. \n
+ * Note: The actual behavior of the feedback played and the intensity depends on the target hardware.
+ * @param[in] dev_handle set recived dev_handle value from device_haptic_open()
+ * @param[in] duration set duration times (ms)
+ * @param[in] feedback_level set feedback level
+ * @return if it succeed, it return zero value, otherwise negative value return
+ * @see device_haptic_play_pattern(), device_haptic_play_file(), device_haptic_stop_play()
+ * @par Example
+ * @code
+ * ...
+ * //Play a monotone pattern for 1s == 1000ms
+ * ret_val = device_haptic_play_monotone_with_feedback_level(dev_handle, 1000, HAPTIC_FEEDBACK_LEVEL_3);
+ * if(ret_val !=0)
+ * return -1;
+ * ...
+ * @endcode
+ */
+
+ int device_haptic_play_monotone_with_feedback_level(int dev_handle, int duration, int feedback_level) __attribute__ ((deprecated));
+
+/**
+ * @fn int device_haptic_play_monotone_with_detail_feedback_level(int dev_handle, int duration, int detail_feedback_level)
+ * @par Description:
+ * This API plays a monotonous haptic-vibration pattern with a given feedback intensity. \n
+ * The first in parameter dev_handle should be from the return value of device_haptic_open().\n
+ * The second in parameter duration defines the length of time this vibration should be played.
+ * This duration is in milliseconds. \n
+ * The fourth in parameter is the vibration feedback intensity level.
+ * This level is integer type value from 0 to 100.
+ * If you want to use the value selected by the user in the Setting application menu, just set 0 value.
+ * On success it returns a zero value. In case of failure it returns a negative value. \n
+ * Note: The actual behavior of the feedback played and the intensity depends on the target hardware.
+ * @param[in] dev_handle set recived dev_handle value from device_haptic_open()
+ * @param[in] duration set duration times (ms)
+ * @param[in] detail_feedback_level set feedback level (0 - 100)
+ * @return if it succeed, it return zero value, otherwise negative value return
+ * @see device_haptic_play_pattern(), device_haptic_play_file(), device_haptic_stop_play()
+ * @par Example
+ * @code
+ * ...
+ * //Play a monotone pattern for 1s == 1000ms
+ * ret_val = device_haptic_play_monotone_with_detail_feedback_level(dev_handle, 1000, 100);
+ * if(ret_val !=0)
+ * return -1;
+ * ...
+ * @endcode
+ */
+
+ int device_haptic_play_monotone_with_detail_feedback_level(int dev_handle, int duration, int detail_feedback_level) __attribute__ ((deprecated));
+
+/**
+ * @fn int device_haptic_stop_play(int dev_handle)
+ * @par Description:
+ * This API stops the current vibration being played.\n
+ * The first in parameter dev_handle should be from the return value of device_haptic_open().\n
+ * On success it returns a zero value. In case of failure it returns a negative value.
+ * @param[in] dev_handle set recived dev_handle value from device_haptic_open()
+ * @return if it succeed, it return zero value , otherwise negative value return
+ * @see device_haptic_play_pattern(), device_haptic_play_file(), device_haptic_play_monotone()
+ * @par Example
+ * @code
+ * ...
+ * //Stop the pattern immediately
+ * ret_val = device_haptic_stop_play(dev_handle);
+ * if(ret_val !=0)
+ * return -1;
+ * ...
+ * @endcode
+ */
+
+ int device_haptic_stop_play(int dev_handle);
+
+/**
+ * @fn int device_haptic_get_buffer_duration(int dev_handle, const unsigned char* vibe_buffer , int* duration)
+ * @par Description:
+ * This API gets a duration time value from a predefined rhythmic vibration pattern.\n
+ * The first in parameter dev_handle should be from the return value of device_haptic_open().\n
+ * The second in parameter vibe_buffer sets rhythmic vibration pattern buffer.
+ * The application can get a duration time value from the third out parameter duration when this API succeeds.
+ * The unit of duration is ms (millisecond) \n
+ * On success it returns a zero value. In case of failure it returns a negative value. \n
+ * Note: The actual behavior of the feedback played and the intensity depends on the target hardware.
+ * @param[in] dev_handle set recived dev_handle value from device_haptic_open()
+ * @param[in] vibe_buffer set vibe pattern buffer to get duration
+ * @param[out] duration get duration times (ms)
+ * @return if it succeed, it return zero value , otherwise negative value return
+ * @see device_haptic_get_file_duration()
+ */
+
+ int device_haptic_get_buffer_duration(int dev_handle, const unsigned char *vibe_buffer,
+ int *duration) __attribute__ ((deprecated));
+
+/**
+ * @fn int device_haptic_get_pattern_duration(int dev_handle, int pattern , int* duration)
+ * @par Description:
+ * This API gets a duration time value from a predefined rhythmic vibration pattern.\n
+ * The first in parameter dev_handle should be from the return value of device_haptic_open().\n
+ * The second in parameter pattern should be from a predefined pattern list
+ * which is available in an enumeration (effectvibe_pattern_list). \n
+ * The application can get a duration time value from the third out parameter duration when this API succeeds.
+ * The unit of duration is ms (millisecond) \n
+ * On success it returns a zero value. In case of failure it returns a negative value. \n
+ * Note: The actual behavior of the feedback played and the intensity depends on the target hardware.
+ * @param[in] dev_handle set recived dev_handle value from device_haptic_open()
+ * @param[in] pattern set predefined pattern enum value from <effectvibe_pattern_list>
+ * @param[out] duration get duration times (ms)
+ * @return if it succeed, it return zero value , otherwise negative value return
+ * @see device_haptic_get_file_duration()
+ */
+
+ int device_haptic_get_pattern_duration(int dev_handle, int pattern,
+ int *duration) __attribute__ ((deprecated));
+
+/**
+ * @fn int device_haptic_get_file_duration(int dev_handle, const char *file_name , int* duration)
+ * @par Description:
+ * This API gets a duration time value from a predefined rhythmic vibration pattern file (only supports .ivt type file).\n
+ * The first in parameter ?dev_handle? should be from the return value of device_haptic_open().\n
+ * The second in parameter ?file_name? sets rhythmic vibration pattern file with path. It only supports *.ivt type pattern file.\n
+ * The application can get a duration time value from the third out parameter duration when this API succeeds.
+ * The unit of duration is ms (millisecond)\n
+ * On success it returns a zero value. In case of failure it returns a negative value. \n
+ * Note: The actual behavior of the feedback played and the intensity depends on the target hardware.
+ * @param[in] dev_handle set recived dev_handle value from device_haptic_open()
+ * @param[in] file_name set file name with path
+ * @param[out] duration get duration times (ms)
+ * @return if it succeed, it return zero value , otherwise negative value return
+ * @see device_haptic_get_pattern_duration()
+ */
+
+ int device_haptic_get_file_duration(int dev_handle,
+ const char *file_name,
+ int *duration) __attribute__ ((deprecated));
+
+/**
+ * @fn int device_haptic_get_device_count(void)
+ * @par Description:
+ * This API gets a numer of devices.\n
+ * The application can get a number of devices from the return value this API succeeds.
+ * On success it returns a number of devices. In case of failure it returns a negative value. \n
+ * @return if it succeed, it return number of devices, otherwise negative value return
+ */
+ int device_haptic_get_device_count(void) __attribute__ ((deprecated));
+
+/**
+ * @fn int device_haptic_convert_to_binary(const char *haptic_name)
+ * @par Description:
+ * This API convert ivt file to binary file.\n
+ * If the haptic file is not located predefined position, this api can't work and returns a negative value.\n
+ * And also binary file is located predefined position and name according to rules.\n
+ * The first in parameter sets source file name which should be ".ivt" file.\n
+ * On success it returns 0. In case of failure it returns a negative value.\n
+ * @return if it succeed, it return 0, otherwise negative value return
+ */
+ int device_haptic_convert_to_binary(const char *haptic_name) __attribute__ ((deprecated));
+
+/**
+ * @}
+ */
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* __DEVMAN_HAPTIC_H__ */
--- /dev/null
+/*
+ * devman
+ * 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.
+ */
+
+
+#ifndef __DEVMAN_HAPTIC_EXT_H__
+#define __DEVMAN_HAPTIC_EXT_H__
+
+#include "devman_haptic_ext_core.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * @file devman_haptic_ext.h
+ * @ingroup DEVICE_MANAGER
+ * @brief This file contains the prototypes of the haptic extended API
+ * @author SLP2.0
+ * @date 2010-01-24
+ * @version 0.1
+ */
+
+/**
+ * @addtogroup DEVICE_MANAGER
+ * @{
+ */
+
+/**
+ * @fn int device_haptic_get_device_state(int device_index, int *state)
+ * @par Description:
+ * This API gets the status bits of an available device that is supported by the TouchSense Player API.\n
+ * @param[in] dev_idx set a device index (predefined enum value by haptic_dev_idx)
+ * @param[out] state is a pointer to the variable that will receive the status bits of the device
+ * @return if it succeed, it return HAPTIC_S_SUCCESS, otherwise negative value return
+ * @par Example:
+ * @code
+ * ...
+ * int status;
+ * int state
+ *
+ * //Get the haptic device state
+ * status = device_haptic_get_device_state(DEV_IDX_0, &state);
+ * if(status < 0)
+ * return -1;
+ * ...
+ * @endcode
+ */
+
+ int device_haptic_get_device_state(int device_index, int *state);
+
+/**
+ * @fn int device_haptic_get_device_capability_bool(int device_index, int device_cap_type, unsigned char *device_cap_value)
+ * @par Description:
+ * This API gets a Boolean capability of an available device that is supported by the TouchSense Player API.\n
+ * @param[in] device_index set a device index (predefined enum value by haptic_dev_idx)
+ * @param[in] device_cap_type set capability type of the Boolean capability to get
+ * @param[out] device_cap_value is a pointer to the variable that will receive the requested Boolean capability value of the device
+ * @return if it succeed, it return HAPTIC_S_SUCCESS , otherwise negative value return
+ * @see device_haptic_close()
+ * @par Example:
+ * @code
+ * ...
+ * int status;
+ * unsigned char device_cap_value;
+ *
+ * //Get haptic device capability
+ * status = device_haptic_get_device_capability_bool(DEV_IDX_0, NOT_AVAILABLE_CAPABILITY, &device_cap_value);
+ * if(status < 0)
+ * return -1;
+ * ...
+ * @endcode
+ */
+
+ int device_haptic_get_device_capability_bool(int device_index, int device_cap_type, unsigned char *device_cap_value);
+
+/**
+ * @fn int device_haptic_get_device_capability_int32(int device_index, int device_cap_type, int *device_cap_value)
+ * @par Description:
+ * This API gets a 32-bit integer capability of an available device that is supported by the TouchSense Player API.\n
+ * @param[in] device_index set a device index (predefined enum value by haptic_dev_idx)
+ * @param[in] device_cap_type set Capability type of the Boolean capability to get
+ * @param[out] device_cap_value is a pointer to the variable that will receive the requested 32-bit integer capability value of the device
+ * @return if it succeed, it return HAPTIC_S_SUCCESS , otherwise negative value return
+ * @see device_haptic_close()
+ * @par Example:
+ * @code
+ * ...
+ * int status;
+ * int device_cap_value;
+ *
+ * //Get haptic device capability
+ * status = device_haptic_get_device_capability_int32(DEV_IDX_0, HAPTIC_DEVCAPTYPE_ACTUATOR_TYPE, &device_cap_value);
+ * if(status < 0)
+ * return -1;
+ * ...
+ * @endcode
+ */
+
+ int device_haptic_get_device_capability_int32(int device_index, int device_cap_type, int *device_cap_value);
+
+/**
+ * @fn int device_haptic_get_device_capability_string(int device_index, int device_cap_type, int size, char *device_cap_value)
+ * @par Description:
+ * This API gets a string capability of an available device that is supported by the TouchSense Player API.\n
+ * @param[in] device_index set a device index (predefined enum value by haptic_dev_idx)
+ * @param[in] device_cap_type set Capability type of the Boolean capability to get
+ * @param[out] device_cap_value is a pointer to the variable that will receive the requested 32-bit integer capability value of the device
+ * @return if it succeed, it return HAPTIC_S_SUCCESS , otherwise negative value return
+ * @see device_haptic_close()
+ * @par Example:
+ * @code
+ * ...
+ * int status;
+ * int size = 1024;
+ * char device_cap_value[size];
+ *
+ * //Get haptic device capability
+ * status = device_haptic_get_device_capability_string(DEV_IDX_0, HAPTIC_DEVCAPTYPE_DEVICE_NAME, size, device_cap_value);
+ * if(status < 0)
+ * return -1;
+ * ...
+ * @endcode
+ */
+
+ int device_haptic_get_device_capability_string(int device_index, int device_cap_type, int size, char *device_cap_value);
+
+/**
+ * @fn int device_haptic_get_device_property_bool(int device_handle, int device_prop_type, unsigned char *device_prop_value)
+ * @par Description:
+ * This API gets a Boolean property of an open device.\n
+ * @param[in] device_handle is a handle to the device for which to get a Boolean property
+ * @param[in] device_prop_type set property type of the Boolean property to get
+ * @param[out] device_prop_value is a pointer to the variable that will receive the requested Boolean property value of the device
+ * @return if it succeed, it return HAPTIC_S_SUCCESS , otherwise negative value return
+ * @see device_haptic_close()
+ * @par Example:
+ * @code
+ * ...
+ * int status;
+ * int device_handle;
+ * unsigned char device_prop_value;
+ *
+ * device_handle = device_haptic_open_device(DEV_IDX0, 0);
+ * ...
+ *
+ * //Get haptic device property
+ * status = device_haptic_get_device_property_bool(device_handle, HAPTIC_DEVPROPTYPE_DISABLE_EFFECTS, &device_prop_value);
+ * if(status < 0)
+ * return -1;
+ * ...
+ * @endcode
+ */
+
+ int device_haptic_get_device_property_bool(int device_handle, int device_prop_type, unsigned char *device_prop_value);
+
+/**
+ * @fn int device_haptic_set_device_property_bool(int device_handle, int device_prop_type, unsigned char device_prop_value)
+ * @par Description:
+ * This API sets a Boolean property of an open device.\n
+ * @param[in] device_handle is a handle to the device for which to set a Boolean property
+ * @param[in] device_prop_type set property type of the Boolean property to set
+ * @param[in] device_prop_value is a value of the Boolean property to set
+ * @return if it succeed, it return HAPTIC_S_SUCCESS , otherwise negative value return
+ * @see device_haptic_close()
+ * @par Example:
+ * @code
+ * ...
+ * int status;
+ * int device_handle;
+ * unsigned char device_prop_value = HAPTIC_FALSE;
+ *
+ * device_handle = device_haptic_open_device(DEV_IDX0, 0);
+ * ...
+ *
+ * //Get haptic device property
+ * status = device_haptic_set_device_property_bool(device_handle, HAPTIC_DEVPROPTYPE_DISABLE_EFFECTS, device_prop_value);
+ * if(status < 0)
+ * return -1;
+ * ...
+ * @endcode
+ */
+
+ int device_haptic_set_device_property_bool(int device_handle, int device_prop_type, unsigned char device_prop_value);
+
+/**
+ * @fn int device_haptic_get_device_property_int32(int device_handle, int device_prop_type, int *device_prop_value)
+ * @par Description:
+ * This API gets a 32-bit integer property of an open device.\n
+ * @param[in] device_handle is a handle to the device for which to get a 32-bit integer property
+ * @param[in] device_prop_type set property type of the Boolean property to get
+ * @param[in] device_prop_value is a pointer to the variable that will receive the requested 32-bit integer property value of the device
+ * @return if it succeed, it return HAPTIC_S_SUCCESS , otherwise negative value return
+ * @see device_haptic_close()
+ * @par Example:
+ * @code
+ * ...
+ * int status;
+ * int device_handle;
+ * int device_prop_value;
+ *
+ * device_handle = device_haptic_open_device(DEV_IDX0, 0);
+ * ...
+ *
+ * //Get haptic device property
+ * status = device_haptic_get_device_property_int32(device_handle, HAPTIC_DEVPROPTYPE_STRENGTH, &device_prop_value);
+ * if(status < 0)
+ * return -1;
+ * ...
+ * @endcode
+ */
+
+ int device_haptic_get_device_property_int32(int device_handle, int device_prop_type, int *device_prop_value);
+
+/**
+ * @fn int device_haptic_set_device_property_int32(int device_handle, int device_prop_type, int device_prop_value)
+ * @par Description:
+ * This API sets a 32-bit integer property of an open device.\n
+ * @param[in] device_handle is a handle to the device for which to set a 32-bit integer property
+ * @param[in] device_prop_type set property type of the Boolean property to set
+ * @param[in] device_prop_value is a value of the 32-bit integer property to set.
+ * @return if it succeed, it return HAPTIC_S_SUCCESS , otherwise negative value return
+ * @see device_haptic_close()
+ * @par Example:
+ * @code
+ * ...
+ * int status;
+ * int device_handle;
+ * int device_prop_value = 5000;
+ *
+ * device_handle = device_haptic_open_device(DEV_IDX0, 0);
+ * ...
+ *
+ * //Get haptic device property
+ * status = device_haptic_get_device_property_int32(device_handle, HAPTIC_DEVPROPTYPE_STRENGTH, device_prop_value);
+ * if(status < 0)
+ * return -1;
+ * ...
+ * @endcode
+ */
+
+ int device_haptic_set_device_property_int32(int device_handle, int device_prop_type, int device_prop_value);
+
+/**
+ * @fn int device_haptic_get_device_property_string(int device_handle, int device_prop_type, int size, char *device_prop_value)
+ * @par Description:
+ * This API gets a string property of an open device.\n
+ * @param[in] device_handle is a handle to the device for which to get a string property
+ * @param[in] device_prop_type set property type of the string property to get
+ * @param[in] size is a size of the buffer, in bytes, pointed to by the device_prop_value parameter.
+ * @param[out] device_prop_value is a pointer to the variable that will receive the requested string property value of the device
+ * @return if it succeed, it return HAPTIC_S_SUCCESS , otherwise negative value return
+ * @see device_haptic_close()
+ * @par Example:
+ * @code
+ * ...
+ * int status;
+ * int device_handle;
+ * int size = 1024;
+ * char device_prop_value[size];
+ *
+ * device_handle = device_haptic_open_device(DEV_IDX0, 0);
+ * ...
+ *
+ * //Get haptic device property
+ * status = device_haptic_get_device_property_string(device_handle, HAPTIC_DEVPROPTYPE_STRENGTH, size, device_prop_value);
+ * if(status < 0)
+ * return -1;
+ * ...
+ * @endcode
+ */
+
+ int device_haptic_get_device_property_string(int device_handle, int device_prop_type, int size, char *device_prop_value);
+
+/**
+ * @fn int device_haptic_set_device_property_string(int device_handle, int device_prop_type, char *device_prop_value)
+ * @par Description:
+ * This API sets a string property of an open device.\n
+ * @param[in] device_handle is a handle to the device for which to get a string property
+ * @param[in] device_prop_type set property type of the string property to set
+ * @param[in] device_prop_value pointer to the character buffer containing the string property value to set.
+ * @return if it succeed, it return HAPTIC_S_SUCCESS , otherwise negative value return
+ * @see device_haptic_close()
+ * @par Example:
+ * @code
+ * ...
+ * int status;
+ * int device_handle;
+ * char *device_prop_value = "DMZI13021KAIA112123";
+ *
+ * device_handle = device_haptic_open_device(DEV_IDX0, 0);
+ * ...
+ *
+ * //Get haptic device property
+ * status = device_haptic_set_device_property_string(device_handle, HAPTIC_DEVPROPTYPE_LICENSE_KEY, device_prop_value);
+ * if(status < 0)
+ * return -1;
+ * ...
+ * @endcode
+ */
+
+ int device_haptic_set_device_property_string(int device_handle, int device_prop_type, const char *device_prop_value);
+
+/**
+ * @fn int device_haptic_get_effect_count(const unsigned char *ivt_buffer)
+ * @par Description:
+ * This API gets number of effects defined in IVT data.\n
+ * @param[in] ivt_buffer is a pointer to IVT data
+ * @return if it succeed, it returns number of effects defined in the specified IVT data, otherwise negative value return
+ * @par Example:
+ * @code
+ * ...
+ * int effect_count;
+ * unsigned char ivt_buffer = { .... };
+ *
+ * //Open the haptic device
+ * effect_count = device_haptic_get_effect_count(ivt_buffer);
+ * if(effect_count < 0)
+ * return -1;
+ * ...
+ * @endcode
+ */
+
+ int device_haptic_get_effect_count(const unsigned char *ivt_buffer);
+
+/**
+ * @fn int device_haptic_get_effect_name(const unsigned char *ivt_buffer, int effect_index, int size, char *effect_name)
+ * @par Description:
+ * This API Gets the name of an effect defined in IVT data.\n
+ * @param[in] ivt_buffer is a pointer to IVT data containing the effect for which to get the name
+ * @param[in] effect_index is index of the effect for which to get the name
+ * @param[in] size is a size of the buffer, in bytes, pointed by the effect_name parameter
+ * @param[out] effect_name is a pointer to the character buffer that will receive the name of the effect
+ * @return if it succeed, it return HAPTIC_S_SUCCESS, otherwise negative value return
+ * @par Example:
+ * @code
+ * ...
+ * int status;
+ * unsigned char *ivt_buffer = { ... };
+ * int size = 1024;
+ * char effect_name[size];
+ *
+ * //Get IVT effect duration
+ * status = device_haptic_get_effect_name(ivt_buffer, 0, size, effect_name);
+ * if(staus < 0)
+ * return -1;
+ * ...
+ * @endcode
+ */
+
+ int device_haptic_get_effect_name(const unsigned char *ivt_buffer, int effect_index, int size, char *effect_name);
+
+/**
+ * @fn int device_haptic_get_effect_name_u(const unsigned char *ivt_buffer, int effect_index, int size, unsigned short *effect_name)
+ * @par Description:
+ * This API gets the name of an effect defined in IVT data as a string of VibeWChar in UCS-2 format.\n
+ * @param[in] ivt_buffer is a pointer to IVT data containing the effect for which to get the name
+ * @param[in] effect_index is index of the effect for which to get the name
+ * @param[in] size is a size of the buffer, in bytes, pointed by the effect_name parameter
+ * @param[out] effect_name is a pointer to the unsigned short buffer that will receive the name of the effect
+ * @return if it succeed, it return HAPTIC_S_SUCCESS, otherwise negative value return
+ * @par Example:
+ * @code
+ * ...
+ * int status;
+ * unsigned char *ivt_buffer = { ... };
+ * int size = 1024;
+ * unsigned short effect_name[size];
+ *
+ * //Get IVT effect duration
+ * status = device_haptic_get_effect_name_u(ivt_buffer, 0, size, effect_name);
+ * if(staus < 0)
+ * return -1;
+ * ...
+ * @endcode
+ */
+
+ int device_haptic_get_effect_name_u(const unsigned char *ivt_buffer, int effect_index, int size, unsigned short *effect_name);
+
+/**
+ * @fn int device_haptic_get_effect_index_from_name(const unsigned char *ivt_buffer, const char *effect_name, int *effect_index)
+ * @par Description:
+ * This API gets the index of an effect defined in IVT data given the name of the effect.\n
+ * @param[in] ivt_buffer is a pointer to IVT data
+ * @param[in] effect_name is pointer to the character buffer containing the name of the effect for which to get the index
+ * @param[out] effect_index is a pointer to the variable that will receive the index of the effect
+ * @return if it succeed, it return HAPTIC_S_SUCCESS, otherwise negative value return
+ * @par Example:
+ * @code
+ * ...
+ * int status;
+ * unsigned char *ivt_buffer = { ... };
+ * int effect_index;
+ * char *effect_name = "PERIODIC_EFFECT";
+ *
+ * //Get IVT effect duration
+ * status = device_haptic_get_effect_index_from_name(ivt_buffer, effect_name, &effect_index);
+ * if(staus < 0)
+ * return -1;
+ * ...
+ * @endcode
+ */
+
+ int device_haptic_get_effect_index_from_name(const unsigned char *ivt_buffer, const char *effect_name, int *effect_index);
+
+/**
+ * @fn int device_haptic_get_effect_index_from_name_u(const unsigned char *ivt_buffer, const unsigned short *effect_name, int *effect_index)
+ * @par Description:
+ * This API Gets the index of an effect defined in IVT data given the name of the effect as a string of VibeWChar in UCS-2 format.\n
+ * @param[in] ivt_buffer is a pointer to IVT data
+ * @param[in] effect_name is a pointer to the unsigned short buffer containing the UCS-2 formatted name of the effect for which to get the index
+ * @param[out] effect_index is a pointer to the variable that will receive the index of the effect
+ * @return if it succeed, it return HAPTIC_S_SUCCESS, otherwise negative value return
+ * @par Example:
+ * @code
+ * ...
+ * int status;
+ * unsigned char *ivt_buffer = { ... };
+ * int effect_index;
+ * unsigned short *effect_name = "PERIODIC_EFFECT";
+ *
+ * //Get IVT effect duration
+ * status = device_haptic_get_effect_index_from_name_u(ivt_buffer, effect_name, &effect_index);
+ * if(staus < 0)
+ * return -1;
+ * ...
+ * @endcode
+ */
+
+ int device_haptic_get_effect_index_from_name_u(const unsigned char *ivt_buffer, const unsigned short *effect_name, int *effect_index);
+
+/**
+ * @fn int device_haptic_play_effect(int device_handle, const unsigned char *ivt_buffer, int effect_index, int *effect_handle)
+ * @par Description:
+ * This API Pauses a playing effect.\n
+ * @param[in] device_handle is a handle to the device associated to the effect
+ * @param[in] ivt_buffer is a pointer to IVT data containing the definition of the effect to play
+ * @param[in] effect_index is an index of the effect to play
+ * @param[out] effect_handle is a pointer to the handle to the variable that will receive a handle to the playing effect
+ * @return if it succeed, it return HAPTIC_S_SUCCESS, otherwise negative value return
+ * @see device_haptic_close()
+ * @par Example:
+ * @code
+ * ...
+ * int status;
+ * int effect_handle;
+ *
+ * status = device_haptic_play_effect(device_handle, ivt_buffer, 0, &effect_handle);
+ * if (status < 0) {
+ * return status;
+ * }
+ * ...
+ * @endcode
+ */
+
+ int device_haptic_play_effect(int device_handle, const unsigned char *ivt_buffer, int effect_index, int *effect_handle);
+
+/**
+ * @fn int device_haptic_play_effect_repeat(int device_handle, const unsigned char *ivt_buffer, int effect_index, unsigned char repeat, int *effect_handle)
+ * @par Description:
+ * This API Pauses a playing effect.\n
+ * @param[in] device_handle is a handle to the device associated to the effect
+ * @param[in] ivt_buffer is a pointer to IVT data containing the definition of the effect to play
+ * @param[in] effect_index is an index of the effect to play
+ * @param[in] repeat is a number of time to repeat the effect
+ * @param[out] effect_handle is a pointer to the handle to the variable that will receive a handle to the playing effect
+ * @return if it succeed, it return HAPTIC_S_SUCCESS, otherwise negative value return
+ * @see device_haptic_close()
+ * @par Example:
+ * @code
+ * ...
+ * int status;
+ * int effect_handle;
+ *
+ * status = device_haptic_play_effect_repeat(device_handle, ivt_buffer, 0, 3, &effect_handle);
+ * if (status < 0) {
+ * return status;
+ * }
+ * ...
+ * @endcode
+ */
+
+ int device_haptic_play_effect_repeat(int device_handle, const unsigned char *ivt_buffer, int effect_index, unsigned char repeat, int *effect_handle);
+
+/**
+ * @fn int device_haptic_stop_playing_effects(int device_handle, int effect_handle)
+ * @par Description:
+ * This API stops playing effect.\n
+ * @param[in] device_handle is a handle to the device on which to stop the playing effect
+ * @param[in] effect_handle is a handle to the playing effect to stop
+ * @return if it succeed, it return HAPTIC_S_SUCCESS, otherwise negative value return
+ * @par Example:
+ * @code
+ * ...
+ * int status;
+ *
+ * status = device_haptic_stop_playing_effects(device_handle, effect_handle);
+ * if(status < 0)
+ * return -1;
+ * ...
+ * @endcode
+ */
+
+ int device_haptic_stop_playing_effect(int device_handle, int effect_handle);
+
+/**
+ * @fn int device_haptic_get_effect_type(const unsigned char *ivt_buffer, int effect_index, int *effect_type)
+ * @par Description:
+ * This API gets the type of an effect defined in IVT data.\n
+ * @param[in] ivt_buffer is a pointer to IVT data containing the effect for which to get the type
+ * @param[in] effect_index is index of the effect for which to get the type
+ * @param[out] effect_type is a pointer to the variable that will receive the type of the effect
+ * @return if it succeed, it return HAPTIC_S_SUCCESS, otherwise negative value return
+ * @par Example:
+ * @code
+ * ...
+ * int status;
+ * unsigned char *ivt_buffer = { ... };
+ * int effect_type;
+ *
+ * //Get IVT effect type
+ * status = device_haptic_get_effect_type(ivt_buffer, 0, &effect_type);
+ * if(staus < 0)
+ * return -1;
+ * ...
+ * @endcode
+ */
+
+ int device_haptic_get_effect_type(const unsigned char *ivt_buffer, int effect_index, int *effect_type);
+
+/**
+ * @fn int device_haptic_get_magsweep_effect_definition(const unsigned char *ivt_buffer, int effect_index, int *duration, int *magnitude, int *style, int *attacktime, int *attacklevel, int *fadetime, int *fadelevel);
+ * @par Description:
+ * This API gets the parameters of a MagSweep effect defined in IVT data.\n
+ * @param[in] ivt_buffer is a pointer to IVT data containing the effect for which to get the type
+ * @param[in] effect_index is index of the effect for which to get the type
+ * @param[out] duration is a pointer to the variable that will receive the duration of the effect in milliseconds
+ * @param[out] magnitude is a pointer to the variable that will receive the magnitude of the effect
+ * @param[out] style is a pointer to the variable that will receive the style of the effect
+ * @param[out] attacktime is a pointer to the variable that will receive the attack time of the effect in milliseconds
+ * @param[out] attacklevel is a pointer to the variable that will receive the attack level of the effect
+ * @param[out] fadetime is a pointer to the variable that will receive the fade time of the effect in milliseconds
+ * @param[out] fadelevel is a pointer to the variable that will receive the fade level of the effect
+ * @return if it succeed, it return HAPTIC_S_SUCCESS, otherwise negative value return
+ * @par Example:
+ * @code
+ * ...
+ * int status;
+ * unsigned char *ivt_buffer = { ... };
+ * int duration;
+ * int magnitude;
+ * int style;
+ * int attacktime;
+ * int attacklevel;
+ * int fadetime;
+ * int fadelevel;
+ *
+ * status = device_haptic_get_magsweep_effect_definition(ivt_buffer, 1,
+ * &duration, &magnitude, &style, &attacktime, &attacklevel, &fadetime, &fadelevel);
+ * if (status < 0) {
+ * return status;
+ * }
+ * ...
+ * @endcode
+ */
+
+ int device_haptic_get_magsweep_effect_definition(const unsigned char *ivt_buffer, int effect_index, int *duration, int *magnitude, int *style, int *attacktime, int *attacklevel, int *fadetime, int *fadelevel);
+
+/**
+ * @fn int device_haptic_get_periodic_effect_definition(const unsigned char *ivt_buffer, int effect_index, int *duration, int *magnitude, int *period, int *style_and_wave_type, int *attacktime, int *attacklevel, int *fadetime, int *fadelevel);
+ * @par Description:
+ * This API gets the parameters of a Periodic effect defined in IVT data.\n
+ * @param[in] ivt_buffer is a pointer to IVT data containing the effect for which to get the type
+ * @param[in] effect_index is index of the effect for which to get the type
+ * @param[out] duration is a pointer to the variable that will receive the duration of the effect in milliseconds
+ * @param[out] magnitude is a pointer to the variable that will receive the magnitude of the effect
+ * @param[out] period is a pointer to the variable that will receive the period of the effect in milliseconds
+ * @param[out] style_and_wave_type is a pointer to the variable that will receive the style and wave type of the effect
+ * @param[out] attacktime is a pointer to the variable that will receive the attack time of the effect in milliseconds
+ * @param[out] attacklevel is a pointer to the variable that will receive the attack level of the effect
+ * @param[out] fadetime is a pointer to the variable that will receive the fade time of the effect in milliseconds
+ * @param[out] fadelevel is a pointer to the variable that will receive the fade level of the effect
+ * @return if it succeed, it return HAPTIC_S_SUCCESS, otherwise negative value return
+ * @par Example:
+ * @code
+ * ...
+ * int status;
+ * unsigned char *ivt_buffer = { ... };
+ * int duration;
+ * int magnitude;
+ * int period;
+ * int style;
+ * int attacktime;
+ * int attacklevel;
+ * int fadetime;
+ * int fadelevel;
+ *
+ * status = device_haptic_get_periodic_effect_definition(ivt_buffer, 1,
+ * &duration, &magnitude, &period, &style, &attacktime, &attacklevel, &fadetime, &fadelevel);
+ * if (status < 0) {
+ * return status;
+ * }
+ * ...
+ * @endcode
+ */
+
+ int device_haptic_get_periodic_effect_definition(const unsigned char *ivt_buffer, int effect_index, int *duration, int *magnitude, int *period, int *style_and_wave_type, int *attacktime, int *attacklevel, int *fadetime, int *fadelevel);
+
+/**
+ * @fn int device_haptic_get_effect_duration(const unsigned char *ivt_buffer, int effect_index, int *effect_duration)
+ * @par Description:
+ * This API gets the duration of an effect defined in IVT data.\n
+ * @param[in] ivt_buffer is a pointer to IVT data containing the effect for which to get the Duration
+ * @param[in] effect_index is a index of the effect for which to get the Duration
+ * @param[out] effect_duration is a pointer to the variable that will receive the Duration of the effect
+ * @return if it succeed, it return HAPTIC_S_SUCCESS, otherwise negative value return
+ * @par Example:
+ * @code
+ * ...
+ * int status;
+ * unsigned char *ivt_buffer = { ... };
+ * int effect_duration
+ *
+ * //Get IVT effect duration
+ * status = device_haptic_get_effect_duration(ivt_buffer, 0, &effect_duration);
+ * if(staus < 0)
+ * return -1;
+ * ...
+ * @endcode
+ */
+
+ int device_haptic_get_effect_duration(const unsigned char *ivt_buffer, int effect_index, int *effect_duration);
+
+/**
+ * @fn int device_haptic_play_magsweep_effect(int device_handle, int duration, int magnitude, int style, int attacktime, int attacklevel, int fadetime, int fadelevel, int *effect_handle);
+ * @par Description:
+ * This API play Mag Sweep effect.\n
+ * @param[in] device_handle is a handle to the device on which to modify the playing effect
+ * @param[in] duration is a duration of the effect in milliseconds
+ * @param[in] magnitude is a magnitude of the effect
+ * @param[in] style is a style of the effect
+ * @param[in] attacktime is a attack time of the effect in milliseconds
+ * @param[in] attacklevel is a attack level of the effect
+ * @param[in] fadetime is a fade time of the effect in milliseconds
+ * @param[in] fadelevel is a fade level of the effect
+ * @param[out] effect_handle is a pointer to the variable that will receive a handle to the playing effect
+ * @return if it succeed, it return HAPTIC_S_SUCCESS, otherwise negative value return
+ * @par Example:
+ * @code
+ * ...
+ * int status;
+ * unsigned char *ivt_buffer = { ... };
+ * int duration = 2900;
+ * int magnitude = HAPTIC_MAX_MAGNITUDE;
+ * int style = HAPTIC_STYLE_SMOOTH;
+ * int attackTime = 2483;
+ * int attackLevel = 0;
+ * int fadeTime = 0;
+ * int fadeLevel = HAPTIC_MAX_MAGNITUDE;
+ * int effect_handle;
+ *
+ * status = device_haptic_play_magsweep_effect(device_handle,
+ * duration, magnitude, style, attacktime, attacklevel, fadetime, fadelevel, &effect_handle);
+ * if (status < 0) {
+ * return status;
+ * }
+ * ...
+ * @endcode
+ */
+
+ int device_haptic_play_magsweep_effect(int device_handle, int duration, int magnitude, int style, int attacktime, int attacklevel, int fadetime, int fadelevel, int *effect_handle);
+
+/**
+ * @fn int device_haptic_play_periodic_effect(int device_handle, int duration, int magnitude, int period, int style_and_wave_type, int attacktime, int attacklevel, int fadetime, int fadelevel, int *effect_handle);
+ * @par Description:
+ * This API play Periodic effect.\n
+ * @param[in] device_handle is a handle to the device on which to modify the playing effect
+ * @param[in] duration is a duration of the effect in milliseconds
+ * @param[in] magnitude is a magnitude of the effect
+ * @param[in] style is a style of the effect
+ * @param[in] attacktime is a attack time of the effect in milliseconds
+ * @param[in] attacklevel is a attack level of the effect
+ * @param[in] fadetime is a fade time of the effect in milliseconds
+ * @param[in] fadelevel is a fade level of the effect
+ * @param[out] effect_handle is a pointer to the variable that will receive a handle to the playing effect
+ * @return if it succeed, it return HAPTIC_S_SUCCESS, otherwise negative value return
+ * @par Example:
+ * @code
+ * ...
+ * int status;
+ * unsigned char *ivt_buffer = { ... };
+ * int duration = 2900;
+ * int magnitude = HAPTIC_MAX_MAGNITUDE;
+ * int period = 100;
+ * int style = HAPTIC_STYLE_SMOOTH;
+ * int attackTime = 2483;
+ * int attackLevel = 0;
+ * int fadeTime = 0;
+ * int fadeLevel = HAPTIC_MAX_MAGNITUDE;
+ * int effect_handle;
+ *
+ * status = device_haptic_play_periodic_effect(device_handle,
+ * duration, magnitude, period, style, attacktime, attacklevel, fadetime, fadelevel, &effect_handle);
+ * if (status < 0) {
+ * return status;
+ * }
+ * ...
+ * @endcode
+ */
+
+ int device_haptic_play_periodic_effect(int device_handle, int duration, int magnitude, int period, int style_and_wave_type, int attacktime, int attacklevel, int fadetime, int fadelevel, int *effect_handle);
+
+/**
+ * @fn int device_haptic_modify_playing_magsweep_effect(int device_handle, int effect_handle, int duration, int magnitude, int style, int attacktime, int attacklevel, int fadetime, int fadelevel);
+ * @par Description:
+ * This API Modifies a playing Mag Sweep effect.\n
+ * @param[in] device_handle is a handle to the device on which to modify the playing effect
+ * @param[in] effect_handle is a handle to the playing MagSweep effect to modify
+ * @param[in] duration is a duration of the effect in milliseconds
+ * @param[in] magnitude is a magnitude of the effect
+ * @param[in] style is a style of the effect
+ * @param[in] attacktime is a attack time of the effect in milliseconds
+ * @param[in] attacklevel is a attack level of the effect
+ * @param[in] fadetime is a fade time of the effect in milliseconds
+ * @param[in] fadelevel is a fade level of the effect
+ * @return if it succeed, it return HAPTIC_S_SUCCESS, otherwise negative value return
+ * @par Example:
+ * @code
+ * ...
+ * int status;
+ * unsigned char *ivt_buffer = { ... };
+ * int duration = 2900;
+ * int magnitude = HAPTIC_MAX_MAGNITUDE;
+ * int style = HAPTIC_STYLE_SMOOTH;
+ * int attackTime = 2483;
+ * int attackLevel = 0;
+ * int fadeTime = 0;
+ * int fadeLevel = HAPTIC_MAX_MAGNITUDE;
+ *
+ * status = device_haptic_modify_playing_magsweep_effect(device_handle, effect_handle,
+ * duration, magnitude, style, attacktime, attacklevel, fadetime, fadelevel);
+ * if (status < 0) {
+ * return status;
+ * }
+ * ...
+ * @endcode
+ */
+
+ int device_haptic_modify_playing_magsweep_effect(int device_handle, int effect_handle, int duration, int magnitude, int style, int attacktime, int attacklevel, int fadetime, int fadelevel);
+
+/**
+ * @fn int device_haptic_modify_playing_periodic_effect(int device_handle, int effect_handle, int duration, int magnitude, int period, int style_and_wave_type, int attacktime, int attacklevel, int fadetime, int fadelevel);
+ * @par Description:
+ * This API modifies a playing Periodic effect.\n
+ * @param[in] device_handle is a handle to the device on which to modify the playing effect
+ * @param[in] effect_handle is a handle to the playing MagSweep effect to modify
+ * @param[in] duration is a duration of the effect in milliseconds
+ * @param[in] magnitude is a magnitude of the effect
+ * @param[in] period is a period of the effect
+ * @param[in] style is a style of the effect
+ * @param[in] attacktime is a attack time of the effect in milliseconds
+ * @param[in] attacklevel is a attack level of the effect
+ * @param[in] fadetime is a fade time of the effect in milliseconds
+ * @param[in] fadelevel is a fade level of the effect
+ * @return if it succeed, it return HAPTIC_S_SUCCESS, otherwise negative value return
+ * @par Example:
+ * @code
+ * ...
+ * int status;
+ * unsigned char *ivt_buffer = { ... };
+ * int duration = 2900;
+ * int magnitude = HAPTIC_MAX_MAGNITUDE;
+ * int period = 100;
+ * int style = HAPTIC_STYLE_SMOOTH;
+ * int attackTime = 2483;
+ * int attackLevel = 0;
+ * int fadeTime = 0;
+ * int fadeLevel = HAPTIC_MAX_MAGNITUDE;
+ *
+ * status = device_haptic_modify_playing_periodic_effect(device_handle, effect_handle,
+ * duration, magnitude, period, style, attacktime, attacklevel, fadetime, fadelevel);
+ * if (status < 0) {
+ * return status;
+ * }
+ * ...
+ * @endcode
+ */
+
+ int device_haptic_modify_playing_periodic_effect(int device_handle, int effect_handle, int duration, int magnitude, int period, int style_and_wave_type, int attacktime, int attacklevel, int fadetime, int fadelevel);
+
+/**
+ * @fn int device_haptic_create_streaming_effect(int device_handle, int *effect_handle)
+ * @par Description:
+ * This API creates a Streaming effect.\n
+ * @param[in] device_handle is a handle to the device associated to the effect
+ * @param[out] effect_handle is a pointer to the variable that will receive a handle to the Streaming effect
+ * @return if it succeed, it return HAPTIC_S_SUCCESS, otherwise negative value return
+ * @par Example:
+ * @code
+ * ...
+ * int status;
+ * int effect_handle;
+ *
+ * status = device_haptic_create_streaming_effect(device_handle, &effect_handle);
+ * if(status < 0)
+ * return -1;
+ * ...
+ * @endcode
+ */
+
+ int device_haptic_create_streaming_effect(int device_handle, int *effect_handle);
+
+/**
+ * @fn int device_haptic_destroy_streaming_effect(int device_handle, int effect_handle)
+ * @par Description:
+ * This API creates a Streaming effect.\n
+ * @param[in] device_handle is a handle to the device associated to the effect
+ * @param[in] effect_handle is a handle to the Streaming effect to destroy
+ * @return if it succeed, it return HAPTIC_S_SUCCESS, otherwise negative value return
+ * @par Example:
+ * @code
+ * ...
+ * int status;
+ * int effect_handle;
+ *
+ * status = device_haptic_create_streaming_effect(device_handle, &effect_handle);
+ * if(status < 0)
+ * return -1;
+ * ...
+ * @endcode
+ */
+
+ int device_haptic_destroy_streaming_effect(int device_handle, int effect_handle);
+
+/**
+ * @fn int device_haptic_play_streaming_sample(int device_handle, int effect_handle, const unsigned char *streaming_sample, int size)
+ * @par Description:
+ * This API plays a Streaming Sample given the parameters defining the effect.\n
+ * @param[in] device_handle is a handle to the device on which to play the effect
+ * @param[in] effect_handle is a hndle to the Streaming effect to play
+ * @param[in] streaming_sameple is a pointer to Streaming Sample data containing the definition of the effect to play
+ * @param[in] size is a size of the buffer, in bytes, pointed to by streaming_sample parameter
+ * @return if it succeed, it return HAPTIC_S_SUCCESS, otherwise negative value return
+ * @par Example:
+ * @code
+ * ...
+ * int status;
+ *
+ * status = device_haptic_play_streaming_sample(device_handle, effect_handle, *streaming_sample, size);
+ * if(status < 0)
+ * return -1;
+ * ...
+ * @endcode
+ */
+
+ int device_haptic_play_streaming_sample(int device_handle, int effect_handle, const unsigned char *streaming_sample, int size);
+
+/**
+ * @fn int device_haptic_play_streaming_sample_with_offset(int device_handle, int effect_handle, const unsigned char *streaming_sample, int size, int offset_time)
+ * @par Description:
+ * This API plays a Streaming Sample with a time offset given the parameters defining the effect.\n
+ * @param[in] device_handle is a handle to the device on which to play the effect
+ * @param[in] effect_handle is a hndle to the Streaming effect to play
+ * @param[in] streaming_sameple is a pointer to Streaming Sample data containing the definition of the effect to play
+ * @param[in] size is a size of the buffer, in bytes, pointed to by streaming_sample parameter
+ * @param[in] offset_time is set offet time to play the sample
+ * @return if it succeed, it return HAPTIC_S_SUCCESS, otherwise negative value return
+ * @par Example:
+ * @code
+ * ...
+ * int status;
+ *
+ * status = device_haptic_play_streaming_sample_with_offset(device_handle, effect_handle, *streaming_sample, size, 100);
+ * if(status < 0)
+ * return -1;
+ * ...
+ * @endcode
+ */
+
+ int device_haptic_play_streaming_sample_with_offset(int device_handle, int effect_handle, const unsigned char *streaming_sample, int size, int offset_time);
+
+
+
+/**
+ * @fn int device_haptic_stop_all_playing_effects(int device_handle)
+ * @par Description:
+ * This API stops all playing and paused effects on a device.\n
+ * @param[in] device_handle is a handle to the device associated to the effect
+ * @return if it succeed, it return HAPTIC_S_SUCCESS, otherwise negative value return
+ * @par Example:
+ * @code
+ * ...
+ * int status;
+ *
+ * status = device_haptic_stop_all_playing_effects(device_handle);
+ * if(status < 0)
+ * return -1;
+ * ...
+ * @endcode
+ */
+
+ int device_haptic_stop_all_playing_effects(int device_handle);
+
+/**
+ * @fn int device_haptic_save_file(const unsigned char *ivt_buffer, int max_bufsize, const char *path_name)
+ * @par Description:
+ * This API saves an IVT file to persistent storage.\n
+ * @param[in] ivt_buffer is a pointer to IVT data
+ * @param[in] max_bufsize is a max size of ivt_buffer
+ * @param[in] path_name is a pointer to the character buffer containing the path name of the file to save
+ * @return if it succeed, it return HAPTIC_S_SUCCESS, otherwise negative value return
+ * @par Example:
+ * @code
+ * ...
+ * int status;
+ * unsigned char *ivt_buffer = { ... };
+ * char *path_name = "test.ivt";
+ * int size = MAX_IVT_SIZE;
+ *
+ * status = device_haptic_save_file(ivt_buffer, size, path_name);
+ * if(staus < 0)
+ * return -1;
+ * ...
+ * @endcode
+ */
+
+ int device_haptic_save_file(const unsigned char *ivt_buffer, int max_bufsize, const char *path_name);
+
+/**
+ * @fn int device_haptic_delete_file(const char *path_name)
+ * @par Description:
+ * This API removes an IVT file from persistent storage.\n
+ * @param[in] path_name is a pointer to the character buffer containing the path name of the file to remove.\n
+ * @return if it succeed, it return HAPTIC_S_SUCCESSe , otherwise negative value return
+ * @see device_haptic_save_file()
+ * @par Example:
+ * @code
+ * ...
+ * char *path_name = "test.ivt";
+ * int = status;
+ *
+ * //Remove an IVT file
+ * status = device_haptic_delete_file(path_name);
+ * if(status < 0)
+ * return -1;
+ * ...
+ * @endcode
+ */
+
+ int device_haptic_delete_file(const char *path_name);
+
+/**
+ * @fn int device_haptic_pause_playing_effect(int device_handle, int effect_handle)
+ * @par Description:
+ * This API Pauses a playing effect.\n
+ * @param[in] device_handle is a handle to the device associated to the effect
+ * @param[in] effect_handle is a handle to the playing effect to pause
+ * @return if it succeed, it return HAPTIC_S_SUCCESS, otherwise negative value return
+ * @par Example:
+ * @code
+ * ...
+ * int status;
+ *
+ * status = device_haptic_pause_playing_effect(handle, effect_handle);
+ * if (status < 0) {
+ * return status;
+ * }
+ * ...
+ * @endcode
+ */
+
+ int device_haptic_pause_playing_effect(int device_handle, int effect_handle);
+
+/**
+ * @fn int device_haptic_resume_paused_effect(int device_handle, int effect_handle)
+ * @par Description:
+ * This API resumes a paused effect from the point where the effect was paused.\n
+ * @param[in] device_handle is a handle to the device associated to the effect
+ * @param[in] effect_handle is a handle to the playing effect to pause
+ * @return if it succeed, it return HAPTIC_S_SUCCESS, otherwise negative value return
+ * @par Example:
+ * @code
+ * ...
+ * int status;
+ *
+ * status = device_haptic_resume_paused_effect(handle, effect_handle);
+ * if (status < 0) {
+ * return status;
+ * }
+ * ...
+ * @endcode
+ */
+
+ int device_haptic_resume_paused_effect(int device_handle, int effect_handle);
+
+/**
+ * @fn int device_haptic_get_effect_state(int device_handle, int effect_handle, int *effect_state)
+ * @par Description:
+ * This API retrieves the status of an effect (playing, not playing, paused).\n
+ * @param[in] device_handle ia a handle to the device associated to the effect
+ * @param[in] effect_handle ia a handle to the effect which must have been obtained by calling playing APIs
+ * @param[out] state ia a pointer to the variable that will receive the status bits of the effect
+ * @return if it succeed, it return HAPTIC_S_SUCCESS, otherwise negative value return
+ * @par Example:
+ * @code
+ * ...
+ * int status;
+ *
+ * //Open the haptic device
+ * status = device_haptic_get_effect_state(device_handle, device_effect, &state);
+ * if(status < 0)
+ * return -1;
+ * ...
+ * @endcode
+ */
+
+ int device_haptic_get_effect_state(int device_handle, int effect_handle, int *effect_state);
+
+/**
+ * @fn int device_haptic_get_size(const unsigned char *ivt_buffer, int size)
+ * @par Description:
+ * This API sets the size of IVT data.\n
+ * @param[in] ivt_buffer is a pointer to an IVT buffer
+ * @param[in] size is a size of the buffer pointed to by ivt_buffer
+ * @return if it succeed, it return the size of the IVT data, otherwise negative value return
+ * @par Example:
+ * @code
+ * ...
+ * int status;
+ * unsigned char *ivt_buffer = { ... };
+ * int IVT_size;
+ *
+ * IVT_size = device_haptic_get_size(ivt_buffer, sizeof(ivt_buffer));
+ * if (status < 0) {
+ * return status;
+ * }
+ * ...
+ * @endcode
+ */
+
+ int device_haptic_get_size(const unsigned char *ivt_buffer, int size);
+
+/**
+ * @fn int device_haptic_initialize_buffer(unsigned char *ivt_buffer, int size)
+ * @par Description:
+ * This API initializes an IVT buffer. Any data currently in the buffer will be destroyed.\n
+ * @param[in/out] ivt_buffer is a pointer to a buffer to initialize
+ * @param[in] size is a size of the buffer pointed to by ivt_buffer
+ * @return if it succeed, it return HAPTIC_S_SUCCESS, otherwise negative value return
+ * @par Example:
+ * @code
+ * ...
+ * int status;
+ * int size = 1024;
+ * unsigned char ivt_buffer[size];
+ *
+ * status = device_haptic_initialize_buffer(ivt_buffer, size);
+ * if (status < 0) {
+ * return status;
+ * }
+ * ...
+ * @endcode
+ */
+
+ int device_haptic_initialize_buffer(unsigned char *ivt_buffer, int size);
+
+/**
+ * @fn int device_haptic_insert_element(unsigned char *ivt_buffer, int size, int timeline_index, const HapticElement *element)
+ * @par Description:
+ * This API inserts an element into a Timeline effect in an IVT buffer.\n
+ * @param[in/out] ivt_buffer is a pointer to an IVT buffer
+ * @param[in] size is a size of the buffer pointed to by ivt_buffer
+ * @param[in] timeline_index is an index of a Timeline effect in which to insert the element
+ * @param[in] element is a pointer to an HapticElement structure containing the parameters of a Periodic effect, MagSweep effect, or Repeat event to insert into the Timeline effect
+ * @return if it succeed, it return HAPTIC_S_SUCCESS, otherwise negative value return
+ * @par Example:
+ * @code
+ * ...
+ * int status;
+ * HapticElement elem1;
+ * elem1.elementtype = HAPTIC_ELEMTYPE_MAGSWEEP;
+ * elem1.time = 0;
+ * elem1.TypeSpecific.magsweep.duration = 2900;
+ * elem1.TypeSpecific.magsweep.magnitude = HAPTIC_MAX_MAGNITUDE;
+ * elem1.TypeSpecific.magsweep.style = HAPTIC_STYLE_SMOOTH;
+ * elem1.TypeSpecific.magsweep.attacktime = 2483;
+ * elem1.TypeSpecific.magsweep.attacklevel = 0;
+ * elem1.TypeSpecific.magsweep.fadetime = 0;
+ * elem1.TypeSpecific.magsweep.fadelevel = HAPTIC_MAX_MAGNITUDE;
+ *
+ * status = device_haptic_insert_element(temp_buffer, temp_size, timeline_index, &elem1);
+ * if (status < 0) {
+ * return status;
+ * }
+
+ * ...
+ * @endcode
+ */
+
+ int device_haptic_insert_element(unsigned char *ivt_buffer, int size, int timeline_index, const HapticElement *element);
+
+/**
+ * @fn int device_haptic_insert_element2(unsigned char *ivt_buffer, int size, int timeline_index, const HapticElement2 *element)
+ * @par Description:
+ * This API inserts an element into a Timeline effect in an IVT buffer.\n
+ * @param[in/out] ivt_buffer is a pointer to an IVT buffer
+ * @param[in] size is a size of the buffer pointed to by ivt_buffer
+ * @param[in] timeline_index is an index of a Timeline effect in which to insert the element
+ * @param[in] element is a pointer to an HapticElement2 structure containing the parameters of a Periodic effect, MagSweep effect, or Repeat event to insert into the Timeline effect
+ * @return if it succeed, it return HAPTIC_S_SUCCESS, otherwise negative value return
+ * @par Example:
+ * @code
+ * ...
+ * int status;
+ * HapticElement2 elem1;
+ * elem1.elementtype = HAPTIC_ELEMTYPE_MAGSWEEP;
+ * elem1.time = 0;
+ * elem1.TypeSpecific.magsweep.duration = 2900;
+ * elem1.TypeSpecific.magsweep.magnitude = HAPTIC_MAX_MAGNITUDE;
+ * elem1.TypeSpecific.magsweep.style = HAPTIC_STYLE_SMOOTH;
+ * elem1.TypeSpecific.magsweep.attacktime = 2483;
+ * elem1.TypeSpecific.magsweep.attacklevel = 0;
+ * elem1.TypeSpecific.magsweep.fadetime = 0;
+ * elem1.TypeSpecific.magsweep.fadelevel = HAPTIC_MAX_MAGNITUDE;
+ *
+ * status = device_haptic_insert_element2(temp_buffer, temp_size, timeline_index, &elem1);
+ * if (status < 0) {
+ * return status;
+ * }
+
+ * ...
+ * @endcode
+ */
+
+ int device_haptic_insert_element2(unsigned char *ivt_buffer, int size, int timeline_index, const HapticElement2 *element);
+
+/**
+ * @fn int device_haptic_insert_element3(unsigned char *ivt_buffer, int size, int timeline_index, const HapticElement3 *element)
+ * @par Description:
+ * This API inserts an element into a Timeline effect in an IVT buffer.\n
+ * @param[in/out] ivt_buffer is a pointer to an IVT buffer
+ * @param[in] size is a size of the buffer pointed to by ivt_buffer
+ * @param[in] timeline_index is an index of a Timeline effect in which to insert the element
+ * @param[in] element is a pointer to an HapticElement3 structure containing the parameters of a Periodic effect, MagSweep effect, or Repeat event to insert into the Timeline effect
+ * @return if it succeed, it return HAPTIC_S_SUCCESS, otherwise negative value return
+ * @par Example:
+ * @code
+ * ...
+ * int status;
+ * HapticElement3 elem1;
+ * elem1.elementtype = HAPTIC_ELEMTYPE_MAGSWEEP;
+ * elem1.time = 0;
+ * elem1.TypeSpecific.magsweep.duration = 2900;
+ * elem1.TypeSpecific.magsweep.magnitude = HAPTIC_MAX_MAGNITUDE;
+ * elem1.TypeSpecific.magsweep.style = HAPTIC_STYLE_SMOOTH;
+ * elem1.TypeSpecific.magsweep.attacktime = 2483;
+ * elem1.TypeSpecific.magsweep.attacklevel = 0;
+ * elem1.TypeSpecific.magsweep.fadetime = 0;
+ * elem1.TypeSpecific.magsweep.fadelevel = HAPTIC_MAX_MAGNITUDE;
+ *
+ * status = device_haptic_insert_element3(temp_buffer, temp_size, 0, &elem1);
+ * if (status < 0) {
+ * return status;
+ * }
+
+ * ...
+ * @endcode
+ */
+
+ int device_haptic_insert_element3(unsigned char *ivt_buffer, int size, int timeline_index, const HapticElement3 *element);
+
+/**
+ * @fn int device_haptic_read_element(const unsigned char *ivt_buffer, int size, int timeline_index, int element_index, HapticElement *element);
+ * @par Description:
+ * This API retrieves the parameters of an element of a Timeline effect in an IVT buffer.\n
+ * @param[in/out] ivt_buffer is a pointer to an IVT buffer
+ * @param[in] size is a size of the buffer pointed to by ivt_buffer
+ * @param[in] timeline_index is an index of a Timeline effect in which to read the element
+ * @param[in] element_index is an index of the element to retrieve
+ * @param[out] element is a pointer to an HapticElement structure to receive the parameters of a Periodic effect, MagSweepeffect, or Repeat event
+ * @return if it succeed, it return HAPTIC_S_SUCCESS, otherwise negative value return
+ * @par Example:
+ * @code
+ * ...
+ * int status;
+ * HapticElement elem1;
+ *
+ * status = device_haptic_insert_element(ivt_buffer, size, 0, 0, &elem1);
+ * if (status < 0) {
+ * return status;
+ * }
+
+ * ...
+ * @endcode
+ */
+
+
+ int device_haptic_read_element(const unsigned char *ivt_buffer, int size, int timeline_index, int element_index, HapticElement *element);
+
+/**
+ * @fn int device_haptic_read_element2(const unsigned char *ivt_buffer, int size, int timeline_index, int element_index, HapticElement2 *element);
+ * @par Description:
+ * This API retrieves the parameters of an element of a Timeline effect in an IVT buffer.\n
+ * @param[in/out] ivt_buffer is a pointer to an IVT buffer
+ * @param[in] size is a size of the buffer pointed to by ivt_buffer
+ * @param[in] timeline_index is an index of a Timeline effect in which to read the element
+ * @param[in] element_index is an index of the element to retrieve
+ * @param[out] element is a pointer to an HapticElement2 structure to receive the parameters of a Periodic effect, MagSweepeffect, or Repeat event
+ * @return if it succeed, it return HAPTIC_S_SUCCESS, otherwise negative value return
+ * @par Example:
+ * @code
+ * ...
+ * int status;
+ * HapticElement2 elem1;
+ *
+ * status = device_haptic_insert_element2(ivt_buffer, size, 0, 0, &elem1);
+ * if (status < 0) {
+ * return status;
+ * }
+
+ * ...
+ * @endcode
+ */
+
+ int device_haptic_read_element2(const unsigned char *ivt_buffer, int size, int timeline_index, int element_index, HapticElement2 *element);
+
+/**
+ * @fn int device_haptic_read_element3(const unsigned char *ivt_buffer, int size, int timeline_index, int element_index, HapticElement3 *element);
+ * @par Description:
+ * This API retrieves the parameters of an element of a Timeline effect in an IVT buffer.\n
+ * @param[in/out] ivt_buffer is a pointer to an IVT buffer
+ * @param[in] size is a size of the buffer pointed to by ivt_buffer
+ * @param[in] timeline_index is an index of a Timeline effect in which to read the element
+ * @param[in] element_index is an index of the element to retrieve
+ * @param[out] element is a pointer to an HapticElement3 structure to receive the parameters of a Periodic effect, MagSweepeffect, or Repeat event
+ * @return if it succeed, it return HAPTIC_S_SUCCESS, otherwise negative value return
+ * @par Example:
+ * @code
+ * ...
+ * int status;
+ * HapticElement3 elem1;
+ *
+ * status = device_haptic_insert_element3(ivt_buffer, size, 0, 0, &elem1);
+ * if (status < 0) {
+ * return status;
+ * }
+
+ * ...
+ * @endcode
+ */
+
+ int device_haptic_read_element3(const unsigned char *ivt_buffer, int size, int timeline_index, int element_index, HapticElement3 *element);
+
+/**
+ * @fn int device_haptic_remove_element(unsigned char *ivt_buffer, int size, int timeline_index, int element_index);
+ * @par Description:
+ * This API removes the element at the specified index from a Timeline effect in an IVT buffer.\n
+ * @param[in/out] ivt_buffer is a pointer to an IVT buffer
+ * @param[in] size is a size of the buffer pointed to by ivt_buffer
+ * @param[in] timeline_index is an index of a Timeline effect to remove the element from
+ * @param[in] element_index is an index of the element to remove
+ * @return if it succeed, it return HAPTIC_S_SUCCESS, otherwise negative value return
+ * @par Example:
+ * @code
+ * ...
+ * int status;
+ * HapticElement3 elem1;
+ *
+ * status = device_haptic_remove_element(ivt_buffer, size, 0, 0);
+ * if (status < 0) {
+ * return status;
+ * }
+
+ * ...
+ * @endcode
+ */
+
+ int device_haptic_remove_element(unsigned char *ivt_buffer, int size, int timeline_index, int element_index);
+
+
+/**
+ * @}
+ */
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* __DEVMAN_HAPTIC_EXT_H__ */
--- /dev/null
+/*\r
+ * devman\r
+ * Copyright (c) 2012 Samsung Electronics Co., Ltd.\r
+ *\r
+ * Licensed under the Apache License, Version 2.0 (the License);\r
+ * you may not use this file except in compliance with the License.\r
+ * You may obtain a copy of the License at\r
+ *\r
+ * http://www.apache.org/licenses/LICENSE-2.0\r
+ *\r
+ * Unless required by applicable law or agreed to in writing, software\r
+ * distributed under the License is distributed on an "AS IS" BASIS,\r
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ * See the License for the specific language governing permissions and\r
+ * limitations under the License.\r
+ */\r
+\r
+\r
+#ifndef __DEVMAN_HAPTIC_EXT_CORE_H__\r
+#define __DEVMAN_HAPTIC_EXT_CORE_H__\r
+\r
+#include <sys/types.h>\r
+#include <limits.h>\r
+\r
+#ifdef __cplusplus\r
+extern "C" {\r
+#endif\r
+\r
+/**\r
+ * @file devman_haptic_ext_core.h\r
+ * @ingroup DEVICE_MANAGER\r
+ * @brief This file contains the data type, structure and definitions of the haptic extra API\r
+ * @author SLP2.0\r
+ * @date 2010-01-24\r
+ * @version 0.1\r
+ */\r
+\r
+/**\r
+ * @addtogroup DEVICE_MANAGER\r
+ * @{\r
+ */\r
+\r
+/**\r
+ * @par Description:\r
+ * Data types level for haptic extra functions.\r
+ */\r
+#define HAPTIC_MAX_MAGNITUDE 10000 /*!< Maximum Force Magnitude */\r
+#define HAPTIC_MIN_MAGNITUDE 0 /*!< Minimum Force Magnitude */\r
+\r
+/**\r
+ * @par Description:\r
+ * Data types level for haptic extra functions.\r
+ */\r
+#define HAPTIC_MAX_EFFECT_NAME_LENGTH 128 /*!< Maximum effect name length */\r
+#define HAPTIC_INVALID_INDEX -1 /*!< Invalid Index */\r
+\r
+/* DevicePropertyType */\r
+#define HAPTIC_DEVPROPTYPE_PRIORITY 1 /*!< Property type constant to set device priority */\r
+#define HAPTIC_DEVPROPTYPE_DISABLE_EFFECTS 2 /*!< Property type constant to enable/disable effects on a device */\r
+#define HAPTIC_DEVPROPTYPE_STRENGTH 3 /*!< Property type constant to set the strength (volume) on a device */\r
+#define HAPTIC_DEVPROPTYPE_MASTERSTRENGTH 4 /*!< Property type constant to set the strength (volume) on ALL devices */\r
+\r
+/* Device type returned by device_haptic_get_device_capability_int32 in 'xxxx' field of\r
+ 'yyyy' struct for 'deviceCapabilityType' equal to\r
+ HAPTIC_DEVCAPTYPE_DEVICE_CATEGORY */\r
+#define HAPTIC_DEVICECATEGORY_IFC 0 /*!< Device category constant for IFC Devices */\r
+#define HAPTIC_DEVICECATEGORY_IMPULSE 1 /*!< Device category constant for Impulse Devices */\r
+#define HAPTIC_DEVICECATEGORY_VIRTUAL 2 /*!< Device category constant for Virtual Devices */\r
+#define HAPTIC_DEVICECATEGORY_EMBEDDED 3 /*!< Device category constant for Embedded Devices */\r
+#define HAPTIC_DEVICECATEGORY_TETHERED 4 /*!< Device category constant for Tethered Devices */\r
+#define HAPTIC_DEVICECATEGORY_IMMERSION_USB 5 /*!< Device category constant for Immersion USB Devices */\r
+#define HAPTIC_DEVICECATEGORY_COMPOSITE 6 /*!< Device category constant for Composite Devices */\r
+\r
+/* Effect type returned by device_haptic_get_IVT_effect_type */\r
+#define HAPTIC_EFFECT_TYPE_PERIODIC 0 /*!< Periodic Effect type constant */\r
+#define HAPTIC_EFFECT_TYPE_MAGSWEEP 1 /*!< Magsweep Effect type constant */\r
+#define HAPTIC_EFFECT_TYPE_TIMELINE 2 /*!< Timeline Effect type constant */\r
+#define HAPTIC_EFFECT_TYPE_STREAMING 3 /*!< Streaming Effect type constant */\r
+#define HAPTIC_EFFECT_TYPE_WAVEFORM 4 /*!< Waveform Effect type constant */\r
+\r
+/* Device capability type passed as input 'deviceCapabilityType' argument to device_haptic_get_device_capability_... */\r
+#define HAPTIC_DEVCAPTYPE_DEVICE_CATEGORY 0 /*!< Use device_haptic_get_device_capability_int32 >*/\r
+#define HAPTIC_DEVCAPTYPE_MAX_NESTED_REPEATS 1 /*!< Use device_haptic_get_device_capability_int32 */\r
+#define HAPTIC_DEVCAPTYPE_NUM_ACTUATORS 2 /*!< Use device_haptic_get_device_capability_int32 */\r
+#define HAPTIC_DEVCAPTYPE_ACTUATOR_TYPE 3 /*!< Use device_haptic_get_device_capability_int32 */\r
+#define HAPTIC_DEVCAPTYPE_NUM_EFFECT_SLOTS 4 /*!< Use device_haptic_get_device_capability_int32 */\r
+#define HAPTIC_DEVCAPTYPE_SUPPORTED_STYLES 5 /*!< Use device_haptic_get_device_capability_int32 */\r
+/* HAPTIC_DEVCAPTYPE_SUPPORTED_CONTROL_MODES is deprecated and will not be an available constant\r
+** in future versions of this software. Please use HAPTIC_DEVCAPTYPE_SUPPORTED_STYLES instead. */\r
+#define HAPTIC_DEVCAPTYPE_SUPPORTED_CONTROL_MODES HAPTIC_DEVCAPTYPE_SUPPORTED_STYLES\r
+#define HAPTIC_DEVCAPTYPE_MIN_PERIOD 6 /*!< Use device_haptic_get_device_capability_int32 */\r
+#define HAPTIC_DEVCAPTYPE_MAX_PERIOD 7 /*!< Use device_haptic_get_device_capability_int32 */\r
+#define HAPTIC_DEVCAPTYPE_MAX_EFFECT_DURATION 8 /*!< Use device_haptic_get_device_capability_int32 */\r
+#define HAPTIC_DEVCAPTYPE_SUPPORTED_EFFECTS 9 /*!< Use device_haptic_get_device_capability_int32 */\r
+#define HAPTIC_DEVCAPTYPE_DEVICE_NAME 10 /*!< Use device_haptic_get_device_capability_string */\r
+#define HAPTIC_DEVCAPTYPE_MAX_ENVELOPE_TIME 11 /*!< Use device_haptic_get_device_capability_int32 */\r
+#define HAPTIC_DEVCAPTYPE_APIVERSIONNUMBER 12 /*!< Use device_haptic_get_device_capability_int32 */\r
+#define HAPTIC_DEVCAPTYPE_MAX_IVT_SIZE_TETHERED 13 /*!< Use device_haptic_get_device_capability_int32 */\r
+#define HAPTIC_DEVCAPTYPE_MAX_IVT_SIZE 14 /*!< Use device_haptic_get_device_capability_int32 */\r
+#define HAPTIC_DEVCAPTYPE_EDITION_LEVEL 15 /*!< Use device_haptic_get_device_capability_int32 */\r
+#define HAPTIC_DEVCAPTYPE_SUPPORTED_WAVE_TYPES 16 /*!< Use device_haptic_get_device_capability_int32 */\r
+#define HAPTIC_DEVCAPTYPE_HANDSET_INDEX 17 /*!< Use device_haptic_get_device_capability_int32 */\r
+\r
+/* Handles */\r
+#define HAPTIC_INVALID_EFFECT_HANDLE_VALUE -1 /*!< Invalid Effect Handle */\r
+#define HAPTIC_INVALID_DEVICE_HANDLE_VALUE -1 /*!< Invalid Device Handle */\r
+\r
+/* Periodic, MagSweep effect Styles are only 4 bits and may be combined with other flags */\r
+#define HAPTIC_STYLE_MASK 0x0F /*!< Style mask */\r
+\r
+/* Periodic, MagSweep effect Styles */\r
+#define HAPTIC_STYLE_SMOOTH 0 /*!< "Smooth" style */\r
+#define HAPTIC_STYLE_STRONG 1 /*!< "Strong" style */\r
+#define HAPTIC_STYLE_SHARP 2 /*!< "Sharp" style */\r
+\r
+#define HAPTIC_DEFAULT_STYLE HAPTIC_STYLE_STRONG\r
+\r
+/* HAPTIC_CONTROLMODE_ constants are deprecated and will not be available\r
+** in future versions of this software. Please use the HAPTIC_STYLE_ constants instead. */\r
+#define HAPTIC_CONTROLMODE_SMOOTH HAPTIC_STYLE_SMOOTH\r
+#define HAPTIC_CONTROLMODE_STRONG HAPTIC_STYLE_STRONG\r
+#define HAPTIC_CONTROLMODE_SHARP HAPTIC_STYLE_SHARP\r
+\r
+#define HAPTIC_DEFAULT_CONTROLMODE HAPTIC_DEFAULT_STYLE\r
+\r
+/* Effect period resolution */\r
+#define HAPTIC_PERIOD_RESOLUTION_MICROSECOND 0x80000000\r
+\r
+/* Periodic effect Wave Types are only 4 bits and may be combined with other flags */\r
+#define HAPTIC_WAVETYPE_SHIFT 4 /*!< Wave type shift */\r
+#define HAPTIC_WAVETYPE_MASK 0xF0 /*!< Wave type mask */\r
+\r
+/* Periodic effect Wave Types */\r
+#define HAPTIC_WAVETYPE_SQUARE (1 << HAPTIC_WAVETYPE_SHIFT) /*!< "Square" wave type */\r
+#define HAPTIC_WAVETYPE_TRIANGLE (2 << HAPTIC_WAVETYPE_SHIFT) /*!< "Triangle" wave type */\r
+#define HAPTIC_WAVETYPE_SINE (3 << HAPTIC_WAVETYPE_SHIFT) /*!< "Sine" wave type */\r
+#define HAPTIC_WAVETYPE_SAWTOOTHUP (4 << HAPTIC_WAVETYPE_SHIFT) /*!< "Sawtooth Up" wave type */\r
+#define HAPTIC_WAVETYPE_SAWTOOTHDOWN (5 << HAPTIC_WAVETYPE_SHIFT) /*!< "Sawtooth Down" wave type */\r
+\r
+#define HAPTIC_DEFAULT_WAVETYPE HAPTIC_WAVETYPE_SQUARE\r
+\r
+/* String length constants */\r
+#define HAPTIC_MAX_DEVICE_NAME_LENGTH 64 /*!<Maximum device name length */\r
+#define HAPTIC_MAX_CAPABILITY_STRING_LENGTH 64 /*!<Maximum string length use by device_haptic_get_device_capability_string/ device_haptic_set_device_capability_string*/\r
+#define HAPTIC_MAX_PROPERTY_STRING_LENGTH 64 /*!<Maximum string length use by device_haptic_get_device_property_string/ device_haptic_set_device_property_string */\r
+\r
+/* Effect type support bit masks */\r
+#define HAPTIC_PERIODIC_EFFECT_SUPPORT (1 << HAPTIC_EFFECT_TYPE_PERIODIC) /*!< Bitmask for Periodic effect support */\r
+#define HAPTIC_MAGSWEEP_EFFECT_SUPPORT (1 << HAPTIC_EFFECT_TYPE_MAGSWEEP) /*!< Bitmask for Magsweep effect support */\r
+#define HAPTIC_TIMELINE_EFFECT_SUPPORT (1 << HAPTIC_EFFECT_TYPE_TIMELINE) /*!< Bitmask for Timeline effect support */\r
+#define HAPTIC_STREAMING_EFFECT_SUPPORT (1 << HAPTIC_EFFECT_TYPE_STREAMING) /*!< Bitmask for Streaming effect support */\r
+#define HAPTIC_WAVEFORM_EFFECT_SUPPORT (1 << HAPTIC_EFFECT_TYPE_WAVEFORM) /*!< Bitmask for Waveform effect support */\r
+\r
+/* Effect Style support bit masks */\r
+#define HAPTIC_STYLE_SUPPORT_MASK 0x0000FFFF /*!< Effect style support mask */\r
+#define HAPTIC_STYLE_SMOOTH_SUPPORT (1 << HAPTIC_STYLE_SMOOTH) /*!< Bitmask for "Smooth" style support */\r
+#define HAPTIC_STYLE_STRONG_SUPPORT (1 << HAPTIC_STYLE_STRONG) /*!< Bitmask for "Strong" style support */\r
+#define HAPTIC_STYLE_SHARP_SUPPORT (1 << HAPTIC_STYLE_SHARP) /*!< Bitmask for "Sharp" style support */\r
+\r
+/* Wave type support bit masks */\r
+/* Starts at 0x10000 to allow combining the flag with the supported style (nControlMode) 32 bits flag */\r
+#define HAPTIC_WAVETYPE_SUPPORT_MASK 0xFFFF0000 /*!< Wave type support mask */\r
+#define HAPTIC_WAVETYPE_SQUARE_SUPPORT (0x10000 << (HAPTIC_WAVETYPE_SQUARE >> HAPTIC_WAVETYPE_SHIFT)) /*!< Bitmask for "Square" wave type support */\r
+#define HAPTIC_WAVETYPE_TRIANGLE_SUPPORT (0x10000 << (HAPTIC_WAVETYPE_TRIANGLE >> HAPTIC_WAVETYPE_SHIFT)) /*!< Bitmask for "Triangle" wave type support */\r
+#define HAPTIC_WAVETYPE_SINE_SUPPORT (0x10000 << (HAPTIC_WAVETYPE_SINE >> HAPTIC_WAVETYPE_SHIFT)) /*!< Bitmask for "Sine" wave type support */\r
+#define HAPTIC_WAVETYPE_SAWTOOTHUP_SUPPORT (0x10000 << (HAPTIC_WAVETYPE_SAWTOOTHUP >> HAPTIC_WAVETYPE_SHIFT)) /*!< Bitmask for "Saw tooth up" wave type support */\r
+#define HAPTIC_WAVETYPE_SAWTOOTHDOWN_SUPPORT (0x10000 << (HAPTIC_WAVETYPE_SAWTOOTHDOWN >> HAPTIC_WAVETYPE_SHIFT)) /*!< Bitmask for "Saw tooth down" wave type support */\r
+\r
+/* HAPTIC_CONTROLMODE_*_SUPPORT constants are deprecated and will not be available\r
+** in future versions of this software. Please use the HAPTIC_STYLE_*_SUPPORT constants instead. */\r
+#define HAPTIC_CONTROLMODE_SMOOTH_SUPPORT HAPTIC_STYLE_SMOOTH_SUPPORT\r
+#define HAPTIC_CONTROLMODE_STRONG_SUPPORT HAPTIC_STYLE_STRONG_SUPPORT\r
+#define HAPTIC_CONTROLMODE_SHARP_SUPPORT HAPTIC_STYLE_SHARP_SUPPORT\r
+\r
+/* Device State constants */\r
+#define HAPTIC_DEVICESTATE_ATTACHED (1 << 0) /*!< Device is attached to the system */\r
+#define HAPTIC_DEVICESTATE_BUSY (1 << 1) /*!< Device is busy (playing effects) */\r
+\r
+/* Time in milliseconds */\r
+#define HAPTIC_TIME_INFINITE LONG_MAX /*!< Infinite time */\r
+\r
+/* Effect priority */\r
+#define HAPTIC_MIN_DEVICE_PRIORITY 0x0 /*!< Minimum Effect priority */\r
+#define HAPTIC_MAX_DEV_DEVICE_PRIORITY 0x7 /*!< Maximum Effect priority for developers */\r
+#define HAPTIC_MAX_OEM_DEVICE_PRIORITY 0xF /*!< Maximum Effect priority for OEMs */\r
+#define HAPTIC_MAX_DEVICE_PRIORITY HAPTIC_MAX_OEM_DEVICE_PRIORITY /*!< FOR BACKWARD COMPATIBILITY ONLY;\r
+ new applications should use HAPTIC_MAX_DEV_DEVICE_PRIORITY\r
+ or HAPTIC_MAX_OEM_DEVICE_PRIORITY */\r
+\r
+\r
+/* Device Actuator Type constants */\r
+#define HAPTIC_DEVACTUATORTYPE_ERM 0\r
+#define HAPTIC_DEVACTUATORTYPE_BLDC 1\r
+#define HAPTIC_DEVACTUATORTYPE_LRA 2\r
+#define HAPTIC_DEVACTUATORTYPE_PIEZO 4\r
+#define HAPTIC_DEVACTUATORTYPE_PIEZO_WAVE 4\r
+\r
+/* Device Default priority value */\r
+#define HAPTIC_DEVPRIORITY_DEFAULT 0\r
+\r
+/* Repeat count */\r
+#define HAPTIC_REPEAT_COUNT_INFINITE 255 /*!< Infinite repeat count */\r
+\r
+/* Streaming Sample */\r
+#define HAPTIC_MAX_STREAMING_SAMPLE_SIZE 255 /*!< Maximum size for streaming sample */\r
+\r
+/* Effect state returned by ImmVibeGetEffectState */\r
+#define HAPTIC_EFFECT_STATE_NOT_PLAYING 0 /*!< Not Playing and not paused */\r
+#define HAPTIC_EFFECT_STATE_PLAYING 1 /*!< Playing */\r
+#define HAPTIC_EFFECT_STATE_PAUSED 2 /*!< Paused */\r
+\r
+/* Edition levels */\r
+#define HAPTIC_EDITION_3000 3000\r
+#define HAPTIC_EDITION_4000 4000\r
+#define HAPTIC_EDITION_5000 5000\r
+\r
+/* Element type for IVTElement structure that is used by ImmVibeInsertIVTElement, ImmVibeReadIVTElement and ImmVibeRemoveIVTElement */\r
+#define HAPTIC_ELEMTYPE_PERIODIC 0\r
+#define HAPTIC_ELEMTYPE_MAGSWEEP 1\r
+#define HAPTIC_ELEMTYPE_REPEAT 2\r
+/* New in API v3.4 */\r
+#define HAPTIC_ELEMTYPE_WAVEFORM 3\r
+\r
+/* Composite device */\r
+#define HAPTIC_MAX_LOGICAL_DEVICE_COUNT 16 /*!< Maximum number of device indices that can be passed to ImmVibeOpenCompositeDevice */\r
+\r
+/****************************************************************************\r
+ *\r
+ * General macros\r
+ *\r
+ ****************************************************************************/\r
+#define HAPTIC_SUCCEEDED(n) ((n) >= 0)\r
+#define HAPTIC_FAILED(n) ((n) < 0)\r
+#define HAPTIC_IS_INVALID_DEVICE_HANDLE(n) (((n) == 0) || ((n) == HAPTIC_INVALID_DEVICE_HANDLE_VALUE))\r
+#define HAPTIC_IS_INVALID_EFFECT_HANDLE(n) (((n) == 0) || ((n) == HAPTIC_INVALID_EFFECT_HANDLE_VALUE))\r
+#define HAPTIC_IS_VALID_DEVICE_HANDLE(n) (((n) != 0) && ((n) != HAPTIC_INVALID_DEVICE_HANDLE_VALUE))\r
+#define HAPTIC_IS_VALID_EFFECT_HANDLE(n) (((n) != 0) && ((n) != HAPTIC_INVALID_EFFECT_HANDLE_VALUE))\r
+\r
+/****************************************************************************\r
+ *\r
+ * Error and Return value codes.\r
+ *\r
+ ****************************************************************************/\r
+#define HAPTIC_S_SUCCESS 0 /*!< Success */\r
+#define HAPTIC_S_FALSE 0 /*!< False */\r
+#define HAPTIC_S_TRUE 1 /*!< True */\r
+#define HAPTIC_W_NOT_PLAYING 1 /*!< Effect is not playing */\r
+#define HAPTIC_W_INSUFFICIENT_PRIORITY 2 /*!< Effect doesn't have enough priority to play: higher priority effect is playing on the device */\r
+#define HAPTIC_W_EFFECTS_DISABLED 3 /*!< Effects are disabled on the device */\r
+#define HAPTIC_W_NOT_PAUSED 4 /*!< The ImmVibeResumePausedEffect function cannot resume an effect that is not paused */\r
+#define HAPTIC_E_NOT_INITIALIZED -2 /*!< The API is already is not initialized */\r
+#define HAPTIC_E_INVALID_ARGUMENT -3 /*!< Invalid argument was used in a API function call */\r
+#define HAPTIC_E_FAIL -4 /*!< Generic error */\r
+#define HAPTIC_E_INCOMPATIBLE_EFFECT_TYPE -5 /*!< Incompatible Effect type has been passed into API function call */\r
+#define HAPTIC_E_INCOMPATIBLE_CAPABILITY_TYPE -6 /*!< Incompatible Capability type was used into one of the following functions */\r
+#define HAPTIC_E_INCOMPATIBLE_PROPERTY_TYPE -7 /*!< Incompatible Property type was used into one of the following functions */\r
+#define HAPTIC_E_DEVICE_NEEDS_LICENSE -8 /*!< Access to the instance of the device is locked until a valid license key is provided. */\r
+#define HAPTIC_E_NOT_ENOUGH_MEMORY -9 /*!< The API function cannot allocate memory to complete the process */\r
+#define HAPTIC_E_SERVICE_NOT_RUNNING -10 /*!< ImmVibeService is not running */\r
+#define HAPTIC_E_INSUFFICIENT_PRIORITY -11 /*!< Not enough priority to achieve the request (insufficient license key priority) */\r
+#define HAPTIC_E_SERVICE_BUSY -12 /*!< ImmVibeService is busy and failed to complete the request */\r
+#define HAPTIC_E_NOT_SUPPORTED -13 /*!< The API function is not supported by this version of the API */\r
+\r
+/****************************************************************************\r
+ *\r
+ * Stuctures\r
+ *\r
+ ****************************************************************************/\r
+typedef struct\r
+{\r
+ int duration;\r
+ int magnitude;\r
+ int period;\r
+ int style;\r
+ int attacktime;\r
+ int attacklevel;\r
+ int fadetime;\r
+ int fadelevel;\r
+} HapticPeriodic;\r
+\r
+typedef struct\r
+{\r
+ int duration;\r
+ int magnitude;\r
+ int period;\r
+ int style;\r
+ int attacktime;\r
+ int attacklevel;\r
+ int fadetime;\r
+ int fadelevel;\r
+ int actuatorindex;\r
+} HapticPeriodic2;\r
+\r
+typedef struct\r
+{\r
+ int duration;\r
+ int magnitude;\r
+ int style;\r
+ int attacktime;\r
+ int attacklevel;\r
+ int fadetime;\r
+ int fadelevel;\r
+} HapticMagSweep;\r
+\r
+typedef struct\r
+{\r
+ int duration;\r
+ int magnitude;\r
+ int style;\r
+ int attacktime;\r
+ int attacklevel;\r
+ int fadetime;\r
+ int fadelevel;\r
+ int actuatorindex;\r
+} HapticMagSweep2;\r
+\r
+typedef struct\r
+{\r
+ int count;\r
+ int duration;\r
+} HapticRepeat;\r
+\r
+typedef struct\r
+{\r
+ const unsigned char *data;\r
+ int datasize;\r
+ int samplingrate;\r
+ int bitdepth;\r
+ int magnitude;\r
+ int actuatorindex;\r
+} HapticWaveform;\r
+\r
+typedef struct\r
+{\r
+ int elementtype;\r
+ int time;\r
+ union\r
+ {\r
+ HapticPeriodic periodic;\r
+ HapticMagSweep magsweep;\r
+ HapticRepeat repeat;\r
+ } TypeSpecific;\r
+} HapticElement;\r
+\r
+typedef struct\r
+{\r
+ int elementtype;\r
+ int time;\r
+ union\r
+ {\r
+ HapticPeriodic2 periodic;\r
+ HapticMagSweep2 magsweep;\r
+ HapticRepeat repeat;\r
+ } TypeSpecific;\r
+} HapticElement2;\r
+\r
+typedef struct\r
+{\r
+ int elementtype;\r
+ int time;\r
+ union\r
+ {\r
+ HapticPeriodic2 periodic;\r
+ HapticMagSweep2 magsweep;\r
+ HapticRepeat repeat;\r
+ HapticWaveform waveform;\r
+ } TypeSpecific;\r
+} HapticElement3;\r
+\r
+#ifdef __cplusplus\r
+}\r
+#endif\r
+#endif /* __DEVMAN_HAPTIC_EXT_CORE_H__ */\r
--- /dev/null
+/*
+ * devman
+ * 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.
+ */
+
+
+#ifndef __DEVMAN_IMAGE_H__
+#define __DEVMAN_IMAGE_H__
+
+/**
+ * @file devman_image.h
+ * @defgroup devman_image Definitions of managed api set
+ * @ingroup DEVICE_MANAGER_MANAGED
+ * @brief This file contains the definitions of managed API for devices
+ * @details define functions that control enhance mode and haptic device
+ * @author Tizen2.0
+ * @date 2010-06-26
+ * @version 0.1
+ */
+
+// This file will be deprecated
+#include "devman.h"
+
+#endif /* __DEVMAN_IMAGE_H__ */
--- /dev/null
+/*
+ * devman
+ * 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.
+ */
+
+
+#ifndef API
+#define API __attribute__ ((visibility("default")))
+#endif
+
+#define DISPLAY_WD_FIFO "/tmp/.display_wd"
+#define DISPLAY_WD_CANCEL 226235
+
+int display_register_postjob(void);
+int display_cancel_postjob(void);
+
--- /dev/null
+/*
+ * devman
+ * 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.
+ */
+
+
+#ifndef __DEVMAN_MANAGED_H__
+#define __DEVMAN_MANAGED_H__
+
+/**
+ * @file devman_managed.h
+ * @defgroup devman_managed Definitions of managed api set
+ * @ingroup DEVICE_MANAGER_MANAGED
+ * @brief This file contains the definitions of managed API for devices
+ * @details define functions that control enhance mode and haptic device
+ * @author Tizen2.0
+ * @date 2010-06-26
+ * @version 0.1
+ */
+
+// This file will be deprecated
+#include "devman.h"
+
+#endif /* __DEVMAN_MANAGED_H__ */
--- /dev/null
+/*
+ * devman
+ * 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.
+ */
+
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <string.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <vconf.h>
+
+#include "devlog.h"
+#include "devman_haptic.h"
+#include "devman_haptic_ext_core.h"
+
+#ifndef EXTAPI
+#define EXTAPI __attribute__ ((visibility("default")))
+#endif /* EXTAPI */
+
+/* START: devman_haptic APIs */
+EXTAPI
+int device_haptic_open(haptic_dev_idx dev_idx, unsigned int mode)
+{
+ DEVERR("This api was deprecated, you have to use libhaptic.");
+ return HAPTIC_FAIL;
+}
+
+EXTAPI
+int device_haptic_close(int device_handle)
+{
+
+ DEVERR("This api was deprecated, you have to use libhaptic.");
+ return HAPTIC_FAIL;
+}
+
+EXTAPI
+int device_haptic_play_buffer(int device_handle, const unsigned char *vibe_buffer, int iteration, int feedback_level)
+{
+ DEVERR("This api was deprecated, you have to use libhaptic.");
+ return HAPTIC_FAIL;
+}
+
+EXTAPI
+int device_haptic_play_file(int device_handle, const char *file_name, int iteration, int feedback_level)
+{
+ DEVERR("This api was deprecated, you have to use libhaptic.");
+ return HAPTIC_FAIL;
+}
+
+EXTAPI
+int device_haptic_play_file_with_priority(int device_handle, const char *file_name, int priority_level, int iteration, int feedback_level)
+{
+ DEVERR("This api was deprecated, you have to use libhaptic.");
+ return HAPTIC_FAIL;
+}
+
+EXTAPI
+int device_haptic_play_pattern(int device_handle, int pattern, int iteration, int feedback_level)
+{
+ DEVERR("This api was deprecated, you have to use libhaptic.");
+ return HAPTIC_FAIL;
+}
+
+EXTAPI
+int device_haptic_stop_play(int device_handle)
+{
+ DEVERR("This api was deprecated, you have to use libhaptic.");
+ return HAPTIC_FAIL;
+}
+
+EXTAPI
+int device_haptic_play_monotone(int device_handle, int duration)
+{
+ DEVERR("This api was deprecated, you have to use libhaptic.");
+ return HAPTIC_FAIL;
+}
+
+EXTAPI
+int device_haptic_play_monotone_with_feedback_level(int device_handle, int duration, int feedback_level)
+{
+ DEVERR("This api was deprecated, you have to use libhaptic.");
+ return HAPTIC_FAIL;
+}
+
+EXTAPI
+int device_haptic_play_monotone_with_detail_feedback_level(int device_handle, int duration, int detail_feedback_level)
+{
+ DEVERR("This api was deprecated, you have to use libhaptic.");
+ return HAPTIC_FAIL;
+}
+
+EXTAPI
+int device_haptic_get_buffer_duration(int device_handle, const unsigned char *vibe_buffer, int *duration)
+{
+ DEVERR("This api was deprecated, you have to use libhaptic.");
+ return HAPTIC_FAIL;
+}
+
+EXTAPI
+int device_haptic_get_file_duration(int device_handle, const char *file_name, int *duration)
+{
+ DEVERR("This api was deprecated, you have to use libhaptic.");
+ return HAPTIC_FAIL;
+}
+
+EXTAPI
+int device_haptic_get__duration(int device_handle, int pattern, int *duration)
+{
+ DEVERR("This api was deprecated, you have to use libhaptic.");
+ return HAPTIC_FAIL;
+}
+
+EXTAPI
+int device_haptic_get_device_count()
+{
+ DEVERR("This api was deprecated, you have to use libhaptic.");
+ return HAPTIC_FAIL;
+}
+/* END: devman_haptic APIs */
+
+
+/* START: devman_haptic_ext APIs */
+EXTAPI
+int device_haptic_get_device_state(int device_index, int *state)
+{
+ return HAPTIC_SUCCESS;
+}
+
+EXTAPI
+int device_haptic_get_device_capability_bool(int device_index, int device_cap_type, unsigned char *device_cap_value)
+{
+ return HAPTIC_SUCCESS;
+}
+
+EXTAPI
+int device_haptic_get_device_capability_int32(int device_index, int device_cap_type, int *device_cap_value)
+{
+ return HAPTIC_SUCCESS;
+}
+
+EXTAPI
+int device_haptic_get_device_capability_string(int device_index, int device_cap_type, int size, char *device_cap_value)
+{
+ return HAPTIC_SUCCESS;
+}
+
+EXTAPI
+int device_haptic_get_device_property_bool(int device_handle, int device_prop_type, unsigned char *device_prop_value)
+{
+ return HAPTIC_SUCCESS;
+}
+
+EXTAPI
+int device_haptic_set_device_property_bool(int device_handle, int device_prop_type, unsigned char device_prop_value)
+{
+ return HAPTIC_SUCCESS;
+}
+
+EXTAPI
+int device_haptic_get_device_property_int32(int device_handle, int device_prop_type, int *device_prop_value)
+{
+ return HAPTIC_SUCCESS;
+}
+
+EXTAPI
+int device_haptic_set_device_property_int32(int device_handle, int device_prop_type, int device_prop_value)
+{
+ return HAPTIC_SUCCESS;
+}
+
+EXTAPI
+int device_haptic_get_device_property_string(int device_handle, int device_prop_type, int size, char *device_prop_value)
+{
+ return HAPTIC_SUCCESS;
+}
+
+EXTAPI
+int device_haptic_set_device_property_string(int device_handle, int device_prop_type, const char *device_prop_value)
+{
+ return HAPTIC_SUCCESS;
+}
+
+EXTAPI
+int device_haptic_get_effect_count(const unsigned char *haptic_buffer)
+{
+ return HAPTIC_SUCCESS;
+}
+
+EXTAPI
+int device_haptic_get_effect_name(const unsigned char *haptic_buffer, int effect_index, int size, char *effect_name)
+{
+ return HAPTIC_SUCCESS;
+}
+
+EXTAPI
+int device_haptic_get_effect_name_u(const unsigned char *haptic_buffer, int effect_index, int size, unsigned short *effect_name)
+{
+ return HAPTIC_SUCCESS;
+}
+
+EXTAPI
+int device_haptic_get_effect_index_from_name(const unsigned char *haptic_buffer, char const *effect_name, int *effect_index)
+{
+ return HAPTIC_SUCCESS;
+}
+
+EXTAPI
+int device_haptic_get_effect_index_from_name_u(const unsigned char *haptic_buffer, const unsigned short *effect_name, int *effect_index)
+{
+ return HAPTIC_SUCCESS;
+}
+
+EXTAPI
+int device_haptic_play_effect(int device_handle, const unsigned char *haptic_buffer, int effect_index, int *effect_handle)
+{
+ return HAPTIC_SUCCESS;
+}
+
+EXTAPI
+int device_haptic_play_effect_repeat(int device_handle, const unsigned char *haptic_buffer, int effect_index, unsigned char repeat, int *effect_handle)
+{
+ return HAPTIC_SUCCESS;
+}
+
+EXTAPI
+int device_haptic_stop_playing_effect(int device_handle, int effect_handle)
+{
+ return HAPTIC_SUCCESS;
+}
+
+EXTAPI
+int device_haptic_get_effect_type(const unsigned char *haptic_buffer, int effect_index, int *effect_type)
+{
+ return HAPTIC_SUCCESS;
+}
+
+EXTAPI
+int device_haptic_get_magsweep_effect_definition(const unsigned char *haptic_buffer, int effect_index,
+ int *duration, int *magnitude, int *style, int *attacktime, int *attacklevel,
+ int *fadetime, int *fadelevel)
+{
+ return HAPTIC_SUCCESS;
+}
+
+EXTAPI
+int device_haptic_get_periodic_effect_definition(const unsigned char *haptic_buffer, int effect_index,
+ int *duration, int *magnitude, int *period, int *style_and_wave_type, int *attacktime, int *attacklevel,
+ int *fadetime, int *fadelevel)
+{
+ return HAPTIC_SUCCESS;
+}
+
+EXTAPI
+int device_haptic_get_effect_duration(const unsigned char *haptic_buffer, int effect_index, int *effect_duration)
+{
+ return HAPTIC_SUCCESS;
+}
+
+EXTAPI
+int device_haptic_play_magsweep_effect(int device_handle,
+ int duration, int magnitude, int style, int attacktime, int attacklevel,
+ int fadetime, int fadelevel, int *effect_handle)
+{
+ return HAPTIC_SUCCESS;
+}
+
+EXTAPI
+int device_haptic_play_periodic_effect(int device_handle,
+ int duration, int magnitude, int period, int style_and_wave_type, int attacktime, int attacklevel,
+ int fadetime, int fadelevel, int *effect_handle)
+{
+ return HAPTIC_SUCCESS;
+}
+
+EXTAPI
+int device_haptic_modify_playing_magsweep_effect(int device_handle, int effect_handle,
+ int duration, int magnitude, int style, int attacktime, int attacklevel, int fadetime, int fadelevel)
+{
+ return HAPTIC_SUCCESS;
+}
+
+EXTAPI
+int device_haptic_modify_playing_periodic_effect(int device_handle, int effect_handle,
+ int duration, int magnitude, int period, int style_and_wave_type, int attacktime, int attacklevel, int fadetime, int fadelevel)
+{
+ return HAPTIC_SUCCESS;
+}
+
+EXTAPI
+int device_haptic_create_streaming_effect(int device_handle, int *effect_handle)
+{
+ return HAPTIC_SUCCESS;
+}
+
+EXTAPI
+int device_haptic_destroy_streaming_effect(int device_handle, int effect_handle)
+{
+ return HAPTIC_SUCCESS;
+}
+
+EXTAPI
+int device_haptic_play_streaming_sample(int device_handle, int effect_handle, const unsigned char *streaming_sample, int size)
+{
+ return HAPTIC_SUCCESS;
+}
+
+EXTAPI
+int device_haptic_play_streaming_sample_with_offset(int device_handle, int effect_handle, const unsigned char *streaming_sample, int size, int offset_time)
+{
+ return HAPTIC_SUCCESS;
+}
+
+EXTAPI
+int device_haptic_stop_all_playing_effects(int device_handle)
+{
+ return HAPTIC_SUCCESS;
+}
+
+EXTAPI
+int device_haptic_save_file(const unsigned char *ivt_buffer, int max_bufsize, const char *path_name)
+{
+ return HAPTIC_SUCCESS;
+}
+
+EXTAPI
+int device_haptic_delete_file(const char *path_name)
+{
+ return HAPTIC_SUCCESS;
+}
+
+EXTAPI
+int device_haptic_pause_playing_effect(int device_handle, int effect_handle)
+{
+ return HAPTIC_SUCCESS;
+}
+
+EXTAPI
+int device_haptic_resume_paused_effect(int device_handle, int effect_handle)
+{
+ return HAPTIC_SUCCESS;
+}
+
+EXTAPI
+int device_haptic_get_effect_state(int device_handle, int effect_handle, int *effect_state)
+{
+ return HAPTIC_SUCCESS;
+}
+
+EXTAPI
+int device_haptic_get_size(const unsigned char *haptic_buffer, int size)
+{
+ return HAPTIC_SUCCESS;
+}
+
+EXTAPI
+int device_haptic_initialize_buffer(unsigned char *haptic_buffer, int size)
+{
+ return HAPTIC_SUCCESS;
+}
+
+EXTAPI
+int device_haptic_insert_element(unsigned char *haptic_buffer, int size, int timeline_index, const HapticElement *element)
+{
+ return HAPTIC_SUCCESS;
+}
+
+EXTAPI
+int device_haptic_insert_element2(unsigned char *haptic_buffer, int size, int timeline_index, const HapticElement2 *element)
+{
+ return HAPTIC_SUCCESS;
+}
+
+EXTAPI
+int device_haptic_insert_element3(unsigned char *haptic_buffer, int size, int timeline_index, const HapticElement3 *element)
+{
+ return HAPTIC_SUCCESS;
+}
+
+EXTAPI
+int device_haptic_read_element(const unsigned char *haptic_buffer, int size, int timeline_index, int element_index, HapticElement *element)
+{
+ return HAPTIC_SUCCESS;
+}
+
+EXTAPI
+int device_haptic_read_element2(const unsigned char *haptic_buffer, int size, int timeline_index, int element_index, HapticElement2 *element)
+{
+ return HAPTIC_SUCCESS;
+}
+
+EXTAPI
+int device_haptic_read_element3(const unsigned char *haptic_buffer, int size, int timeline_index, int element_index, HapticElement3 *element)
+{
+ return HAPTIC_SUCCESS;
+}
+
+EXTAPI
+int device_haptic_remove_element(unsigned char *haptic_buffer, int size, int timeline_index, int element_index)
+{
+ return HAPTIC_SUCCESS;
+}
+/* END: devman_haptic_ext APIs */
--- /dev/null
+/*
+ * devman
+ * 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.
+ */
+
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <stdbool.h>
+#include <unistd.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <signal.h>
+#include <dirent.h>
+#include <ctype.h>
+#include <string.h>
+#include <stdarg.h>
+#include <errno.h>
+#include <sys/poll.h>
+
+#include "devlog.h"
+#include "devman_internal.h"
+
+#define WD_RESPONSE_TIMEOUT 100 /* 0.1 seconds */
+#define DISPLAY_WD_PATH "/usr/bin/display_wd"
+
+static int fifo_fd;
+
+API int display_register_postjob(void)
+{
+ int ret, i;
+ long open_max;
+ pid_t pid;
+ char buf[PATH_MAX];
+ char fifo_path[NAME_MAX];
+ struct pollfd fifo_pollfd;
+
+ snprintf(fifo_path, NAME_MAX, "%s.%d", DISPLAY_WD_FIFO, getpid());
+ if (access(fifo_path, F_OK) == 0) {
+ DEVERR("Already registered!");
+ return -1;
+ }
+
+ if (mkfifo(fifo_path, 0700) != 0) {
+ DEVERR("mkfifo error : %s", strerror(errno));
+ return -1;
+ }
+
+ pid = fork();
+ if(pid < 0) {
+ DEVERR("Failed to fork child process for LCD On/Off");
+ unlink(fifo_path);
+ return -1;
+ }
+ if (pid == 0) {
+ open_max = sysconf(_SC_OPEN_MAX);
+ for (i = 0; i < open_max; i++) {
+ close(i);
+ }
+
+ execl(DISPLAY_WD_PATH, DISPLAY_WD_PATH, NULL);
+ }
+
+ fifo_pollfd.fd = open(fifo_path, O_RDWR | O_NONBLOCK);
+ if (fifo_pollfd.fd < 0) {
+ DEVERR("Cannot open fifo file");
+ unlink(fifo_path);
+ return -1;
+ }
+
+ /* get the watch dog ready message. */
+ fifo_pollfd.events = POLLIN;
+ if (poll(&fifo_pollfd, 1, WD_RESPONSE_TIMEOUT) < 0) {
+ DEVERR("Cannot poll the fifo file");
+ DEVLOG("fifo file path is %s", fifo_path);
+ close(fifo_pollfd.fd);
+ unlink(fifo_path);
+ return -1;
+ }
+ read(fifo_pollfd.fd, buf, sizeof(buf));
+
+ fifo_fd = fifo_pollfd.fd;
+
+ return 0;
+}
+
+API int display_cancel_postjob(void)
+{
+ char buf[PATH_MAX];
+ int ret;
+
+ snprintf(buf, PATH_MAX, "%s.%d", DISPLAY_WD_FIFO, getpid());
+ if (access(buf, F_OK) != 0) {
+ DEVERR("No registered the post job!");
+ return -1;
+ }
+
+ if (fifo_fd < 0)
+ fifo_fd = open(buf, O_WRONLY);
+ if (fifo_fd < 0) {
+ DEVERR("Cannot open the fifo file");
+ DEVLOG("fifo file path is %s", buf);
+ return -1;
+ }
+ ret = DISPLAY_WD_CANCEL;
+ write(fifo_fd, &ret, sizeof(int));
+ close(fifo_fd);
+ unlink(buf);
+ fifo_fd = -1;
+
+ return 0;
+}
+
--- /dev/null
+/*
+ * devman
+ * 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.
+ */
+
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <stdbool.h>
+#include <string.h>
+#include <unistd.h>
+#include <fcntl.h>
+#include <linux/limits.h>
+#include <sys/poll.h>
+#include <errno.h>
+#include <signal.h>
+#include <vconf.h>
+#include <vconf-keys.h>
+#include <device-node.h>
+
+#include "devlog.h"
+#include "devman_internal.h"
+
+char fifo_path[NAME_MAX];
+struct pollfd fifo_pollfd;
+
+static void sig_quit(int signo)
+{
+ DEVERR("[DISPLAY_WD] display_wd will be exit for signal %d", signo);
+ if(fifo_pollfd.fd >= 0)
+ close(fifo_pollfd.fd);
+ if (access(fifo_path, F_OK) == 0)
+ unlink(fifo_path);
+}
+
+int main(void)
+{
+ int fd = -1;
+ int ret = -1;
+ int val = -1;
+ int auto_brightness_state = -1;
+ fifo_pollfd.fd = -1;
+ setsid();
+
+ signal(SIGPIPE, sig_quit);
+
+ snprintf(fifo_path, NAME_MAX, "%s.%d", DISPLAY_WD_FIFO, getppid());
+ fifo_pollfd.fd = open(fifo_path, O_WRONLY);
+ if (fifo_pollfd.fd < 0) {
+ DEVERR("[DISPLAY_WD] Cannot open the fifo file - %s.",
+ fifo_path);
+ return -1;
+ }
+
+ /* waitting for parent process ready */
+ usleep(10000);
+ ret = write(fifo_pollfd.fd, "ack", strlen("ack") + 1);
+
+ close(fifo_pollfd.fd);
+
+ fifo_pollfd.fd = open(fifo_path, O_RDONLY);
+ if (fifo_pollfd.fd < 0) {
+ DEVERR("[DISPLAY_WD] Cannot open the fifo file - %s.",
+ fifo_path);
+ return -1;
+ }
+
+ fifo_pollfd.events = (POLLIN | POLLHUP);
+ ret = 0;
+ while (ret != DISPLAY_WD_CANCEL) {
+ DEVLOG("[DISPLAY_WD] wait....");
+ if (poll(&fifo_pollfd, 1, -1) < 0) {
+ DEVERR("[DISPLAY_WD] Cannot poll the fifo file - %s", fifo_path);
+ close(fifo_pollfd.fd);
+ return -1;
+ }
+ if (fifo_pollfd.revents & POLLIN) {
+ read(fifo_pollfd.fd, &ret, sizeof(int));
+ if (ret == DISPLAY_WD_CANCEL) {
+ DEVERR("[DISPLAY_WD] Canceled. - %s, %d", fifo_path, ret);
+ close(fifo_pollfd.fd);
+ return -1;
+ }
+ }
+ if (fifo_pollfd.revents & POLLHUP)
+ break;
+ }
+ close(fifo_pollfd.fd);
+ unlink(fifo_path);
+
+ DEVLOG("[DISPLAY_WD] occurs POLLHUP");
+
+ vconf_set_int(VCONFKEY_PM_CUSTOM_BRIGHTNESS_STATUS, VCONFKEY_PM_CUSTOM_BRIGHTNESS_OFF);
+ if (vconf_get_int(VCONFKEY_SETAPPL_BRIGHTNESS_AUTOMATIC_INT, &auto_brightness_state) == 0) {
+ if (auto_brightness_state == SETTING_BRIGHTNESS_AUTOMATIC_OFF) {
+ ret = vconf_get_int(VCONFKEY_SETAPPL_LCD_BRIGHTNESS, &val);
+ if (ret == 0 && val > 0) {
+ device_set_property(DEVICE_TYPE_DISPLAY, PROP_DISPLAY_BRIGHTNESS, val);
+ }
+ } else if (auto_brightness_state == SETTING_BRIGHTNESS_AUTOMATIC_PAUSE) {
+ DEVLOG("Auto brightness is enable");
+ vconf_set_int(VCONFKEY_SETAPPL_BRIGHTNESS_AUTOMATIC_INT, SETTING_BRIGHTNESS_AUTOMATIC_ON);
+ }
+ }
+
+ return 0;
+}
--- /dev/null
+/*
+ * devman
+ * 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.
+ */
+
+
+#include <vconf.h>
+#include <errno.h>
+#include <device-node.h>
+
+#include "devman.h"
+#include "devman_internal.h"
+#include "devlog.h"
+
+#define DISPLAY_MAX_BRIGHTNESS 100
+#define DISPLAY_MIN_BRIGHTNESS 0
+
+#define DISP_INDEX_BIT 4
+#define COMBINE_DISP_CMD(cmd, prop, index) (cmd = (prop | (index << DISP_INDEX_BIT)))
+
+#define SET_FLAG(var, bit) (var |= (1<<bit))
+#define UNSET_FLAG(var, bit) (var &= (~(1<<bit)))
+#define BRT_BIT 1
+#define LED_BIT 4
+
+static unsigned int disp_flag = 0x0;
+
+API int device_get_battery_pct(void)
+{
+ int val;
+ int ret;
+
+ ret = device_get_property(DEVICE_TYPE_POWER, PROP_POWER_CAPACITY, &val);
+ if (ret < 0)
+ return ret;
+
+ if (val < 0 || val > 100) {
+ DEVERR("capacity value is wrong");
+ return DEVMAN_ERROR_OPERATION_FAILED;
+ }
+
+ return val;
+}
+
+API int device_is_battery_full(void)
+{
+ int val;
+ int ret;
+
+ ret = device_get_property(DEVICE_TYPE_POWER, PROP_POWER_CHARGE_FULL, &val);
+ if (ret < 0)
+ return ret;
+
+ if (val != 0 && val != 1) {
+ DEVERR("charge_full value is wrong");
+ return DEVMAN_ERROR_OPERATION_FAILED;
+ }
+
+ return val;
+}
+
+API int device_get_battery_health(void)
+{
+ int val;
+ int ret;
+
+ ret = device_get_property(DEVICE_TYPE_POWER, PROP_POWER_HEALTH, &val);
+ if (ret < 0)
+ return ret;
+
+ if (val < BAT_UNKNOWN || val > BAT_COLD) {
+ DEVERR("battery health value is wrong");
+ return DEVMAN_ERROR_OPERATION_FAILED;
+ }
+
+ return val;
+}
+
+API int device_get_battery_pct_raw(void)
+{
+ int val;
+ int ret;
+
+ ret = device_get_property(DEVICE_TYPE_POWER, PROP_POWER_CAPACITY_RAW, &val);
+ if (ret < 0)
+ return ret;
+
+ if (val > 10000)
+ return 10000;
+
+ return val;
+}
+
+API int device_get_display_brt(display_num_t lcdnum)
+{
+ int val;
+ int cmd;
+ int ret;
+
+ COMBINE_DISP_CMD(cmd, PROP_DISPLAY_BRIGHTNESS, lcdnum);
+ ret = device_get_property(DEVICE_TYPE_DISPLAY, cmd, &val);
+ if (ret < 0)
+ return ret;
+
+ return val;
+}
+
+API int device_set_display_brt_with_settings(display_num_t lcdnum, int val)
+{
+ int auto_brt_state;
+ int cmd;
+ int ret;
+
+ if (vconf_get_int(VCONFKEY_SETAPPL_BRIGHTNESS_AUTOMATIC_INT, &auto_brt_state) != 0) {
+ DEVERR("Failed to get VCONFKEY_SETAPPL_BRIGHTNESS_AUTOMATIC_INT value");
+ return DEVMAN_ERROR_OPERATION_FAILED;
+ }
+
+ if (auto_brt_state == SETTING_BRIGHTNESS_AUTOMATIC_ON) {
+ DEVLOG("auto_brightness state is ON, can not change the brightness value");
+ return DEVMAN_ERROR_NONE;
+ }
+
+ COMBINE_DISP_CMD(cmd, PROP_DISPLAY_BRIGHTNESS, lcdnum);
+ ret = device_set_property(DEVICE_TYPE_DISPLAY, cmd, val);
+ if (ret < 0)
+ return ret;
+
+ if (vconf_set_int(VCONFKEY_SETAPPL_LCD_BRIGHTNESS, val) != 0) {
+ DEVERR("Failed to set VCONFKEY_SETAPPL_LCD_BRIGHTNESS value");
+ }
+
+ if (vconf_set_int(VCONFKEY_PM_CURRENT_BRIGHTNESS, val) != 0) {
+ DEVERR("Failed to set VCONFKEY_PM_CURRENT_BRIGHTNESS value");
+ }
+
+ return DEVMAN_ERROR_NONE;
+}
+
+API int device_set_display_brt(display_num_t lcdnum, int val)
+{
+ int auto_brt_state;
+ int cmd;
+ int ret;
+
+ if (vconf_get_int(VCONFKEY_SETAPPL_BRIGHTNESS_AUTOMATIC_INT, &auto_brt_state) != 0) {
+ DEVERR("Failed to get VCONFKEY_SETAPPL_BRIGHTNESS_AUTOMATIC_INT value");
+ return DEVMAN_ERROR_OPERATION_FAILED;
+ }
+
+ vconf_set_int(VCONFKEY_PM_CUSTOM_BRIGHTNESS_STATUS, VCONFKEY_PM_CUSTOM_BRIGHTNESS_ON);
+ COMBINE_DISP_CMD(cmd, PROP_DISPLAY_BRIGHTNESS, lcdnum);
+ ret = device_set_property(DEVICE_TYPE_DISPLAY, cmd, val);
+ if (ret < 0)
+ return ret;
+
+ if (auto_brt_state == SETTING_BRIGHTNESS_AUTOMATIC_ON) {
+ DEVLOG("Auto brightness will be paused");
+ vconf_set_int(VCONFKEY_SETAPPL_BRIGHTNESS_AUTOMATIC_INT, SETTING_BRIGHTNESS_AUTOMATIC_PAUSE);
+ }
+
+ if (vconf_set_int(VCONFKEY_PM_CURRENT_BRIGHTNESS, val) != 0) {
+ DEVERR("Failed to set VCONFKEY_PM_CURRENT_BRIGHTNESS value");
+ }
+
+ if (!disp_flag)
+ ret = display_register_postjob();
+ if (ret == 0)
+ SET_FLAG(disp_flag, BRT_BIT);
+ return DEVMAN_ERROR_NONE;
+}
+
+API int device_release_brt_ctrl(display_num_t lcdnum)
+{
+ int bat_state;
+ int setting_val;
+ int auto_brt_state;
+ int charger_state;
+ int brt_changed_state;
+ int cmd;
+ int ret;
+
+ if (vconf_get_int(VCONFKEY_SYSMAN_BATTERY_STATUS_LOW, &bat_state) != 0) {
+ DEVERR("Failed to get VCONFKEY_SYSMAN_BATTERY_STATUS_LOW value");
+ return DEVMAN_ERROR_OPERATION_FAILED;
+ }
+
+ if (vconf_get_int(VCONFKEY_SYSMAN_CHARGER_STATUS, &charger_state) != 0) {
+ DEVERR("Failed to get VCONFKEY_SYSMAN_CHARGER_STATUS value");
+ return DEVMAN_ERROR_OPERATION_FAILED;
+ }
+
+ if (vconf_get_bool(VCONFKEY_PM_BRIGHTNESS_CHANGED_IN_LPM, &brt_changed_state) != 0) {
+ DEVERR("Failed to get VCONFKEY_PM_BRIGHTNESS_CHANGED_IN_LPM value");
+ return DEVMAN_ERROR_OPERATION_FAILED;
+ }
+
+ if (vconf_get_int(VCONFKEY_SETAPPL_LCD_BRIGHTNESS, &setting_val) != 0) {
+ DEVERR("Failed to get VCONFKEY_SETAPPL_LCD_BRIGHTNESS value");
+ return DEVMAN_ERROR_OPERATION_FAILED;
+ }
+
+ if (vconf_get_int(VCONFKEY_SETAPPL_BRIGHTNESS_AUTOMATIC_INT, &auto_brt_state) != 0) {
+ DEVERR("Failed to get VCONFKEY_SETAPPL_BRIGHTNESS_AUTOMATIC_INT value");
+ return DEVMAN_ERROR_OPERATION_FAILED;
+ }
+
+ vconf_set_int(VCONFKEY_PM_CUSTOM_BRIGHTNESS_STATUS, VCONFKEY_PM_CUSTOM_BRIGHTNESS_OFF);
+
+ // check dim state
+ if (bat_state <= VCONFKEY_SYSMAN_BAT_WARNING_LOW &&
+ charger_state == VCONFKEY_SYSMAN_CHARGER_DISCONNECTED && !brt_changed_state) {
+ DEVLOG("batt warning low : brightness is not changed!");
+ COMBINE_DISP_CMD(cmd, PROP_DISPLAY_BRIGHTNESS, lcdnum);
+ device_set_property(DEVICE_TYPE_DISPLAY, cmd, 0);
+ return DEVMAN_ERROR_NONE;
+ }
+
+ if (auto_brt_state == SETTING_BRIGHTNESS_AUTOMATIC_OFF) {
+ COMBINE_DISP_CMD(cmd, PROP_DISPLAY_BRIGHTNESS, lcdnum);
+ device_set_property(DEVICE_TYPE_DISPLAY, cmd, setting_val);
+ if (vconf_set_int(VCONFKEY_PM_CURRENT_BRIGHTNESS, setting_val) != 0) {
+ DEVERR("Failed to set VCONFKEY_PM_CURRENT_BRIGHTNESS value");
+ }
+ } else if (auto_brt_state == SETTING_BRIGHTNESS_AUTOMATIC_PAUSE) {
+ DEVLOG("Auto brightness will be enable");
+ vconf_set_int(VCONFKEY_SETAPPL_BRIGHTNESS_AUTOMATIC_INT, SETTING_BRIGHTNESS_AUTOMATIC_ON);
+ }
+
+ UNSET_FLAG(disp_flag, BRT_BIT);
+ if (!disp_flag)
+ display_cancel_postjob();
+ return DEVMAN_ERROR_NONE;
+}
+
+API int device_get_max_brt(display_num_t lcdnum)
+{
+ return DISPLAY_MAX_BRIGHTNESS;
+}
+
+API int device_get_min_brt(display_num_t lcdnum)
+{
+ return DISPLAY_MIN_BRIGHTNESS;
+}
+
+API int device_get_display_gamma(display_num_t lcdnum)
+{
+ DEVERR("Not support this api");
+ return DEVMAN_ERROR_NOT_SUPPORTED;
+}
+
+API int device_set_display_gamma(display_num_t lcdnum, display_gamma_t val)
+{
+ DEVERR("Not support this api");
+ return DEVMAN_ERROR_NOT_SUPPORTED;
+}
+
+API int device_release_gamma_ctrl(display_num_t lcdnum, display_gamma_t org_val)
+{
+ DEVERR("Not support this api");
+ return DEVMAN_ERROR_NOT_SUPPORTED;
+}
+
+API int device_get_display_count(void)
+{
+ int val;
+ int ret;
+
+ ret = device_get_property(DEVICE_TYPE_DISPLAY, PROP_DISPLAY_DISPLAY_COUNT, &val);
+ if (ret < 0)
+ return ret;
+
+ return val;
+}
+
+API int device_get_image_enhance_mode(void)
+{
+ int val;
+ int ret;
+
+ ret = device_get_property(DEVICE_TYPE_DISPLAY, PROP_DISPLAY_IMAGE_ENHANCE_MODE, &val);
+ if (ret < 0)
+ return ret;
+
+ return val;
+}
+
+API int device_set_image_enhance_mode(int val)
+{
+ int ret;
+
+ ret = device_set_property(DEVICE_TYPE_DISPLAY, PROP_DISPLAY_IMAGE_ENHANCE_MODE, val);
+ if (ret < 0)
+ return ret;
+
+ return DEVMAN_ERROR_NONE;
+}
+
+API int device_get_image_enhance_scenario(void)
+{
+ int val;
+ int ret;
+
+ ret = device_get_property(DEVICE_TYPE_DISPLAY, PROP_DISPLAY_IMAGE_ENHANCE_SCENARIO, &val);
+ if (ret < 0)
+ return ret;
+
+ return val;
+}
+
+API int device_set_image_enhance_scenario(int val)
+{
+ int ret;
+
+ ret = device_set_property(DEVICE_TYPE_DISPLAY, PROP_DISPLAY_IMAGE_ENHANCE_SCENARIO, val);
+ if (ret < 0)
+ return ret;
+
+ return DEVMAN_ERROR_NONE;
+}
+
+API int device_get_image_enhance_tone(void)
+{
+ int val;
+ int ret;
+
+ ret = device_get_property(DEVICE_TYPE_DISPLAY, PROP_DISPLAY_IMAGE_ENHANCE_TONE, &val);
+ if (ret < 0)
+ return ret;
+
+ return val;
+}
+
+API int device_set_image_enhance_tone(int val)
+{
+ int ret;
+
+ ret = device_set_property(DEVICE_TYPE_DISPLAY, PROP_DISPLAY_IMAGE_ENHANCE_TONE, val);
+ if (ret < 0)
+ return ret;
+
+ return DEVMAN_ERROR_NONE;
+}
+
+API int device_get_image_enhance_outdoor(void)
+{
+ int val;
+ int ret;
+
+ ret = device_get_property(DEVICE_TYPE_DISPLAY, PROP_DISPLAY_IMAGE_ENHANCE_OUTDOOR, &val);
+ if (ret < 0)
+ return ret;
+
+ return val;
+}
+
+API int device_set_image_enhance_outdoor(int val)
+{
+ int ret;
+
+ ret = device_set_property(DEVICE_TYPE_DISPLAY, PROP_DISPLAY_IMAGE_ENHANCE_OUTDOOR, val);
+ if (ret < 0)
+ return ret;
+
+ return DEVMAN_ERROR_NONE;
+}
+
+API int device_get_image_enhance_info(void)
+{
+ int val;
+ int ret;
+
+ ret = device_get_property(DEVICE_TYPE_DISPLAY, PROP_DISPLAY_IMAGE_ENHANCE_INFO, &val);
+ if (ret < 0)
+ return ret;
+
+ return val;
+}
+
+API int device_get_led_brt(void)
+{
+ int val;
+ int ret;
+
+ ret = device_get_property(DEVICE_TYPE_LED, PROP_LED_BRIGHTNESS, &val);
+ if (ret < 0)
+ return ret;
+
+ return val;
+}
+
+API int device_set_led_brt(int val)
+{
+ int ret;
+
+ ret = device_set_property(DEVICE_TYPE_LED, PROP_LED_BRIGHTNESS, val);
+ if (ret < 0)
+ return ret;
+
+ if (val == 0) {
+ UNSET_FLAG(disp_flag, LED_BIT);
+ if (!disp_flag)
+ display_cancel_postjob();
+ } else {
+ if (!disp_flag)
+ ret = display_register_postjob();
+ if (ret == 0)
+ SET_FLAG(disp_flag, LED_BIT);
+ }
+
+ return DEVMAN_ERROR_NONE;
+}
+
+API int device_set_led_brt_without_noti(int val)
+{
+ int ret;
+
+ ret = device_set_property(DEVICE_TYPE_LED, PROP_LED_BRIGHTNESS, val);
+ if (ret < 0)
+ return ret;
+
+ return DEVMAN_ERROR_NONE;
+}
+
+API int device_get_max_led(void)
+{
+ int val;
+ int ret;
+
+ ret = device_get_property(DEVICE_TYPE_LED, PROP_LED_MAX_BRIGHTNESS, &val);
+ if (ret < 0)
+ return ret;
+
+ return val;
+}
+
+API int device_get_acl_control_status(display_num_t num)
+{
+ int val;
+ int cmd;
+ int ret;
+
+ COMBINE_DISP_CMD(cmd, PROP_DISPLAY_ACL_CONTROL, num);
+ ret = device_get_property(DEVICE_TYPE_DISPLAY, cmd, &val);
+ if (ret < 0)
+ return ret;
+
+ return val;
+}
+
+API int device_set_acl_control_status(display_num_t num, int val)
+{
+ int cmd;
+ int ret;
+
+ COMBINE_DISP_CMD(cmd, PROP_DISPLAY_ACL_CONTROL, num);
+ ret = device_set_property(DEVICE_TYPE_DISPLAY, cmd, val);
+ if (ret < 0)
+ return ret;
+
+ return DEVMAN_ERROR_NONE;
+}
--- /dev/null
+<manifest>
+ <request>
+ <domain name="_"/>
+ </request>
+</manifest>
Source3: sysman.manifest
Source4: libslp-pm.manifest
Source5: haptic.manifest
+Source6: devman.manifest
BuildRequires: cmake
BuildRequires: libattr-devel
BuildRequires: pkgconfig(ecore)
%description -n libhaptic-plugin-devel
Haptic plugin library for device control (devel)
+%package -n libdevman
+Summary: Device manager library
+Group: Development/Libraries
+
+%description -n libdevman
+Device manager library for device control
+
+%package -n libdevman-devel
+Summary: Device manager library for (devel)
+Group: Development/Libraries
+Requires: libdevman = %{version}-%{release}
+
+%description -n libdevman-devel
+Device manager library for device control (devel)
+
+%package -n libdevman-haptic-devel
+Summary: Haptic Device manager library for (devel)
+Group: Development/Libraries
+Requires: libdevman-devel = %{version}-%{release}
+
+%description -n libdevman-haptic-devel
+Haptic Device manager library for device control (devel)
+
%package -n libdeviced
Summary: Deviced library
Group: Development/Libraries
cp %{SOURCE3} .
cp %{SOURCE4} .
cp %{SOURCE5} .
+cp %{SOURCE6} .
%cmake .
%install
%{_includedir}/haptic/SLP_haptic_PG.h
%{_libdir}/pkgconfig/haptic-plugin.pc
+%files -n libdevman
+%{_bindir}/display_wd
+%{_libdir}/libdevman.so.*
+%manifest devman.manifest
+
+%files -n libdevman-devel
+%{_includedir}/devman/devman.h
+%{_includedir}/devman/devman_image.h
+%{_includedir}/devman/devman_managed.h
+%{_includedir}/devman/devman_haptic.h
+%{_includedir}/devman/SLP_devman_PG.h
+%{_libdir}/pkgconfig/devman.pc
+%{_libdir}/libdevman.so
+
+%files -n libdevman-haptic-devel
+%{_includedir}/devman/devman_haptic_ext.h
+%{_includedir}/devman/devman_haptic_ext_core.h
+%{_libdir}/pkgconfig/devman_haptic.pc
+
%files -n libdeviced
%defattr(-,root,root,-)
%{_libdir}/libdeviced.so.*