From f0e71819ee83cd67d94be187dc301c3d9c2c83a5 Mon Sep 17 00:00:00 2001 From: taeyoung Date: Wed, 10 Jun 2015 22:57:56 +0900 Subject: common: code sync with Tizen 2.3 - Currently, libsvi is too old and it is necessary to add many fixes and some features. Thus code sync is needed Change-Id: I0abd6ad42bf5ef74ae001a2c82aca5c6bc40ff32 Signed-off-by: taeyoung --- AUTHORS | 1 - CMakeLists.txt | 60 +- LICENSE | 204 +++++ LICENSE.APLv2 | 204 ----- README | 88 +++ SLP_FEEDBACK_PG.h | 6 + TC/_export_env.sh | 8 + TC/_export_target_env.sh | 7 + TC/build.sh | 6 +- TC/clean.sh | 11 + TC/config | 2 + TC/execute.sh | 6 +- TC/push.sh | 11 + TC/testcase/Makefile | 28 + TC/testcase/tslist | 1 + TC/testcase/utc_system_feedback.c | 297 +++++++ TC/tet_code | 12 - TC/tet_scen | 2 +- TC/tetbuild.cfg | 7 +- TC/tetclean.cfg | 7 +- TC/tetexec.cfg | 6 +- TC/unit/Makefile | 22 - TC/unit/tc_gen.sh | 28 - TC/unit/tslist | 3 - TC/unit/utc_ApplicationFW_svi_fini_func.c | 79 -- TC/unit/utc_ApplicationFW_svi_init_func.c | 72 -- TC/unit/utc_ApplicationFW_svi_play_func.c | 135 ---- TC/unit/utc_MODULE_API_func.c.in | 64 -- data/emulator/sound.xml | 133 ++++ data/emulator/sound/operation/notification.ogg | Bin 0 -> 16051 bytes data/emulator/sound/operation/power_on.ogg | Bin 0 -> 36190 bytes data/emulator/sound/operation/ringtone.ogg | Bin 0 -> 38673 bytes data/emulator/sound/operation/shutter.ogg | Bin 0 -> 16468 bytes data/emulator/sound/operation/system.ogg | Bin 0 -> 7657 bytes data/emulator/sound/touch/touch.ogg | Bin 0 -> 4303 bytes data/emulator/vibration.xml | 157 ++++ data/feedback/haptic/default/Basic_call.tht | Bin 106 -> 0 bytes data/feedback/haptic/touch/touch.tht | Bin 38 -> 0 bytes data/feedback/sound/operation/call_connect.wav | Bin 27644 -> 0 bytes data/feedback/sound/operation/call_disconnect.wav | Bin 27644 -> 0 bytes .../sound/operation/charger_connection.wav | Bin 27644 -> 0 bytes data/feedback/sound/operation/fully_charged.wav | Bin 27644 -> 0 bytes data/feedback/sound/operation/list_reorder.wav | Bin 27644 -> 0 bytes data/feedback/sound/operation/lock.wav | Bin 27644 -> 0 bytes data/feedback/sound/operation/low_battery.wav | Bin 27644 -> 0 bytes data/feedback/sound/operation/minute_minder.wav | Bin 27644 -> 0 bytes data/feedback/sound/operation/power_on.wav | Bin 27644 -> 0 bytes data/feedback/sound/operation/shutter.wav | Bin 149108 -> 0 bytes data/feedback/sound/operation/slider_sweep.wav | Bin 27644 -> 0 bytes data/feedback/sound/operation/unlock.wav | Bin 27644 -> 0 bytes data/feedback/sound/operation/volume_control.wav | Bin 7974 -> 0 bytes data/feedback/sound/touch/key0.wav | Bin 9064 -> 0 bytes data/feedback/sound/touch/key1.wav | Bin 9000 -> 0 bytes data/feedback/sound/touch/key2.wav | Bin 8968 -> 0 bytes data/feedback/sound/touch/key3.wav | Bin 9000 -> 0 bytes data/feedback/sound/touch/key4.wav | Bin 8976 -> 0 bytes data/feedback/sound/touch/key5.wav | Bin 8936 -> 0 bytes data/feedback/sound/touch/key6.wav | Bin 8976 -> 0 bytes data/feedback/sound/touch/key7.wav | Bin 8964 -> 0 bytes data/feedback/sound/touch/key8.wav | Bin 9000 -> 0 bytes data/feedback/sound/touch/key9.wav | Bin 8968 -> 0 bytes data/feedback/sound/touch/keyasterisk.wav | Bin 9000 -> 0 bytes data/feedback/sound/touch/keysharp.wav | Bin 9000 -> 0 bytes data/feedback/sound/touch/sip.wav | Bin 8832 -> 0 bytes data/feedback/sound/touch/sip_backspace.wav | Bin 8832 -> 0 bytes data/feedback/sound/touch/touch.wav | Bin 7974 -> 0 bytes data/feedback/vibration.xml | 205 ----- data/micro/sound.xml | 181 +++++ data/micro/sound/operation/notification.ogg | Bin 0 -> 16051 bytes data/micro/sound/operation/power_on.ogg | Bin 0 -> 36190 bytes data/micro/sound/operation/ringtone.ogg | Bin 0 -> 38673 bytes data/micro/sound/operation/shutter.ogg | Bin 0 -> 16468 bytes data/micro/sound/operation/system.ogg | Bin 0 -> 7657 bytes data/micro/sound/touch/touch.ogg | Bin 0 -> 4303 bytes data/micro/vibration.xml | 161 ++++ data/mobile/sound.xml | 157 ++++ data/mobile/sound/operation/call_connect.wav | Bin 0 -> 27644 bytes data/mobile/sound/operation/call_disconnect.wav | Bin 0 -> 27644 bytes data/mobile/sound/operation/charger_connection.wav | Bin 0 -> 27644 bytes data/mobile/sound/operation/fully_charged.wav | Bin 0 -> 27644 bytes data/mobile/sound/operation/list_reorder.wav | Bin 0 -> 27644 bytes data/mobile/sound/operation/lock.wav | Bin 0 -> 27644 bytes data/mobile/sound/operation/low_battery.wav | Bin 0 -> 27644 bytes data/mobile/sound/operation/minute_minder.wav | Bin 0 -> 27644 bytes data/mobile/sound/operation/power_on.wav | Bin 0 -> 27644 bytes data/mobile/sound/operation/shutter.wav | Bin 0 -> 149108 bytes data/mobile/sound/operation/slider_sweep.wav | Bin 0 -> 27644 bytes data/mobile/sound/operation/unlock.wav | Bin 0 -> 27644 bytes data/mobile/sound/operation/volume_control.wav | Bin 0 -> 7974 bytes data/mobile/sound/touch/key0.wav | Bin 0 -> 9064 bytes data/mobile/sound/touch/key1.wav | Bin 0 -> 9000 bytes data/mobile/sound/touch/key2.wav | Bin 0 -> 8968 bytes data/mobile/sound/touch/key3.wav | Bin 0 -> 9000 bytes data/mobile/sound/touch/key4.wav | Bin 0 -> 8976 bytes data/mobile/sound/touch/key5.wav | Bin 0 -> 8936 bytes data/mobile/sound/touch/key6.wav | Bin 0 -> 8976 bytes data/mobile/sound/touch/key7.wav | Bin 0 -> 8964 bytes data/mobile/sound/touch/key8.wav | Bin 0 -> 9000 bytes data/mobile/sound/touch/key9.wav | Bin 0 -> 8968 bytes data/mobile/sound/touch/keyasterisk.wav | Bin 0 -> 9000 bytes data/mobile/sound/touch/keysharp.wav | Bin 0 -> 9000 bytes data/mobile/sound/touch/sip.wav | Bin 0 -> 8832 bytes data/mobile/sound/touch/sip_backspace.wav | Bin 0 -> 8832 bytes data/mobile/sound/touch/touch.wav | Bin 0 -> 7974 bytes data/mobile/vibration.xml | 196 +++++ doc/feedback_doc.h | 45 ++ image/svi.png | Bin include/common.h | 6 +- include/dbus.h | 46 ++ include/devices.h | 6 +- include/feedback-ids.h | 60 +- include/feedback.h | 81 +- include/feedback_doc.h | 35 + include/svi-file.h | 177 ----- include/svi-ids.h | 179 ----- include/svi-log.h | 32 - include/svi.h | 666 ---------------- include/xmlparser.h | 9 +- packaging/libfeedback.changes | 10 - packaging/libfeedback.manifest | 10 +- packaging/libfeedback.spec | 93 +-- packaging/libsvi.manifest | 6 - packaging/svi-data.manifest | 7 + pg-doxy/doxygen.conf | 850 +++++++++++++++++++++ pg-doxy/pg-doxy.sh | 39 + pg-doxy/slp_doxy.css | 699 +++++++++++++++++ pg-doxy/tool/bin/doxygen | Bin 0 -> 6075840 bytes pg-doxy/tool/bin/doxytag | Bin 0 -> 301465 bytes pg-doxy/tool/man/man1/doxygen.1 | 46 ++ pg-doxy/tool/man/man1/doxytag.1 | 21 + src/dbus.c | 136 ++++ src/devices.c | 11 + src/feedback.c | 99 ++- src/sound.c | 493 +++++------- src/str.c | 49 +- src/svi.c | 330 -------- src/vibrator.c | 622 +++++++-------- src/xmlparser.c | 32 +- svi.pc.in | 0 test/Makefile | 12 + test/capi_autofeedback.c | 32 + test/capi_feedback.c | 94 +++ test/feedback_test.c | 72 ++ test/getdata.c | 82 ++ 144 files changed, 4720 insertions(+), 3034 deletions(-) delete mode 100644 AUTHORS create mode 100644 LICENSE delete mode 100644 LICENSE.APLv2 create mode 100644 README create mode 100755 TC/_export_env.sh create mode 100755 TC/_export_target_env.sh create mode 100755 TC/clean.sh create mode 100644 TC/config create mode 100755 TC/push.sh create mode 100644 TC/testcase/Makefile create mode 100644 TC/testcase/tslist create mode 100644 TC/testcase/utc_system_feedback.c delete mode 100755 TC/tet_code mode change 100755 => 100644 TC/tet_scen mode change 100755 => 100644 TC/tetbuild.cfg mode change 100755 => 100644 TC/tetclean.cfg mode change 100755 => 100644 TC/tetexec.cfg delete mode 100755 TC/unit/Makefile delete mode 100755 TC/unit/tc_gen.sh delete mode 100755 TC/unit/tslist delete mode 100755 TC/unit/utc_ApplicationFW_svi_fini_func.c delete mode 100755 TC/unit/utc_ApplicationFW_svi_init_func.c delete mode 100755 TC/unit/utc_ApplicationFW_svi_play_func.c delete mode 100755 TC/unit/utc_MODULE_API_func.c.in create mode 100644 data/emulator/sound.xml create mode 100755 data/emulator/sound/operation/notification.ogg create mode 100755 data/emulator/sound/operation/power_on.ogg create mode 100755 data/emulator/sound/operation/ringtone.ogg create mode 100755 data/emulator/sound/operation/shutter.ogg create mode 100755 data/emulator/sound/operation/system.ogg create mode 100755 data/emulator/sound/touch/touch.ogg create mode 100644 data/emulator/vibration.xml delete mode 100755 data/feedback/haptic/default/Basic_call.tht delete mode 100755 data/feedback/haptic/touch/touch.tht delete mode 100755 data/feedback/sound/operation/call_connect.wav delete mode 100755 data/feedback/sound/operation/call_disconnect.wav delete mode 100755 data/feedback/sound/operation/charger_connection.wav delete mode 100755 data/feedback/sound/operation/fully_charged.wav delete mode 100755 data/feedback/sound/operation/list_reorder.wav delete mode 100755 data/feedback/sound/operation/lock.wav delete mode 100755 data/feedback/sound/operation/low_battery.wav delete mode 100755 data/feedback/sound/operation/minute_minder.wav delete mode 100755 data/feedback/sound/operation/power_on.wav delete mode 100755 data/feedback/sound/operation/shutter.wav delete mode 100755 data/feedback/sound/operation/slider_sweep.wav delete mode 100755 data/feedback/sound/operation/unlock.wav delete mode 100755 data/feedback/sound/operation/volume_control.wav delete mode 100755 data/feedback/sound/touch/key0.wav delete mode 100755 data/feedback/sound/touch/key1.wav delete mode 100755 data/feedback/sound/touch/key2.wav delete mode 100755 data/feedback/sound/touch/key3.wav delete mode 100755 data/feedback/sound/touch/key4.wav delete mode 100755 data/feedback/sound/touch/key5.wav delete mode 100755 data/feedback/sound/touch/key6.wav delete mode 100755 data/feedback/sound/touch/key7.wav delete mode 100755 data/feedback/sound/touch/key8.wav delete mode 100755 data/feedback/sound/touch/key9.wav delete mode 100755 data/feedback/sound/touch/keyasterisk.wav delete mode 100755 data/feedback/sound/touch/keysharp.wav delete mode 100755 data/feedback/sound/touch/sip.wav delete mode 100755 data/feedback/sound/touch/sip_backspace.wav delete mode 100755 data/feedback/sound/touch/touch.wav delete mode 100644 data/feedback/vibration.xml create mode 100644 data/micro/sound.xml create mode 100755 data/micro/sound/operation/notification.ogg create mode 100755 data/micro/sound/operation/power_on.ogg create mode 100755 data/micro/sound/operation/ringtone.ogg create mode 100755 data/micro/sound/operation/shutter.ogg create mode 100755 data/micro/sound/operation/system.ogg create mode 100755 data/micro/sound/touch/touch.ogg create mode 100644 data/micro/vibration.xml create mode 100755 data/mobile/sound.xml create mode 100755 data/mobile/sound/operation/call_connect.wav create mode 100755 data/mobile/sound/operation/call_disconnect.wav create mode 100755 data/mobile/sound/operation/charger_connection.wav create mode 100755 data/mobile/sound/operation/fully_charged.wav create mode 100755 data/mobile/sound/operation/list_reorder.wav create mode 100755 data/mobile/sound/operation/lock.wav create mode 100755 data/mobile/sound/operation/low_battery.wav create mode 100755 data/mobile/sound/operation/minute_minder.wav create mode 100755 data/mobile/sound/operation/power_on.wav create mode 100755 data/mobile/sound/operation/shutter.wav create mode 100755 data/mobile/sound/operation/slider_sweep.wav create mode 100755 data/mobile/sound/operation/unlock.wav create mode 100755 data/mobile/sound/operation/volume_control.wav create mode 100755 data/mobile/sound/touch/key0.wav create mode 100755 data/mobile/sound/touch/key1.wav create mode 100755 data/mobile/sound/touch/key2.wav create mode 100755 data/mobile/sound/touch/key3.wav create mode 100755 data/mobile/sound/touch/key4.wav create mode 100755 data/mobile/sound/touch/key5.wav create mode 100755 data/mobile/sound/touch/key6.wav create mode 100755 data/mobile/sound/touch/key7.wav create mode 100755 data/mobile/sound/touch/key8.wav create mode 100755 data/mobile/sound/touch/key9.wav create mode 100755 data/mobile/sound/touch/keyasterisk.wav create mode 100755 data/mobile/sound/touch/keysharp.wav create mode 100755 data/mobile/sound/touch/sip.wav create mode 100755 data/mobile/sound/touch/sip_backspace.wav create mode 100755 data/mobile/sound/touch/touch.wav create mode 100644 data/mobile/vibration.xml create mode 100755 doc/feedback_doc.h mode change 100755 => 100644 image/svi.png create mode 100644 include/dbus.h create mode 100755 include/feedback_doc.h delete mode 100755 include/svi-file.h delete mode 100755 include/svi-ids.h delete mode 100755 include/svi-log.h delete mode 100755 include/svi.h delete mode 100644 packaging/libfeedback.changes delete mode 100644 packaging/libsvi.manifest create mode 100755 pg-doxy/doxygen.conf create mode 100755 pg-doxy/pg-doxy.sh create mode 100644 pg-doxy/slp_doxy.css create mode 100755 pg-doxy/tool/bin/doxygen create mode 100755 pg-doxy/tool/bin/doxytag create mode 100644 pg-doxy/tool/man/man1/doxygen.1 create mode 100644 pg-doxy/tool/man/man1/doxytag.1 create mode 100644 src/dbus.c delete mode 100755 src/svi.c mode change 100755 => 100644 svi.pc.in create mode 100644 test/Makefile create mode 100644 test/capi_autofeedback.c create mode 100644 test/capi_feedback.c create mode 100644 test/feedback_test.c create mode 100644 test/getdata.c diff --git a/AUTHORS b/AUTHORS deleted file mode 100644 index d14debe..0000000 --- a/AUTHORS +++ /dev/null @@ -1 +0,0 @@ -Jiyoung Yun diff --git a/CMakeLists.txt b/CMakeLists.txt index c3b673f..4aacbdb 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -3,12 +3,25 @@ PROJECT(feedback C) SET(PREFIX ${CMAKE_INSTALL_PREFIX}) SET(EXEC_PREFIX "\${prefix}") -SET(LIBDIR ${LIB_INSTALL_DIR}) SET(INCLUDEDIR "\${prefix}/include/${PROJECT_NAME}") SET(VERSION 0.1.4) +IF("${ARCH}" STREQUAL "emulator") + OPTION(USE_EMULATOR "Use Emulator" ON) +ELSEIF("${ARCH}" STREQUAL "arm") + OPTION(USE_ARM "Use Arm" ON) +ENDIF() + SET(FEEDBACK_DATA_PATH ${CMAKE_CURRENT_SOURCE_DIR}/data) -SET(FEEDBACK_DATA_DIRS ${FEEDBACK_DATA_PATH}/feedback) +IF(USE_EMULATOR) +SET(FEEDBACK_DATA_DIRS ${FEEDBACK_DATA_PATH}/emulator) +ELSE(USE_EMULATOR) +IF(MICRO_DD) +SET(FEEDBACK_DATA_DIRS ${FEEDBACK_DATA_PATH}/micro) +ELSE(MICRO_DD) +SET(FEEDBACK_DATA_DIRS ${FEEDBACK_DATA_PATH}/mobile) +ENDIF(MICRO_DD) +ENDIF(USE_EMULATOR) SET(SRCS src/devices.c @@ -16,23 +29,15 @@ SET(SRCS src/vibrator.c src/xmlparser.c src/feedback.c - src/str.c) + src/str.c + src/dbus.c) SET(HEADERS SLP_FEEDBACK_PG.h include/feedback.h include/feedback-ids.h) -SET(SVI_NAME svi) - -SET(SVI_HEADERS - include/svi.h - include/svi-ids.h) - -SET(SVI_SRCS - src/svi.c) - -SET(DEPENDENTS "vconf haptic mm-keysound dlog libxml-2.0 glib-2.0 libtzplatform-config") +SET(DEPENDENTS "vconf mm-keysound dlog libxml-2.0 glib-2.0 dbus-1") SET(PC_DEPENDENTS "capi-base-common") SET(PC_NAME ${PROJECT_NAME}) @@ -50,6 +55,7 @@ ENDFOREACH(flag) SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} -fvisibility=hidden") SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} -g") +SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} -Werror") SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS}") @@ -57,29 +63,19 @@ ADD_LIBRARY(${PROJECT_NAME} SHARED ${SRCS}) SET_TARGET_PROPERTIES(${PROJECT_NAME} PROPERTIES SOVERSION 0) SET_TARGET_PROPERTIES(${PROJECT_NAME} PROPERTIES VERSION ${VERSION}) TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${pkgs_LDFLAGS}) - -ADD_LIBRARY(${SVI_NAME} SHARED ${SVI_SRCS}) -SET_TARGET_PROPERTIES(${SVI_NAME} PROPERTIES SOVERSION 0) -SET_TARGET_PROPERTIES(${SVI_NAME} PROPERTIES VERSION ${VERSION}) -TARGET_LINK_LIBRARIES(${SVI_NAME} -L${CMAKE_BINARY_DIR} -lfeedback) -TARGET_LINK_LIBRARIES(${SVI_NAME} ${pkgs_LDFLAGS}) +INSTALL(TARGETS ${PROJECT_NAME} DESTINATION ${LIB_INSTALL_DIR} COMPONENT RuntimeLibraries) CONFIGURE_FILE(${PROJECT_NAME}.pc.in ${PROJECT_NAME}.pc @ONLY) -CONFIGURE_FILE(${SVI_NAME}.pc.in ${SVI_NAME}.pc @ONLY) +INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}.pc DESTINATION ${LIB_INSTALL_DIR}/pkgconfig) FOREACH(hfile ${HEADERS}) INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${hfile} DESTINATION include/${PROJECT_NAME}) ENDFOREACH(hfile) -FOREACH(hfile ${SVI_HEADERS}) - INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${hfile} DESTINATION include/${SVI_NAME}) -ENDFOREACH(hfile) - -FOREACH(datadir ${FEEDBACK_DATA_DIRS}) - INSTALL(DIRECTORY ${datadir} DESTINATION share) -ENDFOREACH(datadir) - -INSTALL(TARGETS ${PROJECT_NAME} DESTINATION ${LIB_INSTALL_DIR} COMPONENT RuntimeLibraries) -INSTALL(TARGETS ${SVI_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}/${SVI_NAME}.pc DESTINATION ${LIB_INSTALL_DIR}/pkgconfig) +IF(MICRO_DD OR USE_EMULATOR) + INSTALL(DIRECTORY ${FEEDBACK_DATA_DIRS}/ DESTINATION share/${PROJECT_NAME}) +ELSE(MICRO_DD OR USE_EMULATOR) + INSTALL(DIRECTORY ${FEEDBACK_DATA_DIRS}/sound DESTINATION share/${PROJECT_NAME}) + INSTALL(FILES ${FEEDBACK_DATA_DIRS}/sound.xml DESTINATION share/${PROJECT_NAME}) + INSTALL(FILES ${FEEDBACK_DATA_DIRS}/vibration.xml DESTINATION share/${PROJECT_NAME}) +ENDIF(MICRO_DD OR USE_EMULATOR) diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..a06208b --- /dev/null +++ b/LICENSE @@ -0,0 +1,204 @@ +Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved. + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + 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. + diff --git a/LICENSE.APLv2 b/LICENSE.APLv2 deleted file mode 100644 index a06208b..0000000 --- a/LICENSE.APLv2 +++ /dev/null @@ -1,204 +0,0 @@ -Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved. - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - 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. - diff --git a/README b/README new file mode 100644 index 0000000..4cac11d --- /dev/null +++ b/README @@ -0,0 +1,88 @@ + + +How to add the sound & vibration resources +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +In case of sound resources +- add ./data/[target]/sound/[category]/ +- update the ./data/[target]/sound.xml file + + + [the file path] + + +In case of vibration resources +- get the b64 data of the resource using test/getdata application + -------------------------------------------------------------- + | sh-4.1$ su + | sh-4.1# ls ./noti + | a.ivt + | sh-4.1# ./getdata ./noti + | a.ivt + | [[[AQABAAoAFAAAACAfAAB/IUFBAABQAGUAcgBpAG]]] <----- b64 data + | ((( + | !AAPeriodic))) + | + | done + -------------------------------------------------------------- +- update the ./data/[target]/vibration.xml file + + + [the b64 data] + + + +How to test the sound & vibration resources +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Preparation +- Install Tizen sdk (https://developer.tizen.org/downloads/tizen-sdk) +- Install Samsung USB controller +- Test application + test/capi_feedback + test/capi_autofeedback +- The resource for testing + +Prerequisite for updating the resources +- Connect PC and Target +- Copy test application and resource to Target on pc + (ex. copy to /Phone/Downloads/feedback/) +- Execute terminal program + (ex. command prompt on window + terminal on linux) +- Enter the below command + -------------------------------------------------------------- + | user@user:~$sdb shell + | sh-4.1$ su + | sh-4.1# cd /opt/usr/media/Downloads/feedback + | sh-4.1# ls + | a.ogg capi_autofeedback capi_feedback + -------------------------------------------------------------- + +How to test exisiting resource +- Play each resource using the test application (capi_feedback) + (refer to include/feedback-ids.h) + -------------------------------------------------------------- + | sh-4.1# ./capi_feedback + | Which do you want to do? + | 0 : Play + | 1 : Change the path + | 2 : Reset the path + | others : quit + | Please input value : 0 + | Please input value (exit:-1) : 37 (FEEDBACK_PATTERN_POWEROFF) + -------------------------------------------------------------- + +How to test new resource +- Change the speicifc enum's file path + -------------------------------------------------------------- + | sh-4.1# ./capi_feedback + | Which do you want to do? + | 0 : Play + | 1 : Change the path + | 2 : Reset the path + | others : quit + | Please input value : 1 + | Please input type(sound:0,vib:1), enum, new path : 0 37 /opt/usr/media/Downloads/feedback/a.ogg + -------------------------------------------------------------- + diff --git a/SLP_FEEDBACK_PG.h b/SLP_FEEDBACK_PG.h index 5ab2fbd..b7006a2 100644 --- a/SLP_FEEDBACK_PG.h +++ b/SLP_FEEDBACK_PG.h @@ -163,6 +163,8 @@ if (r != SVI_SUCCESS){ SVI_VIB_OPERATION_LOWBATT SVI_VIB_OPERATION_LOCK SVI_VIB_OPERATION_UNLOCK + SVI_VIB_OPERATION_LOCK_SWIPE + SVI_VIB_OPERATION_UNLOCK_SWIPE SVI_VIB_OPERATION_CALLCONNECT SVI_VIB_OPERATION_DISCALLCONNECT SVI_VIB_OPERATION_MINUTEMINDER @@ -171,6 +173,7 @@ if (r != SVI_SUCCESS){ SVI_VIB_OPERATION_SENDCHAT SVI_VIB_OPERATION_ONOFFSLIDER SVI_VIB_OPERATION_SHUTTER + SVI_VIB_OPERATION_HOURLY_ALERT @endcode

Sound IDs

@@ -202,6 +205,8 @@ if (r != SVI_SUCCESS){ SVI_SND_OPERATION_LOWBATT SVI_SND_OPERATION_LOCK SVI_SND_OPERATION_UNLOCK + SVI_SND_OPERATION_LOCK_SWIPE + SVI_SND_OPERATION_UNLOCK_SWIPE SVI_SND_OPERATION_CALLCONN SVI_SND_OPERATION_CALLDISCONN SVI_SND_OPERATION_MINUTE_MINDER @@ -210,6 +215,7 @@ if (r != SVI_SUCCESS){ SVI_SND_OPERATION_SENTCHAT SVI_SND_OPERATION_ONOFFSLIDER SVI_SND_OPERATION_SCRCAPTURE + SVI_SND_OPERATION_HOURLY_ALERT @endcode */ diff --git a/TC/_export_env.sh b/TC/_export_env.sh new file mode 100755 index 0000000..72a11ec --- /dev/null +++ b/TC/_export_env.sh @@ -0,0 +1,8 @@ +#!/bin/sh + +. ./config +export TET_INSTALL_PATH=$TET_INSTALL_HOST_PATH # tetware root path +export TET_TARGET_PATH=$TET_INSTALL_PATH/tetware-target # tetware target path +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 diff --git a/TC/_export_target_env.sh b/TC/_export_target_env.sh new file mode 100755 index 0000000..5ddaa53 --- /dev/null +++ b/TC/_export_target_env.sh @@ -0,0 +1,7 @@ +#!/bin/sh +. ./config +export TET_INSTALL_PATH=$TET_INSTALL_TARGET_PATH # path to 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 diff --git a/TC/build.sh b/TC/build.sh index e7a9432..d58c039 100755 --- a/TC/build.sh +++ b/TC/build.sh @@ -1,10 +1,6 @@ #!/bin/sh -export TET_INSTALL_PATH=$HOME/git/tetware/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_env.sh # setting environment variables export TET_SUITE_ROOT=`pwd` FILE_NAME_EXTENSION=`date +%s` diff --git a/TC/clean.sh b/TC/clean.sh new file mode 100755 index 0000000..29743e0 --- /dev/null +++ b/TC/clean.sh @@ -0,0 +1,11 @@ +#!/bin/sh + +. ./_export_env.sh # setting environment variables + +export TET_SUITE_ROOT=`pwd` +RESULT_DIR=results + +tcc -c -p ./ # executing tcc, with clean option (-c) +rm -r $RESULT_DIR +rm -r tet_tmp_dir +rm testcase/tet_captured diff --git a/TC/config b/TC/config new file mode 100644 index 0000000..359c6eb --- /dev/null +++ b/TC/config @@ -0,0 +1,2 @@ +TET_INSTALL_HOST_PATH=/var/tmp/dts_fw/TETware +TET_INSTALL_TARGET_PATH=/var/tmp/dts_fw/TETware diff --git a/TC/execute.sh b/TC/execute.sh index a119011..a4f6095 100755 --- a/TC/execute.sh +++ b/TC/execute.sh @@ -1,10 +1,6 @@ #!/bin/sh -export TET_INSTALL_PATH=/mnt/nfs/git/tetware/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_target_env.sh # setting environment variables export TET_SUITE_ROOT=`pwd` FILE_NAME_EXTENSION=`date +%s` diff --git a/TC/push.sh b/TC/push.sh new file mode 100755 index 0000000..2bbab27 --- /dev/null +++ b/TC/push.sh @@ -0,0 +1,11 @@ +#!/bin/sh + +. ./config + +TC_PATH=/opt/home/$PKG_NAME + +echo $TC_PATH + +sdb root on +sdb shell "mkdir -p $TC_PATH" +sdb push . $TC_PATH diff --git a/TC/testcase/Makefile b/TC/testcase/Makefile new file mode 100644 index 0000000..6ab95dc --- /dev/null +++ b/TC/testcase/Makefile @@ -0,0 +1,28 @@ +CC = gcc + +C_FILES = $(shell ls *.c) + +PKGS = dlog feedback + +#TET_ROOT = /home/idkiller/work/tetware/TETware/tetware-target + +LDFLAGS += $(TET_ROOT)/lib/tet3/tcm_s.o +LDFLAGS += -L$(TET_ROOT)/lib/tet3 -ltcm_s +LDFLAGS += -L$(TET_ROOT)/lib/tet3 -lapi_s +LDFLAGS += `pkg-config --libs $(PKGS)` + +CFLAGS += `pkg-config --cflags $(PKGS)` +CFLAGS += -I. +CFLAGS += -I$(TET_ROOT)/inc/tet3 +CFLAGS += -Wall + +#TARGETS = $(C_FILES:%.c=tc-%) +TCS := $(shell ls -1 *.c | cut -d. -f1) + +all: $(TCS) + +%: %.c + $(CC) -o $@ $< $(CFLAGS) $(LDFLAGS) + +clean: + rm -f $(TCS) diff --git a/TC/testcase/tslist b/TC/testcase/tslist new file mode 100644 index 0000000..bdbd7ca --- /dev/null +++ b/TC/testcase/tslist @@ -0,0 +1 @@ +/testcase/utc_system_feedback diff --git a/TC/testcase/utc_system_feedback.c b/TC/testcase/utc_system_feedback.c new file mode 100644 index 0000000..b784598 --- /dev/null +++ b/TC/testcase/utc_system_feedback.c @@ -0,0 +1,297 @@ +/* + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved + * PROPRIETARY/CONFIDENTIAL + * + * This software is the confidential and proprietary information of SAMSUNG + * ELECTRONICS ("Confidential Information"). You agree and acknowledge that + * this software is owned by Samsung and you shall not disclose such + * Confidential Information and shall use it only in accordance with the terms + * of the license agreement you entered into with SAMSUNG ELECTRONICS. SAMSUNG + * make no representations or warranties about the suitability of the software, + * either express or implied, including but not limited to the implied + * warranties of merchantability, fitness for a particular purpose, or + * non-infringement. SAMSUNG shall not be liable for any damages suffered by + * licensee arising out of or related to this software. + * + */ +#include +#include + +#define API_NAME_FEEDBACK_INITIALIZE "feedback_initialize" +#define API_NAME_FEEDBACK_DEINITIALIZE "feedback_deinitialize" +#define API_NAME_FEEDBACK_PLAY "feedback_play" +#define API_NAME_FEEDBACK_PLAY_TYPE "feedback_play_type" +#define API_NAME_FEEDBACK_GET_RESOURCE_PATH "feedback_get_resource_path" +#define API_NAME_FEEDBACK_SET_RESOURCE_PATH "feedback_set_resource_path" + +static void startup(void); +static void cleanup(void); + +void (*tet_startup)(void) = startup; +void (*tet_cleanup)(void) = cleanup; + + +static void utc_system_feedback_initialize_p(void); +static void utc_system_feedback_deinitialize_p(void); +static void utc_system_feedback_play_p(void); +static void utc_system_feedback_play_n(void); +static void utc_system_feedback_play_type_p(void); +static void utc_system_feedback_play_type_n_1(void); +static void utc_system_feedback_play_type_n_2(void); +static void utc_system_feedback_get_resource_path_p(void); +static void utc_system_feedback_get_resource_path_n_1(void); +static void utc_system_feedback_get_resource_path_n_2(void); +static void utc_system_feedback_get_resource_path_n_3(void); +static void utc_system_feedback_set_resource_path_p(void); +static void utc_system_feedback_set_resource_path_n_1(void); +static void utc_system_feedback_set_resource_path_n_2(void); +static void utc_system_feedback_set_resource_path_n_3(void); +static void utc_system_feedback_set_resource_path_n_4(void); + +enum { + POSITIVE_TC_IDX = 0x01, + NEGATIVE_TC_IDX, +}; + +struct tet_testlist tet_testlist[] = { + { utc_system_feedback_initialize_p, POSITIVE_TC_IDX }, + { utc_system_feedback_deinitialize_p, POSITIVE_TC_IDX }, + { utc_system_feedback_play_p, POSITIVE_TC_IDX }, + { utc_system_feedback_play_n, NEGATIVE_TC_IDX }, + { utc_system_feedback_play_type_p, POSITIVE_TC_IDX }, + { utc_system_feedback_play_type_n_1, NEGATIVE_TC_IDX }, + { utc_system_feedback_play_type_n_2, NEGATIVE_TC_IDX }, + { utc_system_feedback_get_resource_path_p, POSITIVE_TC_IDX }, + { utc_system_feedback_get_resource_path_n_1, NEGATIVE_TC_IDX }, + { utc_system_feedback_get_resource_path_n_2, NEGATIVE_TC_IDX }, + { utc_system_feedback_get_resource_path_n_3, NEGATIVE_TC_IDX }, + { utc_system_feedback_set_resource_path_p, POSITIVE_TC_IDX }, + { utc_system_feedback_set_resource_path_n_1, NEGATIVE_TC_IDX }, + { utc_system_feedback_set_resource_path_n_2, NEGATIVE_TC_IDX }, + { utc_system_feedback_set_resource_path_n_3, NEGATIVE_TC_IDX }, + { utc_system_feedback_set_resource_path_n_4, NEGATIVE_TC_IDX }, + { NULL, 0 }, +}; + +#define SOUND_FILE_PATH "/usr/share/feedback/sound/touch/touch.ogg" +#define VIBRATION_FILE_PATH "/usr/share/deviced/HW_touch_30ms_sharp.ivt" + +static void startup(void) +{ +} + +static void cleanup(void) +{ +} + +/** + * @brief Positive test case of feedback_initialize() + */ +static void utc_system_feedback_initialize_p(void) +{ + int ret; + + ret = feedback_initialize(); + dts_check_eq(API_NAME_FEEDBACK_INITIALIZE, ret, FEEDBACK_ERROR_NONE); +} + +/** + * @brief Positive test case of feedback_deinitialize() + */ +static void utc_system_feedback_deinitialize_p(void) +{ + int ret; + + ret = feedback_deinitialize(); + dts_check_eq(API_NAME_FEEDBACK_DEINITIALIZE, ret, FEEDBACK_ERROR_NONE); +} + +/** + * @brief Positive test case of feedback_play() + */ +static void utc_system_feedback_play_p(void) +{ + int i, ret; + + for (i = 0; i < FEEDBACK_PATTERN_END; ++i) { + dts_message(API_NAME_FEEDBACK_PLAY, "Play [%d] pattern", i); + + ret = feedback_play(i); + dts_check_eq(API_NAME_FEEDBACK_PLAY, ret, FEEDBACK_ERROR_NONE); + } +} + +/** + * @brief Negative test case of feedback_play() + */ +static void utc_system_feedback_play_n(void) +{ + int ret; + + ret = feedback_play(-1); + dts_check_ne(API_NAME_FEEDBACK_PLAY, ret, FEEDBACK_ERROR_NONE); +} + +/** + * @brief Positive test case of feedback_play_type() + */ +static void utc_system_feedback_play_type_p(void) +{ + int i, ret; + + for (i = 0; i < FEEDBACK_PATTERN_END; ++i) { + dts_message(API_NAME_FEEDBACK_PLAY_TYPE, "Play [%d] pattern", i); + + ret = feedback_play_type(FEEDBACK_TYPE_SOUND, i); + dts_check_eq(API_NAME_FEEDBACK_PLAY_TYPE, ret, FEEDBACK_ERROR_NONE, "Sound Test"); + + ret = feedback_play_type(FEEDBACK_TYPE_VIBRATION, i); + dts_check_eq(API_NAME_FEEDBACK_PLAY_TYPE, ret, FEEDBACK_ERROR_NONE, "Vibration Test"); + } +} + +/** + * @brief Negative test case of feedback_play_type() + */ +static void utc_system_feedback_play_type_n_1(void) +{ + int ret; + + ret = feedback_play_type(-1, FEEDBACK_PATTERN_TAP); + dts_check_ne(API_NAME_FEEDBACK_PLAY_TYPE, ret, FEEDBACK_ERROR_NONE); +} + +/** + * @brief Negative test case of feedback_play_type() + */ +static void utc_system_feedback_play_type_n_2(void) +{ + int ret; + + ret = feedback_play_type(FEEDBACK_TYPE_SOUND, -1); + dts_check_ne(API_NAME_FEEDBACK_PLAY_TYPE, ret, FEEDBACK_ERROR_NONE); +} + +/** + * @brief Positive test case of feedback_get_resource_path() + */ +static void utc_system_feedback_get_resource_path_p(void) +{ + int i, ret; + char *str = NULL; + + for (i = 0; i < FEEDBACK_PATTERN_END; ++i) { + dts_message(API_NAME_FEEDBACK_GET_RESOURCE_PATH, "Get [%d] pattern path", i); + + ret = feedback_get_resource_path(FEEDBACK_TYPE_SOUND, i, &str); + dts_check_eq(API_NAME_FEEDBACK_GET_RESOURCE_PATH, ret, FEEDBACK_ERROR_NONE, + "[%d] sound file path : %s", i, str); + free(str); + str = NULL; + + ret = feedback_get_resource_path(FEEDBACK_TYPE_VIBRATION, i, &str); + dts_check_eq(API_NAME_FEEDBACK_GET_RESOURCE_PATH, ret, FEEDBACK_ERROR_NONE, + "[%d] vibration file path : %s", i, str); + free(str); + str = NULL; + } +} + +/** + * @brief Negative test case of feedback_get_resource_path() + */ +static void utc_system_feedback_get_resource_path_n_1(void) +{ + int ret; + char *str = NULL; + + ret = feedback_get_resource_path(-1, FEEDBACK_PATTERN_TAP, &str); + dts_check_ne(API_NAME_FEEDBACK_GET_RESOURCE_PATH, ret, FEEDBACK_ERROR_NONE); +} + +/** + * @brief Negative test case of feedback_get_resource_path() + */ +static void utc_system_feedback_get_resource_path_n_2(void) +{ + int ret; + char *str = NULL; + + ret = feedback_get_resource_path(FEEDBACK_TYPE_SOUND, -1, &str); + dts_check_ne(API_NAME_FEEDBACK_GET_RESOURCE_PATH, ret, FEEDBACK_ERROR_NONE); +} + +/** + * @brief Negative test case of feedback_get_resource_path() + */ +static void utc_system_feedback_get_resource_path_n_3(void) +{ + int ret; + + ret = feedback_get_resource_path(FEEDBACK_TYPE_SOUND, FEEDBACK_PATTERN_TAP, NULL); + dts_check_ne(API_NAME_FEEDBACK_GET_RESOURCE_PATH, ret, FEEDBACK_ERROR_NONE); +} + +/** + * @brief Positive test case of feedback_set_resource_path() + */ +static void utc_system_feedback_set_resource_path_p(void) +{ + int i, ret; + + for (i = 0; i < FEEDBACK_PATTERN_END; ++i) { + dts_message(API_NAME_FEEDBACK_SET_RESOURCE_PATH, "Set [%d] pattern path", i); + + ret = feedback_set_resource_path(FEEDBACK_TYPE_SOUND, i, SOUND_FILE_PATH); + dts_check_eq(API_NAME_FEEDBACK_SET_RESOURCE_PATH, ret, FEEDBACK_ERROR_NONE); + + ret = feedback_set_resource_path(FEEDBACK_TYPE_VIBRATION, i, VIBRATION_FILE_PATH); + dts_check_eq(API_NAME_FEEDBACK_SET_RESOURCE_PATH, ret, FEEDBACK_ERROR_NONE); + } +} + +/** + * @brief Negative test case of feedback_set_resource_path() + */ +static void utc_system_feedback_set_resource_path_n_1(void) +{ + int ret; + + ret = feedback_set_resource_path(-1, FEEDBACK_PATTERN_TAP, SOUND_FILE_PATH); + dts_check_ne(API_NAME_FEEDBACK_SET_RESOURCE_PATH, ret, FEEDBACK_ERROR_NONE); +} + +/** + * @brief Negative test case of feedback_set_resource_path() + */ +static void utc_system_feedback_set_resource_path_n_2(void) +{ + int ret; + + ret = feedback_set_resource_path(FEEDBACK_TYPE_SOUND, -1, SOUND_FILE_PATH); + dts_check_ne(API_NAME_FEEDBACK_SET_RESOURCE_PATH, ret, FEEDBACK_ERROR_NONE); +} + +/** + * @brief Negative test case of feedback_set_resource_path() + */ +static void utc_system_feedback_set_resource_path_n_3(void) +{ + int ret; + + ret = feedback_set_resource_path(FEEDBACK_TYPE_SOUND, FEEDBACK_PATTERN_TAP, NULL); + dts_check_ne(API_NAME_FEEDBACK_SET_RESOURCE_PATH, ret, FEEDBACK_ERROR_NONE); +} + +/** + * @brief Negative test case of feedback_set_resource_path() + */ +static void utc_system_feedback_set_resource_path_n_4(void) +{ + int ret; + + ret = feedback_set_resource_path(FEEDBACK_TYPE_SOUND, FEEDBACK_PATTERN_TAP, "/usr/share/no_file"); + dts_check_ne(API_NAME_FEEDBACK_SET_RESOURCE_PATH, ret, FEEDBACK_ERROR_NONE); +} + diff --git a/TC/tet_code b/TC/tet_code deleted file mode 100755 index a2cf6c1..0000000 --- a/TC/tet_code +++ /dev/null @@ -1,12 +0,0 @@ -# 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" diff --git a/TC/tet_scen b/TC/tet_scen old mode 100755 new mode 100644 index 43cbc9b..03f029a --- a/TC/tet_scen +++ b/TC/tet_scen @@ -4,4 +4,4 @@ all # Test scenario TEST - :include:/unit/tslist + :include:/testcase/tslist diff --git a/TC/tetbuild.cfg b/TC/tetbuild.cfg old mode 100755 new mode 100644 index a584acd..f7eda55 --- a/TC/tetbuild.cfg +++ b/TC/tetbuild.cfg @@ -1,2 +1,5 @@ -TET_OUTPUT_CAPTURE=False -TET_BUILD_TOOL=make +TET_OUTPUT_CAPTURE=True # capture option for build operation checking +TET_BUILD_TOOL=make # build with using make command +TET_BUILD_FILE=-f Makefile # execution file (Makefile) for build +TET_API_COMPLIANT=True # use TET API in Test Case ? +TET_PASS_TC_NAME=True # report passed TC name in Journal file? diff --git a/TC/tetclean.cfg b/TC/tetclean.cfg old mode 100755 new mode 100644 index c66eda4..02d7030 --- a/TC/tetclean.cfg +++ b/TC/tetclean.cfg @@ -1,2 +1,5 @@ -TET_OUTPUT_CAPTURE=False -TET_CLEAN_TOOL=make clean +TET_OUTPUT_CAPTURE=True # capture option +TET_CLEAN_TOOL= make clean # clean tool +TET_CLEAN_FILE= Makefile # file for clean +TET_API_COMPLIANT=True # TET API useage +TET_PASS_TC_NAME=True # showing name , passed TC diff --git a/TC/tetexec.cfg b/TC/tetexec.cfg old mode 100755 new mode 100644 index 0d9d39a..ef3e452 --- a/TC/tetexec.cfg +++ b/TC/tetexec.cfg @@ -1 +1,5 @@ -TET_OUTPUT_CAPTURE=False +TET_OUTPUT_CAPTURE=True # capturing execution or not +TET_EXEC_TOOL= # ex) exec : execution tool set up/ Optional +TET_EXEC_FILE= # ex) exectool : execution file/ Optional +TET_API_COMPLIANT=True # Test case or Tool usesTET API? +TET_PASS_TC_NAME=True # showing Passed TC name ? diff --git a/TC/unit/Makefile b/TC/unit/Makefile deleted file mode 100755 index 0f41c47..0000000 --- a/TC/unit/Makefile +++ /dev/null @@ -1,22 +0,0 @@ -CC ?= gcc - -TARGETS = utc_ApplicationFW_svi_init_func utc_ApplicationFW_svi_fini_func utc_ApplicationFW_svi_play_func - -PKGS = vconf devman_haptic mm-sound dlog svi - -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) diff --git a/TC/unit/tc_gen.sh b/TC/unit/tc_gen.sh deleted file mode 100755 index 54f482d..0000000 --- a/TC/unit/tc_gen.sh +++ /dev/null @@ -1,28 +0,0 @@ -#!/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" diff --git a/TC/unit/tslist b/TC/unit/tslist deleted file mode 100755 index 6de8918..0000000 --- a/TC/unit/tslist +++ /dev/null @@ -1,3 +0,0 @@ -/unit/utc_ApplicationFW_svi_init_func -/unit/utc_ApplicationFW_svi_fini_func -/unit/utc_ApplicationFW_svi_play_func diff --git a/TC/unit/utc_ApplicationFW_svi_fini_func.c b/TC/unit/utc_ApplicationFW_svi_fini_func.c deleted file mode 100755 index e67311a..0000000 --- a/TC/unit/utc_ApplicationFW_svi_fini_func.c +++ /dev/null @@ -1,79 +0,0 @@ -/* - * libsvi - * - * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved. - * - * Contact: Seokkyu Jang - * Contact: Sangil Yoon - * - * 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 -#include - -static void startup(void); -static void cleanup(void); - -void (*tet_startup)(void) = startup; -void (*tet_cleanup)(void) = cleanup; - -static void utc_ApplicationFW_svi_fini_func_01(void); - -static int handle = 0; - -enum { - POSITIVE_TC_IDX = 0x01, -}; - -struct tet_testlist tet_testlist[] = { - { utc_ApplicationFW_svi_fini_func_01, POSITIVE_TC_IDX }, - { NULL, 0}, -}; - -static void startup(void) -{ - int r; - char *err; - - r = svi_init(&handle); - - if (r) { - err = "Cannot init svi"; - tet_infoline(err); - tet_delete(POSITIVE_TC_IDX, err); - - } -} - -static void cleanup(void) -{ -} - -/** - * @brief Positive test case of svi_fini() - */ -static void utc_ApplicationFW_svi_fini_func_01(void) -{ - int r = 0; - - r = svi_fini(handle); - - if (r) { - tet_infoline("svi_fini() failed in positive test case"); - tet_result(TET_FAIL); - return; - } - tet_result(TET_PASS); -} diff --git a/TC/unit/utc_ApplicationFW_svi_init_func.c b/TC/unit/utc_ApplicationFW_svi_init_func.c deleted file mode 100755 index 1dedf1d..0000000 --- a/TC/unit/utc_ApplicationFW_svi_init_func.c +++ /dev/null @@ -1,72 +0,0 @@ -/* - * libsvi - * - * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved. - * - * Contact: Seokkyu Jang - * Contact: Sangil Yoon - * - * 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 -#include - -static void startup(void); -static void cleanup(void); - -void (*tet_startup)(void) = startup; -void (*tet_cleanup)(void) = cleanup; - -static void utc_ApplicationFW_svi_init_func_01(void); - -static int handle = 0; - -enum { - POSITIVE_TC_IDX = 0x01, -}; - -struct tet_testlist tet_testlist[] = { - { utc_ApplicationFW_svi_init_func_01, POSITIVE_TC_IDX }, - { NULL, 0}, -}; - -static void startup(void) -{ -} - -static void cleanup(void) -{ -} - -/** - * @brief Positive test case of svi_init() - */ -static void utc_ApplicationFW_svi_init_func_01(void) -{ - int r = 0; - - - r = svi_init(&handle); - - if (r) { - tet_infoline("svi_init() failed in positive test case"); - tet_result(TET_FAIL); - return; - } - tet_result(TET_PASS); - - svi_fini(handle); -} - diff --git a/TC/unit/utc_ApplicationFW_svi_play_func.c b/TC/unit/utc_ApplicationFW_svi_play_func.c deleted file mode 100755 index e7740ac..0000000 --- a/TC/unit/utc_ApplicationFW_svi_play_func.c +++ /dev/null @@ -1,135 +0,0 @@ -/* - * libsvi - * - * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved. - * - * Contact: Seokkyu Jang - * Contact: Sangil Yoon - * - * 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 -#include -#include - -static void startup(void); -static void cleanup(void); - -void (*tet_startup)(void) = startup; -void (*tet_cleanup)(void) = cleanup; - -static void utc_ApplicationFW_svi_play_func_01(void); -static void utc_ApplicationFW_svi_play_func_02(void); - -static int handle = 0; -enum { - POSITIVE_TC_IDX = 0x01, - NEGATIVE_TC_IDX, -}; - -struct tet_testlist tet_testlist[] = { - { utc_ApplicationFW_svi_play_func_01, POSITIVE_TC_IDX }, - { utc_ApplicationFW_svi_play_func_02, NEGATIVE_TC_IDX }, - { NULL, 0}, -}; - -static void startup(void) -{ - int r; - char *err; - - r = svi_init(&handle); - - if (r) { - err = "Cannot init svi"; - tet_infoline(err); - tet_delete(POSITIVE_TC_IDX, err); - tet_delete(NEGATIVE_TC_IDX, err); - } -} - -static void cleanup(void) -{ - svi_fini(handle); -} - -/** - * @brief Positive test case of svi_play() - */ -static void utc_ApplicationFW_svi_play_func_01(void) -{ - int r = 0; - - r = svi_play(handle, SVI_VIB_NONE, SVI_SND_NONE); - - if (r) { - tet_infoline("svi_play() failed in positive test case"); - tet_result(TET_FAIL); - return; - } - - r = svi_play(handle, SVI_VIB_TOUCH_TOUCH, SVI_SND_TOUCH_TOUCH1); - - if (r) { - tet_infoline("svi_play() failed in positive test case"); - tet_result(TET_FAIL); - return; - } - - r = svi_play(handle, SVI_VIB_OPERATION_VIBRATION, SVI_SND_TOUCH_KEY00); - - if (r) { - tet_infoline("svi_play() failed in positive test case"); - tet_result(TET_FAIL); - return; - } - - r = svi_play(handle, SVI_VIB_OPERATION_POWER_ON, SVI_SND_TOUCH_KEY_STAR); - - if (r) { - tet_infoline("svi_play() failed in positive test case"); - tet_result(TET_FAIL); - return; - } - - tet_result(TET_PASS); -} - -/** - * @brief Negative test case of ug_init svi_play() - */ -static void utc_ApplicationFW_svi_play_func_02(void) -{ - int r = 0; - - r = svi_play(handle, -100, SVI_SND_NONE); - - if (r != -1) { - tet_infoline("svi_play() failed in negative test case"); - tet_result(TET_FAIL); - return; - } - - r = svi_play(handle, SVI_VIB_NONE, -100); - - if (r != -1) { - tet_infoline("svi_play() failed in negative test case"); - tet_result(TET_FAIL); - return; - } - - - tet_result(TET_PASS); -} diff --git a/TC/unit/utc_MODULE_API_func.c.in b/TC/unit/utc_MODULE_API_func.c.in deleted file mode 100755 index b235fa3..0000000 --- a/TC/unit/utc_MODULE_API_func.c.in +++ /dev/null @@ -1,64 +0,0 @@ -#include - -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); -} diff --git a/data/emulator/sound.xml b/data/emulator/sound.xml new file mode 100644 index 0000000..fa8c279 --- /dev/null +++ b/data/emulator/sound.xml @@ -0,0 +1,133 @@ + + + + Sound Resource + + + /usr/share/feedback/sound/touch/touch.ogg + + + + /usr/share/feedback/sound/touch/touch.ogg + + + + /usr/share/feedback/sound/touch/touch.ogg + + + + /usr/share/feedback/sound/touch/touch.ogg + + + + /usr/share/feedback/sound/touch/touch.ogg + + + + /usr/share/feedback/sound/touch/touch.ogg + + + + /usr/share/feedback/sound/touch/touch.ogg + + + + /usr/share/feedback/sound/touch/touch.ogg + + + + /usr/share/feedback/sound/touch/touch.ogg + + + + /usr/share/feedback/sound/touch/touch.ogg + + + + /usr/share/feedback/sound/touch/touch.ogg + + + + /usr/share/feedback/sound/touch/touch.ogg + + + + /usr/share/feedback/sound/touch/touch.ogg + + + + /usr/share/feedback/sound/touch/touch.ogg + + + + /usr/share/feedback/sound/operation/power_on.ogg + + + + /usr/share/feedback/sound/operation/system.ogg + + + + /usr/share/feedback/sound/operation/system.ogg + + + + /usr/share/feedback/sound/operation/system.ogg + + + + /usr/share/feedback/sound/operation/system.ogg + + + + /usr/share/feedback/sound/operation/system.ogg + + + + /usr/share/feedback/sound/operation/system.ogg + + + + /usr/share/feedback/sound/operation/system.ogg + + + + /usr/share/feedback/sound/operation/system.ogg + + + + /usr/share/feedback/sound/operation/system.ogg + + + + /usr/share/feedback/sound/operation/system.ogg + + + + /usr/share/feedback/sound/operation/system.ogg + + + + /usr/share/feedback/sound/operation/system.ogg + + + + /usr/share/feedback/sound/operation/shutter.ogg + + + + /usr/share/feedback/sound/operation/system.ogg + + + + /usr/share/feedback/sound/operation/ringtone.ogg + + + + /usr/share/feedback/sound/operation/ringtone.ogg + + + + /usr/share/feedback/sound/operation/notification.ogg + + diff --git a/data/emulator/sound/operation/notification.ogg b/data/emulator/sound/operation/notification.ogg new file mode 100755 index 0000000..457f7e8 Binary files /dev/null and b/data/emulator/sound/operation/notification.ogg differ diff --git a/data/emulator/sound/operation/power_on.ogg b/data/emulator/sound/operation/power_on.ogg new file mode 100755 index 0000000..7756406 Binary files /dev/null and b/data/emulator/sound/operation/power_on.ogg differ diff --git a/data/emulator/sound/operation/ringtone.ogg b/data/emulator/sound/operation/ringtone.ogg new file mode 100755 index 0000000..2653dd6 Binary files /dev/null and b/data/emulator/sound/operation/ringtone.ogg differ diff --git a/data/emulator/sound/operation/shutter.ogg b/data/emulator/sound/operation/shutter.ogg new file mode 100755 index 0000000..c22c810 Binary files /dev/null and b/data/emulator/sound/operation/shutter.ogg differ diff --git a/data/emulator/sound/operation/system.ogg b/data/emulator/sound/operation/system.ogg new file mode 100755 index 0000000..69c8425 Binary files /dev/null and b/data/emulator/sound/operation/system.ogg differ diff --git a/data/emulator/sound/touch/touch.ogg b/data/emulator/sound/touch/touch.ogg new file mode 100755 index 0000000..8be60ce Binary files /dev/null and b/data/emulator/sound/touch/touch.ogg differ diff --git a/data/emulator/vibration.xml b/data/emulator/vibration.xml new file mode 100644 index 0000000..09887c2 --- /dev/null +++ b/data/emulator/vibration.xml @@ -0,0 +1,157 @@ + + + + Vibration Resource + + + TOUCH + + + + TOUCH + + + + NOTIFICATION + + + + NOTIFICATION + + + + NOTIFICATION + + + + NOTIFICATION + + + + NOTIFICATION + + + + NOTIFICATION + + + + NOTIFICATION + + + + NOTIFICATION + + + + NOTIFICATION + + + + NOTIFICATION + + + + NOTIFICATION + + + + NOTIFICATION + + + + SYSTEM + + + + SYSTEM + + + + SYSTEM + + + + SYSTEM + + + + SYSTEM + + + + SYSTEM + + + + SYSTEM + + + + SYSTEM + + + + SYSTEM + + + + SYSTEM + + + + SYSTEM + + + + SYSTEM + + + + SYSTEM + + + + SYSTEM + + + + SYSTEM + + + + SYSTEM + + + + SYSTEM + + + + SYSTEM + + + + SYSTEM + + + + SYSTEM + + + + SYSTEM + + + + SYSTEM + + + + SYSTEM + + + + SYSTEM + + diff --git a/data/feedback/haptic/default/Basic_call.tht b/data/feedback/haptic/default/Basic_call.tht deleted file mode 100755 index 3167416..0000000 Binary files a/data/feedback/haptic/default/Basic_call.tht and /dev/null differ diff --git a/data/feedback/haptic/touch/touch.tht b/data/feedback/haptic/touch/touch.tht deleted file mode 100755 index e374bea..0000000 Binary files a/data/feedback/haptic/touch/touch.tht and /dev/null differ diff --git a/data/feedback/sound/operation/call_connect.wav b/data/feedback/sound/operation/call_connect.wav deleted file mode 100755 index 5383bdf..0000000 Binary files a/data/feedback/sound/operation/call_connect.wav and /dev/null differ diff --git a/data/feedback/sound/operation/call_disconnect.wav b/data/feedback/sound/operation/call_disconnect.wav deleted file mode 100755 index 5383bdf..0000000 Binary files a/data/feedback/sound/operation/call_disconnect.wav and /dev/null differ diff --git a/data/feedback/sound/operation/charger_connection.wav b/data/feedback/sound/operation/charger_connection.wav deleted file mode 100755 index 5383bdf..0000000 Binary files a/data/feedback/sound/operation/charger_connection.wav and /dev/null differ diff --git a/data/feedback/sound/operation/fully_charged.wav b/data/feedback/sound/operation/fully_charged.wav deleted file mode 100755 index 5383bdf..0000000 Binary files a/data/feedback/sound/operation/fully_charged.wav and /dev/null differ diff --git a/data/feedback/sound/operation/list_reorder.wav b/data/feedback/sound/operation/list_reorder.wav deleted file mode 100755 index 5383bdf..0000000 Binary files a/data/feedback/sound/operation/list_reorder.wav and /dev/null differ diff --git a/data/feedback/sound/operation/lock.wav b/data/feedback/sound/operation/lock.wav deleted file mode 100755 index 5383bdf..0000000 Binary files a/data/feedback/sound/operation/lock.wav and /dev/null differ diff --git a/data/feedback/sound/operation/low_battery.wav b/data/feedback/sound/operation/low_battery.wav deleted file mode 100755 index 5383bdf..0000000 Binary files a/data/feedback/sound/operation/low_battery.wav and /dev/null differ diff --git a/data/feedback/sound/operation/minute_minder.wav b/data/feedback/sound/operation/minute_minder.wav deleted file mode 100755 index 5383bdf..0000000 Binary files a/data/feedback/sound/operation/minute_minder.wav and /dev/null differ diff --git a/data/feedback/sound/operation/power_on.wav b/data/feedback/sound/operation/power_on.wav deleted file mode 100755 index 5383bdf..0000000 Binary files a/data/feedback/sound/operation/power_on.wav and /dev/null differ diff --git a/data/feedback/sound/operation/shutter.wav b/data/feedback/sound/operation/shutter.wav deleted file mode 100755 index 9dea92b..0000000 Binary files a/data/feedback/sound/operation/shutter.wav and /dev/null differ diff --git a/data/feedback/sound/operation/slider_sweep.wav b/data/feedback/sound/operation/slider_sweep.wav deleted file mode 100755 index 5383bdf..0000000 Binary files a/data/feedback/sound/operation/slider_sweep.wav and /dev/null differ diff --git a/data/feedback/sound/operation/unlock.wav b/data/feedback/sound/operation/unlock.wav deleted file mode 100755 index 5383bdf..0000000 Binary files a/data/feedback/sound/operation/unlock.wav and /dev/null differ diff --git a/data/feedback/sound/operation/volume_control.wav b/data/feedback/sound/operation/volume_control.wav deleted file mode 100755 index 1ec9de4..0000000 Binary files a/data/feedback/sound/operation/volume_control.wav and /dev/null differ diff --git a/data/feedback/sound/touch/key0.wav b/data/feedback/sound/touch/key0.wav deleted file mode 100755 index e2cd877..0000000 Binary files a/data/feedback/sound/touch/key0.wav and /dev/null differ diff --git a/data/feedback/sound/touch/key1.wav b/data/feedback/sound/touch/key1.wav deleted file mode 100755 index fa77cf4..0000000 Binary files a/data/feedback/sound/touch/key1.wav and /dev/null differ diff --git a/data/feedback/sound/touch/key2.wav b/data/feedback/sound/touch/key2.wav deleted file mode 100755 index 53da84c..0000000 Binary files a/data/feedback/sound/touch/key2.wav and /dev/null differ diff --git a/data/feedback/sound/touch/key3.wav b/data/feedback/sound/touch/key3.wav deleted file mode 100755 index ede9a2b..0000000 Binary files a/data/feedback/sound/touch/key3.wav and /dev/null differ diff --git a/data/feedback/sound/touch/key4.wav b/data/feedback/sound/touch/key4.wav deleted file mode 100755 index 105bddc..0000000 Binary files a/data/feedback/sound/touch/key4.wav and /dev/null differ diff --git a/data/feedback/sound/touch/key5.wav b/data/feedback/sound/touch/key5.wav deleted file mode 100755 index a34b4d0..0000000 Binary files a/data/feedback/sound/touch/key5.wav and /dev/null differ diff --git a/data/feedback/sound/touch/key6.wav b/data/feedback/sound/touch/key6.wav deleted file mode 100755 index 34a8bec..0000000 Binary files a/data/feedback/sound/touch/key6.wav and /dev/null differ diff --git a/data/feedback/sound/touch/key7.wav b/data/feedback/sound/touch/key7.wav deleted file mode 100755 index 3b845a4..0000000 Binary files a/data/feedback/sound/touch/key7.wav and /dev/null differ diff --git a/data/feedback/sound/touch/key8.wav b/data/feedback/sound/touch/key8.wav deleted file mode 100755 index 2a05528..0000000 Binary files a/data/feedback/sound/touch/key8.wav and /dev/null differ diff --git a/data/feedback/sound/touch/key9.wav b/data/feedback/sound/touch/key9.wav deleted file mode 100755 index 80699c8..0000000 Binary files a/data/feedback/sound/touch/key9.wav and /dev/null differ diff --git a/data/feedback/sound/touch/keyasterisk.wav b/data/feedback/sound/touch/keyasterisk.wav deleted file mode 100755 index 9ec2e71..0000000 Binary files a/data/feedback/sound/touch/keyasterisk.wav and /dev/null differ diff --git a/data/feedback/sound/touch/keysharp.wav b/data/feedback/sound/touch/keysharp.wav deleted file mode 100755 index ce7cd88..0000000 Binary files a/data/feedback/sound/touch/keysharp.wav and /dev/null differ diff --git a/data/feedback/sound/touch/sip.wav b/data/feedback/sound/touch/sip.wav deleted file mode 100755 index 5b44d12..0000000 Binary files a/data/feedback/sound/touch/sip.wav and /dev/null differ diff --git a/data/feedback/sound/touch/sip_backspace.wav b/data/feedback/sound/touch/sip_backspace.wav deleted file mode 100755 index 5b44d12..0000000 Binary files a/data/feedback/sound/touch/sip_backspace.wav and /dev/null differ diff --git a/data/feedback/sound/touch/touch.wav b/data/feedback/sound/touch/touch.wav deleted file mode 100755 index 1ec9de4..0000000 Binary files a/data/feedback/sound/touch/touch.wav and /dev/null differ diff --git a/data/feedback/vibration.xml b/data/feedback/vibration.xml deleted file mode 100644 index 9db7adc..0000000 --- a/data/feedback/vibration.xml +++ /dev/null @@ -1,205 +0,0 @@ - - - - Vibration Resource - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - VEhGTSwAAABmbXQgFAAAAAEAAQBjAAAAZAAAAGRhdGEQ - - - - VEhGTSwAAABmbXQgFAAAAAEAAQBjAAAAZAAAAGRhdGEQ - - - - - - - - - - - - VEhGTWoAAABmbXQgFAAAAAEAAQBjAAAArA0AAGRhdGFOAAAA////////////////////////////////////////AAAAAAAAAAAAAAAAAA - - - - VEhGTWoAAABmbXQgFAAAAAEAAQBjAAAArA0AAGRhdGFOAAAA////////////////////////////////////////AAAAAAAAAAAAAAAAAA - - - - VEhGTWoAAABmbXQgFAAAAAEAAQBjAAAArA0AAGRhdGFOAAAA////////////////////////////////////////AAAAAAAAAAAAAAAAAA - - - - VEhGTWoAAABmbXQgFAAAAAEAAQBjAAAArA0AAGRhdGFOAAAA////////////////////////////////////////AAAAAAAAAAAAAAAAAA - - - - VEhGTWoAAABmbXQgFAAAAAEAAQBjAAAArA0AAGRhdGFOAAAA////////////////////////////////////////AAAAAAAAAAAAAAAAAA - - - - VEhGTWoAAABmbXQgFAAAAAEAAQBjAAAArA0AAGRhdGFOAAAA////////////////////////////////////////AAAAAAAAAAAAAAAAAA - - - - VEhGTWoAAABmbXQgFAAAAAEAAQBjAAAArA0AAGRhdGFOAAAA////////////////////////////////////////AAAAAAAAAAAAAAAAAA - - - - VEhGTWoAAABmbXQgFAAAAAEAAQBjAAAArA0AAGRhdGFOAAAA////////////////////////////////////////AAAAAAAAAAAAAAAAAA - - - - VEhGTWoAAABmbXQgFAAAAAEAAQBjAAAArA0AAGRhdGFOAAAA////////////////////////////////////////AAAAAAAAAAAAAAAAAA - - - - VEhGTWoAAABmbXQgFAAAAAEAAQBjAAAArA0AAGRhdGFOAAAA////////////////////////////////////////AAAAAAAAAAAAAAAAAA - - - - VEhGTWoAAABmbXQgFAAAAAEAAQBjAAAArA0AAGRhdGFOAAAA////////////////////////////////////////AAAAAAAAAAAAAAAAAA - - - - VEhGTWoAAABmbXQgFAAAAAEAAQBjAAAArA0AAGRhdGFOAAAA////////////////////////////////////////AAAAAAAAAAAAAAAAAA - - - - VEhGTWoAAABmbXQgFAAAAAEAAQBjAAAArA0AAGRhdGFOAAAA////////////////////////////////////////AAAAAAAAAAAAAAAAAA - - - - VEhGTWoAAABmbXQgFAAAAAEAAQBjAAAArA0AAGRhdGFOAAAA////////////////////////////////////////AAAAAAAAAAAAAAAAAA - - - - VEhGTWoAAABmbXQgFAAAAAEAAQBjAAAArA0AAGRhdGFOAAAA////////////////////////////////////////AAAAAAAAAAAAAAAAAA - - - - VEhGTWoAAABmbXQgFAAAAAEAAQBjAAAArA0AAGRhdGFOAAAA////////////////////////////////////////AAAAAAAAAAAAAAAAAA - - - - VEhGTWoAAABmbXQgFAAAAAEAAQBjAAAArA0AAGRhdGFOAAAA////////////////////////////////////////AAAAAAAAAAAAAAAAAA - - - - VEhGTWoAAABmbXQgFAAAAAEAAQBjAAAArA0AAGRhdGFOAAAA////////////////////////////////////////AAAAAAAAAAAAAAAAAA - - - - VEhGTWoAAABmbXQgFAAAAAEAAQBjAAAArA0AAGRhdGFOAAAA////////////////////////////////////////AAAAAAAAAAAAAAAAAA - - - - VEhGTWoAAABmbXQgFAAAAAEAAQBjAAAArA0AAGRhdGFOAAAA////////////////////////////////////////AAAAAAAAAAAAAAAAAA - - - - VEhGTWoAAABmbXQgFAAAAAEAAQBjAAAArA0AAGRhdGFOAAAA////////////////////////////////////////AAAAAAAAAAAAAAAAAA - - - - VEhGTWoAAABmbXQgFAAAAAEAAQBjAAAArA0AAGRhdGFOAAAA////////////////////////////////////////AAAAAAAAAAAAAAAAAA - - - - VEhGTWoAAABmbXQgFAAAAAEAAQBjAAAArA0AAGRhdGFOAAAA////////////////////////////////////////AAAAAAAAAAAAAAAAAA - - - - VEhGTWoAAABmbXQgFAAAAAEAAQBjAAAArA0AAGRhdGFOAAAA////////////////////////////////////////AAAAAAAAAAAAAAAAAA - - - - VEhGTWoAAABmbXQgFAAAAAEAAQBjAAAArA0AAGRhdGFOAAAA////////////////////////////////////////AAAAAAAAAAAAAAAAAA - - - - VEhGTWoAAABmbXQgFAAAAAEAAQBjAAAArA0AAGRhdGFOAAAA////////////////////////////////////////AAAAAAAAAAAAAAAAAA - - - - - - - - - - - - - - - - - - diff --git a/data/micro/sound.xml b/data/micro/sound.xml new file mode 100644 index 0000000..2ff9be9 --- /dev/null +++ b/data/micro/sound.xml @@ -0,0 +1,181 @@ + + + + Sound Resource + + + /usr/share/feedback/sound/touch/touch.ogg + + + + /usr/share/feedback/sound/touch/touch.ogg + + + + /usr/share/feedback/sound/touch/touch.ogg + + + + /usr/share/feedback/sound/touch/touch.ogg + + + + /usr/share/feedback/sound/touch/touch.ogg + + + + /usr/share/feedback/sound/touch/touch.ogg + + + + /usr/share/feedback/sound/touch/touch.ogg + + + + /usr/share/feedback/sound/touch/touch.ogg + + + + /usr/share/feedback/sound/touch/touch.ogg + + + + /usr/share/feedback/sound/touch/touch.ogg + + + + /usr/share/feedback/sound/touch/touch.ogg + + + + /usr/share/feedback/sound/touch/touch.ogg + + + + /usr/share/feedback/sound/touch/touch.ogg + + + + /usr/share/feedback/sound/touch/touch.ogg + + + + /usr/share/feedback/sound/touch/touch.ogg + + + + /usr/share/feedback/sound/touch/touch.ogg + + + + /usr/share/feedback/sound/touch/touch.ogg + + + + /usr/share/feedback/sound/touch/touch.ogg + + + + /usr/share/feedback/sound/operation/notification.ogg + + + + /usr/share/feedback/sound/operation/notification.ogg + + + + /usr/share/feedback/sound/operation/notification.ogg + + + + /usr/share/feedback/sound/operation/power_on.ogg + + + + /usr/share/feedback/sound/operation/system.ogg + + + + /usr/share/feedback/sound/operation/system.ogg + + + + /usr/share/feedback/sound/operation/system.ogg + + + + /usr/share/feedback/sound/operation/system.ogg + + + + /usr/share/feedback/sound/operation/system.ogg + + + + /usr/share/feedback/sound/operation/system.ogg + + + + /usr/share/feedback/sound/operation/system.ogg + + + + /usr/share/feedback/sound/operation/system.ogg + + + + /usr/share/feedback/sound/operation/system.ogg + + + + /usr/share/feedback/sound/operation/system.ogg + + + + /usr/share/feedback/sound/operation/system.ogg + + + + /usr/share/feedback/sound/operation/shutter.ogg + + + + /usr/share/feedback/sound/operation/system.ogg + + + + /usr/share/feedback/sound/operation/system.ogg + + + + /usr/share/feedback/sound/operation/system.ogg + + + + /usr/share/feedback/sound/operation/system.ogg + + + + /usr/share/feedback/sound/operation/system.ogg + + + + /usr/share/feedback/sound/operation/system.ogg + + + + /usr/share/feedback/sound/operation/system.ogg + + + + /usr/share/feedback/sound/operation/system.ogg + + + + /usr/share/feedback/sound/operation/system.ogg + + + + /usr/share/feedback/sound/operation/system.ogg + + diff --git a/data/micro/sound/operation/notification.ogg b/data/micro/sound/operation/notification.ogg new file mode 100755 index 0000000..457f7e8 Binary files /dev/null and b/data/micro/sound/operation/notification.ogg differ diff --git a/data/micro/sound/operation/power_on.ogg b/data/micro/sound/operation/power_on.ogg new file mode 100755 index 0000000..7756406 Binary files /dev/null and b/data/micro/sound/operation/power_on.ogg differ diff --git a/data/micro/sound/operation/ringtone.ogg b/data/micro/sound/operation/ringtone.ogg new file mode 100755 index 0000000..2653dd6 Binary files /dev/null and b/data/micro/sound/operation/ringtone.ogg differ diff --git a/data/micro/sound/operation/shutter.ogg b/data/micro/sound/operation/shutter.ogg new file mode 100755 index 0000000..c22c810 Binary files /dev/null and b/data/micro/sound/operation/shutter.ogg differ diff --git a/data/micro/sound/operation/system.ogg b/data/micro/sound/operation/system.ogg new file mode 100755 index 0000000..69c8425 Binary files /dev/null and b/data/micro/sound/operation/system.ogg differ diff --git a/data/micro/sound/touch/touch.ogg b/data/micro/sound/touch/touch.ogg new file mode 100755 index 0000000..8be60ce Binary files /dev/null and b/data/micro/sound/touch/touch.ogg differ diff --git a/data/micro/vibration.xml b/data/micro/vibration.xml new file mode 100644 index 0000000..80a5849 --- /dev/null +++ b/data/micro/vibration.xml @@ -0,0 +1,161 @@ + + + + Vibration Resource + + + TOUCH + + + + TOUCH + + + + TOUCH + + + + TOUCH + + + + SYSTEM + + + + TOUCH + + + + TOUCH + + + + TOUCH + + + + NOTIFICATION + + + + NOTIFICATION + + + + NOTIFICATION + + + + NOTIFICATION + + + + NOTIFICATION + + + + SYSTEM + + + + SYSTEM + + + + SYSTEM + + + + SYSTEM + + + + SYSTEM + + + + SYSTEM + + + + SYSTEM + + + + SYSTEM + + + + SYSTEM + + + + SYSTEM + + + + SYSTEM + + + + SYSTEM + + + + SYSTEM + + + + SYSTEM + + + + SYSTEM + + + + SYSTEM + + + + SYSTEM + + + + NOTIFICATION + + + + NOTIFICATION + + + + NOTIFICATION + + + + NOTIFICATION + + + + SYSTEM + + + + NOTIFICATION + + + + NOTIFICATION + + + + SYSTEM + + + + SYSTEM + + diff --git a/data/mobile/sound.xml b/data/mobile/sound.xml new file mode 100755 index 0000000..d5738b8 --- /dev/null +++ b/data/mobile/sound.xml @@ -0,0 +1,157 @@ + + + + Sound Resource + + + /usr/share/feedback/sound/touch/touch.wav + + + + /usr/share/feedback/sound/touch/sip.wav + + + + /usr/share/feedback/sound/touch/sip_backspace.wav + + + + /usr/share/feedback/sound/touch/sip.wav + + + + /usr/share/feedback/sound/touch/sip.wav + + + + /usr/share/feedback/sound/touch/sip.wav + + + + /usr/share/feedback/sound/touch/key0.wav + + + + /usr/share/feedback/sound/touch/key1.wav + + + + /usr/share/feedback/sound/touch/key2.wav + + + + /usr/share/feedback/sound/touch/key3.wav + + + + /usr/share/feedback/sound/touch/key4.wav + + + + /usr/share/feedback/sound/touch/key5.wav + + + + /usr/share/feedback/sound/touch/key6.wav + + + + /usr/share/feedback/sound/touch/key7.wav + + + + /usr/share/feedback/sound/touch/key8.wav + + + + /usr/share/feedback/sound/touch/key9.wav + + + + /usr/share/feedback/sound/touch/keyasterisk.wav + + + + /usr/share/feedback/sound/touch/keysharp.wav + + + + /usr/share/feedback/sound/touch/touch.wav + + + + /usr/share/feedback/sound/touch/touch.wav + + + + /usr/share/feedback/sound/operation/power_on.wav + + + + /usr/share/feedback/sound/operation/charger_connection.wav + + + + /usr/share/feedback/sound/operation/charger_connection.wav + + + + /usr/share/feedback/sound/operation/low_battery.wav + + + + /usr/share/feedback/sound/operation/low_battery.wav + + + + /usr/share/feedback/sound/operation/lock.wav + + + + /usr/share/feedback/sound/operation/unlock.wav + + + + /usr/share/feedback/sound/operation/lock.wav + + + + /usr/share/feedback/sound/operation/unlock.wav + + + + /usr/share/feedback/sound/operation/lock.wav + + + + /usr/share/feedback/sound/operation/call_connect.wav + + + + /usr/share/feedback/sound/operation/call_disconnect.wav + + + + /usr/share/feedback/sound/operation/minute_minder.wav + + + + /usr/share/feedback/sound/operation/volume_control.wav + + + + /usr/share/feedback/sound/operation/shutter.wav + + + + /usr/share/feedback/sound/operation/list_reorder.wav + + + + /usr/share/feedback/sound/operation/slider_sweep.wav + + + + /usr/share/feedback/sound/operation/volume_control.wav + + diff --git a/data/mobile/sound/operation/call_connect.wav b/data/mobile/sound/operation/call_connect.wav new file mode 100755 index 0000000..5383bdf Binary files /dev/null and b/data/mobile/sound/operation/call_connect.wav differ diff --git a/data/mobile/sound/operation/call_disconnect.wav b/data/mobile/sound/operation/call_disconnect.wav new file mode 100755 index 0000000..5383bdf Binary files /dev/null and b/data/mobile/sound/operation/call_disconnect.wav differ diff --git a/data/mobile/sound/operation/charger_connection.wav b/data/mobile/sound/operation/charger_connection.wav new file mode 100755 index 0000000..5383bdf Binary files /dev/null and b/data/mobile/sound/operation/charger_connection.wav differ diff --git a/data/mobile/sound/operation/fully_charged.wav b/data/mobile/sound/operation/fully_charged.wav new file mode 100755 index 0000000..5383bdf Binary files /dev/null and b/data/mobile/sound/operation/fully_charged.wav differ diff --git a/data/mobile/sound/operation/list_reorder.wav b/data/mobile/sound/operation/list_reorder.wav new file mode 100755 index 0000000..5383bdf Binary files /dev/null and b/data/mobile/sound/operation/list_reorder.wav differ diff --git a/data/mobile/sound/operation/lock.wav b/data/mobile/sound/operation/lock.wav new file mode 100755 index 0000000..5383bdf Binary files /dev/null and b/data/mobile/sound/operation/lock.wav differ diff --git a/data/mobile/sound/operation/low_battery.wav b/data/mobile/sound/operation/low_battery.wav new file mode 100755 index 0000000..5383bdf Binary files /dev/null and b/data/mobile/sound/operation/low_battery.wav differ diff --git a/data/mobile/sound/operation/minute_minder.wav b/data/mobile/sound/operation/minute_minder.wav new file mode 100755 index 0000000..5383bdf Binary files /dev/null and b/data/mobile/sound/operation/minute_minder.wav differ diff --git a/data/mobile/sound/operation/power_on.wav b/data/mobile/sound/operation/power_on.wav new file mode 100755 index 0000000..5383bdf Binary files /dev/null and b/data/mobile/sound/operation/power_on.wav differ diff --git a/data/mobile/sound/operation/shutter.wav b/data/mobile/sound/operation/shutter.wav new file mode 100755 index 0000000..9dea92b Binary files /dev/null and b/data/mobile/sound/operation/shutter.wav differ diff --git a/data/mobile/sound/operation/slider_sweep.wav b/data/mobile/sound/operation/slider_sweep.wav new file mode 100755 index 0000000..5383bdf Binary files /dev/null and b/data/mobile/sound/operation/slider_sweep.wav differ diff --git a/data/mobile/sound/operation/unlock.wav b/data/mobile/sound/operation/unlock.wav new file mode 100755 index 0000000..5383bdf Binary files /dev/null and b/data/mobile/sound/operation/unlock.wav differ diff --git a/data/mobile/sound/operation/volume_control.wav b/data/mobile/sound/operation/volume_control.wav new file mode 100755 index 0000000..1ec9de4 Binary files /dev/null and b/data/mobile/sound/operation/volume_control.wav differ diff --git a/data/mobile/sound/touch/key0.wav b/data/mobile/sound/touch/key0.wav new file mode 100755 index 0000000..e2cd877 Binary files /dev/null and b/data/mobile/sound/touch/key0.wav differ diff --git a/data/mobile/sound/touch/key1.wav b/data/mobile/sound/touch/key1.wav new file mode 100755 index 0000000..fa77cf4 Binary files /dev/null and b/data/mobile/sound/touch/key1.wav differ diff --git a/data/mobile/sound/touch/key2.wav b/data/mobile/sound/touch/key2.wav new file mode 100755 index 0000000..53da84c Binary files /dev/null and b/data/mobile/sound/touch/key2.wav differ diff --git a/data/mobile/sound/touch/key3.wav b/data/mobile/sound/touch/key3.wav new file mode 100755 index 0000000..ede9a2b Binary files /dev/null and b/data/mobile/sound/touch/key3.wav differ diff --git a/data/mobile/sound/touch/key4.wav b/data/mobile/sound/touch/key4.wav new file mode 100755 index 0000000..105bddc Binary files /dev/null and b/data/mobile/sound/touch/key4.wav differ diff --git a/data/mobile/sound/touch/key5.wav b/data/mobile/sound/touch/key5.wav new file mode 100755 index 0000000..a34b4d0 Binary files /dev/null and b/data/mobile/sound/touch/key5.wav differ diff --git a/data/mobile/sound/touch/key6.wav b/data/mobile/sound/touch/key6.wav new file mode 100755 index 0000000..34a8bec Binary files /dev/null and b/data/mobile/sound/touch/key6.wav differ diff --git a/data/mobile/sound/touch/key7.wav b/data/mobile/sound/touch/key7.wav new file mode 100755 index 0000000..3b845a4 Binary files /dev/null and b/data/mobile/sound/touch/key7.wav differ diff --git a/data/mobile/sound/touch/key8.wav b/data/mobile/sound/touch/key8.wav new file mode 100755 index 0000000..2a05528 Binary files /dev/null and b/data/mobile/sound/touch/key8.wav differ diff --git a/data/mobile/sound/touch/key9.wav b/data/mobile/sound/touch/key9.wav new file mode 100755 index 0000000..80699c8 Binary files /dev/null and b/data/mobile/sound/touch/key9.wav differ diff --git a/data/mobile/sound/touch/keyasterisk.wav b/data/mobile/sound/touch/keyasterisk.wav new file mode 100755 index 0000000..9ec2e71 Binary files /dev/null and b/data/mobile/sound/touch/keyasterisk.wav differ diff --git a/data/mobile/sound/touch/keysharp.wav b/data/mobile/sound/touch/keysharp.wav new file mode 100755 index 0000000..ce7cd88 Binary files /dev/null and b/data/mobile/sound/touch/keysharp.wav differ diff --git a/data/mobile/sound/touch/sip.wav b/data/mobile/sound/touch/sip.wav new file mode 100755 index 0000000..5b44d12 Binary files /dev/null and b/data/mobile/sound/touch/sip.wav differ diff --git a/data/mobile/sound/touch/sip_backspace.wav b/data/mobile/sound/touch/sip_backspace.wav new file mode 100755 index 0000000..5b44d12 Binary files /dev/null and b/data/mobile/sound/touch/sip_backspace.wav differ diff --git a/data/mobile/sound/touch/touch.wav b/data/mobile/sound/touch/touch.wav new file mode 100755 index 0000000..1ec9de4 Binary files /dev/null and b/data/mobile/sound/touch/touch.wav differ diff --git a/data/mobile/vibration.xml b/data/mobile/vibration.xml new file mode 100644 index 0000000..8221ffa --- /dev/null +++ b/data/mobile/vibration.xml @@ -0,0 +1,196 @@ + + + + Vibration Resource + + + TOUCH + + + + TOUCH + + + + TOUCH + + + + TOUCH + + + + TOUCH + + + + + + + TOUCH + + + + TOUCH + + + + TOUCH + + + + TOUCH + + + + TOUCH + + + + TOUCH + + + + TOUCH + + + + TOUCH + + + + TOUCH + + + + TOUCH + + + + TOUCH + + + + TOUCH + + + + TOUCH + + + + TOUCH + + + + TOUCH + + + + TOUCH + + + + NOTIFICATION + + + + NOTIFICATION + + + + NOTIFICATION + + + + NOTIFICATION + + + + NOTIFICATION + + + + NOTIFICATION + + + + NOTIFICATION + + + + NOTIFICATION + + + + NOTIFICATION + + + + NOTIFICATION + + + + NOTIFICATION + + + + NOTIFICATION + + + + SYSTEM + + + + SYSTEM + + + + SYSTEM + + + + SYSTEM + + + + SYSTEM + + + + SYSTEM + + + + SYSTEM + + + + SYSTEM + + + + SYSTEM + + + + SYSTEM + + + + SYSTEM + + + + SYSTEM + + + + SYSTEM + + + + SYSTEM + + diff --git a/doc/feedback_doc.h b/doc/feedback_doc.h new file mode 100755 index 0000000..0b0131e --- /dev/null +++ b/doc/feedback_doc.h @@ -0,0 +1,45 @@ +/* + * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved + * + * 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 __TIZEN_SYSTEM_FEEDBACK_DOC_H__ +#define __TIZEN_SYSTEM_FEEDBACK_DOC_H__ + +/** + * @ingroup CAPI_SYSTEM_FRAMEWORK + * @defgroup CAPI_SYSTEM_FEEDBACK_MODULE Feedback + * @brief The FEEDBACK API provides functions to play sound or vibration associated with properties. + * + * @section CAPI_SYSTEM_FEEDBACK_MODULE_HEADER Required Header + * \#include + * + * @section CAPI_SYSTEM_FEEDBACK_MODULE_OVERVIEW Overview + * The FEEDBACK API provides functions to play sound or vibration associated with properties. + * @section CAPI_SYSTEM_FEEDBACK_MODULE_FEATURE Related Features + * This API is related with the following features:\n + * - http://developer.samsung.com/tizen/feature/haptic\n + * + * It is recommended to design feature related codes in your application for reliability.\n + * + * You can check if a devrice supports the related features for this API by using @ref CAPI_SYSTEM_SYSTEM_INFO_MODULE, thereby controlling the procedure of your application.\n + * + * To ensure your application is only running on the device with specific features, please define the features in your manifest file using the manifest editor in the SDK.\n + * + * More details on featuring your application can be found from Feature Element. + * + */ + +#endif /* __TIZEN_SYSTEM_FEEDBACK_DOC_H__ */ diff --git a/image/svi.png b/image/svi.png old mode 100755 new mode 100644 diff --git a/include/common.h b/include/common.h index ccbb1bf..71fa321 100644 --- a/include/common.h +++ b/include/common.h @@ -27,18 +27,20 @@ extern "C" { * @file common.h * @brief This file contains the common information */ -#include -#define FEEDBACK_DATA_DIR tzplatform_mkpath(TZ_USER_SHARE,"feedback") +#define FEEDBACK_DATA_DIR "/opt/usr/share/feedback" #define FEEDBACK_ORIGIN_DATA_DIR "/usr/share/feedback" #define FEEDBACK_RETRY_CNT 1 extern int callstatus; +extern int alert_callstatus; extern const char *str_type[]; extern const char *str_pattern[]; +int is_sound_mode(void); + #ifdef __cplusplus } #endif diff --git a/include/dbus.h b/include/dbus.h new file mode 100644 index 0000000..9710b59 --- /dev/null +++ b/include/dbus.h @@ -0,0 +1,46 @@ +/* + * feedback + * + * Copyright (c) 2012 - 2013 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 __DBUS_H__ +#define __DBUS_H__ + +#include + +/* + * Device daemon + */ +#define DEVICED_BUS_NAME "org.tizen.system.deviced" +#define DEVICED_OBJECT_PATH "/Org/Tizen/System/DeviceD" +#define DEVICED_INTERFACE_NAME DEVICED_BUS_NAME +/* Led service: play/stop led operations about led */ +#define DEVICED_PATH_LED DEVICED_OBJECT_PATH"/Led" +#define DEVICED_INTERFACE_LED DEVICED_INTERFACE_NAME".Led" +/* Haptic service: operatioins about haptic */ +#define DEVICED_PATH_HAPTIC DEVICED_OBJECT_PATH"/Haptic" +#define DEVICED_INTERFACE_HAPTIC DEVICED_INTERFACE_NAME".haptic" + +struct dbus_byte { + const unsigned char *data; + int size; +}; + +int dbus_method_sync(const char *dest, const char *path, + const char *interface, const char *method, + const char *sig, char *param[]); +#endif diff --git a/include/devices.h b/include/devices.h index 226c910..2fdd215 100644 --- a/include/devices.h +++ b/include/devices.h @@ -25,6 +25,7 @@ struct device_ops { void (*init) (void); void (*exit) (void); int (*play) (int); + int (*stop) (void); int (*get_path) (int, char *, unsigned int); int (*set_path) (int, char *); }; @@ -32,6 +33,7 @@ struct device_ops { void devices_init(void); void devices_exit(void); void devices_play(int pattern); +void devices_stop(void); #ifndef __CONSTRUCTOR__ #define __CONSTRUCTOR__ __attribute__ ((constructor)) @@ -45,10 +47,6 @@ void devices_play(int pattern); static void __CONSTRUCTOR__ module_init(void) \ { \ add_device(dev); \ -} \ -static void __DESTRUCTOR__ module_exit(void) \ -{ \ - remove_device(dev); \ } void add_device(const struct device_ops *dev); diff --git a/include/feedback-ids.h b/include/feedback-ids.h index 6cdbd8a..84e9430 100644 --- a/include/feedback-ids.h +++ b/include/feedback-ids.h @@ -29,7 +29,7 @@ extern "C" { */ /** - * @addtogroup FEEDBACK + * @addtogroup CAPI_FEEDBACK_MODULE * @{ */ @@ -43,6 +43,7 @@ typedef enum FEEDBACK_TYPE_NONE, FEEDBACK_TYPE_SOUND, FEEDBACK_TYPE_VIBRATION, + FEEDBACK_TYPE_LED, FEEDBACK_TYPE_END } feedback_type_e; @@ -60,6 +61,8 @@ typedef enum FEEDBACK_PATTERN_TAP = 0, /**< feedback pattern when general touch */ FEEDBACK_PATTERN_SIP, /**< feedback pattern when touch text key */ FEEDBACK_PATTERN_SIP_BACKSPACE, /**< feedback pattern when touch backspace key */ + FEEDBACK_PATTERN_SIP_FUNCTION, /**< feedback pattern when touch function key */ + FEEDBACK_PATTERN_SIP_FJKEY, /**< feedback pattern when touch F,J key */ FEEDBACK_PATTERN_MAX_CHARACTER, /**< feedback pattern when max character */ FEEDBACK_PATTERN_KEY0, /**< feedback pattern when touch numeric 0 key */ FEEDBACK_PATTERN_KEY1, /**< feedback pattern when touch numeric 1 key */ @@ -73,6 +76,7 @@ typedef enum FEEDBACK_PATTERN_KEY9, /**< feedback pattern when touch numeric 9 key */ FEEDBACK_PATTERN_KEY_STAR, /**< feedback pattern when touch star key */ FEEDBACK_PATTERN_KEY_SHARP, /**< feedback pattern when touch sharp key */ + FEEDBACK_PATTERN_KEY_BACK, /**< feedback pattern when touch backspace key */ FEEDBACK_PATTERN_HOLD, /**< feedback pattern when touch hold */ FEEDBACK_PATTERN_MULTI_TAP, /**< feedback pattern when multi touch */ FEEDBACK_PATTERN_HW_TAP, /**< feedback pattern when press hardware key */ @@ -90,25 +94,62 @@ typedef enum FEEDBACK_PATTERN_TIMER_ON_CALL, /**< feedback pattern when alert timer on call */ FEEDBACK_PATTERN_GENERAL, /**< feedback pattern when alert general event */ FEEDBACK_PATTERN_GENERAL_ON_CALL, /**< feedback pattern when alert general event on call */ + FEEDBACK_PATTERN_SMART_ALERT, /**< feedback pattern when alert noti on motion */ FEEDBACK_PATTERN_POWERON, /**< feedback pattern when power on */ FEEDBACK_PATTERN_POWEROFF, /**< feedback pattern when power off */ FEEDBACK_PATTERN_CHARGERCONN, /**< feedback pattern when connecting charger */ FEEDBACK_PATTERN_CHARGERCONN_ON_CALL, /**< feedback pattern when connecting charger on call */ + FEEDBACK_PATTERN_CHARGING_ERROR, /**< feedback pattern when occuring charging error */ + FEEDBACK_PATTERN_CHARGING_ERROR_ON_CALL,/**< feedback pattern when occuring charging error on call */ FEEDBACK_PATTERN_FULLCHARGED, /**< feedback pattern when full charged */ FEEDBACK_PATTERN_FULLCHARGED_ON_CALL, /**< feedback pattern when full charged on call */ FEEDBACK_PATTERN_LOWBATT, /**< feedback pattern when low battery */ FEEDBACK_PATTERN_LOWBATT_ON_CALL, /**< feedback pattern when low battery on call */ FEEDBACK_PATTERN_LOCK, /**< feedback pattern when lock */ FEEDBACK_PATTERN_UNLOCK, /**< feedback pattern when unlock */ + FEEDBACK_PATTERN_LOCK_SWIPE, /**< feedback pattern when lock swipe */ + FEEDBACK_PATTERN_UNLOCK_SWIPE, /**< feedback pattern when unlock swipe*/ + FEEDBACK_PATTERN_GEOMETRIC_LOCK, /**< feedback pattern when lock by geometric effect */ FEEDBACK_PATTERN_CALLCONNECT, /**< feedback pattern when connecting call */ FEEDBACK_PATTERN_DISCALLCONNECT, /**< feedback pattern when disconnecting call */ + FEEDBACK_PATTERN_OUTGOING_CALL, /**< feedback pattern when connected outgoing call */ FEEDBACK_PATTERN_MINUTEMINDER, /**< feedback pattern when minute minder */ - FEEDBACK_PATTERN_VIBRATION, /**< feedback pattern when vibration */ - FEEDBACK_PATTERN_SHUTTER, /**< feedback pattern when screen capture or camera shutter */ + FEEDBACK_PATTERN_VIBRATION_ON, /**< feedback pattern when turn on vibration mode */ + FEEDBACK_PATTERN_SILENT_OFF, /**< feedback pattern when turn off silent mode */ + FEEDBACK_PATTERN_BT_CONNECTED, /**< feedback pattern when connecting with bluetooth */ + FEEDBACK_PATTERN_BT_DISCONNECTED, /**< feedback pattern when disconnecting with bluetooth */ + FEEDBACK_PATTERN_BT_PAIRING, /**< feedback pattern when starting pare with bluetooth */ + FEEDBACK_PATTERN_BT_WAITING, /**< feedback pattern when pairing bluetooth */ + FEEDBACK_PATTERN_SCREEN_CAPTURE, /**< feedback pattern when screen capture */ FEEDBACK_PATTERN_LIST_REORDER, /**< feedback pattern when list reorder */ - FEEDBACK_PATTERN_SLIDER_SWEEP, /**< feedback pattern when slider sweep */ + FEEDBACK_PATTERN_LIST_SLIDER, /**< feedback pattern when list slider sweep */ FEEDBACK_PATTERN_VOLUME_KEY, /**< feedback pattern when pressed volume key */ + FEEDBACK_PATTERN_MMS, /**< feedback pattern when message state changed to MMS */ + FEEDBACK_PATTERN_HOURLY_ALERT, /**< feedback pattern when alert every hour on the hour */ + + FEEDBACK_PATTERN_SAFETY_ALERT, /**< feedback pattern when safety alert from phone */ + FEEDBACK_PATTERN_ACCIDENT_DETECT, /**< feedback pattern when accident detect */ + FEEDBACK_PATTERN_SEND_SOS_MESSAGE, /**< feedback pattern when sending SOS message */ + FEEDBACK_PATTERN_END_SOS_MESSAGE, /**< feedback pattern when finishing SOS message */ + FEEDBACK_PATTERN_EMERGENCY_BUZZER, /**< feedback pattern when occurs emergency buzzer */ + FEEDBACK_PATTERN_SAFETY_LOW_POWER, /**< this pattern is a low power ringtone */ + FEEDBACK_PATTERN_CMAS, /**< feedback pattern when alerting commercial mobile */ + FEEDBACK_PATTERN_SPEED_UP, /**< feedback pattern when advising user to speed up */ + FEEDBACK_PATTERN_SLOW_DOWN, /**< feedback pattern when advising user to slow down */ + FEEDBACK_PATTERN_KEEP_THIS_PACE, /**< feedback pattern when advising user to keep this pace */ + FEEDBACK_PATTERN_GOAL_ACHIEVED, /**< feedback pattern when alerting goal achieved */ + FEEDBACK_PATTERN_EXERCISE_COUNT, /**< feedback pattern when changing count number */ + FEEDBACK_PATTERN_START_CUE, /**< feedback pattern when starting cue */ + FEEDBACK_PATTERN_HEALTH_PACE, /**< feedback pattern when alerting health pace */ + FEEDBACK_PATTERN_INACTIVE_TIME, /**< feedback pattern when alerting inactive time */ + FEEDBACK_PATTERN_MEASURING_SUCCESS, /**< feedback pattern when measuring is succeeded */ + FEEDBACK_PATTERN_MEASURING_FAILURE, /**< feedback pattern when measuring is failed */ + FEEDBACK_PATTERN_UV_PROCESSING, /**< feedback pattern when UV is processing */ + FEEDBACK_PATTERN_SHEALTH_START, /**< feedback pattern when starting s-health */ + FEEDBACK_PATTERN_SHEALTH_PAUSE, /**< feedback pattern when pausing s-health */ + FEEDBACK_PATTERN_SHEALTH_STOP, /**< feedback pattern when stoping s-health */ + FEEDBACK_PATTERN_3RD_APPLICATION, /**< feedback pattern when alert 3rd event */ FEEDBACK_PATTERN_END, @@ -117,6 +158,17 @@ typedef enum FEEDBACK_PATTERN_TOUCH_MULTI_TAP = FEEDBACK_PATTERN_MULTI_TAP, FEEDBACK_PATTERN_TOUCH_KEY = FEEDBACK_PATTERN_KEY0, FEEDBACK_PATTERN_TOUCH_HOLD = FEEDBACK_PATTERN_HOLD, + FEEDBACK_PATTERN_REACTIVE_ALERT = FEEDBACK_PATTERN_SMART_ALERT, + FEEDBACK_PATTERN_VIBRATION = FEEDBACK_PATTERN_VIBRATION_ON, + FEEDBACK_PATTERN_SOUND_ON = FEEDBACK_PATTERN_SILENT_OFF, + FEEDBACK_PATTERN_SHUTTER = FEEDBACK_PATTERN_SCREEN_CAPTURE, + FEEDBACK_PATTERN_SLIDER_SWEEP = FEEDBACK_PATTERN_LIST_SLIDER, + FEEDBACK_PATTERN_SAFETY_ASSISTANCE = FEEDBACK_PATTERN_SEND_SOS_MESSAGE, + FEEDBACK_PATTERN_BT_PARING = FEEDBACK_PATTERN_BT_PAIRING, + FEEDBACK_PATTERN_CONNECTED = FEEDBACK_PATTERN_BT_CONNECTED, + FEEDBACK_PATTERN_DISCONNECTED = FEEDBACK_PATTERN_BT_DISCONNECTED, + FEEDBACK_PATTERN_SUCCESS = FEEDBACK_PATTERN_MEASURING_SUCCESS, + FEEDBACK_PATTERN_FAILURE = FEEDBACK_PATTERN_MEASURING_FAILURE, /* END : Will be removed */ } feedback_pattern_e; diff --git a/include/feedback.h b/include/feedback.h index ca224a0..532e24e 100644 --- a/include/feedback.h +++ b/include/feedback.h @@ -32,27 +32,21 @@ extern "C" { */ /** - * @addtogroup FEEDBACK - * @{ - * @breif - * This is a feedback API of the UIX Service. - * @} - */ - -/** - * @addtogroup FEEDBACK + * @addtogroup CAPI_SYSTEM_FEEDBACK_MODULE * @{ */ /** * @brief Enumerations of error codes for the Feedback API. + * @since_tizen 2.3 */ typedef enum { - FEEDBACK_ERROR_NONE = TIZEN_ERROR_NONE, /**< Successful */ - FEEDBACK_ERROR_INVALID_PARAMETER = TIZEN_ERROR_INVALID_PARAMETER, /**< Invalid parameter */ - FEEDBACK_ERROR_NOT_INITIALIZED = TIZEN_ERROR_SYSTEM_CLASS | 0x52, /**< Has not yet been Initialized */ - FEEDBACK_ERROR_OPERATION_FAILED = TIZEN_ERROR_SYSTEM_CLASS | 0x55, /**< Operation failed */ + FEEDBACK_ERROR_NONE = TIZEN_ERROR_NONE, /**< Successful */ + FEEDBACK_ERROR_OPERATION_FAILED = TIZEN_ERROR_NOT_PERMITTED, /**< Operation not permitted */ + FEEDBACK_ERROR_INVALID_PARAMETER = TIZEN_ERROR_INVALID_PARAMETER, /**< Invalid parameter */ + FEEDBACK_ERROR_NOT_SUPPORTED = TIZEN_ERROR_NOT_SUPPORTED, /**< Not supported in this device */ + FEEDBACK_ERROR_NOT_INITIALIZED = TIZEN_ERROR_SYSTEM_CLASS | 0x52, /**< Has not yet been Initialized */ } feedback_error_e; #define FEEDBACK_SUCCEEDED(n) ((n) == FEEDBACK_ERROR_NONE) @@ -61,12 +55,15 @@ typedef enum /** * @brief Initializes feedback API. * + * @since_tizen 2.3 + * * @remarks * If this function is not called in advance, other function will return #FEEDBACK_ERROR_NOT_INITIALIZED. * * @return 0 on success, otherwise a negative error value. * @retval #FEEDBACK_ERROR_NONE Successful * @retval #FEEDBACK_ERROR_OPERATION_FAILED Operation failed + * @retval #FEEDBACK_ERROR_NOT_SUPPORTED Not supported device * * @see feedback_deinitialize() */ @@ -74,12 +71,14 @@ int feedback_initialize(void); /** * @brief Deinitializes feedback API. - * * @details This function must be called when feedback functions are no longer needed. * + * @since_tizen 2.3 + * * @return 0 on success, otherwise a negative error value. * @retval #FEEDBACK_ERROR_NONE Successful * @retval #FEEDBACK_ERROR_OPERATION_FAILED Operation failed + * @retval #FEEDBACK_ERROR_NOT_SUPPORTED Not supported device * * @see feedback_initialize() */ @@ -87,11 +86,12 @@ int feedback_deinitialize(void); /** * @brief Plays various types of reactions that are pre-defined. - * * @details * This functon can be used to react to pre-defined actions. \n * It play various types of system pre-defined media or vibration patterns. * + * @since_tizen 2.3 + * * @remarks * Currently, there are two types of reactions: sound and vibration. \n * Depending on the settings, some types cannot operate. @@ -102,17 +102,19 @@ int feedback_deinitialize(void); * @return 0 on success, otherwise a negative error value. * @retval #FEEDBACK_ERROR_NONE Successful * @retval #FEEDBACK_ERROR_INVALID_PARAMETER Invalid parameter + * @retval #FEEDBACK_ERROR_NOT_SUPPORTED Not supported device */ int feedback_play(feedback_pattern_e pattern); /** * * @brief Plays specific type of reactions that are pre-defined. - * * @details * This function can be used to react to pre-defined actions. \n * It play specific type of system pre-defined pattern. * + * @since_tizen 2.3 + * * @remarks * Currently, there are two types of reactions: sound and vibration. * @@ -122,12 +124,48 @@ int feedback_play(feedback_pattern_e pattern); * @return 0 on success, otherwise a negative error value. * @retval #FEEDBACK_ERROR_NONE Successful * @retval #FEEDBACK_ERROR_INVALID_PARAMETER Invalid parameter + * @retval #FEEDBACK_ERROR_NOT_SUPPORTED Not supported device */ int feedback_play_type(feedback_type_e type, feedback_pattern_e pattern); /** - * @brief Gets the file path of resource for the given feedback type and pattern. * + * @brief Plays specific type of reactions that are pre-defined. + * @details + * This function can be used to react to pre-defined actions. \n + * It play specific type of system pre-defined pattern. + * + * @since_tizen 2.3 + * + * @remarks + * Currently, there are two types of reactions: sound and vibration. + * + * @param[in] type string The pattern type + * @param[in] pattern string The pre-defined pattern + * + * @return 0 on success, otherwise a negative error value. + * @retval #FEEDBACK_ERROR_NONE Successful + * @retval #FEEDBACK_ERROR_INVALID_PARAMETER Invalid parameter + * @retval #FEEDBACK_ERROR_NOT_SUPPORTED Not supported device + */ +int feedback_play_type_by_name(char *type, char *pattern); + +/** + * @brief Stop various types of reactions + * @details + * This functon can be used to stop react to pre-defined actions. \n + * It stops various types of system pre-defined media or vibration patterns. + * + * @since_tizen 2.3 + * + * @return 0 on success, otherwise a negative error value. + * @retval #FEEDBACK_ERROR_NONE Successful + * @retval #FEEDBACK_ERROR_NOT_SUPPORTED Not supported device + */ +int feedback_stop(void); + +/** + * @brief Gets the file path of resource for the given feedback type and pattern. * @details * Depending on the type of each pattern resouorce has a different format. \n * Currently, System supports two pattern types. \n @@ -135,6 +173,8 @@ int feedback_play_type(feedback_type_e type, feedback_pattern_e pattern); * #FEEDBACK_TYPE_VIBRATION type uses .ivt format. \n * If the given pattern doesn't have a file for the type, @a path will return NULL. * + * @since_tizen 2.3 + * * @remarks @a path must be released with free() by you. * * @param[in] type The pattern type @@ -145,13 +185,12 @@ int feedback_play_type(feedback_type_e type, feedback_pattern_e pattern); * @retval #FEEDBACK_ERROR_NONE Successful * @retval #FEEDBACK_ERROR_INVALID_PARAMETER Invalid parameter * @retval #FEEDBACK_ERROR_OPERATION_FAILED Operation failed - * + * @retval #FEEDBACK_ERROR_NOT_SUPPORTED Not supported device */ int feedback_get_resource_path(feedback_type_e type, feedback_pattern_e pattern, char **path); /** * @brief Sets the new file path of resource for the given feedback type and pattern. - * * @details * Depending on the type of each pattern resouorce has a different format. \n * Currently, System supports two pattern types. \n @@ -159,6 +198,8 @@ int feedback_get_resource_path(feedback_type_e type, feedback_pattern_e pattern, * #FEEDBACK_TYPE_VIBRATION type uses .ivt format. \n * If the given pattern doesn't have a file for the type, @a path will return NULL. * + * @since_tizen 2.3 + * * @param[in] type The pattern type * @param[in] pattern The pre-defined pattern * @param[in] path The new file path of resource for feedback type and pattern @@ -167,7 +208,7 @@ int feedback_get_resource_path(feedback_type_e type, feedback_pattern_e pattern, * @retval #FEEDBACK_ERROR_NONE Successful * @retval #FEEDBACK_ERROR_INVALID_PARAMETER Invalid parameter * @retval #FEEDBACK_ERROR_OPERATION_FAILED Operation failed - * + * @retval #FEEDBACK_ERROR_NOT_SUPPORTED Not supported device */ int feedback_set_resource_path(feedback_type_e type, feedback_pattern_e pattern, char *path); diff --git a/include/feedback_doc.h b/include/feedback_doc.h new file mode 100755 index 0000000..c11960d --- /dev/null +++ b/include/feedback_doc.h @@ -0,0 +1,35 @@ +/* + * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved + * + * 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 __FEEDBACK_DOC_H__ +#define __FEEDBACK_DOC_H__ + +/** + * @defgroup CAPI_FEEDBACK_MODULE Feedback + * @brief The FEEDBACK API provides functions to play simple sound and vibration. + * @ingroup CAPI_UIX_FRAMEWORK + * + * @section CAPI_FEEDBACK_MODULE_HEADER Required Header + * \#include + * + * @section CAPI_FEEDBACK_MODULE_OVERVIEW Overview + * The feedback library is responsible for playing simple sound and vibration. + * Feedback play sound using mm-sound library and play vibration with system framework. + * + */ + +#endif /* __FEEDBACK_DOC_H__ */ diff --git a/include/svi-file.h b/include/svi-file.h deleted file mode 100755 index 119f769..0000000 --- a/include/svi-file.h +++ /dev/null @@ -1,177 +0,0 @@ -/* - * libfeedback - * 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 __SVI_FILE_H__ -#define __SVI_FILE_H__ - -#define SVI_DATA_DIR "/opt/share/svi/" -#define SVI_ORIGIN_DATA_DIR "/usr/share/svi/" - -#define SVI_SOUND_DIR SVI_DATA_DIR"sound/" -#define SVI_SOUND_TOUCH_DIR SVI_SOUND_DIR"touch/" -#define SVI_SOUND_OPER_DIR SVI_SOUND_DIR"operation/" - -#define SVI_HAPTIC_DIR SVI_DATA_DIR"haptic/" -#define SVI_HAPTIC_TOUCH_DIR SVI_HAPTIC_DIR"touch/" -#define SVI_HAPTIC_OPER_DIR SVI_HAPTIC_DIR"operation/" -#define SVI_HAPTIC_NOTI_DIR SVI_HAPTIC_DIR"notification/" - -const char* snd_file[] = { - /* TOUCH : SCREEN TOUCH : TAP(TOUCH & RELEASE) : GENERAL */ - SVI_SOUND_TOUCH_DIR"touch1.wav", - SVI_SOUND_TOUCH_DIR"touch2.wav", - SVI_SOUND_TOUCH_DIR"touch3.wav", - /* TOUCH : SCREEN TOUCH : TAP(TOUCH & RELEASE) : TEXT_NUMERIC_INPUT */ - SVI_SOUND_TOUCH_DIR"sip.wav", - SVI_SOUND_TOUCH_DIR"sip_backspace.wav", - /* TOUCH : SCREEN TOUCH : TAP(TOUCH & RELEASE) : DAILER */ - SVI_SOUND_TOUCH_DIR"key0.wav", - SVI_SOUND_TOUCH_DIR"key1.wav", - SVI_SOUND_TOUCH_DIR"key2.wav", - SVI_SOUND_TOUCH_DIR"key3.wav", - SVI_SOUND_TOUCH_DIR"key4.wav", - SVI_SOUND_TOUCH_DIR"key5.wav", - SVI_SOUND_TOUCH_DIR"key6.wav", - SVI_SOUND_TOUCH_DIR"key7.wav", - SVI_SOUND_TOUCH_DIR"key8.wav", - SVI_SOUND_TOUCH_DIR"key9.wav", - SVI_SOUND_TOUCH_DIR"keyasterisk.wav", - SVI_SOUND_TOUCH_DIR"keysharp.wav", - /* TOUCH : H/W OR SOFT TOUCH : HOLD(TAP & HOLD) */ - SVI_SOUND_TOUCH_DIR"hold.wav", - /* TOUCH : H/W OR SOFT TOUCH : MULTI TAP */ - SVI_SOUND_TOUCH_DIR"multi_tap.wav", - /* TOUCH : H/W OR SOFT TOUCH : TAP */ - SVI_SOUND_TOUCH_DIR"hw_tap.wav", - /* TOUCH : H/W OR SOFT TOUCH : TAP & HOLD */ - SVI_SOUND_TOUCH_DIR"hw_hold.wav", - - /* OPERATION : POWER ON/OFF */ - SVI_SOUND_OPER_DIR"power_on.wav", - SVI_SOUND_OPER_DIR"power_off.wav", - /* OPERATION : CHARGECONN */ - SVI_SOUND_OPER_DIR"charger_connection.wav", - /* OPERATION : FULLCHAREGED */ - SVI_SOUND_OPER_DIR"fully_charged.wav", - /* OPERATION : LOW BATTERY */ - SVI_SOUND_OPER_DIR"low_battery.wav", - /* OPERATION : LOCK/UNLOCK */ - SVI_SOUND_OPER_DIR"lock.wav", - SVI_SOUND_OPER_DIR"unlock.wav", - /* OPERATION : CALL CONNECT/ DISCONNECT */ - SVI_SOUND_OPER_DIR"call_connect.wav", - SVI_SOUND_OPER_DIR"call_disconnect.wav", - /* OPERATION : MINUTE MINDER */ - SVI_SOUND_OPER_DIR"minute_minder.wav", - /* OPERATION : VIBRATION */ - SVI_SOUND_OPER_DIR"vibration.wav", - /* OPERATION : BALLOON MESSAGE SEND/RECV */ - SVI_SOUND_OPER_DIR"new_chat.wav", - SVI_SOUND_OPER_DIR"sent_chat.wav", - /* OPERATION : ON/OFF SLIDER */ - SVI_SOUND_OPER_DIR"on_off_slider.wav", - /* OPERATION : CAMERA SHUTTER / SCREEN CAPTURE */ - SVI_SOUND_OPER_DIR"shutter.wav", - /* OPERATION : LIST RE-ORDER */ - SVI_SOUND_OPER_DIR"list_reorder.wav", - /* OPERATION : LIST SLIDER */ - SVI_SOUND_OPER_DIR"slider_sweep.wav" -}; - -/* led_file and haptic_file should be managed in the same order */ -const char* haptic_file[] = { - /* TOUCH : SCREEN TOUCH : TAP(TOUCH & RELEASE) : GENERAL */ - SVI_HAPTIC_TOUCH_DIR"touch.ivt", - /* TOUCH : SCREEN TOUCH : TAP(TOUCH & RELEASE) : TEXT_NUMERIC_INPUT */ - SVI_HAPTIC_TOUCH_DIR"sip.ivt", - SVI_HAPTIC_TOUCH_DIR"sip_backspace.ivt", - /* TOUCH : SCREEN TOUCH : TAP(TOUCH & RELEASE) : DAILER */ - SVI_HAPTIC_TOUCH_DIR"key0.ivt", - SVI_HAPTIC_TOUCH_DIR"key1.ivt", - SVI_HAPTIC_TOUCH_DIR"key2.ivt", - SVI_HAPTIC_TOUCH_DIR"key3.ivt", - SVI_HAPTIC_TOUCH_DIR"key4.ivt", - SVI_HAPTIC_TOUCH_DIR"key5.ivt", - SVI_HAPTIC_TOUCH_DIR"key6.ivt", - SVI_HAPTIC_TOUCH_DIR"key7.ivt", - SVI_HAPTIC_TOUCH_DIR"key8.ivt", - SVI_HAPTIC_TOUCH_DIR"key9.ivt", - SVI_HAPTIC_TOUCH_DIR"keyasterisk.ivt", - SVI_HAPTIC_TOUCH_DIR"keysharp.ivt", - /* TOUCH : H/W OR SOFT TOUCH : HOLD(TAP & HOLD) */ - SVI_HAPTIC_TOUCH_DIR"hold.ivt", - /* TOUCH : H/W OR SOFT TOUCH : MULTI TAP */ - SVI_HAPTIC_TOUCH_DIR"multi_tap.ivt", - /* TOUCH : H/W OR SOFT TOUCH : TAP */ - SVI_HAPTIC_TOUCH_DIR"hw_tap.ivt", - /* TOUCH : H/W OR SOFT TOUCH : TAP & HOLD */ - SVI_HAPTIC_TOUCH_DIR"hw_hold.ivt", - - /* NOTIFICATION : INCOMING : CALL */ - SVI_HAPTIC_NOTI_DIR"incoming_call1.ivt", - SVI_HAPTIC_NOTI_DIR"incoming_call2.ivt", - SVI_HAPTIC_NOTI_DIR"incoming_call3.ivt", - SVI_HAPTIC_NOTI_DIR"incoming_call4.ivt", - SVI_HAPTIC_NOTI_DIR"incoming_call5.ivt", - SVI_HAPTIC_NOTI_DIR"incoming_call6.ivt", - /* NOTIFICATION : INCOMING : MESSAGE */ - SVI_HAPTIC_NOTI_DIR"message.ivt", - /* NOTIFICATION : INCOMING : EMAIL */ - SVI_HAPTIC_NOTI_DIR"email.ivt", - /* NOTIFICATION : ALARM : WAKEUP */ - SVI_HAPTIC_NOTI_DIR"wakeup.ivt", - /* NOTIFICATION : ALARM : SCHEDULE */ - SVI_HAPTIC_NOTI_DIR"schedule.ivt", - /* NOTIFICATION : ALARM : TIMER */ - SVI_HAPTIC_NOTI_DIR"timer.ivt", - /* NOTIFICATION : GENERAL(TICKER/IM/SMS ETC) */ - SVI_HAPTIC_NOTI_DIR"general.ivt", - - /* OPERATION : POWER ON/OFF */ - SVI_HAPTIC_OPER_DIR"power_on.ivt", - SVI_HAPTIC_OPER_DIR"power_off.ivt", - /* OPERATION : CHARGECONN */ - SVI_HAPTIC_OPER_DIR"charger_connection.ivt", - /* OPERATION : FULLCHAREGED */ - SVI_HAPTIC_OPER_DIR"fully_charged.ivt", - /* OPERATION : LOW BATTERY */ - SVI_HAPTIC_OPER_DIR"low_battery.ivt", - /* OPERATION : LOCK/UNLOCK */ - SVI_HAPTIC_OPER_DIR"lock.ivt", - SVI_HAPTIC_OPER_DIR"unlock.ivt", - /* OPERATION : CALL CONNECT/ DISCONNECT */ - SVI_HAPTIC_OPER_DIR"call_connect.ivt", - SVI_HAPTIC_OPER_DIR"call_disconnect.ivt", - /* OPERATION : MINUTE MINDER */ - SVI_HAPTIC_OPER_DIR"minute_minder.ivt", - /* OPERATION : VIBRATION */ - SVI_HAPTIC_OPER_DIR"vibration.ivt", - /* OPERATION : BALLOON MESSAGE SEND/RECV */ - SVI_HAPTIC_OPER_DIR"new_chat.ivt", - SVI_HAPTIC_OPER_DIR"sent_chat.ivt", - /* OPERATION : ON/OFF SLIDER */ - SVI_HAPTIC_OPER_DIR"on_off_slider.ivt", - /* OPERATION : CAMERA SHUTTER / SCREEN CAPTURE */ - SVI_HAPTIC_OPER_DIR"shutter.ivt", - /* OPERATION : LIST RE-ORDER */ - SVI_HAPTIC_OPER_DIR"list_reorder.ivt", - /* OPERATION : LIST SLIDER */ - SVI_HAPTIC_OPER_DIR"slider_sweep.ivt" -}; - -#endif //__SVI_FILE_H__ diff --git a/include/svi-ids.h b/include/svi-ids.h deleted file mode 100755 index 330bc86..0000000 --- a/include/svi-ids.h +++ /dev/null @@ -1,179 +0,0 @@ -/* - * libfeedback - * 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 __SVI_IDS_H__ -#define __SVI_IDS_H__ - -typedef enum svi_type_t { - SVI_TYPE_NONE, - SVI_TYPE_SND, - SVI_TYPE_VIB, - SVI_TYPE_END -} svi_type; - -typedef enum sound_type_t { - SVI_SND_NONE = -1, - - /* TOUCH : SCREEN TOUCH : TAP(TOUCH & RELEASE) : GENERAL */ - SVI_SND_TOUCH_TOUCH1 = 0, - SVI_SND_TOUCH_TOUCH2, - SVI_SND_TOUCH_TOUCH3, - /* TOUCH : SCREEN TOUCH : TAP(TOUCH & RELEASE) : TEXT_NUMERIC_INPUT */ - SVI_SND_TOUCH_SIP, - SVI_SND_TOUCH_SIP_BACKSPACE, - /* TOUCH : SCREEN TOUCH : TAP(TOUCH & RELEASE) : DAILER */ - SVI_SND_TOUCH_KEY00, - SVI_SND_TOUCH_KEY01, - SVI_SND_TOUCH_KEY02, - SVI_SND_TOUCH_KEY03, - SVI_SND_TOUCH_KEY04, - SVI_SND_TOUCH_KEY05, - SVI_SND_TOUCH_KEY06, - SVI_SND_TOUCH_KEY07, - SVI_SND_TOUCH_KEY08, - SVI_SND_TOUCH_KEY09, - SVI_SND_TOUCH_KEY_STAR, - SVI_SND_TOUCH_KEY_SHARP, - /* TOUCH : H/W OR SOFT TOUCH : HOLD(TAP & HOLD) */ - SVI_SND_TOUCH_HOLD, - /* TOUCH : H/W OR SOFT TOUCH : MULTI TAP */ - SVI_SND_TOUCH_MULTI_TAP, - /* TOUCH : H/W OR SOFT TOUCH : TAP */ - SVI_SND_TOUCH_HW_TAP, - /* TOUCH : H/W OR SOFT TOUCH : TAP & HOLD */ - SVI_SND_TOUCH_HW_HOLD, - - /* OPERATION : POWER ON/OFF */ - SVI_SND_OPERATION_POWERON, - SVI_SND_OPERATION_POWEROFF, - /* OPERATION : CHARGECONN */ - SVI_SND_OPERATION_CHARGERCONN, - /* OPERATION : FULLCHAREGED */ - SVI_SND_OPERATION_FULLCHARGED, - /* OPERATION : LOW BATTERY */ - SVI_SND_OPERATION_LOWBATT, - /* OPERATION : LOCK/UNLOCK */ - SVI_SND_OPERATION_LOCK, - SVI_SND_OPERATION_UNLOCK, - /* OPERATION : CALL CONNECT/ DISCONNECT */ - SVI_SND_OPERATION_CALLCONN, - SVI_SND_OPERATION_CALLDISCONN, - /* OPERATION : MINUTE MINDER */ - SVI_SND_OPERATION_MINUTE_MINDER, - /* OPERATION : VIBRATION */ - SVI_SND_OPERATION_VIBRATION, - /* OPERATION : BALLOON MESSAGE SEND/RECV */ - SVI_SND_OPERATION_NEWCHAT, - SVI_SND_OPERATION_SENTCHAT, - /* OPERATION : ON/OFF SLIDER */ - SVI_SND_OPERATION_ONOFFSLIDER, - /* OPERATION : CAMERA SHUTTER / SCREEN CAPTURE */ - SVI_SND_OPERATION_SCRCAPTURE, - /* OPERATION : LIST RE-ORDER */ - SVI_SND_OPERATION_LIST_REORDER, - /* OPERATION : LIST SLIDER */ - SVI_SND_OPERATION_SLIDER_SWEEP, - SVI_SND_ENUM_END -} sound_type; - -typedef enum vibration_type_t { - SVI_VIB_NONE = -1, - - /* TOUCH : SCREEN TOUCH : TAP(TOUCH & RELEASE) : GENERAL */ - SVI_VIB_TOUCH_TOUCH = 0, - /* TOUCH : SCREEN TOUCH : TAP(TOUCH & RELEASE) : TEXT_NUMERIC_INPUT */ - SVI_VIB_TOUCH_SIP, - SVI_VIB_TOUCH_SIP_BACKSPACE, - /* TOUCH : SCREEN TOUCH : TAP(TOUCH & RELEASE) : DAILER */ - SVI_VIB_TOUCH_KEY00, - SVI_VIB_TOUCH_KEY01, - SVI_VIB_TOUCH_KEY02, - SVI_VIB_TOUCH_KEY03, - SVI_VIB_TOUCH_KEY04, - SVI_VIB_TOUCH_KEY05, - SVI_VIB_TOUCH_KEY06, - SVI_VIB_TOUCH_KEY07, - SVI_VIB_TOUCH_KEY08, - SVI_VIB_TOUCH_KEY09, - SVI_VIB_TOUCH_KEY_STAR, - SVI_VIB_TOUCH_KEY_SHARP, - /* TOUCH : H/W OR SOFT TOUCH : HOLD(TAP & HOLD) */ - SVI_VIB_TOUCH_HOLD, - /* TOUCH : H/W OR SOFT TOUCH : MULTI TAP */ - SVI_VIB_TOUCH_MULTI_TAP, - /* TOUCH : H/W OR SOFT TOUCH : TAP */ - SVI_VIB_TOUCH_HW_TAP, - /* TOUCH : H/W OR SOFT TOUCH : TAP & HOLD */ - SVI_VIB_TOUCH_HW_HOLD, - - /* NOTIFICATION : INCOMING : CALL */ - SVI_VIB_NOTIFICATION_INCOMING_CALL01, - SVI_VIB_NOTIFICATION_INCOMING_CALL02, - SVI_VIB_NOTIFICATION_INCOMING_CALL03, - SVI_VIB_NOTIFICATION_INCOMING_CALL04, - SVI_VIB_NOTIFICATION_INCOMING_CALL05, - SVI_VIB_NOTIFICATION_INCOMING_CALL06, - /* NOTIFICATION : INCOMING : MESSAGE */ - SVI_VIB_NOTIFICATION_MESSAGE, - /* NOTIFICATION : INCOMING : EMAIL */ - SVI_VIB_NOTIFICATION_EMAIL, - /* NOTIFICATION : ALARM : WAKEUP */ - SVI_VIB_NOTIFICATION_WAKEUP, - /* NOTIFICATION : ALARM : SCHEDULE */ - SVI_VIB_NOTIFICATION_SCHEDULE, - /* NOTIFICATION : ALARM : TIMER */ - SVI_VIB_NOTIFICATION_TIMER, - /* NOTIFICATION : GENERAL(TICKER/IM/SMS ETC) */ - SVI_VIB_NOTIFICATION_GENERAL, - - /* OPERATION : POWER ON/OFF */ - SVI_VIB_OPERATION_POWER_ON, - SVI_VIB_OPERATION_POWER_OFF, - /* OPERATION : CHARGECONN */ - SVI_VIB_OPERATION_CHARGERCONN, - /* OPERATION : FULLCHAREGED */ - SVI_VIB_OPERATION_FULLCHARGED, - /* OPERATION : LOW BATTERY */ - SVI_VIB_OPERATION_LOWBATT, - /* OPERATION : LOCK/UNLOCK */ - SVI_VIB_OPERATION_LOCK, - SVI_VIB_OPERATION_UNLOCK, - /* OPERATION : CALL CONNECT/ DISCONNECT */ - SVI_VIB_OPERATION_CALLCONNECT, - SVI_VIB_OPERATION_DISCALLCONNECT, - /* OPERATION : MINUTE MINDER */ - SVI_VIB_OPERATION_MINUTEMINDER, - /* OPERATION : VIBRATION */ - SVI_VIB_OPERATION_VIBRATION, - /* OPERATION : BALLOON MESSAGE SEND/RECV */ - SVI_VIB_OPERATION_NEWCHAT, - SVI_VIB_OPERATION_SENDCHAT, - /* OPERATION : ON/OFF SLIDER */ - SVI_VIB_OPERATION_ONOFFSLIDER, - /* OPERATION : CAMERA SHUTTER / SCREEN CAPTURE */ - SVI_VIB_OPERATION_SHUTTER, - /* OPERATION : LIST RE-ORDER */ - SVI_VIB_OPERATION_LIST_REORDER, - /* OPERATION : LIST SLIDER */ - SVI_VIB_OPERATION_SLIDER_SWEEP, - - SVI_VIB_ENUM_END - -} vibration_type; - -#endif //__SVI_IDS_H__ diff --git a/include/svi-log.h b/include/svi-log.h deleted file mode 100755 index eef6941..0000000 --- a/include/svi-log.h +++ /dev/null @@ -1,32 +0,0 @@ -/* - * libfeedback - * 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 __SVI_LOG_H__ -#define __SVI_LOG_H__ - -#define FEATURE_SVI_DLOG - -#ifdef FEATURE_SVI_DLOG - #define LOG_TAG "SVI" - #include - #define SVILOG(fmt, args...) SLOGD("<%s:%4d> " fmt "\n", __func__, __LINE__, ##args) -#else - #define SVILOG(x, ...) -#endif - -#endif //__SVI_LOG_H__ diff --git a/include/svi.h b/include/svi.h deleted file mode 100755 index bbef08a..0000000 --- a/include/svi.h +++ /dev/null @@ -1,666 +0,0 @@ -/* - * libfeedback - * 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 __SVI_H__ -#define __SVI_H__ - -/** - * @addtogroup APPLICATION_FRAMEWORK - * @{ - * - * @defgroup SVI SVI - * @brief A library for playing sound and vibration. - * - * @section Header To use Them: - * @code - * #include - * @endcode - * - * @section Vib_IDs Vibration IDs - * @code - SVI_VIB_TOUCH_TOUCH - SVI_VIB_TOUCH_SIP - SVI_VIB_TOUCH_SIP_BACKSPACE - SVI_VIB_TOUCH_HOLD - SVI_VIB_TOUCH_MULTI_TAP - SVI_VIB_TOUCH_HW_TAP - SVI_VIB_TOUCH_HW_HOLD - - SVI_VIB_TOUCH_KEY00 - SVI_VIB_TOUCH_KEY01 - SVI_VIB_TOUCH_KEY02 - SVI_VIB_TOUCH_KEY03 - SVI_VIB_TOUCH_KEY04 - SVI_VIB_TOUCH_KEY05 - SVI_VIB_TOUCH_KEY06 - SVI_VIB_TOUCH_KEY07 - SVI_VIB_TOUCH_KEY08 - SVI_VIB_TOUCH_KEY09 - SVI_VIB_TOUCH_KEY_STAR - SVI_VIB_TOUCH_KEY_SHARP - - SVI_VIB_NOTIFICATION_INCOMING_CALL01 - SVI_VIB_NOTIFICATION_INCOMING_CALL02 - SVI_VIB_NOTIFICATION_INCOMING_CALL03 - SVI_VIB_NOTIFICATION_MESSAGE - SVI_VIB_NOTIFICATION_EMAIL - SVI_VIB_NOTIFICATION_WAKEUP - SVI_VIB_NOTIFICATION_SCHEDULE - SVI_VIB_NOTIFICATION_TIMER - SVI_VIB_NOTIFICATION_GENERAL - - SVI_VIB_OPERATION_POWER_ON - SVI_VIB_OPERATION_POWER_OFF - SVI_VIB_OPERATION_CHARGERCONN - SVI_VIB_OPERATION_FULLCHARGED - SVI_VIB_OPERATION_LOWBATT - SVI_VIB_OPERATION_LOCK - SVI_VIB_OPERATION_UNLOCK - SVI_VIB_OPERATION_CALLCONNECT - SVI_VIB_OPERATION_DISCALLCONNECT - SVI_VIB_OPERATION_MINUTEMINDER - SVI_VIB_OPERATION_VIBRATION - SVI_VIB_OPERATION_NEWCHAT - SVI_VIB_OPERATION_SENDCHAT - SVI_VIB_OPERATION_ONOFFSLIDER - SVI_VIB_OPERATION_SHUTTER - SVI_VIB_OPERATION_LIST_REORDER - SVI_VIB_OPERATION_SLIDER_SWEEP - * @endcode - * - * @section Snd_IDs Sound IDs - * @code - SVI_SND_TOUCH_TOUCH1 - SVI_SND_TOUCH_TOUCH2 - SVI_SND_TOUCH_TOUCH3 - SVI_SND_TOUCH_SIP - SVI_SND_TOUCH_SIP_BACKSPACE - SVI_SND_TOUCH_HOLD - SVI_SND_TOUCH_MULTI_TAP - SVI_SND_TOUCH_HW_TAP - SVI_SND_TOUCH_HW_HOLD - - SVI_SND_TOUCH_KEY00 - SVI_SND_TOUCH_KEY01 - SVI_SND_TOUCH_KEY02 - SVI_SND_TOUCH_KEY03 - SVI_SND_TOUCH_KEY04 - SVI_SND_TOUCH_KEY05 - SVI_SND_TOUCH_KEY06 - SVI_SND_TOUCH_KEY07 - SVI_SND_TOUCH_KEY08 - SVI_SND_TOUCH_KEY09 - SVI_SND_TOUCH_KEY_STAR - SVI_SND_TOUCH_KEY_SHARP - - SVI_SND_OPERATION_POWERON - SVI_SND_OPERATION_POWEROFF - SVI_SND_OPERATION_CHARGERCONN - SVI_SND_OPERATION_FULLCHARGED - SVI_SND_OPERATION_LOWBATT - SVI_SND_OPERATION_LOCK - SVI_SND_OPERATION_UNLOCK - SVI_SND_OPERATION_CALLCONN - SVI_SND_OPERATION_CALLDISCONN - SVI_SND_OPERATION_MINUTE_MINDER - SVI_SND_OPERATION_VIBRATION - SVI_SND_OPERATION_NEWCHAT - SVI_SND_OPERATION_SENTCHAT - SVI_SND_OPERATION_ONOFFSLIDER - SVI_SND_OPERATION_SCRCAPTURE - SVI_SND_OPERATION_LIST_REORDER - SVI_SND_OPERATION_SLIDER_SWEEP - * @endcode - */ - -/** - * @addtogroup SVI - * @{ - */ - -#include - -#ifdef __cplusplus -extern "C" -{ -#endif - -#define SVI_SUCCESS 0 -#define SVI_ERROR -1 - -/** - * \par Description: - * Initialize audio ui library.\n - * Load sound profile and status, and open haptic device.\n - * - * \par Purpose: - * This API is used for initializing sound and haptic device. - * - * \par Typical use case: - * If user want to initialize sound or vibration, he(or she) can use this API. - * - * \par Method of function operation: - * SVI uses multimedia sound library and device manager library. - * - * \par Important notes: - * None - * - * \param handle [out] svi handle. - * - * \return Return Type (int) \n - * - SVI_SUCCESS - initialize sound status and haptic device successfully. \n - * - SVI_ERROR - fail to initialize sound status or haptic device. \n - * - * \par Prospective clients: - * External Apps. - * - * \par Related functions: - * svi_fini() - * - * \par Known issues/bugs: - * None - * - * \pre - * None - * - * \post - * None - * - * \see - * None - * - * \remarks - * None - * - * \par Sample code: - * \code - * ... - * #include - * ... - * int r = 0; - * int handle = 0; - * - * r = svi_init(&handle); //Initialize SVI - * - * if ( r != SVI_SUCCESS ) { - * printf("Cannot initialize SVI.\n"); - * svi_fini(handle); //If initialization is failed, finalize SVI directly - * } else { - * - * r = svi_play (handle, SVI_VIB_TOUCH_TOUCH, SVI_SND_TOUCH_TOUCH1); //Play sound and vibration - * if (r != SVI_SUCCESS) { - * printf("Cannot play sound or vibration.\n"); - * } - * - * r = svi_fini(handle); //Finalize SVI - * if (r != SVI_SUCCESS) { - * printf("Cannot close SVI.\n"); - * } - * } - * - * ... - * \endcode - */ -/*================================================================================================*/ -int svi_init(int *handle); - -/** - * \par Description: - * Finalize audio ui library.\n - * Unload sound profile and status, and close haptic device.\n - * - * \par Purpose: - * This API is used for finalize sound and close haptic device. - * - * \par Typical use case: - * If user want to finalize sound or close haptic device, he(or she) can use this API. - * - * \par Method of function operation: - * SVI uses multimedia sound library and device manager library. - * - * \par Important notes: - * None - * - * \param handle [in] svi handle. - * - * \return Return Type (int) \n - * - SVI_SUCCESS - finalize sound status and close haptic device successfully. \n - * - SVI_ERROR - fail to finalize sound status or close haptic device. \n - * - * \par Prospective clients: - * External Apps. - * - * \par Related functions: - * svi_init() - * - * \par Known issues/bugs: - * None - * - * \pre - * None - * - * \post - * None - * - * \see - * None - * - * \remarks - * None - * - * \par Sample code: - * \code - * ... - * #include - * ... - * int r = 0; - * int handle = 0; - * - * r = svi_init(&handle); //Initialize SVI - * - * if ( r != SVI_SUCCESS ) { - * printf("Cannot initialize SVI.\n"); - * svi_fini(handle); //If initialization is failed, finalize SVI directly - * } else { - * - * r = svi_play (handle, SVI_VIB_TOUCH_TOUCH, SVI_SND_TOUCH_TOUCH1); //Play sound and vibration - * if (r != SVI_SUCCESS) { - * printf("Cannot play sound or vibration.\n"); - * } - * - * r = svi_fini(handle); //Finalize SVI - * if (r != SVI_SUCCESS) { - * printf("Cannot close SVI.\n"); - * } - * } - * - * ... - * \endcode - */ -/*================================================================================================*/ -int svi_fini(int handle); - - -/** - * \par Description: - * Play simple sound.\n - * - * \par Purpose: - * This API is used for playing predefined simple sound. - * - * \par Typical use case: - * If user want to play sound for predefined simple pattern, he(or she) can use this API. - * - * \par Method of function operation: - * SVI uses multimedia sound library. - * - * \par Important notes: - * None - * - * \param handle [in] svi handle. - * \param sound_key [in] predefined sound key. - * - * \return Return Type (int) \n - * - SVI_SUCCESS - play sound successfully. \n - * - SVI_ERROR - fail to play sound . \n - * - * \par Prospective clients: - * External Apps. - * - * \par Related functions: - * None - * - * \par Known issues/bugs: - * None - * - * \pre - * None - * - * \post - * None - * - * \see - * None - * - * \remarks - * None - * - * \par Sample code: - * \code - * ... - * #include - * ... - * int r = 0; - * int handle = 0; - * - * r = svi_init(&handle); //Initialize SVI - * - * if ( r != SVI_SUCCESS ) { - * printf("Cannot initialize SVI.\n"); - * svi_fini(handle); //If initialization is failed, finalize SVI directly - * } else { - * - * r = svi_play_sound (handle, SVI_SND_TOUCH_TOUCH1); //Play sound - * if (r != SVI_SUCCESS) { - * printf("Cannot play sound or vibration.\n"); - * } - * - * r = svi_fini(handle); //Finalize SVI - * if (r != SVI_SUCCESS) { - * printf("Cannot close SVI.\n"); - * } - * } - * - * ... - * \endcode - */ -/*================================================================================================*/ -int svi_play_sound(int handle, sound_type sound_key); - -/** - * \par Description: - * Play simple vibration.\n - * - * \par Purpose: - * This API is used for playing predefined simple vibration. - * - * \par Typical use case: - * If user want to play vibration for predefined simple pattern, he(or she) can use this API. - * - * \par Method of function operation: - * SVI uses device manager library. - * - * \par Important notes: - * None - * - * \param handle [in] svi handle. - * \param vibration_key [in] predefined vibration key. - * - * \return Return Type (int) \n - * - SVI_SUCCESS - play sound and vibration successfully. \n - * - SVI_ERROR - fail to play sound or vibration. \n - * - * \par Prospective clients: - * External Apps. - * - * \par Related functions: - * None - * - * \par Known issues/bugs: - * None - * - * \pre - * None - * - * \post - * None - * - * \see - * None - * - * \remarks - * None - * - * \par Sample code: - * \code - * ... - * #include - * ... - * int r = 0; - * int handle = 0; - * - * r = svi_init(&handle); //Initialize SVI - * - * if ( r != SVI_SUCCESS ) { - * printf("Cannot initialize SVI.\n"); - * svi_fini(handle); //If initialization is failed, finalize SVI directly - * } else { - * - * r = svi_play_vib (handle, SVI_VIB_TOUCH_TOUCH); //Play vibration - * if (r != SVI_SUCCESS) { - * printf("Cannot play sound or vibration.\n"); - * } - * - * r = svi_fini(handle); //Finalize SVI - * if (r != SVI_SUCCESS) { - * printf("Cannot close SVI.\n"); - * } - * } - * - * ... - * \endcode - */ -/*================================================================================================*/ -int svi_play_vib(int handle, vibration_type vibration_key); - -/** - * \par Description: - * Play simple sound and vibration.\n - * - * \par Purpose: - * This API is used for playing predefined simple sound and vibration. - * - * \par Typical use case: - * If user want to play sound or vibration for predefined simple pattern, he(or she) can use this API. - * - * \par Method of function operation: - * SVI uses multimedia sound library and device manager library. - * - * \par Important notes: - * None - * - * \param handle [in] svi handle. - * \param vibration_key [in] predefined vibration key. - * \param sound_key [in] predefined sound key. - * - * \return Return Type (int) \n - * - SVI_SUCCESS - play sound and vibration successfully. \n - * - SVI_ERROR - fail to play sound or vibration. \n - * - * \par Prospective clients: - * External Apps. - * - * \par Related functions: - * None - * - * \par Known issues/bugs: - * None - * - * \pre - * None - * - * \post - * None - * - * \see - * None - * - * \remarks - * None - * - * \par Sample code: - * \code - * ... - * #include - * ... - * int r = 0; - * int handle = 0; - * - * r = svi_init(&handle); //Initialize SVI - * - * if ( r != SVI_SUCCESS ) { - * printf("Cannot initialize SVI.\n"); - * svi_fini(handle); //If initialization is failed, finalize SVI directly. - * } else { - * - * r = svi_play (handle, SVI_VIB_TOUCH_TOUCH, SVI_SND_TOUCH_TOUCH1); //Play sound and vibration - * if (r != SVI_SUCCESS) { - * printf("Cannot play sound or vibration.\n"); - * } - * - * r = svi_fini(handle); //Finalize SVI - * if (r != SVI_SUCCESS) { - * printf("Cannot close SVI.\n"); - * } - * } - * - * ... - * \endcode - */ -/*================================================================================================*/ -int svi_play(int handle, vibration_type vibration_key, sound_type sound_key); - -/** - * \par Description: - * Set filepath for sound & vibration pattern.\n - * - * \par Purpose: - * This API is used for setting filepath of sound & vibration pattern. - * - * \par Typical use case: - * In case that user want to set filepath of sound or vibration pattern. - * - * \par Method of function operation: - * SVI uses multimedia sound library and device manager library. - * - * \par Important notes: - * None - * - * \param svi_type [in] svi_type(sound, vibration). - * \param svi_enum [in] predefined enum_type. - * \param path [in] file path. - * - * \return Return Type (int) \n - * - SVI_SUCCESS - \n - * - SVI_ERROR - \n - * - * \par Prospective clients: - * External Apps. - * - * \par Related functions: - * None - * - * \par Known issues/bugs: - * None - * - * \pre - * None - * - * \post - * None - * - * \see - * None - * - * \remarks - * None - * - * \par Sample code: - * \code - * ... - * #include - * ... - * int r = 0; - * char *path[512] = "/mnt/ums/sound/sound.wav"; - * - * r = svi_set_path(SVI_SND_TYPE, SVI_SND_TOUCH_TOUCH1, path); - * - * if ( r != SVI_SUCCESS ) { - * printf("Fail.\n"); - * } - * ... - * \endcode - */ -/*================================================================================================*/ -int svi_set_path(int svi_type, int svi_enum, char* path); - -/** - * \par Description: - * Get filepath for sound & vibration pattern.\n - * - * \par Purpose: - * This API is used for getting filepath of sound & vibration pattern. - * - * \par Typical use case: - * In case that user want to get filepath of sound or vibration pattern. - * - * \par Method of function operation: - * SVI uses multimedia sound library and device manager library. - * - * \par Important notes: - * None - * - * \param svi_type [in] svi_type(sound, vibration). - * \param svi_enum [in] predefined enum_type. - * \param buf [out] allocated buffer. - * \param bufLen [out] allocated buffer size. - * - * \return Return Type (int) \n - * - SVI_SUCCESS - \n - * - SVI_ERROR - \n - * - * \par Prospective clients: - * External Apps. - * - * \par Related functions: - * None - * - * \par Known issues/bugs: - * None - * - * \pre - * None - * - * \post - * None - * - * \see - * None - * - * \remarks - * None - * - * \par Sample code: - * \code - * ... - * #include - * ... - * int r = 0; - * char buf[512] = {0,}; - * - * r = svi_get_path(SVI_SND_TYPE, SVI_SND_TOUCH_TOUCH1, buf, sizeof(buf)); - * - * if ( r != SVI_SUCCESS ) { - * printf("Fail.\n"); - * } - * ... - * \endcode - */ -/*================================================================================================*/ - -int svi_get_path(int svi_type, int svi_enum, char* buf, unsigned int bufLen); - -#ifdef __cplusplus -} -#endif - -/** - * @} @} - */ - -#endif //__SVI_H__ diff --git a/include/xmlparser.h b/include/xmlparser.h index cb92b06..0c38672 100644 --- a/include/xmlparser.h +++ b/include/xmlparser.h @@ -23,7 +23,8 @@ struct xmlData { char *label; - unsigned char *data; + char *data; + int size; }; enum xmlType { @@ -31,13 +32,15 @@ enum xmlType { XML_DATA, }; -#define VIBRATION "vibration" +#define VIBRATION_STR "vibration" +#define SOUND_STR "sound" xmlDocPtr xml_open(const char *xml); void xml_close(xmlDocPtr doc); -xmlNodePtr xml_find(xmlDocPtr doc, const xmlChar* expr); +xmlNodePtr xml_find(xmlDocPtr doc, const char *label, const xmlChar* expr); struct xmlData *xml_parse(xmlDocPtr doc, xmlNodePtr cur); +int xml_decode_data(struct xmlData *data); int xml_save(xmlDocPtr doc, const char *path); void xml_free(struct xmlData* data); diff --git a/packaging/libfeedback.changes b/packaging/libfeedback.changes deleted file mode 100644 index 32f65c8..0000000 --- a/packaging/libfeedback.changes +++ /dev/null @@ -1,10 +0,0 @@ -* Fri Sep 27 2013 jy910.yun submit/tizen/20130913.132819@c1dfd9e -- change the svi-data-sdk manifest file name -- change the resource file locations to /opt/usr/share form /opt/share - -* Fri Sep 26 2013 jy910.yun submit/tizen/20130913.132819@7b034f3 -- add device_ops structure for improving feedback structure - -* Fri Jul 12 2013 Patrick McCarty 763c4f2 -- Fix manifest installation - diff --git a/packaging/libfeedback.manifest b/packaging/libfeedback.manifest index 017d22d..f13bba5 100644 --- a/packaging/libfeedback.manifest +++ b/packaging/libfeedback.manifest @@ -1,5 +1,9 @@ - - - + + + + + + + diff --git a/packaging/libfeedback.spec b/packaging/libfeedback.spec index fc87bb0..cdb110b 100644 --- a/packaging/libfeedback.spec +++ b/packaging/libfeedback.spec @@ -1,27 +1,27 @@ Name: libfeedback Summary: Feedback library Version: 0.1.3 -Release: 0 +Release: 1 Group: System/Libraries -License: Apache-2.0 +License: Apache License, Version 2.0 Source0: %{name}-%{version}.tar.gz -Source1: libsvi.manifest -Source2: libfeedback.manifest -Source3: svi-data.manifest -Requires(post): /sbin/ldconfig +source1: libfeedback.manifest +source2: svi-data.manifest +Requires(post): /sbin/ldconfig Requires(postun): /sbin/ldconfig BuildRequires: cmake BuildRequires: pkgconfig(dlog) BuildRequires: pkgconfig(vconf) BuildRequires: pkgconfig(mm-keysound) -BuildRequires: pkgconfig(haptic) BuildRequires: pkgconfig(libxml-2.0) BuildRequires: pkgconfig(glib-2.0) BuildRequires: pkgconfig(capi-base-common) -BuildRequires: pkgconfig(libtzplatform-config) +BuildRequires: pkgconfig(dbus-1) +Requires(post): svi-data %description -Feedback library for playing sound, vibration and led +Feedback library for playing sound and vibration + %package -n libfeedback-devel Summary: Feedback library for (devel) @@ -29,85 +29,76 @@ Group: Development/Libraries Requires: libfeedback = %{version}-%{release} %description -n libfeedback-devel -Feedback library for playing sound, vibration and led (devel) - -%package -n libsvi -Summary: SVI library -Group: Development/Libraries -Requires: libfeedback = %{version}-%{release} - -%description -n libsvi -SVI library package - -%package -n libsvi-devel -Summary: SVI library for (devel) -Group: Development/Libraries -Requires: libsvi = %{version}-%{release} - -%description -n libsvi-devel -SVI library (devel) package +Feedback library for playing sound and vibration (devel) %package -n svi-data -Summary: SVI resource -Group: Development/Libraries +Summary: svi resource package +Group: Development/Libraries %description -n svi-data -SVI resource package +svi resource package %prep -%setup -q +%setup -q %build +export CFLAGS+=" -DTIZEN_ENGINEER_MODE" cp %{SOURCE1} . cp %{SOURCE2} . -cp %{SOURCE3} . -%cmake . -%__make + +%ifarch %{arm} +%define ARCH arm +%else +%define ARCH emulator +%endif + +%cmake \ +%if "%{?tizen_profile_name}" == "wearable" + -DMICRO_DD=YES \ +%endif + . -DCMAKE_INSTALL_PREFIX=%{_prefix} -DARCH=%{ARCH} +make %install rm -rf %{buildroot} %make_install mkdir -p %{buildroot}%{_datadir}/license -cp LICENSE.APLv2 %{buildroot}%{_datadir}/license/%{name} +cp LICENSE %{buildroot}/usr/share/license/%{name} +cp LICENSE %{buildroot}/usr/share/license/svi-data + +mkdir -p %{buildroot}/opt/usr/share/feedback/haptic/custom %post -p /sbin/ldconfig -%post -n libsvi -p /sbin/ldconfig +%post -n svi-data -%postun -n libsvi -p /sbin/ldconfig +if [ -f %{_libdir}/rpm-plugins/msm.so ]; then + find /opt/usr/share/feedback/ | xargs chsmack -a 'svi-data' +fi %postun -p /sbin/ldconfig %postun -n svi-data rm -rf %{_datadir}/feedback/ +rm -rf /opt/usr/share/feedback/ %files -%manifest %{name}.manifest %defattr(-,root,root,-) %{_libdir}/libfeedback.so.* %{_datadir}/license/%{name} +%manifest libfeedback.manifest %files -n libfeedback-devel -%manifest %{name}.manifest %defattr(-,root,root,-) %{_includedir}/feedback/*.h %{_libdir}/libfeedback.so %{_libdir}/pkgconfig/feedback.pc -%files -n libsvi -%manifest %{name}.manifest -%defattr(-,root,root,-) -%{_libdir}/libsvi.so.* - -%files -n libsvi-devel -%manifest %{name}.manifest -%defattr(-,root,root,-) -%{_includedir}/svi/*.h -%{_libdir}/libsvi.so -%{_libdir}/pkgconfig/svi.pc - %files -n svi-data -%manifest %{name}.manifest %defattr(644,root,root,-) %{_datadir}/feedback/* +%defattr(666,app,app,-) +%dir /opt/usr/share/feedback/haptic/custom +%{_datadir}/license/svi-data +%manifest svi-data.manifest diff --git a/packaging/libsvi.manifest b/packaging/libsvi.manifest deleted file mode 100644 index 81ace0c..0000000 --- a/packaging/libsvi.manifest +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/packaging/svi-data.manifest b/packaging/svi-data.manifest index 97e8c31..9e74af7 100644 --- a/packaging/svi-data.manifest +++ b/packaging/svi-data.manifest @@ -1,4 +1,11 @@ + + + + + + + diff --git a/pg-doxy/doxygen.conf b/pg-doxy/doxygen.conf new file mode 100755 index 0000000..a7cd424 --- /dev/null +++ b/pg-doxy/doxygen.conf @@ -0,0 +1,850 @@ +# Doxyfile 1.5.2 + +# This file describes the settings to be used by the documentation system +# doxygen (www.doxygen.org) for a project +# +# All text after a hash (#) is considered a comment and will be ignored +# The format is: +# TAG = value [value, ...] +# For lists items can also be appended using: +# TAG += value [value, ...] +# Values that contain spaces should be placed between quotes (" ") + +#--------------------------------------------------------------------------- +# Project related configuration options +#--------------------------------------------------------------------------- + +DOXYFILE_ENCODING = UTF-8 +PROJECT_NAME = SLP-Developer Library +PROJECT_NUMBER = +OUTPUT_DIRECTORY = ./doxygen_output +CREATE_SUBDIRS = NO +OUTPUT_LANGUAGE = English +BRIEF_MEMBER_DESC = YES +REPEAT_BRIEF = YES +ABBREVIATE_BRIEF = NO +ALWAYS_DETAILED_SEC = YES +INLINE_INHERITED_MEMB = NO +FULL_PATH_NAMES = NO +STRIP_FROM_PATH = +STRIP_FROM_INC_PATH = +SHORT_NAMES = YES +JAVADOC_AUTOBRIEF = NO +MULTILINE_CPP_IS_BRIEF = NO +DETAILS_AT_TOP = YES +INHERIT_DOCS = YES +SEPARATE_MEMBER_PAGES = YES +TAB_SIZE = 8 +ALIASES = +OPTIMIZE_OUTPUT_FOR_C = NO +OPTIMIZE_OUTPUT_JAVA = NO +BUILTIN_STL_SUPPORT = NO +CPP_CLI_SUPPORT = NO +DISTRIBUTE_GROUP_DOC = NO +SUBGROUPING = YES + +#--------------------------------------------------------------------------- +# Build related configuration options +#--------------------------------------------------------------------------- + +EXTRACT_ALL = YES +EXTRACT_PRIVATE = YES +EXTRACT_STATIC = YES +EXTRACT_LOCAL_CLASSES = NO +EXTRACT_LOCAL_METHODS = YES +HIDE_UNDOC_MEMBERS = YES +HIDE_UNDOC_CLASSES = YES +HIDE_FRIEND_COMPOUNDS = YES +HIDE_IN_BODY_DOCS = NO +INTERNAL_DOCS = NO +CASE_SENSE_NAMES = YES +HIDE_SCOPE_NAMES = NO +SHOW_INCLUDE_FILES = YES +INLINE_INFO = YES +SORT_MEMBER_DOCS = YES +SORT_BRIEF_DOCS = YES +SORT_BY_SCOPE_NAME = YES +SORT_GROUP_NAMES = YES +GENERATE_TODOLIST = NO +USE_INLINE_TREES = NO +SHOW_NAMESPACES = NO +HTML DYNAMIC SECTIONS = YES +GENERATE_TESTLIST = NO +GENERATE_BUGLIST = NO +GENERATE_DEPRECATEDLIST= NO +ENABLED_SECTIONS = +MAX_INITIALIZER_LINES = 30 +SHOW_USED_FILES = YES +SHOW_DIRECTORIES = NO +FILE_VERSION_FILTER = + +#--------------------------------------------------------------------------- +# configuration options related to warning and progress messages +#--------------------------------------------------------------------------- + +# The QUIET tag can be used to turn on/off the messages that are generated +# by doxygen. Possible values are YES and NO. If left blank NO is used. + +QUIET = NO + +# The WARNINGS tag can be used to turn on/off the warning messages that are +# generated by doxygen. Possible values are YES and NO. If left blank +# NO is used. + +WARNINGS = YES + +# If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings +# for undocumented members. If EXTRACT_ALL is set to YES then this flag will +# automatically be disabled. + +WARN_IF_UNDOCUMENTED = YES + +# If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for +# potential errors in the documentation, such as not documenting some +# parameters in a documented function, or documenting parameters that +# don't exist or using markup commands wrongly. + +WARN_IF_DOC_ERROR = YES + +# This WARN_NO_PARAMDOC option can be abled to get warnings for +# functions that are documented, but have no documentation for their parameters +# or return value. If set to NO (the default) doxygen will only warn about +# wrong or incomplete parameter documentation, but not about the absence of +# documentation. + +WARN_NO_PARAMDOC = NO + +# The WARN_FORMAT tag determines the format of the warning messages that +# doxygen can produce. The string should contain the $file, $line, and $text +# tags, which will be replaced by the file and line number from which the +# warning originated and the warning text. Optionally the format may contain +# $version, which will be replaced by the version of the file (if it could +# be obtained via FILE_VERSION_FILTER) + +WARN_FORMAT = "$file:$line: $text" + +# The WARN_LOGFILE tag can be used to specify a file to which warning +# and error messages should be written. If left blank the output is written +# to stderr. + +WARN_LOGFILE = + +#--------------------------------------------------------------------------- +# configuration options related to the input files +#--------------------------------------------------------------------------- + +# The INPUT tag can be used to specify the files and/or directories that contain +# documented source files. You may enter file names like "myfile.cpp" or +# directories like "/usr/src/myproject". Separate the files or directories +# with spaces. + +INPUT = .. + +# This tag can be used to specify the character encoding of the source files that +# doxygen parses. Internally doxygen uses the UTF-8 encoding, which is also the default +# input encoding. Doxygen uses libiconv (or the iconv built into libc) for the transcoding. +# See http://www.gnu.org/software/libiconv for the list of possible encodings. + +INPUT_ENCODING = UTF-8 +FILE_PATTERNS = *.h \ + *.doxy +RECURSIVE = YES +EXCLUDE = +EXCLUDE_SYMLINKS = NO +EXCLUDE_PATTERNS = */test/* \ + */debian/* \ + */lost+found/* \ + */i386/* \ + */arm/* \ + */simulator/* \ + *test* \ + */voda3rd/* +EXCLUDE_SYMBOLS = +EXAMPLE_PATH = +EXAMPLE_PATTERNS = +EXAMPLE_RECURSIVE = NO +IMAGE_PATH = ../image +INPUT_FILTER = +FILTER_PATTERNS = +FILTER_SOURCE_FILES = NO + +#--------------------------------------------------------------------------- +# configuration options related to source browsing +#--------------------------------------------------------------------------- + +# If the SOURCE_BROWSER tag is set to YES then a list of source files will +# be generated. Documented entities will be cross-referenced with these sources. +# Note: To get rid of all source code in the generated output, make sure also +# VERBATIM_HEADERS is set to NO. + +SOURCE_BROWSER = NO + +# Setting the INLINE_SOURCES tag to YES will include the body +# of functions and classes directly in the documentation. + +INLINE_SOURCES = NO + +# Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct +# doxygen to hide any special comment blocks from generated source code +# fragments. Normal C and C++ comments will always remain visible. + +STRIP_CODE_COMMENTS = YES + +# If the REFERENCED_BY_RELATION tag is set to YES (the default) +# then for each documented function all documented +# functions referencing it will be listed. + +REFERENCED_BY_RELATION = YES + +# If the REFERENCES_RELATION tag is set to YES (the default) +# then for each documented function all documented entities +# called/used by that function will be listed. + +REFERENCES_RELATION = YES + +# If the REFERENCES_LINK_SOURCE tag is set to YES (the default) +# and SOURCE_BROWSER tag is set to YES, then the hyperlinks from +# functions in REFERENCES_RELATION and REFERENCED_BY_RELATION lists will +# link to the source code. Otherwise they will link to the documentstion. + +REFERENCES_LINK_SOURCE = YES + +# If the USE_HTAGS tag is set to YES then the references to source code +# will point to the HTML generated by the htags(1) tool instead of doxygen +# built-in source browser. The htags tool is part of GNU's global source +# tagging system (see http://www.gnu.org/software/global/global.html). You +# will need version 4.8.6 or higher. + +USE_HTAGS = NO + +# If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen +# will generate a verbatim copy of the header file for each class for +# which an include is specified. Set to NO to disable this. + +VERBATIM_HEADERS = YES + +#--------------------------------------------------------------------------- +# configuration options related to the alphabetical class index +#--------------------------------------------------------------------------- + +# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index +# of all compounds will be generated. Enable this if the project +# contains a lot of classes, structs, unions or interfaces. + +ALPHABETICAL_INDEX = YES +COLS_IN_ALPHA_INDEX = 10 +IGNORE_PREFIX = + +#--------------------------------------------------------------------------- +# configuration options related to the HTML output +#--------------------------------------------------------------------------- + +# If the GENERATE_HTML tag is set to YES (the default) Doxygen will +# generate HTML output. + +GENERATE_HTML = YES + +# The HTML_OUTPUT tag is used to specify where the HTML docs will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# put in front of it. If left blank `html' will be used as the default path. + +HTML_OUTPUT = html + +# The HTML_FILE_EXTENSION tag can be used to specify the file extension for +# each generated HTML page (for example: .htm,.php,.asp). If it is left blank +# doxygen will generate files with .html extension. + +HTML_FILE_EXTENSION = .html + +# The HTML_HEADER tag can be used to specify a personal HTML header for +# each generated HTML page. If it is left blank doxygen will generate a +# standard header. + +HTML_HEADER = + +# The HTML_FOOTER tag can be used to specify a personal HTML footer for +# each generated HTML page. If it is left blank doxygen will generate a +# standard footer. + +HTML_FOOTER = + +# The HTML_STYLESHEET tag can be used to specify a user-defined cascading +# style sheet that is used by each HTML page. It can be used to +# fine-tune the look of the HTML output. If the tag is left blank doxygen +# will generate a default style sheet. Note that doxygen will try to copy +# the style sheet file to the HTML output directory, so don't put your own +# stylesheet in the HTML output directory as well, or it will be erased! + +HTML_STYLESHEET =./slp_doxy.css + +# If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes, +# files or namespaces will be aligned in HTML using tables. If set to +# NO a bullet list will be used. + +HTML_ALIGN_MEMBERS = YES + +# If the GENERATE_HTMLHELP tag is set to YES, additional index files +# will be generated that can be used as input for tools like the +# Microsoft HTML help workshop to generate a compressed HTML help file (.chm) +# of the generated HTML documentation. + +GENERATE_HTMLHELP = YES + +# If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can +# be used to specify the file name of the resulting .chm file. You +# can add a path in front of the file if the result should not be +# written to the html output directory. + +CHM_FILE = + +# If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can +# be used to specify the location (absolute path including file name) of +# the HTML help compiler (hhc.exe). If non-empty doxygen will try to run +# the HTML help compiler on the generated index.hhp. + +HHC_LOCATION = + +# If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag +# controls if a separate .chi index file is generated (YES) or that +# it should be included in the master .chm file (NO). + +GENERATE_CHI = NO + +# If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag +# controls whether a binary table of contents is generated (YES) or a +# normal table of contents (NO) in the .chm file. + +BINARY_TOC = NO + +# The TOC_EXPAND flag can be set to YES to add extra items for group members +# to the contents of the HTML help documentation and to the tree view. + +TOC_EXPAND = NO + +# The DISABLE_INDEX tag can be used to turn on/off the condensed index at +# top of each HTML page. The value NO (the default) enables the index and +# the value YES disables it. + +DISABLE_INDEX = NO + +# This tag can be used to set the number of enum values (range [1..20]) +# that doxygen will group on one line in the generated HTML documentation. + +ENUM_VALUES_PER_LINE = 4 + +# If the GENERATE_TREEVIEW tag is set to YES, a side panel will be +# generated containing a tree-like index structure (just like the one that +# is generated for HTML Help). For this to work a browser that supports +# JavaScript, DHTML, CSS and frames is required (for instance Mozilla 1.0+, +# Netscape 6.0+, Internet explorer 5.0+, or Konqueror). Windows users are +# probably better off using the HTML help feature. + +GENERATE_TREEVIEW = YES + +# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be +# used to set the initial width (in pixels) of the frame in which the tree +# is shown. + +TREEVIEW_WIDTH = 190 + +#--------------------------------------------------------------------------- +# configuration options related to the LaTeX output +#--------------------------------------------------------------------------- + +# If the GENERATE_LATEX tag is set to YES (the default) Doxygen will +# generate Latex output. + +GENERATE_LATEX = NO + +# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# put in front of it. If left blank `latex' will be used as the default path. + +LATEX_OUTPUT = latex + +# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be +# invoked. If left blank `latex' will be used as the default command name. + +LATEX_CMD_NAME = latex + +# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to +# generate index for LaTeX. If left blank `makeindex' will be used as the +# default command name. + +MAKEINDEX_CMD_NAME = makeindex + +# If the COMPACT_LATEX tag is set to YES Doxygen generates more compact +# LaTeX documents. This may be useful for small projects and may help to +# save some trees in general. + +COMPACT_LATEX = NO + +# The PAPER_TYPE tag can be used to set the paper type that is used +# by the printer. Possible values are: a4, a4wide, letter, legal and +# executive. If left blank a4wide will be used. + +PAPER_TYPE = a4wide + +# The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX +# packages that should be included in the LaTeX output. + +EXTRA_PACKAGES = + +# The LATEX_HEADER tag can be used to specify a personal LaTeX header for +# the generated latex document. The header should contain everything until +# the first chapter. If it is left blank doxygen will generate a +# standard header. Notice: only use this tag if you know what you are doing! + +LATEX_HEADER = + +# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated +# is prepared for conversion to pdf (using ps2pdf). The pdf file will +# contain links (just like the HTML output) instead of page references +# This makes the output suitable for online browsing using a pdf viewer. + +PDF_HYPERLINKS = NO + +# If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of +# plain latex in the generated Makefile. Set this option to YES to get a +# higher quality PDF documentation. + +USE_PDFLATEX = NO + +# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode. +# command to the generated LaTeX files. This will instruct LaTeX to keep +# running if errors occur, instead of asking the user for help. +# This option is also used when generating formulas in HTML. + +LATEX_BATCHMODE = NO + +# If LATEX_HIDE_INDICES is set to YES then doxygen will not +# include the index chapters (such as File Index, Compound Index, etc.) +# in the output. + +LATEX_HIDE_INDICES = NO + +#--------------------------------------------------------------------------- +# configuration options related to the RTF output +#--------------------------------------------------------------------------- + +# If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output +# The RTF output is optimized for Word 97 and may not look very pretty with +# other RTF readers or editors. + +GENERATE_RTF = NO + +# The RTF_OUTPUT tag is used to specify where the RTF docs will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# put in front of it. If left blank `rtf' will be used as the default path. + +RTF_OUTPUT = rtf + +# If the COMPACT_RTF tag is set to YES Doxygen generates more compact +# RTF documents. This may be useful for small projects and may help to +# save some trees in general. + +COMPACT_RTF = NO + +# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated +# will contain hyperlink fields. The RTF file will +# contain links (just like the HTML output) instead of page references. +# This makes the output suitable for online browsing using WORD or other +# programs which support those fields. +# Note: wordpad (write) and others do not support links. + +RTF_HYPERLINKS = NO + +# Load stylesheet definitions from file. Syntax is similar to doxygen's +# config file, i.e. a series of assignments. You only have to provide +# replacements, missing definitions are set to their default value. + +RTF_STYLESHEET_FILE = + +# Set optional variables used in the generation of an rtf document. +# Syntax is similar to doxygen's config file. + +RTF_EXTENSIONS_FILE = + +#--------------------------------------------------------------------------- +# configuration options related to the man page output +#--------------------------------------------------------------------------- + +# If the GENERATE_MAN tag is set to YES (the default) Doxygen will +# generate man pages + +GENERATE_MAN = NO + +# The MAN_OUTPUT tag is used to specify where the man pages will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# put in front of it. If left blank `man' will be used as the default path. + +MAN_OUTPUT = man + +# The MAN_EXTENSION tag determines the extension that is added to +# the generated man pages (default is the subroutine's section .3) + +MAN_EXTENSION = .3 + +# If the MAN_LINKS tag is set to YES and Doxygen generates man output, +# then it will generate one additional man file for each entity +# documented in the real man page(s). These additional files +# only source the real man page, but without them the man command +# would be unable to find the correct page. The default is NO. + +MAN_LINKS = NO + +#--------------------------------------------------------------------------- +# configuration options related to the XML output +#--------------------------------------------------------------------------- + +# If the GENERATE_XML tag is set to YES Doxygen will +# generate an XML file that captures the structure of +# the code including all documentation. + +GENERATE_XML = NO + +# The XML_OUTPUT tag is used to specify where the XML pages will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# put in front of it. If left blank `xml' will be used as the default path. + +XML_OUTPUT = xml + +# The XML_SCHEMA tag can be used to specify an XML schema, +# which can be used by a validating XML parser to check the +# syntax of the XML files. + +XML_SCHEMA = + +# The XML_DTD tag can be used to specify an XML DTD, +# which can be used by a validating XML parser to check the +# syntax of the XML files. + +XML_DTD = + +# If the XML_PROGRAMLISTING tag is set to YES Doxygen will +# dump the program listings (including syntax highlighting +# and cross-referencing information) to the XML output. Note that +# enabling this will significantly increase the size of the XML output. + +XML_PROGRAMLISTING = YES + +#--------------------------------------------------------------------------- +# configuration options for the AutoGen Definitions output +#--------------------------------------------------------------------------- + +# If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will +# generate an AutoGen Definitions (see autogen.sf.net) file +# that captures the structure of the code including all +# documentation. Note that this feature is still experimental +# and incomplete at the moment. + +GENERATE_AUTOGEN_DEF = NO + +#--------------------------------------------------------------------------- +# configuration options related to the Perl module output +#--------------------------------------------------------------------------- + +# If the GENERATE_PERLMOD tag is set to YES Doxygen will +# generate a Perl module file that captures the structure of +# the code including all documentation. Note that this +# feature is still experimental and incomplete at the +# moment. + +GENERATE_PERLMOD = NO + +# If the PERLMOD_LATEX tag is set to YES Doxygen will generate +# the necessary Makefile rules, Perl scripts and LaTeX code to be able +# to generate PDF and DVI output from the Perl module output. + +PERLMOD_LATEX = YES + +# If the PERLMOD_PRETTY tag is set to YES the Perl module output will be +# nicely formatted so it can be parsed by a human reader. This is useful +# if you want to understand what is going on. On the other hand, if this +# tag is set to NO the size of the Perl module output will be much smaller +# and Perl will parse it just the same. + +PERLMOD_PRETTY = YES + +# The names of the make variables in the generated doxyrules.make file +# are prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX. +# This is useful so different doxyrules.make files included by the same +# Makefile don't overwrite each other's variables. + +PERLMOD_MAKEVAR_PREFIX = + +#--------------------------------------------------------------------------- +# Configuration options related to the preprocessor +#--------------------------------------------------------------------------- + +# If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will +# evaluate all C-preprocessor directives found in the sources and include +# files. + +ENABLE_PREPROCESSING = YES + +# If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro +# names in the source code. If set to NO (the default) only conditional +# compilation will be performed. Macro expansion can be done in a controlled +# way by setting EXPAND_ONLY_PREDEF to YES. + +MACRO_EXPANSION = NO + +# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES +# then the macro expansion is limited to the macros specified with the +# PREDEFINED and EXPAND_AS_DEFINED tags. + +EXPAND_ONLY_PREDEF = NO + +# If the SEARCH_INCLUDES tag is set to YES (the default) the includes files +# in the INCLUDE_PATH (see below) will be search if a #include is found. + +SEARCH_INCLUDES = YES + +# The INCLUDE_PATH tag can be used to specify one or more directories that +# contain include files that are not input files but should be processed by +# the preprocessor. + +INCLUDE_PATH = + +# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard +# patterns (like *.h and *.hpp) to filter out the header-files in the +# directories. If left blank, the patterns specified with FILE_PATTERNS will +# be used. + +INCLUDE_FILE_PATTERNS = + +# The PREDEFINED tag can be used to specify one or more macro names that +# are defined before the preprocessor is started (similar to the -D option of +# gcc). The argument of the tag is a list of macros of the form: name +# or name=definition (no spaces). If the definition and the = are +# omitted =1 is assumed. To prevent a macro definition from being +# undefined via #undef or recursively expanded use the := operator +# instead of the = operator. + +PREDEFINED = + +# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then +# this tag can be used to specify a list of macro names that should be expanded. +# The macro definition that is found in the sources will be used. +# Use the PREDEFINED tag if you want to use a different macro definition. + +EXPAND_AS_DEFINED = + +# If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then +# doxygen's preprocessor will remove all function-like macros that are alone +# on a line, have an all uppercase name, and do not end with a semicolon. Such +# function macros are typically used for boiler-plate code, and will confuse +# the parser if not removed. + +SKIP_FUNCTION_MACROS = YES + +#--------------------------------------------------------------------------- +# Configuration::additions related to external references +#--------------------------------------------------------------------------- + +# The TAGFILES option can be used to specify one or more tagfiles. +# Optionally an initial location of the external documentation +# can be added for each tagfile. The format of a tag file without +# this location is as follows: +# TAGFILES = file1 file2 ... +# Adding location for the tag files is done as follows: +# TAGFILES = file1=loc1 "file2 = loc2" ... +# where "loc1" and "loc2" can be relative or absolute paths or +# URLs. If a location is present for each tag, the installdox tool +# does not have to be run to correct the links. +# Note that each tag file must have a unique name +# (where the name does NOT include the path) +# If a tag file is not located in the directory in which doxygen +# is run, you must also specify the path to the tagfile here. + +TAGFILES = + +# When a file name is specified after GENERATE_TAGFILE, doxygen will create +# a tag file that is based on the input files it reads. + +GENERATE_TAGFILE = + +# If the ALLEXTERNALS tag is set to YES all external classes will be listed +# in the class index. If set to NO only the inherited external classes +# will be listed. + +ALLEXTERNALS = NO + +# If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed +# in the modules index. If set to NO, only the current project's groups will +# be listed. + +EXTERNAL_GROUPS = YES + +# The PERL_PATH should be the absolute path and name of the perl script +# interpreter (i.e. the result of `which perl'). + +PERL_PATH = /usr/bin/perl + +#--------------------------------------------------------------------------- +# Configuration options related to the dot tool +#--------------------------------------------------------------------------- + +# If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will +# generate a inheritance diagram (in HTML, RTF and LaTeX) for classes with base +# or super classes. Setting the tag to NO turns the diagrams off. Note that +# this option is superseded by the HAVE_DOT option below. This is only a +# fallback. It is recommended to install and use dot, since it yields more +# powerful graphs. + +CLASS_DIAGRAMS = NO + +# You can define message sequence charts within doxygen comments using the \msc +# command. Doxygen will then run the mscgen tool (see http://www.mcternan.me.uk/mscgen/) to +# produce the chart and insert it in the documentation. The MSCGEN_PATH tag allows you to +# specify the directory where the mscgen tool resides. If left empty the tool is assumed to +# be found in the default search path. + +MSCGEN_PATH = + +# If set to YES, the inheritance and collaboration graphs will hide +# inheritance and usage relations if the target is undocumented +# or is not a class. + +HIDE_UNDOC_RELATIONS = YES + +# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is +# available from the path. This tool is part of Graphviz, a graph visualization +# toolkit from AT&T and Lucent Bell Labs. The other options in this section +# have no effect if this option is set to NO (the default) + +HAVE_DOT = NO + +# If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen +# will generate a graph for each documented class showing the direct and +# indirect inheritance relations. Setting this tag to YES will force the +# the CLASS_DIAGRAMS tag to NO. + +CLASS_GRAPH = NO + +# If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen +# will generate a graph for each documented class showing the direct and +# indirect implementation dependencies (inheritance, containment, and +# class references variables) of the class with other documented classes. + +COLLABORATION_GRAPH = NO + +# If the GROUP_GRAPHS and HAVE_DOT tags are set to YES then doxygen +# will generate a graph for groups, showing the direct groups dependencies + +GROUP_GRAPHS = NO + +# If the UML_LOOK tag is set to YES doxygen will generate inheritance and +# collaboration diagrams in a style similar to the OMG's Unified Modeling +# Language. + +UML_LOOK = NO + +# If set to YES, the inheritance and collaboration graphs will show the +# relations between templates and their instances. + +TEMPLATE_RELATIONS = NO + +# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT +# tags are set to YES then doxygen will generate a graph for each documented +# file showing the direct and indirect include dependencies of the file with +# other documented files. + +INCLUDE_GRAPH = NO + +# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and +# HAVE_DOT tags are set to YES then doxygen will generate a graph for each +# documented header file showing the documented files that directly or +# indirectly include this file. + +INCLUDED_BY_GRAPH = NO + +# If the CALL_GRAPH and HAVE_DOT tags are set to YES then doxygen will +# generate a call dependency graph for every global function or class method. +# Note that enabling this option will significantly increase the time of a run. +# So in most cases it will be better to enable call graphs for selected +# functions only using the \callgraph command. + +CALL_GRAPH = NO + +# If the CALLER_GRAPH and HAVE_DOT tags are set to YES then doxygen will +# generate a caller dependency graph for every global function or class method. +# Note that enabling this option will significantly increase the time of a run. +# So in most cases it will be better to enable caller graphs for selected +# functions only using the \callergraph command. + +CALLER_GRAPH = NO + +# If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen +# will graphical hierarchy of all classes instead of a textual one. + +GRAPHICAL_HIERARCHY = NO + +# If the DIRECTORY_GRAPH, SHOW_DIRECTORIES and HAVE_DOT tags are set to YES +# then doxygen will show the dependencies a directory has on other directories +# in a graphical way. The dependency relations are determined by the #include +# relations between the files in the directories. + +DIRECTORY_GRAPH = NO + +# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images +# generated by dot. Possible values are png, jpg, or gif +# If left blank png will be used. + +DOT_IMAGE_FORMAT = jpg + +# The tag DOT_PATH can be used to specify the path where the dot tool can be +# found. If left blank, it is assumed the dot tool can be found in the path. + +DOT_PATH = + +# The DOTFILE_DIRS tag can be used to specify one or more directories that +# contain dot files that are included in the documentation (see the +# \dotfile command). + +DOTFILE_DIRS = + +# The MAX_DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of +# nodes that will be shown in the graph. If the number of nodes in a graph +# becomes larger than this value, doxygen will truncate the graph, which is +# visualized by representing a node as a red box. Note that doxygen will always +# show the root nodes and its direct children regardless of this setting. + +DOT_GRAPH_MAX_NODES = 50 + +# Set the DOT_TRANSPARENT tag to YES to generate images with a transparent +# background. This is disabled by default, which results in a white background. +# Warning: Depending on the platform used, enabling this option may lead to +# badly anti-aliased labels on the edges of a graph (i.e. they become hard to +# read). + +DOT_TRANSPARENT = NO + +# Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output +# files in one run (i.e. multiple -o and -T options on the command line). This +# makes dot run faster, but since only newer versions of dot (>1.8.10) +# support this, this feature is disabled by default. + +DOT_MULTI_TARGETS = NO + +# If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will +# generate a legend page explaining the meaning of the various boxes and +# arrows in the dot generated graphs. + +GENERATE_LEGEND = NO + +# If the DOT_CLEANUP tag is set to YES (the default) Doxygen will +# remove the intermediate dot files that are used to generate +# the various graphs. + +DOT_CLEANUP = NO + +#--------------------------------------------------------------------------- +# Configuration::additions related to the search engine +#--------------------------------------------------------------------------- + +# The SEARCHENGINE tag specifies whether or not a search engine should be +# used. If set to NO the values of all tags below this one will be ignored. + +SEARCHENGINE = YES diff --git a/pg-doxy/pg-doxy.sh b/pg-doxy/pg-doxy.sh new file mode 100755 index 0000000..f542386 --- /dev/null +++ b/pg-doxy/pg-doxy.sh @@ -0,0 +1,39 @@ +#!/bin/bash + +# Create doxygen from debian package server +# By Jungbae Lee (yi_jungbae@samsung.com) + +cd `dirname $0` +CWD=`pwd` + +# Use doxygen 1.7.0 +export PATH=/usr/local/bin:${HOME}/mytools/bin:${PATH} +export LD_LIBRARY_PATH=${HOME}/mytools/lib:${LD_LIBRARY_PATH} + + +### Configuration +SBOX=/scratchbox/users/$USER/home/$USER +DOXYGEN_OUTPUT_DIR=$CWD/doxygen_output +DOXYGEN=./tool/bin/doxygen +DOXY_CONF=doxygen.conf +IMAGE_DIR=../image #need to change +#IMAGE_DIR=[fill your image path] + + + +####doxygen configuration :: output Directory +mkdir $DOXYGEN_OUTPUT_DIR + +echo "Doxygen running..." +if [ ! -e $CWD/doxygen_output ]; then + mkdir $CWD/doxygen_output +fi +# Run doxygen +$DOXYGEN $DOXY_CONF 2>&1 + +#image copy +cp $CWD/$IMAGE_DIR/* $DOXYGEN_OUTPUT_DIR/html/ + +echo "Finished!" +exit; + diff --git a/pg-doxy/slp_doxy.css b/pg-doxy/slp_doxy.css new file mode 100644 index 0000000..12c03ac --- /dev/null +++ b/pg-doxy/slp_doxy.css @@ -0,0 +1,699 @@ +/* The standard CSS for doxygen */ + +body, table, div, p, dl { + font-family: Lucida Grande, Verdana, Geneva, Arial, sans-serif; + font-size: 12px; +} + +/* @group Heading Levels */ + +h1 { + font-size: 18pt; + color: #3366ED; +} + +h1.pg { + font-size: 18pt; + color: #336666; + margin-right:-0.6pt; + margin-left:0cm; + padding-top:0cm; + padding-right:0cm; + padding-bottom:1pt; + padding-left:0cm; + border-bottom-width:1.5pt; + border-bottom-color:#336666; + border-top-style:none; + border-right-style:none; + border-bottom-style:solid; + border-left-style:none; +} + +h2 { + font-size: 14pt; + color: #336666; +} +h2.pg { + font-size: 14pt; + color: #336666; + margin-right:-0.1pt; + margin-left:0cm; + padding-top:0cm; + padding-right:0cm; + padding-bottom:1pt; + padding-left:0cm; + border-bottom-width:1.2pt; + border-bottom-color:#336666; + border-top-style:none; + border-right-style:none; + border-bottom-style:solid; + border-left-style:none; +} + + +h3 { + font-size: 12pt; + color: #336666; +} +h3.pg { + font-size: 12pt; + color: #336666; +} + + + +dt { + font-weight: bold; +} + +div.multicol { + -moz-column-gap: 1em; + -webkit-column-gap: 1em; + -moz-column-count: 3; + -webkit-column-count: 3; +} + +p.startli, p.startdd, p.starttd { + margin-top: 2px; +} + +p.endli { + margin-bottom: 0px; +} + +p.enddd { + margin-bottom: 4px; +} + +p.endtd { + margin-bottom: 2px; +} + +/* @end */ + +caption { + font-weight: bold; +} + +span.legend { + font-size: 70%; + text-align: center; +} + +h3.version { + font-size: 90%; + text-align: center; +} + +div.qindex, div.navtab{ + background-color: #EBEFF6; + border: 1px solid #A3B4D7; + text-align: center; + margin: 2px; + padding: 2px; +} + +div.qindex, div.navpath { + width: 100%; + line-height: 140%; +} + +div.navtab { + margin-right: 15px; +} + +/* @group Link Styling */ + +a { + color: #3D578C; + font-weight: normal; + text-decoration: none; +} + +.contents a:visited { + color: #4665A2; +} + +a:hover { + text-decoration: underline; +} + +a.qindex { + font-weight: bold; +} + +a.qindexHL { + font-weight: bold; + background-color: #9CAFD4; + color: #ffffff; + border: 1px double #869DCA; +} + +.contents a.qindexHL:visited { + color: #ffffff; +} + +a.el { + font-weight: bold; +} + +a.elRef { +} + +a.code { + color: #4665A2; +} + +a.codeRef { + color: #4665A2; +} + +/* @end */ + +dl.el { + margin-left: -1cm; +} + +.fragment { + font-family: monospace, fixed; + font-size: 105%; +} + +pre.fragment { + border: 1px solid #C4CFE5; + background-color: #FBFCFD; + padding: 4px 6px; + margin: 4px 8px 4px 2px; + overflow: auto; + word-wrap: break-word; + font-size: 9pt; + line-height: 125%; +} + +div.ah { + background-color: black; + font-weight: bold; + color: #ffffff; + margin-bottom: 3px; + margin-top: 3px + padding: .2em; + border: solid thin #333; + border-radius: .5em; + -webkit-border-radius: .5em; + -moz-border-radius: .5em; + -webkit-box-shadow: 2px 2px 3px #999; + -moz-box-shadow: rgba(0, 0, 0, 0.15) 2px 2px 2px; + background-image: -webkit-gradient(linear, left top, left bottom, from(#eee), to(#000),color-stop(0.3, #444)); + background-image: -moz-linear-gradient(center top, #eee 0%, #444 40%, #000); +} + +div.groupHeader { + margin-left: 16px; + margin-top: 12px; + margin-bottom: 6px; + font-weight: bold; +} + +div.groupText { + margin-left: 16px; + font-style: italic; +} + +body { + background: white; + color: black; + margin: 0; +} + +div.contents { + margin-top: 10px; + margin-left: 10px; + margin-right: 10px; +} + +td.indexkey { + background-color: #EBEFF6; + font-weight: bold; + border: 1px solid #C4CFE5; + margin: 2px 0px 2px 0; + padding: 2px 10px; +} + +td.indexvalue { + background-color: #EBEFF6; + border: 1px solid #C4CFE5; + padding: 2px 10px; + margin: 2px 0px; +} + +tr.memlist { + background-color: #EEF1F7; +} + +p.formulaDsp { + text-align: center; +} + +img.formulaDsp { + +} + +img.formulaInl { + vertical-align: middle; +} + +div.center { + text-align: center; + margin-top: 0px; + margin-bottom: 0px; + padding: 0px; +} + +div.center img { + border: 0px; +} + +address.footer { + text-align: right; + padding-right: 12px; +} + +img.footer { + border: 0px; + vertical-align: middle; +} + +/* @group Code Colorization */ + +span.keyword { + color: #008000 +} + +span.keywordtype { + color: #604020 +} + +span.keywordflow { + color: #e08000 +} + +span.comment { + color: #800000 +} + +span.preprocessor { + color: #806020 +} + +span.stringliteral { + color: #002080 +} + +span.charliteral { + color: #008080 +} + +span.vhdldigit { + color: #ff00ff +} + +span.vhdlchar { + color: #000000 +} + +span.vhdlkeyword { + color: #700070 +} + +span.vhdllogic { + color: #ff0000 +} + +/* @end */ + +/* +.search { + color: #003399; + font-weight: bold; +} + +form.search { + margin-bottom: 0px; + margin-top: 0px; +} + +input.search { + font-size: 75%; + color: #000080; + font-weight: normal; + background-color: #e8eef2; +} +*/ + +td.tiny { + font-size: 75%; +} + +.dirtab { + padding: 4px; + border-collapse: collapse; + border: 1px solid #A3B4D7; +} + +th.dirtab { + background: #EBEFF6; + font-weight: bold; +} + +hr { + height: 0px; + border: none; + border-top: 1px solid #4A6AAA; +} + +hr.footer { + height: 1px; +} + +/* @group Member Descriptions */ + +table.memberdecls { + border-spacing: 0px; + padding: 0px; +} + +.mdescLeft, .mdescRight, +.memItemLeft, .memItemRight, +.memTemplItemLeft, .memTemplItemRight, .memTemplParams { + background-color: #F9FAFC; + border: none; + margin: 4px; + padding: 1px 0 0 8px; +} + +.mdescLeft, .mdescRight { + padding: 0px 8px 4px 8px; + color: #555; +} + +.memItemLeft, .memItemRight, .memTemplParams { + border-top: 1px solid #C4CFE5; +} + +.memItemLeft, .memTemplItemLeft { + white-space: nowrap; +} + +.memTemplParams { + color: #4665A2; + white-space: nowrap; +} + +/* @end */ + +/* @group Member Details */ + +/* Styles for detailed member documentation */ + +.memtemplate { + font-size: 80%; + color: #4665A2; + font-weight: normal; + margin-left: 3px; +} + +.memnav { + background-color: #EBEFF6; + border: 1px solid #A3B4D7; + text-align: center; + margin: 2px; + margin-right: 15px; + padding: 2px; +} + +.memitem { + padding: 0; + margin-bottom: 10px; +} + +.memname { + white-space: nowrap; + font-weight: bold; + margin-left: 6px; +} + +.memproto { + border-top: 1px solid #A8B8D9; + border-left: 1px solid #A8B8D9; + border-right: 1px solid #A8B8D9; + padding: 6px 0px 6px 0px; + color: #253555; + font-weight: bold; + text-shadow: 0px 1px 1px rgba(255, 255, 255, 0.9); + /* firefox specific markup */ + -moz-box-shadow: rgba(0, 0, 0, 0.15) 5px 5px 5px; + -moz-border-radius-topright: 8px; + -moz-border-radius-topleft: 8px; + /* webkit specific markup */ + -webkit-box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15); + -webkit-border-top-right-radius: 8px; + -webkit-border-top-left-radius: 8px; + background-image:url('nav_f.png'); + background-repeat:repeat-x; + background-color: #E2E8F2; + +} + +.memdoc { + border-bottom: 1px solid #A8B8D9; + border-left: 1px solid #A8B8D9; + border-right: 1px solid #A8B8D9; + padding: 2px 5px; + background-color: #FBFCFD; + border-top-width: 0; + /* firefox specific markup */ + -moz-border-radius-bottomleft: 8px; + -moz-border-radius-bottomright: 8px; + -moz-box-shadow: rgba(0, 0, 0, 0.15) 5px 5px 5px; + background-image: -moz-linear-gradient(center top, #FFFFFF 0%, #FFFFFF 60%, #F8 95%, #F0); + /* webkit specific markup */ + -webkit-border-bottom-left-radius: 8px; + -webkit-border-bottom-right-radius: 8px; + -webkit-box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15); + background-image: -webkit-gradient(linear,center top,center bottom,from(#FFFFFF), color-stop(0.6,#FFFFFF), color-stop(0.60,#FF), color-stop(0.95,#F8), to(#F0)); +} + +.paramkey { + text-align: right; +} + +.paramtype { + white-space: nowrap; +} + +.paramname { + color: #602020; + white-space: nowrap; +} +.paramname em { + font-style: normal; +} + +/* @end */ + +/* @group Directory (tree) */ + +/* for the tree view */ + +.ftvtree { + font-family: sans-serif; + margin: 0px; +} + +/* these are for tree view when used as main index */ + +.directory { + font-size: 9pt; + font-weight: bold; + margin: 5px; +} + +.directory h3 { + margin: 0px; + margin-top: 1em; + font-size: 11pt; +} + +/* +The following two styles can be used to replace the root node title +with an image of your choice. Simply uncomment the next two styles, +specify the name of your image and be sure to set 'height' to the +proper pixel height of your image. +*/ + +/* +.directory h3.swap { + height: 61px; + background-repeat: no-repeat; + background-image: url("yourimage.gif"); +} +.directory h3.swap span { + display: none; +} +*/ + +.directory > h3 { + margin-top: 0; +} + +.directory p { + margin: 0px; + white-space: nowrap; +} + +.directory div { + display: none; + margin: 0px; +} + +.directory img { + vertical-align: -30%; +} + +/* these are for tree view when not used as main index */ + +.directory-alt { + font-size: 100%; + font-weight: bold; +} + +.directory-alt h3 { + margin: 0px; + margin-top: 1em; + font-size: 11pt; +} + +.directory-alt > h3 { + margin-top: 0; +} + +.directory-alt p { + margin: 0px; + white-space: nowrap; +} + +.directory-alt div { + display: none; + margin: 0px; +} + +.directory-alt img { + vertical-align: -30%; +} + +/* @end */ + +div.dynheader { + margin-top: 8px; +} + +address { + font-style: normal; + color: #2A3D61; +} + +table.doxtable { + border-collapse:collapse; +} + +table.doxtable td, table.doxtable th { + border: 1px solid #2D4068; + padding: 3px 7px 2px; +} + +table.doxtable th { + background-color: #374F7F; + color: #FFFFFF; + font-size: 110%; + padding-bottom: 4px; + padding-top: 5px; + text-align:left; +} + +.tabsearch { + top: 0px; + left: 10px; + height: 36px; + background-image: url('tab_b.png'); + z-index: 101; + overflow: hidden; + font-size: 13px; +} + +.navpath ul +{ + font-size: 11px; + background-image:url('tab_b.png'); + background-repeat:repeat-x; + height:30px; + line-height:30px; + color:#8AA0CC; + border:solid 1px #C2CDE4; + overflow:hidden; + margin:0px; + padding:0px; +} + +.navpath li +{ + list-style-type:none; + float:left; + padding-left:10px; + padding-right: 15px; + background-image:url('bc_s.png'); + background-repeat:no-repeat; + background-position:right; + color:#364D7C; +} + +.navpath a +{ + height:32px; + display:block; + text-decoration: none; + outline: none; +} + +.navpath a:hover +{ + color:#6884BD; +} + +div.summary +{ + float: right; + font-size: 8pt; + padding-right: 5px; + width: 50%; + text-align: right; +} + +div.summary a +{ + white-space: nowrap; +} + +div.header +{ + background-image:url('nav_h.png'); + background-repeat:repeat-x; + background-color: #F9FAFC; + margin: 0px; + border-bottom: 1px solid #C4CFE5; +} + +div.headertitle +{ + padding: 5px 5px 5px 10px; +} + diff --git a/pg-doxy/tool/bin/doxygen b/pg-doxy/tool/bin/doxygen new file mode 100755 index 0000000..3662da8 Binary files /dev/null and b/pg-doxy/tool/bin/doxygen differ diff --git a/pg-doxy/tool/bin/doxytag b/pg-doxy/tool/bin/doxytag new file mode 100755 index 0000000..adb0c90 Binary files /dev/null and b/pg-doxy/tool/bin/doxytag differ diff --git a/pg-doxy/tool/man/man1/doxygen.1 b/pg-doxy/tool/man/man1/doxygen.1 new file mode 100644 index 0000000..a3d8c9a --- /dev/null +++ b/pg-doxy/tool/man/man1/doxygen.1 @@ -0,0 +1,46 @@ +.TH DOXYGEN "1" "July 2010" "doxygen 1.7.0" "User Commands" +.SH NAME +doxygen \- documentation system for various programming languages +.SH DESCRIPTION +Doxygen is a documentation system for C++, C, Java, Objective-C, IDL +(Corba and Microsoft flavors) and to some extent PHP, C#, and D. +.PP +You can use doxygen in a number of ways: +.TP +1) Use doxygen to generate a template configuration file: +.IP +doxygen [-s] \fB\-g\fR [configName] +.IP +If - is used for configName doxygen will write to standard output. +.TP +2) Use doxygen to update an old configuration file: +.IP +doxygen [-s] \fB\-u\fR [configName] +.TP +3) Use doxygen to generate documentation using an existing configuration file: +.IP +doxygen [configName] +.IP +If - is used for configName doxygen will read from standard input. +.TP +4) Use doxygen to generate a template style sheet file for RTF, HTML or Latex. +.TP +RTF: +doxygen \fB\-w\fR rtf styleSheetFile +.TP +HTML: +doxygen \fB\-w\fR html headerFile footerFile styleSheetFile [configFile] +.TP +LaTeX: doxygen \fB\-w\fR latex headerFile styleSheetFile [configFile] +.TP +5) Use doxygen to generate an rtf extensions file +.TP +RTF: +doxygen \fB\-e\fR rtf extensionsFile +.PP +If \fB\-s\fR is specified the comments in the config file will be omitted. +If configName is omitted `Doxyfile' will be used as a default. +.SH AUTHOR +Doxygen version 1.7.0, Copyright Dimitri van Heesch 1997-2007 +.SH SEE ALSO +doxytag(1), doxywizard(1). diff --git a/pg-doxy/tool/man/man1/doxytag.1 b/pg-doxy/tool/man/man1/doxytag.1 new file mode 100644 index 0000000..f496899 --- /dev/null +++ b/pg-doxy/tool/man/man1/doxytag.1 @@ -0,0 +1,21 @@ +.TH DOXYTAG "1" "July 2010" "doxytag 1.7.0" "User Commands" +.SH NAME +doxytag \- generates a tag file and/or a search index for a set of HTML files +.SH SYNOPSIS +.B doxytag +[\fI-t tag_file\fR] [\fI-s index_file\fR] [ \fIhtml_file \fR[\fIhtml_file\fR...] ] +.SH DESCRIPTION +Generates a tag file and/or a search index for a set of HTML files. Use +doxysearch as a CGI program to search the tag file generated by doxytag. +.SH OPTIONS +.TP +\fB\-t\fR +Generate tag file . +.TP +\fB\-s\fR +Generate search index . +.PP +If no HTML files are given all files in the current dir that +have a .html extension are parsed. +.SH SEE ALSO +doxygen(1), doxywizard(1). diff --git a/src/dbus.c b/src/dbus.c new file mode 100644 index 0000000..f013abe --- /dev/null +++ b/src/dbus.c @@ -0,0 +1,136 @@ +/* + * feedback + * + * Copyright (c) 2012 - 2013 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 +#include +#include +#include + +#include "common.h" +#include "log.h" +#include "dbus.h" + +/* -1 is a default timeout value, it's converted to 25*1000 internally. */ +#define DBUS_REPLY_TIMEOUT (-1) + +static int append_variant(DBusMessageIter *iter, const char *sig, char *param[]) +{ + char *ch; + int i; + int int_type; + uint64_t int64_type; + DBusMessageIter arr; + struct dbus_byte *byte; + + if (!sig || !param) + return 0; + + for (ch = (char*)sig, i = 0; *ch != '\0'; ++i, ++ch) { + switch (*ch) { + case 'i': + int_type = atoi(param[i]); + dbus_message_iter_append_basic(iter, DBUS_TYPE_INT32, &int_type); + break; + case 'u': + int_type = strtoul(param[i], NULL, 10); + dbus_message_iter_append_basic(iter, DBUS_TYPE_UINT32, &int_type); + break; + case 't': + int64_type = atoll(param[i]); + dbus_message_iter_append_basic(iter, DBUS_TYPE_UINT64, &int64_type); + break; + case 's': + dbus_message_iter_append_basic(iter, DBUS_TYPE_STRING, ¶m[i]); + break; + case 'a': + ++i, ++ch; + switch (*ch) { + case 'y': + dbus_message_iter_open_container(iter, DBUS_TYPE_ARRAY, DBUS_TYPE_BYTE_AS_STRING, &arr); + byte = (struct dbus_byte*)param[i]; + dbus_message_iter_append_fixed_array(&arr, DBUS_TYPE_BYTE, &(byte->data), byte->size); + dbus_message_iter_close_container(iter, &arr); + break; + default: + break; + } + break; + default: + return -EINVAL; + } + } + + return 0; +} + +int dbus_method_sync(const char *dest, const char *path, + const char *interface, const char *method, + const char *sig, char *param[]) +{ + DBusConnection *conn; + DBusMessage *msg; + DBusMessageIter iter; + DBusMessage *reply; + DBusError err; + int ret, result; + + conn = dbus_bus_get(DBUS_BUS_SYSTEM, NULL); + if (!conn) { + _E("dbus_bus_get error"); + return -EPERM; + } + + msg = dbus_message_new_method_call(dest, path, interface, method); + if (!msg) { + _E("dbus_message_new_method_call(%s:%s-%s)", + path, interface, method); + return -EBADMSG; + } + + dbus_message_iter_init_append(msg, &iter); + ret = append_variant(&iter, sig, param); + if (ret < 0) { + _E("append_variant error(%d) %s %s:%s-%s", + ret, dest, path, interface, method); + dbus_message_unref(msg); + return ret; + } + + dbus_error_init(&err); + + reply = dbus_connection_send_with_reply_and_block(conn, msg, DBUS_REPLY_TIMEOUT, &err); + dbus_message_unref(msg); + if (!reply) { + _E("dbus_connection_send error(%s:%s) %s %s:%s-%s", + err.name, err.message, dest, path, interface, method); + dbus_error_free(&err); + return -ECOMM; + } + + ret = dbus_message_get_args(reply, &err, DBUS_TYPE_INT32, &result, DBUS_TYPE_INVALID); + dbus_message_unref(reply); + if (!ret) { + _E("no message : [%s:%s] %s %s:%s-%s", + err.name, err.message, dest, path, interface, method); + dbus_error_free(&err); + return -ENOMSG; + } + + return result; +} diff --git a/src/devices.c b/src/devices.c index f87fcb1..e135e07 100644 --- a/src/devices.c +++ b/src/devices.c @@ -92,3 +92,14 @@ void devices_play(int pattern) dev->play(pattern); } } + +void devices_stop(void) +{ + dd_list *elem; + const struct device_ops *dev; + + DD_LIST_FOREACH(dev_head, elem, dev) { + if (dev->stop) + dev->stop(); + } +} diff --git a/src/feedback.c b/src/feedback.c index 6cebbb6..f14ffef 100644 --- a/src/feedback.c +++ b/src/feedback.c @@ -32,6 +32,7 @@ #endif int callstatus; +int alert_callstatus; static bool binit; @@ -40,6 +41,11 @@ static void feedback_callstatus_cb(keynode_t *key, void* data) callstatus = vconf_keynode_get_int(key); } +static void feedback_alertstatus_cb(keynode_t *key, void* data) +{ + alert_callstatus = vconf_keynode_get_int(key); +} + static feedback_pattern_e get_alert_on_call_key(feedback_pattern_e pattern) { switch(pattern) { @@ -50,6 +56,7 @@ static feedback_pattern_e get_alert_on_call_key(feedback_pattern_e pattern) case FEEDBACK_PATTERN_TIMER: case FEEDBACK_PATTERN_GENERAL: case FEEDBACK_PATTERN_CHARGERCONN: + case FEEDBACK_PATTERN_CHARGING_ERROR: case FEEDBACK_PATTERN_FULLCHARGED: case FEEDBACK_PATTERN_LOWBATT: return (feedback_pattern_e)(pattern+1); @@ -60,6 +67,20 @@ static feedback_pattern_e get_alert_on_call_key(feedback_pattern_e pattern) return pattern; } +static void __DESTRUCTOR__ module_exit(void) +{ + if (!binit) + return; + + vconf_ignore_key_changed(VCONFKEY_CALL_STATE, feedback_callstatus_cb); + vconf_ignore_key_changed(VCONFKEY_CISSAPPL_ALERT_ON_CALL_INT, feedback_alertstatus_cb); + + /* deinitialize device */ + devices_exit(); + + binit = false; +} + API int feedback_initialize() { if (binit) @@ -69,8 +90,14 @@ API int feedback_initialize() if (vconf_get_int(VCONFKEY_CALL_STATE, &callstatus) < 0) _W("VCONFKEY_CALL_STATE ==> FAIL!!"); + + /* alert option on call */ + if (vconf_get_int(VCONFKEY_CISSAPPL_ALERT_ON_CALL_INT, &alert_callstatus) < 0) + _W("VCONFKEY_CISSAPPL_ON_CALL_INT ==> FAIL!!"); + /* add watch for status value */ vconf_notify_key_changed(VCONFKEY_CALL_STATE, feedback_callstatus_cb, NULL); + vconf_notify_key_changed(VCONFKEY_CISSAPPL_ALERT_ON_CALL_INT, feedback_alertstatus_cb, NULL); /* initialize device */ devices_init(); @@ -81,15 +108,6 @@ API int feedback_initialize() API int feedback_deinitialize() { - if (!binit) - return FEEDBACK_ERROR_NOT_INITIALIZED; - - vconf_ignore_key_changed(VCONFKEY_CALL_STATE, feedback_callstatus_cb); - - /* deinitialize device */ - devices_exit(); - - binit = false; return FEEDBACK_ERROR_NONE; } @@ -155,6 +173,17 @@ API int feedback_play_type(feedback_type_e type, feedback_pattern_e pattern) _D("Call status is connected or connecting. pattern changed : %s", str_pattern[pattern]); } + /* should play led regardless of sound or vibration */ + dev = find_device(FEEDBACK_TYPE_LED); + if (dev) { + err = dev->play(pattern); + if (err < 0) + _E("feedback_play_led is failed"); + } + + if (type == FEEDBACK_TYPE_LED) + return FEEDBACK_ERROR_NONE; + /* play proper device */ dev = find_device(type); if (dev) { @@ -166,6 +195,53 @@ API int feedback_play_type(feedback_type_e type, feedback_pattern_e pattern) return FEEDBACK_ERROR_NONE; } +API int feedback_play_type_by_name(char *type, char *pattern) +{ + feedback_type_e etype; + feedback_pattern_e epattern; + + if (!type || !pattern) { + _E("Invalid parameter : type(%x), pattern(%x)", type, pattern); + return FEEDBACK_ERROR_INVALID_PARAMETER; + } + + for (etype = FEEDBACK_TYPE_NONE; etype < FEEDBACK_TYPE_END; ++etype) { + if (!strncmp(type, str_type[etype], strlen(type))) + break; + } + + if (etype == FEEDBACK_TYPE_END) { + _E("Invalid parameter : type(%s)", type); + return FEEDBACK_ERROR_INVALID_PARAMETER; + } + + for (epattern = 0; epattern < FEEDBACK_PATTERN_END; ++epattern) { + if (!strncmp(pattern, str_pattern[epattern], strlen(pattern))) + break; + } + + if (epattern == FEEDBACK_PATTERN_END) { + _E("Invalid parameter : pattern(%d)", pattern); + return FEEDBACK_ERROR_INVALID_PARAMETER; + } + + return feedback_play_type(etype, epattern); +} + +API int feedback_stop(void) +{ + /* check initialize */ + if (!binit) { + _E("Not initialized"); + return FEEDBACK_ERROR_NOT_INITIALIZED; + } + + /* stop all device */ + devices_stop(); + + return FEEDBACK_ERROR_NONE; +} + API int feedback_get_resource_path(feedback_type_e type, feedback_pattern_e pattern, char** path) { const struct device_ops *dev; @@ -204,11 +280,6 @@ API int feedback_set_resource_path(feedback_type_e type, feedback_pattern_e patt const struct device_ops *dev; int err; - if (path == NULL) { - _E("Invalid parameter : path(NULL)"); - return FEEDBACK_ERROR_INVALID_PARAMETER; - } - if (type <= FEEDBACK_TYPE_NONE || type >= FEEDBACK_TYPE_END) { _E("Invalid parameter : type(%d)", type); return FEEDBACK_ERROR_INVALID_PARAMETER; diff --git a/src/sound.c b/src/sound.c index 86a1241..0d14b22 100644 --- a/src/sound.c +++ b/src/sound.c @@ -17,7 +17,6 @@ #include -#include #include #include #include @@ -32,199 +31,23 @@ #include "common.h" #include "log.h" #include "devices.h" +#include "xmlparser.h" -#define FEEDBACK_SOUND_DIR FEEDBACK_DATA_DIR"/sound" -#define FEEDBACK_SOUND_TOUCH_DIR "touch" -#define FEEDBACK_SOUND_OPER_DIR "operation" -#define SCRIPT_INIT_LINK_WAV FEEDBACK_ORIGIN_DATA_DIR"/init_wav_link.sh" -#define MAX_SOUND_FILE 50 - -static const char* sound_file_default[] = { - /* TOUCH : SCREEN TOUCH : TAP(TOUCH & RELEASE) : GENERAL */ - FEEDBACK_SOUND_TOUCH_DIR"/touch.wav", - /* TOUCH : SCREEN TOUCH : TAP(TOUCH & RELEASE) : TEXT_NUMERIC_INPUT */ - FEEDBACK_SOUND_TOUCH_DIR"/sip.wav", - FEEDBACK_SOUND_TOUCH_DIR"/sip_backspace.wav", - FEEDBACK_SOUND_TOUCH_DIR"/sip.wav", - /* TOUCH : SCREEN TOUCH : TAP(TOUCH & RELEASE) : DAILER */ - FEEDBACK_SOUND_TOUCH_DIR"/key0.wav", - FEEDBACK_SOUND_TOUCH_DIR"/key1.wav", - FEEDBACK_SOUND_TOUCH_DIR"/key2.wav", - FEEDBACK_SOUND_TOUCH_DIR"/key3.wav", - FEEDBACK_SOUND_TOUCH_DIR"/key4.wav", - FEEDBACK_SOUND_TOUCH_DIR"/key5.wav", - FEEDBACK_SOUND_TOUCH_DIR"/key6.wav", - FEEDBACK_SOUND_TOUCH_DIR"/key7.wav", - FEEDBACK_SOUND_TOUCH_DIR"/key8.wav", - FEEDBACK_SOUND_TOUCH_DIR"/key9.wav", - FEEDBACK_SOUND_TOUCH_DIR"/keyasterisk.wav", - FEEDBACK_SOUND_TOUCH_DIR"/keysharp.wav", - /* TOUCH : H/W OR SOFT TOUCH : HOLD(TAP & HOLD) */ - NULL, - /* TOUCH : H/W OR SOFT TOUCH : MULTI TAP */ - NULL, - /* TOUCH : H/W OR SOFT TOUCH : TAP */ - NULL, - /* TOUCH : H/W OR SOFT TOUCH : TAP & HOLD */ - NULL, - - /* NOTIFICATION : INCOMING : MESSAGE */ - NULL, - /* NOTIFICATION : INCOMING : MESSAGE ALERT ON CALL */ - NULL, - /* NOTIFICATION : INCOMING : EMAIL */ - NULL, - /* NOTIFICATION : INCOMING : EMAIL ALERT ON CALL */ - NULL, - /* NOTIFICATION : ALARM : WAKEUP */ - NULL, - /* NOTIFICATION : ALARM : WAKEUP ALERT ON CALL */ - NULL, - /* NOTIFICATION : ALARM : SCHEDULE */ - NULL, - /* NOTIFICATION : ALARM : SCHEDULE ALERT ON CALL */ - NULL, - /* NOTIFICATION : ALARM : TIMER */ - NULL, - /* NOTIFICATION : ALARM : TIMER ALERT ON CALL */ - NULL, - - /* NOTIFICATION : GENERAL(TICKER/IM/SMS ETC) */ - FEEDBACK_SOUND_OPER_DIR"/call_connect.wav", - /* NOTIFICATION : GENERAL(TICKER/IM/SMS ETC) ALERT ON CALL */ - FEEDBACK_SOUND_OPER_DIR"/call_connect.wav", - - /* OPERATION : POWER ON/OFF */ - FEEDBACK_SOUND_OPER_DIR"/power_on.wav", - NULL, - /* OPERATION : CHARGECONN */ - FEEDBACK_SOUND_OPER_DIR"/charger_connection.wav", - /* OPERATION : CHARGECONN ALERT ON CALL */ - FEEDBACK_SOUND_OPER_DIR"/charger_connection.wav", - /* OPERATION : FULLCHAREGED */ - FEEDBACK_SOUND_OPER_DIR"/fully_charged.wav", - /* OPERATION : FULLCHAREGED ALERT ON CALL */ - FEEDBACK_SOUND_OPER_DIR"/fully_charged.wav", - /* OPERATION : LOW BATTERY */ - FEEDBACK_SOUND_OPER_DIR"/low_battery.wav", - /* OPERATION : LOW BATTERY ALERT ON CALL */ - FEEDBACK_SOUND_OPER_DIR"/low_battery.wav", - /* OPERATION : LOCK/UNLOCK */ - FEEDBACK_SOUND_OPER_DIR"/lock.wav", - FEEDBACK_SOUND_OPER_DIR"/unlock.wav", - /* OPERATION : CALL CONNECT/ DISCONNECT */ - FEEDBACK_SOUND_OPER_DIR"/call_connect.wav", - FEEDBACK_SOUND_OPER_DIR"/call_disconnect.wav", - /* OPERATION : MINUTE MINDER */ - FEEDBACK_SOUND_OPER_DIR"/minute_minder.wav", - /* OPERATION : VIBRATION */ - NULL, - /* OPERATION : CAMERA SHUTTER / SCREEN CAPTURE */ - FEEDBACK_SOUND_OPER_DIR"/shutter.wav", - /* OPERATION : LIST RE-ORDER */ - FEEDBACK_SOUND_OPER_DIR"/list_reorder.wav", - /* OPERATION : LIST SLIDER */ - FEEDBACK_SOUND_OPER_DIR"/slider_sweep.wav", - /* OPERATION : VOLUME KEY */ - FEEDBACK_SOUND_OPER_DIR"/volume_control.wav", -}; -static char* sound_file[] = { - /* TOUCH : SCREEN TOUCH : TAP(TOUCH & RELEASE) : GENERAL */ - NULL, - /* TOUCH : SCREEN TOUCH : TAP(TOUCH & RELEASE) : TEXT_NUMERIC_INPUT */ - NULL, - NULL, - NULL, - /* TOUCH : SCREEN TOUCH : TAP(TOUCH & RELEASE) : DAILER */ - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - /* TOUCH : H/W OR SOFT TOUCH : HOLD(TAP & HOLD) */ - NULL, - /* TOUCH : H/W OR SOFT TOUCH : MULTI TAP */ - NULL, - /* TOUCH : H/W OR SOFT TOUCH : TAP */ - NULL, - /* TOUCH : H/W OR SOFT TOUCH : TAP & HOLD */ - NULL, - - /* NOTIFICATION : INCOMING : MESSAGE */ - NULL, - /* NOTIFICATION : INCOMING : MESSAGE ALERT ON CALL */ - NULL, - /* NOTIFICATION : INCOMING : EMAIL */ - NULL, - /* NOTIFICATION : INCOMING : EMAIL ALERT ON CALL */ - NULL, - /* NOTIFICATION : ALARM : WAKEUP */ - NULL, - /* NOTIFICATION : ALARM : WAKEUP ALERT ON CALL */ - NULL, - /* NOTIFICATION : ALARM : SCHEDULE */ - NULL, - /* NOTIFICATION : ALARM : SCHEDULE ALERT ON CALL */ - NULL, - /* NOTIFICATION : ALARM : TIMER */ - NULL, - /* NOTIFICATION : ALARM : TIMER ALERT ON CALL */ - NULL, - - /* NOTIFICATION : GENERAL(TICKER/IM/SMS ETC) */ - NULL, - /* NOTIFICATION : GENERAL(TICKER/IM/SMS ETC) ALERT ON CALL */ - NULL, - - /* OPERATION : POWER ON/OFF */ - NULL, - NULL, - /* OPERATION : CHARGECONN */ - NULL, - /* OPERATION : CHARGECONN ALERT ON CALL */ - NULL, - /* OPERATION : FULLCHAREGED */ - NULL, - /* OPERATION : FULLCHAREGED ALERT ON CALL */ - NULL, - /* OPERATION : LOW BATTERY */ - NULL, - /* OPERATION : LOW BATTERY ALERT ON CALL */ - NULL, - /* OPERATION : LOCK/UNLOCK */ - NULL, - NULL, - /* OPERATION : CALL CONNECT/ DISCONNECT */ - NULL, - NULL, - /* OPERATION : MINUTE MINDER */ - NULL, - /* OPERATION : VIBRATION */ - NULL, - /* OPERATION : CAMERA SHUTTER / SCREEN CAPTURE */ - NULL, - /* OPERATION : LIST RE-ORDER */ - NULL, - /* OPERATION : LIST SLIDER */ - NULL, - /* OPERATION : VOLUME KEY */ - NULL, -}; +#define SOUND_XML "/usr/share/feedback/sound.xml" static int sndstatus; static int touch_sndstatus; -static int soundon; +static int lock_sndstatus; +static int camerastatus; +static int shutter_sndstatus; + +static xmlDocPtr v_doc; -static void feedback_sndstatus_cb(keynode_t *key, void* data) +static char sound_file[FEEDBACK_PATTERN_END][NAME_MAX]; + +inline int is_sound_mode(void) { - sndstatus = vconf_keynode_get_bool(key); + return sndstatus; } static void feedback_touch_sndstatus_cb(keynode_t *key, void* data) @@ -232,19 +55,26 @@ static void feedback_touch_sndstatus_cb(keynode_t *key, void* data) touch_sndstatus = vconf_keynode_get_bool(key); } -static void feedback_soundon_cb(keynode_t *key, void* data) +static void feedback_lock_sndstatus_cb(keynode_t *key, void* data) +{ + lock_sndstatus = vconf_keynode_get_bool(key); +} + +static void feedback_camerastatus_cb(keynode_t *key, void* data) { - soundon = vconf_keynode_get_int(key); + camerastatus = vconf_keynode_get_int(key); } static volume_type_t get_volume_type(feedback_pattern_e pattern) { if (pattern == FEEDBACK_PATTERN_TAP) return VOLUME_TYPE_SYSTEM|VOLUME_GAIN_TOUCH; - else if (pattern >= FEEDBACK_PATTERN_KEY0 && pattern <= FEEDBACK_PATTERN_KEY_SHARP) + else if (pattern >= FEEDBACK_PATTERN_KEY0 && pattern <= FEEDBACK_PATTERN_KEY_BACK) return VOLUME_TYPE_SYSTEM|VOLUME_GAIN_DIALER; else if (pattern == FEEDBACK_PATTERN_VOLUME_KEY) return VOLUME_TYPE_RINGTONE; + else if (camerastatus && shutter_sndstatus && pattern == FEEDBACK_PATTERN_SCREEN_CAPTURE) + return VOLUME_TYPE_FIXED; return VOLUME_TYPE_SYSTEM; } @@ -255,122 +85,121 @@ static bool get_always_alert_case(feedback_pattern_e pattern) case FEEDBACK_PATTERN_WAKEUP: case FEEDBACK_PATTERN_WAKEUP_ON_CALL: return true; + case FEEDBACK_PATTERN_MESSAGE_ON_CALL: + case FEEDBACK_PATTERN_EMAIL_ON_CALL: + case FEEDBACK_PATTERN_GENERAL_ON_CALL: + if (alert_callstatus) + return true; + break; + case FEEDBACK_PATTERN_SMART_ALERT: + case FEEDBACK_PATTERN_SEND_SOS_MESSAGE: + case FEEDBACK_PATTERN_END_SOS_MESSAGE: + case FEEDBACK_PATTERN_CMAS: + return true; + case FEEDBACK_PATTERN_SCREEN_CAPTURE: + if (camerastatus && shutter_sndstatus) + return true; + break; + case FEEDBACK_PATTERN_OUTGOING_CALL: + return true; default: break; } return false; } -static int change_symlink(const char *sym_path, const char *new_path) +static bool get_always_off_case(feedback_pattern_e pattern) { - struct stat buf; - - assert(sym_path != NULL && strlen(sym_path)); - assert(new_path != NULL && strlen(new_path)); - - /* check symbolic link file existence */ - if (stat(sym_path, &buf)) { - _E("file(%s) is not presents", sym_path); - return -EPERM; - } - - if (unlink(sym_path) < 0) - _D("unlink(%s) : %s", sym_path, strerror(errno)); - - if (symlink(new_path, sym_path) < 0) { - _E("symlink(%s) : %s", sym_path, strerror(errno)); - return -EPERM; + switch (pattern) { + case FEEDBACK_PATTERN_TAP ... FEEDBACK_PATTERN_MAX_CHARACTER: + case FEEDBACK_PATTERN_HOLD ... FEEDBACK_PATTERN_HW_HOLD: + if (!touch_sndstatus) + return true; + break; + case FEEDBACK_PATTERN_KEY0 ... FEEDBACK_PATTERN_KEY_BACK: + break; + case FEEDBACK_PATTERN_LOCK: + case FEEDBACK_PATTERN_UNLOCK: + case FEEDBACK_PATTERN_LOCK_SWIPE: + case FEEDBACK_PATTERN_UNLOCK_SWIPE: + if (!lock_sndstatus) + return true; + break; + default: + break; } - - return 0; + return false; } -static int restore_default_file(feedback_pattern_e pattern) +static int get_xml_data(xmlDocPtr doc, feedback_pattern_e pattern, struct xmlData **data) { - char default_path[PATH_MAX] = {0,}; - const char *cur_path; - char *temp; - int ret; + xmlNodePtr cur; + struct xmlData *retData; - cur_path = sound_file[pattern]; - /* if there isn't cur_path, it already returns before calling this api */ - if (cur_path == NULL || strlen(cur_path) == 0) { - _E("Invalid parameter : cur_path(NULL)"); - return -EPERM; - } - - temp = strcat(default_path, FEEDBACK_ORIGIN_DATA_DIR); - strcat(temp, cur_path+strlen(FEEDBACK_DATA_DIR)); - _D("default_path : %s", default_path); + cur = xml_find(doc, SOUND_STR, (const xmlChar*)str_pattern[pattern]); + /* This pattern does not have sound file to play */ + if (cur == NULL) + return -ENOENT; - ret = change_symlink(cur_path, default_path); - if (ret < 0) { - _E("change_symlink is failed"); + retData = xml_parse(doc, cur); + if (retData == NULL) { + _E("xml_parse fail"); return -EPERM; } + *data = retData; return 0; } -static void link_init(void) +static void release_xml_data(struct xmlData *data) { - struct stat sts; - int i,ret; - int directory = 0; - char default_path[PATH_MAX] = {0,}; - - /* Check if the directory exists; if not, create it and initialize it */ - ret = stat(FEEDBACK_DATA_DIR, &sts); - if (ret == -1 && errno == ENOENT){ - directory = 1; - } + if (data == NULL) + return; - /* init of sound array and link*/ - strcat(default_path, FEEDBACK_ORIGIN_DATA_DIR); - for( i = 0 ; i< MAX_SOUND_FILE ; i++){ - if ( sound_file_default[i] != NULL ){ - sound_file[i] = strdup(tzplatform_mkpath3(TZ_USER_SHARE,"feedback/sound",sound_file_default[i])); - if (directory == 1){ - if (symlink(default_path,sound_file[i]) < 0){ - _W("change_symlink is failed"); - } - } - } - } + xml_free(data); } static void sound_init(void) { - link_init(); - - /* Sound Init */ - if (vconf_get_bool(VCONFKEY_SETAPPL_SOUND_STATUS_BOOL, &sndstatus) < 0) - _W("VCONFKEY_SETAPPL_SOUND_STATUS_BOOL ==> FAIL!!"); + /* xml Init */ + v_doc = xml_open(SOUND_XML); + if (v_doc == NULL) { + _E("xml_open(%s) fail", SOUND_XML); + return; + } + /* check sound status */ if (vconf_get_bool(VCONFKEY_SETAPPL_TOUCH_SOUNDS_BOOL, &touch_sndstatus) < 0) _W("VCONFKEY_SETAPPL_TOUCH_SOUNDS_BOOL ==> FAIL!!"); - if (vconf_get_int(VCONFKEY_SOUND_STATUS, &soundon) < 0) - _W("VCONFKEY_SOUND_STATUS ==> FAIL!!"); + if (vconf_get_bool(VCONFKEY_SETAPPL_SOUND_LOCK_BOOL, &lock_sndstatus) < 0) + _W("VCONFKEY_SETAPPL_SOUND_LOCK_BOOL ==> FAIL!!"); + + /* check camera status */ + if (vconf_get_int(VCONFKEY_CAMERA_STATE, &camerastatus) < 0) + _W("VCONFKEY_CAMERA_STATE ==> FAIL!!"); + + /* shutter sound policy */ + // This vconf is read just once, because this value is not changed in running time. + if (vconf_get_int(VCONFKEY_CAMERA_SHUTTER_SOUND_POLICY, &shutter_sndstatus) < 0) + _W("VCONFKEY_CAMERA_SHUTTER_SOUND_POLICY ==> FAIL!!"); /* add watch for status value */ - vconf_notify_key_changed(VCONFKEY_SETAPPL_SOUND_STATUS_BOOL, feedback_sndstatus_cb, NULL); vconf_notify_key_changed(VCONFKEY_SETAPPL_TOUCH_SOUNDS_BOOL, feedback_touch_sndstatus_cb, NULL); - vconf_notify_key_changed(VCONFKEY_SOUND_STATUS, feedback_soundon_cb, NULL); + vconf_notify_key_changed(VCONFKEY_SETAPPL_SOUND_LOCK_BOOL, feedback_lock_sndstatus_cb, NULL); + vconf_notify_key_changed(VCONFKEY_CAMERA_STATE, feedback_camerastatus_cb, NULL); } static void sound_exit(void) { - - int i; - /* remove watch */ - vconf_ignore_key_changed(VCONFKEY_SETAPPL_SOUND_STATUS_BOOL, feedback_sndstatus_cb); - vconf_ignore_key_changed(VCONFKEY_SOUND_STATUS, feedback_soundon_cb); vconf_ignore_key_changed(VCONFKEY_SETAPPL_TOUCH_SOUNDS_BOOL, feedback_touch_sndstatus_cb); + vconf_ignore_key_changed(VCONFKEY_SETAPPL_SOUND_LOCK_BOOL, feedback_lock_sndstatus_cb); + vconf_ignore_key_changed(VCONFKEY_CAMERA_STATE, feedback_camerastatus_cb); - for(i = 0 ; i< MAX_SOUND_FILE ; i++){ - free(sound_file[i]); + if (v_doc) { + xml_close(v_doc); + v_doc = NULL; } } @@ -378,97 +207,135 @@ static int sound_play(feedback_pattern_e pattern) { struct stat buf; int retry = FEEDBACK_RETRY_CNT, ret; + char *path; + struct xmlData *data = NULL; + + if (!v_doc) { + _E("Not initialize"); + return -EPERM; + } + + if (vconf_get_bool(VCONFKEY_SETAPPL_SOUND_STATUS_BOOL, &sndstatus) < 0) { + _D("fail to get sound status, will work as turning off"); + sndstatus = 0; + } if (sndstatus == 0 && !get_always_alert_case(pattern)) { _D("Sound condition is OFF (sndstatus : %d)", sndstatus); return 0; } - if (soundon == 1 && pattern >= FEEDBACK_PATTERN_TAP && pattern <= FEEDBACK_PATTERN_HW_HOLD) { - _D("Touch feedback sound doesn't work during playing sound"); + if (sndstatus && get_always_off_case(pattern)) { + _D("Sound always off condition"); return 0; } - if (touch_sndstatus == 0 && pattern >= FEEDBACK_PATTERN_TAP && pattern <= FEEDBACK_PATTERN_HW_HOLD) { - _D("Touch Sound condition is OFF and pattern is touch type (touch_sndstatus : %d, pattern : %s)", touch_sndstatus, str_pattern[pattern]); - return 0; + /* check if the state of voice recorder is recording */ + if (vconf_get_int(VCONFKEY_SOUND_STATUS, &ret) < 0) { + _D("fail to get media sound status, status will be zero"); + ret = 0; } - if (sound_file[pattern] == NULL) { - _D("This case(%s) does not play sound", str_pattern[pattern]); + if (ret & VCONFKEY_SOUND_STATUS_AVRECORDING) { + _D("voice recording status is RECORDING"); return 0; } - if (stat(sound_file[pattern], &buf)) { - _E("%s is not presents", sound_file[pattern]); - ret = restore_default_file(pattern); + /* check whether there is a user defined file */ + path = sound_file[pattern]; + + /* if not */ + if (!(*path)) { + ret = get_xml_data(v_doc, pattern, &data); + if (ret == -ENOENT) { + _D("No sound case(%s)", str_pattern[pattern]); + return 0; + } + if (ret < 0) { - _E("restore_default_file(%s) error", str_pattern[pattern]); + _E("get_xml_data fail"); return -EPERM; } - _D("%s is restored", sound_file[pattern]); + + if (!data->data) { + _D("No sound case(%s)", str_pattern[pattern]); + release_xml_data(data); + return 0; + } + + path = data->data; + } + + if (stat(path, &buf)) { + _E("%s is not presents", path); + return -ENOENT; } + /* play sound file */ do { - ret = mm_sound_play_keysound(sound_file[pattern], get_volume_type(pattern)); + ret = mm_sound_play_keysound(path, get_volume_type(pattern)); if (ret == MM_ERROR_NONE) { - _D("Play success! SND filename is %s", sound_file[pattern]); + _D("Play success! SND filename is %s", path); + release_xml_data(data); return 0; } _E("mm_sound_play_keysound() returned error(%d)", ret); } while(retry--); + release_xml_data(data); return -EPERM; } static int sound_get_path(feedback_pattern_e pattern, char *buf, unsigned int buflen) { - const char *cur_path; - int retry = FEEDBACK_RETRY_CNT; + char *cur_path; + int ret = 0; + struct xmlData *data = NULL; - assert(buf != NULL && buflen > 0); + if (!buf || buflen <= 0) + return -EINVAL; cur_path = sound_file[pattern]; - if (cur_path == NULL) { - _E("This pattern(%s) in sound type is not supported to play", str_pattern[pattern]); - snprintf(buf, buflen, "NULL"); - return -ENOENT; + if (!cur_path) { + ret = get_xml_data(v_doc, pattern, &data); + if (ret >= 0 && data && data->data) + cur_path = (char*)data->data; } - do { - if(readlink(cur_path, buf, buflen) < 0) { - _E("readlink is failed : %s", strerror(errno)); - return -EPERM; - } - } while(retry--); + if (!cur_path) { + _E("This pattern(%s) in sound type is not supported to play", str_pattern[pattern]); + cur_path = "NULL"; + ret = -ENOENT; + } + snprintf(buf, buflen, "%s", cur_path); + release_xml_data(data); return 0; } static int sound_set_path(feedback_pattern_e pattern, char *path) { - const char *cur_path; - int ret; - - assert(path != NULL); - - if (access(path, F_OK) != 0) { - _E("Invalid parameter : path does not exist"); - return -ENOENT; + struct stat buf; + char *ppath; + + /* + * check the path is valid + * if path is null, below operation is ignored + */ + if (path && stat(path, &buf)) { + _E("%s is not presents", path); + return -errno; } - cur_path = sound_file[pattern]; - if (cur_path == NULL) { - _E("This pattern(%s) in sound type is not supported to play", str_pattern[pattern]); - return -ENOENT; - } + ppath = sound_file[pattern]; - ret = change_symlink(cur_path, path); - if (ret < 0) { - _E("change_symlink is failed"); - return -EPERM; - } + /* if path is NULL, this pattern set to default file */ + if (path) + snprintf(ppath, NAME_MAX, "%s", path); + else + memset(ppath, 0, NAME_MAX); + _D("The file of pattern(%s) is changed to [%s]", str_pattern[pattern], path); return 0; } diff --git a/src/str.c b/src/str.c index fb70365..13c2b53 100644 --- a/src/str.c +++ b/src/str.c @@ -23,6 +23,7 @@ const char *str_type[] = "FEEDBACK_TYPE_NONE", "FEEDBACK_TYPE_SOUND", "FEEDBACK_TYPE_VIBRATION", + "FEEDBACK_TYPE_LED", "FEEDBACK_TYPE_END", }; @@ -31,6 +32,8 @@ const char *str_pattern[] = "FEEDBACK_PATTERN_TAP", "FEEDBACK_PATTERN_SIP", "FEEDBACK_PATTERN_SIP_BACKSPACE", + "FEEDBACK_PATTERN_SIP_FUNCTION", + "FEEDBACK_PATTERN_SIP_FJKEY", "FEEDBACK_PATTERN_MAX_CHARACTER", "FEEDBACK_PATTERN_KEY0", "FEEDBACK_PATTERN_KEY1", @@ -44,10 +47,12 @@ const char *str_pattern[] = "FEEDBACK_PATTERN_KEY9", "FEEDBACK_PATTERN_KEY_STAR", "FEEDBACK_PATTERN_KEY_SHARP", + "FEEDBACK_PATTERN_KEY_BACK", "FEEDBACK_PATTERN_HOLD", "FEEDBACK_PATTERN_MULTI_TAP", "FEEDBACK_PATTERN_HW_TAP", "FEEDBACK_PATTERN_HW_HOLD", + "FEEDBACK_PATTERN_MESSAGE", "FEEDBACK_PATTERN_MESSAGE_ON_CALL", "FEEDBACK_PATTERN_EMAIL", @@ -60,22 +65,60 @@ const char *str_pattern[] = "FEEDBACK_PATTERN_TIMER_ON_CALL", "FEEDBACK_PATTERN_GENERAL", "FEEDBACK_PATTERN_GENERAL_ON_CALL", + "FEEDBACK_PATTERN_SMART_ALERT", + "FEEDBACK_PATTERN_POWERON", "FEEDBACK_PATTERN_POWEROFF", "FEEDBACK_PATTERN_CHARGERCONN", "FEEDBACK_PATTERN_CHARGERCONN_ON_CALL", + "FEEDBACK_PATTERN_CHARGING_ERROR", + "FEEDBACK_PATTERN_CHARGING_ERROR_ON_CALL", "FEEDBACK_PATTERN_FULLCHARGED", "FEEDBACK_PATTERN_FULLCHARGED_ON_CALL", "FEEDBACK_PATTERN_LOWBATT", "FEEDBACK_PATTERN_LOWBATT_ON_CALL", "FEEDBACK_PATTERN_LOCK", "FEEDBACK_PATTERN_UNLOCK", + "FEEDBACK_PATTERN_LOCK_SWIPE", + "FEEDBACK_PATTERN_UNLOCK_SWIPE", + "FEEDBACK_PATTERN_GEOMETRIC_LOCK", "FEEDBACK_PATTERN_CALLCONNECT", "FEEDBACK_PATTERN_DISCALLCONNECT", + "FEEDBACK_PATTERN_OUTGOING_CALL", "FEEDBACK_PATTERN_MINUTEMINDER", - "FEEDBACK_PATTERN_VIBRATION", - "FEEDBACK_PATTERN_SHUTTER", + "FEEDBACK_PATTERN_VIBRATION_ON", + "FEEDBACK_PATTERN_SILENT_OFF", + "FEEDBACK_PATTERN_BT_CONNECTED", + "FEEDBACK_PATTERN_BT_DISCONNECTED", + "FEEDBACK_PATTERN_BT_PAIRING", + "FEEDBACK_PATTERN_BT_WAITING", + "FEEDBACK_PATTERN_SCREEN_CAPTURE", "FEEDBACK_PATTERN_LIST_REORDER", - "FEEDBACK_PATTERN_SLIDER_SWEEP", + "FEEDBACK_PATTERN_LIST_SLIDER", "FEEDBACK_PATTERN_VOLUME_KEY", + "FEEDBACK_PATTERN_MMS", + "FEEDBACK_PATTERN_HOURLY_ALERT", + + "FEEDBACK_PATTERN_SAFETY_ALERT", + "FEEDBACK_PATTERN_ACCIDENT_DETECT", + "FEEDBACK_PATTERN_SEND_SOS_MESSAGE", + "FEEDBACK_PATTERN_END_SOS_MESSAGE", + "FEEDBACK_PATTERN_EMERGENCY_BUZZER", + "FEEDBACK_PATTERN_SAFETY_LOW_POWER", + "FEEDBACK_PATTERN_CMAS", + "FEEDBACK_PATTERN_SPEED_UP", + "FEEDBACK_PATTERN_SLOW_DOWN", + "FEEDBACK_PATTERN_KEEP_THIS_PACE", + "FEEDBACK_PATTERN_GOAL_ACHIEVED", + "FEEDBACK_PATTERN_EXERCISE_COUNT", + "FEEDBACK_PATTERN_START_CUE", + "FEEDBACK_PATTERN_HEALTH_PACE", + "FEEDBACK_PATTERN_INACTIVE_TIME", + "FEEDBACK_PATTERN_MEASURING_SUCCESS", + "FEEDBACK_PATTERN_MEASURING_FAILURE", + "FEEDBACK_PATTERN_UV_PROCESSING", + "FEEDBACK_PATTERN_SHEALTH_START", + "FEEDBACK_PATTERN_SHEALTH_PAUSE", + "FEEDBACK_PATTERN_SHEALTH_STOP", + "FEEDBACK_PATTERN_3RD_APPLICATION", }; diff --git a/src/svi.c b/src/svi.c deleted file mode 100755 index 1f73ae6..0000000 --- a/src/svi.c +++ /dev/null @@ -1,330 +0,0 @@ -/* - * libfeedback - * 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 - -#include "svi.h" -#include "feedback.h" -#include "svi-log.h" - -#define SVI_TEMP_HANDLE 1 - -#ifndef API -#define API __attribute__ ((visibility("default"))) -#endif - -feedback_pattern_e feedback_sound[] = { - /* TOUCH : SCREEN TOUCH : TAP(TOUCH & RELEASE) : GENERAL */ - FEEDBACK_PATTERN_TAP, - FEEDBACK_PATTERN_TAP, - FEEDBACK_PATTERN_TAP, - /* TOUCH : SCREEN TOUCH : TAP(TOUCH & RELEASE) : TEXT_NUMERIC_INPUT */ - FEEDBACK_PATTERN_SIP, - FEEDBACK_PATTERN_SIP_BACKSPACE, - /* TOUCH : SCREEN TOUCH : TAP(TOUCH & RELEASE) : DAILER */ - FEEDBACK_PATTERN_KEY0, - FEEDBACK_PATTERN_KEY1, - FEEDBACK_PATTERN_KEY2, - FEEDBACK_PATTERN_KEY3, - FEEDBACK_PATTERN_KEY4, - FEEDBACK_PATTERN_KEY5, - FEEDBACK_PATTERN_KEY6, - FEEDBACK_PATTERN_KEY7, - FEEDBACK_PATTERN_KEY8, - FEEDBACK_PATTERN_KEY9, - FEEDBACK_PATTERN_KEY_STAR, - FEEDBACK_PATTERN_KEY_SHARP, - /* TOUCH : H/W OR SOFT TOUCH : HOLD(TAP & HOLD) */ - FEEDBACK_PATTERN_HOLD, - /* TOUCH : H/W OR SOFT TOUCH : MULTI TAP */ - FEEDBACK_PATTERN_MULTI_TAP, - /* TOUCH : H/W OR SOFT TOUCH : TAP */ - FEEDBACK_PATTERN_HW_TAP, - /* TOUCH : H/W OR SOFT TOUCH : TAP & HOLD */ - FEEDBACK_PATTERN_HW_HOLD, - - /* OPERATION : POWER ON/OFF */ - FEEDBACK_PATTERN_POWERON, - FEEDBACK_PATTERN_POWEROFF, - /* OPERATION : CHARGECONN */ - FEEDBACK_PATTERN_CHARGERCONN, - /* OPERATION : FULLCHAREGED */ - FEEDBACK_PATTERN_FULLCHARGED, - /* OPERATION : LOW BATTERY */ - FEEDBACK_PATTERN_LOWBATT, - /* OPERATION : LOCK/UNLOCK */ - FEEDBACK_PATTERN_LOCK, - FEEDBACK_PATTERN_UNLOCK, - /* OPERATION : CALL CONNECT/ DISCONNECT */ - FEEDBACK_PATTERN_CALLCONNECT, - FEEDBACK_PATTERN_DISCALLCONNECT, - /* OPERATION : MINUTE MINDER */ - FEEDBACK_PATTERN_MINUTEMINDER, - /* OPERATION : VIBRATION */ - FEEDBACK_PATTERN_VIBRATION, - /* OPERATION : BALLOON MESSAGE SEND/RECV */ - FEEDBACK_PATTERN_NONE, - FEEDBACK_PATTERN_NONE, - /* OPERATION : ON/OFF SLIDER */ - FEEDBACK_PATTERN_NONE, - /* OPERATION : CAMERA SHUTTER / SCREEN CAPTURE */ - FEEDBACK_PATTERN_SHUTTER, - /* OPERATION : LIST RE-ORDER */ - FEEDBACK_PATTERN_LIST_REORDER, - /* OPERATION : LIST SLIDER */ - FEEDBACK_PATTERN_SLIDER_SWEEP, -}; - -feedback_pattern_e feedback_vibration[] = { - /* TOUCH : SCREEN TOUCH : TAP(TOUCH & RELEASE) : GENERAL */ - FEEDBACK_PATTERN_TAP, - /* TOUCH : SCREEN TOUCH : TAP(TOUCH & RELEASE) : TEXT_NUMERIC_INPUT */ - FEEDBACK_PATTERN_SIP, - FEEDBACK_PATTERN_SIP_BACKSPACE, - /* TOUCH : SCREEN TOUCH : TAP(TOUCH & RELEASE) : DAILER */ - FEEDBACK_PATTERN_KEY0, - FEEDBACK_PATTERN_KEY1, - FEEDBACK_PATTERN_KEY2, - FEEDBACK_PATTERN_KEY3, - FEEDBACK_PATTERN_KEY4, - FEEDBACK_PATTERN_KEY5, - FEEDBACK_PATTERN_KEY6, - FEEDBACK_PATTERN_KEY7, - FEEDBACK_PATTERN_KEY8, - FEEDBACK_PATTERN_KEY9, - FEEDBACK_PATTERN_KEY_STAR, - FEEDBACK_PATTERN_KEY_SHARP, - /* TOUCH : H/W OR SOFT TOUCH : HOLD(TAP & HOLD) */ - FEEDBACK_PATTERN_HOLD, - /* TOUCH : H/W OR SOFT TOUCH : MULTI TAP */ - FEEDBACK_PATTERN_MULTI_TAP, - /* TOUCH : H/W OR SOFT TOUCH : TAP */ - FEEDBACK_PATTERN_HW_TAP, - /* TOUCH : H/W OR SOFT TOUCH : TAP & HOLD */ - FEEDBACK_PATTERN_HW_HOLD, - - /* NOTIFICATION : INCOMING : CALL */ - FEEDBACK_PATTERN_NONE, - FEEDBACK_PATTERN_NONE, - FEEDBACK_PATTERN_NONE, - FEEDBACK_PATTERN_NONE, - FEEDBACK_PATTERN_NONE, - FEEDBACK_PATTERN_NONE, - /* NOTIFICATION : INCOMING : MESSAGE */ - FEEDBACK_PATTERN_MESSAGE, - /* NOTIFICATION : INCOMING : EMAIL */ - FEEDBACK_PATTERN_EMAIL, - /* NOTIFICATION : ALARM : WAKEUP */ - FEEDBACK_PATTERN_WAKEUP, - /* NOTIFICATION : ALARM : SCHEDULE */ - FEEDBACK_PATTERN_SCHEDULE, - /* NOTIFICATION : ALARM : TIMER */ - FEEDBACK_PATTERN_TIMER, - /* NOTIFICATION : GENERAL(TICKER/IM/SMS ETC) */ - FEEDBACK_PATTERN_GENERAL, - - /* OPERATION : POWER ON/OFF */ - FEEDBACK_PATTERN_POWERON, - FEEDBACK_PATTERN_POWEROFF, - /* OPERATION : CHARGECONN */ - FEEDBACK_PATTERN_CHARGERCONN, - /* OPERATION : FULLCHAREGED */ - FEEDBACK_PATTERN_FULLCHARGED, - /* OPERATION : LOW BATTERY */ - FEEDBACK_PATTERN_LOWBATT, - /* OPERATION : LOCK/UNLOCK */ - FEEDBACK_PATTERN_LOCK, - FEEDBACK_PATTERN_UNLOCK, - /* OPERATION : CALL CONNECT/ DISCONNECT */ - FEEDBACK_PATTERN_CALLCONNECT, - FEEDBACK_PATTERN_DISCALLCONNECT, - /* OPERATION : MINUTE MINDER */ - FEEDBACK_PATTERN_MINUTEMINDER, - /* OPERATION : VIBRATION */ - FEEDBACK_PATTERN_VIBRATION, - /* OPERATION : BALLOON MESSAGE SEND/RECV */ - FEEDBACK_PATTERN_NONE, - FEEDBACK_PATTERN_NONE, - /* OPERATION : ON/OFF SLIDER */ - FEEDBACK_PATTERN_NONE, - /* OPERATION : CAMERA SHUTTER / SCREEN CAPTURE */ - FEEDBACK_PATTERN_SHUTTER, - /* OPERATION : LIST RE-ORDER */ - FEEDBACK_PATTERN_LIST_REORDER, - /* OPERATION : LIST SLIDER */ - FEEDBACK_PATTERN_SLIDER_SWEEP, -}; - -API int svi_init(int *handle) -{ - int ret = -1; - - if (handle == NULL) { - SVILOG("ERROR!! Invalid parameter : handle(NULL)"); - return SVI_ERROR; - } - - ret = feedback_initialize(); - if (FEEDBACK_FAILED(ret)) { - SVILOG("ERROR!! feedback_initialize is failed"); - return SVI_ERROR; - } - - *handle = SVI_TEMP_HANDLE; - return SVI_SUCCESS; -} - -API int svi_fini(int handle) -{ - int ret = -1; - - if (handle != SVI_TEMP_HANDLE) { - SVILOG("ERROR!! Invalid parameter : handle(%d)", handle); - return SVI_ERROR; - } - - ret = feedback_deinitialize(); - if (FEEDBACK_FAILED(ret)) { - SVILOG("ERROR!! feedback_deinitialize is failed"); - return SVI_ERROR; - } - - return SVI_SUCCESS; -} - -API int svi_play_sound(int handle, sound_type sound_key) -{ - int ret = -1; - feedback_pattern_e pattern = FEEDBACK_PATTERN_NONE; - - if (handle != SVI_TEMP_HANDLE) { - SVILOG("ERROR!! Invalid parameter : handle(%d)", handle); - return SVI_ERROR; - } - - if (sound_key < SVI_SND_NONE || sound_key >= SVI_SND_ENUM_END) { - SVILOG("ERROR!! Invalid parameter : sound_key(%d)", sound_key); - return SVI_ERROR; - } - - if (sound_key == SVI_SND_NONE) { - pattern = FEEDBACK_PATTERN_NONE; - SVILOG("pattern is NONE"); - } else { - pattern = feedback_sound[sound_key]; - SVILOG("sound_key : %d, pattern : %d", sound_key, pattern); - } - - ret = feedback_play_type(FEEDBACK_TYPE_SOUND, pattern); - if (FEEDBACK_FAILED(ret)) { - SVILOG("ERROR!! feedback_play_type is failed"); - return SVI_ERROR; - } - - return SVI_SUCCESS; -} - -API int svi_play_vib(int handle, vibration_type vibration_key) -{ - int ret = -1; - feedback_pattern_e pattern = FEEDBACK_PATTERN_NONE; - - if (handle != SVI_TEMP_HANDLE) { - SVILOG("ERROR!! Invalid parameter : handle(%d)", handle); - return SVI_ERROR; - } - - if (vibration_key < SVI_VIB_NONE || vibration_key >= SVI_VIB_ENUM_END) { - SVILOG("ERROR!! Invalid parameter : sound_key(%d)", vibration_key); - return SVI_ERROR; - } - - if (vibration_key == SVI_VIB_NONE) { - pattern = FEEDBACK_PATTERN_NONE; - SVILOG("pattern is NONE"); - } else { - pattern = feedback_vibration[vibration_key]; - SVILOG("vibration_key : %d, pattern : %d", vibration_key, pattern); - } - - ret = feedback_play_type(FEEDBACK_TYPE_VIBRATION, pattern); - if (FEEDBACK_FAILED(ret)) { - SVILOG("ERROR!! feedback_play_type is failed"); - return SVI_ERROR; - } - - return SVI_SUCCESS; -} - -API int svi_play(int handle, vibration_type vibration_key, sound_type sound_key) -{ - int ret_snd = svi_play_sound(handle, sound_key); - int ret_vib = svi_play_vib(handle, vibration_key); - - if (ret_snd == SVI_ERROR || ret_vib == SVI_ERROR) { - return SVI_ERROR; - } else { - return SVI_SUCCESS; - } -} - -API int svi_set_path(int svi_type, int svi_enum, char* path) -{ - SVILOG("This api is not supported"); - return SVI_ERROR; -} - -API int svi_get_path(int svi_type, int svi_enum, char* buf, unsigned int bufLen) -{ - int ret = -1; - feedback_pattern_e pattern = FEEDBACK_PATTERN_NONE; - char *path = NULL; - - if (svi_type <= SVI_TYPE_NONE || svi_type >= SVI_TYPE_END) { - SVILOG("ERROR!! Invalid parameter : svi_type(%d).", svi_type); - return SVI_ERROR; - } - - if (svi_type == SVI_TYPE_SND) { - if (svi_enum <= SVI_SND_NONE || svi_enum >= SVI_SND_ENUM_END) { - SVILOG("ERROR! invalid svi_enum(%d)", svi_enum); - return SVI_ERROR; - } - - pattern = feedback_sound[svi_enum]; - ret = feedback_get_resource_path(FEEDBACK_TYPE_SOUND, pattern, &path); - } else if (svi_type == SVI_TYPE_VIB) { - if (svi_enum <= SVI_VIB_NONE || svi_enum >= SVI_VIB_ENUM_END) { - SVILOG("ERROR! invalid svi_enum(%d)", svi_enum); - return SVI_ERROR; - } - - pattern = feedback_vibration[svi_enum]; - ret = feedback_get_resource_path(FEEDBACK_TYPE_VIBRATION, pattern, &path); - } - - if (FEEDBACK_FAILED(ret)) { - SVILOG("ERROR!! feedback_play_type is failed"); - return SVI_ERROR; - } - - snprintf(buf, bufLen, "%s", path); - free(path); - - return SVI_SUCCESS; -} diff --git a/src/vibrator.c b/src/vibrator.c index 21897c8..3441fc4 100644 --- a/src/vibrator.c +++ b/src/vibrator.c @@ -19,218 +19,168 @@ #include #include #include -#include -#include #include #include #include #include -#include +#include #include "feedback-ids.h" #include "common.h" #include "log.h" #include "devices.h" #include "xmlparser.h" +#include "dbus.h" + +#define DEFAULT_VIB_LEVEL 3 +#define HAPTIC_FEEDBACK_STEP 20 /**< feedback max / slider step */ -#define FEEDBACK_HAPTIC_DIR FEEDBACK_DATA_DIR"/haptic" -#define FEEDBACK_HAPTIC_TOUCH_DIR "touch" -#define FEEDBACK_HAPTIC_OPER_DIR "operation" -#define FEEDBACK_HAPTIC_NOTI_DIR "notification" -#define FEEDBACK_HAPTIC_DEFAULT_DIR "default" -#define SCRIPT_INIT_LINK_HAPTIC FEEDBACK_ORIGIN_DATA_DIR"/init_wav_link.sh" -#define MAX_HAPTIC_FILE 50 - -static const char* haptic_file_default[] = { - /* TOUCH : SCREEN TOUCH : TAP(TOUCH & RELEASE) : GENERAL */ - NULL, - /* TOUCH : SCREEN TOUCH : TAP(TOUCH & RELEASE) : TEXT_NUMERIC_INPUT */ - NULL, - NULL, - NULL, - /* TOUCH : SCREEN TOUCH : TAP(TOUCH & RELEASE) : DAILER */ - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - /* TOUCH : H/W OR SOFT TOUCH : HOLD(TAP & HOLD) */ - FEEDBACK_HAPTIC_TOUCH_DIR"/touch.tht", - /* TOUCH : H/W OR SOFT TOUCH : MULTI TAP */ - FEEDBACK_HAPTIC_TOUCH_DIR"/touch.tht", - /* TOUCH : H/W OR SOFT TOUCH : TAP */ - NULL, - /* TOUCH : H/W OR SOFT TOUCH : TAP & HOLD */ - NULL, - - /* NOTIFICATION : INCOMING : MESSAGE */ - FEEDBACK_HAPTIC_DEFAULT_DIR"/Basic_call.tht", - /* NOTIFICATION : INCOMING : MESSAGE ALERT ON CALL */ - FEEDBACK_HAPTIC_DEFAULT_DIR"/Basic_call.tht", - /* NOTIFICATION : INCOMING : EMAIL */ - FEEDBACK_HAPTIC_DEFAULT_DIR"/Basic_call.tht", - /* NOTIFICATION : INCOMING : EMAIL ALERT ON CALL */ - FEEDBACK_HAPTIC_DEFAULT_DIR"/Basic_call.tht", - /* NOTIFICATION : ALARM : WAKEUP */ - FEEDBACK_HAPTIC_DEFAULT_DIR"/Basic_call.tht", - /* NOTIFICATION : ALARM : WAKEUP ALERT ON CALL */ - FEEDBACK_HAPTIC_DEFAULT_DIR"/Basic_call.tht", - /* NOTIFICATION : ALARM : SCHEDULE */ - FEEDBACK_HAPTIC_DEFAULT_DIR"/Basic_call.tht", - /* NOTIFICATION : ALARM : SCHEDULE ALERT ON CALL */ - FEEDBACK_HAPTIC_DEFAULT_DIR"/Basic_call.tht", - /* NOTIFICATION : ALARM : TIMER */ - FEEDBACK_HAPTIC_DEFAULT_DIR"/Basic_call.tht", - /* NOTIFICATION : ALARM : TIMER ALERT ON CALL */ - FEEDBACK_HAPTIC_DEFAULT_DIR"/Basic_call.tht", - /* NOTIFICATION : GENERAL(TICKER/IM/SMS ETC) */ - FEEDBACK_HAPTIC_DEFAULT_DIR"/Basic_call.tht", - /* NOTIFICATION : GENERAL(TICKER/IM/SMS ETC) ALERT ON CALL */ - FEEDBACK_HAPTIC_DEFAULT_DIR"/Basic_call.tht", - - /* OPERATION : POWER ON/OFF */ - FEEDBACK_HAPTIC_DEFAULT_DIR"/Basic_call.tht", - FEEDBACK_HAPTIC_DEFAULT_DIR"/Basic_call.tht", - /* OPERATION : CHARGECONN */ - FEEDBACK_HAPTIC_DEFAULT_DIR"/Basic_call.tht", - /* OPERATION : CHARGECONN ALERT ON CALL */ - FEEDBACK_HAPTIC_DEFAULT_DIR"/Basic_call.tht", - /* OPERATION : FULLCHAREGED */ - FEEDBACK_HAPTIC_DEFAULT_DIR"/Basic_call.tht", - /* OPERATION : FULLCHAREGED ALERT ON CALL */ - FEEDBACK_HAPTIC_DEFAULT_DIR"/Basic_call.tht", - /* OPERATION : LOW BATTERY */ - FEEDBACK_HAPTIC_DEFAULT_DIR"/Basic_call.tht", - /* OPERATION : LOW BATTERY ALERT ON CALL */ - FEEDBACK_HAPTIC_DEFAULT_DIR"/Basic_call.tht", - /* OPERATION : LOCK/UNLOCK */ - FEEDBACK_HAPTIC_DEFAULT_DIR"/Basic_call.tht", - FEEDBACK_HAPTIC_DEFAULT_DIR"/Basic_call.tht", - /* OPERATION : CALL CONNECT/ DISCONNECT */ - FEEDBACK_HAPTIC_DEFAULT_DIR"/Basic_call.tht", - FEEDBACK_HAPTIC_DEFAULT_DIR"/Basic_call.tht", - /* OPERATION : MINUTE MINDER */ - FEEDBACK_HAPTIC_DEFAULT_DIR"/Basic_call.tht", - /* OPERATION : VIBRATION */ - FEEDBACK_HAPTIC_DEFAULT_DIR"/Basic_call.tht", - /* OPERATION : CAMERA SHUTTER / SCREEN CAPTURE */ - NULL, - /* OPERATION : LIST RE-ORDER */ - NULL, - /* OPERATION : LIST SLIDER */ - NULL, - /* OPERATION : VOLUME KEY */ - NULL, +#define HAPTIC_DEVICE 0 + +enum haptic_priority +{ + HAPTIC_PRIORITY_MIN = 0, + HAPTIC_PRIORITY_MIDDLE, + HAPTIC_PRIORITY_HIGH, }; -static char* haptic_file[] = { - /* TOUCH : SCREEN TOUCH : TAP(TOUCH & RELEASE) : GENERAL */ - NULL, - /* TOUCH : SCREEN TOUCH : TAP(TOUCH & RELEASE) : TEXT_NUMERIC_INPUT */ - NULL, - NULL, - NULL, - /* TOUCH : SCREEN TOUCH : TAP(TOUCH & RELEASE) : DAILER */ - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - /* TOUCH : H/W OR SOFT TOUCH : HOLD(TAP & HOLD) */ - NULL, - /* TOUCH : H/W OR SOFT TOUCH : MULTI TAP */ - NULL, - /* TOUCH : H/W OR SOFT TOUCH : TAP */ - NULL, - /* TOUCH : H/W OR SOFT TOUCH : TAP & HOLD */ - NULL, - - /* NOTIFICATION : INCOMING : MESSAGE */ - NULL, - /* NOTIFICATION : INCOMING : MESSAGE ALERT ON CALL */ - NULL, - /* NOTIFICATION : INCOMING : EMAIL */ - NULL, - /* NOTIFICATION : INCOMING : EMAIL ALERT ON CALL */ - NULL, - /* NOTIFICATION : ALARM : WAKEUP */ - NULL, - /* NOTIFICATION : ALARM : WAKEUP ALERT ON CALL */ - NULL, - /* NOTIFICATION : ALARM : SCHEDULE */ - NULL, - /* NOTIFICATION : ALARM : SCHEDULE ALERT ON CALL */ - NULL, - /* NOTIFICATION : ALARM : TIMER */ - NULL, - /* NOTIFICATION : ALARM : TIMER ALERT ON CALL */ - NULL, - /* NOTIFICATION : GENERAL(TICKER/IM/SMS ETC) */ - NULL, - /* NOTIFICATION : GENERAL(TICKER/IM/SMS ETC) ALERT ON CALL */ - NULL, - - /* OPERATION : POWER ON/OFF */ - NULL, - NULL, - /* OPERATION : CHARGECONN */ - NULL, - /* OPERATION : CHARGECONN ALERT ON CALL */ - NULL, - /* OPERATION : FULLCHAREGED */ - NULL, - /* OPERATION : FULLCHAREGED ALERT ON CALL */ - NULL, - /* OPERATION : LOW BATTERY */ - NULL, - /* OPERATION : LOW BATTERY ALERT ON CALL */ - NULL, - /* OPERATION : LOCK/UNLOCK */ - NULL, - NULL, - /* OPERATION : CALL CONNECT/ DISCONNECT */ - NULL, - NULL, - /* OPERATION : MINUTE MINDER */ - NULL, - /* OPERATION : VIBRATION */ - NULL, - /* OPERATION : CAMERA SHUTTER / SCREEN CAPTURE */ - NULL, - /* OPERATION : LIST RE-ORDER */ - NULL, - /* OPERATION : LIST SLIDER */ - NULL, - /* OPERATION : VOLUME KEY */ - NULL, +enum haptic_iteration +{ + HAPTIC_ITERATION_ONCE = 1, + HAPTIC_ITERATION_INFINITE = 256, }; #define VIBRATION_XML "/usr/share/feedback/vibration.xml" +#define METHOD_OPEN "OpenDevice" +#define METHOD_CLOSE "CloseDevice" +#define METHOD_VIBRATE_BUFFER "VibrateBuffer" +#define METHOD_STOP "StopDevice" + static int vibstatus; static int vib_level; static int noti_level; -static haptic_device_h v_handle; +static unsigned int v_handle; static xmlDocPtr v_doc; -static void feedback_vibstatus_cb(keynode_t *key, void* data) +static char haptic_file[FEEDBACK_PATTERN_END][NAME_MAX]; + +static int haptic_open(void) +{ + char *arr[1]; + char buf_index[32]; + + snprintf(buf_index, sizeof(buf_index), "%d", HAPTIC_DEVICE); + arr[0] = buf_index; + + return dbus_method_sync(DEVICED_BUS_NAME, DEVICED_PATH_HAPTIC, + DEVICED_INTERFACE_HAPTIC, METHOD_OPEN, + "i", arr); +} + +static int haptic_close(unsigned int handle) +{ + char *arr[1]; + char buf_handle[32]; + + snprintf(buf_handle, sizeof(buf_handle), "%u", handle); + arr[0] = buf_handle; + + return dbus_method_sync(DEVICED_BUS_NAME, DEVICED_PATH_HAPTIC, + DEVICED_INTERFACE_HAPTIC, METHOD_CLOSE, + "u", arr); +} + +static int haptic_vibrate_buffer(unsigned int handle, + const unsigned char *buffer, + int size, + int iteration, + int feedback, + int priority) { - vibstatus = vconf_keynode_get_bool(key); + char *arr[6]; + char buf_handle[32]; + char buf_iteration[32]; + char buf_feedback[32]; + char buf_priority[32]; + struct dbus_byte bytes; + + snprintf(buf_handle, sizeof(buf_handle), "%u", handle); + arr[0] = buf_handle; + bytes.size = size; + bytes.data = buffer; + arr[2] = (char*)&bytes; + snprintf(buf_iteration, sizeof(buf_iteration), "%d", iteration); + arr[3] = buf_iteration; + snprintf(buf_feedback, sizeof(buf_feedback), "%d", feedback); + arr[4] = buf_feedback; + snprintf(buf_priority, sizeof(buf_priority), "%d", priority); + arr[5] = buf_priority; + + return dbus_method_sync(DEVICED_BUS_NAME, DEVICED_PATH_HAPTIC, + DEVICED_INTERFACE_HAPTIC, METHOD_VIBRATE_BUFFER, + "uayiii", arr); +} + +static int haptic_vibrate_stop(unsigned int handle) +{ + char *arr[1]; + char buf_handle[32]; + + snprintf(buf_handle, sizeof(buf_handle), "%u", handle); + arr[0] = buf_handle; + + return dbus_method_sync(DEVICED_BUS_NAME, DEVICED_PATH_HAPTIC, + DEVICED_INTERFACE_HAPTIC, METHOD_STOP, + "u", arr); +} + +static unsigned char* convert_file_to_buffer(const char *file_name, int *size) +{ + FILE *pf; + long file_size; + unsigned char *pdata = NULL; + + if (!file_name) + return NULL; + + /* Get File Stream Pointer */ + pf = fopen(file_name, "rb"); + if (!pf) { + _E("fopen failed : %s", strerror(errno)); + return NULL; + } + + if (fseek(pf, 0, SEEK_END)) + goto error; + + file_size = ftell(pf); + if (fseek(pf, 0, SEEK_SET)) + goto error; + + if (file_size < 0) + goto error; + + pdata = (unsigned char*)malloc(file_size); + if (!pdata) + goto error; + + if (fread(pdata, 1, file_size, pf) != file_size) + goto err_free; + + fclose(pf); + *size = file_size; + return pdata; + +err_free: + free(pdata); + +error: + fclose(pf); + + _E("failed to convert file to buffer (%s)", strerror(errno)); + return NULL; } static void feedback_vib_cb(keynode_t *key, void* data) @@ -243,7 +193,7 @@ static void feedback_noti_cb(keynode_t *key, void* data) noti_level = vconf_keynode_get_int(key); } -static haptic_priority_e get_priority(feedback_pattern_e pattern) +static int get_priority(feedback_pattern_e pattern) { if (pattern >= FEEDBACK_PATTERN_TAP && pattern <= FEEDBACK_PATTERN_HW_HOLD) return HAPTIC_PRIORITY_MIN; @@ -255,50 +205,95 @@ static int get_haptic_level(feedback_pattern_e pattern) { int level; - if (pattern >= FEEDBACK_PATTERN_MESSAGE && pattern <= FEEDBACK_PATTERN_GENERAL_ON_CALL) - level = noti_level; + if (pattern >= FEEDBACK_PATTERN_MESSAGE && pattern <= FEEDBACK_PATTERN_SMART_ALERT) + level = noti_level * HAPTIC_FEEDBACK_STEP; else - level = vib_level; + level = vib_level * HAPTIC_FEEDBACK_STEP; _D("Call status : %d, pattern : %s, level : %d", callstatus, str_pattern[pattern], level); - if (callstatus != VCONFKEY_CALL_OFF) { + if (callstatus == VCONFKEY_CALL_VOICE_ACTIVE + || callstatus == VCONFKEY_CALL_VIDEO_ACTIVE) { // if call status is ON, vibration magnitude is 20% - level = (int)(level*0.2f); - level = (level < 1) ? 1 : level; + level = 20; _D("level changed : %d", level); } - level = level * 20; return level; } static bool get_always_alert_case(feedback_pattern_e pattern) { - switch(pattern) { + switch (pattern) { + case FEEDBACK_PATTERN_KEY0 ... FEEDBACK_PATTERN_KEY_BACK: + case FEEDBACK_PATTERN_HOLD: + break; + case FEEDBACK_PATTERN_SIP: + case FEEDBACK_PATTERN_SIP_BACKSPACE: + case FEEDBACK_PATTERN_SIP_FUNCTION: + case FEEDBACK_PATTERN_SIP_FJKEY: + return true; + case FEEDBACK_PATTERN_TIMER: + case FEEDBACK_PATTERN_TIMER_ON_CALL: case FEEDBACK_PATTERN_WAKEUP: case FEEDBACK_PATTERN_WAKEUP_ON_CALL: return true; + case FEEDBACK_PATTERN_MESSAGE_ON_CALL: + case FEEDBACK_PATTERN_EMAIL_ON_CALL: + case FEEDBACK_PATTERN_GENERAL_ON_CALL: + if (alert_callstatus) + return true; + break; + case FEEDBACK_PATTERN_MESSAGE: + case FEEDBACK_PATTERN_EMAIL: + case FEEDBACK_PATTERN_3RD_APPLICATION: + case FEEDBACK_PATTERN_SMART_ALERT: + case FEEDBACK_PATTERN_SEND_SOS_MESSAGE: + case FEEDBACK_PATTERN_END_SOS_MESSAGE: + case FEEDBACK_PATTERN_CMAS: + case FEEDBACK_PATTERN_OUTGOING_CALL: + case FEEDBACK_PATTERN_MMS: + case FEEDBACK_PATTERN_HOURLY_ALERT: + return true; + case FEEDBACK_PATTERN_SPEED_UP: + case FEEDBACK_PATTERN_SLOW_DOWN: + case FEEDBACK_PATTERN_KEEP_THIS_PACE: + case FEEDBACK_PATTERN_GOAL_ACHIEVED: + case FEEDBACK_PATTERN_EXERCISE_COUNT: + case FEEDBACK_PATTERN_START_CUE: + /* except mute case */ + if (is_sound_mode() || vibstatus) + return true; + break; + case FEEDBACK_PATTERN_CHARGERCONN_ON_CALL: + case FEEDBACK_PATTERN_CHARGING_ERROR_ON_CALL: + case FEEDBACK_PATTERN_LOWBATT_ON_CALL: + /* no matter sound profile */ + return true; default: break; } return false; } +static bool get_always_off_case(feedback_pattern_e pattern) +{ + return false; +} + static int get_xml_data(xmlDocPtr doc, feedback_pattern_e pattern, struct xmlData **data) { xmlNodePtr cur; struct xmlData *retData; - cur = xml_find(doc, (const xmlChar*)str_pattern[pattern]); - if (cur == NULL) { - _E("xml_find fail"); - return -1; - } + cur = xml_find(doc, VIBRATION_STR, (const xmlChar*)str_pattern[pattern]); + /* This pattern does not have sound file to play */ + if (cur == NULL) + return -ENOENT; retData = xml_parse(doc, cur); if (retData == NULL) { _E("xml_parse fail"); - return -1; + return -EPERM; } *data = retData; @@ -313,91 +308,10 @@ static void release_xml_data(struct xmlData *data) xml_free(data); } -static int change_symlink(const char *sym_path, const char *new_path) -{ - struct stat buf; - - assert(sym_path != NULL && strlen(sym_path)); - assert(new_path != NULL && strlen(new_path)); - - /* check symbolic link file existence */ - if (stat(sym_path, &buf)) { - _E("file(%s) is not presents", sym_path); - return -EPERM; - } - - if (unlink(sym_path) < 0) - _D("unlink(%s) : %s", sym_path, strerror(errno)); - - if (symlink(new_path, sym_path) < 0) { - _E("symlink(%s) : %s", sym_path, strerror(errno)); - return -EPERM; - } - - return 0; -} - -static int restore_default_file(feedback_pattern_e pattern) -{ - char default_path[PATH_MAX] = {0,}; - const char *cur_path; - char *temp; - int ret; - - cur_path = haptic_file[pattern]; - // if there isn't cur_path, it already returns before calling this api - if (cur_path == NULL || strlen(cur_path) == 0) { - _E("Invalid parameter : cur_path(NULL)"); - return -EPERM; - } - - temp = strcat(default_path, FEEDBACK_ORIGIN_DATA_DIR); - strcat(temp, cur_path+strlen(FEEDBACK_DATA_DIR)); - _D("default_path : %s", default_path); - - ret = change_symlink(cur_path, default_path); - if (ret < 0) { - _E("change_symlink is failed"); - return -EPERM; - } - - return 0; -} - - -static void link_init(void) -{ - struct stat sts; - int i,ret; - int directory = 0; - char default_path[PATH_MAX] = {0,}; - - /* Check if the directory exists; if not, create it and initialize it */ - ret = stat(FEEDBACK_DATA_DIR, &sts); - if (ret == -1 && errno == ENOENT){ - directory = 1; - } - - /* init of haptic array and link*/ - strcat(default_path, FEEDBACK_ORIGIN_DATA_DIR); - for( i = 0 ; i< MAX_HAPTIC_FILE ; i++){ - if ( haptic_file_default[i] != NULL ){ - haptic_file[i] = strdup(tzplatform_mkpath3(TZ_USER_SHARE,"feedback/haptic",haptic_file_default[i])); - if (directory == 1){ - if (symlink(default_path,haptic_file[i]) < 0){ - _W("change_symlink is failed"); - } - } - } - } -} - static void vibrator_init(void) { int ret; - link_init(); - /* xml Init */ v_doc = xml_open(VIBRATION_XML); if (v_doc == NULL) { @@ -406,17 +320,16 @@ static void vibrator_init(void) } /* Vibration Init */ - ret = haptic_open(HAPTIC_DEVICE_ALL, &v_handle); - if (ret != HAPTIC_ERROR_NONE) { + ret = haptic_open(); + if (ret < 0) { _E("haptic_open ==> FAIL!! : %d", ret); xml_close(v_doc); v_doc = NULL; return; } - /* check vibration status */ - if (vconf_get_bool(VCONFKEY_SETAPPL_VIBRATION_STATUS_BOOL, &vibstatus) < 0) - _W("VCONFKEY_SETAPPL_VIBRATION_STATUS_BOOL ==> FAIL!!"); + /* Set vibration handle */ + v_handle = (unsigned int)ret; /* check vib_level */ if (vconf_get_int(VCONFKEY_SETAPPL_TOUCH_FEEDBACK_VIBRATION_LEVEL_INT, &vib_level) < 0) @@ -427,72 +340,101 @@ static void vibrator_init(void) _W("VCONFKEY_SETAPPL_NOTI_VIBRATION_LEVEL_INT ==> FAIL!!"); /* add watch for status value */ - vconf_notify_key_changed(VCONFKEY_SETAPPL_VIBRATION_STATUS_BOOL, feedback_vibstatus_cb, NULL); vconf_notify_key_changed(VCONFKEY_SETAPPL_TOUCH_FEEDBACK_VIBRATION_LEVEL_INT, feedback_vib_cb, NULL); vconf_notify_key_changed(VCONFKEY_SETAPPL_NOTI_VIBRATION_LEVEL_INT, feedback_noti_cb, NULL); } static void vibrator_exit(void) { - int ret,i; + int ret; /* remove watch */ - vconf_ignore_key_changed(VCONFKEY_SETAPPL_VIBRATION_STATUS_BOOL, feedback_vibstatus_cb); vconf_ignore_key_changed(VCONFKEY_SETAPPL_TOUCH_FEEDBACK_VIBRATION_LEVEL_INT, feedback_vib_cb); vconf_ignore_key_changed(VCONFKEY_SETAPPL_NOTI_VIBRATION_LEVEL_INT, feedback_noti_cb); if (v_handle) { ret = haptic_close(v_handle); - if (ret != HAPTIC_ERROR_NONE) + if (ret < 0) _E("haptic_close is failed : %d", ret); - v_handle = NULL; + v_handle = 0; } if (v_doc) { xml_close(v_doc); v_doc = NULL; } - - for( i = 0 ; i< MAX_HAPTIC_FILE ; i++) - { - if ( haptic_file[i] != NULL ) { - free (haptic_file[i]); - } - } } static int vibrator_play(feedback_pattern_e pattern) { - int ret; + int ret, size; struct xmlData *data; + char *path; + unsigned char *buf; if (!v_handle || !v_doc) { _E("Not initialize"); return -EPERM; } + if (vconf_get_bool(VCONFKEY_SETAPPL_VIBRATION_STATUS_BOOL, &vibstatus) < 0) { + _D("fail to get vibration status, will work as turning off"); + vibstatus = 0; + } + if (vibstatus == 0 && !get_always_alert_case(pattern)) { _D("Vibration condition is OFF (vibstatus : %d)", vibstatus); return 0; } + if (vibstatus && get_always_off_case(pattern)) { + _D("Vibration always off condition"); + return 0; + } + + /* if there is a file path user defined */ + path = haptic_file[pattern]; + if (*path) { + buf = convert_file_to_buffer(path, &size); + if (!buf) { + _E("convert_file_to_buffer is failed"); + return -EPERM; + } + + ret = haptic_vibrate_buffer(v_handle, buf, size, HAPTIC_ITERATION_ONCE, + get_haptic_level(pattern), get_priority(pattern)); + if (ret < 0) { + _E("haptic_vibrate_buffer is failed"); + free(buf); + return -EPERM; + } + + free(buf); + return 0; + } + ret = get_xml_data(v_doc, pattern, &data); + if (ret == -ENOENT) { + _D("No vibration case(%s)", str_pattern[pattern]); + return 0; + } + if (ret < 0) { _E("get_xml_data fail"); return -EPERM; } if (data->data == NULL) { - _D("This case(%s) does not play vibration", str_pattern[pattern]); + _D("No vibration case(%s)", str_pattern[pattern]); release_xml_data(data); return 0; } /* play haptic buffer */ - ret = haptic_vibrate_buffer_with_detail(v_handle, data->data, HAPTIC_ITERATION_ONCE, - get_haptic_level(pattern), get_priority(pattern), NULL); - if (ret != HAPTIC_ERROR_NONE) { - _E("haptic_vibrate_buffer_with_detail is failed"); + ret = haptic_vibrate_buffer(v_handle, (unsigned char*)data->data, data->size, HAPTIC_ITERATION_ONCE, + get_haptic_level(pattern), get_priority(pattern)); + if (ret < 0) { + _E("haptic_vibrate_buffer is failed"); release_xml_data(data); return -EPERM; } @@ -501,54 +443,65 @@ static int vibrator_play(feedback_pattern_e pattern) return 0; } +static int vibrator_stop(void) +{ + int ret; + + if (!v_handle || !v_doc) { + _E("Not initialize"); + return -EPERM; + } + + /* stop haptic device */ + ret = haptic_vibrate_stop(v_handle); + if (ret < 0) { + _E("haptic_vibrate_stop is failed"); + return -EPERM; + } + + return 0; +} + static int vibrator_get_path(feedback_pattern_e pattern, char *buf, unsigned int buflen) { const char *cur_path; - int retry = FEEDBACK_RETRY_CNT; assert(buf != NULL && buflen > 0); cur_path = haptic_file[pattern]; - if (cur_path == NULL) { + if (*cur_path) { _E("This pattern(%s) in vibrator type is not supported to play", str_pattern[pattern]); snprintf(buf, buflen, "NULL"); return -ENOENT; } - do { - if(readlink(cur_path, buf, buflen) < 0) { - _E("readlink is failed : %s", strerror(errno)); - return -EPERM; - } - } while(retry--); - + snprintf(buf, buflen, "%s", cur_path); return 0; } static int vibrator_set_path(feedback_pattern_e pattern, char *path) { - const char *cur_path; - int ret; - - assert(path != NULL); - - if (access(path, F_OK) != 0) { - _E("Invalid parameter : path does not exist"); - return -ENOENT; + struct stat buf; + char *ppath; + + /* + * check the path is valid + * if path is null, below operation is ignored + */ + if (path && stat(path, &buf)) { + _E("%s is not presents", path); + return -errno; } - cur_path = haptic_file[pattern]; - if (cur_path == NULL) { - _E("This pattern(%s) in vibrator type is not supported to play", str_pattern[pattern]); - return -ENOENT; - } + ppath = haptic_file[pattern]; - ret = change_symlink(cur_path, path); - if (ret < 0) { - _E("change_symlink is failed"); - return -EPERM; - } + /* if path is NULL, this pattern set to default file */ + if (path) + snprintf(ppath, NAME_MAX, "%s", path); + else + memset(ppath, 0, NAME_MAX); + _D("The file of pattern(%s) is changed to [%s]", str_pattern[pattern], path); return 0; } @@ -557,6 +510,7 @@ static const struct device_ops vibrator_device_ops = { .init = vibrator_init, .exit = vibrator_exit, .play = vibrator_play, + .stop = vibrator_stop, .get_path = vibrator_get_path, .set_path = vibrator_set_path, }; diff --git a/src/xmlparser.c b/src/xmlparser.c index 672d504..e2b09d2 100644 --- a/src/xmlparser.c +++ b/src/xmlparser.c @@ -18,6 +18,7 @@ #include #include +#include #include #include "xmlparser.h" @@ -73,7 +74,7 @@ static int xml_compare(xmlDocPtr doc, xmlNodePtr cur, const xmlChar* expr) return 0; } -xmlNodePtr xml_find(xmlDocPtr doc, const xmlChar* expr) +xmlNodePtr xml_find(xmlDocPtr doc, const char *label, const xmlChar* expr) { xmlNodePtr root; xmlNodePtr cur; @@ -88,7 +89,7 @@ xmlNodePtr xml_find(xmlDocPtr doc, const xmlChar* expr) } for (cur = root->children; cur != NULL; cur = cur->next) { - if (xmlStrcmp(cur->name, (const xmlChar*)VIBRATION)) + if (xmlStrcmp(cur->name, (const xmlChar*)label)) continue; if (!xml_compare(doc, cur, expr)) @@ -104,8 +105,6 @@ struct xmlData *xml_parse(xmlDocPtr doc, xmlNodePtr cur) { xmlNodePtr node; struct xmlData *data; - char *b64_data; - unsigned int len; assert(doc); assert(cur); @@ -122,18 +121,31 @@ struct xmlData *xml_parse(xmlDocPtr doc, xmlNodePtr cur) data->label = (char*)xmlNodeListGetString(doc, node->children, 1); _D("label : %s", data->label); } else if (!xmlStrcmp(node->name, (const xmlChar*)data_str[XML_DATA])) { - b64_data = (char *)xmlNodeListGetString(doc, node->children, 1); - if (b64_data != NULL) { - _D("b64_data : %s", b64_data); - data->data = g_base64_decode(b64_data, &len); - xmlFree(b64_data); - } + data->data = (char*)xmlNodeListGetString(doc, node->children, 1); + data->size = strlen(data->data); } } return data; } +int xml_decode_data(struct xmlData *data) +{ + char *decode; + gsize len; + + if (!data || !data->data) + return -EINVAL; + + _D("b64_data : %s", data->data); + decode = (char*)g_base64_decode(data->data, &len); + free(data->data); + + data->data = decode; + data->size = (unsigned int)len; + return 0; +} + int xml_save(xmlDocPtr doc, const char *path) { int r; diff --git a/svi.pc.in b/svi.pc.in old mode 100755 new mode 100644 diff --git a/test/Makefile b/test/Makefile new file mode 100644 index 0000000..651f465 --- /dev/null +++ b/test/Makefile @@ -0,0 +1,12 @@ +CFLAGS=`pkg-config --cflags feedback glib-2.0` -Wall -g +LDFLAGS=`pkg-config --libs feedback glib-2.0` + +TARGETS=capi_autofeedback capi_feedback getdata + +all: $(TARGETS) + +$(TARGETS): % : %.c + $(CC) -o $@ $@.c $(CFLAGS) $(LDFLAGS) + +clean: + rm -f $(TARGETS) diff --git a/test/capi_autofeedback.c b/test/capi_autofeedback.c new file mode 100644 index 0000000..2b4d59e --- /dev/null +++ b/test/capi_autofeedback.c @@ -0,0 +1,32 @@ +#include +#include +#include + +int main(int argc, char* argv[]) +{ + int val; + int i = -1; + + val = feedback_initialize(); + if (val != FEEDBACK_ERROR_NONE) { + printf("feedback_initialize error : %d\n", val); + return -1; + } + + while(1) + { + val = feedback_play(++i); + printf("[%2d] result : %d\n", i, val); + if (val < 0) break; + + usleep(100000); + } + + val = feedback_deinitialize(); + if (val != FEEDBACK_ERROR_NONE) { + printf("feedback_initialize error : %d\n", val); + return -1; + } + + return 0; +} diff --git a/test/capi_feedback.c b/test/capi_feedback.c new file mode 100644 index 0000000..d864d37 --- /dev/null +++ b/test/capi_feedback.c @@ -0,0 +1,94 @@ +#include +#include + +static void print_menu(void) +{ + printf("Which do you want to do?\n"); + printf("\t0 : Play\n"); + printf("\t1 : Change the path\n"); + printf("\t2 : Reset the path\n"); + printf("\tothers : quit\n"); +} + +static void print_play_menu(void) +{ + printf("Which do you want to do?\n"); + printf("\t0. all\n"); + printf("\t1. sound\n"); + printf("\t2. vibration\n"); + printf("\t3. led\n"); + printf("\tothers. quit\n"); +} + +static void play(void) +{ + int a, b, val; + + while(1) { + print_play_menu(); + printf("Please enter the play menu : "); + scanf("%d", &a); + if (a < 0 || a > 4) + break; + printf("Please input value (exit:-1) : "); + scanf("%d", &b); + if (b == -1) + break; + + if (a == 0) + val = feedback_play(b); + else + val = feedback_play_type(a, b); + + printf("ret value : %d\n", val); + } +} + +int main(int argc, char* argv[]) +{ + char buf[4096] = {0,}; + int val; + int a, b; + + val = feedback_initialize(); + if (val != FEEDBACK_ERROR_NONE) { + printf("feedback_initialize error : %d\n", val); + return -1; + } + + while(1) + { + print_menu(); + printf("Please input value : "); + scanf("%d", &a); + + switch(a) { + case 0: + play(); + break; + case 1: + printf("Please input type(sound:0,vib:1), enum, new path : "); + scanf("%d %d %s", &a, &b, buf); + val = feedback_set_resource_path( (a == 0) ? FEEDBACK_TYPE_SOUND : FEEDBACK_TYPE_VIBRATION, b, buf); + printf("ret value : %d\n", val); + break; + case 2: + printf("Please input type(sound:0,vib:1), enum : "); + scanf("%d %d", &a, &b); + val = feedback_set_resource_path( (a == 0) ? FEEDBACK_TYPE_SOUND : FEEDBACK_TYPE_VIBRATION, b, NULL); + printf("ret value : %d\n", val); + break; + default: + goto exit; + } + } + +exit: + val = feedback_deinitialize(); + if (val != FEEDBACK_ERROR_NONE) { + printf("feedback_initialize error : %d\n", val); + return -1; + } + + return 0; +} diff --git a/test/feedback_test.c b/test/feedback_test.c new file mode 100644 index 0000000..57e4edd --- /dev/null +++ b/test/feedback_test.c @@ -0,0 +1,72 @@ +/* + * libfeedback + * + * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Seokkyu Jang + * Contact: Sangil Yoon + * + * 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 +#include "feedback.h" + +int main(int argc, char* argv[]) +{ + char buf[4096] = {0,}; + char *temp = NULL; + int val, input; + int a, b; + + val = feedback_initialize(); + if (val != FEEDBACK_ERROR_NONE) { + printf("feedback_initialize error : %d\n", val); + return -1; + } + + while(1) + { + printf("Which do you want to work play(0) or change the path(1)?"); + scanf("%d", &a); + if (a == 0) { + printf("Please input value : "); + scanf("%d", &a); + if (a == -1) + break; + val = feedback_play(a); + printf("ret value : %d\n", val); + } else if (a == 1) { + printf("Please input type(sound:0,vib:1), enum, new path : "); + scanf("%d %d %s", &a, &b, buf); + val = feedback_get_resource_path( (a == 0) ? FEEDBACK_TYPE_SOUND : FEEDBACK_TYPE_VIBRATION, b, &temp); + printf("Prev : %s", temp); + free(temp); + val = feedback_set_resource_path( (a == 0) ? FEEDBACK_TYPE_SOUND : FEEDBACK_TYPE_VIBRATION, b, buf); + val = feedback_get_resource_path( (a == 0) ? FEEDBACK_TYPE_SOUND : FEEDBACK_TYPE_VIBRATION, b, &temp); + printf("Curr : %s", temp); + free(temp); + } else { + printf("Input error!!"); + } + } + + val = feedback_deinitialize(); + if (val != FEEDBACK_ERROR_NONE) { + printf("feedback_initialize error : %d\n", val); + return -1; + } + + return 0; +} diff --git a/test/getdata.c b/test/getdata.c new file mode 100644 index 0000000..ba54aa6 --- /dev/null +++ b/test/getdata.c @@ -0,0 +1,82 @@ +#include +#include +#include +#include +#include +#include +#include + +#define DBG(fmt, argc...) printf("<%s:%d> "fmt"\n", __func__, __LINE__, ##argc) +#define ERR(fmt, argc...) printf("<%s:%d> [ERROR] "fmt"\n", __func__, __LINE__, ##argc) + +#define BUF_SIZE 1024 + +static int print_content(const char *filename) +{ + FILE *fp; + unsigned char buf[BUF_SIZE]; + char *b64_de, *b64_en; + unsigned int n; + + fp = fopen(filename, "r"); + if (fp == NULL) { + ERR("fopen fail"); + return -1; + } + + while ((n = fread(buf, 1, sizeof(buf), fp)) > 0) { + printf("[[["); + b64_en = g_base64_encode(buf, n); + fwrite(b64_en, 1, n, stdout); + printf("]]]\n((("); + b64_de = (char*)g_base64_decode(b64_en, &n); + fwrite(b64_de, 1, n, stdout); + printf(")))\n"); + + free(b64_en); + free(b64_de); + } + + fclose(fp); + printf("\n"); + return 0; + +} + +static void printdir(char *dir, int depth) +{ + DIR *dp; + struct dirent *entry; + struct stat statbuf; + + if ((dp = opendir(dir)) == NULL) { + ERR("opendir fail"); + return; + } + + chdir(dir); + while ((entry = readdir(dp)) != NULL) { + lstat(entry->d_name, &statbuf); + if (S_ISDIR(statbuf.st_mode)) { + if (strcmp(".", entry->d_name) == 0 || + strcmp("..", entry->d_name) == 0) + continue; + + DBG("%*s%s", depth, "", entry->d_name); + printdir(entry->d_name, depth+strlen(entry->d_name)); + } else { + + DBG("%*s%s", depth, "", entry->d_name); + print_content(entry->d_name); + } + } + chdir(".."); + closedir(dp); +} + +int main(int argc, char *argv[]) +{ + printdir(argv[1], 0); + DBG("done"); + return 0; +} -- cgit v1.2.3