From: Kibum Kim Date: Fri, 6 Jan 2012 15:48:44 +0000 (+0900) Subject: Git init X-Git-Tag: 2.0_alpha~9 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=7b93e558cf9c94b77eeb14b47bda4699b21098da;p=framework%2Ftelephony%2Flibslp-tapi.git Git init --- diff --git a/AUTHORS b/AUTHORS new file mode 100644 index 0000000..b9eed62 --- /dev/null +++ b/AUTHORS @@ -0,0 +1,5 @@ +Jongman Park +Danny Jeongseok Seo +Kyeongchul Kim +Youngman Park +Inho Oh diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..39f73c5 --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,178 @@ +CMAKE_MINIMUM_REQUIRED(VERSION 2.6) +SET(CMAKE_ALLOW_LOOSE_LOOP_CONSTRUCTS true) + +PROJECT(SLP-tapi C) +SET(VERSION 0.0) + + +### Global setting ### +SET(PREFIX ${CMAKE_INSTALL_PREFIX}) +SET(EXEC_PREFIX "\${prefix}") +SET(LIBDIR "\${prefix}/lib") +SET(INCLUDEDIR "\${prefix}/include") + +MACRO(GET_TARGET_PROPERTY_WITH_DEFAULT _variable _target _property _default_value) + GET_TARGET_PROPERTY (${_variable} ${_target} ${_property}) + IF (${_variable} MATCHES NOTFOUND) + SET (${_variable} ${_default_value}) + ENDIF (${_variable} MATCHES NOTFOUND) +ENDMACRO (GET_TARGET_PROPERTY_WITH_DEFAULT) + +MACRO(CREATE_LIBTOOL_FILE _target _install_DIR) + GET_TARGET_PROPERTY(_target_location ${_target} LOCATION) + GET_TARGET_PROPERTY_WITH_DEFAULT(_target_static_lib ${_target} STATIC_LIB "") + GET_TARGET_PROPERTY_WITH_DEFAULT(_target_dependency_libs ${_target} LT_DEPENDENCY_LIBS "") + GET_TARGET_PROPERTY_WITH_DEFAULT(_target_current ${_target} LT_VERSION_CURRENT 0) + GET_TARGET_PROPERTY_WITH_DEFAULT(_target_age ${_target} LT_VERSION_AGE 0) + GET_TARGET_PROPERTY_WITH_DEFAULT(_target_revision ${_target} LT_VERSION_REVISION 0) + GET_TARGET_PROPERTY_WITH_DEFAULT(_target_installed ${_target} LT_INSTALLED yes) + GET_TARGET_PROPERTY_WITH_DEFAULT(_target_shouldnotlink ${_target} LT_SHOULDNOTLINK yes) + GET_TARGET_PROPERTY_WITH_DEFAULT(_target_dlopen ${_target} LT_DLOPEN "") + GET_TARGET_PROPERTY_WITH_DEFAULT(_target_dlpreopen ${_target} LT_DLPREOPEN "") + GET_FILENAME_COMPONENT(_laname ${_target_location} NAME_WE) + GET_FILENAME_COMPONENT(_soname ${_target_location} NAME) + SET(_laname2 ${_laname}.la) + SET(_laname ${PROJECT_BINARY_DIR}/${_laname}.la) + FILE(WRITE ${_laname} "# ${_laname2} - a libtool library file\n") + FILE(APPEND ${_laname} "# Generated by CMake ${CMAKE_VERSION} (like GNU libtool)\n") + FILE(APPEND ${_laname} "\n# Please DO NOT delete this file!\n# It is necessary for linking the library with libtool.\n\n" ) + FILE(APPEND ${_laname} "# The name that we can dlopen(3).\n") + FILE(APPEND ${_laname} "dlname='${_soname}'\n\n") + FILE(APPEND ${_laname} "# Names of this library.\n") + FILE(APPEND ${_laname} "library_names='${_soname}.${_target_current}.${_target_age}.${_target_revision} ${_soname}.${_target_current} ${_soname}'\n\n") + FILE(APPEND ${_laname} "# The name of the static archive.\n") + FILE(APPEND ${_laname} "old_library='${_target_static_lib}'\n\n") + FILE(APPEND ${_laname} "# Libraries that this one depends upon.\n") + FILE(APPEND ${_laname} "dependency_libs='${_target_dependency_libs}'\n\n") + FILE(APPEND ${_laname} "# Names of additional weak libraries provided by this library\n") + FILE(APPEND ${_laname} "weak_library_names=\n\n") + FILE(APPEND ${_laname} "# Version information for ${_laname2}.\n") + FILE(APPEND ${_laname} "current=${_target_current}\n") + FILE(APPEND ${_laname} "age=${_target_age}\n") + FILE(APPEND ${_laname} "revision=${_target_revision}\n\n") + FILE(APPEND ${_laname} "# Is this an already installed library?\n") + FILE(APPEND ${_laname} "installed=${_target_installed}\n\n") + FILE(APPEND ${_laname} "# Should we warn about portability when linking against -modules?\n") + FILE(APPEND ${_laname} "shouldnotlink=${_target_shouldnotlink}\n\n") + FILE(APPEND ${_laname} "# Files to dlopen/dlpreopen\n") + FILE(APPEND ${_laname} "dlopen='${_target_dlopen}'\n") + FILE(APPEND ${_laname} "dlpreopen='${_target_dlpreopen}'\n\n") + FILE(APPEND ${_laname} "# Directory that this library needs to be installed in:\n") + FILE(APPEND ${_laname} "libdir='${CMAKE_INSTALL_PREFIX}${_install_DIR}'\n") + INSTALL( FILES ${_laname} DESTINATION ${CMAKE_INSTALL_PREFIX}${_install_DIR}) +ENDMACRO(CREATE_LIBTOOL_FILE) + + +# Build type : Release +IF("${CMAKE_BUILD_TYPE}" STREQUAL "") + SET(CMAKE_BUILD_TYPE "Release") +ENDIF() +MESSAGE("Build type: ${CMAKE_BUILD_TYPE}") + + +# Set required packages +INCLUDE(FindPkgConfig) +pkg_check_modules(pkgs REQUIRED vconf glib-2.0 dbus-1 dbus-glib-1 gthread-2.0 dlog security-server) + +FOREACH(flag ${pkgs_CFLAGS}) + SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}") +ENDFOREACH(flag) + + +# Compiler flags +INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include/common + ${CMAKE_SOURCE_DIR}/include/tapi + ${CMAKE_SOURCE_DIR}/include/porting) +SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} -Wl,-zdefs" ) +SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} -fvisibility=hidden") +SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS}") +SET(CMAKE_C_FLAGS_DEBUG "-O0 -g") +SET(CMAKE_C_FLAGS_RELEASE "-O2") + +SET(CMAKE_SKIP_BUILD_RPATH true) + + +# Get uname value to set 'TARGET' definition +# TODO: Is this needed? +FIND_PROGRAM(UNAME NAMES uname) +EXEC_PROGRAM("${UNAME}" ARGS "-m" OUTPUT_VARIABLE "ARCH") +IF("${ARCH}" STREQUAL "arm") + ADD_DEFINITIONS("-DTARGET") + ADD_DEFINITIONS("-D_TELEPHONY_ARM_ONEDRAM") + ADD_DEFINITIONS("-D_ARM_TOUCH -DFEATURE_GPS_XTRA") + MESSAGE("add -DTARGET") +ELSE() + ADD_DEFINITIONS("-D_SIMUL_TOUCH -DFEATURE_GPS_XTRA") +ENDIF() + + +ADD_DEFINITIONS("-D_CP_INFINEON_") +#ADD_DEFINITIONS("-D_CP_QUALCOMM_") + +ADD_DEFINITIONS("-D_MACHINE_AQUILA_") +ADD_DEFINITIONS("-DPREFIX=\"${CMAKE_INSTALL_PREFIX}\"") + +ADD_DEFINITIONS("-DTELEPHONY_TIMER") +ADD_DEFINITIONS("-DFEATURE_TELEPHONY_GPS") +ADD_DEFINITIONS("-D_TAPI_DEBUG_ON_DEBUG_VIEWER_") +ADD_DEFINITIONS("-DLARGE_ICON") +ADD_DEFINITIONS(" -DEXPORT_API=\"__attribute__((visibility(\\\"default\\\")))\" ") + + +# Linker flags +SET(CMAKE_EXE_LINKER_FLAGS "-Wl,--as-needed") + + +### Build ### +SET(SRCS + src/tapi_proxy_common.c + src/tapi_proxy_network.c + src/tapi_proxy_sim.c + src/tapi_proxy_ss.c + src/tapi_proxy_call.c + src/tapi_proxy_nettext.c + src/tapi_proxy_sat.c + src/common_tapi_lib.c + src/tapi_proxy_sound.c + src/tapi_proxy_gprs.c + src/porting/tel_marshaler.c + src/common_tapi_lib_internal.c + src/tapi_proxy_cfg.c + src/tapi_proxy_productivity.c + src/tapi_proxy_power.c + src/tapi_proxy_gps.c + src/tapi_proxy_omadm.c + src/tapi_proxy_misc.c + src/tapi_proxy_data.c + ) + +ADD_CUSTOM_TARGET(tapi-lib-proxy.h + COMMAND dbus-binding-tool --prefix= --mode=glib-client --output=${CMAKE_CURRENT_SOURCE_DIR}/include/tapi/tapi-lib-proxy.h ${CMAKE_CURRENT_SOURCE_DIR}/src/tapi-lib.xml) + +#ADD_LIBRARY(SLP-tapi_STATIC STATIC ${SRCS}) +#TARGET_LINK_LIBRARIES(SLP-tapi_STATIC ${pkgs_LDFLAGS}) +#SET_TARGET_PROPERTIES(SLP-tapi_STATIC PROPERTIES VERSION 0.0.0 SOVERSION 0 OUTPUT_NAME SLP-tapi) +#ADD_DEPENDENCIES(SLP-tapi_STATIC tapi-lib-proxy.h) + +ADD_LIBRARY(SLP-tapi_SHARED SHARED ${SRCS}) +TARGET_LINK_LIBRARIES(SLP-tapi_SHARED ${pkgs_LDFLAGS}) +SET_TARGET_PROPERTIES(SLP-tapi_SHARED PROPERTIES VERSION 0.0.0 SOVERSION 0 OUTPUT_NAME SLP-tapi) +CREATE_LIBTOOL_FILE(SLP-tapi_SHARED /lib) + +ADD_DEPENDENCIES(SLP-tapi_SHARED tapi-lib-proxy.h) + +# pkgconfig file +SET(PREFIX ${CMAKE_INSTALL_PREFIX}) +CONFIGURE_FILE(tapi.pc.in tapi.pc @ONLY) + + +### Install ### +#INSTALL(TARGETS SLP-tapi_STATIC SLP-tapi_SHARED DESTINATION lib) +#INSTALL(TARGETS SLP-tapi_STATIC SLP-tapi_SHARED DESTINATION lib COMPONENT Development) +#INSTALL(TARGETS SLP-tapi DESTINATION lib COMPONENT RuntimeLibraries) +INSTALL(TARGETS SLP-tapi_SHARED DESTINATION lib COMPONENT Runtime) + +INSTALL(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/include/common DESTINATION include/telephony) +INSTALL(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/include/tapi DESTINATION include/telephony) +INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/tapi.pc DESTINATION lib/pkgconfig) + diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..9c13a9b --- /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/TC/making_new_tet_scen.py b/TC/making_new_tet_scen.py new file mode 100755 index 0000000..6c5b845 --- /dev/null +++ b/TC/making_new_tet_scen.py @@ -0,0 +1,69 @@ +#!/usr/bin/python + +############################################# +# tet_scen auto generator +# +# ** argv[1] = TC root +############################################# + +import sys,string,os + + +write_file = open("tet_scen", 'w') + +# +# making new tet_scen +# +def making_tet_scen (filename): + #tmp_list = filename.strip().split('/') + n_filename = filename.replace(' ', '\\ ') + #print n_filename + #new_path = "/"+ sys.argv[1] +"/"+n_filename[2:-6] + new_path = "/"+n_filename[:-6] + #print new_path + file = open(filename, 'r') + lines = file.readlines() + for line in lines: + if len(line.strip()) > 1: + list = line.strip().split('/') + #print new_path + list[-1] + write_file.write("\t"+new_path+list[-1]+"\n") + +# +# usage() +# +def usage(): + print(" ") + print("./making_new_tet_scen.py tc_root") + print("Put the Test Case's root directory.") + print("Do not include '/' at the end") + print(" ") + +# +# main() +# +def main(): + if len(sys.argv) < 2: + usage() + sys.exit(0) + + os.system('find '+ sys.argv[1] +' -name "tslist" > tslist.txt') + + #write_file = open("tetscen", w) + write_file.write("# auto generated tet_scen\n") + write_file.write("all\n") + write_file.write("\t\"Starting Full Test Suite\"\n") + + for file in open("tslist.txt", 'r'): + #print file.strip() + making_tet_scen(file.strip()) + + write_file.write("\t\"Completed Full Test Suite\"\n") + write_file.write("# EOF\n") + write_file.close() + print(" ") + print("==============================") + print("New tet_scen file is made~~~~") + print("==============================") + print(" ") +main() diff --git a/TC/telephony_TC/CFG/cfg_util.c b/TC/telephony_TC/CFG/cfg_util.c new file mode 100644 index 0000000..a5fb7f3 --- /dev/null +++ b/TC/telephony_TC/CFG/cfg_util.c @@ -0,0 +1,176 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * 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 "cfg_util.h" + +static unsigned int subscription_id[7]; +GMainLoop *main_loop = NULL; + +void app_cfg_callback (TelTapiEvent_t * TapiEvent) +{ + + TelTapiEventClass_t eventClass; + TelTapiEventType_t eventType; + int requestId; + int status; + void *EventData = NULL; + + eventClass = TapiEvent->EventClass; + eventType = TapiEvent->EventType; + requestId = TapiEvent->RequestId; + status = TapiEvent->Status; + EventData = TapiEvent->pData; + + printf("\nClass:[%d], Event Type:[%d], RequestId:[%d], Status:[%d] \n", eventClass, eventType , requestId, status ); + + if( EventData==NULL) + { + printf("\n****** EventData is NULL......... ******\n"); + } + + switch(eventClass) + { + case TAPI_EVENT_CLASS_CFG: + switch(eventType) + { + case TAPI_EVENT_CFG_GET_A_KEY_CNF : + printf("*** TAPI_EVENT_CFG_GET_A_KEY_CNF received : %x ****\n", eventType); + break; + + case TAPI_EVENT_CFG_VERIFY_A_KEY_CNF: + printf("*** TAPI_EVENT_CFG_VERIFY_A_KEY_CNF received : %x ****\n", eventType); + break; + + case TAPI_EVENT_CFG_GET_MSL_INFO_CNF: + printf("*** TAPI_EVENT_CFG_GET_MSL_INFO_CNF received : %x ****\n", eventType); + break; + + case TAPI_EVENT_CFG_GET_VOCODER_OPTION_CNF: + printf("*** TAPI_EVENT_CFG_GET_VOCODER_OPTION_CNF received : %x ****\n", eventType); + break; + + case TAPI_EVENT_CFG_SET_VOCODER_OPTION_CNF: + printf("*** TAPI_EVENT_CFG_SET_VOCODER_OPTION_CNF received : %x ****\n", eventType); + break; + + case TAPI_EVENT_CFG_GET_HIDDEN_MENU_ACCESS_CNF: + printf("*** TAPI_EVENT_CFG_GET_HIDDEN_MENU_ACCESS_CNF received : %x ****\n", eventType); + break; + case TAPI_EVENT_CFG_SET_HIDDEN_MENU_ACCESS_CNF: + printf("*** TAPI_EVENT_CFG_SET_HIDDEN_MENU_ACCESS_CNF received : %x ****\n", eventType); + break; + case TAPI_EVENT_CFG_GET_CURRENT_CARRIER_CNF: + printf("*** TAPI_EVENT_CFG_GET_CURRENT_CARRIER_CNF received : %x ****\n", eventType); + break; + case TAPI_EVENT_CFG_SET_CURRENT_CARRIER_CNF: + printf("*** TAPI_EVENT_CFG_SET_CURRENT_CARRIER_CNF received : %x ****\n", eventType); + break; + case TAPI_EVENT_CFG_GET_SIO_MODE_CNF: + printf("*** TAPI_EVENT_CFG_GET_SIO_MODE_CNF received : %x ****\n", eventType); + break; + case TAPI_EVENT_CFG_SET_SIO_MODE_CNF: + printf("*** TAPI_EVENT_CFG_SET_SIO_MODE_CNF received : %x ****\n", eventType); + break; + case TAPI_EVENT_CFG_GET_ACTIVATION_DATE_CNF: + printf("*** TAPI_EVENT_CFG_GET_ACTIVATION_DATE_CNF received : %x ****\n", eventType); + break; + case TAPI_EVENT_CFG_GET_RECONDITIONED_DATE_CNF: + printf("*** TAPI_EVENT_CFG_GET_RECONDITIONED_DATE_CNF received : %x ****\n", eventType); + break; + case TAPI_EVENT_CFG_SET_TTY_MODE_CNF: + printf("*** TAPI_EVENT_CFG_SET_TTY_MODE_CNF received : %x ****\n", eventType); + break; + + case TAPI_EVENT_CFG_GET_TTY_MODE_CNF: + printf("*** TAPI_EVENT_CFG_GET_TTY_MODE_CNF received : %x ****\n", eventType); + break; + default: + printf("*** Default Event %x ****\n", eventType); + break; + + } + + break; + + default: + printf("*** Other TAPI EVENT received : class : %x ****\n", eventClass); + break; + } + +} + + +int gmain_loop_for_tapi_events(int delay) +{ + main_loop = g_main_loop_new (NULL, FALSE); + g_timeout_add (delay, TimeOutFun, NULL); + g_main_loop_run (main_loop); + + return 0; +} + +void print_all_subsciption_ids() +{ + int i=0; + for(i=0;i<7;i++) + { + printf("\n subscription_id[%d] has value %d \n",i,subscription_id[i]); + } +} + + +TapiResult_t register_all_events() +{ + TapiResult_t api_err = TAPI_API_SUCCESS; + + api_err = tel_register_event(TAPI_EVENT_CFG_GET_A_KEY_CNF, &subscription_id[0], app_cfg_callback); + + api_err = tel_register_event(TAPI_EVENT_CFG_VERIFY_A_KEY_CNF, &subscription_id[1], app_cfg_callback); + api_err = tel_register_event(TAPI_EVENT_CFG_GET_MSL_INFO_CNF, &subscription_id[2], app_cfg_callback); + api_err = tel_register_event(TAPI_EVENT_CFG_GET_VOCODER_OPTION_CNF, &subscription_id[3],app_cfg_callback); + api_err = tel_register_event(TAPI_EVENT_CFG_SET_VOCODER_OPTION_CNF, &subscription_id[4], app_cfg_callback); + api_err = tel_register_event(TAPI_EVENT_CFG_GET_HIDDEN_MENU_ACCESS_CNF, &subscription_id[5], app_cfg_callback); + api_err = tel_register_event(TAPI_EVENT_CFG_SET_HIDDEN_MENU_ACCESS_CNF, &subscription_id[6], app_cfg_callback); + api_err = tel_register_event(TAPI_EVENT_CFG_GET_CURRENT_CARRIER_CNF, &subscription_id[7], app_cfg_callback); + api_err = tel_register_event(TAPI_EVENT_CFG_SET_CURRENT_CARRIER_CNF, &subscription_id[8], app_cfg_callback); + api_err = tel_register_event(TAPI_EVENT_CFG_GET_SIO_MODE_CNF, &subscription_id[9], app_cfg_callback); + api_err = tel_register_event(TAPI_EVENT_CFG_SET_SIO_MODE_CNF, &subscription_id[10], app_cfg_callback); + api_err = tel_register_event(TAPI_EVENT_CFG_GET_ACTIVATION_DATE_CNF, &subscription_id[11], app_cfg_callback); + api_err = tel_register_event(TAPI_EVENT_CFG_GET_RECONDITIONED_DATE_CNF, &subscription_id[12], app_cfg_callback); + api_err = tel_register_event(TAPI_EVENT_CFG_SET_TTY_MODE_CNF, &subscription_id[13], app_cfg_callback); + api_err = tel_register_event(TAPI_EVENT_CFG_GET_TTY_MODE_CNF, &subscription_id[14], app_cfg_callback); + + print_all_subsciption_ids(); + return 0; +} + + + TapiResult_t deregister_all() +{ + int i ; + for(i=0 ;i<=14; i++) + { + tel_deregister_event(subscription_id[i]); + } + + return 0; + +} + + diff --git a/TC/telephony_TC/CFG/cfg_util.h b/TC/telephony_TC/CFG/cfg_util.h new file mode 100644 index 0000000..767dfb4 --- /dev/null +++ b/TC/telephony_TC/CFG/cfg_util.h @@ -0,0 +1,62 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * 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 _CFG_UTIL_H_ +#define _CFG_UTIL_H_ + + +#include +#include +#include +#include "string.h" +#include "assert.h" +#include +#include +#include +#include +#include +#include +#include +#include + + +#include +#include +#include "tet_macro.h" +#include +#include +#include +#include +#include "async_util.h" + + + +#define TIME_DELAY 5000 + +//extern void app_sound_callback (TelTapiEvent_t * TapiEvent); + +extern TapiResult_t register_all_events(); +extern TapiResult_t deregister_all(); +void print_all_subsciption_ids(); +extern int gmain_loop_for_tapi_events(int delay); +extern gboolean TimeOutFun (void *data); +void app_cfg_callback (TelTapiEvent_t * TapiEvent); + +#endif //_CFG_UTIL_H_ diff --git a/TC/telephony_TC/CFG/uts_tel_cfg_default_configuration.c b/TC/telephony_TC/CFG/uts_tel_cfg_default_configuration.c new file mode 100644 index 0000000..c892987 --- /dev/null +++ b/TC/telephony_TC/CFG/uts_tel_cfg_default_configuration.c @@ -0,0 +1,243 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +/** +* @ingroup TELEPHONY_API TelephonyAPI +* @addtogroup CONFIG Configuration +*/ + +/** +* @ingroup CONFIG Configuration +* @addtogroup UTS_CONFIG Unit +*/ + +/** +* @ingroup UTS_CONFIG +* @addtogroup UTS_TAPI_CFG_GET_TTY_MODE tel_set_cfg_default_configuration +* @brief Unit test cases for tel_set_cfg_default_configuration() +* @par Test function Prototype: +* TapiResult_t tel_set_cfg_default_configuration( int *pRequestID) +* @par Test function description: +* It requests to get tty(text telephone) mode.(CDMA only) +* @par Important Notes: +* None +* @param [out] pRequestId +* - Unique identifier for a particular request. +* - request_id value can be any value from 0 to 255 if the API is returned successfully +* - -1 (INVALID_REQUEST_ID) will be sent in case of failure. +* @par Async Response Message +* The event associated is TAPI_EVENT_CFG_GET_TTY_MODE_CNF +* @pre +* None +* @post +* None +* @return +* Return Type : (TapiResult_t) +* - TAPI_API_SUCCESS - indicating that the operation has completed successfully. +* - Refer TapiResult_t for failure and error code +* @{ +*/ + +/** +* @file uts_tel_set_cfg_default_configuration.c +* @brief This is a suite of unit test cases to test tel_set_cfg_default_configuration() API function +* @author Gautam Nand Sinha (gnand.sinha@samsung.com) +* @version Initial Creation V0.1 +* @date 2009.12.16 +*/ + + + +#include "uts_tel_set_cfg_default_configuration.h" + +/* Initialize TCM data structures */ +static void startup(); +static void cleanup(); +void (*tet_startup) () = startup; +void (*tet_cleanup) () = cleanup; + +struct tet_testlist tet_testlist[] = { + {utc_tel_set_cfg_default_configuration_000, 1}, + {utc_tel_set_cfg_default_configuration_001, 2}, + {utc_tel_set_cfg_default_configuration_002, 3}, + {utc_tel_set_cfg_default_configuration_003, 4}, + {utc_tel_set_cfg_default_configuration_004, 5}, + {utc_tel_set_cfg_default_configuration_005, 6}, + {NULL, 0} +}; + +/* Startup & Clean function : It is not test code, only for + initialize and finalize test module +*/ +static BOOL gStartupSuccess = FALSE; +static unsigned int subscription_id = 0; + +static void startup() +{ + + if(tel_init() != TAPI_API_SUCCESS) + { + printf("TelTapiInit() Failed \n") + } + register_all_events(); + + return; +} + +static void cleanup() +{ + deregister_all(); + tel_deinit(); + return; +} + + + +void utc_tel_set_cfg_default_configuration_000() +{ + + TapiResult_t ret_status = TAPI_API_SUCCESS; + int request_id=0; + gmain_loop_for_tapi_events(TIME_DELAY); + ret_status = tel_set_cfg_default_configuration(TAPI_CFG_DEFAULT_FULL); + gmain_loop_for_tapi_events(TIME_DELAY); + + if(ret_status == TAPI_API_SUCCESS) + { + tet_infoline("utc_tel_set_cfg_default_configuration_000 pass\n"); + tet_result(TET_PASS); + } + else + { + tet_infoline("utc_tel_set_cfg_default_configuration_000 has failed\n"); + tet_result(TET_FAIL); + } +} + + + +void utc_tel_set_cfg_default_configuration_001() +{ + + TapiResult_t ret_status = TAPI_API_SUCCESS; + int request_id=0; + gmain_loop_for_tapi_events(TIME_DELAY); + ret_status = tel_set_cfg_default_configuration(TAPI_CFG_DEFAULT_FACTORY); + gmain_loop_for_tapi_events(TIME_DELAY); + + if(ret_status == TAPI_API_SUCCESS) + { + tet_infoline("utc_tel_set_cfg_default_configuration_001 pass\n"); + tet_result(TET_PASS); + } + else + { + tet_infoline("utc_tel_set_cfg_default_configuration_001 has failed\n"); + tet_result(TET_FAIL); + } +} + +void utc_tel_set_cfg_default_configuration_002() +{ + + TapiResult_t ret_status = TAPI_API_SUCCESS; + int request_id=0; + gmain_loop_for_tapi_events(TIME_DELAY); + ret_status = tel_set_cfg_default_configuration( TAPI_CFG_DEFAULT_SERVICE); + gmain_loop_for_tapi_events(TIME_DELAY); + + if(ret_status == TAPI_API_SUCCESS) + { + tet_infoline("utc_tel_set_cfg_default_configuration_002 pass\n"); + tet_result(TET_PASS); + } + else + { + tet_infoline("utc_tel_set_cfg_default_configuration_002 has failed\n"); + tet_result(TET_FAIL); + } +} + +void utc_tel_set_cfg_default_configuration_003() +{ + + TapiResult_t ret_status = TAPI_API_SUCCESS; + int request_id=0; + gmain_loop_for_tapi_events(TIME_DELAY); + ret_status = tel_set_cfg_default_configuration( TAPI_CFG_DEFAULT_SERVICE); + gmain_loop_for_tapi_events(TIME_DELAY); + + if(ret_status == TAPI_API_SUCCESS) + { + tet_infoline("utc_tel_set_cfg_default_configuration_003 pass\n"); + tet_result(TET_PASS); + } + else + { + tet_infoline("utc_tel_set_cfg_default_configuration_003 has failed\n"); + tet_result(TET_FAIL); + } +} + +void utc_tel_set_cfg_default_configuration_004() +{ + + TapiResult_t ret_status = TAPI_API_SUCCESS; + int request_id=0; + gmain_loop_for_tapi_events(TIME_DELAY); + ret_status = tel_set_cfg_default_configuration( TAPI_CFG_DEFAULT_MODE_MAX); + gmain_loop_for_tapi_events(TIME_DELAY); + + if(ret_status == TAPI_API_SUCCESS) + { + tet_infoline("utc_tel_set_cfg_default_configuration_004 has failed\n"); + tet_result(TET_FAIL); + } + else + { + tet_infoline("utc_tel_set_cfg_default_configuration_004 has passed\n"); + tet_result(TET_PASS); + } +} + +void utc_tel_set_cfg_default_configuration_005() +{ + + TapiResult_t ret_status = TAPI_API_SUCCESS; + int request_id=0; + gmain_loop_for_tapi_events(TIME_DELAY); + ret_status = tel_set_cfg_default_configuration(-1); + gmain_loop_for_tapi_events(TIME_DELAY); + + if(ret_status == TAPI_API_SUCCESS) + { + tet_infoline("utc_tel_set_cfg_default_configuration_004 has failed\n"); + tet_result(TET_FAIL); + } + else + { + tet_infoline("utc_tel_set_cfg_default_configuration_004 has passed\n"); + tet_result(TET_PASS); + } +} + + +/** @} */ diff --git a/TC/telephony_TC/CFG/uts_tel_cfg_default_configuration.h b/TC/telephony_TC/CFG/uts_tel_cfg_default_configuration.h new file mode 100644 index 0000000..bb1c130 --- /dev/null +++ b/TC/telephony_TC/CFG/uts_tel_cfg_default_configuration.h @@ -0,0 +1,63 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * 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. + */ + + +/** +* @file uts_tel_set_cfg_default_configuration.h +* @brief This is the implementaion file for the test case of getting tty mode +* @author Gautam Nand Sinha (gnand.sinha@samsung.com) +* @version Initial Creation V0.1 +* @date 2009.12.16 +*/ + +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include "assert.h" +#include "glib.h" +#include "cfg_util.h" + +#include "TapiCommon.h" +//#include "tapi_utility.h" +#include +#include "string.h" + +#include "tet_tapi_util.h" + +#ifndef _UTS_TAPI_CFG_GET_TTY_MODE_H_ +#define _UTS_TAPI_CFG_GET_TTY_MODE_H_ + + static void utc_tel_set_cfg_default_configuration_000(); + static void utc_tel_set_cfg_default_configuration_001(); + static void utc_tel_set_cfg_default_configuration_002(); + static void utc_tel_set_cfg_default_configuration_003(); + static void utc_tel_set_cfg_default_configuration_004(); + static void utc_tel_set_cfg_default_configuration_005(); + + +#endif //_UTS_TAPI_CFG_GET_TTY_MODE_H_ + diff --git a/TC/telephony_TC/CFG/uts_tel_get_cfg_akey.c b/TC/telephony_TC/CFG/uts_tel_get_cfg_akey.c new file mode 100644 index 0000000..8fc9101 --- /dev/null +++ b/TC/telephony_TC/CFG/uts_tel_get_cfg_akey.c @@ -0,0 +1,159 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +/** +* @ingroup TELEPHONY_API TelephonyAPI +* @addtogroup CONFIG Configuration +*/ + +/** +* @ingroup CONFIG Configuration +* @addtogroup UTS_CONFIG Unit +*/ + +/** +* @ingroup UTS_CONFIG +* @addtogroup UTS_TAPI_CFG_GET_TTY_MODE tel_get_cfg_akey +* @brief Unit test cases for tel_get_cfg_akey() +* @par Test function Prototype: +* TapiResult_t tel_get_cfg_akey( int *pRequestID) +* @par Test function description: +* It requests to get tty(text telephone) mode.(CDMA only) +* @par Important Notes: +* None +* @param [out] pRequestId +* - Unique identifier for a particular request. +* - request_id value can be any value from 0 to 255 if the API is returned successfully +* - -1 (INVALID_REQUEST_ID) will be sent in case of failure. +* @par Async Response Message +* The event associated is TAPI_EVENT_CFG_GET_TTY_MODE_CNF +* @pre +* None +* @post +* None +* @return +* Return Type : (TapiResult_t) +* - TAPI_API_SUCCESS - indicating that the operation has completed successfully. +* - Refer TapiResult_t for failure and error code +* @{ +*/ + +/** +* @file uts_tel_get_cfg_akey.c +* @brief This is a suite of unit test cases to test tel_get_cfg_akey() API function +* @author Gautam Nand Sinha (gnand.sinha@samsung.com) +* @version Initial Creation V0.1 +* @date 2009.12.16 +*/ + + + +#include "uts_tel_get_cfg_akey.h" + +/* Initialize TCM data structures */ +static void startup(); +static void cleanup(); +void (*tet_startup) () = startup; +void (*tet_cleanup) () = cleanup; + +struct tet_testlist tet_testlist[] = { + {utc_tel_get_cfg_akey_000, 1}, + {utc_tel_get_cfg_akey_001, 2}, + {NULL, 0} +}; + +/* Startup & Clean function : It is not test code, only for + initialize and finalize test module +*/ +static BOOL gStartupSuccess = FALSE; +static unsigned int subscription_id = 0; + +static void startup() +{ + + if(tel_init() != TAPI_API_SUCCESS) + { + printf("TelTapiInit() Failed \n") + } + register_all_events(); + + return; +} + +static void cleanup() +{ + deregister_all(); + tel_deinit(); + return; +} + + + +void utc_tel_get_cfg_akey_000() +{ + + TapiResult_t ret_status = TAPI_API_SUCCESS; + int request_id=0; + gmain_loop_for_tapi_events(TIME_DELAY); + tel_set_cfg_default_configuration(TAPI_CFG_DEFAULT_FULL); + ret_status = tel_get_cfg_akey(); + gmain_loop_for_tapi_events(TIME_DELAY); + + if(ret_status == TAPI_API_SUCCESS) + { + tet_infoline("utc_tel_get_cfg_akey_000 pass\n"); + tet_result(TET_PASS); + } + else + { + tet_infoline("utc_tel_get_cfg_akey_000 has failed\n"); + tet_result(TET_FAIL); + } +} + + + +void utc_tel_get_cfg_akey_001() +{ + + TapiResult_t ret_status = TAPI_API_SUCCESS; + int request_id=0; + gmain_loop_for_tapi_events(TIME_DELAY); + ret_status = tel_get_cfg_akey(); + ret_status = tel_get_cfg_akey(); + ret_status = tel_get_cfg_akey(); + gmain_loop_for_tapi_events(TIME_DELAY); + + if(ret_status == TAPI_API_SUCCESS) + { + tet_infoline("utc_tel_get_cfg_akey_001 has failed\n"); + tet_result(TET_FAIL); + } + else + { + tet_infoline("utc_tel_get_cfg_akey_001 has passed\n"); + tet_result(TET_PASS); + } +} + + + +/** @} */ diff --git a/TC/telephony_TC/CFG/uts_tel_get_cfg_akey.h b/TC/telephony_TC/CFG/uts_tel_get_cfg_akey.h new file mode 100644 index 0000000..2382d13 --- /dev/null +++ b/TC/telephony_TC/CFG/uts_tel_get_cfg_akey.h @@ -0,0 +1,60 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * 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. + */ + + +/** +* @file uts_tel_set_cfg_default_configuration.h +* @brief This is the implementaion file for the test case of getting tty mode +* @author Gautam Nand Sinha (gnand.sinha@samsung.com) +* @version Initial Creation V0.1 +* @date 2009.12.16 +*/ + +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include "assert.h" +#include "glib.h" +#include "cfg_util.h" + +#include "TapiCommon.h" +//#include "tapi_utility.h" +#include +#include "string.h" + +#include "tet_tapi_util.h" + +#ifndef _UTS_TAPI_CFG_GET_TTY_MODE_H_ +#define _UTS_TAPI_CFG_GET_TTY_MODE_H_ + + static void utc_tel_get_cfg_akey_000(); + static void utc_tel_get_cfg_akey_001(); + + + +#endif //_UTS_TAPI_CFG_GET_TTY_MODE_H_ + diff --git a/TC/telephony_TC/CFG/uts_tel_get_cfg_hidden_menu_access.c b/TC/telephony_TC/CFG/uts_tel_get_cfg_hidden_menu_access.c new file mode 100644 index 0000000..56ae4b3 --- /dev/null +++ b/TC/telephony_TC/CFG/uts_tel_get_cfg_hidden_menu_access.c @@ -0,0 +1,182 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +/** +* @ingroup TELEPHONY_API TelephonyAPI +* @addtogroup CONFIG Configuration +*/ + +/** +* @ingroup CONFIG Configuration +* @addtogroup UTS_CONFIG Unit +*/ + +/** +* @ingroup UTS_CONFIG +* @addtogroup UTS_TAPI_CFG_GET_TTY_MODE tel_get_cfg_hidden_menu_access +* @brief Unit test cases for tel_get_cfg_hidden_menu_access() +* @par Test function Prototype: +* TapiResult_t tel_get_cfg_hidden_menu_access() +* @par Test function description: +* It requests to get tty(text telephone) mode.(CDMA only) +* @par Important Notes: +* None +* @param [out] pRequestId +* - Unique identifier for a particular request. +* - request_id value can be any value from 0 to 255 if the API is returned successfully +* - -1 (INVALID_REQUEST_ID) will be sent in case of failure. +* @par Async Response Message +* The event associated is TAPI_EVENT_CFG_GET_TTY_MODE_CNF +* @pre +* None +* @post +* None +* @return +* Return Type : (TapiResult_t) +* - TAPI_API_SUCCESS - indicating that the operation has completed successfully. +* - Refer TapiResult_t for failure and error code +* @{ +*/ + +/** +* @file uts_tel_get_cfg_hidden_menu_access.c +* @brief This is a suite of unit test cases to test tel_get_cfg_hidden_menu_access() API function +* @author Gautam Nand Sinha (gnand.sinha@samsung.com) +* @version Initial Creation V0.1 +* @date 2009.12.16 +*/ + + + +#include "uts_tel_get_cfg_hidden_menu_access.h" + +/* Initialize TCM data structures */ +static void startup(); +static void cleanup(); +void (*tet_startup) () = startup; +void (*tet_cleanup) () = cleanup; + +struct tet_testlist tet_testlist[] = { + {utc_tel_get_cfg_hidden_menu_access_000, 1}, + {utc_tel_get_cfg_hidden_menu_access_001, 2}, + {utc_tel_get_cfg_hidden_menu_access_002, 3}, + {NULL, 0} +}; + +/* Startup & Clean function : It is not test code, only for + initialize and finalize test module +*/ +static BOOL gStartupSuccess = FALSE; +static unsigned int subscription_id = 0; + +static void startup() +{ + + if(tel_init() != TAPI_API_SUCCESS) + { + printf("TelTapiInit() Failed \n") + } + register_all_events(); + + return; +} + +static void cleanup() +{ + deregister_all(); + tel_deinit(); + return; +} + + + +void utc_tel_get_cfg_hidden_menu_access_000() +{ + + TapiResult_t ret_status = TAPI_API_SUCCESS; + int request_id=0; + gmain_loop_for_tapi_events(TIME_DELAY); + + tel_set_cfg_hidden_menu_access(TAPI_CFG_HIDDEN_MENU_ENABLE); + ret_status = tel_get_cfg_hidden_menu_access(); + gmain_loop_for_tapi_events(TIME_DELAY); + + if(ret_status == TAPI_API_SUCCESS) + { + tet_infoline("utc_tel_get_cfg_hidden_menu_access_000 pass\n"); + tet_result(TET_PASS); + } + else + { + tet_infoline("utc_tel_get_cfg_hidden_menu_access_000 has failed\n"); + tet_result(TET_FAIL); + } +} + + + +void utc_tel_get_cfg_hidden_menu_access_001() +{ + + TapiResult_t ret_status = TAPI_API_SUCCESS; + int request_id=0; + gmain_loop_for_tapi_events(TIME_DELAY); + tel_set_cfg_hidden_menu_access(TAPI_CFG_HIDDEN_MENU_DISABLE); + ret_status = tel_get_cfg_hidden_menu_access(); + gmain_loop_for_tapi_events(TIME_DELAY); + + if(ret_status == TAPI_API_SUCCESS) + { + tet_infoline("utc_tel_get_cfg_hidden_menu_access_001 pass\n"); + tet_result(TET_PASS); + } + else + { + tet_infoline("utc_tel_get_cfg_hidden_menu_access_001 has failed\n"); + tet_result(TET_FAIL); + } +} + +void utc_tel_get_cfg_hidden_menu_access_002() +{ + + TapiResult_t ret_status = TAPI_API_SUCCESS; + int request_id=0; + gmain_loop_for_tapi_events(TIME_DELAY); + + tel_set_cfg_hidden_menu_access(-1); + ret_status = tel_get_cfg_hidden_menu_access(); + gmain_loop_for_tapi_events(TIME_DELAY); + + if(ret_status == TAPI_API_SUCCESS) + { + tet_infoline("utc_tel_get_cfg_hidden_menu_access_002 has failed\n"); + tet_result(TET_FAIL); + } + else + { + tet_infoline("utc_tel_get_cfg_hidden_menu_access_002 has passed\n"); + tet_result(TET_PASS); + } +} + + +/** @} */ diff --git a/TC/telephony_TC/CFG/uts_tel_get_cfg_hidden_menu_access.h b/TC/telephony_TC/CFG/uts_tel_get_cfg_hidden_menu_access.h new file mode 100644 index 0000000..eaea1a4 --- /dev/null +++ b/TC/telephony_TC/CFG/uts_tel_get_cfg_hidden_menu_access.h @@ -0,0 +1,61 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * 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. + */ + + +/** +* @file uts_tel_get_cfg_vocoder_option.h +* @brief This is the implementaion file for the test case of getting tty mode +* @author Gautam Nand Sinha (gnand.sinha@samsung.com) +* @version Initial Creation V0.1 +* @date 2009.12.16 +*/ + +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include "assert.h" +#include "glib.h" +#include "cfg_util.h" + +#include "TapiCommon.h" +//#include "tapi_utility.h" +#include +#include "string.h" + +#include "tet_tapi_util.h" + +#ifndef _UTS_TEL_GET_CFG_HIDDEN_MENU_ACCESS_H_ +#define _UTS_TEL_GET_CFG_HIDDEN_MENU_ACCESS_H_ + + static void utc_tel_get_cfg_hidden_menu_access_000(); + static void utc_tel_get_cfg_hidden_menu_access_001(); + static void utc_tel_get_cfg_hidden_menu_access_002(); + + + +#endif //_UTS_TEL_GET_CFG_HIDDEN_MENU_ACCESS_H_ + diff --git a/TC/telephony_TC/CFG/uts_tel_get_cfg_msl_info.c b/TC/telephony_TC/CFG/uts_tel_get_cfg_msl_info.c new file mode 100644 index 0000000..a988594 --- /dev/null +++ b/TC/telephony_TC/CFG/uts_tel_get_cfg_msl_info.c @@ -0,0 +1,159 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +/** +* @ingroup TELEPHONY_API TelephonyAPI +* @addtogroup CONFIG Configuration +*/ + +/** +* @ingroup CONFIG Configuration +* @addtogroup UTS_CONFIG Unit +*/ + +/** +* @ingroup UTS_CONFIG +* @addtogroup UTS_TAPI_CFG_GET_TTY_MODE tel_get_cfg_msl_info +* @brief Unit test cases for tel_get_cfg_msl_info() +* @par Test function Prototype: +* TapiResult_t tel_get_cfg_msl_info( int *pRequestID) +* @par Test function description: +* It requests to get tty(text telephone) mode.(CDMA only) +* @par Important Notes: +* None +* @param [out] pRequestId +* - Unique identifier for a particular request. +* - request_id value can be any value from 0 to 255 if the API is returned successfully +* - -1 (INVALID_REQUEST_ID) will be sent in case of failure. +* @par Async Response Message +* The event associated is TAPI_EVENT_CFG_GET_TTY_MODE_CNF +* @pre +* None +* @post +* None +* @return +* Return Type : (TapiResult_t) +* - TAPI_API_SUCCESS - indicating that the operation has completed successfully. +* - Refer TapiResult_t for failure and error code +* @{ +*/ + +/** +* @file uts_tel_get_cfg_msl_info.c +* @brief This is a suite of unit test cases to test tel_get_cfg_msl_info() API function +* @author Gautam Nand Sinha (gnand.sinha@samsung.com) +* @version Initial Creation V0.1 +* @date 2009.12.16 +*/ + + + +#include "uts_tel_get_cfg_msl_info.h" + +/* Initialize TCM data structures */ +static void startup(); +static void cleanup(); +void (*tet_startup) () = startup; +void (*tet_cleanup) () = cleanup; + +struct tet_testlist tet_testlist[] = { + {utc_tel_get_cfg_msl_info_000, 1}, + {utc_tel_get_cfg_msl_info_001, 2}, + {NULL, 0} +}; + +/* Startup & Clean function : It is not test code, only for + initialize and finalize test module +*/ +static BOOL gStartupSuccess = FALSE; +static unsigned int subscription_id = 0; + +static void startup() +{ + + if(tel_init() != TAPI_API_SUCCESS) + { + printf("TelTapiInit() Failed \n") + } + register_all_events(); + + return; +} + +static void cleanup() +{ + deregister_all(); + tel_deinit(); + return; +} + + + +void utc_tel_get_cfg_msl_info_000() +{ + + TapiResult_t ret_status = TAPI_API_SUCCESS; + int request_id=0; + gmain_loop_for_tapi_events(TIME_DELAY); + tel_set_cfg_default_configuration(TAPI_CFG_DEFAULT_FULL); + ret_status = tel_get_cfg_msl_info(); + gmain_loop_for_tapi_events(TIME_DELAY); + + if(ret_status == TAPI_API_SUCCESS) + { + tet_infoline("utc_tel_get_cfg_msl_info_000 pass\n"); + tet_result(TET_PASS); + } + else + { + tet_infoline("utc_tel_get_cfg_msl_info_000 has failed\n"); + tet_result(TET_FAIL); + } +} + + + +void utc_tel_get_cfg_msl_info_001() +{ + + TapiResult_t ret_status = TAPI_API_SUCCESS; + int request_id=0; + gmain_loop_for_tapi_events(TIME_DELAY); + ret_status = tel_get_cfg_msl_info(); + ret_status = tel_get_cfg_msl_info(); + ret_status = tel_get_cfg_msl_info(); + gmain_loop_for_tapi_events(TIME_DELAY); + + if(ret_status == TAPI_API_SUCCESS) + { + tet_infoline("utc_tel_get_cfg_msl_info_001 has failed\n"); + tet_result(TET_FAIL); + } + else + { + tet_infoline("utc_tel_get_cfg_msl_info_001 has passed\n"); + tet_result(TET_PASS); + } +} + + + +/** @} */ diff --git a/TC/telephony_TC/CFG/uts_tel_get_cfg_msl_info.h b/TC/telephony_TC/CFG/uts_tel_get_cfg_msl_info.h new file mode 100644 index 0000000..2626e1d --- /dev/null +++ b/TC/telephony_TC/CFG/uts_tel_get_cfg_msl_info.h @@ -0,0 +1,60 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * 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. + */ + + +/** +* @file uts_tel_get_cfg_msl_info.h +* @brief This is the implementaion file for the test case of getting tty mode +* @author Gautam Nand Sinha (gnand.sinha@samsung.com) +* @version Initial Creation V0.1 +* @date 2009.12.16 +*/ + +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include "assert.h" +#include "glib.h" +#include "cfg_util.h" + +#include "TapiCommon.h" +//#include "tapi_utility.h" +#include +#include "string.h" + +#include "tet_tapi_util.h" + +#ifndef _UTS_TAPI_GET_CFG_TMSL_INFO_H_ +#define _UTS_TAPI_GET_CFG_TMSL_INFO_H_ + + static void utc_tel_get_cfg_msl_info_000(); + static void utc_tel_get_cfg_msl_info_001(); + + + +#endif //_UTS_TAPI_GET_CFG_TMSL_INFO_H_ + diff --git a/TC/telephony_TC/CFG/uts_tel_get_cfg_serving_carrier.c b/TC/telephony_TC/CFG/uts_tel_get_cfg_serving_carrier.c new file mode 100644 index 0000000..cfeefe8 --- /dev/null +++ b/TC/telephony_TC/CFG/uts_tel_get_cfg_serving_carrier.c @@ -0,0 +1,422 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +/** +* @ingroup TELEPHONY_API TelephonyAPI +* @addtogroup CONFIG Configuration +*/ + +/** +* @ingroup CONFIG Configuration +* @addtogroup UTS_CONFIG Unit +*/ + +/** +* @ingroup UTS_CONFIG +* @addtogroup UTS_TAPI_CFG_set_TTY_MODE tel_get_cfg_serving_carrier +* @brief Unit test cases for tel_get_cfg_serving_carrier() +* @par Test function Prototype: +* TapiResult_t tel_get_cfg_serving_carrier( int *pRequestID) +* @par Test function description: +* It requests to set tty(text telephone) mode.(CDMA only) +* @par Important Notes: +* None +* @param [out] pRequestId +* - Unique identifier for a particular request. +* - request_id value can be any value from 0 to 255 if the API is returned successfully +* - -1 (INVALID_REQUEST_ID) will be sent in case of failure. +* @par Async Response Message +* The event associated is TAPI_EVENT_CFG_set_TTY_MODE_CNF +* @pre +* None +* @post +* None +* @return +* Return Type : (TapiResult_t) +* - TAPI_API_SUCCESS - indicating that the operation has completed successfully. +* - Refer TapiResult_t for failure and error code +* @{ +*/ + +/** +* @file uts_tel_get_cfg_serving_carrier.c +* @brief This is a suite of unit test cases to test tel_get_cfg_serving_carrier() API function +* @author Gautam Nand Sinha (gnand.sinha@samsung.com) +* @version Initial Creation V0.1 +* @date 2009.12.16 +*/ + + + +#include "uts_tel_get_cfg_serving_carrier.h" + +/* Initialize TCM data structures */ +static void startup(); +static void cleanup(); +void (*tet_startup) () = startup; +void (*tet_cleanup) () = cleanup; + +struct tet_testlist tet_testlist[] = { + {utc_tel_get_cfg_serving_carrier_000, 1}, + {utc_tel_get_cfg_serving_carrier_001, 2}, + {utc_tel_get_cfg_serving_carrier_002, 3}, + {utc_tel_get_cfg_serving_carrier_003, 4}, + {utc_tel_get_cfg_serving_carrier_004, 5}, + {utc_tel_get_cfg_serving_carrier_005, 6}, + {utc_tel_get_cfg_serving_carrier_006, 7}, + {utc_tel_get_cfg_serving_carrier_007, 8}, + {utc_tel_get_cfg_serving_carrier_008, 9}, + {utc_tel_get_cfg_serving_carrier_009, 10}, + {utc_tel_get_cfg_serving_carrier_010, 11}, + {utc_tel_get_cfg_serving_carrier_011, 12}, + {utc_tel_get_cfg_serving_carrier_012, 13}, + {NULL, 0} +}; + +/* Startup & Clean function : It is not test code, only for + initialize and finalize test module +*/ +static BOOL gStartupSuccess = FALSE; +static unsigned int subscription_id = 0; + +static void startup() +{ + + if(tel_init() != TAPI_API_SUCCESS) + { + printf("TelTapiInit() Failed \n") + } + register_all_events(); + + return; +} + +static void cleanup() +{ + deregister_all(); + tel_deinit(); + return; +} + + + +void utc_tel_get_cfg_serving_carrier_000() +{ + + TapiResult_t ret_status = TAPI_API_SUCCESS; + int request_id=0; + gmain_loop_for_tapi_events(TIME_DELAY); + tel_set_cfg_serving_carrier(TAPI_CFG_CARRIER_TEST); + ret_status = tel_get_cfg_serving_carrier(); + gmain_loop_for_tapi_events(TIME_DELAY); + + if(ret_status == TAPI_API_SUCCESS) + { + tet_infoline("utc_tel_get_cfg_serving_carrier_000 pass\n"); + tet_result(TET_PASS); + } + else + { + tet_infoline("utc_tel_get_cfg_serving_carrier_000 has failed\n"); + tet_result(TET_FAIL); + } +} + + + +void utc_tel_get_cfg_serving_carrier_001() +{ + + TapiResult_t ret_status = TAPI_API_SUCCESS; + int request_id=0; + gmain_loop_for_tapi_events(TIME_DELAY); + tel_set_cfg_serving_carrier( TAPI_CFG_CARRIER_SKT); + ret_status = tel_get_cfg_serving_carrier(); + + gmain_loop_for_tapi_events(TIME_DELAY); + + if(ret_status == TAPI_API_SUCCESS) + { + tet_infoline("utc_tel_get_cfg_serving_carrier_001 pass\n"); + tet_result(TET_PASS); + } + else + { + tet_infoline("utc_tel_get_cfg_serving_carrier_001 has failed\n"); + tet_result(TET_FAIL); + } +} + +void utc_tel_get_cfg_serving_carrier_002() +{ + + TapiResult_t ret_status = TAPI_API_SUCCESS; + int request_id=0; + gmain_loop_for_tapi_events(TIME_DELAY); + tel_set_cfg_serving_carrier(TAPI_CFG_CARRIER_KTF); + ret_status = tel_get_cfg_serving_carrier(); + + gmain_loop_for_tapi_events(TIME_DELAY); + + if(ret_status == TAPI_API_SUCCESS) + { + tet_infoline("utc_tel_get_cfg_serving_carrier_002 pass\n"); + tet_result(TET_PASS); + } + else + { + tet_infoline("utc_tel_get_cfg_serving_carrier_002 has failed\n"); + tet_result(TET_FAIL); + } +} + +void utc_tel_get_cfg_serving_carrier_003() +{ + + TapiResult_t ret_status = TAPI_API_SUCCESS; + int request_id=0; + gmain_loop_for_tapi_events(TIME_DELAY); + tel_set_cfg_serving_carrier( TAPI_CFG_CARRIER_LGT); + ret_status = tel_get_cfg_serving_carrier(); + + gmain_loop_for_tapi_events(TIME_DELAY); + + if(ret_status == TAPI_API_SUCCESS) + { + tet_infoline("utc_tel_get_cfg_serving_carrier_003 pass\n"); + tet_result(TET_PASS); + } + else + { + tet_infoline("utc_tel_get_cfg_serving_carrier_003 has failed\n"); + tet_result(TET_FAIL); + } +} + +void utc_tel_get_cfg_serving_carrier_004() +{ + + TapiResult_t ret_status = TAPI_API_SUCCESS; + int request_id=0; + gmain_loop_for_tapi_events(TIME_DELAY); + tel_set_cfg_serving_carrier( TAPI_CFG_CARRIER_VERIZON); + ret_status = tel_get_cfg_serving_carrier(); + + gmain_loop_for_tapi_events(TIME_DELAY); + + if(ret_status == TAPI_API_SUCCESS) + { + tet_infoline("utc_tel_get_cfg_serving_carrier_004 pass\n"); + tet_result(TET_PASS); + } + else + { + tet_infoline("utc_tel_get_cfg_serving_carrier_004 has failed\n"); + tet_result(TET_FAIL); + } +} + +void utc_tel_get_cfg_serving_carrier_005() +{ + + TapiResult_t ret_status = TAPI_API_SUCCESS; + int request_id=0; + gmain_loop_for_tapi_events(TIME_DELAY); + tel_set_cfg_serving_carrier( TAPI_CFG_CARRIER_SPRINT); + ret_status = tel_get_cfg_serving_carrier(); + + gmain_loop_for_tapi_events(TIME_DELAY); + + if(ret_status == TAPI_API_SUCCESS) + { + tet_infoline("utc_tel_get_cfg_serving_carrier_005 pass\n"); + tet_result(TET_PASS); + } + else + { + tet_infoline("utc_tel_get_cfg_serving_carrier_005 has failed\n"); + tet_result(TET_FAIL); + } +} + +void utc_tel_get_cfg_serving_carrier_006() +{ + + TapiResult_t ret_status = TAPI_API_SUCCESS; + int request_id=0; + gmain_loop_for_tapi_events(TIME_DELAY); + tel_set_cfg_serving_carrier( TAPI_CFG_CARRIER_ALLTEL); + ret_status = tel_get_cfg_serving_carrier(); + + gmain_loop_for_tapi_events(TIME_DELAY); + + if(ret_status == TAPI_API_SUCCESS) + { + tet_infoline("utc_tel_get_cfg_serving_carrier_006 pass\n"); + tet_result(TET_PASS); + } + else + { + tet_infoline("utc_tel_get_cfg_serving_carrier_006 has failed\n"); + tet_result(TET_FAIL); + } +} + +void utc_tel_get_cfg_serving_carrier_007() +{ + + TapiResult_t ret_status = TAPI_API_SUCCESS; + int request_id=0; + gmain_loop_for_tapi_events(TIME_DELAY); + tel_set_cfg_serving_carrier( TAPI_CFG_CARRIER_TELUS); + ret_status = tel_get_cfg_serving_carrier(); + + gmain_loop_for_tapi_events(TIME_DELAY); + + if(ret_status == TAPI_API_SUCCESS) + { + tet_infoline("utc_tel_get_cfg_serving_carrier_007 pass\n"); + tet_result(TET_PASS); + } + else + { + tet_infoline("utc_tel_get_cfg_serving_carrier_007 has failed\n"); + tet_result(TET_FAIL); + } +} + +void utc_tel_get_cfg_serving_carrier_008() +{ + + TapiResult_t ret_status = TAPI_API_SUCCESS; + int request_id=0; + gmain_loop_for_tapi_events(TIME_DELAY); + tel_set_cfg_serving_carrier(TAPI_CFG_CARRIER_BMC); + ret_status = tel_get_cfg_serving_carrier(); + + gmain_loop_for_tapi_events(TIME_DELAY); + + if(ret_status == TAPI_API_SUCCESS) + { + tet_infoline("utc_tel_get_cfg_serving_carrier_008 pass\n"); + tet_result(TET_PASS); + } + else + { + tet_infoline("utc_tel_get_cfg_serving_carrier_008 has failed\n"); + tet_result(TET_FAIL); + } +} + +void utc_tel_get_cfg_serving_carrier_009() +{ + + TapiResult_t ret_status = TAPI_API_SUCCESS; + int request_id=0; + gmain_loop_for_tapi_events(TIME_DELAY); + tel_set_cfg_serving_carrier( TAPI_CFG_CARRIER_ALIANT); + ret_status = tel_get_cfg_serving_carrier(); + + gmain_loop_for_tapi_events(TIME_DELAY); + + if(ret_status == TAPI_API_SUCCESS) + { + tet_infoline("utc_tel_get_cfg_serving_carrier_009 pass\n"); + tet_result(TET_PASS); + } + else + { + tet_infoline("utc_tel_get_cfg_serving_carrier_009 has failed\n"); + tet_result(TET_FAIL); + } +} + +void utc_tel_get_cfg_serving_carrier_010() +{ + + TapiResult_t ret_status = TAPI_API_SUCCESS; + int request_id=0; + gmain_loop_for_tapi_events(TIME_DELAY); + tel_set_cfg_serving_carrier( TAPI_CFG_CARRIER_SASKTEL); + ret_status = tel_get_cfg_serving_carrier(); + + gmain_loop_for_tapi_events(TIME_DELAY); + + if(ret_status == TAPI_API_SUCCESS) + { + tet_infoline("utc_tel_get_cfg_serving_carrier_010 pass\n"); + tet_result(TET_PASS); + } + else + { + tet_infoline("utc_tel_get_cfg_serving_carrier_010 has failed\n"); + tet_result(TET_FAIL); + } +} + +void utc_tel_get_cfg_serving_carrier_011() +{ + + TapiResult_t ret_status = TAPI_API_SUCCESS; + int request_id=0; + gmain_loop_for_tapi_events(TIME_DELAY); + tel_set_cfg_serving_carrier( TAPI_CFG_CARRIER_MTS); + ret_status = tel_get_cfg_serving_carrier(); + + gmain_loop_for_tapi_events(TIME_DELAY); + + if(ret_status == TAPI_API_SUCCESS) + { + tet_infoline("utc_tel_get_cfg_serving_carrier_011 pass\n"); + tet_result(TET_PASS); + } + else + { + tet_infoline("utc_tel_get_cfg_serving_carrier_011 has failed\n"); + tet_result(TET_FAIL); + } +} + +void utc_tel_get_cfg_serving_carrier_012() +{ + + TapiResult_t ret_status = TAPI_API_SUCCESS; + int request_id=0; + gmain_loop_for_tapi_events(TIME_DELAY); + tel_set_cfg_serving_carrier(-1); + ret_status = tel_get_cfg_serving_carrier(); + + gmain_loop_for_tapi_events(TIME_DELAY); + + if(ret_status == TAPI_API_SUCCESS) + { + tet_infoline("utc_tel_get_cfg_serving_carrier_012 has failed\n"); + tet_result(TET_FAIL); + } + else + { + tet_infoline("utc_tel_get_cfg_serving_carrier_012 has passed\n"); + tet_result(TET_PASS); + } +} + + +/** @} */ diff --git a/TC/telephony_TC/CFG/uts_tel_get_cfg_serving_carrier.h b/TC/telephony_TC/CFG/uts_tel_get_cfg_serving_carrier.h new file mode 100644 index 0000000..83ac180 --- /dev/null +++ b/TC/telephony_TC/CFG/uts_tel_get_cfg_serving_carrier.h @@ -0,0 +1,71 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * 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. + */ + + +/** +* @file uts_tel_get_cfg_serving_carrier.h +* @brief This is the implementaion file for the test case of setting tty mode +* @author Gautam Nand Sinha (gnand.sinha@samsung.com) +* @version Initial Creation V0.1 +* @date 2009.12.16 +*/ + +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include "assert.h" +#include "glib.h" +#include "cfg_util.h" + +#include "TapiCommon.h" +//#include "tapi_utility.h" +#include +#include "string.h" + +#include "tet_tapi_util.h" + +#ifndef _UTS_TEL_GET_CFG_SERVING_CARRIER_H_ +#define _UTS_TEL_GET_CFG_SERVING_CARRIER_H_ + + static void utc_tel_get_cfg_serving_carrier_000(); + static void utc_tel_get_cfg_serving_carrier_001(); + static void utc_tel_get_cfg_serving_carrier_002(); + static void utc_tel_get_cfg_serving_carrier_003(); + static void utc_tel_get_cfg_serving_carrier_004(); + static void utc_tel_get_cfg_serving_carrier_005(); + static void utc_tel_get_cfg_serving_carrier_006(); + static void utc_tel_get_cfg_serving_carrier_007(); + static void utc_tel_get_cfg_serving_carrier_008(); + static void utc_tel_get_cfg_serving_carrier_009(); + static void utc_tel_get_cfg_serving_carrier_010(); + static void utc_tel_get_cfg_serving_carrier_011(); + static void utc_tel_get_cfg_serving_carrier_012(); + + + +#endif //_UTS_TEL_GET_CFG_SERVING_CARRIER_H_ + diff --git a/TC/telephony_TC/CFG/uts_tel_get_cfg_vocoder_option.c b/TC/telephony_TC/CFG/uts_tel_get_cfg_vocoder_option.c new file mode 100644 index 0000000..7e8f744 --- /dev/null +++ b/TC/telephony_TC/CFG/uts_tel_get_cfg_vocoder_option.c @@ -0,0 +1,226 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +/** +* @ingroup TELEPHONY_API TelephonyAPI +* @addtogroup CONFIG Configuration +*/ + +/** +* @ingroup CONFIG Configuration +* @addtogroup UTS_CONFIG Unit +*/ + +/** +* @ingroup UTS_CONFIG +* @addtogroup UTS_TAPI_CFG_GET_TTY_MODE tel_get_cfg_vocoder_option +* @brief Unit test cases for tel_get_cfg_vocoder_option() +* @par Test function Prototype: +* TapiResult_t tel_get_cfg_vocoder_option( int *pRequestID) +* @par Test function description: +* It requests to get tty(text telephone) mode.(CDMA only) +* @par Important Notes: +* None +* @param [out] pRequestId +* - Unique identifier for a particular request. +* - request_id value can be any value from 0 to 255 if the API is returned successfully +* - -1 (INVALID_REQUEST_ID) will be sent in case of failure. +* @par Async Response Message +* The event associated is TAPI_EVENT_CFG_GET_TTY_MODE_CNF +* @pre +* None +* @post +* None +* @return +* Return Type : (TapiResult_t) +* - TAPI_API_SUCCESS - indicating that the operation has completed successfully. +* - Refer TapiResult_t for failure and error code +* @{ +*/ + +/** +* @file uts_tel_get_cfg_vocoder_option.c +* @brief This is a suite of unit test cases to test tel_get_cfg_vocoder_option() API function +* @author Gautam Nand Sinha (gnand.sinha@samsung.com) +* @version Initial Creation V0.1 +* @date 2009.12.16 +*/ + + + +#include "uts_tel_get_cfg_vocoder_option.h" + +/* Initialize TCM data structures */ +static void startup(); +static void cleanup(); +void (*tet_startup) () = startup; +void (*tet_cleanup) () = cleanup; + +struct tet_testlist tet_testlist[] = { + {utc_tel_get_cfg_vocoder_option_000, 1}, + {utc_tel_get_cfg_vocoder_option_001, 2}, + {utc_tel_get_cfg_vocoder_option_002, 3}, + {utc_tel_get_cfg_vocoder_option_003, 4}, + {utc_tel_get_cfg_vocoder_option_004, 5}, + {NULL, 0} +}; + +/* Startup & Clean function : It is not test code, only for + initialize and finalize test module +*/ +static BOOL gStartupSuccess = FALSE; +static unsigned int subscription_id = 0; + +static void startup() +{ + + if(tel_init() != TAPI_API_SUCCESS) + { + printf("TelTapiInit() Failed \n") + } + register_all_events(); + + return; +} + +static void cleanup() +{ + deregister_all(); + tel_deinit(); + return; +} + + + +void utc_tel_get_cfg_vocoder_option_000() +{ + + TapiResult_t ret_status = TAPI_API_SUCCESS; + int request_id=0; + gmain_loop_for_tapi_events(TIME_DELAY); + tel_set_cfg_vocoder_option( TAPI_CFG_VOC_OPTION_DEFAULT); + ret_status = tel_get_cfg_vocoder_option(); + gmain_loop_for_tapi_events(TIME_DELAY); + + if(ret_status == TAPI_API_SUCCESS) + { + tet_infoline("utc_tel_get_cfg_vocoder_option_000 pass\n"); + tet_result(TET_PASS); + } + else + { + tet_infoline("utc_tel_get_cfg_vocoder_option_000 has failed\n"); + tet_result(TET_FAIL); + } +} + + + +void utc_tel_get_cfg_vocoder_option_001() +{ + + TapiResult_t ret_status = TAPI_API_SUCCESS; + int request_id=0; + gmain_loop_for_tapi_events(TIME_DELAY); + tel_set_cfg_vocoder_option( TAPI_CFG_VOC_OPTION_EVRC); + ret_status = tel_get_cfg_vocoder_option(); + gmain_loop_for_tapi_events(TIME_DELAY); + + if(ret_status == TAPI_API_SUCCESS) + { + tet_infoline("utc_tel_get_cfg_vocoder_option_001 pass\n"); + tet_result(TET_PASS); + } + else + { + tet_infoline("utc_tel_get_cfg_vocoder_option_001 has failed\n"); + tet_result(TET_FAIL); + } +} + +void utc_tel_get_cfg_vocoder_option_002() +{ + + TapiResult_t ret_status = TAPI_API_SUCCESS; + int request_id=0; + gmain_loop_for_tapi_events(TIME_DELAY); + tel_set_cfg_vocoder_option( TAPI_CFG_VOC_OPTION_13K); + ret_status = tel_get_cfg_vocoder_option(); + gmain_loop_for_tapi_events(TIME_DELAY); + + if(ret_status == TAPI_API_SUCCESS) + { + tet_infoline("utc_tel_get_cfg_vocoder_option_002 pass\n"); + tet_result(TET_PASS); + } + else + { + tet_infoline("utc_tel_get_cfg_vocoder_option_002 has failed\n"); + tet_result(TET_FAIL); + } +} + +void utc_tel_get_cfg_vocoder_option_003() +{ + + TapiResult_t ret_status = TAPI_API_SUCCESS; + int request_id=0; + gmain_loop_for_tapi_events(TIME_DELAY); + tel_set_cfg_vocoder_option( TAPI_CFG_VOC_OPTION_8K); + ret_status = tel_get_cfg_vocoder_option(); + gmain_loop_for_tapi_events(TIME_DELAY); + + if(ret_status == TAPI_API_SUCCESS) + { + tet_infoline("utc_tel_get_cfg_vocoder_option_003 pass\n"); + tet_result(TET_PASS); + } + else + { + tet_infoline("utc_tel_get_cfg_vocoder_option_003 has failed\n"); + tet_result(TET_FAIL); + } +} + +void utc_tel_get_cfg_vocoder_option_004() +{ + + TapiResult_t ret_status = TAPI_API_SUCCESS; + int request_id=0; + gmain_loop_for_tapi_events(TIME_DELAY); + tel_set_cfg_vocoder_option( -1); + ret_status = tel_get_cfg_vocoder_option(); + gmain_loop_for_tapi_events(TIME_DELAY); + + if(ret_status == TAPI_API_SUCCESS) + { + tet_infoline("utc_tel_get_cfg_vocoder_option_004 has failed\n"); + tet_result(TET_FAIL); + } + else + { + tet_infoline("utc_tel_get_cfg_vocoder_option_004 has passed\n"); + tet_result(TET_FAIL); + } +} + + +/** @} */ diff --git a/TC/telephony_TC/CFG/uts_tel_get_cfg_vocoder_option.h b/TC/telephony_TC/CFG/uts_tel_get_cfg_vocoder_option.h new file mode 100644 index 0000000..6645d61 --- /dev/null +++ b/TC/telephony_TC/CFG/uts_tel_get_cfg_vocoder_option.h @@ -0,0 +1,63 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * 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. + */ + + +/** +* @file uts_tel_get_cfg_vocoder_option.h +* @brief This is the implementaion file for the test case of getting tty mode +* @author Gautam Nand Sinha (gnand.sinha@samsung.com) +* @version Initial Creation V0.1 +* @date 2009.12.16 +*/ + +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include "assert.h" +#include "glib.h" +#include "cfg_util.h" + +#include "TapiCommon.h" +//#include "tapi_utility.h" +#include +#include "string.h" + +#include "tet_tapi_util.h" + +#ifndef _UTS_TAPI_GET_CFG_TMSL_INFO_H_ +#define _UTS_TAPI_GET_CFG_TMSL_INFO_H_ + + static void utc_tel_get_cfg_vocoder_option_000(); + static void utc_tel_get_cfg_vocoder_option_001(); + static void utc_tel_get_cfg_vocoder_option_002(); + static void utc_tel_get_cfg_vocoder_option_003(); + static void utc_tel_get_cfg_vocoder_option_004(); + + + +#endif //_UTS_TAPI_GET_CFG_TMSL_INFO_H_ + diff --git a/TC/telephony_TC/CFG/uts_tel_set_cfg_hidden_menu_access.c b/TC/telephony_TC/CFG/uts_tel_set_cfg_hidden_menu_access.c new file mode 100644 index 0000000..6471897 --- /dev/null +++ b/TC/telephony_TC/CFG/uts_tel_set_cfg_hidden_menu_access.c @@ -0,0 +1,179 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +/** +* @ingroup TELEPHONY_API TelephonyAPI +* @addtogroup CONFIG Configuration +*/ + +/** +* @ingroup CONFIG Configuration +* @addtogroup UTS_CONFIG Unit +*/ + +/** +* @ingroup UTS_CONFIG +* @addtogroup UTS_TAPI_CFG_GET_TTY_MODE tel_set_cfg_hidden_menu_access +* @brief Unit test cases for tel_set_cfg_hidden_menu_access() +* @par Test function Prototype: +* TapiResult_t tel_set_cfg_hidden_menu_access( int *pRequestID) +* @par Test function description: +* It requests to get tty(text telephone) mode.(CDMA only) +* @par Important Notes: +* None +* @param [out] pRequestId +* - Unique identifier for a particular request. +* - request_id value can be any value from 0 to 255 if the API is returned successfully +* - -1 (INVALID_REQUEST_ID) will be sent in case of failure. +* @par Async Response Message +* The event associated is TAPI_EVENT_CFG_GET_TTY_MODE_CNF +* @pre +* None +* @post +* None +* @return +* Return Type : (TapiResult_t) +* - TAPI_API_SUCCESS - indicating that the operation has completed successfully. +* - Refer TapiResult_t for failure and error code +* @{ +*/ + +/** +* @file uts_tel_set_cfg_hidden_menu_access.c +* @brief This is a suite of unit test cases to test tel_set_cfg_hidden_menu_access() API function +* @author Gautam Nand Sinha (gnand.sinha@samsung.com) +* @version Initial Creation V0.1 +* @date 2009.12.16 +*/ + + + +#include "uts_tel_set_cfg_hidden_menu_access.h" + +/* Initialize TCM data structures */ +static void startup(); +static void cleanup(); +void (*tet_startup) () = startup; +void (*tet_cleanup) () = cleanup; + +struct tet_testlist tet_testlist[] = { + {utc_tel_set_cfg_hidden_menu_access_000, 1}, + {utc_tel_set_cfg_hidden_menu_access_001, 2}, + {utc_tel_set_cfg_hidden_menu_access_002, 3}, + {NULL, 0} +}; + +/* Startup & Clean function : It is not test code, only for + initialize and finalize test module +*/ +static BOOL gStartupSuccess = FALSE; +static unsigned int subscription_id = 0; + +static void startup() +{ + + if(tel_init() != TAPI_API_SUCCESS) + { + printf("TelTapiInit() Failed \n") + } + register_all_events(); + + return; +} + +static void cleanup() +{ + deregister_all(); + tel_deinit(); + return; +} + + + +void utc_tel_set_cfg_hidden_menu_access_000() +{ + + TapiResult_t ret_status = TAPI_API_SUCCESS; + int request_id=0; + gmain_loop_for_tapi_events(TIME_DELAY); + + ret_status = tel_set_cfg_hidden_menu_access(TAPI_CFG_HIDDEN_MENU_ENABLE); + gmain_loop_for_tapi_events(TIME_DELAY); + + if(ret_status == TAPI_API_SUCCESS) + { + tet_infoline("utc_tel_set_cfg_hidden_menu_access_000 pass\n"); + tet_result(TET_PASS); + } + else + { + tet_infoline("utc_tel_set_cfg_hidden_menu_access_000 has failed\n"); + tet_result(TET_FAIL); + } +} + + + +void utc_tel_set_cfg_hidden_menu_access_001() +{ + + TapiResult_t ret_status = TAPI_API_SUCCESS; + int request_id=0; + gmain_loop_for_tapi_events(TIME_DELAY); + ret_status = tel_set_cfg_hidden_menu_access(TAPI_CFG_HIDDEN_MENU_DISABLE); + gmain_loop_for_tapi_events(TIME_DELAY); + + if(ret_status == TAPI_API_SUCCESS) + { + tet_infoline("utc_tel_set_cfg_hidden_menu_access_001 pass\n"); + tet_result(TET_PASS); + } + else + { + tet_infoline("utc_tel_set_cfg_hidden_menu_access_001 has failed\n"); + tet_result(TET_FAIL); + } +} + +void utc_tel_set_cfg_hidden_menu_access_002() +{ + + TapiResult_t ret_status = TAPI_API_SUCCESS; + int request_id=0; + gmain_loop_for_tapi_events(TIME_DELAY); + + ret_status = tel_set_cfg_hidden_menu_access(-1); + gmain_loop_for_tapi_events(TIME_DELAY); + + if(ret_status == TAPI_API_SUCCESS) + { + tet_infoline("utc_tel_set_cfg_hidden_menu_access_002 has failed\n"); + tet_result(TET_FAIL); + } + else + { + tet_infoline("utc_tel_set_cfg_hidden_menu_access_002 has passed\n"); + tet_result(TET_PASS); + } +} + + +/** @} */ diff --git a/TC/telephony_TC/CFG/uts_tel_set_cfg_hidden_menu_access.h b/TC/telephony_TC/CFG/uts_tel_set_cfg_hidden_menu_access.h new file mode 100644 index 0000000..bd2231b --- /dev/null +++ b/TC/telephony_TC/CFG/uts_tel_set_cfg_hidden_menu_access.h @@ -0,0 +1,61 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * 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. + */ + + +/** +* @file uts_tel_get_cfg_vocoder_option.h +* @brief This is the implementaion file for the test case of getting tty mode +* @author Gautam Nand Sinha (gnand.sinha@samsung.com) +* @version Initial Creation V0.1 +* @date 2009.12.16 +*/ + +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include "assert.h" +#include "glib.h" +#include "cfg_util.h" + +#include "TapiCommon.h" +//#include "tapi_utility.h" +#include +#include "string.h" + +#include "tet_tapi_util.h" + +#ifndef _UTS_TEL_SET_CFG_HIDDEN_MENU_ACCESS_H_ +#define _UTS_TEL_SET_CFG_HIDDEN_MENU_ACCESS_H_ + + static void utc_tel_set_cfg_hidden_menu_access_000(); + static void utc_tel_set_cfg_hidden_menu_access_001(); + static void utc_tel_set_cfg_hidden_menu_access_002(); + + + +#endif //_UTS_TEL_SET_CFG_HIDDEN_MENU_ACCESS_H_ + diff --git a/TC/telephony_TC/CFG/uts_tel_set_cfg_serving_carrier.c b/TC/telephony_TC/CFG/uts_tel_set_cfg_serving_carrier.c new file mode 100644 index 0000000..e31f268 --- /dev/null +++ b/TC/telephony_TC/CFG/uts_tel_set_cfg_serving_carrier.c @@ -0,0 +1,409 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +/** +* @ingroup TELEPHONY_API TelephonyAPI +* @addtogroup CONFIG Configuration +*/ + +/** +* @ingroup CONFIG Configuration +* @addtogroup UTS_CONFIG Unit +*/ + +/** +* @ingroup UTS_CONFIG +* @addtogroup UTS_TAPI_CFG_set_TTY_MODE tel_set_cfg_serving_carrier +* @brief Unit test cases for tel_set_cfg_serving_carrier() +* @par Test function Prototype: +* TapiResult_t tel_set_cfg_serving_carrier( int *pRequestID) +* @par Test function description: +* It requests to set tty(text telephone) mode.(CDMA only) +* @par Important Notes: +* None +* @param [out] pRequestId +* - Unique identifier for a particular request. +* - request_id value can be any value from 0 to 255 if the API is returned successfully +* - -1 (INVALID_REQUEST_ID) will be sent in case of failure. +* @par Async Response Message +* The event associated is TAPI_EVENT_CFG_set_TTY_MODE_CNF +* @pre +* None +* @post +* None +* @return +* Return Type : (TapiResult_t) +* - TAPI_API_SUCCESS - indicating that the operation has completed successfully. +* - Refer TapiResult_t for failure and error code +* @{ +*/ + +/** +* @file uts_tel_set_cfg_serving_carrier.c +* @brief This is a suite of unit test cases to test tel_set_cfg_serving_carrier() API function +* @author Gautam Nand Sinha (gnand.sinha@samsung.com) +* @version Initial Creation V0.1 +* @date 2009.12.16 +*/ + + + +#include "uts_tel_set_cfg_serving_carrier.h" + +/* Initialize TCM data structures */ +static void startup(); +static void cleanup(); +void (*tet_startup) () = startup; +void (*tet_cleanup) () = cleanup; + +struct tet_testlist tet_testlist[] = { + {utc_tel_set_cfg_serving_carrier_000, 1}, + {utc_tel_set_cfg_serving_carrier_001, 2}, + {utc_tel_set_cfg_serving_carrier_002, 3}, + {utc_tel_set_cfg_serving_carrier_003, 4}, + {utc_tel_set_cfg_serving_carrier_004, 5}, + {utc_tel_set_cfg_serving_carrier_005, 6}, + {utc_tel_set_cfg_serving_carrier_006, 7}, + {utc_tel_set_cfg_serving_carrier_007, 8}, + {utc_tel_set_cfg_serving_carrier_008, 9}, + {utc_tel_set_cfg_serving_carrier_009, 10}, + {utc_tel_set_cfg_serving_carrier_010, 11}, + {utc_tel_set_cfg_serving_carrier_011, 12}, + {utc_tel_set_cfg_serving_carrier_012, 13}, + {NULL, 0} +}; + +/* Startup & Clean function : It is not test code, only for + initialize and finalize test module +*/ +static BOOL gStartupSuccess = FALSE; +static unsigned int subscription_id = 0; + +static void startup() +{ + + if(tel_init() != TAPI_API_SUCCESS) + { + printf("TelTapiInit() Failed \n") + } + register_all_events(); + + return; +} + +static void cleanup() +{ + deregister_all(); + tel_deinit(); + return; +} + + + +void utc_tel_set_cfg_serving_carrier_000() +{ + + TapiResult_t ret_status = TAPI_API_SUCCESS; + int request_id=0; + gmain_loop_for_tapi_events(TIME_DELAY); + ret_status = ret_status = tel_set_cfg_serving_carrier( TAPI_CFG_CARRIER_TEST); + gmain_loop_for_tapi_events(TIME_DELAY); + + if(ret_status == TAPI_API_SUCCESS) + { + tet_infoline("utc_tel_set_cfg_serving_carrier_000 pass\n"); + tet_result(TET_PASS); + } + else + { + tet_infoline("utc_tel_set_cfg_serving_carrier_000 has failed\n"); + tet_result(TET_FAIL); + } +} + + + +void utc_tel_set_cfg_serving_carrier_001() +{ + + TapiResult_t ret_status = TAPI_API_SUCCESS; + int request_id=0; + gmain_loop_for_tapi_events(TIME_DELAY); + ret_status = tel_set_cfg_serving_carrier( TAPI_CFG_CARRIER_SKT); + + gmain_loop_for_tapi_events(TIME_DELAY); + + if(ret_status == TAPI_API_SUCCESS) + { + tet_infoline("utc_tel_set_cfg_serving_carrier_001 pass\n"); + tet_result(TET_PASS); + } + else + { + tet_infoline("utc_tel_set_cfg_serving_carrier_001 has failed\n"); + tet_result(TET_FAIL); + } +} + +void utc_tel_set_cfg_serving_carrier_002() +{ + + TapiResult_t ret_status = TAPI_API_SUCCESS; + int request_id=0; + gmain_loop_for_tapi_events(TIME_DELAY); + ret_status = tel_set_cfg_serving_carrier(TAPI_CFG_CARRIER_KTF); + + gmain_loop_for_tapi_events(TIME_DELAY); + + if(ret_status == TAPI_API_SUCCESS) + { + tet_infoline("utc_tel_set_cfg_serving_carrier_002 pass\n"); + tet_result(TET_PASS); + } + else + { + tet_infoline("utc_tel_set_cfg_serving_carrier_002 has failed\n"); + tet_result(TET_FAIL); + } +} + +void utc_tel_set_cfg_serving_carrier_003() +{ + + TapiResult_t ret_status = TAPI_API_SUCCESS; + int request_id=0; + gmain_loop_for_tapi_events(TIME_DELAY); + ret_status = tel_set_cfg_serving_carrier( TAPI_CFG_CARRIER_LGT); + + gmain_loop_for_tapi_events(TIME_DELAY); + + if(ret_status == TAPI_API_SUCCESS) + { + tet_infoline("utc_tel_set_cfg_serving_carrier_003 pass\n"); + tet_result(TET_PASS); + } + else + { + tet_infoline("utc_tel_set_cfg_serving_carrier_003 has failed\n"); + tet_result(TET_FAIL); + } +} + +void utc_tel_set_cfg_serving_carrier_004() +{ + + TapiResult_t ret_status = TAPI_API_SUCCESS; + int request_id=0; + gmain_loop_for_tapi_events(TIME_DELAY); + ret_status = tel_set_cfg_serving_carrier( TAPI_CFG_CARRIER_VERIZON); + + gmain_loop_for_tapi_events(TIME_DELAY); + + if(ret_status == TAPI_API_SUCCESS) + { + tet_infoline("utc_tel_set_cfg_serving_carrier_004 pass\n"); + tet_result(TET_PASS); + } + else + { + tet_infoline("utc_tel_set_cfg_serving_carrier_004 has failed\n"); + tet_result(TET_FAIL); + } +} + +void utc_tel_set_cfg_serving_carrier_005() +{ + + TapiResult_t ret_status = TAPI_API_SUCCESS; + int request_id=0; + gmain_loop_for_tapi_events(TIME_DELAY); + ret_status = tel_set_cfg_serving_carrier( TAPI_CFG_CARRIER_SPRINT); + + gmain_loop_for_tapi_events(TIME_DELAY); + + if(ret_status == TAPI_API_SUCCESS) + { + tet_infoline("utc_tel_set_cfg_serving_carrier_005 pass\n"); + tet_result(TET_PASS); + } + else + { + tet_infoline("utc_tel_set_cfg_serving_carrier_005 has failed\n"); + tet_result(TET_FAIL); + } +} + +void utc_tel_set_cfg_serving_carrier_006() +{ + + TapiResult_t ret_status = TAPI_API_SUCCESS; + int request_id=0; + gmain_loop_for_tapi_events(TIME_DELAY); + ret_status = tel_set_cfg_serving_carrier( TAPI_CFG_CARRIER_ALLTEL); + + gmain_loop_for_tapi_events(TIME_DELAY); + + if(ret_status == TAPI_API_SUCCESS) + { + tet_infoline("utc_tel_set_cfg_serving_carrier_006 pass\n"); + tet_result(TET_PASS); + } + else + { + tet_infoline("utc_tel_set_cfg_serving_carrier_006 has failed\n"); + tet_result(TET_FAIL); + } +} + +void utc_tel_set_cfg_serving_carrier_007() +{ + + TapiResult_t ret_status = TAPI_API_SUCCESS; + int request_id=0; + gmain_loop_for_tapi_events(TIME_DELAY); + ret_status = tel_set_cfg_serving_carrier( TAPI_CFG_CARRIER_TELUS); + + gmain_loop_for_tapi_events(TIME_DELAY); + + if(ret_status == TAPI_API_SUCCESS) + { + tet_infoline("utc_tel_set_cfg_serving_carrier_007 pass\n"); + tet_result(TET_PASS); + } + else + { + tet_infoline("utc_tel_set_cfg_serving_carrier_007 has failed\n"); + tet_result(TET_FAIL); + } +} + +void utc_tel_set_cfg_serving_carrier_008() +{ + + TapiResult_t ret_status = TAPI_API_SUCCESS; + int request_id=0; + gmain_loop_for_tapi_events(TIME_DELAY); + ret_status = tel_set_cfg_serving_carrier(TAPI_CFG_CARRIER_BMC); + + gmain_loop_for_tapi_events(TIME_DELAY); + + if(ret_status == TAPI_API_SUCCESS) + { + tet_infoline("utc_tel_set_cfg_serving_carrier_008 pass\n"); + tet_result(TET_PASS); + } + else + { + tet_infoline("utc_tel_set_cfg_serving_carrier_008 has failed\n"); + tet_result(TET_FAIL); + } +} + +void utc_tel_set_cfg_serving_carrier_009() +{ + + TapiResult_t ret_status = TAPI_API_SUCCESS; + int request_id=0; + gmain_loop_for_tapi_events(TIME_DELAY); + ret_status = tel_set_cfg_serving_carrier( TAPI_CFG_CARRIER_ALIANT); + + gmain_loop_for_tapi_events(TIME_DELAY); + + if(ret_status == TAPI_API_SUCCESS) + { + tet_infoline("utc_tel_set_cfg_serving_carrier_009 pass\n"); + tet_result(TET_PASS); + } + else + { + tet_infoline("utc_tel_set_cfg_serving_carrier_009 has failed\n"); + tet_result(TET_FAIL); + } +} + +void utc_tel_set_cfg_serving_carrier_010() +{ + + TapiResult_t ret_status = TAPI_API_SUCCESS; + int request_id=0; + gmain_loop_for_tapi_events(TIME_DELAY); + ret_status = tel_set_cfg_serving_carrier( TAPI_CFG_CARRIER_SASKTEL); + + gmain_loop_for_tapi_events(TIME_DELAY); + + if(ret_status == TAPI_API_SUCCESS) + { + tet_infoline("utc_tel_set_cfg_serving_carrier_010 pass\n"); + tet_result(TET_PASS); + } + else + { + tet_infoline("utc_tel_set_cfg_serving_carrier_010 has failed\n"); + tet_result(TET_FAIL); + } +} + +void utc_tel_set_cfg_serving_carrier_011() +{ + + TapiResult_t ret_status = TAPI_API_SUCCESS; + int request_id=0; + gmain_loop_for_tapi_events(TIME_DELAY); + ret_status = tel_set_cfg_serving_carrier( TAPI_CFG_CARRIER_MTS); + + gmain_loop_for_tapi_events(TIME_DELAY); + + if(ret_status == TAPI_API_SUCCESS) + { + tet_infoline("utc_tel_set_cfg_serving_carrier_011 pass\n"); + tet_result(TET_PASS); + } + else + { + tet_infoline("utc_tel_set_cfg_serving_carrier_011 has failed\n"); + tet_result(TET_FAIL); + } +} + +void utc_tel_set_cfg_serving_carrier_012() +{ + + TapiResult_t ret_status = TAPI_API_SUCCESS; + int request_id=0; + gmain_loop_for_tapi_events(TIME_DELAY); + ret_status = tel_set_cfg_serving_carrier(-1); + + gmain_loop_for_tapi_events(TIME_DELAY); + + if(ret_status == TAPI_API_SUCCESS) + { + tet_infoline("utc_tel_set_cfg_serving_carrier_012 has failed\n"); + tet_result(TET_FAIL); + } + else + { + tet_infoline("utc_tel_set_cfg_serving_carrier_012 has passed\n"); + tet_result(TET_PASS); + } +} + + +/** @} */ diff --git a/TC/telephony_TC/CFG/uts_tel_set_cfg_serving_carrier.h b/TC/telephony_TC/CFG/uts_tel_set_cfg_serving_carrier.h new file mode 100644 index 0000000..67e8f85 --- /dev/null +++ b/TC/telephony_TC/CFG/uts_tel_set_cfg_serving_carrier.h @@ -0,0 +1,71 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * 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. + */ + + +/** +* @file uts_tel_set_cfg_serving_carrier.h +* @brief This is the implementaion file for the test case of setting tty mode +* @author Gautam Nand Sinha (gnand.sinha@samsung.com) +* @version Initial Creation V0.1 +* @date 2009.12.16 +*/ + +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include "assert.h" +#include "glib.h" +#include "cfg_util.h" + +#include "TapiCommon.h" +//#include "tapi_utility.h" +#include +#include "string.h" + +#include "tet_tapi_util.h" + +#ifndef _UTS_TEL_SET_CFG_SERVING_CARRIER_H_ +#define _UTS_TEL_SET_CFG_SERVING_CARRIER_H_ + + static void utc_tel_set_cfg_serving_carrier_000(); + static void utc_tel_set_cfg_serving_carrier_001(); + static void utc_tel_set_cfg_serving_carrier_002(); + static void utc_tel_set_cfg_serving_carrier_003(); + static void utc_tel_set_cfg_serving_carrier_004(); + static void utc_tel_set_cfg_serving_carrier_005(); + static void utc_tel_set_cfg_serving_carrier_006(); + static void utc_tel_set_cfg_serving_carrier_007(); + static void utc_tel_set_cfg_serving_carrier_008(); + static void utc_tel_set_cfg_serving_carrier_009(); + static void utc_tel_set_cfg_serving_carrier_010(); + static void utc_tel_set_cfg_serving_carrier_011(); + static void utc_tel_set_cfg_serving_carrier_012(); + + + +#endif //_UTS_TEL_SET_CFG_SERVING_CARRIER_H_ + diff --git a/TC/telephony_TC/CFG/uts_tel_set_cfg_vocoder_option.c b/TC/telephony_TC/CFG/uts_tel_set_cfg_vocoder_option.c new file mode 100644 index 0000000..fe13b34 --- /dev/null +++ b/TC/telephony_TC/CFG/uts_tel_set_cfg_vocoder_option.c @@ -0,0 +1,225 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +/** +* @ingroup TELEPHONY_API TelephonyAPI +* @addtogroup CONFIG Configuration +*/ + +/** +* @ingroup CONFIG Configuration +* @addtogroup UTS_CONFIG Unit +*/ + +/** +* @ingroup UTS_CONFIG +* @addtogroup UTS_TAPI_CFG_set_TTY_MODE tel_set_cfg_vocoder_option +* @brief Unit test cases for tel_set_cfg_vocoder_option() +* @par Test function Prototype: +* TapiResult_t tel_set_cfg_vocoder_option( int *pRequestID) +* @par Test function description: +* It requests to set tty(text telephone) mode.(CDMA only) +* @par Important Notes: +* None +* @param [out] pRequestId +* - Unique identifier for a particular request. +* - request_id value can be any value from 0 to 255 if the API is returned successfully +* - -1 (INVALID_REQUEST_ID) will be sent in case of failure. +* @par Async Response Message +* The event associated is TAPI_EVENT_CFG_set_TTY_MODE_CNF +* @pre +* None +* @post +* None +* @return +* Return Type : (TapiResult_t) +* - TAPI_API_SUCCESS - indicating that the operation has completed successfully. +* - Refer TapiResult_t for failure and error code +* @{ +*/ + +/** +* @file uts_tel_set_cfg_vocoder_option.c +* @brief This is a suite of unit test cases to test tel_set_cfg_vocoder_option() API function +* @author Gautam Nand Sinha (gnand.sinha@samsung.com) +* @version Initial Creation V0.1 +* @date 2009.12.16 +*/ + + + +#include "uts_tel_set_cfg_vocoder_option.h" + +/* Initialize TCM data structures */ +static void startup(); +static void cleanup(); +void (*tet_startup) () = startup; +void (*tet_cleanup) () = cleanup; + +struct tet_testlist tet_testlist[] = { + {utc_tel_set_cfg_vocoder_option_000, 1}, + {utc_tel_set_cfg_vocoder_option_001, 2}, + {utc_tel_set_cfg_vocoder_option_002, 3}, + {utc_tel_set_cfg_vocoder_option_003, 4}, + {utc_tel_set_cfg_vocoder_option_004, 5}, + {NULL, 0} +}; + +/* Startup & Clean function : It is not test code, only for + initialize and finalize test module +*/ +static BOOL gStartupSuccess = FALSE; +static unsigned int subscription_id = 0; + +static void startup() +{ + + if(tel_init() != TAPI_API_SUCCESS) + { + printf("TelTapiInit() Failed \n") + } + register_all_events(); + + return; +} + +static void cleanup() +{ + deregister_all(); + tel_deinit(); + return; +} + + + +void utc_tel_set_cfg_vocoder_option_000() +{ + + TapiResult_t ret_status = TAPI_API_SUCCESS; + int request_id=0; + gmain_loop_for_tapi_events(TIME_DELAY); + ret_status = ret_status = tel_set_cfg_vocoder_option( TAPI_CFG_VOC_OPTION_DEFAULT); + gmain_loop_for_tapi_events(TIME_DELAY); + + if(ret_status == TAPI_API_SUCCESS) + { + tet_infoline("utc_tel_set_cfg_vocoder_option_000 pass\n"); + tet_result(TET_PASS); + } + else + { + tet_infoline("utc_tel_set_cfg_vocoder_option_000 has failed\n"); + tet_result(TET_FAIL); + } +} + + + +void utc_tel_set_cfg_vocoder_option_001() +{ + + TapiResult_t ret_status = TAPI_API_SUCCESS; + int request_id=0; + gmain_loop_for_tapi_events(TIME_DELAY); + ret_status = tel_set_cfg_vocoder_option( TAPI_CFG_VOC_OPTION_EVRC); + + gmain_loop_for_tapi_events(TIME_DELAY); + + if(ret_status == TAPI_API_SUCCESS) + { + tet_infoline("utc_tel_set_cfg_vocoder_option_001 pass\n"); + tet_result(TET_PASS); + } + else + { + tet_infoline("utc_tel_set_cfg_vocoder_option_001 has failed\n"); + tet_result(TET_FAIL); + } +} + +void utc_tel_set_cfg_vocoder_option_002() +{ + + TapiResult_t ret_status = TAPI_API_SUCCESS; + int request_id=0; + gmain_loop_for_tapi_events(TIME_DELAY); + ret_status = tel_set_cfg_vocoder_option( TAPI_CFG_VOC_OPTION_13K); + + gmain_loop_for_tapi_events(TIME_DELAY); + + if(ret_status == TAPI_API_SUCCESS) + { + tet_infoline("utc_tel_set_cfg_vocoder_option_002 pass\n"); + tet_result(TET_PASS); + } + else + { + tet_infoline("utc_tel_set_cfg_vocoder_option_002 has failed\n"); + tet_result(TET_FAIL); + } +} + +void utc_tel_set_cfg_vocoder_option_003() +{ + + TapiResult_t ret_status = TAPI_API_SUCCESS; + int request_id=0; + gmain_loop_for_tapi_events(TIME_DELAY); + ret_status = tel_set_cfg_vocoder_option( TAPI_CFG_VOC_OPTION_8K); + + gmain_loop_for_tapi_events(TIME_DELAY); + + if(ret_status == TAPI_API_SUCCESS) + { + tet_infoline("utc_tel_set_cfg_vocoder_option_003 pass\n"); + tet_result(TET_PASS); + } + else + { + tet_infoline("utc_tel_set_cfg_vocoder_option_003 has failed\n"); + tet_result(TET_FAIL); + } +} + +void utc_tel_set_cfg_vocoder_option_004() +{ + + TapiResult_t ret_status = TAPI_API_SUCCESS; + int request_id=0; + gmain_loop_for_tapi_events(TIME_DELAY); + ret_status = tel_set_cfg_vocoder_option( -1); + + gmain_loop_for_tapi_events(TIME_DELAY); + + if(ret_status == TAPI_API_SUCCESS) + { + tet_infoline("utc_tel_set_cfg_vocoder_option_004 has failed\n"); + tet_result(TET_FAIL); + } + else + { + tet_infoline("utc_tel_set_cfg_vocoder_option_004 has passed\n"); + tet_result(TET_FAIL); + } +} + + +/** @} */ diff --git a/TC/telephony_TC/CFG/uts_tel_set_cfg_vocoder_option.h b/TC/telephony_TC/CFG/uts_tel_set_cfg_vocoder_option.h new file mode 100644 index 0000000..b7f57cb --- /dev/null +++ b/TC/telephony_TC/CFG/uts_tel_set_cfg_vocoder_option.h @@ -0,0 +1,63 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * 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. + */ + + +/** +* @file uts_tel_set_cfg_vocoder_option.h +* @brief This is the implementaion file for the test case of setting tty mode +* @author Gautam Nand Sinha (gnand.sinha@samsung.com) +* @version Initial Creation V0.1 +* @date 2009.12.16 +*/ + +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include "assert.h" +#include "glib.h" +#include "cfg_util.h" + +#include "TapiCommon.h" +//#include "tapi_utility.h" +#include +#include "string.h" + +#include "tet_tapi_util.h" + +#ifndef _UTS_TEL_SET_CFG_VOCODER_OPTION_H_ +#define _UTS_TEL_SET_CFG_VOCODER_OPTION_H_ + + static void utc_tel_set_cfg_vocoder_option_000(); + static void utc_tel_set_cfg_vocoder_option_001(); + static void utc_tel_set_cfg_vocoder_option_002(); + static void utc_tel_set_cfg_vocoder_option_003(); + static void utc_tel_set_cfg_vocoder_option_004(); + + + +#endif //_UTS_TEL_SET_CFG_VOCODER_OPTION_H_ + diff --git a/TC/telephony_TC/CFG/uts_tel_verify_cfg_akey.c b/TC/telephony_TC/CFG/uts_tel_verify_cfg_akey.c new file mode 100644 index 0000000..5352a4b --- /dev/null +++ b/TC/telephony_TC/CFG/uts_tel_verify_cfg_akey.c @@ -0,0 +1,159 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +/** +* @ingroup TELEPHONY_API TelephonyAPI +* @addtogroup CONFIG Configuration +*/ + +/** +* @ingroup CONFIG Configuration +* @addtogroup UTS_CONFIG Unit +*/ + +/** +* @ingroup UTS_CONFIG +* @addtogroup UTS_TAPI_CFG_GET_TTY_MODE tel_verify_cfg_akey +* @brief Unit test cases for tel_verify_cfg_akey() +* @par Test function Prototype: +* TapiResult_t tel_verify_cfg_akey( int *pRequestID) +* @par Test function description: +* It requests to get tty(text telephone) mode.(CDMA only) +* @par Important Notes: +* None +* @param [out] pRequestId +* - Unique identifier for a particular request. +* - request_id value can be any value from 0 to 255 if the API is returned successfully +* - -1 (INVALID_REQUEST_ID) will be sent in case of failure. +* @par Async Response Message +* The event associated is TAPI_EVENT_CFG_GET_TTY_MODE_CNF +* @pre +* None +* @post +* None +* @return +* Return Type : (TapiResult_t) +* - TAPI_API_SUCCESS - indicating that the operation has completed successfully. +* - Refer TapiResult_t for failure and error code +* @{ +*/ + +/** +* @file uts_tel_verify_cfg_akey.c +* @brief This is a suite of unit test cases to test tel_verify_cfg_akey() API function +* @author Gautam Nand Sinha (gnand.sinha@samsung.com) +* @version Initial Creation V0.1 +* @date 2009.12.16 +*/ + + + +#include "uts_tel_verify_cfg_akey.h" + +/* Initialize TCM data structures */ +static void startup(); +static void cleanup(); +void (*tet_startup) () = startup; +void (*tet_cleanup) () = cleanup; + +struct tet_testlist tet_testlist[] = { + {utc_tel_verify_cfg_akey_000, 1}, + {utc_tel_verify_cfg_akey_001, 2}, + {NULL, 0} +}; + +/* Startup & Clean function : It is not test code, only for + initialize and finalize test module +*/ +static BOOL gStartupSuccess = FALSE; +static unsigned int subscription_id = 0; + +static void startup() +{ + + if(tel_init() != TAPI_API_SUCCESS) + { + printf("TelTapiInit() Failed \n") + } + register_all_events(); + + return; +} + +static void cleanup() +{ + deregister_all(); + tel_deinit(); + return; +} + + + +void utc_tel_verify_cfg_akey_000() +{ + + TapiResult_t ret_status = TAPI_API_SUCCESS; + int request_id=0; + char *key = "PHONE" ; + gmain_loop_for_tapi_events(TIME_DELAY); + tel_set_cfg_default_configuration(TAPI_CFG_DEFAULT_FULL); + ret_status = tel_verify_cfg_akey(key); + gmain_loop_for_tapi_events(TIME_DELAY); + + if(ret_status == TAPI_API_SUCCESS) + { + tet_infoline("utc_tel_verify_cfg_akey_000 pass\n"); + tet_result(TET_PASS); + } + else + { + tet_infoline("utc_tel_verify_cfg_akey_000 has failed\n"); + tet_result(TET_FAIL); + } +} + + + +void utc_tel_verify_cfg_akey_001() +{ + + TapiResult_t ret_status = TAPI_API_SUCCESS; + int request_id=0; + gmain_loop_for_tapi_events(TIME_DELAY); + ret_status = tel_verify_cfg_akey(NULL); + + gmain_loop_for_tapi_events(TIME_DELAY); + + if(ret_status == TAPI_API_SUCCESS) + { + tet_infoline("utc_tel_verify_cfg_akey_001 has failed\n"); + tet_result(TET_FAIL); + } + else + { + tet_infoline("utc_tel_verify_cfg_akey_001 has passed\n"); + tet_result(TET_PASS); + } +} + + + +/** @} */ diff --git a/TC/telephony_TC/CFG/uts_tel_verify_cfg_akey.h b/TC/telephony_TC/CFG/uts_tel_verify_cfg_akey.h new file mode 100644 index 0000000..987d756 --- /dev/null +++ b/TC/telephony_TC/CFG/uts_tel_verify_cfg_akey.h @@ -0,0 +1,60 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * 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. + */ + + +/** +* @file uts_tel_verify_cfg_akey.h +* @brief This is the implementaion file for the test case of getting tty mode +* @author Gautam Nand Sinha (gnand.sinha@samsung.com) +* @version Initial Creation V0.1 +* @date 2009.12.16 +*/ + +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include "assert.h" +#include "glib.h" +#include "cfg_util.h" + +#include "TapiCommon.h" +//#include "tapi_utility.h" +#include +#include "string.h" + +#include "tet_tapi_util.h" + +#ifndef _UTS_TAPI_CFG_GET_TTY_MODE_H_ +#define _UTS_TAPI_CFG_GET_TTY_MODE_H_ + + static void utc_tel_verify_cfg_akey_000(); + static void utc_tel_verify_cfg_akey_001(); + + + +#endif //_UTS_TAPI_CFG_GET_TTY_MODE_H_ + diff --git a/TC/telephony_TC/Makefile b/TC/telephony_TC/Makefile new file mode 100644 index 0000000..11f69dc --- /dev/null +++ b/TC/telephony_TC/Makefile @@ -0,0 +1,12 @@ +SUBDIRS = common/unit call/unit gprs/unit network/unit power/unit sat/unit sim/unit sms/unit sound/unit ss/unit + +.PHONY: subdirs $(SUBDIRS) + +subdirs: $(SUBDIRS) + +$(SUBDIRS): + $(MAKE) -C $@ + +clean : + -for d in $(SUBDIRS); do (cd $$d; $(MAKE) clean ); done + diff --git a/TC/telephony_TC/call/README b/TC/telephony_TC/call/README new file mode 100644 index 0000000..075a6f3 --- /dev/null +++ b/TC/telephony_TC/call/README @@ -0,0 +1,82 @@ +================================================================================= +* README * +================================================================================= + +1. The EMAIL Test Script directory (TestCases) includes: + + call/ + |-- README ; This file + `-- Unit ; contains Unit TCs + |-- makefile + |-- tslist + `-- Unit test case source codes + 2 directories, 44 files + + +2. The $(TEST_ROOT) directory must includes following files: + + /$(TEST_ROOT) + |-- tet_scen + |-- tetbuild.cfg + |-- tetclean.cfg + `-- tetexec.cfg + +================================================================================= +* Preconditions * +--------------------------------------------------------------------------------- +| Before Testing Call Module, you should check the following conditions | +================================================================================= + +1. Prepare Three valid SIM cards . + +2. One target phone and two other phones are required to create MO/MT Call.Two extra phones are required for SWAP, HOLD, CONFERENCE and SPLIT etc functioality. + +3. Call waiting must be enabled if not then enable it manually. + +4. Modify the mobile number + - call_common.h [LINE 40] + - Followings are the macro for mobile number customized as per the country. + // Mobile numbers + + #define MOB_NUM1 "+919999146715" //Used for MO call creation. Change the number according to your country. + #define MOB_NUM2 "+919810971703" //Used to divert a call to specified number. Change the number according to your country. + #define DTMF_STRING "12345" // User can change as per their choice + +5. During execution continuously watch the log file at Putty or whatever terminal used for target logging and as per the log instruction, user has to provide + the MT call or disconnect the call. + + e,g.: log will be printed in the following fashion: + + + /****************************************/ + Give a MT Call within 20 secs + /****************************************/ + + If user sees this kind of log in putty or used terminal, user has to give a MT call within the specified time [e.g. 20 secs]. + + /****************************************/ + As call is answered disconnect the call + /****************************************/ + + If user see this kind of log in putty or used terminal , user has to disconnect after the call is received[ Not through target but through end user phone] + + /****************************************/ + disconnect the call + /****************************************/ + + If user see this kind of log in putty or used terminal , user has to disconnect in MO & MT scenario’s[ Not through target but through end user phone] + +================================================================================= +* Change log * +================================================================================= +1. 18-Dec-2008 + - Initial draft. +2. 10-Oct-2010 + - Revised + +================================================================================= +* NOTE * +================================================================================= +1. In order to ensure successful working of the Test Scripts, please ensure that all of the IPKG files are installed normally. +2. Testing Call Module can be executed under target system environment (not simulator). + diff --git a/TC/telephony_TC/call/call_common.h b/TC/telephony_TC/call/call_common.h new file mode 100644 index 0000000..1e89f3c --- /dev/null +++ b/TC/telephony_TC/call/call_common.h @@ -0,0 +1,191 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * 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 _TET_TAPI_UTIL_NEW_ +#define _TET_TAPI_UTIL_NEW_ + +#include +#include +#include "TapiCommon.h" + + +#define TIME_DELAY0 3000 +#define TIME_DELAY1 20000 +#define TIME_DELAY2 30000 +#define TIME_DELAY3 30000 + +#define INVALID_CALL_HANDLE 0 +#define VALID_CALL_HANDLE 1 + +#define MOB_NUM1 "01012345678" //Used for MO call creation.Change the number according to your country. +#define MOB_NUM2 "01098765432" //Used to divert a call to specified number.Change the number according to your country. + +#define DTMF_STRING "12345" // User can change as per their choice + +#define LOCAL_MOB_NUM "01012345678" + + +#define MAX_NUMBER_SIZE 16 +#define TEST_INVALID_VALUE_1 -1 +#define TEST_INVALID_VALUE_2 5 + +// TET_Error Code string return macro +typedef struct { + TapiResult_t err; + char * string; +}TAPI_Error_String; + +//#define TAPI_ERROR_MAX TAPI_API_MISC_OUTPARAM_NULL+1 +#define TAPI_ERROR_MAX 200 + +TAPI_Error_String g_TAPI_ErrorString[TAPI_ERROR_MAX] = { + + /* #################### COMMON START ################ */ + {TAPI_API_SUCCESS, "TAPI_API_SUCCESS : No Error occured"}, + {TAPI_API_INVALID_INPUT, "TAPI_API_INVALID_INPUT : Input values are not correct in TAPI Library"}, + {TAPI_API_INVALID_PTR, "TAPI_API_INVALID_PTR : Invalid pointer"}, + {TAPI_API_NOT_SUPPORTED, "TAPI_API_NOT_SUPPORTED: The feature corresponding to requested API is not supported. This may be due to market/network/vendor reasons such as the feature is not available in the network"}, + {TAPI_API_DEPRICATED, "TAPI_API_DEPRICATED : This API is deprecated and will be so in future also"}, + {TAPI_API_SYSTEM_OUT_OF_MEM, "TAPI_API_SYSTEM_OUT_OF_MEM : Out of memory"}, + {TAPI_API_SYSTEM_RPC_LINK_DOWN, "TAPI_API_SYSTEM_RPC_LINK_DOWN : RPC link down"}, + {TAPI_API_MODEM_POWERED_OFF, "TAPI_API_MODEM_POWERED_OFF : The Modem is powered off"}, + {TAPI_API_SERVICE_NOT_READY, "TAPI_API_SERVICE_NOT_READY : Phone was powered on, but yet to receive the power up completed notification"}, + {TAPI_API_SERVER_FAILURE , "TAPI_API_SERVER_FAILURE : error occurred in Telephony server"}, + {TAPI_API_OEM_PLUGIN_FAILURE , "TAPI_API_OEM_PLUGIN_FAILURE : Plug-in layer failure"}, + {TAPI_API_TRANSPORT_LAYER_FAILURE, "TAPI_API_TRANSPORT_LAYER_FAILURE"}, + + {TAPI_API_INVALID_CALL_HANDLE, "TAPI_API_INVALID_CALL_HANDLE : Invalid call handle"}, + {TAPI_API_INVALID_CALL_STATE, "TAPI_API_INVALID_CALL_STATE : Invalid call state- Newly added. Need to raise a CR for this"}, + + {TAPI_API_INVALID_DATA_LEN, "TAPI_API_INVALID_DATA_LEN : Invalid data length"}, + {TAPI_API_SIM_NOT_FOUND, "TAPI_API_SIM_NOT_FOUND : Sim is not present / removed "}, + {TAPI_API_SIM_BUSY, "TAPI_API_SIM_BUSY : SIM is busy"}, + {TAPI_API_SIM_INVALID_CARD_TYPE, "TAPI_API_SIM_INVALID_CARD_TYPE : Sim card is unknown "}, + {TAPI_API_SIM_CARD_PERMANENT_ERROR, "TAPI_API_SIM_CARD_PERMANENT_ERROR : SIM error/blocked state"}, + {TAPI_API_SIM_NOT_INITIALIZED, "TAPI_API_SIM_NOT_INITIALIZED : SIM has not initialized yet (waiting for PIN verifcation, etc)"}, + {TAPI_API_REQUEST_MAX_IN_PROGRESS, "TAPI_API_REQUEST_MAX_IN_PROGRESS : Maximum number of API Request for the same service are already in progress "}, + {TAPI_API_OFFLINE_MODE_ERROR, "TAPI_API_OFFLINE_MODE_ERROR : OEM Telephony Provider is in Offline mode"}, + {TAPI_EVENT_CLASS_UNKNOWN, "TAPI_EVENT_CLASS_UNKNOWN : Event class specified is not present in Event Class list"}, + {TAPI_EVENT_UNKNOWN, "TAPI_EVENT_UNKNOWN : Event specified is not present in TAPI Unsolicited Event list"}, + {TAPI_REGISTRATION_OP_FAILED, "TAPI_REGISTRATION_OP_FAILED : Callback Registration/De-registration failed"}, + {TAPI_NETTEXT_SCADDRESS_NOT_SET, "TAPI_NETTEXT_SCADDRESS_NOT_SET"}, + {TAPI_API_OPERATION_FAILED, "TAPI_API_OPERATION_FAILED"}, + {TAPI_API_INVALID_OPERATION, "TAPI_API_INVALID_OPERATION"}, + + /* Samsung Specif */ + {TAPI_API_SYSTEM_RPC_LINK_NOT_EST, "TAPI_API_SYSTEM_RPC_LINK_NOT_EST"}, + {TAPI_API_API_NOT_SUPPORTED, "TAPI_API_API_NOT_SUPPORTED"}, + {TAPI_API_SERVER_LAYER_FAILURE, "TAPI_API_SERVER_LAYER_FAILURE"}, + + /* CALL */ + {TAPI_API_INVALID_CALL_ID, "TAPI_API_INVALID_CALL_ID"}, + {TAPI_API_CALL_CTXT_OVERFLOW, "TAPI_API_CALL_CTXT_OVERFLOW"}, + {TAPI_API_COULD_NOT_GET_CALL_CTXT, "TAPI_API_COULD_NOT_GET_CALL_CTXT"}, + {TAPI_API_CTXT_SEARCH_RET_NON_CALL_CTXT, "TAPI_API_CTXT_SEARCH_RET_NON_CALL_CTXT"}, + {TAPI_API_COULD_NOT_DESTROY_CTXT, "TAPI_API_COULD_NOT_DESTROY_CTXT"}, + {TAPI_API_INVALID_LINE_ID, "TAPI_API_INVALID_LINE_ID"}, + + /* POWER */ +// {TAPI_API_MODEM_ALREADY_ON, "TAPI_API_MODEM_ALREADY_ON"}, +// {TAPI_API_MODEM_ALREADY_OFF, "TAPI_API_MODEM_ALREADY_OFF"}, + + /* NETTEXT */ + {TAPI_API_NETTEXT_DEVICE_NOT_READY, "TAPI_API_NETTEXT_DEVICE_NOT_READY"}, + {TAPI_API_NETTEXT_SCADDR_NOT_SET, "TAPI_API_NETTEXT_SCADDR_NOT_SET"}, + {TAPI_API_NETTEXT_INVALID_DATA_LEN, "TAPI_API_NETTEXT_INVALID_DATA_LEN"}, + + /* SIM */ + //{TAPI_API_SIM_DEV_CTX_NULL, "TAPI_API_SIM_DEV_CTX_NULL"}, + //{TAPI_API_SIM_SIM_NOT_FOUND, "TAPI_API_SIM_SIM_NOT_FOUND"}, + {TAPI_API_SIM_SIM_SESSION_FULL, "TAPI_API_SIM_SIM_SESSION_FULL"}, + //{TAPI_API_SIM_INVALID_APP_ID, "TAPI_API_SIM_INVALID_APP_ID"}, + {TAPI_API_SIM_INVALID_SESSION, "TAPI_API_SIM_INVALID_SESSION"}, + {TAPI_API_SIM_FILE_TYPE_WRONG, "TAPI_API_SIM_FILE_TYPE_WRONG"}, + {TAPI_API_SIM_FILE_ENCODE_FAIL, "TAPI_API_SIM_FILE_ENCODE_FAIL"}, + {TAPI_API_SIM_FILE_DECODE_FAIL, "TAPI_API_SIM_FILE_DECODE_FAIL"}, + {TAPI_API_SIM_FILE_INVALID_ENCODE_LEN, "TAPI_API_SIM_FILE_INVALID_ENCODE_LEN"}, + {TAPI_API_SIM_INVALID_RECORD_NUM, "TAPI_API_SIM_INVALID_RECORD_NUM"}, + {TAPI_API_SIM_CASE_NOT_HANDLED, "TAPI_API_SIM_CASE_NOT_HANDLED"}, + {TAPI_API_SIM_OEM_UNKNOWN_SIM_CARD, "TAPI_API_SIM_OEM_UNKNOWN_SIM_CARD"}, + {TAPI_API_SIM_SEC_UKNOWN_PIN_TYPE, "TAPI_API_SIM_SEC_UKNOWN_PIN_TYPE"}, + {TAPI_API_SIM_SEC_INVALID_PIN_TYPE, "TAPI_API_SIM_SEC_INVALID_PIN_TYPE"}, + {TAPI_API_SIM_PB_INVALID_STORAGE_TYPE, "TAPI_API_SIM_PB_INVALID_STORAGE_TYPE"}, + + {TAPI_API_SAT_COMMAND_TYPE_MISMATCH, "TAPI_API_SAT_COMMAND_TYPE_MISMATCH"}, + + /* Network */ + {TAPI_API_NETWORK_INVALID_CTXT, "TAPI_API_NETWORK_INVALID_CTXT"}, + + /*Misc */ + {TAPI_API_MISC_RETURN_NULL, "TAPI_API_MISC_RETURN_NULL"}, + {TAPI_API_MISC_VALIDITY_ERROR, "TAPI_API_MISC_VALIDITY_ERROR"}, + {TAPI_API_MISC_INPUTPARM_ERROR, "TAPI_API_MISC_INPUTPARM_ERROR"}, + {TAPI_API_MISC_OUTPARAM_NULL, "TAPI_API_MISC_OUTPARAM_NULL"}, +}; + +//#define TET_ERROR_TO_STRING(err) g_TAPI_ErrorString[(err)].string +static const char* TET_ERROR_TO_STRING(TapiResult_t err_code) +{ + int index; + for( index=0; g_TAPI_ErrorString[index].err != TAPI_ERROR_MAX ; index++) + { + if (g_TAPI_ErrorString[index].err == err_code || g_TAPI_ErrorString[index].err == TAPI_ERROR_MAX) + return g_TAPI_ErrorString[index].string; + } + return NULL; +} + +// TET_CHECK Macro : TAPI api return value test macro. If it is not TAPI_API_SUCCESS, tet_retult(TET_FAIL) is called +#define TET_CHECK(x1, y...) \ + { \ + TapiResult_t err = y;\ + if (err != (x1)) \ + { \ + tet_printf("%s[%d] : test fail. error code =%d [%s] ",__FILE__,__LINE__, err, TET_ERROR_TO_STRING(err) ); \ + tet_result(TET_FAIL); \ + return;\ + } \ + } + +#define TET_CHECK2(x1,x2, y...) \ + { \ + TapiResult_t err = y;\ + if (!(err == (x1) || err == (x2))) \ + { \ + tet_printf("%s[%d] : test fail. error code =%d [%s] ",__FILE__,__LINE__, err, TET_ERROR_TO_STRING(err) ); \ + tet_result(TET_FAIL); \ + return;\ + } \ + } + +#define TET_CHECK3(x1,x2,x3, y...) \ + { \ + TapiResult_t err = y;\ + if (!(err == (x1) || err == (x2) || err == (x3))) \ + { \ + tet_printf("%s[%d] : test fail. error code =%d [%s] ",__FILE__,__LINE__, err, TET_ERROR_TO_STRING(err) ); \ + tet_result(TET_FAIL); \ + return;\ + } \ + } + + +#endif //_TET_TAPI_UTIL_ diff --git a/TC/telephony_TC/call/unit/makefile b/TC/telephony_TC/call/unit/makefile new file mode 100644 index 0000000..b775530 --- /dev/null +++ b/TC/telephony_TC/call/unit/makefile @@ -0,0 +1,133 @@ +CC=gcc -Wall + +TS1 = uts_tel_exe_call_mo +TS2 = uts_tel_answer_call +TS3 = uts_tel_release_call +TS4 = uts_tel_release_call_all +TS5 = uts_tel_retrieve_call +TS6 = uts_tel_hold_call +TS7 = uts_tel_swap_call +TS8 = uts_tel_join_call +TS9 = uts_tel_split_call +TS10 = uts_tel_exe_call_explicit_transfer +TS11 = uts_tel_get_call_act_line +TS12 = uts_tel_set_call_act_line +TS13 = uts_tel_get_call_conf_list +TS14 = uts_tel_get_call_status +TS15 = uts_tel_get_call_duration +TS16 = uts_tel_send_call_dtmf +TS17 = uts_tel_release_call_all_active +TS18 = uts_tel_release_call_all_held +//TS19 = uts_tapi_check_status +TS20 = uts_tel_exit_call_emergency_mode +TS21 = uts_tel_exe_call_flash +TS22 = uts_tel_get_call_privacy_mode +TS23 = uts_tel_set_call_privacy_mode +TS24 = uts_tel_get_call_time +TS25 = uts_tel_activate_call_ccbs +TS26 = uts_tel_deflect_call + +LB1 = tapi_callback + +LIBS =$(LB1).o +LIBS += `pkg-config --libs gconf-2.0 dbus-1 dbus-glib-1 glib-2.0 gthread-2.0 tapi` + +LIBS +=$(TET_ROOT)/lib/tet3/tcm.o +LIBS +=-L$(TET_ROOT)/lib/tet3 -lapi + +INCS = -I. `pkg-config --cflags gconf-2.0 glib-2.0 dbus-1 dbus-glib-1 gthread-2.0 tapi` +INCS += -I$(TET_ROOT)/inc/tet3 +INCS += -I.. + +CFLAGS += $(INCS) -D__arm__ -D_ARM_TOUCH -DTELEPHONY_TIMER +CC +=$(CFLAGS) +LDFLAGS = $(LIBS) + +all : $(LB1) $(TS1) $(TS2) $(TS3) $(TS4) $(TS5) $(TS6) $(TS7) $(TS8) $(TS9) $(TS10) $(TS11) $(TS12) $(TS13) $(TS14) $(TS15) $(TS16) $(TS17) $(TS18) $(TS20) $(TS21) $(TS22) $(TS23) $(TS24) $(TS25) $(TS26) + + +clean : + rm -rf *~ *.o tet_lock tet_captured $(LB1) $(TS1) $(TS2) $(TS3) $(TS4) $(TS5) $(TS6) $(TS7) $(TS8) $(TS9) $(TS10) $(TS11) $(TS12) $(TS13) $(TS14) $(TS15) $(TS16) $(TS17) $(TS18) $(TS20) $(TS21) $(TS22) $(TS23) $(TS24) $(TS25) $(TS26) + + +$(LB1): $(LB1).c + $(CC) -c $(LB1).c + +$(TS1): $(TS1).c $(LB1) + $(CC) -o $(TS1) $(TS1).c $(LDFLAGS) + +$(TS2): $(TS2).c $(LB1) + $(CC) -o $(TS2) $(TS2).c $(LDFLAGS) + +$(TS3): $(TS3).c $(LB1) + $(CC) -o $(TS3) $(TS3).c $(LDFLAGS) + +$(TS4): $(TS4).c $(LB1) + $(CC) -o $(TS4) $(TS4).c $(LDFLAGS) + +$(TS5): $(TS5).c $(LB1) + $(CC) -o $(TS5) $(TS5).c $(LDFLAGS) + +$(TS6): $(TS6).c $(LB1) + $(CC) -o $(TS6) $(TS6).c $(LDFLAGS) + +$(TS7): $(TS7).c $(LB1) + $(CC) -o $(TS7) $(TS7).c $(LDFLAGS) + +$(TS8): $(TS8).c $(LB1) + $(CC) -o $(TS8) $(TS8).c $(LDFLAGS) + +$(TS9): $(TS9).c $(LB1) + $(CC) -o $(TS9) $(TS9).c $(LDFLAGS) + +$(TS10): $(TS10).c $(LB1) + $(CC) -o $(TS10) $(TS10).c $(LDFLAGS) + +$(TS11): $(TS11).c $(LB1) + $(CC) -o $(TS11) $(TS11).c $(LDFLAGS) + +$(TS12): $(TS12).c $(LB1) + $(CC) -o $(TS12) $(TS12).c $(LDFLAGS) + +$(TS13): $(TS13).c $(LB1) + $(CC) -o $(TS13) $(TS13).c $(LDFLAGS) + + +$(TS14): $(TS14).c $(LB1) + $(CC) -o $(TS14) $(TS14).c $(LDFLAGS) + +$(TS15): $(TS15).c $(LB1) + $(CC) -o $(TS15) $(TS15).c $(LDFLAGS) + +$(TS16): $(TS16).c $(LB1) + $(CC) -o $(TS16) $(TS16).c $(LDFLAGS) + +$(TS17): $(TS17).c $(LB1) + $(CC) -o $(TS17) $(TS17).c $(LDFLAGS) + +$(TS18): $(TS18).c $(LB1) + $(CC) -o $(TS18) $(TS18).c $(LDFLAGS) + +#$(TS19): $(TS19).c $(LB1) +# $(CC) -o $(TS19) $(TS19).c $(LDFLAGS) + +$(TS20): $(TS20).c $(LB1) + $(CC) -o $(TS20) $(TS20).c $(LDFLAGS) + +$(TS21): $(TS21).c $(LB1) + $(CC) -o $(TS21) $(TS21).c $(LDFLAGS) + +$(TS22): $(TS22).c $(LB1) + $(CC) -o $(TS22) $(TS22).c $(LDFLAGS) + +$(TS23): $(TS23).c $(LB1) + $(CC) -o $(TS23) $(TS23).c $(LDFLAGS) + +$(TS24): $(TS24).c $(LB1) + $(CC) -o $(TS24) $(TS24).c $(LDFLAGS) + +$(TS25): $(TS25).c $(LB1) + $(CC) -o $(TS25) $(TS25).c $(LDFLAGS) + +$(TS26): $(TS26).c $(LB1) + $(CC) -o $(TS26) $(TS26).c $(LDFLAGS) diff --git a/TC/telephony_TC/call/unit/tapi_callback.c b/TC/telephony_TC/call/unit/tapi_callback.c new file mode 100644 index 0000000..8c04955 --- /dev/null +++ b/TC/telephony_TC/call/unit/tapi_callback.c @@ -0,0 +1,309 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * 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 "tapi_callback.h" + +GMainLoop *main_loop = NULL; +TS_UINT g_CallHandle = -1; +TS_BOOL call_status = FALSE; +/***** TESTING FOR VALID SET OF INPTS*****/ + +TS_UINT conf_call_handle=-1 ; +static unsigned int subscription_id[32]={0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}; + +int expected_event; + +void app_callback (TelTapiEvent_t * TapiEvent) +{ + + int eventClass; + int eventType; + int requestId; + int status; + void *EventData = NULL; + + TS_UINT callHandle; + + eventClass = TapiEvent->EventClass; + eventType = TapiEvent->EventType; + requestId = TapiEvent->RequestId; + status = TapiEvent->Status; + EventData = TapiEvent->pData; + + CALL_TEST_DEBUG("Class:[%d], Event Type:[%d], RequestId:[%d], Status:[%d] \n", eventClass, eventType , requestId, status ); + if( EventData==NULL) + { + CALL_TEST_DEBUG("****** EventData is NULL......... ******\n"); + } + + switch(eventClass) + { + case TAPI_EVENT_CLASS_CALL_VOICE: + case TAPI_EVENT_CLASS_CALL_DATA: + { + + switch(eventType) + { + + case TAPI_EVENT_CALL_SETUP_CNF: + memcpy(&callHandle, EventData, sizeof(TS_UINT)); + CALL_TEST_DEBUG(" === TAPI_EVENT_CALL_SETUP_CNF. callHandle:[%d]\n",callHandle); + break; + + + case TAPI_EVENT_CALL_ALERT_IND: + memcpy(&callHandle, EventData, sizeof(TS_UINT)); + CALL_TEST_DEBUG(" === TAPI_EVENT_CALL_ALERT_IND. callHandle:[%d]\n",callHandle); + break; + + case TAPI_EVENT_CALL_INCOM_IND: + memcpy(&callHandle, EventData, sizeof(TS_UINT)); + g_CallHandle = callHandle; + CALL_TEST_DEBUG(" === TAPI_EVENT_CALL_INCOM_IND. callHandle:[%d]\n",callHandle); + break; + + case TAPI_EVENT_CALL_ANSWER_CNF: + memcpy(&callHandle, EventData, sizeof(TS_UINT)); + CALL_TEST_DEBUG(" === TAPI_EVENT_CALL_ANSWER_CNF. callHandle:[%d]\n",callHandle); + break; + + case TAPI_EVENT_CALL_WAITING_IND: + memcpy(&callHandle, EventData, sizeof(TS_UINT)); + CALL_TEST_DEBUG(" === TAPI_EVENT_CALL_WAITING_IND. callHandle:[%d]\n",callHandle); + break; + + case TAPI_EVENT_CALL_CONNECTED_IND: + + memcpy(&callHandle, EventData, sizeof(TS_UINT)); + CALL_TEST_DEBUG(" === TAPI_EVENT_CALL_CONNECTED_IND. callHandle:[%d]\n",callHandle); + break; + + case TAPI_EVENT_CALL_CONNECTING_IND: + memcpy(&callHandle, EventData, sizeof(TS_UINT)); + CALL_TEST_DEBUG(" === TAPI_EVENT_CALL_CONNECTING_IND. callHandle:[%d]\n",callHandle); + break; + + case TAPI_EVENT_CALL_RETRIEVE_CNF: + memcpy(&callHandle, EventData, sizeof(TS_UINT)); + CALL_TEST_DEBUG(" === TAPI_EVENT_CALL_RETRIEVE_CNF. callHandle:[%d]\n",callHandle); + break; + + case TAPI_EVENT_CALL_HOLD_CNF: + memcpy(&callHandle, EventData, sizeof(TS_UINT)); + CALL_TEST_DEBUG(" === TAPI_EVENT_CALL_HOLD_CNF. callHandle:[%d]\n",callHandle); + break; + + case TAPI_EVENT_CALL_SETUPCONFERENCE_CNF: + memcpy(&callHandle, EventData, sizeof(TS_UINT)); + conf_call_handle = callHandle; + CALL_TEST_DEBUG(" === TAPI_EVENT_CALL_SETUPCONFERENCE_CNF. callHandle:[%d]\n",callHandle); + break; + + case TAPI_EVENT_CALL_SPLITCONFERENCE_CNF: + memcpy(&callHandle, EventData, sizeof(TS_UINT)); + + CALL_TEST_DEBUG(" === TAPI_EVENT_CALL_SPLITCONFERENCE_CNF. callHandle:[%d]\n",callHandle); + break; + + case TAPI_EVENT_CALL_TRANSFER_CNF: + memcpy(&callHandle, EventData, sizeof(TS_UINT)); + CALL_TEST_DEBUG(" === TAPI_EVENT_CALL_TRANSFER_CNF. callHandle:[%d]\n",callHandle); + break; + + case TAPI_EVENT_CALL_SEND_DTMF_CNF: // no data. + CALL_TEST_DEBUG(" === TAPI_EVENT_CALL_SEND_DTMF_CNF. \n"); + break; + + case TAPI_EVENT_CALL_RELEASE_CNF: + memcpy(&callHandle, EventData, sizeof(TS_UINT)); + CALL_TEST_DEBUG(" === TAPI_EVENT_CALL_RELEASE_CNF. callHandle:[%d]\n",callHandle); + break; + + case TAPI_EVENT_CALL_RELEASE_ALL_CNF: // no data. + CALL_TEST_DEBUG(" === TAPI_EVENT_CALL_RELEASE_ALL_CNF. \n"); + break; + + case TAPI_EVENT_CALL_END_IND: + memcpy(&callHandle, EventData, sizeof(TS_UINT)); + CALL_TEST_DEBUG(" === TAPI_EVENT_CALL_END_IND. callHandle:[%d]\n",callHandle); + call_status = TRUE; + break; + + case TAPI_EVENT_CALL_SET_LINEID_CNF: + memcpy(&callHandle, EventData, sizeof(TS_UINT)); + CALL_TEST_DEBUG(" === TAPI_EVENT_CALL_SET_LINEID_CNF. callHandle:[%d]\n",callHandle); + call_status = TRUE; + break; + + case TAPI_EVENT_CALL_GET_LINEID_CNF: + memcpy(&callHandle, EventData, sizeof(TS_UINT)); + CALL_TEST_DEBUG(" === TAPI_EVENT_CALL_GET_LINEID_CNF. callHandle:[%d]\n",callHandle); + call_status = TRUE; + break; + + case TAPI_EVENT_CALL_RELEASE_ALL_HELD_CNF: + CALL_TEST_DEBUG(" === TAPI_EVENT_CALL_RELEASE_ALL_HELD_CNF\n"); + call_status = TRUE; + break; + + default: + CALL_TEST_DEBUG(" === VOICE EVENT CLASS. but UNKNOWN EVENT TYPE:[%d] \n", eventType); + call_status = FALSE; + break; + + } + break; + } + default: + CALL_TEST_DEBUG(" UNKNOWN EVENT CLASS:[%d] \n", eventClass); + break; + + } + if(eventType == expected_event) + g_main_loop_quit(main_loop); +} + +gboolean +TimeOutFun (void *data) +{ + g_main_loop_quit (main_loop); + printf ("Exit from this callback\n"); + call_status = FALSE; + return FALSE; + + +} + +int gmain_loop_for_tapi_events(int delay) +{ + + main_loop = g_main_loop_new (NULL, FALSE); + g_timeout_add (delay, TimeOutFun, NULL); + g_main_loop_run (main_loop); + + return 0; + + +} + + + + + +void print_all_subsciption_ids() +{ + int i=0; + for(i=0;i<27;i++) + { + printf("\n subscription_id[%d] has value %d \n",i,subscription_id[i]); + } +} + +TapiResult_t register_all_events() +{ + TapiResult_t api_err = TAPI_API_SUCCESS; + + api_err = tel_register_event(TAPI_EVENT_CALL_SETUP_CNF, &subscription_id[0], (TelAppCallback)&app_callback,NULL); + api_err = tel_register_event(TAPI_EVENT_CALL_ALERT_IND, &subscription_id[1], (TelAppCallback)&app_callback,NULL); + api_err = tel_register_event(TAPI_EVENT_CALL_CONNECTING_IND, &subscription_id[2], (TelAppCallback)&app_callback,NULL); + api_err = tel_register_event(TAPI_EVENT_CALL_CONNECTED_IND, &subscription_id[3], (TelAppCallback)&app_callback,NULL); + api_err = tel_register_event(TAPI_EVENT_CALL_INCOM_IND, &subscription_id[4], (TelAppCallback)&app_callback,NULL); + api_err = tel_register_event(TAPI_EVENT_CALL_ANSWER_CNF, &subscription_id[5], (TelAppCallback)&app_callback,NULL); + api_err = tel_register_event(TAPI_EVENT_CALL_RETRIEVE_CNF, &subscription_id[6], (TelAppCallback)&app_callback,NULL); + api_err = tel_register_event(TAPI_EVENT_CALL_RETRIEVE_IND, &subscription_id[7], (TelAppCallback)&app_callback,NULL); + api_err = tel_register_event(TAPI_EVENT_CALL_HOLD_IND, &subscription_id[8], (TelAppCallback)&app_callback,NULL); + api_err = tel_register_event(TAPI_EVENT_CALL_HOLD_CNF, &subscription_id[9], (TelAppCallback)&app_callback,NULL); + api_err = tel_register_event(TAPI_EVENT_CALL_TRANSFER_CNF, &subscription_id[10], (TelAppCallback)&app_callback,NULL); + api_err = tel_register_event(TAPI_EVENT_CALL_TRANSFER_IND, &subscription_id[11], (TelAppCallback)&app_callback,NULL); + api_err = tel_register_event(TAPI_EVENT_CALL_SETUPCONFERENCE_CNF, &subscription_id[12], (TelAppCallback)&app_callback,NULL); + api_err = tel_register_event(TAPI_EVENT_CALL_SETUPCONFERENCE_IND, &subscription_id[13], (TelAppCallback)&app_callback,NULL); + api_err = tel_register_event(TAPI_EVENT_CALL_SPLITCONFERENCE_CNF, &subscription_id[14], (TelAppCallback)&app_callback,NULL); + api_err = tel_register_event(TAPI_EVENT_CALL_SEND_DTMF_CNF, &subscription_id[15], (TelAppCallback)&app_callback,NULL); + api_err = tel_register_event(TAPI_EVENT_CALL_WAITING_IND, &subscription_id[16], (TelAppCallback)&app_callback,NULL); + api_err = tel_register_event(TAPI_EVENT_CALL_FORWARD_IND, &subscription_id[17], (TelAppCallback)&app_callback,NULL); + //api_err = tel_register_event(TAPI_EVENT_CALL_USERINFO_IND, &subscription_id[18], (TelAppCallback)&app_callback,NULL); + api_err = tel_register_event(TAPI_EVENT_CALL_RELEASE_CNF, &subscription_id[19], (TelAppCallback)&app_callback,NULL); + api_err = tel_register_event(TAPI_EVENT_CALL_RELEASE_ALL_CNF, &subscription_id[20], (TelAppCallback)&app_callback,NULL); + api_err = tel_register_event(TAPI_EVENT_CALL_RELEASE_ALL_ACTIVE_CNF, &subscription_id[21], (TelAppCallback)&app_callback,NULL); + api_err = tel_register_event(TAPI_EVENT_CALL_END_IND, &subscription_id[22], (TelAppCallback)&app_callback,NULL); + api_err = tel_register_event(TAPI_EVENT_CALL_GET_LINEID_CNF, &subscription_id[23], (TelAppCallback)&app_callback,NULL); + api_err = tel_register_event(TAPI_EVENT_CALL_SET_LINEID_CNF, &subscription_id[24], (TelAppCallback)&app_callback,NULL); + api_err = tel_register_event(TAPI_EVENT_CALL_SWAP_CNF, &subscription_id[25], (TelAppCallback)&app_callback,NULL); + /* For multiparty call */ + api_err = tel_register_event(TAPI_EVENT_SS_WAITING_CNF, &subscription_id[26], (TelAppCallback)&app_callback,NULL); + + /* For multiparty call */ + api_err = tel_register_event(TAPI_EVENT_CALL_RELEASE_ALL_HELD_CNF, &subscription_id[27], (TelAppCallback)&app_callback,NULL); + +// api_err = tel_register_event(TAPI_EVENT_CALL_EXIT_EMERGENCYMODE_CNF, &subscription_id[28], (TelAppCallback)&app_callback,NULL); + + api_err = tel_register_event(TAPI_EVENT_CALL_FLASHINFO_CNF, &subscription_id[28], (TelAppCallback)&app_callback,NULL); + +// api_err = tel_register_event(TAPI_EVENT_CALL_SET_PRIVACYMODE_CNF, &subscription_id[30], (TelAppCallback)&app_callback,NULL); + +// api_err = tel_register_event(TAPI_EVENT_CALL_GET_PRIVACYMODE_CNF, &subscription_id[31], (TelAppCallback)&app_callback,NULL); + + +// print_all_subsciption_ids(); + return api_err; +} + + + TapiResult_t deregister_all() +{ + TapiResult_t api_err = TAPI_API_SUCCESS; + + api_err = tel_deregister_event(subscription_id[0]); + api_err = tel_deregister_event(subscription_id[1]); + api_err = tel_deregister_event(subscription_id[2]); + api_err = tel_deregister_event(subscription_id[3]); + api_err = tel_deregister_event(subscription_id[4]); + api_err = tel_deregister_event(subscription_id[5]); + api_err = tel_deregister_event(subscription_id[6]); + api_err = tel_deregister_event(subscription_id[7]); + api_err = tel_deregister_event(subscription_id[8]); + api_err = tel_deregister_event(subscription_id[9]); + api_err = tel_deregister_event(subscription_id[10]); + api_err = tel_deregister_event(subscription_id[11]); + api_err = tel_deregister_event(subscription_id[12]); + api_err = tel_deregister_event(subscription_id[13]); + api_err = tel_deregister_event(subscription_id[14]); + api_err = tel_deregister_event(subscription_id[15]); + api_err = tel_deregister_event(subscription_id[16]); + api_err = tel_deregister_event(subscription_id[17]); + api_err = tel_deregister_event(subscription_id[18]); + api_err = tel_deregister_event(subscription_id[19]); + api_err = tel_deregister_event(subscription_id[20]); + api_err = tel_deregister_event(subscription_id[21]); + api_err = tel_deregister_event(subscription_id[22]); + api_err = tel_deregister_event(subscription_id[23]); + api_err = tel_deregister_event(subscription_id[24]); + api_err = tel_deregister_event(subscription_id[25]); + api_err = tel_deregister_event(subscription_id[26]); + api_err = tel_deregister_event(subscription_id[27]); +// api_err = tel_deregister_event(subscription_id[28]); + api_err = tel_deregister_event(subscription_id[28]); +/// api_err = tel_deregister_event(subscription_id[30]); +// api_err = tel_deregister_event(subscription_id[31]); + + return api_err; + +} + diff --git a/TC/telephony_TC/call/unit/tapi_callback.h b/TC/telephony_TC/call/unit/tapi_callback.h new file mode 100644 index 0000000..021b7c6 --- /dev/null +++ b/TC/telephony_TC/call/unit/tapi_callback.h @@ -0,0 +1,57 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * 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 __UTS_TAPI_COMMON_H_ +#define __UTS_TAPI_COMMON_H_ + +/* Includes */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + + + +#define CALL_TEST_DEBUG(fmt, args...) \ + printf("[%s %s:%d]\n" fmt "\n",__FILE__, __FUNCTION__, __LINE__, ##args); + +extern int gmain_loop_for_tapi_events(int delay); + +extern void app_callback (TelTapiEvent_t * TapiEvent); +extern gboolean TimeOutFun (void *data); + + +extern TapiResult_t register_all_events(); + +extern TapiResult_t deregister_all(); + +void print_all_subsciption_ids(); + + +#endif diff --git a/TC/telephony_TC/call/unit/tslist b/TC/telephony_TC/call/unit/tslist new file mode 100644 index 0000000..1c6d5c4 --- /dev/null +++ b/TC/telephony_TC/call/unit/tslist @@ -0,0 +1,22 @@ +/call/unit/uts_tel_get_call_time +#//call/unit/uts_tel_exe_call_flash +#//call/unit/uts_tel_exit_call_emergency_mode +#//call/unit/uts_tel_get_call_privacy_mode +#//call/unit/uts_tel_set_call_privacy_mode +#//call/unit/uts_tel_answer_call +/call/unit/uts_tel_exe_call_mo +/call/unit/uts_tel_release_call +/call/unit/uts_tel_release_call_all +/call/unit/uts_tel_release_call_all_active +/call/unit/uts_tel_hold_call +/call/unit/uts_tel_retrieve_call +/call/unit/uts_tel_swap_call +/call/unit/uts_tel_send_call_dtmf +/call/unit/uts_tel_join_call +/call/unit/uts_tel_split_call +/call/unit/uts_tel_get_call_act_line +#//call/unit/uts_tel_exe_call_explicit_transfer +/call/unit/uts_tel_get_call_status +/call/unit/uts_tel_get_call_duration +/call/unit/uts_tel_get_call_conf_list +/call/unit/uts_tel_set_call_act_line diff --git a/TC/telephony_TC/call/unit/uts_tapi_check_status.c b/TC/telephony_TC/call/unit/uts_tapi_check_status.c new file mode 100644 index 0000000..b363c54 --- /dev/null +++ b/TC/telephony_TC/call/unit/uts_tapi_check_status.c @@ -0,0 +1,126 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * 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 "uts_tapi_check_status.h" + + +/* Initialize TCM data structures */ + + + + + +/* +* tapi_api_err_t tel_exe_call_mo(tel_exe_call_mo_info_t const * const ptr_call_setup_info, +* tapi_call_handle *ptr_call_handle); +*/ + + +void (*tet_startup) () = startup; +void (*tet_cleanup) () = cleanup; + +extern int expected_event; + +static void startup() +{ + TapiResult_t ret_status ; + tapi_dbus_connection_name dname; + int bStatus; + ret_status = tel_init(); + + if(ret_status != TAPI_API_SUCCESS) + { + printf("tel_init() Failed ret_status = %d \n",ret_status); + } + + + register_all_events(); + tel_register_app_name("org.samsung.test"); + if(tel_get_app_name(&dname)) + printf("Dbus Get app name error\n"); + else + printf("Dbus Name is %s\n",dname.name); + + tel_check_service_ready(&bStatus); + printf("Telephpny service %d\n",bStatus); + + g_CallHandle = -1; +} + +static void cleanup() +{ + deregister_all(); + + tel_deinit(); +} + +/** + * @brief This tests tapi_common_check_status() API in normal conditions + * @par ID: + * UTC_TAPI_CHECK_STATUS_01 + * @param [out] status + * @return TAPI_API_SUCCESS +*/ + +/***** TESTING FOR VALID SET OF INPUTS*****/ + +void utc_tapi_check_status_01() +{ + CALL_TEST_DEBUG("\n######## TEST START ###########\n"); + TapiResult_t ret_status ; + TS_BOOL * status; + ret_status = tapi_common_check_status(&status); + if(ret_status !=TAPI_API_SUCCESS) + { + tet_result(TET_FAIL); + } + printf("utc_tapi_check_status_01 pass"); + tet_result(TET_PASS); + + return; +} +/** + * @brief This tests tapi_common_check_status() API in abnormal conditions + * @par ID: + * UTC_TAPI_CHECK_STATUS_02 + * @param [out] status + * @return TAPI_API_FAILURE +*/ + +/***** TESTING FOR VALID SET OF INPUTS*****/ + +void utc_tapi_check_status_02() +{ + CALL_TEST_DEBUG("\n######## TEST START ###########\n"); + TapiResult_t ret_status ; + + ret_status = tapi_common_check_status(NULL); + + if(ret_status ==TAPI_API_SUCCESS) + { + tet_result(TET_FAIL); + } + printf("utc_tapi_check_status_02 pass"); + tet_result(TET_PASS); + + return; +} + diff --git a/TC/telephony_TC/call/unit/uts_tapi_check_status.h b/TC/telephony_TC/call/unit/uts_tapi_check_status.h new file mode 100644 index 0000000..3a77f2b --- /dev/null +++ b/TC/telephony_TC/call/unit/uts_tapi_check_status.h @@ -0,0 +1,51 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * 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 __UTS_TAPI_CHECK_STATUS_H_ +#define __UTS_TAPI_CHECK_STATUS_H_ + +#include "tapi_callback.h" +#include +#include "call_common.h" +//#include + +extern TS_UINT g_CallHandle; +extern TS_BOOL call_status; + + static void utc_tapi_check_status_01(void); + static void utc_tapi_check_status_02(void); + + static void startup(); + + static void cleanup(); + + +struct tet_testlist tet_testlist[] = { + {utc_tapi_check_status_01, 1}, + {utc_tapi_check_status_02, 2}, + {NULL, 0} + }; + +#endif + +/** + * @} + */ diff --git a/TC/telephony_TC/call/unit/uts_tel_activate_call_ccbs.c b/TC/telephony_TC/call/unit/uts_tel_activate_call_ccbs.c new file mode 100644 index 0000000..bdb2519 --- /dev/null +++ b/TC/telephony_TC/call/unit/uts_tel_activate_call_ccbs.c @@ -0,0 +1,266 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** +* @ingroup TELEPHONY_FRAMEWORK_API +* @addtogroup CALL +*/ + +/** +* @ingroup CALL +* @addtogroup UTS_TEL_ACTIVE_CALL_CCBS Unit +*/ + +/** +* @ingroup UTS_TEL_ACTIVE_CALL_CCBS Unit +* @addtogroup UTS_TEL_ACTIVE_CALL_CCBS_ Uts_Tel_Active_Call_Ccbs +* @{ +*/ + +/** +* @file uts_tel_activate_call_ccbs.c +* @brief This is a suit of unit test cases to test tel_activate_call_ccbs() API function +* @author Gautam Nand Sinha (gnand.sinha@samsung.com) +* @version Initial Creation Version 0.1 +* @date 2010.06.29 +*/ + +#include "uts_tel_activate_call_ccbs.h" + + +/* Initialize TCM data structures */ + + + + + +/* +* TapiResult_t tel_activate_call_ccbs(unsigned int call_handle, int *pRequestID) +*/ + +void (*tet_startup) () = startup; +void (*tet_cleanup) () = cleanup; + + +extern int expected_event; + +static void startup() +{ + TapiResult_t ret_status ; + tapi_dbus_connection_name dname; + int bStatus; + ret_status = tel_init(); + + if(ret_status != TAPI_API_SUCCESS) + { + tet_printf("tel_init() Failed ret_status = %d \n",ret_status); + } + + register_all_events(); + tel_register_app_name("org.samsung.test"); + if(tel_get_app_name(&dname)) + printf("Dbus Get app name error\n"); + else + printf("Dbus Name is %s\n",dname.name); + + tel_check_service_ready(&bStatus); + printf("Telephpny service %d\n",bStatus); + + g_CallHandle = -1; +} + +static void cleanup() +{ + int RequestId; + tel_release_call_all(&RequestId); + expected_event = TAPI_EVENT_CALL_END_IND; + gmain_loop_for_tapi_events(TIME_DELAY1); + deregister_all(); + + tel_deinit(); + +} + + +/** + * @brief This tests tel_activate_call_ccbs() API in normal conditions + * @par ID: + * UTC_TEL_DEFLECT_CALL_01 + * @param [in] CallHandle = callhandle + * @param [out] pCallStatus = &CallStatus +* @return TAPI_API_SUCCESS +*/ + +void utc_tel_activate_call_ccbs_01() +{ + CALL_TEST_DEBUG("\n######## TEST START ###########\n"); + TapiResult_t ret_status ; + int RequestId = -1; + TS_UINT call_handle; + TelCallDeflectDstInfo_t info; + TelCallStatus_t CallStatus; + TelCallSetupParams_t setup_call_info; + char normal[16] = MOB_NUM1; + + memset(&setup_call_info, 0, sizeof(TelCallSetupParams_t)); + setup_call_info.CallType = TAPI_CALL_TYPE_VOICE; //VOICE CALL + strncpy(setup_call_info.szNumber, normal, 13); + tet_printf("called number = %s\n", setup_call_info.szNumber); + + //setup_call_info.IdentityMode = TAPI_CALL_IDENTITY_SHOW; + + tel_exe_call_mo(&setup_call_info, &call_handle, &RequestId); + + expected_event = TAPI_EVENT_CALL_CONNECTED_IND; + gmain_loop_for_tapi_events(TIME_DELAY1); + + RequestId = -1; + + ret_status = tel_activate_call_ccbs (call_handle,&RequestId); + + tet_printf ("bMoCall = %d \n pNumber = %s\n CallType = %d\n allActiveState=%d\n CallState =%d\n bConferenceState =%d\n", CallStatus.bMoCall, CallStatus.pNumber, CallStatus.CallType, CallStatus.CallActiveState, CallStatus.CallState, CallStatus.bConferenceState); + + + if(ret_status == TAPI_API_SUCCESS) + { + tet_printf("utc_tel_activate_call_ccbs_01 has passed and Data in ret_status is %d\n", ret_status); + tet_result(TET_PASS); + } + else + { + tet_printf("utc_tel_activate_call_ccbs_01 has failed and Data in ret_status is %d\n", ret_status); + tet_result(TET_FAIL); + } + + + +} + +/** + * @brief This tests tel_activate_call_ccbs() API in normal conditions + * @par ID: + * UTC_TEL_DEFLECT_CALL_02 + * @param [in] CallHandle = callhandle + * @param [out] pCallStatus = NULL +* @return TAPI_API_INVALID_CALL_HANDLE +*/ + +void utc_tel_activate_call_ccbs_02() +{ + CALL_TEST_DEBUG("\n######## TEST START ###########\n"); + TapiResult_t ret_status ; + int RequestId = -1; + TS_UINT call_handle; + TelCallDeflectDstInfo_t info; + TelCallStatus_t CallStatus; + TelCallSetupParams_t setup_call_info; + char normal[16] = MOB_NUM1; + + memset(&setup_call_info, 0, sizeof(TelCallSetupParams_t)); + setup_call_info.CallType = TAPI_CALL_TYPE_VOICE; //VOICE CALL + strncpy(setup_call_info.szNumber, normal, 13); + tet_printf("called number = %s\n", setup_call_info.szNumber); + + //setup_call_info.IdentityMode = TAPI_CALL_IDENTITY_SHOW; + + tel_exe_call_mo(&setup_call_info, &call_handle, &RequestId); + + expected_event = TAPI_EVENT_CALL_CONNECTED_IND; + gmain_loop_for_tapi_events(TIME_DELAY1); + + RequestId = -1; + + ret_status = tel_activate_call_ccbs (call_handle,NULL); + + tet_printf ("bMoCall = %d \n pNumber = %s\n CallType = %d\n allActiveState=%d\n CallState =%d\n bConferenceState =%d\n", CallStatus.bMoCall, CallStatus.pNumber, CallStatus.CallType, CallStatus.CallActiveState, CallStatus.CallState, CallStatus.bConferenceState); + + + if(ret_status != TAPI_API_SUCCESS) + { + tet_printf("utc_tel_activate_call_ccbs_02 has passed and Data in ret_status is %d\n", ret_status); + tet_result(TET_PASS); + } + else + { + tet_printf("utc_tel_activate_call_ccbs_02 has failed and Data in ret_status is %d\n", ret_status); + tet_result(TET_FAIL); + } + + + +} + + +/** + * @brief This tests tel_activate_call_ccbs() API in normal conditions + * @par ID: + * UTC_TEL_DEFLECT_CALL_03 + * @param [in] CallHandle = -1 + * @param [out] pCallStatus = NULL +* @return TAPI_API_INVALID_CALL_HANDLE +*/ + +void utc_tel_activate_call_ccbs_03() +{ + CALL_TEST_DEBUG("\n######## TEST START ###########\n"); + TapiResult_t ret_status ; + int RequestId = -1; + TS_UINT call_handle; + TelCallDeflectDstInfo_t info; + TelCallStatus_t CallStatus; + TelCallSetupParams_t setup_call_info; + char normal[16] = MOB_NUM1; + + memset(&setup_call_info, 0, sizeof(TelCallSetupParams_t)); + setup_call_info.CallType = TAPI_CALL_TYPE_VOICE; //VOICE CALL + strncpy(setup_call_info.szNumber, normal, 13); + tet_printf("called number = %s\n", setup_call_info.szNumber); + + //setup_call_info.IdentityMode = TAPI_CALL_IDENTITY_SHOW; + + tel_exe_call_mo(&setup_call_info, &call_handle, &RequestId); + + expected_event = TAPI_EVENT_CALL_CONNECTED_IND; + gmain_loop_for_tapi_events(TIME_DELAY1); + + RequestId = -1; + + ret_status = tel_activate_call_ccbs (-1,NULL); + + tet_printf ("bMoCall = %d \n pNumber = %s\n CallType = %d\n allActiveState=%d\n CallState =%d\n bConferenceState =%d\n", CallStatus.bMoCall, CallStatus.pNumber, CallStatus.CallType, CallStatus.CallActiveState, CallStatus.CallState, CallStatus.bConferenceState); + + + if(ret_status != TAPI_API_SUCCESS) + { + tet_printf("utc_tel_activate_call_ccbs_03 has passed and Data in ret_status is %d\n", ret_status); + tet_result(TET_PASS); + } + else + { + tet_printf("utc_tel_activate_call_ccbs_03 has failed and Data in ret_status is %d\n", ret_status); + tet_result(TET_FAIL); + } + + + +} + + + diff --git a/TC/telephony_TC/call/unit/uts_tel_activate_call_ccbs.h b/TC/telephony_TC/call/unit/uts_tel_activate_call_ccbs.h new file mode 100644 index 0000000..725fa77 --- /dev/null +++ b/TC/telephony_TC/call/unit/uts_tel_activate_call_ccbs.h @@ -0,0 +1,91 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** +* @ingroup TELEPHONY_FRAMEWORK_API +* @addtogroup CALL +*/ + +/** +* @ingroup CALL +* @addtogroup UTS_TEL_ACTIVE_CALL_CCBS Unit +*/ + +/** +* @ingroup UTS_TEL_ACTIVE_CALL_CCBS Unit +* @addtogroup UTS_TEL_ACTIVE_CALL_CCBS_ Uts_Tel_Active_Call_Ccbs +* @{ +*/ + +/** +* @file uts_tel_activate_call_ccbs.h +* @brief This is a suit of unit test cases to test tel_activate_call_ccbs() API function +* @author Gautam Nand Sinha (gnand.sinha@samsung.com) +* @version Initial Creation Version 0.1 +* @date 2010.06.29 +*/ + +#ifndef __UTS_TEL_ACTIVE_CALL_CCBS_H_ +#define __UTS_TEL_ACTIVE_CALL_CCBS_H_ + +/* Includes */ + + +#include "tapi_callback.h" +#include +#include "call_common.h" + +extern TS_UINT g_CallHandle; +extern TS_BOOL call_status; + + + +/** +* @test This test case tests TapiResult_t el_deflect_call(unsigned int call_handle, const TelCallDeflectDstInfo_t *info, int *pRequestID) +* @brief This API is used to test to get the call information. +* @return tapi_api_err_t +*/ + + + static void utc_tel_activate_call_ccbs_01(void); + + static void utc_tel_activate_call_ccbs_02(void); + + static void utc_tel_activate_call_ccbs_03(void); + + + + static void startup(); + + static void cleanup(); + + +struct tet_testlist tet_testlist[] = { + {utc_tel_activate_call_ccbs_01, 1}, + {utc_tel_activate_call_ccbs_02, 2}, + {utc_tel_activate_call_ccbs_03, 3}, + {NULL, 0} + }; + +#endif + +/** + * @} + */ diff --git a/TC/telephony_TC/call/unit/uts_tel_answer_call.c b/TC/telephony_TC/call/unit/uts_tel_answer_call.c new file mode 100644 index 0000000..ae8ccd1 --- /dev/null +++ b/TC/telephony_TC/call/unit/uts_tel_answer_call.c @@ -0,0 +1,160 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * 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 "uts_tel_answer_call.h" + +/* Initialize TCM data structures */ + +/* +* tapi_api_err_t tel_exe_call_mo(tel_exe_call_mo_info_t const * const ptr_call_setup_info, +* tapi_call_handle *ptr_call_handle); +*/ +void (*tet_startup) () = startup; +void (*tet_cleanup) () = cleanup; + +extern int expected_event; + +static void startup() +{ + TapiResult_t ret_status ; + tapi_dbus_connection_name dname; + int bStatus; + ret_status = tel_init(); + + if(ret_status != TAPI_API_SUCCESS) + { + printf("tel_init() Failed ret_status = %d \n",ret_status); + } + + + register_all_events(); + tel_register_app_name("org.samsung.test"); + if(tel_get_app_name(&dname)) + printf("Dbus Get app name error\n"); + else + printf("Dbus Name is %s\n",dname.name); + + tel_check_service_ready(&bStatus); + printf("Telephpny service %d\n",bStatus); + + g_CallHandle = -1; +} + +static void cleanup() +{ + deregister_all(); + + tel_deinit(); +} + +/** + * @brief This tests tel_answer_call() API in normal conditions MO call. + * @par ID: + * UTC_TEL_ANSWER_CALL_01 + * @param [in] CallHandle = g_CallHandle + * @param [in] AnsType = TEL_ANSWER_CALL_ACCEPT + * @param [out] pRequestId = &RequestId + * @return TAPI_API_SUCCESS +*/ + +/***** TESTING FOR VALID SET OF INPUTS*****/ + +void utc_tel_answer_call_01() +{ + CALL_TEST_DEBUG("\n######## TEST START ###########\n"); + TapiResult_t ret_status ; + int RequestId = -1; + CALL_TEST_DEBUG("\n /**************************************** Give a MT Call within 20 secs ****************************/\n"); + gmain_loop_for_tapi_events(TIME_DELAY1); + ret_status = tel_answer_call(g_CallHandle, TAPI_CALL_ANSWER_ACCEPT, &RequestId); + g_CallHandle = -1; + + TET_CHECK(TAPI_API_SUCCESS, ret_status); + expected_event = TAPI_EVENT_CALL_ANSWER_CNF; + gmain_loop_for_tapi_events(TIME_DELAY1); + + TET_CHECK(TAPI_API_SUCCESS, ret_status); + printf("utc_tel_answer_call_01 pass"); + tet_result(TET_PASS); + tel_release_call_all(&RequestId); + gmain_loop_for_tapi_events(TIME_DELAY1); + + return; +} + +/** + * @brief This tests tel_answer_call() API in normal conditions in MT call. + * @par ID: + * UTC_TEL_ANSWER_CALL_02 + * @param [in] CallHandle = g_CallHandle + * @param [in] AnsType = TAPI_CALL_ANSWER_REJECT + * @param [out] pRequestId = &RequestId + * @return TAPI_API_SUCCESS +*/ + +void utc_tel_answer_call_02() +{ + CALL_TEST_DEBUG("\n######## TEST START ###########\n"); + TapiResult_t ret_status ; + int RequestId = -1; + + CALL_TEST_DEBUG("\n /**************************************** Give a MT Call within 20 secs /****************************/\n"); + + gmain_loop_for_tapi_events(TIME_DELAY1); + + ret_status = tel_answer_call(g_CallHandle, TAPI_CALL_ANSWER_REJECT, &RequestId); + g_CallHandle = -1; + gmain_loop_for_tapi_events(TIME_DELAY1); + expected_event = TAPI_EVENT_CALL_ANSWER_CNF; + TET_CHECK(TAPI_API_SUCCESS, ret_status); + printf("utc_tel_answer_call_02 pass"); + tel_release_call_all(&RequestId); + tet_result(TET_PASS); + gmain_loop_for_tapi_events(TIME_DELAY1); + + return; +} + +/** + * @brief This tests tel_answer_call() API in abnormal conditions + * @par ID: + * UTC_TEL_ANSWER_CALL_03 + * @param [in] CallHandle = g_CallHandle + * @param [in] AnsType = TEL_ANSWER_CALL_ACCEPT + * @param [out] pRequestId = NULL + * @return TAPI_API_INVALID_PTR +*/ + +void utc_tel_answer_call_03() +{ + CALL_TEST_DEBUG("\n######## TEST START ###########\n"); + TapiResult_t ret_status ; + + ret_status = tel_answer_call(g_CallHandle, TAPI_CALL_ANSWER_ACCEPT, NULL); + + TET_CHECK(TAPI_API_INVALID_PTR, ret_status); + + printf("utc_tel_answer_call_03 pass"); + tet_result(TET_PASS); + + return; +} + diff --git a/TC/telephony_TC/call/unit/uts_tel_answer_call.h b/TC/telephony_TC/call/unit/uts_tel_answer_call.h new file mode 100644 index 0000000..bed1bc4 --- /dev/null +++ b/TC/telephony_TC/call/unit/uts_tel_answer_call.h @@ -0,0 +1,50 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * 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 __UTS_TEL_ANSWER_CALL_H_ +#define __UTS_TEL_ANSWER_SETUP_H_ + +#include "tapi_callback.h" +#include +#include "call_common.h" + +extern TS_UINT g_CallHandle; +extern TS_BOOL call_status; + + static void utc_tel_answer_call_01(void); + + static void utc_tel_answer_call_02(void); + + static void utc_tel_answer_call_03(void); + + static void startup(); + + static void cleanup(); + + +struct tet_testlist tet_testlist[] = { + {utc_tel_answer_call_01, 1}, + {utc_tel_answer_call_02, 2}, + {utc_tel_answer_call_03, 3}, + {NULL, 0} + }; + +#endif diff --git a/TC/telephony_TC/call/unit/uts_tel_deflect_call.c b/TC/telephony_TC/call/unit/uts_tel_deflect_call.c new file mode 100644 index 0000000..8c0add1 --- /dev/null +++ b/TC/telephony_TC/call/unit/uts_tel_deflect_call.c @@ -0,0 +1,269 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** +* @ingroup TELEPHONY_FRAMEWORK_API +* @addtogroup CALL +*/ + +/** +* @ingroup CALL +* @addtogroup UTS_TEL_DEFLECT_CALL Unit +*/ + +/** +* @ingroup UTS_TEL_DEFLECT_CALL Unit +* @addtogroup UTS_TEL_DEFLECT_CALL_ Uts_Tel_Deflect_Call +* @{ +*/ + +/** +* @file uts_tel_deflect_call.c +* @brief This is a suit of unit test cases to test tel_deflect_call() API function +* @author Gautam Nand Sinha (gnand.sinha@samsung.com) +* @version Initial Creation Version 0.1 +* @date 2010.06.29 +*/ + +#include "uts_tel_deflect_call.h" + + +/* Initialize TCM data structures */ + + + + + +/* +* TapiResult_t tel_deflect_call(unsigned int call_handle, const TelCallDeflectDstInfo_t *info, int *pRequestID) +*/ + +void (*tet_startup) () = startup; +void (*tet_cleanup) () = cleanup; + + +extern int expected_event; + +static void startup() +{ + TapiResult_t ret_status ; + tapi_dbus_connection_name dname; + int bStatus; + ret_status = tel_init(); + + if(ret_status != TAPI_API_SUCCESS) + { + printf("tel_init() Failed ret_status = %d \n",ret_status); + } + + register_all_events(); + tel_register_app_name("org.samsung.test"); + if(tel_get_app_name(&dname)) + printf("Dbus Get app name error\n"); + else + printf("Dbus Name is %s\n",dname.name); + + tel_check_service_ready(&bStatus); + printf("Telephpny service %d\n",bStatus); + + g_CallHandle = -1; +} + +static void cleanup() +{ + int RequestId; + tel_release_call_all(&RequestId); + expected_event = TAPI_EVENT_CALL_END_IND; + gmain_loop_for_tapi_events(TIME_DELAY1); + deregister_all(); + + tel_deinit(); + +} + + +/** + * @brief This tests tel_deflect_call() API in normal conditions + * @par ID: + * UTC_TEL_DEFLECT_CALL_01 + * @param [in] CallHandle = callhandle + * @param [out] info = &info + * @param [out] pCallStatus = &CallStatus +* @return TAPI_API_SUCCESS +*/ + +void utc_tel_deflect_call_01() +{ + CALL_TEST_DEBUG("\n######## TEST START ###########\n"); + TapiResult_t ret_status ; + int RequestId = -1; + TS_UINT call_handle; + TelCallDeflectDstInfo_t info; + TelCallStatus_t CallStatus; + TelCallSetupParams_t setup_call_info; + char normal[16] = MOB_NUM1; + + memset(&setup_call_info, 0, sizeof(TelCallSetupParams_t)); + setup_call_info.CallType = TAPI_CALL_TYPE_VOICE; //VOICE CALL + strncpy(setup_call_info.szNumber, normal, 13); + tet_printf("called number = %s\n", setup_call_info.szNumber); + + //setup_call_info.IdentityMode = TAPI_CALL_IDENTITY_SHOW; + + tel_exe_call_mo(&setup_call_info, &call_handle, &RequestId); + + expected_event = TAPI_EVENT_CALL_CONNECTED_IND; + gmain_loop_for_tapi_events(TIME_DELAY1); + + RequestId = -1; + + ret_status = tel_deflect_call (call_handle,&info,&RequestId); + + tet_printf ("bMoCall = %d \n pNumber = %s\n CallType = %d\n allActiveState=%d\n CallState =%d\n bConferenceState =%d\n", CallStatus.bMoCall, CallStatus.pNumber, CallStatus.CallType, CallStatus.CallActiveState, CallStatus.CallState, CallStatus.bConferenceState); + + + if(ret_status == TAPI_API_SUCCESS) + { + printf("utc_tel_deflect_call_01 pass\n"); + tet_result(TET_PASS); + } + else + { + printf("utc_tel_deflect_call_01 pass\n"); + tet_result(TET_FAIL); + } + + + +} + +/** + * @brief This tests tel_deflect_call() API in normal conditions + * @par ID: + * UTC_TEL_DEFLECT_CALL_02 + * @param [in] CallHandle = callhandle + * @param [out] info = NULL + * @param [out] pCallStatus = &CallStatus +* @return TAPI_API_INVALID_CALL_HANDLE +*/ + +void utc_tel_deflect_call_02() +{ + CALL_TEST_DEBUG("\n######## TEST START ###########\n"); + TapiResult_t ret_status ; + int RequestId = -1; + TS_UINT call_handle; + TelCallDeflectDstInfo_t info; + TelCallStatus_t CallStatus; + TelCallSetupParams_t setup_call_info; + char normal[16] = MOB_NUM1; + + memset(&setup_call_info, 0, sizeof(TelCallSetupParams_t)); + setup_call_info.CallType = TAPI_CALL_TYPE_VOICE; //VOICE CALL + strncpy(setup_call_info.szNumber, normal, 13); + tet_printf("called number = %s\n", setup_call_info.szNumber); + + //setup_call_info.IdentityMode = TAPI_CALL_IDENTITY_SHOW; + + tel_exe_call_mo(&setup_call_info, &call_handle, &RequestId); + + expected_event = TAPI_EVENT_CALL_CONNECTED_IND; + gmain_loop_for_tapi_events(TIME_DELAY1); + + RequestId = -1; + + ret_status = tel_deflect_call (call_handle,NULL,&RequestId); + + tet_printf ("bMoCall = %d \n pNumber = %s\n CallType = %d\n allActiveState=%d\n CallState =%d\n bConferenceState =%d\n", CallStatus.bMoCall, CallStatus.pNumber, CallStatus.CallType, CallStatus.CallActiveState, CallStatus.CallState, CallStatus.bConferenceState); + + + if(ret_status != TAPI_API_SUCCESS) + { + printf("utc_tel_deflect_call_02 pass\n"); + tet_result(TET_PASS); + } + else + { + printf("utc_tel_deflect_call_02 pass\n"); + tet_result(TET_FAIL); + } + + + +} + + +/** + * @brief This tests tel_deflect_call() API in normal conditions + * @par ID: + * UTC_TEL_DEFLECT_CALL_03 + * @param [in] CallHandle = callhandle + * @param [out] info = NULL + * @param [out] pCallStatus = NULL +* @return TAPI_API_INVALID_CALL_HANDLE +*/ + +void utc_tel_deflect_call_03() +{ + CALL_TEST_DEBUG("\n######## TEST START ###########\n"); + TapiResult_t ret_status ; + int RequestId = -1; + TS_UINT call_handle; + TelCallDeflectDstInfo_t info; + TelCallStatus_t CallStatus; + TelCallSetupParams_t setup_call_info; + char normal[16] = MOB_NUM1; + + memset(&setup_call_info, 0, sizeof(TelCallSetupParams_t)); + setup_call_info.CallType = TAPI_CALL_TYPE_VOICE; //VOICE CALL + strncpy(setup_call_info.szNumber, normal, 13); + tet_printf("called number = %s\n", setup_call_info.szNumber); + + //setup_call_info.IdentityMode = TAPI_CALL_IDENTITY_SHOW; + + tel_exe_call_mo(&setup_call_info, &call_handle, &RequestId); + + expected_event = TAPI_EVENT_CALL_CONNECTED_IND; + gmain_loop_for_tapi_events(TIME_DELAY1); + + RequestId = -1; + + ret_status = tel_deflect_call (call_handle,NULL,NULL); + + tet_printf ("bMoCall = %d \n pNumber = %s\n CallType = %d\n allActiveState=%d\n CallState =%d\n bConferenceState =%d\n", CallStatus.bMoCall, CallStatus.pNumber, CallStatus.CallType, CallStatus.CallActiveState, CallStatus.CallState, CallStatus.bConferenceState); + + + if(ret_status != TAPI_API_SUCCESS) + { + printf("utc_tel_deflect_call_03 pass\n"); + tet_result(TET_PASS); + } + else + { + printf("utc_tel_deflect_call_03 pass\n"); + tet_result(TET_FAIL); + } + + + +} + + + diff --git a/TC/telephony_TC/call/unit/uts_tel_deflect_call.h b/TC/telephony_TC/call/unit/uts_tel_deflect_call.h new file mode 100644 index 0000000..73e71bf --- /dev/null +++ b/TC/telephony_TC/call/unit/uts_tel_deflect_call.h @@ -0,0 +1,92 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** +* @ingroup TELEPHONY_FRAMEWORK_API +* @addtogroup CALL +*/ + +/** +* @ingroup CALL +* @addtogroup UTS_TEL_DEFLECT_CALL Unit +*/ + +/** +* @ingroup UTS_TEL_DEFLECT_CALL Unit +* @addtogroup UTS_TEL_DEFLECT_CALL_ Uts_Tel_Deflect_Call +* @{ +*/ + +/** +* @file uts_tel_deflect_call.h +* @brief This is a suit of unit test cases to test tel_deflect_call() API function +* @author Gautam Nand Sinha (gnand.sinha@samsung.com) +* @version Initial Creation Version 0.1 +* @date 2010.06.29 +*/ + + +#ifndef __TS_TEL_DEFLECT_CALL_H_ +#define __TS_TEL_DEFLECT_CALL_H_ + +/* Includes */ + + +#include "tapi_callback.h" +#include +#include "call_common.h" + +extern TS_UINT g_CallHandle; +extern TS_BOOL call_status; + + + +/** +* @test This test case tests TapiResult_t el_deflect_call(unsigned int call_handle, const TelCallDeflectDstInfo_t *info, int *pRequestID) +* @brief This API is used to test to get the call information. +* @return tapi_api_err_t +*/ + + + static void utc_tel_deflect_call_01(void); + + static void utc_tel_deflect_call_02(void); + + static void utc_tel_deflect_call_03(void); + + + + static void startup(); + + static void cleanup(); + + +struct tet_testlist tet_testlist[] = { + {utc_tel_deflect_call_01, 1}, + {utc_tel_deflect_call_02, 2}, + {utc_tel_deflect_call_03, 3}, + {NULL, 0} + }; + +#endif + +/** + * @} + */ diff --git a/TC/telephony_TC/call/unit/uts_tel_exe_call_explicit_transfer.c b/TC/telephony_TC/call/unit/uts_tel_exe_call_explicit_transfer.c new file mode 100644 index 0000000..015f98f --- /dev/null +++ b/TC/telephony_TC/call/unit/uts_tel_exe_call_explicit_transfer.c @@ -0,0 +1,206 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * 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 "uts_tel_exe_call_explicit_transfer.h" + + +/* Initialize TCM data structures */ + + + + + +/* +* tel_exe_call_explicit_transfer ( unsigned int CallHandle, int *pRequestId ); +*/ + +void (*tet_startup) () = startup; +void (*tet_cleanup) () = cleanup; + + +extern int expected_event; + + +static void startup() +{ + TapiResult_t ret_status ; + tapi_dbus_connection_name dname; + int bStatus; + ret_status = tel_init(); + + if(ret_status != TAPI_API_SUCCESS) + { + printf("tel_init() Failed ret_status = %d \n",ret_status); + } + + + register_all_events(); + tel_register_app_name("org.samsung.test"); + if(tel_get_app_name(&dname)) + printf("Dbus Get app name error\n"); + else + printf("Dbus Name is %s\n",dname.name); + + tel_check_service_ready(&bStatus); + printf("Telephpny service %d\n",bStatus); +} + +static void cleanup() +{ + + int RequestId = -1; + + tel_release_call_all(&RequestId); + expected_event = TAPI_EVENT_CALL_END_IND; + + gmain_loop_for_tapi_events(TIME_DELAY1); + + deregister_all(); + + tel_deinit(); +} + + +/** + * @brief This tests tel_exe_call_explicit_transfer() API in normal conditions + * @par ID: + * UTC_TEL_EXE_CALL_EXPLICIT_TRANSFER_01 + * @param [in] CallHandle = call_handle1 + * @param [out] pRequestId = &RequestId + * @return TAPI_API_SUCCESS +*/ +void utc_tel_exe_call_explicit_transfer_01() +{ + CALL_TEST_DEBUG("\n################ TEST START ################\n"); + TapiResult_t ret_status ; + unsigned int call_handle_01 = -1; + unsigned int call_handle_02 = -1; + TelCallSetupParams_t setup_call_info_01; + TelCallSetupParams_t setup_call_info_02; + int RequestId = -1; + char normal1[16] = MOB_NUM1; + char normal2[16] = MOB_NUM2; + + memset(&setup_call_info_01, 0, sizeof(TelCallSetupParams_t)); + setup_call_info_01.CallType = TAPI_CALL_TYPE_VOICE; + strncpy(setup_call_info_01.szNumber, normal1, 13); + tet_printf("called number = %s\n", setup_call_info_01.szNumber); + + //setup_call_info_01.IdentityMode = TAPI_CALL_IDENTITY_SHOW; //preet: TelCallSetupParams_t donot have these memebers + //setup_call_info_01.pCugInfo = NULL; + //setup_call_info_01.pUusInfo = NULL; + + memset(&setup_call_info_02, 0, sizeof(TelCallSetupParams_t)); + setup_call_info_02.CallType = TAPI_CALL_TYPE_VOICE; + strncpy(setup_call_info_02.szNumber, normal2, 13); + tet_printf("called number = %s\n", setup_call_info_02.szNumber); + + //setup_call_info_02.IdentityMode = TAPI_CALL_IDENTITY_SHOW; //preet: TelCallSetupParams_t donot have these memebers + //setup_call_info_02.pCugInfo = NULL; + //setup_call_info_02.pUusInfo = NULL; + + + CALL_TEST_DEBUG("MAKE A 1ST MO CALL TO %s\n",setup_call_info_01.szNumber); + ret_status = tel_exe_call_mo(&setup_call_info_01, &call_handle_01, &RequestId); + TET_CHECK(TAPI_API_SUCCESS, ret_status); + expected_event = TAPI_EVENT_CALL_CONNECTED_IND; + gmain_loop_for_tapi_events(TIME_DELAY1); + + CALL_TEST_DEBUG("HOLD THE ACTIVE CALL\n"); + ret_status = tel_hold_call (call_handle_01 , &RequestId); + TET_CHECK(TAPI_API_SUCCESS, ret_status); + //expected_event = TAPI_EVENT_CALL_HOLD_CNF; + gmain_loop_for_tapi_events(TIME_DELAY1); + + + CALL_TEST_DEBUG("MAKE 2ND MO CALL TO %s\n",setup_call_info_02.szNumber); + ret_status = tel_exe_call_mo(&setup_call_info_02, &call_handle_02, &RequestId); + TET_CHECK(TAPI_API_SUCCESS, ret_status); + expected_event = TAPI_EVENT_CALL_CONNECTED_IND; + gmain_loop_for_tapi_events(TIME_DELAY1); + + CALL_TEST_DEBUG("EXPLICIT TRANSFER %s\n",setup_call_info_02.szNumber); + ret_status = tel_exe_call_explicit_transfer(call_handle_02 ,&RequestId); + gmain_loop_for_tapi_events(TIME_DELAY1); + expected_event = TAPI_EVENT_CALL_TRANSFER_CNF; + TET_CHECK(TAPI_API_SUCCESS, ret_status); + + CALL_TEST_DEBUG("RELEASE ALL CALLS\n"); + tel_release_call_all(&RequestId); + expected_event = TAPI_EVENT_CALL_END_IND; + gmain_loop_for_tapi_events(TIME_DELAY1); + + printf("utc_tel_exe_call_explicit_transfer_02 pass\n"); + tet_result(TET_PASS); + + return; +} + +/** + * @brief This tests tel_exe_call_explicit_transfer() API in abnormal conditions + * @par ID: + * UTC_TEL_EXE_CALL_EXPLICIT_TRANSFER_02 + * @param [in] CallHandle = call_handle2 + * @param [out] pRequestId = &RequestId +* @return TAPI_API_INVALID_CALL_HANDLE +*/ + +void utc_tel_exe_call_explicit_transfer_02() +{ + CALL_TEST_DEBUG("\n######## TEST START ###########\n"); + TapiResult_t ret_status ; + int RequestId = -1; + + ret_status = tel_exe_call_explicit_transfer(INVALID_CALL_HANDLE,&RequestId); + + TET_CHECK(TAPI_API_INVALID_CALL_HANDLE, ret_status); + + printf("utc_tel_exe_call_explicit_transfer_02 pass\n"); + tet_result(TET_PASS); + + return; +} + + +/** + * @brief This tests tel_exe_call_explicit_transfer() API in abnormal conditions + * @par ID: + * UTC_TEL_EXE_CALL_EXPLICIT_TRANSFER_04 + * @param [in] CallHandle = INVALID_CALL_HANDLE + * @param [out] pRequestId = NULL +* @return TAPI_API_INVALID_PTR +*/ + +void utc_tel_exe_call_explicit_transfer_03() +{ + CALL_TEST_DEBUG("\n######## TEST START ###########\n"); + TapiResult_t ret_status ; + + ret_status = tel_exe_call_explicit_transfer(VALID_CALL_HANDLE,NULL); + + TET_CHECK(TAPI_API_INVALID_PTR, ret_status); + + printf("utc_tel_exe_call_explicit_transfer_04 pass\n"); + tet_result(TET_PASS); + + return; +} diff --git a/TC/telephony_TC/call/unit/uts_tel_exe_call_explicit_transfer.h b/TC/telephony_TC/call/unit/uts_tel_exe_call_explicit_transfer.h new file mode 100644 index 0000000..4ee6d6a --- /dev/null +++ b/TC/telephony_TC/call/unit/uts_tel_exe_call_explicit_transfer.h @@ -0,0 +1,56 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * 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 __UTS_TAPI_TRANSFER_CALL_H_ +#define __UTS_TAPI_TRANSFER_CALL_H_ + +/* Includes */ + + +#include "tapi_callback.h" +#include +#include "call_common.h" + + + static void utc_tel_exe_call_explicit_transfer_01(void); + + static void utc_tel_exe_call_explicit_transfer_02(void); + + static void utc_tel_exe_call_explicit_transfer_03(void); + + + static void startup(); + + static void cleanup(); + + +struct tet_testlist tet_testlist[] = { + {utc_tel_exe_call_explicit_transfer_01, 1}, + {utc_tel_exe_call_explicit_transfer_02, 2}, + {utc_tel_exe_call_explicit_transfer_03, 3}, + {NULL, 0} + }; + +#endif + +/** + * @} + */ diff --git a/TC/telephony_TC/call/unit/uts_tel_exe_call_flash.c b/TC/telephony_TC/call/unit/uts_tel_exe_call_flash.c new file mode 100644 index 0000000..d41e0b5 --- /dev/null +++ b/TC/telephony_TC/call/unit/uts_tel_exe_call_flash.c @@ -0,0 +1,155 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * 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 "uts_tel_exe_call_flash.h" +#include +#define NUMBER_SIZE 11 + +/* Initialize TCM data structures */ + + + + + +/* +* tapi_api_err_t tel_exe_call_mo(tel_exe_call_mo_info_t const * const ptr_call_setup_info, +* tapi_call_handle *ptr_call_handle); +*/ + + +void (*tet_startup) () = startup; +void (*tet_cleanup) () = cleanup; + +extern int expected_event; + +static void startup() +{ + TapiResult_t ret_status ; + tapi_dbus_connection_name dname; + int bStatus; + ret_status = tel_init(); + + if(ret_status != TAPI_API_SUCCESS) + { + printf("tel_init() Failed ret_status = %d \n",ret_status); + } + + + register_all_events(); + tel_register_app_name("org.samsung.test"); + if(tel_get_app_name(&dname)) + printf("Dbus Get app name error\n"); + else + printf("Dbus Name is %s\n",dname.name); + + tel_check_service_ready(&bStatus); + printf("Telephpny service %d\n",bStatus); + + g_CallHandle = -1; +} + +static void cleanup() +{ + deregister_all(); + + tel_deinit(); +} + +/** + * @brief This tests tel_exe_call_flash() API in normal conditions + * @par ID: + * UTC_TAPI_CHECK_STATUS_01 + * @param [out] + * @return TAPI_API_SUCCESS +*/ + +/***** TESTING FOR VALID SET OF INPUTS*****/ + +void utc_tel_exe_call_flash_01() +{ + CALL_TEST_DEBUG("\n######## TEST START ###########\n"); + TapiResult_t ret_status ; + char pDialNumber[NUMBER_SIZE]; + strcpy(pDialNumber, "9886541875"); + int pRequestID; + ret_status = tel_exe_call_flash_info ( pDialNumber, &pRequestID); + if(ret_status !=TAPI_API_SUCCESS) + { + printf("uts_tapi_flash_inof_01 failed %d, number %s\n",ret_status,pDialNumber); + tet_result(TET_FAIL); + } + printf("utc_tapi_check_status_01 pass"); + tet_result(TET_PASS); + + return; +} + + +/** + * * @brief This tests tel_exe_call_flash() API in abnormal conditions + * * @par ID: + * * UTC_TAPI_CHECK_STATUS_01 + * * @param [out] + * * @return TAPI_API_FAILURE + * */ + +/***** TESTING FOR INVALID SET OF INPUTS*****/ + + +void utc_tel_exe_call_flash_02() +{ + CALL_TEST_DEBUG("\n######## TEST START ###########\n"); + TapiResult_t ret_status ; + int *pRequestID; + ret_status = tel_exe_call_flash_info ( NULL, pRequestID); + if(ret_status ==TAPI_API_SUCCESS) + { + tet_result(TET_FAIL); + } + printf("utc_tapi_check_status_02 pass"); + tet_result(TET_PASS); + + return; +} + + +/** + * * @brief This tests tel_exe_call_flash() API in abnormal conditions + * * @par ID: + * * UTC_TAPI_CHECK_STATUS_01 + * * @param [out] + * * @return TAPI_API_FAILURE + * */ + +void utc_tel_exe_call_flash_03() +{ + CALL_TEST_DEBUG("\n######## TEST START ###########\n"); + TapiResult_t ret_status ; + char const *const pDialNumber={"919811507939"}; + ret_status = tel_exe_call_flash_info (pDialNumber, NULL); + if(ret_status ==TAPI_API_SUCCESS) + { + tet_result(TET_FAIL); + } + printf("utc_tapi_check_status_03 pass"); + tet_result(TET_PASS); + + return; +} diff --git a/TC/telephony_TC/call/unit/uts_tel_exe_call_flash.h b/TC/telephony_TC/call/unit/uts_tel_exe_call_flash.h new file mode 100644 index 0000000..3132bdb --- /dev/null +++ b/TC/telephony_TC/call/unit/uts_tel_exe_call_flash.h @@ -0,0 +1,53 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * 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 __UTS_TEL_EXE_CALL_FLASH_H_ +#define __UTS_TEL_EXE_CALL_FLASH_H_ + +#include "tapi_callback.h" +#include +#include "call_common.h" +#include +#include + +extern TS_UINT g_CallHandle; +extern TS_BOOL call_status; + + static void utc_tel_exe_call_flash_01(void); + static void utc_tel_exe_call_flash_02(void); + static void utc_tel_exe_call_flash_03(void); + static void startup(); + + static void cleanup(); + + +struct tet_testlist tet_testlist[] = { + {utc_tel_exe_call_flash_01, 1}, + {utc_tel_exe_call_flash_02, 2}, + {utc_tel_exe_call_flash_03, 2}, + {NULL, 0} + }; + +#endif + +/** + * @} + */ diff --git a/TC/telephony_TC/call/unit/uts_tel_exe_call_mo.c b/TC/telephony_TC/call/unit/uts_tel_exe_call_mo.c new file mode 100644 index 0000000..217b740 --- /dev/null +++ b/TC/telephony_TC/call/unit/uts_tel_exe_call_mo.c @@ -0,0 +1,213 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * 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 "uts_tel_exe_call_mo.h" +#include "TelCall.h" +/* Initialize TCM data structures */ + +/* +* TapiResult_t tel_exe_call_mo (const TelCallSetupParams_t* pParams,unsigned int * pCallHandle, int * ); + +*/ +void (*tet_startup) () = startup; +void (*tet_cleanup) () = cleanup; + +extern int expected_event; + +static void startup() +{ + TapiResult_t ret_status ; + tapi_dbus_connection_name dname; + int bStatus; + ret_status = tel_init(); + + if(ret_status != TAPI_API_SUCCESS) + { + printf("tel_init() Failed ret_status = %d \n",ret_status); + } + register_all_events(); + tel_register_app_name("org.samsung.test"); + if(tel_get_app_name(&dname)) + printf("Dbus Get app name error\n"); + else + printf("Dbus Name is %s\n",dname.name); + + tel_check_service_ready(&bStatus); + printf("Telephpny service %d\n",bStatus); + + g_CallHandle = -1; +} + +static void cleanup() +{ + deregister_all(); + + tel_deinit(); +} +/** + * @brief This tests tel_exe_call_mo() API in normal conditions + * @par ID: + * UTC_TEL_EXE_CALL_MO_01 + * @param [in] pParams = &setup_call_info + * @param [out] pCallHandle = &active_call_handle + * @param [out] pRequestId = &RequestId +* @return TAPI_API_SUCCESS +*/ +void utc_tel_exe_call_mo_01() +{ + CALL_TEST_DEBUG("\n######## TEST START ###########\n"); + TapiResult_t ret_status ; + unsigned int active_call_handle = -1; + TelCallSetupParams_t setup_call_info; + int RequestId = -1; + char normal[16] = {0}; + strncpy(normal, MOB_NUM1, 16); + + + memset(&setup_call_info, 0, sizeof(TelCallSetupParams_t)); + setup_call_info.CallType = TAPI_CALL_TYPE_VOICE; + strncpy(setup_call_info.szNumber, normal,16); + tet_printf("called number = %s\n", setup_call_info.szNumber); + CALL_TEST_DEBUG("called number = %s\n", setup_call_info.szNumber); + + //setup_call_info.IdentityMode = TAPI_CALL_IDENTITY_SHOW; //preet: TelCallSetupParams_t dont have these members + //setup_call_info.pCugInfo = NULL; + //setup_call_info.pUusInfo = NULL; + ret_status = tel_exe_call_mo(&setup_call_info, &active_call_handle, &RequestId); + + tet_printf ("setup_call_handle_01 = %d\t request_id_01 =%d\n", active_call_handle,RequestId); + CALL_TEST_DEBUG ("setup_call_handle_01 = %d\t request_id_01 =%d\n", active_call_handle,RequestId); + + TET_CHECK(TAPI_API_SUCCESS, ret_status); + tet_infoline("utc_tel_exe_call_mo_01 pass"); + tet_result(TET_PASS); + CALL_TEST_DEBUG("i am out of 1st test case \n"); + + expected_event = TAPI_EVENT_CALL_CONNECTED_IND; + gmain_loop_for_tapi_events(TIME_DELAY1); + + RequestId = -1; + tel_release_call_all(&RequestId); + expected_event = TAPI_EVENT_CALL_END_IND; + gmain_loop_for_tapi_events(TIME_DELAY1); + + printf("utc_tel_exe_call_mo_01 pass"); + tet_result(TET_PASS); + + return; +} + +/** + * @brief This tests tel_exe_call_mo() API in abnormal conditions + * @par ID: + * UTC_TEL_EXE_CALL_MO_02 + * @param [in] pParams = NULL + * @param [out] pCallHandle = &call_handle + * @param [out] pRequestId = &RequestId +* @return TAPI_API_INVALID_PTR +*/ +void utc_tel_exe_call_mo_02() +{ + CALL_TEST_DEBUG("\n######## TEST START ###########\n"); + TapiResult_t ret_status ; + unsigned int call_handle; + int RequestId = -1; + + ret_status = tel_exe_call_mo(NULL, &call_handle, &RequestId); + + TET_CHECK(TAPI_API_INVALID_PTR, ret_status); + + tet_printf ("setup_call_handle_02 = %d\t request_id_02 =%d\n", call_handle,RequestId); + + printf("utc_tel_exe_call_mo_02 pass"); + tet_result(TET_PASS); + + return; +} + + +/** + * @brief This tests tel_exe_call_mo() API in abnormal conditions + * @par ID: + * UTC_TEL_EXE_CALL_MO_03 + * @param [in] pParams = &setup_call_info + * @param [out] pCallHandle = NULL + * @param [out] pRequestId = &RequestId +* @return TAPI_API_INVALID_PTR +*/ +void utc_tel_exe_call_mo_03() +{ + CALL_TEST_DEBUG("\n######## TEST START ###########\n"); + TapiResult_t ret_status; + TelCallSetupParams_t setup_call_info; + int RequestId = -1; + char normal[16] = MOB_NUM1; + + memset(&setup_call_info, 0, sizeof(TelCallSetupParams_t)); + setup_call_info.CallType = TAPI_CALL_TYPE_VOICE; //VOICE CALL + strncpy(setup_call_info.szNumber, normal, sizeof(normal)); + ret_status = tel_exe_call_mo(&setup_call_info, NULL, &RequestId); + + TET_CHECK(TAPI_API_INVALID_PTR, ret_status); + + tet_printf (" request_id_03 =%d\n",RequestId); + + printf("utc_tel_exe_call_mo_03 pass"); + tet_result(TET_PASS); + + return; +} + +/** + * @brief This tests tel_exe_call_mo() API in abnormal conditions + * @par ID: + * UTC_TEL_EXE_CALL_MO_04 + * @param [in] pParams = &setup_call_info + * @param [out] pCallHandle = &active_call_handle + * @param [out] pRequestId = NULL +* @return TAPI_API_INVALID_PTR +*/ + +void utc_tel_exe_call_mo_04() +{ + CALL_TEST_DEBUG("\n######## TEST START ###########\n"); + TapiResult_t ret_status ; + unsigned int call_handle = INVALID_CALL_HANDLE; + TelCallSetupParams_t setup_call_info; + int RequestId = -1; + char normal[16] = MOB_NUM1; + + memset(&setup_call_info, 0, sizeof(TelCallSetupParams_t)); + setup_call_info.CallType = TAPI_CALL_TYPE_VOICE; //VOICE CALL + strncpy(setup_call_info.szNumber, normal, sizeof(normal)); + ret_status = tel_exe_call_mo(&setup_call_info, &call_handle, NULL); + + tet_printf ("setup_call_handle_04 = %d\t request_id_04 =%d\n", call_handle,RequestId); + + TET_CHECK(TAPI_API_INVALID_PTR, ret_status); + + printf("utc_tel_exe_call_mo_04 pass"); + tet_result(TET_PASS); + + return; +} + diff --git a/TC/telephony_TC/call/unit/uts_tel_exe_call_mo.h b/TC/telephony_TC/call/unit/uts_tel_exe_call_mo.h new file mode 100644 index 0000000..f2a7e7e --- /dev/null +++ b/TC/telephony_TC/call/unit/uts_tel_exe_call_mo.h @@ -0,0 +1,56 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * 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 __UTS_TEL_EXE_CALL_MO_H_ +#define __UTS_TEL_EXE_CALL_MO_H_ + +/* Includes */ +#include "tapi_callback.h" +#include +#include "call_common.h" + +extern TS_UINT g_CallHandle; +extern TS_BOOL call_status; + + + +static void utc_tel_exe_call_mo_01(void); +static void utc_tel_exe_call_mo_02(void); +static void utc_tel_exe_call_mo_03(void); +static void utc_tel_exe_call_mo_04(void); + +static void startup(); +static void cleanup(); + +struct tet_testlist tet_testlist[] = { + {utc_tel_exe_call_mo_01, 1}, + {utc_tel_exe_call_mo_02, 2}, + {utc_tel_exe_call_mo_03, 3}, + {utc_tel_exe_call_mo_04, 4}, + {NULL, 0} +}; + +#endif + + +/** + * @} + */ diff --git a/TC/telephony_TC/call/unit/uts_tel_exit_call_emergency_mode.c b/TC/telephony_TC/call/unit/uts_tel_exit_call_emergency_mode.c new file mode 100644 index 0000000..d8e057e --- /dev/null +++ b/TC/telephony_TC/call/unit/uts_tel_exit_call_emergency_mode.c @@ -0,0 +1,125 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * 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 "uts_tel_exit_call_emergency_mode.h" + + +/* Initialize TCM data structures */ + + + + + +/* +* tapi_api_err_t tel_exe_call_mo(tel_exe_call_mo_info_t const * const ptr_call_setup_info, +* tapi_call_handle *ptr_call_handle); +*/ + + +void (*tet_startup) () = startup; +void (*tet_cleanup) () = cleanup; + +extern int expected_event; + +static void startup() +{ + TapiResult_t ret_status ; + tapi_dbus_connection_name dname; + int bStatus; + ret_status = tel_init(); + + if(ret_status != TAPI_API_SUCCESS) + { + printf("tel_init() Failed ret_status = %d \n",ret_status); + } + + + register_all_events(); + tel_register_app_name("org.samsung.test"); + if(tel_get_app_name(&dname)) + printf("Dbus Get app name error\n"); + else + printf("Dbus Name is %s\n",dname.name); + + tel_check_service_ready(&bStatus); + printf("Telephpny service %d\n",bStatus); + + g_CallHandle = -1; +} + +static void cleanup() +{ + deregister_all(); + + tel_deinit(); +} + +/** + * @brief This tests tel_exit_call_emergency_mode() API in normal conditions + * @par ID: + * UTC_TEL_EXIT_CALL_EMERGENCY_MODE + * @param [out] + * @return TAPI_API_SUCCESS +*/ + +/***** TESTING FOR VALID SET OF INPUTS*****/ + +void utc_tel_exit_call_emergency_mode_01() +{ + CALL_TEST_DEBUG("\n######## TEST START ###########\n"); + TapiResult_t ret_status ; + int *pRequestID; + ret_status =tel_exit_call_emergency_mode(&pRequestID); + if(ret_status !=TAPI_API_SUCCESS) + { + tet_result(TET_FAIL); + } + printf("utc_tel_exit_call_emergency_mode_01 pass"); + tet_result(TET_PASS); + + return; + +} +/** + * @brief This tests tel_exit_call_emergency_mode() API in normal conditions + * @par ID: + * UTC_TEL_EXIT_CALL_EMERGENCY_MODE + * @param [out] + * @return TAPI_API_SUCCESS +*/ + +/***** TESTING FOR VALID SET OF INPUTS*****/ + +void utc_tel_exit_call_emergency_mode_02() +{ + CALL_TEST_DEBUG("\n######## TEST START ###########\n"); + TapiResult_t ret_status ; + ret_status =tel_exit_call_emergency_mode(NULL); + if(ret_status ==TAPI_API_SUCCESS) + { + tet_result(TET_FAIL); + } + printf("utc_tel_exit_call_emergency_mode_02 pass"); + tet_result(TET_PASS); + + return; + +} diff --git a/TC/telephony_TC/call/unit/uts_tel_exit_call_emergency_mode.h b/TC/telephony_TC/call/unit/uts_tel_exit_call_emergency_mode.h new file mode 100644 index 0000000..314d94b --- /dev/null +++ b/TC/telephony_TC/call/unit/uts_tel_exit_call_emergency_mode.h @@ -0,0 +1,51 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * 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 __UTS_TEL_EXIT_CALL_EMERGENCY_MODE_H_ +#define __UTS_TEL_EXIT_CALL_EMERGENCY_MODE_H_ + +#include "tapi_callback.h" +#include +#include "call_common.h" +#include + +extern TS_UINT g_CallHandle; +extern TS_BOOL call_status; + + static void utc_tel_exit_call_emergency_mode_01(void); + static void utc_tel_exit_call_emergency_mode_02(void); + + static void startup(); + + static void cleanup(); + + +struct tet_testlist tet_testlist[] = { + {utc_tel_exit_call_emergency_mode_01, 1}, + {utc_tel_exit_call_emergency_mode_02, 2}, + {NULL, 0} + }; + +#endif + +/** + * @} + */ diff --git a/TC/telephony_TC/call/unit/uts_tel_get_call_act_line.c b/TC/telephony_TC/call/unit/uts_tel_get_call_act_line.c new file mode 100644 index 0000000..0d6c514 --- /dev/null +++ b/TC/telephony_TC/call/unit/uts_tel_get_call_act_line.c @@ -0,0 +1,134 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * 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 "uts_tel_get_call_act_line.h" + + +/* Initialize TCM data structures */ + + + + + +/* +* TapiResult_t tel_get_call_act_line (TelCallActiveLine_t* ptr_active_line ,int *pRequestId); +*/ + +void (*tet_startup) () = startup; +void (*tet_cleanup) () = cleanup; + +extern int expected_event; + +static void startup() +{ + TapiResult_t ret_status ; + tapi_dbus_connection_name dname; + int bStatus; + ret_status = tel_init(); + + if(ret_status != TAPI_API_SUCCESS) + { + printf("tel_init() Failed ret_status = %d \n",ret_status); + } + + register_all_events(); + tel_register_app_name("org.samsung.test"); + if(tel_get_app_name(&dname)) + printf("Dbus Get app name error\n"); + else + printf("Dbus Name is %s\n",dname.name); + + tel_check_service_ready(&bStatus); + printf("Telephpny service %d\n",bStatus); + + g_CallHandle = -1; + +} + +static void cleanup() +{ + deregister_all(); + + tel_deinit(); + +} + + + +/***** TESTING FOR VALID SET OF INPUTS*****/ +/** + * @brief This tests tel_get_call_act_line() API in normal conditions + * @par ID: + * UTC_TEL_GET_CALL_ACT_LINE_01 + * @param [in] ptr_active_line = &active_line + * @param [out] pRequestId = &RequestId + * @return TAPI_API_SUCCESS +*/ + +void utc_tel_get_call_act_line_01() +{ + CALL_TEST_DEBUG("\n######## TEST START ###########\n"); + TapiResult_t ret_status ; + int RequestId = -1; + + printf ("Get Active Line With Valid Out Param."); + + ret_status = tel_get_call_act_line(&RequestId); + + if (ret_status >= 0) + { + TET_CHECK(TAPI_API_SUCCESS, ret_status); + + printf("utc_tel_get_call_act_line_01 pass\n"); + tet_result(TET_PASS); + } + return; +} + +/***** TESTING FOR INVALID SET OF INPUTS*****/ + +/** + * @brief This tests tel_get_call_act_line() API in abnormal conditions + * @par ID: + * UTC_TEL_GET_CALL_ACT_LINE_02 + * @param [in] ptr_active_line = NULL + * @param [out] pRequestId = &RequestId +* @return TAPI_API_INVALID_PTR +*/ + +void utc_tel_get_call_act_line_02() +{ + CALL_TEST_DEBUG("\n######## TEST START ###########\n"); + TapiResult_t ret_status ; + int RequestId = -1; + + ret_status = tel_get_call_act_line(NULL); + + + TET_CHECK(TAPI_API_INVALID_PTR, ret_status); + + printf("utc_tel_get_call_act_line_02 pass\n"); + tet_result(TET_PASS); + + return; +} + diff --git a/TC/telephony_TC/call/unit/uts_tel_get_call_act_line.h b/TC/telephony_TC/call/unit/uts_tel_get_call_act_line.h new file mode 100644 index 0000000..62e63ab --- /dev/null +++ b/TC/telephony_TC/call/unit/uts_tel_get_call_act_line.h @@ -0,0 +1,54 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * 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 __UTS_TEL_GET_CALL_ACT_LINE_H_ +#define __UTS_TEL_GET_CALL_ACT_LINE_H_ + +/* Includes */ + +#include "tapi_callback.h" +#include +#include "call_common.h" + + +extern TS_UINT g_CallHandle; +extern TS_BOOL call_status; + + static void utc_tel_get_call_act_line_01(void); + + static void utc_tel_get_call_act_line_02(void); + + static void startup(); + + static void cleanup(); + + +struct tet_testlist tet_testlist[] = { + {utc_tel_get_call_act_line_01, 1}, + {utc_tel_get_call_act_line_02, 2}, + {NULL, 0} + }; + +#endif + +/** + * @} + */ diff --git a/TC/telephony_TC/call/unit/uts_tel_get_call_conf_list.c b/TC/telephony_TC/call/unit/uts_tel_get_call_conf_list.c new file mode 100644 index 0000000..fb33f73 --- /dev/null +++ b/TC/telephony_TC/call/unit/uts_tel_get_call_conf_list.c @@ -0,0 +1,233 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * 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 "uts_tel_get_call_conf_list.h" + + +/* Initialize TCM data structures */ + + + + + +/* +* TapiResult_t tel_get_call_conf_list ( unsigned int CallHandle,unsigned int * pCallList, int *pNoOfCalls ); pCallList, int *pNoOfCalls ); +*/ + +void (*tet_startup) () = startup; +void (*tet_cleanup) () = cleanup; + + +unsigned int CallList[3] = {0}; +static int NoOfCalls = -1; +extern int expected_event; + +//extern tapi_call_handle conf_call_handle; //preet: conf_call_handle is nowhere used + +static void startup() +{ + TapiResult_t ret_status ; + tapi_dbus_connection_name dname; + int bStatus; + + ret_status = tel_init(); + + if(ret_status != TAPI_API_SUCCESS) + { + printf("tel_init() Failed ret_status = %d \n",ret_status); + } + + register_all_events(); + tel_register_app_name("org.samsung.test"); + if(tel_get_app_name(&dname)) + printf("Dbus Get app name error\n"); + else + printf("Dbus Name is %s\n",dname.name); + + tel_check_service_ready(&bStatus); + printf("Telephpny service %d\n",bStatus); + +} + +static void cleanup() +{ + int RequestId; + tel_release_call_all(&RequestId); + expected_event = TAPI_EVENT_CALL_END_IND; + gmain_loop_for_tapi_events(TIME_DELAY1); + + CallList[0] = CallList[1] = CallList[2] = -1; + NoOfCalls = -1; + deregister_all(); + + tel_deinit(); + +} + + + + +/** + * @brief This tests tel_get_call_conf_list() API in normal conditions + * @par ID: + * UTC_TEL_GET_CALL_CONF_LIST_01 + * @param [in] CallHandle = callhandle[1] + * @param [out] pCallList = CallList //array + * @param [out] pNoOfCalls = &NoOfCalls +* @return TAPI_API_SUCCESS +*/ + +void utc_tel_get_call_conf_list_01() +{ + CALL_TEST_DEBUG("\n################ TEST START ################\n"); + TapiResult_t ret_status ; + unsigned int call_handle_01 = -1; + unsigned int call_handle_02 = -1; + TelCallSetupParams_t setup_call_info_01; + TelCallSetupParams_t setup_call_info_02; + int RequestId = -1; + char normal1[16] = MOB_NUM1; + char normal2[16] = MOB_NUM2; + + memset(&setup_call_info_01, 0, sizeof(TelCallSetupParams_t)); + setup_call_info_01.CallType = TAPI_CALL_TYPE_VOICE; + strncpy(setup_call_info_01.szNumber, normal1, 13); + tet_printf("called number = %s\n", setup_call_info_01.szNumber); + + //setup_call_info_01.IdentityMode = TAPI_CALL_IDENTITY_SHOW; //preet + //setup_call_info_01.pCugInfo = NULL; + //setup_call_info_01.pUusInfo = NULL; + + memset(&setup_call_info_02, 0, sizeof(TelCallSetupParams_t)); + setup_call_info_02.CallType = TAPI_CALL_TYPE_VOICE; + strncpy(setup_call_info_02.szNumber, normal2, 13); + tet_printf("called number = %s\n", setup_call_info_02.szNumber); + + //setup_call_info_02.IdentityMode = TAPI_CALL_IDENTITY_SHOW; //preet + //setup_call_info_02.pCugInfo = NULL; + //setup_call_info_02.pUusInfo = NULL; + + + CALL_TEST_DEBUG("MAKE A 1ST MO CALL TO %s\n",setup_call_info_01.szNumber); + ret_status = tel_exe_call_mo(&setup_call_info_01, &call_handle_01, &RequestId); + TET_CHECK(TAPI_API_SUCCESS, ret_status); + expected_event = TAPI_EVENT_CALL_CONNECTED_IND; + gmain_loop_for_tapi_events(TIME_DELAY1); + + CALL_TEST_DEBUG("HOLD THE ACTIVE CALL\n"); + ret_status = tel_hold_call (call_handle_01 , &RequestId); + TET_CHECK(TAPI_API_SUCCESS, ret_status); + expected_event = TAPI_EVENT_CALL_HOLD_CNF; + gmain_loop_for_tapi_events(TIME_DELAY1); + + CALL_TEST_DEBUG("MAKE 2ND MO CALL TO %s\n",setup_call_info_02.szNumber); + ret_status = tel_exe_call_mo(&setup_call_info_02, &call_handle_02, &RequestId); + TET_CHECK(TAPI_API_SUCCESS, ret_status); + expected_event = TAPI_EVENT_CALL_CONNECTED_IND; + gmain_loop_for_tapi_events(TIME_DELAY1); + + CALL_TEST_DEBUG("JOIN TWO CALLS\n"); + ret_status = tel_join_call (call_handle_02, call_handle_01, &RequestId); + TET_CHECK(TAPI_API_SUCCESS, ret_status); + expected_event = TAPI_EVENT_CALL_SETUPCONFERENCE_CNF; + gmain_loop_for_tapi_events(TIME_DELAY1); + + CALL_TEST_DEBUG("GET CONFERENCE LIST\n"); + ret_status = tel_get_call_conf_list (call_handle_02, CallList, &NoOfCalls); + tet_printf ("call_id1 =%d\n call_id2=%d\n call_id3=%d\n NoOfCalls=%d\n", CallList[0], CallList[1], CallList[2], NoOfCalls); + TET_CHECK(TAPI_API_SUCCESS, ret_status); + gmain_loop_for_tapi_events(TIME_DELAY1); + + CALL_TEST_DEBUG("RELEASE ALL CALLS\n"); + tel_release_call_all(&RequestId); + expected_event = TAPI_EVENT_CALL_END_IND; + gmain_loop_for_tapi_events(TIME_DELAY1); + + tet_result(TET_PASS); + + return; +} + +/** + * @brief This tests tel_get_call_conf_list() API in abnormal conditions + * @par ID: + * UTC_TEL_GET_CALL_CONF_LIST_02 + * @param [in] CallHandle = callhandle[1] + * @param [out] pCallList = CallList //array + * @param [out] pNoOfCalls = NULL +* @return TAPI_API_INVALID_PTR +*/ + +void utc_tel_get_call_conf_list_02() +{ + TapiResult_t ret_status ; + + ret_status = tel_get_call_conf_list (VALID_CALL_HANDLE, CallList, NULL); + TET_CHECK(TAPI_API_INVALID_PTR, ret_status); + printf("utc_tel_get_call_conf_list_02 pass\n"); + tet_result(TET_PASS); + + return; +} + +/** + * @brief This tests tel_get_call_conf_list() API in abnormal conditions + * @par ID: + * UTC_TEL_GET_CALL_CONF_LIST_03 + * @param [in] CallHandle = callhandle[1] + * @param [out] pCallList = NULL + * @param [out] pNoOfCalls = &NoOfCalls +* @return TAPI_API_INVALID_PTR +*/ +void utc_tel_get_call_conf_list_03() +{ + TapiResult_t ret_status ; + + ret_status = tel_get_call_conf_list (VALID_CALL_HANDLE, NULL, &NoOfCalls); + TET_CHECK(TAPI_API_INVALID_PTR, ret_status); + printf("utc_tel_get_call_conf_list_03 pass\n"); + tet_result(TET_PASS); + + return; +} + +/** + * @brief This tests tel_get_call_conf_list() API in abnormal conditions + * @par ID: + * UTC_TEL_GET_CALL_CONF_LIST_04 + * @param [in] CallHandle = INVALID_CALL_HANDLE + * @param [out] pCallList = CallList //array + * @param [out] pNoOfCalls = &NoOfCalls +* @return TAPI_API_INVALID_CALL_HANDLE +*/ + +void utc_tel_get_call_conf_list_04() +{ + TapiResult_t ret_status ; + + ret_status = tel_get_call_conf_list (INVALID_CALL_HANDLE, CallList, &NoOfCalls); + TET_CHECK(TAPI_API_INVALID_CALL_HANDLE, ret_status); + printf("utc_tel_get_call_conf_list_04 pass\n"); + tet_result(TET_PASS); + + return; +} diff --git a/TC/telephony_TC/call/unit/uts_tel_get_call_conf_list.h b/TC/telephony_TC/call/unit/uts_tel_get_call_conf_list.h new file mode 100644 index 0000000..bd14c88 --- /dev/null +++ b/TC/telephony_TC/call/unit/uts_tel_get_call_conf_list.h @@ -0,0 +1,67 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * 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 __UTS_TEL_GET_CALL_CONF_LIST_H_ +#define __UTS_TEL_GET_CALL_CONF_LIST_H_ + +/* Includes */ + + +#include "tapi_callback.h" +#include +#include "call_common.h" + + + +/** +* @test This test case tests TapiResult_t tel_get_call_conf_list ( unsigned int CallHandle,unsigned int * * pCallList, int *pNoOfCalls ); +* @brief This API is used to establish conference call +* @return tapi_api_err_t +*/ + + + static void utc_tel_get_call_conf_list_01(void); + + static void utc_tel_get_call_conf_list_02(void); + + static void utc_tel_get_call_conf_list_03(void); + + static void utc_tel_get_call_conf_list_04(void); + + static void startup(); + + static void cleanup(); + + +struct tet_testlist tet_testlist[] = { + {utc_tel_get_call_conf_list_01, 1}, + {utc_tel_get_call_conf_list_02, 2}, + {utc_tel_get_call_conf_list_03, 3}, + {utc_tel_get_call_conf_list_04, 4}, + + {NULL, 0} + }; + +#endif + +/** + * @} + */ diff --git a/TC/telephony_TC/call/unit/uts_tel_get_call_duration.c b/TC/telephony_TC/call/unit/uts_tel_get_call_duration.c new file mode 100644 index 0000000..4d6855b --- /dev/null +++ b/TC/telephony_TC/call/unit/uts_tel_get_call_duration.c @@ -0,0 +1,173 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * 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 "uts_tel_get_call_duration.h" + +/* +* TapiResult_t tel_get_call_duration ( unsigned int CallHandle, unsigned int * pDurationInSecs); +*/ + +void (*tet_startup) () = startup; +void (*tet_cleanup) () = cleanup; + + +extern int expected_event; + +static void startup() +{ + TapiResult_t ret_status ; + tapi_dbus_connection_name dname; + int bStatus; + ret_status = tel_init(); + + if(ret_status != TAPI_API_SUCCESS) + { + printf("tel_init() Failed ret_status = %d \n",ret_status); + } + + register_all_events(); + tel_register_app_name("org.samsung.test"); + if(tel_get_app_name(&dname)) + printf("Dbus Get app name error\n"); + else + printf("Dbus Name is %s\n",dname.name); + + tel_check_service_ready(&bStatus); + printf("Telephpny service %d\n",bStatus); +} + +static void cleanup() +{ + int RequestId; + tel_release_call_all(&RequestId); + expected_event = TAPI_EVENT_CALL_END_IND; + gmain_loop_for_tapi_events(TIME_DELAY1); + deregister_all(); + + tel_deinit(); + +} + + + + +/** + * @brief This tests tel_get_call_duration() API in normal conditions + * @par ID: + * UTC_TEL_GET_CALL_DURATION_01 + * @param [in] CallHandle = callhandle + * @param [out] pDurationInSecs = &DurationInSecs + * @return TAPI_API_SUCCESS +*/ + +void utc_tel_get_call_duration_01() +{ + CALL_TEST_DEBUG("\n################ TEST START ################\n"); + + unsigned int DurationInSecs; + + TapiResult_t ret_status ; + unsigned int call_handle_01 = -1; + TelCallSetupParams_t setup_call_info_01; + int RequestId = -1; + char normal1[16] = MOB_NUM1; + + memset(&setup_call_info_01, 0, sizeof(TelCallSetupParams_t)); + setup_call_info_01.CallType = TAPI_CALL_TYPE_VOICE; + strncpy(setup_call_info_01.szNumber, normal1, 13); + tet_printf("called number = %s\n", setup_call_info_01.szNumber); + + //setup_call_info_01.IdentityMode = TAPI_CALL_IDENTITY_SHOW; //preet + //setup_call_info_01.pCugInfo = NULL; + //setup_call_info_01.pUusInfo = NULL; + + CALL_TEST_DEBUG("MAKE A MO CALL TO %s\n",setup_call_info_01.szNumber); + ret_status = tel_exe_call_mo(&setup_call_info_01, &call_handle_01, &RequestId); + tet_printf ("call_handle = %d\n",call_handle_01); + TET_CHECK(TAPI_API_SUCCESS, ret_status); + expected_event = TAPI_EVENT_CALL_CONNECTED_IND; + gmain_loop_for_tapi_events(TIME_DELAY1); + + RequestId = -1; + + ret_status = tel_get_call_duration (call_handle_01, &DurationInSecs); + + tet_printf ("Call_duration =%d \n", DurationInSecs); + + TET_CHECK(TAPI_API_SUCCESS, ret_status); + + printf("utc_tel_get_call_duration_01 pass\n"); + tet_result(TET_PASS); + + return; +} + + +/** + * @brief This tests tel_get_call_duration() API in abnormal conditions + * @par ID: + * UTC_TEL_GET_CALL_DURATION_02 + * @param [in] CallHandle = callhandle + * @param [out] pDurationInSecs = NULL +* @return TAPI_API_INVALID_PTR +*/ + +void utc_tel_get_call_duration_02() +{ + CALL_TEST_DEBUG("\n######## TEST START ###########\n"); + TapiResult_t ret_status ; + + ret_status = tel_get_call_duration (VALID_CALL_HANDLE, NULL); + + TET_CHECK(TAPI_API_INVALID_PTR, ret_status); + printf("utc_tel_get_call_duration_02 pass\n"); + tet_result(TET_PASS); + + return; +} + + +/** + * @brief This tests tel_get_call_duration() API in abnormal conditions + * @par ID: + * UTC_TEL_GET_CALL_DURATION_03 + * @param [in] CallHandle = INVALID_CALL_HANDLE + * @param [out] pDurationInSecs = &DurationInSecs +* @return TAPI_API_INVALID_CALL_HANDLE +*/ + +void utc_tel_get_call_duration_03() +{ + CALL_TEST_DEBUG("\n######## TEST START ###########\n"); + TapiResult_t ret_status ; + unsigned int DurationInSecs = -1; + + ret_status = tel_get_call_duration (INVALID_CALL_HANDLE, &DurationInSecs); + + TET_CHECK(TAPI_API_INVALID_CALL_HANDLE, ret_status); + printf("utc_tel_get_call_duration_03\n"); + tet_result(TET_PASS); + + return; +} + + + diff --git a/TC/telephony_TC/call/unit/uts_tel_get_call_duration.h b/TC/telephony_TC/call/unit/uts_tel_get_call_duration.h new file mode 100644 index 0000000..c417e36 --- /dev/null +++ b/TC/telephony_TC/call/unit/uts_tel_get_call_duration.h @@ -0,0 +1,66 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * 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 __UTS_TEL_GET_CALL_DURATION_H_ +#define __UTS_TEL_GET_CALL_DURATION_H_ + +/* Includes */ + + +#include "tapi_callback.h" +#include +#include "call_common.h" + +extern TS_UINT g_CallHandle; +extern TS_BOOL call_status; + + + +/** +* @test This test case tests TapiResult_t tel_get_call_duration ( unsigned int CallHandle, unsigned int * pDurationInSecs); +* @brief This API is used to test to get the call information. +* @return tapi_api_err_t +*/ + + + static void utc_tel_get_call_duration_01(void); + + static void utc_tel_get_call_duration_02(void); + + static void utc_tel_get_call_duration_03(void); + + static void startup(); + + static void cleanup(); + + +struct tet_testlist tet_testlist[] = { + {utc_tel_get_call_duration_01, 1}, + {utc_tel_get_call_duration_02, 2}, + {utc_tel_get_call_duration_03, 3}, + {NULL, 0} + }; + +#endif + +/** + * @} + */ diff --git a/TC/telephony_TC/call/unit/uts_tel_get_call_privacy_mode.c b/TC/telephony_TC/call/unit/uts_tel_get_call_privacy_mode.c new file mode 100644 index 0000000..2eac1c1 --- /dev/null +++ b/TC/telephony_TC/call/unit/uts_tel_get_call_privacy_mode.c @@ -0,0 +1,176 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * 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 "uts_tel_get_call_privacy_mode.h" + +/* Initialize TCM data structures */ + +void (*tet_startup) () = startup; +void (*tet_cleanup) () = cleanup; + +extern int expected_event; + +static void startup() +{ + TapiResult_t ret_status ; + tapi_dbus_connection_name dname; + int bStatus; + ret_status = tel_init(); + + if(ret_status != TAPI_API_SUCCESS) + { + printf("tel_init() Failed ret_status = %d \n",ret_status); + } + + + register_all_events(); + tel_register_app_name("org.samsung.test"); + if(tel_get_app_name(&dname)) + printf("Dbus Get app name error\n"); + else + printf("Dbus Name is %s\n",dname.name); + + tel_check_service_ready(&bStatus); + printf("Telephpny service %d\n",bStatus); + + g_CallHandle = -1; +} + +static void cleanup() +{ + deregister_all(); + + tel_deinit(); +} + +/** + * @brief This tests () API in normal conditions + * @par ID: + * UTC_TEL_GET_CALL_PRIVACY_MODE_01 + * @param [out] + * @return TAPI_API_SUCCESS +*/ + +/***** TESTING FOR VALID SET OF INPUTS*****/ + +void utc_tel_get_call_privacy_mode_01() +{ + CALL_TEST_DEBUG("\n######## TEST START ###########\n"); + TapiResult_t ret_status ; + TelCallPrivacyType_t PrivacyType; + int *pRequestID; + PrivacyType = TAPI_CALL_PRIVACY_TYPE_MS; + ret_status =tel_get_call_privacy_mode (PrivacyType, &pRequestID); + if(ret_status !=TAPI_API_SUCCESS) + { + tet_result(TET_FAIL); + } + printf("utc_tel_get_call_privacy_mode_01 pass"); + tet_result(TET_PASS); + + return; +} + +void utc_tel_get_call_privacy_mode_02() +{ + CALL_TEST_DEBUG("\n######## TEST START ###########\n"); + TapiResult_t ret_status ; + TelCallPrivacyType_t PrivacyType; + int *pRequestID; + PrivacyType = TAPI_CALL_PRIVACY_TYPE_BS ; + ret_status =tel_get_call_privacy_mode (PrivacyType, &pRequestID); + if(ret_status !=TAPI_API_SUCCESS) + { + tet_result(TET_FAIL); + } + printf("utc_tel_get_call_privacy_mode_02 pass"); + tet_result(TET_PASS); + + return; +} + +void utc_tel_get_call_privacy_mode_03() +{ + CALL_TEST_DEBUG("\n######## TEST START ###########\n"); + TapiResult_t ret_status ; + TelCallPrivacyType_t PrivacyType; + int *pRequestID; + PrivacyType = TAPI_CALL_PRIVACY_TYPE_CURRENT; + ret_status =tel_get_call_privacy_mode (PrivacyType, &pRequestID); + if(ret_status !=TAPI_API_SUCCESS) + { + tet_result(TET_FAIL); + } + printf("utc_tel_get_call_privacy_mode_03 pass"); + tet_result(TET_PASS); + + return; +} + +void utc_tel_get_call_privacy_mode_04() +{ + CALL_TEST_DEBUG("\n######## TEST START ###########\n"); + TapiResult_t ret_status ; + int *pRequestID; + ret_status =tel_get_call_privacy_mode (-1, pRequestID); + if(ret_status ==TAPI_API_SUCCESS) + { + tet_result(TET_FAIL); + } + printf("utc_tel_get_call_privacy_mode_04 pass"); + tet_result(TET_PASS); + + return; +} + +void utc_tel_get_call_privacy_mode_05() +{ + CALL_TEST_DEBUG("\n######## TEST START ###########\n"); + TapiResult_t ret_status ; + int *pRequestID; + ret_status =tel_get_call_privacy_mode (4, pRequestID); + if(ret_status ==TAPI_API_SUCCESS) + { + tet_result(TET_FAIL); + } + printf("utc_tel_get_call_privacy_mode_04 pass"); + tet_result(TET_PASS); + + return; +} + +void utc_tel_get_call_privacy_mode_06() +{ + CALL_TEST_DEBUG("\n######## TEST START ###########\n"); + TapiResult_t ret_status ; + TelCallPrivacyType_t PrivacyType; + PrivacyType = TAPI_CALL_PRIVACY_TYPE_CURRENT; + ret_status =tel_get_call_privacy_mode (PrivacyType, NULL); + if(ret_status ==TAPI_API_SUCCESS) + { + tet_result(TET_FAIL); + } + printf("utc_tel_get_call_privacy_mode_05 pass"); + tet_result(TET_PASS); + + return; +} + diff --git a/TC/telephony_TC/call/unit/uts_tel_get_call_privacy_mode.h b/TC/telephony_TC/call/unit/uts_tel_get_call_privacy_mode.h new file mode 100644 index 0000000..02043b3 --- /dev/null +++ b/TC/telephony_TC/call/unit/uts_tel_get_call_privacy_mode.h @@ -0,0 +1,59 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * 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 __UTS_TEL_GET_CALL_PRIVACY_MODE_H_ +#define __UTS_TEL_GET_CALL_PRIVACY_MODE_H_ + +#include "tapi_callback.h" +#include +#include "call_common.h" +#include + +extern TS_UINT g_CallHandle; +extern TS_BOOL call_status; + + static void utc_tel_get_call_privacy_mode_01(void); + static void utc_tel_get_call_privacy_mode_02(void); + static void utc_tel_get_call_privacy_mode_03(void); + static void utc_tel_get_call_privacy_mode_04(void); + static void utc_tel_get_call_privacy_mode_05(void); + static void utc_tel_get_call_privacy_mode_06(void); + + static void startup(); + + static void cleanup(); + + +struct tet_testlist tet_testlist[] = { + {utc_tel_get_call_privacy_mode_01, 1}, + {utc_tel_get_call_privacy_mode_02, 2}, + {utc_tel_get_call_privacy_mode_03, 3}, + {utc_tel_get_call_privacy_mode_04, 4}, + {utc_tel_get_call_privacy_mode_05, 5}, + {utc_tel_get_call_privacy_mode_06, 6}, + {NULL, 0} + }; + +#endif + +/** + * @} + */ diff --git a/TC/telephony_TC/call/unit/uts_tel_get_call_status.c b/TC/telephony_TC/call/unit/uts_tel_get_call_status.c new file mode 100644 index 0000000..ffb3902 --- /dev/null +++ b/TC/telephony_TC/call/unit/uts_tel_get_call_status.c @@ -0,0 +1,194 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * 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 "uts_tel_get_call_status.h" + + +/* Initialize TCM data structures */ + + + + + +/* +* TapiResult_t tel_get_call_status ( unsigned int CallHandle, TelCallStatus_t * pCallStatus); +*/ + +void (*tet_startup) () = startup; +void (*tet_cleanup) () = cleanup; + + +extern int expected_event; + +static void startup() +{ + TapiResult_t ret_status ; + tapi_dbus_connection_name dname; + int bStatus; + ret_status = tel_init(); + + if(ret_status != TAPI_API_SUCCESS) + { + printf("tel_init() Failed ret_status = %d \n",ret_status); + } + + register_all_events(); + tel_register_app_name("org.samsung.test"); + if(tel_get_app_name(&dname)) + printf("Dbus Get app name error\n"); + else + printf("Dbus Name is %s\n",dname.name); + + tel_check_service_ready(&bStatus); + printf("Telephpny service %d\n",bStatus); + + g_CallHandle = -1; +} + +static void cleanup() +{ + int RequestId; + tel_release_call_all(&RequestId); + expected_event = TAPI_EVENT_CALL_END_IND; + gmain_loop_for_tapi_events(TIME_DELAY1); + deregister_all(); + + tel_deinit(); + +} + + +/** + * @brief This tests tel_get_call_status() API in normal conditions + * @par ID: + * UTC_TEL_GET_CALL_STATUS_01 + * @param [in] CallHandle = callhandle + * @param [out] pCallStatus = &CallStatus +* @return TAPI_API_SUCCESS +*/ + +void utc_tel_get_call_status_01() +{ + CALL_TEST_DEBUG("\n######## TEST START ###########\n"); + TapiResult_t ret_status ; + int RequestId = -1; + TS_UINT call_handle; + TelCallStatus_t CallStatus; + TelCallSetupParams_t setup_call_info; + char normal[16] = MOB_NUM1; + + memset(&setup_call_info, 0, sizeof(TelCallSetupParams_t)); + setup_call_info.CallType = TAPI_CALL_TYPE_VOICE; //VOICE CALL + strncpy(setup_call_info.szNumber, normal, 13); + tet_printf("called number = %s\n", setup_call_info.szNumber); + + //setup_call_info.IdentityMode = TAPI_CALL_IDENTITY_SHOW; + + ret_status=tel_exe_call_mo(&setup_call_info, &call_handle, &RequestId); + tet_printf ("call_handle = %d\n",call_handle); + TET_CHECK(TAPI_API_SUCCESS, ret_status); + expected_event = TAPI_EVENT_CALL_CONNECTED_IND; + gmain_loop_for_tapi_events(TIME_DELAY1); + + RequestId = -1; + tet_printf ("call_handle = %d\n",call_handle); + ret_status = tel_get_call_status (call_handle, &CallStatus); + + tet_printf ("bMoCall = %d \n pNumber = %s\n CallType = %d\n allActiveState=%d\n CallState =%d\n bConferenceState =%d\n", CallStatus.bMoCall, CallStatus.pNumber, CallStatus.CallType, CallStatus.CallActiveState, CallStatus.CallState, CallStatus.bConferenceState); + + TET_CHECK(TAPI_API_SUCCESS, ret_status); + + printf("utc_tel_get_call_status_01 pass\n"); + tet_result(TET_PASS); + + return; +} + +/** + * @brief This tests tel_get_call_status() API in abnormal conditions + * @par ID: + * UTC_TEL_GET_CALL_STATUS_02 + * @param [in] CallHandle = callhandle + * @param [out] pCallStatus = NULL +* @return TAPI_API_INVALID_PTR +*/ + +void utc_tel_get_call_status_02() +{ + CALL_TEST_DEBUG("\n######## TEST START ###########\n"); + TapiResult_t ret_status ; + + ret_status = tel_get_call_status (VALID_CALL_HANDLE, NULL); + + TET_CHECK(TAPI_API_INVALID_PTR, ret_status); + printf("utc_tel_get_call_status_02 pass\n"); + tet_result(TET_PASS); + + return; +} + +/** + * @brief This tests tel_get_call_status() API in abnormal conditions + * @par ID: + * UTC_TEL_GET_CALL_STATUS_03 + * @param [in] CallHandle = INVALID_CALL_HANDLE + * @param [out] pCallStatus = &CallStatus +* @return TAPI_API_INVALID_CALL_HANDLE +*/ +void utc_tel_get_call_status_03() +{ + CALL_TEST_DEBUG("\n######## TEST START ###########\n"); + TapiResult_t ret_status ; + TelCallStatus_t CallStatus; + + ret_status = tel_get_call_status (INVALID_CALL_HANDLE, &CallStatus); + + TET_CHECK(TAPI_API_INVALID_CALL_HANDLE, ret_status); + printf("utc_tel_get_call_status_03 pass\n"); + tet_result(TET_PASS); + + return; +} + +/** + * @brief This tests tel_get_call_status() API in abnormal conditions + * @par ID: + * UTC_TEL_GET_CALL_STATUS_04 + * @param [in] CallHandle = INVALID_CALL_HANDLE + * @param [out] pCallStatus = NULL + * @return TAPI_API_INVALID_PTR +*/ +void utc_tel_get_call_status_04() +{ + CALL_TEST_DEBUG("\n######## TEST START ###########\n"); + TapiResult_t ret_status ; + + ret_status = tel_get_call_status (INVALID_CALL_HANDLE, NULL); + + TET_CHECK(TAPI_API_INVALID_PTR, ret_status); + printf("utc_tel_get_call_status_04 pass\n"); + tet_result(TET_PASS); + + return; +} + + + diff --git a/TC/telephony_TC/call/unit/uts_tel_get_call_status.h b/TC/telephony_TC/call/unit/uts_tel_get_call_status.h new file mode 100644 index 0000000..9af698e --- /dev/null +++ b/TC/telephony_TC/call/unit/uts_tel_get_call_status.h @@ -0,0 +1,70 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * 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 __UTS_TEL_GET_CALL_STATUS_H_ +#define __UTS_TEL_GET_CALL_STATUS_H_ + +/* Includes */ + + +#include "tapi_callback.h" +#include +#include "call_common.h" + +extern TS_UINT g_CallHandle; +extern TS_BOOL call_status; + + + +/** +* @test This test case tests TapiResult_t tel_get_call_status ( unsigned int CallHandle, + TelCallStatus_t *pCallStatus); +* @brief This API is used to test to get the call information. +* @return tapi_api_err_t +*/ + + + static void utc_tel_get_call_status_01(void); + + static void utc_tel_get_call_status_02(void); + + static void utc_tel_get_call_status_03(void); + + static void utc_tel_get_call_status_04(void); + + static void startup(); + + static void cleanup(); + + +struct tet_testlist tet_testlist[] = { + {utc_tel_get_call_status_01, 1}, + {utc_tel_get_call_status_02, 2}, + {utc_tel_get_call_status_03, 3}, + {utc_tel_get_call_status_04, 4}, + {NULL, 0} + }; + +#endif + +/** + * @} + */ diff --git a/TC/telephony_TC/call/unit/uts_tel_get_call_time.c b/TC/telephony_TC/call/unit/uts_tel_get_call_time.c new file mode 100644 index 0000000..9ced768 --- /dev/null +++ b/TC/telephony_TC/call/unit/uts_tel_get_call_time.c @@ -0,0 +1,105 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * 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 "uts_tel_get_call_time.h" + +/* Initialize TCM data structures */ + +void (*tet_startup) () = startup; +void (*tet_cleanup) () = cleanup; + +extern int expected_event; + +static void startup() +{ + TapiResult_t ret_status ; + tapi_dbus_connection_name dname; + int bStatus; + ret_status = tel_init(); + + if(ret_status != TAPI_API_SUCCESS) + { + printf("tel_init() Failed ret_status = %d \n",ret_status); + } + + + register_all_events(); + tel_register_app_name("org.samsung.test"); + if(tel_get_app_name(&dname)) + printf("Dbus Get app name error\n"); + else + printf("Dbus Name is %s\n",dname.name); + + tel_check_service_ready(&bStatus); + printf("Telephpny service %d\n",bStatus); + + g_CallHandle = -1; +} + +static void cleanup() +{ + deregister_all(); + + tel_deinit(); +} + +/** + * @brief This tests () API in normal conditions + * @par ID: + * UTC_TEL_GET_CALL_TIME_01 + * @param [out] status + * @return TAPI_API_SUCCESS +*/ + +/***** TESTING FOR VALID SET OF INPUTS*****/ + +void utc_tel_get_call_time_01() +{ + CALL_TEST_DEBUG("\n######## TEST START ###########\n"); + TapiResult_t ret_status ; + TS_WORD req_mask = 1; + int *pRequestID; + ret_status = tel_get_call_time (req_mask, &pRequestID); + if(ret_status !=TAPI_API_SUCCESS) + { + tet_result(TET_FAIL); + } + printf("utc_tel_get_call_time_01 pass"); + tet_result(TET_PASS); + + return; +} + +void utc_tel_get_call_time_02() +{ + CALL_TEST_DEBUG("\n######## TEST START ###########\n"); + TapiResult_t ret_status ; + TS_WORD req_mask = 1; + ret_status = tel_get_call_time (req_mask, NULL); + if(ret_status ==TAPI_API_SUCCESS) + { + tet_result(TET_FAIL); + } + printf("utc_tel_get_call_time_02 pass"); + tet_result(TET_PASS); + + return; +} diff --git a/TC/telephony_TC/call/unit/uts_tel_get_call_time.h b/TC/telephony_TC/call/unit/uts_tel_get_call_time.h new file mode 100644 index 0000000..9e7b052 --- /dev/null +++ b/TC/telephony_TC/call/unit/uts_tel_get_call_time.h @@ -0,0 +1,51 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * 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 __UTS_TEL_GET_CALL_TIME_H_ +#define __UTS_TEL_GET_CALL_TIME_H_ + +#include "tapi_callback.h" +#include +#include "call_common.h" +#include + +extern TS_UINT g_CallHandle; +extern TS_BOOL call_status; + + static void utc_tel_get_call_time_01(void); + static void utc_tel_get_call_time_02(void); + + static void startup(); + + static void cleanup(); + + +struct tet_testlist tet_testlist[] = { + {utc_tel_get_call_time_01, 1}, + {utc_tel_get_call_time_02, 2}, + {NULL, 0} + }; + +#endif + +/** + * @} + */ diff --git a/TC/telephony_TC/call/unit/uts_tel_hold_call.c b/TC/telephony_TC/call/unit/uts_tel_hold_call.c new file mode 100644 index 0000000..b46bb82 --- /dev/null +++ b/TC/telephony_TC/call/unit/uts_tel_hold_call.c @@ -0,0 +1,201 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * 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 "uts_tel_hold_call.h" + + +/* Initialize TCM data structures */ + + + + + +/* +* TapiResult_t tel_hold_call ( unsigned int CallHandle, int *pRequestId); +*/ + +void (*tet_startup) () = startup; +void (*tet_cleanup) () = cleanup; + + +extern int expected_event; + +static void startup() +{ + TapiResult_t ret_status ; + tapi_dbus_connection_name dname; + int bStatus; + ret_status = tel_init(); + + if(ret_status != TAPI_API_SUCCESS) + { + printf("tel_init() Failed ret_status = %d \n",ret_status); + } + + + register_all_events(); + tel_register_app_name("org.samsung.test"); + if(tel_get_app_name(&dname)) + printf("Dbus Get app name error\n"); + else + printf("Dbus Name is %s\n",dname.name); + + tel_check_service_ready(&bStatus); + printf("Telephpny service %d\n",bStatus); + +} + +static void cleanup() +{ + int RequestId; + tel_release_call_all(&RequestId); + expected_event = TAPI_EVENT_CALL_END_IND; + gmain_loop_for_tapi_events(TIME_DELAY1); + + deregister_all(); + + tel_deinit(); + +} + + + + + +/** + * @brief This tests tel_hold_call() API in normal conditions + * @par ID: + * UTC_TEL_HOLD_CALL_01 + * @param [in] CallHandle = g_hold_callhandle[1] + * @param [out] pRequestId = &RequestId + * @return TAPI_API_SUCCESS +*/ + +void utc_tel_hold_call_01() +{ + CALL_TEST_DEBUG("################ TEST START ################"); + TapiResult_t ret_status ; + unsigned int active_call_handle = -1; + TelCallSetupParams_t setup_call_info; + int RequestId = -1; + char normal[16] = MOB_NUM1; + + memset(&setup_call_info, 0, sizeof(TelCallSetupParams_t)); + setup_call_info.CallType = TAPI_CALL_TYPE_VOICE; + strncpy(setup_call_info.szNumber, normal, 13); + tet_printf("called number = %s\n", setup_call_info.szNumber); + + //setup_call_info.IdentityMode = TAPI_CALL_IDENTITY_SHOW; //preet: TelCallSetupParams_t dont have these memebers + //setup_call_info.pCugInfo = NULL; + //setup_call_info.pUusInfo = NULL; + + CALL_TEST_DEBUG("MAKE A MO CALL TO %s",setup_call_info.szNumber); + + ret_status = tel_exe_call_mo(&setup_call_info, &active_call_handle , &RequestId); + //ret_status = tel_answer_call(g_CallHandle, TEL_ANSWER_CALL_ACCEPT, &RequestId); + // g_CallHandle = -1; + // TET_CHECK(TAPI_API_SUCCESS, ret_status); + // expected_event = TAPI_EVENT_CALL_ANSWER_CNF; + // gmain_loop_for_tapi_events(TIME_DELAY1); + + TET_CHECK(TAPI_API_SUCCESS, ret_status); + expected_event = TAPI_EVENT_CALL_SETUP_CNF; + gmain_loop_for_tapi_events(TIME_DELAY1); + + expected_event = TAPI_EVENT_CALL_CONNECTED_IND; + gmain_loop_for_tapi_events(TIME_DELAY1); + + CALL_TEST_DEBUG("HOLD THE ACTIVE CALL"); + + ret_status = tel_hold_call (active_call_handle , &RequestId); + + TET_CHECK(TAPI_API_SUCCESS, ret_status); + expected_event = TAPI_EVENT_CALL_HOLD_CNF; + + gmain_loop_for_tapi_events(TIME_DELAY1); + + CALL_TEST_DEBUG("RELEASE ALL CALLS"); + + tel_release_call_all(&RequestId); + expected_event = TAPI_EVENT_CALL_END_IND; + + gmain_loop_for_tapi_events(TIME_DELAY1); + + tet_result(TET_PASS); + + return; + +} + +/** + * @brief This tests tel_hold_call() API in abnormal conditions + * @par ID: + * UTC_TEL_HOLD_CALL_02 + * @param [in] CallHandle = 1 + * @param [out] pRequestId = NULL +* @return TAPI_API_INVALID_PTR +*/ + +void utc_tel_hold_call_02() +{ + CALL_TEST_DEBUG("\n######## TEST START ###########\n"); + TapiResult_t ret_status ; + + TS_UINT call_handle = VALID_CALL_HANDLE; + + ret_status = tel_hold_call ( call_handle, NULL); + + TET_CHECK(TAPI_API_INVALID_PTR, ret_status); + + tet_infoline("utc_tel_hold_call_02"); + tet_result(TET_PASS); + + return; +} + + +/** + * @brief This tests tel_hold_call() API in abnormal conditions + * @par ID: + * UTC_TEL_HOLD_CALL_03 + * @param [in] CallHandle = call_handle + * @param [out] pRequestId = &RequestId +* @return TAPI_API_INVALID_CALL_HANDLE +*/ + +void utc_tel_hold_call_03() +{ + CALL_TEST_DEBUG("\n######## TEST START ###########\n"); + TapiResult_t ret_status ; + unsigned int call_handle = INVALID_CALL_HANDLE; + int RequestId = -1; + + ret_status = tel_hold_call (call_handle, &RequestId); + + TET_CHECK(TAPI_API_INVALID_CALL_HANDLE, ret_status); + + tet_infoline("utc_tel_hold_call_03 pass"); + tet_result(TET_PASS); + + return; +} + + diff --git a/TC/telephony_TC/call/unit/uts_tel_hold_call.h b/TC/telephony_TC/call/unit/uts_tel_hold_call.h new file mode 100644 index 0000000..7cfec54 --- /dev/null +++ b/TC/telephony_TC/call/unit/uts_tel_hold_call.h @@ -0,0 +1,68 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * 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 __UTS_TEL_HOLD_CALL_H_ +#define __UTS_TEL_HOLD_CALL_H_ + +/* Includes */ + + +#include "tapi_callback.h" +#include +#include "call_common.h" + +extern TS_UINT g_CallHandle; +extern TS_BOOL call_status; + + + +/** +* @test This test case tests TapiResult_t tel_hold_call ( unsigned int CallHandle, int *pRequestId); +* @brief This API is used to test MT call +* @return tapi_api_err_t +*/ + + + + static void utc_tel_hold_call_01(void); + + static void utc_tel_hold_call_02(void); + + static void utc_tel_hold_call_03(void); + + + static void startup(); + + static void cleanup(); + + +struct tet_testlist tet_testlist[] = { + {utc_tel_hold_call_01, 1}, + {utc_tel_hold_call_02, 2}, + {utc_tel_hold_call_03, 3}, + {NULL, 0} + }; + +#endif + +/** + * @} + */ diff --git a/TC/telephony_TC/call/unit/uts_tel_join_call.c b/TC/telephony_TC/call/unit/uts_tel_join_call.c new file mode 100644 index 0000000..aee59b3 --- /dev/null +++ b/TC/telephony_TC/call/unit/uts_tel_join_call.c @@ -0,0 +1,219 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * 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 "uts_tel_join_call.h" + + +/* Initialize TCM data structures */ + + + + + +/* +* TapiResult_t tel_join_call ( unsigned int CallHandle1, unsigned int CallHandle2, int * pRequestId); +*/ + +void (*tet_startup) () = startup; +void (*tet_cleanup) () = cleanup; + + +extern int expected_event; + +static void startup() +{ + TapiResult_t ret_status ; + tapi_dbus_connection_name dname; + int bStatus; + ret_status = tel_init(); + + if(ret_status != TAPI_API_SUCCESS) + { + printf("tel_init() Failed ret_status = %d \n",ret_status); + } + + register_all_events(); + tel_register_app_name("org.samsung.test"); + if(tel_get_app_name(&dname)) + printf("Dbus Get app name error\n"); + else + printf("Dbus Name is %s\n",dname.name); + + tel_check_service_ready(&bStatus); + printf("Telephpny service %d\n",bStatus); + +} + +static void cleanup() +{ + int RequestId = -1; + + tel_release_call_all(&RequestId); + expected_event = TAPI_EVENT_CALL_END_IND; + gmain_loop_for_tapi_events(TIME_DELAY0); + + deregister_all(); + + tel_deinit(); + +} + + + +/** + * @brief This tests tel_join_call() API in normal conditions + * @par ID: + * UTC_TEL_JOIN_CALL_01 + * @param [in] CallHandle1 = callhandle[1] + * @param [in] CallHandle2 = callhandle[0] + * @param [out] pRequestId = &RequestId +* @return TAPI_API_SUCCESS +*/ + +void utc_tel_join_call_01() +{ + CALL_TEST_DEBUG("\n######## TEST START ###########\n"); + TapiResult_t ret_status ; + unsigned int call_handle_01 = -1; + unsigned int call_handle_02 = -1; + TelCallSetupParams_t setup_call_info_01; + TelCallSetupParams_t setup_call_info_02; + int RequestId = -1; + char normal1[16] = MOB_NUM1; + char normal2[16] = MOB_NUM2; + + memset(&setup_call_info_01, 0, sizeof(TelCallSetupParams_t)); + setup_call_info_01.CallType = TAPI_CALL_TYPE_VOICE; + strncpy(setup_call_info_01.szNumber, normal1, 13); + tet_printf("called number = %s\n", setup_call_info_01.szNumber); + + //setup_call_info_01.IdentityMode = TAPI_CALL_IDENTITY_SHOW; //preet: TelCallSetupParams_t dont have these members + //setup_call_info_01.pCugInfo = NULL; + //setup_call_info_01.pUusInfo = NULL; + + memset(&setup_call_info_02, 0, sizeof(TelCallSetupParams_t)); + setup_call_info_02.CallType = TAPI_CALL_TYPE_VOICE; + strncpy(setup_call_info_02.szNumber, normal2, 13); + tet_printf("called number = %s\n", setup_call_info_02.szNumber); + + //setup_call_info_02.IdentityMode = TAPI_CALL_IDENTITY_SHOW; //preet: TelCallSetupParams_t dont have these member + //setup_call_info_02.pCugInfo = NULL; + //setup_call_info_02.pUusInfo = NULL; + + + CALL_TEST_DEBUG("MAKE A 1ST MO CALL TO %s\n",setup_call_info_01.szNumber); + + ret_status = tel_exe_call_mo(&setup_call_info_01, &call_handle_01, &RequestId); + + TET_CHECK(TAPI_API_SUCCESS, ret_status); + expected_event = TAPI_EVENT_CALL_CONNECTED_IND; + gmain_loop_for_tapi_events(TIME_DELAY1); + + CALL_TEST_DEBUG("HOLD THE ACTIVE CALL\n"); + + ret_status = tel_hold_call (call_handle_01 , &RequestId); + + TET_CHECK(TAPI_API_SUCCESS, ret_status); + //expected_event = TAPI_EVENT_CALL_HOLD_CNF; + gmain_loop_for_tapi_events(TIME_DELAY1); + + + CALL_TEST_DEBUG("MAKE 2ND MO CALL TO %s\n",setup_call_info_02.szNumber); + + ret_status = tel_exe_call_mo(&setup_call_info_02, &call_handle_02, &RequestId); + + TET_CHECK(TAPI_API_SUCCESS, ret_status); + expected_event = TAPI_EVENT_CALL_CONNECTED_IND; + gmain_loop_for_tapi_events(TIME_DELAY1); + + CALL_TEST_DEBUG("JOIN TWO CALLS\n"); + + ret_status = tel_join_call (call_handle_02, call_handle_01, &RequestId); + + TET_CHECK(TAPI_API_SUCCESS, ret_status); + expected_event = TAPI_EVENT_CALL_SETUPCONFERENCE_CNF; + gmain_loop_for_tapi_events(TIME_DELAY1); + + CALL_TEST_DEBUG("RELEASE ALL CALLS\n"); + + tel_release_call_all(&RequestId); + expected_event = TAPI_EVENT_CALL_END_IND; + gmain_loop_for_tapi_events(TIME_DELAY1); + + printf("utc_tel_join_call_01 pass\n"); + tet_result(TET_PASS); + + return; +} + + +/** + * @brief This tests tel_join_call() API in abnormal conditions + * @par ID: + * UTC_TEL_JOIN_CALL_02 + * @param [in] CallHandle1 = INVALID_CALL_HANDLE + * @param [in] CallHandle2 = VALID_CALL_HANDLE + * @param [out] pRequestId = &RequestId +* @return TAPI_API_INVALID_CALL_HANDLE +*/ + +void utc_tel_join_call_02() +{ + CALL_TEST_DEBUG("\n######## TEST START ###########\n"); + TapiResult_t ret_status ; + int RequestId = -1; + + ret_status = tel_join_call (INVALID_CALL_HANDLE, VALID_CALL_HANDLE, &RequestId); + + TET_CHECK(TAPI_API_INVALID_CALL_HANDLE, ret_status); + + printf("utc_tel_join_call_02 pass\n"); + tet_result(TET_PASS); + + return; +} + +/** + * @brief This tests tel_join_call() API in abnormal conditions + * @par ID: + * UTC_TEL_JOIN_CALL_04 + * @param [in] CallHandle1 = VALID_CALL_HANDLE + * @param [in] CallHandle2 = VALID_CALL_HANDLE+1 + * @param [out] pRequestId = NULL +* @return TAPI_API_INVALID_PTR +*/ + +void utc_tel_join_call_03() +{ + CALL_TEST_DEBUG("\n######## TEST START ###########\n"); + TapiResult_t ret_status ; + + ret_status = tel_join_call (VALID_CALL_HANDLE, VALID_CALL_HANDLE+1, NULL); + + TET_CHECK(TAPI_API_INVALID_PTR, ret_status); + + printf("utc_tel_join_call_04 pass\n"); + tet_result(TET_PASS); + + return; +} + diff --git a/TC/telephony_TC/call/unit/uts_tel_join_call.h b/TC/telephony_TC/call/unit/uts_tel_join_call.h new file mode 100644 index 0000000..deb278d --- /dev/null +++ b/TC/telephony_TC/call/unit/uts_tel_join_call.h @@ -0,0 +1,55 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * 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 __UTS_TEL_JOIN_CALL_H_ +#define __UTS_TEL_JOIN_CALL_H_ + +/* Includes */ + + +#include "tapi_callback.h" +#include +#include "call_common.h" + + + static void utc_tel_join_call_01(void); + + static void utc_tel_join_call_02(void); + + static void utc_tel_join_call_03(void); + + static void startup(); + + static void cleanup(); + + +struct tet_testlist tet_testlist[] = { + {utc_tel_join_call_01, 1}, + {utc_tel_join_call_02, 2}, + {utc_tel_join_call_03, 3}, + {NULL, 0} + }; + +#endif + +/** + * @} + */ diff --git a/TC/telephony_TC/call/unit/uts_tel_release_call.c b/TC/telephony_TC/call/unit/uts_tel_release_call.c new file mode 100644 index 0000000..94f0da7 --- /dev/null +++ b/TC/telephony_TC/call/unit/uts_tel_release_call.c @@ -0,0 +1,185 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * 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 "uts_tel_release_call.h" + + +extern TS_UINT g_CallHandle; + +/* Initialize TCM data structures */ + + + +void (*tet_startup) () = startup; +void (*tet_cleanup) () = cleanup; + +extern int expected_event; + +static void startup() +{ + TapiResult_t ret_status ; + tapi_dbus_connection_name dname; + int bStatus; + + ret_status = tel_init(); + + if(ret_status != TAPI_API_SUCCESS) + { + printf("tel_init() Failed ret_status = %d \n",ret_status); + } + g_CallHandle = -1; + + register_all_events(); + tel_register_app_name("org.samsung.test"); + if(tel_get_app_name(&dname)) + printf("Dbus Get app name error\n"); + else + printf("Dbus Name is %s\n",dname.name); + + tel_check_service_ready(&bStatus); + printf("Telephpny service %d\n",bStatus); +} + +static void cleanup() +{ + g_CallHandle = -1; + + deregister_all(); + + tel_deinit(); +} + +/** +TapiResult_t tel_release_call ( unsigned int CallHandle, int *pRequestId); +*/ + + +/** + * @brief This tests tel_release_call() API in normal conditions (MO CALL) + * @par ID: + * UTC_TEL_RELEASE_CALL_01 + * @param [in] CallHandle = active_call_handle + * @param [out] pRequestId = &RequestId +* @return TAPI_API_SUCCESS +*/ + + +void utc_tel_release_call_01() +{ + CALL_TEST_DEBUG("\n######## TEST START ###########\n"); + TapiResult_t ret_status ; + unsigned int active_call_handle = 0; + TelCallSetupParams_t setup_call_info; + int RequestId = -1; + char normal[16] = MOB_NUM1; + + memset(&setup_call_info, 0, sizeof(TelCallSetupParams_t)); + setup_call_info.CallType = TAPI_CALL_TYPE_VOICE; + strncpy(setup_call_info.szNumber, normal, 13); + tet_printf("called number = %s\n", setup_call_info.szNumber); + + //setup_call_info.IdentityMode = TAPI_CALL_IDENTITY_SHOW; //preet: TelCallSetupParams_t dont ahve these members + //setup_call_info.pCugInfo = NULL; + //setup_call_info.pUusInfo = NULL; + + CALL_TEST_DEBUG("MAKE A MO CALL TO %s",setup_call_info.szNumber); + ret_status = tel_exe_call_mo(&setup_call_info, &g_CallHandle, &RequestId); + TET_CHECK(TAPI_API_SUCCESS, ret_status); + expected_event = TAPI_EVENT_CALL_SETUP_CNF; + gmain_loop_for_tapi_events(TIME_DELAY1); + + expected_event = TAPI_EVENT_CALL_CONNECTED_IND; + gmain_loop_for_tapi_events(TIME_DELAY1); + + CALL_TEST_DEBUG("RELEASE A CALL %s\n",setup_call_info.szNumber); + ret_status = tel_release_call (g_CallHandle,&RequestId ); + + expected_event = TAPI_EVENT_CALL_END_IND; + gmain_loop_for_tapi_events(TIME_DELAY1); + + TET_CHECK(TAPI_API_SUCCESS, ret_status); + + tet_infoline("utc_tel_release_call_01"); + tet_result(TET_PASS); + + return; +} + + +/** + * @brief This tests tel_release_call() API in abnormal conditions + * @par ID: + * UTC_TEL_RELEASE_CALL_02 + * @param [in] CallHandle = INVALID_CALL_HANDLE + * @param [out] pRequestId = &RequestId +* @return TAPI_API_INVALID_CALL_HANDLE +*/ + +void utc_tel_release_call_02() +{ + CALL_TEST_DEBUG("\n######## TEST START ###########\n"); + TapiResult_t ret_status ; + unsigned int call_handle = -1;//INVALID_CALL_HANDLE; + int RequestId = -1; + + ret_status = tel_release_call (call_handle ,&RequestId); + + printf ("utc_tel_release_call_02 RequestId = %d\n", RequestId); + + TET_CHECK(TAPI_API_COULD_NOT_GET_CALL_CTXT, ret_status); + + tet_infoline("utc_tel_release_call_02"); + tet_result(TET_PASS); + + return; +} + +/** + * @brief This tests tel_release_call() API in abnormal conditions (MT CALL) + * @par ID: + * UTC_TEL_RELEASE_CALL_03 + * @param [in] CallHandle = g_CallHandle + * @param [out] pRequestId = NULL +* @return TAPI_API_INVALID_PTR +*/ + + +void utc_tel_release_call_03() +{ + CALL_TEST_DEBUG("\n######## TEST START ###########\n"); + TapiResult_t ret_status ; + unsigned int call_handle; + + ret_status = tel_release_call (call_handle,NULL ); + + TET_CHECK(TAPI_API_INVALID_PTR, ret_status); + + tet_infoline("utc_tel_release_call_03"); + tet_result(TET_PASS); + + return; +} + diff --git a/TC/telephony_TC/call/unit/uts_tel_release_call.h b/TC/telephony_TC/call/unit/uts_tel_release_call.h new file mode 100644 index 0000000..f0d314a --- /dev/null +++ b/TC/telephony_TC/call/unit/uts_tel_release_call.h @@ -0,0 +1,61 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * 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 __UTS_TEL_RELEASE_CALL_H_ +#define __UTS_TEL_RELEASE_CALL_H_ + +#include "tapi_callback.h" +#include +#include "call_common.h" + + +/** +* @test This test case tests TapiResult_t tel_release_call ( unsigned int CallHandle, int *pRequestId); + TapiResult_t tel_release_callAll (int *pRequestId); +* @brief This API is used to test MT call +* @return tapi_api_err_t +*/ + + + static void utc_tel_release_call_01(void); + + static void utc_tel_release_call_02(void); + + static void utc_tel_release_call_03(void); + + static void startup(); + + static void cleanup(); + + + +struct tet_testlist tet_testlist[] = { + {utc_tel_release_call_01, 1}, + {utc_tel_release_call_02, 2}, + {utc_tel_release_call_03, 3}, + {NULL, 0} + }; + +#endif + +/** + * @} + */ diff --git a/TC/telephony_TC/call/unit/uts_tel_release_call_all.c b/TC/telephony_TC/call/unit/uts_tel_release_call_all.c new file mode 100644 index 0000000..08bf39f --- /dev/null +++ b/TC/telephony_TC/call/unit/uts_tel_release_call_all.c @@ -0,0 +1,155 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * 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 "uts_tel_release_call_all.h" + +/* Initialize TCM data structures */ +void (*tet_startup) () = startup; +void (*tet_cleanup) () = cleanup; + +extern int expected_event; + +static void startup() +{ + TapiResult_t ret_status ; + tapi_dbus_connection_name dname; + int bStatus; + ret_status = tel_init(); + + if(ret_status != TAPI_API_SUCCESS) + { + printf("tel_init() Failed ret_status = %d \n",ret_status); + } + + + register_all_events(); + tel_register_app_name("org.samsung.test"); + if(tel_get_app_name(&dname)) + printf("Dbus Get app name error\n"); + else + printf("Dbus Name is %s\n",dname.name); + + tel_check_service_ready(&bStatus); + printf("Telephpny service %d\n",bStatus); +} + +static void cleanup() +{ + deregister_all(); + + tel_deinit(); +} + +/** + * @brief This tests tel_release_call_all() API in normal conditions (MO call) + * @par ID: + * UTC_TEL_RELEASE_CALL_ALL_01 + * @param [out] pRequestId = &RequestId +* @return TAPI_API_SUCCESS +*/ +void utc_tel_release_call_all_01() +{ + CALL_TEST_DEBUG("\n################ TEST START ################\n"); + TapiResult_t ret_status ; + unsigned int call_handle_01 = -1; + unsigned int call_handle_02 = -1; + TelCallSetupParams_t setup_call_info_01; + TelCallSetupParams_t setup_call_info_02; + int RequestId = -1; + char normal1[16] = MOB_NUM1; + char normal2[16] = MOB_NUM2; + + memset(&setup_call_info_01, 0, sizeof(TelCallSetupParams_t)); + setup_call_info_01.CallType = TAPI_CALL_TYPE_VOICE; + strncpy(setup_call_info_01.szNumber, normal1, 13); + tet_printf("called number = %s\n", setup_call_info_01.szNumber); + + //setup_call_info_01.IdentityMode = TAPI_CALL_IDENTITY_SHOW; //preet + //setup_call_info_01.pCugInfo = NULL; + //setup_call_info_01.pUusInfo = NULL; + + memset(&setup_call_info_02, 0, sizeof(TelCallSetupParams_t)); + setup_call_info_02.CallType = TAPI_CALL_TYPE_VOICE; + strncpy(setup_call_info_02.szNumber, normal2, 13); + tet_printf("called number = %s\n", setup_call_info_02.szNumber); + + //setup_call_info_02.IdentityMode = TAPI_CALL_IDENTITY_SHOW; //preet + //setup_call_info_02.pCugInfo = NULL; + //setup_call_info_02.pUusInfo = NULL; + + CALL_TEST_DEBUG("MAKE A 1ST MO CALL TO %s\n",setup_call_info_01.szNumber); + ret_status = tel_exe_call_mo(&setup_call_info_01, &call_handle_01, &RequestId); + TET_CHECK(TAPI_API_SUCCESS, ret_status); + expected_event = TAPI_EVENT_CALL_SETUP_CNF; + gmain_loop_for_tapi_events(TIME_DELAY1); + + expected_event = TAPI_EVENT_CALL_CONNECTED_IND; + gmain_loop_for_tapi_events(TIME_DELAY1); + + CALL_TEST_DEBUG("HOLD THE ACTIVE CALL\n"); + ret_status = tel_hold_call (call_handle_01 , &RequestId); + TET_CHECK(TAPI_API_SUCCESS, ret_status); + expected_event = TAPI_EVENT_CALL_HOLD_CNF; + gmain_loop_for_tapi_events(TIME_DELAY1); + + CALL_TEST_DEBUG("MAKE 2ND MO CALL TO %s\n",setup_call_info_02.szNumber); + ret_status = tel_exe_call_mo(&setup_call_info_02, &call_handle_02, &RequestId); + TET_CHECK(TAPI_API_SUCCESS, ret_status); + expected_event = TAPI_EVENT_CALL_SETUP_CNF; + gmain_loop_for_tapi_events(TIME_DELAY1); + + expected_event = TAPI_EVENT_CALL_CONNECTED_IND; + gmain_loop_for_tapi_events(TIME_DELAY1); + + CALL_TEST_DEBUG("RELEASE ALL ACTIVE CALL\n"); + ret_status = tel_release_call_all(&RequestId); + TET_CHECK(TAPI_API_SUCCESS, ret_status); + expected_event = TAPI_EVENT_CALL_END_IND; + gmain_loop_for_tapi_events(TIME_DELAY1); + + tet_result(TET_PASS); + + return; +} + +/** + * @brief This tests tel_release_call_all() API in abnormal conditions + * @par ID: + * UTC_TEL_RELEASE_CALL_ALL_02 + * @param [out] pRequestId = NULL +* @return TAPI_API_INVALID_PTR +*/ + +void utc_tel_release_call_all_02() +{ + CALL_TEST_DEBUG("\n######## TEST START ###########\n"); + TapiResult_t ret_status ; + + ret_status = tel_release_call_all (NULL); + + TET_CHECK(TAPI_API_INVALID_PTR, ret_status); + + tet_infoline("utc_tel_release_call_func_03"); + tet_result(TET_PASS); + + return; +} diff --git a/TC/telephony_TC/call/unit/uts_tel_release_call_all.h b/TC/telephony_TC/call/unit/uts_tel_release_call_all.h new file mode 100644 index 0000000..eb3574c --- /dev/null +++ b/TC/telephony_TC/call/unit/uts_tel_release_call_all.h @@ -0,0 +1,67 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * 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 __UTS_TEL_RELEASE_CALL_ALL_H_ +#define __UTS_TEL_RELEASE_CALL_ALL_H_ + +/* Includes */ + +#include "tapi_callback.h" +#include +#include "call_common.h" + +extern TS_UINT g_CallHandle; +extern TS_BOOL call_status; + + + +/** +* @test This test case tests TapiResult_t tel_release_call_all (int *pRequestId); +* @brief This API is used to test MT call +* @return tapi_api_err_t +*/ + + +// static void utc_tel_release_call_all_01(void); + + static void utc_tel_release_call_all_01(void); + + static void utc_tel_release_call_all_02(void); + + + + static void startup(); + + static void cleanup(); + + + +struct tet_testlist tet_testlist[] = { + {utc_tel_release_call_all_01, 1}, + {utc_tel_release_call_all_02, 2}, + {NULL, 0} + }; + +#endif + +/** + * @} + */ diff --git a/TC/telephony_TC/call/unit/uts_tel_release_call_all_active.c b/TC/telephony_TC/call/unit/uts_tel_release_call_all_active.c new file mode 100644 index 0000000..3705fa1 --- /dev/null +++ b/TC/telephony_TC/call/unit/uts_tel_release_call_all_active.c @@ -0,0 +1,182 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * 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 "uts_tel_release_call_all_active.h" + + +/* Initialize TCM data structures */ + + + + + +/* +* TapiResult_t tel_release_call_all_active(int *pRequestID); +*/ + +void (*tet_startup) () = startup; +void (*tet_cleanup) () = cleanup; + + +extern int expected_event; + +static void startup() +{ + TapiResult_t ret_status ; + tapi_dbus_connection_name dname; + int bStatus; + ret_status = tel_init(); + + if(ret_status != TAPI_API_SUCCESS) + { + printf("tel_init() Failed ret_status = %d \n",ret_status); + } + + + register_all_events(); + tel_register_app_name("org.samsung.test"); + if(tel_get_app_name(&dname)) + printf("Dbus Get app name error\n"); + else + printf("Dbus Name is %s\n",dname.name); + + tel_check_service_ready(&bStatus); + printf("Telephpny service %d\n",bStatus); + + g_CallHandle = -1; +} + +static void cleanup() +{ + int RequestId = -1; + + tel_release_call_all(&RequestId); + gmain_loop_for_tapi_events(TIME_DELAY0); + + deregister_all(); + + tel_deinit(); + +} + + +/** + * @brief This tests tel_release_call_active_all() API in normal conditions + * @par ID: + * UTC_TEL_RELEASE_CALL_ALL_ACTIVe_01 + * @param [out] pRequestId = &RequestId +* @return TAPI_API_SUCCESS +*/ + +void utc_tel_release_call_all_active_01() +{ + CALL_TEST_DEBUG("\n################ TEST START ################\n"); + TapiResult_t ret_status ; + unsigned int call_handle_01 = -1; + unsigned int call_handle_02 = -1; + TelCallSetupParams_t setup_call_info_01; + TelCallSetupParams_t setup_call_info_02; + int RequestId = -1; + char normal1[16] = MOB_NUM1; + char normal2[16] = MOB_NUM2; + + memset(&setup_call_info_01, 0, sizeof(TelCallSetupParams_t)); + setup_call_info_01.CallType = TAPI_CALL_TYPE_VOICE; + strncpy(setup_call_info_01.szNumber, normal1, 13); + tet_printf("called number = %s\n", setup_call_info_01.szNumber); + + //setup_call_info_01.IdentityMode = TAPI_CALL_IDENTITY_SHOW; //preet: TelCallSetupParams_t donot have these members + //setup_call_info_01.pCugInfo = NULL; + //setup_call_info_01.pUusInfo = NULL; + + memset(&setup_call_info_02, 0, sizeof(TelCallSetupParams_t)); + setup_call_info_02.CallType = TAPI_CALL_TYPE_VOICE; + strncpy(setup_call_info_02.szNumber, normal2, 13); + tet_printf("called number = %s\n", setup_call_info_02.szNumber); + + //setup_call_info_02.IdentityMode = TAPI_CALL_IDENTITY_SHOW; //preet: TelCallSetupParams_t donot have these members + //setup_call_info_02.pCugInfo = NULL; + //setup_call_info_02.pUusInfo = NULL; + + + CALL_TEST_DEBUG("MAKE A 1ST MO CALL TO %s\n",setup_call_info_01.szNumber); + ret_status = tel_exe_call_mo(&setup_call_info_01, &call_handle_01, &RequestId); + TET_CHECK(TAPI_API_SUCCESS, ret_status); + expected_event = TAPI_EVENT_CALL_CONNECTED_IND; + gmain_loop_for_tapi_events(TIME_DELAY1); + + CALL_TEST_DEBUG("HOLD THE ACTIVE CALL\n"); + ret_status = tel_hold_call (call_handle_01 , &RequestId); + TET_CHECK(TAPI_API_SUCCESS, ret_status); + expected_event = TAPI_EVENT_CALL_HOLD_CNF; + gmain_loop_for_tapi_events(TIME_DELAY1); + + CALL_TEST_DEBUG("MAKE 2ND MO CALL TO %s\n",setup_call_info_02.szNumber); + ret_status = tel_exe_call_mo(&setup_call_info_02, &call_handle_02, &RequestId); + TET_CHECK(TAPI_API_SUCCESS, ret_status); + expected_event = TAPI_EVENT_CALL_CONNECTED_IND; + gmain_loop_for_tapi_events(TIME_DELAY1); + + CALL_TEST_DEBUG("RELEASE ALL ACTIVE CALL\n"); + ret_status = tel_release_call_all_active(&RequestId); + TET_CHECK(TAPI_API_SUCCESS, ret_status); + expected_event = TAPI_EVENT_CALL_END_IND; + gmain_loop_for_tapi_events(TIME_DELAY1); + + TelCallStatus_t call_status; + + CALL_TEST_DEBUG("GET CALL STATUS\n"); + ret_status = tel_get_call_status (call_handle_01, &call_status); + TET_CHECK(TAPI_API_SUCCESS, ret_status); + CALL_TEST_DEBUG("Active State :%d\n",call_status.CallActiveState); + CALL_TEST_DEBUG("Call State :%d\n",call_status.CallState); + CALL_TEST_DEBUG("call Type :%d\n",call_status.CallType); + CALL_TEST_DEBUG("call Number :%s\n",call_status.pNumber); + + tet_result(TET_PASS); + + return; +} + +/** + * @brief This tests tel_release_call_all_active() API in abnormal conditions + * @par ID: + * UTC_TEL_RELEASE_CALL_ALL_ACTIVe_02 + * @param [out] pRequestId = NULL +* @return TAPI_API_INVALID_PTR +*/ + + +void utc_tel_release_call_all_active_02() +{ + CALL_TEST_DEBUG("\n######## TEST START ###########\n"); + TapiResult_t ret_status ; + + ret_status = tel_release_call_all_active(NULL); + + TET_CHECK(TAPI_API_INVALID_PTR, ret_status); + + tet_infoline("utc_tel_release_call_all_active_02"); + tet_result(TET_PASS); + + return; +} + diff --git a/TC/telephony_TC/call/unit/uts_tel_release_call_all_active.h b/TC/telephony_TC/call/unit/uts_tel_release_call_all_active.h new file mode 100644 index 0000000..2117dc5 --- /dev/null +++ b/TC/telephony_TC/call/unit/uts_tel_release_call_all_active.h @@ -0,0 +1,86 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * 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 __UTS_TEL_RELEASE_CALL_ALL_ACTIVE_H_ +#define __UTS_TEL_RELEASE_CALL_ALL_ACTIVE_H_ + +/* Includes */ + + +#include "tapi_callback.h" +#include +#include "call_common.h" + +extern TS_UINT g_CallHandle; +extern TS_BOOL call_status; + + + +/** +* @test This test case tests TapiResult_t tel_release_call_all_active(int *pRequestID); +* @brief This API is used to release all active call. +* @return TapiResult_t +*/ + + + +/** +* @test This test case tests +* API This test case tests TapiResult_t tel_release_call_all_active(int *pRequestID); +* @brief launch application with valid input, outparameter . @n +* @pre +* @param[in] pRequestID = valid pointer , +* @return TAPI_API_SUCCESS + +*/ + + static void utc_tel_release_call_all_active_01(void); + + +/** +* @test This test case tests +* API This test case tests TapiResult_t tel_release_call_all_active(int *pRequestID); +* @brief launch application with valid input, outparameter . @n +* @pre +* @param[in] pRequestID = NULL , +* @return TAPI_API_INVALID_PTR + +*/ + + static void utc_tel_release_call_all_active_02(void); + + + static void startup(); + + static void cleanup(); + + +struct tet_testlist tet_testlist[] = { + {utc_tel_release_call_all_active_01, 1}, + {utc_tel_release_call_all_active_02, 2}, + {NULL, 0} + }; + +#endif + +/** + * @} + */ diff --git a/TC/telephony_TC/call/unit/uts_tel_release_call_all_held.c b/TC/telephony_TC/call/unit/uts_tel_release_call_all_held.c new file mode 100644 index 0000000..ccdc03b --- /dev/null +++ b/TC/telephony_TC/call/unit/uts_tel_release_call_all_held.c @@ -0,0 +1,169 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * 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 "uts_tel_release_call_all_held.h" + + + +/* Initialize TCM data structures */ + + + +void (*tet_startup) () = startup; +void (*tet_cleanup) () = cleanup; + + +extern int expected_event; + +static void startup() +{ + TapiResult_t ret_status ; + tapi_dbus_connection_name dname; + int bStatus; + ret_status = tel_init(); + + if(ret_status != TAPI_API_SUCCESS) + { + printf("tel_init() Failed ret_status = %d \n",ret_status); + } + + + register_all_events(); + tel_register_app_name("org.samsung.test"); + if(tel_get_app_name(&dname)) + printf("Dbus Get app name error\n"); + else + printf("Dbus Name is %s\n",dname.name); + + tel_check_service_ready(&bStatus); + printf("Telephpny service %d\n",bStatus); +} + +static void cleanup() +{ + deregister_all(); + + tel_deinit(); +} + + +/** +TapiResult_t tel_release_call_all_held (int *pRequestId); +*/ + + +/** + * @brief This tests tel_release_call_all_held() API in normal conditions (MO call) + * @par ID: + * UTC_TEL_RELEASE_CALL_ALL_01 + * @param [out] pRequestId = &RequestId +* @return TAPI_API_SUCCESS +*/ +void utc_tel_release_call_all_held_01() +{ + CALL_TEST_DEBUG("\n################ TEST START ################\n"); + TapiResult_t ret_status ; + unsigned int call_handle_01 = -1; + unsigned int call_handle_02 = -1; + TelCallSetupParams_t setup_call_info_01; + TelCallSetupParams_t setup_call_info_02; + int RequestId = -1; + char normal1[16] = MOB_NUM1; + char normal2[16] = MOB_NUM2; + + memset(&setup_call_info_01, 0, sizeof(TelCallSetupParams_t)); + setup_call_info_01.CallType = TAPI_CALL_TYPE_VOICE; + strncpy(setup_call_info_01.szNumber, normal1, 13); + tet_printf("called number = %s\n", setup_call_info_01.szNumber); + + //setup_call_info_01.IdentityMode = TAPI_CALL_IDENTITY_SHOW; //preet + //setup_call_info_01.pCugInfo = NULL; + //setup_call_info_01.pUusInfo = NULL; + + memset(&setup_call_info_02, 0, sizeof(TelCallSetupParams_t)); + setup_call_info_02.CallType = TAPI_CALL_TYPE_VOICE; + strncpy(setup_call_info_02.szNumber, normal2, 13); + tet_printf("called number = %s\n", setup_call_info_02.szNumber); + + //setup_call_info_02.IdentityMode = TAPI_CALL_IDENTITY_SHOW; //preet + //setup_call_info_02.pCugInfo = NULL; + //setup_call_info_02.pUusInfo = NULL; + + + CALL_TEST_DEBUG("MAKE A 1ST MO CALL TO %s\n",setup_call_info_01.szNumber); + ret_status = tel_exe_call_mo(&setup_call_info_01, &call_handle_01, &RequestId); + TET_CHECK(TAPI_API_SUCCESS, ret_status); + expected_event = TAPI_EVENT_CALL_CONNECTED_IND; + gmain_loop_for_tapi_events(TIME_DELAY1); + + CALL_TEST_DEBUG("HOLD THE ACTIVE CALL\n"); + ret_status = tel_hold_call (call_handle_01 , &RequestId); + TET_CHECK(TAPI_API_SUCCESS, ret_status); + expected_event = TAPI_EVENT_CALL_HOLD_CNF; + gmain_loop_for_tapi_events(TIME_DELAY1); + + CALL_TEST_DEBUG("MAKE 2ND MO CALL TO %s\n",setup_call_info_02.szNumber); + ret_status = tel_exe_call_mo(&setup_call_info_02, &call_handle_02, &RequestId); + TET_CHECK(TAPI_API_SUCCESS, ret_status); + expected_event = TAPI_EVENT_CALL_CONNECTED_IND; + gmain_loop_for_tapi_events(TIME_DELAY1); + + + CALL_TEST_DEBUG("RELEASE ALL HELD CALLS\n"); + ret_status = tel_release_call_all_held(&RequestId); + TET_CHECK(TAPI_API_SUCCESS, ret_status); + expected_event = TAPI_EVENT_CALL_RELEASE_ALL_HELD_CNF; + gmain_loop_for_tapi_events(TIME_DELAY1); + + tet_result(TET_PASS); + + return; +} + +/** + * @brief This tests tel_release_call_all() API in abnormal conditions + * @par ID: + * UTC_TEL_RELEASE_CALL_ALL_02 + * @param [out] pRequestId = NULL +* @return TAPI_API_INVALID_PTR +*/ + +void utc_tel_release_call_all_held_02() +{ + CALL_TEST_DEBUG("\n######## TEST START ###########\n"); + TapiResult_t ret_status ; + + ret_status = tel_release_call_all_held (NULL); + + TET_CHECK(TAPI_API_INVALID_PTR, ret_status); + + tet_infoline("utc_tel_release_call_all_held_func_02"); + tet_result(TET_PASS); + + return; +} + + + diff --git a/TC/telephony_TC/call/unit/uts_tel_release_call_all_held.h b/TC/telephony_TC/call/unit/uts_tel_release_call_all_held.h new file mode 100644 index 0000000..59a22b8 --- /dev/null +++ b/TC/telephony_TC/call/unit/uts_tel_release_call_all_held.h @@ -0,0 +1,69 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * 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 __UTS_TEL_RELEASE_CALL_ALL_CALL_H_ +#define __UTS_TEL_RELEASE_CALL_ALL_CALL_H_ + +/* Includes */ + +#include "tapi_callback.h" +#include +#include "call_common.h" + +extern TS_UINT g_CallHandle; +extern TS_BOOL call_status; + + + +/** +* @test This test case tests TapiResult_t tel_release_call_all (int *pRequestId); +* @brief This API is used to test MT call +* @return tapi_api_err_t +*/ + + +// static void utc_tel_release_call_all_01(void); + + static void utc_tel_release_call_all_held_01(void); + + static void utc_tel_release_call_all_held_02(void); + + + + static void startup(); + + static void cleanup(); + + + +struct tet_testlist tet_testlist[] = { +// {utc_tel_release_call_all_01, 1}, + {utc_tel_release_call_all_held_01, 1}, + {utc_tel_release_call_all_held_02, 2}, + {NULL, 0} + }; + +#endif + +/** + * @} + */ + diff --git a/TC/telephony_TC/call/unit/uts_tel_retrieve_call.c b/TC/telephony_TC/call/unit/uts_tel_retrieve_call.c new file mode 100644 index 0000000..b590728 --- /dev/null +++ b/TC/telephony_TC/call/unit/uts_tel_retrieve_call.c @@ -0,0 +1,187 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * 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 "uts_tel_retrieve_call.h" + + +/* Initialize TCM data structures */ + +/* +* TapiResult_t tel_retrieve_call ( unsigned int CallHandle, int *pRequestId) ; +*/ + +void (*tet_startup) () = startup; +void (*tet_cleanup) () = cleanup; + + +extern int expected_event; + +static void startup() +{ + TapiResult_t ret_status ; + tapi_dbus_connection_name dname; + int bStatus; + + ret_status = tel_init(); + + if(ret_status != TAPI_API_SUCCESS) + { + printf("tel_init() Failed ret_status = %d \n",ret_status); + } + + register_all_events(); + tel_register_app_name("org.samsung.test"); + if(tel_get_app_name(&dname)) + printf("Dbus Get app name error\n"); + else + printf("Dbus Name is %s\n",dname.name); + + tel_check_service_ready(&bStatus); + printf("Telephpny service %d\n",bStatus); +} + +static void cleanup() +{ + int RequestId = -1; + + tel_release_call_all(&RequestId); + expected_event = TAPI_EVENT_CALL_END_IND; + gmain_loop_for_tapi_events(TIME_DELAY1); + + deregister_all(); + + tel_deinit(); +} + + +/** + * @brief This tests tel_retrieve_call() API in normal conditions + * @par ID: UTC_TEL_RETRIEVE_CALL_01 + * @param [in] CallHandle = g_retreive_handle[0] + * @param [out] pRequestId = &RequestId +* @return TAPI_API_SUCCESS +*/ + + +void utc_tel_retrieve_call_01() +{ + CALL_TEST_DEBUG("\n######## TEST START ###########\n"); + TapiResult_t ret_status ; + unsigned int active_call_handle = 0; + TelCallSetupParams_t setup_call_info; + int RequestId = -1; + char normal[16] = MOB_NUM1; + + memset(&setup_call_info, 0, sizeof(TelCallSetupParams_t)); + setup_call_info.CallType = TAPI_CALL_TYPE_VOICE; + strncpy(setup_call_info.szNumber, normal, 13); + tet_printf("called number = %s\n", setup_call_info.szNumber); + + //setup_call_info.IdentityMode = TAPI_CALL_IDENTITY_SHOW; //preet + //setup_call_info.pCugInfo = NULL; + //setup_call_info.pUusInfo = NULL; + + CALL_TEST_DEBUG("MAKE A MO CALL TO %s",setup_call_info.szNumber); + ret_status = tel_exe_call_mo(&setup_call_info, &active_call_handle, &RequestId); + TET_CHECK(TAPI_API_SUCCESS, ret_status); + expected_event = TAPI_EVENT_CALL_CONNECTED_IND; + gmain_loop_for_tapi_events(TIME_DELAY1); + + CALL_TEST_DEBUG("HOLD THE ACTIVE CALL"); + ret_status = tel_hold_call (active_call_handle , &RequestId); + TET_CHECK(TAPI_API_SUCCESS, ret_status); + expected_event = TAPI_EVENT_CALL_HOLD_CNF; + gmain_loop_for_tapi_events(TIME_DELAY1); + + CALL_TEST_DEBUG("RETRIEVE THE HELD CALL"); + ret_status = tel_retrieve_call (active_call_handle ,&RequestId); + TET_CHECK(TAPI_API_SUCCESS, ret_status); + expected_event = TAPI_EVENT_CALL_RETRIEVE_CNF; + + CALL_TEST_DEBUG("RELEASE ALL CALLS"); + tel_release_call_all(&RequestId); + expected_event = TAPI_EVENT_CALL_END_IND; + gmain_loop_for_tapi_events(TIME_DELAY1); + + printf("utc_tel_retrieve_call_01 pass\n"); + tet_result(TET_PASS); + + return; + +} + +/** + * @brief This tests tel_retrieve_call() API in abnormal conditions + * @par ID: + * UTC_TEL_RETRIEVE_CALL_02 + * @param [in] CallHandle = g_retreive_handle[1] + * @param [out] pRequestId = NULL +* @return TAPI_API_INVALID_PTR +*/ + +void utc_tel_retrieve_call_02() +{ + CALL_TEST_DEBUG("\n######## TEST START ###########\n"); + TapiResult_t ret_status ; + int RequestId = -1; + unsigned int call_handle = VALID_CALL_HANDLE; + + ret_status = tel_retrieve_call (call_handle , NULL); + + TET_CHECK(TAPI_API_INVALID_PTR, ret_status); + + RequestId = -1; + + printf("utc_tel_retrieve_call_02 pass\n"); + tet_result(TET_PASS); + + return; + +} + +/** + * @brief This tests tel_retrieve_call() API in abnormal conditions + * @par ID: + * UTC_TEL_RETRIEVE_CALL_03 + * @param [in] CallHandle = INVALID_CALL_HANDLE + * @param [out] pRequestId = &RequestId +* @return TAPI_API_INVALID_CALL_HANDLE +*/ + +void utc_tel_retrieve_call_03() +{ + CALL_TEST_DEBUG("\n######## TEST START ###########\n"); + TapiResult_t ret_status ; + unsigned int call_handle = INVALID_CALL_HANDLE; + int RequestId = -1; + + ret_status = tel_retrieve_call (call_handle, &RequestId); + + TET_CHECK(TAPI_API_INVALID_CALL_HANDLE, ret_status); + + printf("utc_tel_retrieve_call_03 pass\n"); + tet_result(TET_PASS); + + return; +} + + diff --git a/TC/telephony_TC/call/unit/uts_tel_retrieve_call.h b/TC/telephony_TC/call/unit/uts_tel_retrieve_call.h new file mode 100644 index 0000000..68b8c6b --- /dev/null +++ b/TC/telephony_TC/call/unit/uts_tel_retrieve_call.h @@ -0,0 +1,67 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * 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 __UTS_TEL_RETRIEVE_CALL_H_ +#define __UTS_TEL_RETRIEVE_CALL_H_ + +/* Includes */ + + +#include "tapi_callback.h" +#include +#include "call_common.h" + +extern TS_UINT g_CallHandle; +extern TS_BOOL call_status; + + + +/** +* @test This test case tests TapiResult_t tel_retrieve_call ( unsigned int CallHandle, int *pRequestId) ; +* @brief This API is used to test MT call +* @return tapi_api_err_t +*/ + + + static void utc_tel_retrieve_call_01(void); + + static void utc_tel_retrieve_call_02(void); + + static void utc_tel_retrieve_call_03(void); + + + static void startup(); + + static void cleanup(); + + +struct tet_testlist tet_testlist[] = { + {utc_tel_retrieve_call_01, 1}, + {utc_tel_retrieve_call_02, 2}, + {utc_tel_retrieve_call_03, 3}, + {NULL, 0} + }; + +#endif + +/** + * @} + */ diff --git a/TC/telephony_TC/call/unit/uts_tel_send_call_dtmf.c b/TC/telephony_TC/call/unit/uts_tel_send_call_dtmf.c new file mode 100644 index 0000000..cad4e75 --- /dev/null +++ b/TC/telephony_TC/call/unit/uts_tel_send_call_dtmf.c @@ -0,0 +1,175 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * 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 + +#include "uts_tel_send_call_dtmf.h" + + + +/* Initialize TCM data structures */ + + +void (*tet_startup) () = startup; +void (*tet_cleanup) () = cleanup; + +extern int expected_event; + +static void startup() +{ + TapiResult_t ret_status ; + tapi_dbus_connection_name dname; + int bStatus; + ret_status = tel_init(); + + if(ret_status != TAPI_API_SUCCESS) + { + printf("tel_init() Failed ret_status = %d \n",ret_status); + } + + register_all_events(); + tel_register_app_name("org.samsung.test"); + if(tel_get_app_name(&dname)) + printf("Dbus Get app name error\n"); + else + printf("Dbus Name is %s\n",dname.name); + + tel_check_service_ready(&bStatus); + printf("Telephpny service %d\n",bStatus); +} + +static void cleanup() +{ + int RequestId; + tel_release_call_all(&RequestId); + expected_event = TAPI_EVENT_CALL_END_IND; + gmain_loop_for_tapi_events(TIME_DELAY1); + deregister_all(); + + tel_deinit(); +} + +/** +* TapiResult_t tel_send_call_dtmf (const char * pDtmfString, int *pRequestId); +*/ + + +/** + * @brief This tests tel_send_call_dtmf () API in normal condition (MO call) + * @par ID: + * UTC_TEL_SEND_CALL_DTMF_01 + * @param [in] pDtmfString = DTMF_STRING + * @param [out] pRequestId = &RequestId +* @return TAPI_API_SUCCESS +*/ + +void utc_tel_send_call_dtmf_01() +{ + CALL_TEST_DEBUG("\n######## TEST START ###########\n"); + + TapiResult_t ret_status ; + unsigned int call_handle = INVALID_CALL_HANDLE; + TelCallSetupParams_t setup_call_info; + int RequestId = -1; + char normal[16] = MOB_NUM1; + + memset(&setup_call_info, 0, sizeof(TelCallSetupParams_t)); + setup_call_info.CallType = TAPI_CALL_TYPE_VOICE; //VOICE CALL + strncpy(setup_call_info.szNumber, normal, sizeof(normal)); + ret_status = tel_exe_call_mo(&setup_call_info, &call_handle, &RequestId); + + TET_CHECK(TAPI_API_SUCCESS, ret_status); + + expected_event = TAPI_EVENT_CALL_CONNECTED_IND; + gmain_loop_for_tapi_events(TIME_DELAY1); + + ret_status = tel_send_call_dtmf(DTMF_STRING , &RequestId); + + TET_CHECK(TAPI_API_SUCCESS, ret_status); + + expected_event = TAPI_EVENT_CALL_SEND_DTMF_CNF; + gmain_loop_for_tapi_events(TIME_DELAY1); + printf("utc_tel_send_call_dtmf_func_01 pass"); + tet_result(TET_PASS); + + tel_release_call_all(&RequestId); + + expected_event = TAPI_EVENT_CALL_END_IND; + gmain_loop_for_tapi_events(TIME_DELAY1); + + return; +} + +/** + * @brief This tests tel_send_call_dtmf () API in abnormal conditions + * @par ID: + * UTC_TEL_SEND_CALL_DTMF_03 + * @param [in] pDtmfString = DTMF_STRING + * @param [out] pRequestId = NULL +* @return TAPI_API_INVALID_PTR +*/ + +void utc_tel_send_call_dtmf_03() +{ + CALL_TEST_DEBUG("\n######## TEST START ###########\n"); + TapiResult_t ret_status ; + + ret_status = tel_send_call_dtmf (DTMF_STRING , NULL); + + TET_CHECK(TAPI_API_INVALID_PTR, ret_status); + + printf("utc_tel_send_call_dtmf_func_03 pass"); + tet_result(TET_PASS); + + return; +} + +/** + * @brief This tests tel_send_call_dtmf () API in abnormal conditions + * @par ID: + * UTC_TEL_SEND_CALL_DTMF_04 + * @param [in] pDtmfString = NULL + * @param [out] pRequestId = &RequestId +* @return TAPI_API_INVALID_PTR +*/ + +void utc_tel_send_call_dtmf_04() +{ + CALL_TEST_DEBUG("\n######## TEST START ###########\n"); + TapiResult_t ret_status ; + + int RequestId = -1; + ret_status = tel_send_call_dtmf (NULL , &RequestId); + + TET_CHECK(TAPI_API_INVALID_PTR, ret_status); + + printf("utc_tel_send_call_dtmf_func_04 pass"); + tet_result(TET_PASS); + + return; +} + diff --git a/TC/telephony_TC/call/unit/uts_tel_send_call_dtmf.h b/TC/telephony_TC/call/unit/uts_tel_send_call_dtmf.h new file mode 100644 index 0000000..8e1c95e --- /dev/null +++ b/TC/telephony_TC/call/unit/uts_tel_send_call_dtmf.h @@ -0,0 +1,60 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * 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 __UTS_TEL_SEND_CALL_DTMF_H_ +#define __UTS_TEL_SEND_CALL_DTMF_H_ + +/* Includes */ + +#include +#include "call_common.h" +#include +#include "tapi_callback.h" + +extern TS_UINT g_CallHandle; +extern TS_BOOL call_status; + + static void utc_tel_send_call_dtmf_01(void); + + static void utc_tel_send_call_dtmf_03(void); + + static void utc_tel_send_call_dtmf_04(void); + + + + static void startup(); + + static void cleanup(); + + + +struct tet_testlist tet_testlist[] = { + {utc_tel_send_call_dtmf_01, 1}, + {utc_tel_send_call_dtmf_03, 3}, + {utc_tel_send_call_dtmf_04, 4}, + {NULL, 0} + }; + +#endif + +/** + * @} + */ diff --git a/TC/telephony_TC/call/unit/uts_tel_set_call_act_line.c b/TC/telephony_TC/call/unit/uts_tel_set_call_act_line.c new file mode 100644 index 0000000..5d816d3 --- /dev/null +++ b/TC/telephony_TC/call/unit/uts_tel_set_call_act_line.c @@ -0,0 +1,217 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * 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 "uts_tel_set_call_act_line.h" + + +/* Initialize TCM data structures */ + + +/* +* TapiResult_t tel_set_call_act_line (TelCallActiveLine_t active_line ,int *pRequestId); +*/ + +void (*tet_startup) () = startup; +void (*tet_cleanup) () = cleanup; + +extern int expected_event; + +static void startup() +{ + TapiResult_t ret_status ; + tapi_dbus_connection_name dname; + int bStatus; + ret_status = tel_init(); + + if(ret_status != TAPI_API_SUCCESS) + { + printf("tel_init() Failed ret_status = %d \n",ret_status); + } + + + register_all_events(); + tel_register_app_name("org.samsung.test"); + if(tel_get_app_name(&dname)) + printf("Dbus Get app name error\n"); + else + printf("Dbus Name is %s\n",dname.name); + + tel_check_service_ready(&bStatus); + printf("Telephpny service %d\n",bStatus); + + g_CallHandle = -1; +} + +static void cleanup() +{ + TapiResult_t ret_status ; + int RequestId = -1; + ret_status = tel_set_call_act_line(TAPI_CALL_ACTIVE_LINE1 ,&RequestId); + deregister_all(); + + tel_deinit(); + +} + + + +/** + * @brief This tests tel_set_call_act_line() API in normal conditions + * @par ID: + * UTC_TEL_SET_CALL_ACT_LINE_01 + * @param [in] CallHandle = TAPI_CALL_ACTIVE_LINE1 + * @param [out] pRequestId = &RequestId +* @return TAPI_API_SUCCESS +*/ + + +void utc_tel_set_call_act_line_01() +{ + CALL_TEST_DEBUG("\n######## TEST START ###########\n"); + TapiResult_t ret_status ; + int RequestId = -1; + + ret_status = tel_set_call_act_line(TAPI_CALL_ACTIVE_LINE1 ,&RequestId); + + expected_event = TAPI_EVENT_CALL_SET_LINEID_CNF; + if (ret_status >= 0) + { + TET_CHECK(TAPI_API_SUCCESS, ret_status); + + expected_event = TAPI_EVENT_CALL_SET_LINEID_CNF; + printf("utc_tel_set_call_act_line_01 pass\n"); + tet_result(TET_PASS); + } + return; +} + + +/** + * @brief This tests tel_set_call_act_line() API in normal conditions + * @par ID: + * UTC_TEL_SET_CALL_ACT_LINE_02 + * @param [in] CallHandle = TAPI_CALL_ACTIVE_LINE2 + * @param [out] pRequestId = &RequestId +* @return TAPI_API_SUCCESS +*/ + +void utc_tel_set_call_act_line_02() +{ + CALL_TEST_DEBUG("\n######## TEST START ###########\n"); + TapiResult_t ret_status ; + int RequestId = -1; + + ret_status = tel_set_call_act_line(TAPI_CALL_ACTIVE_LINE2 ,&RequestId); + + expected_event = TAPI_EVENT_CALL_SET_LINEID_CNF; + if (ret_status >= 0) + { + TET_CHECK(TAPI_API_SUCCESS, ret_status); + + expected_event = TAPI_EVENT_CALL_SET_LINEID_CNF; + printf("utc_tel_set_call_act_line_02 pass\n"); + tet_result(TET_PASS); + } + return; +} + +/** + * @brief This tests tel_set_call_act_line() API in abnormal conditions + * @par ID: + * UTC_TEL_SET_CALL_ACT_LINE_03 + * @param [in] CallHandle = TAPI_CALL_ACTIVE_LINE2+1 + * @param [out] pRequestId = &RequestId +* @return TAPI_API_INVALID_INPUT +*/ + +void utc_tel_set_call_act_line_03() +{ + CALL_TEST_DEBUG("\n######## TEST START ###########\n"); + TapiResult_t ret_status ; + int RequestId = -1; + + ret_status = tel_set_call_act_line(TAPI_CALL_ACTIVE_LINE2+1 ,&RequestId); + + + TET_CHECK(TAPI_API_INVALID_INPUT, ret_status); + + printf("utc_tel_set_call_act_line_03 pass\n"); + tet_result(TET_PASS); + + return; +} + +/** + * @brief This tests tel_set_call_act_line() API in abnormal conditions + * @par ID: + * UTC_TEL_SET_CALL_ACT_LINE_04 + * @param [in] CallHandle = TAPI_CALL_ACTIVE_LINE1-1 + * @param [out] pRequestId = &RequestId +* @return TAPI_API_INVALID_INPUT +*/ + +void utc_tel_set_call_act_line_04() +{ + CALL_TEST_DEBUG("\n######## TEST START ###########\n"); + TapiResult_t ret_status ; + int RequestId = -1; + + ret_status = tel_set_call_act_line(TAPI_CALL_ACTIVE_LINE1-1 ,&RequestId); + + + TET_CHECK(TAPI_API_INVALID_INPUT, ret_status); + + printf("utc_tel_set_call_act_line_04 pass\n"); + tet_result(TET_PASS); + + return; +} + +/** + * @brief This tests tel_set_call_act_line() API in abnormal conditions + * @par ID: + * UTC_TEL_SET_CALL_ACT_LINE_05 + * @param [in] CallHandle = TAPI_CALL_ACTIVE_LINE1-1 + * @param [out] pRequestId = NULL +* @return TAPI_API_INVALID_PTR +*/ + +void utc_tel_set_call_act_line_05() +{ + CALL_TEST_DEBUG("\n######## TEST START ###########\n"); + TapiResult_t ret_status ; + + ret_status = tel_set_call_act_line(TAPI_CALL_ACTIVE_LINE1 ,NULL); + + + TET_CHECK(TAPI_API_INVALID_PTR, ret_status); + + printf("utc_tel_set_call_act_line_05 pass\n"); + tet_result(TET_PASS); + + return; +} + + + + + diff --git a/TC/telephony_TC/call/unit/uts_tel_set_call_act_line.h b/TC/telephony_TC/call/unit/uts_tel_set_call_act_line.h new file mode 100644 index 0000000..32f569a --- /dev/null +++ b/TC/telephony_TC/call/unit/uts_tel_set_call_act_line.h @@ -0,0 +1,64 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * 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 __UTS_TEL_SET_CALL_ACT_LINE_H_ +#define __UTS_TEL_SET_CALL_ACT_LINE_H_ + +/* Includes */ + +#include "tapi_callback.h" +#include +#include "call_common.h" + +extern TS_UINT g_CallHandle; +extern TS_BOOL call_status; + + static void utc_tel_set_call_act_line_01(void); + + static void utc_tel_set_call_act_line_02(void); + + static void utc_tel_set_call_act_line_03(void); + + static void utc_tel_set_call_act_line_04(void); + + static void utc_tel_set_call_act_line_05(void); + + + + static void startup(); + + static void cleanup(); + + +struct tet_testlist tet_testlist[] = { + {utc_tel_set_call_act_line_01, 1}, + {utc_tel_set_call_act_line_02, 2}, + {utc_tel_set_call_act_line_03, 3}, + {utc_tel_set_call_act_line_04, 4}, + {utc_tel_set_call_act_line_05, 5}, + {NULL, 0} + }; + +#endif + +/** + * @} + */ diff --git a/TC/telephony_TC/call/unit/uts_tel_set_call_privacy_mode.c b/TC/telephony_TC/call/unit/uts_tel_set_call_privacy_mode.c new file mode 100644 index 0000000..39f448e --- /dev/null +++ b/TC/telephony_TC/call/unit/uts_tel_set_call_privacy_mode.c @@ -0,0 +1,278 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * 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 "uts_tel_set_call_privacy_mode.h" + +/* Initialize TCM data structures */ +void (*tet_startup) () = startup; +void (*tet_cleanup) () = cleanup; + +extern int expected_event; + +static void startup() +{ + TapiResult_t ret_status ; + tapi_dbus_connection_name dname; + int bStatus; + ret_status = tel_init(); + + if(ret_status != TAPI_API_SUCCESS) + { + printf("tel_init() Failed ret_status = %d \n",ret_status); + } + + register_all_events(); + tel_register_app_name("org.samsung.test"); + if(tel_get_app_name(&dname)) + printf("Dbus Get app name error\n"); + else + printf("Dbus Name is %s\n",dname.name); + + tel_check_service_ready(&bStatus); + printf("Telephpny service %d\n",bStatus); + + g_CallHandle = -1; +} + +static void cleanup() +{ + deregister_all(); + + tel_deinit(); +} + +/** + * @brief This tests () API in normal conditions + * @par ID: + * UTC_TEL_GET_CALL_PRIVACY_MODE_01 + * @param [out] + * @return TAPI_API_SUCCESS +*/ + +/***** TESTING FOR VALID SET OF INPUTS*****/ + +void utc_tel_set_call_privacy_mode_01() +{ + CALL_TEST_DEBUG("\n######## TEST START ###########\n"); + TapiResult_t ret_status ; + TelCallVoicePrivacyInfo_t PrivacyInfo ; + int *pRequestID; + PrivacyInfo.PrivacyType = TAPI_CALL_PRIVACY_TYPE_MS; + PrivacyInfo.PrivacyMode = TAPI_CALL_PRIVACY_MODE_STANDARD ; + ret_status =tel_set_call_privacy_mode (PrivacyInfo, &pRequestID); + if(ret_status !=TAPI_API_SUCCESS) + { + tet_result(TET_FAIL); + } + printf("utc_tel_get_call_privacy_mode_01 pass"); + tet_result(TET_PASS); + + return; +} + +void utc_tel_set_call_privacy_mode_02() +{ + CALL_TEST_DEBUG("\n######## TEST START ###########\n"); + TapiResult_t ret_status ; + TelCallVoicePrivacyInfo_t PrivacyInfo ; + int *pRequestID; + PrivacyInfo.PrivacyType = TAPI_CALL_PRIVACY_TYPE_MS; + PrivacyInfo.PrivacyMode = TAPI_CALL_PRIVACY_MODE_ENHANCED; + ret_status =tel_set_call_privacy_mode (PrivacyInfo, &pRequestID); + if(ret_status !=TAPI_API_SUCCESS) + { + tet_result(TET_FAIL); + } + printf("utc_tel_get_call_privacy_mode_02 pass"); + tet_result(TET_PASS); + + return; +} + +void utc_tel_set_call_privacy_mode_03() +{ + CALL_TEST_DEBUG("\n######## TEST START ###########\n"); + TapiResult_t ret_status ; + TelCallVoicePrivacyInfo_t PrivacyInfo ; + int *pRequestID; + PrivacyInfo.PrivacyType = TAPI_CALL_PRIVACY_TYPE_BS; + PrivacyInfo.PrivacyMode = TAPI_CALL_PRIVACY_MODE_STANDARD ; + ret_status =tel_set_call_privacy_mode (PrivacyInfo, &pRequestID); + if(ret_status !=TAPI_API_SUCCESS) + { + tet_result(TET_FAIL); + } + printf("utc_tel_get_call_privacy_mode_03 pass"); + tet_result(TET_PASS); + + return; +} +void utc_tel_set_call_privacy_mode_04() +{ + CALL_TEST_DEBUG("\n######## TEST START ###########\n"); + TapiResult_t ret_status ; + TelCallVoicePrivacyInfo_t PrivacyInfo ; + int *pRequestID; + PrivacyInfo.PrivacyType = TAPI_CALL_PRIVACY_TYPE_BS; + PrivacyInfo.PrivacyMode = TAPI_CALL_PRIVACY_MODE_ENHANCED; + ret_status =tel_set_call_privacy_mode (PrivacyInfo, &pRequestID); + if(ret_status !=TAPI_API_SUCCESS) + { + tet_result(TET_FAIL); + } + printf("utc_tel_get_call_privacy_mode_04 pass"); + tet_result(TET_PASS); + + return; +} + +void utc_tel_set_call_privacy_mode_05() +{ + CALL_TEST_DEBUG("\n######## TEST START ###########\n"); + TapiResult_t ret_status ; + TelCallVoicePrivacyInfo_t PrivacyInfo ; + int *pRequestID; + PrivacyInfo.PrivacyType = TAPI_CALL_PRIVACY_TYPE_CURRENT; + PrivacyInfo.PrivacyMode = TAPI_CALL_PRIVACY_MODE_STANDARD ; + ret_status =tel_set_call_privacy_mode (PrivacyInfo, &pRequestID); + if(ret_status !=TAPI_API_SUCCESS) + { + tet_result(TET_FAIL); + } + printf("utc_tel_get_call_privacy_mode_05 pass"); + tet_result(TET_PASS); + + return; +} + +void utc_tel_set_call_privacy_mode_06() +{ + CALL_TEST_DEBUG("\n######## TEST START ###########\n"); + TapiResult_t ret_status ; + TelCallVoicePrivacyInfo_t PrivacyInfo ; + int *pRequestID; + PrivacyInfo.PrivacyType = TAPI_CALL_PRIVACY_TYPE_CURRENT ; + PrivacyInfo.PrivacyMode = TAPI_CALL_PRIVACY_MODE_ENHANCED; + ret_status =tel_set_call_privacy_mode (PrivacyInfo, &pRequestID); + if(ret_status !=TAPI_API_SUCCESS) + { + tet_result(TET_FAIL); + } + printf("utc_tel_get_call_privacy_mode_06 pass"); + tet_result(TET_PASS); + + return; +} + +void utc_tel_set_call_privacy_mode_07() +{ + CALL_TEST_DEBUG("\n######## TEST START ###########\n"); + TapiResult_t ret_status ; + TelCallVoicePrivacyInfo_t PrivacyInfo ; + int *pRequestID; + PrivacyInfo.PrivacyType = -1; + PrivacyInfo.PrivacyMode = TAPI_CALL_PRIVACY_MODE_ENHANCED; + ret_status =tel_set_call_privacy_mode (PrivacyInfo, &pRequestID); + if(ret_status ==TAPI_API_SUCCESS) + { + tet_result(TET_FAIL); + } + printf("utc_tel_get_call_privacy_mode_07 pass"); + tet_result(TET_PASS); + + return; +} + +void utc_tel_set_call_privacy_mode_08() +{ + CALL_TEST_DEBUG("\n######## TEST START ###########\n"); + TapiResult_t ret_status ; + TelCallVoicePrivacyInfo_t PrivacyInfo ; + int *pRequestID; + PrivacyInfo.PrivacyType = 4; + PrivacyInfo.PrivacyMode = TAPI_CALL_PRIVACY_MODE_ENHANCED; + ret_status =tel_set_call_privacy_mode (PrivacyInfo, &pRequestID); + printf("\nReturn Code is :%d\n",ret_status); + if(ret_status ==TAPI_API_SUCCESS) + { + tet_result(TET_FAIL); + } + printf("utc_tel_get_call_privacy_mode_08 pass"); + tet_result(TET_PASS); + + return; +} + +void utc_tel_set_call_privacy_mode_09() +{ + CALL_TEST_DEBUG("\n######## TEST START ###########\n"); + TapiResult_t ret_status ; + TelCallVoicePrivacyInfo_t PrivacyInfo ; + int *pRequestID; + PrivacyInfo.PrivacyType = TAPI_CALL_PRIVACY_TYPE_CURRENT ; + PrivacyInfo.PrivacyMode = -1; + ret_status =tel_set_call_privacy_mode (PrivacyInfo, &pRequestID); + if(ret_status ==TAPI_API_SUCCESS) + { + tet_result(TET_FAIL); + } + printf("utc_tel_get_call_privacy_mode_09 pass"); + tet_result(TET_PASS); + + return; +} + +void utc_tel_set_call_privacy_mode_10() +{ + CALL_TEST_DEBUG("\n######## TEST START ###########\n"); + TapiResult_t ret_status ; + TelCallVoicePrivacyInfo_t PrivacyInfo ; + int *pRequestID; + PrivacyInfo.PrivacyType = TAPI_CALL_PRIVACY_TYPE_CURRENT ; + PrivacyInfo.PrivacyMode = 2; + ret_status =tel_set_call_privacy_mode (PrivacyInfo, &pRequestID); + if(ret_status ==TAPI_API_SUCCESS) + { + tet_result(TET_FAIL); + } + printf("utc_tel_get_call_privacy_mode_10 pass"); + tet_result(TET_PASS); + + return; +} + +void utc_tel_set_call_privacy_mode_11() +{ + CALL_TEST_DEBUG("\n######## TEST START ###########\n"); + TapiResult_t ret_status ; + TelCallVoicePrivacyInfo_t PrivacyInfo ; + PrivacyInfo.PrivacyType = TAPI_CALL_PRIVACY_TYPE_CURRENT ; + PrivacyInfo.PrivacyMode = TAPI_CALL_PRIVACY_MODE_ENHANCED; + ret_status =tel_set_call_privacy_mode (PrivacyInfo, NULL); + if(ret_status ==TAPI_API_SUCCESS) + { + tet_result(TET_FAIL); + } + printf("utc_tel_get_call_privacy_mode_11 pass"); + tet_result(TET_PASS); + + return; +} diff --git a/TC/telephony_TC/call/unit/uts_tel_set_call_privacy_mode.h b/TC/telephony_TC/call/unit/uts_tel_set_call_privacy_mode.h new file mode 100644 index 0000000..26366d1 --- /dev/null +++ b/TC/telephony_TC/call/unit/uts_tel_set_call_privacy_mode.h @@ -0,0 +1,69 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * 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 __UTS_TEL_SET_CALL_PRIVACY_MODE_H_ +#define __UTS_TEL_SET_CALL_PRIVACY_MODE_H_ + +#include "tapi_callback.h" +#include +#include "call_common.h" +#include + +extern TS_UINT g_CallHandle; +extern TS_BOOL call_status; + + static void utc_tel_set_call_privacy_mode_01(void); + static void utc_tel_set_call_privacy_mode_02(void); + static void utc_tel_set_call_privacy_mode_03(void); + static void utc_tel_set_call_privacy_mode_04(void); + static void utc_tel_set_call_privacy_mode_05(void); + static void utc_tel_set_call_privacy_mode_06(void); + static void utc_tel_set_call_privacy_mode_07(void); + static void utc_tel_set_call_privacy_mode_08(void); + static void utc_tel_set_call_privacy_mode_09(void); + static void utc_tel_set_call_privacy_mode_10(void); + static void utc_tel_set_call_privacy_mode_11(void); + + static void startup(); + + static void cleanup(); + + +struct tet_testlist tet_testlist[] = { + {utc_tel_set_call_privacy_mode_01, 1}, + {utc_tel_set_call_privacy_mode_02, 2}, + {utc_tel_set_call_privacy_mode_03, 3}, + {utc_tel_set_call_privacy_mode_04, 4}, + {utc_tel_set_call_privacy_mode_05, 5}, + {utc_tel_set_call_privacy_mode_06, 6}, + {utc_tel_set_call_privacy_mode_07, 7}, + {utc_tel_set_call_privacy_mode_08, 8}, + {utc_tel_set_call_privacy_mode_09, 9}, + {utc_tel_set_call_privacy_mode_10, 10}, + {utc_tel_set_call_privacy_mode_11, 11}, + {NULL, 0} + }; + +#endif + +/** + * @} + */ diff --git a/TC/telephony_TC/call/unit/uts_tel_split_call.c b/TC/telephony_TC/call/unit/uts_tel_split_call.c new file mode 100644 index 0000000..e9f25c5 --- /dev/null +++ b/TC/telephony_TC/call/unit/uts_tel_split_call.c @@ -0,0 +1,229 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * 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 "uts_tel_split_call.h" + + +/* Initialize TCM data structures */ + + +/* +* TapiResult_t tel_split_call ( unsigned int CallHandle, int * pRequestId ); +*/ + +void (*tet_startup) () = startup; +void (*tet_cleanup) () = cleanup; + + +extern int expected_event; + +static void startup() +{ + TapiResult_t ret_status ; + tapi_dbus_connection_name dname; + int bStatus; + ret_status = tel_init(); + + if(ret_status != TAPI_API_SUCCESS) + { + printf("tel_init() Failed ret_status = %d \n",ret_status); + } + + register_all_events(); + tel_register_app_name("org.samsung.test"); + if(tel_get_app_name(&dname)) + printf("Dbus Get app name error\n"); + else + printf("Dbus Name is %s\n",dname.name); + + tel_check_service_ready(&bStatus); + printf("Telephpny service %d\n",bStatus); + + g_CallHandle = -1; +} + +static void cleanup() +{ + + deregister_all(); + + tel_deinit(); + +} + + + +/** + * @brief This tests tel_split_call() API in normal conditions + * @par ID: + * UTC_TEL_SPLIT_CALL_01 + * @param [in] CallHandle = callhandle[0] + * @param [out] pRequestId = &RequestId +* @return TAPI_API_SUCCESS +*/ +void utc_tel_split_call_01() +{ + CALL_TEST_DEBUG("\n######## TEST START ###########\n"); + TapiResult_t ret_status ; + unsigned int call_handle_01 = -1; + unsigned int call_handle_02 = -1; + TelCallSetupParams_t setup_call_info_01; + TelCallSetupParams_t setup_call_info_02; + int RequestId = -1; + char normal1[16] = MOB_NUM1; + char normal2[16] = MOB_NUM2; + + memset(&setup_call_info_01, 0, sizeof(TelCallSetupParams_t)); + setup_call_info_01.CallType = TAPI_CALL_TYPE_VOICE; + strncpy(setup_call_info_01.szNumber, normal1, 13); + tet_printf("called number = %s\n", setup_call_info_01.szNumber); + + //setup_call_info_01.IdentityMode = TAPI_CALL_IDENTITY_SHOW; //preet: TelCallSetupParams_t dont have these memebers + //setup_call_info_01.pCugInfo = NULL; + //setup_call_info_01.pUusInfo = NULL; + + memset(&setup_call_info_02, 0, sizeof(TelCallSetupParams_t)); + setup_call_info_02.CallType = TAPI_CALL_TYPE_VOICE; + strncpy(setup_call_info_02.szNumber, normal2, 13); + tet_printf("called number = %s\n", setup_call_info_02.szNumber); + + //setup_call_info_02.IdentityMode = TAPI_CALL_IDENTITY_SHOW; //preet: TelCallSetupParams_t dont have these memebers + //setup_call_info_02.pCugInfo = NULL; + //setup_call_info_02.pUusInfo = NULL; + + + CALL_TEST_DEBUG("MAKE A 1ST MO CALL TO %s\n",setup_call_info_01.szNumber); + ret_status = tel_exe_call_mo(&setup_call_info_01, &call_handle_01, &RequestId); + TET_CHECK(TAPI_API_SUCCESS, ret_status); + expected_event = TAPI_EVENT_CALL_CONNECTED_IND; + gmain_loop_for_tapi_events(TIME_DELAY1); + + CALL_TEST_DEBUG("HOLD THE ACTIVE CALL\n"); + ret_status = tel_hold_call (call_handle_01 , &RequestId); + TET_CHECK(TAPI_API_SUCCESS, ret_status); + //expected_event = TAPI_EVENT_CALL_HOLD_CNF; + gmain_loop_for_tapi_events(TIME_DELAY2); + + CALL_TEST_DEBUG("MAKE 2ND MO CALL TO %s\n",setup_call_info_02.szNumber); + ret_status = tel_exe_call_mo(&setup_call_info_02, &call_handle_02, &RequestId); + TET_CHECK(TAPI_API_SUCCESS, ret_status); + expected_event = TAPI_EVENT_CALL_CONNECTED_IND; + gmain_loop_for_tapi_events(TIME_DELAY1); + + CALL_TEST_DEBUG("JOIN TWO CALLS\n"); + ret_status = tel_join_call (call_handle_02, call_handle_01, &RequestId); + TET_CHECK(TAPI_API_SUCCESS, ret_status); + expected_event = TAPI_EVENT_CALL_SETUPCONFERENCE_CNF; + gmain_loop_for_tapi_events(TIME_DELAY1); + + CALL_TEST_DEBUG("SPLIT THE CONFERENCE\n"); + ret_status = tel_split_call(call_handle_01, &RequestId); + expected_event = TAPI_EVENT_CALL_SPLITCONFERENCE_CNF; + gmain_loop_for_tapi_events(TIME_DELAY1); + printf ("utc_tel_split_call_01 RequestId = %d\n", RequestId); + TET_CHECK(TAPI_API_SUCCESS, ret_status); + + CALL_TEST_DEBUG("RELEASE ALL CALLS\n"); + tel_release_call_all(&RequestId); + expected_event = TAPI_EVENT_CALL_END_IND; + gmain_loop_for_tapi_events(TIME_DELAY1); + + printf("utc_tel_split_call_01 pass\n"); + tet_result(TET_PASS); + + return; +} + + +/** + * @brief This tests tel_split_call() API in abnormal conditions + * @par ID: + * UTC_TEL_SPLIT_CALL_02 + * @param [in] CallHandle = callhandle[0] + * @param [out] pRequestId = NULL +* @return TAPI_API_INVALID_PTR +*/ +void utc_tel_split_call_02() +{ + CALL_TEST_DEBUG("\n################ TEST START ################\n"); + TapiResult_t ret_status ; + + ret_status = tel_split_call(VALID_CALL_HANDLE, NULL); + TET_CHECK(TAPI_API_INVALID_PTR, ret_status); + + printf("utc_tel_split_call_02 pass\n"); + tet_result(TET_PASS); + + return; +} + + +/** + * @brief This tests tel_split_call() API in abnormal conditions + * @par ID: + * UTC_TEL_SPLIT_CALL_03 + * @param [in] CallHandle = INVALID_CALL_HANDLE + * @param [out] pRequestId = &RequestId +* @return TAPI_API_INVALID_CALL_HANDLE +*/ + + +void utc_tel_split_call_03() +{ + CALL_TEST_DEBUG("\n######## TEST START ###########\n"); + TapiResult_t ret_status ; + int RequestId = -1; + + ret_status = tel_split_call(INVALID_CALL_HANDLE, &RequestId); + + TET_CHECK(TAPI_API_INVALID_CALL_HANDLE, ret_status); + + printf("utc_tel_split_call_03 pass\n"); + tet_result(TET_PASS); + + return; +} + +/** + * @brief This tests tel_split_call() API in abnormal conditions + * @par ID: + * UTC_TEL_SPLIT_CALL_04 + * @param [in] CallHandle = INVALID_CALL_HANDLE + * @param [out] pRequestId = NULL +* @return TAPI_API_INVALID_PTR +*/ + +void utc_tel_split_call_04() +{ + CALL_TEST_DEBUG("\n######## TEST START ###########\n"); + TapiResult_t ret_status ; + + ret_status = tel_split_call(VALID_CALL_HANDLE, NULL); + + TET_CHECK(TAPI_API_INVALID_PTR, ret_status); + + printf("utc_tel_split_call_04 pass\n"); + tet_result(TET_PASS); + + return; +} + diff --git a/TC/telephony_TC/call/unit/uts_tel_split_call.h b/TC/telephony_TC/call/unit/uts_tel_split_call.h new file mode 100644 index 0000000..96c2f64 --- /dev/null +++ b/TC/telephony_TC/call/unit/uts_tel_split_call.h @@ -0,0 +1,115 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * 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 __UTS_TEL_SPLIT_CALL_H_ +#define __UTS_TEL_SPLIT_CALL_H_ + +/* Includes */ + + +#include "tapi_callback.h" +#include +#include "call_common.h" + +extern TS_UINT g_CallHandle; +extern TS_BOOL call_status; + + +/** +* @test This test case tests TapiResult_t tel_split_call ( unsigned int CallHandle, int * pRequestId ); +* @brief This API is used to split a call from conference +* @return tapi_api_err_t +*/ + + + +/** +* @test This test case tests +* API This test case tests TapiResult_t tel_split_call ( unsigned int CallHandle, int * pRequestId ); +* @brief launch application with valid input, outparameter . @n +* @pre +* @param[in] call_handle = valid value , +* @param[out] pRequestId, +* @return TAPI_API_SUCCESS + +*/ + + static void utc_tel_split_call_01(void); + +/** +* @test This test case tests +* API This test case tests TapiResult_t tel_split_call ( unsigned int CallHandle, int * pRequestId ); +* @brief launch application with valid input, outparameter . @n +* @pre +* @param[in] call_handle = Invalid value , +* @param[out] pRequestId, +* @return TAPI_API_INVALID_INPUT + +*/ + + static void utc_tel_split_call_02(void); + + +/** +* @test This test case tests +* API This test case tests TapiResult_t tel_split_call ( unsigned int CallHandle, int * pRequestId ); +* @brief launch application with valid input, outparameter . @n +* @pre +* @param[in] call_handle = valid value , +* @param[out] NULL, +* @return TAPI_API_INVALID_INPUT + +*/ + + static void utc_tel_split_call_03(void); + +/** +* @test This test case tests +* API This test case tests TapiResult_t tel_split_call ( unsigned int CallHandle, int * pRequestId ); +* @brief launch application with valid input, outparameter . @n +* @pre +* @param[in] call_handle = Invalid value , +* @param[out] NULL, +* @return TAPI_API_INVALID_INPUT + +*/ + + static void utc_tel_split_call_04(void); + + + static void startup(); + + static void cleanup(); + + +struct tet_testlist tet_testlist[] = { + {utc_tel_split_call_01, 1}, + {utc_tel_split_call_02, 2}, + {utc_tel_split_call_03, 3}, + {utc_tel_split_call_04, 4}, + {NULL, 0} + }; + +#endif + +/** + * @} + */ diff --git a/TC/telephony_TC/call/unit/uts_tel_swap_call.c b/TC/telephony_TC/call/unit/uts_tel_swap_call.c new file mode 100644 index 0000000..ec84bac --- /dev/null +++ b/TC/telephony_TC/call/unit/uts_tel_swap_call.c @@ -0,0 +1,246 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * 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 "uts_tel_swap_call.h" +#include "ITapiSs.h" + + +/* Initialize TCM data structures */ + + +/* +* TapiResult_t tel_swap_call( unsigned int active_call, unsigned int held_call ,int *pRequestId); +*/ + +void (*tet_startup) () = startup; +void (*tet_cleanup) () = cleanup; + +extern int expected_event; + +static void startup() +{ + TapiResult_t ret_status ; + tapi_dbus_connection_name dname; + int bStatus; + + ret_status = tel_init(); + + if(ret_status != TAPI_API_SUCCESS) + { + printf("tel_init() Failed ret_status = %d \n",ret_status); + } + + register_all_events(); + tel_register_app_name("org.samsung.test"); + if(tel_get_app_name(&dname)) + printf("Dbus Get app name error\n"); + else + printf("Dbus Name is %s\n",dname.name); + + tel_check_service_ready(&bStatus); + printf("Telephpny service %d\n",bStatus); + + TelSsWaitingInfo_t waitInfo; + + int request_id=0; + waitInfo.CallType = TAPI_CALL_TYPE_VOICE_EV; + waitInfo.Mode =(TelSsCallWaitOperationMode_t)TAPI_SS_CW_ACTIVATE; + + ret_status = tel_set_ss_waiting(&waitInfo, &request_id); + expected_event = TAPI_EVENT_SS_WAITING_CNF; + printf("call waiting\n"); + gmain_loop_for_tapi_events(TIME_DELAY1); + + + g_CallHandle = -1; +} + +static void cleanup() +{ + int RequestId = -1; + + tel_release_call_all(&RequestId); + expected_event = TAPI_EVENT_CALL_END_IND; + gmain_loop_for_tapi_events(TIME_DELAY1); + + deregister_all(); + + tel_deinit(); + +} + + +/** + * @brief This tests tel_swap_call() API in normal conditions + * @par ID: + * UTC_TEL_SWAP_CALL_01 + * @param [in] active_call = callhandle[1] + * @param [in] held_call = callhandle[0] + * @param [out] pRequestId = &RequestId +* @return TAPI_API_SUCCESS +*/ +// Sunghyuk Lee +void utc_tel_swap_call_01() +{ + CALL_TEST_DEBUG("\n################ TEST START ################\n"); + TapiResult_t ret_status ; + unsigned int call_handle_01 = -1; + unsigned int call_handle_02 = -1; + TelCallSetupParams_t setup_call_info_01; + TelCallSetupParams_t setup_call_info_02; + int RequestId = -1; + char normal1[16] = MOB_NUM1; + char normal2[16] = MOB_NUM2; + + memset(&setup_call_info_01, 0, sizeof(TelCallSetupParams_t)); + setup_call_info_01.CallType = TAPI_CALL_TYPE_VOICE; + strncpy(setup_call_info_01.szNumber, normal1, 13); + tet_printf("called number = %s\n", setup_call_info_01.szNumber); + + //setup_call_info_01.IdentityMode = TAPI_CALL_IDENTITY_SHOW; //preet: TelCallSetupParams_t donot have these memebers + //setup_call_info_01.pCugInfo = NULL; + //setup_call_info_01.pUusInfo = NULL; + + memset(&setup_call_info_02, 0, sizeof(TelCallSetupParams_t)); + setup_call_info_02.CallType = TAPI_CALL_TYPE_VOICE; + strncpy(setup_call_info_02.szNumber, normal2, 13); + tet_printf("called number = %s\n", setup_call_info_02.szNumber); + + //setup_call_info_02.IdentityMode = TAPI_CALL_IDENTITY_SHOW; //preet: TelCallSetupParams_t donot have these memebers + //setup_call_info_02.pCugInfo = NULL; + //setup_call_info_02.pUusInfo = NULL; + + + CALL_TEST_DEBUG("MAKE A 1ST MO CALL TO %s\n",setup_call_info_01.szNumber); + ret_status = tel_exe_call_mo(&setup_call_info_01, &call_handle_01, &RequestId); + TET_CHECK(TAPI_API_SUCCESS, ret_status); + expected_event = TAPI_EVENT_CALL_CONNECTED_IND; + gmain_loop_for_tapi_events(TIME_DELAY2); + + CALL_TEST_DEBUG("HOLD THE ACTIVE CALL\n"); + ret_status = tel_hold_call (call_handle_01 , &RequestId); + TET_CHECK(TAPI_API_SUCCESS, ret_status); +// expected_event = TAPI_EVENT_CALL_HOLD_CNF; + gmain_loop_for_tapi_events(TIME_DELAY2); + + CALL_TEST_DEBUG("MAKE 2ND MO CALL TO %s\n",setup_call_info_02.szNumber); + ret_status = tel_exe_call_mo(&setup_call_info_02, &call_handle_02, &RequestId); + TET_CHECK(TAPI_API_SUCCESS, ret_status); + expected_event = TAPI_EVENT_CALL_CONNECTED_IND; + gmain_loop_for_tapi_events(TIME_DELAY2); + + CALL_TEST_DEBUG("SWAP TWO CALLS\n"); + ret_status = tel_swap_call (call_handle_02, call_handle_01, &RequestId); + TET_CHECK(TAPI_API_SUCCESS, ret_status); + expected_event = TAPI_EVENT_CALL_SWAP_CNF; + gmain_loop_for_tapi_events(TIME_DELAY2); + + CALL_TEST_DEBUG("RELEASE ALL CALLS\n"); + tel_release_call_all(&RequestId); + expected_event = TAPI_EVENT_CALL_END_IND; + gmain_loop_for_tapi_events(TIME_DELAY2); + + tet_result(TET_PASS); + + return; + +} + + +/** + * @brief This tests tel_swap_call() API in abnormal conditions + * @par ID: + * UTC_TEL_SWAP_CALL_02 + * @param [in] active_call = INVALID_CALL_HANDLE + * @param [in] held_call = VALID_CALL_HANDLE + * @param [out] pRequestId = &RequestId +* @return TAPI_API_INVALID_CALL_HANDLE +*/ + +void utc_tel_swap_call_02() +{ + CALL_TEST_DEBUG("\n######## TEST START ###########\n"); + TapiResult_t ret_status ; + int RequestId = -1; + unsigned int call_handle = VALID_CALL_HANDLE; + + ret_status = tel_swap_call (INVALID_CALL_HANDLE, call_handle, &RequestId); + + TET_CHECK(TAPI_API_INVALID_CALL_HANDLE, ret_status); + printf("utc_tel_swap_call_02 pass\n"); + tet_result(TET_PASS); + + return; +} + +/** + * @brief This tests tel_swap_call() API in abnormal conditions + * @par ID: + * UTC_TEL_SWAP_CALL_03 + * @param [in] active_call = VALID_CALL_HANDLE + * @param [in] held_call = INVALID_CALL_HANDLE + * @param [out] pRequestId = &RequestIdd +* @return TAPI_API_INVALID_CALL_HANDLE +*/ + +void utc_tel_swap_call_03() +{ + CALL_TEST_DEBUG("\n######## TEST START ###########\n"); + TapiResult_t ret_status ; + int RequestId = -1; + unsigned int call_handle = VALID_CALL_HANDLE; + + ret_status = tel_swap_call (call_handle, INVALID_CALL_HANDLE, &RequestId); + + TET_CHECK(TAPI_API_INVALID_CALL_HANDLE, ret_status); + printf("utc_tel_swap_call_03 pass\n"); + tet_result(TET_PASS); + + return; +} + + +/** + * @brief This tests tel_swap_call() API in abnormal conditions + * @par ID: + * UTC_TEL_SWAP_CALL_04 + * @param [in] active_call = VALID_CALL_HANDLE + * @param [in] held_call = VALID_CALL_HANDLE + * @param [out] pRequestId = NULL +* @return TAPI_API_INVALID_PTR +*/ + +void utc_tel_swap_call_04() +{ + CALL_TEST_DEBUG("\n######## TEST START ###########\n"); + TapiResult_t ret_status ; + unsigned int call_handle = VALID_CALL_HANDLE; + + ret_status = tel_swap_call (call_handle, call_handle, NULL); + + TET_CHECK(TAPI_API_INVALID_PTR, ret_status); + printf("utc_tel_swap_call_04 pass\n"); + tet_result(TET_PASS); + + return; +} + diff --git a/TC/telephony_TC/call/unit/uts_tel_swap_call.h b/TC/telephony_TC/call/unit/uts_tel_swap_call.h new file mode 100644 index 0000000..72bb349 --- /dev/null +++ b/TC/telephony_TC/call/unit/uts_tel_swap_call.h @@ -0,0 +1,62 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * 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 __UTS_TEL_SWAP_CALL_H_ +#define __UTS_TEL_SWAP_CALL_H_ + +/* Includes */ + +#include "tapi_callback.h" +#include +#include "call_common.h" + +extern TS_UINT g_CallHandle; +extern TS_BOOL call_status; + + + + static void utc_tel_swap_call_01(void); + + static void utc_tel_swap_call_02(void); + + static void utc_tel_swap_call_03(void); + + static void utc_tel_swap_call_04(void); + + + static void startup(); + + static void cleanup(); + + +struct tet_testlist tet_testlist[] = { + {utc_tel_swap_call_01, 1}, + {utc_tel_swap_call_02, 2}, + {utc_tel_swap_call_03, 3}, + {utc_tel_swap_call_04, 4}, + {NULL, 0} + }; + +#endif + +/** + * @} + */ diff --git a/TC/telephony_TC/common/unit/makefile b/TC/telephony_TC/common/unit/makefile new file mode 100644 index 0000000..f255d69 --- /dev/null +++ b/TC/telephony_TC/common/unit/makefile @@ -0,0 +1,78 @@ +CC=gcc -Wall +CXX=g++ -Wall + +#LB1 = async_util +LB1 = +TS1 = uts_tel_check_service_ready +TS2 = uts_tel_deinit +#TS3 = uts_tel_deinit_ecore_loop +TS3 = +TS4 = uts_tel_register_event +#TS5 = uts_tel_deregister_event_at_ecore_loop +TS5 = +#TS6 = uts_tel_init_ecore_loop +TS6 = +TS7 = uts_tel_request_tunnel +TS8 = uts_tel_init +TS9 = uts_tel_deregister_event +#TS10 = uts_tel_register_event_at_ecore_loop +TS10 = + +LIBS = `pkg-config --libs gconf-2.0 glib-2.0 dbus-1 dbus-glib-1 gthread-2.0 tapi ` +LIBS +=$(TET_ROOT)/lib/tet3/tcm.o +LIBS +=-L$(TET_ROOT)/lib/tet3 -lapi + +INCS = -I. `pkg-config --cflags gconf-2.0 glib-2.0 dbus-1 dbus-glib-1 gthread-2.0 tapi ` +INCS += -I$(TET_ROOT)/inc/tet3 + +#ifeq ($(ARCH),target) +#CC += -g -mabi=aapcs-linux +#endif + +CFLAGS = $(INCS) -DXTHREADS -D_REENTRANT -DXUSE_MTSAFE_API -DWITHOUT_APP_MGR +CC +=$(CFLAGS) +LDFLAGS = $(LIBS) + + +all : $(LB1) $(TS1) $(TS2) $(TS3) $(TS4) $(TS5) $(TS6) $(TS7) $(TS8) $(TS9) $(TS10) + + + +clean : + rm -rf *~ *.o tet_lock tet_captured + rm -rf $(TS1) $(TS2) $(TS3) $(TS4) $(TS5) $(TS6) $(TS7) $(TS8) $(TS9) $(TS10) + + +$(LB1): $(LB1).c + $(CC) -c $(LB1).c + +$(TS1): $(TS1).c $(LB1) + $(CC) -o $(TS1) $(TS1).c $(LDFLAGS) + +$(TS2): $(TS2).c $(LB1) + $(CC) -o $(TS2) $(TS2).c $(LDFLAGS) + +$(TS3): $(TS3).c $(LB1) + $(CC) -o $(TS3) $(TS3).c $(LDFLAGS) + +$(TS4): $(TS4).c $(LB1) + $(CC) -o $(TS4) $(TS4).c $(LDFLAGS) + +$(TS5): $(TS5).c $(LB1) + $(CC) -o $(TS5) $(TS5).c $(LDFLAGS) + +$(TS6): $(TS6).c $(LB1) + $(CC) -o $(TS6) $(TS6).c $(LDFLAGS) + +$(TS7): $(TS7).c $(LB1) + $(CC) -o $(TS7) $(TS7).c $(LDFLAGS) + +$(TS8): $(TS8).c $(LB1) + $(CC) -o $(TS8) $(TS8).c $(LDFLAGS) + +$(TS9): $(TS9).c $(LB1) + $(CC) -o $(TS9) $(TS9).c $(LDFLAGS) + +$(TS10): $(TS10).c $(LB1) + $(CC) -o $(TS10) $(TS10).c $(LDFLAGS) + diff --git a/TC/telephony_TC/common/unit/tapi_common.h b/TC/telephony_TC/common/unit/tapi_common.h new file mode 100644 index 0000000..b8e6491 --- /dev/null +++ b/TC/telephony_TC/common/unit/tapi_common.h @@ -0,0 +1,49 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * 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 UTS_TAPI_COMMON_H +#define UTS_TAPI_COMMON_H + +#include +#include + +GMainLoop *main_loop = NULL; + +#define TIME_DELAY 5000 + +gboolean +TimeOutFun (void *data) +{ + g_main_loop_quit (main_loop); + printf ("Exit from this callback\n"); + return FALSE; +} + +int gmain_loop_for_tapi_events(int delay) +{ + + main_loop = g_main_loop_new (NULL, FALSE); + g_timeout_add (delay, TimeOutFun, NULL); + g_main_loop_run (main_loop); + + return 0; +} +#endif diff --git a/TC/telephony_TC/common/unit/tet_macro.h b/TC/telephony_TC/common/unit/tet_macro.h new file mode 100644 index 0000000..17c574c --- /dev/null +++ b/TC/telephony_TC/common/unit/tet_macro.h @@ -0,0 +1,43 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * 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 TET_MACRO_H +#define TET_MACRO_H + +//#define true TET_PASS +//#define false TET_FAIL +//#define printf tet_printf + +//#define MT_FAIL(x) tet_result(TET_FAIL) +#define TET_CHECK(x) if(x) tet_result(TET_PASS); else tet_result(TET_FAIL) +#define TET_CHECK_EQUAL(x,y) if ((x)==(y)) tet_result(TET_PASS); else tet_result(TET_FAIL) +#define TET_CHECK_NOT_EQUAL(x,y) if ((x)!=(y)) tet_result(TET_PASS); else tet_result(TET_FAIL) + +////modified by Aakash Manik aakash.manik@samsung.com on 08_04_08 + +#define TET_CHECK_MESSAGE(x,y) if ((y)==(TRUE)) tet_result(TET_PASS); else {tet_result(TET_FAIL); tet_printf(x);} +#define TET_CHECK_EQUAL_MESSAGE(x,y,z) if ((y)==(z)) tet_result(TET_PASS); else {tet_result(TET_FAIL); tet_printf(x);} +#define TET_CHECK_NOT_EQUAL_MESSAGE(x,y,z) if ((y)!=(z)) tet_result(TET_PASS); else {tet_result(TET_FAIL); tet_printf(x);} + +////modified by Aakash Manik aakash.manik@samsung.com on 08_04_08 + +#endif + diff --git a/TC/telephony_TC/common/unit/tslist b/TC/telephony_TC/common/unit/tslist new file mode 100644 index 0000000..0615e56 --- /dev/null +++ b/TC/telephony_TC/common/unit/tslist @@ -0,0 +1,6 @@ +/common/unit/uts_tel_check_service_ready +/common/unit/uts_tel_deinit +/common/unit/uts_tel_register_event +/common/unit/uts_tel_init +/common/unit/uts_tel_deregister_event +/common/unit/uts_tel_request_tunnel diff --git a/TC/telephony_TC/common/unit/uts_tel_check_service_ready.c b/TC/telephony_TC/common/unit/uts_tel_check_service_ready.c new file mode 100644 index 0000000..ecde3ac --- /dev/null +++ b/TC/telephony_TC/common/unit/uts_tel_check_service_ready.c @@ -0,0 +1,142 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * 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 "tapi_common.h" +#include "tet_macro.h" +#include "uts_tel_check_service_ready.h" + +/* Initialize TCM data structures */ +static void startup(); +static void cleanup(); +void (*tet_startup) () = startup; +void (*tet_cleanup) () = cleanup; +struct tet_testlist tet_testlist[] = { + {utc_tel_check_service_ready_01, 1}, + {utc_tel_check_service_ready_02, 2}, + {NULL, 0} +}; +#if 0 +/* + G_MAIN Utility //////////////////////////////////////////////////////////////////////////// +*/ +// Prototype : User must add function body +gboolean g_timeout_callback (void *data); + +// GMainLoop global handler +GMainLoop *nw_context_loop = NULL; + +void G_MAIN_LOOP_CLOSE() +{ + g_main_loop_quit(nw_context_loop); +} + +int G_MAIN_LOOP_RUN(int sec) +{ + //GMainLoop *mainloop; + nw_context_loop = g_main_loop_new (NULL, FALSE); + g_timeout_add ( (sec * 1000), g_timeout_callback, NULL); + g_main_loop_run (nw_context_loop); + + return 0; +} +// End of G_MAIN Utility////////////////////////////////////////////////////////////////////// +#endif + +/* + User Defined Handler +*/ + + +/* Startup & Clean function : It is not test code, only for + initialize and finalize test module +*/ +static void startup() +{ + tet_infoline("uts_tel_get_sim_imsi Test Start\n"); + if (tel_init() != TAPI_API_SUCCESS) + { + tet_infoline("startup fail. tel_init() failed"); + } + return; +} + + +static void cleanup() +{ + tet_infoline("uts_tel_get_sim_imsi Test Finished\n"); + if (tel_deinit() != TAPI_API_SUCCESS) + { + tet_infoline("startup fail. tel_deinit() failed"); + } + return; +} + +void utc_tel_check_service_ready_01() +{ + TapiResult_t returnStatus = TAPI_API_SUCCESS; + int bstatus; + + returnStatus = tel_check_service_ready(&bstatus); + + tet_printf ("The return value is %d\n", returnStatus); + + if(returnStatus == TAPI_API_SUCCESS) + { + tet_result(TET_PASS); + tet_printf("utc_tel_check_service_ready_01 success\n"); + } + else + { + tet_result(TET_FAIL); + tet_printf("utc_tel_check_service_ready_01 failed\n"); + } +} + + + +void utc_tel_check_service_ready_02() +{ + TapiResult_t returnStatus = TAPI_API_SUCCESS; + + returnStatus = tel_check_service_ready(NULL); + + tet_printf ("The return value is %d\n", returnStatus); + + if(returnStatus == TAPI_API_SUCCESS) + { + tet_result(TET_FAIL); + tet_printf("utc_tel_check_service_ready_02 failed\n"); + } + tet_result(TET_PASS); +//returnStatus = tel_deinit(); //Deinitializin already deinitialized tapi +} + +/** @} */ + + + + + + + + diff --git a/TC/telephony_TC/common/unit/uts_tel_check_service_ready.h b/TC/telephony_TC/common/unit/uts_tel_check_service_ready.h new file mode 100644 index 0000000..595a3ce --- /dev/null +++ b/TC/telephony_TC/common/unit/uts_tel_check_service_ready.h @@ -0,0 +1,49 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * 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 _UTC_TAPI_DEINIT_EVENT_ +#define _UTC_TAPI_DEINIT_EVENT_ + + +void utc_tel_check_service_ready_01(); +void utc_tel_check_service_ready_02(); + +static void startup(); + +static void cleanup(); + + + + + +#endif //_UTC_TAPI_DEINIT_EVENT_ + + + + + + + + + + diff --git a/TC/telephony_TC/common/unit/uts_tel_deinit.c b/TC/telephony_TC/common/unit/uts_tel_deinit.c new file mode 100644 index 0000000..3d7fdfc --- /dev/null +++ b/TC/telephony_TC/common/unit/uts_tel_deinit.c @@ -0,0 +1,74 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * 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 "tapi_common.h" +#include "tet_macro.h" +#include "uts_tel_deinit.h" +#include +/* Initialize TCM data structures */ +static void startup(); +static void cleanup(); +void (*tet_startup) () = startup; +void (*tet_cleanup) () = cleanup; +struct tet_testlist tet_testlist[] = { + {utc_tapi_deinit_01, 1}, + {NULL, 0} +}; + +static void startup() +{ +} + +static void cleanup() +{ +} + +void utc_tapi_deinit_01() +{ + + TapiResult_t returnStatus = TAPI_API_SUCCESS; + + if(tel_init() == TAPI_API_SUCCESS){ + returnStatus = tel_deinit(); + } + + tet_printf ("The return value is %d\n", returnStatus); + + TET_CHECK_EQUAL(returnStatus ,TAPI_API_SUCCESS); + if(returnStatus == TAPI_API_SUCCESS) + tet_printf("utc_tapi_deinit_01 pass\n"); +} + +/** @} */ + + + + + + + + + + + + diff --git a/TC/telephony_TC/common/unit/uts_tel_deinit.h b/TC/telephony_TC/common/unit/uts_tel_deinit.h new file mode 100644 index 0000000..034318d --- /dev/null +++ b/TC/telephony_TC/common/unit/uts_tel_deinit.h @@ -0,0 +1,48 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * 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 _UTC_TAPI_DEINIT_EVENT_ +#define _UTC_TAPI_DEINIT_EVENT_ + + +void utc_tapi_deinit_01(); + +static void startup(); + +static void cleanup(); + +#endif //_UTC_TAPI_DEINIT_EVENT_ + + + + + + + + + + + + + + diff --git a/TC/telephony_TC/common/unit/uts_tel_deregister_event.c b/TC/telephony_TC/common/unit/uts_tel_deregister_event.c new file mode 100644 index 0000000..884c2a1 --- /dev/null +++ b/TC/telephony_TC/common/unit/uts_tel_deregister_event.c @@ -0,0 +1,153 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * 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 "tapi_common.h" +#include "tet_macro.h" +#include "uts_tel_deregister_event.h" + +/* Initialize TCM data structures */ +static void startup(); +static void cleanup(); +void (*tet_startup) () = startup; +void (*tet_cleanup) () = cleanup; +struct tet_testlist tet_testlist[] = { + {utc_tel_deregister_event_01, 1}, + {utc_tel_deregister_event_02, 2}, + {NULL, 0} +}; + +/* + G_MAIN Utility //////////////////////////////////////////////////////////////////////////// +*/ +// Prototype : User must add function body +gboolean g_timeout_callback (void *data); + +// GMainLoop global handler +GMainLoop *nw_context_loop = NULL; + +void G_MAIN_LOOP_CLOSE() +{ + g_main_loop_quit(nw_context_loop); +} + +int G_MAIN_LOOP_RUN(int sec) +{ + nw_context_loop = g_main_loop_new (NULL, FALSE); + g_timeout_add ( (sec * 1000), g_timeout_callback, NULL); + g_main_loop_run (nw_context_loop); + + return 0; +} +// End of G_MAIN Utility////////////////////////////////////////////////////////////////////// + + +/* + User Defined Handler +*/ +// Global variable for user data +static int gAsyncResult; //user defined data : Async callback is called or not + +// G_MAIN Utility : time out callback function +gboolean g_timeout_callback (void *data) +{ + gAsyncResult = FALSE; + tet_printf("[SIM APP][TIME OUT] g_timeout called .Close g_main_roop()"); + G_MAIN_LOOP_CLOSE(); + return FALSE; +} + + +/* Startup & Clean function : It is not test code, only for + initialize and finalize test module +*/ +static int gStartupSuccess = FALSE; +static unsigned int subscription_id = 0; + + +int register_app_callback(TelTapiEvent_t *Event) +{ + tet_printf("utc_tapi_register_event_01 - call back called\n"); + return TRUE; +} + +static void startup() +{ + tet_infoline("utc_tapi_update_deregister_event Test Start\n"); + + if ( tel_init() == TAPI_API_SUCCESS) + { + if (TAPI_API_SUCCESS == tel_register_event(TAPI_EVENT_CLASS_DATA,&subscription_id,(TelAppCallback)register_app_callback,NULL)) + gStartupSuccess = TRUE; + else + tet_infoline("startup fail. tel_register_event() failed"); + } else { + tet_infoline("startup fail. tel_init() failed"); + } + + return; +} + + +static void cleanup() +{ + tet_infoline("utc_tapi_update_deregister_event Test Finished\n"); +tel_deinit(); + + return; +} + + + +void utc_tel_deregister_event_01() +{ + + TapiResult_t returnStatus = TAPI_API_SUCCESS; + + returnStatus = tel_deregister_event(subscription_id); + + tet_printf ("The return value is %d\n", returnStatus); + + TET_CHECK_EQUAL(returnStatus,TAPI_API_SUCCESS); + if(returnStatus == TAPI_API_SUCCESS) + tet_printf("utc_tapi_deregister_event_01 pass\n"); + +} + + +void utc_tel_deregister_event_02() +{ + + TapiResult_t returnStatus = TAPI_API_SUCCESS; + + returnStatus = tel_deregister_event(NULL); + + tet_printf ("The return value is %d\n", returnStatus); + + TET_CHECK_EQUAL(returnStatus,TAPI_API_INVALID_INPUT); + if(returnStatus == TAPI_API_INVALID_INPUT) + tet_printf("utc_tapi_deregister_event_02 pass\n"); + +} + + + +/** @} */ + diff --git a/TC/telephony_TC/common/unit/uts_tel_deregister_event.h b/TC/telephony_TC/common/unit/uts_tel_deregister_event.h new file mode 100644 index 0000000..991bfc4 --- /dev/null +++ b/TC/telephony_TC/common/unit/uts_tel_deregister_event.h @@ -0,0 +1,47 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * 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 _UTC_TAPI_DEREGISTER_EVENT_ +#define _UTC_TAPI_DEREGISTER_EVENT_ + + +void utc_tel_deregister_event_01(); +void utc_tel_deregister_event_02(); + +static void startup(); + +static void cleanup(); + + +#endif //_UTC_TAPI_DEREGISTER_EVENT_ + + + + + + + + + + + diff --git a/TC/telephony_TC/common/unit/uts_tel_init.c b/TC/telephony_TC/common/unit/uts_tel_init.c new file mode 100644 index 0000000..c76ff43 --- /dev/null +++ b/TC/telephony_TC/common/unit/uts_tel_init.c @@ -0,0 +1,68 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * 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 "tet_macro.h" +#include "uts_tel_init.h" +#include "tapi_common.h" + +/* Initialize TCM data structures */ +static void startup(); +static void cleanup(); +void (*tet_startup) () = startup; +void (*tet_cleanup) () = cleanup; +struct tet_testlist tet_testlist[] = { + {utc_tel_init_01, 1}, + {NULL, 0} +}; + + +/* Startup & Clean function : It is not test code, only for + initialize and finalize test module +*/ + +static void startup() +{ +} + +static void cleanup() +{ +} + +void utc_tel_init_01() +{ + + TapiResult_t returnStatus = TAPI_API_SUCCESS; + + returnStatus = tel_init(); + + tet_printf ("The return value is %d\n", returnStatus); + + TET_CHECK_EQUAL(returnStatus,TAPI_API_SUCCESS); + if(returnStatus==TAPI_API_SUCCESS) + tet_printf("utc_tapi_init_01 pass\n"); + returnStatus = tel_deinit(); + +} + +/** @} */ + diff --git a/TC/telephony_TC/common/unit/uts_tel_init.h b/TC/telephony_TC/common/unit/uts_tel_init.h new file mode 100644 index 0000000..c6421c3 --- /dev/null +++ b/TC/telephony_TC/common/unit/uts_tel_init.h @@ -0,0 +1,30 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * 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 _UTC_TAPI_INIT_EVENT_ +#define _UTC_TAPI_INIT_EVENT_ + +void utc_tel_init_01(); + +static void startup(); + +static void cleanup(); + +#endif //_UTC_TAPI_INIT_EVENT_ diff --git a/TC/telephony_TC/common/unit/uts_tel_register_event.c b/TC/telephony_TC/common/unit/uts_tel_register_event.c new file mode 100644 index 0000000..375d568 --- /dev/null +++ b/TC/telephony_TC/common/unit/uts_tel_register_event.c @@ -0,0 +1,215 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * 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 "tapi_common.h" +#include "tet_macro.h" +#include "uts_tel_register_event.h" + +/* Initialize TCM data structures */ +static void startup(); +static void cleanup(); +void (*tet_startup) () = startup; +void (*tet_cleanup) () = cleanup; +struct tet_testlist tet_testlist[] = { + {utc_tapi_register_event_01, 1}, +// {utc_tapi_register_event_02, 2}, +// {utc_tapi_register_event_03, 3}, + {utc_tapi_register_event_04, 4}, + {utc_tapi_register_event_05, 5}, + {NULL, 0} +}; + +/* + G_MAIN Utility //////////////////////////////////////////////////////////////////////////// +*/ +// Prototype : User must add function body +gboolean g_timeout_callback (void *data); + +// GMainLoop global handler +GMainLoop *nw_context_loop = NULL; + +void G_MAIN_LOOP_CLOSE() +{ + g_main_loop_quit(nw_context_loop); +} + +int G_MAIN_LOOP_RUN(int sec) +{ + nw_context_loop = g_main_loop_new (NULL, FALSE); + g_timeout_add ( (sec * 1000), g_timeout_callback, NULL); + g_main_loop_run (nw_context_loop); + + return 0; +} + +// Global variable for user data +static int gAsyncResult; //user defined data : Async callback is called or not + +// G_MAIN Utility : time out callback function +gboolean g_timeout_callback (void *data) +{ + gAsyncResult = FALSE; + tet_printf("[SIM APP][TIME OUT] g_timeout called .Close g_main_roop()"); + G_MAIN_LOOP_CLOSE(); + return FALSE; +} + + +/* Startup & Clean function : It is not test code, only for + initialize and finalize test module +*/ +static int gStartupSuccess = FALSE; +static unsigned int subscription_id = 0; + +static void startup() +{ + tet_infoline("utc_tapi_register_event Test Start\n"); + + if ( tel_init() == TAPI_API_SUCCESS) + { + + gStartupSuccess = TRUE; + + } else { + tet_infoline("startup fail. tel_init() failed"); + } + + return; +} + + +static void cleanup() +{ + tet_infoline("utc_tapi_update_register_event Test Finished\n"); + + if (gStartupSuccess == TRUE) + { + tel_deregister_event(subscription_id); + } + tel_deinit(); + + return; +} + +int register_app_callback(TelTapiEvent_t *Event) +{ + tet_printf("utc_tapi_register_event_01 - call back called\n"); + return TRUE; +} + + + +void utc_tapi_register_event_01() +{ + + TapiResult_t returnStatus = TAPI_API_SUCCESS; + + returnStatus = tel_register_event(TAPI_EVENT_CLASS_DATA,&subscription_id,(TelAppCallback)register_app_callback,NULL); + + tet_printf ("The return value is %d\n", returnStatus); + + TET_CHECK_EQUAL(returnStatus , TAPI_API_SUCCESS); + if(returnStatus == TAPI_API_SUCCESS) + tet_printf("utc_tapi_register_event_01 pass\n"); + +} + +/* +void utc_tapi_register_event_02() +{ + + TapiResult_t returnStatus = TAPI_API_SUCCESS; + + gmain_loop_for_tapi_events(TIME_DELAY); + returnStatus = tel_register_event(TAPI_EVENT_CALL_SETUP_CNF - 1,&subscription_id,(TelAppCallback)register_app_callback,NULL); + gmain_loop_for_tapi_events(TIME_DELAY); + + printf ("The return value is %d\n", returnStatus); + + TET_CHECK_EQUAL(returnStatus,TAPI_EVENT_CLASS_UNKNOWN); + if(returnStatus == TAPI_EVENT_CLASS_UNKNOWN) + printf("utc_tapi_register_event_02 pass\n"); + +} + + +void utc_tapi_register_event_03() +{ + + TapiResult_t returnStatus = TAPI_API_SUCCESS; + + gmain_loop_for_tapi_events(TIME_DELAY); + returnStatus = tel_register_event((int)NULL,&subscription_id,(TelAppCallback)register_app_callback,NULL); + gmain_loop_for_tapi_events(TIME_DELAY); + + printf ("The return value is %d\n", returnStatus); + if(returnStatus == TAPI_API_SUCCESS) + tet_result(TET_FAIL); + + tet_result(TET_PASS); + printf("utc_tapi_register_event_03 pass\n"); + +} +*/ +void utc_tapi_register_event_04() +{ + + TapiResult_t returnStatus = TAPI_API_SUCCESS; + + returnStatus = tel_register_event(TAPI_EVENT_CALL_SETUP_CNF,NULL,(TelAppCallback)register_app_callback,NULL); + tet_printf ("The return value is %d\n", returnStatus); + if(returnStatus == TAPI_API_SUCCESS) + tet_result(TET_FAIL); + + tet_result(TET_PASS); + tet_printf("utc_tapi_register_event_04 pass\n"); + +} + +void utc_tapi_register_event_05() +{ + + TapiResult_t returnStatus = TAPI_API_SUCCESS; + + returnStatus = tel_register_event(TAPI_EVENT_CALL_SETUP_CNF ,&subscription_id,(TelAppCallback)NULL,NULL); + + tet_printf ("The return value is %d\n", returnStatus); + if(returnStatus == TAPI_API_SUCCESS) + tet_result(TET_FAIL); + + tet_result(TET_PASS); + tet_printf("utc_tapi_register_event_05 pass\n"); + +} + +/** @} */ + + + + + + + + + diff --git a/TC/telephony_TC/common/unit/uts_tel_register_event.h b/TC/telephony_TC/common/unit/uts_tel_register_event.h new file mode 100644 index 0000000..d1442f6 --- /dev/null +++ b/TC/telephony_TC/common/unit/uts_tel_register_event.h @@ -0,0 +1,51 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * 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 _UTC_TAPI_REGISTER_EVENT_ +#define _UTC_TAPI_REGISTER_EVENT_ + +extern TS_UINT g_CallHandle; + +void utc_tapi_register_event_01(); + +void utc_tapi_register_event_02(); +void utc_tapi_register_event_03(); +void utc_tapi_register_event_04(); +void utc_tapi_register_event_05(); + +static void startup(); + +static void cleanup(); + + +#endif //_UTC_TAPI_REGISTER_EVENT_ + + + + + + + + + + diff --git a/TC/telephony_TC/common/unit/uts_tel_request_tunnel.c b/TC/telephony_TC/common/unit/uts_tel_request_tunnel.c new file mode 100644 index 0000000..232b215 --- /dev/null +++ b/TC/telephony_TC/common/unit/uts_tel_request_tunnel.c @@ -0,0 +1,79 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * 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 +#include "tet_macro.h" +#include "uts_tel_request_tunnel.h" + +/* Initialize TCM data structures */ +static void startup(); +static void cleanup(); +void (*tet_startup) () = startup; +void (*tet_cleanup) () = cleanup; +struct tet_testlist tet_testlist[] = { + {utc_tapi_request_tunnel_01, 1}, + {utc_tapi_request_tunnel_02, 2}, + {NULL, 0} +}; + + +static void startup() +{ + +} + +static void cleanup() +{ + +} + +void utc_tapi_request_tunnel_01() +{ + + int ret = TAPI_API_SUCCESS; + int req_id; + + ret = tel_request_tunnel(NULL, &req_id); + + tet_printf ("tel_request_tunnel return=%d\n", ret); + + TET_CHECK_NOT_EQUAL(ret , TAPI_API_SUCCESS); +} + + +void utc_tapi_request_tunnel_02() +{ + int ret = TAPI_API_SUCCESS; + int req_id; + TelTunnelInfo_t tunnel_info; + + ret = tel_request_tunnel(&tunnel_info, NULL); + + tet_printf ("tel_request_tunnel return=%d\n", ret); + + TET_CHECK_NOT_EQUAL(ret , TAPI_API_SUCCESS); + +} + +/** @} */ diff --git a/TC/telephony_TC/common/unit/uts_tel_request_tunnel.h b/TC/telephony_TC/common/unit/uts_tel_request_tunnel.h new file mode 100644 index 0000000..3de3efd --- /dev/null +++ b/TC/telephony_TC/common/unit/uts_tel_request_tunnel.h @@ -0,0 +1,44 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * 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 _UTC_TAPI_REQUEST_TUNNEL_ +#define _UTC_TAPI_REQUEST_TUNNEL_ + +void utc_tapi_request_tunnel_01(); +void utc_tapi_request_tunnel_02(); + +static void startup(); +static void cleanup(); + + +#endif //_UTC_TAPI_REGISTER_EVENT_ + + + + + + + + + + diff --git a/TC/telephony_TC/gprs/unit/gprs_common.c b/TC/telephony_TC/gprs/unit/gprs_common.c new file mode 100644 index 0000000..c03ddc7 --- /dev/null +++ b/TC/telephony_TC/gprs/unit/gprs_common.c @@ -0,0 +1,194 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * 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 "gprs_common.h" + +GMainLoop *nw_context_loop = NULL; + +static unsigned int subscription_id[16] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; +int expected_event; +bool async_response = false; + +void G_MAIN_LOOP_CLOSE() +{ + g_main_loop_quit(nw_context_loop); +} + +gboolean g_timeout_callback(void * data) +{ + G_MAIN_LOOP_CLOSE(); + return FALSE; +} + +int G_MAIN_LOOP_RUN(int sec) +{ + nw_context_loop = g_main_loop_new(NULL, FALSE); + g_timeout_add_seconds(sec, g_timeout_callback, NULL); + g_main_loop_run(nw_context_loop); + + return 0; +} + +//static int ps_app_callback (int group, int action, void* data, int length) +void ps_app_callback(TelTapiEvent_t *TapiEvent) +{ + int eventClass; + int eventType; + int requestId; + int status; + void *EventData = NULL; + + eventClass = TapiEvent->EventClass; + eventType = TapiEvent->EventType; + requestId = TapiEvent->RequestId; + status = TapiEvent->Status; + EventData = TapiEvent->pData; + + printf("- expected event=0x%x received event=0x%x\n", expected_event, eventType); + if (eventType == expected_event) { + async_response = true; + g_main_loop_quit(nw_context_loop); + } + + return; + +} + +void print_all_subsciption_ids() +{ + int i = 0; + for (i = 0; i < 16; i++) { + printf("subscription_id[%02d] has value %d \n", i, subscription_id[i]); + } +} + +TapiResult_t register_all_events() +{ + TapiResult_t api_err = TAPI_API_SUCCESS; + + api_err = tel_register_event(TAPI_EVENT_PS_BTDUN_PINCONTROL_NOTI, &subscription_id[0], (TelAppCallback) &ps_app_callback, NULL); + api_err = tel_register_event(TAPI_EVENT_PS_CALL_STATISTICS, &subscription_id[1], (TelAppCallback) &ps_app_callback, NULL); + //api_err = tel_register_event(TAPI_EVENT_PS_CALL_STATUS_RSP, &subscription_id[2], (TelAppCallback)&ps_app_callback,NULL); + api_err = tel_register_event(TAPI_EVENT_PS_ERROR_IND, &subscription_id[4], (TelAppCallback) &ps_app_callback, NULL); + api_err = tel_register_event(TAPI_EVENT_PS_HSDPA_STATUS_NOTI, &subscription_id[5], (TelAppCallback) &ps_app_callback, NULL); + //api_err = tel_register_event(TAPI_EVENT_PS_NETWORK_STATUS_RSP, &subscription_id[6], (TelAppCallback)&ps_app_callback,NULL); + api_err = tel_register_event(TAPI_EVENT_PS_PDP_ACT_IPCONFIG_INFO, &subscription_id[7], (TelAppCallback) &ps_app_callback, NULL); + api_err = tel_register_event(TAPI_EVENT_PS_PDP_ACT_RSP, &subscription_id[8], (TelAppCallback) &ps_app_callback, NULL); + //api_err = tel_register_event(TAPI_EVENT_PS_PDP_ADDRESS_RSP, &subscription_id[9], (TelAppCallback)&ps_app_callback,NULL); + //api_err = tel_register_event(TAPI_EVENT_PS_PDP_CONTEXTINFO_RSP, &subscription_id[10], (TelAppCallback)&ps_app_callback,NULL); + //api_err = tel_register_event(TAPI_EVENT_PS_PDP_DEACT_IND, &subscription_id[11], (TelAppCallback)&ps_app_callback,NULL); + api_err = tel_register_event(TAPI_EVENT_PS_PDP_DEACT_RSP, &subscription_id[12], (TelAppCallback) &ps_app_callback, NULL); + //api_err = tel_register_event(TAPI_EVENT_PS_QOS_3G_PROFILE_RSP, &subscription_id[13], (TelAppCallback)&ps_app_callback,NULL); + //api_err = tel_register_event(TAPI_EVENT_PS_QOS_PROFILE_RSP, &subscription_id[14], (TelAppCallback)&ps_app_callback,NULL); + //api_err = tel_register_event(TAPI_EVENT_PS_STATUS, &subscription_id[15], (TelAppCallback)&ps_app_callback,NULL); + + print_all_subsciption_ids(); + return api_err; +} + +TapiResult_t deregister_all() +{ + TapiResult_t api_err = TAPI_API_SUCCESS; + + api_err = tel_deregister_event(subscription_id[0]); + api_err = tel_deregister_event(subscription_id[1]); + //api_err = tel_deregister_event(subscription_id[2]); + api_err = tel_deregister_event(subscription_id[4]); + api_err = tel_deregister_event(subscription_id[5]); + //api_err = tel_deregister_event(subscription_id[6]); + api_err = tel_deregister_event(subscription_id[7]); + api_err = tel_deregister_event(subscription_id[8]); + //api_err = tel_deregister_event(subscription_id[9]); + //api_err = tel_deregister_event(subscription_id[10]); + //api_err = tel_deregister_event(subscription_id[11]); + api_err = tel_deregister_event(subscription_id[12]); + //api_err = tel_deregister_event(subscription_id[13]); + //api_err = tel_deregister_event(subscription_id[14]); + //api_err = tel_deregister_event(subscription_id[15]); + + return api_err; + +} + +TapiResult_t temp_gprs_session_activate() +{ + TapiResult_t ret_status; + tapi_ps_net_start_req_t start_req; + int request_id = 0; + + TEST_DEBUG("- Temp gprs activation starts\n"); + + memset(&start_req, 0, sizeof(tapi_ps_net_start_req_t)); + + start_req.cont_id = CONTEXT_ID; + strncpy(start_req.pdp_info.apn, APN_ADDRESS, TAPI_PDP_APN_LEN_MAX); + + ret_status = tel_activate_gprs_pdp(&start_req, &request_id); + + printf("- return value = %d\n", ret_status); + + if (TAPI_API_SUCCESS == ret_status) { + printf("- temp gprs mode Started successfully \n"); + } + else { + printf("- temp gprs mode not started \n"); + } + + expected_event = TAPI_EVENT_PS_PDP_ACT_RSP; + + G_MAIN_LOOP_RUN(10); + + TEST_DEBUG("- Temp gprs activation ends\n"); + + return ret_status; +} + +TapiResult_t temp_gprs_session_deactivate(int contId) +{ + TapiResult_t ret_status; + tapi_ps_net_stop_req_t end_req; + int request_id = 0; + + TEST_DEBUG("- Temp gprs deactivation starts\n"); + + memset(&end_req, 0, sizeof(tapi_ps_net_stop_req_t)); + + end_req.cont_id = contId; + + ret_status = tel_deactivate_gprs_pdp(&end_req, &request_id); + + printf("- return value = %d\n", ret_status); + + if (TAPI_API_SUCCESS == ret_status) { + printf("- temp gprs mode ended successfully\n"); + } + else { + printf("- temp gprs mode not ended \n"); + } + + expected_event = TAPI_EVENT_PS_PDP_DEACT_RSP; + + G_MAIN_LOOP_RUN(10); + + TEST_DEBUG("- Temp gprs deactivation ends\n"); + + return ret_status; +} + diff --git a/TC/telephony_TC/gprs/unit/gprs_common.h b/TC/telephony_TC/gprs/unit/gprs_common.h new file mode 100644 index 0000000..68ed369 --- /dev/null +++ b/TC/telephony_TC/gprs/unit/gprs_common.h @@ -0,0 +1,91 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * 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 _GPRS_COMMON_H_ +#define _GPRS_COMMON_H_ + +#include +#include +#include +#include "string.h" +#include "assert.h" +#include +#include +#include +#include +#include +#include +#include +#include "ITapiPS.h" +#include +#include "tet_macro.h" +#include +#include + +#define APN_ADDRESS "web.vodafone.de" +#define CONTEXT_ID 1 + +#define APN_ADDRESS_2 "web.vodafone.de" +#define CONTEXT_ID_2 2 + + +#define TLOG_HEADER(fmt, args...) printf("<%s:%4d> " fmt "\n", __FILE__, __LINE__, ##args); +#define TLOG_INFO(fmt, args...) printf("<%s:%4d> " fmt "\n", __FILE__, __LINE__, ##args); + +#define TIME_DELAY 5000 +#define TEST_DEBUG(fmt, args...) \ + printf("[%s %s:%d]\n" fmt "\n",__FILE__, __FUNCTION__, __LINE__, ##args); + +#ifndef false + #define false 0 +#endif +#ifndef true + #define true !0 +#endif +#ifndef bool + #define bool char +#endif + +extern void ps_app_callback (TelTapiEvent_t *TapiEvent); +extern TapiResult_t register_all_events(); +extern TapiResult_t deregister_all(); +extern void G_MAIN_LOOP_CLOSE(); +extern int G_MAIN_LOOP_RUN(int); + + +extern TapiResult_t temp_gprs_session_deactivate(); +extern TapiResult_t temp_gprs_session_activate(); + +#define TET_CHECK_TEMP(x1, y...) \ + do { \ + TapiResult_t err = y;\ + if (err != (x1)) \ + { \ + tet_printf("[line %d] Expected Result: %d Actual Result: %d",__LINE__, x1,y); \ + printf("- FAIL. [line %d] Expected Result: %d Actual Result: %d\n",__LINE__, x1,y); \ + tet_result(TET_FAIL); \ + return;\ + } \ + } while(0) + + +#endif //_GPRS_COMMON_H_ diff --git a/TC/telephony_TC/gprs/unit/makefile b/TC/telephony_TC/gprs/unit/makefile new file mode 100644 index 0000000..68ddeed --- /dev/null +++ b/TC/telephony_TC/gprs/unit/makefile @@ -0,0 +1,39 @@ +CC=gcc -Wall + +LB1 = gprs_common +TS1 = uts_tel_activate_gprs_pdp +TS2 = uts_tel_control_gprs_btdun_pin +TS3 = uts_tel_deactivate_gprs_pdp + +LIBS =$(LB1).o +LIBS += `pkg-config --libs gconf-2.0 glib-2.0 dbus-1 dbus-glib-1 gthread-2.0 tapi` +LIBS +=$(TET_ROOT)/lib/tet3/tcm.o +LIBS +=-L$(TET_ROOT)/lib/tet3 -lapi + +INCS = -I. `pkg-config --cflags gconf-2.0 glib-2.0 dbus-1 dbus-glib-1 gthread-2.0 tapi` +INCS += -I$(TET_ROOT)/inc/tet3 + +CFLAGS += $(INCS) -D__arm__ -D_ARM_TOUCH -DTELEPHONY_TIMER +CC +=$(CFLAGS) +LDFLAGS = $(LIBS) + +#ifeq ($(ARCH),target) +#CC += -g -mabi=aapcs-linux +#endif + +all : $(LB1) $(TS1) $(TS2) $(TS3) + +clean : + rm -rf *~ *.o tet_lock tet_captured $(LB1) $(TS1) $(TS2) $(TS3) + +$(LB1): $(LB1).c + $(CC) -c $(LB1).c + +$(TS1): $(TS1).c $(LB1) + $(CC) -o $(TS1) $(TS1).c $(LDFLAGS) + +$(TS2): $(TS2).c $(LB1) + $(CC) -o $(TS2) $(TS2).c $(LDFLAGS) + +$(TS3): $(TS3).c $(LB1) + $(CC) -o $(TS3) $(TS3).c $(LDFLAGS) diff --git a/TC/telephony_TC/gprs/unit/tet_macro.h b/TC/telephony_TC/gprs/unit/tet_macro.h new file mode 100644 index 0000000..17c574c --- /dev/null +++ b/TC/telephony_TC/gprs/unit/tet_macro.h @@ -0,0 +1,43 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * 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 TET_MACRO_H +#define TET_MACRO_H + +//#define true TET_PASS +//#define false TET_FAIL +//#define printf tet_printf + +//#define MT_FAIL(x) tet_result(TET_FAIL) +#define TET_CHECK(x) if(x) tet_result(TET_PASS); else tet_result(TET_FAIL) +#define TET_CHECK_EQUAL(x,y) if ((x)==(y)) tet_result(TET_PASS); else tet_result(TET_FAIL) +#define TET_CHECK_NOT_EQUAL(x,y) if ((x)!=(y)) tet_result(TET_PASS); else tet_result(TET_FAIL) + +////modified by Aakash Manik aakash.manik@samsung.com on 08_04_08 + +#define TET_CHECK_MESSAGE(x,y) if ((y)==(TRUE)) tet_result(TET_PASS); else {tet_result(TET_FAIL); tet_printf(x);} +#define TET_CHECK_EQUAL_MESSAGE(x,y,z) if ((y)==(z)) tet_result(TET_PASS); else {tet_result(TET_FAIL); tet_printf(x);} +#define TET_CHECK_NOT_EQUAL_MESSAGE(x,y,z) if ((y)!=(z)) tet_result(TET_PASS); else {tet_result(TET_FAIL); tet_printf(x);} + +////modified by Aakash Manik aakash.manik@samsung.com on 08_04_08 + +#endif + diff --git a/TC/telephony_TC/gprs/unit/tet_scen b/TC/telephony_TC/gprs/unit/tet_scen new file mode 100644 index 0000000..a2c9d59 --- /dev/null +++ b/TC/telephony_TC/gprs/unit/tet_scen @@ -0,0 +1,11 @@ + +all + "Starting Full Test Suite" + + /gprs/unit/uts_tapi_gprs_start + /gprs/unit/uts_tapi_gprs_pdp_deactivation_set + /gprs/unit/uts_tapi_gprs_pdp_btdunpincontrol_get + + "Completed Full Test Suite" + +# EOF diff --git a/TC/telephony_TC/gprs/unit/tslist b/TC/telephony_TC/gprs/unit/tslist new file mode 100644 index 0000000..a670f3d --- /dev/null +++ b/TC/telephony_TC/gprs/unit/tslist @@ -0,0 +1,3 @@ +/gprs/unit/uts_tel_activate_gprs_pdp +/gprs/unit/uts_tel_control_gprs_btdun_pin +/gprs/unit/uts_tel_deactivate_gprs_pdp diff --git a/TC/telephony_TC/gprs/unit/uts_tel_activate_gprs_pdp.c b/TC/telephony_TC/gprs/unit/uts_tel_activate_gprs_pdp.c new file mode 100644 index 0000000..a4b9af7 --- /dev/null +++ b/TC/telephony_TC/gprs/unit/uts_tel_activate_gprs_pdp.c @@ -0,0 +1,268 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * 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. + */ + + + +//add includes + + +#include "uts_tel_activate_gprs_pdp.h" + +void (*tet_startup) () = startup; +void (*tet_cleanup) () = cleanup; + +extern int expected_event; +extern bool async_response; + +static void startup() +{ + TLOG_HEADER("STARTUP"); + + TapiResult_t ret_status; + + ret_status = tel_init(); + if (ret_status != TAPI_API_SUCCESS) + { + printf("TelTapiInit() Failed ret_status = %d \n", ret_status); + } + + register_all_events(); + + tel_register_app_name("org.samsung.test"); + + TLOG_INFO(" - GPRS active session deactivate"); + + ret_status = temp_gprs_session_deactivate(CONTEXT_ID); + if (ret_status == TAPI_API_SUCCESS) + { + TLOG_INFO("- GPRS active session ended successfully"); + } + else + { + TLOG_INFO("- GPRS active session not ended"); + } +} + +static void cleanup() +{ + TLOG_HEADER("CLEANUP"); + + TapiResult_t ret_status; + + deregister_all(); + + ret_status = tel_deinit(); + if (ret_status != TAPI_API_SUCCESS) + { + printf("TelTapiDeInit() Failed ret_status = %d \n", ret_status); + } +} + + +#if 0 +/** + * @brief This tests + * @par ID: UTC_TAPI_GPRS_START_00 + * @param [in] *net_start_req_info + * @param [in] pRequestID + * @code + * @endcode + * @param [out] *net_start_req_info + * @param [out] pRequestID + * @return TapiResult_t + */ +void utc_tel_activate_gprs_pdp_00() +{ + TLOG_HEADER("TEST START [%s]", __FUNCTION__); + TLOG_INFO(" - setting the valid gprs mode"); + + TapiResult_t ret_status ; + tapi_ps_net_start_req_t start_req; + int request_id = 0; + + async_response = false;//initialize + + memset(&start_req, 0, sizeof(tapi_ps_net_start_req_t)); + start_req.cont_id = CONTEXT_ID; + strncpy(start_req.pdp_info.apn , APN_ADDRESS, TAPI_PDP_APN_LEN_MAX); + + ret_status = tel_activate_gprs_pdp(&start_req, &request_id); + if (TAPI_API_SUCCESS == ret_status) + { + TLOG_INFO(" - GPRS mode started successfully"); + } + else + { + TLOG_INFO(" - GPRS mode not started"); + } + + TET_CHECK_EQUAL(TAPI_API_SUCCESS, ret_status); + tet_infoline("utc_tel_activate_gprs_pdp_00 pass"); + + expected_event = TAPI_EVENT_PS_PDP_ACT_RSP; + TLOG_INFO(" - expected_event is TAPI_EVENT_PS_PDP_ACT_RSP(%d)", expected_event); + TLOG_INFO(" - ... waiting ... "); + + G_MAIN_LOOP_RUN(80); + TET_CHECK_TEMP(true, async_response); + tet_result(TET_PASS); + + ret_status = temp_gprs_session_deactivate(CONTEXT_ID); + if(TAPI_API_SUCCESS == ret_status) + { + TLOG_INFO(" - GPRS active session ended succesfully"); + } + else + { + TLOG_INFO(" - GPRS active session not ended"); + } + + TLOG_HEADER("TEST END [%s]\n", __FUNCTION__); +} +#endif + +/** + * @brief This tests + * @par ID: UTC_TAPI_GPRS_START_01 + * @param [in] *net_start_req_info + * @param [in] pRequestID + * @code + * @endcode + * @param [out] *net_start_req_info + * @param [out] pRequestID + * @return TapiResult_t + */ +void utc_tel_activate_gprs_pdp_00() +{ + TLOG_HEADER("TEST START [%s]", __FUNCTION__); + TLOG_INFO(" - setting the invalid(net_start_req_info) gprs mode"); + + TapiResult_t ret_status ; + tapi_ps_net_start_req_t start_req; + int request_id = 0; + + async_response = false;//initialize + + memset(&start_req, 0, sizeof(tapi_ps_net_start_req_t)); + start_req.cont_id = CONTEXT_ID; + strncpy(start_req.pdp_info.apn , APN_ADDRESS, TAPI_PDP_APN_LEN_MAX); + + ret_status = tel_activate_gprs_pdp(NULL, &request_id); + if(TAPI_API_INVALID_PTR == ret_status) + { + TLOG_INFO(" - GPRS mode start api invalid NULL case pass"); + } + else + { + TLOG_INFO(" - GPRS mode NULL check failed"); + } + + TET_CHECK_EQUAL(TAPI_API_INVALID_PTR, ret_status); + tet_infoline("utc_tel_activate_gprs_pdp_01 pass"); + + TLOG_HEADER("TEST END [%s]\n", __FUNCTION__); +} + +/** + * @brief This tests + * @par ID: UTC_TAPI_GPRS_START_02 + * @param [in] *net_start_req_info + * @param [in] pRequestID + * @code + * @endcode + * @param [out] *net_start_req_info + * @param [out] pRequestID + * @return TapiResult_t + */ +void utc_tel_activate_gprs_pdp_01() +{ + TLOG_HEADER("TEST START [%s]", __FUNCTION__); + TLOG_INFO(" - setting the invalid(pRequestID) gprs mode"); + + TapiResult_t ret_status ; + tapi_ps_net_start_req_t start_req; + //int request_id=0; + async_response = false;//initialize + + memset(&start_req, 0, sizeof(tapi_ps_net_start_req_t)); + + start_req.cont_id = CONTEXT_ID; + strncpy(start_req.pdp_info.apn , APN_ADDRESS, TAPI_PDP_APN_LEN_MAX); + + ret_status = tel_activate_gprs_pdp(&start_req, NULL); + if (TAPI_API_INVALID_PTR == ret_status) + { + TLOG_INFO(" - GPRS mode started api invalid NULL case pass"); + } + else + { + TLOG_INFO(" - GPRS mode NULL check failed"); + } + + TET_CHECK_EQUAL(TAPI_API_INVALID_PTR, ret_status); + tet_infoline("utc_tel_activate_gprs_pdp_02 pass"); + + TLOG_HEADER("TEST END [%s]\n", __FUNCTION__); +} + +/* + * @brief This tests + * @par ID: UTC_TAPI_GPRS_START_03 + * @param [in] *net_start_req_info + * @param [in] pRequestID + * @code + * @endcode + * @param [out] *net_start_req_info + * @param [out] pRequestID + * @return TapiResult_t + */ +void utc_tel_activate_gprs_pdp_02() +{ + TLOG_HEADER("TEST START [%s]", __FUNCTION__); + TLOG_INFO(" - setting the invalid(auth_type) gprs mode"); + + TapiResult_t ret_status; + tapi_ps_net_start_req_t start_req; + int request_id = 0; + + async_response = false;//initialize + + memset(&start_req, 0, sizeof(tapi_ps_net_start_req_t)); + start_req.cont_id = CONTEXT_ID; + strncpy(start_req.pdp_info.apn , APN_ADDRESS, TAPI_PDP_APN_LEN_MAX); + start_req.pdp_info.auth_type = TAPI_PDP_AUTH_NONE - 1; + + ret_status = tel_activate_gprs_pdp(&start_req, &request_id); + if (TAPI_API_INVALID_INPUT == ret_status) + { + TLOG_INFO(" - GPRS mode start api invalid input cass pass"); + } + else + { + TLOG_INFO(" - GPRS mode invalid enum check failed"); + } + + TET_CHECK_EQUAL(TAPI_API_INVALID_INPUT, ret_status); + tet_infoline("utc_tel_activate_gprs_pdp_03 pass"); + + TLOG_HEADER("TEST END [%s]\n", __FUNCTION__); +} + +/** @} */ diff --git a/TC/telephony_TC/gprs/unit/uts_tel_activate_gprs_pdp.h b/TC/telephony_TC/gprs/unit/uts_tel_activate_gprs_pdp.h new file mode 100644 index 0000000..2322fe6 --- /dev/null +++ b/TC/telephony_TC/gprs/unit/uts_tel_activate_gprs_pdp.h @@ -0,0 +1,40 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * 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 "gprs_common.h" + +#ifndef _UTC_TAPI_GPRS_START_ +#define _UTC_TAPI_GPRS_START_ + +void utc_tel_activate_gprs_pdp_00(); +void utc_tel_activate_gprs_pdp_01(); +void utc_tel_activate_gprs_pdp_02(); + +static void startup(); +static void cleanup(); + +struct tet_testlist tet_testlist[] = { + {utc_tel_activate_gprs_pdp_00, 1}, + {utc_tel_activate_gprs_pdp_01, 2}, + {utc_tel_activate_gprs_pdp_02, 3}, + {NULL, 0} + }; + +#endif //_UTC_TAPI_GPRS_START_ diff --git a/TC/telephony_TC/gprs/unit/uts_tel_control_gprs_btdun_pin.c b/TC/telephony_TC/gprs/unit/uts_tel_control_gprs_btdun_pin.c new file mode 100644 index 0000000..7151802 --- /dev/null +++ b/TC/telephony_TC/gprs/unit/uts_tel_control_gprs_btdun_pin.c @@ -0,0 +1,400 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * 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. + */ + +//add includes + + +#include "uts_tel_control_gprs_btdun_pin.h" + +void (*tet_startup)() = startup; +void (*tet_cleanup)() = cleanup; + +extern int expected_event; +extern bool async_response; + +static void startup() +{ + TapiResult_t ret_status; + + ret_status = tel_init(); + + if (ret_status != TAPI_API_SUCCESS) { + printf("TelTapiInit() Failed ret_status = %d \n", ret_status); + } + + register_all_events(); + tel_register_app_name("org.samsung.test"); +} + +static void cleanup() +{ + TapiResult_t ret_status; + + deregister_all(); + ret_status = tel_deinit(); + + if (ret_status != TAPI_API_SUCCESS) { + printf("TelTapiDeInit() Failed ret_status = %d \n", ret_status); + } +} + +/** + * @brief This tests + * @par ID: UTC_TAPI_GPRS_PDP_BTDUNPINCONTROL_GET_00 + * @param [in] pincontrol + * @param [in] pRequestID + * @code + * @endcode + * @param [out] pincontrol + * @param [out] pRequestID + * @return TapiResult_t + */ +void utc_tel_control_gprs_btdun_pin_00() +{ + TEST_DEBUG("######## TEST utc_tel_control_gprs_btdun_pin_00 START ###########"); + + TapiResult_t ret_status; + int request_id = 0; + tapi_ps_btdun_pincontrol bt_control; + async_response = false;//initialize + + memset(&bt_control, 0, sizeof(tapi_ps_btdun_pincontrol)); + + /* NORMAL CASE */ + bt_control.signal = GPRS_DATA_SIGNAL_DTR; + bt_control.status = GPRS_SIGNAL_STATUS_OFF; + + ret_status = tel_control_gprs_btdun_pin(bt_control, &request_id); + + printf("- return value = %d\n", ret_status); + + TET_CHECK_EQUAL(TAPI_API_SUCCESS, ret_status); + tet_infoline("utc_tel_control_gprs_btdun_pin_00 pass"); + expected_event = TAPI_EVENT_PS_BTDUN_PINCONTROL_NOTI; + printf("- The expected_event is TAPI_EVENT_PS_BTDUN_PINCONTROL_NOTI(%d)\n", expected_event); + + G_MAIN_LOOP_RUN(10); + TET_CHECK_TEMP(true, async_response); + tet_result(TET_PASS); + + TEST_DEBUG("######## TEST utc_tel_control_gprs_btdun_pin_00 ENDS ###########\n"); +} + +/** + * @brief This tests + * @par ID: UTC_TAPI_GPRS_PDP_BTDUNPINCONTROL_GET_01 + * @param [in] pincontrol + * @param [in] pRequestID + * @code + * @endcode + * @param [out] pincontrol + * @param [out] pRequestID + * @return TapiResult_t + */ +void utc_tel_control_gprs_btdun_pin_01() +{ + TEST_DEBUG("######## TEST utc_tel_control_gprs_btdun_pin_01 START ###########"); + + TapiResult_t ret_status; + int request_id = 0; + tapi_ps_btdun_pincontrol bt_control; + async_response = false;//initialize + + memset(&bt_control, 0, sizeof(tapi_ps_btdun_pincontrol)); + + /* NORMAL CASE */ + bt_control.signal = GPRS_DATA_SIGNAL_RTS; + bt_control.status = GPRS_SIGNAL_STATUS_ON; + + ret_status = tel_control_gprs_btdun_pin(bt_control, &request_id); + + printf("- return value = %d\n", ret_status); + + TET_CHECK_EQUAL(TAPI_API_SUCCESS, ret_status); + tet_infoline("utc_tel_control_gprs_btdun_pin_01 pass"); + expected_event = TAPI_EVENT_PS_BTDUN_PINCONTROL_NOTI; + printf("- The expected_event is TAPI_EVENT_PS_BTDUN_PINCONTROL_NOTI(%d)\n", expected_event); + + G_MAIN_LOOP_RUN(10); + TET_CHECK_TEMP(true, async_response); + tet_result(TET_PASS); + + TEST_DEBUG("######## TEST utc_tel_control_gprs_btdun_pin_01 ENDS ###########\n"); +} + +/** + * @brief This tests + * @par ID: UTC_TAPI_GPRS_PDP_BTDUNPINCONTROL_GET_02 + * @param [in] pincontrol + * @param [in] pRequestID + * @code + * @endcode + * @param [out] pincontrol + * @param [out] pRequestID + * @return TapiResult_t + */ +void utc_tel_control_gprs_btdun_pin_02() +{ + TEST_DEBUG("######## TEST utc_tel_control_gprs_btdun_pin_02 START ###########"); + + TapiResult_t ret_status; + int request_id = 0; + tapi_ps_btdun_pincontrol bt_control; + async_response = false;//initialize + + memset(&bt_control, 0, sizeof(tapi_ps_btdun_pincontrol)); + + /* BAD CASE - GPRS_DATA_SIGNAL_RI not allowed */ + bt_control.signal = GPRS_DATA_SIGNAL_RI; + bt_control.status = GPRS_SIGNAL_STATUS_ON; + + ret_status = tel_control_gprs_btdun_pin(bt_control, &request_id); + + printf("- return value = %d\n", ret_status); + + TET_CHECK_EQUAL(TAPI_API_SUCCESS, ret_status); + tet_infoline("utc_tel_control_gprs_btdun_pin_02 pass"); + expected_event = TAPI_EVENT_PS_BTDUN_PINCONTROL_NOTI; + printf("- The expected_event is TAPI_EVENT_PS_BTDUN_PINCONTROL_NOTI(%d)\n", expected_event); + + G_MAIN_LOOP_RUN(10); + TET_CHECK_TEMP(false, async_response); + tet_result(TET_PASS); + + TEST_DEBUG("######## TEST utc_tel_control_gprs_btdun_pin_02 ENDS ###########\n"); +} + +/** + * @brief This tests + * @par ID: UTC_TAPI_GPRS_PDP_BTDUNPINCONTROL_GET_03 + * @param [in] pincontrol + * @param [in] pRequestID + * @code + * @endcode + * @param [out] pincontrol + * @param [out] pRequestID + * @return TapiResult_t + */ +void utc_tel_control_gprs_btdun_pin_03() +{ + TEST_DEBUG("######## TEST utc_tel_control_gprs_btdun_pin_03 START ###########"); + + TapiResult_t ret_status; + //int request_id=0; + tapi_ps_btdun_pincontrol bt_control; + async_response = false;//initialize + + memset(&bt_control, 0, sizeof(tapi_ps_btdun_pincontrol)); + + bt_control.signal = GPRS_DATA_SIGNAL_RI; + bt_control.status = GPRS_SIGNAL_STATUS_ON; + + printf("- gprs btdunpincontrol null case check\n"); + + ret_status = tel_control_gprs_btdun_pin(bt_control, NULL); + + printf("- return value = %d\n", ret_status); + + TET_CHECK_EQUAL(TAPI_API_INVALID_PTR, ret_status); + tet_infoline("utc_tel_control_gprs_btdun_pin_03 pass"); + //expected_event = TAPI_EVENT_PS_BTDUN_PINCONTROL_NOTI; + //printf("The expected_event is TAPI_EVENT_PS_BTDUN_PINCONTROL_NOTI(%d)\n",expected_event); + + //G_MAIN_LOOP_RUN(10); + //TET_CHECK_TEMP(true, async_response); + //tet_result(TET_PASS); + + TEST_DEBUG("######## TEST utc_tel_control_gprs_btdun_pin_03 ENDS ###########\n"); +} + +/** + * @brief This tests + * @par ID: UTC_TAPI_GPRS_PDP_BTDUNPINCONTROL_GET_04 + * @param [in] pincontrol + * @param [in] pRequestID + * @code + * @endcode + * @param [out] pincontrol + * @param [out] pRequestID + * @return TapiResult_t + */ +void utc_tel_control_gprs_btdun_pin_04() +{ + TEST_DEBUG("######## TEST utc_tel_control_gprs_btdun_pin_04 START ###########"); + + TapiResult_t ret_status; + int request_id = 0; + tapi_ps_btdun_pincontrol bt_control; + async_response = false;//initialize + + memset(&bt_control, 0, sizeof(tapi_ps_btdun_pincontrol)); + + bt_control.signal = GPRS_SIGNAL_DCD - 1; + bt_control.status = GPRS_SIGNAL_STATUS_ON; + + printf("- gprs btdunpincontrol invalid input case check\n"); + + ret_status = tel_control_gprs_btdun_pin(bt_control, &request_id); + + printf("- return value = %d\n", ret_status); + + TET_CHECK_EQUAL(TAPI_API_INVALID_INPUT, ret_status); + tet_infoline("utc_tel_control_gprs_btdun_pin_04 pass"); + //expected_event = TAPI_EVENT_PS_BTDUN_PINCONTROL_NOTI; + //printf("The expected_event is TAPI_EVENT_PS_BTDUN_PINCONTROL_NOTI(%d)\n",expected_event); + + //G_MAIN_LOOP_RUN(10); + //TET_CHECK_TEMP(true, async_response); + //tet_result(TET_PASS); + + TEST_DEBUG("######## TEST utc_tel_control_gprs_btdun_pin_04 ENDS ###########\n"); +} + +/** + * @brief This tests + * @par ID: UTC_TAPI_GPRS_PDP_BTDUNPINCONTROL_GET_05 + * @param [in] pincontrol + * @param [in] pRequestID + * @code + * @endcode + * @param [out] pincontrol + * @param [out] pRequestID + * @return TapiResult_t + */ +void utc_tel_control_gprs_btdun_pin_05() +{ + + TEST_DEBUG("######## TEST utc_tel_control_gprs_btdun_pin_05 START ###########"); + + TapiResult_t ret_status; + int request_id = 0; + tapi_ps_btdun_pincontrol bt_control; + async_response = false;//initialize + + memset(&bt_control, 0, sizeof(tapi_ps_btdun_pincontrol)); + + bt_control.signal = GPRS_SIGNAL_DCD; + bt_control.status = GPRS_SIGNAL_STATUS_OFF - 1; + + printf("- gprs btdunpincontrol invalid input case check\n"); + + ret_status = tel_control_gprs_btdun_pin(bt_control, &request_id); + + printf("- return value = %d\n", ret_status); + + TET_CHECK_EQUAL(TAPI_API_INVALID_INPUT, ret_status); + tet_infoline("utc_tel_control_gprs_btdun_pin_05 pass"); + //expected_event = TAPI_EVENT_PS_BTDUN_PINCONTROL_NOTI; + //printf("The expected_event is TAPI_EVENT_PS_BTDUN_PINCONTROL_NOTI(%d)\n",expected_event); + + //G_MAIN_LOOP_RUN(10); + //TET_CHECK_TEMP(true, async_response); + //tet_result(TET_PASS); + + TEST_DEBUG("######## TEST utc_tel_control_gprs_btdun_pin_05 ENDS ###########\n"); +} + +/** + * @brief This tests + * @par ID: UTC_TAPI_GPRS_PDP_BTDUNPINCONTROL_GET_06 + * @param [in] pincontrol + * @param [in] pRequestID + * @code + * @endcode + * @param [out] pincontrol + * @param [out] pRequestID + * @return TapiResult_t + */ +void utc_tel_control_gprs_btdun_pin_06() +{ + TEST_DEBUG("######## TEST utc_tel_control_gprs_btdun_pin_06 START ###########"); + + TapiResult_t ret_status; + int request_id = 0; + tapi_ps_btdun_pincontrol bt_control; + async_response = false;//initialize + + memset(&bt_control, 0, sizeof(tapi_ps_btdun_pincontrol)); + + bt_control.signal = GPRS_DATA_SIGNAL_RI + 1; + bt_control.status = GPRS_SIGNAL_STATUS_ON; + + printf("- gprs btdunpincontrol invalid input case check\n"); + + ret_status = tel_control_gprs_btdun_pin(bt_control, &request_id); + + printf("- return value = %d\n", ret_status); + + TET_CHECK_EQUAL(TAPI_API_INVALID_INPUT, ret_status); + tet_infoline("utc_tel_control_gprs_btdun_pin_06 pass"); + //expected_event = TAPI_EVENT_PS_BTDUN_PINCONTROL_NOTI; + //printf("The expected_event is TAPI_EVENT_PS_BTDUN_PINCONTROL_NOTI(%d)\n",expected_event); + + //G_MAIN_LOOP_RUN(10); + //TET_CHECK_TEMP(true, async_response); + //tet_result(TET_PASS); + + TEST_DEBUG("######## TEST utc_tel_control_gprs_btdun_pin_06 ENDS ###########\n"); +} + +/** + * @brief This tests + * @par ID: UTC_TAPI_GPRS_PDP_BTDUNPINCONTROL_GET_07 + * @param [in] pincontrol + * @param [in] pRequestID + * @code + * @endcode + * @param [out] pincontrol + * @param [out] pRequestID + * @return TapiResult_t + */ +void utc_tel_control_gprs_btdun_pin_07() +{ + TEST_DEBUG("######## TEST utc_tel_control_gprs_btdun_pin_07 START ###########"); + + TapiResult_t ret_status; + int request_id = 0; + tapi_ps_btdun_pincontrol bt_control; + async_response = false;//initialize + + memset(&bt_control, 0, sizeof(tapi_ps_btdun_pincontrol)); + + bt_control.signal = 0x03; + bt_control.status = GPRS_SIGNAL_STATUS_ON; + + printf("- gprs btdunpincontrol invalid input case check\n"); + + ret_status = tel_control_gprs_btdun_pin(bt_control, &request_id); + + printf("- return value = %d\n", ret_status); + + TET_CHECK_EQUAL(TAPI_API_INVALID_INPUT, ret_status); + tet_infoline("utc_tel_control_gprs_btdun_pin_07 pass"); + //expected_event = TAPI_EVENT_PS_BTDUN_PINCONTROL_NOTI; + //printf("The expected_event is TAPI_EVENT_PS_BTDUN_PINCONTROL_NOTI(%d)\n",expected_event); + + //G_MAIN_LOOP_RUN(10); + //TET_CHECK_TEMP(true, async_response); + //tet_result(TET_PASS); + + TEST_DEBUG("######## TEST utc_tel_control_gprs_btdun_pin_07 ENDS ###########\n"); +} + +/** @} */ diff --git a/TC/telephony_TC/gprs/unit/uts_tel_control_gprs_btdun_pin.h b/TC/telephony_TC/gprs/unit/uts_tel_control_gprs_btdun_pin.h new file mode 100644 index 0000000..c31dac8 --- /dev/null +++ b/TC/telephony_TC/gprs/unit/uts_tel_control_gprs_btdun_pin.h @@ -0,0 +1,60 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * 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 "gprs_common.h" + +#ifndef _UTC_TAPI_GPRS_PDP_BTDUNPINCONTROL_GET_ +#define _UTC_TAPI_GPRS_PDP_BTDUNPINCONTROL_GET_ + +void utc_tel_control_gprs_btdun_pin_00(); + +void utc_tel_control_gprs_btdun_pin_01(); + +void utc_tel_control_gprs_btdun_pin_02(); + +void utc_tel_control_gprs_btdun_pin_03(); + +void utc_tel_control_gprs_btdun_pin_04(); + +void utc_tel_control_gprs_btdun_pin_05(); + +void utc_tel_control_gprs_btdun_pin_06(); + +void utc_tel_control_gprs_btdun_pin_07(); + +static void startup(); + +static void cleanup(); + +struct tet_testlist tet_testlist[] = { + {utc_tel_control_gprs_btdun_pin_00, 1}, + {utc_tel_control_gprs_btdun_pin_01, 2}, + {utc_tel_control_gprs_btdun_pin_02, 3}, + {utc_tel_control_gprs_btdun_pin_03, 4}, + {utc_tel_control_gprs_btdun_pin_04, 5}, + {utc_tel_control_gprs_btdun_pin_05, 6}, + {utc_tel_control_gprs_btdun_pin_06, 7}, + {utc_tel_control_gprs_btdun_pin_07, 8}, + {NULL, 0} +}; + + + +#endif //_UTC_TAPI_GPRS_PDP_BTDUNPINCONTROL_GET_ diff --git a/TC/telephony_TC/gprs/unit/uts_tel_deactivate_gprs_pdp.c b/TC/telephony_TC/gprs/unit/uts_tel_deactivate_gprs_pdp.c new file mode 100644 index 0000000..f2e4148 --- /dev/null +++ b/TC/telephony_TC/gprs/unit/uts_tel_deactivate_gprs_pdp.c @@ -0,0 +1,320 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * 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. + */ + + + + +//add includes + + +#include "uts_tel_deactivate_gprs_pdp.h" + + + +void (*tet_startup) () = startup; +void (*tet_cleanup) () = cleanup; + +extern int expected_event; +extern bool async_response; + +static void startup() +{ + TLOG_HEADER("STARTUP"); + + TapiResult_t ret_status; + + ret_status = tel_init(); + if (ret_status != TAPI_API_SUCCESS) + { + printf("TelTapiInit() Failed ret_status = %d\n", ret_status); + } + + register_all_events(); + tel_register_app_name("org.samsung.test"); +} + +static void cleanup() +{ + TLOG_HEADER("CLEANUP"); + + TapiResult_t ret_status ; + + deregister_all(); + + ret_status = tel_deinit(); + if (ret_status != TAPI_API_SUCCESS) + { + printf("TelTapiDeInit() Failed ret_status = %d \n", ret_status); + } +} + + +#if 0 +/** + * @brief This tests + * @par ID: UTC_TAPI_GPRS_PDP_DEACTIVATION_SET_00 + * @param [in] *net_stop_req_info + * @param [in] pRequestID + * @code + * @endcode + * @param [out] *net_stop_req_info + * @param [out] pRequestID + * @return TapiResult_t +*/ +void utc_tel_deactivate_gprs_pdp_01() +{ + TLOG_HEADER("TEST START [%s]", __FUNCTION__); + + TapiResult_t ret_status ; + tapi_ps_net_stop_req_t end_req; + int request_id = 0; + + async_response = false;//initialize + + if (TAPI_API_SUCCESS == temp_gprs_session_activate()) + { + TLOG_INFO(" - temp gprs mode started succesfully"); + + memset(&end_req, 0, sizeof(tapi_ps_net_stop_req_t)); + end_req.cont_id = CONTEXT_ID; + + ret_status = tel_deactivate_gprs_pdp(&end_req, &request_id); + if (TAPI_API_SUCCESS == ret_status) + { + TLOG_INFO(" - gprs activate session ended succesfully"); + } + else + { + TLOG_INFO(" - gprs active session not ended"); + } + + TET_CHECK_EQUAL(TAPI_API_SUCCESS, ret_status); + tet_infoline("utc_tel_deactivate_gprs_pdp_00 pass"); + expected_event = TAPI_EVENT_PS_PDP_DEACT_RSP; + + TLOG_INFO(" - The expected_event is TAPI_EVENT_PS_PDP_DEACT_RSP(%d)\n", expected_event); + + G_MAIN_LOOP_RUN(80); + TET_CHECK_TEMP(true, async_response); + tet_result(TET_PASS); + } + else + { + TLOG_INFO(" - temp gprs mode not started"); + } + + TLOG_HEADER("TEST END [%s]\n", __FUNCTION__); +} +#endif + +/** + * @brief This tests + * @par ID: UTC_TAPI_GPRS_PDP_DEACTIVATION_SET_01 + * @param [in] *net_stop_req_info + * @param [in] pRequestID + * @code + * @endcode + * @param [out] *net_stop_req_info + * @param [out] pRequestID + * @return TapiResult_t + */ +void utc_tel_deactivate_gprs_pdp_01() +{ + TLOG_HEADER("TEST START [%s]", __FUNCTION__); + TLOG_INFO(" - temp gprs session end api NULL case"); + + TapiResult_t ret_status; + int request_id = 0; + + async_response = false;//initialize + + ret_status = tel_deactivate_gprs_pdp(NULL, &request_id); + if (TAPI_API_INVALID_PTR == ret_status) + { + printf("/n/****************** gprs end api null case pass **************************\\n"); + } + else + { + printf("/n/****************** gprs end api null case failed **************************\\n"); + } + + + TET_CHECK_EQUAL(TAPI_API_INVALID_PTR, ret_status); + tet_infoline("utc_tel_deactivate_gprs_pdp_01 pass"); + //expected_event = TAPI_EVENT_PS_PDP_DEACT_RSP; + //printf("The expected_event is TAPI_EVENT_PS_PDP_DEACT_RSP(%d)\n",expected_event); + + //G_MAIN_LOOP_RUN(10); + //TET_CHECK_TEMP(true, async_response); + //tet_result(TET_PASS); + + TLOG_HEADER("TEST END [%s]\n", __FUNCTION__); +} + +/** + * @brief This tests + * @par ID: UTC_TAPI_GPRS_PDP_DEACTIVATION_SET_02 + * @param [in] *net_stop_req_info + * @param [in] pRequestID + * @code + * @endcode + * @param [out] *net_stop_req_info + * @param [out] pRequestID + * @return TapiResult_t + */ +void utc_tel_deactivate_gprs_pdp_02() +{ + TLOG_HEADER("TEST START [%s]", __FUNCTION__); + + TapiResult_t ret_status ; + tapi_ps_net_stop_req_t end_req; + + async_response = false;//initialize + + + printf("/n/****************** temp gprs session end api Null case **************************\\n"); + + end_req.cont_id = CONTEXT_ID; + + ret_status = tel_deactivate_gprs_pdp(&end_req, NULL); + if (TAPI_API_INVALID_PTR == ret_status) + { + printf("/n/****************** gprs end api null case pass **************************\\n"); + } + else + { + printf("/n/****************** gprs end api null case failed **************************\\n"); + } + + + TET_CHECK_EQUAL(TAPI_API_INVALID_PTR, ret_status); + tet_infoline("utc_tel_deactivate_gprs_pdp_02 pass"); + //expected_event = TAPI_EVENT_PS_PDP_DEACT_RSP; + //printf("The expected_event is TAPI_EVENT_PS_PDP_DEACT_RSP(%d)\n",expected_event); + + //G_MAIN_LOOP_RUN(10); + //TET_CHECK_TEMP(true, async_response); + //tet_result(TET_PASS); + + TLOG_HEADER("TEST END [%s]\n", __FUNCTION__); +} + +/** + * @brief This tests + * @par ID: UTC_TAPI_GPRS_PDP_DEACTIVATION_SET_04 + * @param [in] *net_stop_req_info + * @param [in] pRequestID + * @code + * @endcode + * @param [out] *net_stop_req_info + * @param [out] pRequestID + * @return TapiResult_t + */ +void utc_tel_deactivate_gprs_pdp_03() +{ + TLOG_HEADER("TEST START [%s]", __FUNCTION__); + + TapiResult_t ret_status ; + tapi_ps_net_stop_req_t end_req; + int request_id=0; + + async_response = false;//initialize + + + printf("/n/****************** temp gprs session end api invalid enum case **************************\\n"); + + end_req.cont_id = CONTEXT_ID; + end_req.pdp_info.auth_type = TAPI_PDP_AUTH_MAX; + + ret_status = tel_deactivate_gprs_pdp(&end_req,&request_id); + if (TAPI_API_INVALID_INPUT == ret_status) + { + printf("/n/****************** gprs end api invalid enum case pass **************************\\n"); + } + else + { + printf("/n/****************** gprs end api invalid enum case failed **************************\\n"); + } + + + TET_CHECK_EQUAL(TAPI_API_INVALID_INPUT, ret_status); + tet_infoline("utc_tel_deactivate_gprs_pdp_04 pass"); + //expected_event = TAPI_EVENT_PS_PDP_DEACT_RSP; + //printf("The expected_event is TAPI_EVENT_PS_PDP_DEACT_RSP(%d)\n",expected_event); + + //G_MAIN_LOOP_RUN(10); + //TET_CHECK_TEMP(true, async_response); + //tet_result(TET_PASS); + + + TLOG_HEADER("TEST END [%s]\n", __FUNCTION__); +} + +/** + * @brief This tests + * @par ID: UTC_TAPI_GPRS_PDP_DEACTIVATION_SET_05 + * @param [in] *net_stop_req_info + * @param [in] pRequestID + * @code + * @endcode + * @param [out] *net_stop_req_info + * @param [out] pRequestID + * @return TapiResult_t + */ +void utc_tel_deactivate_gprs_pdp_04() +{ + TLOG_HEADER("TEST START [%s]", __FUNCTION__); + + TapiResult_t ret_status ; + tapi_ps_net_stop_req_t end_req; + int request_id=0; + + async_response = false;//initialize + + + printf("/n/****************** temp gprs session not started to check api **************************\\n"); + + end_req.cont_id = CONTEXT_ID; + end_req.pdp_info.auth_type = TAPI_PDP_AUTH_NONE-1; + + ret_status = tel_deactivate_gprs_pdp(&end_req, &request_id); + if (TAPI_API_SUCCESS != ret_status) + { + printf("/n/****************** gprs end api invalid server case pass **************************\\n"); + } + else + { + printf("/n/****************** gprs end api invalid server case failed **************************\\n"); + } + + + TET_CHECK_EQUAL(TAPI_API_INVALID_INPUT, ret_status); + tet_infoline("utc_tel_deactivate_gprs_pdp_05 pass"); + //expected_event = TAPI_EVENT_PS_PDP_DEACT_RSP; + //printf("The expected_event is TAPI_EVENT_PS_PDP_DEACT_RSP(%d)\n",expected_event); + + //G_MAIN_LOOP_RUN(10); + //TET_CHECK_TEMP(true, async_response); + //tet_result(TET_PASS); + + + TLOG_HEADER("TEST END [%s]\n", __FUNCTION__); +} +/** @} */ diff --git a/TC/telephony_TC/gprs/unit/uts_tel_deactivate_gprs_pdp.h b/TC/telephony_TC/gprs/unit/uts_tel_deactivate_gprs_pdp.h new file mode 100644 index 0000000..c4119e0 --- /dev/null +++ b/TC/telephony_TC/gprs/unit/uts_tel_deactivate_gprs_pdp.h @@ -0,0 +1,42 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * 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 "gprs_common.h" + +#ifndef _UTC_TAPI_GPRS_PDP_DEACTIVATION_SET_ +#define _UTC_TAPI_GPRS_PDP_DEACTIVATION_SET_ + +void utc_tel_deactivate_gprs_pdp_01(); +void utc_tel_deactivate_gprs_pdp_02(); +void utc_tel_deactivate_gprs_pdp_03(); +void utc_tel_deactivate_gprs_pdp_04(); + +static void startup(); +static void cleanup(); + +struct tet_testlist tet_testlist[] = { + {utc_tel_deactivate_gprs_pdp_01, 1}, + {utc_tel_deactivate_gprs_pdp_02, 2}, + {utc_tel_deactivate_gprs_pdp_03, 3}, + {utc_tel_deactivate_gprs_pdp_04, 4}, + {NULL, 0} + }; + +#endif //_UTC_TAPI_GPRS_PDP_DEACTIVATION_SET_ diff --git a/TC/telephony_TC/misc/unit/async_util.c b/TC/telephony_TC/misc/unit/async_util.c new file mode 100644 index 0000000..2e2c519 --- /dev/null +++ b/TC/telephony_TC/misc/unit/async_util.c @@ -0,0 +1,55 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * 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 "misc_callback_util.h" +#include "async_util.h" + +static void G_MAIN_TIMER_HANDLER(int sgi); + +// Global variable for G_MAIN system +static int gEventHandle=0; +static GMainLoop * context_loop = NULL; +static EvtAlarmCb gpAlarm_Handler = NULL; +static unsigned int gSubscription_id; + +void G_MAIN_LOOP_CLOSE() +{ + g_main_loop_quit(context_loop); +} + +void G_MAIN_TIMER_HANDLER(int sgi) +{ + if (gpAlarm_Handler) + gpAlarm_Handler(sgi); + else + { + fprintf(stderr, "SIGALRM received. But user handler not registered. Close g_main_loop()"); + G_MAIN_LOOP_CLOSE(); + } +} + +void G_MAIN_LOOP_RUN(int sec) +{ + (void) signal(SIGALRM, G_MAIN_TIMER_HANDLER); + alarm(sec); + context_loop = g_main_loop_new(NULL, FALSE); + g_main_loop_run(context_loop); + alarm(0); +} diff --git a/TC/telephony_TC/misc/unit/async_util.h b/TC/telephony_TC/misc/unit/async_util.h new file mode 100644 index 0000000..7927b72 --- /dev/null +++ b/TC/telephony_TC/misc/unit/async_util.h @@ -0,0 +1,34 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * 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 _ASYNC_UTIL_H_ +#define _ASYNC_UTIL_H_ + +#include "TapiEvent.h" + + +typedef void (*EvtAlarmCb) (int sgi); +TS_BOOL gAsyncResult; + +void G_MAIN_LOOP_RUN(int sec); +void G_MAIN_LOOP_CLOSE(); + +#endif //_ASYNC_UTIL_H_ diff --git a/TC/telephony_TC/misc/unit/makefile b/TC/telephony_TC/misc/unit/makefile new file mode 100644 index 0000000..09e4d66 --- /dev/null +++ b/TC/telephony_TC/misc/unit/makefile @@ -0,0 +1,42 @@ +CC=gcc -Wall + +TS1 = uts_tapi_misc_NAM_info_get +TS2 = uts_tapi_misc_NAM_info_set +TS3 = uts_tapi_misc_me_serial_num_get +TS4 = uts_tapi_misc_timezone_getinfo +TS5 = uts_tapi_misc_timezone_setinfo + +LIBS = `pkg-config --libs glib-2.0 gconf-2.0 dbus-1 dbus-glib-1 gthread-2.0 tapi` +LIBS +=$(TET_ROOT)/lib/tet3/tcm.o +LIBS +=-L$(TET_ROOT)/lib/tet3 -lapi + +INCS = -I. `pkg-config --cflags glib-2.0 gconf-2.0 dbus-1 dbus-glib-1 gthread-2.0 tapi` +INCS += -I$(TET_ROOT)/inc/tet3 + +CFLAGS += $(INCS) -D__arm__ -D_ARM_TOUCH -DTELEPHONY_TIMER +CC +=$(CFLAGS) +LDFLAGS = $(LIBS) + +#ifeq ($(ARCH),target) +#CC += -g -mabi=aapcs-linux +#endif + +all : $(TS1) $(TS2) $(TS3) $(TS4) $(TS5) + +clean : + rm -rf *~ *.o tet_lock tet_captured $(TS1) $(TS2) $(TS3) $(TS4) $(TS5) + +$(TS1): $(TS1).c + $(CC) -o $(TS1) $(TS1).c misc_callback_util.c $(LDFLAGS) +$(TS2): $(TS2).c + $(CC) -o $(TS2) $(TS2).c misc_callback_util.c $(LDFLAGS) + +$(TS3): $(TS3).c + $(CC) -o $(TS3) $(TS3).c misc_callback_util.c $(LDFLAGS) + +$(TS4): $(TS4).c + $(CC) -o $(TS4) $(TS4).c misc_callback_util.c $(LDFLAGS) + +$(TS5): $(TS5).c + $(CC) -o $(TS5) $(TS5).c misc_callback_util.c $(LDFLAGS) + diff --git a/TC/telephony_TC/misc/unit/misc_callback_util.c b/TC/telephony_TC/misc/unit/misc_callback_util.c new file mode 100644 index 0000000..c9231ca --- /dev/null +++ b/TC/telephony_TC/misc/unit/misc_callback_util.c @@ -0,0 +1,141 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * 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 "misc_callback_util.h" + + +static unsigned int subscription_id[6]={0,0,0,0,0,0}; + +/** +* @file misc_callback_util.c +* @brief This is the implementation file for misc callback utility APIs +* @version [09-03-04] Initial Creation V0.1 +*/ + + +GMainLoop *main_loop = NULL; + +void misc_Callback (TelTapiEvent_t * TapiEvent) +{ + + int eventClass; + int eventType; + int requestId; + int status; + void *EventData = NULL; + + eventClass = TapiEvent->EventClass; + eventType = TapiEvent->EventType; + requestId = TapiEvent->RequestId; + status = TapiEvent->Status; + EventData = TapiEvent->pData; + + printf("\nClass:[%d], Event Type:[%d], RequestId:[%d], Status:[%d] \n", eventClass, eventType , requestId, status ); + + if( EventData==NULL) + { + printf("\n****** EventData is NULL......... ******\n"); + } + + switch(eventClass) + { + case TAPI_EVENT_CLASS_MISC: + switch(eventType) + { + case TAPI_EVENT_MISC_NITZ_GETCNF : + printf("*** TAPI_EVENT_MISC_NITZ_GETCNF received : %x ****\n", eventType); + break; + + case TAPI_EVENT_MISC_NITZ_NOTIFY : + printf("*** TAPI_EVENT_MISC_NITZ_NOTIFY received : %x ****\n", eventType); + break; + + case TAPI_EVENT_MISC_NITZ_IND : + printf("*** TAPI_EVENT_MISC_NITZ_IND received : %x ****\n", eventType); + break; + + default: + printf("*** MISC Default Event %x ****\n", eventType); + break; + + } + + break; + + default: + printf("*** Other TAPI EVENT received : class : %x ****\n", eventClass); + break; + } + +} + + +gboolean +TimeOutFun (void *data) +{ + g_main_loop_quit (main_loop); + printf ("Exit from this callback\n"); + return FALSE; +} + +int gmain_loop_for_tapi_events(int delay) +{ + main_loop = g_main_loop_new (NULL, FALSE); + g_timeout_add (delay, TimeOutFun, NULL); + g_main_loop_run (main_loop); + + return 0; +} + +void print_all_subsciption_ids() +{ + int i=0; + for(i=0;i<3;i++) + { + printf("\n subscription_id[%d] has value %d \n",i,subscription_id[i]); + } +} + +TapiResult_t register_all_events() +{ + TapiResult_t api_err = TAPI_API_SUCCESS; + + api_err = tel_register_event(TAPI_EVENT_MISC_NITZ_GETCNF, &subscription_id[0], (TelAppCallback)misc_Callback, NULL); + api_err = tel_register_event(TAPI_EVENT_MISC_NITZ_NOTIFY, &subscription_id[1], (TelAppCallback)misc_Callback, NULL); + api_err = tel_register_event(TAPI_EVENT_MISC_NITZ_IND, &subscription_id[2], (TelAppCallback)misc_Callback, NULL); + print_all_subsciption_ids(); + return 0; +} + + + TapiResult_t deregister_all() +{ + tel_deregister_event(subscription_id[0]); + tel_deregister_event(subscription_id[1]); + tel_deregister_event(subscription_id[2]); + return 0; +} + + + + + + + diff --git a/TC/telephony_TC/misc/unit/misc_callback_util.h b/TC/telephony_TC/misc/unit/misc_callback_util.h new file mode 100644 index 0000000..bf6a6b4 --- /dev/null +++ b/TC/telephony_TC/misc/unit/misc_callback_util.h @@ -0,0 +1,56 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * 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 _MISC_CALLBACK_UTIL_H_ +#define _MISC_CALLBACK_UTIL_H_ + +#include +#include +#include +#include "string.h" +#include "assert.h" +#include +#include +#include +#include +#include +#include +#include + +#include +#include "tet_api.h" +#include "tet_macro.h" +#include +#include +#include +#include +#include "async_util.h" + +extern void misc_Callback (TelTapiEvent_t * TapiEvent); +extern TapiResult_t register_all_events(); +extern TapiResult_t deregister_all(); +void print_all_subsciption_ids(); +void misc_Callback(TelTapiEvent_t *TapiEvent); + +extern int gmain_loop_for_tapi_events(int delay); +extern gboolean TimeOutFun (void *data); + +#endif //_MISC_CALLBACK_UTIL_H_ diff --git a/TC/telephony_TC/misc/unit/tet_macro.h b/TC/telephony_TC/misc/unit/tet_macro.h new file mode 100644 index 0000000..89744c0 --- /dev/null +++ b/TC/telephony_TC/misc/unit/tet_macro.h @@ -0,0 +1,33 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * 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 TET_MACRO_H +#define TET_MACRO_H + +#define TET_CHECK(x) if(x) tet_result(TET_PASS); else tet_result(TET_FAIL) +#define TET_CHECK_EQUAL(x,y) if ((x)==(y)) tet_result(TET_PASS); else tet_result(TET_FAIL) +#define TET_CHECK_NOT_EQUAL(x,y) if ((x)!=(y)) tet_result(TET_PASS); else tet_result(TET_FAIL) + +#define TET_CHECK_MESSAGE(x,y) if ((y)==(TRUE)) tet_result(TET_PASS); else {tet_result(TET_FAIL); tet_printf(x);} +#define TET_CHECK_EQUAL_MESSAGE(x,y,z) if ((y)==(z)) tet_result(TET_PASS); else {tet_result(TET_FAIL); tet_printf(x);} +#define TET_CHECK_NOT_EQUAL_MESSAGE(x,y,z) if ((y)!=(z)) tet_result(TET_PASS); else {tet_result(TET_FAIL); tet_printf(x);} + +#endif + diff --git a/TC/telephony_TC/misc/unit/tslist b/TC/telephony_TC/misc/unit/tslist new file mode 100644 index 0000000..2c10bec --- /dev/null +++ b/TC/telephony_TC/misc/unit/tslist @@ -0,0 +1,5 @@ +/misc/unit/uts_tapi_misc_NAM_info_set +/misc/unit/uts_tapi_misc_NAM_info_get +/misc/unit/uts_tapi_misc_me_serial_num_get +/misc/unit/uts_tapi_misc_timezone_getinfo + diff --git a/TC/telephony_TC/misc/unit/uts_tapi_misc_NAM_info_get.c b/TC/telephony_TC/misc/unit/uts_tapi_misc_NAM_info_get.c new file mode 100644 index 0000000..31d6b0d --- /dev/null +++ b/TC/telephony_TC/misc/unit/uts_tapi_misc_NAM_info_get.c @@ -0,0 +1,159 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * 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 "uts_tapi_misc_NAM_info_get.h" + +static void startup(); +static void cleanup(); + +void (*tet_startup)() = startup; +void (*tet_cleanup)() = cleanup; + +static TapiResult_t gStartupSuccess; + +static void startup() { + gStartupSuccess = tel_init(); + if (gStartupSuccess != TAPI_API_SUCCESS) { + printf("TelTapiInit() Failed gStartupSuccess = %d \n", gStartupSuccess); + } + register_all_events(); +} + +static void cleanup() { + if (gStartupSuccess == TAPI_API_SUCCESS) { + // G_MAIN_CLOSE(); + } + deregister_all(); + tel_deinit(); + return; +} + +/** + * @brief This tests + * @par ID: + * @param [in] timezone_valid + * @code + * @endcode + * @param [out] timezone_valid + * @return TapiResult_t + */ + +void utc_tapi_misc_NAM_info_get_001() { + + TapiResult_t returnStatus; + TS_WORD nam_info_mask = 0x0008;// Auto NAM + TelMiscNamIndex_t nam_index = TAPI_MISC_NAM_1; + int case_result = 1; + + gmain_loop_for_tapi_events(10000); + returnStatus = tel_get_misc_nam_info(nam_info_mask, nam_index); + // G_MAIN_LOOP_RUN(5); + gmain_loop_for_tapi_events(10000); + + printf("The return value is %d\n", returnStatus); + + TET_CHECK(returnStatus == TAPI_API_SUCCESS) + ; + + if (returnStatus == TAPI_API_SUCCESS) + printf("utc_tapi_misc_NAM_info_get_001 request successful\n"); + else + case_result = 0; + + //expected_event = TAPI_EVENT_MISC_GET_NAM_INFO_CNF; + gmain_loop_for_tapi_events(100); + + if (case_result) + tet_result(TET_PASS); + + printf("\n\n\n\n\n######## TEST utc_tapi_misc_NAM_info_get_001 ENDS ###########\n"); +} + +/** + * @brief This tests + * @par ID: + * @param [in] timezone_valid + * @code + * @endcode + * @param [out] timezone_valid + * @return TapiResult_t + */ + +void utc_tapi_misc_NAM_info_get_002() { + + TapiResult_t returnStatus; + TS_WORD nam_info_mask = -1; + TelMiscNamIndex_t nam_index = TAPI_MISC_NAM_1; + int case_result = 1; + + gmain_loop_for_tapi_events(5000); + returnStatus = tel_get_misc_nam_info(NULL, nam_index); + // G_MAIN_LOOP_RUN(5); + gmain_loop_for_tapi_events(5000); + + printf("The return value is %d\n", returnStatus); + //printf ("The pRequestId value is %d\n",flag); + + if (returnStatus == TAPI_API_SUCCESS) { + tet_result(TET_FAIL); + tet_printf("utc_tapi_misc_Nam_info_get_002 failed\n"); + } + tet_result(TET_PASS); + + printf("\n\n\n\n\n######## TEST utc_tapi_misc_NAM_info_get_002 ENDS ###########\n"); +} + +/** + * @brief This tests + * @par ID: + * @param [in] timezone_valid + * @code + * @endcode + * @param [out] timezone_valid + * @return TapiResult_t + */ + +void utc_tapi_misc_NAM_info_get_003() { + + TapiResult_t returnStatus; + TS_WORD nam_info_mask = 0x0008;// Auto NAM + int nam_index = -1; + int case_result = 1; + + gmain_loop_for_tapi_events(5000); + returnStatus = tel_get_misc_nam_info(nam_info_mask, nam_index); + // G_MAIN_LOOP_RUN(5); + gmain_loop_for_tapi_events(5000); + + printf("The return value is %d\n", returnStatus); + TET_CHECK(returnStatus == TAPI_API_INVALID_INPUT) + ; + + if (returnStatus == TAPI_API_INVALID_INPUT) + printf("utc_tapi_misc_NAM_info_get_003 request successful\n"); + else + case_result = 0; + + if (case_result) + tet_result(TET_PASS); + + printf("\n\n\n\n\n######## TEST utc_tapi_misc_NAM_info_get_003 ENDS ###########\n"); +} +/** @} */ diff --git a/TC/telephony_TC/misc/unit/uts_tapi_misc_NAM_info_get.h b/TC/telephony_TC/misc/unit/uts_tapi_misc_NAM_info_get.h new file mode 100644 index 0000000..e159e42 --- /dev/null +++ b/TC/telephony_TC/misc/unit/uts_tapi_misc_NAM_info_get.h @@ -0,0 +1,40 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * 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 "misc_callback_util.h" + +#ifndef _UTC_TAPI_MISC_NAM_INFO_GET_ +#define _UTC_TAPI_MISC_NAM_INFO_GET_ + + +void utc_tapi_misc_NAM_info_get_001(); +void utc_tapi_misc_NAM_info_get_002(); +void utc_tapi_misc_NAM_info_get_003(); + +struct tet_testlist tet_testlist[] = { + {utc_tapi_misc_NAM_info_get_001, 1}, + {utc_tapi_misc_NAM_info_get_002, 2}, + {utc_tapi_misc_NAM_info_get_003, 2}, + {NULL, 0} +}; + + + +#endif //_UTC_TAPI_MISC_NAM_INFO_GET_ diff --git a/TC/telephony_TC/misc/unit/uts_tapi_misc_NAM_info_set.c b/TC/telephony_TC/misc/unit/uts_tapi_misc_NAM_info_set.c new file mode 100644 index 0000000..b8c65e7 --- /dev/null +++ b/TC/telephony_TC/misc/unit/uts_tapi_misc_NAM_info_set.c @@ -0,0 +1,117 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * 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 "uts_tapi_misc_NAM_info_set.h" + +static void startup(); +static void cleanup(); + +void (*tet_startup)() = startup; +void (*tet_cleanup)() = cleanup; + +static TapiResult_t gStartupSuccess; + +/* Startup & Clean function : It is not test code, only for + initialize and finalize test module */ + +static void startup() { + gStartupSuccess = tel_init(); + if (gStartupSuccess != TAPI_API_SUCCESS) { + printf("TelTapiInit() Failed gStartupSuccess = %d \n", gStartupSuccess); + } + register_all_events(); +} + +static void cleanup() { + if (gStartupSuccess == TAPI_API_SUCCESS) { + // G_MAIN_CLOSE(); + } + deregister_all(); + tel_deinit(); + return; +} + +/** + * @brief This tests + * @par ID: + * @param [in] *timezone_info + * @code + * @endcode + * @param [out] *timezone_info + * @return TapiResult_t + */ + +void utc_tapi_misc_NAM_info_set_001() { + TapiResult_t returnStatus = TAPI_API_SUCCESS; + TelMiscNamInfo_t *nam_info = { 0, }; + /* + nam_info->nam_info_mask = ; + nam_info->nam_total = ; + nam_info->nam_current_index = ; + nam_info->nam_req_index = ; + nam_info->nam_auto = ; + memcpy (,&nam_info->nam_mcc,TAPI_MISC_MCC_LEN_MAX); + memcpy (,&nam_info->nam_mnc,TAPI_MISC_MCC_LEN_MAX); + memcpy (,&nam_info->nam_min,TAPI_MISC_MIN_LEN_MAX); + memcpy (,&nam_info->nam_mdn,TAPI_MISC_MDN_LEN_MAX); + memcpy (,&nam_info->nam_name,TAPI_MISC_NAME_LEN_MAX); + */ + gmain_loop_for_tapi_events(10000); + returnStatus = tel_set_misc_nam_info(&nam_info); + + //G_MAIN_LOOP_RUN(5); + gmain_loop_for_tapi_events(10000); + printf("The return value is %d\n", returnStatus); + + TET_CHECK(returnStatus == TAPI_API_SUCCESS) + ; + + if (returnStatus == TAPI_API_SUCCESS) + printf("utc_tapi_misc_NAM_info_set_001 pass\n"); + +} + +/** + * @brief This tests + * @par ID: + * @param [in] *timezone_info + * @code + * @endcode + * @param [out] *timezone_info + * @return TapiResult_t + */ +void utc_tapi_misc_NAM_info_set_002() { + + TapiResult_t returnStatus = TAPI_API_SUCCESS; + TelMiscNamInfo_t *nam_info = { 0, }; + + gmain_loop_for_tapi_events(10000); + returnStatus = tel_set_misc_nam_info(NULL); + //G_MAIN_LOOP_RUN(5); + gmain_loop_for_tapi_events(10000); + printf("The return value is %d\n", returnStatus); + + TET_CHECK(returnStatus == TAPI_API_INVALID_PTR) + ; + if (returnStatus == TAPI_API_INVALID_PTR) + printf("utc_tapi_misc_NAM_info_set_002 pass\n"); + +} +/** @} */ diff --git a/TC/telephony_TC/misc/unit/uts_tapi_misc_NAM_info_set.h b/TC/telephony_TC/misc/unit/uts_tapi_misc_NAM_info_set.h new file mode 100644 index 0000000..2800f3f --- /dev/null +++ b/TC/telephony_TC/misc/unit/uts_tapi_misc_NAM_info_set.h @@ -0,0 +1,44 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * 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. + */ + +/** +* @file +* @brief This is a suite of unit test cases to test Telephony misc API function +* @author Sagar Aggarwal (a.sagar@samsung.com) +* @version Initial Creation +* @date 2009.03.04 +*/ + +#include "misc_callback_util.h" + +#ifndef _UTC_TAPI_MISC_NAM_INFO_SET_ +#define _UTC_TAPI_MISC_NAM_INFO_SET_ + +void utc_tapi_misc_NAM_info_set_001(); +void utc_tapi_misc_NAM_info_set_002(); + + +struct tet_testlist tet_testlist[] = { + {utc_tapi_misc_NAM_info_set_001, 1}, + {utc_tapi_misc_NAM_info_set_002, 2}, + {NULL, 0} +}; + +#endif // _UTC_TAPI_MISC_NAM_INFO_SET_ diff --git a/TC/telephony_TC/misc/unit/uts_tapi_misc_me_serial_num_get.c b/TC/telephony_TC/misc/unit/uts_tapi_misc_me_serial_num_get.c new file mode 100644 index 0000000..888baad --- /dev/null +++ b/TC/telephony_TC/misc/unit/uts_tapi_misc_me_serial_num_get.c @@ -0,0 +1,84 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * 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. + */ + +void utc_tapi_misc_me_serial_num_get_001() { + + int returnStatus; + TelMiscSNIndexType_t index_type = TAPI_MISC_ME_MEID; + TelMiscSNInformation sn_info; + int case_result = 1; + + gmain_loop_for_tapi_events(10000); + returnStatus = tel_get_misc_me_sn(index_type, &sn_info); + // G_MAIN_LOOP_RUN(5); + gmain_loop_for_tapi_events(10000); + + printf("The return value is %d\n", returnStatus); + + TET_CHECK(returnStatus == TAPI_API_SUCCESS); + + if (returnStatus == TAPI_API_SUCCESS) + printf("utc_tapi_misc_me_serial_num_get_001 request successful\n"); + else + case_result = 0; + + expected_event = TAPI_EVENT_MISC_SERIAL_NUMBER_IND; + gmain_loop_for_tapi_events(10000); + + if (case_result) + tet_result(TET_PASS); + + printf("\n\n\n\n\n######## TEST utc_tapi_misc_me_serial_num_get_001 ENDS ###########\n"); +} + +/** + * @brief This tests + * @par ID: + * @param [in] timezone_valid + * @code + * @endcode + * @param [out] timezone_valid + * @return int + */ + +void utc_tapi_misc_me_serial_num_get_002() { + + int returnStatus; + int index_type = -1; + int case_result = 1; + TelMiscSNInformation sn_info; + + gmain_loop_for_tapi_events(5000); + returnStatus = tel_get_misc_me_sn(index_type, &sn_info); + // G_MAIN_LOOP_RUN(5); + gmain_loop_for_tapi_events(5000); + + printf("The return value is %d\n", returnStatus); + + if (returnStatus == TAPI_API_SUCCESS) { + tet_result(TET_FAIL); + printf("\nTEST utc_tapi_misc_me_serial_num_get_002 Failed \n"); + } + + tet_result(TET_PASS); + + printf("\n\n\n\n\n######## TEST utc_tapi_misc_me_serial_num_get_002 ENDS ###########\n"); +} +/** @} */ diff --git a/TC/telephony_TC/misc/unit/uts_tapi_misc_me_serial_num_get.h b/TC/telephony_TC/misc/unit/uts_tapi_misc_me_serial_num_get.h new file mode 100644 index 0000000..565187b --- /dev/null +++ b/TC/telephony_TC/misc/unit/uts_tapi_misc_me_serial_num_get.h @@ -0,0 +1,38 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * 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 "misc_callback_util.h" + +#ifndef _UTC_TAPI_MISC_ME_SERIAL_NUM_GET_ +#define _UTC_TAPI_MISC_ME_SERIAL_NUM_GET_ + + +void utc_tapi_misc_me_serial_num_get_001(); +void utc_tapi_misc_me_serial_num_get_002(); + +struct tet_testlist tet_testlist[] = { + {utc_tapi_misc_me_serial_num_get_001, 1}, + {utc_tapi_misc_me_serial_num_get_002, 2}, + {NULL, 0} +}; + + + +#endif //_UTC_TAPI_MISC_ME_SERIAL_NUM_GET_ diff --git a/TC/telephony_TC/misc/unit/uts_tapi_misc_timezone_getinfo.c b/TC/telephony_TC/misc/unit/uts_tapi_misc_timezone_getinfo.c new file mode 100644 index 0000000..432beed --- /dev/null +++ b/TC/telephony_TC/misc/unit/uts_tapi_misc_timezone_getinfo.c @@ -0,0 +1,105 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * 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 "uts_tapi_misc_timezone_getinfo.h" + + +static void startup(); +static void cleanup(); +void (*tet_startup) () = startup; +void (*tet_cleanup) () = cleanup; + +struct tet_testlist tet_testlist[] = { + {utc_tapi_misc_timezone_getinfo_001, 1}, + {NULL, 0} +}; + + +static int gStartupSuccess; + +void alarm_received(int sgi) +{ + gAsyncResult = FALSE; + printf("Signal [SIGALARM] Received. Close g_main_loop()"); +// G_MAIN_LOOP_CLOSE(); +} + + +/* Startup & Clean function : It is not test code, only for + initialize and finalize test module */ + +static void startup() +{ + gStartupSuccess = tel_init(); + if(gStartupSuccess != TAPI_API_SUCCESS) + { + printf("tel_init() Failed gStartupSuccess = %d \n",gStartupSuccess); + } + + register_all_events(); + +} + +static void cleanup() +{ + if (gStartupSuccess == TAPI_API_SUCCESS) + { + // G_MAIN_CLOSE(); + } + deregister_all(); + tel_deinit(); + return; + +} + + + + +/** + * @brief This tests + * @par ID: + * UTC_TAPI_MISC_TIMEZONE_GETINFO_001 + * @param [in] *timezone_info + * @code + * @endcode + * @param [out] *timezone_info + * @return int +*/ + + +void utc_tapi_misc_timezone_getinfo_001() +{ + + int returnStatus = TAPI_API_SUCCESS; + gmain_loop_for_tapi_events(5000); + returnStatus = tel_get_misc_timezone_info(); + gmain_loop_for_tapi_events(5000); + + printf ("The return value is %d\n", returnStatus); + + TET_CHECK(returnStatus == TAPI_API_SUCCESS); + if(returnStatus == TAPI_API_SUCCESS) + printf("utc_tapi_misc_timezone_getinfo_001 pass\n"); + + +} + + +/** @} */ diff --git a/TC/telephony_TC/misc/unit/uts_tapi_misc_timezone_getinfo.h b/TC/telephony_TC/misc/unit/uts_tapi_misc_timezone_getinfo.h new file mode 100644 index 0000000..7f3be9f --- /dev/null +++ b/TC/telephony_TC/misc/unit/uts_tapi_misc_timezone_getinfo.h @@ -0,0 +1,29 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * 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 _UTC_TAPI_MISC_TIMEZONE_GETINFO_ +#define _UTC_TAPI_MISC_TIMEZONE_GETINFO_ + +#include "misc_callback_util.h" + +void utc_tapi_misc_timezone_getinfo_001(); + +#endif // _UTC_TAPI_MISC_TIMEZONE_GETINFO_ diff --git a/TC/telephony_TC/misc/unit/uts_tapi_misc_timezone_setinfo.c b/TC/telephony_TC/misc/unit/uts_tapi_misc_timezone_setinfo.c new file mode 100644 index 0000000..fdab033 --- /dev/null +++ b/TC/telephony_TC/misc/unit/uts_tapi_misc_timezone_setinfo.c @@ -0,0 +1,138 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * 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 "uts_tapi_misc_timezone_setinfo.h" + + +static void startup(); +static void cleanup(); +void (*tet_startup) () = startup; +void (*tet_cleanup) () = cleanup; + +struct tet_testlist tet_testlist[] = { + {utc_tapi_misc_timezone_setinfo_001, 1}, + {utc_tapi_misc_timezone_setinfo_002, 2}, + {NULL, 0} +}; + + +static TapiResult_t gStartupSuccess; + +void alarm_received(int sgi) +{ + gAsyncResult = FALSE; + printf("Signal [SIGALARM] Received. Close g_main_loop()"); +// G_MAIN_LOOP_CLOSE(); +} + + +/* Startup & Clean function : It is not test code, only for + initialize and finalize test module */ + +static void startup() +{ + + gStartupSuccess = TelTapiInit(); + if(gStartupSuccess != TAPI_API_SUCCESS) + { + printf("TelTapiInit() Failed gStartupSuccess = %d \n",gStartupSuccess); + } + register_all_events(); + +} + +static void cleanup() +{ + if (gStartupSuccess == TAPI_API_SUCCESS) + { + // G_MAIN_CLOSE(); + } + deregister_all(); + TelTapiDeInit(); + return; + +} + + + + +/** + * @brief This tests + * @par ID: + * UTC_TAPI_MISC_TIMEZONE_SETINFO_001 + * @param [in] *timezone_info + * @code + * @endcode + * @param [out] *timezone_info + * @return TapiResult_t +*/ + + +void utc_tapi_misc_timezone_setinfo_001() +{ + + TapiResult_t returnStatus = TAPI_API_SUCCESS; + tapi_misc_time_zone_info_type timezone_info = {0,}; + timezone_info.daylight_valid=1; + timezone_info.year=10; + timezone_info.month=1; + timezone_info.day=1; + timezone_info.hour=1; + timezone_info.minute=1; + timezone_info.second=1; + timezone_info.time_zone=36; + timezone_info.time_zone_valid=TAPI_MISC_NITZ_RTC_BKUP_PHONE; + timezone_info.daylight_adjust=TAPI_MISC_NITZ_NOADJUST; + timezone_info.day_of_week =TAPI_MISC_NITZ_DOW_FRI; + + gmain_loop_for_tapi_events(5000); + returnStatus = tapi_misc_timezone_setinfo(&timezone_info); + gmain_loop_for_tapi_events(5000); + + printf ("The return value is %d\n", returnStatus); + + TET_CHECK(returnStatus == TAPI_API_SUCCESS); + if(returnStatus == TAPI_API_SUCCESS) + printf("utc_tapi_misc_timezone_setinfo_001 pass\n"); + + +} + + + +void utc_tapi_misc_timezone_setinfo_002() +{ + + TapiResult_t returnStatus = 1; + TelTapiDeInit(); + gmain_loop_for_tapi_events(5000); + //De-initializing Tapi for invalid test case + returnStatus = tapi_misc_timezone_setinfo(NULL); + gmain_loop_for_tapi_events(5000); + + printf ("The return value is %d\n", returnStatus); + if(returnStatus == TAPI_API_SUCCESS) + { + tet_result(TET_FAIL); + } + tet_result(TET_PASS); +} + +/** @} */ diff --git a/TC/telephony_TC/misc/unit/uts_tapi_misc_timezone_setinfo.h b/TC/telephony_TC/misc/unit/uts_tapi_misc_timezone_setinfo.h new file mode 100644 index 0000000..c69e210 --- /dev/null +++ b/TC/telephony_TC/misc/unit/uts_tapi_misc_timezone_setinfo.h @@ -0,0 +1,29 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * 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 "misc_callback_util.h" + +#ifndef _UTC_TAPI_MISC_TIMEZONE_SETINFO_ +#define _UTC_TAPI_MISC_TIMEZONE_SETINFO_ + +void utc_tapi_misc_timezone_setinfo_001(); +void utc_tapi_misc_timezone_setinfo_002(); + +#endif // _UTC_TAPI_MISC_TIMEZONE_SETINFO_ diff --git a/TC/telephony_TC/network/README b/TC/telephony_TC/network/README new file mode 100644 index 0000000..803feff --- /dev/null +++ b/TC/telephony_TC/network/README @@ -0,0 +1,91 @@ +================================================================================= +* README * +================================================================================= + +1. The Telephony Network Test Script directory (TestCases) includes: + + Telephony-framework/network/ + |-- README ; This file + `-- Unit ; contains Unit TCs + |-- makefile + |-- tslist + `-- Unit test case source codes + 2 directories, 58 files + + +2. The $(TEST_ROOT) directory must includes following files: + + /$(TEST_ROOT) + |-- _export_tet_host.sh + |-- _export_tet_target.sh + |-- build-target.sh + |-- exec-target.sh + |-- tet_code + |-- tet_scen + |-- tetbuild.cfg + |-- tetclean.cfg + |-- tetexec.cfg + |-- telephony-framework + `-- ...(elipsis) + +================================================================================= +* Preconditions * +--------------------------------------------------------------------------------- +| Before Testing Email Module, you should check the following conditions | +================================================================================= + +1. Prepare a vaild SIM card that supports GPRS. + + + +================================================================================= +* Build * +================================================================================= + 1) Place the Email Test Case package (TestCases) under $(TEST_ROOT)/telephony-framework. + + 2) Host computer must have two type of TETware . + . A TETware built with 'arm-linux-gcc' for target testing + . A TETware built with 'gcc' for simulator testing + + 3) Change directory to $(TEST_ROOT) folder. + + 4) Modify the environment variable settings in "_export_tet_host.sh" file. + # TET_INSTALL_DIR=/home/share/tet3.7a ; specify your TETware path + # TET_TAR_PATH=/tetware-target + # TET_SIMULATOR_PATH=/tetware-simulator + + 5) Make sure that all the header files, libraries and binaries are stored under LD_LIBRARY_PATH and PKG_CONFIG_PATH. + + + 6) Build. + # ./build-tar-host + +================================================================================= +* Execute * +================================================================================= + 1) Mount NFS shares. + + 2) Change directory to $(TEST_ROOT) folder. + + 3) EModify the environment variable settings in "_export_tet_target.sh" file. + # TET_INSTALL_DIR=/mnt/nfs/tet3.7a ; specify your TETware path + # TET_TAR_PATH=/tetware-target + + 4) Make sure that all the header files, libraries and binaries are stored under LD_LIBRARY_PATH and PKG_CONFIG_PATH. + + 5) Execute. It takes maximum 1 minute. + # ./exec-tar-target + +================================================================================= +* Change log * +================================================================================= +1. 18-Dec-2008 + - Initial draft. + +================================================================================= +* NOTE * +================================================================================= +1. In order to ensure successful working of the Test Scripts, please ensure that all of the IPKG files are installed normally. +2. Testing Email Module can be executed under target system environment (not simulator). + + diff --git a/TC/telephony_TC/network/unit/makefile b/TC/telephony_TC/network/unit/makefile new file mode 100644 index 0000000..2fa3cbf --- /dev/null +++ b/TC/telephony_TC/network/unit/makefile @@ -0,0 +1,84 @@ +CC=gcc -Wall + +COMM = tel_tapi_nw_common +TS1 = uts_tel_get_network_band +TS2 = uts_tel_get_network_hybrid_in_cdma +TS3 = uts_tel_get_network_preferred_plmn +TS4 = uts_tel_get_network_roaming +TS5 = uts_tel_get_network_selection_mode +TS6 = uts_tel_get_network_service_domain +TS7 = uts_tel_search_network +TS8 = uts_tel_set_network_band +TS10 = uts_tel_set_network_hybrid_in_cdma +TS11 = uts_tel_set_network_preferred_plmn +TS13 = uts_tel_set_network_roaming +TS14 = uts_tel_set_network_service_domain +TS15 = uts_tel_select_network_automatic +TS16 = uts_tel_set_network_mode +TS17 = uts_tel_get_network_mode +TS18 = uts_tel_select_network_manual + +LIBS = `pkg-config --libs glib-2.0 gconf-2.0 dbus-1 dbus-glib-1 gthread-2.0 tapi` + +LIBS +=$(TET_ROOT)/lib/tet3/tcm.o +LIBS +=-L$(TET_ROOT)/lib/tet3 -lapi + +INCS = -I. `pkg-config --cflags glib-2.0 gconf-2.0 dbus-1 dbus-glib-1 gthread-2.0 tapi` +INCS += -I$(TET_ROOT)/inc/tet3 +INCS += -I../include + +CFLAGS += $(INCS) -D__arm__ -D_ARM_TOUCH -DTELEPHONY_TIMER +CC +=$(CFLAGS) +LDFLAGS = $(LIBS) + +all : $(TS1) $(TS2) $(TS3) $(TS4) $(TS5) $(TS6) $(TS7) $(TS8) $(TS10) $(TS11) $(TS13) $(TS14) $(TS15) $(TS16) $(TS17) $(TS18) + +clean : + rm -rf *~ *.o tet_lock tet_captured $(TS1) $(TS2) $(TS3) $(TS4) $(TS5) $(TS6) $(TS7) $(TS8) $(TS10) $(TS11) $(TS13) $(TS14) $(TS15) $(TS16) $(TS17) $(TS18) + +$(TS1): $(TS1).c + $(CC) -o $(TS1) tel_tapi_nw_common.c $(TS1).c $(LDFLAGS) + +$(TS2): $(TS2).c + $(CC) -o $(TS2) tel_tapi_nw_common.c $(TS2).c $(LDFLAGS) + +$(TS3): $(TS3).c + $(CC) -o $(TS3) tel_tapi_nw_common.c $(TS3).c $(LDFLAGS) + +$(TS4): $(TS4).c + $(CC) -o $(TS4) tel_tapi_nw_common.c $(TS4).c $(LDFLAGS) + +$(TS5): $(TS5).c + $(CC) -o $(TS5) tel_tapi_nw_common.c $(TS5).c $(LDFLAGS) + +$(TS6): $(TS6).c + $(CC) -o $(TS6) tel_tapi_nw_common.c $(TS6).c $(LDFLAGS) + +$(TS7): $(TS7).c + $(CC) -o $(TS7) tel_tapi_nw_common.c $(TS7).c $(LDFLAGS) + +$(TS8): $(TS8).c + $(CC) -o $(TS8) tel_tapi_nw_common.c $(TS8).c $(LDFLAGS) + +$(TS10): $(TS10).c + $(CC) -o $(TS10) tel_tapi_nw_common.c $(TS10).c $(LDFLAGS) + +$(TS11): $(TS11).c + $(CC) -o $(TS11) tel_tapi_nw_common.c $(TS11).c $(LDFLAGS) + +$(TS13): $(TS13).c + $(CC) -o $(TS13) tel_tapi_nw_common.c $(TS13).c $(LDFLAGS) + +$(TS14): $(TS14).c + $(CC) -o $(TS14) tel_tapi_nw_common.c $(TS14).c $(LDFLAGS) +$(TS15): $(TS15).c + $(CC) -o $(TS15) tel_tapi_nw_common.c $(TS15).c $(LDFLAGS) + +$(TS16): $(TS16).c + $(CC) -o $(TS16) tel_tapi_nw_common.c $(TS16).c $(LDFLAGS) + +$(TS17): $(TS17).c + $(CC) -o $(TS17) tel_tapi_nw_common.c $(TS17).c $(LDFLAGS) + +$(TS18): $(TS18).c + $(CC) -o $(TS18) tel_tapi_nw_common.c $(TS18).c $(LDFLAGS) diff --git a/TC/telephony_TC/network/unit/tel_tapi_nw_common.c b/TC/telephony_TC/network/unit/tel_tapi_nw_common.c new file mode 100644 index 0000000..f74e8fb --- /dev/null +++ b/TC/telephony_TC/network/unit/tel_tapi_nw_common.c @@ -0,0 +1,537 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * 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 "tel_tapi_nw_common.h" + +TelNetworkList_t gNetworkList = { 0, }; +GMainLoop *mainloop; + +void GetNetworkInfoCB(void *data) +{ + TelNetworkInfo_t tNetworkInfo; + memcpy(&tNetworkInfo, data, sizeof(TelNetworkInfo_t)); + + printf("GetNetworkInfoCB() : PLMN is %ld\n", tNetworkInfo.SysId.SysId); + printf("GetNetworkInfoCB() : PLMN is %s\n", tNetworkInfo.SysId.szSystemName); + + if (tNetworkInfo.SysId.bPlmnForbidden == TRUE) { + printf("GetNetworkInfoCB(): Network Forbidden\n"); + } + + if (tNetworkInfo.SysId.bHome == TRUE) { + printf("GetNetworkInfoCB(): Home Network \n"); + } + + if (tNetworkInfo.bRoaming == TRUE) { + printf("GetNetworkInfoCB(): Roaming Network \n"); + } + + /*SystemType*/ + switch (tNetworkInfo.SysId.SystemType) { + case TAPI_NETWORK_SYSTEM_GSM: + printf("SystemType: TAPI_NETWORK_SYSTEM_GSM\n"); + break; + + case TAPI_NETWORK_SYSTEM_UMTS: + printf("SystemType: TAPI_NETWORK_SYSTEM_UMTS\n"); + break; + + case TAPI_NETWORK_SYSTEM_GPRS: + printf("SystemType: TAPI_NETWORK_SYSTEM_GPRS\n"); + break; + + default: + printf("SystemType: Other than GSM,GPRS,UMTS System type \n"); + break; + } + + /*ServiceType*/ + switch (tNetworkInfo.SysId.ServiceType) { + case TAPI_NETWORK_SERVICE_TYPE_COMBINED: + printf("ServiceType: TAPI_NETWORK_SERVICE_TYPE_COMBINED\n"); + break; + + case TAPI_NETWORK_SERVICE_TYPE_CS: + printf("ServiceType: TAPI_NETWORK_SERVICE_TYPE_CS\n"); + break; + + case TAPI_NETWORK_SERVICE_TYPE_PS: + printf("ServiceType: TAPI_NETWORK_SERVICE_TYPE_PS\n"); + break; + + default: + printf("ServiceType: TAPI_NETWORK_SERVICE_TYPE_NO_SVE\n"); + break; + } + + /*NetworkMode*/ + switch (tNetworkInfo.SysId.NetworkMode) { + case TAPI_NETWORK_MODE_AUTOMATIC: + printf("NetworkMode: TAPI_NETWORK_MODE_AUTOMATIC\n"); + break; + + case TAPI_NETWORK_MODE_GSM: + printf("NetworkMode: TAPI_NETWORK_MODE_GSM\n"); + break; + + case TAPI_NETWORK_MODE_CDMA: + printf("NetworkMode: TAPI_NETWORK_MODE_CDMA\n"); + break; + + case TAPI_NETWORK_MODE_EMERGENCY: + printf("NetworkMode: TAPI_NETWORK_MODE_EMERGENCY\n"); + break; + + case TAPI_NETWORK_MODE_WCDMA: + printf("NetworkMode: TAPI_NETWORK_MODE_WCDMA\n"); + break; + + case TAPI_NETWORK_MODE_WLAN: + printf("NetworkMode: TAPI_NETWORK_MODE_WLAN\n"); + break; + + default: + printf("NetworkMode: UnKnown\n"); + break; + } + + /*service level */ + switch (tNetworkInfo.ServiceLevel) { + case TAPI_NETWORK_SERVICE_LEVEL_NO: + printf("ServiceLevel: TAPI_NETWORK_SERVICE_LEVEL_NO\n"); + break; + + case TAPI_NETWORK_SERVICE_LEVEL_EMERGENCY: + printf("ServiceLevel: TAPI_NETWORK_SERVICE_LEVEL_EMERGENCY\n"); + break; + + case TAPI_NETWORK_SERVICE_LEVEL_FULL: + printf("ServiceLevel: TAPI_NETWORK_SERVICE_LEVEL_FULL\n"); + break; + + case TAPI_NETWORK_SERVICE_LEVEL_SEARCH: + printf("ServiceLevel: TAPI_NETWORK_SERVICE_LEVEL_SEARCH\n"); + break; + + default: + printf("ServiceLevel: Unknown value\n"); + break; + } +} + +void SearchNetworkCB(void *data) +{ + TelNetworkList_t tmpNetworkList; + int idx = 0; + + memcpy(&tmpNetworkList, data, sizeof(TelNetworkList_t)); + memcpy(&gNetworkList, data, sizeof(TelNetworkList_t)); + + printf("[PHONE CLIENT] ReceiveNetworkList() - entryCount:[%d]\n", tmpNetworkList.NumOfNwAvailable); + + for (idx = 0; idx < tmpNetworkList.NumOfNwAvailable; idx++) { + printf("[PHONE CLIENT] NetworkList.systemList[idx].SysId =>%ld\n", tmpNetworkList.SystemList[idx].SysId); + } + + if (tmpNetworkList.SystemList[0].ServiceType == TAPI_NETWORK_SERVICE_TYPE_COMBINED) { + printf("TAPI_NETWORK_SERVICE_TYPE_COMBINED\n"); + } + else if (tmpNetworkList.SystemList[0].ServiceType == TAPI_NETWORK_SERVICE_TYPE_CS) { + printf("TAPI_NETWORK_SERVICE_TYPE_CS\n"); + } + else if (tmpNetworkList.SystemList[0].ServiceType == TAPI_NETWORK_SERVICE_TYPE_PS) { + printf("TAPI_NETWORK_SERVICE_TYPE_PS\n"); + } +} + +void SelectNetworkCB(void *data) +{ + TelNetworkInfo_t tNetworkInfo; + memcpy(&tNetworkInfo, data, sizeof(TelNetworkInfo_t)); + + printf("SelectNetworkCB() : PLMN is %ld\n", tNetworkInfo.SysId.SysId); + + if (tNetworkInfo.SysId.bPlmnForbidden == TRUE) { + printf("SelectNetworkCB(): Network Forbidden\n"); + } + + if (tNetworkInfo.SysId.bHome == TRUE) { + printf("SelectNetworkCB(): Home Network \n"); + } + + if (tNetworkInfo.bRoaming == TRUE) { + printf("SelectNetworkCB(): Roaming Network \n"); + } + + + /*SystemType*/ + switch (tNetworkInfo.SysId.SystemType) { + case TAPI_NETWORK_SYSTEM_GSM: + printf("SystemType: TAPI_NETWORK_SYSTEM_GSM\n"); + break; + + case TAPI_NETWORK_SYSTEM_UMTS: + printf("SystemType: TAPI_NETWORK_SYSTEM_UMTS\n"); + break; + + case TAPI_NETWORK_SYSTEM_GPRS: + printf("SystemType: TAPI_NETWORK_SYSTEM_GPRS\n"); + break; + + default: + printf("SystemType: Other than GSM,GPRS,UMTS System type \n"); + break; + } + + + /*ServiceType*/ + switch (tNetworkInfo.SysId.ServiceType) { + case TAPI_NETWORK_SERVICE_TYPE_COMBINED: + printf("ServiceType: TAPI_NETWORK_SERVICE_TYPE_COMBINED\n"); + break; + + case TAPI_NETWORK_SERVICE_TYPE_CS: + printf("ServiceType: TAPI_NETWORK_SERVICE_TYPE_CS\n"); + break; + + case TAPI_NETWORK_SERVICE_TYPE_PS: + printf("ServiceType: TAPI_NETWORK_SERVICE_TYPE_PS\n"); + break; + + default: + printf("ServiceType: TAPI_NETWORK_SERVICE_TYPE_NO_SVE\n"); + break; + } + + + /*NetworkMode*/ + switch (tNetworkInfo.SysId.NetworkMode) { + case TAPI_NETWORK_MODE_AUTOMATIC: + printf("NetworkMode: TAPI_NETWORK_MODE_AUTOMATIC\n"); + break; + + case TAPI_NETWORK_MODE_GSM: + printf("NetworkMode: TAPI_NETWORK_MODE_GSM\n"); + break; + + case TAPI_NETWORK_MODE_CDMA: + printf("NetworkMode: TAPI_NETWORK_MODE_CDMA\n"); + break; + + case TAPI_NETWORK_MODE_EMERGENCY: + printf("NetworkMode: TAPI_NETWORK_MODE_EMERGENCY\n"); + break; + + case TAPI_NETWORK_MODE_WCDMA: + printf("NetworkMode: TAPI_NETWORK_MODE_WCDMA\n"); + break; + + case TAPI_NETWORK_MODE_WLAN: + printf("NetworkMode: TAPI_NETWORK_MODE_WLAN\n"); + break; + + default: + printf("NetworkMode: UnKnown\n"); + break; + } + + /*service level */ + switch (tNetworkInfo.ServiceLevel) { + case TAPI_NETWORK_SERVICE_LEVEL_NO: + printf("ServiceLevel: TAPI_NETWORK_SERVICE_LEVEL_NO\n"); + break; + + case TAPI_NETWORK_SERVICE_LEVEL_EMERGENCY: + printf("ServiceLevel: TAPI_NETWORK_SERVICE_LEVEL_EMERGENCY\n"); + break; + + case TAPI_NETWORK_SERVICE_LEVEL_FULL: + printf("ServiceLevel: TAPI_NETWORK_SERVICE_LEVEL_FULL\n"); + break; + + case TAPI_NETWORK_SERVICE_LEVEL_SEARCH: + printf("ServiceLevel: TAPI_NETWORK_SERVICE_LEVEL_SEARCH\n"); + break; + + default: + printf("ServiceLevel: Unknown value\n"); + break; + } +} + + +void GetSelectionModeCB(void *data) +{ + TelNetworkSelectionMode_t tSelectionMode; + memcpy(&tSelectionMode, data, sizeof(TelNetworkSelectionMode_t)); + + if (tSelectionMode == TAPI_NETWORK_SELECTIONMODE_AUTOMATIC) { + printf("GetSelectionModeCB(): TAPI_NETWORK_SELECTIONMODE_AUTOMATIC\n"); + } + else if (tSelectionMode == TAPI_NETWORK_SELECTIONMODE_MANUAL) { + printf("GetSelectionModeCB(): TAPI_NETWORK_SELECTIONMODE_MANUAL\n"); + } + else { + printf("GetSelectionModeCB()???"); + } +} + +int tapi_callback(const TelTapiEvent_t *tapievent, void *data) +{ + int tmp; + int i = 0; + TelNetworkRadioInfo_t radioInfo; + + tmp = tapievent->RequestId; + + //tapievent->RequestId = tapievent->Status; + //tapievent->Status = tapievent->EventType; + //tapievent->EventType = tmp; + tet_printf("\n Inside tapi_callback \n"); + tet_printf("Request iD is %d\n", tapievent->RequestId); + tet_printf("Status is %d\n", tapievent->Status); + tet_printf("Event type is %d\n", tapievent->EventType); + + if (tapievent->EventClass != TAPI_EVENT_CLASS_NETWORK) { + return FALSE; + } + + switch (tapievent->EventType) { + case TAPI_EVENT_NETWORK_RADIO_INFO_IND: + printf("\n$$$$$$ TAPI_EVENT_NETWORK_RADIO_INFO_IND $$$$$$ \n"); + + memcpy(&radioInfo, tapievent->pData, sizeof(TelNetworkRadioInfo_t)); + + printf("\n Radio InfoRssiBar:[%d] \n", radioInfo.RssiBar); + printf("\n Radio InfoRxLevel:[%d] \n", radioInfo.RxLevel); + printf("\n Radio InfoRxQuality:[%d] \n", radioInfo.RxQuality); + + break; + + case TAPI_EVENT_NETWORK_CHANGE_IND: + printf("\n$$$$$$ TAPI_EVENT_NETWORK_CHANGE_IND $$$$$$ \n"); + + if (tapievent->pData != NULL) + SelectNetworkCB(tapievent->pData); + else + printf("Event Data is NULL\n"); + + break; + + case TAPI_EVENT_NETWORK_GETSELECTIONMODE_CNF: + printf("\n$$$$$$ TAPI_EVENT_NETWORK_GETSELECTIONMODE_CNF $$$$$$ \n"); + + if (tapievent->pData != NULL) + GetSelectionModeCB(tapievent->pData); + else + printf("Event Data is NULL\n"); + + break; + + case TAPI_EVENT_NETWORK_SETNWMODE_CNF: + printf("\n$$$$$$ TAPI_EVENT_NETWORK_SETNWMODE_CNF $$$$$$ \n"); + break; + + case TAPI_EVENT_NETWORK_SETNWBAND_CNF: + printf("\n$$$$$$ TAPI_EVENT_NETWORK_SETNWBAND_CNF $$$$$$ \n"); + break; + + case TAPI_EVENT_NETWORK_SETSERVICEDOMAIN_CNF: + printf("\n$$$$$$ TAPI_EVENT_NETWORK_SETSERVICEDOMAIN_CNF $$$$$$ \n"); + break; + + case TAPI_EVENT_NETWORK_SEARCH_CNF: + printf("\n$$$$$$ TAPI_EVENT_NETWORK_SEARCH_CNF $$$$$$ \n"); + + if (tapievent->pData != NULL) { + TelNetworkList_t networlist; + memcpy(&networlist, tapievent->pData, sizeof(TelNetworkList_t)); + //memcpy(&gNetworkList, 0, sizeof(TelNetworkList_t)); + memcpy(&gNetworkList, tapievent->pData, sizeof(TelNetworkList_t)); + printf("\n Network Count:[%d] \n", networlist.NumOfNwAvailable); + for (i = 0; i < networlist.NumOfNwAvailable; i++) { + printf("Network Name:[%ld] \n", networlist.SystemList[i].SysId); + printf("Network Name:[%c] \n", networlist.SystemList[i].szSystemName[0]); + printf("System Type:[%d] \n", networlist.SystemList[i].SystemType); + printf("Service Type:[%d] \n", networlist.SystemList[i].ServiceType); + printf("Home PLMN:[%d] \n", networlist.SystemList[i].bHome); + printf("Forbidden PLMN:[%d] \n", networlist.SystemList[i].bPlmnForbidden); + } + } + else { + printf("Event Data is NULL\n"); + } + + break; + + case TAPI_EVENT_NETWORK_SELECT_CNF: + printf("\n$$$$$$ TAPI_EVENT_NETWORK_SELECT_CNF $$$$$$ \n"); + + if (tapievent->pData != NULL) + GetNetworkInfoCB(tapievent->pData); + else + printf("Event Data is NULL\n"); + + break; + + case TAPI_EVENT_NETWORK_GETPREFFEREDPLMN_CNF: + printf("\n$$$$$$ TAPI_EVENT_NETWORK_GETPREFFPLMN_CNF $$$$$$ \n"); + + if (tapievent->pData != NULL) { + TelNetworkPrefferedPlmnList_t preff_plmn_list; + memcpy(&preff_plmn_list, tapievent->pData, sizeof(TelNetworkPrefferedPlmnList_t)); + unsigned char plmn_count; + unsigned char counter; + plmn_count = preff_plmn_list.NumOfPreffPlmns; + counter = 0; + while (counter < plmn_count) { + printf(" INDEX:[%d]\n", preff_plmn_list.PreffPlmnRecord[counter].Index); + printf(" PLMN ID:[%s]\n", preff_plmn_list.PreffPlmnRecord[counter].Plmn); + printf(" SYSTEM TYPE:[%d]\n", preff_plmn_list.PreffPlmnRecord[counter].SystemType); + printf("\n"); + counter++; + } + } + else { + printf("Event Data is NULL\n"); + } + + break; + + case TAPI_EVENT_NETWORK_GETNWBAND_CNF: + printf("\n$$$$$$ TAPI_EVENT_NETWORK_GETNWBAND_CNF $$$$$$ \n"); + + if (tapievent->pData != NULL) { + TelNetworkBand_t band_type; + memcpy(&band_type, tapievent->pData, sizeof(TelNetworkBand_t)); + printf("\n BAND TYPE:[%d] \n", band_type); + if (band_type == TAPI_NETWORK_BAND_TYPE_GSM) + printf("\n$$$$$$ TAPI_NETWORK_BAND_TYPE_GSM $$$$$$ \n"); + + } + else { + printf("Event Data is NULL\n"); + } + + break; + + case TAPI_EVENT_NETWORK_GETSERVICEDOMAIN_CNF: + printf("\n$$$$$$ TAPI_EVENT_NETWORK_GETSERVICEDOMAIN_CNF $$$$$$ \n"); + + if (tapievent->pData != NULL) { + TelNetworkServiceDomain_t service_type; + memcpy(&service_type, tapievent->pData, sizeof(TelNetworkServiceDomain_t)); + printf("\n SERVICE DOMAIN:[%d] \n", service_type); + + if (service_type == TAPI_NETWORK_SERVICE_DOMAIN_PS) + printf("\n$$$$$$TAPI_NETWORK_SERVICE_DOMAIN_PS$$$$$$ \n"); + else if (service_type == TAPI_NETWORK_SERVICE_DOMAIN_CS) + printf("\n$$$$$$TAPI_NETWORK_SERVICE_DOMAIN_CS$$$$$$ \n"); + else if (service_type == TAPI_NETWORK_SERVICE_DOMAIN_AUTOMATIC) + printf("\n$$$$$$ TAPI_NETWORK_SERVICE_DOMAIN_AUTOMATIC$$$$$$ \n"); + else if (service_type == TAPI_NETWORK_SERVICE_DOMAIN_COMBINED) + printf("\n$$$$$$ TAPI_NETWORK_SERVICE_DOMAIN_COMBINED \n"); + } + else { + printf("Event Data is NULL\n"); + } + + break; + + case TAPI_EVENT_NETWORK_GETNWMODE_CNF: + printf("\n$$$$$$ TAPI_EVENT_NETWORK_GETNWMODE_CNF $$$$$$ \n"); + + if (tapievent->pData != NULL) { + TelNetworkMode_t network_mode; + memcpy(&network_mode, tapievent->pData, sizeof(TelNetworkMode_t)); + printf("\n NETWORK MODE:[%d] \n", network_mode); + if (network_mode == TAPI_NETWORK_MODE_AUTOMATIC) + printf("\n$$$$$$ TAPI_NETWORK_MODE_AUTOMATIC $$$$$$ \n"); + else if (network_mode == TAPI_NETWORK_MODE_GSM) + printf("\n$$$$$$ TAPI_NETWORK_MODE_GSM $$$$$$ \n"); + else if (network_mode == TAPI_NETWORK_MODE_WCDMA) + printf("\n$$$$$$ TAPI_NETWORK_MODE_WCDMA $$$$$$ \n"); + } + else { + printf("Event Data is NULL\n"); + } + + break; + + case TAPI_EVENT_NETWORK_LOCATIONCELLINFO_IND: + printf("\n$$$$$$ TAPI_EVENT_NETWORK_LOCANDCELLINFO $$$$$$ \n"); + + if (tapievent->pData != NULL) { + TelNetworkLocationCellInfo_t network_loc_cell_info; + memcpy(&network_loc_cell_info, tapievent->pData, sizeof(TelNetworkLocationCellInfo_t)); + printf("\n LAC:[%d] \n", network_loc_cell_info.LocationAreaCode); + printf("\n CID:[%ld] \n", network_loc_cell_info.CellId); + } + else { + printf("Event Data is NULL\n"); + } + + break; + + case TAPI_EVENT_NETWORK_SETPREFFEREDPLMN_CNF: + printf("\n$$$$$$ TAPI_EVENT_NETWORK_SETPREFPLMN_CNF $$$$$$ \n"); + break; + + case TAPI_EVENT_NETWORK_SPN_INFO: + printf("\n$$$$$$ TAPI_EVENT_NETWORK_SPN_INFO $$$$$$ \n"); + + if (tapievent->pData != NULL) { + TelNetworkSpnMccMncInfo_t short_network_name; + int ret_val = 0; + char short_net_name[20]; + + memcpy(&short_network_name, tapievent->pData, sizeof(TelNetworkSpnMccMncInfo_t)); + fprintf(stderr, "SERVICE PROVIDER NAME #### [%s] ####\n", short_network_name.short_network_name); + fprintf(stderr, "MCC #### [%d] #### MNC #### [%d]\n", short_network_name.mcc, short_network_name.mnc); + + printf("ret val from status to get network name=%d", ret_val); + printf("NETWORK NAME FORM STATUS = %s \n", short_net_name); + } + break; + + default: + printf("\n$$$$$$ UNKNOWN Event has Received $$$$$$ \n"); + break; + } + + return TRUE; +} + +gboolean TimeOutFunc(void *data) +{ + g_main_loop_quit(mainloop); + printf("out of loop\n"); + return FALSE; +} + +int gmain_loop_for_tapi_events() +{ + mainloop = g_main_loop_new(NULL, FALSE); + g_timeout_add(3000, TimeOutFunc, NULL); + g_main_loop_run(mainloop); + printf("receive_tapi_event:finish\n"); + return 0; +} diff --git a/TC/telephony_TC/network/unit/tel_tapi_nw_common.h b/TC/telephony_TC/network/unit/tel_tapi_nw_common.h new file mode 100644 index 0000000..c38f9b3 --- /dev/null +++ b/TC/telephony_TC/network/unit/tel_tapi_nw_common.h @@ -0,0 +1,45 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * 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 + +#define TET_CHECK(x1, y...) \ + { \ + TapiResult_t err = y;\ + if (err != (x1)) \ + { \ + tet_printf("%s[%d] : test fail. error code =%d ",__FILE__,__LINE__, err); \ + tet_result(TET_FAIL); \ + return;\ + } \ + } + +extern void GetNetworkInfoCB(void *); +extern void SearchNetworkCB(void *); +extern void SelectNetworkCB(void *); +extern void GetSelectionModeCB(void *); +extern int gmain_loop_for_tapi_events(void); +extern int tapi_callback(const TelTapiEvent_t *tapievent, void *data); + diff --git a/TC/telephony_TC/network/unit/tslist b/TC/telephony_TC/network/unit/tslist new file mode 100644 index 0000000..402583d --- /dev/null +++ b/TC/telephony_TC/network/unit/tslist @@ -0,0 +1,11 @@ +/network/unit/uts_tel_get_network_band +/network/unit/uts_tel_get_network_preferred_plmn +/network/unit/uts_tel_get_network_selection_mode +/network/unit/uts_tel_get_network_service_domain +/network/unit/uts_tel_search_network +/network/unit/uts_tel_set_network_band +/network/unit/uts_tel_set_network_service_domain +/network/unit/uts_tel_get_network_mode +/network/unit/uts_tel_select_network_automatic +/network/unit/uts_tel_select_network_manual +/network/unit/uts_tel_set_network_mode diff --git a/TC/telephony_TC/network/unit/uts_tel_get_network_band.c b/TC/telephony_TC/network/unit/uts_tel_get_network_band.c new file mode 100644 index 0000000..34a76ef --- /dev/null +++ b/TC/telephony_TC/network/unit/uts_tel_get_network_band.c @@ -0,0 +1,144 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * 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 "tel_tapi_nw_common.h" +#include "uts_tel_get_network_band.h" + +TS_UINT subscription_id = 0, subscription_id1 = 0; + +/* Initialize TCM data structures */ +static void startup(); +static void cleanup(); +void (*tet_startup)() = startup; +void (*tet_cleanup)() = cleanup; +struct tet_testlist tet_testlist[] = { { utc_tel_get_network_band_01, 1 }, { utc_tel_get_network_band_02, 2 }, { NULL, 0 } }; + +/* Startup & Clean function : It is not test code, only for + initialize and finalize test module + */ +static void startup() +{ + int api_err = TAPI_API_SUCCESS; + tet_infoline("utc_tel_get_network_band, Test Start\n"); + + api_err = tel_init(); + if (api_err != TAPI_API_SUCCESS) { + printf("tel_init Failed api_err = %d \n", api_err); + } + + api_err = tel_register_event(TAPI_EVENT_NETWORK_GETNWBAND_CNF, &subscription_id1, tapi_callback, NULL); + if (api_err != TAPI_API_SUCCESS) { + printf("TapiCommonRegisterEvent Failed api_err = %d \n", api_err); + } + printf("after TapiCommonRegisterEvent sub id is %d api_err is %d\n", subscription_id1, api_err); + + tel_register_app_name("org.samsung.test"); + return; +} + +static void cleanup() +{ + tet_infoline("utc_tel_get_network_band, Test Finished\n"); + tel_deregister_event(subscription_id1); + tel_deinit(); + return; +} + + +/* + Unit Test Case functions +*/ + +/** + * @brief This tests tel_get_network_band() API in normal conditions + * @par ID: + * utc_tel_get_network_band_01 + * @code + + BandMode = TAPI_NETWORK_BAND_MODE_PREFERRED; + Band = TAPI_NETWORK_BAND_TYPE_ANY; + ret_val = tel_get_network_band(BandMode, Band, &pRequestId); + ret_val = tel_get_network_band(&pRequestId); + +* @endcode +* @param [out] pRequestId +* @return TAPI_API_SUCCESS - indicating that the operation has completed successfully. + */ +void utc_tel_get_network_band_01() +{ + TapiResult_t ret_val = TAPI_API_SUCCESS; + + TelNetworkBandPreferred_t BandMode; + TelNetworkBand_t Band; + int pRequestId; + + BandMode = TAPI_NETWORK_BAND_MODE_PREFERRED; + Band = TAPI_NETWORK_BAND_TYPE_ANY; + pRequestId = -1; + + tet_infoline("utc_tel_get_network_band_01 Test\n"); + /*Setting the network Band*/ + ret_val = tel_get_network_band(&pRequestId); + /*************************/ + + TET_CHECK(TAPI_API_SUCCESS, ret_val); + + tet_infoline("utc_tel_get_network_band_01 is passed\n"); + tet_result(TET_PASS); + + return; +} + +/** + * @brief This tests tel_get_network_band() API in abnormal conditions + * @par ID: + * utc_tel_get_network_band_02 + * @code + + pRequestId = NULL; + ret_val = tel_get_network_band(&pRequestId); +* @endcode +* @param [out] pRequestId +* @return TAPI_API_INVALID_PTR +*/ +void utc_tel_get_network_band_02() +{ + TapiResult_t ret_val = TAPI_API_SUCCESS; + + int *pRequestId; + + pRequestId = NULL; + + tet_infoline("utc_tel_get_network_band_02 Test\n"); + + ret_val = tel_get_network_band(pRequestId); + TET_CHECK(TAPI_API_INVALID_PTR, ret_val); + + tet_infoline("utc_tel_get_network_band_02 is passed\n"); + tet_result(TET_PASS); + + return; +} + +/** @} */ diff --git a/TC/telephony_TC/network/unit/uts_tel_get_network_band.h b/TC/telephony_TC/network/unit/uts_tel_get_network_band.h new file mode 100644 index 0000000..69f646f --- /dev/null +++ b/TC/telephony_TC/network/unit/uts_tel_get_network_band.h @@ -0,0 +1,28 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * 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. + */ + + +static void startup(); +static void cleanup(); + +static void utc_tel_get_network_band_01(); +static void utc_tel_get_network_band_02(); + +/** @} */ diff --git a/TC/telephony_TC/network/unit/uts_tel_get_network_hybrid_in_cdma.c b/TC/telephony_TC/network/unit/uts_tel_get_network_hybrid_in_cdma.c new file mode 100644 index 0000000..7f73ab0 --- /dev/null +++ b/TC/telephony_TC/network/unit/uts_tel_get_network_hybrid_in_cdma.c @@ -0,0 +1,188 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * 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 "tel_tapi_nw_common.h" +#include "uts_tel_get_network_hybrid_in_cdma.h" + +TS_UINT subscription_id = 0, subscription_id1 = 0; + +/* Initialize TCM data structures */ +static void startup(); +static void cleanup(); +void (*tet_startup) () = startup; +void (*tet_cleanup) () = cleanup; +struct tet_testlist tet_testlist[] = { + {utc_tel_get_network_hybrid_in_cdma_01, 1}, + {utc_tel_get_network_hybrid_in_cdma_02, 2}, + {utc_tel_get_network_hybrid_in_cdma_03, 3}, + {NULL, 0} +}; + +/* Startup & Clean function : It is not test code, only for + initialize and finalize test module + */ +void callback(TelTapiEvent_t *event) +{ + if (event->EventClass != TAPI_EVENT_CLASS_NETWORK) + return; + + if (event->EventType == TAPI_EVENT_NETWORK_GET_CDMA_HYBRID_MODE_CNF) { + printf("\n$$$$$$ TAPI_EVENT_NETWORK_GET_CDMA_HYBRID_MODE_CNF $$$$$$ \n"); + } +} + +static void startup() +{ + TapiResult_t api_err = TAPI_API_SUCCESS; + tet_infoline("utc_tel_tapi_nw_set_network_mode_func, Test Start\n"); + + api_err = tel_init(); + if (api_err != TAPI_API_SUCCESS) { + printf("tel_init Failed api_err = %d \n", api_err); + } + + api_err = tel_register_event(TAPI_EVENT_NETWORK_GET_CDMA_HYBRID_MODE_CNF, &subscription_id1, (TelAppCallback) &callback, NULL); + if (api_err != TAPI_API_SUCCESS) { + printf("TapiCommonRegisterEvent Failed api_err = %d \n", api_err); + } + printf("after TapiCommonRegisterEvent sub id is %d api_err is %d\n", subscription_id1, api_err); + + tel_register_app_name("org.samsung.test"); + return; +} + +static void cleanup() +{ + tet_infoline("utc_tel_tapi_nw_set_network_mode_func, Test Finished\n"); + tel_deregister_event(subscription_id1); + tel_deinit(); + return; +} + + +/* + Unit Test Case functions +*/ + +/** + * @brief This tests TelTapiNwSetNetworkMode() API in normal conditions + * @par ID: + * utc_tel_tapi_nw_set_network_mode_func_01 + * @param [in] NwMode + * @code + + NwMode = TAPI_NETWORK_MODE_EMERGENCY; + pRequestId = -1; + +* @endcode +* @param [out] pRequestId +* @return TAPI_API_INVALID_INPUT +*/ +void utc_tel_get_network_hybrid_in_cdma_01() +{ + TapiResult_t ret_val = TAPI_API_SUCCESS; + + ///TelNetworkMode_t NwMode; + int pRequestId; + + //NwMode = TAPI_NETWORK_MODE_EMERGENCY; + pRequestId = -1; + + tet_infoline("utc_tel_get_network_hybrid_in_cdma_01 Test\n"); + + ret_val = tel_get_network_hybrid_in_cdma(&pRequestId); + TET_CHECK(TAPI_API_SUCCESS, ret_val); + + tet_infoline("utc_tel_get_network_hybrid_in_cdma_01 is passed\n"); + tet_result(TET_PASS); + + return; +} + +/** + * @brief This tests TelTapiNwSetNetworkMode() API in normal conditions + * @par ID: + * utc_tel_tapi_nw_set_network_mode_func_02 + * @param [in] NwMode + * @code + + NwMode = TAPI_NETWORK_MODE_AUTOMATIC; + pRequestId = -1; + +* @endcode +* @param [out] pRequestId +* @return TAPI_API_SUCCESS - indicating that the operation has completed successfully. +*/ +void utc_tel_get_network_hybrid_in_cdma_02() +{ + TapiResult_t ret_val = TAPI_API_SUCCESS; + + TelNetworkMode_t NwMode; + int pRequestId; + + NwMode = TAPI_NETWORK_MODE_AUTOMATIC; + pRequestId = -1; + + tet_infoline("utc_tel_get_network_hybrid_in_cdma_02 Test\n"); + + ret_val = tel_get_network_hybrid_in_cdma(&pRequestId); + TET_CHECK(TAPI_API_SUCCESS, ret_val); + + tet_infoline("utc_tel_get_network_hybrid_in_cdma_02 is passed\n"); + tet_result(TET_PASS); + + return; +} + +/** + * @brief This tests TelTapiNwSetNetworkMode() API in normal conditions + * @par ID: + * utc_tel_tapi_nw_set_network_mode_func_03 + * @param [in] NwMode + * @code + + NwMode = TAPI_NETWORK_MODE_CDMA; + pRequestId = -1; + + * @endcode + * @param [out] pRequestId + * @return TAPI_API_INVALID_INPUT + */ +void utc_tel_get_network_hybrid_in_cdma_03() +{ + TapiResult_t ret_val = TAPI_API_SUCCESS; + + //pRequestId = NULL; + + tet_infoline("utc_tel_get_network_hybrid_in_cdma_03 Test\n"); + + ret_val = tel_get_network_hybrid_in_cdma(NULL); + TET_CHECK(TAPI_API_INVALID_PTR, ret_val); + + tet_infoline("utc_tel_get_network_hybrid_in_cdma_03 is passed\n"); + tet_result(TET_PASS); + + return; +} + + +/** @} */ diff --git a/TC/telephony_TC/network/unit/uts_tel_get_network_hybrid_in_cdma.h b/TC/telephony_TC/network/unit/uts_tel_get_network_hybrid_in_cdma.h new file mode 100644 index 0000000..4ce5d3b --- /dev/null +++ b/TC/telephony_TC/network/unit/uts_tel_get_network_hybrid_in_cdma.h @@ -0,0 +1,30 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * 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. + */ + + +static void startup(); +static void cleanup(); +static void utc_tel_get_network_hybrid_in_cdma_01(void); +static void utc_tel_get_network_hybrid_in_cdma_02(void); +static void utc_tel_get_network_hybrid_in_cdma_03(void); + +/** @} */ + + diff --git a/TC/telephony_TC/network/unit/uts_tel_get_network_mode.c b/TC/telephony_TC/network/unit/uts_tel_get_network_mode.c new file mode 100644 index 0000000..89563b7 --- /dev/null +++ b/TC/telephony_TC/network/unit/uts_tel_get_network_mode.c @@ -0,0 +1,137 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * 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 "tel_tapi_nw_common.h" +#include "uts_tel_get_network_mode.h" + +TS_UINT subscription_id = 0, subscription_id1 = 0; + +/* Initialize TCM data structures */ +static void startup(); +static void cleanup(); +void (*tet_startup) () = startup; +void (*tet_cleanup) () = cleanup; +struct tet_testlist tet_testlist[] = { + {utc_tel_get_network_mode_01, 1}, + {utc_tel_get_network_mode_02, 2}, + {NULL, 0} +}; + +/* Startup & Clean function : It is not test code, only for + initialize and finalize test module + */ +static void startup() +{ + int api_err = TAPI_API_SUCCESS; + tet_infoline("utc_tel_get_network_mode, Test Start\n"); + + api_err = tel_init(); + if (api_err != TAPI_API_SUCCESS) { + printf("tel_init Failed api_err = %d \n", api_err); + } + + api_err = tel_register_event(TAPI_EVENT_NETWORK_GETNWMODE_CNF, &subscription_id1, (TelAppCallback) tapi_callback, NULL); + if (api_err != TAPI_API_SUCCESS) { + printf("TapiCommonRegisterEvent Failed api_err = %d \n", api_err); + } + + printf("after TapiCommonRegisterEvent sub id is %d api_err is %d\n", subscription_id1, api_err); + + tel_register_app_name("org.samsung.test"); + return; +} + +static void cleanup() +{ + tet_infoline("utc_tel_get_network_mode, Test Finished\n"); + tel_deregister_event(subscription_id1); + tel_deinit(); + return; +} + + +/* + Unit Test Case functions +*/ + +/** + * @brief This tests tel_get_network_mode() API in normal conditions + * @par ID: + * utc_tel_get_network_mode_01 + * @code + + NwMode = TAPI_NETWORK_MODE_EMERGENCY; + pRequestId = -1; + +* @endcode +* @param [out] pRequestId +* @return TAPI_API_SUCCESS - indicating that the operation has completed successfully. +*/ +void utc_tel_get_network_mode_01() +{ + TapiResult_t ret_val = TAPI_API_SUCCESS; + + int pRequestId = -1; + + tet_infoline("utc_tel_get_network_mode_01 Test\n"); + /*Setting of Network Mode*/ + /*************************/ + ret_val = tel_get_network_mode(&pRequestId); + + TET_CHECK(TAPI_API_SUCCESS, ret_val); + + tet_infoline("utc_tel_get_network_mode_01 is passed\n"); + tet_result(TET_PASS); + + return; +} + +/** + * @brief This tests tel_get_network_mode() API in abnormal conditions + * @par ID: + * utc_tel_get_network_mode_02 + * @code + + pRequestId = NULL; + +* @endcode +* @param [out] pRequestId +* @return TAPI_API_INVALID_PTR +*/ +void utc_tel_get_network_mode_02() +{ + TapiResult_t ret_val = TAPI_API_SUCCESS; + + tet_infoline("utc_tel_get_network_mode_02 Test\n"); + + ret_val = tel_get_network_mode(NULL); + TET_CHECK(TAPI_API_INVALID_PTR, ret_val); + + tet_infoline("utc_tel_get_network_mode_02 is passed\n"); + tet_result(TET_PASS); + + return; +} + +/** @} */ diff --git a/TC/telephony_TC/network/unit/uts_tel_get_network_mode.h b/TC/telephony_TC/network/unit/uts_tel_get_network_mode.h new file mode 100644 index 0000000..2c93772 --- /dev/null +++ b/TC/telephony_TC/network/unit/uts_tel_get_network_mode.h @@ -0,0 +1,29 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * 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. + */ + + +static void startup(); +static void cleanup(); + +static void utc_tel_get_network_mode_01(); +static void utc_tel_get_network_mode_02(); + +/** @} */ + diff --git a/TC/telephony_TC/network/unit/uts_tel_get_network_preferred_plmn.c b/TC/telephony_TC/network/unit/uts_tel_get_network_preferred_plmn.c new file mode 100644 index 0000000..1cef006 --- /dev/null +++ b/TC/telephony_TC/network/unit/uts_tel_get_network_preferred_plmn.c @@ -0,0 +1,146 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * 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 "tel_tapi_nw_common.h" +#include "uts_tel_get_network_preferred_plmn.h" + +TS_UINT subscription_id = 0, subscription_id1 = 0; + +/* Initialize TCM data structures */ +static void startup(); +static void cleanup(); +void (*tet_startup) () = startup; +void (*tet_cleanup) () = cleanup; +struct tet_testlist tet_testlist[] = { + {utc_tel_get_network_preferred_plmn_01, 1}, + {utc_tel_get_network_preferred_plmn_02, 2}, + {NULL, 0} +}; + +/* Startup & Clean function : It is not test code, only for + initialize and finalize test module + */ +static void startup() +{ + int api_err = TAPI_API_SUCCESS; + tet_infoline("utc_tel_get_network_preferred_plmn, Test Start\n"); + + api_err = tel_init(); + if (api_err != TAPI_API_SUCCESS) { + printf("tel_init Failed api_err = %d \n", api_err); + } + + api_err = tel_register_event(TAPI_EVENT_NETWORK_GETPREFFEREDPLMN_CNF, &subscription_id1, tapi_callback, NULL); + if (api_err != TAPI_API_SUCCESS) { + printf("TapiCommonRegisterEvent Failed api_err = %d \n", api_err); + } + printf("after TapiCommonRegisterEvent sub id is %d api_err is %d\n", subscription_id1, api_err); + + tel_register_app_name("org.samsung.test"); + return; +} + +static void cleanup() +{ + tet_infoline("utc_tel_get_network_preferred_plmn, Test Finished\n"); + tel_deregister_event(subscription_id1); + tel_deinit(); + return; +} + + +/* + Unit Test Case functions +*/ + +/** + * @brief This tests tel_get_network_preferred_plmn() API in normal conditions + * @par ID: + * utc_tel_get_network_preferred_plmn_01 + * @code + + Operation = TAPI_NETWORK_PREF_PLMN_ADD; + PreffPlmnInfo.Index = 23; + memcpy(PreffPlmnInfo.Plmn,"VF",2); + PreffPlmnInfo.SystemType = TAPI_NETWORK_SYSTEM_GPRS; + pRequestId = -1; + +* @endcode +* @param [out] pRequestId +* @return TAPI_API_SUCCESS - indicating that the operation has completed successfully. +*/ +void utc_tel_get_network_preferred_plmn_01() +{ + TapiResult_t ret_val = TAPI_API_SUCCESS; + + TelNetworkPrefferedPlmnOp_t Operation; + TelNetworkPrefferedPlmnInfo_t PreffPlmnInfo; + int pRequestId; + + Operation = TAPI_NETWORK_PREF_PLMN_ADD; + PreffPlmnInfo.Index = 23;/*Some value between 0 and 255*/ + memcpy(PreffPlmnInfo.Plmn, "VF", 2); + PreffPlmnInfo.SystemType = TAPI_NETWORK_SYSTEM_GPRS; + pRequestId = -1; + + tet_infoline("utc_tel_get_network_preferred_plmn_01 Test\n"); + + /*Setting of Preferred PLMN*/ + ret_val = tel_get_network_preferred_plmn(&pRequestId); + /***************************/ + + TET_CHECK(TAPI_API_SUCCESS, ret_val); + + tet_infoline("utc_tel_get_network_preferred_plmn_01 is passed\n"); + tet_result(TET_PASS); + + return; +} + +/** + * @brief This tests tel_get_network_preferred_plmn() API in abnormal conditions + * @par ID: + * utc_tel_get_network_preferred_plmn_02 + * @code + + pRequestId = NULL; + + * @endcode + * @param [out] pRequestId + * @return TAPI_API_INVALID_PTR + */ +void utc_tel_get_network_preferred_plmn_02() +{ + TapiResult_t ret_val = TAPI_API_SUCCESS; + + tet_infoline("utc_tel_get_network_preferred_plmn_02 Test\n"); + + ret_val = tel_get_network_preferred_plmn(NULL); + TET_CHECK(TAPI_API_INVALID_PTR, ret_val); + + tet_infoline("utc_tel_get_network_preferred_plmn_02 is passed\n"); + tet_result(TET_PASS); + + return; +} + +/** @} */ diff --git a/TC/telephony_TC/network/unit/uts_tel_get_network_preferred_plmn.h b/TC/telephony_TC/network/unit/uts_tel_get_network_preferred_plmn.h new file mode 100644 index 0000000..272653d --- /dev/null +++ b/TC/telephony_TC/network/unit/uts_tel_get_network_preferred_plmn.h @@ -0,0 +1,32 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * 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. + */ + + +static void startup(); +static void cleanup(); + +static void utc_tel_get_network_preferred_plmn_01(); +static void utc_tel_get_network_preferred_plmn_02(); + +/** @} */ + + + + diff --git a/TC/telephony_TC/network/unit/uts_tel_get_network_roaming.c b/TC/telephony_TC/network/unit/uts_tel_get_network_roaming.c new file mode 100644 index 0000000..93290b9 --- /dev/null +++ b/TC/telephony_TC/network/unit/uts_tel_get_network_roaming.c @@ -0,0 +1,149 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * 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 "tel_tapi_nw_common.h" +#include "uts_tel_get_network_roaming.h" + +TS_UINT subscription_id = 0, subscription_id1 = 0; + +/* Initialize TCM data structures */ +static void startup(); +static void cleanup(); +void (*tet_startup) () = startup; +void (*tet_cleanup) () = cleanup; +struct tet_testlist tet_testlist[] = { + {utc_tel_get_network_roaming_01, 1}, + {utc_tel_get_network_roaming_02, 2}, + {NULL, 0} +}; + +void callback(TelTapiEvent_t *event) +{ + if (event->EventClass != TAPI_EVENT_CLASS_NETWORK) + return; + + if (event->EventType == TAPI_EVENT_NETWORK_GET_ROAMING_MODE_CNF) { + printf("\n$$$$$$ TAPI_EVENT_NETWORK_GET_ROAMING_MODE_CNF $$$$$$ \n"); + } + +} + +/* Startup & Clean function : It is not test code, only for + initialize and finalize test module + */ +static void startup() +{ + TapiResult_t api_err = TAPI_API_SUCCESS; + tet_infoline("utc_tel_tapi_nw_get_network_mode_func, Test Start\n"); + + api_err = tel_init(); + if (api_err != TAPI_API_SUCCESS) { + printf("tel_init Failed api_err = %d \n", api_err); + } + api_err = tel_register_event(TAPI_EVENT_NETWORK_GET_ROAMING_MODE_CNF, &subscription_id1, (TelAppCallback) &callback, NULL); + if (api_err != TAPI_API_SUCCESS) { + printf("TapiCommonRegisterEvent Failed api_err = %d \n", api_err); + } + printf("after TapiCommonRegisterEvent sub id is %d api_err is %d\n", subscription_id1, api_err); + + tel_register_app_name("org.samsung.test"); + return; +} + +static void cleanup() +{ + tet_infoline("utc_tel_get_network_roaming, Test Finished\n"); + tel_deregister_event(subscription_id1); + tel_deinit(); + return; +} + + +/* + Unit Test Case functions +*/ + +/** + * @brief This tests tel_get_network_roaming() API in normal conditions + * @par ID: + * utc_tel_get_network_roaming_01 + * @code + + RoamingMode = TAPI_NETWORK_MODE_EMERGENCY; + pRequestId = -1; + +* @endcode +* @param [out] pRequestId +* @return TAPI_API_SUCCESS - indicating that the operation has completed successfully. +*/ +void utc_tel_get_network_roaming_01() +{ + TapiResult_t ret_val = TAPI_API_SUCCESS; + + int pRequestId; + + pRequestId = -1; + + tet_infoline("utc_tel_get_network_roaming_01 Test\n"); + /*Setting of roaming Mode*/ + ret_val = tel_get_network_roaming(&pRequestId); + /*************************/ + + TET_CHECK(TAPI_API_SUCCESS, ret_val); + + tet_infoline("utc_tel_get_network_roaming_01 is passed\n"); + tet_result(TET_PASS); + + return; +} + +/** + * @brief This tests tel_get_network_roaming() API in abnormal conditions + * @par ID: + * utc_tel_get_network_roaming_02 + * @code + + pRequestId = NULL; + +* @endcode +* @param [out] pRequestId +* @return TAPI_API_INVALID_PTR +*/ + +void utc_tel_get_network_roaming_02() +{ + TapiResult_t ret_val = TAPI_API_SUCCESS; + + tet_infoline("utc_tel_get_network_roaming_02 Test\n"); + + ret_val = tel_get_network_roaming(NULL); + TET_CHECK(TAPI_API_INVALID_PTR, ret_val); + + tet_infoline("utc_tel_get_network_roaming_02 is passed\n"); + tet_result(TET_PASS); + + return; +} + +/** @} */ diff --git a/TC/telephony_TC/network/unit/uts_tel_get_network_roaming.h b/TC/telephony_TC/network/unit/uts_tel_get_network_roaming.h new file mode 100644 index 0000000..527f07a --- /dev/null +++ b/TC/telephony_TC/network/unit/uts_tel_get_network_roaming.h @@ -0,0 +1,28 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * 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. + */ + + +static void startup(); +static void cleanup(); +static void utc_tel_get_network_roaming_01(); +static void utc_tel_get_network_roaming_02(); + +/** @} */ + diff --git a/TC/telephony_TC/network/unit/uts_tel_get_network_selection_mode.c b/TC/telephony_TC/network/unit/uts_tel_get_network_selection_mode.c new file mode 100644 index 0000000..04d508a --- /dev/null +++ b/TC/telephony_TC/network/unit/uts_tel_get_network_selection_mode.c @@ -0,0 +1,142 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * 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 "tel_tapi_nw_common.h" +#include "uts_tel_get_network_selection_mode.h" + +TS_UINT subscription_id = 0, subscription_id1 = 0; + +/* Initialize TCM data structures */ +static void startup(); +static void cleanup(); +void (*tet_startup) () = startup; +void (*tet_cleanup) () = cleanup; +struct tet_testlist tet_testlist[] = { + {utc_tel_get_network_selection_mode_01, 1}, + {utc_tel_get_network_selection_mode_02, 2}, + {NULL, 0} +}; + +/* Startup & Clean function : It is not test code, only for + initialize and finalize test module + */ +static void startup() +{ + TapiResult_t api_err = TAPI_API_SUCCESS; + tet_infoline("utc_tel_get_network_selection_mode, Test Start\n"); + + api_err = tel_init(); + if (api_err != TAPI_API_SUCCESS) { + printf("tel_init Failed api_err = %d \n", api_err); + } + + api_err = tel_register_event(TAPI_EVENT_NETWORK_GETSELECTIONMODE_CNF, &subscription_id1, tapi_callback, NULL); + if (api_err != TAPI_API_SUCCESS) { + printf("TapiCommonRegisterEvent Failed api_err = %d \n", api_err); + } + printf("after TapiCommonRegisterEvent sub id is %d api_err is %d\n", subscription_id1, api_err); + + tel_register_app_name("org.samsung.test"); + return; +} + +static void cleanup() +{ + tet_infoline("utc_tel_get_network_selection_mode, Test Finished\n"); + tel_deregister_event(subscription_id1); + tel_deinit(); + return; +} + + +/* + Unit Test Case functions +*/ + +/** + * @brief This tests tel_get_network_selection_mode() API in normal conditions + * @par ID: + * utc_tel_get_network_selection_mode_01 + * @code + + pRequestId = -1; + NwSelectionMode = TAPI_NETWORK_SELECTIONMODE_AUTOMATIC; + ret_val = TelTapiNwSetSelectionMode(NwSelectionMode, &pRequestId); + +* @endcode +* @param [out] pRequestId +* @return TAPI_API_SUCCESS - indicating that the operation has completed successfully. +*/ +void utc_tel_get_network_selection_mode_01() +{ + TapiResult_t ret_val = TAPI_API_SUCCESS; + + int pRequestId; + pRequestId = -1; + + tet_infoline("utc_tel_get_network_selection_mode_01 Test\n"); + + printf("Value of ret-val while setting the value ==== %d\n", ret_val); + + /***************************/ + ret_val = tel_get_network_selection_mode(&pRequestId); + printf("Value of ret-val while getting the value ==== %d\n", ret_val); + + TET_CHECK(TAPI_API_SUCCESS, ret_val); + + tet_infoline("utc_tel_get_network_selection_mode_01 is passed\n"); + tet_result(TET_PASS); + + return; +} + +/** + * @brief This tests tel_get_network_selection_mode() API in abnormal conditions + * @par ID: + * utc_tel_get_network_selection_mode_02 + * @code + + pRequestId = NULL; + +* @endcode +* @param [out] pRequestId +* @return TAPI_API_INVALID_PTR +*/ + +void utc_tel_get_network_selection_mode_02() +{ + TapiResult_t ret_val = TAPI_API_SUCCESS; + + tet_infoline("utc_tel_get_network_selection_mode_02 Test\n"); + + ret_val = tel_get_network_selection_mode(NULL); + TET_CHECK(TAPI_API_INVALID_PTR, ret_val); + + tet_infoline("utc_tel_get_network_selection_mode_02 is passed\n"); + tet_result(TET_PASS); + + return; +} + +/** @} */ diff --git a/TC/telephony_TC/network/unit/uts_tel_get_network_selection_mode.h b/TC/telephony_TC/network/unit/uts_tel_get_network_selection_mode.h new file mode 100644 index 0000000..24649d1 --- /dev/null +++ b/TC/telephony_TC/network/unit/uts_tel_get_network_selection_mode.h @@ -0,0 +1,33 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * 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. + */ + + +static void startup(); +static void cleanup(); + +static void utc_tel_get_network_selection_mode_01(); +static void utc_tel_get_network_selection_mode_02(); + +/** @} */ + + + + + diff --git a/TC/telephony_TC/network/unit/uts_tel_get_network_service_domain.c b/TC/telephony_TC/network/unit/uts_tel_get_network_service_domain.c new file mode 100644 index 0000000..a8e5e55 --- /dev/null +++ b/TC/telephony_TC/network/unit/uts_tel_get_network_service_domain.c @@ -0,0 +1,140 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * 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 "tel_tapi_nw_common.h" +#include "uts_tel_get_network_service_domain.h" + +TS_UINT subscription_id = 0, subscription_id1 = 0; + +/* Initialize TCM data structures */ +static void startup(); +static void cleanup(); +void (*tet_startup) () = startup; +void (*tet_cleanup) () = cleanup; +struct tet_testlist tet_testlist[] = { + {utc_tel_get_network_service_domain_01, 1}, + {utc_tel_get_network_service_domain_02, 2}, + {NULL, 0} +}; + +/* Startup & Clean function : It is not test code, only for + initialize and finalize test module + */ +static void startup() +{ + TapiResult_t api_err = TAPI_API_SUCCESS; + tet_infoline("utc_tel_get_network_service_domain, Test Start\n"); + + api_err = tel_init(); + if (api_err != TAPI_API_SUCCESS) { + printf("tel_init Failed api_err = %d \n", api_err); + } + + api_err = tel_register_event(TAPI_EVENT_NETWORK_GETSERVICEDOMAIN_CNF, &subscription_id1, tapi_callback, NULL); + if (api_err != TAPI_API_SUCCESS) { + printf("TapiCommonRegisterEvent Failed api_err = %d \n", api_err); + } + printf("after TapiCommonRegisterEvent sub id is %d api_err is %d\n", subscription_id1, api_err); + + tel_register_app_name("org.samsung.test"); + return; +} + +static void cleanup() +{ + tet_infoline("utc_tel_get_network_service_domain, Test Finished\n"); + tel_deregister_event(subscription_id1); + tel_deinit(); + return; +} + + +/* + Unit Test Case functions +*/ + +/** + * @brief This tests tel_get_network_service_domain() API in normal conditions + * @par ID: + * utc_tel_get_network_service_domain_01 + * @code + + pRequestId = -1; + ServiceDomain = TAPI_NETWORK_SERVICE_DOMAIN_COMBINED; + ret_val = tel_get_network_service_domain(ServiceDomain, &pRequestId); + +* @endcode +* @param [out] pRequestId +* @return TAPI_API_SUCCESS - indicating that the operation has completed successfully. +*/ +void utc_tel_get_network_service_domain_01() +{ + TapiResult_t ret_val = TAPI_API_SUCCESS; + + int pRequestId; + pRequestId = -1; + + tet_infoline("utc_tel_get_network_service_domain_01 Test\n"); + + /*Setting of Service Domain*/ + /***************************/ + ret_val = tel_get_network_service_domain(&pRequestId); + + TET_CHECK(TAPI_API_SUCCESS, ret_val); + + tet_infoline("utc_tel_get_network_service_domain_01 is passed\n"); + tet_result(TET_PASS); + + return; +} + +/** + * @brief This tests tel_get_network_service_domain() API in abnormal conditions + * @par ID: + * utc_tel_get_network_service_domain_02 + * @code + + pRequestId = NULL; + +* @endcode +* @param [out] pRequestId +* @return TAPI_API_INVALID_PTR +*/ + +void utc_tel_get_network_service_domain_02() +{ + TapiResult_t ret_val = TAPI_API_SUCCESS; + + tet_infoline("utc_tel_get_network_service_domain_02 Test\n"); + + ret_val = tel_get_network_service_domain(NULL); + TET_CHECK(TAPI_API_INVALID_PTR, ret_val); + + tet_infoline("utc_tel_get_network_service_domain_02 is passed\n"); + tet_result(TET_PASS); + + return; +} + +/** @} */ diff --git a/TC/telephony_TC/network/unit/uts_tel_get_network_service_domain.h b/TC/telephony_TC/network/unit/uts_tel_get_network_service_domain.h new file mode 100644 index 0000000..0bb361b --- /dev/null +++ b/TC/telephony_TC/network/unit/uts_tel_get_network_service_domain.h @@ -0,0 +1,35 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * 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. + */ + + + +static void startup(); +static void cleanup(); + +static void utc_tel_get_network_service_domain_01(); +static void utc_tel_get_network_service_domain_02(); + +/** @} */ + + + + + + diff --git a/TC/telephony_TC/network/unit/uts_tel_search_network.c b/TC/telephony_TC/network/unit/uts_tel_search_network.c new file mode 100644 index 0000000..fae2bed --- /dev/null +++ b/TC/telephony_TC/network/unit/uts_tel_search_network.c @@ -0,0 +1,137 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * 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 "tel_tapi_nw_common.h" +#include "uts_tel_search_network.h" + +TS_UINT subscription_id = 0, subscription_id1 = 0; + +/* Initialize TCM data structures */ +static void startup(); +static void cleanup(); +void (*tet_startup) () = startup; +void (*tet_cleanup) () = cleanup; +struct tet_testlist tet_testlist[] = { + {utc_tel_search_network_01, 1}, + {utc_tel_search_network_02, 2}, + {NULL, 0} +}; + +/* Startup & Clean function : It is not test code, only for + initialize and finalize test module + */ +static void startup() +{ + TapiResult_t api_err = TAPI_API_SUCCESS; + + tet_infoline("utc_tel_search_network, Test Start\n"); + + api_err = tel_init(); + if (api_err != TAPI_API_SUCCESS) { + printf("tel_init Failed api_err = %d \n", api_err); + } + + api_err = tel_register_event(TAPI_EVENT_NETWORK_SEARCH_CNF, &subscription_id1, tapi_callback, NULL); + if (api_err != TAPI_API_SUCCESS) { + printf("TapiCommonRegisterEvent Failed api_err = %d \n", api_err); + } + printf("after TapiCommonRegisterEvent sub id is %d api_err is %d\n", subscription_id1, api_err); + + tel_register_app_name("org.samsung.test"); + return; +} + +static void cleanup() +{ + tet_infoline("utc_tel_search_network, Test Finished\n"); + tel_deregister_event(subscription_id1); + tel_deinit(); + return; +} + + +/* + Unit Test Case functions +*/ + +/** + * @brief This tests tel_search_network() API in normal conditions + * @par ID: + * utc_tel_search_network_01 + * @code + + pRequestId = -1; + ret_val = tel_search_network(&pRequestId); + +* @endcode +* @param [out] pRequestId +* @return TAPI_API_SUCCESS - indicating that the operation has completed successfully. +*/ +void utc_tel_search_network_01() +{ + TapiResult_t ret_val = TAPI_API_SUCCESS; + + int pRequestId; + pRequestId = -1; + + tet_infoline("utc_tel_search_network_01 Test\n"); + + ret_val = tel_search_network(&pRequestId); + + TET_CHECK(TAPI_API_SUCCESS, ret_val); + + tet_infoline("utc_tel_search_network_01 is passed\n"); + tet_result(TET_PASS); + + return; +} + +/** + * @brief This tests tel_search_network() API in abnormal conditions + * @par ID: + * utc_tel_search_network_02 + * @code + + pRequestId = NULL; + +* @endcode +* @param [out] pRequestId +* @return TAPI_API_INVALID_PTR +*/ +void utc_tel_search_network_02() +{ + TapiResult_t ret_val = TAPI_API_SUCCESS; + + tet_infoline("utc_tel_search_network_02 Test\n"); + + ret_val = tel_search_network(NULL); + TET_CHECK(TAPI_API_INVALID_PTR, ret_val); + + tet_infoline("utc_tel_search_network_02 is passed\n"); + tet_result(TET_PASS); + + return; +} + +/** @} */ diff --git a/TC/telephony_TC/network/unit/uts_tel_search_network.h b/TC/telephony_TC/network/unit/uts_tel_search_network.h new file mode 100644 index 0000000..7e3b5c0 --- /dev/null +++ b/TC/telephony_TC/network/unit/uts_tel_search_network.h @@ -0,0 +1,35 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * 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. + */ + + +static void startup(); +static void cleanup(); + +static void utc_tel_search_network_01(); +static void utc_tel_search_network_02(); + +/** @} */ + + + + + + + diff --git a/TC/telephony_TC/network/unit/uts_tel_select_network_automatic.c b/TC/telephony_TC/network/unit/uts_tel_select_network_automatic.c new file mode 100644 index 0000000..42a5d7a --- /dev/null +++ b/TC/telephony_TC/network/unit/uts_tel_select_network_automatic.c @@ -0,0 +1,168 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * 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 "uts_tel_select_network_automatic.h" +#include "tel_tapi_nw_common.h" + +TS_UINT subscription_id = 0, subscription_id1 = 0; + +/* Initialize TCM data structures */ +static void startup(); +static void cleanup(); +void (*tet_startup) () = startup; +void (*tet_cleanup) () = cleanup; +struct tet_testlist tet_testlist[] = { + {utc_tel_select_network_automatic_01, 1}, + {utc_tel_select_network_automatic_02, 2}, + {NULL, 0} +}; + +void callback(TelTapiEvent_t *event) +{ + if (event->EventClass != TAPI_EVENT_CLASS_NETWORK) + return; + + if (event->EventType == TAPI_EVENT_NETWORK_SELECT_CNF) { + printf("\n$$$$$$ TAPI_EVENT_NETWORK_SELECT_CNF $$$$$$ \n"); + } + +} + +/* Startup & Clean function : It is not test code, only for + initialize and finalize test module + */ +static void startup() +{ + int api_err = TAPI_API_SUCCESS; + + tet_infoline("utc_tel_select_network_automatic, Test Start\n"); + + api_err = tel_init(); + if (api_err != TAPI_API_SUCCESS) { + printf("tel_init Failed api_err = %d \n", api_err); + } + api_err = tel_register_event(TAPI_EVENT_NETWORK_SELECT_CNF, &subscription_id1, (TelAppCallback) &callback, NULL); + if (api_err != TAPI_API_SUCCESS) { + printf("TapiCommonRegisterEvent Failed api_err = %d \n", api_err); + } + printf("after TapiCommonRegisterEvent sub id is %d api_err is %d\n", subscription_id1, api_err); + + tel_register_app_name("org.samsung.test"); + return; +} + +static void cleanup() +{ + tet_infoline("utc_tel_select_network_automatic, Test Finished\n"); + tel_deregister_event(subscription_id1); + tel_deinit(); + return; +} + + +/* + Unit Test Case functions +*/ + +/** + * @brief This tests tel_select_network_automatic() API in normal conditions + * @par ID: + * utc_tel_select_network_automatic_01 + * @code + + pSystemId -> SystemType = TAPI_NETWORK_SYSTEM_GSM; + pSystemId -> ServiceType = TAPI_NETWORK_SERVICE_TYPE_COMBINED; + pSystemId -> SysIdFormat = TAPI_NETWORK_SYSID_FORMAT_PLMN; + pSystemId -> NetworkMode = TAPI_NETWORK_MODE_AUTOMATIC; + pSystemId -> SysId = 12345; + pSystemId -> bPlmnForbidden = FALSE; + pSystemId -> bHome = TRUE; + pSystemId -> bEquivalentPlmn = TRUE; + pSystemId -> bNetworkIdentityAvail = TRUE; + pSystemId -> bNetworkTimeAvail = TRUE; + pSystemId -> bNetworkTimeZoneAvail = TRUE; + pSystemId -> bNetworkDlsAvail = TRUE; + memcpy(pSystemId -> szSystemName, "XO", 2); + memcpy(pSystemId -> szSpn, "Vodafone", 9); + pSystemId -> NetworkTimeZone.Year = 1970; + pSystemId -> NetworkTimeZone.Month = 01; + pSystemId -> NetworkTimeZone.Day = 01; + pSystemId -> NetworkTimeZone.Hour = 01; + pSystemId -> NetworkTimeZone.Minute = 01; + pSystemId -> NetworkTimeZone.Second = 01; + pSystemId -> NetworkTimeZone.DaylightSave = TAPI_NETWORK_DLS_ADJ_NO_ADJUSTMENT; + pSystemId -> bMncIncludesPcsDigit = TRUE; + ret_val = TelTapiNwSelectNetwork(pSystemId, &pRequestId); + ret_val = tel_select_network_automatic(&pRequestId); +* @endcode +* @param [out] pRequestId +* @return TAPI_API_SUCCESS - indicating that the operation has completed successfully. +*/ +void utc_tel_select_network_automatic_01() +{ + TapiResult_t ret_val = TAPI_API_SUCCESS; + + int pRequestId; + pRequestId = -1; + + tet_infoline("utc_tel_select_network_automatic_01 Test\n"); + /* Selection of Network done*/ + /*************************/ + ret_val = tel_select_network_automatic(&pRequestId); + + TET_CHECK(TAPI_API_SUCCESS, ret_val); + + tet_infoline("utc_tel_select_network_automatic_01 is passed\n"); + tet_result(TET_PASS); + + return; +} + +/** + * @brief This tests tel_select_network_automatic() API in abnormal conditions + * @par ID: + * utc_tel_select_network_automatic_02 + * @code + + pRequestId = NULL; + ret_val = tel_select_network_automatic(&pRequestId); +* @endcode +* @param [out] pRequestId +* @return TAPI_API_INVALID_PTR +*/ +void utc_tel_select_network_automatic_02() +{ + TapiResult_t ret_val = TAPI_API_SUCCESS; + + tet_infoline("utc_tel_select_network_automatic_02 Test\n"); + + ret_val = tel_select_network_automatic(NULL); + TET_CHECK(TAPI_API_INVALID_PTR, ret_val); + + tet_infoline("utc_tel_select_network_automatic_02 is passed\n"); + tet_result(TET_PASS); + + return; +} + +/** @} */ diff --git a/TC/telephony_TC/network/unit/uts_tel_select_network_automatic.h b/TC/telephony_TC/network/unit/uts_tel_select_network_automatic.h new file mode 100644 index 0000000..1e8a100 --- /dev/null +++ b/TC/telephony_TC/network/unit/uts_tel_select_network_automatic.h @@ -0,0 +1,31 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * 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. + */ + + +static void startup(); +static void cleanup(); + +static void utc_tel_select_network_automatic_01(); +static void utc_tel_select_network_automatic_02(); + +/** @} */ + + + diff --git a/TC/telephony_TC/network/unit/uts_tel_select_network_manual.c b/TC/telephony_TC/network/unit/uts_tel_select_network_manual.c new file mode 100644 index 0000000..897bbf6 --- /dev/null +++ b/TC/telephony_TC/network/unit/uts_tel_select_network_manual.c @@ -0,0 +1,187 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * 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 "uts_tel_select_network_manual.h" +#include "tel_tapi_nw_common.h" + +TS_UINT subscription_id = 0, subscription_id1 = 0; + +/* Initialize TCM data structures */ +static void startup(); +static void cleanup(); +void (*tet_startup) () = startup; +void (*tet_cleanup) () = cleanup; +struct tet_testlist tet_testlist[] = { + {utc_tel_select_network_manual_01, 1}, + {utc_tel_select_network_manual_02, 2}, + {NULL, 0} +}; + +void callback(TelTapiEvent_t *event) +{ + if (event->EventClass != TAPI_EVENT_CLASS_NETWORK) + return; + + if (event->EventType == TAPI_EVENT_NETWORK_SELECT_CNF) { + printf("\n$$$$$$ TAPI_EVENT_NETWORK_SELECT_CNF $$$$$$ \n"); + } +} + + +/* Startup & Clean function : It is not test code, only for + initialize and finalize test module + */ +static void startup() +{ + TapiResult_t api_err = TAPI_API_SUCCESS; + + tet_infoline("utc_tel_select_network_manual, Test Start\n"); + + api_err = tel_init(); + if (api_err != TAPI_API_SUCCESS) { + printf("tel_init Failed api_err = %d \n", api_err); + } + api_err = tel_register_event(TAPI_EVENT_NETWORK_SELECT_CNF, &subscription_id1, (TelAppCallback) &callback, NULL); + if (api_err != TAPI_API_SUCCESS) { + printf("TapiCommonRegisterEvent Failed api_err = %d \n", api_err); + } + printf("after TapiCommonRegisterEvent sub id is %d api_err is %d\n", subscription_id1, api_err); + + tel_register_app_name("org.samsung.test"); + return; +} + +static void cleanup() +{ + tet_infoline("utc_tel_select_network_manual, Test Finished\n"); + tel_deregister_event(subscription_id1); + tel_deinit(); + return; +} + + +/* + Unit Test Case functions +*/ + +/** + * @brief This tests tel_select_network_manual() API in normal conditions + * @par ID: + * utc_tel_select_network_manual_01 + * @code + + pSystemId -> SystemType = TAPI_NETWORK_SYSTEM_GSM; + pSystemId -> ServiceType = TAPI_NETWORK_SERVICE_TYPE_COMBINED; + pSystemId -> SysIdFormat = TAPI_NETWORK_SYSID_FORMAT_PLMN; + pSystemId -> NetworkMode = TAPI_NETWORK_MODE_AUTOMATIC; + pSystemId -> SysId = 12345; + pSystemId -> bPlmnForbidden = FALSE; + pSystemId -> bHome = TRUE; + pSystemId -> bEquivalentPlmn = TRUE; + pSystemId -> bNetworkIdentityAvail = TRUE; + pSystemId -> bNetworkTimeAvail = TRUE; + pSystemId -> bNetworkTimeZoneAvail = TRUE; + pSystemId -> bNetworkDlsAvail = TRUE; + memcpy(pSystemId -> szSystemName, "XO", 2); + memcpy(pSystemId -> szSpn, "Vodafone", 9); + pSystemId -> NetworkTimeZone.Year = 1970; + pSystemId -> NetworkTimeZone.Month = 01; + pSystemId -> NetworkTimeZone.Day = 01; + pSystemId -> NetworkTimeZone.Hour = 01; + pSystemId -> NetworkTimeZone.Minute = 01; + pSystemId -> NetworkTimeZone.Second = 01; + pSystemId -> NetworkTimeZone.DaylightSave = TAPI_NETWORK_DLS_ADJ_NO_ADJUSTMENT; + pSystemId -> bMncIncludesPcsDigit = TRUE; + ret_val = tel_select_network_manual(pSystemId, &pRequestId); + ret_val = tel_select_network_manual(&pRequestId); +* @endcode +* @param [out] pRequestId +* @return TAPI_API_SUCCESS - indicating that the operation has completed successfully. +*/ +void utc_tel_select_network_manual_01() +{ + TapiResult_t ret_val = TAPI_API_SUCCESS; + unsigned int Plmn = 40405; + int pRequestId; + pRequestId = -1; + + tet_infoline("utc_tel_select_network_manual_01 Test\n"); + /* Selection of Network done*/ + /*************************/ + ret_val = tel_select_network_manual(Plmn, &pRequestId); + + TET_CHECK(TAPI_API_SUCCESS, ret_val); + + tet_infoline("utc_tel_select_network_manual_01 is passed\n"); + tet_result(TET_PASS); + + return; +} + +/** + * @brief This tests tel_select_network_manual() API in abnormal conditions + * @par ID: + * utc_tel_select_network_manual_02 + * @code + + pRequestId = NULL; + ret_val = tel_select_network_manual(&pRequestId); +* @endcode +* @param [out] pRequestId +* @return TAPI_API_INVALID_PTR + */ +void utc_tel_select_network_manual_02() +{ + TapiResult_t ret_val = TAPI_API_SUCCESS; + + unsigned int Plmn = 1; + + tet_infoline("utc_tel_select_network_manual_02 Test\n"); + + ret_val = tel_select_network_manual(Plmn, NULL); + TET_CHECK(TAPI_API_INVALID_PTR, ret_val); + + tet_infoline("utc_tel_select_network_manual_02 is passed\n"); + tet_result(TET_PASS); + + return; +} + +void utc_tel_select_network_manual_03() +{ + TapiResult_t ret_val = TAPI_API_SUCCESS; + + unsigned int Plmn = -1; + + tet_infoline("utc_tel_select_network_manual_02 Test\n"); + + ret_val = tel_select_network_manual(Plmn, NULL); + TET_CHECK(TAPI_API_INVALID_PTR, ret_val); + + tet_infoline("utc_tel_select_network_manual_03 is passed\n"); + tet_result(TET_PASS); + + return; +} + +/** @} */ diff --git a/TC/telephony_TC/network/unit/uts_tel_select_network_manual.h b/TC/telephony_TC/network/unit/uts_tel_select_network_manual.h new file mode 100644 index 0000000..da4160b --- /dev/null +++ b/TC/telephony_TC/network/unit/uts_tel_select_network_manual.h @@ -0,0 +1,31 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * 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. + */ + + +static void startup(); +static void cleanup(); + +static void utc_tel_select_network_manual_01(); +static void utc_tel_select_network_manual_02(); + +/** @} */ + + + diff --git a/TC/telephony_TC/network/unit/uts_tel_set_network_band.c b/TC/telephony_TC/network/unit/uts_tel_set_network_band.c new file mode 100644 index 0000000..ae24ee8 --- /dev/null +++ b/TC/telephony_TC/network/unit/uts_tel_set_network_band.c @@ -0,0 +1,1303 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * 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 "tel_tapi_nw_common.h" +#include "uts_tel_set_network_band.h" + +TS_UINT subscription_id = 0, subscription_id1 = 0; + +/* Initialize TCM data structures */ +static void startup(); +static void cleanup(); +void (*tet_startup) () = startup; +void (*tet_cleanup) () = cleanup; +struct tet_testlist tet_testlist[] = { + {utc_tel_set_network_band_01, 1}, + {utc_tel_set_network_band_02, 2}, + {utc_tel_set_network_band_03, 3}, + {utc_tel_set_network_band_04, 4}, + {utc_tel_set_network_band_05, 5}, + {utc_tel_set_network_band_06, 6}, + {utc_tel_set_network_band_07, 7}, + {utc_tel_set_network_band_08, 8}, + {utc_tel_set_network_band_09, 9}, + {utc_tel_set_network_band_10, 10}, + {utc_tel_set_network_band_11, 11}, + {utc_tel_set_network_band_12, 12}, + {utc_tel_set_network_band_13, 13}, + {utc_tel_set_network_band_14, 14}, + {utc_tel_set_network_band_15, 15}, + {utc_tel_set_network_band_16, 16}, + {utc_tel_set_network_band_17, 17}, + {utc_tel_set_network_band_18, 18}, + {utc_tel_set_network_band_19, 19}, + {utc_tel_set_network_band_20, 20}, + {utc_tel_set_network_band_21, 21}, + {utc_tel_set_network_band_22, 22}, + {utc_tel_set_network_band_23, 23}, + {utc_tel_set_network_band_24, 24}, + {utc_tel_set_network_band_25, 25}, + {utc_tel_set_network_band_26, 26}, + {utc_tel_set_network_band_27, 27}, + {utc_tel_set_network_band_28, 28}, + {utc_tel_set_network_band_29, 29}, + {utc_tel_set_network_band_30, 30}, + {NULL, 0} +}; + +/* Startup & Clean function : It is not test code, only for + initialize and finalize test module + */ +static void startup() +{ + TapiResult_t api_err = TAPI_API_SUCCESS; + tet_infoline("utc_tel_set_network_band, Test Start\n"); + + api_err = tel_init(); + if (api_err != TAPI_API_SUCCESS) { + printf("tel_init Failed api_err = %d \n", api_err); + } + + api_err = tel_register_event(TAPI_EVENT_NETWORK_SETNWBAND_CNF, &subscription_id1, tapi_callback, NULL); + if (api_err != TAPI_API_SUCCESS) { + printf("TapiCommonRegisterEvent Failed api_err = %d \n", api_err); + } + printf("after TapiCommonRegisterEvent sub id is %d api_err is %d\n", subscription_id1, api_err); + + tel_register_app_name("org.samsung.test"); + return; +} + +static void cleanup() +{ + tet_infoline("utc_tel_set_network_band, Test Finished\n"); + tel_deregister_event(subscription_id1); + tel_deinit(); + return; +} + + +/* + Unit Test Case functions +*/ + +/** + * @brief This tests tel_set_network_band() API in normal conditions + * @par ID: + * utc_tel_set_network_band_01 + * @param [in] BandMode + * @param [in] Band + * @code + + BandMode = TAPI_NETWORK_BAND_MODE_PREFERRED; + Band = TAPI_NETWORK_BAND_TYPE_ANY; + pRequestId = -1; + +* @endcode +* @param [out] pRequestId +* @return TAPI_API_SUCCESS - indicating that the operation has completed successfully. +*/ +void utc_tel_set_network_band_01() +{ + TapiResult_t ret_val = TAPI_API_SUCCESS; + + TelNetworkBandPreferred_t BandMode; + TelNetworkBand_t Band; + int pRequestId; + + BandMode = TAPI_NETWORK_BAND_MODE_PREFERRED; + Band = TAPI_NETWORK_BAND_TYPE_ANY; + pRequestId = -1; + + tet_infoline("utc_tel_set_network_band_01 Test\n"); + + ret_val = tel_set_network_band(BandMode, Band, &pRequestId); + TET_CHECK(TAPI_API_SUCCESS, ret_val); + + tet_infoline("utc_tel_set_network_band_01 is passed\n"); + tet_result(TET_PASS); + + return; +} + +/** + * @brief This tests tel_set_network_band() API in normal conditions + * @par ID: + * utc_tel_set_network_band_02 + * @param [in] BandMode + * @param [in] Band + * @code + + BandMode = TAPI_NETWORK_BAND_MODE_PREFERRED; + Band = TAPI_NETWORK_BAND_TYPE_GSM850; + pRequestId = -1; + + * @endcode + * @param [out] pRequestId + * @return TAPI_API_INVALID_INPUT + */ + +void utc_tel_set_network_band_02() +{ + TapiResult_t ret_val = TAPI_API_SUCCESS; + + TelNetworkBandPreferred_t BandMode; + TelNetworkBand_t Band; + int *pRequestId; + + BandMode = TAPI_NETWORK_BAND_MODE_PREFERRED; + Band = TAPI_NETWORK_BAND_TYPE_GSM850; + pRequestId = NULL; + + tet_infoline("utc_tel_set_network_band_02 Test\n"); + + ret_val = tel_set_network_band(BandMode, Band, pRequestId); + TET_CHECK(TAPI_API_INVALID_PTR, ret_val); + + tet_infoline("utc_tel_set_network_band_02 is passed\n"); + tet_result(TET_PASS); + + return; +} + +/** + * @brief This tests tel_set_network_band() API in normal conditions + * @par ID: + * utc_tel_set_network_band_03 + * @param [in] BandMode + * @param [in] Band + * @code + + BandMode = TAPI_NETWORK_BAND_MODE_PREFERRED; + Band = TAPI_NETWORK_BAND_TYPE_GSM_900_1800; + pRequestId = -1; + + * @endcode + * @param [out] pRequestId + * @return TAPI_API_SUCCESS - indicating that the operation has completed successfully. + */ + +void utc_tel_set_network_band_03() +{ + TapiResult_t ret_val = TAPI_API_SUCCESS; + + TelNetworkBandPreferred_t BandMode; + TelNetworkBand_t Band; + int pRequestId; + + BandMode = TAPI_NETWORK_BAND_MODE_PREFERRED; + Band = TAPI_NETWORK_BAND_TYPE_GSM_900_1800; + pRequestId = -1; + + tet_infoline("utc_tel_set_network_band_03 Test\n"); + + ret_val = tel_set_network_band(BandMode, Band, &pRequestId); + TET_CHECK(TAPI_API_SUCCESS, ret_val); + + tet_infoline("utc_tel_set_network_band_03 is passed\n"); + tet_result(TET_PASS); + + return; +} + +/** + * @brief This tests tel_set_network_band() API in normal conditions + * @par ID: + * utc_tel_set_network_band_04 + * @param [in] BandMode + * @param [in] Band + * @code + + BandMode = TAPI_NETWORK_BAND_MODE_PREFERRED; + Band = TAPI_NETWORK_BAND_TYPE_GSM1900; + pRequestId = -1; + + * @endcode + * @param [out] pRequestId + * @return TAPI_API_SUCCESS - indicating that the operation has completed successfully. + */ + +void utc_tel_set_network_band_04() +{ + TapiResult_t ret_val = TAPI_API_SUCCESS; + + TelNetworkBandPreferred_t BandMode; + TelNetworkBand_t Band; + int pRequestId; + + BandMode = TAPI_NETWORK_BAND_MODE_PREFERRED; + Band = TAPI_NETWORK_BAND_TYPE_GSM1900; + pRequestId = -1; + + tet_infoline("utc_tel_set_network_band_04 Test\n"); + + ret_val = tel_set_network_band(BandMode, Band, &pRequestId); + TET_CHECK(TAPI_API_SUCCESS, ret_val); + + tet_infoline("utc_tel_set_network_band_04 is passed\n"); + tet_result(TET_PASS); + + return; +} + +/** + * @brief This tests tel_set_network_band() API in normal conditions + * @par ID: + * utc_tel_set_network_band_05 + * @param [in] BandMode + * @param [in] Band + * @code + + BandMode = TAPI_NETWORK_BAND_MODE_PREFERRED; + Band = TAPI_NETWORK_BAND_TYPE_GSM; + pRequestId = -1; + + * @endcode + * @param [out] pRequestId + * @return TAPI_API_INVALID_INPUT + */ + +void utc_tel_set_network_band_05() +{ + TapiResult_t ret_val = TAPI_API_SUCCESS; + + TelNetworkBandPreferred_t BandMode; + TelNetworkBand_t Band; + int *pRequestId; + + BandMode = TAPI_NETWORK_BAND_MODE_PREFERRED; + Band = TAPI_NETWORK_BAND_TYPE_GSM; + pRequestId = NULL; + + tet_infoline("utc_tel_set_network_band_05 Test\n"); + + ret_val = tel_set_network_band(BandMode, Band, pRequestId); + TET_CHECK(TAPI_API_INVALID_PTR, ret_val); + + tet_infoline("utc_tel_set_network_band_05 is passed\n"); + tet_result(TET_PASS); + + return; +} + +/** + * @brief This tests tel_set_network_band() API in normal conditions + * @par ID: + * utc_tel_set_network_band_06 + * @param [in] BandMode + * @param [in] Band + * @code + + BandMode = TAPI_NETWORK_BAND_MODE_PREFERRED; + Band = TAPI_NETWORK_BAND_TYPE_WCDMA; + pRequestId = -1; + + * @endcode + * @param [out] pRequestId + * @return TAPI_API_SUCCESS - indicating that the operation has completed successfully. + */ + +void utc_tel_set_network_band_06() +{ + TapiResult_t ret_val = TAPI_API_SUCCESS; + + TelNetworkBandPreferred_t BandMode; + TelNetworkBand_t Band; + int pRequestId; + + BandMode = TAPI_NETWORK_BAND_MODE_PREFERRED; + Band = TAPI_NETWORK_BAND_TYPE_WCDMA; + pRequestId = -1; + + tet_infoline("utc_tel_set_network_band_06 Test\n"); + + ret_val = tel_set_network_band(BandMode, Band, &pRequestId); + TET_CHECK(TAPI_API_SUCCESS, ret_val); + + tet_infoline("utc_tel_set_network_band_06 is passed\n"); + tet_result(TET_PASS); + + return; +} + +/** + * @brief This tests tel_set_network_band() API in normal conditions + * @par ID: + * utc_tel_set_network_band_07 + * @param [in] BandMode + * @param [in] Band + * @code + + BandMode = TAPI_NETWORK_BAND_MODE_PREFERRED; + Band = TAPI_NETWORK_BAND_TYPE_WCDMA850; + pRequestId = -1; + + * @endcode + * @param [out] pRequestId + * @return TAPI_API_INVALID_INPUT + */ + +void utc_tel_set_network_band_07() +{ + TapiResult_t ret_val = TAPI_API_SUCCESS; + + TelNetworkBandPreferred_t BandMode; + TelNetworkBand_t Band; + int pRequestId; + + BandMode = TAPI_NETWORK_BAND_MODE_PREFERRED; + Band = TAPI_NETWORK_BAND_TYPE_WCDMA850; + pRequestId = -1; + + tet_infoline("utc_tel_set_network_band_07 Test\n"); + + ret_val = tel_set_network_band(BandMode, Band, &pRequestId); + TET_CHECK(TAPI_API_INVALID_INPUT, ret_val); + + tet_infoline("utc_tel_set_network_band_07 is passed\n"); + tet_result(TET_PASS); + + return; +} + +/** + * @brief This tests tel_set_network_band() API in normal conditions + * @par ID: + * utc_tel_set_network_band_08 + * @param [in] BandMode + * @param [in] Band + * @code + + BandMode = TAPI_NETWORK_BAND_MODE_PREFERRED; + Band = TAPI_NETWORK_BAND_TYPE_WCDMA1900; + pRequestId = -1; + + * @endcode + * @param [out] pRequestId + * @return TAPI_API_INVALID_INPUT + */ + +void utc_tel_set_network_band_08() +{ + TapiResult_t ret_val = TAPI_API_SUCCESS; + + TelNetworkBandPreferred_t BandMode; + TelNetworkBand_t Band; + int pRequestId; + + BandMode = TAPI_NETWORK_BAND_MODE_PREFERRED; + Band = TAPI_NETWORK_BAND_TYPE_WCDMA1900; + pRequestId = -1; + + tet_infoline("utc_tel_set_network_band_08 Test\n"); + + ret_val = tel_set_network_band(BandMode, Band, &pRequestId); + TET_CHECK(TAPI_API_INVALID_INPUT, ret_val); + + tet_infoline("utc_tel_set_network_band_08 is passed\n"); + tet_result(TET_PASS); + + return; +} + +/** + * @brief This tests tel_set_network_band() API in normal conditions + * @par ID: + * utc_tel_set_network_band_09 + * @param [in] BandMode + * @param [in] Band + * @code + + BandMode = TAPI_NETWORK_BAND_MODE_PREFERRED; + Band = TAPI_NETWORK_BAND_TYPE_WCDMA2100; + pRequestId = -1; + + * @endcode + * @param [out] pRequestId + * @return TAPI_API_INVALID_INPUT + */ + +void utc_tel_set_network_band_09() +{ + TapiResult_t ret_val = TAPI_API_SUCCESS; + + TelNetworkBandPreferred_t BandMode; + TelNetworkBand_t Band; + int pRequestId; + + BandMode = TAPI_NETWORK_BAND_MODE_PREFERRED; + Band = TAPI_NETWORK_BAND_TYPE_WCDMA2100; + pRequestId = -1; + + tet_infoline("utc_tel_set_network_band_09 Test\n"); + + ret_val = tel_set_network_band(BandMode, Band, &pRequestId); + TET_CHECK(TAPI_API_INVALID_INPUT, ret_val); + + tet_infoline("utc_tel_set_network_band_09 is passed\n"); + tet_result(TET_PASS); + + return; +} + +/** + * @brief This tests tel_set_network_band() API when one of the argument is invalid + * @par ID: + * utc_tel_set_network_band_10 + * @param [in] BandMode + * @param [in] Band + * @code + + BandMode = TAPI_NETWORK_BAND_MODE_PREFERRED; + Band = -1; + pRequestId = -1; + + * @endcode + * @param [out] pRequestId + * @return TAPI_API_INVALID_INPUT + */ + +void utc_tel_set_network_band_10() +{ + TapiResult_t ret_val = TAPI_API_SUCCESS; + + TelNetworkBandPreferred_t BandMode; + TelNetworkBand_t Band; + int pRequestId; + + BandMode = TAPI_NETWORK_BAND_MODE_PREFERRED; + Band = -1; + pRequestId = -1; + + tet_infoline("utc_tel_set_network_band_10 Test\n"); + + ret_val = tel_set_network_band(BandMode, Band, &pRequestId); + TET_CHECK(TAPI_API_INVALID_INPUT, ret_val); + + tet_infoline("utc_tel_set_network_band_10 is passed\n"); + tet_result(TET_PASS); + + return; +} + +/** + * @brief This tests tel_set_network_band() API in normal conditions + * @par ID: + * utc_tel_set_network_band_11 + * @param [in] BandMode + * @param [in] Band + * @code + + BandMode = TAPI_NETWORK_BAND_MODE_ONLY; + Band = TAPI_NETWORK_BAND_TYPE_ANY; + pRequestId = -1; + + * @endcode + * @param [out] pRequestId + * @return TAPI_API_SUCCESS - indicating that the operation has completed successfully. + */ + +void utc_tel_set_network_band_11() +{ + TapiResult_t ret_val = TAPI_API_SUCCESS; + + TelNetworkBandPreferred_t BandMode; + TelNetworkBand_t Band; + int pRequestId; + + BandMode = TAPI_NETWORK_BAND_MODE_ONLY; + Band = TAPI_NETWORK_BAND_TYPE_ANY; + pRequestId = -1; + + tet_infoline("utc_tel_set_network_band_11 Test\n"); + + ret_val = tel_set_network_band(BandMode, Band, &pRequestId); + TET_CHECK(TAPI_API_SUCCESS, ret_val); + + tet_infoline("utc_tel_set_network_band_11 is passed\n"); + tet_result(TET_PASS); + + return; +} + +/** + * @brief This tests tel_set_network_band() API in normal conditions + * @par ID: + * utc_tel_set_network_band_12 + * @param [in] BandMode + * @param [in] Band + * @code + + BandMode = TAPI_NETWORK_BAND_MODE_ONLY; + Band = TAPI_NETWORK_BAND_TYPE_GSM850; + pRequestId = -1; + + * @endcode + * @param [out] pRequestId + * @return TAPI_API_INVALID_INPUT + */ + +void utc_tel_set_network_band_12() +{ + TapiResult_t ret_val = TAPI_API_SUCCESS; + + TelNetworkBandPreferred_t BandMode; + TelNetworkBand_t Band; + int *pRequestId; + + BandMode = TAPI_NETWORK_BAND_MODE_ONLY; + Band = TAPI_NETWORK_BAND_TYPE_GSM850; + pRequestId = NULL; + + tet_infoline("utc_tel_set_network_band_12 Test\n"); + + ret_val = tel_set_network_band(BandMode, Band, pRequestId); + TET_CHECK(TAPI_API_INVALID_PTR, ret_val); + + tet_infoline("utc_tel_set_network_band_12 is passed\n"); + tet_result(TET_PASS); + + return; +} + +/** + * @brief This tests tel_set_network_band() API in normal conditions + * @par ID: + * utc_tel_set_network_band_13 + * @param [in] BandMode + * @param [in] Band + * @code + + BandMode = TAPI_NETWORK_BAND_MODE_ONLY; + Band = TAPI_NETWORK_BAND_TYPE_GSM_900_1800; + pRequestId = -1; + + * @endcode + * @param [out] pRequestId + * @return TAPI_API_SUCCESS - indicating that the operation has completed successfully. + */ + +void utc_tel_set_network_band_13() +{ + TapiResult_t ret_val = TAPI_API_SUCCESS; + + TelNetworkBandPreferred_t BandMode; + TelNetworkBand_t Band; + int pRequestId; + + BandMode = TAPI_NETWORK_BAND_MODE_ONLY; + Band = TAPI_NETWORK_BAND_TYPE_GSM_900_1800; + pRequestId = -1; + + tet_infoline("utc_tel_set_network_band_13 Test\n"); + + ret_val = tel_set_network_band(BandMode, Band, &pRequestId); + TET_CHECK(TAPI_API_SUCCESS, ret_val); + + tet_infoline("utc_tel_set_network_band_13 is passed\n"); + tet_result(TET_PASS); + + return; +} + +/** + * @brief This tests tel_set_network_band() API in normal conditions + * @par ID: + * utc_tel_set_network_band_14 + * @param [in] BandMode + * @param [in] Band + * @code + + BandMode = TAPI_NETWORK_BAND_MODE_ONLY; + Band = TAPI_NETWORK_BAND_TYPE_GSM1900; + pRequestId = -1; + + * @endcode + * @param [out] pRequestId + * @return TAPI_API_SUCCESS - indicating that the operation has completed successfully. + */ + +void utc_tel_set_network_band_14() +{ + TapiResult_t ret_val = TAPI_API_SUCCESS; + + TelNetworkBandPreferred_t BandMode; + TelNetworkBand_t Band; + int pRequestId; + + BandMode = TAPI_NETWORK_BAND_MODE_ONLY; + Band = TAPI_NETWORK_BAND_TYPE_GSM1900; + pRequestId = -1; + + tet_infoline("utc_tel_set_network_band_14 Test\n"); + + ret_val = tel_set_network_band(BandMode, Band, &pRequestId); + TET_CHECK(TAPI_API_SUCCESS, ret_val); + + tet_infoline("utc_tel_set_network_band_14 is passed\n"); + tet_result(TET_PASS); + + return; +} + +/** + * @brief This tests tel_set_network_band() API in normal conditions + * @par ID: + * utc_tel_set_network_band_15 + * @param [in] BandMode + * @param [in] Band + * @code + + BandMode = TAPI_NETWORK_BAND_MODE_ONLY; + Band = TAPI_NETWORK_BAND_TYPE_GSM; + pRequestId = -1; + + * @endcode + * @param [out] pRequestId + * @return TAPI_API_INVALID_INPUT + */ + +void utc_tel_set_network_band_15() +{ + TapiResult_t ret_val = TAPI_API_SUCCESS; + + TelNetworkBandPreferred_t BandMode; + TelNetworkBand_t Band; + int *pRequestId; + + BandMode = TAPI_NETWORK_BAND_MODE_ONLY; + Band = TAPI_NETWORK_BAND_TYPE_GSM; + pRequestId = NULL; + + tet_infoline("utc_tel_set_network_band_15 Test\n"); + + ret_val = tel_set_network_band(BandMode, Band, pRequestId); + TET_CHECK(TAPI_API_INVALID_PTR, ret_val); + + tet_infoline("utc_tel_set_network_band_15 is passed\n"); + tet_result(TET_PASS); + + return; +} + +/** + * @brief This tests tel_set_network_band() API in normal conditions + * @par ID: + * utc_tel_set_network_band_16 + * @param [in] BandMode + * @param [in] Band + * @code + + BandMode = TAPI_NETWORK_BAND_MODE_ONLY; + Band = TAPI_NETWORK_BAND_TYPE_WCDMA; + pRequestId = -1; + + * @endcode + * @param [out] pRequestId + * @return TAPI_API_SUCCESS - indicating that the operation has completed successfully. + */ + +void utc_tel_set_network_band_16() +{ + TapiResult_t ret_val = TAPI_API_SUCCESS; + + TelNetworkBandPreferred_t BandMode; + TelNetworkBand_t Band; + int pRequestId; + + BandMode = TAPI_NETWORK_BAND_MODE_ONLY; + Band = TAPI_NETWORK_BAND_TYPE_WCDMA; + pRequestId = -1; + + tet_infoline("utc_tel_set_network_band_16 Test\n"); + + ret_val = tel_set_network_band(BandMode, Band, &pRequestId); + TET_CHECK(TAPI_API_SUCCESS, ret_val); + + tet_infoline("utc_tel_set_network_band_16 is passed\n"); + tet_result(TET_PASS); + + return; +} + +/** + * @brief This tests tel_set_network_band() API in normal conditions + * @par ID: + * utc_tel_set_network_band_17 + * @param [in] BandMode + * @param [in] Band + * @code + + BandMode = TAPI_NETWORK_BAND_MODE_ONLY; + Band = TAPI_NETWORK_BAND_TYPE_WCDMA850; + pRequestId = -1; + + * @endcode + * @param [out] pRequestId + * @return TAPI_API_INVALID_INPUT + */ + +void utc_tel_set_network_band_17() +{ + TapiResult_t ret_val = TAPI_API_SUCCESS; + + TelNetworkBandPreferred_t BandMode; + TelNetworkBand_t Band; + int pRequestId; + + BandMode = TAPI_NETWORK_BAND_MODE_ONLY; + Band = TAPI_NETWORK_BAND_TYPE_WCDMA850; + pRequestId = -1; + + tet_infoline("utc_tel_set_network_band_17 Test\n"); + + ret_val = tel_set_network_band(BandMode, Band, &pRequestId); + TET_CHECK(TAPI_API_INVALID_INPUT, ret_val); + + tet_infoline("utc_tel_set_network_band_17 is passed\n"); + tet_result(TET_PASS); + + return; +} + +/** + * @brief This tests tel_set_network_band() API in normal conditions + * @par ID: + * utc_tel_set_network_band_18 + * @param [in] BandMode + * @param [in] Band + * @code + + BandMode = TAPI_NETWORK_BAND_MODE_ONLY; + Band = TAPI_NETWORK_BAND_TYPE_WCDMA1900; + pRequestId = -1; + + * @endcode + * @param [out] pRequestId + * @return TAPI_API_INVALID_INPUT + */ + +void utc_tel_set_network_band_18() +{ + TapiResult_t ret_val = TAPI_API_SUCCESS; + + TelNetworkBandPreferred_t BandMode; + TelNetworkBand_t Band; + int pRequestId; + + BandMode = TAPI_NETWORK_BAND_MODE_ONLY; + Band = TAPI_NETWORK_BAND_TYPE_WCDMA1900; + pRequestId = -1; + + tet_infoline("utc_tel_set_network_band_18 Test\n"); + + ret_val = tel_set_network_band(BandMode, Band, &pRequestId); + TET_CHECK(TAPI_API_INVALID_INPUT, ret_val); + + tet_infoline("utc_tel_set_network_band_18 is passed\n"); + tet_result(TET_PASS); + + return; +} + +/** + * @brief This tests tel_set_network_band() API in normal conditions + * @par ID: + * utc_tel_set_network_band_19 + * @param [in] BandMode + * @param [in] Band + * @code + + BandMode = TAPI_NETWORK_BAND_MODE_ONLY; + Band = TAPI_NETWORK_BAND_TYPE_WCDMA2100; + pRequestId = -1; + + * @endcode + * @param [out] pRequestId + * @return TAPI_API_INVALID_INPUT + */ + +void utc_tel_set_network_band_19() +{ + TapiResult_t ret_val = TAPI_API_SUCCESS; + + TelNetworkBandPreferred_t BandMode; + TelNetworkBand_t Band; + int pRequestId; + + BandMode = TAPI_NETWORK_BAND_MODE_ONLY; + Band = TAPI_NETWORK_BAND_TYPE_WCDMA2100; + pRequestId = -1; + + tet_infoline("utc_tel_set_network_band_19 Test\n"); + + ret_val = tel_set_network_band(BandMode, Band, &pRequestId); + TET_CHECK(TAPI_API_INVALID_INPUT, ret_val); + + tet_infoline("utc_tel_set_network_band_19 is passed\n"); + tet_result(TET_PASS); + + return; +} + +/** + * @brief This tests tel_set_network_band() API when one of the argument is invalid + * @par ID: + * utc_tel_set_network_band_20 + * @param [in] BandMode + * @param [in] Band + * @code + + BandMode = TAPI_NETWORK_BAND_MODE_ONLY; + Band = -1; + pRequestId = -1; + + * @endcode + * @param [out] pRequestId + * @return TAPI_API_SUCCESS - indicating that the operation has completed successfully. + */ + +void utc_tel_set_network_band_20() +{ + TapiResult_t ret_val = TAPI_API_SUCCESS; + + TelNetworkBandPreferred_t BandMode; + TelNetworkBand_t Band; + int pRequestId; + + BandMode = TAPI_NETWORK_BAND_MODE_ONLY; + Band = -1; + pRequestId = -1; + + tet_infoline("utc_tel_set_network_band_20 Test\n"); + + ret_val = tel_set_network_band(BandMode, Band, &pRequestId); + TET_CHECK(TAPI_API_INVALID_INPUT, ret_val); + + tet_infoline("utc_tel_set_network_band_20 is passed\n"); + tet_result(TET_PASS); + + return; +} + +/** + * @brief This tests tel_set_network_band() API when one of the argument is invalid + * @par ID: + * utc_tel_set_network_band_21 + * @param [in] BandMode + * @param [in] Band + * @code + + BandMode = -1; + Band = TAPI_NETWORK_BAND_TYPE_ANY; + pRequestId = -1; + + * @endcode + * @param [out] pRequestId + * @return TAPI_API_SUCCESS - indicating that the operation has completed successfully. + */ + +void utc_tel_set_network_band_21() +{ + TapiResult_t ret_val = TAPI_API_SUCCESS; + + TelNetworkBandPreferred_t BandMode; + TelNetworkBand_t Band; + int pRequestId; + + BandMode = -1; + Band = TAPI_NETWORK_BAND_TYPE_ANY; + pRequestId = -1; + + tet_infoline("utc_tel_set_network_band_21 Test\n"); + + ret_val = tel_set_network_band(BandMode, Band, &pRequestId); + TET_CHECK(TAPI_API_INVALID_INPUT, ret_val); + + tet_infoline("utc_tel_set_network_band_21 is passed\n"); + tet_result(TET_PASS); + + return; +} + +/** + * @brief This tests tel_set_network_band() API when one of the argument is invalid + * @par ID: + * utc_tel_set_network_band_22 + * @param [in] BandMode + * @param [in] Band + * @code + + BandMode = -1; + Band = TAPI_NETWORK_BAND_TYPE_GSM850; + pRequestId = -1; + + * @endcode + * @param [out] pRequestId + * @return TAPI_API_INVALID_INPUT + */ + +void utc_tel_set_network_band_22() +{ + TapiResult_t ret_val = TAPI_API_SUCCESS; + + TelNetworkBandPreferred_t BandMode; + TelNetworkBand_t Band; + int pRequestId; + + BandMode = -1; + Band = TAPI_NETWORK_BAND_TYPE_GSM850; + pRequestId = -1; + + tet_infoline("utc_tel_set_network_band_22 Test\n"); + + ret_val = tel_set_network_band(BandMode, Band, &pRequestId); + TET_CHECK(TAPI_API_INVALID_INPUT, ret_val); + + tet_infoline("utc_tel_set_network_band_22 is passed\n"); + tet_result(TET_PASS); + + return; +} + +/** + * @brief This tests tel_set_network_band() API when one of the argument is invalid + * @par ID: + * utc_tel_set_network_band_23 + * @param [in] BandMode + * @param [in] Band + * @code + + BandMode = -1; + Band = TAPI_NETWORK_BAND_TYPE_GSM_900_1800; + pRequestId = -1; + + * @endcode + * @param [out] pRequestId + * @return TAPI_API_SUCCESS - indicating that the operation has completed successfully. + */ + +void utc_tel_set_network_band_23() +{ + TapiResult_t ret_val = TAPI_API_SUCCESS; + + TelNetworkBandPreferred_t BandMode; + TelNetworkBand_t Band; + int pRequestId; + + BandMode = -1; + Band = TAPI_NETWORK_BAND_TYPE_GSM_900_1800; + pRequestId = -1; + + tet_infoline("utc_tel_set_network_band_23 Test\n"); + + ret_val = tel_set_network_band(BandMode, Band, &pRequestId); + TET_CHECK(TAPI_API_INVALID_INPUT, ret_val); + + tet_infoline("utc_tel_set_network_band_23 is passed\n"); + tet_result(TET_PASS); + + return; +} + +/** + * @brief This tests tel_set_network_band() API when one of the argument is invalid + * @par ID: + * utc_tel_set_network_band_24 + * @param [in] BandMode + * @param [in] Band + * @code + + BandMode = -1; + Band = TAPI_NETWORK_BAND_TYPE_GSM1900; + pRequestId = -1; + + * @endcode + * @param [out] pRequestId + * @return TAPI_API_SUCCESS - indicating that the operation has completed successfully. + */ + +void utc_tel_set_network_band_24() +{ + TapiResult_t ret_val = TAPI_API_SUCCESS; + + TelNetworkBandPreferred_t BandMode; + TelNetworkBand_t Band; + int pRequestId; + + BandMode = -1; + Band = TAPI_NETWORK_BAND_TYPE_GSM1900; + pRequestId = -1; + + tet_infoline("utc_tel_set_network_band_24 Test\n"); + + ret_val = tel_set_network_band(BandMode, Band, &pRequestId); + TET_CHECK(TAPI_API_INVALID_INPUT, ret_val); + + tet_infoline("utc_tel_set_network_band_24 is passed\n"); + tet_result(TET_PASS); + + return; +} + +/** + * @brief This tests tel_set_network_band() API when one of the argument is invalid + * @par ID: + * utc_tel_set_network_band_25 + * @param [in] BandMode + * @param [in] Band + * @code + + BandMode = -1; + Band = TAPI_NETWORK_BAND_TYPE_GSM; + pRequestId = -1; + + * @endcode + * @param [out] pRequestId + * @return TAPI_API_SUCCESS - indicating that the operation has completed successfully. + */ + +void utc_tel_set_network_band_25() +{ + TapiResult_t ret_val = TAPI_API_SUCCESS; + + TelNetworkBandPreferred_t BandMode; + TelNetworkBand_t Band; + int pRequestId; + + BandMode = -1; + Band = TAPI_NETWORK_BAND_TYPE_GSM; + pRequestId = -1; + + tet_infoline("utc_tel_set_network_band_25 Test\n"); + + ret_val = tel_set_network_band(BandMode, Band, &pRequestId); + TET_CHECK(TAPI_API_INVALID_INPUT, ret_val); + + tet_infoline("utc_tel_set_network_band_25 is passed\n"); + tet_result(TET_PASS); + + return; +} + +/** + * @brief This tests tel_set_network_band() API when one of the argument is invalid + * @par ID: + * utc_tel_set_network_band_26 + * @param [in] BandMode + * @param [in] Band + * @code + + BandMode = -1; + Band = TAPI_NETWORK_BAND_TYPE_WCDMA; + pRequestId = -1; + + * @endcode + * @param [out] pRequestId + * @return TAPI_API_SUCCESS - indicating that the operation has completed successfully. + */ + +void utc_tel_set_network_band_26() +{ + TapiResult_t ret_val = TAPI_API_SUCCESS; + + TelNetworkBandPreferred_t BandMode; + TelNetworkBand_t Band; + int pRequestId; + + BandMode = -1; + Band = TAPI_NETWORK_BAND_TYPE_WCDMA; + pRequestId = -1; + + tet_infoline("utc_tel_set_network_band_26 Test\n"); + + ret_val = tel_set_network_band(BandMode, Band, &pRequestId); + TET_CHECK(TAPI_API_INVALID_INPUT, ret_val); + + tet_infoline("utc_tel_set_network_band_26 is passed\n"); + tet_result(TET_PASS); + + return; +} + +/** + * @brief This tests tel_set_network_band() API when one of the argument is invalid + * @par ID: + * utc_tel_set_network_band_27 + * @param [in] BandMode + * @param [in] Band + * @code + + BandMode = -1; + Band = TAPI_NETWORK_BAND_TYPE_WCDMA850; + pRequestId = -1; + + * @endcode + * @param [out] pRequestId + * @return TAPI_API_SUCCESS - indicating that the operation has completed successfully. + */ + +void utc_tel_set_network_band_27() +{ + TapiResult_t ret_val = TAPI_API_SUCCESS; + + TelNetworkBandPreferred_t BandMode; + TelNetworkBand_t Band; + int pRequestId; + + BandMode = -1; + Band = TAPI_NETWORK_BAND_TYPE_WCDMA850; + pRequestId = -1; + + tet_infoline("utc_tel_set_network_band_27 Test\n"); + + ret_val = tel_set_network_band(BandMode, Band, &pRequestId); + TET_CHECK(TAPI_API_INVALID_INPUT, ret_val); + + tet_infoline("utc_tel_set_network_band_27 is passed\n"); + tet_result(TET_PASS); + + return; +} + +/** + * @brief This tests tel_set_network_band() API when one of the argument is invalid + * @par ID: + * utc_tel_set_network_band_28 + * @param [in] BandMode + * @param [in] Band + * @code + + BandMode = -1; + Band = TAPI_NETWORK_BAND_TYPE_WCDMA1900; + pRequestId = -1; + + * @endcode + * @param [out] pRequestId + * @return TAPI_API_SUCCESS - indicating that the operation has completed successfully. + */ + +void utc_tel_set_network_band_28() +{ + TapiResult_t ret_val = TAPI_API_SUCCESS; + + TelNetworkBandPreferred_t BandMode; + TelNetworkBand_t Band; + int pRequestId; + + BandMode = -1; + Band = TAPI_NETWORK_BAND_TYPE_WCDMA1900; + pRequestId = -1; + + tet_infoline("utc_tel_set_network_band_28 Test\n"); + + ret_val = tel_set_network_band(BandMode, Band, &pRequestId); + TET_CHECK(TAPI_API_INVALID_INPUT, ret_val); + + tet_infoline("utc_tel_set_network_band_28 is passed\n"); + tet_result(TET_PASS); + + return; +} + +/** + * @brief This tests tel_set_network_band() API when one of the argument is invalid + * @par ID: + * utc_tel_set_network_band_29 + * @param [in] BandMode + * @param [in] Band + * @code + + BandMode = -1; + Band = TAPI_NETWORK_BAND_TYPE_WCDMA2100; + pRequestId = -1; + + * @endcode + * @param [out] pRequestId + * @return TAPI_API_SUCCESS - indicating that the operation has completed successfully. + */ + +void utc_tel_set_network_band_29() +{ + TapiResult_t ret_val = TAPI_API_SUCCESS; + + TelNetworkBandPreferred_t BandMode; + TelNetworkBand_t Band; + int pRequestId; + + BandMode = -1; + Band = TAPI_NETWORK_BAND_TYPE_WCDMA2100; + pRequestId = -1; + + tet_infoline("utc_tel_set_network_band_29 Test\n"); + + ret_val = tel_set_network_band(BandMode, Band, &pRequestId); + TET_CHECK(TAPI_API_INVALID_INPUT, ret_val); + + tet_infoline("utc_tel_set_network_band_29 is passed\n"); + tet_result(TET_PASS); + + return; +} + +/** + * @brief This tests tel_set_network_band() API when both the arguments are invalid + * @par ID: + * utc_tel_set_network_band_30 + * @param [in] BandMode + * @param [in] Band + * @code + + BandMode = -1; + Band = -1; + pRequestId = -1; + + * @endcode + * @param [out] pRequestId + * @return TAPI_API_SUCCESS - indicating that the operation has completed successfully. + */ + +void utc_tel_set_network_band_30() +{ + TapiResult_t ret_val = TAPI_API_SUCCESS; + + TelNetworkBandPreferred_t BandMode; + TelNetworkBand_t Band; + int pRequestId; + + BandMode = -1; + Band = -1; + pRequestId = -1; + + tet_infoline("utc_tel_set_network_band_30 Test\n"); + + ret_val = tel_set_network_band(BandMode, Band, &pRequestId); + TET_CHECK(TAPI_API_INVALID_INPUT, ret_val); + + tet_infoline("utc_tel_set_network_band_30 is passed\n"); + tet_result(TET_PASS); + + return; +} + +/** @} */ diff --git a/TC/telephony_TC/network/unit/uts_tel_set_network_band.h b/TC/telephony_TC/network/unit/uts_tel_set_network_band.h new file mode 100644 index 0000000..9cbf6f3 --- /dev/null +++ b/TC/telephony_TC/network/unit/uts_tel_set_network_band.h @@ -0,0 +1,53 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * 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. + */ +static void startup(); +static void cleanup(); +static void utc_tel_set_network_band_01(void); +static void utc_tel_set_network_band_02(void); +static void utc_tel_set_network_band_03(void); +static void utc_tel_set_network_band_04(void); +static void utc_tel_set_network_band_05(void); +static void utc_tel_set_network_band_06(void); +static void utc_tel_set_network_band_07(void); +static void utc_tel_set_network_band_08(void); +static void utc_tel_set_network_band_09(void); +static void utc_tel_set_network_band_10(void); +static void utc_tel_set_network_band_11(void); +static void utc_tel_set_network_band_12(void); +static void utc_tel_set_network_band_13(void); +static void utc_tel_set_network_band_14(void); +static void utc_tel_set_network_band_15(void); +static void utc_tel_set_network_band_16(void); +static void utc_tel_set_network_band_17(void); +static void utc_tel_set_network_band_18(void); +static void utc_tel_set_network_band_19(void); +static void utc_tel_set_network_band_20(void); +static void utc_tel_set_network_band_21(void); +static void utc_tel_set_network_band_22(void); +static void utc_tel_set_network_band_23(void); +static void utc_tel_set_network_band_24(void); +static void utc_tel_set_network_band_25(void); +static void utc_tel_set_network_band_26(void); +static void utc_tel_set_network_band_27(void); +static void utc_tel_set_network_band_28(void); +static void utc_tel_set_network_band_29(void); +static void utc_tel_set_network_band_30(void); +/** @} */ + diff --git a/TC/telephony_TC/network/unit/uts_tel_set_network_hybrid_in_cdma.c b/TC/telephony_TC/network/unit/uts_tel_set_network_hybrid_in_cdma.c new file mode 100644 index 0000000..c78f9e3 --- /dev/null +++ b/TC/telephony_TC/network/unit/uts_tel_set_network_hybrid_in_cdma.c @@ -0,0 +1,217 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * 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 "tel_tapi_nw_common.h" +#include "uts_tel_set_network_hybrid_in_cdma.h" + +TS_UINT subscription_id = 0, subscription_id1 = 0; + +/* Initialize TCM data structures */ +static void startup(); +static void cleanup(); +void (*tet_startup) () = startup; +void (*tet_cleanup) () = cleanup; +struct tet_testlist tet_testlist[] = { + {utc_tel_set_network_hybrid_in_cdma_01, 1}, + {utc_tel_set_network_hybrid_in_cdma_02, 2}, + {utc_tel_set_network_hybrid_in_cdma_03, 3}, + {utc_tel_set_network_hybrid_in_cdma_04, 4}, + {NULL, 0} +}; + +/* Startup & Clean function : It is not test code, only for + initialize and finalize test module +*/ +void callback(TelTapiEvent_t *event) +{ + if (event->EventClass != TAPI_EVENT_CLASS_NETWORK) + return; + + if (event->EventType == TAPI_EVENT_NETWORK_SET_CDMA_HYBRID_MODE_CNF) { + printf("\n$$$$$$ TAPI_EVENT_NETWORK_SET_ROAMING_MODE_CNF $$$$$$ \n"); + } +} + +static void startup() +{ + int api_err = TAPI_API_SUCCESS; + tet_infoline("utc_tel_tapi_nw_set_network_mode_func, Test Start\n"); + + api_err = tel_init(); + if (api_err != TAPI_API_SUCCESS) { + printf("tel_init Failed api_err = %d \n", api_err); + } + + api_err = tel_register_event(TAPI_EVENT_NETWORK_SET_CDMA_HYBRID_MODE_CNF, &subscription_id1, (TelAppCallback) &callback, NULL); + if (api_err != TAPI_API_SUCCESS) { + printf("TapiCommonRegisterEvent Failed api_err = %d \n", api_err); + } + printf("after TapiCommonRegisterEvent sub id is %d api_err is %d\n", subscription_id1, api_err); + + tel_register_app_name("org.samsung.test"); + return; +} + +static void cleanup() +{ + tet_infoline("utc_tel_tapi_nw_set_network_mode_func, Test Finished\n"); + tel_deregister_event(subscription_id1); + tel_deinit(); + return; +} + + +/* + Unit Test Case functions +*/ + +/** + * @brief This tests TelTapiNwSetNetworkMode() API in normal conditions + * @par ID: + * utc_tel_tapi_nw_set_network_mode_func_01 + * @param [in] NwMode + * @code + + NwMode = TAPI_NETWORK_MODE_EMERGENCY; + pRequestId = -1; + +* @endcode +* @param [out] pRequestId +* @return TAPI_API_INVALID_INPUT +*/ +void utc_tel_set_network_hybrid_in_cdma_01() +{ + TapiResult_t ret_val = TAPI_API_SUCCESS; + + int pRequestId = -1; + tet_infoline("utc_tel_set_network_hybrid_in_cdma_01 Test\n"); + + ret_val = tel_set_network_hybrid_in_cdma(TAPI_NETWORK_CDMA_HYBRID, &pRequestId); + TET_CHECK(TAPI_API_SUCCESS, ret_val); + + tet_infoline("utc_tel_set_network_hybrid_in_cdma_01 is passed\n"); + tet_result(TET_PASS); + + return; +} + +/** + * @brief This tests TelTapiNwSetNetworkMode() API in normal conditions + * @par ID: + * utc_tel_tapi_nw_set_network_mode_func_02 + * @param [in] NwMode + * @code + + NwMode = TAPI_NETWORK_MODE_AUTOMATIC; + pRequestId = -1; + + * @endcode + * @param [out] pRequestId + * @return TAPI_API_SUCCESS - indicating that the operation has completed successfully. + */ + +void utc_tel_set_network_hybrid_in_cdma_02() +{ + TapiResult_t ret_val = TAPI_API_SUCCESS; + + TelNetworkMode_t NwMode; + int pRequestId; + + NwMode = TAPI_NETWORK_MODE_AUTOMATIC; + pRequestId = -1; + + tet_infoline("utc_tel_set_network_hybrid_in_cdma_02 Test\n"); + + ret_val = tel_set_network_hybrid_in_cdma(TAPI_NETWORK_CDMA_EVDO_ONLY, &pRequestId); + TET_CHECK(TAPI_API_SUCCESS, ret_val); + + tet_infoline("utc_tel_set_network_hybrid_in_cdma_02 is passed\n"); + tet_result(TET_PASS); + + return; +} + +/** + * @brief This tests TelTapiNwSetNetworkMode() API in normal conditions + * @par ID: + * utc_tel_tapi_nw_set_network_mode_func_03 + * @param [in] NwMode + * @code + + NwMode = TAPI_NETWORK_MODE_CDMA; + pRequestId = -1; + + * @endcode + * @param [out] pRequestId + * @return TAPI_API_INVALID_INPUT + */ + +void utc_tel_set_network_hybrid_in_cdma_03() +{ + TapiResult_t ret_val = TAPI_API_SUCCESS; + int pRequestId; + pRequestId = -1; + + tet_infoline("utc_tel_set_network_hybrid_in_cdma_03 Test\n"); + + ret_val = tel_set_network_hybrid_in_cdma(TAPI_NETWORK_CDMA_EVDO_ONLY + 1, &pRequestId); + TET_CHECK(TAPI_API_INVALID_INPUT, ret_val); + + tet_infoline("utc_tel_set_network_hybrid_in_cdma_03 is passed\n"); + tet_result(TET_PASS); + + return; +} + +/** + * @brief This tests TelTapiNwSetNetworkMode() API in normal conditions + * @par ID: + * utc_tel_tapi_nw_set_network_mode_func_04 + * @param [in] NwMode + * @code + + NwMode = TAPI_NETWORK_MODE_GSM; + pRequestId = -1; + + * @endcode + * @param [out] pRequestId + * @return TAPI_API_SUCCESS - indicating that the operation has completed successfully. + */ + +void utc_tel_set_network_hybrid_in_cdma_04() +{ + TapiResult_t ret_val = TAPI_API_SUCCESS; + + tet_infoline("utc_tel_set_network_hybrid_in_cdma_04 Test\n"); + + ret_val = tel_set_network_hybrid_in_cdma(TAPI_NETWORK_CDMA_HYBRID, NULL); + + TET_CHECK(TAPI_API_INVALID_PTR, ret_val); + + tet_infoline("utc_tel_set_network_hybrid_in_cdma_04 is passed\n"); + tet_result(TET_PASS); + + return; +} + +/** @} */ diff --git a/TC/telephony_TC/network/unit/uts_tel_set_network_hybrid_in_cdma.h b/TC/telephony_TC/network/unit/uts_tel_set_network_hybrid_in_cdma.h new file mode 100644 index 0000000..ffaebf0 --- /dev/null +++ b/TC/telephony_TC/network/unit/uts_tel_set_network_hybrid_in_cdma.h @@ -0,0 +1,33 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * 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. + */ + + +static void startup(); +static void cleanup(); + +static void utc_tel_set_network_hybrid_in_cdma_01(void); +static void utc_tel_set_network_hybrid_in_cdma_02(void); +static void utc_tel_set_network_hybrid_in_cdma_03(void); +static void utc_tel_set_network_hybrid_in_cdma_04(void); + + +/** @} */ + + diff --git a/TC/telephony_TC/network/unit/uts_tel_set_network_mode.c b/TC/telephony_TC/network/unit/uts_tel_set_network_mode.c new file mode 100644 index 0000000..bdc0f67 --- /dev/null +++ b/TC/telephony_TC/network/unit/uts_tel_set_network_mode.c @@ -0,0 +1,146 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * 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 "tel_tapi_nw_common.h" +#include "uts_tel_set_network_mode.h" + +TS_UINT subscription_id = 0, subscription_id1 = 0; + +/* Initialize TCM data structures */ +static void startup(); +static void cleanup(); +void (*tet_startup) () = startup; +void (*tet_cleanup) () = cleanup; +struct tet_testlist tet_testlist[] = { + {utc_tel_set_network_mode_01, 1}, + {utc_tel_set_network_mode_02, 2}, + {NULL, 0} +}; + +/* Startup & Clean function : It is not test code, only for + initialize and finalize test module + */ +static void startup() +{ + TapiResult_t api_err = TAPI_API_SUCCESS; + tet_infoline("utc_tel_set_network_mode, Test Start\n"); + + api_err = tel_init(); + if (api_err != TAPI_API_SUCCESS) { + printf("tel_init Failed api_err = %d \n", api_err); + } + + api_err = tel_register_event(TAPI_EVENT_NETWORK_SETNWMODE_CNF, &subscription_id1, (TelAppCallback) tapi_callback, NULL); + if (api_err != TAPI_API_SUCCESS) { + printf("TapiCommonRegisterEvent Failed api_err = %d \n", api_err); + } + printf("after TapiCommonRegisterEvent sub id is %d api_err is %d\n", subscription_id1, api_err); + + tel_register_app_name("org.samsung.test"); + return; +} + +static void cleanup() +{ + tet_infoline("utc_tel_set_network_mode, Test Finished\n"); + tel_deregister_event(subscription_id1); + tel_deinit(); + return; +} + + +/* + Unit Test Case functions +*/ + +/** + * @brief This tests tel_set_network_mode() API in normal conditions + * @par ID: + * utc_tel_set_network_mode_01 + * @param [in] NwMode + * @code + + NwMode = TAPI_NETWORK_MODE_EMERGENCY; + pRequestId = -1; + +* @endcode +* @param [out] pRequestId +* @return TAPI_API_INVALID_INPUT +*/ +void utc_tel_set_network_mode_01() +{ + TapiResult_t ret_val = TAPI_API_SUCCESS; + + TelNetworkMode_t NwMode; + int pRequestId; + + NwMode = TAPI_NETWORK_MODE_EMERGENCY; + pRequestId = -1; + + tet_infoline("utc_tel_set_network_mode_01 Test\n"); + + ret_val = tel_set_network_mode(NwMode, &pRequestId); + TET_CHECK(TAPI_API_INVALID_INPUT, ret_val); + + tet_infoline("utc_tel_set_network_mode_01 is passed\n"); + tet_result(TET_PASS); + + return; +} + +/** + * @brief This tests tel_set_network_mode() API in normal conditions + * @par ID: + * utc_tel_set_network_mode_02 + * @param [in] NwMode + * @code + + NwMode = TAPI_NETWORK_MODE_AUTOMATIC; + pRequestId = -1; + + * @endcode + * @param [out] pRequestId + * @return TAPI_API_SUCCESS - indicating that the operation has completed successfully. + */ + +void utc_tel_set_network_mode_02() +{ + TapiResult_t ret_val = TAPI_API_SUCCESS; + + TelNetworkMode_t NwMode; + int pRequestId; + + NwMode = TAPI_NETWORK_MODE_AUTOMATIC; + pRequestId = -1; + + tet_infoline("utc_tel_set_network_mode_02 Test\n"); + + ret_val = tel_set_network_mode(NwMode, &pRequestId); + TET_CHECK(TAPI_API_SUCCESS, ret_val); + + tet_infoline("utc_tel_set_network_mode_02 is passed\n"); + tet_result(TET_PASS); + + return; +} +/** @} */ diff --git a/TC/telephony_TC/network/unit/uts_tel_set_network_mode.h b/TC/telephony_TC/network/unit/uts_tel_set_network_mode.h new file mode 100644 index 0000000..4bb969d --- /dev/null +++ b/TC/telephony_TC/network/unit/uts_tel_set_network_mode.h @@ -0,0 +1,28 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * 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. + */ + + +static void startup(); +static void cleanup(); + +static void utc_tel_set_network_mode_01(void); +static void utc_tel_set_network_mode_02(void); + +/** @} */ diff --git a/TC/telephony_TC/network/unit/uts_tel_set_network_preferred_plmn.c b/TC/telephony_TC/network/unit/uts_tel_set_network_preferred_plmn.c new file mode 100644 index 0000000..76486e2 --- /dev/null +++ b/TC/telephony_TC/network/unit/uts_tel_set_network_preferred_plmn.c @@ -0,0 +1,1843 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * 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 "tel_tapi_nw_common.h" +#include "uts_tel_set_network_preferred_plmn.h" + +TS_UINT subscription_id = 0, subscription_id1 = 0; + +/* Initialize TCM data structures */ +static void startup(); +static void cleanup(); +void (*tet_startup) () = startup; +void (*tet_cleanup) () = cleanup; +struct tet_testlist tet_testlist[] = { + {utc_tel_set_network_preferred_plmn_01, 1}, + //{utc_tel_set_network_preferred_plmn_02, 2}, + //{utc_tel_set_network_preferred_plmn_03, 3}, + {utc_tel_set_network_preferred_plmn_04, 4}, + {utc_tel_set_network_preferred_plmn_05, 3}, + {utc_tel_set_network_preferred_plmn_06, 6}, + {utc_tel_set_network_preferred_plmn_07, 7}, + {utc_tel_set_network_preferred_plmn_08, 8}, + {utc_tel_set_network_preferred_plmn_09, 9}, + {utc_tel_set_network_preferred_plmn_10, 10}, + {utc_tel_set_network_preferred_plmn_11, 11}, + //{utc_tel_set_network_preferred_plmn_12, 12}, + //{utc_tel_set_network_preferred_plmn_13, 13}, + {utc_tel_set_network_preferred_plmn_14, 14}, + {utc_tel_set_network_preferred_plmn_15, 15}, + {utc_tel_set_network_preferred_plmn_16, 16}, + {utc_tel_set_network_preferred_plmn_17, 17}, + {utc_tel_set_network_preferred_plmn_18, 18}, + {utc_tel_set_network_preferred_plmn_19, 19}, + {utc_tel_set_network_preferred_plmn_20, 20}, + {utc_tel_set_network_preferred_plmn_21, 21}, + //{utc_tel_set_network_preferred_plmn_22, 22}, + //{utc_tel_set_network_preferred_plmn_23, 23}, + {utc_tel_set_network_preferred_plmn_24, 24}, + {utc_tel_set_network_preferred_plmn_25, 25}, + {utc_tel_set_network_preferred_plmn_26, 26}, + {utc_tel_set_network_preferred_plmn_27, 27}, + {utc_tel_set_network_preferred_plmn_28, 28}, + {utc_tel_set_network_preferred_plmn_29, 29}, + {utc_tel_set_network_preferred_plmn_30, 30}, + {utc_tel_set_network_preferred_plmn_31, 31}, + //{utc_tel_set_network_preferred_plmn_32, 32}, + //{utc_tel_set_network_preferred_plmn_33, 33}, + {utc_tel_set_network_preferred_plmn_34, 34}, + {utc_tel_set_network_preferred_plmn_35, 35}, + {utc_tel_set_network_preferred_plmn_36, 36}, + {utc_tel_set_network_preferred_plmn_37, 37}, + {utc_tel_set_network_preferred_plmn_38, 38}, + {utc_tel_set_network_preferred_plmn_39, 39}, + {utc_tel_set_network_preferred_plmn_40, 40}, + {NULL, 0} +}; + +/* Startup & Clean function : It is not test code, only for + initialize and finalize test module + */ +static void startup() +{ + int api_err = TAPI_API_SUCCESS; + tet_infoline("utc_tel_set_network_preferred_plmn, Test Start\n"); + + api_err = tel_init(); + if (api_err != TAPI_API_SUCCESS) { + printf("tel_init Failed api_err = %d \n", api_err); + } + api_err = tel_register_event(TAPI_EVENT_NETWORK_SETPREFFEREDPLMN_CNF, &subscription_id1, (TelAppCallback) tapi_callback, NULL); + if (api_err != TAPI_API_SUCCESS) { + printf("TapiCommonRegisterEvent Failed api_err = %d \n", api_err); + } + printf("after TapiCommonRegisterEvent sub id is %d api_err is %d\n", subscription_id1, api_err); + + tel_register_app_name("org.samsung.test"); + return; +} + +static void cleanup() +{ + tet_infoline("utc_tel_set_network_preferred_plmn, Test Finished\n"); + tel_deregister_event(subscription_id1); + tel_deinit(); + return; +} + +/* + Unit Test Case functions +*/ + +/** + * @brief This tests tel_set_network_preferred_plmn() API for invalid inputs + * @par ID: + * utc_tel_set_network_preferred_plmn_01 + * @param [in] Operation + * @param [in] PreffPlmnInfo + * @code + + Operation = TAPI_NETWORK_PREF_PLMN_ADD; + PreffPlmnInfo.Index = 244; + memcpy(PreffPlmnInfo.Plmn,"40411",5); + PreffPlmnInfo.SystemType = TAPI_NETWORK_SYSTEM_NO_SRV; + pRequestId = -1; + +* @endcode +* @param [out] pRequestId +* @return TAPI_API_INVALID_INPUT +*/ +void utc_tel_set_network_preferred_plmn_01() +{ + int ret_val = TAPI_API_SUCCESS; + TelNetworkPrefferedPlmnOp_t Operation; + TelNetworkPrefferedPlmnInfo_t PreffPlmnInfo; + int pRequestId; + + Operation = TAPI_NETWORK_PREF_PLMN_ADD; + PreffPlmnInfo.Index = 244;/*Some value between 0 and 255*/ + memcpy(PreffPlmnInfo.Plmn, "40411", 5); + PreffPlmnInfo.SystemType = TAPI_NETWORK_SYSTEM_NO_SRV; /*Test for invalid value*/ + pRequestId = -1; + + tet_infoline("utc_tel_set_network_preferred_plmn_01 Test\n"); + ret_val = tel_set_network_preferred_plmn(Operation, &PreffPlmnInfo, &pRequestId); + TET_CHECK(TAPI_API_INVALID_INPUT, ret_val); + + tet_infoline("utc_tel_set_network_preferred_plmn_01 is passed\n"); + tet_result(TET_PASS); + return; +} + +#if 0 +/** + * @brief This tests tel_set_network_preferred_plmn() API in normal conditions + * @par ID: + * utc_tel_set_network_preferred_plmn_02 + * @param [in] Operation + * @param [in] PreffPlmnInfo + * @code + + Operation = TAPI_NETWORK_PREF_PLMN_ADD; + PreffPlmnInfo.Index = 245; + memcpy(PreffPlmnInfo.Plmn,"40411",5); + PreffPlmnInfo.SystemType = TAPI_NETWORK_SYSTEM_CDMA; + pRequestId = -1; + + * @endcode + * @param [out] pRequestId + * @return TAPI_API_INVALID_INPUT + */ + +void utc_tel_set_network_preferred_plmn_02() +{ + int ret_val = TAPI_API_SUCCESS; + + TelNetworkPrefferedPlmnOp_t Operation; + TelNetworkPrefferedPlmnInfo_t PreffPlmnInfo; + int pRequestId; + + Operation = TAPI_NETWORK_PREF_PLMN_ADD; + PreffPlmnInfo.Index = 245;/*Some value between 0 and 255*/ + memcpy(PreffPlmnInfo.Plmn,"40411",5); + PreffPlmnInfo.SystemType = TAPI_NETWORK_SYSTEM_CDMA; + pRequestId = -1; + + tet_infoline("utc_tel_set_network_preferred_plmn_02 Test\n"); + + ret_val = tel_set_network_preferred_plmn(Operation, &PreffPlmnInfo, &pRequestId); + TET_CHECK(TAPI_API_INVALID_INPUT, ret_val); + + tet_infoline("utc_tel_set_network_preferred_plmn_02 is passed\n"); + tet_result(TET_PASS); + + return; +} + +/** + * @brief This tests tel_set_network_preferred_plmn() API in normal conditions + * @par ID: + * utc_tel_set_network_preferred_plmn_03 + * @param [in] Operation + * @param [in] PreffPlmnInfo + * @code + + Operation = TAPI_NETWORK_PREF_PLMN_ADD; + PreffPlmnInfo.Index = 246; + memcpy(PreffPlmnInfo.Plmn,"40411",5); + PreffPlmnInfo.SystemType = TAPI_NETWORK_SYSTEM_TDMA; + pRequestId = -1; + + * @endcode + * @param [out] pRequestId + * @return TAPI_API_INVALID_INPUT + */ + +void utc_tel_set_network_preferred_plmn_03() +{ + int ret_val = TAPI_API_SUCCESS; + + TelNetworkPrefferedPlmnOp_t Operation; + TelNetworkPrefferedPlmnInfo_t PreffPlmnInfo; + int pRequestId; + + Operation = TAPI_NETWORK_PREF_PLMN_ADD; + PreffPlmnInfo.Index = 246;/*Some value between 0 and 255*/ + memcpy(PreffPlmnInfo.Plmn,"40411",5); + PreffPlmnInfo.SystemType = TAPI_NETWORK_SYSTEM_TDMA; + pRequestId = -1; + + tet_infoline("utc_tel_set_network_preferred_plmn_03 Test\n"); + + ret_val = tel_set_network_preferred_plmn(Operation, &PreffPlmnInfo, &pRequestId); + TET_CHECK(TAPI_API_INVALID_INPUT, ret_val); + + tet_infoline("utc_tel_set_network_preferred_plmn_03 is passed\n"); + tet_result(TET_PASS); + + return; +} +#endif + +/** + * @brief This tests tel_set_network_preferred_plmn() API in normal conditions + * @par ID: + * utc_tel_set_network_preferred_plmn_04 + * @param [in] Operation + * @param [in] PreffPlmnInfo + * @code + + Operation = TAPI_NETWORK_PREF_PLMN_ADD; + PreffPlmnInfo.Index = 247; + memcpy(PreffPlmnInfo.Plmn,"40411",5); + PreffPlmnInfo.SystemType = TAPI_NETWORK_SYSTEM_GSM; + pRequestId = -1; + + * @endcode + * @param [out] pRequestId + * @return TAPI_API_SUCCESS - indicating that the operation has completed successfully. + */ +void utc_tel_set_network_preferred_plmn_04() +{ + int ret_val = TAPI_API_SUCCESS; + + TelNetworkPrefferedPlmnOp_t Operation; + TelNetworkPrefferedPlmnInfo_t PreffPlmnInfo; + int pRequestId; + + Operation = TAPI_NETWORK_PREF_PLMN_ADD; + PreffPlmnInfo.Index = 247;/*Some value between 0 and 255*/ + memcpy(PreffPlmnInfo.Plmn, "40411", 5); + PreffPlmnInfo.SystemType = TAPI_NETWORK_SYSTEM_GSM; + pRequestId = -1; + + tet_infoline("utc_tel_set_network_preferred_plmn_04 Test\n"); + + ret_val = tel_set_network_preferred_plmn(Operation, &PreffPlmnInfo, &pRequestId); + TET_CHECK(TAPI_API_SUCCESS, ret_val); + + tet_infoline("utc_tel_set_network_preferred_plmn_04 is passed\n"); + tet_result(TET_PASS); + + return; +} + +/** + * @brief This tests tel_set_network_preferred_plmn() API in normal conditions + * @par ID: + * utc_tel_set_network_preferred_plmn_05 + * @param [in] Operation + * @param [in] PreffPlmnInfo + * @code + + Operation = TAPI_NETWORK_PREF_PLMN_ADD; + PreffPlmnInfo.Index = 248; + memcpy(PreffPlmnInfo.Plmn,"40411",5); + PreffPlmnInfo.SystemType = TAPI_NETWORK_SYSTEM_GPRS; + pRequestId = -1; + + * @endcode + * @param [out] pRequestId + * @return TAPI_API_SUCCESS - indicating that the operation has completed successfully. + */ +void utc_tel_set_network_preferred_plmn_05() +{ + int ret_val = TAPI_API_SUCCESS; + + TelNetworkPrefferedPlmnOp_t Operation; + TelNetworkPrefferedPlmnInfo_t PreffPlmnInfo; + int pRequestId; + + Operation = TAPI_NETWORK_PREF_PLMN_ADD; + PreffPlmnInfo.Index = 248;/*Some value between 0 and 255*/ + memcpy(PreffPlmnInfo.Plmn, "40411", 5); + PreffPlmnInfo.SystemType = TAPI_NETWORK_SYSTEM_GPRS; + pRequestId = -1; + + tet_infoline("utc_tel_set_network_preferred_plmn_05 Test\n"); + + ret_val = tel_set_network_preferred_plmn(Operation, &PreffPlmnInfo, &pRequestId); + TET_CHECK(TAPI_API_SUCCESS, ret_val); + + tet_infoline("utc_tel_set_network_preferred_plmn_05 is passed\n"); + tet_result(TET_PASS); + + return; +} + +/** + * @brief This tests tel_set_network_preferred_plmn() API in normal conditions + * @par ID: + * utc_tel_set_network_preferred_plmn_06 + * @param [in] Operation + * @param [in] PreffPlmnInfo + * @code + + Operation = TAPI_NETWORK_PREF_PLMN_ADD; + PreffPlmnInfo.Index = 249; + memcpy(PreffPlmnInfo.Plmn,"40411",5); + PreffPlmnInfo.SystemType = TAPI_NETWORK_SYSTEM_EGPRS; + pRequestId = -1; + + * @endcode + * @param [out] pRequestId + * @return TAPI_API_SUCCESS - indicating that the operation has completed successfully. + */ +void utc_tel_set_network_preferred_plmn_06() +{ + int ret_val = TAPI_API_SUCCESS; + + TelNetworkPrefferedPlmnOp_t Operation; + TelNetworkPrefferedPlmnInfo_t PreffPlmnInfo; + int pRequestId; + + Operation = TAPI_NETWORK_PREF_PLMN_ADD; + PreffPlmnInfo.Index = 249;/*Some value between 0 and 255*/ + memcpy(PreffPlmnInfo.Plmn, "40411", 5); + PreffPlmnInfo.SystemType = TAPI_NETWORK_SYSTEM_EGPRS; + pRequestId = -1; + + tet_infoline("utc_tel_set_network_preferred_plmn_06 Test\n"); + + ret_val = tel_set_network_preferred_plmn(Operation, &PreffPlmnInfo, &pRequestId); + TET_CHECK(TAPI_API_SUCCESS, ret_val); + + tet_infoline("utc_tel_set_network_preferred_plmn_06 is passed\n"); + tet_result(TET_PASS); + + return; +} + +/** + * @brief This tests tel_set_network_preferred_plmn() API in normal conditions + * @par ID: + * utc_tel_set_network_preferred_plmn_07 + * @param [in] Operation + * @param [in] PreffPlmnInfo + * @code + + Operation = TAPI_NETWORK_PREF_PLMN_ADD; + PreffPlmnInfo.Index = 250; + memcpy(PreffPlmnInfo.Plmn,"40411",5); + PreffPlmnInfo.SystemType = TAPI_NETWORK_SYSTEM_PCS1900; + pRequestId = -1; + + * @endcode + * @param [out] pRequestId + * @return TAPI_API_INVALID_INPUT + */ +void utc_tel_set_network_preferred_plmn_07() +{ + int ret_val = TAPI_API_SUCCESS; + + TelNetworkPrefferedPlmnOp_t Operation; + TelNetworkPrefferedPlmnInfo_t PreffPlmnInfo; + int pRequestId; + + Operation = TAPI_NETWORK_PREF_PLMN_ADD; + PreffPlmnInfo.Index = 250;/*Some value between 0 and 255*/ + memcpy(PreffPlmnInfo.Plmn, "40411", 5); + PreffPlmnInfo.SystemType = TAPI_NETWORK_SYSTEM_PCS1900; + pRequestId = -1; + + tet_infoline("utc_tel_set_network_preferred_plmn_07 Test\n"); + + ret_val = tel_set_network_preferred_plmn(Operation, &PreffPlmnInfo, &pRequestId); + TET_CHECK(TAPI_API_INVALID_INPUT, ret_val); + + tet_infoline("utc_tel_set_network_preferred_plmn_07 is passed\n"); + tet_result(TET_PASS); + + return; +} + +/** + * @brief This tests tel_set_network_preferred_plmn() API in normal conditions + * @par ID: + * utc_tel_set_network_preferred_plmn_08 + * @param [in] Operation + * @param [in] PreffPlmnInfo + * @code + + Operation = TAPI_NETWORK_PREF_PLMN_ADD; + PreffPlmnInfo.Index = 251; + memcpy(PreffPlmnInfo.Plmn,"40411",5); + PreffPlmnInfo.SystemType = TAPI_NETWORK_SYSTEM_UMTS; + pRequestId = -1; + + * @endcode + * @param [out] pRequestId + * @return TAPI_API_SUCCESS - indicating that the operation has completed successfully. + */ +void utc_tel_set_network_preferred_plmn_08() +{ + int ret_val = TAPI_API_SUCCESS; + + TelNetworkPrefferedPlmnOp_t Operation; + TelNetworkPrefferedPlmnInfo_t PreffPlmnInfo; + int pRequestId; + + Operation = TAPI_NETWORK_PREF_PLMN_ADD; + PreffPlmnInfo.Index = 251;/*Some value between 0 and 255*/ + memcpy(PreffPlmnInfo.Plmn, "40411", 5); + PreffPlmnInfo.SystemType = TAPI_NETWORK_SYSTEM_UMTS; + pRequestId = -1; + + tet_infoline("utc_tel_set_network_preferred_plmn_08 Test\n"); + + ret_val = tel_set_network_preferred_plmn(Operation, &PreffPlmnInfo, &pRequestId); + TET_CHECK(TAPI_API_SUCCESS, ret_val); + + tet_infoline("utc_tel_set_network_preferred_plmn_08 is passed\n"); + tet_result(TET_PASS); + + return; +} + +/** + * @brief This tests tel_set_network_preferred_plmn() API in normal conditions + * @par ID: + * utc_tel_set_network_preferred_plmn_09 + * @param [in] Operation + * @param [in] PreffPlmnInfo + * @code + + Operation = TAPI_NETWORK_PREF_PLMN_ADD; + PreffPlmnInfo.Index = 252; + memcpy(PreffPlmnInfo.Plmn,"40411",5); + PreffPlmnInfo.SystemType = TAPI_NETWORK_SYSTEM_GSM_AND_UMTS; + pRequestId = -1; + + * @endcode + * @param [out] pRequestId + * @return TAPI_API_SUCCESS - indicating that the operation has completed successfully. + */ +void utc_tel_set_network_preferred_plmn_09() +{ + int ret_val = TAPI_API_SUCCESS; + + TelNetworkPrefferedPlmnOp_t Operation; + TelNetworkPrefferedPlmnInfo_t PreffPlmnInfo; + int pRequestId; + + Operation = TAPI_NETWORK_PREF_PLMN_ADD; + PreffPlmnInfo.Index = 252;/*Some value between 0 and 255*/ + memcpy(PreffPlmnInfo.Plmn, "40411", 5); + PreffPlmnInfo.SystemType = TAPI_NETWORK_SYSTEM_GSM_AND_UMTS; + pRequestId = -1; + + tet_infoline("utc_tel_set_network_preferred_plmn_09 Test\n"); + + ret_val = tel_set_network_preferred_plmn(Operation, &PreffPlmnInfo, &pRequestId); + TET_CHECK(TAPI_API_SUCCESS, ret_val); + + tet_infoline("utc_tel_set_network_preferred_plmn_09 is passed\n"); + tet_result(TET_PASS); + + return; +} + +/** + * @brief This tests tel_set_network_preferred_plmn() API in normal conditions + * @par ID: + * utc_tel_set_network_preferred_plmn_10 + * @param [in] Operation + * @param [in] PreffPlmnInfo + * @code + + Operation = TAPI_NETWORK_PREF_PLMN_ADD; + PreffPlmnInfo.Index = 253; + memcpy(PreffPlmnInfo.Plmn,"40411",5); + PreffPlmnInfo.SystemType = TAPI_NETWORK_SYSTEM_HSDPA; + pRequestId = -1; + + * @endcode + * @param [out] pRequestId + * @return TAPI_API_INVALID_INPUT + */ +void utc_tel_set_network_preferred_plmn_10() +{ + int ret_val = TAPI_API_SUCCESS; + + TelNetworkPrefferedPlmnOp_t Operation; + TelNetworkPrefferedPlmnInfo_t PreffPlmnInfo; + int pRequestId; + + Operation = TAPI_NETWORK_PREF_PLMN_ADD; + PreffPlmnInfo.Index = 253;/*Some value between 0 and 255*/ + memcpy(PreffPlmnInfo.Plmn, "40411", 5); + PreffPlmnInfo.SystemType = TAPI_NETWORK_SYSTEM_HSDPA; + pRequestId = -1; + + tet_infoline("utc_tel_set_network_preferred_plmn_10 Test\n"); + + ret_val = tel_set_network_preferred_plmn(Operation, &PreffPlmnInfo, &pRequestId); + TET_CHECK(TAPI_API_INVALID_INPUT, ret_val); + + tet_infoline("utc_tel_set_network_preferred_plmn_10 is passed\n"); + tet_result(TET_PASS); + + return; +} + +/** + * @brief This tests tel_set_network_preferred_plmn() API with invalid inputs + * @par ID: + * utc_tel_set_network_preferred_plmn_11 + * @param [in] Operation + * @param [in] PreffPlmnInfo + * @code + + Operation = TAPI_NETWORK_PREF_PLMN_EDIT; + PreffPlmnInfo.Index = 244; + memcpy(PreffPlmnInfo.Plmn,"40411",5); + PreffPlmnInfo.SystemType = TAPI_NETWORK_SYSTEM_NO_SRV; + pRequestId = -1; + + * @endcode + * @param [out] pRequestId + * @return TAPI_API_INVALID_INPUT + */ +void utc_tel_set_network_preferred_plmn_11() +{ + int ret_val = TAPI_API_SUCCESS; + + TelNetworkPrefferedPlmnOp_t Operation; + TelNetworkPrefferedPlmnInfo_t PreffPlmnInfo; + int pRequestId; + + Operation = TAPI_NETWORK_PREF_PLMN_EDIT; + PreffPlmnInfo.Index = 244;/*Some value between 0 and 255*/ + memcpy(PreffPlmnInfo.Plmn, "40411", 5); + PreffPlmnInfo.SystemType = TAPI_NETWORK_SYSTEM_NO_SRV; /*Test for invalid value*/ + pRequestId = -1; + + tet_infoline("utc_tel_set_network_preferred_plmn_11 Test\n"); + + ret_val = tel_set_network_preferred_plmn(Operation, &PreffPlmnInfo, &pRequestId); + TET_CHECK(TAPI_API_INVALID_INPUT, ret_val); + + tet_infoline("utc_tel_set_network_preferred_plmn_11 is passed\n"); + tet_result(TET_PASS); + + return; +} + +/** + * @brief This tests tel_set_network_preferred_plmn() API in normal conditions + * @par ID: + * utc_tel_set_network_preferred_plmn_12 + * @param [in] Operation + * @param [in] PreffPlmnInfo + * @code + + Operation = TAPI_NETWORK_PREF_PLMN_EDIT; + PreffPlmnInfo.Index = 245; + memcpy(PreffPlmnInfo.Plmn,"40411",5); + PreffPlmnInfo.SystemType = TAPI_NETWORK_SYSTEM_CDMA; + pRequestId = -1; + +* @endcode +* @param [out] pRequestId +* @return TAPI_API_INVALID_INPUT + */ +#if 0 +void utc_tel_set_network_preferred_plmn_12() +{ + int ret_val = TAPI_API_SUCCESS; + + TelNetworkPrefferedPlmnOp_t Operation; + TelNetworkPrefferedPlmnInfo_t PreffPlmnInfo; + int pRequestId; + + Operation = TAPI_NETWORK_PREF_PLMN_EDIT; + PreffPlmnInfo.Index = 245;/*Some value between 0 and 255*/ + memcpy(PreffPlmnInfo.Plmn,"40411",5); + PreffPlmnInfo.SystemType = TAPI_NETWORK_SYSTEM_CDMA; + pRequestId = -1; + + tet_infoline("utc_tel_set_network_preferred_plmn_12 Test\n"); + + ret_val = tel_set_network_preferred_plmn(Operation, &PreffPlmnInfo, &pRequestId); + TET_CHECK(TAPI_API_INVALID_INPUT, ret_val); + + tet_infoline("utc_tel_set_network_preferred_plmn_12 is passed\n"); + tet_result(TET_PASS); + + return; +} + +/** + * @brief This tests tel_set_network_preferred_plmn() API in normal conditions + * @par ID: + * utc_tel_set_network_preferred_plmn_13 + * @param [in] Operation + * @param [in] PreffPlmnInfo + * @code + + Operation = TAPI_NETWORK_PREF_PLMN_EDIT; + PreffPlmnInfo.Index = 246; + memcpy(PreffPlmnInfo.Plmn,"40411",5); + PreffPlmnInfo.SystemType = TAPI_NETWORK_SYSTEM_TDMA; + pRequestId = -1; + + * @endcode + * @param [out] pRequestId + * @return TAPI_API_INVALID_INPUT + */ + +void utc_tel_set_network_preferred_plmn_13() +{ + int ret_val = TAPI_API_SUCCESS; + + TelNetworkPrefferedPlmnOp_t Operation; + TelNetworkPrefferedPlmnInfo_t PreffPlmnInfo; + int pRequestId; + + Operation = TAPI_NETWORK_PREF_PLMN_EDIT; + PreffPlmnInfo.Index = 246;/*Some value between 0 and 255*/ + memcpy(PreffPlmnInfo.Plmn,"40411",5); + PreffPlmnInfo.SystemType = TAPI_NETWORK_SYSTEM_TDMA; + pRequestId = -1; + + tet_infoline("utc_tel_set_network_preferred_plmn_13 Test\n"); + + ret_val = tel_set_network_preferred_plmn(Operation, &PreffPlmnInfo, &pRequestId); + TET_CHECK(TAPI_API_INVALID_INPUT, ret_val); + + tet_infoline("utc_tel_set_network_preferred_plmn_13 is passed\n"); + tet_result(TET_PASS); + + return; +} +#endif + +/** + * @brief This tests tel_set_network_preferred_plmn() API in normal conditions + * @par ID: + * utc_tel_set_network_preferred_plmn_14 + * @param [in] Operation + * @param [in] PreffPlmnInfo + * @code + + Operation = TAPI_NETWORK_PREF_PLMN_EDIT; + PreffPlmnInfo.Index = 247; + memcpy(PreffPlmnInfo.Plmn,"40411",5); + PreffPlmnInfo.SystemType = TAPI_NETWORK_SYSTEM_GSM; + pRequestId = -1; + + * @endcode + * @param [out] pRequestId + * @return TAPI_API_SUCCESS - indicating that the operation has completed successfully. + */ +void utc_tel_set_network_preferred_plmn_14() +{ + int ret_val = TAPI_API_SUCCESS; + + TelNetworkPrefferedPlmnOp_t Operation; + TelNetworkPrefferedPlmnInfo_t PreffPlmnInfo; + int pRequestId; + + Operation = TAPI_NETWORK_PREF_PLMN_EDIT; + PreffPlmnInfo.Index = 247;/*Some value between 0 and 255*/ + memcpy(PreffPlmnInfo.Plmn, "40411", 5); + PreffPlmnInfo.SystemType = TAPI_NETWORK_SYSTEM_GSM; + pRequestId = -1; + + tet_infoline("utc_tel_set_network_preferred_plmn_14 Test\n"); + + ret_val = tel_set_network_preferred_plmn(Operation, &PreffPlmnInfo, &pRequestId); + TET_CHECK(TAPI_API_SUCCESS, ret_val); + + tet_infoline("utc_tel_set_network_preferred_plmn_14 is passed\n"); + tet_result(TET_PASS); + + return; +} + +/** + * @brief This tests tel_set_network_preferred_plmn() API in normal conditions + * @par ID: + * utc_tel_set_network_preferred_plmn_15 + * @param [in] Operation + * @param [in] PreffPlmnInfo + * @code + + Operation = TAPI_NETWORK_PREF_PLMN_EDIT; + PreffPlmnInfo.Index = 248; + memcpy(PreffPlmnInfo.Plmn,"40411",5); + PreffPlmnInfo.SystemType = TAPI_NETWORK_SYSTEM_GPRS; + pRequestId = -1; + + * @endcode + * @param [out] pRequestId + * @return TAPI_API_SUCCESS - indicating that the operation has completed successfully. + */ +void utc_tel_set_network_preferred_plmn_15() +{ + int ret_val = TAPI_API_SUCCESS; + + TelNetworkPrefferedPlmnOp_t Operation; + TelNetworkPrefferedPlmnInfo_t PreffPlmnInfo; + int pRequestId; + + Operation = TAPI_NETWORK_PREF_PLMN_EDIT; + PreffPlmnInfo.Index = 248;/*Some value between 0 and 255*/ + memcpy(PreffPlmnInfo.Plmn, "40411", 5); + PreffPlmnInfo.SystemType = TAPI_NETWORK_SYSTEM_GPRS; + pRequestId = -1; + + tet_infoline("utc_tel_set_network_preferred_plmn_15 Test\n"); + + ret_val = tel_set_network_preferred_plmn(Operation, &PreffPlmnInfo, &pRequestId); + TET_CHECK(TAPI_API_SUCCESS, ret_val); + + tet_infoline("utc_tel_set_network_preferred_plmn_15 is passed\n"); + tet_result(TET_PASS); + + return; +} + +/** + * @brief This tests tel_set_network_preferred_plmn() API in normal conditions + * @par ID: + * utc_tel_set_network_preferred_plmn_16 + * @param [in] Operation + * @param [in] PreffPlmnInfo + * @code + + Operation = TAPI_NETWORK_PREF_PLMN_EDIT; + PreffPlmnInfo.Index = 249; + memcpy(PreffPlmnInfo.Plmn,"40411",5); + PreffPlmnInfo.SystemType = TAPI_NETWORK_SYSTEM_EGPRS; + pRequestId = -1; + + * @endcode + * @param [out] pRequestId + * @return TAPI_API_SUCCESS - indicating that the operation has completed successfully. + */ +void utc_tel_set_network_preferred_plmn_16() +{ + int ret_val = TAPI_API_SUCCESS; + + TelNetworkPrefferedPlmnOp_t Operation; + TelNetworkPrefferedPlmnInfo_t PreffPlmnInfo; + int pRequestId; + + Operation = TAPI_NETWORK_PREF_PLMN_EDIT; + PreffPlmnInfo.Index = 249;/*Some value between 0 and 255*/ + memcpy(PreffPlmnInfo.Plmn, "40411", 5); + PreffPlmnInfo.SystemType = TAPI_NETWORK_SYSTEM_EGPRS; + pRequestId = -1; + + tet_infoline("utc_tel_set_network_preferred_plmn_16 Test\n"); + + ret_val = tel_set_network_preferred_plmn(Operation, &PreffPlmnInfo, &pRequestId); + TET_CHECK(TAPI_API_SUCCESS, ret_val); + + tet_infoline("utc_tel_set_network_preferred_plmn_16 is passed\n"); + tet_result(TET_PASS); + + return; +} + +/** + * @brief This tests tel_set_network_preferred_plmn() API in normal conditions + * @par ID: + * utc_tel_set_network_preferred_plmn_17 + * @param [in] Operation + * @param [in] PreffPlmnInfo + * @code + + Operation = TAPI_NETWORK_PREF_PLMN_EDIT; + PreffPlmnInfo.Index = 250; + memcpy(PreffPlmnInfo.Plmn,"40411",5); + PreffPlmnInfo.SystemType = TAPI_NETWORK_SYSTEM_PCS1900; + pRequestId = -1; + + * @endcode + * @param [out] pRequestId + * @return TAPI_API_INVALID_INPUT + */ +void utc_tel_set_network_preferred_plmn_17() +{ + int ret_val = TAPI_API_SUCCESS; + + TelNetworkPrefferedPlmnOp_t Operation; + TelNetworkPrefferedPlmnInfo_t PreffPlmnInfo; + int pRequestId; + + Operation = TAPI_NETWORK_PREF_PLMN_EDIT; + PreffPlmnInfo.Index = 250;/*Some value between 0 and 255*/ + memcpy(PreffPlmnInfo.Plmn, "40411", 5); + PreffPlmnInfo.SystemType = TAPI_NETWORK_SYSTEM_PCS1900; + pRequestId = -1; + + tet_infoline("utc_tel_set_network_preferred_plmn_17 Test\n"); + + ret_val = tel_set_network_preferred_plmn(Operation, &PreffPlmnInfo, &pRequestId); + TET_CHECK(TAPI_API_INVALID_INPUT, ret_val); + + tet_infoline("utc_tel_set_network_preferred_plmn_17 is passed\n"); + tet_result(TET_PASS); + + return; +} + +/** + * @brief This tests tel_set_network_preferred_plmn() API in normal conditions + * @par ID: + * utc_tel_set_network_preferred_plmn_18 + * @param [in] Operation + * @param [in] PreffPlmnInfo + * @code + + Operation = TAPI_NETWORK_PREF_PLMN_EDIT; + PreffPlmnInfo.Index = 251; + memcpy(PreffPlmnInfo.Plmn,"40411",5); + PreffPlmnInfo.SystemType = TAPI_NETWORK_SYSTEM_UMTS; + pRequestId = -1; + + * @endcode + * @param [out] pRequestId + * @return TAPI_API_SUCCESS - indicating that the operation has completed successfully. + */ +void utc_tel_set_network_preferred_plmn_18() +{ + int ret_val = TAPI_API_SUCCESS; + + TelNetworkPrefferedPlmnOp_t Operation; + TelNetworkPrefferedPlmnInfo_t PreffPlmnInfo; + int pRequestId; + + Operation = TAPI_NETWORK_PREF_PLMN_EDIT; + PreffPlmnInfo.Index = 251;/*Some value between 0 and 255*/ + memcpy(PreffPlmnInfo.Plmn, "40411", 5); + PreffPlmnInfo.SystemType = TAPI_NETWORK_SYSTEM_UMTS; + pRequestId = -1; + + tet_infoline("utc_tel_set_network_preferred_plmn_18 Test\n"); + + ret_val = tel_set_network_preferred_plmn(Operation, &PreffPlmnInfo, &pRequestId); + TET_CHECK(TAPI_API_SUCCESS, ret_val); + + tet_infoline("utc_tel_set_network_preferred_plmn_18 is passed\n"); + tet_result(TET_PASS); + + return; +} + +/** + * @brief This tests tel_set_network_preferred_plmn() API in normal conditions + * @par ID: + * utc_tel_set_network_preferred_plmn_19 + * @param [in] Operation + * @param [in] PreffPlmnInfo + * @code + + Operation = TAPI_NETWORK_PREF_PLMN_EDIT; + PreffPlmnInfo.Index = 252; + memcpy(PreffPlmnInfo.Plmn,"40411",5); + PreffPlmnInfo.SystemType = TAPI_NETWORK_SYSTEM_GSM_AND_UMTS; + pRequestId = -1; + + * @endcode + * @param [out] pRequestId + * @return TAPI_API_SUCCESS - indicating that the operation has completed successfully. + */ +void utc_tel_set_network_preferred_plmn_19() +{ + int ret_val = TAPI_API_SUCCESS; + + TelNetworkPrefferedPlmnOp_t Operation; + TelNetworkPrefferedPlmnInfo_t PreffPlmnInfo; + int pRequestId; + + Operation = TAPI_NETWORK_PREF_PLMN_EDIT; + PreffPlmnInfo.Index = 252;/*Some value between 0 and 255*/ + memcpy(PreffPlmnInfo.Plmn, "40411", 5); + PreffPlmnInfo.SystemType = TAPI_NETWORK_SYSTEM_GSM_AND_UMTS; + pRequestId = -1; + + tet_infoline("utc_tel_set_network_preferred_plmn_19 Test\n"); + + ret_val = tel_set_network_preferred_plmn(Operation, &PreffPlmnInfo, &pRequestId); + TET_CHECK(TAPI_API_SUCCESS, ret_val); + + tet_infoline("utc_tel_set_network_preferred_plmn_19 is passed\n"); + tet_result(TET_PASS); + + return; +} + +/** + * @brief This tests tel_set_network_preferred_plmn() API in normal conditions + * @par ID: + * utc_tel_set_network_preferred_plmn_20 + * @param [in] Operation + * @param [in] PreffPlmnInfo + * @code + + Operation = TAPI_NETWORK_PREF_PLMN_EDIT; + PreffPlmnInfo.Index = 253; + memcpy(PreffPlmnInfo.Plmn,"40411",5); + PreffPlmnInfo.SystemType = TAPI_NETWORK_SYSTEM_HSDPA; + pRequestId = -1; + + * @endcode + * @param [out] pRequestId + * @return TAPI_API_INVALID_INPUT + */ +void utc_tel_set_network_preferred_plmn_20() +{ + int ret_val = TAPI_API_SUCCESS; + + TelNetworkPrefferedPlmnOp_t Operation; + TelNetworkPrefferedPlmnInfo_t PreffPlmnInfo; + int pRequestId; + + Operation = TAPI_NETWORK_PREF_PLMN_EDIT; + PreffPlmnInfo.Index = 253;/*Some value between 0 and 255*/ + memcpy(PreffPlmnInfo.Plmn, "40411", 5); + PreffPlmnInfo.SystemType = TAPI_NETWORK_SYSTEM_HSDPA; + pRequestId = -1; + + tet_infoline("utc_tel_set_network_preferred_plmn_20 Test\n"); + + ret_val = tel_set_network_preferred_plmn(Operation, &PreffPlmnInfo, &pRequestId); + TET_CHECK(TAPI_API_INVALID_INPUT, ret_val); + + tet_infoline("utc_tel_set_network_preferred_plmn_20 is passed\n"); + tet_result(TET_PASS); + + return; +} + +/** + * @brief This tests tel_set_network_preferred_plmn() API with invalid inputs + * @par ID: + * utc_tel_set_network_preferred_plmn_21 + * @param [in] Operation + * @param [in] PreffPlmnInfo + * @code + + Operation = TAPI_NETWORK_PREF_PLMN_DELETE; + PreffPlmnInfo.Index = 244; + memcpy(PreffPlmnInfo.Plmn,"40411",5); + PreffPlmnInfo.SystemType = TAPI_NETWORK_SYSTEM_NO_SRV; + pRequestId = -1; + + * @endcode + * @param [out] pRequestId + * @return TAPI_API_INVALID_INPUT + */ +void utc_tel_set_network_preferred_plmn_21() +{ + int ret_val = TAPI_API_SUCCESS; + + TelNetworkPrefferedPlmnOp_t Operation; + TelNetworkPrefferedPlmnInfo_t PreffPlmnInfo; + int pRequestId; + + Operation = TAPI_NETWORK_PREF_PLMN_DELETE; + PreffPlmnInfo.Index = 244;/*Some value between 0 and 255*/ + memcpy(PreffPlmnInfo.Plmn, "40411", 5); + PreffPlmnInfo.SystemType = TAPI_NETWORK_SYSTEM_NO_SRV; /*Test for invalid value*/ + pRequestId = -1; + + tet_infoline("utc_tel_set_network_preferred_plmn_21 Test\n"); + + ret_val = tel_set_network_preferred_plmn(Operation, &PreffPlmnInfo, &pRequestId); + TET_CHECK(TAPI_API_INVALID_INPUT, ret_val); + + tet_infoline("utc_tel_set_network_preferred_plmn_21 is passed\n"); + tet_result(TET_PASS); + + return; +} + +#if 0 +/** + * @brief This tests tel_set_network_preferred_plmn() API in normal conditions + * @par ID: + * utc_tel_set_network_preferred_plmn_22 + * @param [in] Operation + * @param [in] PreffPlmnInfo + * @code + + Operation = TAPI_NETWORK_PREF_PLMN_DELETE; + PreffPlmnInfo.Index = 245; + memcpy(PreffPlmnInfo.Plmn,"40411",5); + PreffPlmnInfo.SystemType = TAPI_NETWORK_SYSTEM_CDMA; + pRequestId = -1; + + * @endcode + * @param [out] pRequestId + * @return TAPI_API_INVALID_INPUT + */ + +void utc_tel_set_network_preferred_plmn_22() +{ + int ret_val = TAPI_API_SUCCESS; + + TelNetworkPrefferedPlmnOp_t Operation; + TelNetworkPrefferedPlmnInfo_t PreffPlmnInfo; + int pRequestId; + + Operation = TAPI_NETWORK_PREF_PLMN_DELETE; + PreffPlmnInfo.Index = 245;/*Some value between 0 and 255*/ + memcpy(PreffPlmnInfo.Plmn,"40411",5); + PreffPlmnInfo.SystemType = TAPI_NETWORK_SYSTEM_CDMA; + pRequestId = -1; + + tet_infoline("utc_tel_set_network_preferred_plmn_22 Test\n"); + + ret_val = tel_set_network_preferred_plmn(Operation, &PreffPlmnInfo, &pRequestId); + TET_CHECK(TAPI_API_INVALID_INPUT, ret_val); + + tet_infoline("utc_tel_set_network_preferred_plmn_22 is passed\n"); + tet_result(TET_PASS); + + return; +} + +/** + * @brief This tests tel_set_network_preferred_plmn() API in normal conditions + * @par ID: + * utc_tel_set_network_preferred_plmn_23 + * @param [in] Operation + * @param [in] PreffPlmnInfo + * @code + + Operation = TAPI_NETWORK_PREF_PLMN_DELETE; + PreffPlmnInfo.Index = 246; + memcpy(PreffPlmnInfo.Plmn,"40411",5); + PreffPlmnInfo.SystemType = TAPI_NETWORK_SYSTEM_TDMA; + pRequestId = -1; + + * @endcode + * @param [out] pRequestId + * @return TAPI_API_INVALID_INPUT + */ + +void utc_tel_set_network_preferred_plmn_23() +{ + int ret_val = TAPI_API_SUCCESS; + + TelNetworkPrefferedPlmnOp_t Operation; + TelNetworkPrefferedPlmnInfo_t PreffPlmnInfo; + int pRequestId; + + Operation = TAPI_NETWORK_PREF_PLMN_DELETE; + PreffPlmnInfo.Index = 246;/*Some value between 0 and 255*/ + memcpy(PreffPlmnInfo.Plmn,"40411",5); + PreffPlmnInfo.SystemType = TAPI_NETWORK_SYSTEM_TDMA; + pRequestId = -1; + + tet_infoline("utc_tel_set_network_preferred_plmn_23 Test\n"); + + ret_val = tel_set_network_preferred_plmn(Operation, &PreffPlmnInfo, &pRequestId); + TET_CHECK(TAPI_API_INVALID_INPUT, ret_val); + + tet_infoline("utc_tel_set_network_preferred_plmn_23 is passed\n"); + tet_result(TET_PASS); + + return; +} +#endif + +/** + * @brief This tests tel_set_network_preferred_plmn() API in normal conditions + * @par ID: + * utc_tel_set_network_preferred_plmn_24 + * @param [in] Operation + * @param [in] PreffPlmnInfo + * @code + + Operation = TAPI_NETWORK_PREF_PLMN_DELETE; + PreffPlmnInfo.Index = 247; + memcpy(PreffPlmnInfo.Plmn,"40411",5); + PreffPlmnInfo.SystemType = TAPI_NETWORK_SYSTEM_GSM; + pRequestId = -1; + + * @endcode + * @param [out] pRequestId + * @return TAPI_API_SUCCESS - indicating that the operation has completed successfully. + */ +void utc_tel_set_network_preferred_plmn_24() +{ + int ret_val = TAPI_API_SUCCESS; + + TelNetworkPrefferedPlmnOp_t Operation; + TelNetworkPrefferedPlmnInfo_t PreffPlmnInfo; + int pRequestId; + + Operation = TAPI_NETWORK_PREF_PLMN_DELETE; + PreffPlmnInfo.Index = 247;/*Some value between 0 and 255*/ + memcpy(PreffPlmnInfo.Plmn, "40411", 5); + PreffPlmnInfo.SystemType = TAPI_NETWORK_SYSTEM_GSM; + pRequestId = -1; + + tet_infoline("utc_tel_set_network_preferred_plmn_24 Test\n"); + + ret_val = tel_set_network_preferred_plmn(Operation, &PreffPlmnInfo, &pRequestId); + TET_CHECK(TAPI_API_SUCCESS, ret_val); + + tet_infoline("utc_tel_set_network_preferred_plmn_24 is passed\n"); + tet_result(TET_PASS); + + return; +} + +/** + * @brief This tests tel_set_network_preferred_plmn() API in normal conditions + * @par ID: + * utc_tel_set_network_preferred_plmn_25 + * @param [in] Operation + * @param [in] PreffPlmnInfo + * @code + + Operation = TAPI_NETWORK_PREF_PLMN_DELETE; + PreffPlmnInfo.Index = 248; + memcpy(PreffPlmnInfo.Plmn,"40411",5); + PreffPlmnInfo.SystemType = TAPI_NETWORK_SYSTEM_GPRS; + pRequestId = -1; + + * @endcode + * @param [out] pRequestId + * @return TAPI_API_SUCCESS - indicating that the operation has completed successfully. + */ +void utc_tel_set_network_preferred_plmn_25() +{ + int ret_val = TAPI_API_SUCCESS; + + TelNetworkPrefferedPlmnOp_t Operation; + TelNetworkPrefferedPlmnInfo_t PreffPlmnInfo; + int pRequestId; + + Operation = TAPI_NETWORK_PREF_PLMN_DELETE; + PreffPlmnInfo.Index = 248;/*Some value between 0 and 255*/ + memcpy(PreffPlmnInfo.Plmn, "40411", 5); + PreffPlmnInfo.SystemType = TAPI_NETWORK_SYSTEM_GPRS; + pRequestId = -1; + + tet_infoline("utc_tel_set_network_preferred_plmn_25 Test\n"); + + ret_val = tel_set_network_preferred_plmn(Operation, &PreffPlmnInfo, &pRequestId); + TET_CHECK(TAPI_API_SUCCESS, ret_val); + + tet_infoline("utc_tel_set_network_preferred_plmn_25 is passed\n"); + tet_result(TET_PASS); + + return; +} + +/** + * @brief This tests tel_set_network_preferred_plmn() API in normal conditions + * @par ID: + * utc_tel_set_network_preferred_plmn_26 + * @param [in] Operation + * @param [in] PreffPlmnInfo + * @code + + Operation = TAPI_NETWORK_PREF_PLMN_DELETE; + PreffPlmnInfo.Index = 249; + memcpy(PreffPlmnInfo.Plmn,"40411",5); + PreffPlmnInfo.SystemType = TAPI_NETWORK_SYSTEM_EGPRS; + pRequestId = -1; + + * @endcode + * @param [out] pRequestId + * @return TAPI_API_SUCCESS - indicating that the operation has completed successfully. + */ +void utc_tel_set_network_preferred_plmn_26() +{ + int ret_val = TAPI_API_SUCCESS; + + TelNetworkPrefferedPlmnOp_t Operation; + TelNetworkPrefferedPlmnInfo_t PreffPlmnInfo; + int pRequestId; + + Operation = TAPI_NETWORK_PREF_PLMN_DELETE; + PreffPlmnInfo.Index = 249;/*Some value between 0 and 255*/ + memcpy(PreffPlmnInfo.Plmn, "40411", 5); + PreffPlmnInfo.SystemType = TAPI_NETWORK_SYSTEM_EGPRS; + pRequestId = -1; + + tet_infoline("utc_tel_set_network_preferred_plmn_26 Test\n"); + + ret_val = tel_set_network_preferred_plmn(Operation, &PreffPlmnInfo, &pRequestId); + TET_CHECK(TAPI_API_SUCCESS, ret_val); + + tet_infoline("utc_tel_set_network_preferred_plmn_26 is passed\n"); + tet_result(TET_PASS); + + return; +} + +/** + * @brief This tests tel_set_network_preferred_plmn() API in normal conditions + * @par ID: + * utc_tel_set_network_preferred_plmn_26 + * @param [in] Operation + * @param [in] PreffPlmnInfo + * @code + + Operation = TAPI_NETWORK_PREF_PLMN_DELETE; + PreffPlmnInfo.Index = 250; + memcpy(PreffPlmnInfo.Plmn,"40411",5); + PreffPlmnInfo.SystemType = TAPI_NETWORK_SYSTEM_PCS1900; + pRequestId = -1; + + * @endcode + * @param [out] pRequestId + * @return TAPI_API_INVALID_INPUT + */ +void utc_tel_set_network_preferred_plmn_27() +{ + int ret_val = TAPI_API_SUCCESS; + + TelNetworkPrefferedPlmnOp_t Operation; + TelNetworkPrefferedPlmnInfo_t PreffPlmnInfo; + int pRequestId; + + Operation = TAPI_NETWORK_PREF_PLMN_DELETE; + PreffPlmnInfo.Index = 250;/*Some value between 0 and 255*/ + memcpy(PreffPlmnInfo.Plmn, "40411", 5); + PreffPlmnInfo.SystemType = TAPI_NETWORK_SYSTEM_PCS1900; + pRequestId = -1; + + tet_infoline("utc_tel_set_network_preferred_plmn_27 Test\n"); + + ret_val = tel_set_network_preferred_plmn(Operation, &PreffPlmnInfo, &pRequestId); + TET_CHECK(TAPI_API_INVALID_INPUT, ret_val); + + tet_infoline("utc_tel_set_network_preferred_plmn_27 is passed\n"); + tet_result(TET_PASS); + + return; +} + +/** + * @brief This tests tel_set_network_preferred_plmn() API in normal conditions + * @par ID: + * utc_tel_set_network_preferred_plmn_28 + * @param [in] Operation + * @param [in] PreffPlmnInfo + * @code + + Operation = TAPI_NETWORK_PREF_PLMN_DELETE; + PreffPlmnInfo.Index = 251; + memcpy(PreffPlmnInfo.Plmn,"40411",5); + PreffPlmnInfo.SystemType = TAPI_NETWORK_SYSTEM_UMTS; + pRequestId = -1; + + * @endcode + * @param [out] pRequestId + * @return TAPI_API_SUCCESS - indicating that the operation has completed successfully. + */ +void utc_tel_set_network_preferred_plmn_28() +{ + int ret_val = TAPI_API_SUCCESS; + + TelNetworkPrefferedPlmnOp_t Operation; + TelNetworkPrefferedPlmnInfo_t PreffPlmnInfo; + int pRequestId; + + Operation = TAPI_NETWORK_PREF_PLMN_DELETE; + PreffPlmnInfo.Index = 251;/*Some value between 0 and 255*/ + memcpy(PreffPlmnInfo.Plmn, "40411", 5); + PreffPlmnInfo.SystemType = TAPI_NETWORK_SYSTEM_UMTS; + pRequestId = -1; + + tet_infoline("utc_tel_set_network_preferred_plmn_28 Test\n"); + + ret_val = tel_set_network_preferred_plmn(Operation, &PreffPlmnInfo, &pRequestId); + TET_CHECK(TAPI_API_SUCCESS, ret_val); + + tet_infoline("utc_tel_set_network_preferred_plmn_28 is passed\n"); + tet_result(TET_PASS); + + return; +} + +/** + * @brief This tests tel_set_network_preferred_plmn() API in normal conditions + * @par ID: + * utc_tel_set_network_preferred_plmn_29 + * @param [in] Operation + * @param [in] PreffPlmnInfo + * @code + + Operation = TAPI_NETWORK_PREF_PLMN_DELETE; + PreffPlmnInfo.Index = 252; + memcpy(PreffPlmnInfo.Plmn,"40411",5); + PreffPlmnInfo.SystemType = TAPI_NETWORK_SYSTEM_GSM_AND_UMTS; + pRequestId = -1; + + * @endcode + * @param [out] pRequestId + * @return TAPI_API_SUCCESS - indicating that the operation has completed successfully. + */ +void utc_tel_set_network_preferred_plmn_29() +{ + int ret_val = TAPI_API_SUCCESS; + + TelNetworkPrefferedPlmnOp_t Operation; + TelNetworkPrefferedPlmnInfo_t PreffPlmnInfo; + int pRequestId; + + Operation = TAPI_NETWORK_PREF_PLMN_DELETE; + PreffPlmnInfo.Index = 252;/*Some value between 0 and 255*/ + memcpy(PreffPlmnInfo.Plmn, "40411", 5); + PreffPlmnInfo.SystemType = TAPI_NETWORK_SYSTEM_GSM_AND_UMTS; + pRequestId = -1; + + tet_infoline("utc_tel_set_network_preferred_plmn_29 Test\n"); + + ret_val = tel_set_network_preferred_plmn(Operation, &PreffPlmnInfo, &pRequestId); + TET_CHECK(TAPI_API_SUCCESS, ret_val); + + tet_infoline("utc_tel_set_network_preferred_plmn_29 is passed\n"); + tet_result(TET_PASS); + + return; +} + +/** + * @brief This tests tel_set_network_preferred_plmn() API in normal conditions + * @par ID: + * utc_tel_set_network_preferred_plmn_30 + * @param [in] Operation + * @param [in] PreffPlmnInfo + * @code + + Operation = TAPI_NETWORK_PREF_PLMN_DELETE; + PreffPlmnInfo.Index = 253; + memcpy(PreffPlmnInfo.Plmn,"40411",5); + PreffPlmnInfo.SystemType = TAPI_NETWORK_SYSTEM_HSDPA; + pRequestId = -1; + + * @endcode + * @param [out] pRequestId + * @return TAPI_API_INVALID_INPUT + */ +void utc_tel_set_network_preferred_plmn_30() +{ + int ret_val = TAPI_API_SUCCESS; + + TelNetworkPrefferedPlmnOp_t Operation; + TelNetworkPrefferedPlmnInfo_t PreffPlmnInfo; + int pRequestId; + + Operation = TAPI_NETWORK_PREF_PLMN_DELETE; + PreffPlmnInfo.Index = 253;/*Some value between 0 and 255*/ + memcpy(PreffPlmnInfo.Plmn, "40411", 5); + PreffPlmnInfo.SystemType = TAPI_NETWORK_SYSTEM_HSDPA; + pRequestId = -1; + + tet_infoline("utc_tel_set_network_preferred_plmn_30 Test\n"); + + ret_val = tel_set_network_preferred_plmn(Operation, &PreffPlmnInfo, &pRequestId); + TET_CHECK(TAPI_API_INVALID_INPUT, ret_val); + + tet_infoline("utc_tel_set_network_preferred_plmn_30 is passed\n"); + tet_result(TET_PASS); + + return; +} + +/** + * @brief This tests tel_set_network_preferred_plmn() API with invalid input + * @par ID: + * utc_tel_set_network_preferred_plmn_31 + * @param [in] Operation + * @param [in] PreffPlmnInfo + * @code + + Operation = -1; + PreffPlmnInfo.Index = 23; + memcpy(PreffPlmnInfo.Plmn,"40411",5); + PreffPlmnInfo.SystemType = TAPI_NETWORK_SYSTEM_NO_SRV; + pRequestId = -1; + + * @endcode + * @param [out] pRequestId + * @return TAPI_API_INVALID_INPUT + */ +void utc_tel_set_network_preferred_plmn_31() +{ + int ret_val = TAPI_API_SUCCESS; + + TelNetworkPrefferedPlmnOp_t Operation; + TelNetworkPrefferedPlmnInfo_t PreffPlmnInfo; + int pRequestId; + + Operation = -1;/*invalid input*/ + PreffPlmnInfo.Index = 23;/*Some value between 0 and 255*/ + memcpy(PreffPlmnInfo.Plmn, "40411", 5); + PreffPlmnInfo.SystemType = TAPI_NETWORK_SYSTEM_NO_SRV;/*Invalid input*/ + pRequestId = -1; + + tet_infoline("utc_tel_set_network_preferred_plmn_31 Test\n"); + + ret_val = tel_set_network_preferred_plmn(Operation, &PreffPlmnInfo, &pRequestId); + TET_CHECK(TAPI_API_INVALID_INPUT, ret_val); + + tet_infoline("utc_tel_set_network_preferred_plmn_31 is passed\n"); + tet_result(TET_PASS); + + return; +} + +#if 0 +/** + * @brief This tests tel_set_network_preferred_plmn() API with invalid input + * @par ID: + * utc_tel_set_network_preferred_plmn_32 + * @param [in] Operation + * @param [in] PreffPlmnInfo + * @code + + Operation = -1; + PreffPlmnInfo.Index = 23; + memcpy(PreffPlmnInfo.Plmn,"40411",5); + PreffPlmnInfo.SystemType = TAPI_NETWORK_SYSTEM_CDMA; + pRequestId = -1; + + * @endcode + * @param [out] pRequestId + * @return TAPI_API_INVALID_INPUT + */ + +void utc_tel_set_network_preferred_plmn_32() +{ + int ret_val = TAPI_API_SUCCESS; + + TelNetworkPrefferedPlmnOp_t Operation; + TelNetworkPrefferedPlmnInfo_t PreffPlmnInfo; + int pRequestId; + + Operation = -1;/*invalid input*/ + PreffPlmnInfo.Index = 23;/*Some value between 0 and 255*/ + memcpy(PreffPlmnInfo.Plmn,"40411",5); + PreffPlmnInfo.SystemType = TAPI_NETWORK_SYSTEM_CDMA; + pRequestId = -1; + + tet_infoline("utc_tel_set_network_preferred_plmn_32 Test\n"); + + ret_val = tel_set_network_preferred_plmn(Operation, &PreffPlmnInfo, &pRequestId); + TET_CHECK(TAPI_API_INVALID_INPUT, ret_val); + + tet_infoline("utc_tel_set_network_preferred_plmn_32 is passed\n"); + tet_result(TET_PASS); + + return; +} + +/** + * @brief This tests tel_set_network_preferred_plmn() API with invalid input + * @par ID: + * utc_tel_set_network_preferred_plmn_33 + * @param [in] Operation + * @param [in] PreffPlmnInfo + * @code + + Operation = -1; + PreffPlmnInfo.Index = 23; + memcpy(PreffPlmnInfo.Plmn,"40411",5); + PreffPlmnInfo.SystemType = TAPI_NETWORK_SYSTEM_TDMA; + pRequestId = -1; + + * @endcode + * @param [out] pRequestId + * @return TAPI_API_INVALID_INPUT + */ + +void utc_tel_set_network_preferred_plmn_33() +{ + int ret_val = TAPI_API_SUCCESS; + + TelNetworkPrefferedPlmnOp_t Operation; + TelNetworkPrefferedPlmnInfo_t PreffPlmnInfo; + int pRequestId; + + Operation = -1;/*invalid input*/ + PreffPlmnInfo.Index = 23;/*Some value between 0 and 255*/ + memcpy(PreffPlmnInfo.Plmn,"40411",5); + PreffPlmnInfo.SystemType = TAPI_NETWORK_SYSTEM_TDMA; + pRequestId = -1; + + tet_infoline("utc_tel_set_network_preferred_plmn_33 Test\n"); + + ret_val = tel_set_network_preferred_plmn(Operation, &PreffPlmnInfo, &pRequestId); + TET_CHECK(TAPI_API_INVALID_INPUT, ret_val); + + tet_infoline("utc_tel_set_network_preferred_plmn_33 is passed\n"); + tet_result(TET_PASS); + + return; +} +#endif + +/** + * @brief This tests tel_set_network_preferred_plmn() API with invalid input + * @par ID: + * utc_tel_set_network_preferred_plmn_34 + * @param [in] Operation + * @param [in] PreffPlmnInfo + * @code + + Operation = -1; + PreffPlmnInfo.Index = 23; + memcpy(PreffPlmnInfo.Plmn,"40411",5); + PreffPlmnInfo.SystemType = TAPI_NETWORK_SYSTEM_GSM; + pRequestId = -1; + + * @endcode + * @param [out] pRequestId + * @return TAPI_API_INVALID_INPUT + */ +void utc_tel_set_network_preferred_plmn_34() +{ + int ret_val = TAPI_API_SUCCESS; + + TelNetworkPrefferedPlmnOp_t Operation; + TelNetworkPrefferedPlmnInfo_t PreffPlmnInfo; + int pRequestId; + + Operation = -1;/*invalid input*/ + PreffPlmnInfo.Index = 23;/*Some value between 0 and 255*/ + memcpy(PreffPlmnInfo.Plmn, "40411", 5); + PreffPlmnInfo.SystemType = TAPI_NETWORK_SYSTEM_GSM; + pRequestId = -1; + + tet_infoline("utc_tel_set_network_preferred_plmn_34 Test\n"); + + ret_val = tel_set_network_preferred_plmn(Operation, &PreffPlmnInfo, &pRequestId); + TET_CHECK(TAPI_API_INVALID_INPUT, ret_val); + + tet_infoline("utc_tel_set_network_preferred_plmn_34 is passed\n"); + tet_result(TET_PASS); + + return; +} + +/** + * @brief This tests tel_set_network_preferred_plmn() API with invalid input + * @par ID: + * utc_tel_set_network_preferred_plmn_35 + * @param [in] Operation + * @param [in] PreffPlmnInfo + * @code + + Operation = -1; + PreffPlmnInfo.Index = 23; + memcpy(PreffPlmnInfo.Plmn,"40411",5); + PreffPlmnInfo.SystemType = TAPI_NETWORK_SYSTEM_GPRS; + pRequestId = -1; + + * @endcode + * @param [out] pRequestId + * @return TAPI_API_INVALID_INPUT + */ +void utc_tel_set_network_preferred_plmn_35() +{ + int ret_val = TAPI_API_SUCCESS; + + TelNetworkPrefferedPlmnOp_t Operation; + TelNetworkPrefferedPlmnInfo_t PreffPlmnInfo; + int pRequestId; + + Operation = -1;/*invalid input*/ + PreffPlmnInfo.Index = 23;/*Some value between 0 and 255*/ + memcpy(PreffPlmnInfo.Plmn, "40411", 5); + PreffPlmnInfo.SystemType = TAPI_NETWORK_SYSTEM_GPRS; + pRequestId = -1; + + tet_infoline("utc_tel_set_network_preferred_plmn_35 Test\n"); + + ret_val = tel_set_network_preferred_plmn(Operation, &PreffPlmnInfo, &pRequestId); + TET_CHECK(TAPI_API_INVALID_INPUT, ret_val); + + tet_infoline("utc_tel_set_network_preferred_plmn_35 is passed\n"); + tet_result(TET_PASS); + + return; +} + +/** + * @brief This tests tel_set_network_preferred_plmn() API with invalid input + * @par ID: + * utc_tel_set_network_preferred_plmn_36 + * @param [in] Operation + * @param [in] PreffPlmnInfo + * @code + + Operation = -1; + PreffPlmnInfo.Index = 23; + memcpy(PreffPlmnInfo.Plmn,"40411",5); + PreffPlmnInfo.SystemType = TAPI_NETWORK_SYSTEM_EGPRS; + pRequestId = -1; + + * @endcode + * @param [out] pRequestId + * @return TAPI_API_INVALID_INPUT + */ +void utc_tel_set_network_preferred_plmn_36() +{ + int ret_val = TAPI_API_SUCCESS; + + TelNetworkPrefferedPlmnOp_t Operation; + TelNetworkPrefferedPlmnInfo_t PreffPlmnInfo; + int pRequestId; + + Operation = -1;/*invalid input*/ + PreffPlmnInfo.Index = 23;/*Some value between 0 and 255*/ + memcpy(PreffPlmnInfo.Plmn, "40411", 5); + PreffPlmnInfo.SystemType = TAPI_NETWORK_SYSTEM_EGPRS; + pRequestId = -1; + + tet_infoline("utc_tel_set_network_preferred_plmn_36 Test\n"); + + ret_val = tel_set_network_preferred_plmn(Operation, &PreffPlmnInfo, &pRequestId); + TET_CHECK(TAPI_API_INVALID_INPUT, ret_val); + + tet_infoline("utc_tel_set_network_preferred_plmn_36 is passed\n"); + tet_result(TET_PASS); + + return; +} + +/** + * @brief This tests tel_set_network_preferred_plmn() API with invalid input + * @par ID: + * utc_tel_set_network_preferred_plmn_37 + * @param [in] Operation + * @param [in] PreffPlmnInfo + * @code + + Operation = -1; + PreffPlmnInfo.Index = 23; + memcpy(PreffPlmnInfo.Plmn,"40411",5); + PreffPlmnInfo.SystemType = TAPI_NETWORK_SYSTEM_PCS1900; + pRequestId = -1; + + * @endcode + * @param [out] pRequestId + * @return TAPI_API_INVALID_INPUT + */ +void utc_tel_set_network_preferred_plmn_37() +{ + int ret_val = TAPI_API_SUCCESS; + + TelNetworkPrefferedPlmnOp_t Operation; + TelNetworkPrefferedPlmnInfo_t PreffPlmnInfo; + int pRequestId; + + Operation = -1;/*invalid input*/ + PreffPlmnInfo.Index = 23;/*Some value between 0 and 255*/ + memcpy(PreffPlmnInfo.Plmn, "40411", 5); + PreffPlmnInfo.SystemType = TAPI_NETWORK_SYSTEM_PCS1900; + pRequestId = -1; + + tet_infoline("utc_tel_set_network_preferred_plmn_37 Test\n"); + + ret_val = tel_set_network_preferred_plmn(Operation, &PreffPlmnInfo, &pRequestId); + TET_CHECK(TAPI_API_INVALID_INPUT, ret_val); + + tet_infoline("utc_tel_set_network_preferred_plmn_37 is passed\n"); + tet_result(TET_PASS); + + return; +} + +/** + * @brief This tests tel_set_network_preferred_plmn() API with invalid input + * @par ID: + * utc_tel_set_network_preferred_plmn_38 + * @param [in] Operation + * @param [in] PreffPlmnInfo + * @code + + Operation = -1; + PreffPlmnInfo.Index = 23; + memcpy(PreffPlmnInfo.Plmn,"40411",5); + PreffPlmnInfo.SystemType = TAPI_NETWORK_SYSTEM_UMTS; + pRequestId = -1; + + * @endcode + * @param [out] pRequestId + * @return TAPI_API_INVALID_INPUT + */ +void utc_tel_set_network_preferred_plmn_38() +{ + int ret_val = TAPI_API_SUCCESS; + + TelNetworkPrefferedPlmnOp_t Operation; + TelNetworkPrefferedPlmnInfo_t PreffPlmnInfo; + int pRequestId; + + Operation = -1;/*invalid input*/ + PreffPlmnInfo.Index = 23;/*Some value between 0 and 255*/ + memcpy(PreffPlmnInfo.Plmn, "40411", 5); + PreffPlmnInfo.SystemType = TAPI_NETWORK_SYSTEM_UMTS; + pRequestId = -1; + + tet_infoline("utc_tel_set_network_preferred_plmn_38 Test\n"); + + ret_val = tel_set_network_preferred_plmn(Operation, &PreffPlmnInfo, &pRequestId); + TET_CHECK(TAPI_API_INVALID_INPUT, ret_val); + + tet_infoline("utc_tel_set_network_preferred_plmn_38 is passed\n"); + tet_result(TET_PASS); + + return; +} + +/** + * @brief This tests tel_set_network_preferred_plmn() API with invalid input + * @par ID: + * utc_tel_set_network_preferred_plmn_39 + * @param [in] Operation + * @param [in] PreffPlmnInfo + * @code + + Operation = -1; + PreffPlmnInfo.Index = 23; + memcpy(PreffPlmnInfo.Plmn,"40411",5); + PreffPlmnInfo.SystemType = TAPI_NETWORK_SYSTEM_GSM_AND_UMTS; + pRequestId = -1; + + * @endcode + * @param [out] pRequestId + * @return TAPI_API_INVALID_INPUT + */ +void utc_tel_set_network_preferred_plmn_39() +{ + int ret_val = TAPI_API_SUCCESS; + + TelNetworkPrefferedPlmnOp_t Operation; + TelNetworkPrefferedPlmnInfo_t PreffPlmnInfo; + int pRequestId; + + Operation = -1;/*invalid input*/ + PreffPlmnInfo.Index = 23;/*Some value between 0 and 255*/ + memcpy(PreffPlmnInfo.Plmn, "40411", 5); + PreffPlmnInfo.SystemType = TAPI_NETWORK_SYSTEM_GSM_AND_UMTS; + pRequestId = -1; + + tet_infoline("utc_tel_set_network_preferred_plmn_39 Test\n"); + + ret_val = tel_set_network_preferred_plmn(Operation, &PreffPlmnInfo, &pRequestId); + TET_CHECK(TAPI_API_INVALID_INPUT, ret_val); + + tet_infoline("utc_tel_set_network_preferred_plmn_39 is passed\n"); + tet_result(TET_PASS); + + return; +} + +/** + * @brief This tests tel_set_network_preferred_plmn() API with invalid input + * @par ID: + * utc_tel_set_network_preferred_plmn_40 + * @param [in] Operation + * @param [in] PreffPlmnInfo + * @code + + Operation = -1; + PreffPlmnInfo.Index = 23; + memcpy(PreffPlmnInfo.Plmn,"40411",5); + PreffPlmnInfo.SystemType = TAPI_NETWORK_SYSTEM_HSDPA; + pRequestId = -1; + + * @endcode + * @param [out] pRequestId + * @return TAPI_API_INVALID_INPUT + */ +void utc_tel_set_network_preferred_plmn_40() +{ + int ret_val = TAPI_API_SUCCESS; + + TelNetworkPrefferedPlmnOp_t Operation; + TelNetworkPrefferedPlmnInfo_t PreffPlmnInfo; + int pRequestId; + + Operation = -1;/*invalid input*/ + PreffPlmnInfo.Index = 23;/*Some value between 0 and 255*/ + memcpy(PreffPlmnInfo.Plmn, "40411", 5); + PreffPlmnInfo.SystemType = TAPI_NETWORK_SYSTEM_HSDPA; + pRequestId = -1; + + tet_infoline("utc_tel_set_network_preferred_plmn_40 Test\n"); + + ret_val = tel_set_network_preferred_plmn(Operation, &PreffPlmnInfo, &pRequestId); + TET_CHECK(TAPI_API_INVALID_INPUT, ret_val); + + tet_infoline("utc_tel_set_network_preferred_plmn_40 is passed\n"); + tet_result(TET_PASS); + + return; +} +/** @} */ diff --git a/TC/telephony_TC/network/unit/uts_tel_set_network_preferred_plmn.h b/TC/telephony_TC/network/unit/uts_tel_set_network_preferred_plmn.h new file mode 100644 index 0000000..4f017bf --- /dev/null +++ b/TC/telephony_TC/network/unit/uts_tel_set_network_preferred_plmn.h @@ -0,0 +1,72 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * 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. + */ + + +static void startup(); +static void cleanup(); + +static void utc_tel_set_network_preferred_plmn_01(void); +//static void utc_tel_set_network_preferred_plmn_02(void); +//static void utc_tel_set_network_preferred_plmn_03(void); +static void utc_tel_set_network_preferred_plmn_04(void); +static void utc_tel_set_network_preferred_plmn_05(void); +static void utc_tel_set_network_preferred_plmn_06(void); +static void utc_tel_set_network_preferred_plmn_07(void); +static void utc_tel_set_network_preferred_plmn_08(void); +static void utc_tel_set_network_preferred_plmn_09(void); +static void utc_tel_set_network_preferred_plmn_10(void); +static void utc_tel_set_network_preferred_plmn_11(void); +//static void utc_tel_set_network_preferred_plmn_12(void); +//static void utc_tel_set_network_preferred_plmn_13(void); +static void utc_tel_set_network_preferred_plmn_14(void); +static void utc_tel_set_network_preferred_plmn_15(void); +static void utc_tel_set_network_preferred_plmn_16(void); +static void utc_tel_set_network_preferred_plmn_17(void); +static void utc_tel_set_network_preferred_plmn_18(void); +static void utc_tel_set_network_preferred_plmn_19(void); +static void utc_tel_set_network_preferred_plmn_20(void); +static void utc_tel_set_network_preferred_plmn_21(void); +//static void utc_tel_set_network_preferred_plmn_22(void); +//static void utc_tel_set_network_preferred_plmn_23(void); +static void utc_tel_set_network_preferred_plmn_24(void); +static void utc_tel_set_network_preferred_plmn_25(void); +static void utc_tel_set_network_preferred_plmn_26(void); +static void utc_tel_set_network_preferred_plmn_27(void); +static void utc_tel_set_network_preferred_plmn_28(void); +static void utc_tel_set_network_preferred_plmn_29(void); +static void utc_tel_set_network_preferred_plmn_30(void); +static void utc_tel_set_network_preferred_plmn_31(void); +//static void utc_tel_set_network_preferred_plmn_32(void); +//static void utc_tel_set_network_preferred_plmn_33(void); +static void utc_tel_set_network_preferred_plmn_34(void); +static void utc_tel_set_network_preferred_plmn_35(void); +static void utc_tel_set_network_preferred_plmn_36(void); +static void utc_tel_set_network_preferred_plmn_37(void); +static void utc_tel_set_network_preferred_plmn_38(void); +static void utc_tel_set_network_preferred_plmn_39(void); +static void utc_tel_set_network_preferred_plmn_40(void); + + +/** @} */ + + + + + diff --git a/TC/telephony_TC/network/unit/uts_tel_set_network_roaming.c b/TC/telephony_TC/network/unit/uts_tel_set_network_roaming.c new file mode 100644 index 0000000..41a09f1 --- /dev/null +++ b/TC/telephony_TC/network/unit/uts_tel_set_network_roaming.c @@ -0,0 +1,233 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * 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 "tel_tapi_nw_common.h" +#include "uts_tel_set_network_roaming.h" + +TS_UINT subscription_id = 0, subscription_id1 = 0; + +/* Initialize TCM data structures */ +static void startup(); +static void cleanup(); +void (*tet_startup) () = startup; +void (*tet_cleanup) () = cleanup; +struct tet_testlist tet_testlist[] = { + {utc_tel_set_network_roaming_01, 1}, + {utc_tel_set_network_roaming_02, 2}, + {utc_tel_set_network_roaming_03, 3}, + {utc_tel_set_network_roaming_04, 4}, + {NULL, 0} +}; + +/* Startup & Clean function : It is not test code, only for + initialize and finalize test module + */ +void callback(TelTapiEvent_t *event) +{ + if (event->EventClass != TAPI_EVENT_CLASS_NETWORK) + return; + + if (event->EventType == TAPI_EVENT_NETWORK_SET_ROAMING_MODE_CNF) { + printf("\n$$$$$$ TAPI_EVENT_NETWORK_SET_ROAMING_MODE_CNF $$$$$$ \n"); + } + +} + +static void startup() +{ + TapiResult_t api_err = TAPI_API_SUCCESS; + tet_infoline("utc_tel_set_network_roaming, Test Start\n"); + + api_err = tel_init(); + if (api_err != TAPI_API_SUCCESS) { + printf("tel_init Failed api_err = %d \n", api_err); + } + + api_err = tel_register_event(TAPI_EVENT_NETWORK_SET_ROAMING_MODE_CNF, &subscription_id1, (TelAppCallback) &callback, NULL); + if (api_err != TAPI_API_SUCCESS) { + printf("TapiCommonRegisterEvent Failed api_err = %d \n", api_err); + } + printf("after TapiCommonRegisterEvent sub id is %d api_err is %d\n", subscription_id1, api_err); + + tel_register_app_name("org.samsung.test"); + return; +} + +static void cleanup() +{ + tet_infoline("utc_tel_set_network_roaming, Test Finished\n"); + tel_deregister_event(subscription_id1); + tel_deinit(); + return; +} + + +/* + Unit Test Case functions + */ + +/** + * @brief This tests tel_set_network_roaming() API in normal conditions + * @par ID: + * utc_tel_tapi_nw_set_network_mode_func_01 + * @param [in] NwMode + * @code + + RoamingMode = TAPI_NETWORK_MODE_EMERGENCY; + pRequestId = -1; + + * @endcode + * @param [out] pRequestId + * @return TAPI_API_INVALID_INPUT + */ +void utc_tel_set_network_roaming_01() +{ + TapiResult_t ret_val = TAPI_API_SUCCESS; + + TelNetworkRoamingMode_t RoamingMode; + int pRequestId; + + RoamingMode.pref_net_type = TAPI_NETWORK_PREF_NET_TYPE_AUTOMATIC; + RoamingMode.prl_pref_only = TAPI_NETWORK_PRL_PREF_ONLY_ON; + pRequestId = -1; + + tet_infoline("utc_tel_set_network_roaming_01 Test\n"); + + ret_val = tel_set_network_roaming(&RoamingMode, &pRequestId); + TET_CHECK(TAPI_API_INVALID_INPUT, ret_val); + + tet_infoline("utc_tel_set_network_roaming_01 is passed\n"); + tet_result(TET_PASS); + + return; +} + +/** + * @brief This tests tel_set_network_roaming() API in normal conditions + * @par ID: + * utc_tel_tapi_nw_set_network_mode_func_02 + * @param [in] NwMode + * @code + + //RoamingMode = TAPI_NETWORK_MODE_AUTOMATIC; + pRequestId = -1; + + * @endcode + * @param [out] pRequestId + * @return TAPI_API_SUCCESS - indicating that the operation has completed successfully. + */ +void utc_tel_set_network_roaming_02() +{ + TapiResult_t ret_val = TAPI_API_SUCCESS; + + TelNetworkRoamingMode_t RoamingMode; + int pRequestId; + + RoamingMode.pref_net_type = TAPI_NETWORK_PREF_NET_TYPE_AUTOMATIC_A; + RoamingMode.prl_pref_only = TAPI_NETWORK_PRL_PREF_ONLY_ON; + pRequestId = -1; + + tet_infoline("utc_tel_set_network_roaming_02 Test\n"); + + ret_val = tel_set_network_roaming(&RoamingMode, &pRequestId); + TET_CHECK(TAPI_API_SUCCESS, ret_val); + + tet_infoline("utc_tel_set_network_roaming_02 is passed\n"); + tet_result(TET_PASS); + + return; +} + +/** + * @brief This tests tel_set_network_roaming() API in normal conditions + * @par ID: + * utc_tel_set_network_roaming_03 + * @param [in] NwMode + * @code + + //NwMode = TAPI_NETWORK_MODE_CDMA; + pRequestId = -1; + + * @endcode + * @param [out] pRequestId + * @return TAPI_API_INVALID_INPUT + */ +void utc_tel_set_network_roaming_03() +{ + TapiResult_t ret_val = TAPI_API_SUCCESS; + + TelNetworkRoamingMode_t RoamingMode; + int pRequestId; + + RoamingMode.pref_net_type = TAPI_NETWORK_PREF_NET_TYPE_ROAM_ONLY; + RoamingMode.prl_pref_only = TAPI_NETWORK_PRL_PREF_ONLY_NONE + 1; + pRequestId = -1; + + tet_infoline("utc_tel_set_network_roaming_03 Test\n"); + + ret_val = tel_set_network_roaming(&RoamingMode, &pRequestId); + TET_CHECK(TAPI_API_INVALID_INPUT, ret_val); + + tet_infoline("utc_tel_tapi_nw_set_network_mode_func_03 is passed\n"); + tet_result(TET_PASS); + + return; +} + +/** + * @brief This tests tel_set_network_roaming() API in normal conditions + * @par ID: + * utc_tel_set_network_roaming_04 + * @param [in] NwMode + * @code + + //RoamingMode = TAPI_NETWORK_MODE_GSM; + pRequestId = -1; + +* @endcode +* @param [out] pRequestId +* @return TAPI_API_SUCCESS - indicating that the operation has completed successfully. +*/ +void utc_tel_set_network_roaming_04() +{ + TapiResult_t ret_val = TAPI_API_SUCCESS; + + TelNetworkRoamingMode_t RoamingMode; + RoamingMode.pref_net_type = TAPI_NETWORK_PREF_NET_TYPE_HOME_ONLY; + RoamingMode.prl_pref_only = TAPI_NETWORK_PRL_PREF_ONLY_ON; + + //RoamingMode = TAPI_NETWORK_MODE_GSM; + + tet_infoline("utc_tel_set_network_roaming_04 Test\n"); + + ret_val = tel_set_network_roaming(&RoamingMode, NULL); + TET_CHECK(TAPI_API_INVALID_PTR, ret_val); + if (ret_val == TAPI_API_INVALID_PTR) { + tet_infoline("utc_tel_set_network_roaming_04 is passed\n"); + tet_result(TET_PASS); + } + + return; +} + +/** @} */ diff --git a/TC/telephony_TC/network/unit/uts_tel_set_network_roaming.h b/TC/telephony_TC/network/unit/uts_tel_set_network_roaming.h new file mode 100644 index 0000000..3f349a7 --- /dev/null +++ b/TC/telephony_TC/network/unit/uts_tel_set_network_roaming.h @@ -0,0 +1,34 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * 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. + */ + + +static void startup(); +static void cleanup(); + +static void utc_tel_set_network_roaming_01(void); +static void utc_tel_set_network_roaming_02(void); +static void utc_tel_set_network_roaming_03(void); +static void utc_tel_set_network_roaming_04(void); + + + +/** @} */ + + diff --git a/TC/telephony_TC/network/unit/uts_tel_set_network_service_domain.c b/TC/telephony_TC/network/unit/uts_tel_set_network_service_domain.c new file mode 100644 index 0000000..05f4fd7 --- /dev/null +++ b/TC/telephony_TC/network/unit/uts_tel_set_network_service_domain.c @@ -0,0 +1,250 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * 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 "tel_tapi_nw_common.h" +#include "uts_tel_set_network_service_domain.h" + +TS_UINT subscription_id = 0, subscription_id1 = 0; + +/* Initialize TCM data structures */ +static void startup(); +static void cleanup(); +void (*tet_startup) () = startup; +void (*tet_cleanup) () = cleanup; +struct tet_testlist tet_testlist[] = { + {utc_tel_set_network_service_domain_01, 1}, + {utc_tel_set_network_service_domain_02, 2}, + {utc_tel_set_network_service_domain_03, 3}, + {utc_tel_set_network_service_domain_04, 4}, + {utc_tel_set_network_service_domain_05, 5}, + {NULL, 0} +}; + +/* Startup & Clean function : It is not test code, only for + initialize and finalize test module + */ +static void startup() +{ + TapiResult_t api_err = TAPI_API_SUCCESS; + tet_infoline("utc_tel_set_network_service_domain, Test Start\n"); + + api_err = tel_init(); + if (api_err != TAPI_API_SUCCESS) { + printf("tel_init Failed api_err = %d \n", api_err); + } + + api_err = tel_register_event(TAPI_EVENT_NETWORK_SETSERVICEDOMAIN_CNF, &subscription_id1, tapi_callback, NULL); + if (api_err != TAPI_API_SUCCESS) { + printf("TapiCommonRegisterEvent Failed api_err = %d \n", api_err); + } + printf("after TapiCommonRegisterEvent sub id is %d api_err is %d\n", subscription_id1, api_err); + + tel_register_app_name("org.samsung.test"); + return; +} + +static void cleanup() +{ + tet_infoline("utc_tel_set_network_service_domain, Test Finished\n"); + tel_deregister_event(subscription_id1); + tel_deinit(); + return; +} + + +/* + Unit Test Case functions + */ + +/** + * @brief This tests tel_set_network_service_domain() API in normal conditions + * @par ID: + * utc_tel_set_network_service_domain_01 + * @param [in] ServiceDomain + * @code + + pRequestId = -1; + ServiceDomain = TAPI_NETWORK_SERVICE_DOMAIN_COMBINED; + + * @endcode + * @param [out] pRequestId + * @return TAPI_API_SUCCESS - indicating that the operation has completed successfully. + */ +void utc_tel_set_network_service_domain_01() +{ + TapiResult_t ret_val = TAPI_API_SUCCESS; + + TelNetworkServiceDomain_t ServiceDomain; + int pRequestId; + pRequestId = -1; + ServiceDomain = TAPI_NETWORK_SERVICE_DOMAIN_COMBINED; + + tet_infoline("utc_tel_set_network_service_domain_01 Test\n"); + + ret_val = tel_set_network_service_domain(ServiceDomain, &pRequestId); + TET_CHECK(TAPI_API_SUCCESS, ret_val); + + tet_infoline("utc_tel_set_network_service_domain_01 is passed\n"); + tet_result(TET_PASS); + + return; +} + +/** + * @brief This tests tel_set_network_service_domain() API in normal conditions + * @par ID: + * utc_tel_set_network_service_domain_02 + * @param [in] ServiceDomain + * @code + + pRequestId = -1; + ServiceDomain = TAPI_NETWORK_SERVICE_DOMAIN_PS; + + * @endcode + * @param [out] pRequestId + * @return TAPI_API_SUCCESS - indicating that the operation has completed successfully. + */ +void utc_tel_set_network_service_domain_02() +{ + TapiResult_t ret_val = TAPI_API_SUCCESS; + + TelNetworkServiceDomain_t ServiceDomain; + int pRequestId; + pRequestId = -1; + ServiceDomain = TAPI_NETWORK_SERVICE_DOMAIN_PS; + + tet_infoline("utc_tel_set_network_service_domain_02 Test\n"); + + ret_val = tel_set_network_service_domain(ServiceDomain, &pRequestId); + TET_CHECK(TAPI_API_SUCCESS, ret_val); + + tet_infoline("utc_tel_set_network_service_domain_02 is passed\n"); + tet_result(TET_PASS); + + return; +} + +/** + * @brief This tests tel_set_network_service_domain() API in normal conditions + * @par ID: + * utc_tel_set_network_service_domain_03 + * @param [in] ServiceDomain + * @code + + pRequestId = -1; + ServiceDomain = TAPI_NETWORK_SERVICE_DOMAIN_CS; + + * @endcode + * @param [out] pRequestId + * @return TAPI_API_SUCCESS - indicating that the operation has completed successfully. + */ +void utc_tel_set_network_service_domain_03() +{ + TapiResult_t ret_val = TAPI_API_SUCCESS; + + TelNetworkServiceDomain_t ServiceDomain; + int pRequestId; + pRequestId = -1; + ServiceDomain = TAPI_NETWORK_SERVICE_DOMAIN_CS; + + tet_infoline("utc_tel_set_network_service_domain_03 Test\n"); + + ret_val = tel_set_network_service_domain(ServiceDomain, &pRequestId); + TET_CHECK(TAPI_API_SUCCESS, ret_val); + + tet_infoline("utc_tel_set_network_service_domain_03 is passed\n"); + tet_result(TET_PASS); + + return; +} + +/** + * @brief This tests tel_set_network_service_domain() API in normal conditions + * @par ID: + * utc_tel_set_network_service_domain_04 + * @param [in] ServiceDomain + * @code + + pRequestId = -1; + ServiceDomain = TAPI_NETWORK_SERVICE_DOMAIN_AUTOMATIC; + + * @endcode + * @param [out] pRequestId + * @return TAPI_API_SUCCESS - indicating that the operation has completed successfully. + */ +void utc_tel_set_network_service_domain_04() +{ + TapiResult_t ret_val = TAPI_API_SUCCESS; + + TelNetworkServiceDomain_t ServiceDomain; + int pRequestId; + pRequestId = -1; + ServiceDomain = TAPI_NETWORK_SERVICE_DOMAIN_AUTOMATIC; + + tet_infoline("utc_tel_set_network_service_domain_04 Test\n"); + + ret_val = tel_set_network_service_domain(ServiceDomain, &pRequestId); + TET_CHECK(TAPI_API_SUCCESS, ret_val); + + tet_infoline("utc_tel_set_network_service_domain_04 is passed\n"); + tet_result(TET_PASS); + + return; +} + +/** + * @brief This tests tel_set_network_service_domain() API with invalid input + * @par ID: + * utc_tel_set_network_service_domain_05 + * @param [in] ServiceDomain + * @code + + pRequestId = -1; + ServiceDomain = -1; + + * @endcode + * @param [out] pRequestId + * @return TAPI_API_SUCCESS - indicating that the operation has completed successfully. + */ +void utc_tel_set_network_service_domain_05() +{ + TapiResult_t ret_val = TAPI_API_SUCCESS; + + TelNetworkServiceDomain_t ServiceDomain; + ServiceDomain = -1; + int pRequestId; + pRequestId = -1; + + tet_infoline("utc_tel_set_network_service_domain_05 Test\n"); + + ret_val = tel_set_network_service_domain(ServiceDomain, &pRequestId); + TET_CHECK(TAPI_API_INVALID_INPUT, ret_val); + + tet_infoline("utc_tel_set_network_service_domain_05 is passed\n"); + tet_result(TET_PASS); + + return; +} + +/** @} */ diff --git a/TC/telephony_TC/network/unit/uts_tel_set_network_service_domain.h b/TC/telephony_TC/network/unit/uts_tel_set_network_service_domain.h new file mode 100644 index 0000000..345833d --- /dev/null +++ b/TC/telephony_TC/network/unit/uts_tel_set_network_service_domain.h @@ -0,0 +1,38 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * 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. + */ + + +static void startup(); +static void cleanup(); +static void utc_tel_set_network_service_domain_01(void); +static void utc_tel_set_network_service_domain_02(void); +static void utc_tel_set_network_service_domain_03(void); +static void utc_tel_set_network_service_domain_04(void); +static void utc_tel_set_network_service_domain_05(void); + + +/** @} */ + + + + + + + diff --git a/TC/telephony_TC/power/unit/makefile b/TC/telephony_TC/power/unit/makefile new file mode 100644 index 0000000..4265475 --- /dev/null +++ b/TC/telephony_TC/power/unit/makefile @@ -0,0 +1,54 @@ +CC=gcc -Wall + +LB1 = power_common +TS1 = uts_tel_process_power_command +TS2 = uts_tel_set_flight_mode +TS3 = uts_tapi_power_reboot_modem +TS4 = +TS5 = +TS6 = +TS7 = + +LIBS =$(LB1).o +LIBS += `pkg-config --libs gconf-2.0 glib-2.0 dbus-1 dbus-glib-1 gthread-2.0 tapi` +LIBS +=$(TET_ROOT)/lib/tet3/tcm_s.o +LIBS +=-L$(TET_ROOT)/lib/tet3 -ltcm_s +LIBS +=-L$(TET_ROOT)/lib/tet3 -lapi_s + +INCS += -I$(TET_ROOT)/inc/tet3 +INCS += -I. `pkg-config --cflags gconf-2.0 glib-2.0 dbus-1 dbus-glib-1 gthread-2.0 tapi` + +#ifeq ($(ARCH),target) +#CC += -g -mabi=aapcs-linux +#endif + +CFLAGS = $(INCS) -DXTHREADS -D_REENTRANT -DXUSE_MTSAFE_API -DWITHOUT_APP_MGR +CFLAGS += -D_TETWARE_MODE_ -D_XO_TELEPHONY_INTEGRATION_ +CFLAGS += -DXO20_EVENT_DELIVERY_MODIFICATION +CC +=$(CFLAGS) +LDFLAGS = $(LIBS) + + +all : $(LB1) $(TS1) $(TS2) $(TS3) $(TS4) $(TS5) $(TS6) $(TS7) +clean : + rm -rf *~ *.o tet_lock tet_captured $(LB1) $(TS1) $(TS2) $(TS3) $(TS4) $(TS5) $(TS6) $(TS7) + +$(LB1): $(LB1).c + $(CC) -c $(LB1).c + + +$(TS1): $(TS1).c $(LB1) + $(CC) -o $(TS1) $(TS1).c $(LDFLAGS) +$(TS2): $(TS2).c $(LB1) + $(CC) -o $(TS2) $(TS2).c $(LDFLAGS) +$(TS3): $(TS3).c $(LB1) + $(CC) -o $(TS3) $(TS3).c $(LDFLAGS) +$(TS4): $(TS4).c $(LB1) + $(CC) -o $(TS4) $(TS4).c $(LDFLAGS) +$(TS5): $(TS5).c $(LB1) + $(CC) -o $(TS5) $(TS5).c $(LDFLAGS) +$(TS6): $(TS6).c $(LB1) + $(CC) -o $(TS6) $(TS6).c $(LDFLAGS) +$(TS7): $(TS7).c $(LB1) + $(CC) -o $(TS7) $(TS7).c $(LDFLAGS) + diff --git a/TC/telephony_TC/power/unit/power_common.c b/TC/telephony_TC/power/unit/power_common.c new file mode 100644 index 0000000..abb7301 --- /dev/null +++ b/TC/telephony_TC/power/unit/power_common.c @@ -0,0 +1,229 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * 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 "power_common.h" +#include +#define TIME_DELAY 5000 +GMainLoop *g_main_loop = NULL; + +static unsigned int subscription_id[5]={0,0,0,0,0}; +int expected_event; +bool async_response = false; + + +void G_MAIN_LOOP_CLOSE() +{ + g_main_loop_quit(g_main_loop); +} + +gboolean g_timeout_callback(void * data) +{ + G_MAIN_LOOP_CLOSE(); + return FALSE; +} + +int G_MAIN_LOOP_RUN(int sec) +{ + g_main_loop = g_main_loop_new(NULL, FALSE); + g_timeout_add_seconds(sec, g_timeout_callback, NULL); + g_main_loop_run(g_main_loop); + + return 0; +} + +void print_events(int event) { + + printf("\n event in prnt_events function %d\n", event); + + switch (event) { + case TAPI_EVENT_NETTEXT_GET_COUNT_CNF: /**< This event is returned in response to Get Number of messages stored in SIM*/ + case TAPI_EVENT_NETTEXT_SENTSTATUS_CNF: /**< This event is returned in response to SMS message sent*/ + case TAPI_EVENT_NETTEXT_GET_PARAM_CNF: /**< This event is returned in response to NetText Get parameters*/ + case TAPI_EVENT_NETTEXT_DELETE_STATUS_CNF: /**< This confirmation event is a returned indicating the delete message e status*/ + case TAPI_EVENT_NETTEXT_SAVE_STATUS_CNF: /**< This confirmation event is a returned indicating the Save SMS into SIM status*/ + case TAPI_EVENT_NETTEXT_SET_REQUEST_CNF: /**< This event is returned as a confirmation for SET nettext APIs*/ + case TAPI_EVENT_NETTEXT_GET_CB_CONFIG_CNF: /**< This event is returned with Get CB configuration details*/ + case TAPI_EVENT_NETTEXT_GET_SMSBEARER_CNF: /**< This event is returned as a response to get preferred bearer used for SMS Transport*/ + case TAPI_EVENT_NETTEXT_DELIVERY_REPORT_CNF:/**< This event is returned in response to send delivery report*/ + case TAPI_EVENT_NETTEXT_INCOM_IND: /**< This is an unsolicited Incoming SMS Event*/ + case TAPI_EVENT_NETTEXT_CB_INCOM_IND: /**< This is an unsolicited Incoming cell broadcast message*/ + case TAPI_EVENT_NETTEXT_MEMORY_STATUS_IND: /**< This event is an unsolicited event indicating SIM memory status */ + case TAPI_EVENT_NETTEXT_DEVICE_READY_IND: /**< Device Ready indication */ + case TAPI_EVENT_NETTEXT_PARAM_COUNT_IND: /**< Param count indication */ + /* Events related on Network Messages */ + case TAPI_EVENT_NETWORK_GETNWBAND_CNF: //= TAPI_EVENT_CLASS_NETWORK<<8: /**<0x0300: This event indicates the Network Band has been identified and returned*/ + case TAPI_EVENT_NETWORK_SETNWBAND_CNF: /**< This event indicates the Network Band has been set*/ + case TAPI_EVENT_NETWORK_GETSERVICEDOMAIN_CNF: /**< This event confirms the request to get the service domain */ + case TAPI_EVENT_NETWORK_SETSERVICEDOMAIN_CNF: /**< This event confirms the request to set the service domain */ + case TAPI_EVENT_NETWORK_CANCELMANUALSELECTION_CNF: /**< This event is returned on cancellation of manual network selection from network list*/ + case TAPI_EVENT_NETWORK_CANCELMANUALSEARCH_CNF: /**< This event is returned on cancellation of manual network search*/ + case TAPI_EVENT_NETWORK_GETNWORDER_CNF: /**< This event is returned on getting network order*/ + case TAPI_EVENT_NETWORK_SETNWORDER_CNF: /**< This event is returned on setting network order*/ + case TAPI_EVENT_NETWORK_GETNWMODE_CNF:/**< This event is returned on getting network mode*/ + case TAPI_EVENT_NETWORK_SETNWMODE_CNF: /**< This event is returned on setting network mode*/ + case TAPI_EVENT_NETWORK_SELECT_CNF: /**< This confirmation event is returned when user manually selected a network from list for Network selection */ + case TAPI_EVENT_NETWORK_SEARCH_CNF: /**< This event is returned as confirmation for manual Network search with the available network list*/ + case TAPI_EVENT_NETWORK_GETSELECTIONMODE_CNF: /**< This event is returned on getting network selection mode*/ + case TAPI_EVENT_SS_BARRING_CNF: //= TAPI_EVENT_CLASS_SS<<8: /**<0x0400: This confirmation event is sent when Barring activation/deactivation is requested*/ + case TAPI_EVENT_SS_BARRING_CHANGEPASS_CNF: /**< This event is returned as Barring password change confirmation*/ + case TAPI_EVENT_SS_BARRING_QUERYSTATUS_CNF: /**< This event is returned as Barring status query confirmation*/ + case TAPI_EVENT_SS_FORWARD_CNF: /**< This event is returned as confirmation for Forward Activation/Deactivation/Registration/Erasure */ + case TAPI_EVENT_SS_FORWARD_QUERYSTATUS_CNF: /**< This event is returned as confirmation for Forward Status query confirmation*/ + case TAPI_EVENT_SS_WAITING_CNF: /**< This event is returned as confirmation for Call waiting activation/deactivation*/ + case TAPI_EVENT_SS_WAITING_QUERYSTATUS_CNF: /**< This event is returned as Call waiting status query confirmation*/ + case TAPI_EVENT_SS_USSD_CNF: /**< This event is returned as USSD send confirmation*/ + case TAPI_EVENT_SS_USSD_IND: /**< This is an unsolicited USSD indication*/ + case TAPI_EVENT_SS_CLI_QUERYSTATUS_CNF: /**< This event is indicated to the Application for CLI service interrogation*/ + case TAPI_EVENT_SS_REL_COMP_MSG_NOTIFY: /**< This event is indicated to the Application when tapi receives Release complete message notification for any SS transactions*/ + case TAPI_EVENT_SS_AOC_RSP: /**EventClass; + eventType = TapiEvent->EventType; + requestId = TapiEvent->RequestId; + status = TapiEvent->Status; + EventData = TapiEvent->pData; + printf(" app _callback is called \n"); + + print_events((int) eventType); + printf("\n event came in power_callback [%d] \n", eventType); + printf("\n expected event is in callback [%d] \n", expected_event); + + switch (eventClass) { + default: + TEST_DEBUG("##Undefined Power Event received") + ; + break; + } + + if (eventType == expected_event) { + g_main_loop_quit(g_main_loop); + async_response = true; + } + return; +} + +void print_all_subsciption_ids() { + int i = 0; + for (i = 0; i < 2; i++) { + printf("\n subscription_id[%d] has value %d \n", i, subscription_id[i]); + } +} + +TapiResult_t register_all_events() { + TapiResult_t api_err = -1; + + api_err = tel_register_event(TAPI_EVENT_POWER_FLIGHT_MODE_RESP, + &subscription_id[0], (TelAppCallback) &power_app_callback, NULL); + api_err = tel_register_event(TAPI_EVENT_POWER_PHONE_OFF, + &subscription_id[1], (TelAppCallback) &power_app_callback, NULL); + + print_all_subsciption_ids(); + return api_err; +} + +TapiResult_t deregister_all() { + TapiResult_t api_err = -1; + + api_err = tel_deregister_event(subscription_id[0]); + api_err = tel_deregister_event(subscription_id[1]); + return api_err; + +} diff --git a/TC/telephony_TC/power/unit/power_common.h b/TC/telephony_TC/power/unit/power_common.h new file mode 100644 index 0000000..ecbb8dc --- /dev/null +++ b/TC/telephony_TC/power/unit/power_common.h @@ -0,0 +1,79 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * 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 _POWER_COMMON_H_ +#define _POWER_COMMON_H_ + +#include +#include +#include +#include "string.h" +#include "assert.h" +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include "tet_macro.h" +#include + +#define TIME_DELAY 5000 +#define TEST_DEBUG(fmt, args...) \ + printf("[%s %s:%d]\n" fmt "\n",__FILE__, __FUNCTION__, __LINE__, ##args); + + +#ifndef false + #define false 0 +#endif +#ifndef true + #define true !0 +#endif +#ifndef bool + #define bool char +#endif + +extern void power_app_callback (TelTapiEvent_t *TapiEvent); +void print_events(int event); +extern TapiResult_t register_all_events(); +extern TapiResult_t deregister_all(); +extern void G_MAIN_LOOP_CLOSE(); +extern int G_MAIN_LOOP_RUN(int); + + +#define TET_CHECK_TEMP(x1, y...) \ +do { \ + TapiResult_t err = y;\ + if (err != (x1)) \ + { \ + tet_printf("[line %d] Expected Result: %d Actual Result: %d",__LINE__, x1,y); \ + tet_result(TET_FAIL); \ + return;\ + } \ + } while(0) + + +#endif //_POWER_COMMON_H_ diff --git a/TC/telephony_TC/power/unit/tet_macro.h b/TC/telephony_TC/power/unit/tet_macro.h new file mode 100644 index 0000000..9c5909e --- /dev/null +++ b/TC/telephony_TC/power/unit/tet_macro.h @@ -0,0 +1,32 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * 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 TET_MACRO_H +#define TET_MACRO_H + +#define TET_CHECK(x) if(x) tet_result(TET_PASS); else tet_result(TET_FAIL) +#define TET_CHECK_EQUAL(x,y) if ((x)==(y)) tet_result(TET_PASS); else tet_result(TET_FAIL) +#define TET_CHECK_NOT_EQUAL(x,y) if ((x)!=(y)) tet_result(TET_PASS); else tet_result(TET_FAIL) + +#define TET_CHECK_MESSAGE(x,y) if ((y)==(TRUE)) tet_result(TET_PASS); else {tet_result(TET_FAIL); tet_printf(x);} +#define TET_CHECK_EQUAL_MESSAGE(x,y,z) if ((y)==(z)) tet_result(TET_PASS); else {tet_result(TET_FAIL); tet_printf(x);} +#define TET_CHECK_NOT_EQUAL_MESSAGE(x,y,z) if ((y)!=(z)) tet_result(TET_PASS); else {tet_result(TET_FAIL); tet_printf(x);} + +#endif diff --git a/TC/telephony_TC/power/unit/tslist b/TC/telephony_TC/power/unit/tslist new file mode 100644 index 0000000..2a67ad5 --- /dev/null +++ b/TC/telephony_TC/power/unit/tslist @@ -0,0 +1,8 @@ +#/power/unit/uts_tel_process_power_command +#/power/unit/uts_tapi_power_get_phone_power_status +/power/unit/uts_tel_set_flight_mode +/power/unit/uts_tapi_power_reboot_modem +#/power/unit/uts_tapi_display_get_icon_info +#/power/unit/uts_tapi_power_battery_compansation_set +#/power/unit/uts_tapi_power_charger_indication_set + diff --git a/TC/telephony_TC/power/unit/uts_tapi_display_get_icon_info.c b/TC/telephony_TC/power/unit/uts_tapi_display_get_icon_info.c new file mode 100644 index 0000000..7e6c0b6 --- /dev/null +++ b/TC/telephony_TC/power/unit/uts_tapi_display_get_icon_info.c @@ -0,0 +1,321 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * 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 "uts_tapi_display_get_icon_info.h" + + + +void (*tet_startup) () = startup; +void (*tet_cleanup) () = cleanup; + +struct tet_testlist tet_testlist[] = { + {utc_tapi_display_get_icon_info_00, 1}, + {utc_tapi_display_get_icon_info_01, 2}, + {utc_tapi_display_get_icon_info_02, 3}, + {utc_tapi_display_get_icon_info_03, 4}, + {utc_tapi_display_get_icon_info_04, 5}, + {NULL, 0} + }; + +extern int expected_event; +extern bool async_response; + +static void startup() +{ + TapiResult_t ret_status ; + + + ret_status = tel_init(); + + if(ret_status != TAPI_API_SUCCESS) + { + printf("TelTapiInit() Failed ret_status = %d \n",ret_status); + } + + register_all_events(); + + tel_register_app_name("org.samsung.test"); +} + +static void cleanup() +{ + TapiResult_t ret_status ; + + deregister_all(); + ret_status = tel_deinit(); + + + if(ret_status != TAPI_API_SUCCESS) + { + printf("TelTapiDeInit() Failed ret_status = %d \n",ret_status); + } +} + + + + + +/** + * @brief This tests + * @par ID: utc_tapi_display_get_icon_info_00 + * @param [in] tapi_display_get_icon_req_type_t + * @code + * @endcode + * @return TapiResult_t +*/ + + +void utc_tapi_display_get_icon_info_00() +{ + + + TEST_DEBUG("\n TEST utc_tapi_display_get_icon_info_00 \n"); + + TapiResult_t ret_status ; + + async_response = false;//initialize + + ret_status = tapi_display_get_icon_info(TAPI_DISPLAY_GET_ICON_RSSI); + + printf("/n return value = %d\n",ret_status); + + if(TAPI_API_SUCCESS == ret_status) + { + printf("/n/****************** get icon info api successful **************************\\n"); + } + else + { + printf("/n/****************** get icon info api case failed **************************\\n"); + } + + TET_CHECK_EQUAL(TAPI_API_SUCCESS, ret_status); + tet_infoline("utc_tapi_display_get_icon_info_00 pass"); + expected_event = TAPI_EVENT_DISPLAY_ICON_INFO_IND; + printf("The expected_event is TAPI_EVENT_DISPLAY_ICON_INFO_IND(%d)\n",expected_event); + + printf("\n\n value of asyn_response %d",async_response); + G_MAIN_LOOP_RUN(10); + tet_result(TET_PASS); + + TEST_DEBUG("\n\n\n\n\n######## TEST utc_tapi_display_get_icon_info_00 ENDS ###########\n"); + + +} + + + +/** + * @brief This tests + * @par ID: utc_tapi_display_get_icon_info_01 + * @param [in] tapi_display_get_icon_req_type_t + * @code + * @endcode + * @return TapiResult_t +*/ + + +void utc_tapi_display_get_icon_info_01() +{ + + + TEST_DEBUG("\n\n\n\n\n######## TEST utc_tapi_display_get_icon_info_01 START ###########\n"); + + TapiResult_t ret_status ; + + async_response = false;//initialize + + ret_status = tapi_display_get_icon_info(TAPI_DISPLAY_GET_ICON_ACT); + + printf("/n return value = %d\n",ret_status); + + if(TAPI_API_SUCCESS == ret_status) + { + printf("/n/****************** get icon info api successful **************************\\n"); + } + else + { + printf("/n/****************** get icon info api case failed **************************\\n"); + } + + TET_CHECK_EQUAL(TAPI_API_SUCCESS, ret_status); + tet_infoline("utc_tapi_display_get_icon_info_01 pass"); + expected_event = TAPI_EVENT_DISPLAY_ICON_INFO_IND; + printf("The expected_event is TAPI_EVENT_DISPLAY_ICON_INFO_IND(%d)\n",expected_event); + + printf("\n\n value of asyn_response %d",async_response); + G_MAIN_LOOP_RUN(10); + tet_result(TET_PASS); + + TEST_DEBUG("\n\n\n\n\n######## TEST utc_tapi_display_get_icon_info_01 ENDS ###########\n"); + +} + + + +/** + * @brief This tests + * @par ID: utc_tapi_display_get_icon_info_02 + * @param [in] tapi_display_get_icon_req_type_t + * @code + * @endcode + * @return TapiResult_t +*/ + + +void utc_tapi_display_get_icon_info_02() +{ + + TEST_DEBUG("\n\n\n\n\n######## TEST utc_tapi_display_get_icon_info_02 START ###########\n"); + + TapiResult_t ret_status ; + + async_response = false;//initialize + + ret_status = tapi_display_get_icon_info(TAPI_DISPLAY_GET_ICON_ALL); + + printf("/n return value = %d\n",ret_status); + + if(TAPI_API_SUCCESS == ret_status) + { + printf("/n/****************** get icon info api successful **************************\\n"); + } + else + { + printf("/n/****************** get icon info api case failed **************************\\n"); + } + + TET_CHECK_EQUAL(TAPI_API_SUCCESS, ret_status); + tet_infoline("utc_tapi_display_get_icon_info_02 pass"); + expected_event = TAPI_EVENT_DISPLAY_ICON_INFO_IND; + printf("The expected_event is TAPI_EVENT_DISPLAY_ICON_INFO_IND(%d)\n",expected_event); + + printf("\n\n value of asyn_response %d",async_response); + G_MAIN_LOOP_RUN(10); + tet_result(TET_PASS); + + TEST_DEBUG("\n\n\n\n\n######## TEST utc_tapi_display_get_icon_info_02 ENDS ###########\n"); + + + +} + + + + + +/** + * @brief This tests + * @par ID: utc_tapi_display_get_icon_info_03 + * @param [in] tapi_display_get_icon_req_type_t + * @code + * @endcode + * @return TapiResult_t +*/ + + +void utc_tapi_display_get_icon_info_03() +{ + TEST_DEBUG("\n\n\n\n\n######## TEST utc_tapi_display_get_icon_info_03 START ###########\n"); + + TapiResult_t ret_status ; + + async_response = false;//initialize + + ret_status = tapi_display_get_icon_info(TAPI_DISPLAY_GET_ICON_RSSI - 1); + + printf("/n return value = %d\n",ret_status); + + if(TAPI_API_INVALID_INPUT == ret_status) + { + printf("/n/****************** get icon info api invalid input case successful **************************\\n"); + } + else + { + printf("/n/****************** get icon info api invalid input case failed **************************\\n"); + } + + TET_CHECK_EQUAL(TAPI_API_INVALID_INPUT, ret_status); + tet_infoline("utc_tapi_display_get_icon_info_03 pass"); +expected_event = TAPI_EVENT_DISPLAY_ICON_INFO_IND; +printf("The expected_event is TAPI_EVENT_DISPLAY_ICON_INFO_IND(%d)\n",expected_event); + +G_MAIN_LOOP_RUN(10); +tet_result(TET_PASS); + + TEST_DEBUG("\n\n\n\n\n######## TEST utc_tapi_display_get_icon_info_03 ENDS ###########\n"); + + +} + + + + + +/** + * @brief This tests + * @par ID: utc_tapi_display_get_icon_info_04 + * @param [in] tapi_display_get_icon_req_type_t + * @code + * @endcode + * @return TapiResult_t +*/ + + +void utc_tapi_display_get_icon_info_04() +{ + TEST_DEBUG("\n\n\n\n\n######## TEST utc_tapi_display_get_icon_info_04 START ###########\n"); + + TapiResult_t ret_status ; + + async_response = false;//initialize + + ret_status = tapi_display_get_icon_info(TAPI_DISPLAY_GET_ICON_ALL + 1); + + printf("/n return value = %d\n",ret_status); + + if(TAPI_API_INVALID_INPUT == ret_status) + { + printf("/n/****************** get icon info api invalid input case successful **************************\\n"); + } + else + { + printf("/n/****************** get icon info api invalid input case failed **************************\\n"); + } + + TET_CHECK_EQUAL(TAPI_API_INVALID_INPUT, ret_status); + tet_infoline("utc_tapi_display_get_icon_info_04 pass"); + expected_event = TAPI_EVENT_DISPLAY_ICON_INFO_IND; + printf("The expected_event is TAPI_EVENT_DISPLAY_ICON_INFO_IND(%d)\n",expected_event); + +G_MAIN_LOOP_RUN(10); + tet_result(TET_PASS); + + TEST_DEBUG("\n\n\n\n\n######## TEST utc_tapi_display_get_icon_info_04 ENDS ###########\n"); + + + +} + + + + + +/** @} */ diff --git a/TC/telephony_TC/power/unit/uts_tapi_display_get_icon_info.h b/TC/telephony_TC/power/unit/uts_tapi_display_get_icon_info.h new file mode 100644 index 0000000..e067040 --- /dev/null +++ b/TC/telephony_TC/power/unit/uts_tapi_display_get_icon_info.h @@ -0,0 +1,58 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * 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. + */ + + + + +/** +* @file uts_tapi_display_get_icon_info.h +* @brief This is a suite of unit test cases to test Telephony Power API function +* @author Sagar Aggarwal (a.sagar@samsung.com) +* @version Initial Creation +* @date [2009-05-13] +*/ + + + +#include "power_common.h" + + +#ifndef _UTC_TAPI_POWER_DISPLAY_GET_INFO_ +#define _UTC_TAPI_POWER_DISPLAY_GET_INFO_ + + +void utc_tapi_display_get_icon_info_00(); + +void utc_tapi_display_get_icon_info_01(); + +void utc_tapi_display_get_icon_info_02(); + +void utc_tapi_display_get_icon_info_03(); + +void utc_tapi_display_get_icon_info_04(); + +static void startup(); + +static void cleanup(); + + + + +#endif //_UTC_TAPI_POWER_DISPLAY_GET_INFO_ diff --git a/TC/telephony_TC/power/unit/uts_tapi_power_get_phone_power_status.c b/TC/telephony_TC/power/unit/uts_tapi_power_get_phone_power_status.c new file mode 100644 index 0000000..c8a70b2 --- /dev/null +++ b/TC/telephony_TC/power/unit/uts_tapi_power_get_phone_power_status.c @@ -0,0 +1,202 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** +* @ingroup Telephony_API TelephonyAPI +* @addtogroup POWER power +*/ + +/** +* @ingroup POWER power +* @addtogroup UTS_POWER Unit +*/ + +/** +* @ingroup UTS_POWER Unit +* @addtogroup UTS_TAPI_POWER_GET_PHONE_POWER_STATUS tapi_power_get_phone_power_status +* @{ +*/ + + + +/** +* @file tapi_power_get_phone_power_status.c +* @brief This is a suite of unit test cases to test Telephony power API function +* @author Sagar Aggarwal (a.sagar@samsung.com) +* @version Initial Creation +* @date [2009-05-13] +*/ + + +//add includes + + +#include "uts_tapi_power_get_phone_power_status.h" + + + +void (*tet_startup) () = startup; +void (*tet_cleanup) () = cleanup; + + +extern TelTapiEventType_t expected_event; +extern bool async_response; + +static void startup() +{ + TapiResult_t ret_status ; + + + ret_status = TelTapiInit(); + + if(ret_status != TAPI_API_SUCCESS) + { + printf("TelTapiInit() Failed ret_status = %d \n",ret_status); + } + + register_all_events(); + tel_register_app_name("org.samsung.test"); + +} + +static void cleanup() +{ + TapiResult_t ret_status ; + + deregister_all(); + ret_status = TelTapiDeInit(); + + + if(ret_status != TAPI_API_SUCCESS) + { + printf("TelTapiDeInit() Failed ret_status = %d \n",ret_status); + } +} + + + + + +/** + * @brief This tests + * @par ID: UTC_TAPI_POWER_GET_PHONE_POWER_STATUS_00 + * @param [out] tapi_power_phone_power_status_t + * @code + * @endcode + * @return TapiResult_t +*/ + + +void utc_tapi_power_get_phone_power_status_00() +{ + + + TEST_DEBUG("\n\n\n\n\n######## TEST utc_tapi_power_get_phone_power_status_00 START ###########\n"); + + TapiResult_t ret_status ; + + async_response = false;//initialize + tapi_power_phone_power_status_t status = 0; + + ret_status = tapi_power_get_phone_power_status(&status); + + printf("/n return value = %d\n",ret_status); + + if(TAPI_API_SUCCESS == ret_status) + { + printf("/n/****************** get power mode api successfully **************************\\n"); + } + else + { + printf("/n/****************** get power mode api not started **************************\\n"); + } + + TET_CHECK_EQUAL(TAPI_API_SUCCESS, ret_status); + tet_infoline("utc_tapi_power_get_phone_power_status_00 pass"); + expected_event = TAPI_EVENT_POWER_BATT_STAT_IND; + printf("The expected_event is TAPI_EVENT_POWER_BATT_STAT_IND(%d)\n",expected_event); + + printf("\n\n value of asyn_response %d",async_response); + G_MAIN_LOOP_RUN(10); + // TET_CHECK_TEMP(true, async_response); + tet_result(TET_PASS); + + TEST_DEBUG("\n\n\n\n\n######## TEST utc_tapi_power_get_phone_power_status_00 ENDS ###########\n"); + + + +} + + + +/** + * @brief This tests + * @par ID: UTC_TAPI_POWER_GET_PHONE_POWER_STATUS_01 + * @param [out] tapi_power_phone_power_status_t + * @code + * @endcode + * @return TapiResult_t +*/ + + +void utc_tapi_power_get_phone_power_status_01() +{ + + + TEST_DEBUG("\n\n\n\n\n######## TEST utc_tapi_power_get_phone_power_status_01 START ###########\n"); + + TapiResult_t ret_status ; + + async_response = false;//initialize + tapi_power_phone_power_status_t status = 0; + + ret_status = tapi_power_get_phone_power_status(NULL); + + printf("/n return value = %d\n",ret_status); + + if(TAPI_API_INVALID_PTR == ret_status) + { + printf("/n/****************** get power mode api null case successful **************************\\n"); + } + else + { + printf("/n/****************** get power mode api null case failed **************************\\n"); + } + + TET_CHECK_EQUAL(TAPI_API_INVALID_PTR, ret_status); + tet_infoline("utc_tapi_power_get_phone_power_status_01 pass"); + // expected_event = TAPI_EVENT_POWER_BATT_STAT_IND; + // printf("The expected_event is TAPI_EVENT_POWER_BATT_STAT_IND(%d)\n",expected_event); + + //G_MAIN_LOOP_RUN(10); + //TET_CHECK_TEMP(true, async_response); + //tet_result(TET_PASS); + + TEST_DEBUG("\n\n\n\n\n######## TEST utc_tapi_power_get_phone_power_status_01 ENDS ###########\n"); + + +} + + + + + + +/** @} */ diff --git a/TC/telephony_TC/power/unit/uts_tapi_power_get_phone_power_status.h b/TC/telephony_TC/power/unit/uts_tapi_power_get_phone_power_status.h new file mode 100644 index 0000000..9ed556d --- /dev/null +++ b/TC/telephony_TC/power/unit/uts_tapi_power_get_phone_power_status.h @@ -0,0 +1,56 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * 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. + */ + +/** +* @file uts_tapi_power_get_phone_power_status.h +* @brief This is a suite of unit test cases to test Telephony power API function +* @author Sagar Aggarwal (a.sagar@samsung.com) +* @version Initial Creation +* @date [2009-05-13] +*/ + + + +#include "power_common.h" +#include + +#ifndef _UTC_TAPI_POWER_STATUS_ +#define _UTC_TAPI_POWER_STATUS_ + + + +void utc_tapi_power_get_phone_power_status_00(); + +void utc_tapi_power_get_phone_power_status_01(); + + +static void startup(); + +static void cleanup(); + +struct tet_testlist tet_testlist[] = { + {utc_tapi_power_get_phone_power_status_00, 1}, + {utc_tapi_power_get_phone_power_status_01, 2}, + {NULL, 0} + }; + + + +#endif //_UTC_TAPI_POWER_STATUS_ diff --git a/TC/telephony_TC/power/unit/uts_tapi_power_reboot_modem.c b/TC/telephony_TC/power/unit/uts_tapi_power_reboot_modem.c new file mode 100644 index 0000000..85fec1f --- /dev/null +++ b/TC/telephony_TC/power/unit/uts_tapi_power_reboot_modem.c @@ -0,0 +1,154 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** +* @ingroup Telephony_API TelephonyAPI +* @addtogroup POWER power +*/ + +/** +* @ingroup POWER power +* @addtogroup UTS_POWER Unit +*/ + +/** +* @ingroup UTS_POWER Unit +* @addtogroup UTS_TAPI_POWER_FLIGHT_MODE tapi_power_flight_mode +* @{ +*/ + + + +//add includes + + +#include "uts_tapi_power_reboot_modem.h" + + + +void (*tet_startup) () = startup; +void (*tet_cleanup) () = cleanup; + + +extern int expected_event; +extern bool async_response; + +static void startup() +{ + TapiResult_t ret_status ; + + + ret_status = tel_init(); + + if(ret_status != TAPI_API_SUCCESS) + { + printf("TelTapiInit() Failed ret_status = %d \n",ret_status); + } + + register_all_events(); + tel_register_app_name("org.samsung.test"); + +} + +static void cleanup() +{ + TapiResult_t ret_status ; + + deregister_all(); + ret_status = tel_deinit(); + + + if(ret_status != TAPI_API_SUCCESS) + { + printf("TelTapiDeInit() Failed ret_status = %d \n",ret_status); + } +} + + + + +void utc_tapi_power_reboot_modem_01() +{ + + TEST_DEBUG("\n\n\n\n\n######## TEST utc_tapi_reboot_modem_01 START ###########\n"); + + TapiResult_t ret_status ; + + async_response = false;//initialize + + ret_status = tel_reset_modem(); + + printf("/n return value = %d\n",ret_status); + + if(TAPI_API_SUCCESS == ret_status) + { + printf("/n/****************** reboot modem api successful **************************\\n"); + } + else + { + printf("/n/****************** reboot modem api case failed **************************\\n"); + } + + TET_CHECK_EQUAL(TAPI_API_SUCCESS, ret_status); + tet_infoline("utc_tapi_power_reboot_modem pass"); + + G_MAIN_LOOP_RUN(10); + //TET_CHECK_TEMP(true, async_response); + tet_result(TET_PASS); + + TEST_DEBUG("\n\n\n\n\n######## TEST utc_tapi_power_reboot_modem 01 ENDS ###########\n"); + + +} + +void utc_tapi_power_reboot_modem_02() +{ + + TEST_DEBUG("\n\n\n\n\n######## TEST utc_tapi_reboot_modem_02 START ###########\n"); + + TapiResult_t ret_status ; + + async_response = false;//initialize + tel_init(); + //Calling rebooting of Modem after DeInitializing of Tapi + ret_status = tel_reset_modem(); + + printf("/n return value = %d\n",ret_status); + + if(TAPI_API_SUCCESS != ret_status) + { + printf("/n/****************** reboot modem invalid api successful **************************\\n"); + } + else + { + printf("/n/****************** reboot modem api case failed **************************\\n"); + } + + TET_CHECK_EQUAL(TAPI_API_SUCCESS, ret_status); + tet_infoline("utc_tapi_power_reboot_modem pass"); + + G_MAIN_LOOP_RUN(10); + //TET_CHECK_TEMP(true, async_response); + tet_result(TET_PASS); + + TEST_DEBUG("\n\n\n\n\n######## TEST utc_tapi_power_reboot_modem 01 ENDS ###########\n"); + + +} diff --git a/TC/telephony_TC/power/unit/uts_tapi_power_reboot_modem.h b/TC/telephony_TC/power/unit/uts_tapi_power_reboot_modem.h new file mode 100644 index 0000000..8d4af3b --- /dev/null +++ b/TC/telephony_TC/power/unit/uts_tapi_power_reboot_modem.h @@ -0,0 +1,44 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * 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 "power_common.h" + + +#ifndef _UTC_TAPI_POWER_REBOOT_MODEM_ +#define _UTC_TAPI_POWER_REBOOT_MODEM_ + + +void utc_tapi_power_reboot_modem_01(); +void utc_tapi_power_reboot_modem_02(); + + +static void startup(); + +static void cleanup(); + +struct tet_testlist tet_testlist[] = { + {utc_tapi_power_reboot_modem_01, 1}, + {utc_tapi_power_reboot_modem_02, 2}, + {NULL, 0} + }; + + + +#endif //_UTC_TAPI_POWER_FLIGHT_MODE_ diff --git a/TC/telephony_TC/power/unit/uts_tel_process_power_command.c b/TC/telephony_TC/power/unit/uts_tel_process_power_command.c new file mode 100644 index 0000000..a7ce88d --- /dev/null +++ b/TC/telephony_TC/power/unit/uts_tel_process_power_command.c @@ -0,0 +1,309 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** +* @ingroup Telephony_API TelephonyAPI +* @addtogroup POWER power +*/ + +/** +* @ingroup POWER power +* @addtogroup UTS_POWER Unit +*/ + +/** +* @ingroup UTS_POWER Unit +* @addtogroup UTS_tel_process_power_command tel_process_power_command +* @{ +*/ + + + +/** +* @file uts_tel_process_power_command.c +* @brief This is a suite of unit test cases to test Telephony power API function +* @author Sagar Aggarwal (a.sagar@samsung.com) +* @version Initial Creation +* @date [2009-05-13] +*/ + + + +//add includes + + +#include "uts_tel_process_power_command.h" + +#include "/usr/include/telephony/sec-ext/tapi/include/ITapiPower.h" + +void (*tet_startup) () = startup; +void (*tet_cleanup) () = cleanup; + + +extern int expected_event; +extern bool async_response; + +static void startup() +{ + TapiResult_t ret_status ; + + + ret_status = tel_init(); + + if(ret_status != TAPI_API_SUCCESS) + { + printf("TelTapiInit() Failed ret_status = %d \n",ret_status); + } + + register_all_events(); + tel_register_app_name("org.samsung.test"); + +} + +static void cleanup() +{ + TapiResult_t ret_status ; + + deregister_all(); + ret_status = tel_deinit(); + + + if(ret_status != TAPI_API_SUCCESS) + { + printf("TelTapiDeInit() Failed ret_status = %d \n",ret_status); + } +} + + + +/** + * @brief This tests + * @par ID: UTS_tel_process_power_command_00 + * @param [in] tapi_power_phone_cmd_t + * @code + * @endcode + * @return TapiResult_t +*/ + + +void utc_tel_process_power_command_00() +{ + + + + TEST_DEBUG("\n\n\n\n\n######## TEST utc_tel_process_power_command_00 START ###########\n"); + + TapiResult_t ret_status ; + + async_response = false;//initialize + + + ret_status = tel_process_power_command(TAPI_PHONE_POWER_OFF); + + printf("/n return value = %d\n",ret_status); + + if(TAPI_API_SUCCESS == ret_status) + { + printf("/n/****************** power on off mode Started successfully **************************\\n"); + } + else + { + printf("/n/****************** power on off mode not started **************************\\n"); + } + + TET_CHECK_EQUAL(TAPI_API_SUCCESS, ret_status); + tet_infoline("utc_tel_process_power_command_00 pass"); + expected_event = TAPI_EVENT_POWER_PHONE_OFF; + printf("The expected_event is TAPI_EVENT_POWER_PHONE_OFF(%d)\n",expected_event); + + printf("\n\n value of asyn_response %d",async_response); + G_MAIN_LOOP_RUN(10); + //TET_CHECK_TEMP(true, async_response); + tet_result(TET_PASS); + + TEST_DEBUG("\n\n\n\n\n######## TEST utc_tel_process_power_command_00 ENDS ###########\n"); + + + +} + + + +/** + * @brief This tests + * @par ID: UTS_tel_process_power_command_01 + * @param [in] tapi_power_phone_cmd_t + * @code + * @endcode + * @return TapiResult_t +*/ + + +void utc_tel_process_power_command_01() +{ + + + TEST_DEBUG("\n\n\n\n\n######## TEST utc_tel_process_power_command_01 START ###########\n"); + + TapiResult_t ret_status ; + + async_response = false;//initialize + + tel_process_power_command(TAPI_PHONE_POWER_OFF); + sleep(5); + ret_status = tel_process_power_command(TAPI_PHONE_POWER_ON); + + printf("/n return value = %d\n",ret_status); + + if(TAPI_API_SUCCESS == ret_status || TAPI_API_MODEM_ALREADY_ON == ret_status) + { + printf("/n/****************** power on off mode Started successfully **************************\\n"); + tet_result(TET_PASS); + } + else + { + printf("/n/****************** power on off mode not started **************************\\n"); + } + + TET_CHECK_EQUAL(TAPI_API_SUCCESS, ret_status); + tet_infoline("utc_tel_process_power_command_01 pass"); + expected_event = TAPI_EVENT_POWER_PHONE_OFF; + printf("The expected_event is TAPI_EVENT_POWER_PHONE_OFF(%d)\n",expected_event); + printf("\n\n value of asyn_response %d",async_response); + + G_MAIN_LOOP_RUN(10); + // TET_CHECK_TEMP(true, async_response); + tet_result(TET_PASS); + + TEST_DEBUG("\n\n\n\n\n######## TEST utc_tel_process_power_command_01 ENDS ###########\n"); + + + +} + + + + +/** + * @brief This tests + * @par ID: UTS_tel_process_power_command_02 + * @param [in] tapi_power_phone_cmd_t + * @code + * @endcode + * @return TapiResult_t +*/ + + +void utc_tel_process_power_command_02() +{ + + TEST_DEBUG("\n\n\n\n\n######## TEST utc_tel_process_power_command_02 START ###########\n"); + + TapiResult_t ret_status ; + + async_response = false;//initialize + + + ret_status = tel_process_power_command(TAPI_PHONE_POWER_OFF -1); + + printf("/n return value = %d\n",ret_status); + + if(TAPI_API_INVALID_INPUT == ret_status) + { + printf("/n/****************** power on off mode invalid input pass **************************\\n"); + } + else + { + printf("/n/****************** power on off mode invalid input case failed **************************\\n"); + } + + TET_CHECK_EQUAL(TAPI_API_INVALID_INPUT, ret_status); + tet_infoline("utc_tel_process_power_command_02 pass"); + //expected_event = TAPI_EVENT_POWER_PHONE_OFF; + //printf("The expected_event is TAPI_EVENT_POWER_PHONE_OFF(%d)\n",expected_event); + + //G_MAIN_LOOP_RUN(10); + //TET_CHECK_TEMP(true, async_response); + //tet_result(TET_PASS); + + TEST_DEBUG("\n\n\n\n\n######## TEST utc_tel_process_power_command_02 ENDS ###########\n"); + + + +} + + + + +/** + * @brief This tests + * @par ID: UTS_tel_process_power_command_03 + * @param [in] tapi_power_phone_cmd_t + * @code + * @endcode + * @return TapiResult_t +*/ + + +void utc_tel_process_power_command_03() +{ + + + TEST_DEBUG("\n\n\n\n\n######## TEST utc_tel_process_power_command_03 START ###########\n"); + + TapiResult_t ret_status ; + + async_response = false;//initialize + + + ret_status = tel_process_power_command(TAPI_PHONE_POWER_ON +1); + + printf("/n return value = %d\n",ret_status); + + if(TAPI_API_INVALID_INPUT == ret_status) + { + printf("/n/****************** power on off mode invalid input pass **************************\\n"); + } + else + { + printf("/n/****************** power on off mode invalid input case failed **************************\\n"); + } + + TET_CHECK_EQUAL(TAPI_API_INVALID_INPUT, ret_status); + tet_infoline("utc_tel_process_power_command_03 pass"); + //expected_event = TAPI_EVENT_POWER_PHONE_OFF; + //printf("The expected_event is TAPI_EVENT_POWER_PHONE_OFF(%d)\n",expected_event); + + //G_MAIN_LOOP_RUN(10); + //TET_CHECK_TEMP(true, async_response); + //tet_result(TET_PASS); + + TEST_DEBUG("\n\n\n\n\n######## TEST utc_tel_process_power_command_03 ENDS ###########\n"); + + + +} + + + + + + +/** @} */ diff --git a/TC/telephony_TC/power/unit/uts_tel_process_power_command.h b/TC/telephony_TC/power/unit/uts_tel_process_power_command.h new file mode 100644 index 0000000..c581f1d --- /dev/null +++ b/TC/telephony_TC/power/unit/uts_tel_process_power_command.h @@ -0,0 +1,67 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * 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. + */ + +/** +* @file uts_tel_process_power_command.h +* @brief This is a suite of unit test cases to test Telephony power API function +* @author Sagar Aggarwal (a.sagar@samsung.com) +* @version Initial Creation +* @date [2009-05-13] +*/ + + + +#include "power_common.h" + + +#ifndef _UTC_TAPI_POWER_ONOFF_ +#define _UTC_TAPI_POWER_ONOFF_ + + + +void utc_tel_process_power_command_00(); + + + +void utc_tel_process_power_command_01(); + + + +void utc_tel_process_power_command_02(); + + + +void utc_tel_process_power_command_03(); + +static void startup(); + +static void cleanup(); + +struct tet_testlist tet_testlist[] = { + {utc_tel_process_power_command_00, 1}, + {utc_tel_process_power_command_01, 2}, + {utc_tel_process_power_command_02, 3}, + {utc_tel_process_power_command_03, 4}, + {NULL, 0} + }; + + + +#endif //_UTC_TAPI_POWER_ONOFF_ diff --git a/TC/telephony_TC/power/unit/uts_tel_set_flight_mode.c b/TC/telephony_TC/power/unit/uts_tel_set_flight_mode.c new file mode 100644 index 0000000..f04aff0 --- /dev/null +++ b/TC/telephony_TC/power/unit/uts_tel_set_flight_mode.c @@ -0,0 +1,253 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @ingroup Telephony_API TelephonyAPI + * @addtogroup POWER power + */ + +/** + * @ingroup POWER power + * @addtogroup UTS_POWER Unit + */ + +/** + * @ingroup UTS_POWER Unit + * @addtogroup UTS_TAPI_POWER_FLIGHT_MODE tel_set_flight_mode + * @{ + */ + +/** + * @file uts_tel_set_flight_mode.c + * @brief This is a suite of unit test cases to test Telephony power API function + * @author Sagar Aggarwal (a.sagar@samsung.com) + * @version Initial Creation + * @date [2009-05-13] + */ + +#include "uts_tel_set_flight_mode.h" +#include "ITapiPower.h" + +void (*tet_startup)() = startup; +void (*tet_cleanup)() = cleanup; + +extern int expected_event; +extern bool async_response; + +static void startup() { + TapiResult_t ret_status; + + ret_status = tel_init(); + + if (ret_status != TAPI_API_SUCCESS) { + printf("TelTapiInit() Failed ret_status = %d \n", ret_status); + } + + register_all_events(); + tel_register_app_name("org.samsung.test"); + +} + +static void cleanup() { + TapiResult_t ret_status; + + deregister_all(); + ret_status = tel_deinit(); + + if (ret_status != TAPI_API_SUCCESS) { + printf("TelTapiDeInit() Failed ret_status = %d \n", ret_status); + } +} + +/** + * @brief This tests + * @par ID: UTC_TAPI_POWER_FLIGHT_MODE_00 + * @param [in] tel_set_flight_mode_type_t + * @code + * @endcode + * @return TapiResult_t + */ + +void utc_tel_set_flight_mode_00() { + + TEST_DEBUG("\n\n\n\n\n######## TEST utc_tel_set_flight_mode_00 START ###########\n"); + + TapiResult_t ret_status; + + async_response = false;//initialize + + ret_status = tel_set_flight_mode(TAPI_POWER_FLIGHT_MODE_ENTER); + + printf("/n return value = %d\n", ret_status); + + if (TAPI_API_SUCCESS == ret_status) { + printf( + "/n/****************** set flight mode api successful **************************\\n"); + } else { + printf( + "/n/****************** set flight mode api case failed **************************\\n"); + } + + TET_CHECK_EQUAL(TAPI_API_SUCCESS, ret_status) + ; + tet_infoline("utc_tel_set_flight_mode_00 pass"); + expected_event = TAPI_EVENT_POWER_FLIGHT_MODE_RESP; + printf("The expected_event is TAPI_EVENT_POWER_FLIGHT_MODE_RESP(%d)\n", + expected_event); + + printf("\n\n value of asyn_response %d", async_response); + G_MAIN_LOOP_RUN(10); + //TET_CHECK_TEMP(true, async_response); + tet_result(TET_PASS); + + TEST_DEBUG("\n\n\n\n\n######## TEST utc_tel_set_flight_mode_00 ENDS ###########\n"); + +} + +/** + * @brief This tests + * @par ID: UTC_TAPI_POWER_FLIGHT_MODE_01 + * @param [in] tel_set_flight_mode_type_t + * @code + * @endcode + * @return TapiResult_t + */ + +void utc_tel_set_flight_mode_01() { + + TEST_DEBUG("\n\n\n\n\n######## TEST utc_tel_set_flight_mode_01 START ###########\n"); + + TapiResult_t ret_status; + + async_response = false;//initialize + + ret_status = tel_set_flight_mode(TAPI_POWER_FLIGHT_MODE_LEAVE); + + printf("/n return value = %d\n", ret_status); + + if (TAPI_API_SUCCESS == ret_status) { + printf( + "/n/****************** set flight mode api successful **************************\\n"); + } else { + printf( + "/n/****************** set flight mode api case failed **************************\\n"); + } + + TET_CHECK_EQUAL(TAPI_API_SUCCESS, ret_status) + ; + tet_infoline("utc_tel_set_flight_mode_01 pass"); + expected_event = TAPI_EVENT_POWER_FLIGHT_MODE_RESP; + printf("The expected_event is TAPI_EVENT_POWER_FLIGHT_MODE_RESP(%d)\n", + expected_event); + + printf("\n\n value of asyn_response %d", async_response); + G_MAIN_LOOP_RUN(10); + // TET_CHECK_TEMP(true, async_response); + tet_result(TET_PASS); + + TEST_DEBUG("\n\n\n\n\n######## TEST utc_tel_set_flight_mode_01 ENDS ###########\n"); + +} + +/** + * @brief This tests + * @par ID: UTC_TAPI_POWER_FLIGHT_MODE_02 + * @param [in] tel_set_flight_mode_type_t + * @code + * @endcode + * @return TapiResult_t + */ + +void utc_tel_set_flight_mode_02() { + + TEST_DEBUG("\n\n\n\n\n######## TEST utc_tel_set_flight_mode_02 START ###########\n"); + + TapiResult_t ret_status; + + async_response = false;//initialize + + ret_status = tel_set_flight_mode(TAPI_POWER_FLIGHT_MODE_MAX); + + printf("/n return value = %d\n", ret_status); + + if (TAPI_API_INVALID_INPUT == ret_status) { + printf( + "/n/****************** set flight mode api invalid input case successful **************************\\n"); + } else { + printf( + "/n/****************** set flight mode api invalid input case failed **************************\\n"); + } + + TET_CHECK_EQUAL(TAPI_API_INVALID_INPUT, ret_status) + ; + tet_infoline("utc_tel_set_flight_mode_02 pass"); + //expected_event = TAPI_EVENT_POWER_FLIGHT_MODE_RESP; + //printf("The expected_event is TAPI_EVENT_POWER_FLIGHT_MODE_RESP(%d)\n",expected_event); + + //G_MAIN_LOOP_RUN(10); + //TET_CHECK_TEMP(true, async_response); + //tet_result(TET_PASS); + TEST_DEBUG("\n\n\n\n\n######## TEST utc_tel_set_flight_mode_02 ENDS ###########\n"); + +} + +/** + * @brief This tests + * @par ID: UTC_TAPI_POWER_FLIGHT_MODE_03 + * @param [in] tel_set_flight_mode_type_t + * @code + * @endcode + * @return TapiResult_t + */ + +void utc_tel_set_flight_mode_03() { + + TEST_DEBUG("\n\n\n\n\n######## TEST utc_tel_set_flight_mode_03 START ###########\n"); + + TapiResult_t ret_status; + + async_response = false;//initialize + + ret_status = tel_set_flight_mode(TAPI_POWER_FLIGHT_MODE_ENTER - 1); + + printf("/n return value = %d\n", ret_status); + + if (TAPI_API_INVALID_INPUT == ret_status) { + printf( + "/n/****************** set flight mode api invalid input case successful **************************\\n"); + } else { + printf( + "/n/****************** set flight mode api invalid input case failed **************************\\n"); + } + + TET_CHECK_EQUAL(TAPI_API_INVALID_INPUT, ret_status) + ; + tet_infoline("utc_tel_set_flight_mode_03 pass"); + //expected_event = TAPI_EVENT_POWER_FLIGHT_MODE_RESP; + //printf("The expected_event is TAPI_EVENT_POWER_FLIGHT_MODE_RESP(%d)\n",expected_event); + + //G_MAIN_LOOP_RUN(10); + //TET_CHECK_TEMP(true, async_response); + //tet_result(TET_PASS); + TEST_DEBUG("\n\n\n\n\n######## TEST utc_tel_set_flight_mode_03 ENDS ###########\n"); + +} + +/** @} */ diff --git a/TC/telephony_TC/power/unit/uts_tel_set_flight_mode.h b/TC/telephony_TC/power/unit/uts_tel_set_flight_mode.h new file mode 100644 index 0000000..27e9061 --- /dev/null +++ b/TC/telephony_TC/power/unit/uts_tel_set_flight_mode.h @@ -0,0 +1,62 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * 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. + */ + + +/** +* @file uts_tel_set_flight_mode.h +* @brief This is a suite of unit test cases to test Telephony Power API function +* @author Sagar Aggarwal (a.sagar@samsung.com) +* @version Initial Creation +* @date [2009-05-13] +*/ + + + +#include "power_common.h" + + +#ifndef _UTC_TEL_SET_FLIGHT_MODE_ +#define _UTC_TEL_SET_FLIGHT_MODE_ + + +void utc_tel_set_flight_mode_00(); + +void utc_tel_set_flight_mode_01(); + +void utc_tel_set_flight_mode_02(); + +void utc_tel_set_flight_mode_03(); + + +static void startup(); + +static void cleanup(); + +struct tet_testlist tet_testlist[] = { + {utc_tel_set_flight_mode_00, 1}, + {utc_tel_set_flight_mode_01, 2}, + {utc_tel_set_flight_mode_02, 3}, + {utc_tel_set_flight_mode_03, 4}, + {NULL, 0} + }; + + + +#endif //_UTC_tel_set_FLIGHT_MODE_ diff --git a/TC/telephony_TC/power/uts_tapi_power_phone_on_off.c b/TC/telephony_TC/power/uts_tapi_power_phone_on_off.c new file mode 100644 index 0000000..02ecd4b --- /dev/null +++ b/TC/telephony_TC/power/uts_tapi_power_phone_on_off.c @@ -0,0 +1,309 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +/** +* @ingroup Telephony_API TelephonyAPI +* @addtogroup POWER power +*/ + +/** +* @ingroup POWER power +* @addtogroup UTS_POWER Unit +*/ + +/** +* @ingroup UTS_POWER Unit +* @addtogroup UTS_TAPI_POWER_PHONE_ON_OFF tapi_power_phone_on_off +* @{ +*/ + + + +/** +* @file uts_tapi_power_phone_on_off.c +* @brief This is a suite of unit test cases to test Telephony power API function +* @author Sagar Aggarwal (a.sagar@samsung.com) +* @version Initial Creation +* @date [2009-05-13] +*/ + + + +//add includes + + +#include "uts_tapi_power_phone_on_off.h" + + + +void (*tet_startup) () = startup; +void (*tet_cleanup) () = cleanup; + + +extern TelTapiEventType_t expected_event; +extern bool async_response; + +static void startup() +{ + TapiResult_t ret_status ; + + + ret_status = TelTapiInit(); + + if(ret_status != TAPI_API_SUCCESS) + { + printf("TelTapiInit() Failed ret_status = %d \n",ret_status); + } + + register_all_events(); + +} + +static void cleanup() +{ + TapiResult_t ret_status ; + + deregister_all(); + ret_status = TelTapiDeInit(); + + + if(ret_status != TAPI_API_SUCCESS) + { + printf("TelTapiDeInit() Failed ret_status = %d \n",ret_status); + } +} + + + +/** + * @brief This tests + * @par ID: UTS_TAPI_POWER_PHONE_ON_OFF_00 + * @param [in] tapi_power_phone_cmd_t + * @code + * @endcode + * @return TapiResult_t +*/ + + +void utc_tapi_power_phone_on_off_00() +{ + + + + TEST_DEBUG("\n\n\n\n\n######## TEST utc_tapi_power_phone_on_off_00 START ###########\n"); + + TapiResult_t ret_status ; + + async_response = false;//initialize + + + ret_status = tapi_power_phone_on_off(TAPI_PHONE_POWER_OFF); + + printf("/n return value = %d\n",ret_status); + + if(TAPI_API_SUCCESS == ret_status) + { + printf("/n/****************** power on off mode Started successfully **************************\\n"); + } + else + { + printf("/n/****************** power on off mode not started **************************\\n"); + } + + TET_CHECK_EQUAL(TAPI_API_SUCCESS, ret_status); + tet_infoline("utc_tapi_power_phone_on_off_00 pass"); + expected_event = TAPI_EVENT_POWER_PHONE_OFF; + printf("The expected_event is TAPI_EVENT_POWER_PHONE_OFF(%d)\n",expected_event); + + printf("\n\n value of asyn_response %d",async_response); + G_MAIN_LOOP_RUN(10); + //TET_CHECK_TEMP(true, async_response); + tet_result(TET_PASS); + + TEST_DEBUG("\n\n\n\n\n######## TEST utc_tapi_power_phone_on_off_00 ENDS ###########\n"); + + + +} + + + +/** + * @brief This tests + * @par ID: UTS_TAPI_POWER_PHONE_ON_OFF_01 + * @param [in] tapi_power_phone_cmd_t + * @code + * @endcode + * @return TapiResult_t +*/ + + +void utc_tapi_power_phone_on_off_01() +{ + + + TEST_DEBUG("\n\n\n\n\n######## TEST utc_tapi_power_phone_on_off_01 START ###########\n"); + + TapiResult_t ret_status ; + + async_response = false;//initialize + + tapi_power_phone_on_off(TAPI_PHONE_POWER_OFF); + sleep(5); + ret_status = tapi_power_phone_on_off(TAPI_PHONE_POWER_ON); + + printf("/n return value = %d\n",ret_status); + + if(TAPI_API_SUCCESS == ret_status || TAPI_API_MODEM_ALREADY_ON == ret_status) + { + printf("/n/****************** power on off mode Started successfully **************************\\n"); + tet_result(TET_PASS); + } + else + { + printf("/n/****************** power on off mode not started **************************\\n"); + } + + TET_CHECK_EQUAL(TAPI_API_SUCCESS, ret_status); + tet_infoline("utc_tapi_power_phone_on_off_01 pass"); + expected_event = TAPI_EVENT_POWER_PHONE_OFF; + printf("The expected_event is TAPI_EVENT_POWER_PHONE_OFF(%d)\n",expected_event); + printf("\n\n value of asyn_response %d",async_response); + + G_MAIN_LOOP_RUN(10); + // TET_CHECK_TEMP(true, async_response); + tet_result(TET_PASS); + + TEST_DEBUG("\n\n\n\n\n######## TEST utc_tapi_power_phone_on_off_01 ENDS ###########\n"); + + + +} + + + + +/** + * @brief This tests + * @par ID: UTS_TAPI_POWER_PHONE_ON_OFF_02 + * @param [in] tapi_power_phone_cmd_t + * @code + * @endcode + * @return TapiResult_t +*/ + + +void utc_tapi_power_phone_on_off_02() +{ + + TEST_DEBUG("\n\n\n\n\n######## TEST utc_tapi_power_phone_on_off_02 START ###########\n"); + + TapiResult_t ret_status ; + + async_response = false;//initialize + + + ret_status = tapi_power_phone_on_off(TAPI_PHONE_POWER_OFF -1); + + printf("/n return value = %d\n",ret_status); + + if(TAPI_API_INVALID_INPUT == ret_status) + { + printf("/n/****************** power on off mode invalid input pass **************************\\n"); + } + else + { + printf("/n/****************** power on off mode invalid input case failed **************************\\n"); + } + + TET_CHECK_EQUAL(TAPI_API_INVALID_INPUT, ret_status); + tet_infoline("utc_tapi_power_phone_on_off_02 pass"); + //expected_event = TAPI_EVENT_POWER_PHONE_OFF; + //printf("The expected_event is TAPI_EVENT_POWER_PHONE_OFF(%d)\n",expected_event); + + //G_MAIN_LOOP_RUN(10); + //TET_CHECK_TEMP(true, async_response); + //tet_result(TET_PASS); + + TEST_DEBUG("\n\n\n\n\n######## TEST utc_tapi_power_phone_on_off_02 ENDS ###########\n"); + + + +} + + + + +/** + * @brief This tests + * @par ID: UTS_TAPI_POWER_PHONE_ON_OFF_03 + * @param [in] tapi_power_phone_cmd_t + * @code + * @endcode + * @return TapiResult_t +*/ + + +void utc_tapi_power_phone_on_off_03() +{ + + + TEST_DEBUG("\n\n\n\n\n######## TEST utc_tapi_power_phone_on_off_03 START ###########\n"); + + TapiResult_t ret_status ; + + async_response = false;//initialize + + + ret_status = tapi_power_phone_on_off(TAPI_PHONE_POWER_ON +1); + + printf("/n return value = %d\n",ret_status); + + if(TAPI_API_INVALID_INPUT == ret_status) + { + printf("/n/****************** power on off mode invalid input pass **************************\\n"); + } + else + { + printf("/n/****************** power on off mode invalid input case failed **************************\\n"); + } + + TET_CHECK_EQUAL(TAPI_API_INVALID_INPUT, ret_status); + tet_infoline("utc_tapi_power_phone_on_off_03 pass"); + //expected_event = TAPI_EVENT_POWER_PHONE_OFF; + //printf("The expected_event is TAPI_EVENT_POWER_PHONE_OFF(%d)\n",expected_event); + + //G_MAIN_LOOP_RUN(10); + //TET_CHECK_TEMP(true, async_response); + //tet_result(TET_PASS); + + TEST_DEBUG("\n\n\n\n\n######## TEST utc_tapi_power_phone_on_off_03 ENDS ###########\n"); + + + +} + + + + + + +/** @} */ diff --git a/TC/telephony_TC/power/uts_tapi_power_phone_on_off.h b/TC/telephony_TC/power/uts_tapi_power_phone_on_off.h new file mode 100644 index 0000000..a283ca6 --- /dev/null +++ b/TC/telephony_TC/power/uts_tapi_power_phone_on_off.h @@ -0,0 +1,68 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * 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. + */ + + +/** +* @file uts_tapi_power_phone_on_off.h +* @brief This is a suite of unit test cases to test Telephony power API function +* @author Sagar Aggarwal (a.sagar@samsung.com) +* @version Initial Creation +* @date [2009-05-13] +*/ + + + +#include "power_common.h" + + +#ifndef _UTC_TAPI_POWER_ONOFF_ +#define _UTC_TAPI_POWER_ONOFF_ + + + +void utc_tapi_power_phone_on_off_00(); + + + +void utc_tapi_power_phone_on_off_01(); + + + +void utc_tapi_power_phone_on_off_02(); + + + +void utc_tapi_power_phone_on_off_03(); + +static void startup(); + +static void cleanup(); + +struct tet_testlist tet_testlist[] = { + {utc_tapi_power_phone_on_off_00, 1}, + {utc_tapi_power_phone_on_off_01, 2}, + {utc_tapi_power_phone_on_off_02, 3}, + {utc_tapi_power_phone_on_off_03, 4}, + {NULL, 0} + }; + + + +#endif //_UTC_TAPI_POWER_ONOFF_ diff --git a/TC/telephony_TC/sat/unit/makefile b/TC/telephony_TC/sat/unit/makefile new file mode 100644 index 0000000..e184de5 --- /dev/null +++ b/TC/telephony_TC/sat/unit/makefile @@ -0,0 +1,67 @@ +CC=gcc -Wall + +LB1 = async_util +LB2 = tet_tapi_util +TS1 = uts_tel_download_sat_event +TS2 = uts_tel_get_sat_main_menu_info +TS3 = uts_tel_select_sat_menu +TS4 = uts_tel_send_sat_app_exec_result +TS5 = uts_tel_send_sat_ui_user_confirm +TS6 = uts_tel_send_ui_display_status + +LIBS = `pkg-config --libs gconf-2.0 glib-2.0 dbus-1 dbus-glib-1 gthread-2.0 tapi ` +LIBS +=$(TET_ROOT)/lib/tet3/tcm_s.o +LIBS +=-L$(TET_ROOT)/lib/tet3 -ltcm_s +LIBS +=-L$(TET_ROOT)/lib/tet3 -lapi_s + +INCS = -I. `pkg-config --cflags gconf-2.0 glib-2.0 dbus-1 dbus-glib-1 gthread-2.0 tapi` +INCS += -I$(TET_ROOT)/inc/tet3 + +CFLAGS += $(INCS) -D__arm__ -D_ARM_TOUCH -DTELEPHONY_TIMER +CC +=$(CFLAGS) +LDFLAGS = $(LIBS) + +#ifeq ($(ARCH),target) +#CC += -g -mabi=aapcs-linux +#endif + +all : $(TS1) $(TS2) $(TS3) $(TS4) $(TS5) $(TS6) + +clean : + rm -rf *~ *.o target i386 tet_lock tet_captured *.pyc *.log .scon* + rm -rf *~ *.o $(TS1) + rm -rf *~ *.o $(TS2) + rm -rf *~ *.o $(TS3) + rm -rf *~ *.o $(TS4) + rm -rf *~ *.o $(TS5) + rm -rf *~ *.o $(TS6) + + + +$(LB1): $(LB1).c + $(CC) -c $(LB1).c + +$(LB2): $(LB2).c + $(CC) -c $(LB2).c + +$(TS1): $(TS1).c + $(CC) -o $(TS1) $(TS1).c $(LDFLAGS) + +$(TS2): $(TS2).c + $(CC) -o $(TS2) $(TS2).c $(LDFLAGS) + +$(TS3): $(TS3).c + $(CC) -o $(TS3) $(TS3).c $(LDFLAGS) + +$(TS4): $(TS4).c + $(CC) -o $(TS4) $(TS4).c $(LDFLAGS) + +$(TS5): $(TS5).c + $(CC) -o $(TS5) $(TS5).c $(LDFLAGS) + +$(TS6): $(TS6).c + $(CC) -o $(TS6) $(TS6).c $(LDFLAGS) + + + + diff --git a/TC/telephony_TC/sat/unit/tet_macro.h b/TC/telephony_TC/sat/unit/tet_macro.h new file mode 100644 index 0000000..b386b3e --- /dev/null +++ b/TC/telephony_TC/sat/unit/tet_macro.h @@ -0,0 +1,36 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * 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 TET_MACRO_H +#define TET_MACRO_H + + +#define TET_CHECK(x) if(x) tet_result(TET_PASS); else tet_result(TET_FAIL) +#define TET_CHECK_EQUAL(x,y) if ((x)==(y)) tet_result(TET_PASS); else tet_result(TET_FAIL) +#define TET_CHECK_NOT_EQUAL(x,y) if ((x)!=(y)) tet_result(TET_PASS); else tet_result(TET_FAIL) + + +#define TET_CHECK_MESSAGE(x,y) if ((y)==(TRUE)) tet_result(TET_PASS); else {tet_result(TET_FAIL); tet_printf(x);} +#define TET_CHECK_EQUAL_MESSAGE(x,y,z) if ((y)==(z)) tet_result(TET_PASS); else {tet_result(TET_FAIL); tet_printf(x);} +#define TET_CHECK_NOT_EQUAL_MESSAGE(x,y,z) if ((y)!=(z)) tet_result(TET_PASS); else {tet_result(TET_FAIL); tet_printf(x);} + + +#endif + diff --git a/TC/telephony_TC/sat/unit/tslist b/TC/telephony_TC/sat/unit/tslist new file mode 100644 index 0000000..19abfcf --- /dev/null +++ b/TC/telephony_TC/sat/unit/tslist @@ -0,0 +1,7 @@ +/sat/unit/uts_tel_download_sat_event +/sat/unit/uts_tel_get_sat_main_menu_info +/sat/unit/uts_tel_select_sat_menu +/sat/unit/uts_tel_send_sat_app_exec_result +/sat/unit/uts_tel_send_sat_ui_user_confirm +/sat/unit/uts_tel_send_ui_display_status + diff --git a/TC/telephony_TC/sat/unit/uts_tel_download_sat_event.c b/TC/telephony_TC/sat/unit/uts_tel_download_sat_event.c new file mode 100644 index 0000000..b4ffc7c --- /dev/null +++ b/TC/telephony_TC/sat/unit/uts_tel_download_sat_event.c @@ -0,0 +1,115 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * 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 +#include "tet_macro.h" +#include "uts_tel_download_sat_event.h" + +static void startup(); +static void cleanup(); + +void (*tet_startup) () = startup; +void (*tet_cleanup) () = cleanup; + +struct tet_testlist tet_testlist[] = { + {utc_tel_download_sat_event_01, 1}, + {utc_tel_download_sat_event_02, 2}, + {NULL, 0} +}; + + +static void startup() +{ + tet_infoline("utc_tel_download_sat_event Test Start\n"); + if ( tel_init() != TAPI_API_SUCCESS) + { + tet_infoline("startup fail. tel_init() failed"); + } + return; +} + + +static void cleanup() +{ + tet_infoline("utc_tel_download_sat_event Test Finished\n"); + if ( tel_deinit() != TAPI_API_SUCCESS) + { + tet_infoline("startup fail. tel_deinit() failed"); + } + return; +} + + +/** + * @test This case tests BOOL sat_engine_get_main_menu_title(sat_engine_main_menu_title_t* main_menu_title); + * @brief This function is called by passing main_menu_title = NULL + * @return TAPI_API_INVALID_PTR + * @param[out] main_menu_title + */ +void utc_tel_download_sat_event_01() +{ + int reqId=-1; + int ret_status; + + /* Calling tel_download_sat_event API */ + ret_status = tel_download_sat_event(NULL,&reqId); + + tet_printf("ret_status[%d]\n",ret_status); + + TET_CHECK(ret_status == TAPI_API_INVALID_PTR); + if(ret_status == TAPI_API_INVALID_PTR) + tet_printf("utc_tel_download_sat_event_01 pass\n"); + return; +} + + +/** + * @test This case tests BOOL sat_engine_get_main_menu_title(sat_engine_main_menu_title_t* main_menu_title); + * @brief This function is called by passing NULL request ID + * @return TAPI_API_INVALID_PTR + * @param[out] main_menu_title + */ +void utc_tel_download_sat_event_02() +{ + TelSatEventDownloadReqInfo_t sat_event_info; + int reqId=-1; + + /* Test SAT Event Download Envelope Command - Invalid input (NULL pointer) Handling */ + + int ret_status; + + sat_event_info.eventDownloadType=5;//Idle Screen Available Event + sat_event_info.u.bIdleScreenAvailable==TRUE; + + /* Calling tel_download_sat_event API */ + ret_status = tel_download_sat_event(&sat_event_info,NULL); + + tet_printf("ret_status[%d]\n",ret_status); + + TET_CHECK(ret_status == TAPI_API_INVALID_PTR); + if(ret_status == TAPI_API_INVALID_PTR) + tet_printf("utc_tel_download_sat_event_02 pass\n"); + return; +} diff --git a/TC/telephony_TC/sat/unit/uts_tel_download_sat_event.h b/TC/telephony_TC/sat/unit/uts_tel_download_sat_event.h new file mode 100644 index 0000000..a85ae6d --- /dev/null +++ b/TC/telephony_TC/sat/unit/uts_tel_download_sat_event.h @@ -0,0 +1,28 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * 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 _UTS_TEL_DOWNLOAD_SAT_EVENT_H_ +#define _UTS_TEL_DOWNLOAD_SAT_EVENT_H_ + +void utc_tel_download_sat_event_01(); +void utc_tel_download_sat_event_02(); + +#endif +/** @} */ diff --git a/TC/telephony_TC/sat/unit/uts_tel_get_sat_main_menu_info.c b/TC/telephony_TC/sat/unit/uts_tel_get_sat_main_menu_info.c new file mode 100644 index 0000000..fa3c87d --- /dev/null +++ b/TC/telephony_TC/sat/unit/uts_tel_get_sat_main_menu_info.c @@ -0,0 +1,98 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * 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 +#include "tet_macro.h" + +#include "uts_tel_get_sat_main_menu_info.h" + +static void startup(); +static void cleanup(); + +void (*tet_startup) () = startup; +void (*tet_cleanup) () = cleanup; + +struct tet_testlist tet_testlist[] = { + {utc_tel_get_sat_main_menu_info_01, 1}, + {utc_tel_get_sat_main_menu_info_02, 2}, + {NULL, 0} +}; + + +static void startup() +{ + tet_infoline("utc_tel_get_sat_main_menu_info Test Start\n"); + if ( tel_init() != TAPI_API_SUCCESS) + { + tet_infoline("startup fail. tel_init() failed"); + } + return; +} + + +static void cleanup() +{ + tet_infoline("utc_tel_get_sat_main_menu_info Test Finished\n"); + if ( tel_deinit() != TAPI_API_SUCCESS) + { + tet_infoline("startup fail. tel_deinit() failed"); + } + return; +} + + +void utc_tel_get_sat_main_menu_info_01() +{ + + int ret_status=TAPI_API_SUCCESS; + tet_printf("Get SAT Main MenuInfo 01\n"); + + /* Calling TelTapiSatGetMainMenuInfo API */ + ret_status = tel_get_sat_main_menu_info (NULL); + tet_printf("The Return Status of TelTapiSatGetMainMenuInfo 01() is: %d\n", ret_status); + + TET_CHECK(ret_status == TAPI_API_INVALID_PTR); + if(ret_status == TAPI_API_INVALID_PTR) + tet_printf("utc_tel_get_sat_main_menu_info_01 pass\n"); + return; +} + +void utc_tel_get_sat_main_menu_info_02() +{ + + int ret_status=TAPI_API_SUCCESS; + tet_printf("Get SAT Main MenuInfo 02\n"); + + TelSatSetupMenuInfo_t main_menu ={0,}; + + /* Calling TelTapiSatGetMainMenuInfo API */ + ret_status = tel_get_sat_main_menu_info (&main_menu); + tet_printf("The Return Status of tel_get_sat_main_menu_info 02() is: %d\n", ret_status); + + TET_CHECK(ret_status == TAPI_API_SUCCESS); + if(ret_status == TAPI_API_SUCCESS) + tet_printf("utc_tel_get_sat_main_menu_info_02 pass\n"); + return; +} diff --git a/TC/telephony_TC/sat/unit/uts_tel_get_sat_main_menu_info.h b/TC/telephony_TC/sat/unit/uts_tel_get_sat_main_menu_info.h new file mode 100644 index 0000000..7b6dd3e --- /dev/null +++ b/TC/telephony_TC/sat/unit/uts_tel_get_sat_main_menu_info.h @@ -0,0 +1,30 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * 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 _UTS_TEL_GET_SAT_MAIN_MENU_INFO_H_ +#define _UTS_TEL_GET_SAT_MAIN_MENU_INFO_H_ + +void utc_tel_get_sat_main_menu_info_01(); +void utc_tel_get_sat_main_menu_info_02(); + +#endif +/** @} */ + + diff --git a/TC/telephony_TC/sat/unit/uts_tel_select_sat_menu.c b/TC/telephony_TC/sat/unit/uts_tel_select_sat_menu.c new file mode 100644 index 0000000..6a75191 --- /dev/null +++ b/TC/telephony_TC/sat/unit/uts_tel_select_sat_menu.c @@ -0,0 +1,106 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * 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 +#include "tet_macro.h" + +#include "uts_tel_select_sat_menu.h" + +static void startup(); +static void cleanup(); + +void (*tet_startup) () = startup; +void (*tet_cleanup) () = cleanup; + +struct tet_testlist tet_testlist[] = { + {utc_tel_select_sat_menu_01, 1}, + {utc_tel_select_sat_menu_02, 2}, + {NULL, 0} +}; + + +static void startup() +{ + tet_infoline("tel_select_sat_menu Test Start\n"); + if ( tel_init() != TAPI_API_SUCCESS) + { + tet_infoline("startup fail. tel_init() failed"); + } + return; +} + + +static void cleanup() +{ + tet_infoline("tel_select_sat_menu Test Finished\n"); + if ( tel_deinit() != TAPI_API_SUCCESS) + { + tet_infoline("startup fail. tel_deinit() failed"); + } + return; +} + + +/** + * @test This case tests BOOLuts_tapi_sat_menu_selection_envelope(sat_engine_main_menu_title_t* main_menu_title); + * @brief This function sends the UI display status to sat engine for specific command. + * @return TRUE. + * @param[out] main_menu_title + */ +void utc_tel_select_sat_menu_01() +{ + /* Test SAT Menu Selection Envelope Command - Successful case */ + + int ret_status = TAPI_API_SUCCESS; + int reqId = -1; + + /* Calling tel_select_sat_menu API */ + ret_status = tel_select_sat_menu(NULL,&reqId); + + TET_CHECK(ret_status == TAPI_API_INVALID_PTR); +} + + +/** + * @test This case tests BOOLuts_tapi_sat_menu_selection_envelope(sat_engine_main_menu_title_t* main_menu_title); + * @brief This function is called by passing main_menu_title = NULL + * @return FALSE + * @param[out] main_menu_title + */ +void utc_tel_select_sat_menu_02() +{ + TelSatMenuSelectionReqInfo_t menu_selection_info; + + menu_selection_info.itemIdentifier =1; + int ret_status = TAPI_API_SUCCESS; + + /* Calling tel_select_sat_menu API */ + ret_status = tel_select_sat_menu(&menu_selection_info,NULL); + TET_CHECK(ret_status == TAPI_API_INVALID_PTR); +} + + + + diff --git a/TC/telephony_TC/sat/unit/uts_tel_select_sat_menu.h b/TC/telephony_TC/sat/unit/uts_tel_select_sat_menu.h new file mode 100644 index 0000000..895851d --- /dev/null +++ b/TC/telephony_TC/sat/unit/uts_tel_select_sat_menu.h @@ -0,0 +1,28 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * 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 _UTS_TEL_SELECT_SAT_MENU_H_ +#define _UTS_TEL_SELECT_SAT_MENU_H_ + +static void utc_tel_select_sat_menu_01(); +static void utc_tel_select_sat_menu_02(); + +#endif +/** @} */ diff --git a/TC/telephony_TC/sat/unit/uts_tel_send_sat_app_exec_result.c b/TC/telephony_TC/sat/unit/uts_tel_send_sat_app_exec_result.c new file mode 100644 index 0000000..93dc608 --- /dev/null +++ b/TC/telephony_TC/sat/unit/uts_tel_send_sat_app_exec_result.c @@ -0,0 +1,97 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * 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 +#include "tet_macro.h" + +#include "uts_tel_send_sat_app_exec_result.h" + +static void startup(); +static void cleanup(); + +void (*tet_startup) () = startup; +void (*tet_cleanup) () = cleanup; + +struct tet_testlist tet_testlist[] = { + {utc_tel_send_sat_app_exec_result_01, 1}, + {utc_tel_send_sat_app_exec_result_02, 2}, + {NULL, 0} +}; + +static void startup() +{ + tet_infoline("utc_tel_send_sat_app_exec_result Test Start\n"); + if ( tel_init() != TAPI_API_SUCCESS) + { + tet_infoline("startup fail. tel_init() failed"); + } + return; +} + + +static void cleanup() +{ + tet_infoline("utc_tel_send_sat_app_exec_result Test Finished\n"); + if ( tel_deinit() != TAPI_API_SUCCESS) + { + tet_infoline("startup fail. tel_deinit() failed"); + } + return; +} + + +/** + * @test This case tests BOOL sat_engine_get_main_menu_title(sat_engine_main_menu_title_t* main_menu_title); + * @brief This function sends the UI display status to sat engine for specific command. + * @return TRUE. + * @param[out] main_menu_title + */ +void utc_tel_send_sat_app_exec_result_01() +{ + int ret_status=TAPI_API_SUCCESS; + + ret_status = tel_send_sat_app_exec_result (NULL); + + tet_printf("tel_send_sat_app_exec_result return=%d\n", ret_status); + + TET_CHECK(ret_status == TAPI_API_INVALID_PTR); + return; +} + +void utc_tel_send_sat_app_exec_result_02() +{ + int ret_status=TAPI_API_SUCCESS; + TelSatAppsRetInfo_t appRetInfo ={0,}; + + appRetInfo.commandType = TAPI_SAT_CMD_TYPE_SEND_DATA; + appRetInfo.commandId = 0; + + ret_status = tel_send_sat_app_exec_result(&appRetInfo); + + tet_printf("tel_send_sat_app_exec_result return=%d\n", ret_status); + + TET_CHECK(ret_status == TAPI_API_SERVER_FAILURE); + return; +} diff --git a/TC/telephony_TC/sat/unit/uts_tel_send_sat_app_exec_result.h b/TC/telephony_TC/sat/unit/uts_tel_send_sat_app_exec_result.h new file mode 100644 index 0000000..296f845 --- /dev/null +++ b/TC/telephony_TC/sat/unit/uts_tel_send_sat_app_exec_result.h @@ -0,0 +1,28 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * 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 _UTS_TEL_SEND_SAT_APP_EXEC_RESULT_H_ +#define _UTS_TEL_SEND_SAT_APP_EXEC_RESULT_H_ + +static void utc_tel_send_sat_app_exec_result_01(); +static void utc_tel_send_sat_app_exec_result_02(); + +#endif +/** @} */ diff --git a/TC/telephony_TC/sat/unit/uts_tel_send_sat_ui_user_confirm.c b/TC/telephony_TC/sat/unit/uts_tel_send_sat_ui_user_confirm.c new file mode 100644 index 0000000..470805a --- /dev/null +++ b/TC/telephony_TC/sat/unit/uts_tel_send_sat_ui_user_confirm.c @@ -0,0 +1,86 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * 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 +#include "tet_macro.h" + +#include "uts_tel_send_sat_ui_user_confirm.h" + +static void startup(); +static void cleanup(); + +void (*tet_startup) () = startup; +void (*tet_cleanup) () = cleanup; + +struct tet_testlist tet_testlist[] = { + {utc_tel_send_sat_ui_user_confirm_01, 1}, + {utc_tel_send_sat_ui_user_confirm_02, 2}, + {NULL, 0} +}; + +static void startup() +{ + tet_infoline("utc_tel_send_sat_ui_user_confirm Test Start\n"); + if ( tel_init() != TAPI_API_SUCCESS) + { + tet_infoline("startup fail. tel_init() failed"); + } + return; +} + + +static void cleanup() +{ + tet_infoline("utc_tel_send_sat_ui_user_confirm Test Finished\n"); + if ( tel_deinit() != TAPI_API_SUCCESS) + { + tet_infoline("startup fail. tel_deinit() failed"); + } + return; +} + +void utc_tel_send_sat_ui_user_confirm_01() +{ + TapiResult_t ret_status = TAPI_API_SUCCESS; + + ret_status = tel_send_sat_ui_user_confirm (NULL); + + tet_printf("utc_tel_send_sat_ui_user_confirm_01 return=%d\n", ret_status); + TET_CHECK(ret_status == TAPI_API_INVALID_PTR); + return; +} + +void utc_tel_send_sat_ui_user_confirm_02() +{ + TapiResult_t ret_status = TAPI_API_SUCCESS; + TelSatUiUserConfirmInfo_t userConfirmData = {0,}; + + userConfirmData.dataLen = -1; + + ret_status = tel_send_sat_ui_user_confirm(&userConfirmData); + + tet_printf("utc_tel_send_sat_ui_user_confirm_02 return=%d\n", ret_status); + TET_CHECK(ret_status == TAPI_API_INVALID_INPUT); + return; +} diff --git a/TC/telephony_TC/sat/unit/uts_tel_send_sat_ui_user_confirm.h b/TC/telephony_TC/sat/unit/uts_tel_send_sat_ui_user_confirm.h new file mode 100644 index 0000000..4541ae7 --- /dev/null +++ b/TC/telephony_TC/sat/unit/uts_tel_send_sat_ui_user_confirm.h @@ -0,0 +1,28 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * 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 _UTS_TEL_SEND_SAT_UI_USER_CONFIRM_H_ +#define _UTS_TEL_SEND_SAT_UI_USER_CONFIRM_H_ + +void utc_tel_send_sat_ui_user_confirm_01(); +void utc_tel_send_sat_ui_user_confirm_02(); + +#endif +/** @} */ diff --git a/TC/telephony_TC/sat/unit/uts_tel_send_ui_display_status.c b/TC/telephony_TC/sat/unit/uts_tel_send_ui_display_status.c new file mode 100644 index 0000000..edc5d27 --- /dev/null +++ b/TC/telephony_TC/sat/unit/uts_tel_send_ui_display_status.c @@ -0,0 +1,125 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * 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 +#include "tet_macro.h" + +#include "uts_tel_send_ui_display_status.h" + +static void startup(); +static void cleanup(); + +/* Initialize TCM data structures */ +void (*tet_startup) () = startup; +void (*tet_cleanup) () = cleanup; + + +struct tet_testlist tet_testlist[] = { + {utc_tel_send_ui_display_status_01, 1}, + {utc_tel_send_ui_display_status_02, 2}, + {utc_tel_send_ui_display_status_03, 3}, + {NULL, 0} +}; + + +static void startup() +{ + tet_infoline("utc_tel_send_ui_display_status Test Start\n"); + if ( tel_init() != TAPI_API_SUCCESS) + { + tet_infoline("startup fail. tel_init() failed"); + } + return; +} + + +static void cleanup() +{ + tet_infoline("utc_tel_send_ui_display_status Test Finished\n"); + if ( tel_deinit() != TAPI_API_SUCCESS) + { + tet_infoline("startup fail. tel_deinit() failed"); + } + return; +} + + +/** + * @test This case tests TapiResult_t TelTapiSatSendUiDisplayStatus(int command_id, sat_engine_ui_display_status status); + * @brief This function is called by passing invalid command_id = -1 + * @return False + * @param[in] command_id = -1 + * @param[in] status = TAPI_SAT_DISPLAY_SUCCESS + */ +void utc_tel_send_ui_display_status_01() +{ + int ret_val= TAPI_API_SUCCESS; + + ret_val = tel_send_ui_display_status(-1,TAPI_SAT_DISPLAY_SUCCESS); + + TET_CHECK(ret_val == TAPI_API_SAT_INVALID_COMMAND_ID); +} + + /** + * @test This case tests TapiResult_t TelTapiSatSendUiDisplayStatus(int command_id, sat_engine_ui_display_status status); + * @brief This function is called by passing sinvalid status = -1 + * @return False + * @param[in] command_id = 1 + * @param[in] status = -1 + */ +void utc_tel_send_ui_display_status_02() +{ + int ret_val = TAPI_API_SUCCESS; + + ret_val = tel_send_ui_display_status(1,TAPI_SAT_DISPLAY_SUCCESS-1); + + TET_CHECK(ret_val == TAPI_API_INVALID_INPUT); +} + + /** + * @test This case tests TapiResult_t TelTapiSatSendUiDisplayStatus(int command_id, sat_engine_ui_display_status status); + * @brief This function is called by invalid status = 2 + * @return False + * @param[in] command_id = 1 + * @param[in] status = 3 + */ +void utc_tel_send_ui_display_status_03() +{ + int ret_val = TAPI_API_SUCCESS; + + ret_val = tel_send_ui_display_status(1,TAPI_SAT_DISPLAY_FAIL+1); + + TET_CHECK(ret_val == TAPI_API_INVALID_INPUT); +} + + + + + + + + + + diff --git a/TC/telephony_TC/sat/unit/uts_tel_send_ui_display_status.h b/TC/telephony_TC/sat/unit/uts_tel_send_ui_display_status.h new file mode 100644 index 0000000..1ba2228 --- /dev/null +++ b/TC/telephony_TC/sat/unit/uts_tel_send_ui_display_status.h @@ -0,0 +1,29 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * 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 _UTS_TEL_SEND_UI_DISPLAY_STATUS_H_ +#define _UTS_TEL_SEND_UI_DISPLAY_STATUS_H_ + +void utc_tel_send_ui_display_status_01(); +void utc_tel_send_ui_display_status_02(); +void utc_tel_send_ui_display_status_03(); + +#endif +/** @} */ diff --git a/TC/telephony_TC/sim/README b/TC/telephony_TC/sim/README new file mode 100644 index 0000000..c82abd8 --- /dev/null +++ b/TC/telephony_TC/sim/README @@ -0,0 +1,60 @@ +================================================================================= +* README * +================================================================================= + +1. The sim Test Script directory (TestCases) includes: + + sim/ + |-- README ; This file + `-- unit ; contains Unit TCs + |-- makefile + |-- tslist + `-- Unit test case source codes + +2. The $(TEST_ROOT) directory must includes following files: + + /$(TEST_ROOT) + |-- tet_scen + |-- tetbuild.cfg + |-- tetclean.cfg + |-- tetexec.cfg + `-- ...(elipsis) + +================================================================================= +* Preconditions * +--------------------------------------------------------------------------------- +| Before Testing telephony-framework/sim Module, | +| you should check the following conditions | +================================================================================= + +1. Ready for test 3G sim + +2. Check PIN1 code, PIN2 code, PUK1 code, PUK2 code of test sim + +3. Update uts header files + 1) Open sim_common.h + 2) Modify below macro to your test SIM information + PIN1_NORMAL , PIN1_NORMAL : PIN1 code of test sim + PIN2_NORMAL , PIN2_NORMAL : PIN2 code of test sim + PUK1_CODE : PUK1 code of test sim + PUK2_CODE : PUK2 code of test sim + +5. Before running tests, SIM card is inserted to tested phone + +================================================================================= +* Change log * +================================================================================= +1. 18-Dec-2008 + - Initial draft. +2. 18-Dec-2008 + - Precondition Update +3. 6-Oct-2010 + - Precondition Update + +================================================================================= +* NOTE * +================================================================================= +1. In order to ensure successful working of the Test Scripts, please ensure that all of the IPKG files are installed normally. +2. Testing SIM Module can be executed under target system environment (not simulator). + + diff --git a/TC/telephony_TC/sim/sim_common.h b/TC/telephony_TC/sim/sim_common.h new file mode 100644 index 0000000..9129bd6 --- /dev/null +++ b/TC/telephony_TC/sim/sim_common.h @@ -0,0 +1,44 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * 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 _SIM_COMMON_H +#define _SIM_COMMON_H + +#include +#include + +#define SIM_INFO "sim_pw.txt" + +#define PIN1_INVALID "999" +#define PIN2_INVALID "999" + +typedef struct { + char pin1[5]; + char pin2[5]; + char puk1[9]; + char puk2[9]; + char wpin1[5]; + char wpin2[5]; + char wpuk1[9]; + char wpuk2[9]; +}sim_info_t; + +#endif diff --git a/TC/telephony_TC/sim/unit/async_util.c b/TC/telephony_TC/sim/unit/async_util.c new file mode 100644 index 0000000..c447858 --- /dev/null +++ b/TC/telephony_TC/sim/unit/async_util.c @@ -0,0 +1,105 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * 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 + +sim_info_t g_si; + +int sim_pin_info_setup() +{ + FILE * p_file; + int f_size; + char* p_buf; + char* p_str = NULL; + size_t result; + + p_file = fopen("sim_pw.txt","r"); + if(p_file == NULL) + printf("file not found\n"); + + fseek(p_file, 0, SEEK_END); + f_size = ftell(p_file); + rewind(p_file); + + //printf("file size[%d]\n",f_size); + + p_buf = (char*)malloc(sizeof(char)*f_size); + if(p_buf == NULL) + printf("file is empty or malloc failed\n"); + + result = fread(p_buf,1,f_size,p_file); + if(result != f_size) + printf("file read error\n"); + + memset(&p_buf[f_size-1],'\0',1); + + // printf("file info=%s\n",p_buf); + + p_str = strstr(p_buf, "pin1:"); + if(p_str)sscanf(p_str+5, "%4s", &g_si.pin1[0]); + + p_str = strstr(p_buf, "pin2:"); + if(p_str)sscanf(p_str+5, "%4s", &g_si.pin2[0]); + + p_str = strstr(p_buf, "puk1:"); + if(p_str)sscanf(p_str+5, "%8s", &g_si.puk1[0]); + + p_str = strstr(p_buf, "puk2:"); + if(p_str)sscanf(p_str+5, "%8s", &g_si.puk2[0]); + + p_str = strstr(p_buf, "wpin1:"); + if(p_str)sscanf(p_str+6, "%4s", &g_si.wpin1[0]); + + p_str = strstr(p_buf, "wpin2:"); + if(p_str)sscanf(p_str+6, "%4s", &g_si.wpin2[0]); + + p_str = strstr(p_buf, "wpuk1:"); + if(p_str)sscanf(p_str+6, "%8s", &g_si.wpuk1[0]); + + p_str = strstr(p_buf, "wpuk2:"); + if(p_str)sscanf(p_str+6, "%8s", &g_si.wpuk2[0]); + + g_si.pin1[4]='\0'; + g_si.pin2[4]='\0'; + g_si.puk1[8]='\0'; + g_si.puk2[8]='\0'; + g_si.wpin1[4]='\0'; + g_si.wpin2[4]='\0'; + g_si.wpuk1[8]='\0'; + g_si.wpuk2[8]='\0'; + + printf("pin1[%s]\n",g_si.pin1); + printf("pin2[%s]\n",g_si.pin2); + printf("puk1[%s]\n",g_si.puk1); + printf("puk2[%s]\n",g_si.puk2); + printf("wpin1[%s]\n",g_si.wpin1); + printf("wpin2[%s]\n",g_si.wpin2); + printf("wpuk1[%s]\n",g_si.wpuk1); + printf("wpuk2[%s]\n",g_si.wpuk2); + + fclose(p_file); + free(p_buf); + return 0; +} + diff --git a/TC/telephony_TC/sim/unit/async_util.h b/TC/telephony_TC/sim/unit/async_util.h new file mode 100644 index 0000000..f081336 --- /dev/null +++ b/TC/telephony_TC/sim/unit/async_util.h @@ -0,0 +1,27 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * 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 _ASYNC_UTIL_H_ +#define _ASYNC_UTIL_H_ + +int sim_pin_info_setup(); + +#endif diff --git a/TC/telephony_TC/sim/unit/log b/TC/telephony_TC/sim/unit/log new file mode 100644 index 0000000..652b3ef --- /dev/null +++ b/TC/telephony_TC/sim/unit/log @@ -0,0 +1,83 @@ +uts_tapi_get_file_info.c: if (TAPI_API_SUCCESS == tel_register_event(TAPI_EVENT_SIM_FILE_INFO_CNF,&subscription_id,(TelAppCallback)sim_app_callback) ) +uts_tapi_get_file_info.c: tet_infoline("startup fail. tel_register_event() failed"); +uts_tapi_get_lock_info.c: if (TAPI_API_SUCCESS == tel_register_event(TAPI_EVENT_SIM_LOCKTYPE_INFO_CNF,&subscription_id,(TelAppCallback)sim_app_callback) ) +uts_tapi_get_lock_info.c: tet_infoline("startup fail. tel_register_event() failed"); +uts_tapi_read_sim_file.c: if (TAPI_API_SUCCESS == tel_register_event(TAPI_EVENT_SIM_READ_FILE_CNF,&subscription_id,(TelAppCallback)sim_app_callback) ) +uts_tapi_read_sim_file.c: tet_infoline("startup fail. tel_register_event() failed"); +uts_tapi_sim_disable_lock.c: if (TAPI_API_SUCCESS == tel_register_event(TAPI_EVENT_SIM_DISABLE_SIMLOCK_CNF,&subscription_id,(TelAppCallback)sim_app_callback) ) +uts_tapi_sim_disable_lock.c: tet_infoline("startup fail. tel_register_event() failed"); +uts_tapi_sim_enable_lock.c: if (TAPI_API_SUCCESS == tel_register_event(TAPI_EVENT_SIM_ENABLE_SIMLOCK_CNF,&subscription_id,(TelAppCallback)sim_app_callback) ) +uts_tapi_sim_enable_lock.c: tet_infoline("startup fail. tel_register_event() failed"); +uts_tapi_sim_getlock_personalization_status.c: if (TAPI_API_SUCCESS == tel_register_event(TAPI_EVENT_SIM_STATUS_PERSONALIZATION_CNF,&subscription_id,(TelAppCallback)sim_app_callback) ) +uts_tapi_sim_getlock_personalization_status.c: tet_infoline("startup fail. tel_register_event() failed"); +uts_tapi_update_sim_file.c: if (TAPI_API_SUCCESS == tel_register_event(TAPI_EVENT_SIM_UPDATE_FILE_CNF,&subscription_id,(TelAppCallback)sim_app_callback) ) +uts_tapi_update_sim_file.c: tet_infoline("startup fail. tel_register_event() failed"); +uts_tel_change_sim_pins.c: //tel_register_event(TAPI_EVENT_SIM_DISABLE_SEC_CNF,&subscription_id,(TelAppCallback)sim_app_callback); +uts_tel_change_sim_pins.c: //tel_register_event(TAPI_EVENT_SIM_CHANGE_PINS_CNF,&subscription_id,(TelAppCallback)sim_app_callback); +uts_tel_change_sim_pins.c: //tel_register_event(TAPI_EVENT_SIM_VERIFY_SEC_CNF,&subscription_id,(TelAppCallback)sim_app_callback); +uts_tel_change_sim_pins.c: //tel_register_event(TAPI_EVENT_SIM_ENABLE_SEC_CNF,&subscription_id,(TelAppCallback)sim_app_callback); +uts_tel_change_sim_pins.c: tel_register_event(TAPI_EVENT_SIM_DISABLE_SEC_CNF,&subscription_id,(TelAppCallback)sim_app_callback); +uts_tel_change_sim_pins.c: tel_register_event(TAPI_EVENT_SIM_CHANGE_PINS_CNF,&subscription_id,(TelAppCallback)sim_app_callback); +uts_tel_change_sim_pins.c: tel_register_event(TAPI_EVENT_SIM_VERIFY_SEC_CNF,&subscription_id,(TelAppCallback)sim_app_callback); +uts_tel_change_sim_pins.c: tel_register_event(TAPI_EVENT_SIM_ENABLE_SEC_CNF,&subscription_id,(TelAppCallback)sim_app_callback); +uts_tel_delete_sim_pb_record.c: if (TAPI_API_SUCCESS == tel_register_event(TAPI_EVENT_SIM_PB_DELETE_CNF,&subscription_id,(TelAppCallback)sim_app_callback) ) +uts_tel_delete_sim_pb_record.c: tet_infoline("startup fail. tel_register_event() failed"); +uts_tel_disable_sim_fdn.c: if (TAPI_API_SUCCESS == tel_register_event(TAPI_EVENT_SIM_DISABLE_SEC_CNF,&subscription_id,(TelAppCallback)sim_app_callback) ) +uts_tel_disable_sim_fdn.c: tet_infoline("startup fail. tel_register_event() failed"); +uts_tel_disable_sim_security.c: if (TAPI_API_SUCCESS == tel_register_event(TAPI_EVENT_SIM_DISABLE_SEC_CNF,&subscription_id,(TelAppCallback)sim_app_callback) ) +uts_tel_disable_sim_security.c: tet_infoline("startup fail. tel_register_event() failed"); +uts_tel_enable_sim_fdn.c: if (TAPI_API_SUCCESS == tel_register_event(TAPI_EVENT_SIM_ENABLE_SEC_CNF,&subscription_id,(TelAppCallback)sim_app_callback) ) +uts_tel_enable_sim_fdn.c: tet_infoline("startup fail. tel_register_event() failed"); +uts_tel_enable_sim_security.c: //if (TAPI_API_SUCCESS == tel_register_event(TAPI_EVENT_SIM_ENABLE_PIN_CNF,&subscription_id,(TelAppCallback)sim_app_callback) ) +uts_tel_enable_sim_security.c: if (TAPI_API_SUCCESS == tel_register_event(TAPI_EVENT_SIM_ENABLE_SEC_CNF,&subscription_id,(TelAppCallback)sim_app_callback) ) +uts_tel_enable_sim_security.c: tet_infoline("startup fail. tel_register_event() failed"); +uts_tel_get_sim_indicator_info.c: if (TAPI_API_SUCCESS == tel_register_event(TAPI_EVENT_SIM_SET_INDICATION_CNF,&subscription_id,(TelAppCallback)sim_app_callback) ) +uts_tel_get_sim_indicator_info.c: tet_infoline("startup fail. tel_register_event() failed"); +uts_tel_get_sim_init_info.c: if (TAPI_API_SUCCESS == tel_register_event(TAPI_EVENT_SIM_SET_MAILBOX_CNF,&subscription_id,(TelAppCallback)sim_app_callback) ) +uts_tel_get_sim_init_info.c: tet_infoline("startup fail. tel_register_event() failed"); +uts_tel_get_sim_language.c: //if (TAPI_API_SUCCESS == tel_register_event(TAPI_EVENT_SIM_LOCKTYPE_INFO_CNF,&subscription_id,(TelAppCallback)sim_app_callback) ) +uts_tel_get_sim_language.c: tet_infoline("startup fail. tel_register_event() failed"); +uts_tel_get_sim_mailbox_info.c: if (TAPI_API_SUCCESS == tel_register_event(TAPI_EVENT_SIM_SET_MAILBOX_CNF,&subscription_id,(TelAppCallback)sim_app_callback) ) +uts_tel_get_sim_mailbox_info.c: tet_infoline("startup fail. tel_register_event() failed"); +uts_tel_get_sim_pb_3g_meta_info.c: if (TAPI_API_SUCCESS == tel_register_event(TAPI_EVENT_SIM_PB_CAPABILITY_INFO_CNF,&subscription_id,(TelAppCallback)sim_app_callback) ) +uts_tel_get_sim_pb_3g_meta_info.c: tet_infoline("startup fail. tel_register_event() failed"); +uts_tel_get_sim_pb_count.c: if (TAPI_API_SUCCESS == tel_register_event(TAPI_EVENT_SIM_PB_STORAGE_COUNT_CNF,&subscription_id,(TelAppCallback)sim_app_callback) ) +uts_tel_get_sim_pb_count.c: tet_infoline("startup fail. tel_register_event() failed"); +uts_tel_get_sim_pb_init_info.c: if (TAPI_API_SUCCESS == tel_register_event(TAPI_EVENT_SIM_SET_MAILBOX_CNF,&subscription_id,(TelAppCallback)sim_app_callback) ) +uts_tel_get_sim_pb_init_info.c: tet_infoline("startup fail. tel_register_event() failed"); +uts_tel_get_sim_pb_meta_info.c: if (TAPI_API_SUCCESS == tel_register_event(TAPI_EVENT_SIM_PB_ENTRY_INFO_CNF,&subscription_id,(TelAppCallback)sim_app_callback) ) +uts_tel_get_sim_pb_meta_info.c: tet_infoline("startup fail. tel_register_event() failed"); +uts_tel_lock_sim_personalization.c: if (TAPI_API_SUCCESS == tel_register_event(TAPI_EVENT_SIM_ENABLE_PERS_CNF, &subscription_id,(TelAppCallback)sim_app_callback) ) +uts_tel_lock_sim_personalization.c: tet_infoline("startup fail. tel_register_event() failed"); +uts_tel_read_sim_pb_record.c: if (TAPI_API_SUCCESS == tel_register_event(TAPI_EVENT_SIM_PB_ACCESS_READ_CNF,&subscription_id,(TelAppCallback)sim_app_callback) ) +uts_tel_read_sim_pb_record.c: tet_infoline("startup fail. tel_register_event() failed"); +uts_tel_req_sap_cardreader_status.c: if (TAPI_API_SUCCESS == tel_register_event(TAPI_EVENT_SIM_SAP_CARD_READER_STATUS_CNF,&subscription_id,(TelAppCallback)sim_app_callback) ) +uts_tel_req_sap_cardreader_status.c: tet_infoline("startup fail. tel_register_event() failed"); +uts_tel_req_sap_connection.c: if (TAPI_API_SUCCESS == tel_register_event(TAPI_EVENT_SIM_SAP_CONNECT_CNF,&subscription_id,(TelAppCallback)sim_app_callback) ) +uts_tel_req_sap_connection.c: tet_infoline("startup fail. tel_register_event() failed"); +uts_tel_req_sap_connection_status.c: if (TAPI_API_SUCCESS == tel_register_event(TAPI_EVENT_SIM_SAP_CONNECT_STATUS_CNF,&subscription_id,(TelAppCallback)sim_app_callback) ) +uts_tel_req_sap_connection_status.c: tet_infoline("startup fail. tel_register_event() failed"); +uts_tel_req_sap_power_operation.c: if (TAPI_API_SUCCESS == tel_register_event(TAPI_EVENT_SIM_SAP_SET_SIM_POWER_CNF,&subscription_id,(TelAppCallback)sim_app_callback) ) +uts_tel_req_sap_power_operation.c: tet_infoline("startup fail. tel_register_event() failed"); +uts_tel_req_sap_transfer_apdu.c: if (TAPI_API_SUCCESS == tel_register_event(TAPI_EVENT_SIM_SAP_TRANSFER_APDU_CNF,&subscription_id,(TelAppCallback)sim_app_callback) ) +uts_tel_req_sap_transfer_apdu.c: tet_infoline("startup fail. tel_register_event() failed"); +uts_tel_req_sap_transfer_atr.c: if (TAPI_API_SUCCESS == tel_register_event(TAPI_EVENT_SIM_SAP_TRANSFER_ATR_CNF,&subscription_id,(TelAppCallback)sim_app_callback) ) +uts_tel_req_sap_transfer_atr.c: tet_infoline("startup fail. tel_register_event() failed"); +uts_tel_req_sap_transport_protocol.c: if (TAPI_API_SUCCESS == tel_register_event(TAPI_EVENT_SIM_SAP_SET_PROTOCOL_CNF,&subscription_id,(TelAppCallback)sim_app_callback) ) +uts_tel_req_sap_transport_protocol.c: tet_infoline("startup fail. tel_register_event() failed"); +uts_tel_req_sim_access.c: if (TAPI_API_SUCCESS == tel_register_event(TAPI_EVENT_SIM_SET_MAILBOX_CNF,&subscription_id,(TelAppCallback)sim_app_callback) ) +uts_tel_req_sim_access.c: tet_infoline("startup fail. tel_register_event() failed"); +uts_tel_req_sim_isim_authentication.c: if (TAPI_API_SUCCESS == tel_register_event(TAPI_EVENT_SIM_ISIM_AUTHENTICATION_CNF,&subscription_id,(TelAppCallback)sim_app_callback) ) +uts_tel_req_sim_isim_authentication.c: tet_infoline("startup fail. tel_register_event() failed"); +uts_tel_set_sim_indicator_info.c: if (TAPI_API_SUCCESS == tel_register_event(TAPI_EVENT_SIM_SET_INDICATION_CNF,&subscription_id,(TelAppCallback)sim_app_callback) ) +uts_tel_set_sim_indicator_info.c: tet_infoline("startup fail. tel_register_event() failed"); +uts_tel_set_sim_language.c: if ( (TAPI_API_SUCCESS == tel_register_event(TAPI_EVENT_SIM_SET_LANGUAGE_CNF,&subscription_id,(TelAppCallback)sim_app_callback, NULL) ) || (TAPI_API_SUCCESS == tel_register_event(TAPI_SIM_PIN_OPERATION_SUCCESS,&subscription_id,(TelAppCallback)sim_app_callback, NULL) ) ) +uts_tel_set_sim_language.c: tet_infoline("startup fail. tel_register_event() failed"); +uts_tel_set_sim_mailbox_info.c: if (TAPI_API_SUCCESS == tel_register_event(TAPI_EVENT_SIM_SET_MAILBOX_CNF,&subscription_id,(TelAppCallback)sim_app_callback) ) +uts_tel_set_sim_mailbox_info.c: tet_infoline("startup fail. tel_register_event() failed"); +uts_tel_update_sim_pb_record.c: if (TAPI_API_SUCCESS == tel_register_event(TAPI_EVENT_SIM_PB_UPDATE_CNF,&subscription_id,(TelAppCallback)sim_app_callback) ) +uts_tel_update_sim_pb_record.c: tet_infoline("startup fail. tel_register_event() failed"); +uts_tel_verifiy_sim_pins.c: if ( (TAPI_API_SUCCESS == tel_register_event(TAPI_EVENT_SIM_VERIFY_SEC_CNF,&subscription_id,(TelAppCallback)sim_app_callback) ) || (TAPI_API_SUCCESS == tel_register_event(TAPI_SIM_PIN_OPERATION_SUCCESS,&subscription_id,(TelAppCallback)sim_app_callback) ) ) +uts_tel_verifiy_sim_pins.c: tet_infoline("startup fail. tel_register_event() failed"); +uts_tel_verify_sim_puks.c: if (TAPI_API_SUCCESS == tel_register_event(TAPI_EVENT_SIM_VERIFY_PUK_CNF,&subscription_id,(TelAppCallback)sim_app_callback) ) +uts_tel_verify_sim_puks.c: tet_infoline("startup fail. tel_register_event() failed"); diff --git a/TC/telephony_TC/sim/unit/makefile b/TC/telephony_TC/sim/unit/makefile new file mode 100644 index 0000000..5d51641 --- /dev/null +++ b/TC/telephony_TC/sim/unit/makefile @@ -0,0 +1,206 @@ +CC=gcc -Wall + +LB1 = async_util +TS1 = uts_tel_get_sim_type +TS2 = uts_tel_get_sim_init_info +TS3 = uts_tel_get_sim_ecc +TS4 = uts_tel_get_sim_imsi +TS5 = uts_tel_get_sim_language +TS6 = uts_tel_set_sim_language +TS7 = uts_tel_req_sim_access +TS8 = uts_tel_verify_sim_puks +TS9 = uts_tel_verifiy_sim_pins +TS10 = uts_tel_change_sim_pins +TS11 = uts_tel_disable_sim_security +TS12 = uts_tel_disable_sim_fdn +TS13 = uts_tel_enable_sim_security +TS14 = uts_tel_enable_sim_fdn +TS15 = uts_tel_get_sim_fdn_status +TS16 = uts_tel_get_sim_security_status +TS17 = uts_tel_get_sim_personalization_status +TS18 = uts_tel_disable_sim_personalization +TS19 = uts_tel_enable_sim_personalization +TS20 = uts_tel_get_sim_mailbox_info +TS21 = uts_tel_get_sim_callforwarding_info +TS22 = uts_tel_get_sim_messagewaiting_info +TS23 = uts_tel_get_sim_cphs_info +TS24 = uts_tel_get_sim_msisdn +TS25 = uts_tel_get_sim_pb_init_info +TS26 = uts_tel_get_sim_pb_meta_info +TS27 = uts_tel_get_sim_pb_3g_meta_info +TS28 = uts_tel_get_sim_pb_count +TS29 = uts_tel_read_sim_pb_record +TS30 = uts_tel_update_sim_pb_record +TS31 = uts_tel_delete_sim_pb_record +TS32 = uts_tel_req_sim_isim_authentication +TS33 = #uts_tel_req_sap_connection +TS34 = #uts_tel_req_sap_connection_status +TS35 = #uts_tel_req_sap_transfer_atr +TS36 = #uts_tel_req_sap_transfer_apdu +TS37 = #uts_tel_req_sap_transport_protocol +TS38 = #uts_tel_req_sap_power_operation +TS39 = #uts_tel_req_sap_cardreader_status +TS40 = +TS41 = +TS42 = + +LIBS = `pkg-config --libs gconf-2.0 glib-2.0 dbus-1 dbus-glib-1 gthread-2.0 tapi ` +LIBS +=$(TET_ROOT)/lib/tet3/tcm.o +LIBS +=-L$(TET_ROOT)/lib/tet3 -lapi + +INCS = -I. `pkg-config --cflags gconf-2.0 glib-2.0 dbus-1 dbus-glib-1 gthread-2.0 tapi ` +INCS += -I$(TET_ROOT)/inc/tet3 +INCS += -I../ + +CFLAGS = $(INCS) -DXTHREADS -D_REENTRANT -DXUSE_MTSAFE_API -DWITHOUT_APP_MGR +CFLAGS += -D_TETWARE_MODE_ +CC +=$(CFLAGS) +LDFLAGS = $(LIBS) + +#ifeq ($(ARCH),target) +#CC += -g -mabi=aapcs-linux +#endif + +all : $(LB1) $(TS1) $(TS2) $(TS3) $(TS4) $(TS5) $(TS6) $(TS7) $(TS8) $(TS9) $(TS10) \ + $(TS11) $(TS12) $(TS13) $(TS14) $(TS15) $(TS16) $(TS17) $(TS18) $(TS19) $(TS20) \ + $(TS21) $(TS22) $(TS23) $(TS24) $(TS25) $(TS26) $(TS27) $(TS28) $(TS29) $(TS30) \ + $(TS31) $(TS32) $(TS33) $(TS34) $(TS35) $(TS36) $(TS37) $(TS38) $(TS39) $(TS40) $(TS41) $(TS42) + + +clean : + rm -rf *~ *.o target i386 tet_lock tet_captured *.pyc *.log .scon* + rm -rf $(TS1) $(TS2) $(TS3) $(TS4) $(TS5) $(TS6) $(TS7) $(TS8) $(TS9) $(TS10) + rm -rf $(TS11) $(TS12) $(TS13) $(TS14) $(TS15) $(TS16) $(TS17) $(TS18) $(TS19) $(TS20) + rm -rf $(TS21) $(TS22) $(TS23) $(TS24) $(TS25) $(TS26) $(TS27) $(TS28) $(TS29) $(TS30) + rm -rf $(TS31) $(TS32) $(TS33) $(TS34) $(TS35) $(TS36) $(TS37) $(TS38) $(TS39) $(TS40) $(TS41) $(TS42) + + +$(LB1): $(LB1).c + $(CC) -c $(LB1).c + +$(TS1): $(TS1).c $(LB1) + $(CC) -o $(TS1) $(TS1).c $(LDFLAGS) $(LB1).o + +$(TS2): $(TS2).c $(LB1) + $(CC) -o $(TS2) $(TS2).c $(LDFLAGS) $(LB1).o + +$(TS3): $(TS3).c $(LB1) + $(CC) -o $(TS3) $(TS3).c $(LDFLAGS) $(LB1).o + +$(TS4): $(TS4).c $(LB1) + $(CC) -o $(TS4) $(TS4).c $(LDFLAGS) $(LB1).o + +$(TS5): $(TS5).c $(LB1) + $(CC) -o $(TS5) $(TS5).c $(LDFLAGS) $(LB1).o + +$(TS6): $(TS6).c $(LB1) + $(CC) -o $(TS6) $(TS6).c $(LDFLAGS) $(LB1).o + +$(TS7): $(TS7).c $(LB1) + $(CC) -o $(TS7) $(TS7).c $(LDFLAGS) $(LB1).o + +$(TS8): $(TS8).c $(LB1) + $(CC) -o $(TS8) $(TS8).c $(LDFLAGS) $(LB1).o + +$(TS9): $(TS9).c $(LB1) + $(CC) -o $(TS9) $(TS9).c $(LDFLAGS) $(LB1).o + +$(TS10): $(TS10).c $(LB1) + $(CC) -o $(TS10) $(TS10).c $(LDFLAGS) $(LB1).o + +$(TS11): $(TS11).c $(LB1) + $(CC) -o $(TS11) $(TS11).c $(LDFLAGS) $(LB1).o + +$(TS12): $(TS12).c $(LB1) + $(CC) -o $(TS12) $(TS12).c $(LDFLAGS) $(LB1).o + +$(TS13): $(TS13).c $(LB1) + $(CC) -o $(TS13) $(TS13).c $(LDFLAGS) $(LB1).o + +$(TS14): $(TS14).c $(LB1) + $(CC) -o $(TS14) $(TS14).c $(LDFLAGS) $(LB1).o + +$(TS15): $(TS15).c $(LB1) + $(CC) -o $(TS15) $(TS15).c $(LDFLAGS) $(LB1).o + +$(TS16): $(TS16).c $(LB1) + $(CC) -o $(TS16) $(TS16).c $(LDFLAGS) $(LB1).o + +$(TS17): $(TS17).c $(LB1) + $(CC) -o $(TS17) $(TS17).c $(LDFLAGS) $(LB1).o + +$(TS18): $(TS18).c $(LB1) + $(CC) -o $(TS18) $(TS18).c $(LDFLAGS) $(LB1).o + +$(TS19): $(TS19).c $(LB1) + $(CC) -o $(TS19) $(TS19).c $(LDFLAGS) $(LB1).o + +$(TS20): $(TS20).c $(LB1) + $(CC) -o $(TS20) $(TS20).c $(LDFLAGS) $(LB1).o + +$(TS21): $(TS21).c $(LB1) + $(CC) -o $(TS21) $(TS21).c $(LDFLAGS) $(LB1).o + +$(TS22): $(TS22).c $(LB1) + $(CC) -o $(TS22) $(TS22).c $(LDFLAGS) $(LB1).o + +$(TS23): $(TS23).c $(LB1) + $(CC) -o $(TS23) $(TS23).c $(LDFLAGS) $(LB1).o + +$(TS24): $(TS24).c $(LB1) + $(CC) -o $(TS24) $(TS24).c $(LDFLAGS) $(LB1).o + +$(TS25): $(TS25).c $(LB1) + $(CC) -o $(TS25) $(TS25).c $(LDFLAGS) $(LB1).o + +$(TS26): $(TS26).c $(LB1) + $(CC) -o $(TS26) $(TS26).c $(LDFLAGS) $(LB1).o + +$(TS27): $(TS27).c $(LB1) + $(CC) -o $(TS27) $(TS27).c $(LDFLAGS) $(LB1).o + +$(TS28): $(TS28).c $(LB1) + $(CC) -o $(TS28) $(TS28).c $(LDFLAGS) $(LB1).o + +$(TS29): $(TS29).c $(LB1) + $(CC) -o $(TS29) $(TS29).c $(LDFLAGS) $(LB1).o + +$(TS30): $(TS30).c $(LB1) + $(CC) -o $(TS30) $(TS30).c $(LDFLAGS) $(LB1).o + +$(TS31): $(TS31).c $(LB1) + $(CC) -o $(TS31) $(TS31).c $(LDFLAGS) $(LB1).o + +$(TS32): $(TS32).c $(LB1) + $(CC) -o $(TS32) $(TS32).c $(LDFLAGS) $(LB1).o + +$(TS33): $(TS33).c $(LB1) + $(CC) -o $(TS33) $(TS33).c $(LDFLAGS) $(LB1).o + +$(TS34): $(TS34).c $(LB1) + $(CC) -o $(TS34) $(TS34).c $(LDFLAGS) $(LB1).o + +$(TS35): $(TS35).c $(LB1) + $(CC) -o $(TS35) $(TS35).c $(LDFLAGS) $(LB1).o + +$(TS36): $(TS36).c $(LB1) + $(CC) -o $(TS36) $(TS36).c $(LDFLAGS) $(LB1).o + +$(TS37): $(TS37).c $(LB1) + $(CC) -o $(TS37) $(TS37).c $(LDFLAGS) $(LB1).o + +$(TS38): $(TS38).c $(LB1) + $(CC) -o $(TS38) $(TS38).c $(LDFLAGS) $(LB1).o + +$(TS39): $(TS39).c $(LB1) + $(CC) -o $(TS39) $(TS39).c $(LDFLAGS) $(LB1).o + +$(TS40): $(TS40).c $(LB1) + $(CC) -o $(TS40) $(TS40).c $(LDFLAGS) $(LB1).o + +$(TS41): $(TS41).c $(LB1) + $(CC) -o $(TS41) $(TS41).c $(LDFLAGS) $(LB1).o + +$(TS42): $(TS42).c $(LB1) + $(CC) -o $(TS42) $(TS42).c $(LDFLAGS) $(LB1).o + diff --git a/TC/telephony_TC/sim/unit/sim_pw.txt b/TC/telephony_TC/sim/unit/sim_pw.txt new file mode 100644 index 0000000..b7a16a1 --- /dev/null +++ b/TC/telephony_TC/sim/unit/sim_pw.txt @@ -0,0 +1,8 @@ +pin1:1111 +pin2:2222 +puk1:11111111 +puk2:22222222 +wpin1:5555 +wpin2:6666 +wpuk1:77777777 +wpuk2:88888888 diff --git a/TC/telephony_TC/sim/unit/tet_tapi_util.h b/TC/telephony_TC/sim/unit/tet_tapi_util.h new file mode 100644 index 0000000..73156c5 --- /dev/null +++ b/TC/telephony_TC/sim/unit/tet_tapi_util.h @@ -0,0 +1,327 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * 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 _TET_TAPI_UTIL_ +#define _TET_TAPI_UTIL_ + +#include +#include +#include +#include + +#ifndef UINT16 +typedef int UINT16; +#endif + +#ifndef BOOL +#define BOOL int +#endif +#ifndef TRUE +#define TRUE 1 +#endif +#ifndef FALSE +#define FALSE 0 +#endif + +#include + +// TET_Error Code string return macro +typedef struct { + TapiResult_t _err_; + char * string; +}TAPI_Error_String; + +#define TAPI_ERROR_MAX TAPI_API_MISC_OUTPARAM_NULL+1 + + +TAPI_Error_String g_TAPI_ErrorString[200] = { + + /* #################### COMMON START ################ */ + {TAPI_API_SUCCESS, "TAPI_API_SUCCESS : No Error occured"}, + {TAPI_API_INVALID_INPUT, "TAPI_API_INVALID_INPUT : Input values are not correct in TAPI Library"}, + {TAPI_API_INVALID_PTR, "TAPI_API_INVALID_PTR : Invalid pointer"}, + {TAPI_API_NOT_SUPPORTED, "TAPI_API_NOT_SUPPORTED: The feature corresponding to requested API is not supported. This may be due to market/network/vendor reasons such as the feature is not available in the network"}, + {TAPI_API_DEPRICATED, "TAPI_API_DEPRICATED : This API is deprecated and will be so in future also"}, + {TAPI_API_SYSTEM_OUT_OF_MEM, "TAPI_API_SYSTEM_OUT_OF_MEM : Out of memory"}, + {TAPI_API_SYSTEM_RPC_LINK_DOWN, "TAPI_API_SYSTEM_RPC_LINK_DOWN : RPC link down"}, + {TAPI_API_MODEM_POWERED_OFF, "TAPI_API_MODEM_POWERED_OFF : The Modem is powered off"}, + {TAPI_API_SERVICE_NOT_READY, "TAPI_API_SERVICE_NOT_READY : Phone was powered on, but yet to receive the power up completed notification"}, + {TAPI_API_SERVER_FAILURE , "TAPI_API_SERVER_FAILURE : error occurred in Telephony server"}, + {TAPI_API_OEM_PLUGIN_FAILURE , "TAPI_API_OEM_PLUGIN_FAILURE : Plug-in layer failure"}, + {TAPI_API_TRANSPORT_LAYER_FAILURE, "TAPI_API_TRANSPORT_LAYER_FAILURE"}, + + {TAPI_API_INVALID_CALL_HANDLE, "TAPI_API_INVALID_CALL_HANDLE : Invalid call handle"}, + {TAPI_API_INVALID_CALL_STATE, "TAPI_API_INVALID_CALL_STATE : Invalid call state- Newly added. Need to raise a CR for this"}, + + {TAPI_API_INVALID_DATA_LEN, "TAPI_API_INVALID_DATA_LEN : Invalid data length"}, + {TAPI_API_SIM_NOT_FOUND, "TAPI_API_SIM_NOT_FOUND : Sim is not present / removed "}, + {TAPI_API_SIM_BUSY, "TAPI_API_SIM_BUSY : SIM is busy"}, + {TAPI_API_SIM_INVALID_CARD_TYPE, "TAPI_API_SIM_INVALID_CARD_TYPE : Sim card is unknown "}, + {TAPI_API_SIM_CARD_PERMANENT_ERROR, "TAPI_API_SIM_CARD_PERMANENT_ERROR : SIM error/blocked state"}, + {TAPI_API_SIM_NOT_INITIALIZED, "TAPI_API_SIM_NOT_INITIALIZED : SIM has not initialized yet (waiting for PIN verifcation, etc)"}, + {TAPI_API_REQUEST_MAX_IN_PROGRESS, "TAPI_API_REQUEST_MAX_IN_PROGRESS : Maximum number of API Request for the same service are already in progress "}, + {TAPI_API_OFFLINE_MODE_ERROR, "TAPI_API_OFFLINE_MODE_ERROR : OEM Telephony Provider is in Offline mode"}, + {TAPI_EVENT_CLASS_UNKNOWN, "TAPI_EVENT_CLASS_UNKNOWN : Event class specified is not present in Event Class list"}, + {TAPI_EVENT_UNKNOWN, "TAPI_EVENT_UNKNOWN : Event specified is not present in TAPI Unsolicited Event list"}, + {TAPI_REGISTRATION_OP_FAILED, "TAPI_REGISTRATION_OP_FAILED : Callback Registration/De-registration failed"}, + {TAPI_NETTEXT_SCADDRESS_NOT_SET, "TAPI_NETTEXT_SCADDRESS_NOT_SET"}, + {TAPI_API_OPERATION_FAILED, "TAPI_API_OPERATION_FAILED"}, + {TAPI_API_INVALID_OPERATION, "TAPI_API_INVALID_OPERATION"}, + + /* ############## XOCEAN ##################### */ + {TAPI_API_SYSTEM_RPC_LINK_NOT_EST, "TAPI_API_SYSTEM_RPC_LINK_NOT_EST"}, + {TAPI_API_API_NOT_SUPPORTED, "TAPI_API_API_NOT_SUPPORTED"}, + {TAPI_API_SERVER_LAYER_FAILURE, "TAPI_API_SERVER_LAYER_FAILURE"}, + + /* ################### CAL #############################*/ + {TAPI_API_INVALID_CALL_ID, "TAPI_API_INVALID_CALL_ID"}, + {TAPI_API_CALL_CTXT_OVERFLOW, "TAPI_API_CALL_CTXT_OVERFLOW"}, + {TAPI_API_COULD_NOT_GET_CALL_CTXT, "TAPI_API_COULD_NOT_GET_CALL_CTXT"}, + {TAPI_API_CTXT_SEARCH_RET_NON_CALL_CTXT, "TAPI_API_CTXT_SEARCH_RET_NON_CALL_CTXT"}, + {TAPI_API_COULD_NOT_DESTROY_CTXT, "TAPI_API_COULD_NOT_DESTROY_CTXT"}, + {TAPI_API_INVALID_LINE_ID, "TAPI_API_INVALID_LINE_ID"}, + + /* POWER */ + //{TAPI_API_MODEM_ALREADY_ON, "TAPI_API_MODEM_ALREADY_ON"}, + //{TAPI_API_MODEM_ALREADY_OFF, "TAPI_API_MODEM_ALREADY_OFF"}, + + /* NETTEXT */ + {TAPI_API_NETTEXT_DEVICE_NOT_READY, "TAPI_API_NETTEXT_DEVICE_NOT_READY"}, + {TAPI_API_NETTEXT_SCADDR_NOT_SET, "TAPI_API_NETTEXT_SCADDR_NOT_SET"}, + {TAPI_API_NETTEXT_INVALID_DATA_LEN, "TAPI_API_NETTEXT_INVALID_DATA_LEN"}, + +#if 0 + /* SIM */ + {TAPI_API_SIM_DEV_CTX_NULL, "TAPI_API_SIM_DEV_CTX_NULL"}, + {TAPI_API_SIM_NOT_FOUND, "TAPI_API_SIM_SIM_NOT_FOUND"}, + //{TAPI_API_SIM_SIM_NOT_FOUND, "TAPI_API_SIM_SIM_NOT_FOUND"}, + {TAPI_API_SIM_SIM_SESSION_FULL, "TAPI_API_SIM_SIM_SESSION_FULL"}, + {TAPI_API_SIM_INVALID_APP_ID, "TAPI_API_SIM_INVALID_APP_ID"}, + {TAPI_API_SIM_INVALID_SESSION, "TAPI_API_SIM_INVALID_SESSION"}, + {TAPI_API_SIM_FILE_TYPE_WRONG, "TAPI_API_SIM_FILE_TYPE_WRONG"}, + {TAPI_API_SIM_FILE_ENCODE_FAIL, "TAPI_API_SIM_FILE_ENCODE_FAIL"}, + {TAPI_API_SIM_FILE_DECODE_FAIL, "TAPI_API_SIM_FILE_DECODE_FAIL"}, + {TAPI_API_SIM_FILE_INVALID_ENCODE_LEN, "TAPI_API_SIM_FILE_INVALID_ENCODE_LEN"}, + {TAPI_API_SIM_INVALID_RECORD_NUM, "TAPI_API_SIM_INVALID_RECORD_NUM"}, + {TAPI_API_SIM_CASE_NOT_HANDLED, "TAPI_API_SIM_CASE_NOT_HANDLED"}, + {TAPI_API_SIM_OEM_UNKNOWN_SIM_CARD, "TAPI_API_SIM_OEM_UNKNOWN_SIM_CARD"}, + {TAPI_API_SIM_SEC_UKNOWN_PIN_TYPE, "TAPI_API_SIM_SEC_UKNOWN_PIN_TYPE"}, + {TAPI_API_SIM_SEC_INVALID_PIN_TYPE, "TAPI_API_SIM_SEC_INVALID_PIN_TYPE"}, + {TAPI_API_SIM_PB_INVALID_STORAGE_TYPE, "TAPI_API_SIM_PB_INVALID_STORAGE_TYPE"}, +#endif + /* Network */ + {TAPI_API_NETWORK_INVALID_CTXT, "TAPI_API_NETWORK_INVALID_CTXT"}, + + /*Misc */ + {TAPI_API_MISC_RETURN_NULL, "TAPI_API_MISC_RETURN_NULL"}, + {TAPI_API_MISC_VALIDITY_ERROR, "TAPI_API_MISC_VALIDITY_ERROR"}, + {TAPI_API_MISC_INPUTPARM_ERROR, "TAPI_API_MISC_INPUTPARM_ERROR"}, + {TAPI_API_MISC_OUTPARAM_NULL, "TAPI_API_MISC_OUTPARAM_NULL"}, +}; + + + +//#define TET_ERROR_TO_STRING(_err_) g_TAPI_ErrorString[(_err_)].string +static char * nondefined_err = "Non defined error code"; +static const char* TET_ERROR_TO_STRING(TapiResult_t err_code) +{ + int index; + for( index=0; g_TAPI_ErrorString[index]._err_ != TAPI_ERROR_MAX ; index++) + { + if (g_TAPI_ErrorString[index]._err_ == err_code || g_TAPI_ErrorString[index]._err_ == TAPI_ERROR_MAX) + return g_TAPI_ErrorString[index].string; + } + return nondefined_err; +} + + +// TET_STAMP ****************************************************************************** +#define TET_STAMP_START(log) \ +do {\ + tet_printf("[*]%s[%d] %s() : %s", __FILE__,__LINE__,__FUNCTION__,log);\ +} while(0) + +#define TET_STAMP_PASS() \ +do {\ + tet_printf("[*]%s[%d] %s() : pass",__FILE__,__LINE__,__FUNCTION__);\ + tet_result(TET_PASS);\ +} while(0) + +#define TET_STAMP_FAIL() \ +do {\ + tet_printf("[*]%s[%d] %s() : fail",__FILE__,__LINE__,__FUNCTION__);\ + tet_result(TET_FAIL);\ +} while(0) + +#define TET_STAMP(result) \ +do {\ + tet_printf("[*]%s[%d] %s() TET_STAMP(%d)",__FILE__,__LINE__,__FUNCTION__,result); \ + tet_result(result);\ +} while(0) + +// TET_RESULT Function ********************************************************************* +#define TET_RESULT_EQUAL(result,x1,x2) \ +do { \ + if ((x1) == (x2)) \ + { \ + tet_printf("[*]%s[%d] %s() : %d and %d is equal",__FILE__,__LINE__,__FUNCTION__, x1,x2); \ + tet_result(result); \ + if(result==TET_PASS || result==TET_FAIL || result == TET_UNTESTED) return;\ + } \ + } while(0) + +#define TET_RESULT_EQUAL_GOTO(result,label,x1,x2) \ +do { \ + if ((x1) == (x2)) \ + { \ + tet_printf("[*]%s[%d] %s() : %d and %d is equal",__FILE__,__LINE__,__FUNCTION__, x1,x2); \ + tet_result(result); \ + goto label;\ + } \ + } while(0) + +#define TET_RESULT_NOT_EQUAL(result,x1,x2) \ +do { \ + if ((x1) != (x2)) \ + { \ + tet_printf("[*]%s[%d] %s() : %d and %d is not equal",__FILE__,__LINE__,__FUNCTION__, x1,x2); \ + tet_result(result); \ + if(result==TET_PASS || result==TET_FAIL || result == TET_UNTESTED) return;\ + } \ + } while(0) + + +#define TET_RESULT_NOT_EQUAL_GOTO(result,label,x1,x2) \ +do { \ + if ((x1) != (x2)) \ + { \ + tet_printf("[*]%s[%d] %s() : %d and %d is not equal",__FILE__,__LINE__,__FUNCTION__, x1,x2); \ + tet_result(result); \ + goto label;\ + } \ + } while(0) + + +// TET_CHECK Macro : TAPI api return value test macro. If it is not TAPI_API_SUCCESS, tet_retult(TET_FAIL) is called +#define TET_CHECK(x1, y...) \ +do { \ + TapiResult_t _err_ = y;\ + if (_err_ != (x1)) \ + { \ + tet_printf("[*]%s[%d] %s() : test fail. error code =%d [%s] ",__FILE__,__LINE__,__FUNCTION__, _err_, TET_ERROR_TO_STRING(_err_) ); \ + tet_result(TET_FAIL); \ + return;\ + } \ + } while(0) + + +#define TET_PRECONDITION(x1, y...) \ +do { \ + TapiResult_t _err_ = y;\ + if (_err_ != (x1)) \ + { \ + tet_printf("[*]%s[%d] %s : Test precondition fail. error code =%d [%s] ",__FILE__,__LINE__,__FUNCTION__, _err_, TET_ERROR_TO_STRING(_err_) ); \ + tet_result(TET_UNTESTED); \ + return;\ + } \ + } while(0) + +#define TET_PRECONDITION2(x1, x2, y...) \ +do { \ + TapiResult_t _err_ = y;\ + if ( !(_err_ == (x1) || _err_ == (x2))) \ + { \ + tet_printf("[*]%s[%d] %s : Test precondition fail. error code =%d [%s] ",__FILE__,__LINE__,__FUNCTION__, _err_, TET_ERROR_TO_STRING(_err_) ); \ + tet_result(TET_UNTESTED); \ + return;\ + } \ + } while(0) + + +#define TET_CHECK_GOTO(x1,label, y...) \ +do { \ + TapiResult_t _err_ = y;\ + if (_err_ != (x1)) \ + { \ + tet_printf("[*]%s[%d] %s() : test fail. error code =%x [%s] ",__FILE__,__LINE__,__FUNCTION__, _err_, TET_ERROR_TO_STRING(_err_) ); \ + tet_result(TET_FAIL); \ + goto label;\ + } \ + } while(0) + +#define TET_PRECONDITION_GOTO(x1,label, y...) \ +do { \ + TapiResult_t _err_ = y;\ + if (_err_ != (x1)) \ + { \ + tet_printf("[*]%s[%d] %s() : Test precondition fail. error code =%d [%s] ",__FILE__,__LINE__,__FUNCTION__, _err_, TET_ERROR_TO_STRING(_err_) ); \ + tet_result(TET_UNTESTED); \ + goto label;\ + } \ + } while(0) + +#define TET_PRECONDITION2_GOTO(x1,x2,label, y...) \ +do { \ + TapiResult_t _err_ = y;\ + if ( !(_err_ == (x1)||_err_ == (x2))) \ + { \ + tet_printf("[*]%s[%d] %s() : Test precondition fail. error code =%d [%s] ",__FILE__,__LINE__,__FUNCTION__, _err_, TET_ERROR_TO_STRING(_err_) ); \ + tet_result(TET_UNTESTED); \ + goto label;\ + } \ + } while(0) + + +#define TET_CHECK2(x1,x2, y...) \ +do { \ + TapiResult_t _err_ = y;\ + if (!(_err_ == (x1) || _err_ == (x2))) \ + { \ + tet_printf("[*]%s[%d] %s() : test fail. error code =%d [%s] ",__FILE__,__LINE__,__FUNCTION__, _err_, TET_ERROR_TO_STRING(_err_) ); \ + tet_result(TET_FAIL); \ + return;\ + } \ + } while(0) + +#define TET_CHECK2_GOTO(x1,x2, label, y...) \ +do { \ + TapiResult_t _err_ = y;\ + if (!(_err_ == (x1) || _err_ == (x2))) \ + { \ + tet_printf("[*]%s[%d] %s() : test fail. error code =%d [%s] ",__FILE__,__LINE__,__FUNCTION__, _err_, TET_ERROR_TO_STRING(_err_) ); \ + tet_result(TET_FAIL); \ + goto label;\ + } \ + else tet_printf("[*]%s[%d] %s() : test success. error code =%d [%s] ",__FILE__,__LINE__,__FUNCTION__, _err_, TET_ERROR_TO_STRING(_err_) ); \ + } while(0) + + +#define TET_CHECK3(x1,x2,x3, y...) \ +do { \ + TapiResult_t _err_ = y;\ + if (!(_err_ == (x1) || _err_ == (x2) || _err_ == (x3))) \ + { \ + tet_printf("[*]%s[%d] %s() : test fail. error code =%d [%s] ",__FILE__,__LINE__,__FUNCTION__, _err_, TET_ERROR_TO_STRING(_err_) ); \ + tet_result(TET_FAIL); \ + return;\ + } \ + } while(0) +#endif //_TET_TAPI_UTIL_ diff --git a/TC/telephony_TC/sim/unit/tslist b/TC/telephony_TC/sim/unit/tslist new file mode 100644 index 0000000..6e805b4 --- /dev/null +++ b/TC/telephony_TC/sim/unit/tslist @@ -0,0 +1,32 @@ +/sim/unit/uts_tel_get_sim_type +/sim/unit/uts_tel_get_sim_init_info +/sim/unit/uts_tel_get_sim_ecc +/sim/unit/uts_tel_get_sim_imsi +/sim/unit/uts_tel_get_sim_language +/sim/unit/uts_tel_set_sim_language +/sim/unit/uts_tel_req_sim_access +/sim/unit/uts_tel_verify_sim_puks +/sim/unit/uts_tel_verifiy_sim_pins +/sim/unit/uts_tel_change_sim_pins +/sim/unit/uts_tel_disable_sim_security +/sim/unit/uts_tel_disable_sim_fdn +/sim/unit/uts_tel_enable_sim_security +/sim/unit/uts_tel_enable_sim_fdn +/sim/unit/uts_tel_get_sim_fdn_status +/sim/unit/uts_tel_get_sim_security_status +/sim/unit/uts_tel_get_sim_personalization_status +/sim/unit/uts_tel_disable_sim_personalization +/sim/unit/uts_tel_enable_sim_personalization +/sim/unit/uts_tel_get_sim_mailbox_info +/sim/unit/uts_tel_get_sim_callforwarding_info +/sim/unit/uts_tel_get_sim_messagewaiting_info +/sim/unit/uts_tel_get_sim_cphs_info +/sim/unit/uts_tel_get_sim_msisdn +/sim/unit/uts_tel_get_sim_pb_init_info +/sim/unit/uts_tel_get_sim_pb_meta_info +/sim/unit/uts_tel_get_sim_pb_3g_meta_info +/sim/unit/uts_tel_get_sim_pb_count +/sim/unit/uts_tel_read_sim_pb_record +/sim/unit/uts_tel_update_sim_pb_record +/sim/unit/uts_tel_delete_sim_pb_record +/sim/unit/uts_tel_req_sim_isim_authentication diff --git a/TC/telephony_TC/sim/unit/uts_tel_change_sim_pins.c b/TC/telephony_TC/sim/unit/uts_tel_change_sim_pins.c new file mode 100644 index 0000000..f242c23 --- /dev/null +++ b/TC/telephony_TC/sim/unit/uts_tel_change_sim_pins.c @@ -0,0 +1,700 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +/** +* @ingroup TELEPHONY_API +* @addtogroup TAPI_API_SIM_SAT SIM/SAT +*/ + +/** +* @ingroup TAPI_API_SIM_SAT +* @addtogroup UTS_SIM_SAT Unit +*/ + +/** +* @ingroup UTS_SIM_SAT +* @addtogroup UTS_TAPI_SIM_CHANGE_PIN tel_change_sim_pins +* +* @brief Unit test code for tel_change_sim_pins() +* @par Test function Prototype: +* TapiResult_t tel_change_sim_pins (TelSimPinType_t PinType , const char *pOldPinData, const char *pNewPinData, int *pRequestId); +* @par Test function description: +* This function changes PIN code based on the pin type passed along with old pin data and new pin data. +* @par Important Notes: +* Based on Pin status (PIN/UPIN/PUK) is blocked, an unsolicited event TAPI_EVENT_SIM_STATUS_IND is published to Applications +* @param [in] +* PinType Pin type information. +* @code +typedef enum +{ + TAPI_SIM_PTYPE_PIN1 = 0x00, // PIN 1 + TAPI_SIM_PTYPE_PIN2 = 0x01, // PIN 2 + TAPI_SIM_PTYPE_PUK1 = 0x02, // Puk 1 + TAPI_SIM_PTYPE_PUK2 = 0x03, // Puk 2 + TAPI_SIM_PTYPE_UPIN = 0x04, // Universal PIN + TAPI_SIM_PTYPE_ADM = 0x05 // Administrator +} TelSimPinType_t; +* @endcode +* @param [in] +* pOldPinData Old pin code, entered by the user. (Null terminated string) +* @param [in] +* pNewPinData New pin code, entered by the user. (Null terminated string) +* @param [out] pRequestId +* \n Unique identifier for a particular request. +* \n Request_id value can be any value from 0 to 255 if the API is returned successfully +* \n -1 (INVALID_REQUEST_ID) will be sent in case of failure. +* @par Async Response Message: +* The event associated is below and the event data is #TelSimPinInfo_t. \n +* (Asynchronous return status is indicated by #TelSimPinOperationResult_t.) +* - TAPI_EVENT_SIM_DISABLE_PIN_CNF +* - TAPI_EVENT_SIM_ENABLE_PIN_CNF +* - TAPI_EVENT_SIM_CHANGE_PIN_CNF +* - TAPI_EVENT_SIM_UNBLOCK_PIN_CNF +* @pre +* - Before test script compile, you set correct PIN1_NORMAL, PIN2_NORMAL, PIN1_CHANGED, PIN2_CHANGED value on 'tet_tapi_util.h' +* - Before test script compile, you set incorrect PIN1_INCORRECT value on 'tet_tapi_util.h' +* @post +* None +* @return +* Return Type : (TapiResult_t) +* - TAPI_API_SUCCESS - indicating that the operation has completed successfully. +* - Otherwise it provides an error code (Refer #TapiResult_t) +* @{ +*/ + +/** +* @file uts_tel_change_sim_pins.c +* @brief Test for the tel_change_sim_pins() API that is used to change pin1 code +* @author +* @version Initial Creation V0.1 +* @date 2008.07.30 +*/ + +#include +#include +#include + +#include "tet_tapi_util.h" +#include "uts_tel_change_sim_pins.h" +#include "sim_common.h" +#include "async_util.h" + +/* Initialize TCM data structures */ +static void startup(); +static void cleanup(); +void (*tet_startup) () = startup; +void (*tet_cleanup) () = cleanup; +struct tet_testlist tet_testlist[] = { + {utc_tel_change_sim_pins_01, 1}, + {utc_tel_change_sim_pins_02, 2}, + {utc_tel_change_sim_pins_03, 3}, + {utc_tel_change_sim_pins_04, 4}, + {utc_tel_change_sim_pins_05, 5}, + {utc_tel_change_sim_pins_06, 6}, + {utc_tel_change_sim_pins_07, 7}, + {utc_tel_change_sim_pins_08, 8}, + {NULL, 0} +}; + +/* + User Defined Handler +*/ +// Global variable for user data +static BOOL gAsyncResult; //user defined data : Async callback is called or not +static TelSimPinOperationResult_t gSimEventStatus; + +/* Startup & Clean function : It is not test code, only for + initialize and finalize test module +*/ +static BOOL gStartupSuccess = FALSE; +static unsigned int subscription_id = 0; + +extern sim_info_t g_si; + + +/* + G_MAIN Utility //////////////////////////////////////////////////////////////////////////// +*/ +// Prototype : User must add function body +gboolean g_timeout_callback (void *data); + +// GMainLoop global handler +GMainLoop *sim_loop = NULL; + +void G_MAIN_LOOP_CLOSE() +{ + g_main_loop_quit(sim_loop); +} + +int G_MAIN_LOOP_RUN(int sec) +{ + sim_loop = g_main_loop_new (NULL, FALSE); + g_timeout_add ( (sec * 1000), g_timeout_callback, NULL); + g_main_loop_run (sim_loop); + return 0; +} +gboolean g_timeout_callback (void *data) +{ + gAsyncResult = FALSE; + tet_printf("[TIME OUT] g_timeout called .Close g_main_roop()"); + G_MAIN_LOOP_CLOSE(); + return FALSE; +} +// End of G_MAIN Utility////////////////////////////////////////////////////////////////////// + + +static int sim_pin_process_for_condition(TelSimPinType_t wish_pin, TelSimPinStatus_t wish_condition) +{ + int pRequestId=0; + int tapiRet = TAPI_API_SUCCESS; + TelSimPinStatus_t pin_status = TAPI_SIM_PIN_STATUS_UNKNOWN; + TelSimSecPw_t sec_data; + memset(&sec_data, 0x00, sizeof(TelSimSecPw_t)); + + tet_printf("pin[%d]:0-pin1, 1-pin2, wish_condition[%d]: 0-dis, 1- enabled, 2-blocked(puk)",wish_pin, wish_condition); + + tapiRet = tel_get_sim_security_status(wish_pin,&pin_status); + if(tapiRet != TAPI_API_SUCCESS) + { + tet_printf("tel_get_sim_security_status is Failed with tapiRet[%d]", tapiRet); + return -1; + } + + if(pin_status == TAPI_SIM_PIN_STATUS_DISABLED ) + { + tet_printf("current pin status is TAPI_SIM_PIN_STATUS_DISABLED"); + } + else if(pin_status == TAPI_SIM_PIN_STATUS_ENABLED) + { + tet_printf("current pin status is TAPI_SIM_PIN_STATUS_ENABLED"); + } + else + { + tet_printf("current pin status is unhandled status[%d]",pin_status ); + return -1; + } + + if(pin_status == wish_condition ) + { + tet_printf("current pin status is same with wished condition"); + return 0; + } + else + { + tet_printf("current pin status is different with wished condition"); + sec_data.type = wish_pin; + + if(wish_pin == TAPI_SIM_PTYPE_PIN1 ) + { + sec_data.pw_len = strlen(g_si.pin1); + sec_data.pw = (unsigned char*)malloc(sec_data.pw_len); + memcpy(sec_data.pw,g_si.pin1,sec_data.pw_len); + } + else if(wish_pin == TAPI_SIM_PTYPE_PIN2) + { + sec_data.pw_len = strlen(g_si.pin2); + sec_data.pw = (unsigned char*)malloc(sec_data.pw_len); + memcpy(sec_data.pw,g_si.pin2,sec_data.pw_len); + } + + gAsyncResult = FALSE; + + if(wish_condition == TAPI_SIM_PIN_STATUS_DISABLED) + { + tet_printf("make pin status with wished condition(TAPI_SIM_PIN_STATUS_DISABLED)"); + + tapiRet = tel_disable_sim_security(&sec_data,&pRequestId); + } + else if(wish_condition == TAPI_SIM_PIN_STATUS_ENABLED) + { + tet_printf("make pin status with wished condition(TAPI_SIM_PIN_STATUS_ENABLED)"); + tapiRet = tel_enable_sim_security(&sec_data,&pRequestId); + } + else + { + tet_printf("Unhandled wish_condition[%d]", wish_condition); + return -1; + } + + if(tapiRet != TAPI_API_SUCCESS) + { + tet_printf("tapi return[%d] when en/disabling pin for condition",tapiRet); + return -1; + } + else + { + G_MAIN_LOOP_RUN(3); + } + + if(gAsyncResult == TRUE) + return 0; + else + return -1; + } + + return 0; +} + + +static int sim_app_callback (TelTapiEvent_t *sim_event) +{ + tet_printf("\n\n\n***************[SIM APP]Callback data **********************\n"); + tet_printf("[SIM APP]Reques Id[%d]\n", sim_event->RequestId); + tet_printf("[SIM APP]event status [%d]\n", sim_event->Status); + + gAsyncResult = FALSE; + switch(sim_event->EventType) + { + case TAPI_EVENT_SIM_ENABLE_SEC_CNF: //preet: changed TAPI_EVENT_SIM_ENABLE_PIN_CNF to TAPI_EVENT_SIM_ENABLE_SEC_CNF + { + tet_printf("\n[SIM APP]*****************TAPI_EVENT_SIM_ENABLE_SEC_CNF***************************\n"); + tet_printf("SIM Enable PIN event status = [%x]\n", sim_event->Status); + + gSimEventStatus = sim_event->Status; + if(sim_event->Status == TAPI_SIM_PIN_OPERATION_SUCCESS) + gAsyncResult = TRUE; + else + gAsyncResult = FALSE; + } + break; + + case TAPI_EVENT_SIM_DISABLE_SEC_CNF: ////preet: changed TAPI_EVENT_SIM_DISABLE_PIN_CNF to TAPI_EVENT_SIM_DISABLE_SEC_CNF + { + tet_printf("\n[SIM APP]*****************TAPI_EVENT_SIM_DISABLE_SEC_CNF***************************\n"); + tet_printf("SIM Disable PIN event status = [%x]\n", sim_event->Status); + + gSimEventStatus = sim_event->Status; + if(sim_event->Status == TAPI_SIM_PIN_OPERATION_SUCCESS) + gAsyncResult = TRUE; + else + gAsyncResult = FALSE; + } + break; + + case TAPI_EVENT_SIM_CHANGE_PINS_CNF: //preet: changed TAPI_EVENT_SIM_CHANGE_PIN_CNF to TAPI_EVENT_SIM_CHANGE_PINS_CNF: + { + tet_printf("\n[GOT THE EVENT]*****TAPI_EVENT_SIM_CHANGE_PINS_CNF:******\n"); + tet_printf("SIM Change PIN event status = [%x]\n", sim_event->Status); + + gSimEventStatus = sim_event->Status; + gAsyncResult = TRUE; + } + break; + + default: + { + gSimEventStatus = sim_event->Status; + gAsyncResult = FALSE; + tet_printf("[SIM APP]Undhandled event type [0x%x]\n",sim_event->EventType); + tet_printf("[SIM APP]Undhandled event state [%d]\n",sim_event->Status); + break; + } + }//end switch + + G_MAIN_LOOP_CLOSE(); + return 0; +} + + +static void startup() +{ + // describe code if you need... + tet_infoline("utc_tel_change_sim_pins Test Start\n"); + + sim_pin_info_setup(); + + if ( tel_init() == TAPI_API_SUCCESS) + { + tel_register_event(TAPI_EVENT_SIM_DISABLE_SEC_CNF,&subscription_id,(TelAppCallback)sim_app_callback,NULL); + tel_register_event(TAPI_EVENT_SIM_CHANGE_PINS_CNF,&subscription_id,(TelAppCallback)sim_app_callback,NULL); + tel_register_event(TAPI_EVENT_SIM_VERIFY_SEC_CNF,&subscription_id,(TelAppCallback)sim_app_callback,NULL); + tel_register_event(TAPI_EVENT_SIM_ENABLE_SEC_CNF,&subscription_id,(TelAppCallback)sim_app_callback,NULL); + + gStartupSuccess = TRUE; + } else { + tet_infoline("startup fail. tel_init() failed"); + } + + tel_register_app_name("org.samsung.test"); + + return; +} + +static void cleanup() +{ + tet_infoline("utc_tel_change_sim_pins Test Finished\n"); + + if (gStartupSuccess == TRUE) + { + tel_deregister_event(subscription_id); + } + tel_deinit(); + return; +} + + +/* + Unit Test Case functions +*/ + +/** +* @brief tel_change_sim_pins() API : Negative condition(First parameter is Null) +* @par ID: UTC_TEL_CHANGE_SIM_PINS_01 +* @param [in] PinType = TAPI_SIM_PTYPE_PIN1 +* @param [in] *pOldPinData = NULL +* @param [in] *pNewPinData = PIN1_CHANGED +* @param [out] &pRequestId +* @return TAPI_API_INVALID_PTR +*/ +void utc_tel_change_sim_pins_01() +{ + TET_STAMP_START("tel_change_sim_pins(),Null parameter check 1"); + TET_RESULT_NOT_EQUAL(TET_UNTESTED,gStartupSuccess, TRUE); + + int pRequestId=0; + + TelSimSecPw_t pNewPinData; + pNewPinData.type = TAPI_SIM_PTYPE_PIN1; + pNewPinData.pw = (unsigned char*)g_si.pin1; + pNewPinData.pw_len = strlen(g_si.pin1); + + TET_CHECK(TAPI_API_INVALID_PTR, tel_change_sim_pins(NULL, &pNewPinData, &pRequestId)); + TET_STAMP_PASS(); + return; +} + +/** +* @brief tel_change_sim_pins() API : Negative condition(Second parameter is Null) +* @par ID: UTC_TEL_CHANGE_SIM_PINS_02 +* @param [in] PinType = TAPI_SIM_PTYPE_PIN1 +* @param [in] *pOldPinData = PIN1_NORMAL +* @param [in] *pNewPinData = NULL +* @param [out] &pRequestId +* @return TAPI_API_INVALID_PTR +*/ +void utc_tel_change_sim_pins_02() +{ + TET_STAMP_START("tel_change_sim_pins(),Null parameter check 2"); + TET_RESULT_NOT_EQUAL(TET_UNTESTED,gStartupSuccess, TRUE); + + int pRequestId=0; + + TelSimSecPw_t pOldPinData; + pOldPinData.type = TAPI_SIM_PTYPE_PIN1; + pOldPinData.pw = (unsigned char*)g_si.pin1; + pOldPinData.pw_len = strlen(g_si.pin1); + + TET_CHECK(TAPI_API_INVALID_PTR, tel_change_sim_pins(&pOldPinData,NULL,&pRequestId)); + TET_STAMP_PASS(); + return; +} + +/** +* @brief tel_change_sim_pins() API : Negative condition(Third parameter is Null) +* @par ID: UTC_TEL_CHANGE_SIM_PINS_03 +* @param [in] PinType = TAPI_SIM_PTYPE_PIN1 +* @param [in] *pOldPinData = PIN1_NORMAL +* @param [in] *pNewPinData = PIN1_CHANGED +* @param [out] NULL +* @return TAPI_API_INVALID_PTR +*/ +void utc_tel_change_sim_pins_03() +{ + TET_STAMP_START("tel_change_sim_pins(), Null parameter check3"); + TET_RESULT_NOT_EQUAL(TET_UNTESTED,gStartupSuccess, TRUE); + + TelSimSecPw_t pOldPinData; + TelSimSecPw_t pNewPinData; + + pOldPinData.type = TAPI_SIM_PTYPE_PIN1; + pOldPinData.pw_len = strlen(g_si.pin1); + pOldPinData.pw = (unsigned char*)malloc(pOldPinData.pw_len); + memcpy(pOldPinData.pw,g_si.pin1,pOldPinData.pw_len); + + pNewPinData.type = TAPI_SIM_PTYPE_PIN1; + pNewPinData.pw_len = strlen(g_si.pin1); + pNewPinData.pw = (unsigned char*)malloc(pNewPinData.pw_len); + memcpy(pNewPinData.pw,g_si.pin1,pNewPinData.pw_len); + + TET_CHECK(TAPI_API_INVALID_PTR, tel_change_sim_pins(&pOldPinData, &pNewPinData,NULL)); + TET_STAMP_PASS(); + return; +} + + +/** +* @brief tel_change_sim_pins() API : Low boundary test +* @par ID: UTC_TEL_CHANGE_SIM_PINS_04 +* @param [in] PinType = (TelSimPinType_t)TAPI_SIM_PTYPE_PIN1-1;//<-- Invalid pintype +* @param [in] *pOldPinData = PIN1_NORMAL +* @param [in] *pNewPinData = PIN1_CHANGED +* @param [out] &pRequestId +* @return TAPI_API_INVALID_INPUT +*/ +void utc_tel_change_sim_pins_04() +{ + TET_STAMP_START("invalid pin type 1"); + TET_RESULT_NOT_EQUAL(TET_UNTESTED,gStartupSuccess, TRUE); + + int pRequestId=0; + + TelSimSecPw_t pOldPinData; + TelSimSecPw_t pNewPinData; + + pOldPinData.type = TAPI_SIM_PTYPE_PIN1 -1; //INVALID PINTYPE + pOldPinData.pw_len = strlen(g_si.pin1); + pOldPinData.pw = (unsigned char*)malloc(pOldPinData.pw_len); + memcpy(pOldPinData.pw,g_si.pin1,pOldPinData.pw_len); + + pNewPinData.type = TAPI_SIM_PTYPE_PIN1 -1; //INVALID PINTYPE + pNewPinData.pw_len = strlen(g_si.pin1); + pNewPinData.pw = (unsigned char*)malloc(pNewPinData.pw_len); + memcpy(pNewPinData.pw,g_si.pin1,pNewPinData.pw_len); + + TET_CHECK(TAPI_API_INVALID_INPUT, tel_change_sim_pins (&pOldPinData, &pNewPinData,&pRequestId)); + TET_STAMP_PASS(); + return; +} + +/** +* @brief tel_change_sim_pins() API : Invalid pin type +* @par ID: UTC_TEL_CHANGE_SIM_PINS_05 +* @param [in] PinType = (TelSimPinType_t)TAPI_SIM_PTYPE_SIM+1;//<-- Invalid pintype +* @param [in] *pOldPinData = PIN2_NORMAL +* @param [in] *pNewPinData = PIN2_CHANGED +* @param [out] &pRequestId +* @return TAPI_API_SUCCESS +*/ +void utc_tel_change_sim_pins_05() +{ + TET_STAMP_START("Invalid pin type "); + TET_RESULT_NOT_EQUAL(TET_UNTESTED,gStartupSuccess, TRUE); + + int pRequestId=0; + + TelSimSecPw_t pOldPinData; + TelSimSecPw_t pNewPinData; + + pOldPinData.type = TAPI_SIM_PTYPE_SIM +1; //INVALID PINTYPE + pOldPinData.pw_len = strlen(g_si.pin1); + pOldPinData.pw = (unsigned char*)malloc(pOldPinData.pw_len); + memcpy(pOldPinData.pw,g_si.pin1,pOldPinData.pw_len); + + pNewPinData.type = TAPI_SIM_PTYPE_SIM +1; //INVALID PINTYPE + pNewPinData.pw_len = strlen(g_si.pin1); + pNewPinData.pw = (unsigned char*)malloc(pNewPinData.pw_len); + memcpy(pNewPinData.pw,g_si.pin1,pNewPinData.pw_len); + + TET_CHECK(TAPI_API_INVALID_INPUT,tel_change_sim_pins (&pOldPinData, &pNewPinData,&pRequestId)); + TET_STAMP_PASS(); + return; +} + +/** +* @brief tel_change_sim_pins() API : Positive condition(Change Pin1 coce) +* @par ID: UTC_TEL_CHANGE_SIM_PINS_06 +* @param [in] PinType = TAPI_SIM_PTYPE_PIN1 +* @param [in] *pOldPinData = PIN1_NORMAL +* @param [in] *pNewPinData = PIN1_CHANGED +* @param [out] &pRequestId +* @return TAPI_API_SUCCESS +* @par Async Response Message: +* The event received is below and the event data is #TelSimPinInfo_t. \n +* (Asynchronous return status is indicated by #TelSimPinOperationResult_t.) +* - TAPI_EVENT_SIM_CHANGE_PIN_CNF (TAPI_SIM_PIN_OPERATION_SUCCESS) +*/ +void utc_tel_change_sim_pins_06() +{ + TET_STAMP_START("Change pin1 code successfully : Before test, you set correct PIN1_NORMAL value on 'tet_tapi_util.h'"); + TET_RESULT_NOT_EQUAL(TET_UNTESTED,gStartupSuccess, TRUE); + + int tapiRet = TAPI_API_SUCCESS; + int pRequestId=0; + + // Step 1 : enable pin + tet_printf("Step 1 : enable pin"); + + if( 0 != sim_pin_process_for_condition(TAPI_SIM_PTYPE_PIN1,TAPI_SIM_PIN_STATUS_ENABLED)) + { + tet_printf("condition set is failed!!"); + return; + } + + // Step 2 : now change chv + tet_printf("Step 2 : now change chv"); + TelSimSecPw_t pOldPinData; + TelSimSecPw_t pNewPinData; + pOldPinData.type = TAPI_SIM_PTYPE_PIN1; + pOldPinData.pw_len = strlen(g_si.pin1); + pOldPinData.pw = (unsigned char*)malloc(pOldPinData.pw_len); + memcpy(pOldPinData.pw,g_si.pin1,pOldPinData.pw_len); + + pNewPinData.type = TAPI_SIM_PTYPE_PIN1; + pNewPinData.pw_len = strlen(g_si.pin1); + pNewPinData.pw = (unsigned char*)malloc(pNewPinData.pw_len); + memcpy(pNewPinData.pw,g_si.pin1,pNewPinData.pw_len); + + tapiRet = tel_change_sim_pins(&pOldPinData, &pNewPinData,&pRequestId); + TET_RESULT_NOT_EQUAL_GOTO(TET_FAIL,exit,TAPI_API_SUCCESS,tapiRet); + + tet_printf("after real tc api - wait start"); + + G_MAIN_LOOP_RUN(3); + + tet_printf("after real tc api - wait stop"); + + + TET_RESULT_NOT_EQUAL_GOTO(TET_FAIL,exit,gAsyncResult,TRUE); // If gAsyncResult != FALSE, then TET_FAIL and return + TET_RESULT_NOT_EQUAL_GOTO(TET_FAIL,exit,TAPI_SIM_PIN_OPERATION_SUCCESS, gSimEventStatus); // If gSimEventStatus != TAPI_SIM_PIN_INCORRECT_PASSWORD, then TET_FAIL and return + TET_STAMP_PASS(); + +exit: + // Step 3 : make default condition + tet_printf("Step 3 : disable pin"); + + if( 0 != sim_pin_process_for_condition(TAPI_SIM_PTYPE_PIN1,TAPI_SIM_PIN_STATUS_DISABLED)) + { + tet_printf("condition set is failed!!"); + } + return; +} + + +/** +* @brief tel_change_sim_pins() API : Negative condition(Incorrect pin code) +* @par ID: UTC_TEL_CHANGE_SIM_PINS_07 +* @param [in] PinType = TAPI_SIM_PTYPE_PIN1 +* @param [in] *pOldPinData = PIN1_INCORRECT +* @param [in] *pNewPinData = PIN1_CHANGED +* @param [out] &pRequestId +* @return TAPI_API_SUCCESS +* @par Async Response Message: +* The event received is below and the event data is #TelSimPinInfo_t. \n +* (Asynchronous return status is indicated by #TelSimPinOperationResult_t.) +* - TAPI_EVENT_SIM_CHANGE_PIN_CNF (TAPI_SIM_PIN_INCORRECT_PASSWORD) +*/ +void utc_tel_change_sim_pins_07() +{ + TET_STAMP_START("Change pin1 code Fail : Before test, you set incorrect PIN1_INCORRECT value on 'tet_tapi_util.h'"); + TET_RESULT_NOT_EQUAL(TET_UNTESTED,gStartupSuccess, TRUE); + + int tapiRet = TAPI_API_SUCCESS; + int pRequestId=0; + + // Step 1 : make proper condition + tet_printf("Step 1 : enable pin"); + + if( 0 != sim_pin_process_for_condition(TAPI_SIM_PTYPE_PIN1,TAPI_SIM_PIN_STATUS_ENABLED)) + { + tet_printf("condition set is failed!!"); + return; + } + + // Step 2 : now change chv + tet_printf("Step 2 : now change chv"); + TelSimSecPw_t pInvalidPinData; + TelSimSecPw_t pNewPinData; + pInvalidPinData.type = TAPI_SIM_PTYPE_PIN1; + pInvalidPinData.pw_len = strlen(g_si.wpin1); + pInvalidPinData.pw = (unsigned char*)malloc(pInvalidPinData.pw_len); + memcpy(pInvalidPinData.pw,g_si.wpin1,pInvalidPinData.pw_len); + + pNewPinData.type = TAPI_SIM_PTYPE_PIN1; + pNewPinData.pw_len = strlen(g_si.wpin1); + pNewPinData.pw = (unsigned char*)malloc(pNewPinData.pw_len); + memcpy(pNewPinData.pw,g_si.wpin1,pNewPinData.pw_len); + + gAsyncResult = FALSE; + + tapiRet = tel_change_sim_pins(&pInvalidPinData, &pNewPinData,&pRequestId); + TET_RESULT_NOT_EQUAL_GOTO(TET_FAIL,exit,TAPI_API_SUCCESS,tapiRet); + + tet_printf("after real tc api - wait start"); + + G_MAIN_LOOP_RUN(3); + + tet_printf("after real tc api - wait stop"); + + + TET_RESULT_NOT_EQUAL_GOTO(TET_FAIL,exit,gAsyncResult,TRUE); // If gAsyncResult != FALSE, then TET_FAIL and return + TET_RESULT_NOT_EQUAL_GOTO(TET_FAIL,exit,TAPI_SIM_PIN_INCORRECT_PASSWORD, gSimEventStatus); // If gSimEventStatus != TAPI_SIM_PIN_INCORRECT_PASSWORD, then TET_FAIL and return + TET_STAMP_PASS(); + +exit: + // Step 3 : make default condition + tet_printf("Step 3 : disable pin"); + + if( 0 != sim_pin_process_for_condition(TAPI_SIM_PTYPE_PIN1,TAPI_SIM_PIN_STATUS_DISABLED)) + { + tet_printf("condition set is failed!!"); + } + return; +} + + +/** +* @brief tel_change_sim_pins() API : Negative condition(Disable pin and try to change pin1 code) +* @par ID: UTC_TEL_CHANGE_SIM_PINS_08 +* @pre +* If PIN Enable, try to diable PIN. \n +* (At the test function 'utc_tel_change_sim_pins_08()' check and disable PIN1 function is coded) +* @param [in] PinType = TAPI_SIM_PTYPE_PIN1 +* @param [in] *pOldPinData = PIN1_NORMAL +* @param [in] *pNewPinData = PIN1_CHANGED +* @param [out] &pRequestId +* @return TAPI_API_INVALID_OPERATION +*/ +void utc_tel_change_sim_pins_08() +{ + TET_STAMP_START("Disable pin and try to change"); + TET_RESULT_NOT_EQUAL(TET_UNTESTED,gStartupSuccess, TRUE); + + int pRequestId=0; + + // Step 1 : make proper condition + tet_printf("Step 1 : enable pin"); + + if( 0 != sim_pin_process_for_condition(TAPI_SIM_PTYPE_PIN1,TAPI_SIM_PIN_STATUS_DISABLED)) + { + tet_printf("condition set is failed!!"); + return; + } + + // Step 2 : now change chv + tet_printf("Step 2 : now change chv"); + TelSimSecPw_t pOldPinData; + TelSimSecPw_t pNewPinData; + pOldPinData.type = TAPI_SIM_PTYPE_PIN1; + pOldPinData.pw_len = strlen(g_si.pin1); + pOldPinData.pw = (unsigned char*)malloc(pOldPinData.pw_len); + memcpy(pOldPinData.pw,g_si.pin1,pOldPinData.pw_len); + + pNewPinData.type = TAPI_SIM_PTYPE_PIN1; + pNewPinData.pw_len = strlen(g_si.pin1); + pNewPinData.pw = (unsigned char*)malloc(pNewPinData.pw_len); + memcpy(pNewPinData.pw,g_si.pin1,pNewPinData.pw_len); + + TET_CHECK(TAPI_API_INVALID_OPERATION,tel_change_sim_pins(&pOldPinData, &pNewPinData,&pRequestId)); + TET_STAMP_PASS(); + return; +} + +/** @} */ diff --git a/TC/telephony_TC/sim/unit/uts_tel_change_sim_pins.h b/TC/telephony_TC/sim/unit/uts_tel_change_sim_pins.h new file mode 100644 index 0000000..4df7873 --- /dev/null +++ b/TC/telephony_TC/sim/unit/uts_tel_change_sim_pins.h @@ -0,0 +1,33 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * 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 _UTS_TEL_CHANGE_SIM_PINS_H_ +#define _UTS_TEL_CHANGE_SIM_PINS_H_ + + static void utc_tel_change_sim_pins_01(); + static void utc_tel_change_sim_pins_02(); + static void utc_tel_change_sim_pins_03(); + static void utc_tel_change_sim_pins_04(); + static void utc_tel_change_sim_pins_05(); + static void utc_tel_change_sim_pins_06(); + static void utc_tel_change_sim_pins_07(); + static void utc_tel_change_sim_pins_08(); +#endif diff --git a/TC/telephony_TC/sim/unit/uts_tel_delete_sim_pb_record.c b/TC/telephony_TC/sim/unit/uts_tel_delete_sim_pb_record.c new file mode 100644 index 0000000..fc416e8 --- /dev/null +++ b/TC/telephony_TC/sim/unit/uts_tel_delete_sim_pb_record.c @@ -0,0 +1,463 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +/** +* @ingroup TELEPHONY_API +* @addtogroup TAPI_API_SIM_SAT SIM/SAT +*/ + +/** +* @ingroup TAPI_API_SIM_SAT +* @addtogroup UTS_SIM_SAT Unit +*/ + +/** +* @ingroup UTS_SIM_SAT +* @addtogroup UTS_TAPI_SIM_PB_DELETE_RECORD tel_delete_sim_pb_record +* +* @brief Unit test code for tel_delete_sim_pb_record() +* @par Test function Prototype: +* TapiResult_t tel_delete_sim_pb_record(TelSimPbFileType_t StorageFileType, unsigned short RecordIndex, int* pRequestId); +* @par Test function description: +* This API is used to delete a SIM phone book record. +* @par Important Notes: +* The index ranges from 1 through to a maximum of 254 for a Linear fixed file and 255 for a cyclic file. +* @param [in] StorageFileType Different storage types to be selected in SIM. +* @param [in] RecordIndex Index of the record to be deleted. +* @param [out] pRequestId Unique identifier for a particular request. +* - request_id value can be any value from 0 to 255 if the API is returned successfully +* - -1 (INVALID_REQUEST_ID) will be sent in case of failure. +* @par Async Response Message: +* The event associated is below and the event data is #TelSimPbUpdateResp_t. \n +* (Asynchronous return status is indicated by #TelSimPinOperationResult_t.) +* - TAPI_EVENT_SIM_PB_DELETE_CNF +* - TAPI_EVENT_SIM_PB_ACCESS_READ_CNF +* @pre +* - Phonebook supported SIM used for test +* - SIM Phonebook data backup is required(After test, some phonebook record is deleted) +* @post +* - Restore SIM phonebook data +* @return +* Return Type : (TapiResult_t) +* - TAPI_API_SUCCESS - indicating that the operation has completed successfully. +* - Otherwise it provides an error code (Refer #TapiResult_t) +* @{ +*/ + +/** +* @file uts_tel_delete_sim_pb_record.c +* @brief Test for the tel_delete_sim_pb_record() API that is used to access for delete a SIM phonebook record +* @author +* @version Initial Creation V0.1 +* @date 2008.07.30 +*/ + +#include +#include +#include + +#include "tet_tapi_util.h" +#include "uts_tel_delete_sim_pb_record.h" +#include "sim_common.h" + + +/* Initialize TCM data structures */ +static void startup(); +static void cleanup(); +void (*tet_startup) () = startup; +void (*tet_cleanup) () = cleanup; +struct tet_testlist tet_testlist[] = { + {utc_tel_delete_sim_pb_record_01, 1}, + {utc_tel_delete_sim_pb_record_02, 2}, + {utc_tel_delete_sim_pb_record_03, 3}, + {utc_tel_delete_sim_pb_record_04, 4}, + {utc_tel_delete_sim_pb_record_05, 5}, + {utc_tel_delete_sim_pb_record_06, 6}, + {utc_tel_delete_sim_pb_record_07, 7}, + {utc_tel_delete_sim_pb_record_08, 8}, + {NULL, 0} +}; + + + +/* + G_MAIN Utility //////////////////////////////////////////////////////////////////////////// +*/ +// Prototype : User must add function body +gboolean g_timeout_callback (void *data); + +// GMainLoop global handler +GMainLoop *nw_context_loop = NULL; + +void G_MAIN_LOOP_CLOSE() +{ + g_main_loop_quit(nw_context_loop); +} + +int G_MAIN_LOOP_RUN(int sec) +{ + //GMainLoop *mainloop; + nw_context_loop = g_main_loop_new (NULL, FALSE); + g_timeout_add ( (sec * 1000), g_timeout_callback, NULL); + g_main_loop_run (nw_context_loop); + + return 0; +} +// End of G_MAIN Utility////////////////////////////////////////////////////////////////////// + + +/* + User Defined Handler +*/ +// Global variable for user data +static BOOL gAsyncResult; //user defined data : Async callback is called or not + +// G_MAIN Utility : time out callback function +gboolean g_timeout_callback (void *data) +{ + gAsyncResult = FALSE; + tet_printf("[SIM APP][TIME OUT] g_timeout called .Close g_main_roop()"); + G_MAIN_LOOP_CLOSE(); + return FALSE; +} + + +static int sim_app_callback (TelTapiEvent_t *sim_event) +{ + tet_printf("\n\n\n***************[SIM APP]Callback data **********************\n"); + tet_printf("[SIM APP]Reques Id[%d]\n", sim_event->RequestId); + tet_printf("[SIM APP]event status [%d]\n", sim_event->Status); + + gAsyncResult = FALSE; + BOOL bReceived = FALSE; + + switch(sim_event->EventType) + { + case TAPI_EVENT_SIM_PB_ACCESS_READ_CNF: + { + tet_printf("[SIM APP]*****************TAPI_EVENT_SIM_PB_ACCESS_READ_CNF***************************"); + tet_printf("[SIM APP]SIM PB access read event status = [%x]", sim_event->Status); + + TelSimPbRecordData_t *sim_acces_info = (TelSimPbRecordData_t*)sim_event->pData; + tet_printf("[SIM APP]storaget type is [%x]",sim_acces_info->StorageFileType); + tet_printf(" SIM phone book access error [%d]", sim_event->Status); + tet_printf("********************************************"); + gAsyncResult = TRUE; + bReceived = TRUE; + } + break; + + case TAPI_EVENT_SIM_PB_DELETE_CNF: + { + tet_printf("[SIM APP]*****************TAPI_EVENT_SIM_PB_DELETE_CNF***************************"); + tet_printf("SIM Delete PB event status = [%x]", sim_event->Status); + + // TelSimPbUpdateResp_t *pDeleteResp = (TelSimPbUpdateResp_t*)sim_event->pData; + // tet_printf(" Storage File Type [%d]", pDeleteResp->PbStorageInfo.StorageFileType); + // tet_printf(" Storage File Index [%d]", pDeleteResp->PbIndex); + tet_printf("*******************************************"); + gAsyncResult = TRUE; + bReceived = TRUE; + } + break; + + default: + { + bReceived = TRUE; + gAsyncResult = FALSE; + tet_printf("Info : TAPI_EVENT_SIM_PB_DELETE_CNF = %d", TAPI_EVENT_SIM_PB_DELETE_CNF); + tet_printf("[SIM APP]***************** Undhandled event type [%d] *****************\n",sim_event->EventType); + tet_printf("[SIM APP]Undhandled event state [%d]\n",sim_event->Status); + break; + } + }//end switch + + if (bReceived == TRUE) + G_MAIN_LOOP_CLOSE(); + + return 0; +} + +/* Startup & Clean function : It is not test code, only for + initialize and finalize test module +*/ +static BOOL gStartupSuccess = FALSE; +static unsigned int subscription_id = 0; + +static void startup() +{ + tet_infoline("utc_tel_read_sim_pb_record Test Start"); + if ( tel_init() == TAPI_API_SUCCESS) + { + if (TAPI_API_SUCCESS == tel_register_event(TAPI_EVENT_SIM_PB_DELETE_CNF,&subscription_id,(TelAppCallback)sim_app_callback,NULL) ) + gStartupSuccess = TRUE; + else + tet_infoline("startup fail. tel_register_event() failed"); + } else { + tet_infoline("startup fail. tel_init() failed"); + } + tel_register_app_name("org.samsung.test"); + return; +} + + +static void cleanup() +{ + tet_infoline("utc_tel_read_sim_pb_record Finished"); + + if (gStartupSuccess == TRUE) + { + tel_deregister_event(subscription_id); + } + tel_deinit(); + return; +} + + +/* + Unit Test Case functions +*/ +/** +* @brief tel_delete_sim_pb_record() API : Negative condition(Low boundary test) +* @par ID: UTC_TEL_DELETE_SIM_PB_RECORD_01 +* @param [in] StorageFileType = (TelSimPbFileType_t)TAPI_SIM_PB_FDN-1; +* @param [in] Index = 1 +* @param [out] &pRequestId +* @return TAPI_API_INVALID_INPUT +*/ +void utc_tel_delete_sim_pb_record_01() +{ + TET_STAMP_START("TAPI_API_INVALID_INPUT test 1"); + TelSimPbFileType_t StorageFileType = (TelSimPbFileType_t)TAPI_SIM_PB_FDN-1; + unsigned short Index=1; + int pRequestId=0; + + TET_CHECK(TAPI_API_INVALID_INPUT, tel_delete_sim_pb_record(StorageFileType,Index,&pRequestId)); + TET_STAMP_PASS(); + return; +} + +/** +* @brief tel_delete_sim_pb_record() API : Negative condition(Upper boundary test) +* @par ID: UTC_TEL_DELETE_SIM_PB_RECORD_02 +* @param [in] StorageFileType = (TelSimPbFileType_t)TAPI_SIM_PB_UNKNOWNN+1; +* @param [in] Index = 1 +* @param [out] &pRequestId +* @return TAPI_API_INVALID_INPUT +*/ +void utc_tel_delete_sim_pb_record_02() +{ + TET_STAMP_START("TAPI_API_INVALID_INPUT test 2"); + TelSimPbFileType_t StorageFileType = (TelSimPbFileType_t)TAPI_SIM_PB_UNKNOWNN+1; + unsigned short Index=1; + int pRequestId=0; + + TET_CHECK(TAPI_API_INVALID_INPUT, tel_delete_sim_pb_record(StorageFileType,Index,&pRequestId)); + TET_STAMP_PASS(); + return; +} + + +/** +* @brief tel_delete_sim_pb_record() API : Negative condition(NULL parameter) +* @par ID: UTC_TEL_DELETE_SIM_PB_RECORD_03 +* @param [in] StorageFileType = TAPI_SIM_PB_FDN +* @param [in] Index = 1 +* @param [out] &pRequestId = NULL +* @return TAPI_API_INVALID_PTR +*/ +void utc_tel_delete_sim_pb_record_03() +{ + TET_STAMP_START("TAPI_API_INVALID_INPUT test 3"); + TelSimPbFileType_t StorageFileType = TAPI_SIM_PB_FDN; + unsigned short Index=1; + + TET_CHECK(TAPI_API_INVALID_PTR, tel_delete_sim_pb_record(StorageFileType,Index,NULL)); //<-------------------- Invalid value + TET_STAMP_PASS(); + return; +} + + +/** +* @brief tel_delete_sim_pb_record() API : Positive condition(Delete for a Phonebook FDN record) +* @par ID: UTC_TEL_DELETE_SIM_PB_RECORD_04 +* @param [in] StorageFileType = TAPI_SIM_PB_FDN +* @param [in] Index = 1 +* @param [out] &pRequestId +* @return TAPI_API_SUCCESS +* @par Async Response Message: +* The event associated is below and the event data is #TelSimPbUpdateResp_t. \n +* - TAPI_EVENT_SIM_PB_DELETE_CNF +*/ +void utc_tel_delete_sim_pb_record_04() +{ + TET_STAMP_START("StorageFileType=TAPI_SIM_PB_FDN"); + TET_RESULT_NOT_EQUAL(TET_UNTESTED,gStartupSuccess, TRUE); + TapiResult_t ret; + TelSimPbFileType_t StorageFileType=TAPI_SIM_PB_FDN; + unsigned short Index = 1; + int pRequestId=0; + + gAsyncResult =FALSE; + + ret = tel_delete_sim_pb_record(StorageFileType,Index,&pRequestId); + + G_MAIN_LOOP_RUN(2); + + TET_RESULT_NOT_EQUAL(TET_FAIL,gAsyncResult,TRUE); // If gAsyncResult != TRUE, then TET_FAIL and return + TET_STAMP_PASS(); + return; +} + + +/** +* @brief tel_delete_sim_pb_record() API : Positive condition(Delete for a Phonebook LDN record) +* @par ID: UTC_TEL_DELETE_SIM_PB_RECORD_05 +* @param [in] StorageFileType = TAPI_SIM_PB_LDN +* @param [in] Index = 1 +* @param [out] &pRequestId +* @return TAPI_API_SUCCESS +* @par Async Response Message: +* The event associated is below and the event data is #TelSimPbUpdateResp_t. \n +* - TAPI_EVENT_SIM_PB_DELETE_CNF +*/ +void utc_tel_delete_sim_pb_record_05() +{ + TET_STAMP_START("StorageFileType=TAPI_SIM_PB_LDN"); + TET_RESULT_NOT_EQUAL(TET_UNTESTED,gStartupSuccess, TRUE); + + TelSimPbFileType_t StorageFileType=TAPI_SIM_PB_LDN; + unsigned short Index = 1; + int pRequestId=0; + TapiResult_t ret; + + gAsyncResult =FALSE; + + ret = tel_delete_sim_pb_record(StorageFileType,Index,&pRequestId); + + G_MAIN_LOOP_RUN(2); + + TET_RESULT_NOT_EQUAL(TET_FAIL,gAsyncResult,TRUE); // If gAsyncResult != TRUE, then TET_FAIL and return + TET_STAMP_PASS(); + return; +} + + + +/** +* @brief tel_delete_sim_pb_record() API : Positive condition(Delete for a Phonebook MSISDN record) +* @par ID: UTC_TEL_DELETE_SIM_PB_RECORD_06 +* @param [in] StorageFileType = TAPI_SIM_PB_MSISDN +* @param [in] Index = 1 +* @param [out] &pRequestId +* @return TAPI_API_SUCCESS +* @par Async Response Message: +* The event associated is below and the event data is #TelSimPbUpdateResp_t. \n +* - TAPI_EVENT_SIM_PB_DELETE_CNF +*/ +void utc_tel_delete_sim_pb_record_06() +{ + TET_STAMP_START("StorageFileType=TAPI_SIM_PB_MSISDN"); + TET_RESULT_NOT_EQUAL(TET_UNTESTED,gStartupSuccess, TRUE); + + TelSimPbFileType_t StorageFileType=TAPI_SIM_PB_MSISDN; + unsigned short Index = 1; + int pRequestId=0; + TapiResult_t ret; + + gAsyncResult =FALSE; + + ret = tel_delete_sim_pb_record(StorageFileType,Index,&pRequestId); + + G_MAIN_LOOP_RUN(2); + + TET_RESULT_NOT_EQUAL(TET_FAIL,gAsyncResult,TRUE); // If gAsyncResult != TRUE, then TET_FAIL and return + TET_STAMP_PASS(); + return; +} + + +/** +* @brief tel_delete_sim_pb_record() API : Positive condition(Delete for a Phonebook ADN record) +* @par ID: UTC_TEL_DELETE_SIM_PB_RECORD_07 +* @param [in] StorageFileType = TAPI_SIM_PB_ADN +* @param [in] Index = 1 +* @param [out] &pRequestId +* @return TAPI_API_SUCCESS +* @par Async Response Message: +* The event associated is below and the event data is #TelSimPbUpdateResp_t. \n +* - TAPI_EVENT_SIM_PB_DELETE_CNF +*/ +void utc_tel_delete_sim_pb_record_07() +{ + TET_STAMP_START("StorageFileType=TAPI_SIM_PB_ADN"); + TET_RESULT_NOT_EQUAL(TET_UNTESTED,gStartupSuccess, TRUE); + + TelSimPbFileType_t StorageFileType=TAPI_SIM_PB_ADN; + unsigned short Index = 1; + int pRequestId=0; + TapiResult_t ret; + + gAsyncResult =FALSE; + + ret = tel_delete_sim_pb_record(StorageFileType,Index,&pRequestId); + + G_MAIN_LOOP_RUN(2); + + TET_RESULT_NOT_EQUAL(TET_FAIL,gAsyncResult,TRUE); // If gAsyncResult != TRUE, then TET_FAIL and return + TET_STAMP_PASS(); + return; +} + + +/** +* @brief tel_delete_sim_pb_record() API : Positive condition(Delete for a Phonebook SDN record) +* @par ID: UTC_TEL_DELETE_SIM_PB_RECORD_08 +* @param [in] StorageFileType = TAPI_SIM_PB_SDN +* @param [in] Index = 1 +* @param [out] &pRequestId +* @return TAPI_API_SUCCESS +* @par Async Response Message: +* The event associated is below and the event data is #TelSimPbUpdateResp_t. \n +* - TAPI_EVENT_SIM_PB_DELETE_CNF +*/ +void utc_tel_delete_sim_pb_record_08() +{ + TET_STAMP_START("StorageFileType=TAPI_SIM_PB_SDN"); + TET_RESULT_NOT_EQUAL(TET_UNTESTED,gStartupSuccess, TRUE); + + TelSimPbFileType_t StorageFileType=TAPI_SIM_PB_SDN; + unsigned short Index = 1; + int pRequestId=0; + TapiResult_t ret; + + gAsyncResult =FALSE; + + ret = tel_delete_sim_pb_record(StorageFileType,Index,&pRequestId); + + G_MAIN_LOOP_RUN(2); + + TET_RESULT_NOT_EQUAL(TET_FAIL,gAsyncResult,TRUE); // If gAsyncResult != TRUE, then TET_FAIL and return + TET_STAMP_PASS(); + return; +} + +/** @} */ diff --git a/TC/telephony_TC/sim/unit/uts_tel_delete_sim_pb_record.h b/TC/telephony_TC/sim/unit/uts_tel_delete_sim_pb_record.h new file mode 100644 index 0000000..3f09769 --- /dev/null +++ b/TC/telephony_TC/sim/unit/uts_tel_delete_sim_pb_record.h @@ -0,0 +1,33 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * 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 _UTS_TEL_DELETE_SIM_PB_RECORD_H_ +#define _UTS_TEL_DELETE_SIM_PB_RECORD_H_ + + static void utc_tel_delete_sim_pb_record_01 (); + static void utc_tel_delete_sim_pb_record_02 (); + static void utc_tel_delete_sim_pb_record_03 (); + static void utc_tel_delete_sim_pb_record_04 (); + static void utc_tel_delete_sim_pb_record_05 (); + static void utc_tel_delete_sim_pb_record_06 (); + static void utc_tel_delete_sim_pb_record_07 (); + static void utc_tel_delete_sim_pb_record_08 (); +#endif diff --git a/TC/telephony_TC/sim/unit/uts_tel_disable_sim_fdn.c b/TC/telephony_TC/sim/unit/uts_tel_disable_sim_fdn.c new file mode 100644 index 0000000..53d5937 --- /dev/null +++ b/TC/telephony_TC/sim/unit/uts_tel_disable_sim_fdn.c @@ -0,0 +1,460 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +/** +* @ingroup TELEPHONY_API +* @addtogroup TAPI_API_SIM_SAT SIM/SAT +*/ + +/** +* @ingroup TAPI_API_SIM_SAT +* @addtogroup UTS_SIM_SAT Unit +*/ + +/** +* @ingroup UTS_SIM_SAT +* @addtogroup UTS_TAPI_SIM_DISABLE_FDN tel_disable_sim_fdn +* +* @brief Unit test code for tel_disable_sim_fdn() +* @par Test function Prototype: +* TapiResult_t tel_disable_sim_fdn (const char* pPinData, int *pRequestId); +* @par Test function description: +* This function is used to disable FDN mode +* @par Important Notes: + * An unsolicited event TAPI_EVENT_SIM_FDN_STATUS_IND is notified to indicate + * whenever FDN status is changed(disabled/enabled) +* @param [in] pPinData +* User entered PIN2 data. (NULL terminated string) +* @param [out] pRequestId +* - Unique identifier for a particular request. +* - request_id value can be any value from 0 to 255 if the API is returned successfully +* - -1 (INVALID_REQUEST_ID) will be sent in case of failure. +* @par Async Response Message: +* The event associated is below and the event data is #TelSimPinInfo_t. \n +* (Asynchronous return status is indicated by #TelSimPinOperationResult_t.) +* - TAPI_EVENT_SIM_DISABLE_FDN_CNF +* - TAPI_EVENT_SIM_ENABLE_FDN_CNF +* - TAPI_EVENT_SIM_FDN_STATUS_IND +* @pre +* - Before test script compile, you set correct PIN1_NORMAL, PIN2_NORMAL, PIN1_CHANGED, PIN2_CHANGED value on 'tet_tapi_util.h' +* - Before test script compile, you set incorrect PIN1_INCORRECT value on 'tet_tapi_util.h' +* @post +* None +* @return +* Return Type : (TapiResult_t) +* - TAPI_API_SUCCESS - indicating that the operation has completed successfully. +* - Otherwise it provides an error code (Refer #TapiResult_t) +* @{ +*/ + +/** +* @file uts_tel_disable_sim_fdn.c +* @brief Test for the tel_disable_sim_fdn() API that is used to disable FDN mode +* @author +* @version Initial Creation V0.1 +* @date 2008.07.30 +*/ + +#include +#include +#include + +#include "tet_tapi_util.h" +#include "uts_tel_disable_sim_fdn.h" +#include "sim_common.h" +#include "async_util.h" + + +/* Initialize TCM data structures */ +static void startup(); +static void cleanup(); +void (*tet_startup) () = startup; +void (*tet_cleanup) () = cleanup; +struct tet_testlist tet_testlist[] = { + {utc_tel_disable_sim_fdn_01, 1}, + {utc_tel_disable_sim_fdn_02, 2}, + {utc_tel_disable_sim_fdn_03, 3}, + {utc_tel_disable_sim_fdn_04, 4}, + + {NULL, 0} +}; + + +/* + User Defined Handler +*/ +// Global variable for user data +static BOOL gAsyncResult; //user defined data : Async callback is called or not +static TelSimPinOperationResult_t gSimEventStatus; + +/* Startup & Clean function : It is not test code, only for + initialize and finalize test module +*/ +static BOOL gStartupSuccess = FALSE; +static unsigned int subscription_id = 0; + +extern sim_info_t g_si; + + +/* + G_MAIN Utility //////////////////////////////////////////////////////////////////////////// +*/ +// Prototype : User must add function body +gboolean g_timeout_callback (void *data); + +// GMainLoop global handler +GMainLoop *sim_loop = NULL; + +void G_MAIN_LOOP_CLOSE() +{ + g_main_loop_quit(sim_loop); +} + +int G_MAIN_LOOP_RUN(int sec) +{ + sim_loop = g_main_loop_new (NULL, FALSE); + g_timeout_add ( (sec * 1000), g_timeout_callback, NULL); + g_main_loop_run (sim_loop); + return 0; +} + +gboolean g_timeout_callback (void *data) +{ + gAsyncResult = FALSE; + tet_printf("[TIME OUT] g_timeout called .Close g_main_roop()"); + G_MAIN_LOOP_CLOSE(); + return FALSE; +} +// End of G_MAIN Utility////////////////////////////////////////////////////////////////////// + + +static int sim_fdn_process_for_condition(int wish_condition) +{ + int pRequestId=0; + int tapiRet = TAPI_API_SUCCESS; + int fdn_status = 0; //dis(0)/enable(1) + int pin2_len = 0; + char* pin2 = NULL; + + tet_printf("wish_condition[%d]: 0-dis, 1- enabled",wish_condition); + + tapiRet = tel_get_sim_fdn_status(&fdn_status); + if(tapiRet != TAPI_API_SUCCESS) + { + tet_printf("tel_get_sim_fdn_status is Failed with tapiRet[%d]", tapiRet); + return -1; + } + + if(fdn_status == 0 ) + { + tet_printf("current fdn status is disable"); + } + else if(fdn_status == 1) + { + tet_printf("current fdn status is enable"); + } + else + { + tet_printf("current fdn status is unhandled status[%d]",fdn_status ); + return -1; + } + + if(fdn_status == wish_condition ) + { + tet_printf("current fdn status is same with wished condition"); + return 0; + } + else + { + tet_printf("current fdn status is different with wished condition"); + + pin2_len = strlen(g_si.pin2); + pin2 = (char*)malloc(pin2_len); + memcpy(pin2,g_si.pin2,pin2_len); + + gAsyncResult = FALSE; + + if(wish_condition == 0) + { + tet_printf("make fdn status with wished condition - disable"); + + tapiRet = tel_disable_sim_fdn((const unsigned char*)pin2,&pin2_len,&pRequestId); + } + else if(wish_condition == 1) + { + tet_printf("make fdn status with wished condition - enable"); + tapiRet = tel_enable_sim_fdn((const unsigned char*)pin2,&pin2_len,&pRequestId); + } + else + { + tet_printf("Unhandled wish_condition[%d]", wish_condition); + return -1; + } + + if(tapiRet != TAPI_API_SUCCESS) + { + tet_printf("tapi return[%d] when en/disabling fdn for condition",tapiRet); + return -1; + } + else + { + tet_printf("after pre/post condition tc api - wait start"); + G_MAIN_LOOP_RUN(2); + tet_printf("after pre/post condition tc api - wait stop"); + } + + if(gAsyncResult == TRUE) + return 0; + else + return -1; + } + return 0; +} + + +static int sim_app_callback (TelTapiEvent_t *sim_event) +{ + tet_printf("\n\n\n***************[SIM APP]Callback data **********************\n"); + tet_printf("[SIM APP]Reques Id[%d]\n", sim_event->RequestId); + tet_printf("[SIM APP]event status [%d]\n", sim_event->Status); + + gAsyncResult = FALSE; + BOOL bReceived = FALSE; + + switch(sim_event->EventType) + { + case TAPI_EVENT_SIM_ENABLE_FDNMODE_CNF: + { + tet_printf("\n[SIM APP]*****************TAPI_EVENT_SIM_ENABLE_FDNMODE_CNF (%d) ***************************\n", TAPI_EVENT_SIM_ENABLE_FDNMODE_CNF); + tet_printf("SIM Enable FDN event status = [%x]\n", sim_event->Status); + + gSimEventStatus = sim_event->Status; + gAsyncResult = TRUE; + bReceived = TRUE; + } + break; + + case TAPI_EVENT_SIM_DISABLE_FDNMODE_CNF: + { + tet_printf("\n[SIM APP]*****************TAPI_EVENT_SIM_DISABLE_FDNMODE_CNF (%d) ***************************\n", TAPI_EVENT_SIM_DISABLE_FDNMODE_CNF); + tet_printf("SIM Disable FDN event status = [%x]\n", sim_event->Status); + + gSimEventStatus = sim_event->Status; + gAsyncResult = TRUE; + bReceived = TRUE; + } + break; + + default: + { + gSimEventStatus = sim_event->Status; + gAsyncResult = FALSE; + tet_printf("[SIM APP]***************** Undhandled event type [%d] *****************\n",sim_event->EventType); + tet_printf("[SIM APP]Undhandled event state [%d]\n",sim_event->Status); + break; + } + }//end switch + + if (bReceived == TRUE) + G_MAIN_LOOP_CLOSE(); + return 0; +} + +static void startup() +{ + tet_infoline("utc_tel_disable_sim_fdn Test Start\n"); + + sim_pin_info_setup(); + + if ( tel_init() == TAPI_API_SUCCESS) + { + tel_register_event(TAPI_EVENT_SIM_DISABLE_SEC_CNF,&subscription_id,(TelAppCallback)sim_app_callback,NULL); + tel_register_event(TAPI_EVENT_SIM_ENABLE_SEC_CNF,&subscription_id,(TelAppCallback)sim_app_callback,NULL); + tel_register_event(TAPI_EVENT_SIM_DISABLE_FDNMODE_CNF,&subscription_id,(TelAppCallback)sim_app_callback,NULL); + tel_register_event(TAPI_EVENT_SIM_ENABLE_FDNMODE_CNF,&subscription_id,(TelAppCallback)sim_app_callback,NULL); + + gStartupSuccess = TRUE; + + } else { + tet_infoline("startup fail. tel_init() failed"); + } + tel_register_app_name("org.samsung.test"); + return; +} + +static void cleanup() +{ + tet_infoline("utc_tel_disable_sim_fdn Test Finished\n"); + if (gStartupSuccess == TRUE) + { + tel_deregister_event(subscription_id); + } + tel_deinit(); + return; +} + + +/* + Unit Test Case functions +*/ + +/** +* @brief tel_disable_sim_fdn() API : Negative condition(First parameter is Null) +* @par ID: UTC_TEL_DISABLE_SIM_FDN_01 +* @param [in] *pPinData = NULL +* @param [out] &pRequestId +* @return TAPI_API_INVALID_PTR +*/ +void utc_tel_disable_sim_fdn_01() +{ + TET_STAMP_START("NULL parameter test 1"); + TET_RESULT_NOT_EQUAL(TET_UNTESTED,gStartupSuccess, TRUE); + + int pRequestId=0; + int len = 0; + + TET_CHECK(TAPI_API_INVALID_PTR, tel_disable_sim_fdn(NULL,&len, &pRequestId)); + TET_STAMP_PASS(); + return; +} + +/** +* @brief tel_disable_sim_fdn() API : Negative condition(Second parameter is Null) +* @par ID: UTC_TEL_DISABLE_SIM_FDN_02 +* @param [in] *pPinData = PIN1_NORMAL +* @param [out] &pRequestId = NULL +* @return TAPI_API_INVALID_PTR +*/ +void utc_tel_disable_sim_fdn_02() +{ + TET_STAMP_START("NULL parameter test 2"); + TET_RESULT_NOT_EQUAL(TET_UNTESTED,gStartupSuccess, TRUE); + + int pin2_len = strlen(g_si.pin2); + char* pPinData = (char*)malloc(pin2_len); + memcpy(pPinData, g_si.pin2, pin2_len); + + TET_CHECK(TAPI_API_INVALID_PTR, tel_disable_sim_fdn((const unsigned char*)pPinData, &pin2_len, NULL)); + TET_STAMP_PASS(); + return; +} + +void utc_tel_disable_sim_fdn_03() +{ + TET_STAMP_START("PIN2_INCORRECT test"); + TET_RESULT_NOT_EQUAL(TET_UNTESTED,gStartupSuccess, TRUE); + + int tapiRet = TAPI_API_SUCCESS; + int pRequestId = 0; + int pin2_len = 0; + char* pPinData = NULL; + + tet_printf("Step 1 : enable fdn"); + if( 0 != sim_fdn_process_for_condition(1)) + { + tet_printf("condition set is failed!!"); + return; + } + + tet_printf("Step 2 : disable fdn with incorrect pin2"); + pPinData = (char*)malloc(pin2_len); + pin2_len = strlen(g_si.wpin2); + memcpy(pPinData, g_si.wpin2, pin2_len); + + gAsyncResult = FALSE; + + tapiRet = tel_disable_sim_fdn((const unsigned char*)pPinData, &pin2_len, &pRequestId); + TET_RESULT_NOT_EQUAL(TET_FAIL,TAPI_API_SUCCESS,tapiRet); + + tet_printf("after real tc api - wait start"); + + G_MAIN_LOOP_RUN(2); + + tet_printf("after real tc api - wait stop"); + + TET_RESULT_NOT_EQUAL_GOTO(TET_FAIL,exit,gAsyncResult,TRUE); // If gAsyncResult != FALSE, then TET_FAIL and return + TET_RESULT_NOT_EQUAL_GOTO(TET_FAIL,exit,TAPI_SIM_PIN_INCORRECT_PASSWORD, gSimEventStatus); // If gSimEventStatus != TAPI_SIM_PIN_INCORRECT_PASSWORD, then TET_FAIL and return + TET_STAMP_PASS(); + +exit: + // Step 3 : make default condition + tet_printf("Step 3 : disable fdn"); + + if( 0 != sim_fdn_process_for_condition(0)) + { + tet_printf("condition set is failed!!"); + } + gAsyncResult = FALSE; + return; +} + +void utc_tel_disable_sim_fdn_04() +{ + TET_STAMP_START("PIN2_CORRECT test"); + TET_RESULT_NOT_EQUAL(TET_UNTESTED,gStartupSuccess, TRUE); + + int tapiRet = TAPI_API_SUCCESS; + int pRequestId = 0; + int pin2_len = 0; + char* pPinData = NULL; + + tet_printf("Step 1 : enable fdn"); + if( 0 != sim_fdn_process_for_condition(1)) + { + tet_printf("condition set is failed!!"); + return; + } + + tet_printf("Step 2 : disable fdn with correct pin2"); + pPinData = (char*)malloc(pin2_len); + pin2_len = strlen(g_si.pin2); + memcpy(pPinData, g_si.pin2, pin2_len); + + gAsyncResult = FALSE; + + tapiRet = tel_disable_sim_fdn((const unsigned char*)pPinData, &pin2_len, &pRequestId); + TET_RESULT_NOT_EQUAL(TET_FAIL,TAPI_API_SUCCESS,tapiRet); + + tet_printf("after real tc api - wait start"); + + G_MAIN_LOOP_RUN(2); + + tet_printf("after real tc api - wait stop"); + + + TET_RESULT_NOT_EQUAL_GOTO(TET_FAIL,exit,gAsyncResult,TRUE); // If gAsyncResult != FALSE, then TET_FAIL and return + TET_RESULT_NOT_EQUAL_GOTO(TET_FAIL,exit,TAPI_SIM_PIN_OPERATION_SUCCESS, gSimEventStatus); // If gSimEventStatus != TAPI_SIM_PIN_INCORRECT_PASSWORD, then TET_FAIL and return + TET_STAMP_PASS(); + +exit: + // Step 3 : make default condition + tet_printf("Step 3 : disable fdn"); + + if( 0 != sim_fdn_process_for_condition(0)) + { + tet_printf("condition set is failed!!"); + } + gAsyncResult = FALSE; + return; +} + + +/** @} */ diff --git a/TC/telephony_TC/sim/unit/uts_tel_disable_sim_fdn.h b/TC/telephony_TC/sim/unit/uts_tel_disable_sim_fdn.h new file mode 100644 index 0000000..8c7a061 --- /dev/null +++ b/TC/telephony_TC/sim/unit/uts_tel_disable_sim_fdn.h @@ -0,0 +1,32 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * 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 _UTS_TAPI_FDN_DISABLE_H_ +#define _UTS_TAPI_FDN_DISABLE_H_ + + static void utc_tel_disable_sim_fdn_01 (); + static void utc_tel_disable_sim_fdn_02 (); + static void utc_tel_disable_sim_fdn_03 (); + static void utc_tel_disable_sim_fdn_04 (); + +#endif diff --git a/TC/telephony_TC/sim/unit/uts_tel_disable_sim_personalization.c b/TC/telephony_TC/sim/unit/uts_tel_disable_sim_personalization.c new file mode 100644 index 0000000..efe8ccd --- /dev/null +++ b/TC/telephony_TC/sim/unit/uts_tel_disable_sim_personalization.c @@ -0,0 +1,245 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** +* @ingroup TELEPHONY_API +* @addtogroup TAPI_API_SIM_SAT SIM/SAT +*/ + +/** +* @ingroup TAPI_API_SIM_SAT +* @addtogroup UTS_SIM_SAT Unit +*/ + +/** +* @ingroup UTS_SIM_SAT +* @addtogroup UTS_TEL_DISABLE_PERSONALISATION tel_disable_sim_personalization +* +* @brief Unit test code for tel_disable_sim_personalization() +* @par Test function Prototype: +* int tel_disable_sim_personalization(TelSimPersPw_t *pers_data, int *req_id) +* @par Test function description: +* This API is used to disable the network personalisation feature. +* @par Important Notes: +* None +* @param [in] TelSimPersPw_t +* The information required to disable network personalisation. +* @code + typedef struct + { + TelSimPersType_t type; + unsigned char* pw; + unsigned int pw_len; + } TelSimPersPw_t; +* @endcode +* @param [out] pRequestId Unique identifier for a particular request. +* - request_id value can be any value from 0 to 255 if the API is returned successfully +* - -1 (INVALID_REQUEST_ID) will be sent in case of failure. +* @par Async Response Message: +* The event associated is TAPI_EVENT_SIM_DISABLE_PERS_CNF +* @pre +* None +* @post +* None +* @return +* Return Type : (TapiResult_t) +* - TAPI_API_SUCCESS - indicating that the operation has completed successfully. +* - Otherwise it provides an error code (Refer #TapiResult_t) +* @{ +*/ + +/** +* @file uts_tel_disable_sim_personalization.c +* @brief + Test for the tel_disable_sim_personalization() API that is used to disable the network personalisation feature \n + Test for the tel_enable_sim_personalization() API that is used to enable the network personalisation feature +* @author +* @version Initial Creation V0.1 +* @date 2010.10.05 +*/ + +#include +#include +#include + +#include "tet_tapi_util.h" +#include "sim_common.h" +#include "uts_tel_disable_sim_personalization.h" + + +/* Initialize TCM data structures */ +static void startup(); +static void cleanup(); +void (*tet_startup) () = startup; +void (*tet_cleanup) () = cleanup; +struct tet_testlist tet_testlist[] = { + {utc_tel_disable_sim_personalization01, 1}, + {utc_tel_disable_sim_personalization02, 2}, + {NULL, 0} +}; + +/* + User Defined Handler +*/ +// Global variable for user data +static BOOL gAsyncResult; //user defined data : Async callback is called or not + +/* Startup & Clean function : It is not test code, only for + initialize and finalize test module +*/ +static BOOL gStartupSuccess = FALSE; +static unsigned int subscription_id = 0; + + +/* + G_MAIN Utility //////////////////////////////////////////////////////////////////////////// +*/ +// Prototype : User must add function body +gboolean g_timeout_callback (void *data); + +// GMainLoop global handler +GMainLoop *sim_loop = NULL; + +void G_MAIN_LOOP_CLOSE() +{ + g_main_loop_quit(sim_loop); +} + +int G_MAIN_LOOP_RUN(int sec) +{ + sim_loop = g_main_loop_new (NULL, FALSE); + g_timeout_add ( (sec * 1000), g_timeout_callback, NULL); + g_main_loop_run (sim_loop); + + return 0; +} + +gboolean g_timeout_callback (void *data) +{ + gAsyncResult = FALSE; + tet_printf("[TIME OUT] g_timeout called .Close g_main_roop()"); + G_MAIN_LOOP_CLOSE(); + return FALSE; +} +// End of G_MAIN Utility////////////////////////////////////////////////////////////////////// + + +static int sim_app_callback (TelTapiEvent_t *sim_event) +{ + tet_printf("\n***************[SIM APP]Callback data **********************\n"); + tet_printf("[SIM]Reques Id[%d]\n", sim_event->RequestId); + tet_printf("[SIM]event status [%d]\n", sim_event->Status); + + gAsyncResult = FALSE; + BOOL bReceived = FALSE; + + switch(sim_event->EventType) + { + case TAPI_EVENT_SIM_DISABLE_PERS_CNF: + { + tet_printf("\n[GOT THE EVENT]*******TAPI_EVENT_SIM_DISABLE_PERS_CNF******\n"); + tet_printf("[SIM]SIM personalization status event status = [0x%x]\n", sim_event->Status); + bReceived = TRUE; + gAsyncResult = TRUE; + } + break; + + default: + { + bReceived = TRUE; + gAsyncResult = FALSE; + tet_printf("[SIM]***************** Undhandled event type [%d] *****************\n",sim_event->EventType); + tet_printf("[SIM]Undhandled event state [%d]\n",sim_event->Status); + } + break; + }//end switch + + if (bReceived == TRUE) + G_MAIN_LOOP_CLOSE(); + + return 0; +} + + +static void startup() +{ + tet_infoline("utc_tel_disable_sim_personalization_status Test Start\n"); + + if ( tel_init() == TAPI_API_SUCCESS) + { + if (TAPI_API_SUCCESS == tel_register_event(TAPI_EVENT_SIM_DISABLE_PERS_CNF,&subscription_id,(TelAppCallback)sim_app_callback,NULL) ) + gStartupSuccess = TRUE; + else + tet_infoline("startup fail. tel_register_event() failed"); + } else { + tet_infoline("startup fail. tel_init() failed"); + } + + tel_register_app_name("org.samsung.test"); + return; +} + + +static void cleanup() +{ + tet_infoline("utc_tel_disable_sim_personalization_status Test Finished\n"); + + if (gStartupSuccess == TRUE) + { + tel_deregister_event(subscription_id); + } + tel_deinit(); + return; +} + + +/* + Unit Test Case functions +*/ +void utc_tel_disable_sim_personalization01() +{ + TET_STAMP_START("utc_tel_disable_sim_personalization01 -TAPI_API_INVALID_PTR"); + TET_CHECK(TAPI_API_INVALID_PTR,tel_disable_sim_personalization (NULL, NULL)); + TET_STAMP_PASS(); + return; +} + + +void utc_tel_disable_sim_personalization02() +{ + TET_STAMP_START("utc_tel_disable_sim_personalization02 "); + int pRequestId=0; + TelSimPersPw_t lock_pers = {0,}; + lock_pers.type = TAPI_SIM_PERS_NET; + lock_pers.pw_len = 8; + lock_pers.pw = (unsigned char*)malloc(8); + memcpy(lock_pers.pw,"00000000",8); + + gAsyncResult = FALSE; + + TET_CHECK(TAPI_API_SUCCESS,tel_disable_sim_personalization(&lock_pers, &pRequestId)); + + G_MAIN_LOOP_RUN(2); + TET_RESULT_NOT_EQUAL(TET_FAIL,gAsyncResult,TRUE); // If gAsyncResult != TRUE, then TET_FAIL and return + TET_STAMP_PASS(); + return; + +} + diff --git a/TC/telephony_TC/sim/unit/uts_tel_disable_sim_personalization.h b/TC/telephony_TC/sim/unit/uts_tel_disable_sim_personalization.h new file mode 100644 index 0000000..a15f2f1 --- /dev/null +++ b/TC/telephony_TC/sim/unit/uts_tel_disable_sim_personalization.h @@ -0,0 +1,27 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * 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 _UTS_TEL_DISABLE_SIM_PERSONALIZATION_H_ +#define _UTS_TEL_DISABLE_SIM_PERSONALIZATION_H_ + static void utc_tel_disable_sim_personalization01(); + static void utc_tel_disable_sim_personalization02(); +#endif diff --git a/TC/telephony_TC/sim/unit/uts_tel_disable_sim_security.c b/TC/telephony_TC/sim/unit/uts_tel_disable_sim_security.c new file mode 100644 index 0000000..c64d8cb --- /dev/null +++ b/TC/telephony_TC/sim/unit/uts_tel_disable_sim_security.c @@ -0,0 +1,549 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +/** +* @ingroup TELEPHONY_API +* @addtogroup TAPI_API_SIM_SAT SIM/SAT +*/ + +/** +* @ingroup TAPI_API_SIM_SAT +* @addtogroup UTS_SIM_SAT Unit +*/ + +/** +* @ingroup UTS_SIM_SAT +* @addtogroup UTS_TAPI_SIM_DISABLE_PIN tel_disable_sim_security +* +* @brief Unit test code for tel_disable_sim_security() +* @par Test function Prototype: +* TapiResult_t tel_disable_sim_security (const TelSimPinData_t* pPinData, int *pRequestId); +* @par Test function description: +* This function disables the PIN based on the Pin type and pin data passed from Application. +* @par Important Notes: +* For PIN2, disabling applies only for 3G USIMs and when PIN2 in NOT mapped to CHV2 of GSM application. +* Based on Pin status (PIN/UPIN/PUK) is blocked, an unsolicited event TAPI_EVENT_SIM_STATUS_IND +* is published to Applications. +* @param [in] pPinData +* #TelSimPinData_t type of user entered Pin disable data and pin type +* @code +typedef struct +{ + TelSimPinType_t PinType; // Pin type + char szPinCode[TAPI_SIM_PIN_LENGTH+1]; //PIN code +} TelSimPinData_t; + +typedef enum +{ + TAPI_SIM_PTYPE_PIN1 = 0x00, // PIN 1 + TAPI_SIM_PTYPE_PIN2 = 0x01, // PIN 2 + TAPI_SIM_PTYPE_PUK1 = 0x02, // Puk 1 + TAPI_SIM_PTYPE_PUK2 = 0x03, // Puk 2 + TAPI_SIM_PTYPE_UPIN = 0x04, // Universal PIN + TAPI_SIM_PTYPE_ADM = 0x05 // Administrator +} TelSimPinType_t; +* @endcode +* @param [out] pRequestId +* - Unique identifier for a particular request. +* - request_id value can be any value from 0 to 255 if the API is returned successfully +* - -1 (INVALID_REQUEST_ID) will be sent in case of failure. +* @par Async Response Message: +* The event associated is below and the event data is #TelSimPinInfo_t. \n +* (Asynchronous return status is indicated by #TelSimPinOperationResult_t.) +* - TAPI_EVENT_SIM_DISABLE_PIN_CNF +* - TAPI_EVENT_SIM_ENABLE_PIN_CNF +* @pre +* - Before test script compile, you set correct PIN1_NORMAL, PIN2_NORMAL, PIN1_CHANGED, PIN2_CHANGED value on 'tet_tapi_util.h' +* - Before test script compile, you set incorrect PIN1_INCORRECT value on 'tet_tapi_util.h' +* @post +* None +* @return +* Return Type : (TapiResult_t) +* - TAPI_API_SUCCESS - indicating that the operation has completed successfully. +* - Otherwise it provides an error code (Refer #TapiResult_t) +* @{ +*/ + +/** +* @file uts_tel_disable_sim_security.c +* @brief Test for the tel_disable_sim_security() API that is used to disable PIN +* @author +* @version Initial Creation V0.1 +* @date 2008.07.30 +*/ + +#include +#include +#include + +#include "tet_tapi_util.h" +#include "uts_tel_disable_sim_security.h" +#include "sim_common.h" +#include "async_util.h" + + +/* Initialize TCM data structures */ +static void startup(); +static void cleanup(); +void (*tet_startup) () = startup; +void (*tet_cleanup) () = cleanup; +struct tet_testlist tet_testlist[] = { + {utc_tel_disable_sim_security_01, 1}, + {utc_tel_disable_sim_security_02, 2}, + {utc_tel_disable_sim_security_03, 3}, + {utc_tel_disable_sim_security_04, 4}, + {utc_tel_disable_sim_security_05, 5}, + {utc_tel_disable_sim_security_06, 6}, + {NULL, 0} +}; + +/* + User Defined Handler +*/ +// Global variable for user data +static BOOL gAsyncResult; //user defined data : Async callback is called or not +static TelSimPinOperationResult_t gSimEventStatus; + +/* Startup & Clean function : It is not test code, only for + initialize and finalize test module +*/ +static BOOL gStartupSuccess = FALSE; +static unsigned int subscription_id = 0; + +extern sim_info_t g_si; + + +/* + G_MAIN Utility //////////////////////////////////////////////////////////////////////////// +*/ +// Prototype : User must add function body +gboolean g_timeout_callback (void *data); + +// GMainLoop global handler +GMainLoop *sim_loop = NULL; + +void G_MAIN_LOOP_CLOSE() +{ + g_main_loop_quit(sim_loop); +} + +int G_MAIN_LOOP_RUN(int sec) +{ + //GMainLoop *mainloop; + sim_loop = g_main_loop_new (NULL, FALSE); + g_timeout_add ( (sec * 1000), g_timeout_callback, NULL); + g_main_loop_run (sim_loop); + + return 0; +} + +gboolean g_timeout_callback (void *data) +{ + gAsyncResult = FALSE; + tet_printf("[TIME OUT] g_timeout called .Close g_main_roop()"); + G_MAIN_LOOP_CLOSE(); + return FALSE; +} + +// End of G_MAIN Utility////////////////////////////////////////////////////////////////////// + + +static int sim_pin_process_for_condition(TelSimPinType_t wish_pin, TelSimPinStatus_t wish_condition) +{ + int pRequestId=0; + int tapiRet = TAPI_API_SUCCESS; + TelSimPinStatus_t pin_status = TAPI_SIM_PIN_STATUS_UNKNOWN; + TelSimSecPw_t sec_data; + memset(&sec_data, 0x00, sizeof(TelSimSecPw_t)); + + tet_printf("pin[%d]:0-pin1, 1-pin2, wish_condition[%d]: 0-dis, 1- enabled, 2-blocked(puk)",wish_pin, wish_condition); + + tapiRet = tel_get_sim_security_status(wish_pin,&pin_status); + if(tapiRet != TAPI_API_SUCCESS) + { + tet_printf("tel_get_sim_security_status is Failed with tapiRet[%d]", tapiRet); + return -1; + } + + if(pin_status == TAPI_SIM_PIN_STATUS_DISABLED ) + { + tet_printf("current pin status is TAPI_SIM_PIN_STATUS_DISABLED"); + } + else if(pin_status == TAPI_SIM_PIN_STATUS_ENABLED) + { + tet_printf("current pin status is TAPI_SIM_PIN_STATUS_ENABLED"); + } + else + { + tet_printf("current pin status is unhandled status[%d]",pin_status ); + return -1; + } + + if(pin_status == wish_condition ) + { + tet_printf("current pin status is same with wished condition"); + return 0; + } + else + { + tet_printf("current pin status is different with wished condition"); + sec_data.type = wish_pin; + + if(wish_pin == TAPI_SIM_PTYPE_PIN1 ) + { + sec_data.pw_len = strlen(g_si.pin1); + sec_data.pw = (unsigned char*)malloc(sec_data.pw_len); + memcpy(sec_data.pw,g_si.pin1,sec_data.pw_len); + } + else if(wish_pin == TAPI_SIM_PTYPE_PIN2) + { + sec_data.pw_len = strlen(g_si.pin2); + sec_data.pw = (unsigned char*)malloc(sec_data.pw_len); + memcpy(sec_data.pw,g_si.pin2,sec_data.pw_len); + } + + gAsyncResult = FALSE; + + if(wish_condition == TAPI_SIM_PIN_STATUS_DISABLED) + { + tet_printf("make pin status with wished condition(TAPI_SIM_PIN_STATUS_DISABLED)"); + + tapiRet = tel_disable_sim_security(&sec_data,&pRequestId); + } + else if(wish_condition == TAPI_SIM_PIN_STATUS_ENABLED) + { + tet_printf("make pin status with wished condition(TAPI_SIM_PIN_STATUS_ENABLED)"); + tapiRet = tel_enable_sim_security(&sec_data,&pRequestId); + } + else + { + tet_printf("Unhandled wish_condition[%d]", wish_condition); + return -1; + } + + if(tapiRet != TAPI_API_SUCCESS) + { + tet_printf("tapi return[%d] when en/disabling pin for condition",tapiRet); + return -1; + } + else + { + G_MAIN_LOOP_RUN(3); + } + + if(gAsyncResult == TRUE) + return 0; + else + return -1; + } + + return 0; +} + + +static int sim_app_callback (TelTapiEvent_t *sim_event) +{ + tet_printf("\n***************[SIM]Callback data **********************\n"); + tet_printf("[SIM APP]Reques Id[%d]\n", sim_event->RequestId); + tet_printf("[SIM APP]event status [%d]\n", sim_event->Status); + + gAsyncResult = FALSE; + switch(sim_event->EventType) + { + case TAPI_EVENT_SIM_ENABLE_SEC_CNF: + { + tet_printf("\n[SIM]*****************TAPI_EVENT_SIM_ENABLE_SEC_CNF***************************\n"); + tet_printf("SIM Enable PIN event status = [%x]\n", sim_event->Status); + + gSimEventStatus = sim_event->Status; + gAsyncResult = TRUE; + } + break; + + case TAPI_EVENT_SIM_DISABLE_SEC_CNF: + { + tet_printf("\n[SIM]*****************TAPI_EVENT_SIM_DISABLE_SEC_CNF***************************\n"); + tet_printf("SIM Disable PIN event status = [%x]\n", sim_event->Status); + + gSimEventStatus = sim_event->Status; + gAsyncResult = TRUE; + } + break; + + default: + { + gSimEventStatus = sim_event->Status; + gAsyncResult = FALSE; + tet_printf("[SIM]Undhandled event type [%d]\n",sim_event->EventType); + tet_printf("[SIM]Undhandled event state [%d]\n",sim_event->Status); + break; + } + }//end switch + + G_MAIN_LOOP_CLOSE(); + return 0; +} + + +static void startup() +{ + tet_infoline("utc_tel_disable_sim_security Test Start\n"); + + sim_pin_info_setup(); + + if ( tel_init() == TAPI_API_SUCCESS) + { + tel_register_event(TAPI_EVENT_SIM_DISABLE_SEC_CNF,&subscription_id,(TelAppCallback)sim_app_callback,NULL); + tel_register_event(TAPI_EVENT_SIM_ENABLE_SEC_CNF,&subscription_id,(TelAppCallback)sim_app_callback,NULL); + + gStartupSuccess = TRUE; + + } else { + tet_infoline("startup fail. tel_init() failed"); + } + tel_register_app_name("org.samsung.test"); + return; +} + +static void cleanup() +{ + tet_infoline("utc_tel_disable_sim_security Test Finished\n"); + + if (gStartupSuccess == TRUE) + { + tel_deregister_event(subscription_id); + } + tel_deinit(); + + return; +} + + +/* + Unit Test Case functions +*/ + +/** +* @brief tel_disable_sim_security() API : Negative condition(First parameter is Null) +* @par ID: UTC_TEL_DIsABLE_SIM_SECURITY_01 +* @param [in] &pPinData = NULL +* @param [out] &pRequestId +* @return TAPI_API_INVALID_PTR +*/ +void utc_tel_disable_sim_security_01() +{ + TET_STAMP_START("NULL parameter test 1"); + TET_RESULT_NOT_EQUAL(TET_UNTESTED,gStartupSuccess, TRUE); + + int pRequestId=0; + + TET_CHECK(TAPI_API_INVALID_PTR, tel_disable_sim_security(NULL,&pRequestId)); + TET_STAMP_PASS(); + return; +} + +/** +* @brief tel_disable_sim_security() API : Negative condition(Second parameter is Null) +* @par ID: UTC_TEL_DIsABLE_SIM_SECURITY_02 +* @param [in] &pPinData.szPinCode = PIN1_NORMAL +* @param [out] &pRequestId = NULL +* @return TAPI_API_INVALID_PTR +*/ +void utc_tel_disable_sim_security_02() +{ + TET_STAMP_START("NULL parameter test 2"); + TET_RESULT_NOT_EQUAL(TET_UNTESTED,gStartupSuccess, TRUE); + + TelSimSecPw_t sec_data; + memset(&sec_data, 0x00, sizeof(TelSimSecPw_t)); + sec_data.type = TAPI_SIM_PTYPE_PIN1; + sec_data.pw_len = strlen(g_si.pin1); + sec_data.pw = (unsigned char*)malloc(sec_data.pw_len); + memcpy(sec_data.pw,g_si.pin1,sec_data.pw_len); + + TET_CHECK(TAPI_API_INVALID_PTR, tel_disable_sim_security(&sec_data,NULL)); + TET_STAMP_PASS(); + return; +} + +/** +* @brief tel_disable_sim_security() API : Low boundary test +* @par ID: UTC_TEL_DIsABLE_SIM_SECURITY_03 +* @param [in] &pPinData.PinType = TAPI_SIM_PTYPE_PIN1-1; //<---- Invalid value +* @param [out] &pRequestId = NULL +* @return TAPI_API_INVALID_INPUT +*/ +void utc_tel_disable_sim_security_03() +{ + TET_STAMP_START("Invalid Input test 1"); + TET_RESULT_NOT_EQUAL(TET_UNTESTED,gStartupSuccess, TRUE); + + int pRequestId = 0; + TelSimSecPw_t sec_data; + memset(&sec_data, 0x00, sizeof(TelSimSecPw_t)); + sec_data.type = TAPI_SIM_PTYPE_PIN1 -1; + sec_data.pw_len = strlen(g_si.pin1); + sec_data.pw = (unsigned char*)malloc(sec_data.pw_len); + memcpy(sec_data.pw,g_si.pin1,sec_data.pw_len); + + TET_CHECK(TAPI_API_INVALID_INPUT, tel_disable_sim_security(&sec_data,&pRequestId)); + TET_STAMP_PASS(); + return; +} + +/** +* @brief tel_disable_sim_security() API : Upper boundary test +* @par ID: UTC_TEL_DIsABLE_SIM_SECURITY_04 +* @param [in] &pPinData.PinType = TAPI_SIM_PTYPE_ADM+1; //<---- Invalid value +* @param [out] &pRequestId = NULL +* @return TAPI_API_INVALID_INPUT +*/ +void utc_tel_disable_sim_security_04() +{ + TET_STAMP_START("Invalid Input test 2"); + TET_RESULT_NOT_EQUAL(TET_UNTESTED,gStartupSuccess, TRUE); + + int pRequestId = 0; + TelSimSecPw_t sec_data; + memset(&sec_data, 0x00, sizeof(TelSimSecPw_t)); + sec_data.type = TAPI_SIM_PTYPE_PIN1 +1; + sec_data.pw_len = strlen(g_si.pin1); + sec_data.pw = (unsigned char*)malloc(sec_data.pw_len); + memcpy(sec_data.pw,g_si.pin1,sec_data.pw_len); + + TET_CHECK(TAPI_API_INVALID_INPUT, tel_disable_sim_security(&sec_data,&pRequestId)); + TET_STAMP_PASS(); + return; +} + + +/** +* @brief tel_disable_sim_security() API : Invalid parameter(PIN1_INCORRECT) +* @par ID: UTC_TEL_DIsABLE_SIM_SECURITY_05 +* @param [in] &pPinData.szPinCode = PIN1_INCORRECT; //<---- Invalid value +* @param [out] &pRequestId = NULL +* @return TAPI_API_SUCCESS +* @par Async Response Message: +* The event received is below and the event data is #TelSimPinInfo_t. \n +* (Asynchronous return status is indicated by #TelSimPinOperationResult_t.) +* - TAPI_EVENT_SIM_DISABLE_PIN_CNF (TAPI_SIM_PIN_INCORRECT_PASSWORD) +*/ +void utc_tel_disable_sim_security_05() +{ + TET_STAMP_START("PIN1_INCORRECT test"); + TET_RESULT_NOT_EQUAL(TET_UNTESTED,gStartupSuccess, TRUE); + + // Step 1 : make proper condition + tet_printf("Step 1 : enable pin"); + + if( 0 != sim_pin_process_for_condition(TAPI_SIM_PTYPE_PIN1,TAPI_SIM_PIN_STATUS_ENABLED)) + { + tet_printf("condition set is failed!!"); + return; + } + + // Step 2 : disable pin + tet_printf("Step 2 : disable pin"); + int pRequestId = 0; + int tapiRet = TAPI_API_SUCCESS; + TelSimSecPw_t sec_data; + memset(&sec_data, 0x00, sizeof(TelSimSecPw_t)); + sec_data.type = TAPI_SIM_PTYPE_PIN1; + sec_data.pw_len = strlen(g_si.wpin1); + sec_data.pw = (unsigned char*)malloc(sec_data.pw_len); + memcpy(sec_data.pw,g_si.wpin1,sec_data.pw_len); + + gAsyncResult = FALSE; + + tapiRet = tel_disable_sim_security(&sec_data,&pRequestId); + TET_RESULT_NOT_EQUAL(TET_FAIL,TAPI_API_SUCCESS,tapiRet); + + tet_printf("after real tc api - wait start"); + + G_MAIN_LOOP_RUN(3); + + tet_printf("after real tc api - wait stop"); + + TET_RESULT_NOT_EQUAL(TET_FAIL,gAsyncResult,TRUE); // If gAsyncResult != TRUE, then TET_FAIL and return + TET_RESULT_NOT_EQUAL(TET_FAIL,TAPI_SIM_PIN_INCORRECT_PASSWORD, gSimEventStatus); // If gSimEventStatus != TAPI_SIM_PIN_INCORRECT_PASSWORD, then TET_FAIL and return + TET_STAMP_PASS(); + tet_printf("finish case"); + return; +} + + +/** +* @brief tel_disable_sim_security() API : Normal operation +* @par ID: UTC_TEL_DIsABLE_SIM_SECURITY_06 +* @param [in] &pPinData + pPinData.szPinCode = PIN1_NORMAL + pPinData.PinType=TAPI_SIM_PTYPE_PIN1 +* @param [out] &pRequestId = NULL +* @return TAPI_API_SUCCESS +* @par Async Response Message: +* The event received is below and the event data is #TelSimPinInfo_t. \n +* (Asynchronous return status is indicated by #TelSimPinOperationResult_t.) +* - TAPI_EVENT_SIM_DISABLE_PIN_CNF (TAPI_SIM_PIN_OPERATION_SUCCESS) +*/ +void utc_tel_disable_sim_security_06() +{ + TET_STAMP_START("PIN1_NORMAL test"); + TET_RESULT_NOT_EQUAL(TET_UNTESTED,gStartupSuccess, TRUE); + + // Step 1 : make proper condition + tet_printf("Step 1 : enable pin"); + + if( 0 != sim_pin_process_for_condition(TAPI_SIM_PTYPE_PIN1,TAPI_SIM_PIN_STATUS_ENABLED)) + { + tet_printf("condition set is failed!!"); + return; + } + + // Step 2 : disable pin + tet_printf("Step 2 : disable pin"); + int pRequestId = 0; + int tapiRet = TAPI_API_SUCCESS; + TelSimSecPw_t sec_data; + memset(&sec_data, 0x00, sizeof(TelSimSecPw_t)); + sec_data.type = TAPI_SIM_PTYPE_PIN1; + sec_data.pw_len = strlen(g_si.pin1); + sec_data.pw = (unsigned char*)malloc(sec_data.pw_len); + memcpy(sec_data.pw,g_si.pin1,sec_data.pw_len); + + gAsyncResult = FALSE; + + tapiRet = tel_disable_sim_security(&sec_data,&pRequestId); + TET_RESULT_NOT_EQUAL(TET_FAIL,TAPI_API_SUCCESS,tapiRet); + + tet_printf("after real tc api - wait start"); + + G_MAIN_LOOP_RUN(3); + + tet_printf("after real tc api - wait stop"); + + TET_RESULT_NOT_EQUAL(TET_FAIL,gAsyncResult,TRUE); // If gAsyncResult != TRUE, then TET_FAIL and return + TET_RESULT_NOT_EQUAL(TET_FAIL,TAPI_SIM_PIN_OPERATION_SUCCESS, gSimEventStatus); // If gSimEventStatus != TAPI_SIM_PIN_INCORRECT_PASSWORD, then TET_FAIL and return + TET_STAMP_PASS(); + tet_printf("finish case"); + return; +} + +/** @} */ diff --git a/TC/telephony_TC/sim/unit/uts_tel_disable_sim_security.h b/TC/telephony_TC/sim/unit/uts_tel_disable_sim_security.h new file mode 100644 index 0000000..9516d0f --- /dev/null +++ b/TC/telephony_TC/sim/unit/uts_tel_disable_sim_security.h @@ -0,0 +1,32 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * 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 _UTS_TEL_DIsABLE_SIM_SECURITY_H_ +#define _UTS_TEL_DIsABLE_SIM_SECURITY_H_ + + static void utc_tel_disable_sim_security_01(); + static void utc_tel_disable_sim_security_02(); + static void utc_tel_disable_sim_security_03(); + static void utc_tel_disable_sim_security_04(); + static void utc_tel_disable_sim_security_05(); + static void utc_tel_disable_sim_security_06(); + +#endif diff --git a/TC/telephony_TC/sim/unit/uts_tel_enable_sim_fdn.c b/TC/telephony_TC/sim/unit/uts_tel_enable_sim_fdn.c new file mode 100644 index 0000000..04a340d --- /dev/null +++ b/TC/telephony_TC/sim/unit/uts_tel_enable_sim_fdn.c @@ -0,0 +1,456 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +/** +* @ingroup TELEPHONY_API +* @addtogroup TAPI_API_SIM_SAT SIM/SAT +*/ + +/** +* @ingroup TAPI_API_SIM_SAT +* @addtogroup UTS_SIM_SAT Unit +*/ + +/** +* @ingroup UTS_SIM_SAT +* @addtogroup UTS_TAPI_SIM_ENABLE_FDN tel_enable_sim_fdn +* +* @brief Unit test code for tel_enable_sim_fdn() +* @par Test function Prototype: +* TapiResult_t tel_enable_sim_fdn(const char* pPinData, int *pRequestId); +* @par Test function description: +* This function enables the FDN Mode +* @par Important Notes: +* An unsolicited event TAPI_EVENT_SIM_FDN_STATUS_IND is notified to indicate +* whenever FDN status is changed(disabled/enabled) +* @param [in] pPinData +* User entered PIN2 data. (NULL terminated string) +* @param [out] pRequestId +* - Unique identifier for a particular request. +* - request_id value can be any value from 0 to 255 if the API is returned successfully +* - -1 (INVALID_REQUEST_ID) will be sent in case of failure. * @par Async Response Message: +* @par Async Response Message: +* The event associated is below and the event data is #TelSimPinInfo_t. \n +* (Asynchronous return status is indicated by #TelSimPinOperationResult_t.) +* - TAPI_EVENT_SIM_DISABLE_FDN_CNF +* - TAPI_EVENT_SIM_ENABLE_FDN_CNF +* - TAPI_EVENT_SIM_STATUS_IND +* @pre +* - Before test script compile, you set correct PIN1_NORMAL, PIN2_NORMAL, PIN1_CHANGED, PIN2_CHANGED value on 'tet_tapi_util.h' +* - Before test script compile, you set incorrect PIN1_INCORRECT value on 'tet_tapi_util.h' +* @post +* None +* @return +* Return Type : (TapiResult_t) +* - TAPI_API_SUCCESS - indicating that the operation has completed successfully. +* - Otherwise it provides an error code (Refer #TapiResult_t) +* @{ +*/ + +/** +* @file uts_tel_enable_sim_fdn.c +* @brief Test for the tel_enable_sim_fdn() API that is used to enable FDN mode +* @author +* @version Initial Creation V0.1 +* @date 2008.07.30 +*/ + + +#include +#include +#include + +#include "tet_tapi_util.h" +#include "uts_tel_enable_sim_fdn.h" +#include "sim_common.h" +#include "async_util.h" + + +/* Initialize TCM data structures */ +static void startup(); +static void cleanup(); +void (*tet_startup) () = startup; +void (*tet_cleanup) () = cleanup; +struct tet_testlist tet_testlist[] = { + {utc_tel_enable_sim_fdn_01, 1}, + {utc_tel_enable_sim_fdn_02, 2}, + {utc_tel_enable_sim_fdn_03, 3}, + {utc_tel_enable_sim_fdn_04, 4}, + + {NULL, 0} +}; + +/* + User Defined Handler +*/ +// Global variable for user data +static BOOL gAsyncResult; //user defined data : Async callback is called or not +static TelSimPinOperationResult_t gSimEventStatus; + +/* Startup & Clean function : It is not test code, only for + initialize and finalize test module +*/ +static BOOL gStartupSuccess = FALSE; +static unsigned int subscription_id = 0; + +extern sim_info_t g_si; + + +/* + G_MAIN Utility //////////////////////////////////////////////////////////////////////////// +*/ +// Prototype : User must add function body +gboolean g_timeout_callback (void *data); + +// GMainLoop global handler +GMainLoop *sim_loop = NULL; + +void G_MAIN_LOOP_CLOSE() +{ + g_main_loop_quit(sim_loop); +} + +int G_MAIN_LOOP_RUN(int sec) +{ + //GMainLoop *mainloop; + sim_loop = g_main_loop_new (NULL, FALSE); + g_timeout_add ( (sec * 1000), g_timeout_callback, NULL); + g_main_loop_run (sim_loop); + + return 0; +} + +gboolean g_timeout_callback (void *data) +{ + gAsyncResult = FALSE; + tet_printf("[TIME OUT] g_timeout called .Close g_main_roop()"); + G_MAIN_LOOP_CLOSE(); + return FALSE; +} +// End of G_MAIN Utility////////////////////////////////////////////////////////////////////// + + +static int sim_fdn_process_for_condition(int wish_condition) +{ + int pRequestId=0; + int tapiRet = TAPI_API_SUCCESS; + int fdn_status = 0; //dis(0)/enable(1) + int pin2_len = 0; + char* pin2 = NULL; + + tet_printf("wish_condition[%d]: 0-dis, 1- enabled",wish_condition); + + tapiRet = tel_get_sim_fdn_status(&fdn_status); + if(tapiRet != TAPI_API_SUCCESS) + { + tet_printf("tel_get_sim_fdn_status is Failed with tapiRet[%d]", tapiRet); + return -1; + } + + if(fdn_status == 0 ) + { + tet_printf("current fdn status is disable"); + } + else if(fdn_status == 1) + { + tet_printf("current fdn status is enable"); + } + else + { + tet_printf("current fdn status is unhandled status[%d]",fdn_status ); + return -1; + } + + if(fdn_status == wish_condition ) + { + tet_printf("current fdn status is same with wished condition"); + return 0; + } + else + { + tet_printf("current fdn status is different with wished condition"); + + pin2_len = strlen(g_si.pin2); + pin2 = (char*)malloc(pin2_len); + memcpy(pin2,g_si.pin2,pin2_len); + + gAsyncResult = FALSE; + + if(wish_condition == 0) + { + tapiRet = tel_disable_sim_fdn((const unsigned char*)pin2,&pin2_len,&pRequestId); + } + else if(wish_condition == 1) + { + tapiRet = tel_enable_sim_fdn((const unsigned char*)pin2,&pin2_len,&pRequestId); + } + else + { + tet_printf("Unhandled wish_condition[%d]", wish_condition); + return -1; + } + + if(tapiRet != TAPI_API_SUCCESS) + { + tet_printf("tapi return[%d] when en/disabling fdn for condition",tapiRet); + return -1; + } + else + { + G_MAIN_LOOP_RUN(2); + } + + if(gAsyncResult == TRUE) + return 0; + else + return -1; + } + return 0; +} + + +static int sim_app_callback (TelTapiEvent_t *sim_event) +{ + tet_printf("\n***************[SIM APP]Callback data **********************\n"); + tet_printf("[SIM]Reques Id[%d]\n", sim_event->RequestId); + tet_printf("[SIM]event status [%d]\n", sim_event->Status); + + gAsyncResult = FALSE; + BOOL bReceived = FALSE; + + switch(sim_event->EventType) + { + case TAPI_EVENT_SIM_ENABLE_FDNMODE_CNF: + { + tet_printf("\n[SIM]*****************TAPI_EVENT_SIM_ENABLE_FDNMODE_CNF (%d) ***************************\n", TAPI_EVENT_SIM_ENABLE_FDNMODE_CNF); + tet_printf("SIM Enable FDN event status = [%x]\n", sim_event->Status); + + gSimEventStatus = sim_event->Status; + gAsyncResult = TRUE; + bReceived = TRUE; + } + break; + + case TAPI_EVENT_SIM_DISABLE_FDNMODE_CNF: + { + tet_printf("\n[SIM]*****************TAPI_EVENT_SIM_DISABLE_FDNMODE_CNF (%d) ***************************\n", TAPI_EVENT_SIM_DISABLE_FDNMODE_CNF); + tet_printf("SIM Disable FDN event status = [%x]\n", sim_event->Status); + + gSimEventStatus = sim_event->Status; + gAsyncResult = TRUE; + bReceived = TRUE; + } + break; + + default: + { + gSimEventStatus = sim_event->Status; + gAsyncResult = FALSE; + tet_printf("[SIM]***************** Undhandled event type [%d] *****************\n",sim_event->EventType); + tet_printf("[SIM APP]Undhandled event state [%d]\n",sim_event->Status); + break; + } + }//end switch + + if (bReceived == TRUE) + G_MAIN_LOOP_CLOSE(); + return 0; +} + + +static void startup() +{ + tet_infoline("utc_tel_enable_sim_fdn Test Start\n"); + + sim_pin_info_setup(); + + if (tel_init() == TAPI_API_SUCCESS) + { + tel_register_event(TAPI_EVENT_SIM_ENABLE_FDNMODE_CNF,&subscription_id,(TelAppCallback)sim_app_callback,NULL); + tel_register_event(TAPI_EVENT_SIM_DISABLE_FDNMODE_CNF,&subscription_id,(TelAppCallback)sim_app_callback,NULL); + gStartupSuccess = TRUE; + + } else { + tet_infoline("startup fail. tel_init() failed"); + } + tel_register_app_name("org.samsung.test"); + return; +} + + +static void cleanup() +{ + tet_infoline("utc_tel_enable_sim_fdn Test Finished\n"); + + if (gStartupSuccess == TRUE) + { + tel_deregister_event(subscription_id); + } + tel_deinit(); + return; +} + + +/* + Unit Test Case functions +*/ +/** +* @brief tel_enable_sim_fdn() API : Negative condition(First parameter is Null) +* @par ID: UTC_TEL_ENABLE_SIM_FDN_01 +* @param [in] *pPinData = NULL +* @param [out] &pRequestId +* @return TAPI_API_INVALID_PTR +*/ +void utc_tel_enable_sim_fdn_01() +{ + TET_STAMP_START("NULL parameter test 1"); + TET_RESULT_NOT_EQUAL(TET_UNTESTED,gStartupSuccess, TRUE); + + int pRequestId=0; + int len = 0; + + TET_CHECK(TAPI_API_INVALID_PTR, tel_enable_sim_fdn(NULL,&len, &pRequestId)); + TET_STAMP_PASS(); + return; +} + +/** +* @brief tel_enable_sim_fdn() API : Negative condition(Second parameter is Null) +* @par ID: UTC_TEL_ENABLE_SIM_FDN_02 +* @param [in] *pPinData = PIN1_NORMAL +* @param [out] &pRequestId = NULL +* @return TAPI_API_INVALID_PTR +*/ +void utc_tel_enable_sim_fdn_02() +{ + TET_STAMP_START("NULL parameter test 2"); + TET_RESULT_NOT_EQUAL(TET_UNTESTED,gStartupSuccess, TRUE); + + int pin2_len = strlen(g_si.pin2); + char* pPinData = (char*)malloc(pin2_len); + memcpy(pPinData, g_si.pin2, pin2_len); + + TET_CHECK(TAPI_API_INVALID_PTR, tel_enable_sim_fdn((const unsigned char*)pPinData, &pin2_len, NULL)); + TET_STAMP_PASS(); + return; +} + + +void utc_tel_enable_sim_fdn_03() +{ + TET_STAMP_START("PIN2_INCORRECT test"); + TET_RESULT_NOT_EQUAL(TET_UNTESTED,gStartupSuccess, TRUE); + + int tapiRet = TAPI_API_SUCCESS; + int pRequestId = 0; + int pin2_len = 0; + char* pPinData = NULL; + + tet_printf("Step 1 : disable fdn"); + if( 0 != sim_fdn_process_for_condition(0)) + { + tet_printf("condition set is failed!!"); + return; + } + + tet_printf("Step 2 : enable fdn with incorrect pin2"); + pPinData = (char*)malloc(pin2_len); + pin2_len = strlen(g_si.wpin2); + memcpy(pPinData, g_si.wpin2, pin2_len); + + gAsyncResult = FALSE; + + tapiRet = tel_enable_sim_fdn((const unsigned char*)pPinData, &pin2_len, &pRequestId); + TET_RESULT_NOT_EQUAL(TET_FAIL,TAPI_API_SUCCESS,tapiRet); + + tet_printf("after real tc api - wait start"); + + G_MAIN_LOOP_RUN(2); + + tet_printf("after real tc api - wait stop"); + + + TET_RESULT_NOT_EQUAL_GOTO(TET_FAIL,exit,gAsyncResult,TRUE); // If gAsyncResult != FALSE, then TET_FAIL and return + TET_RESULT_NOT_EQUAL_GOTO(TET_FAIL,exit,TAPI_SIM_PIN_INCORRECT_PASSWORD, gSimEventStatus); // If gSimEventStatus != TAPI_SIM_PIN_INCORRECT_PASSWORD, then TET_FAIL and return + TET_STAMP_PASS(); + +exit: + // Step 3 : make default condition + tet_printf("Step 3 : disable fdn"); + + if( 0 != sim_fdn_process_for_condition(0)) + { + tet_printf("condition set is failed!!"); + } + return; +} + + +void utc_tel_enable_sim_fdn_04() +{ + TET_STAMP_START("PIN2_CORRECT test"); + TET_RESULT_NOT_EQUAL(TET_UNTESTED,gStartupSuccess, TRUE); + + int tapiRet = TAPI_API_SUCCESS; + int pRequestId = 0; + int pin2_len = 0; + char* pPinData = NULL; + + tet_printf("Step 1 : disable fdn"); + if( 0 != sim_fdn_process_for_condition(0)) + { + tet_printf("condition set is failed!!"); + return; + } + + tet_printf("Step 2 : enable fdn with correct pin2"); + pPinData = (char*)malloc(pin2_len); + pin2_len = strlen(g_si.pin2); + memcpy(pPinData, g_si.pin2, pin2_len); + + gAsyncResult = FALSE; + + tapiRet = tel_enable_sim_fdn((const unsigned char*)pPinData, &pin2_len, &pRequestId); + TET_RESULT_NOT_EQUAL(TET_FAIL,TAPI_API_SUCCESS,tapiRet); + + tet_printf("after real tc api - wait start"); + + G_MAIN_LOOP_RUN(2); + + tet_printf("after real tc api - wait stop"); + + + TET_RESULT_NOT_EQUAL_GOTO(TET_FAIL,exit,gAsyncResult,TRUE); // If gAsyncResult != FALSE, then TET_FAIL and return + TET_RESULT_NOT_EQUAL_GOTO(TET_FAIL,exit,TAPI_SIM_PIN_OPERATION_SUCCESS, gSimEventStatus); // If gSimEventStatus != TAPI_SIM_PIN_INCORRECT_PASSWORD, then TET_FAIL and return + TET_STAMP_PASS(); + +exit: + // Step 3 : make default condition + tet_printf("Step 3 : disable fdn"); + + if( 0 != sim_fdn_process_for_condition(0)) + { + tet_printf("condition set is failed!!"); + } + return; +} + +/** @} */ diff --git a/TC/telephony_TC/sim/unit/uts_tel_enable_sim_fdn.h b/TC/telephony_TC/sim/unit/uts_tel_enable_sim_fdn.h new file mode 100644 index 0000000..37e04ea --- /dev/null +++ b/TC/telephony_TC/sim/unit/uts_tel_enable_sim_fdn.h @@ -0,0 +1,30 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * 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 _uts_tel_enable_sim_fdn_H_ +#define _uts_tel_enable_sim_fdn_H_ + + static void utc_tel_enable_sim_fdn_01(); + static void utc_tel_enable_sim_fdn_02(); + static void utc_tel_enable_sim_fdn_03(); + static void utc_tel_enable_sim_fdn_04(); + +#endif diff --git a/TC/telephony_TC/sim/unit/uts_tel_enable_sim_personalization.c b/TC/telephony_TC/sim/unit/uts_tel_enable_sim_personalization.c new file mode 100644 index 0000000..3d82a12 --- /dev/null +++ b/TC/telephony_TC/sim/unit/uts_tel_enable_sim_personalization.c @@ -0,0 +1,245 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** +* @ingroup TELEPHONY_API +* @addtogroup TAPI_API_SIM_SAT SIM/SAT +*/ + +/** +* @ingroup TAPI_API_SIM_SAT +* @addtogroup UTS_SIM_SAT Unit +*/ + +/** +* @ingroup UTS_SIM_SAT +* @addtogroup UTS_TEL_ENABLE_PERSONALISATION tel_enable_sim_personalization +* +* @brief Unit test code for tel_enable_sim_personalization() +* @par Test function Prototype: +* int tel_enable_sim_personalization(TelSimPersPw_t *pers_data, int *req_id) +* @par Test function description: +* This API is used to enable the network personalisation feature. +* @par Important Notes: +* None +* @param [in] TelSimPersPw_t +* The information required to enable network personalisation. +* @code + typedef struct + { + TelSimPersType_t type; + unsigned char* pw; + unsigned int pw_len; + } TelSimPersPw_t; +* @endcode +* @param [out] pRequestId Unique identifier for a particular request. +* - request_id value can be any value from 0 to 255 if the API is returned successfully +* - -1 (INVALID_REQUEST_ID) will be sent in case of failure. +* @par Async Response Message: +* The event associated is TAPI_EVENT_SIM_ENABLE_PERS_CNF +* @pre +* None +* @post +* None +* @return +* Return Type : (TapiResult_t) +* - TAPI_API_SUCCESS - indicating that the operation has completed successfully. +* - Otherwise it provides an error code (Refer #TapiResult_t) +* @{ +*/ + +/** +* @file uts_tel_enable_sim_personalization.c +* @brief + Test for the tel_disable_sim_personalization() API that is used to disable the network personalisation feature \n + Test for the tel_enable_sim_personalization() API that is used to enable the network personalisation feature +* @author +* @version Initial Creation V0.1 +* @date 2010.10.05 +*/ + +#include +#include +#include + +#include "tet_tapi_util.h" +#include "sim_common.h" +#include "uts_tel_enable_sim_personalization.h" + + +/* Initialize TCM data structures */ +static void startup(); +static void cleanup(); +void (*tet_startup) () = startup; +void (*tet_cleanup) () = cleanup; +struct tet_testlist tet_testlist[] = { + {utc_tel_enable_sim_personalization01, 1}, + {utc_tel_enable_sim_personalization02, 2}, + {NULL, 0} +}; + +/* + User Defined Handler +*/ +// Global variable for user data +static BOOL gAsyncResult; //user defined data : Async callback is called or not + +/* Startup & Clean function : It is not test code, only for + initialize and finalize test module +*/ +static BOOL gStartupSuccess = FALSE; +static unsigned int subscription_id = 0; + + +/* + G_MAIN Utility //////////////////////////////////////////////////////////////////////////// +*/ +// Prototype : User must add function body +gboolean g_timeout_callback (void *data); + +// GMainLoop global handler +GMainLoop *sim_loop = NULL; + +void G_MAIN_LOOP_CLOSE() +{ + g_main_loop_quit(sim_loop); +} + +int G_MAIN_LOOP_RUN(int sec) +{ + sim_loop = g_main_loop_new (NULL, FALSE); + g_timeout_add ( (sec * 1000), g_timeout_callback, NULL); + g_main_loop_run (sim_loop); + + return 0; +} + +gboolean g_timeout_callback (void *data) +{ + gAsyncResult = FALSE; + tet_printf("[TIME OUT] g_timeout called .Close g_main_roop()"); + G_MAIN_LOOP_CLOSE(); + return FALSE; +} +// End of G_MAIN Utility////////////////////////////////////////////////////////////////////// + + +static int sim_app_callback (TelTapiEvent_t *sim_event) +{ + tet_printf("\n***************[SIM APP]Callback data **********************\n"); + tet_printf("[SIM]Reques Id[%d]\n", sim_event->RequestId); + tet_printf("[SIM APP]event status [%d]\n", sim_event->Status); + + gAsyncResult = FALSE; + BOOL bReceived = FALSE; + + switch(sim_event->EventType) + { + case TAPI_EVENT_SIM_ENABLE_PERS_CNF: + { + tet_printf("\n[GOT THE EVENT]*******TAPI_EVENT_SIM_ENABLE_PERS_CNF******\n"); + tet_printf("[SIM]SIM personalization status event status = [0x%x]\n", sim_event->Status); + bReceived = TRUE; + gAsyncResult = TRUE; + } + break; + + default: + { + bReceived = TRUE; + gAsyncResult = FALSE; + tet_printf("[SIM]***************** Undhandled event type [%d] *****************\n",sim_event->EventType); + tet_printf("[SIM]Undhandled event state [%d]\n",sim_event->Status); + } + break; + }//end switch + + if (bReceived == TRUE) + G_MAIN_LOOP_CLOSE(); + + return 0; +} + + +static void startup() +{ + tet_infoline("utc_tel_enable_sim_personalization_status Test Start\n"); + + if ( tel_init() == TAPI_API_SUCCESS) + { + if (TAPI_API_SUCCESS == tel_register_event(TAPI_EVENT_SIM_ENABLE_PERS_CNF,&subscription_id,(TelAppCallback)sim_app_callback,NULL) ) + gStartupSuccess = TRUE; + else + tet_infoline("startup fail. tel_register_event() failed"); + } else { + tet_infoline("startup fail. tel_init() failed"); + } + + tel_register_app_name("org.samsung.test"); + return; +} + + +static void cleanup() +{ + tet_infoline("utc_tel_enable_sim_personalization_status Test Finished\n"); + + if (gStartupSuccess == TRUE) + { + tel_deregister_event(subscription_id); + } + tel_deinit(); + return; +} + + +/* + Unit Test Case functions +*/ +void utc_tel_enable_sim_personalization01() +{ + TET_STAMP_START("utc_tel_enable_sim_personalization01 -TAPI_API_INVALID_PTR "); + TET_CHECK(TAPI_API_INVALID_PTR,tel_enable_sim_personalization (NULL, NULL)); + TET_STAMP_PASS(); + return; +} + + +void utc_tel_enable_sim_personalization02() +{ + TET_STAMP_START("utc_tel_enable_sim_personalization02 "); + int pRequestId=0; + + TelSimPersPw_t lock_pers = {0,}; + lock_pers.type = TAPI_SIM_PERS_NET; + lock_pers.pw_len = 15; + lock_pers.pw = (unsigned char*)malloc(15); + memcpy(lock_pers.pw,"000000000000000",15); + + gAsyncResult = FALSE; + + TET_CHECK(TAPI_API_SUCCESS,tel_enable_sim_personalization(&lock_pers, &pRequestId)); + + G_MAIN_LOOP_RUN(2); + TET_RESULT_NOT_EQUAL(TET_FAIL,gAsyncResult,TRUE); // If gAsyncResult != TRUE, then TET_FAIL and return + TET_STAMP_PASS(); + return; +} + diff --git a/TC/telephony_TC/sim/unit/uts_tel_enable_sim_personalization.h b/TC/telephony_TC/sim/unit/uts_tel_enable_sim_personalization.h new file mode 100644 index 0000000..a9be66f --- /dev/null +++ b/TC/telephony_TC/sim/unit/uts_tel_enable_sim_personalization.h @@ -0,0 +1,27 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * 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 _UTS_TEL_ENABLE_SIM_PERSONALIZATION_H_ +#define _UTS_TEL_ENABLE_SIM_PERSONALIZATION_H_ + static void utc_tel_enable_sim_personalization01(); + static void utc_tel_enable_sim_personalization02(); +#endif diff --git a/TC/telephony_TC/sim/unit/uts_tel_enable_sim_security.c b/TC/telephony_TC/sim/unit/uts_tel_enable_sim_security.c new file mode 100644 index 0000000..860c4ee --- /dev/null +++ b/TC/telephony_TC/sim/unit/uts_tel_enable_sim_security.c @@ -0,0 +1,568 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +/** +* @ingroup TELEPHONY_API +* @addtogroup TAPI_API_SIM_SAT SIM/SAT +*/ + +/** +* @ingroup TAPI_API_SIM_SAT +* @addtogroup UTS_SIM_SAT Unit +*/ + +/** +* @ingroup UTS_SIM_SAT +* @addtogroup UTS_TAPI_SIM_ENABLE_PIN tel_enable_sim_security +* +* @brief Unit test code for tel_enable_sim_security() +* @par Test function Prototype: +* TapiResult_t tel_enable_sim_security (const TelSimPinData_t* pPinData, int *pRequestId); +* @par Test function description: +* This function enables the PIN based on the Pin type and pin data passed from the Application. +* @par Important Notes: +* For PIN2, disabling applies only for 3G USIMs and when PIN2 in NOT mapped to CHV2 of GSM application. +* Based on Pin status (PIN/UPIN/PUK) is blocked, an unsolicited event TAPI_EVENT_SIM_STATUS_IND +* is published to Applications. +* @param [in] pPinData +* #TelSimPinData_t type of user entered Pin disable data and pin type +* @code +typedef struct +{ + TelSimPinType_t PinType; // Pin type + char szPinCode[TAPI_SIM_PIN_LENGTH+1]; //PIN code +} TelSimPinData_t; + +typedef enum +{ + TAPI_SIM_PTYPE_PIN1 = 0x00, // PIN 1 + TAPI_SIM_PTYPE_PIN2 = 0x01, // PIN 2 + TAPI_SIM_PTYPE_PUK1 = 0x02, // Puk 1 + TAPI_SIM_PTYPE_PUK2 = 0x03, // Puk 2 + TAPI_SIM_PTYPE_UPIN = 0x04, // Universal PIN + TAPI_SIM_PTYPE_ADM = 0x05 // Administrator +} TelSimPinType_t; +* @endcode +* @param [out] pRequestId +* - Unique identifier for a particular request. +* - request_id value can be any value from 0 to 255 if the API is returned successfully +* - -1 (INVALID_REQUEST_ID) will be sent in case of failure. * @par Async Response Message: +* @par Async Response Message: +* The event associated is below and the event data is #TelSimPinInfo_t. \n +* (Asynchronous return status is indicated by #TelSimPinOperationResult_t.) +* - TAPI_EVENT_SIM_DISABLE_SEC_CNF +* - TAPI_EVENT_SIM_ENABLE_SEC_CNF +* - TAPI_EVENT_SIM_STATUS_IND +* @pre +* - Before test script compile, you set correct PIN1_NORMAL, PIN2_NORMAL, PIN1_CHANGED, PIN2_CHANGED value on 'tet_tapi_util.h' +* - Before test script compile, you set incorrect PIN1_INCORRECT value on 'tet_tapi_util.h' +* @post +* None +* @return +* Return Type : (TapiResult_t) +* - TAPI_API_SUCCESS - indicating that the operation has completed successfully. +* - Otherwise it provides an error code (Refer #TapiResult_t) +* @{ +*/ + +/** +* @file uts_tel_enable_sim_security.c +* @brief Test for the tel_enable_sim_security() API that is used to enable chv(Card Hoder value : PIN number) +* @author +* @version Initial Creation V0.1 +* @date 2008.07.30 +*/ + +#include +#include +#include + +#include "tet_tapi_util.h" +#include "uts_tel_enable_sim_security.h" +#include "sim_common.h" +#include "async_util.h" + + +/* Initialize TCM data structures */ +static void startup(); +static void cleanup(); +void (*tet_startup) () = startup; +void (*tet_cleanup) () = cleanup; +struct tet_testlist tet_testlist[] = { + {utc_tel_enable_sim_security_01, 1}, + {utc_tel_enable_sim_security_02, 2}, + {utc_tel_enable_sim_security_03, 3}, + {utc_tel_enable_sim_security_04, 4}, + {utc_tel_enable_sim_security_05, 5}, + {utc_tel_enable_sim_security_06, 6}, + + {NULL, 0} +}; + +/* + User Defined Handler +*/ +// Global variable for user data +static BOOL gAsyncResult; //user defined data : Async callback is called or not +static TelSimPinOperationResult_t gSimEventStatus; + +/* Startup & Clean function : It is not test code, only for + initialize and finalize test module +*/ +static BOOL gStartupSuccess = FALSE; +static unsigned int subscription_id = 0; + +extern sim_info_t g_si; + +/* + G_MAIN Utility //////////////////////////////////////////////////////////////////////////// +*/ +// Prototype : User must add function body +gboolean g_timeout_callback (void *data); + +// GMainLoop global handler +GMainLoop *sim_loop = NULL; + +void G_MAIN_LOOP_CLOSE() +{ + g_main_loop_quit(sim_loop); +} + +int G_MAIN_LOOP_RUN(int sec) +{ + //GMainLoop *mainloop; + sim_loop = g_main_loop_new (NULL, FALSE); + g_timeout_add ( (sec * 1000), g_timeout_callback, NULL); + g_main_loop_run (sim_loop); + + return 0; +} + +gboolean g_timeout_callback (void *data) +{ + gAsyncResult = FALSE; + tet_printf("[TIME OUT] g_timeout called .Close g_main_roop()"); + G_MAIN_LOOP_CLOSE(); + return FALSE; +} +// End of G_MAIN Utility////////////////////////////////////////////////////////////////////// + + +static int sim_pin_process_for_condition(TelSimPinType_t wish_pin, TelSimPinStatus_t wish_condition) +{ + int pRequestId=0; + int tapiRet = TAPI_API_SUCCESS; + TelSimPinStatus_t pin_status = TAPI_SIM_PIN_STATUS_UNKNOWN; + TelSimSecPw_t sec_data; + memset(&sec_data, 0x00, sizeof(TelSimSecPw_t)); + + tet_printf("pin[%d]:0-pin1, 1-pin2, wish_condition[%d]: 0-dis, 1- enabled, 2-blocked(puk)",wish_pin, wish_condition); + + tapiRet = tel_get_sim_security_status(wish_pin,&pin_status); + if(tapiRet != TAPI_API_SUCCESS) + { + tet_printf("tel_get_sim_security_status is Failed with tapiRet[%d]", tapiRet); + return -1; + } + + if(pin_status == TAPI_SIM_PIN_STATUS_DISABLED ) + { + tet_printf("current pin status is TAPI_SIM_PIN_STATUS_DISABLED"); + } + else if(pin_status == TAPI_SIM_PIN_STATUS_ENABLED) + { + tet_printf("current pin status is TAPI_SIM_PIN_STATUS_ENABLED"); + } + else + { + tet_printf("current pin status is unhandled status[%d]",pin_status ); + return -1; + } + + if(pin_status == wish_condition ) + { + tet_printf("current pin status is same with wished condition"); + return 0; + } + else + { + tet_printf("current pin status is different with wished condition"); + sec_data.type = wish_pin; + + if(wish_pin == TAPI_SIM_PTYPE_PIN1 ) + { + sec_data.pw_len = strlen(g_si.pin1); + sec_data.pw = (unsigned char*)malloc(sec_data.pw_len); + memcpy(sec_data.pw,g_si.pin1,sec_data.pw_len); + } + else if(wish_pin == TAPI_SIM_PTYPE_PIN2) + { + sec_data.pw_len = strlen(g_si.pin2); + sec_data.pw = (unsigned char*)malloc(sec_data.pw_len); + memcpy(sec_data.pw,g_si.pin2,sec_data.pw_len); + } + + gAsyncResult = FALSE; + + if(wish_condition == TAPI_SIM_PIN_STATUS_DISABLED) + { + tet_printf("make pin status with wished condition(TAPI_SIM_PIN_STATUS_DISABLED)"); + + tapiRet = tel_disable_sim_security(&sec_data,&pRequestId); + } + else if(wish_condition == TAPI_SIM_PIN_STATUS_ENABLED) + { + tet_printf("make pin status with wished condition(TAPI_SIM_PIN_STATUS_ENABLED)"); + tapiRet = tel_enable_sim_security(&sec_data,&pRequestId); + } + else + { + tet_printf("Unhandled wish_condition[%d]", wish_condition); + return -1; + } + + if(tapiRet != TAPI_API_SUCCESS) + { + tet_printf("tapi return[%d] when en/disabling pin for condition",tapiRet); + return -1; + } + else + { + G_MAIN_LOOP_RUN(3); + } + + if(gAsyncResult == TRUE) + return 0; + else + return -1; + } + + return 0; +} + + +static int sim_app_callback (TelTapiEvent_t *sim_event) +{ + tet_printf("\n***************[SIM APP]Callback data **********************\n"); + tet_printf("[SIM]Reques Id[%d]\n", sim_event->RequestId); + tet_printf("[SIM]event status [%d]\n", sim_event->Status); + + gAsyncResult = FALSE; + BOOL bReceived = FALSE; + + switch(sim_event->EventType) + { + case TAPI_EVENT_SIM_ENABLE_SEC_CNF: + { + tet_printf("\n[SIM]*****************TAPI_EVENT_SIM_ENABLE_SEC_CNF (%d) ***************************\n", TAPI_EVENT_SIM_ENABLE_SEC_CNF); + tet_printf("SIM Enable PIN event status = [%x]\n", sim_event->Status); + + gSimEventStatus = sim_event->Status; + gAsyncResult = TRUE; + bReceived = TRUE; + } + break; + + case TAPI_EVENT_SIM_DISABLE_SEC_CNF: + { + tet_printf("\n[SIM]*****************TAPI_EVENT_SIM_DISABLE_SEC_CNF (%d) ***************************\n", TAPI_EVENT_SIM_DISABLE_SEC_CNF); + tet_printf("SIM Disable PIN event status = [%x]\n", sim_event->Status); + + gSimEventStatus = sim_event->Status; + gAsyncResult = TRUE; + bReceived = TRUE; + } + break; + + default: + { + gSimEventStatus = sim_event->Status; + gAsyncResult = FALSE; + tet_printf("[SIM]***************** Undhandled event type [%d] *****************\n",sim_event->EventType); + tet_printf("[SIM]Undhandled event state [%d]\n",sim_event->Status); + break; + } + }//end switch + + if (bReceived == TRUE) + G_MAIN_LOOP_CLOSE(); + return 0; +} + + +static void startup() +{ + tet_infoline("utc_tel_enable_sim_security Test Start\n"); + + sim_pin_info_setup(); + + if ( tel_init() == TAPI_API_SUCCESS) + { + tel_register_event(TAPI_EVENT_SIM_DISABLE_SEC_CNF,&subscription_id,(TelAppCallback)sim_app_callback,NULL); + tel_register_event(TAPI_EVENT_SIM_ENABLE_SEC_CNF,&subscription_id,(TelAppCallback)sim_app_callback,NULL); + + gStartupSuccess = TRUE; + + } else { + tet_infoline("startup fail. tel_init() failed"); + } + + tel_register_app_name("org.samsung.test"); + + tet_printf("Test precondition : Before test, you must PIN Lock Disabled!"); + + return; +} + + +static void cleanup() +{ + tet_infoline("utc_tel_enable_sim_security Test Finished\n"); + + if (gStartupSuccess == TRUE) + { + tel_deregister_event(subscription_id); + } + tel_deinit(); + return; +} + + +/* + Unit Test Case functions +*/ +/** +* @brief tel_enable_sim_security() API : Negative condition(Second parameter is Null) +* @par ID: UTC_TEL_ENABLE_SIM_SECURITY_01 +* @param [out] &pPindata +* @param [out] &pRequestId = NULL +* @return TAPI_API_INVALID_PTR +*/ +void utc_tel_enable_sim_security_01() +{ + TET_STAMP_START("Invalid pointer test"); + TET_RESULT_NOT_EQUAL(TET_UNTESTED,gStartupSuccess, TRUE); + + TelSimSecPw_t sec_data; + memset(&sec_data, 0x00, sizeof(TelSimSecPw_t)); + sec_data.type = TAPI_SIM_PTYPE_PIN1; + sec_data.pw_len = strlen(g_si.pin1); + sec_data.pw = (unsigned char*)malloc(sec_data.pw_len); + memcpy(sec_data.pw,g_si.pin1,sec_data.pw_len); + + TET_CHECK(TAPI_API_INVALID_PTR,tel_enable_sim_security(&sec_data,NULL)); + TET_STAMP_PASS(); + return; +} + +/** +* @brief tel_enable_sim_security() API : Negative condition(First parameter is Null) +* @par ID: UTC_TEL_ENABLE_SIM_SECURITY_02 +* @param [out] &pPindata = NULL +* @param [out] &pRequestId +* @return TAPI_API_INVALID_PTR +*/ +void utc_tel_enable_sim_security_02() +{ + TET_STAMP_START("Invalid pointer test 2"); + TET_RESULT_NOT_EQUAL(TET_UNTESTED,gStartupSuccess, TRUE); + + int pRequestId=0; + + TET_CHECK(TAPI_API_INVALID_PTR,tel_enable_sim_security(NULL,&pRequestId)); + TET_STAMP_PASS(); + return; +} + +/** +* @brief tel_enable_sim_security() API : Lower boundary test(Invalid pin type) +* @par ID: UTC_TEL_ENABLE_SIM_SECURITY_03 +* @param [out] &pPindata.PinType = TAPI_SIM_PTYPE_PIN1-1;//<---------Invalid +* @param [out] &pRequestId +* @return TAPI_API_INVALID_INPUT +*/ +void utc_tel_enable_sim_security_03() +{ + TET_STAMP_START("Invalid Input - Lower boundary"); + TET_RESULT_NOT_EQUAL(TET_UNTESTED,gStartupSuccess, TRUE); + + int pRequestId = 0; + TelSimSecPw_t sec_data; + memset(&sec_data, 0x00, sizeof(TelSimSecPw_t)); + sec_data.type = TAPI_SIM_PTYPE_PIN1 -1; + sec_data.pw_len = strlen(g_si.pin1); + sec_data.pw = (unsigned char*)malloc(sec_data.pw_len); + memcpy(sec_data.pw,g_si.pin1,sec_data.pw_len); + + TET_CHECK(TAPI_API_INVALID_INPUT,tel_enable_sim_security(&sec_data,&pRequestId)); + TET_STAMP_PASS(); + return; +} + +/** +* @brief tel_enable_sim_security() API : Upper boundary test(Invalid pin type) +* @par ID: UTC_TEL_ENABLE_SIM_SECURITY_04 +* @param [out] &pPindata.PinType = TAPI_SIM_PTYPE_ADM+1;//<---------Invalid +* @param [out] &pRequestId +* @return TAPI_API_INVALID_INPUT +*/ +void utc_tel_enable_sim_security_04() +{ + TET_STAMP_START("Invalid Input 2"); + TET_RESULT_NOT_EQUAL(TET_UNTESTED,gStartupSuccess, TRUE); + + int pRequestId = 0; + TelSimSecPw_t sec_data; + memset(&sec_data, 0x00, sizeof(TelSimSecPw_t)); + sec_data.type = TAPI_SIM_PTYPE_SIM +1; + sec_data.pw_len = strlen(g_si.pin1); + sec_data.pw = (unsigned char*)malloc(sec_data.pw_len); + memcpy(sec_data.pw,g_si.pin1,sec_data.pw_len); + + TET_CHECK(TAPI_API_INVALID_INPUT,tel_enable_sim_security(&sec_data,&pRequestId)); + TET_STAMP_PASS(); + return; +} + +/** +* @brief tel_enable_sim_security() API : Invalid parameter +* @par ID: UTC_TEL_ENABLE_SIM_SECURITY_05 +* @param [out] &pPindata.szPinCode = PIN1_INCORRECT; +* @param [out] &pRequestId +* @return TAPI_API_SUCCESS +* @par Async Response Message: +* The event received is below and the event data is #TelSimPinInfo_t. \n +* (Asynchronous return status is indicated by #TelSimPinOperationResult_t.) +* - TAPI_EVENT_SIM_ENABLE_PIN_CNF (TAPI_SIM_PIN_INCORRECT_PASSWORD) +*/ +void utc_tel_enable_sim_security_05() +{ + TET_STAMP_START("Incorrect password test"); + TET_RESULT_NOT_EQUAL(TET_UNTESTED,gStartupSuccess, TRUE); + + // Step 1 : make proper condition + tet_printf("Step 1 : disable pin"); + + if( 0 != sim_pin_process_for_condition(TAPI_SIM_PTYPE_PIN1,TAPI_SIM_PIN_STATUS_DISABLED)) + { + tet_printf("condition set is failed!!"); + return; + } + + // Step 2 : enable pin + tet_printf("Step 2 : enable pin"); + int pRequestId = 0; + int tapiRet = TAPI_API_SUCCESS; + TelSimSecPw_t sec_data; + memset(&sec_data, 0x00, sizeof(TelSimSecPw_t)); + sec_data.type = TAPI_SIM_PTYPE_PIN1; + sec_data.pw_len = strlen(g_si.wpin1); + sec_data.pw = (unsigned char*)malloc(sec_data.pw_len); + memcpy(sec_data.pw,g_si.wpin1,sec_data.pw_len); + + gAsyncResult = FALSE; + + tapiRet = tel_enable_sim_security(&sec_data,&pRequestId); + TET_RESULT_NOT_EQUAL(TET_FAIL,TAPI_API_SUCCESS,tapiRet); + + + tet_printf("after real tc api - wait start"); + + G_MAIN_LOOP_RUN(3); + + tet_printf("after real tc api - wait stop"); + + + TET_RESULT_NOT_EQUAL(TET_FAIL,gAsyncResult,TRUE); // If gAsyncResult != TRUE, then TET_FAIL and return + TET_RESULT_NOT_EQUAL(TET_FAIL,TAPI_SIM_PIN_INCORRECT_PASSWORD, gSimEventStatus); // If gSimEventStatus != TAPI_SIM_PIN_INCORRECT_PASSWORD, then TET_FAIL and return + TET_STAMP_PASS(); + tet_printf("finish case"); + return; + +} + + +/** +* @brief tel_enable_sim_security() API : Positive condition +* @par ID: UTC_TEL_ENABLE_SIM_SECURITY_05 +* @param [out] &pPindata.szPinCode = PIN1_NORMAL; +* @param [out] &pRequestId +* @return TAPI_API_SUCCESS +* @par Async Response Message: +* The event received is below and the event data is #TelSimPinInfo_t. \n +* (Asynchronous return status is indicated by #TelSimPinOperationResult_t.) +* - TAPI_EVENT_SIM_ENABLE_PIN_CNF (TAPI_SIM_PIN_OPERATION_SUCCESS) +*/ +void utc_tel_enable_sim_security_06() +{ + TET_STAMP_START("Normal operation test"); + TET_RESULT_NOT_EQUAL(TET_UNTESTED,gStartupSuccess, TRUE); + + // Step 1 : make proper condition + tet_printf("Step 1 : disable pin"); + + if( 0 != sim_pin_process_for_condition(TAPI_SIM_PTYPE_PIN1,TAPI_SIM_PIN_STATUS_DISABLED)) + { + tet_printf("condition set is failed!!"); + return; + } + + // Step 2 : enable pin + tet_printf("Step 2 : enable pin"); + int pRequestId = 0; + int tapiRet = TAPI_API_SUCCESS; + TelSimSecPw_t sec_data; + memset(&sec_data, 0x00, sizeof(TelSimSecPw_t)); + sec_data.type = TAPI_SIM_PTYPE_PIN1; + sec_data.pw_len = strlen(g_si.pin1); + sec_data.pw = (unsigned char*)malloc(sec_data.pw_len); + memcpy(sec_data.pw,g_si.pin1,sec_data.pw_len); + + gAsyncResult = FALSE; + + tapiRet = tel_enable_sim_security(&sec_data,&pRequestId); + TET_RESULT_NOT_EQUAL(TET_FAIL,TAPI_API_SUCCESS,tapiRet); + + tet_printf("after real tc api - wait start"); + + G_MAIN_LOOP_RUN(3); + + tet_printf("after real tc api - wait stop"); + + + TET_RESULT_NOT_EQUAL_GOTO(TET_FAIL,exit,gAsyncResult,TRUE); // If gAsyncResult != FALSE, then TET_FAIL and return + TET_RESULT_NOT_EQUAL_GOTO(TET_FAIL,exit,TAPI_SIM_PIN_OPERATION_SUCCESS, gSimEventStatus); // If gSimEventStatus != TAPI_SIM_PIN_INCORRECT_PASSWORD, then TET_FAIL and return + TET_RESULT_EQUAL_GOTO(TET_PASS,exit,TAPI_SIM_PIN_OPERATION_SUCCESS, gSimEventStatus); // If gSimEventStatus != TAPI_SIM_PIN_INCORRECT_PASSWORD, then TET_FAIL and return + +exit: + // Step 3 : make default condition + tet_printf("Step 3 : disable pin"); + + if( 0 != sim_pin_process_for_condition(TAPI_SIM_PTYPE_PIN1,TAPI_SIM_PIN_STATUS_DISABLED)) + { + tet_printf("condition set is failed!!"); + } + tet_printf("finish case"); + return; +} + + +/** @} */ diff --git a/TC/telephony_TC/sim/unit/uts_tel_enable_sim_security.h b/TC/telephony_TC/sim/unit/uts_tel_enable_sim_security.h new file mode 100644 index 0000000..94b31e9 --- /dev/null +++ b/TC/telephony_TC/sim/unit/uts_tel_enable_sim_security.h @@ -0,0 +1,33 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * 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 _uts_tel_enable_sim_security_H_ +#define _uts_tel_enable_sim_security_H_ + + static void utc_tel_enable_sim_security_01(); + static void utc_tel_enable_sim_security_02(); + static void utc_tel_enable_sim_security_03(); + static void utc_tel_enable_sim_security_04(); + static void utc_tel_enable_sim_security_05(); + static void utc_tel_enable_sim_security_06(); + +#endif + diff --git a/TC/telephony_TC/sim/unit/uts_tel_get_sim_callforwarding_info.c b/TC/telephony_TC/sim/unit/uts_tel_get_sim_callforwarding_info.c new file mode 100644 index 0000000..dc2d0f5 --- /dev/null +++ b/TC/telephony_TC/sim/unit/uts_tel_get_sim_callforwarding_info.c @@ -0,0 +1,165 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +/** +* @ingroup TELEPHONY_API +* @addtogroup TAPI_API_SIM_SAT SIM/SAT +*/ + +/** +* @ingroup TAPI_API_SIM_SAT +* @addtogroup UTS_SIM_SAT Unit +*/ + +/** +* @ingroup UTS_SIM_SAT +* @addtogroup UTS_TAPI_SIM_GET_CALLFORWARDING_INFO tel_get_sim_callforwarding_info +* +* @brief Unit test code for tel_get_sim_callforwarding_info() +* @par Test function Prototype: +* int tel_get_sim_callforwarding_info(TelSimCallForwarding_s *cf); +* @par Test function description: +* This function is used to get callforwarding indication Information +* @par Important Notes: +* None +* @param [out] cf This parameter returns the callforwarding indication information +* @code +* typedef struct +* { +* int b_cphs; // current data is from CPHS SIM or not +* union{ +* TelSimCphsCallForwardingFlagInfo_t cphs_cf; // information from CPHS SIM +* TelSimCallForwardingIndicationStatus_t cf; // information from 3GPP SIM +* }cf_data_u; +* }TelSimCallForwarding_s; +* @endcode +* @par Async Response Message: +* None +* @pre +* None +* @post +* None +* @return +* Return Type : (int) +* - TAPI_API_SUCCESS - indicating that the operation has completed successfully. +* - Otherwise it provides an error code (Refer #TapiResult_t) +* @{ +*/ + +/** +* @file uts_tel_get_sim_callforwarding_info.c +* @brief Test for the tel_get_sim_callforwarding_info() API that is used to get callforwarding indication information +* @author +* @version Initial Creation V0.1 +* @date 2011.08.29 +*/ + +#include +#include +#include "tet_tapi_util.h" +#include "uts_tel_get_sim_callforwarding_info.h" +#include "sim_common.h" + +/* Initialize TCM data structures */ +static void startup(); +static void cleanup(); +void (*tet_startup) () = startup; +void (*tet_cleanup) () = cleanup; +struct tet_testlist tet_testlist[] = { + {utc_tel_get_sim_callforwarding_info_01, 1}, + {utc_tel_get_sim_callforwarding_info_02, 2}, + {NULL, 0} +}; + +/* Startup & Clean function : It is not test code, only for + initialize and finalize test module +*/ +static void startup() +{ + tet_infoline("uts_tel_get_sim_callforwarding_info Test Start\n"); + if (tel_init() != TAPI_API_SUCCESS) + { + tet_infoline("startup fail. tel_init() failed"); + } + return; +} + + +static void cleanup() +{ + tet_infoline("uts_tel_get_sim_callforwarding_info Test Finished\n"); + if (tel_deinit() != TAPI_API_SUCCESS) + { + tet_infoline("startup fail. tel_deinit() failed"); + } + return; +} + + +/* + Unit Test Case functions +*/ +/** +* @brief tel_get_sim_callforwarding_info() API : Positive condition(Get callforwarding Information) +* @par ID: UTC_TEL_GET_SIM_CALLFORWARDING_INFO_01 +* @param [out] &cf +* @return TAPI_API_SUCCESS +* @par Expected Result: +* - call forwarding information +*/ +void utc_tel_get_sim_callforwarding_info_01() +{ + TET_STAMP_START("Normal operation"); + TelSimCallForwarding_s cf; + + TET_CHECK(TAPI_API_SUCCESS, tel_get_sim_callforwarding_info(&cf)); + + if( cf.b_cphs == 0 || cf.b_cphs == 1) + { + tet_printf("b_cphs[%d]",cf.b_cphs); + TET_STAMP_PASS(); + return; + } + else + { + TET_STAMP_FAIL(); + return; + } + return; +} + +/** +* @brief tel_get_sim_callforwarding_info() API : Negative condition(Null Parameter test) +* @par ID: UTC_TEL_GET_SIM_CALLFORWARDING_INFO_02 +* @param [out] &cf = NULL +* @return TAPI_API_INVALID_PTR +*/ +void utc_tel_get_sim_callforwarding_info_02() +{ + TET_STAMP_START("null pointer operation"); + TelSimCallForwarding_s cf; + + TET_CHECK(TAPI_API_INVALID_PTR, tel_get_sim_callforwarding_info(NULL)); + TET_STAMP_PASS(); + return; +} + +/** @} */ diff --git a/TC/telephony_TC/sim/unit/uts_tel_get_sim_callforwarding_info.h b/TC/telephony_TC/sim/unit/uts_tel_get_sim_callforwarding_info.h new file mode 100644 index 0000000..4337ca6 --- /dev/null +++ b/TC/telephony_TC/sim/unit/uts_tel_get_sim_callforwarding_info.h @@ -0,0 +1,58 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** +* @ingroup TELEPHONY_FRAMEWORK_API +* @addtogroup SIM +*/ + +/** +* @ingroup SIM +* @addtogroup UTS_TEL_GET_SIM_CALLFORWADING_INFO Unit +*/ + +/** +* @ingroup UTS_TEL_GET_SIM_CALLFORWADING_INFO Unit +* @addtogroup UTS_TEL_GET_SIM_CALLFORWADING_INFO_ Uts_tel_get_sim_callforwarding_info +* @{ +*/ + +/** +* @file uts_tel_get_sim_callforwarding_info.h +* @brief This is a suit of unit test cases to test tel_get_sim_callforwarding_info() API function +* @author +* @version Initial Creation Version 0.1 +* @date 2011.08.29 +*/ + + +#include +#include +#include +#include + +#include "tet_tapi_util.h" +#include "sim_common.h" + +#ifndef _UTS_TEL_GET_SIM_CALLFORWADING_INFO_H_ +#define _UTS_TEL_GET_SIM_CALLFORWADING_INFO_H_ + static void utc_tel_get_sim_callforwarding_info_01 (); + static void utc_tel_get_sim_callforwarding_info_02 (); +#endif diff --git a/TC/telephony_TC/sim/unit/uts_tel_get_sim_cphs_info.c b/TC/telephony_TC/sim/unit/uts_tel_get_sim_cphs_info.c new file mode 100644 index 0000000..f73d975 --- /dev/null +++ b/TC/telephony_TC/sim/unit/uts_tel_get_sim_cphs_info.c @@ -0,0 +1,168 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +/** +* @ingroup TELEPHONY_API +* @addtogroup TAPI_API_SIM_SAT SIM/SAT +*/ + +/** +* @ingroup TAPI_API_SIM_SAT +* @addtogroup UTS_SIM_SAT Unit +*/ + +/** +* @ingroup UTS_SIM_SAT +* @addtogroup UTS_TAPI_SIM_GET_CPHS_INFO tel_get_sim_cphs_info +* +* @brief Unit test code for tel_get_sim_cphs_info() +* @par Test function Prototype: +* int tel_get_sim_cphs_info(TelSimCphsLocalInfo_t *cphs); +* @par Test function description: +* This function is used to get CPHS specific Information +* @par Important Notes: +* None +* @param [out] cphs This parameter returns the CPHS specific information +* @code +* typedef struct +* { +* int b_used; // used or not +* TelSimCphsInfo_t cphsinfo; // cphs information +* TelSimCphsCustomerServiceProfileInfo_t csp; // customer service profile +* TelSimCphsInformationNum_t infn; // information numbers +* TelSimCphsOperatorName_t opname; // operator name +* TelSimCphsOperatorShortName_t opshortform; //operator short form +* TelSimDynamicFlagsInfo_t dflagsinfo; // Dynamic flags +* TelSimDynamic2FlagsInfo_t d2flagsinfo; // Dynamic2 flags +* }TelSimCphsLocalInfo_t; +* @endcode +* @par Async Response Message: +* None +* @pre +* None +* @post +* None +* @return +* Return Type : (int) +* - TAPI_API_SUCCESS - indicating that the operation has completed successfully. +* - Otherwise it provides an error code (Refer #TapiResult_t) +* @{ +*/ + +/** +* @file uts_tel_get_sim_cphs_info.c +* @brief Test for the tel_get_sim_cphs_info() API that is used to get CPHS specific information +* @author +* @version Initial Creation V0.1 +* @date 2011.08.29 +*/ + +#include +#include +#include "tet_tapi_util.h" +#include "uts_tel_get_sim_cphs_info.h" +#include "sim_common.h" + +/* Initialize TCM data structures */ +static void startup(); +static void cleanup(); +void (*tet_startup) () = startup; +void (*tet_cleanup) () = cleanup; +struct tet_testlist tet_testlist[] = { + {utc_tel_get_sim_cphs_info_01, 1}, + {utc_tel_get_sim_cphs_info_02, 2}, + {NULL, 0} +}; + +/* Startup & Clean function : It is not test code, only for + initialize and finalize test module +*/ +static void startup() +{ + tet_infoline("uts_tel_get_sim_cphs_info Test Start\n"); + if (tel_init() != TAPI_API_SUCCESS) + { + tet_infoline("startup fail. tel_init() failed"); + } + return; +} + + +static void cleanup() +{ + tet_infoline("uts_tel_get_sim_cphs_info Test Finished\n"); + if (tel_deinit() != TAPI_API_SUCCESS) + { + tet_infoline("startup fail. tel_deinit() failed"); + } + return; +} + + +/* + Unit Test Case functions +*/ +/** +* @brief tel_get_sim_cphs_info() API : Positive condition(Get CPHS specific Information) +* @par ID: UTC_TEL_GET_SIM_CPHS_INFO_01 +* @param [out] &cphs +* @return TAPI_API_SUCCESS +* @par Expected Result: +* - CPHS information +*/ +void utc_tel_get_sim_cphs_info_01() +{ + TET_STAMP_START("Normal operation"); + TelSimCphsLocalInfo_t cphs; + + TET_CHECK(TAPI_API_SUCCESS, tel_get_sim_cphs_info(&cphs)); + + if( cphs.b_used == 0 || cphs.b_used == 1) + { + tet_printf("b_used[%d]",cphs.b_used); + TET_STAMP_PASS(); + return; + } + else + { + TET_STAMP_FAIL(); + return; + } + return; +} + +/** +* @brief tel_get_sim_cphs_info() API : Negative condition(Null Parameter test) +* @par ID: UTC_TEL_GET_SIM_CPHS_INFO_02 +* @param [out] &cphs = NULL +* @return TAPI_API_INVALID_PTR +*/ +void utc_tel_get_sim_cphs_info_02() +{ + TET_STAMP_START("null pointer operation"); + TelSimCphsLocalInfo_t cphs; + + TET_CHECK(TAPI_API_INVALID_PTR, tel_get_sim_cphs_info(NULL)); + TET_STAMP_PASS(); + return; +} + +/** @} */ diff --git a/TC/telephony_TC/sim/unit/uts_tel_get_sim_cphs_info.h b/TC/telephony_TC/sim/unit/uts_tel_get_sim_cphs_info.h new file mode 100644 index 0000000..b561f7a --- /dev/null +++ b/TC/telephony_TC/sim/unit/uts_tel_get_sim_cphs_info.h @@ -0,0 +1,58 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** +* @ingroup TELEPHONY_FRAMEWORK_API +* @addtogroup SIM +*/ + +/** +* @ingroup SIM +* @addtogroup UTS_TEL_GET_SIM_CPHS_INFO Unit +*/ + +/** +* @ingroup UTS_TEL_GET_SIM_CPHS_INFO Unit +* @addtogroup UTS_TEL_GET_SIM_CPHS_INFO Uts_tel_get_sim_cphs_info +* @{ +*/ + +/** +* @file uts_tel_get_sim_cphs_info.h +* @brief This is a suit of unit test cases to test tel_get_sim_cphs_info() API function +* @author +* @version Initial Creation Version 0.1 +* @date 2011.08.29 +*/ + + +#include +#include +#include +#include + +#include "tet_tapi_util.h" +#include "sim_common.h" + +#ifndef _UTS_TEL_GET_SIM_CPHS_INFO_H_ +#define _UTS_TEL_GET_SIM_CPHS_INFO_H_ + static void utc_tel_get_sim_cphs_info_01 (); + static void utc_tel_get_sim_cphs_info_02 (); +#endif diff --git a/TC/telephony_TC/sim/unit/uts_tel_get_sim_ecc.c b/TC/telephony_TC/sim/unit/uts_tel_get_sim_ecc.c new file mode 100644 index 0000000..e626ba1 --- /dev/null +++ b/TC/telephony_TC/sim/unit/uts_tel_get_sim_ecc.c @@ -0,0 +1,179 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +/** +* @ingroup TELEPHONY_API +* @addtogroup TAPI_API_SIM_SAT SIM/SAT +*/ + +/** +* @ingroup TAPI_API_SIM_SAT +* @addtogroup UTS_SIM_SAT Unit +*/ + +/** +* @ingroup UTS_SIM_SAT +* @addtogroup UTS_TAPI_SIM_GET_ECC_INFO tel_get_sim_ecc +* +* @brief Unit test code for tel_get_sim_ecc() +* @par Test function Prototype: +* TapiResult_t tel_get_sim_ecc(TelSimEccData_t* pSimEccInfo, int *pCount); +* @par Test function description: +* This function is a synchronous API used to get ECC data. +* @par Important Notes: +* None +* @param [out] pSimEccInfo +* This parameter returns the SIM emergency call code information like ecc length, service type etc. +* @param [out] pCount +* Specifies number of ECC records. +* @par Async Response Message: +* None +* @pre +* None +* @post +* None +* @return +* Return Type : (TapiResult_t) +* - TAPI_API_SUCCESS - indicating that the operation has completed successfully. +* - Otherwise it provides an error code (Refer #TapiResult_t) +* @{ +*/ + +/** +* @file uts_tel_get_sim_ecc.c +* @brief Test for the tel_get_sim_ecc() API that is used to get ecc info(Card type) +* @author +* @version Initial Creation V0.1 +* @date 2008.07.30 +*/ + +#include +#include +#include "tet_tapi_util.h" +#include "uts_tel_get_sim_ecc.h" +#include "sim_common.h" + +/* Initialize TCM data structures */ +static void startup(); +static void cleanup(); +void (*tet_startup) () = startup; +void (*tet_cleanup) () = cleanup; +struct tet_testlist tet_testlist[] = { + {utc_tel_get_sim_ecc_01, 1}, + {utc_tel_get_sim_ecc_02, 2}, + {utc_tel_get_sim_ecc_03, 3}, + {NULL, 0} +}; + +/* Startup & Clean function : It is not test code, only for + initialize and finalize test module +*/ +static void startup() +{ + tet_infoline("uts_tel_get_sim_ecc Test Start\n"); + tel_register_app_name("org.samsung.test"); + return; +} + + +static void cleanup() +{ + tet_infoline("uts_tel_get_sim_ecc Test Finished\n"); + return; +} + +/** +* @brief tel_get_sim_ecc() API : Normal opertion +* @par ID: UTC_TEL_GET_SIM_ECC_01 +* @param [out] &ecc_info +* @param [out] &ecc_rec_count +* @return TAPI_API_SUCCESS +*/ +void utc_tel_get_sim_ecc_01() +{ + TET_STAMP_START("Normal test"); + int ecc_rec_count = 0; + TelSimEccData_t ecc_info; + memset(&ecc_info, 0, sizeof(ecc_info)); + + TET_CHECK(TAPI_API_SUCCESS, tel_get_sim_ecc(&ecc_info, &ecc_rec_count)); + + tet_printf("EEC count [%d]\n",ecc_rec_count); + + int i; + for (i=0 ; i + * + * 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 _uts_tel_get_sim_ecc_H_ +#define _uts_tel_get_sim_ecc_H_ + + static void utc_tel_get_sim_ecc_01(); + static void utc_tel_get_sim_ecc_02(); + static void utc_tel_get_sim_ecc_03(); + +#endif + + diff --git a/TC/telephony_TC/sim/unit/uts_tel_get_sim_fdn_status.c b/TC/telephony_TC/sim/unit/uts_tel_get_sim_fdn_status.c new file mode 100644 index 0000000..b87ef15 --- /dev/null +++ b/TC/telephony_TC/sim/unit/uts_tel_get_sim_fdn_status.c @@ -0,0 +1,147 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +/** +* @ingroup TELEPHONY_API +* @addtogroup TAPI_API_SIM_SAT SIM/SAT +*/ + +/** +* @ingroup TAPI_API_SIM_SAT +* @addtogroup UTS_SIM_SAT Unit +*/ + +/** +* @ingroup UTS_SIM_SAT +* @addtogroup UTS_TAPI_SIM_GET_FDN_STATUS tel_get_sim_fdn_status +* +* @brief Unit test code for tel_get_sim_fdn_status() +* @par Test function Prototype: +* TapiResult_t tel_get_sim_fdn_status(BOOL *pFdnStatus); +* @par Test function description: +* This function is a synchronous API gets the current FDN status. +* @par Important Notes: +* None +* @param [out] pFdnStatus +* This parameter returns the current fdn status whether enabled or disabled. +* @par Async Response Message: +* None +* @pre +* None +* @post +* None +* @return +* Return Type : (TapiResult_t) +* - TAPI_API_SUCCESS - indicating that the operation has completed successfully. +* - Otherwise it provides an error code (Refer #TapiResult_t) +* @{ +*/ + +/** +* @file uts_tel_get_sim_fdn_status.c +* @brief Test for the tel_get_sim_fdn_status() API that is used to get fdn status +* @author +* @version Initial Creation V0.1 +* @date 2008.07.30 +*/ + +#include +#include +#include + +#include "tet_tapi_util.h" +#include "uts_tel_get_sim_fdn_status.h" +#include "sim_common.h" + +/* Initialize TCM data structures */ +static void startup(); +static void cleanup(); +void (*tet_startup) () = startup; +void (*tet_cleanup) () = cleanup; +struct tet_testlist tet_testlist[] = { + {utc_tel_get_sim_fdn_status_01, 1}, + {utc_tel_get_sim_fdn_status_02, 2}, + {NULL, 0} +}; + +/* Startup & Clean function : It is not test code, only for + initialize and finalize test module +*/ +static void startup() +{ + tet_infoline("utc_tel_get_sim_fdn_status Test Start\n"); + if (tel_init() != TAPI_API_SUCCESS) + { + tet_infoline("startup fail. tel_init() failed"); + } + return; +} + + +static void cleanup() +{ + tet_infoline("utc_tel_get_sim_fdn_status Test Finished\n"); + if (tel_deinit() != TAPI_API_SUCCESS) + { + tet_infoline("startup fail. tel_deinit() failed"); + } + return; +} + + + +/* + Unit Test Case functions +*/ + +/** +* @brief tel_get_sim_fdn_status() API : Positive condition(Get FDN Status) +* @par ID: UTC_TEL_GET_SIM_FDN_STATUS_01 +* @param [out] &fdn_status +* @return TAPI_API_SUCCESS +*/ +void utc_tel_get_sim_fdn_status_01() +{ + BOOL fdn_status = 0; + + TET_STAMP_START("all valid input parameter test"); + TET_CHECK(TAPI_API_SUCCESS, tel_get_sim_fdn_status(&fdn_status)); + tet_printf(" FDN status is %d", fdn_status); + TET_STAMP_PASS(); + return; +} + +/** +* @brief tel_get_sim_fdn_status() API : Negative condition(Parameter is Null) +* @par ID: UTC_TEL_GET_SIM_FDN_STATUS_02 +* @param [out] &fdn_status = NULL +* @return TAPI_API_SUCCESS +*/ +void utc_tel_get_sim_fdn_status_02() +{ + TET_STAMP_START("NULL parameter test"); + + TET_CHECK(TAPI_API_INVALID_PTR, tel_get_sim_fdn_status(NULL)); + TET_STAMP_PASS(); + return; +} + +/** @} */ diff --git a/TC/telephony_TC/sim/unit/uts_tel_get_sim_fdn_status.h b/TC/telephony_TC/sim/unit/uts_tel_get_sim_fdn_status.h new file mode 100644 index 0000000..31fb1b2 --- /dev/null +++ b/TC/telephony_TC/sim/unit/uts_tel_get_sim_fdn_status.h @@ -0,0 +1,28 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * 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 _uts_tel_get_sim_fdn_status_h_ +#define _uts_tel_get_sim_fdn_status_h_ + + static void utc_tel_get_sim_fdn_status_01(); + static void utc_tel_get_sim_fdn_status_02(); + +#endif diff --git a/TC/telephony_TC/sim/unit/uts_tel_get_sim_imsi.c b/TC/telephony_TC/sim/unit/uts_tel_get_sim_imsi.c new file mode 100644 index 0000000..6943b75 --- /dev/null +++ b/TC/telephony_TC/sim/unit/uts_tel_get_sim_imsi.c @@ -0,0 +1,173 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +/** +* @ingroup TELEPHONY_API +* @addtogroup TAPI_API_SIM_SAT SIM/SAT +*/ + +/** +* @ingroup TAPI_API_SIM_SAT +* @addtogroup UTS_SIM_SAT Unit +*/ + +/** +* @ingroup UTS_SIM_SAT +* @addtogroup UTS_TAPI_SIM_GET_IMSI_INFO tel_get_sim_imsi +* +* @brief Unit test code for tel_get_sim_imsi() +* @par Test function Prototype: +* TapiResult_t tel_get_sim_imsi(TelSimImsiInfo_t* pSimImsiInfo); +* @par Test function description: +* This function is used to get ISMI Information +* @par Important Notes: +* None +* @param [out] pSimImsiInfo This parameter returns the IMSI information +* @code +typedef struct +{ + BOOL bValid; // Valid(ACTIVATE) IMSI (TRUE) or Deactivated (FALSE) + char szMcc[TAPI_SIM_MCC_CODE_LEN+1]; // mobile country code + char szMnc[TAPI_SIM_MNC_CODE_LEN+1]; // mobile network code + char szMsin[TAPI_SIM_MSIN_CODE_LEN+1]; // mobile station identification number +} TelSimImsiInfo_t; +* @endcode +* @par Async Response Message: +* None +* @pre +* None +* @post +* None +* @return +* Return Type : (TapiResult_t) +* - TAPI_API_SUCCESS - indicating that the operation has completed successfully. +* - Otherwise it provides an error code (Refer #TapiResult_t) +* @{ +*/ + +/** +* @file uts_tel_get_sim_imsi.c +* @brief Test for the tel_get_sim_imsi() API that is used to get imsi information +* @author +* @version Initial Creation V0.1 +* @date 2008.07.30 +*/ + +#include +#include +#include "tet_tapi_util.h" +#include "uts_tel_get_sim_imsi.h" +#include "sim_common.h" + +/* Initialize TCM data structures */ +static void startup(); +static void cleanup(); +void (*tet_startup) () = startup; +void (*tet_cleanup) () = cleanup; +struct tet_testlist tet_testlist[] = { + {utc_tel_get_sim_imsi_01, 1}, + {utc_tel_get_sim_imsi_02, 2}, + {NULL, 0} +}; + +/* Startup & Clean function : It is not test code, only for + initialize and finalize test module +*/ +static void startup() +{ + tet_infoline("uts_tel_get_sim_imsi Test Start\n"); + if (tel_init() != TAPI_API_SUCCESS) + { + tet_infoline("startup fail. tel_init() failed"); + } + return; +} + + +static void cleanup() +{ + tet_infoline("uts_tel_get_sim_imsi Test Finished\n"); + if (tel_deinit() != TAPI_API_SUCCESS) + { + tet_infoline("startup fail. tel_deinit() failed"); + } + return; +} + + +/* + Unit Test Case functions +*/ +/** +* @brief tel_get_sim_imsi() API : Positive condition(Get IMSI Information) +* @par ID: UTC_TEL_GET_SIM_IMSI_01 +* @param [out] &sim_imsi_info +* @return TAPI_API_SUCCESS +* @par Expected Result: +* - sim_imsi_info.szMcc != NULL // mobile country code is returned +* - sim_imsi_info.szMnc != NULL // mobile network code is returned +* - sim_imsi_info.szMsin != NULL // mobile station identification number is returned +*/ +void utc_tel_get_sim_imsi_01() +{ + TET_STAMP_START("Normal operation"); + TelSimImsiInfo_t sim_imsi_info; + + TET_CHECK(TAPI_API_SUCCESS, tel_get_sim_imsi(&sim_imsi_info)); + + if( sim_imsi_info.szMcc != NULL + && sim_imsi_info.szMnc != NULL + && sim_imsi_info.szMsin != NULL) + { + tet_printf("[SIM APP] IMSI [mcc,mnc,msin]= "); + tet_printf(" [%s]",sim_imsi_info.szMcc); + tet_printf(" [%s]",sim_imsi_info.szMnc); + tet_printf(" [%s]",sim_imsi_info.szMsin); + TET_STAMP_PASS(); + return; + } + else + { + tet_printf("[SIM APP] IMSI error [mcc,mnc,msin]=[%x,%x,%x]\n", + sim_imsi_info.szMcc, sim_imsi_info.szMnc, + sim_imsi_info.szMsin); + TET_STAMP_FAIL(); + return; + } + return; +} + +/** +* @brief tel_get_sim_imsi() API : Negative condition(Null Parameter test) +* @par ID: UTC_TEL_GET_SIM_IMSI_02 +* @param [out] &sim_imsi_info = NULL +* @return TAPI_API_INVALID_PTR +*/ +void utc_tel_get_sim_imsi_02() +{ + TET_STAMP_START("null pointer operation"); + + TET_CHECK(TAPI_API_INVALID_PTR, tel_get_sim_imsi(NULL)); + TET_STAMP_PASS(); + return; +} + +/** @} */ diff --git a/TC/telephony_TC/sim/unit/uts_tel_get_sim_imsi.h b/TC/telephony_TC/sim/unit/uts_tel_get_sim_imsi.h new file mode 100644 index 0000000..a5fcec8 --- /dev/null +++ b/TC/telephony_TC/sim/unit/uts_tel_get_sim_imsi.h @@ -0,0 +1,29 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * 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 _uts_tel_get_sim_imsi_H_ +#define _uts_tel_get_sim_imsi_H_ + + static void utc_tel_get_sim_imsi_01(); + static void utc_tel_get_sim_imsi_02(); + +#endif + diff --git a/TC/telephony_TC/sim/unit/uts_tel_get_sim_init_info.c b/TC/telephony_TC/sim/unit/uts_tel_get_sim_init_info.c new file mode 100644 index 0000000..b7ed5d4 --- /dev/null +++ b/TC/telephony_TC/sim/unit/uts_tel_get_sim_init_info.c @@ -0,0 +1,114 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** +* @ingroup TELEPHONY_FRAMEWORK_API +* @addtogroup SIM +*/ + +/** +* @ingroup SIM +* @addtogroup UTS_TEL_GET_SIM_INIT_INFO Unit +*/ + +/** +* @ingroup UTS_TEL_GET_SIM_INIT_INFO Unit +* @addtogroup UTS_TEL_GET_SIM_INIT_INFO_ Uts_Tel_Get_Sim_Init_Info +* @{ +*/ + +/** +* @file uts_tel_get_sim_init_info.c +* @brief This is a suit of unit test cases to test tel_get_sim_init_info() API function +* @author Gautam Nand Sinha (gnand.sinha@samsung.com) +* @version Initial Creation Version 0.1 +* @date 2010.06.29 +*/ + + +#include "uts_tel_get_sim_init_info.h" + + +/* Initialize TCM data structures */ +static void startup(); +static void cleanup(); +void (*tet_startup) () = startup; +void (*tet_cleanup) () = cleanup; +struct tet_testlist tet_testlist[] = { + {utc_tel_get_sim_init_info_01, 1}, + {utc_tel_get_sim_init_info_02, 2}, + {NULL, 0} +}; + + + +static void startup() +{ + tet_infoline("utc_tel_get_sim_init_info Test Start\n"); + if ( tel_init() != TAPI_API_SUCCESS) + { + tet_infoline("startup fail. tel_init() failed"); + } + return; +} + + +static void cleanup() +{ + tet_infoline("utc_tel_get_sim_init_info Test Finished\n"); + if ( tel_deinit() != TAPI_API_SUCCESS) + { + tet_infoline("startup fail. tel_deinit() failed"); + } + return; +} + + +void utc_tel_get_sim_init_info_01() +{ + TET_STAMP_START("utc_tel_get_sim_init_info_01"); + + int changed=0,err; + TelSimCardStatus_t sim_status = 0x00 ; + err = tel_get_sim_init_info(&sim_status,&changed); + if(err == TAPI_API_SUCCESS) + { + tet_printf("utc_tel_get_sim_init_info_01 has passed and the data in err-->%d", err); + tet_result(TET_PASS); + } + else + { + tet_printf("utc_tel_get_sim_init_info_01 has failed and the data in err-->%d", err); + tet_result(TET_FAIL); + } + return; +} + + +void utc_tel_get_sim_init_info_02() +{ + TET_STAMP_START("utc_tel_get_sim_init_info_02"); + + TET_CHECK(TAPI_API_INVALID_PTR,tel_get_sim_init_info(NULL,NULL)); + TET_STAMP_PASS(); + return; +} + +/** @} */ diff --git a/TC/telephony_TC/sim/unit/uts_tel_get_sim_init_info.h b/TC/telephony_TC/sim/unit/uts_tel_get_sim_init_info.h new file mode 100644 index 0000000..9c52dbb --- /dev/null +++ b/TC/telephony_TC/sim/unit/uts_tel_get_sim_init_info.h @@ -0,0 +1,66 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** +* @ingroup TELEPHONY_FRAMEWORK_API +* @addtogroup SIM +*/ + +/** +* @ingroup SIM +* @addtogroup UTS_TEL_GET_SIM_INIT_INFO Unit +*/ + +/** +* @ingroup UTS_TEL_GET_SIM_INIT_INFO Unit +* @addtogroup UTS_TEL_GET_SIM_INIT_INFO_ Uts_Tel_Set_Sim_Mailbox_Info +* @{ +*/ + +/** +* @file uts_tel_get_sim_init_info.h +* @brief This is a suit of unit test cases to test tel_get_sim_init_info() API function +* @author Gautam Nand Sinha (gnand.sinha@samsung.com) +* @version Initial Creation Version 0.1 +* @date 2010.06.29 +*/ + +/** +* @file uts_tel_get_sim_mailbox_info.h +* @brief This is a suit of unit test cases to test tel_get_sim_mailbox_info() API function +* @author Gautam Nand Sinha (gnand.sinha@samsung.com) +* @version Initial Creation Version 0.1 +* @date 2010.06.29 +*/ + + +#include +#include +#include +#include + +#include "tet_tapi_util.h" +#include "sim_common.h" + +#ifndef _UTS_TEL_GET_SIM_INIT_INFO_H_ +#define _UTS_TEL_GET_SIM_INIT_INFO_H_ + static void utc_tel_get_sim_init_info_01 (); + static void utc_tel_get_sim_init_info_02 (); +#endif diff --git a/TC/telephony_TC/sim/unit/uts_tel_get_sim_language.c b/TC/telephony_TC/sim/unit/uts_tel_get_sim_language.c new file mode 100644 index 0000000..b650789 --- /dev/null +++ b/TC/telephony_TC/sim/unit/uts_tel_get_sim_language.c @@ -0,0 +1,143 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +/** +* @ingroup TELEPHONY_API +* @addtogroup TAPI_API_SIM_SAT SIM/SAT +*/ + +/** +* @ingroup TAPI_API_SIM_SAT +* @addtogroup UTS_SIM_SAT Unit +*/ + +/** +* @ingroup UTS_SIM_SAT +* @addtogroup UTS_TAPI_SIM_GET_LANGUAGE_PREF_INFO tel_get_sim_language +* +* @brief Unit test code for tel_get_sim_language() +* @par Test function Prototype: +* TapiResult_t tel_get_sim_language(TelSimLanguageInfo_t* pSimLpInfo); +* @par Test function description: +* This API is used to get the language preference information. +* @par Important Notes: +* None +* \param [out] pSimLpInfo +* This parameter returns the language preference information. +* @par Async Response Message: +* None +* @pre +* None +* @post +* None +* @return + * \return Return Type (TapiResult_t) \n + * - TAPI_API_SUCCESS - indicating that the operation has completed successfully. \n + * - Otherwise it provides an error code (Refer #TapiResult_t) +* @{ +*/ + +/** +* @file uts_tapi_sim_get_sim_language_pref_info.c +* @brief Test for the tel_get_sim_language() API that is used to get Lock information +* @author +* @version Initial Creation V0.1 +* @date 2009.12.17 +*/ + +#include +#include +#include + +#include "tet_tapi_util.h" +#include "uts_tel_get_sim_language.h" +#include "sim_common.h" + + +/* Initialize TCM data structures */ +static void startup(); +static void cleanup(); +void (*tet_startup) () = startup; +void (*tet_cleanup) () = cleanup; +struct tet_testlist tet_testlist[] = { + {utc_tel_get_sim_language_01, 1}, + {utc_tel_get_sim_language_02, 2}, + {NULL, 0} +}; + + +/* Startup & Clean function : It is not test code, only for + initialize and finalize test module +*/ +static void startup() +{ + tet_infoline("tel_get_sim_language Test Start\n"); + if (tel_init() != TAPI_API_SUCCESS) + { + tet_infoline("startup fail. tel_init() failed"); + } + return; +} + + +static void cleanup() +{ + tet_infoline("tel_get_sim_language Test Finished\n"); + if (tel_deinit() != TAPI_API_SUCCESS) + { + tet_infoline("startup fail. tel_deinit() failed"); + } + return; +} + + +/* + Unit Test Case functions +*/ + +/** +* @brief tel_get_sim_language() API : Positive condition +* @par ID: UTC_TEL_GET_SIM_LANGUAGE_01 +* @param [out] pSimLpInfo = valid parameter +* @return TAPI_API_SUCCESS +*/ +void utc_tel_get_sim_language_01() +{ + TET_STAMP_START("Normal operation"); + TelSimLanguageInfo_t simLpInfo; + TET_CHECK(TAPI_API_SUCCESS,tel_get_sim_language(&simLpInfo)); + TET_STAMP_PASS(); + return; +} + +/** +* @brief TelTapiSimGetLockInfo() API : Negative condition(NULL) +* @par ID: UTC_TEL_GET_SIM_LANGUAGE_02 +* @param [out] pRequestId = NULL +* @return +*/ +void utc_tel_get_sim_language_02() +{ + TET_STAMP_START("Null parameter test"); + TET_CHECK(TAPI_API_INVALID_PTR, tel_get_sim_language(NULL)); + TET_STAMP_PASS(); +} +/** @} */ diff --git a/TC/telephony_TC/sim/unit/uts_tel_get_sim_language.h b/TC/telephony_TC/sim/unit/uts_tel_get_sim_language.h new file mode 100644 index 0000000..86ef21e --- /dev/null +++ b/TC/telephony_TC/sim/unit/uts_tel_get_sim_language.h @@ -0,0 +1,28 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * 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 _UTS_TAPI_SIM_GET_LANGUAGE_PREF_INFO_ +#define _UTS_TAPI_SIM_GET_LANGUAGE_PREF_INFO_ + + static void utc_tel_get_sim_language_01(); + static void utc_tel_get_sim_language_02(); + +#endif diff --git a/TC/telephony_TC/sim/unit/uts_tel_get_sim_mailbox_info.c b/TC/telephony_TC/sim/unit/uts_tel_get_sim_mailbox_info.c new file mode 100644 index 0000000..8a003d7 --- /dev/null +++ b/TC/telephony_TC/sim/unit/uts_tel_get_sim_mailbox_info.c @@ -0,0 +1,166 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +/** +* @ingroup TELEPHONY_API +* @addtogroup TAPI_API_SIM_SAT SIM/SAT +*/ + +/** +* @ingroup TAPI_API_SIM_SAT +* @addtogroup UTS_SIM_SAT Unit +*/ + +/** +* @ingroup UTS_SIM_SAT +* @addtogroup UTS_TAPI_SIM_GET_MAILBOX_INFO tel_get_sim_mailbox_info +* +* @brief Unit test code for tel_get_sim_mailbox_info() +* @par Test function Prototype: +* int tel_get_sim_mailbox_info(TelSimMailboxNumbers_s *mbox); +* @par Test function description: +* This function is used to get mailbox number Information +* @par Important Notes: +* None +* @param [out] mbox This parameter returns the mailbox information +* @code +* typedef struct +* { +* int b_cphs; // current data is from CPHS SIM or not +* TelSimDialingNumberInfo_t voice_line1; // voice line1 mailbox number +* TelSimDialingNumberInfo_t voice_line2; // voice line2 mailbox number (only available in CPHS) +* TelSimDialingNumberInfo_t video; // video mailbox number +* TelSimDialingNumberInfo_t fax; // fax mailbox number +* TelSimDialingNumberInfo_t email; // email mailbox number +* }TelSimMailboxNumbers_s; +* @endcode +* @par Async Response Message: +* None +* @pre +* None +* @post +* None +* @return +* Return Type : (int) +* - TAPI_API_SUCCESS - indicating that the operation has completed successfully. +* - Otherwise it provides an error code (Refer #TapiResult_t) +* @{ +*/ + +/** +* @file uts_tel_get_sim_mailbox_info.c +* @brief Test for the tel_get_sim_mailbox_info() API that is used to get mailbox information +* @author +* @version Initial Creation V0.1 +* @date 2011.08.29 +*/ + +#include +#include +#include "tet_tapi_util.h" +#include "uts_tel_get_sim_mailbox_info.h" +#include "sim_common.h" + +/* Initialize TCM data structures */ +static void startup(); +static void cleanup(); +void (*tet_startup) () = startup; +void (*tet_cleanup) () = cleanup; +struct tet_testlist tet_testlist[] = { + {utc_tel_get_sim_mailbox_info_01, 1}, + {utc_tel_get_sim_mailbox_info_02, 2}, + {NULL, 0} +}; + +/* Startup & Clean function : It is not test code, only for + initialize and finalize test module +*/ +static void startup() +{ + tet_infoline("uts_tel_get_sim_mailbox_info Test Start\n"); + if (tel_init() != TAPI_API_SUCCESS) + { + tet_infoline("startup fail. tel_init() failed"); + } + return; +} + + +static void cleanup() +{ + tet_infoline("uts_tel_get_sim_mailbox_info Test Finished\n"); + if (tel_deinit() != TAPI_API_SUCCESS) + { + tet_infoline("startup fail. tel_deinit() failed"); + } + return; +} + + +/* + Unit Test Case functions +*/ +/** +* @brief tel_get_sim_mailbox_info() API : Positive condition(Get mailbox Information) +* @par ID: UTC_TEL_GET_SIM_MAILBOX_INFO_01 +* @param [out] &mailbox +* @return TAPI_API_SUCCESS +* @par Expected Result: +* - mailbox number +*/ +void utc_tel_get_sim_mailbox_info_01() +{ + TET_STAMP_START("Normal operation"); + TelSimMailboxNumbers_s mailbox; + + TET_CHECK(TAPI_API_SUCCESS, tel_get_sim_mailbox_info(&mailbox)); + + if( mailbox.b_cphs == 0 || mailbox.b_cphs == 1) + { + tet_printf("b_cphs[%d]",mailbox.b_cphs); + TET_STAMP_PASS(); + return; + } + else + { + TET_STAMP_FAIL(); + return; + } + return; +} + +/** +* @brief tel_get_sim_mailbox_info() API : Negative condition(Null Parameter test) +* @par ID: UTC_TEL_GET_SIM_MAILBOX_INFO_02 +* @param [out] &mailbox = NULL +* @return TAPI_API_INVALID_PTR +*/ +void utc_tel_get_sim_mailbox_info_02() +{ + TET_STAMP_START("null pointer operation"); + TelSimMailboxNumbers_s mailbox; + + TET_CHECK(TAPI_API_INVALID_PTR, tel_get_sim_mailbox_info(NULL)); + TET_STAMP_PASS(); + return; +} + +/** @} */ diff --git a/TC/telephony_TC/sim/unit/uts_tel_get_sim_mailbox_info.h b/TC/telephony_TC/sim/unit/uts_tel_get_sim_mailbox_info.h new file mode 100644 index 0000000..a3cfde5 --- /dev/null +++ b/TC/telephony_TC/sim/unit/uts_tel_get_sim_mailbox_info.h @@ -0,0 +1,58 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** +* @ingroup TELEPHONY_FRAMEWORK_API +* @addtogroup SIM +*/ + +/** +* @ingroup SIM +* @addtogroup UTS_TEL_GET_SIM_MAILBOX_INFO Unit +*/ + +/** +* @ingroup UTS_TEL_GET_SIM_MAILBOX_INFO Unit +* @addtogroup UTS_TEL_GET_SIM_MAILBOX_INFO_ Uts_tel_get_sim_mailbox_info +* @{ +*/ + +/** +* @file uts_tel_get_sim_mailbox_info.h +* @brief This is a suit of unit test cases to test tel_get_sim_mailbox_info() API function +* @author Gautam Nand Sinha (gnand.sinha@samsung.com) +* @version Initial Creation Version 0.1 +* @date 2010.06.29 +*/ + + +#include +#include +#include +#include + +#include "tet_tapi_util.h" +#include "sim_common.h" + +#ifndef _UTS_TEL_GET_SIM_MAILBOX_INFO_H_ +#define _UTS_TEL_GET_SIM_MAILBOX_INFO_H_ + static void utc_tel_get_sim_mailbox_info_01 (); + static void utc_tel_get_sim_mailbox_info_02 (); +#endif diff --git a/TC/telephony_TC/sim/unit/uts_tel_get_sim_messagewaiting_info.c b/TC/telephony_TC/sim/unit/uts_tel_get_sim_messagewaiting_info.c new file mode 100644 index 0000000..c98c00a --- /dev/null +++ b/TC/telephony_TC/sim/unit/uts_tel_get_sim_messagewaiting_info.c @@ -0,0 +1,165 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +/** +* @ingroup TELEPHONY_API +* @addtogroup TAPI_API_SIM_SAT SIM/SAT +*/ + +/** +* @ingroup TAPI_API_SIM_SAT +* @addtogroup UTS_SIM_SAT Unit +*/ + +/** +* @ingroup UTS_SIM_SAT +* @addtogroup UTS_TAPI_SIM_GET_MESSAGEWAITING_INFO tel_get_sim_messagewaiting_info +* +* @brief Unit test code for tel_get_sim_messagewaiting_info() +* @par Test function Prototype: +* int tel_get_sim_messagewaiting_info(TelSimMessageWaiting_s *mw); +* @par Test function description: +* This function is used to get messagewaiting indication Information +* @par Important Notes: +* None +* @param [out] mw This parameter returns the messagewaiting indication information +* @code +* typedef struct +* { +* int b_cphs; // current data is from CPHS SIM or not +* union{ +* TelSimCphsVoiceMsgWaitFlagInfo_t cphs_mw; // information from CPHS SIM +* TelSimMsgWaitingIndicationStatus_t mw; // information from 3GPP SIM +* }mw_data_u; +* }TelSimMessageWaiting_s; +* @endcode +* @par Async Response Message: +* None +* @pre +* None +* @post +* None +* @return +* Return Type : (int) +* - TAPI_API_SUCCESS - indicating that the operation has completed successfully. +* - Otherwise it provides an error code (Refer #TapiResult_t) +* @{ +*/ + +/** +* @file uts_tel_get_sim_messagewaiting_info.c +* @brief Test for the tel_get_sim_messagewaiting_info() API that is used to get messagewaiting indication information +* @author +* @version Initial Creation V0.1 +* @date 2011.08.29 +*/ + +#include +#include +#include "tet_tapi_util.h" +#include "uts_tel_get_sim_messagewaiting_info.h" +#include "sim_common.h" + +/* Initialize TCM data structures */ +static void startup(); +static void cleanup(); +void (*tet_startup) () = startup; +void (*tet_cleanup) () = cleanup; +struct tet_testlist tet_testlist[] = { + {utc_tel_get_sim_messagewaiting_info_01, 1}, + {utc_tel_get_sim_messagewaiting_info_02, 2}, + {NULL, 0} +}; + +/* Startup & Clean function : It is not test code, only for + initialize and finalize test module +*/ +static void startup() +{ + tet_infoline("uts_tel_get_sim_messagewaiting_info Test Start\n"); + if (tel_init() != TAPI_API_SUCCESS) + { + tet_infoline("startup fail. tel_init() failed"); + } + return; +} + + +static void cleanup() +{ + tet_infoline("uts_tel_get_sim_messagewaiting_info Test Finished\n"); + if (tel_deinit() != TAPI_API_SUCCESS) + { + tet_infoline("startup fail. tel_deinit() failed"); + } + return; +} + + +/* + Unit Test Case functions +*/ +/** +* @brief tel_get_sim_messagewaiting_info() API : Positive condition(Get messagewaiting Information) +* @par ID: UTC_TEL_GET_SIM_MESSAGEWAITING_INFO_01 +* @param [out] &mw +* @return TAPI_API_SUCCESS +* @par Expected Result: +* - message waiting information +*/ +void utc_tel_get_sim_messagewaiting_info_01() +{ + TET_STAMP_START("Normal operation"); + TelSimMessageWaiting_s mw; + + TET_CHECK(TAPI_API_SUCCESS, tel_get_sim_messagewaiting_info(&mw)); + + if( mw.b_cphs == 0 || mw.b_cphs == 1) + { + tet_printf("b_cphs[%d]",mw.b_cphs); + TET_STAMP_PASS(); + return; + } + else + { + TET_STAMP_FAIL(); + return; + } + return; +} + +/** +* @brief tel_get_sim_messagewaiting_info() API : Negative condition(Null Parameter test) +* @par ID: UTC_TEL_GET_SIM_MESSAGEWAITING_INFO_02 +* @param [out] &mw = NULL +* @return TAPI_API_INVALID_PTR +*/ +void utc_tel_get_sim_messagewaiting_info_02() +{ + TET_STAMP_START("null pointer operation"); + TelSimMessageWaiting_s mw; + + TET_CHECK(TAPI_API_INVALID_PTR, tel_get_sim_messagewaiting_info(NULL)); + TET_STAMP_PASS(); + return; +} + +/** @} */ diff --git a/TC/telephony_TC/sim/unit/uts_tel_get_sim_messagewaiting_info.h b/TC/telephony_TC/sim/unit/uts_tel_get_sim_messagewaiting_info.h new file mode 100644 index 0000000..a2659d4 --- /dev/null +++ b/TC/telephony_TC/sim/unit/uts_tel_get_sim_messagewaiting_info.h @@ -0,0 +1,58 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** +* @ingroup TELEPHONY_FRAMEWORK_API +* @addtogroup SIM +*/ + +/** +* @ingroup SIM +* @addtogroup UTS_TEL_GET_SIM_MESSAGEWAITING_INFO Unit +*/ + +/** +* @ingroup UTS_TEL_GET_SIM_MESSAGEWAITING_INFO Unit +* @addtogroup UTS_TEL_GET_SIM_MESSAGEWAITING_INFO Uts_tel_get_sim_messagewaiting_info +* @{ +*/ + +/** +* @file uts_tel_get_sim_messagewaiting_info.h +* @brief This is a suit of unit test cases to test tel_get_sim_messagewaiting_info() API function +* @author +* @version Initial Creation Version 0.1 +* @date 2011.08.29 +*/ + + +#include +#include +#include +#include + +#include "tet_tapi_util.h" +#include "sim_common.h" + +#ifndef _UTS_TEL_GET_SIM_MESSAGEWAITING_INFO_H_ +#define _UTS_TEL_GET_SIM_MESSAGEWAITING_INFO_H_ + static void utc_tel_get_sim_messagewaiting_info_01 (); + static void utc_tel_get_sim_messagewaiting_info_02 (); +#endif diff --git a/TC/telephony_TC/sim/unit/uts_tel_get_sim_msisdn.c b/TC/telephony_TC/sim/unit/uts_tel_get_sim_msisdn.c new file mode 100644 index 0000000..ebe59c0 --- /dev/null +++ b/TC/telephony_TC/sim/unit/uts_tel_get_sim_msisdn.c @@ -0,0 +1,159 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +/** +* @ingroup TELEPHONY_API +* @addtogroup TAPI_API_SIM_SAT SIM/SAT +*/ + +/** +* @ingroup TAPI_API_SIM_SAT +* @addtogroup UTS_SIM_SAT Unit +*/ + +/** +* @ingroup UTS_SIM_SAT +* @addtogroup UTS_TAPI_SIM_GET_MSISDN tel_get_sim_msisdn +* +* @brief Unit test code for tel_get_sim_msisdn() +* @par Test function Prototype: +* int tel_get_sim_msisdn(TelSimSubscriberInfo_t *subscriber); +* @par Test function description: +* This function is used to get SIM MSISDN Information +* @par Important Notes: +* None +* @param [out] subscriber This parameter returns the MSISDN information +* @code +* typedef struct +* { +* char num[TAPI_SIM_XDN_DIALING_NUMBER_LEN+1]; // MSISDN number. If not exist, Null string will be returned +* char name[TAPI_SIM_XDN_ALPHA_ID_MAX_LEN+1]; // MSISDN name. If not exist, Null string will be returned +* }TelSimSubscriberInfo_t; +* +* @endcode +* @par Async Response Message: +* None +* @pre +* None +* @post +* None +* @return +* Return Type : (int) +* - TAPI_API_SUCCESS - indicating that the operation has completed successfully. +* - Otherwise it provides an error code (Refer #TapiResult_t) +* @{ +*/ + +/** +* @file uts_tel_get_sim_msisdn.c +* @brief Test for the tel_get_sim_msisdn() API that is used to get MSISDN information +* @author +* @version Initial Creation V0.1 +* @date 2011.09.13 +*/ + +#include +#include +#include "tet_tapi_util.h" +#include "uts_tel_get_sim_msisdn.h" +#include "sim_common.h" + +/* Initialize TCM data structures */ +static void startup(); +static void cleanup(); +void (*tet_startup) () = startup; +void (*tet_cleanup) () = cleanup; +struct tet_testlist tet_testlist[] = { + {utc_tel_get_sim_msisdn_01, 1}, + {utc_tel_get_sim_msisdn_02, 2}, + {NULL, 0} +}; + +/* Startup & Clean function : It is not test code, only for + initialize and finalize test module +*/ +static void startup() +{ + tet_infoline("uts_tel_get_sim_msisdn Test Start\n"); + if (tel_init() != TAPI_API_SUCCESS) + { + tet_infoline("startup fail. tel_init() failed"); + } + return; +} + + +static void cleanup() +{ + tet_infoline("uts_tel_get_sim_msisdn Test Finished\n"); + if (tel_deinit() != TAPI_API_SUCCESS) + { + tet_infoline("startup fail. tel_deinit() failed"); + } + return; +} + + +/* + Unit Test Case functions +*/ +/** +* @brief tel_get_sim_msisdn() API : Positive condition(Get MSISDN Information) +* @par ID: UTC_TEL_GET_SIM_MSISDN_01 +* @param [out] &msisdn +* @return TAPI_API_SUCCESS +* @par Expected Result: +* - msisdn information +*/ +void utc_tel_get_sim_msisdn_01() +{ + TET_STAMP_START("Normal operation"); + TelSimSubscriberInfo_t msisdn; + int api_ret = 0; + api_ret = tel_get_sim_msisdn(&msisdn); + + if (api_ret == TAPI_API_SUCCESS) { + TET_STAMP_PASS(); + return; + } else { + TET_STAMP_FAIL(); + return; + } + return; +} + +/** +* @brief tel_get_sim_msisdn() API : Negative condition(Null Parameter test) +* @par ID: UTC_TEL_GET_SIM_MSISDN_02 +* @param [out] &cphs = NULL +* @return TAPI_API_INVALID_PTR +*/ +void utc_tel_get_sim_msisdn_02() +{ + TET_STAMP_START("null pointer operation"); + TelSimSubscriberInfo_t msisdn; + + TET_CHECK(TAPI_API_INVALID_PTR, tel_get_sim_msisdn(NULL)); + TET_STAMP_PASS(); + return; +} + +/** @} */ diff --git a/TC/telephony_TC/sim/unit/uts_tel_get_sim_msisdn.h b/TC/telephony_TC/sim/unit/uts_tel_get_sim_msisdn.h new file mode 100644 index 0000000..e49ec82 --- /dev/null +++ b/TC/telephony_TC/sim/unit/uts_tel_get_sim_msisdn.h @@ -0,0 +1,59 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** +* @ingroup TELEPHONY_FRAMEWORK_API +* @addtogroup SIM +*/ + +/** +* @ingroup SIM +* @addtogroup UTS_TEL_GET_SIM_MSISDN Unit +*/ + +/** +* @ingroup UTS_TEL_GET_SIM_MSISDN Unit +* @addtogroup UTS_TEL_GET_SIM_MSISDN Uts_tel_get_sim_msisdn +* @{ +*/ + +/** +* @file uts_tel_get_sim_msisdn.h +* @brief This is a suit of unit test cases to test tel_get_sim_msisdn() API function +* @author +* @version Initial Creation Version 0.1 +* @date 2011.09.13 +*/ + + +#include +#include +#include +#include + +#include "tet_tapi_util.h" +#include "sim_common.h" + +#ifndef _UTS_TEL_GET_SIM_MSISDN_H_ +#define _UTS_TEL_GET_SIM_MSISDN_H_ + static void utc_tel_get_sim_msisdn_01 (); + static void utc_tel_get_sim_msisdn_02 (); +#endif + diff --git a/TC/telephony_TC/sim/unit/uts_tel_get_sim_pb_3g_meta_info.c b/TC/telephony_TC/sim/unit/uts_tel_get_sim_pb_3g_meta_info.c new file mode 100644 index 0000000..8a111b4 --- /dev/null +++ b/TC/telephony_TC/sim/unit/uts_tel_get_sim_pb_3g_meta_info.c @@ -0,0 +1,262 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +/** +* @ingroup TELEPHONY_API +* @addtogroup TAPI_API_SIM_SAT SIM/SAT +*/ + +/** +* @ingroup TAPI_API_SIM_SAT +* @addtogroup UTS_SIM_SAT Unit +*/ + +/** +* @ingroup UTS_SIM_SAT +* @addtogroup UTS_TAPI_SIM_GET_3G_CAPABILLITY_INFO tel_get_sim_pb_3g_meta_info +* +* @brief Unit test code for tel_get_sim_pb_3g_meta_info() +* @par Test function Prototype: +* TapiResult_t tel_get_sim_pb_3g_meta_info (int *pRequestId); +* @par Test function description: +* This API is used to Get the 3G phone book capability information +* @par Important Notes: +* The index ranges from 1 through to a maximum of 254 for a Linear fixed file and 255 for a cyclic file. +* This API is applicable only for 3G phonebook. +* @param [out] pRequestId Unique identifier for a particular request. +* - pRequestId value can be any value from 0 to 255 if the API is returned successfully +* - -1 (INVALID_REQUEST_ID) will be sent in case of failure. +* @par Async Response Message: +* The event associated is below and the event data is #TelSimPbCapabilityInfo_t. \n +* - TAPI_EVENT_SIM_PB_CAPABILITY_INFO_CNF +* @pre +* None +* @post +* None +* @return +* Return Type : (TapiResult_t) +* - TAPI_API_SUCCESS - indicating that the operation has completed successfully. +* - Otherwise it provides an error code (Refer #TapiResult_t) +* @{ +*/ + +/** +* @file uts_tel_get_sim_pb_3g_meta_info.c +* @brief Test for the tel_get_sim_pb_3g_meta_info() API that is used to get phonebook capability info +* @author +* @version Initial Creation V0.1 +* @date 2008.07.30 +*/ + + +#include +#include +#include + +#include "tet_tapi_util.h" +#include "uts_tel_get_sim_pb_3g_meta_info.h" +#include "sim_common.h" + +/* Initialize TCM data structures */ +static void startup(); +static void cleanup(); +void (*tet_startup) () = startup; +void (*tet_cleanup) () = cleanup; +struct tet_testlist tet_testlist[] = { + {utc_tel_get_sim_pb_3g_meta_info_01, 1}, + {utc_tel_get_sim_pb_3g_meta_info_02, 2}, + {NULL, 0} +}; + +/* + User Defined Handler +*/ +// Global variable for user data +static BOOL gAsyncResult; //user defined data : Async callback is called or not + +/* Startup & Clean function : It is not test code, only for + initialize and finalize test module +*/ +static BOOL gStartupSuccess = FALSE; +static unsigned int subscription_id = 0; + + +/* + G_MAIN Utility //////////////////////////////////////////////////////////////////////////// +*/ +// Prototype : User must add function body +gboolean g_timeout_callback (void *data); + +// GMainLoop global handler +GMainLoop *sim_loop = NULL; + +void G_MAIN_LOOP_CLOSE() +{ + g_main_loop_quit(sim_loop); +} + +int G_MAIN_LOOP_RUN(int sec) +{ + sim_loop = g_main_loop_new (NULL, FALSE); + g_timeout_add ( (sec * 1000), g_timeout_callback, NULL); + g_main_loop_run (sim_loop); + + return 0; +} + +gboolean g_timeout_callback (void *data) +{ + gAsyncResult = FALSE; + tet_printf("[TIME OUT] g_timeout called .Close g_main_roop()"); + G_MAIN_LOOP_CLOSE(); + return FALSE; +} +// End of G_MAIN Utility////////////////////////////////////////////////////////////////////// + + +static int sim_app_callback (TelTapiEvent_t *sim_event) +{ + tet_printf("\n***************[SIM APP]Callback data **********************\n"); + tet_printf("[SIM]Reques Id[%d]\n", sim_event->RequestId); + tet_printf("[SIM]event status [%d]\n", sim_event->Status); + + gAsyncResult = FALSE; + BOOL bReceived = FALSE; + + switch(sim_event->EventType) + { + case TAPI_EVENT_SIM_PB_CAPABILITY_INFO_CNF: + { + tet_printf("\n[GOT THE EVENT]*******TAPI_EVENT_SIM_PB_CAPABILITY_INFO_CNF,******\n"); + tet_printf("[SIM]SIM PB Capability Info event status = [%x]\n", sim_event->Status); + + //TelSimPbCapabilityInfo_t *sim_capability_info = (TelSimPbCapabilityInfo_t*)sim_event->pData; + //int i; + // for(i = 0;iFileTypeCount;i++) + //{ + // tet_printf(" [SIM APP]Filed tag type[%d]", sim_capability_info->FileTypeInfo[i].FileType3G); + // tet_printf(" [SIM APP]max index [%d]\n", sim_capability_info->FileTypeInfo[i].PbIndexMax); + // tet_printf(" [SIM APP]max text [%d]\n", sim_capability_info->FileTypeInfo[i].PbTextMax); + // tet_printf(" [SIM APP]used count [%d]\n", sim_capability_info->FileTypeInfo[i].TotalRecordCount); + //} + gAsyncResult = TRUE; + bReceived = TRUE; + } + break; + + default: + { + bReceived = TRUE; + gAsyncResult = FALSE; + tet_printf("Info : TAPI_EVENT_SIM_PB_CAPABILITY_INFO_CNF = %d",TAPI_EVENT_SIM_PB_CAPABILITY_INFO_CNF); + tet_printf("[SIM]***************** Undhandled event type [%d] *****************\n",sim_event->EventType); + tet_printf("[SIM]Undhandled event state [%d]\n",sim_event->Status); + break; + } + }//end switch + + if (bReceived == TRUE) + G_MAIN_LOOP_CLOSE(); + + return 0; +} + +static void startup() +{ + tet_infoline("uts_tel_get_sim_pb_3g_meta_info Test Start\n"); + if ( tel_init() == TAPI_API_SUCCESS) + { + if (TAPI_API_SUCCESS == tel_register_event(TAPI_EVENT_SIM_PB_CAPABILITY_INFO_CNF,&subscription_id,(TelAppCallback)sim_app_callback,NULL) ) + gStartupSuccess = TRUE; + else + tet_infoline("startup fail. tel_register_event() failed"); + } else { + tet_infoline("startup fail. tel_init() failed"); + } + + tel_register_app_name("org.samsung.test"); + return; +} + + +static void cleanup() +{ + tet_infoline("uts_tel_get_sim_pb_3g_meta_info Test Finished\n"); + + if (gStartupSuccess == TRUE) + { + tel_deregister_event(subscription_id); + } + tel_deinit(); + + return; +} + + +/* + Unit Test Case functions +*/ + +/** +* @brief tel_get_sim_pb_3g_meta_info() API : Negative condition(Parameter is Null) +* @par ID: UTC_TEL_GET_SIM_PB_3G_META_INFO_01 +* @param [out] &req_id = NULL +* @return TAPI_API_INVALID_PTR +*/ +void utc_tel_get_sim_pb_3g_meta_info_01() +{ + TET_STAMP_START("Null parameter test"); + + /* calling PB capability info api */ + TET_CHECK(TAPI_API_INVALID_PTR, tel_get_sim_pb_3g_meta_info(NULL)); + TET_STAMP_PASS(); + return; +} + +/** +* @brief tel_get_sim_pb_3g_meta_info() API : Positive condition +* @par ID: UTC_TEL_GET_SIM_PB_3G_META_INFO_02 +* @param [out] &req_id +* @return TAPI_API_SUCCESS +* @par Async Response Message: +* The event received is below and the event data is #TelSimPbCapabilityInfo_t. \n +* - TAPI_EVENT_SIM_PB_CAPABILITY_INFO_CNF +*/ +void utc_tel_get_sim_pb_3g_meta_info_02() +{ + TET_STAMP_START("utc_tel_get_sim_pb_3g_meta_info_02"); + TET_RESULT_NOT_EQUAL(TET_UNTESTED,gStartupSuccess, TRUE); + + int req_id=0; + + gAsyncResult = FALSE; + + TET_CHECK(TAPI_API_SUCCESS,tel_get_sim_pb_3g_meta_info(&req_id)); + + G_MAIN_LOOP_RUN(2); + + TET_RESULT_NOT_EQUAL(TET_FAIL,gAsyncResult,TRUE); // If gAsyncResult != TRUE, then TET_FAIL and return + TET_STAMP_PASS(); + return; +} + + +/** @} */ diff --git a/TC/telephony_TC/sim/unit/uts_tel_get_sim_pb_3g_meta_info.h b/TC/telephony_TC/sim/unit/uts_tel_get_sim_pb_3g_meta_info.h new file mode 100644 index 0000000..3b55a8a --- /dev/null +++ b/TC/telephony_TC/sim/unit/uts_tel_get_sim_pb_3g_meta_info.h @@ -0,0 +1,29 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * 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 _uts_tel_get_sim_pb_3g_meta_info_H_ +#define _uts_tel_get_sim_pb_3g_meta_info_H_ + + static void utc_tel_get_sim_pb_3g_meta_info_01 (); + static void utc_tel_get_sim_pb_3g_meta_info_02 (); + +#endif +/** @} */ diff --git a/TC/telephony_TC/sim/unit/uts_tel_get_sim_pb_count.c b/TC/telephony_TC/sim/unit/uts_tel_get_sim_pb_count.c new file mode 100644 index 0000000..085be7e --- /dev/null +++ b/TC/telephony_TC/sim/unit/uts_tel_get_sim_pb_count.c @@ -0,0 +1,473 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +/** +* @ingroup TELEPHONY_API +* @addtogroup TAPI_API_SIM_SAT SIM/SAT +*/ + +/** +* @ingroup TAPI_API_SIM_SAT +* @addtogroup UTS_SIM_SAT Unit +*/ + +/** +* @ingroup UTS_SIM_SAT +* @addtogroup UTS_TAPI_SIM_PB_GET_STORAGE_COUNT tel_get_sim_pb_count +* +* @brief Unit test code for tel_get_sim_pb_count() +* @par Test function Prototype: +* TapiResult_t tel_get_sim_pb_count(TelSimPbFileType_t StorageFileType, int* pRequestId); +* @par Test function description: +* This API is used to get number of used records and total records in SIM phone book files. +* This API is applicable only to GSM phonebook (ADN and EXT1), FDN, SDN, LND and MSISDN. +* @par Important Notes: +* None +* @param [in] StorageFileType Different storage types to be selected in SIM. +* @param [out] pRequestId Unique identifier for a particular request. +* - request_id value can be any value from 0 to 255 if the API is returned successfully +* - -1 (INVALID_REQUEST_ID) will be sent in case of failure. +* @par Async Response Message: +* The event associated is below and the event data is #TelSimPbStorageInfo_t. \n +* - TAPI_EVENT_SIM_PB_STORAGE_COUNT_CNF +* @pre +* - Phonebook supported SIM used for test +* @post +* None +* @return +* Return Type : (TapiResult_t) +* - TAPI_API_SUCCESS - indicating that the operation has completed successfully. +* - Otherwise it provides an error code (Refer #TapiResult_t) +* @{ +*/ + +/** +* @file uts_tel_get_sim_pb_count.c +* @brief Test for the tel_get_sim_pb_count() API that is used to get phonebook Storage Count +* @author +* @version Initial Creation V0.1 +* @date 2008.07.30 +*/ + + +#include +#include +#include + +#include "tet_tapi_util.h" +#include "uts_tel_get_sim_pb_count.h" +#include "sim_common.h" + + +/* Initialize TCM data structures */ +static void startup(); +static void cleanup(); +void (*tet_startup) () = startup; +void (*tet_cleanup) () = cleanup; +struct tet_testlist tet_testlist[] = { + {utc_tel_get_sim_pb_count_01, 1}, + {utc_tel_get_sim_pb_count_02, 2}, + {utc_tel_get_sim_pb_count_03, 3}, + {utc_tel_get_sim_pb_count_04, 4}, + {utc_tel_get_sim_pb_count_05, 5}, + {utc_tel_get_sim_pb_count_06, 6}, + {utc_tel_get_sim_pb_count_07, 7}, + {utc_tel_get_sim_pb_count_08, 8}, + {utc_tel_get_sim_pb_count_09, 9}, + {utc_tel_get_sim_pb_count_10, 10}, + {NULL, 0} +}; + +/* + User Defined Handler +*/ +// Global variable for user data +static BOOL gAsyncResult; //user defined data : Async callback is called or not + +/* Startup & Clean function : It is not test code, only for + initialize and finalize test module +*/ +static BOOL gStartupSuccess = FALSE; +static unsigned int subscription_id = 0; + + +/* + G_MAIN Utility //////////////////////////////////////////////////////////////////////////// +*/ +// Prototype : User must add function body +gboolean g_timeout_callback (void *data); + +// GMainLoop global handler +GMainLoop *sim_loop = NULL; + +void G_MAIN_LOOP_CLOSE() +{ + g_main_loop_quit(sim_loop); +} + +int G_MAIN_LOOP_RUN(int sec) +{ + sim_loop = g_main_loop_new (NULL, FALSE); + g_timeout_add ( (sec * 1000), g_timeout_callback, NULL); + g_main_loop_run (sim_loop); + + return 0; +} + +gboolean g_timeout_callback (void *data) +{ + gAsyncResult = FALSE; + tet_printf("[TIME OUT] g_timeout called .Close g_main_roop()"); + G_MAIN_LOOP_CLOSE(); + return FALSE; +} +// End of G_MAIN Utility////////////////////////////////////////////////////////////////////// + +static int sim_app_callback (TelTapiEvent_t *sim_event) +{ + tet_printf("\n***************[SIM APP]Callback data **********************\n"); + tet_printf("[SIM]Reques Id[%d]\n", sim_event->RequestId); + tet_printf("[SIM]event status [%d]\n", sim_event->Status); + + gAsyncResult = FALSE; + BOOL bReceived = FALSE; + + switch(sim_event->EventType) + { + case TAPI_EVENT_SIM_PB_STORAGE_COUNT_CNF: + { + tet_printf("\n[SIM]*****************TAPI_EVENT_SIM_PB_STORAGE_COUNT_CNF***************************\n"); + + // TelSimPbStorageInfo_t *storageInfo = (TelSimPbStorageInfo_t*)sim_event->pData ; + tet_printf("SIM PB storage count event status = [%x]\n", sim_event->Status); + // tet_printf("[SIM APP]PB_STORAGE_TYPE %x\n", storageInfo->StorageFileType); + // tet_printf("[SIM APP]TOTAL_COUNT = %d\n", storageInfo->TotalRecordCount); + // tet_printf("[SIM APP]USED_COUNT = %d\n", storageInfo->UsedRecordCount); + gAsyncResult = TRUE; + bReceived = TRUE; + } + break; + + default: + { + bReceived = TRUE; + gAsyncResult = FALSE; + tet_printf("[SIM]***************** Undhandled event type [%d] *****************\n",sim_event->EventType); + tet_printf("[SIM]Undhandled event state [%d]\n",sim_event->Status); + break; + } + }//end switch + + if (bReceived == TRUE) + G_MAIN_LOOP_CLOSE(); + + return 0; +} + + +static void startup() +{ + tet_infoline("uts_tel_get_sim_pb_count Test Start"); + if ( tel_init() == TAPI_API_SUCCESS) + { + if (TAPI_API_SUCCESS == tel_register_event(TAPI_EVENT_SIM_PB_STORAGE_COUNT_CNF,&subscription_id,(TelAppCallback)sim_app_callback,NULL) ) + gStartupSuccess = TRUE; + else + tet_infoline("startup fail. tel_register_event() failed"); + } else { + tet_infoline("startup fail. tel_init() failed"); + } + tel_register_app_name("org.samsung.test"); + return; +} + +static void cleanup() +{ + tet_infoline("uts_tel_get_sim_pb_count Finished"); + + if (gStartupSuccess == TRUE) + { + tel_deregister_event(subscription_id); + } + tel_deinit(); + + return; +} + + +/* + Unit Test Case functions +*/ + +/** +* @brief tel_get_sim_pb_count() API : Negative condition(Low boundary test) +* @par ID: UTC_TEL_GET_SIM_PB_COUNT_01 +* @param [in] StorageFileType = (TelSimPbFileType_t)TAPI_SIM_PB_FDN-1; +* @param [out] &pRequestId +* @return TAPI_API_INVALID_INPUT +*/ +void utc_tel_get_sim_pb_count_01() +{ + TET_STAMP_START("TAPI_API_INVALID_INPUT test 1"); + TelSimPbFileType_t StorageFileType=(TelSimPbFileType_t)TAPI_SIM_PB_FDN-1; + int pRequestId=0; + + TET_CHECK(TAPI_API_INVALID_INPUT, tel_get_sim_pb_count(StorageFileType,&pRequestId)); + TET_STAMP_PASS(); + return; +} + + +/** +* @brief tel_get_sim_pb_count() API : Negative condition(Upper boundary test) +* @par ID: UTC_TEL_GET_SIM_PB_COUNT_02 +* @param [in] StorageFileType = (TelSimPbFileType_t)TAPI_SIM_PB_UNKNOWNN+1; +* @param [out] &pRequestId +* @return TAPI_API_INVALID_INPUT +*/ +void utc_tel_get_sim_pb_count_02() +{ + TET_STAMP_START("TAPI_API_INVALID_INPUT test 2"); + TelSimPbFileType_t StorageFileType=(TelSimPbFileType_t)TAPI_SIM_PB_UNKNOWNN+1; + int pRequestId=0; + + TET_CHECK(TAPI_API_INVALID_INPUT, tel_get_sim_pb_count(StorageFileType,&pRequestId)); + TET_STAMP_PASS(); + return; +} + +/** +* @brief tel_get_sim_pb_count() API : Negative condition(NULL Parameter test) +* @par ID: UTC_TEL_GET_SIM_PB_COUNT_03 +* @param [in] StorageFileType = TAPI_SIM_PB_GAS +* @param [out] &pRequestId = NULL +* @return TAPI_API_INVALID_PTR +*/ +void utc_tel_get_sim_pb_count_03() +{ + TET_STAMP_START("TAPI_API_INVALID_PTR test"); + TelSimPbFileType_t StorageFileType=TAPI_SIM_PB_GAS; + + TET_CHECK(TAPI_API_INVALID_PTR,tel_get_sim_pb_count(StorageFileType,NULL)); + TET_STAMP_PASS(); + return; +} + +/** +* @brief tel_get_sim_pb_count() API : Positive condition(Get count when type is FDN) +* @par ID: UTC_TEL_GET_SIM_PB_COUNT_04 +* @param [in] StorageFileType = TAPI_SIM_PB_FDN +* @param [out] &pRequestId +* @return TAPI_API_SUCCESS +* @par Async Response Message: +* The event associated is below and the event data is #TelSimPbStorageInfo_t. \n +* - TAPI_EVENT_SIM_PB_STORAGE_COUNT_CNF +*/ +void utc_tel_get_sim_pb_count_04() +{ + TET_STAMP_START("StorageFileType = TAPI_SIM_PB_FDN"); + TET_RESULT_NOT_EQUAL(TET_UNTESTED,gStartupSuccess, TRUE); + + TelSimPbFileType_t StorageFileType=TAPI_SIM_PB_FDN; + int pRequestId=0; + + gAsyncResult = FALSE; + + TET_CHECK(TAPI_API_SUCCESS,tel_get_sim_pb_count(StorageFileType,&pRequestId)); + + G_MAIN_LOOP_RUN(10); + TET_RESULT_NOT_EQUAL(TET_FAIL,gAsyncResult,TRUE); // If gAsyncResult != TRUE, then TET_FAIL and return + TET_STAMP_PASS(); + return; +} + + +/** +* @brief tel_get_sim_pb_count() API : Positive condition(Get count when type is LDN) +* @par ID: UTC_TEL_GET_SIM_PB_COUNT_05 +* @param [in] StorageFileType = TAPI_SIM_PB_LDN +* @param [out] &pRequestId +* @return TAPI_API_SUCCESS +* @par Async Response Message: +* The event associated is below and the event data is #TelSimPbStorageInfo_t. \n +* - TAPI_EVENT_SIM_PB_STORAGE_COUNT_CNF +*/ +void utc_tel_get_sim_pb_count_05() +{ + TET_STAMP_START("StorageFileType = TAPI_SIM_PB_LDN"); + TET_RESULT_NOT_EQUAL(TET_UNTESTED,gStartupSuccess, TRUE); + + TelSimPbFileType_t StorageFileType=TAPI_SIM_PB_LDN; + int pRequestId=0; + + gAsyncResult = FALSE; + + TET_CHECK(TAPI_API_SUCCESS,tel_get_sim_pb_count(StorageFileType,&pRequestId)); + + G_MAIN_LOOP_RUN(10); + TET_RESULT_NOT_EQUAL(TET_FAIL,gAsyncResult,TRUE); // If gAsyncResult != TRUE, then TET_FAIL and return + TET_STAMP_PASS(); + return; +} + + +/** +* @brief tel_get_sim_pb_count() API : Positive condition(Get count when type is MSISDN) +* @par ID: UTC_TEL_GET_SIM_PB_COUNT_06 +* @param [in] StorageFileType = TAPI_SIM_PB_MSISDN +* @param [out] &pRequestId +* @return TAPI_API_SUCCESS +* @par Async Response Message: +* The event associated is below and the event data is #TelSimPbStorageInfo_t. \n +* - TAPI_EVENT_SIM_PB_STORAGE_COUNT_CNF +*/ +void utc_tel_get_sim_pb_count_06() +{ + TET_STAMP_START("StorageFileType = TAPI_SIM_PB_MSISDN"); + TET_RESULT_NOT_EQUAL(TET_UNTESTED,gStartupSuccess, TRUE); + + TelSimPbFileType_t StorageFileType=TAPI_SIM_PB_MSISDN; + int pRequestId=0; + + gAsyncResult = FALSE; + + TET_CHECK(TAPI_API_SUCCESS,tel_get_sim_pb_count(StorageFileType,&pRequestId)); + + G_MAIN_LOOP_RUN(10); + TET_RESULT_NOT_EQUAL(TET_FAIL,gAsyncResult,TRUE); // If gAsyncResult != TRUE, then TET_FAIL and return + TET_STAMP_PASS(); + return; +} + + +/** +* @brief tel_get_sim_pb_count() API : Positive condition(Get count when type is ADN) +* @par ID: UTC_TEL_GET_SIM_PB_COUNT_07 +* @param [in] StorageFileType = TAPI_SIM_PB_ADN +* @param [out] &pRequestId +* @return TAPI_API_SUCCESS +* @par Async Response Message: +* The event associated is below and the event data is #TelSimPbStorageInfo_t. \n +* - TAPI_EVENT_SIM_PB_STORAGE_COUNT_CNF +*/ +void utc_tel_get_sim_pb_count_07() +{ + TET_STAMP_START("StorageFileType = TAPI_SIM_PB_ADN"); + TET_RESULT_NOT_EQUAL(TET_UNTESTED,gStartupSuccess, TRUE); + + TelSimPbFileType_t StorageFileType=TAPI_SIM_PB_ADN; + int pRequestId=0; + + gAsyncResult = FALSE; + + TET_CHECK(TAPI_API_SUCCESS,tel_get_sim_pb_count(StorageFileType,&pRequestId)); + + G_MAIN_LOOP_RUN(10); + TET_RESULT_NOT_EQUAL(TET_FAIL,gAsyncResult,TRUE); // If gAsyncResult != TRUE, then TET_FAIL and return + TET_STAMP_PASS(); + return; +} + +/** +* @brief tel_get_sim_pb_count() API : Positive condition(Get count when type is SDN) +* @par ID: UTC_TEL_GET_SIM_PB_COUNT_08 +* @param [in] StorageFileType = TAPI_SIM_PB_SDN +* @param [out] &pRequestId +* @return TAPI_API_SUCCESS +* @par Async Response Message: +* The event associated is below and the event data is #TelSimPbStorageInfo_t. \n +* - TAPI_EVENT_SIM_PB_STORAGE_COUNT_CNF +*/ +void utc_tel_get_sim_pb_count_08() +{ + TET_STAMP_START("StorageFileType = TAPI_SIM_PB_SDN"); + TET_RESULT_NOT_EQUAL(TET_UNTESTED,gStartupSuccess, TRUE); + + TelSimPbFileType_t StorageFileType=TAPI_SIM_PB_SDN; + int pRequestId=0; + + gAsyncResult = FALSE; + + TET_CHECK(TAPI_API_SUCCESS,tel_get_sim_pb_count(StorageFileType,&pRequestId)); + + G_MAIN_LOOP_RUN(10); + TET_RESULT_NOT_EQUAL(TET_FAIL,gAsyncResult,TRUE); // If gAsyncResult != TRUE, then TET_FAIL and return + TET_STAMP_PASS(); +} + + +/** +* @brief tel_get_sim_pb_count() API : Positive condition(Get count when type is EN) +* @par ID: UTC_TEL_GET_SIM_PB_COUNT_09 +* @param [in] StorageFileType = TAPI_SIM_PB_EN +* @param [out] &pRequestId +* @return TAPI_API_SUCCESS +* @par Async Response Message: +* The event associated is below and the event data is #TelSimPbStorageInfo_t. \n +* - TAPI_EVENT_SIM_PB_STORAGE_COUNT_CNF +*/ +void utc_tel_get_sim_pb_count_09() +{ + TET_STAMP_START("StorageFileType = TAPI_SIM_PB_EN"); + TET_RESULT_NOT_EQUAL(TET_UNTESTED,gStartupSuccess, TRUE); + + TelSimPbFileType_t StorageFileType=TAPI_SIM_PB_EN; + int pRequestId=0; + + gAsyncResult = FALSE; + + TET_CHECK(TAPI_API_SUCCESS,tel_get_sim_pb_count(StorageFileType,&pRequestId)); + + G_MAIN_LOOP_RUN(10); + TET_RESULT_NOT_EQUAL(TET_FAIL,gAsyncResult,TRUE); // If gAsyncResult != TRUE, then TET_FAIL and return + TET_STAMP_PASS(); + return; +} + +/** +* @brief tel_get_sim_pb_count() API : Positive condition(Get count when type is 3GSIM) +* @par ID: UTC_TEL_GET_SIM_PB_COUNT_10 +* @param [in] StorageFileType = TAPI_SIM_PB_3GSIM +* @param [out] &pRequestId +* @return TAPI_API_SUCCESS +* @par Async Response Message: +* The event associated is below and the event data is #TelSimPbStorageInfo_t. \n +* - TAPI_EVENT_SIM_PB_STORAGE_COUNT_CNF +*/ +void utc_tel_get_sim_pb_count_10() +{ + TET_STAMP_START("StorageFileType = TAPI_SIM_PB_3GSIM"); + TET_RESULT_NOT_EQUAL(TET_UNTESTED,gStartupSuccess, TRUE); + + TelSimPbFileType_t StorageFileType=TAPI_SIM_PB_3GSIM; + int pRequestId=0; + gAsyncResult = FALSE; + + TET_CHECK(TAPI_API_SUCCESS,tel_get_sim_pb_count(StorageFileType,&pRequestId)); + + G_MAIN_LOOP_RUN(10); + TET_RESULT_NOT_EQUAL(TET_FAIL,gAsyncResult,TRUE); // If gAsyncResult != TRUE, then TET_FAIL and return + TET_STAMP_PASS(); + return; + +} + +/** @} */ diff --git a/TC/telephony_TC/sim/unit/uts_tel_get_sim_pb_count.h b/TC/telephony_TC/sim/unit/uts_tel_get_sim_pb_count.h new file mode 100644 index 0000000..b9996b4 --- /dev/null +++ b/TC/telephony_TC/sim/unit/uts_tel_get_sim_pb_count.h @@ -0,0 +1,36 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * 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 _uts_tel_get_sim_pb_count_H_ +#define _uts_tel_get_sim_pb_count_H_ + + static void utc_tel_get_sim_pb_count_01 (); + static void utc_tel_get_sim_pb_count_02 (); + static void utc_tel_get_sim_pb_count_03 (); + static void utc_tel_get_sim_pb_count_04 (); + static void utc_tel_get_sim_pb_count_05 (); + static void utc_tel_get_sim_pb_count_06 (); + static void utc_tel_get_sim_pb_count_07 (); + static void utc_tel_get_sim_pb_count_08 (); + static void utc_tel_get_sim_pb_count_09 (); + static void utc_tel_get_sim_pb_count_10 (); +#endif diff --git a/TC/telephony_TC/sim/unit/uts_tel_get_sim_pb_init_info.c b/TC/telephony_TC/sim/unit/uts_tel_get_sim_pb_init_info.c new file mode 100644 index 0000000..e25ac4d --- /dev/null +++ b/TC/telephony_TC/sim/unit/uts_tel_get_sim_pb_init_info.c @@ -0,0 +1,168 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** +* @ingroup TELEPHONY_FRAMEWORK_API +* @addtogroup SIM +*/ + +/** +* @ingroup SIM +* @addtogroup UTS_TEL_GET_SIM_PB_INIT_INFO Unit +*/ + +/** +* @ingroup UTS_TEL_GET_SIM_PB_INIT_INFO Unit +* @addtogroup UTS_TEL_GET_SIM_PB_INIT_INFO_ Uts_Tel_Get_Sim_Pb_Init_Info +* @{ +*/ + +/** +* @file uts_tel_get_sim_pb_init_info.c +* @brief This is a suit of unit test cases to test tel_get_sim_pb_init_info() API function +* @author Gautam Nand Sinha (gnand.sinha@samsung.com) +* @version Initial Creation Version 0.1 +* @date 2010.06.29 +*/ +#include +#include +#include +#include + +#include "tet_tapi_util.h" +#include "sim_common.h" +#include "uts_tel_get_sim_pb_init_info.h" + + +/* Initialize TCM data structures */ +static void startup(); +static void cleanup(); +void (*tet_startup) () = startup; +void (*tet_cleanup) () = cleanup; +struct tet_testlist tet_testlist[] = { + {utc_tel_get_sim_pb_init_info_01, 1}, + {utc_tel_get_sim_pb_init_info_02, 2}, + {utc_tel_get_sim_pb_init_info_03, 3}, + {utc_tel_get_sim_pb_init_info_04, 4}, + {NULL, 0} +}; + + +static void startup() +{ + tet_infoline("utc_tel_get_sim_pb_init_info Test Start\n"); + + if ( tel_init() != TAPI_API_SUCCESS) + { + tet_infoline("startup fail. tel_init() failed"); + } + return; +} + + +static void cleanup() +{ + tet_infoline("utc_tel_get_sim_pb_init_info Test Finished\n"); + + if ( tel_deinit() != TAPI_API_SUCCESS) + { + tet_infoline("cleanup fail. tel_deinit() failed"); + } + return; +} + + +void utc_tel_get_sim_pb_init_info_01() +{ + int err,init_completed = 0; + TelSimPbList_t pb_list = {0,}; + int first_index = 0; + err = tel_get_sim_pb_init_info(&init_completed, &pb_list,&first_index ); + if(err == TAPI_API_SUCCESS) + { + tet_printf("utc_tel_get_sim_pb_init_info_01 has passed and the data in err-->%d", err); + tet_result(TET_PASS); + } + else + { + tet_printf("utc_tel_get_sim_pb_init_info_01 has failed and the data in err-->%d", err); + tet_result(TET_FAIL); + } + return; +} + + +void utc_tel_get_sim_pb_init_info_02() +{ + int err; + TelSimPbList_t pb_list = {0,}; + int first_index = 0; + err = tel_get_sim_pb_init_info(NULL, &pb_list,&first_index ); + if(err != TAPI_API_SUCCESS) + { + tet_printf("utc_tel_get_sim_pb_init_info_02 has passed and the data in err-->%d", err); + tet_result(TET_PASS); + } + else + { + tet_printf("utc_tel_get_sim_pb_init_info_02 has failed and the data in err-->%d", err); + tet_result(TET_FAIL); + } + return; +} + +void utc_tel_get_sim_pb_init_info_03() +{ + int err; + + int first_index = 0; + err = tel_get_sim_pb_init_info(NULL, NULL,&first_index ); + if(err != TAPI_API_SUCCESS) + { + tet_printf("utc_tel_get_sim_pb_init_info_03 has passed and the data in err-->%d", err); + tet_result(TET_PASS); + } + else + { + tet_printf("utc_tel_get_sim_pb_init_info_03 has failed and the data in err-->%d", err); + tet_result(TET_FAIL); + } + return; +} + +void utc_tel_get_sim_pb_init_info_04() +{ + int err,init_completed = 0; + + err = tel_get_sim_pb_init_info(&init_completed, NULL,NULL ); + if(err != TAPI_API_SUCCESS) + { + tet_printf("utc_tel_get_sim_pb_init_info_04 has passed and the data in err-->%d", err); + tet_result(TET_PASS); + } + else + { + tet_printf("utc_tel_get_sim_pb_init_info_04 has failed and the data in err-->%d", err); + tet_result(TET_FAIL); + } + return; +} + +/** @} */ diff --git a/TC/telephony_TC/sim/unit/uts_tel_get_sim_pb_init_info.h b/TC/telephony_TC/sim/unit/uts_tel_get_sim_pb_init_info.h new file mode 100644 index 0000000..cc409d8 --- /dev/null +++ b/TC/telephony_TC/sim/unit/uts_tel_get_sim_pb_init_info.h @@ -0,0 +1,54 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** +* @ingroup TELEPHONY_FRAMEWORK_API +* @addtogroup SIM +*/ + +/** +* @ingroup SIM +* @addtogroup UTS_TEL_GET_SIM_PB_INIT_INFO Unit +*/ + +/** +* @ingroup UTS_TEL_GET_SIM_PB_INIT_INFO Unit +* @addtogroup UTS_TEL_GET_SIM_PB_INIT_INFO_ Uts_Tel_Get_Sim_Pb_Init_Info +* @{ +*/ + +/** +* @file uts_tel_get_sim_pb_init_info.h +* @brief This is a suit of unit test cases to test tel_get_sim_pb_init_info() API function +* @author Gautam Nand Sinha (gnand.sinha@samsung.com) +* @version Initial Creation Version 0.1 +* @date 2010.06.29 +*/ + +#ifndef _UTS_TEL_GET_SIM_PB_INIT_INFO_H_ +#define _UTS_TEL_GET_SIM_PB_INIT_INFO_H_ + + static void utc_tel_get_sim_pb_init_info_01 (); + static void utc_tel_get_sim_pb_init_info_02 (); + static void utc_tel_get_sim_pb_init_info_03 (); + static void utc_tel_get_sim_pb_init_info_04 (); + + +#endif diff --git a/TC/telephony_TC/sim/unit/uts_tel_get_sim_pb_meta_info.c b/TC/telephony_TC/sim/unit/uts_tel_get_sim_pb_meta_info.c new file mode 100644 index 0000000..31d4bb9 --- /dev/null +++ b/TC/telephony_TC/sim/unit/uts_tel_get_sim_pb_meta_info.c @@ -0,0 +1,556 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +/** +* @ingroup TELEPHONY_API +* @addtogroup TAPI_API_SIM_SAT SIM/SAT +*/ + +/** +* @ingroup TAPI_API_SIM_SAT +* @addtogroup UTS_SIM_SAT Unit +*/ + +/** +* @ingroup UTS_SIM_SAT +* @addtogroup UTS_TAPI_SIM_PB_GET_ENTRY_INFO tel_get_sim_pb_meta_info +* +* @brief Unit test code for tel_get_sim_pb_meta_info() +* @par Test function Prototype: +* TapiResult_t tel_get_sim_pb_meta_info(TelSimPbFileType_t StorageFileType, int* pRequestId); +* @par Test function description: +* This API is used to get max text length and max number length supported by SIM phone book elementary file. +* @par Important Notes: +* The max number length includes the storage space provided by the corresponding EXT file for a given Dialling Number file. +* @param [in] StorageFileType Different storage types to be selected in SIM. +* @param [out] pRequestId Unique identifier for a particular request. +* - request_id value can be any value from 0 to 255 if the API is returned successfully +* - -1 (INVALID_REQUEST_ID) will be sent in case of failure. +* @par Async Response Message: +* The event associated is below and the event data is #TelSimPbEntryInfo_t. \n +* - TAPI_EVENT_SIM_PB_ENTRY_INFO_CNF +* @pre +* - Phonebook supported SIM used for test +* @post +* None +* @return +* Return Type : (TapiResult_t) +* - TAPI_API_SUCCESS - indicating that the operation has completed successfully. +* - Otherwise it provides an error code (Refer #TapiResult_t) +* @{ +*/ + +/** +* @file uts_tel_get_sim_pb_meta_info.c +* @brief Test for the tel_get_sim_pb_meta_info() API that is used to get phonebook entry info +* @author +* @version Initial Creation V0.1 +* @date 2008.07.30 +*/ + + +#include +#include +#include + +#include "tet_tapi_util.h" +#include "uts_tel_get_sim_pb_meta_info.h" +#include "sim_common.h" + + +/* Initialize TCM data structures */ +static void startup(); +static void cleanup(); +void (*tet_startup) () = startup; +void (*tet_cleanup) () = cleanup; +struct tet_testlist tet_testlist[] = { + {utc_tel_get_sim_pb_meta_info_01, 1}, + {utc_tel_get_sim_pb_meta_info_02, 2}, + {utc_tel_get_sim_pb_meta_info_03, 3}, + {utc_tel_get_sim_pb_meta_info_04, 4}, + {utc_tel_get_sim_pb_meta_info_05, 5}, + {utc_tel_get_sim_pb_meta_info_06, 6}, + {utc_tel_get_sim_pb_meta_info_07, 7}, + {utc_tel_get_sim_pb_meta_info_08, 8}, + {utc_tel_get_sim_pb_meta_info_09, 9}, + {utc_tel_get_sim_pb_meta_info_10, 10}, + {utc_tel_get_sim_pb_meta_info_11, 11}, + {utc_tel_get_sim_pb_meta_info_12, 12}, + {utc_tel_get_sim_pb_meta_info_13, 13}, + {NULL, 0} +}; + +/* + User Defined Handler +*/ +// Global variable for user data +static BOOL gAsyncResult; //user defined data : Async callback is called or not + +/* Startup & Clean function : It is not test code, only for + initialize and finalize test module +*/ +static BOOL gStartupSuccess = FALSE; +static unsigned int subscription_id = 0; + + +/* + G_MAIN Utility //////////////////////////////////////////////////////////////////////////// +*/ +// Prototype : User must add function body +gboolean g_timeout_callback (void *data); + +// GMainLoop global handler +GMainLoop *sim_loop = NULL; + +void G_MAIN_LOOP_CLOSE() +{ + g_main_loop_quit(sim_loop); +} + +int G_MAIN_LOOP_RUN(int sec) +{ + sim_loop = g_main_loop_new (NULL, FALSE); + g_timeout_add ( (sec * 1000), g_timeout_callback, NULL); + g_main_loop_run (sim_loop); + + return 0; +} + +gboolean g_timeout_callback (void *data) +{ + gAsyncResult = FALSE; + tet_printf("[TIME OUT] g_timeout called .Close g_main_roop()"); + G_MAIN_LOOP_CLOSE(); + return FALSE; +} +// End of G_MAIN Utility////////////////////////////////////////////////////////////////////// + + +static int sim_app_callback (TelTapiEvent_t *sim_event) +{ + tet_printf("\n***************[SIM APP]Callback data **********************\n"); + tet_printf("[SIM]Reques Id[%d]\n", sim_event->RequestId); + tet_printf("[SIM]event status [%d]\n", sim_event->Status); + + gAsyncResult = FALSE; + BOOL bReceived = FALSE; + + switch(sim_event->EventType) + { + case TAPI_EVENT_SIM_PB_ENTRY_INFO_CNF: + { + tet_printf("\n[SIM]*****************TAPI_EVENT_SIM_PB_ENTRY_INFO_CNF***************************\n"); + +// TelSimPbEntryInfo_t *entryInfo = (TelSimPbEntryInfo_t*)sim_event->pData ; + tet_printf("SIM PB entry info event status = [%x]\n", sim_event->Status); + // tet_printf("[SIM APP]STORAGE TYPE [%d]\n", entryInfo->StorageFileType); + // tet_printf("[SIM APP]PB_INDEX_MIN %d\n", entryInfo->PbIndexMin); + // tet_printf("[SIM APP]PB_INDEX_MAX = %d\n", entryInfo->PbIndexMax); + // tet_printf("[SIM APP]PB_NUM_LEN_MAX = %d\n", entryInfo->PbNumLenMax); + // tet_printf("[SIM APP]PB_TEXT_LEN_MAX = %d\n", entryInfo->PbTextLenMax); + // tet_printf("********************************************\n"); + gAsyncResult = TRUE; + bReceived = TRUE; + } + break; + + default: + { + bReceived = TRUE; + gAsyncResult = FALSE; + tet_printf("Info TAPI_EVENT_SIM_PB_ENTRY_INFO_CNF = %d",TAPI_EVENT_SIM_PB_ENTRY_INFO_CNF); + tet_printf("[SIM]***************** Undhandled event type [%d] *****************\n",sim_event->EventType); + tet_printf("[SIM]Undhandled event state [%d]\n",sim_event->Status); + break; + } + }//end switch + + if (bReceived == TRUE) + G_MAIN_LOOP_CLOSE(); + + return 0; +} + + +static void startup() +{ + tet_infoline("utc_tel_get_sim_pb_meta_info Test Start\n"); + if ( tel_init() == TAPI_API_SUCCESS) + { + if (TAPI_API_SUCCESS == tel_register_event(TAPI_EVENT_SIM_PB_ENTRY_INFO_CNF,&subscription_id,(TelAppCallback)sim_app_callback,NULL) ) + gStartupSuccess = TRUE; + else + tet_infoline("startup fail. tel_register_event() failed"); + } else { + tet_infoline("startup fail. tel_init() failed"); + } + tel_register_app_name("org.samsung.test"); + return; +} + + +static void cleanup() +{ + tet_infoline("utc_tel_get_sim_pb_meta_info Test Finished\n"); + if (gStartupSuccess == TRUE) + { + tel_deregister_event(subscription_id); + } + tel_deinit(); + + return; +} + + +/* + Unit Test Case functions +*/ + +/** +* @brief tel_get_sim_pb_meta_info() API : Negative condition(Low boundary test) +* @par ID: UTC_TEL_GET_SIM_PB_META_INFO_01 +* @param [in] StorageFileType = (TelSimPbFileType_t)TAPI_SIM_PB_FDN-1; +* @param [out] &pRequestId +* @return TAPI_API_INVALID_INPUT +*/ +void utc_tel_get_sim_pb_meta_info_01() +{ + TET_STAMP_START("TAPI_API_INVALID_INPUT test 1"); + TelSimPbFileType_t StorageFileType=(TelSimPbFileType_t)TAPI_SIM_PB_FDN-1; + int pRequestId=0; + + TET_CHECK(TAPI_API_INVALID_INPUT, tel_get_sim_pb_meta_info(StorageFileType,&pRequestId)); + TET_STAMP_PASS(); +} + +/** +* @brief tel_get_sim_pb_meta_info() API : Negative condition(Upper boundary test) +* @par ID: UTC_TEL_GET_SIM_PB_META_INFO_02 +* @param [in] StorageFileType = (TelSimPbFileType_t)TAPI_SIM_PB_UNKNOWNN+1; +* @param [out] &pRequestId +* @return TAPI_API_INVALID_INPUT +*/ +void utc_tel_get_sim_pb_meta_info_02() +{ + TET_STAMP_START("TAPI_API_INVALID_INPUT test 2"); + TelSimPbFileType_t StorageFileType=(TelSimPbFileType_t)TAPI_SIM_PB_UNKNOWNN+1; + int pRequestId=0; + + TET_CHECK(TAPI_API_INVALID_INPUT, tel_get_sim_pb_meta_info(StorageFileType,&pRequestId)); + TET_STAMP_PASS(); +} + +/** +* @brief tel_get_sim_pb_meta_info() API : Negative condition(NULL Parameter test) +* @par ID: UTC_TEL_GET_SIM_PB_META_INFO_03 +* @param [in] StorageFileType = TAPI_SIM_PB_GAS +* @param [out] &pRequestId = NULL +* @return TAPI_API_INVALID_PTR +*/ +void utc_tel_get_sim_pb_meta_info_03() +{ + TET_STAMP_START("TAPI_API_INVALID_PTR test"); + TelSimPbFileType_t StorageFileType=TAPI_SIM_PB_GAS; + + TET_CHECK(TAPI_API_INVALID_PTR,tel_get_sim_pb_meta_info(StorageFileType,NULL)); + TET_STAMP_PASS(); +} + +/** +* @brief tel_get_sim_pb_meta_info() API : Positive condition(Get Entry info for a Phonebook FDN record) +* @par ID: UTC_TEL_GET_SIM_PB_META_INFO_04 +* @param [in] StorageFileType = TAPI_SIM_PB_FDN +* @param [out] &pRequestId +* @return TAPI_API_SUCCESS +* @par Async Response Message: +* The event associated is below and the event data is #TelSimPbEntryInfo_t. \n +* - TAPI_EVENT_SIM_PB_ENTRY_INFO_CNF +*/ +void utc_tel_get_sim_pb_meta_info_04() +{ + TET_STAMP_START("StorageFileType = TAPI_SIM_PB_FDN"); + TET_RESULT_NOT_EQUAL(TET_UNTESTED,gStartupSuccess, TRUE); + + TelSimPbFileType_t StorageFileType=TAPI_SIM_PB_FDN; + int pRequestId=0; + + gAsyncResult = FALSE; + + TET_CHECK(TAPI_API_SUCCESS,tel_get_sim_pb_meta_info(StorageFileType,&pRequestId)); + + G_MAIN_LOOP_RUN(5); + TET_RESULT_NOT_EQUAL(TET_FAIL,gAsyncResult,TRUE); // If gAsyncResult != TRUE, then TET_FAIL and return + TET_STAMP_PASS(); + return; +} + +/** +* @brief tel_get_sim_pb_meta_info() API : Positive condition(Get Entry info for a Phonebook LDN record) +* @par ID: UTC_TEL_GET_SIM_PB_META_INFO_05 +* @param [in] StorageFileType = TAPI_SIM_PB_LDN +* @param [out] &pRequestId +* @return TAPI_API_SUCCESS +* @par Async Response Message: +* The event associated is below and the event data is #TelSimPbEntryInfo_t. \n +* - TAPI_EVENT_SIM_PB_ENTRY_INFO_CNF +*/ +void utc_tel_get_sim_pb_meta_info_05() +{ + TET_STAMP_START("StorageFileType = TAPI_SIM_PB_LDN"); + TET_RESULT_NOT_EQUAL(TET_UNTESTED,gStartupSuccess, TRUE); + + TelSimPbFileType_t StorageFileType=TAPI_SIM_PB_LDN; + int pRequestId=0; + + gAsyncResult = FALSE; + + TET_CHECK(TAPI_API_SUCCESS,tel_get_sim_pb_meta_info(StorageFileType,&pRequestId)); + + G_MAIN_LOOP_RUN(5); + TET_RESULT_NOT_EQUAL(TET_FAIL,gAsyncResult,TRUE); // If gAsyncResult != TRUE, then TET_FAIL and return + TET_STAMP_PASS(); + return; +} + + +/** +* @brief tel_get_sim_pb_meta_info() API : Positive condition(Get Entry info for a Phonebook MSISDN record) +* @par ID: UTC_TEL_GET_SIM_PB_META_INFO_06 +* @param [in] StorageFileType = TAPI_SIM_PB_MSISDN +* @param [out] &pRequestId +* @return TAPI_API_SUCCESS +* @par Async Response Message: +* The event associated is below and the event data is #TelSimPbEntryInfo_t. \n +* - TAPI_EVENT_SIM_PB_ENTRY_INFO_CNF +*/ +void utc_tel_get_sim_pb_meta_info_06() +{ + TET_STAMP_START("StorageFileType = TAPI_SIM_PB_MSISDN"); + TET_RESULT_NOT_EQUAL(TET_UNTESTED,gStartupSuccess, TRUE); + + TelSimPbFileType_t StorageFileType=TAPI_SIM_PB_MSISDN; + int pRequestId=0; + + gAsyncResult = FALSE; + + TET_CHECK(TAPI_API_SUCCESS,tel_get_sim_pb_meta_info(StorageFileType,&pRequestId)); + + G_MAIN_LOOP_RUN(5); + TET_RESULT_NOT_EQUAL(TET_FAIL,gAsyncResult,TRUE); // If gAsyncResult != TRUE, then TET_FAIL and return + TET_STAMP_PASS(); + return; +} + + +/** +* @brief tel_get_sim_pb_meta_info() API : Positive condition(Get Entry info for a Phonebook ADN record) +* @par ID: UTC_TEL_GET_SIM_PB_META_INFO_07 +* @param [in] StorageFileType = TAPI_SIM_PB_ADN +* @param [out] &pRequestId +* @return TAPI_API_SUCCESS +* @par Async Response Message: +* The event associated is below and the event data is #TelSimPbEntryInfo_t. \n +* - TAPI_EVENT_SIM_PB_ENTRY_INFO_CNF +*/ +void utc_tel_get_sim_pb_meta_info_07() +{ + TET_STAMP_START("StorageFileType = TAPI_SIM_PB_ADN"); + TET_RESULT_NOT_EQUAL(TET_UNTESTED,gStartupSuccess, TRUE); + + TelSimPbFileType_t StorageFileType=TAPI_SIM_PB_ADN; + int pRequestId=0; + + gAsyncResult = FALSE; + + TET_CHECK(TAPI_API_SUCCESS,tel_get_sim_pb_meta_info(StorageFileType,&pRequestId)); + + G_MAIN_LOOP_RUN(5); + TET_RESULT_NOT_EQUAL(TET_FAIL,gAsyncResult,TRUE); // If gAsyncResult != TRUE, then TET_FAIL and return + TET_STAMP_PASS(); + return; +} + + +/** +* @brief tel_get_sim_pb_meta_info() API : Positive condition(Get Entry info for a Phonebook SDN record) +* @par ID: UTC_TEL_GET_SIM_PB_META_INFO_08 +* @param [in] StorageFileType = TAPI_SIM_PB_SDN +* @param [out] &pRequestId +* @return TAPI_API_SUCCESS +* @par Async Response Message: +* The event associated is below and the event data is #TelSimPbEntryInfo_t. \n +* - TAPI_EVENT_SIM_PB_ENTRY_INFO_CNF +*/ +void utc_tel_get_sim_pb_meta_info_08() +{ + TET_STAMP_START("StorageFileType = TAPI_SIM_PB_SDN"); + TET_RESULT_NOT_EQUAL(TET_UNTESTED,gStartupSuccess, TRUE); + + TelSimPbFileType_t StorageFileType=TAPI_SIM_PB_SDN; + int pRequestId=0; + + gAsyncResult = FALSE; + + TET_CHECK(TAPI_API_SUCCESS,tel_get_sim_pb_meta_info(StorageFileType,&pRequestId)); + + G_MAIN_LOOP_RUN(5); + TET_RESULT_NOT_EQUAL(TET_FAIL,gAsyncResult,TRUE); // If gAsyncResult != TRUE, then TET_FAIL and return + TET_STAMP_PASS(); + return; +} + + +/** +* @brief tel_get_sim_pb_meta_info() API : Positive condition(Get Entry info for a Phonebook EN record) +* @par ID: UTC_TEL_GET_SIM_PB_META_INFO_09 +* @param [in] StorageFileType = TAPI_SIM_PB_EN +* @param [out] &pRequestId +* @return TAPI_API_SUCCESS +* @par Async Response Message: +* The event associated is below and the event data is #TelSimPbEntryInfo_t. \n +* - TAPI_EVENT_SIM_PB_ENTRY_INFO_CNF +*/ +void utc_tel_get_sim_pb_meta_info_09() +{ + TET_STAMP_START("StorageFileType = TAPI_SIM_PB_EN"); + TET_RESULT_NOT_EQUAL(TET_UNTESTED,gStartupSuccess, TRUE); + + TelSimPbFileType_t StorageFileType=TAPI_SIM_PB_EN; + int pRequestId=0; + + gAsyncResult = FALSE; + + TET_CHECK(TAPI_API_SUCCESS,tel_get_sim_pb_meta_info(StorageFileType,&pRequestId)); + + G_MAIN_LOOP_RUN(5); + TET_RESULT_NOT_EQUAL(TET_FAIL,gAsyncResult,TRUE); // If gAsyncResult != TRUE, then TET_FAIL and return + TET_STAMP_PASS(); + return; +} + + +/** +* @brief tel_get_sim_pb_meta_info() API : Positive condition(Get Entry info for a Phonebook 3GSIM record) +* @par ID: UTC_TEL_GET_SIM_PB_META_INFO_10 +* @param [in] StorageFileType = TAPI_SIM_PB_3GSIM +* @param [out] &pRequestId +* @return TAPI_API_SUCCESS +* @par Async Response Message: +* The event associated is below and the event data is #TelSimPbEntryInfo_t. \n +* - TAPI_EVENT_SIM_PB_ENTRY_INFO_CNF +*/ +void utc_tel_get_sim_pb_meta_info_10() +{ + TET_STAMP_START("StorageFileType = TAPI_SIM_PB_3GSIM"); + TET_RESULT_NOT_EQUAL(TET_UNTESTED,gStartupSuccess, TRUE); + + TelSimPbFileType_t StorageFileType=TAPI_SIM_PB_3GSIM; + int pRequestId=0; + + gAsyncResult = FALSE; + + TET_CHECK(TAPI_API_SUCCESS,tel_get_sim_pb_meta_info(StorageFileType,&pRequestId)); + + G_MAIN_LOOP_RUN(5); + TET_RESULT_NOT_EQUAL(TET_FAIL,gAsyncResult,TRUE); // If gAsyncResult != TRUE, then TET_FAIL and return + TET_STAMP_PASS(); + return; +} + + +/** +* @brief tel_get_sim_pb_meta_info() API : Positive condition(Get Entry info for a Phonebook AAS record) +* @par ID: UTC_TEL_GET_SIM_PB_META_INFO_11 +* @param [in] StorageFileType = TAPI_SIM_PB_AAS +* @param [out] &pRequestId +* @return TAPI_API_SUCCESS +* @par Async Response Message: +* The event associated is below and the event data is #TelSimPbEntryInfo_t. \n +* - TAPI_EVENT_SIM_PB_ENTRY_INFO_CNF +*/ +void utc_tel_get_sim_pb_meta_info_11() +{ + TET_STAMP_START("StorageFileType = TAPI_SIM_PB_AAS"); + TET_RESULT_NOT_EQUAL(TET_UNTESTED,gStartupSuccess, TRUE); + + TelSimPbFileType_t StorageFileType=TAPI_SIM_PB_AAS; + int pRequestId=0; + + gAsyncResult = FALSE; + + TET_CHECK(TAPI_API_SUCCESS,tel_get_sim_pb_meta_info(StorageFileType,&pRequestId)); + + G_MAIN_LOOP_RUN(5); + TET_RESULT_NOT_EQUAL(TET_FAIL,gAsyncResult,TRUE); // If gAsyncResult != TRUE, then TET_FAIL and return + TET_STAMP_PASS(); + return; +} + + + +/** +* @brief tel_get_sim_pb_meta_info() API : Positive condition(Get Entry info for a Phonebook GAS record) +* @par ID: UTC_TEL_GET_SIM_PB_META_INFO_12 +* @param [in] StorageFileType = TAPI_SIM_PB_GAS +* @param [out] &pRequestId +* @return TAPI_API_SUCCESS +* @par Async Response Message: +* The event associated is below and the event data is #TelSimPbEntryInfo_t. \n +* - TAPI_EVENT_SIM_PB_ENTRY_INFO_CNF +*/ +void utc_tel_get_sim_pb_meta_info_12() +{ + TET_STAMP_START("StorageFileType = TAPI_SIM_PB_GAS"); + TET_RESULT_NOT_EQUAL(TET_UNTESTED,gStartupSuccess, TRUE); + + TelSimPbFileType_t StorageFileType=TAPI_SIM_PB_GAS; + int pRequestId=0; + + gAsyncResult = FALSE; + + TET_CHECK(TAPI_API_SUCCESS,tel_get_sim_pb_meta_info(StorageFileType,&pRequestId)); + + G_MAIN_LOOP_RUN(5); + TET_RESULT_NOT_EQUAL(TET_FAIL,gAsyncResult,TRUE); // If gAsyncResult != TRUE, then TET_FAIL and return + TET_STAMP_PASS(); + return; +} + + +/** +* @brief tel_get_sim_pb_meta_info() API : Negative condition( StorageFileType=TAPI_SIM_PB_UNKNOWNN) +* @par ID: UTC_TEL_GET_SIM_PB_META_INFO_13 +* @param [in] StorageFileType = TAPI_SIM_PB_UNKNOWNN +* @param [out] &pRequestId +* @return TAPI_API_INVALID_INPUT +*/ +void utc_tel_get_sim_pb_meta_info_13() +{ + TET_STAMP_START("StorageFileType = TAPI_SIM_PB_UNKNOWNN"); + TelSimPbFileType_t StorageFileType=TAPI_SIM_PB_UNKNOWNN; + int pRequestId=0; + + TET_CHECK(TAPI_API_INVALID_INPUT,tel_get_sim_pb_meta_info(StorageFileType,&pRequestId)); + TET_STAMP_PASS(); + return; +} + +/** @} */ diff --git a/TC/telephony_TC/sim/unit/uts_tel_get_sim_pb_meta_info.h b/TC/telephony_TC/sim/unit/uts_tel_get_sim_pb_meta_info.h new file mode 100644 index 0000000..20b1daa --- /dev/null +++ b/TC/telephony_TC/sim/unit/uts_tel_get_sim_pb_meta_info.h @@ -0,0 +1,41 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * 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 _uts_tel_get_sim_pb_meta_info_H_ +#define _uts_tel_get_sim_pb_meta_info_H_ + + static void utc_tel_get_sim_pb_meta_info_01(); + static void utc_tel_get_sim_pb_meta_info_02(); + static void utc_tel_get_sim_pb_meta_info_03(); + static void utc_tel_get_sim_pb_meta_info_04(); + static void utc_tel_get_sim_pb_meta_info_05(); + static void utc_tel_get_sim_pb_meta_info_06(); + static void utc_tel_get_sim_pb_meta_info_07(); + static void utc_tel_get_sim_pb_meta_info_08(); + static void utc_tel_get_sim_pb_meta_info_09(); + static void utc_tel_get_sim_pb_meta_info_10(); + static void utc_tel_get_sim_pb_meta_info_11(); + static void utc_tel_get_sim_pb_meta_info_12(); + static void utc_tel_get_sim_pb_meta_info_13(); + +#endif + diff --git a/TC/telephony_TC/sim/unit/uts_tel_get_sim_personalization_status.c b/TC/telephony_TC/sim/unit/uts_tel_get_sim_personalization_status.c new file mode 100644 index 0000000..b9c2b8a --- /dev/null +++ b/TC/telephony_TC/sim/unit/uts_tel_get_sim_personalization_status.c @@ -0,0 +1,331 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** +* @ingroup TELEPHONY_API +* @addtogroup TAPI_API_SIM_SAT SIM/SAT +*/ + +/** +* @ingroup TAPI_API_SIM_SAT +* @addtogroup UTS_SIM_SAT Unit +*/ + +/** +* @ingroup UTS_SIM_SAT +* @addtogroup UTS_TAPI_SIM_LOCK_ENABLE_PERSONALISATION tel_enable_sim_personalization +* +* @brief Unit test code for tel_enable_sim_personalization() +* @par Test function Prototype: +* TapiResult_t tel_enable_sim_personalization(TelSimLockPersonalisationInfo_t *PersonalisationPwd, int *pRequestId); +* @par Test function description: +* This API is used to enable the network personalisation feature. +* @par Important Notes: +* None +* @param [in] PersonalisationPwd +* The information required to disable network personalisation. +* @code + typedef struct + { + TelSimPersType_t PersonalisationLock; + UINT8 Password_length; + UINT8 Personalisation_password[TAPI_SEC_LOCK_PERSONALISATION_PASSWD_LEN]; + }TelSimLockPersonalisationInfo_t; +* @endcode +* @param [out] pRequestId Unique identifier for a particular request. +* - request_id value can be any value from 0 to 255 if the API is returned successfully +* - -1 (INVALID_REQUEST_ID) will be sent in case of failure. +* @par Async Response Message: +* The event associated is TAPI_EVENT_SIM_ENABLE_PERSONALIZATION_CNF +* @pre +* None +* @post +* None +* @return +* Return Type : (TapiResult_t) +* - TAPI_API_SUCCESS - indicating that the operation has completed successfully. +* - Otherwise it provides an error code (Refer #TapiResult_t) +* @{ +*/ + +/** +* @file uts_tapi_sim_lock_personalization.c +* @brief + Test for the tel_disable_sim_personalization() API that is used to disable the network personalisation feature \n + Test for the tel_enable_sim_personalization() API that is used to enable the network personalisation feature +* @author +* @version Initial Creation V0.1 +* @date 2008.07.30 +*/ + +#include +#include +#include + +#include "tet_tapi_util.h" +#include "sim_common.h" +#include "uts_tel_get_sim_personalization_status.h" + + +/* Initialize TCM data structures */ +static void startup(); +static void cleanup(); +void (*tet_startup) () = startup; +void (*tet_cleanup) () = cleanup; +struct tet_testlist tet_testlist[] = { + {utc_tel_get_sim_personalization_status01, 1}, + {utc_tel_get_sim_personalization_status02, 2}, + {utc_tel_get_sim_personalization_status03, 3}, + {utc_tel_get_sim_personalization_status04, 4}, + {utc_tel_get_sim_personalization_status05, 5}, + {NULL, 0} +}; + + +/* + G_MAIN Utility //////////////////////////////////////////////////////////////////////////// +*/ +// Prototype : User must add function body +gboolean g_timeout_callback (void *data); + +// GMainLoop global handler +GMainLoop *nw_context_loop = NULL; + +void G_MAIN_LOOP_CLOSE() +{ + g_main_loop_quit(nw_context_loop); +} + +int G_MAIN_LOOP_RUN(int sec) +{ + //GMainLoop *mainloop; + nw_context_loop = g_main_loop_new (NULL, FALSE); + g_timeout_add ( (sec * 1000), g_timeout_callback, NULL); + g_main_loop_run (nw_context_loop); + + return 0; +} +// End of G_MAIN Utility////////////////////////////////////////////////////////////////////// + + +/* + User Defined Handler +*/ +// Global variable for user data +static BOOL gAsyncResult; //user defined data : Async callback is called or not + +// G_MAIN Utility : time out callback function +gboolean g_timeout_callback (void *data) +{ + gAsyncResult = FALSE; + tet_printf("[SIM APP][TIME OUT] g_timeout called .Close g_main_roop()"); + G_MAIN_LOOP_CLOSE(); + return FALSE; +} + + +static int sim_app_callback (TelTapiEvent_t *sim_event) +{ + tet_printf("\n\n\n***************[SIM APP]Callback data **********************\n"); + tet_printf("[SIM APP]Reques Id[%d]\n", sim_event->RequestId); + tet_printf("[SIM APP]event status [%d]\n", sim_event->Status); + + gAsyncResult = FALSE; + BOOL bReceived = FALSE; + + switch(sim_event->EventType) + { + case TAPI_EVENT_SIM_PERS_STATUS_CNF: + { + tet_printf("\n[GOT THE EVENT]*******TAPI_EVENT_SIM_PERS_STATUS_CNF******\n"); + tet_printf("[SIM APP]SIM personalization status event status = [0x%x]\n", sim_event->Status); + bReceived = TRUE; + gAsyncResult = TRUE; + } + break; + + default: + { + bReceived = TRUE; + gAsyncResult = FALSE; + tet_printf("[SIM APP]***************** Undhandled event type [%d] *****************\n",sim_event->EventType); + tet_printf("[SIM APP]Undhandled event state [%d]\n",sim_event->Status); + } + break; + }//end switch + + if (bReceived == TRUE) + G_MAIN_LOOP_CLOSE(); + + return 0; +} + + + +/* Startup & Clean function : It is not test code, only for + initialize and finalize test module +*/ +static BOOL gStartupSuccess = FALSE; +static unsigned int subscription_id = 0; + +static void startup() +{ + tet_infoline("uts_tel_get_sim_personalization_status Test Start\n"); + + if ( tel_init() == TAPI_API_SUCCESS) + { + if (TAPI_API_SUCCESS == tel_register_event(TAPI_EVENT_SIM_PERS_STATUS_CNF,&subscription_id,(TelAppCallback)sim_app_callback,NULL) ) + gStartupSuccess = TRUE; + else + tet_infoline("startup fail. tel_register_event() failed"); + } else { + tet_infoline("startup fail. tel_init() failed"); + } + + tel_register_app_name("org.samsung.test"); + return; +} + + +static void cleanup() +{ + tet_infoline("uts_tel_get_sim_personalization_status Test Finished\n"); + + if (gStartupSuccess == TRUE) + { + tel_deregister_event(subscription_id); + } + tel_deinit(); + return; +} + + + +/* + Unit Test Case functions +*/ +/** +* @brief TelTapiSimGetLockPersonalisationSatus() API : Negative condition(invalid input parameterl) +* @par ID: UTC_TEL_GET_SIM_PERSONALIZATION_STATUS01 +* @param [in] PersType = TAPI_SIM_PERS_CP+1 +* @param [out]&pRequestId +* @return TAPI_API_INVALID_INPUT +*/ +void utc_tel_get_sim_personalization_status01() +{ + TET_STAMP_START("utc_tel_get_sim_personalization_status01 -TAPI_API_INVALID_INPUT "); + int pRequestId=0; + TelSimPersType_t PersType = TAPI_SIM_PERS_CP+1 ; + TET_CHECK(TAPI_API_INVALID_INPUT,tel_get_sim_personalization_status (PersType, &pRequestId)); + TET_STAMP_PASS(); + return; +} + + +void utc_tel_get_sim_personalization_status02() +{ + TET_STAMP_START("utc_tel_get_sim_personalization_status02 "); + int pRequestId=0; + TelSimPersType_t PersType= TAPI_SIM_PERS_NET; + + gAsyncResult = FALSE; + + TET_CHECK(TAPI_API_SUCCESS,tel_get_sim_personalization_status (PersType, &pRequestId)); + + tet_printf("after real tc api - wait start"); + + G_MAIN_LOOP_RUN(5); + + tet_printf("after real tc api - wait stop"); + + TET_RESULT_NOT_EQUAL(TET_FAIL,gAsyncResult,TRUE); // If gAsyncResult != TRUE, then TET_FAIL and return + TET_STAMP_PASS(); + return; +} + + + + +void utc_tel_get_sim_personalization_status03() +{ + TET_STAMP_START("utc_tel_get_sim_personalization_status03 "); + int pRequestId=0; + TelSimPersType_t PersType=TAPI_SIM_PERS_NS ; + + gAsyncResult = FALSE; + + TET_CHECK(TAPI_API_SUCCESS,tel_get_sim_personalization_status (PersType, &pRequestId)); + + tet_printf("after real tc api - wait start"); + + G_MAIN_LOOP_RUN(5); + + tet_printf("after real tc api - wait stop"); + + TET_RESULT_NOT_EQUAL(TET_FAIL,gAsyncResult,TRUE); // If gAsyncResult != TRUE, then TET_FAIL and return + TET_STAMP_PASS(); + return; +} + + + +void utc_tel_get_sim_personalization_status04() +{ + TET_STAMP_START("utc_tel_get_sim_personalization_status04 "); + int pRequestId=0; + TelSimPersType_t PersType= TAPI_SIM_PERS_SP ; + + gAsyncResult = FALSE; + + TET_CHECK(TAPI_API_SUCCESS,tel_get_sim_personalization_status (PersType, &pRequestId)); + + tet_printf("after real tc api - wait start"); + + G_MAIN_LOOP_RUN(5); + + tet_printf("after real tc api - wait stop"); + + TET_RESULT_NOT_EQUAL(TET_FAIL,gAsyncResult,TRUE); // If gAsyncResult != TRUE, then TET_FAIL and return + TET_STAMP_PASS(); + return; +} + + +void utc_tel_get_sim_personalization_status05() +{ + TET_STAMP_START("utc_tel_get_sim_personalization_status05 "); + int pRequestId=0; + TelSimPersType_t PersType= TAPI_SIM_PERS_CP ; + + gAsyncResult = FALSE; + + TET_CHECK(TAPI_API_SUCCESS,tel_get_sim_personalization_status (PersType, &pRequestId)); + + tet_printf("after real tc api - wait start"); + + G_MAIN_LOOP_RUN(5); + + tet_printf("after real tc api - wait stop"); + + TET_RESULT_NOT_EQUAL(TET_FAIL,gAsyncResult,TRUE); // If gAsyncResult != TRUE, then TET_FAIL and return + TET_STAMP_PASS(); + return; +} + diff --git a/TC/telephony_TC/sim/unit/uts_tel_get_sim_personalization_status.h b/TC/telephony_TC/sim/unit/uts_tel_get_sim_personalization_status.h new file mode 100644 index 0000000..93982ef --- /dev/null +++ b/TC/telephony_TC/sim/unit/uts_tel_get_sim_personalization_status.h @@ -0,0 +1,31 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * 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 _UTS_TAPI_SIM_GETLOCK_PERSONALIZATION_STATUSH_ +#define _UTS_TAPI_SIM_GETLOCK_PERSONALIZATION_STATUSH_ + + static void utc_tel_get_sim_personalization_status01(); + static void utc_tel_get_sim_personalization_status02(); + static void utc_tel_get_sim_personalization_status03(); + static void utc_tel_get_sim_personalization_status04(); + static void utc_tel_get_sim_personalization_status05(); +#endif diff --git a/TC/telephony_TC/sim/unit/uts_tel_get_sim_security_status.c b/TC/telephony_TC/sim/unit/uts_tel_get_sim_security_status.c new file mode 100644 index 0000000..d2a622d --- /dev/null +++ b/TC/telephony_TC/sim/unit/uts_tel_get_sim_security_status.c @@ -0,0 +1,235 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +/** +* @ingroup TELEPHONY_API +* @addtogroup TAPI_API_SIM_SAT SIM/SAT +*/ + +/** +* @ingroup TAPI_API_SIM_SAT +* @addtogroup UTS_SIM_SAT Unit +*/ + +/** +* @ingroup UTS_SIM_SAT +* @addtogroup UTS_TAPI_SIM_GET_PIN_STATUS tel_get_sim_security_status +* +* @brief Unit test code for tel_get_sim_security_status() +* @par Test function Prototype: +* TapiResult_t tel_get_sim_security_status(TelSimPinStatus_t *pPinStatus, TelSimPinType_t* pPinType); +* @par Test function description: +* This function gets the current PIN (PIN1 or UPIN) status. +* @par Important Notes: +* None +* @param [out] pPinStatus +* This parameter returns the current Pin status. +* @code +typedef enum +{ + TAPI_SIM_PIN_STATUS_DISABLED = 0x00, + TAPI_SIM_PIN_STATUS_ENABLED = 0x01, + TAPI_SIM_PIN_STATUS_BLOCKED = 0x02, + TAPI_SIM_PIN_STATUS_PUK_BLOCKED = 0x03, + TAPI_SIM_PIN_STATUS_UNKNOWN = 0xFF +} TelSimPinStatus_t; +* @endcode +* @param [out] pPinType +* This parameter returns the current Pin (Pin1 or upin) type. +* @code +typedef enum +{ + TAPI_SIM_PTYPE_PIN1 = 0x00, + TAPI_SIM_PTYPE_PIN2 = 0x01, + TAPI_SIM_PTYPE_PUK1 = 0x02, + TAPI_SIM_PTYPE_PUK2 = 0x03, + TAPI_SIM_PTYPE_UPIN = 0x04, + TAPI_SIM_PTYPE_ADM = 0x05 +} TelSimPinType_t; +* @endcode +* @par Async Response Message: +* None +* @pre +* None +* @post +* None +* @return +* Return Type : (TapiResult_t) +* - TAPI_API_SUCCESS - indicating that the operation has completed successfully. +* - Otherwise it provides an error code (Refer #TapiResult_t) +* @{ +*/ + +/** +* @file uts_tel_get_sim_security_status.c +* @brief Test for the tel_get_sim_security_status() API that is used to get pin1 status +* @author +* @version Initial Creation V0.1 +* @date 2008.07.30 +*/ + +#include +#include +#include + +#include "tet_tapi_util.h" +#include "uts_tel_get_sim_security_status.h" +#include "sim_common.h" + + +/* Initialize TCM data structures */ +static void startup(); +static void cleanup(); +void (*tet_startup) () = startup; +void (*tet_cleanup) () = cleanup; +struct tet_testlist tet_testlist[] = { + {utc_tel_get_sim_security_status_01, 1}, + {utc_tel_get_sim_security_status_02, 2}, + {utc_tel_get_sim_security_status_03, 3}, + {NULL, 0} +}; + + +/* Startup & Clean function : It is not test code, only for + initialize and finalize test module +*/ +static void startup() +{ + tet_infoline("utc_tel_get_sim_security_status Test Start\n"); + if (tel_init() != TAPI_API_SUCCESS) + { + tet_infoline("startup fail. tel_init() failed"); + } + return; +} + + +static void cleanup() +{ + tet_infoline("utc_tel_get_sim_security_status Test Finished\n"); + if (tel_deinit() != TAPI_API_SUCCESS) + { + tet_infoline("startup fail. tel_deinit() failed"); + } + return; +} + + + +/* + Unit Test Case functions +*/ + +/** +* @brief tel_get_sim_security_status() API : Positive condition(Get PIN1 status) +* @par ID: UTC_TEL_SET_SIM_SECURITY_STATUS_01 +* @param [out] pPinStatus +* @param [in] pPinType +* @return TAPI_API_SUCCESS +* @par Expected Result: +* pPinStatus is one of TelSimPinStatus_t type value and pPinType is one of pPinType value +*/ +void utc_tel_get_sim_security_status_01() +{ + TET_STAMP_START("Normal operation - get pin1 status"); + TelSimPinStatus_t pin1_status = TAPI_SIM_PIN_STATUS_UNKNOWN; + TelSimPinType_t pPinType = TAPI_SIM_PTYPE_PIN1; + + TET_CHECK(TAPI_API_SUCCESS, tel_get_sim_security_status(pPinType, &pin1_status)); + tet_printf ("PIN1 status is %d\n", pin1_status); + if ( (pin1_status>=TAPI_SIM_PIN_STATUS_DISABLED && pin1_status<=TAPI_SIM_PIN_STATUS_PUK_BLOCKED)||(pin1_status==TAPI_SIM_PIN_STATUS_UNKNOWN)) + { + if ( pPinType >= TAPI_SIM_PTYPE_PIN1 && pPinType <=TAPI_SIM_PTYPE_ADM ) + { + TET_STAMP_PASS(); + return; + } + } + TET_STAMP_FAIL(); + return; +} + + +/** +* @brief tel_get_sim_security_status() API : Positive condition(Get PIN2 status) +* @par ID: UTC_TEL_SET_SIM_SECURITY_STATUS_02 +* @param [out] pPinStatus +* @param [in] pPinType +* @return TAPI_API_SUCCESS +* @par Expected Result: +* pPinStatus is one of TelSimPinStatus_t type value and pPinType is one of pPinType value +*/ +void utc_tel_get_sim_security_status_02() +{ + TET_STAMP_START("Normal operation - get pin2 status"); + TelSimPinStatus_t pin2_status = TAPI_SIM_PIN_STATUS_UNKNOWN; + TelSimPinType_t pPinType = TAPI_SIM_PTYPE_PIN2; + + TET_CHECK(TAPI_API_SUCCESS, tel_get_sim_security_status(pPinType, &pin2_status)); + tet_printf ("PIN1 status is %d\n", pin2_status); + if ( (pin2_status>=TAPI_SIM_PIN_STATUS_DISABLED && pin2_status<=TAPI_SIM_PIN_STATUS_PUK_BLOCKED)||(pin2_status==TAPI_SIM_PIN_STATUS_UNKNOWN)) + { + if ( pPinType >= TAPI_SIM_PTYPE_PIN1 && pPinType <=TAPI_SIM_PTYPE_ADM ) + { + TET_STAMP_PASS(); + return; + } + } + TET_STAMP_FAIL(); + return; +} + + +/** +* @brief tel_get_sim_security_status() API : Negative condition(Second parameter is NULL) +* @par ID: UTC_TEL_SET_SIM_SECURITY_STATUS_03 +* @param [out] pPinStatus = NULL +* @param [in] pPinType +* @return TAPI_API_INVALID_PTR +*/ +void utc_tel_get_sim_security_status_03() +{ + TET_STAMP_START("TAPI_API_INVALID_PTR"); + TelSimPinType_t pPinType = TAPI_SIM_PTYPE_PIN1; + + TET_CHECK(TAPI_API_INVALID_PTR,tel_get_sim_security_status(pPinType, NULL)); + TET_STAMP_PASS(); +} + +/** +* @brief tel_get_sim_security_status() API : Negative condition(first parameter is invalid) +* @par ID: UTC_TEL_SET_SIM_SECURITY_STATUS_04 +* @param [out] pPinStatus +* @param [in] pPinType = NULL +* @return TAPI_API_INVALID_INPUT +*/ +void utc_tel_get_sim_security_status_04() +{ + TET_STAMP_START("TAPI_API_INVALID_PTR 2"); + TelSimPinStatus_t pin1_status = TAPI_SIM_PIN_STATUS_UNKNOWN; + TelSimPinType_t pPinType = TAPI_SIM_PTYPE_SIM+1; + + TET_CHECK(TAPI_API_INVALID_INPUT,tel_get_sim_security_status(pPinType, &pin1_status)); + TET_STAMP_PASS(); +} + + +/** @} */ diff --git a/TC/telephony_TC/sim/unit/uts_tel_get_sim_security_status.h b/TC/telephony_TC/sim/unit/uts_tel_get_sim_security_status.h new file mode 100644 index 0000000..bb3475b --- /dev/null +++ b/TC/telephony_TC/sim/unit/uts_tel_get_sim_security_status.h @@ -0,0 +1,29 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * 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 _uts_tel_get_sim_security_status_H_ +#define _uts_tel_get_sim_security_status_H_ + + static void utc_tel_get_sim_security_status_01(); + static void utc_tel_get_sim_security_status_02(); + static void utc_tel_get_sim_security_status_03(); + +#endif diff --git a/TC/telephony_TC/sim/unit/uts_tel_get_sim_type.c b/TC/telephony_TC/sim/unit/uts_tel_get_sim_type.c new file mode 100644 index 0000000..c6dac4f --- /dev/null +++ b/TC/telephony_TC/sim/unit/uts_tel_get_sim_type.c @@ -0,0 +1,161 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** +* @ingroup TELEPHONY_API +* @addtogroup TAPI_API_SIM_SAT SIM/SAT +*/ + +/** +* @ingroup TAPI_API_SIM_SAT +* @addtogroup UTS_SIM_SAT Unit +*/ + +/** +* @ingroup UTS_SIM_SAT +* @addtogroup UTS_TEL_GET_SIM_TYPE tel_get_sim_type +* +* @brief Unit test code for tel_get_sim_type() +* @par Test function Prototype: +* TapiResult_t tel_get_sim_type(TelSimCardType_t *pCardInfo); +* @par Test function description: +* This function is a synchronous API which gets the Card Type whether SIM Card is a GSM SIM or a 3G SIM. +* @par Important Notes: +* None +* @param [in] +* None +* @param [out] pCardInfo +* This parameter returns the SIM card type information like whether it is GSM SIM card or USIM or it is of unknown type. +* - TAPI_SIM_CARD_TYPE_UNKNOWN +* - TAPI_SIM_CARD_TYPE_GSM +* - TAPI_SIM_CARD_TYPE_USIM +* @par Async Response Message +* None +* @pre +* Before test, prepare GSM SIM and USIM cards. +* @post +* None +* @return +* Return Type : (TapiResult_t) +* - TAPI_API_SUCCESS - indicating that the operation has completed successfully. +* - Otherwise it provides an error code (Refer #TapiResult_t) +* @{ +*/ + +/** +* @file uts_tel_get_sim_type.c +* @brief Test for the tel_get_sim_type() API that is used to get SIM Card type +* @author +* @version Initial Creation V0.1 +* @date 2008.07.30 +*/ + +#include +#include +#include "uts_tel_get_sim_type.h" +#include "tet_tapi_util.h" + +/* Initialize TCM data structures */ +static void startup(); +static void cleanup(); +void (*tet_startup) () = startup; +void (*tet_cleanup) () = cleanup; +struct tet_testlist tet_testlist[] = { + {utc_tel_get_sim_type_01, 1}, + {utc_tel_get_sim_type_02, 2}, + {NULL, 0} +}; + +/* Startup & Clean function : It is not test code, only for + initialize and finalize test module +*/ +static void startup() +{ + tet_infoline("uts_tel_get_sim_imsi Test Start\n"); + if (tel_init() != TAPI_API_SUCCESS) + { + tet_infoline("startup fail. tel_init() failed"); + } + return; +} + + +static void cleanup() +{ + tet_infoline("uts_tel_get_sim_imsi Test Finished\n"); + if (tel_deinit() != TAPI_API_SUCCESS) + { + tet_infoline("startup fail. tel_deinit() failed"); + } + return; +} + + + +/* + Unit Test Case functions +*/ + +/** +* @brief tel_get_sim_type() API : Normal condition +* @par ID: UTC_TEL_GET_SIM_TYPE_01 +* @param [out] &cardInfo +* @return TAPI_API_SUCCESS +* @par Expected Result: +* - Out paramter's value satisfied below +*@n -#cardInfo >= 0 and #cardInfo <= 2 (TAPI_SIM_CARD_TYPE_UNKNOWN, TAPI_SIM_CARD_TYPE_GSM, TAPI_SIM_CARD_TYPE_USIM) +*/ +void utc_tel_get_sim_type_01() +{ + TET_STAMP_START("utc_tel_get_sim_type_01"); + TelSimCardType_t cardInfo; + + TET_STAMP_START("SIM Type check test"); + + /* Calling TAPI LAGUAGE INDICATOR API */ + TET_CHECK(TAPI_API_SUCCESS, tel_get_sim_type(&cardInfo)); + + tet_printf("The card type is %d\n", cardInfo); + tet_printf("\t0x00 : UNKNOWN\n\t0x01 : 2GGSM\n\t0x02 : 3G\n"); + + if (cardInfo >= 0 && cardInfo <= 2) + TET_STAMP_PASS(); + else + TET_STAMP_FAIL(); + return; +} + +/** +* @brief tel_get_sim_type() API : Negative condition(First parameter is Null) +* @par ID: UTC_TEL_GET_SIM_TYPE_02 +* @param [out] &cardInfo = NULL +* @return TAPI_API_INVALID_PTR +*/ +void utc_tel_get_sim_type_02() +{ + TET_STAMP_START("utc_tel_get_sim_type_02"); + + /* Calling TAPI LAGUAGE INDICATOR API */ + TET_CHECK( TAPI_API_INVALID_PTR,tel_get_sim_type(NULL)); + TET_STAMP_PASS(); + return; +} +/** @} */ + diff --git a/TC/telephony_TC/sim/unit/uts_tel_get_sim_type.h b/TC/telephony_TC/sim/unit/uts_tel_get_sim_type.h new file mode 100644 index 0000000..62f4e7d --- /dev/null +++ b/TC/telephony_TC/sim/unit/uts_tel_get_sim_type.h @@ -0,0 +1,32 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * 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 _UTS_TEL_GET_SIM_TYPE_H_ +#define _UTS_TEL_GET_SIM_TYPE_H_ + + static void utc_tel_get_sim_type_01 (); + static void utc_tel_get_sim_type_02 (); +// static void utc_tapi_get_basic_info_01(); +// static void utc_tapi_get_basic_info_02(); + + +#endif //_UTS_TEL_GET_SIM_TYPE_H_ + diff --git a/TC/telephony_TC/sim/unit/uts_tel_lock_sim_personalization.c b/TC/telephony_TC/sim/unit/uts_tel_lock_sim_personalization.c new file mode 100644 index 0000000..6075245 --- /dev/null +++ b/TC/telephony_TC/sim/unit/uts_tel_lock_sim_personalization.c @@ -0,0 +1,547 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** +* @ingroup TELEPHONY_API +* @addtogroup TAPI_API_SIM_SAT SIM/SAT +*/ + +/** +* @ingroup TAPI_API_SIM_SAT +* @addtogroup UTS_SIM_SAT Unit +*/ + +/** +* @ingroup UTS_SIM_SAT +* @addtogroup UTS_TAPI_SIM_LOCK_ENABLE_PERSONALISATION tel_enable_sim_personalization +* +* @brief Unit test code for tel_enable_sim_personalization() +* @par Test function Prototype: +* TapiResult_t tel_enable_sim_personalization(TelSimLockPersonalisationInfo_t *PersonalisationPwd, int *pRequestId); +* @par Test function description: +* This API is used to enable the network personalisation feature. +* @par Important Notes: +* None +* @param [in] PersonalisationPwd +* The information required to disable network personalisation. +* @code + typedef struct + { + TelSimLockType_t PersonalisationLock; + UINT8 Password_length; + UINT8 Personalisation_password[TAPI_SEC_LOCK_PERSONALISATION_PASSWD_LEN]; + }TelSimLockPersonalisationInfo_t; +* @endcode +* @param [out] pRequestId Unique identifier for a particular request. +* - request_id value can be any value from 0 to 255 if the API is returned successfully +* - -1 (INVALID_REQUEST_ID) will be sent in case of failure. +* @par Async Response Message: +* The event associated is TAPI_EVENT_SIM_ENABLE_PERSONALIZATION_CNF +* @pre +* None +* @post +* None +* @return +* Return Type : (TapiResult_t) +* - TAPI_API_SUCCESS - indicating that the operation has completed successfully. +* - Otherwise it provides an error code (Refer #TapiResult_t) +* @{ +*/ + +/** +* @file uts_tapi_sim_lock_personalization.c +* @brief + Test for the tel_disable_sim_personalization() API that is used to disable the network personalisation feature \n + Test for the tel_enable_sim_personalization() API that is used to enable the network personalisation feature +* @author +* @version Initial Creation V0.1 +* @date 2008.07.30 +*/ + +#include +#include +#include + +#include "tet_tapi_util.h" +#include "sim_common.h" +#include "uts_tel_lock_sim_personalization.h" +#include "async_util.h" + + +/* Initialize TCM data structures */ +static void startup(); +static void cleanup(); +void (*tet_startup) () = startup; +void (*tet_cleanup) () = cleanup; +struct tet_testlist tet_testlist[] = { + {utc_tel_enable_sim_personalization01, 1}, + {utc_tel_enable_sim_personalization02, 2}, + {utc_tel_enable_sim_personalization03, 3}, + {utc_tel_enable_sim_personalization04, 4}, + {utc_tel_disable_sim_personalization01, 5}, + {utc_tel_disable_sim_personalization02, 6}, + {utc_tel_disable_sim_personalization03, 7}, + {utc_tel_disable_sim_personalization04, 8}, + {NULL, 0} +}; + +/* + User Defined Handler +*/ +// Global variable for user data +static BOOL gAsyncResult; //user defined data : Async callback is called or not + +/* Startup & Clean function : It is not test code, only for + initialize and finalize test module +*/ +static BOOL gStartupSuccess = FALSE; +static unsigned int subscription_id = 0; + + +/* + G_MAIN Utility //////////////////////////////////////////////////////////////////////////// +*/ +// Prototype : User must add function body +gboolean g_timeout_callback (void *data); + +// GMainLoop global handler +GMainLoop *sim_loop = NULL; + +void G_MAIN_LOOP_CLOSE() +{ + g_main_loop_quit(sim_loop); +} + +int G_MAIN_LOOP_RUN(int sec) +{ + //GMainLoop *mainloop; + sim_loop = g_main_loop_new (NULL, FALSE); + g_timeout_add ( (sec * 1000), g_timeout_callback, NULL); + g_main_loop_run (sim_loop); + + return 0; +} + +gboolean g_timeout_callback (void *data) +{ + gAsyncResult = FALSE; + tet_printf("[TIME OUT] g_timeout called .Close g_main_roop()"); + G_MAIN_LOOP_CLOSE(); + return FALSE; +} +// End of G_MAIN Utility////////////////////////////////////////////////////////////////////// + + +static int sim_app_callback (TelTapiEvent_t *sim_event) +{ + tet_printf("\n***************[SIM APP]Callback data **********************\n"); + tet_printf("[SIM]Reques Id[%d]\n", sim_event->RequestId); + tet_printf("[SIM]event status [%d]\n", sim_event->Status); + + gAsyncResult = FALSE; + BOOL bReceived = FALSE; + + switch(sim_event->EventType) + { +#if 0 + case TAPI_EVENT_SIM_LOCKTYPE_INFO_CNF: + { + tet_printf("\n[GOT THE EVENT]*******TAPI_EVENT_SIM_LOCKTYPE_INFO_CNF******\n"); + tet_printf("[SIM APP]SIM SAP trasfer ATR event status = [0x%x]\n", sim_event->Status); + bReceived = TRUE; + gAsyncResult = TRUE; + } + break; +#endif + case TAPI_EVENT_SIM_ENABLE_PERS_CNF: + { + tet_printf("\n[GOT THE EVENT]*******TAPI_EVENT_SIM_DISABLE_PERS_CNF******\n"); + tet_printf("[SIM]SIM SAP trasfer ATR event status = [0x%x]\n", sim_event->Status); + bReceived = TRUE; + gAsyncResult = TRUE; + } + break; + + case TAPI_EVENT_SIM_DISABLE_PERS_CNF: + { + tet_printf("\n[GOT THE EVENT]*******TAPI_EVENT_SIM_DISABLE_PERS_CNF******\n"); + tet_printf("[SIM]SIM SAP trasfer ATR event status = [0x%x]\n", sim_event->Status); + bReceived = TRUE; + gAsyncResult = TRUE; + } + break; + + default: + { + bReceived = TRUE; + gAsyncResult = FALSE; + tet_printf("Info : TAPI_EVENT_SIM_ENABLE_PERS_CNF = %d", TAPI_EVENT_SIM_ENABLE_PERS_CNF); + tet_printf("[SIM]***************** Undhandled event type [%d] *****************\n",sim_event->EventType); + tet_printf("[SIM]Undhandled event state [%d]\n",sim_event->Status); + } + break; + }//end switch + + if (bReceived == TRUE) + G_MAIN_LOOP_CLOSE(); + + return 0; +} + + +static void startup() +{ + tet_infoline("uts_tapi_sim_lock_personalization Test Start\n"); + + if ( tel_init() == TAPI_API_SUCCESS) + { + if (TAPI_API_SUCCESS == tel_register_event(TAPI_EVENT_SIM_ENABLE_PERS_CNF, &subscription_id,(TelAppCallback)sim_app_callback,NULL) ) + gStartupSuccess = TRUE; + else + tet_infoline("startup fail. tel_register_event() failed"); + } else { + tet_infoline("startup fail. tel_init() failed"); + } + + tel_register_app_name("org.samsung.test"); + return; +} + + +static void cleanup() +{ + tet_infoline("uts_tapi_sim_lock_personalization Test Finished\n"); + + if (gStartupSuccess == TRUE) + { + tel_deregister_event(subscription_id); + } + tel_deinit(); + + return; +} + + + +/* + Unit Test Case functions +*/ +/** +* @brief tel_enable_sim_personalization() API : Negative condition(Parameter is Null) +* @par ID: UTC_TEL_ENABLE_SIM_PERSONALIZATION01 +* @param [in] &lock_pers = NULL +* @param [out]&pRequestId +* @return TAPI_API_INVALID_PTR +*/ +void utc_tel_enable_sim_personalization01() +{ + TET_STAMP_START("TAPI_API_INVALID_PTR "); + int pRequestId=0; + + TapiResult_t err = tel_enable_sim_personalization(NULL,&pRequestId); + tet_printf("%s[%d] %s(): error code =%d [%s] ",__FILE__,__LINE__,__FUNCTION__, err, TET_ERROR_TO_STRING(err) ); + if (err == TAPI_API_INVALID_PTR ) + TET_STAMP_PASS(); + else if ( err == TAPI_API_NOT_SUPPORTED ) + TET_STAMP(TET_NOTINUSE); + else + TET_STAMP_FAIL(); + +} + + +/** +* @brief tel_enable_sim_personalization() API : Negative condition(Parameter is Null) +* @par ID: UTC_TEL_ENABLE_SIM_PERSONALIZATION02 +* @param [in] &lock_pers +* @param [out]&pRequestId = NULL +* @return TAPI_API_INVALID_PTR +*/ +void utc_tel_enable_sim_personalization02() +{ + TET_STAMP_START("TAPI_API_INVALID_PTR "); + int pRequestId=0; + TelSimPersPw_t lock_pers;// = {0,}; + + lock_pers.type = TAPI_SIM_LOCK_PN; /* only for testing */ + + lock_pers.pw_len = 8 /*control key*/; + + TelSimImsiInfo_t pSimImsiInfo; + TET_PRECONDITION(TAPI_API_SUCCESS,tel_get_sim_imsi(&pSimImsiInfo)); + memcpy(&lock_pers.pw[1], pSimImsiInfo.szMcc, TAPI_SIM_MCC_CODE_LEN); + memcpy(&lock_pers.pw[1 + TAPI_SIM_MCC_CODE_LEN], pSimImsiInfo.szMnc, TAPI_SIM_MNC_CODE_LEN); + memcpy(lock_pers.pw, "12345678\0", 9); /* only for testing - random password */ + + tet_printf("check"); + TapiResult_t err = tel_enable_sim_personalization(&lock_pers,NULL); + tet_printf("%s[%d] %s(): error code =%d [%s] ",__FILE__,__LINE__,__FUNCTION__, err, TET_ERROR_TO_STRING(err) ); + if (err == TAPI_API_INVALID_PTR ) + TET_STAMP_PASS(); + else if ( err == TAPI_API_NOT_SUPPORTED ) + TET_STAMP(TET_NOTINUSE); + else + TET_STAMP_FAIL(); +} + +/** +* @brief tel_enable_sim_personalization() API : Positive condition(Normal operation) +* @par ID: UTC_TEL_ENABLE_SIM_PERSONALIZATION03 +* @pre Successfully get IMSI information using tel_get_sim_imsi() +* @param [in] &lock_pers +* @code + TelSimLockPersonalisationInfo_t lock_pers; + TelSimImsiInfo_t pSimImsiInfo; + tel_get_sim_imsi(&pSimImsiInfo); + + lock_pers.PersonalisationLock = TAPI_SIM_LOCK_PN; // only for testing + lock_pers.Password_length = 1 // 1 byte length of mnc+mcc + + 5 // 5 or 6 bytes mnc+mcc + + 6; //control key; + lock_pers.Personalisation_password[0] = 5; // mcc + mnc length can be 5 or 6 + memcpy(&lock_pers.Personalisation_password[1], pSimImsiInfo.szMcc, TAPI_SIM_MCC_CODE_LEN); + memcpy(&lock_pers.Personalisation_password[1 + TAPI_SIM_MCC_CODE_LEN], pSimImsiInfo.szMnc, TAPI_SIM_MNC_CODE_LEN); + memcpy(&lock_pers.Personalisation_password[1 + TAPI_SIM_MCC_CODE_LEN + TAPI_SIM_MNC_CODE_LEN], "123456", 6); // only for testing - random password +* @endcode +* @param [out]&pRequestId +* @return TAPI_API_SUCCESS +* @par Async Response Message: +* The event associated is TAPI_EVENT_SIM_ENABLE_PERSONALIZATION_CNF +*/ +void utc_tel_enable_sim_personalization03() +{ + TET_STAMP_START("Normal operation "); + TET_RESULT_NOT_EQUAL(TET_UNTESTED,gStartupSuccess, TRUE); + + int pRequestId=0; + TelSimPersPw_t lock_pers;// = {0,}; + + lock_pers.type = TAPI_SIM_LOCK_PN; /* only for testing */ + + lock_pers.pw_len = 8 /*control key*/; + + TelSimImsiInfo_t pSimImsiInfo; + TET_PRECONDITION(TAPI_API_SUCCESS,tel_get_sim_imsi(&pSimImsiInfo)); + memcpy(&lock_pers.pw[1], pSimImsiInfo.szMcc, TAPI_SIM_MCC_CODE_LEN); + memcpy(&lock_pers.pw[1 + TAPI_SIM_MCC_CODE_LEN], pSimImsiInfo.szMnc, TAPI_SIM_MNC_CODE_LEN); + memcpy(lock_pers.pw, "12345678\0", 9); /* only for testing - random password */ + + TapiResult_t err = tel_enable_sim_personalization(&lock_pers,&pRequestId); + if ( err == TAPI_API_NOT_SUPPORTED ) + { + tet_printf("%s[%d] %s(): error code =%d [%s] ",__FILE__,__LINE__,__FUNCTION__, err, TET_ERROR_TO_STRING(err) ); + TET_STAMP(TET_NOTINUSE); + return; + } + TET_CHECK(TAPI_API_SUCCESS,err); + + gAsyncResult = FALSE; + G_MAIN_LOOP_RUN(55); + TET_RESULT_NOT_EQUAL(TET_FAIL,gAsyncResult,TRUE); // If gAsyncResult != TRUE, then TET_FAIL and return + TET_STAMP_PASS(); +} + +void utc_tel_enable_sim_personalization04() +{ + TET_STAMP_START("Normal operation "); + TET_RESULT_NOT_EQUAL(TET_UNTESTED,gStartupSuccess, TRUE); + + int pRequestId=0; + TelSimPersPw_t lock_pers;// = {0,}; + + lock_pers.type = TAPI_SIM_LOCK_PN + 12; /* only for testing */ + + lock_pers.pw_len = 8 /*control key*/; + + TelSimImsiInfo_t pSimImsiInfo; + TET_PRECONDITION(TAPI_API_SUCCESS,tel_get_sim_imsi(&pSimImsiInfo)); + memcpy(&lock_pers.pw[1], pSimImsiInfo.szMcc, TAPI_SIM_MCC_CODE_LEN); + memcpy(&lock_pers.pw[1 + TAPI_SIM_MCC_CODE_LEN], pSimImsiInfo.szMnc, TAPI_SIM_MNC_CODE_LEN); + memcpy(lock_pers.pw, "12345678\0", 9); /* only for testing - random password */ + + TapiResult_t err = tel_enable_sim_personalization(&lock_pers,&pRequestId); + if ( err == TAPI_API_NOT_SUPPORTED ) + { + tet_printf("%s[%d] %s(): error code =%d [%s] ",__FILE__,__LINE__,__FUNCTION__, err, TET_ERROR_TO_STRING(err) ); + TET_STAMP(TET_NOTINUSE); + return; + } + TET_CHECK(TAPI_API_SUCCESS,err); + + gAsyncResult = FALSE; + G_MAIN_LOOP_RUN(55); + TET_RESULT_NOT_EQUAL(TET_FAIL,gAsyncResult,TRUE); // If gAsyncResult != TRUE, then TET_FAIL and return + TET_STAMP_PASS(); +} + +/** @} */ + + +/** +* @ingroup UTS_SIM_SAT +* @addtogroup UTS_TAPI_SIM_LOCK_DISABLE_PERSONALISATION tel_disable_sim_personalization +* +* @brief Unit test code for tel_disable_sim_personalization() +* @par Test function Prototype: +* TapiResult_t tel_disable_sim_personalization(TelSimLockPersonalisationInfo_t *PersonalisationPwd, int *pRequestId); +* @par Test function description: +* This API is used to disable the network personalisation feature. +* @par Important Notes: +* None +* @param [in] PersonalisationPwd +* The information required to disable network personalisation. +* @code + typedef struct + { + TelSimLockType_t PersonalisationLock; + UINT8 Password_length; + UINT8 Personalisation_password[TAPI_SEC_LOCK_PERSONALISATION_PASSWD_LEN]; + }TelSimLockPersonalisationInfo_t; +* @endcode +* @param [out] pRequestId Unique identifier for a particular request. +* - request_id value can be any value from 0 to 255 if the API is returned successfully +* - -1 (INVALID_REQUEST_ID) will be sent in case of failure. +* @par Async Response Message: +* The event associated is TAPI_EVENT_SIM_DISABLE_PERSONALIZATION_CNF +* @pre +* None +* @post +* None +* @return +* Return Type : (TapiResult_t) +* - TAPI_API_SUCCESS - indicating that the operation has completed successfully. +* - Otherwise it provides an error code (Refer #TapiResult_t) +* @{ +*/ + + +/** +* @file uts_tapi_sim_lock_personalization.c +* @brief + Test for the tel_disable_sim_personalization() API that is used to disable the network personalisation feature \n + Test for the tel_enable_sim_personalization() API that is used to enable the network personalisation feature +* @author +* @version Initial Creation V0.1 +* @date 2008.07.30 +*/ + +/** +* @brief tel_disable_sim_personalization() API : Negative condition(Parameter is Null) +* @par ID: UTC_TEL_DISABLE_SIM_PERSONALIZATION01 +* @param [in] &lock_pers = NULL +* @param [out]&pRequestId +* @return TAPI_API_INVALID_PTR +*/ +void utc_tel_disable_sim_personalization01() +{ + TET_STAMP_START("TAPI_API_INVALID_PTR "); + int pRequestId=0; + + TapiResult_t err = tel_disable_sim_personalization(NULL,&pRequestId); + tet_printf("%s[%d] %s(): error code =%d [%s] ",__FILE__,__LINE__,__FUNCTION__, err, TET_ERROR_TO_STRING(err) ); + if (err == TAPI_API_INVALID_PTR ) + TET_STAMP_PASS(); + else if ( err == TAPI_API_NOT_SUPPORTED ) + TET_STAMP(TET_NOTINUSE); + else + TET_STAMP_FAIL(); + +} + +/** +* @brief tel_disable_sim_personalization() API : Negative condition(Parameter is Null) +* @par ID: UTC_TEL_DISABLE_SIM_PERSONALIZATION02 +* @param [in] &lock_pers +* @param [out]&pRequestId = NULL +* @return TAPI_API_INVALID_PTR +*/ +void utc_tel_disable_sim_personalization02() +{ + TET_STAMP_START("TAPI_API_INVALID_PTR "); + int pRequestId=0; + TelSimPersPw_t lock_pers;// = {0,}; + + lock_pers.type = TAPI_SIM_LOCK_PN; /* only for testing */ + lock_pers.pw_len = 8 /*control key*/; + + TelSimImsiInfo_t pSimImsiInfo; + tel_get_sim_imsi(&pSimImsiInfo); + memcpy(&lock_pers.pw[1], pSimImsiInfo.szMcc, TAPI_SIM_MCC_CODE_LEN); + memcpy(&lock_pers.pw[1 + TAPI_SIM_MCC_CODE_LEN], pSimImsiInfo.szMnc, TAPI_SIM_MNC_CODE_LEN); + memcpy(lock_pers.pw, "12345678\0", 9); /* only for testing - random password */ + + TapiResult_t err = tel_disable_sim_personalization(&lock_pers,NULL); + tet_printf("%s[%d] %s(): error code =%d [%s] ",__FILE__,__LINE__,__FUNCTION__, err, TET_ERROR_TO_STRING(err) ); + if (err == TAPI_API_INVALID_PTR ) + TET_STAMP_PASS(); + else if ( err == TAPI_API_NOT_SUPPORTED ) + TET_STAMP(TET_NOTINUSE); + else + TET_STAMP_FAIL(); +} + +void utc_tel_disable_sim_personalization03() +{ + TET_STAMP_START("TAPI_API_INVALID_PTR "); + int pRequestId=0; + TelSimPersPw_t lock_pers;// = {0,}; + + lock_pers.type = TAPI_SIM_LOCK_PN; /* only for testing */ + lock_pers.pw_len = 8 /*control key*/; + + TelSimImsiInfo_t pSimImsiInfo; + tel_get_sim_imsi(&pSimImsiInfo); + memcpy(&lock_pers.pw[1], pSimImsiInfo.szMcc, TAPI_SIM_MCC_CODE_LEN); + memcpy(&lock_pers.pw[1 + TAPI_SIM_MCC_CODE_LEN], pSimImsiInfo.szMnc, TAPI_SIM_MNC_CODE_LEN); + memcpy(lock_pers.pw, "12345678\0", 9); /* only for testing - random password */ + + TapiResult_t err = tel_disable_sim_personalization(&lock_pers,&pRequestId); + tet_printf("%s[%d] %s(): error code =%d [%s] ",__FILE__,__LINE__,__FUNCTION__, err, TET_ERROR_TO_STRING(err) ); + if (err == TAPI_API_SUCCESS ) + TET_STAMP_PASS(); + else + TET_STAMP_FAIL(); +} + + +void utc_tel_disable_sim_personalization04() +{ + TET_STAMP_START("TAPI_API_INVALID_PTR "); + int pRequestId=0; + TelSimPersPw_t lock_pers;// = {0,}; + + lock_pers.type = TAPI_SIM_LOCK_PN-12; /* only for testing */ + lock_pers.pw_len = 8 /*control key*/; + + TelSimImsiInfo_t pSimImsiInfo; + tel_get_sim_imsi(&pSimImsiInfo); + memcpy(&lock_pers.pw[1], pSimImsiInfo.szMcc, TAPI_SIM_MCC_CODE_LEN); + memcpy(&lock_pers.pw[1 + TAPI_SIM_MCC_CODE_LEN], pSimImsiInfo.szMnc, TAPI_SIM_MNC_CODE_LEN); + memcpy(lock_pers.pw, "12345678\0", 9); /* only for testing - random password */ + + TapiResult_t err = tel_disable_sim_personalization(&lock_pers,&pRequestId); + tet_printf("%s[%d] %s(): error code =%d [%s] ",__FILE__,__LINE__,__FUNCTION__, err, TET_ERROR_TO_STRING(err) ); + if (err != TAPI_API_SUCCESS ) + TET_STAMP_PASS(); + else + TET_STAMP_FAIL(); +} + +/** @} */ diff --git a/TC/telephony_TC/sim/unit/uts_tel_lock_sim_personalization.h b/TC/telephony_TC/sim/unit/uts_tel_lock_sim_personalization.h new file mode 100644 index 0000000..aa86475 --- /dev/null +++ b/TC/telephony_TC/sim/unit/uts_tel_lock_sim_personalization.h @@ -0,0 +1,75 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * 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 _UTS_TAPI_SIM_LOCK_PERSONALIZATION_H_ +#define _UTS_TAPI_SIM_LOCK_PERSONALIZATION_H_ + + static void utc_tel_enable_sim_personalization01(); + static void utc_tel_enable_sim_personalization02(); + static void utc_tel_enable_sim_personalization03(); + static void utc_tel_enable_sim_personalization04(); + static void utc_tel_disable_sim_personalization01(); + static void utc_tel_disable_sim_personalization02(); + static void utc_tel_disable_sim_personalization03(); + static void utc_tel_disable_sim_personalization04(); +typedef enum +{ + TAPI_SIM_LOCK_READY = 0x00, /**< ME Not locked - No pin verifications for any lock*/ + + TAPI_SIM_LOCK_PS, /** < PH-SIM (phone-sim) locked.Lock Phone to SIM/UICC card + * (MT asks password when other than current SIM/UICC card inserted; + * MT may remember certain amount of previously used cards thus not + * requiring password when they are inserted + */ + /* This is currently managed by launcher in using gconf - NOT useful from modem + * as of now. + */ + + TAPI_SIM_LOCK_PF, /** < PH-FSIM (phone-first-sim) Lock Phone to the very + * First inserted SIM/UICC card(MT asks password when other than the first SIM/UICC + * card is inserted + */ + /* This should managed by launcher in using gconf - NOT useful from modem + * as of now. + + */ + TAPI_SIM_LOCK_SC, /** < SIM Lock (PIN, PIN2, PUK, PUK2) Lock SIM/UICC card ( SIM asks password in ME power-up and + * when this command is issued + */ + + TAPI_SIM_LOCK_FD, /** < FDN - SIM card or active application in the UICC (GSM or USIM) + * fixed dialing memory feature */ + TAPI_SIM_LOCK_PN, /**< Network Personalization */ + TAPI_SIM_LOCK_PU, /** < network subset Personalization */ + TAPI_SIM_LOCK_PP, /** < service Provider Personalization */ + TAPI_SIM_LOCK_PC, /** < Coporate Personalization */ + TAPI_SIM_LOCK_SC2, /**< PIN2 lock*/ + TAPI_SIM_LOCK_SCPUK2 = 0x0A, /** < PIN2 Unblocking Key */ + TAPI_SIM_LOCK_ACL = 0x0B, /** < ACL lock */ + + TAPI_SIM_NO_SIM = 0x80, /**< SIM not inserted */ + TAPI_SIM_UNAVAIL = 0x81, /** < SIM interface error - SIM inserted but cannot communicate */ + TAPI_SIM_INIT_COMPLETE = 0x82, /** < SIM initialization completed */ + TAPI_SIM_PB_INIT_COMPLETE = 0x83, /**< PB init completed */ +} TelSimLockType_t; +#endif + diff --git a/TC/telephony_TC/sim/unit/uts_tel_read_sim_pb_record.c b/TC/telephony_TC/sim/unit/uts_tel_read_sim_pb_record.c new file mode 100644 index 0000000..4ae9189 --- /dev/null +++ b/TC/telephony_TC/sim/unit/uts_tel_read_sim_pb_record.c @@ -0,0 +1,428 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +/** +* @ingroup TELEPHONY_API +* @addtogroup TAPI_API_SIM_SAT SIM/SAT +*/ + +/** +* @ingroup TAPI_API_SIM_SAT +* @addtogroup UTS_SIM_SAT Unit +*/ + +/** +* @ingroup UTS_SIM_SAT +* @addtogroup UTS_TAPI_SIM_PB_READ_RECORD tel_read_sim_pb_record +* +* @brief Unit test code for tel_read_sim_pb_record() +* @par Test function Prototype: +* TapiResult_t tel_read_sim_pb_record(TelSimPbFileType_t StorageFileType, unsigned short Index, int* pRequestId); +* @par Test function description: +* This API is used to read SIM phone book entry information from given storage type +* @par Important Notes: +* The index ranges from 1 through to a maximum of 254 for a Linear fixed file and 255 for a cyclic file. +* @param [in] StorageFileType Different storage types to be selected in SIM. +* @param [in] Index Index for accessing the SIM data. +* @param [out] pRequestId Unique identifier for a particular request. +* - request_id value can be any value from 0 to 255 if the API is returned successfully +* - -1 (INVALID_REQUEST_ID) will be sent in case of failure. +* @par Async Response Message: +* The event associated is below and the event data is #TelSimPbRecordData_t. \n +* - TAPI_EVENT_SIM_PB_ACCESS_READ_CNF +* @pre +* - Phonebook supported SIM used for test +* @post +* None +* @return +* Return Type : (TapiResult_t) +* - TAPI_API_SUCCESS - indicating that the operation has completed successfully. +* - Otherwise it provides an error code (Refer #TapiResult_t) +* @{ +*/ + +/** +* @file uts_tel_read_sim_pb_record.c +* @brief Test for the tel_read_sim_pb_record() API that is used to read phonebook entry +* @author +* @version Initial Creation V0.1 +* @date 2008.07.30 +*/ + +#include +#include +#include + +#include "tet_tapi_util.h" +#include "uts_tel_read_sim_pb_record.h" +#include "sim_common.h" + +/* Initialize TCM data structures */ +static void startup(); +static void cleanup(); +void (*tet_startup) () = startup; +void (*tet_cleanup) () = cleanup; +struct tet_testlist tet_testlist[] = { + {utc_tel_read_sim_pb_record_01, 1}, + {utc_tel_read_sim_pb_record_02, 2}, + {utc_tel_read_sim_pb_record_03, 3}, + {utc_tel_read_sim_pb_record_04, 4}, + {utc_tel_read_sim_pb_record_05, 5}, + {utc_tel_read_sim_pb_record_06, 6}, + {utc_tel_read_sim_pb_record_07, 7}, + {utc_tel_read_sim_pb_record_08, 8}, + {NULL, 0} +}; + +/* + User Defined Handler +*/ +// Global variable for user data +static BOOL gAsyncResult; //user defined data : Async callback is called or not + +/* Startup & Clean function : It is not test code, only for + initialize and finalize test module +*/ +static BOOL gStartupSuccess = FALSE; +static unsigned int subscription_id = 0; + + +/* + G_MAIN Utility //////////////////////////////////////////////////////////////////////////// +*/ +// Prototype : User must add function body +gboolean g_timeout_callback (void *data); + +// GMainLoop global handler +GMainLoop *sim_loop = NULL; + +void G_MAIN_LOOP_CLOSE() +{ + g_main_loop_quit(sim_loop); +} + +int G_MAIN_LOOP_RUN(int sec) +{ + sim_loop = g_main_loop_new (NULL, FALSE); + g_timeout_add ( (sec * 1000), g_timeout_callback, NULL); + g_main_loop_run (sim_loop); + + return 0; +} + +gboolean g_timeout_callback (void *data) +{ + gAsyncResult = FALSE; + tet_printf("[SIM APP][TIME OUT] g_timeout called .Close g_main_roop()"); + G_MAIN_LOOP_CLOSE(); + return FALSE; +} +// End of G_MAIN Utility////////////////////////////////////////////////////////////////////// + + +static int sim_app_callback (TelTapiEvent_t *sim_event) +{ + tet_printf("\n**************[SIM APP]Callback data **********************\n"); + tet_printf("[SIM]Reques Id[%d]\n", sim_event->RequestId); + tet_printf("[SIM]event status [%d]\n", sim_event->Status); + + gAsyncResult = FALSE; + BOOL bReceived = FALSE; + + switch(sim_event->EventType) + { + case TAPI_EVENT_SIM_PB_ACCESS_READ_CNF: + { + tet_printf("[SIM]*****************TAPI_EVENT_SIM_PB_ACCESS_READ_CNF***************************"); + tet_printf("[SIM]SIM PB access read event status = [%x]", sim_event->Status); + + //TelSimPbRecordData_t *sim_acces_info = (TelSimPbRecordData_t*)sim_event->pData; + // tet_printf("[SIM APP]storaget type is [%x]",sim_acces_info->StorageFileType); + // tet_printf(" SIM phone book access error [%d]", sim_event->Status); + tet_printf("********************************************"); + gAsyncResult = TRUE; + bReceived = TRUE; + } + break; + + default: + { + bReceived = TRUE; + gAsyncResult = FALSE; + tet_printf("[SIM]***************** Undhandled event type [%d] *****************\n",sim_event->EventType); + tet_printf("[SIM]Undhandled event state [%d]\n",sim_event->Status); + break; + } + }//end switch + + if (bReceived == TRUE) + G_MAIN_LOOP_CLOSE(); + + return 0; +} + + +static void startup() +{ + tet_infoline("utc_tel_read_sim_pb_record Test Start"); + + if ( tel_init() == TAPI_API_SUCCESS) + { + if (TAPI_API_SUCCESS == tel_register_event(TAPI_EVENT_SIM_PB_ACCESS_READ_CNF,&subscription_id,(TelAppCallback)sim_app_callback,NULL) ) + gStartupSuccess = TRUE; + else + tet_infoline("startup fail. tel_register_event() failed"); + } else { + tet_infoline("startup fail. tel_init() failed"); + } + tel_register_app_name("org.samsung.test"); + return; +} + +static void cleanup() +{ + tet_infoline("utc_tel_read_sim_pb_record Finished"); + + if (gStartupSuccess == TRUE) + { + tel_deregister_event(subscription_id); + } + tel_deinit(); + + return; +} + + +/* + Unit Test Case functions +*/ + +/** +* @brief tel_read_sim_pb_record() API : Negative condition(Lower boundary test) +* @par ID: UTC_TEL_READ_SIM_PB_RECORD_01 +* @param [in] StorageFileType = (TelSimPbFileType_t)TAPI_SIM_PB_FDN-1 +* @param [in] Index = 1 +* @param [out] &pRequestId +* @return TAPI_API_INVALID_INPUT +*/ +void utc_tel_read_sim_pb_record_01() +{ + TET_STAMP_START("TAPI_API_INVALID_INPUT test 1"); + TelSimPbFileType_t StorageFileType = (TelSimPbFileType_t)TAPI_SIM_PB_FDN-1; + unsigned short Index=1; + int pRequestId=0; + + TET_CHECK(TAPI_API_INVALID_INPUT, tel_read_sim_pb_record(StorageFileType,Index,&pRequestId)); + TET_STAMP_PASS(); +} + +/** +* @brief tel_read_sim_pb_record() API : Negative condition(Lower boundary test) +* @par ID: UTC_TEL_READ_SIM_PB_RECORD_02 +* @param [in] StorageFileType = (TelSimPbFileType_t)TAPI_SIM_PB_UNKNOWNN+1 +* @param [in] Index = 1 +* @param [out] &pRequestId +* @return TAPI_API_INVALID_INPUT +*/ +void utc_tel_read_sim_pb_record_02() +{ + TET_STAMP_START("TAPI_API_INVALID_INPUT test 2"); + TelSimPbFileType_t StorageFileType = (TelSimPbFileType_t)TAPI_SIM_PB_UNKNOWNN+1; + unsigned short Index=1; + int pRequestId=0; + + TET_CHECK(TAPI_API_INVALID_INPUT, tel_read_sim_pb_record(StorageFileType,Index,&pRequestId)); + TET_STAMP_PASS(); +} + + +/** +* @brief tel_read_sim_pb_record() API : Negative condition(NULL parameter test) +* @par ID: UTC_TEL_READ_SIM_PB_RECORD_03 +* @param [in] StorageFileType = TAPI_SIM_PB_FDN +* @param [in] Index = 1 +* @param [out] &pRequestId = NULL +* @return TAPI_API_INVALID_INPUT +*/ +void utc_tel_read_sim_pb_record_03() +{ + TET_STAMP_START("TAPI_API_INVALID_INPUT test 3"); + TelSimPbFileType_t StorageFileType = TAPI_SIM_PB_FDN; + unsigned short Index=1; + + TET_CHECK(TAPI_API_INVALID_PTR, tel_read_sim_pb_record(StorageFileType,Index,NULL)); //<-------------------- Invalid value + TET_STAMP_PASS(); +} + +/** +* @brief tel_read_sim_pb_record() API : Positive condition(Get FDN record) +* @par ID: UTC_TEL_READ_SIM_PB_RECORD_04 +* @param [in] StorageFileType = TAPI_SIM_PB_FDN +* @param [in] Index = 1 +* @param [out] &pRequestId +* @return TAPI_API_SUCCESS +* @par Async Response Message: +* The event associated is below and the event data is #TelSimPbRecordData_t. \n +* - TAPI_EVENT_SIM_PB_ACCESS_READ_CNF +*/ +void utc_tel_read_sim_pb_record_04() +{ + TET_STAMP_START("StorageFileType=TAPI_SIM_PB_FDN"); + TET_RESULT_NOT_EQUAL(TET_UNTESTED,gStartupSuccess, TRUE); + + TelSimPbFileType_t StorageFileType=TAPI_SIM_PB_FDN; + unsigned short Index=1; + int pRequestId=0; + + gAsyncResult = FALSE; + + TET_CHECK(TAPI_API_SUCCESS, tel_read_sim_pb_record(StorageFileType,Index,&pRequestId)); + + G_MAIN_LOOP_RUN(2); + TET_RESULT_NOT_EQUAL(TET_FAIL,gAsyncResult,TRUE); // If gAsyncResult != TRUE, then TET_FAIL and return + TET_STAMP_PASS(); + return; +} + +/** +* @brief tel_read_sim_pb_record() API : Positive condition(Get LDN record) +* @par ID: UTC_TEL_READ_SIM_PB_RECORD_05 +* @param [in] StorageFileType = TAPI_SIM_PB_FDN +* @param [in] Index = 1 +* @param [out] &pRequestId +* @return TAPI_API_SUCCESS +* @par Async Response Message: +* The event associated is below and the event data is #TelSimPbRecordData_t. \n +* - TAPI_EVENT_SIM_PB_ACCESS_READ_CNF +*/ +void utc_tel_read_sim_pb_record_05() +{ + TET_STAMP_START("StorageFileType=TAPI_SIM_PB_LDN"); + TET_RESULT_NOT_EQUAL(TET_UNTESTED,gStartupSuccess, TRUE); + + TelSimPbFileType_t StorageFileType=TAPI_SIM_PB_LDN; + unsigned short Index=4; + int pRequestId=0; + + gAsyncResult = FALSE; + + TET_CHECK(TAPI_API_SUCCESS, tel_read_sim_pb_record(StorageFileType,Index,&pRequestId)); + + G_MAIN_LOOP_RUN(2); + TET_RESULT_NOT_EQUAL(TET_FAIL,gAsyncResult,TRUE); // If gAsyncResult != TRUE, then TET_FAIL and return + TET_STAMP_PASS(); + return; +} + + +/** +* @brief tel_read_sim_pb_record() API : Positive condition(Get MSISDN record) +* @par ID: UTC_TEL_READ_SIM_PB_RECORD_06 +* @param [in] StorageFileType = TAPI_SIM_PB_MSISDN +* @param [in] Index = 1 +* @param [out] &pRequestId +* @return TAPI_API_SUCCESS +* @par Async Response Message: +* The event associated is below and the event data is #TelSimPbRecordData_t. \n +* - TAPI_EVENT_SIM_PB_ACCESS_READ_CNF +*/ +void utc_tel_read_sim_pb_record_06() +{ + TET_STAMP_START("StorageFileType=TAPI_SIM_PB_MSISDN"); + TET_RESULT_NOT_EQUAL(TET_UNTESTED,gStartupSuccess, TRUE); + + TelSimPbFileType_t StorageFileType=TAPI_SIM_PB_MSISDN; + unsigned short Index=1; + int pRequestId=0; + + gAsyncResult = FALSE; + + TET_CHECK(TAPI_API_SUCCESS, tel_read_sim_pb_record(StorageFileType,Index,&pRequestId)); + + G_MAIN_LOOP_RUN(2); + TET_RESULT_NOT_EQUAL(TET_FAIL,gAsyncResult,TRUE); // If gAsyncResult != TRUE, then TET_FAIL and return + TET_STAMP_PASS(); + return; +} + + +/** +* @brief tel_read_sim_pb_record() API : Positive condition(Get ADN record) +* @par ID: UTC_TEL_READ_SIM_PB_RECORD_07 +* @param [in] StorageFileType = TAPI_SIM_PB_ADN +* @param [in] Index = 1 +* @param [out] &pRequestId +* @return TAPI_API_SUCCESS +* @par Async Response Message: +* The event associated is below and the event data is #TelSimPbRecordData_t. \n +* - TAPI_EVENT_SIM_PB_ACCESS_READ_CNF +*/ +void utc_tel_read_sim_pb_record_07() +{ + TET_STAMP_START("StorageFileType=TAPI_SIM_PB_ADN"); + TET_RESULT_NOT_EQUAL(TET_UNTESTED,gStartupSuccess, TRUE); + + TelSimPbFileType_t StorageFileType=TAPI_SIM_PB_ADN; + unsigned short Index=1; + int pRequestId=0; + + gAsyncResult = FALSE; + + TET_CHECK(TAPI_API_SUCCESS, tel_read_sim_pb_record(StorageFileType,Index,&pRequestId)); + + G_MAIN_LOOP_RUN(2); + TET_RESULT_NOT_EQUAL(TET_FAIL,gAsyncResult,TRUE); // If gAsyncResult != TRUE, then TET_FAIL and return + TET_STAMP_PASS(); + return; +} + + +/** +* @brief tel_read_sim_pb_record() API : Positive condition(Get SDN record) +* @par ID: UTC_TEL_READ_SIM_PB_RECORD_08 +* @param [in] StorageFileType = TAPI_SIM_PB_SDN +* @param [in] Index = 1 +* @param [out] &pRequestId +* @return TAPI_API_SUCCESS +* @par Async Response Message: +* The event associated is below and the event data is #TelSimPbRecordData_t. \n +* - TAPI_EVENT_SIM_PB_ACCESS_READ_CNF +*/ +void utc_tel_read_sim_pb_record_08() +{ + TET_STAMP_START("StorageFileType=TAPI_SIM_PB_SDN"); + TET_RESULT_NOT_EQUAL(TET_UNTESTED,gStartupSuccess, TRUE); + + TelSimPbFileType_t StorageFileType=TAPI_SIM_PB_SDN; + unsigned short Index=1; + int pRequestId=0; + + gAsyncResult = FALSE; + + TET_CHECK(TAPI_API_SUCCESS, tel_read_sim_pb_record(StorageFileType,Index,&pRequestId)); + + G_MAIN_LOOP_RUN(5); + TET_RESULT_NOT_EQUAL(TET_FAIL,gAsyncResult,TRUE); // If gAsyncResult != TRUE, then TET_FAIL and return + TET_STAMP_PASS(); + return; +} + +/** @} */ diff --git a/TC/telephony_TC/sim/unit/uts_tel_read_sim_pb_record.h b/TC/telephony_TC/sim/unit/uts_tel_read_sim_pb_record.h new file mode 100644 index 0000000..16ff84f --- /dev/null +++ b/TC/telephony_TC/sim/unit/uts_tel_read_sim_pb_record.h @@ -0,0 +1,34 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * 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 _UTS_TEL_READ_SIM_PB_RECORD_H_ +#define _UTS_TEL_READ_SIM_PB_RECORD_H_ + + static void utc_tel_read_sim_pb_record_01 (); + static void utc_tel_read_sim_pb_record_02 (); + static void utc_tel_read_sim_pb_record_03 (); + static void utc_tel_read_sim_pb_record_04 (); + static void utc_tel_read_sim_pb_record_05 (); + static void utc_tel_read_sim_pb_record_06 (); + static void utc_tel_read_sim_pb_record_07 (); + static void utc_tel_read_sim_pb_record_08 (); +#endif + diff --git a/TC/telephony_TC/sim/unit/uts_tel_req_sap_cardreader_status.c b/TC/telephony_TC/sim/unit/uts_tel_req_sap_cardreader_status.c new file mode 100644 index 0000000..5ac45c8 --- /dev/null +++ b/TC/telephony_TC/sim/unit/uts_tel_req_sap_cardreader_status.c @@ -0,0 +1,338 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +/** +* @ingroup TELEPHONY_API +* @addtogroup TAPI_API_SIM_SAT SIM/SAT +*/ + +/** +* @ingroup TAPI_API_SIM_SAT +* @addtogroup UTS_SIM_SAT Unit +*/ + +/** +* @ingroup UTS_SIM_SAT +* @addtogroup UTS_TAPI_SIM_SAP_CARD_READER_STATUS tel_req_sap_cardreader_status +* +* @brief Unit test code for tel_req_sap_cardreader_status() +* @par Test function Prototype: +* TapiResult_t tel_req_sap_cardreader_status( int* pRequestId); +* @par Test function description: +* This API is used to get the card reader status. +* @par Important Notes: +* None +* @param [out] pRequestId Unique identifier for a particular request. +* - request_id value can be any value from 0 to 255 if the API is returned successfully +* - -1 (INVALID_REQUEST_ID) will be sent in case of failure. +* @par Async Response Message: +* The event associated is below and the event data is #TelSimCardReaderStatus_t. \n +* - TAPI_EVENT_SIM_SAP_CARD_READER_STATUS_CNF +* @pre +* SAP supported sim used to testing +* @post +* None +* @return +* Return Type : (TapiResult_t) +* - TAPI_API_SUCCESS - indicating that the operation has completed successfully. +* - Otherwise it provides an error code (Refer #TapiResult_t) +* @{ +*/ + +/** +* @file uts_tel_req_sap_cardreader_status.c +* @brief Test for the tel_req_sap_cardreader_status() API that is used to get SAP card reader status +* @author +* @version Initial Creation V0.1 +* @date 2008.07.30 +*/ + +#include +#include +#include + +#include "tet_tapi_util.h" +#include "uts_tel_req_sap_cardreader_status.h" +#include "sim_common.h" + + +/* Initialize TCM data structures */ +static void startup(); +static void cleanup(); +void (*tet_startup) () = startup; +void (*tet_cleanup) () = cleanup; +struct tet_testlist tet_testlist[] = { + {utc_tel_req_sap_cardreader_status_01, 1}, + {utc_tel_req_sap_cardreader_status_02, 2}, + {NULL, 0} +}; + + +/* + G_MAIN Utility //////////////////////////////////////////////////////////////////////////// +*/ +// Prototype : User must add function body +gboolean g_timeout_callback (void *data); + +// GMainLoop global handler +GMainLoop *nw_context_loop = NULL; + +void G_MAIN_LOOP_CLOSE() +{ + g_main_loop_quit(nw_context_loop); +} + +int G_MAIN_LOOP_RUN(int sec) +{ + //GMainLoop *mainloop; + nw_context_loop = g_main_loop_new (NULL, FALSE); + g_timeout_add ( (sec * 1000), g_timeout_callback, NULL); + g_main_loop_run (nw_context_loop); + + return 0; +} +// End of G_MAIN Utility////////////////////////////////////////////////////////////////////// + + +/* + User Defined Handler +*/ +// Global variable for user data +static BOOL gAsyncResult; //user defined data : Async callback is called or not + +// G_MAIN Utility : time out callback function +gboolean g_timeout_callback (void *data) +{ + gAsyncResult = FALSE; + tet_printf("[SIM APP][TIME OUT] g_timeout called .Close g_main_roop()"); + G_MAIN_LOOP_CLOSE(); + return FALSE; +} + + +static int sim_sap_process_for_condition(int wish_condition) +{ + TelSimSapConnect_t pConnectionReq; + int pRequestId=0; + int tapiRet = TAPI_API_SUCCESS; + + tet_printf("sap wish condition[%d]:0-disconnect, 1-connect",wish_condition); + + if(wish_condition == 1) + { + pConnectionReq.MsgId = TAPI_SIM_SAP_CONNECT_REQ; + } + else + { + pConnectionReq.MsgId = TAPI_SIM_SAP_DISCONNECT_REQ; + } + + pConnectionReq.MaxMsgSize = 10; //temp for testing only - not clear + + gAsyncResult = FALSE; + + tapiRet = tel_req_sap_connection(&pConnectionReq,&pRequestId); + TET_RESULT_NOT_EQUAL(TET_FAIL,TAPI_API_SUCCESS,tapiRet); + + G_MAIN_LOOP_RUN(2); + + if(gAsyncResult == TRUE) + return 0; + else + return -1; + +} + + +static int sim_app_callback (TelTapiEvent_t *sim_event) +{ + tet_printf("\n\n\n***************[SIM APP]Callback data **********************\n"); + tet_printf("[SIM APP]Reques Id[%d]\n", sim_event->RequestId); + tet_printf("[SIM APP]event status [%d]\n", sim_event->Status); + + gAsyncResult = FALSE; + BOOL bReceived = FALSE; + + switch(sim_event->EventType) + { + case TAPI_EVENT_SIM_SAP_CONNECT_NOTI: + { + tet_printf("\n[SIM APP]*****************TAPI_EVENT_SIM_SAP_CONNECT_NOTI***************************\n"); + gAsyncResult = TRUE; + bReceived = TRUE; + } + break; + + + case TAPI_EVENT_SIM_SAP_CONNECT_CNF: + { + tet_printf("\n[SIM APP]*****************TAPI_EVENT_SIM_SAP_CONNECT_CNF***************************\n"); + gAsyncResult = TRUE; + bReceived = TRUE; + } + break; + + case TAPI_EVENT_SIM_SAP_CARD_READER_STATUS_CNF: + { + tet_printf("\n[SIM APP]*****************TAPI_EVENT_SIM_SAP_CARD_READER_STATUS_CNF***************************\n"); + TelSimCardReaderStatus_t *sap_card_reader_status = (TelSimCardReaderStatus_t*)sim_event->pData; + + tet_printf(" [SIM APP]card reader result [%x]\n ", sap_card_reader_status->CardReaderResult); + tet_printf(" [SIM APP]card reader status bitwise encoded data [%d]\n", sap_card_reader_status->CardReaderStatus); + + gAsyncResult = TRUE; + bReceived = TRUE; + } + break; + + default: + { + bReceived = TRUE; + gAsyncResult = FALSE; + //tet_printf("Info : TAPI_EVENT_SIM_READ_FILE_CNF = %d", TAPI_EVENT_SIM_READ_FILE_CNF); + tet_printf("[SIM APP]***************** Undhandled event type [%d] *****************\n",sim_event->EventType); + tet_printf("[SIM APP]Undhandled event state [%d]\n",sim_event->Status); + break; + } + }//end switch + + if (bReceived == TRUE) + G_MAIN_LOOP_CLOSE(); + + return 0; +} + + +/* Startup & Clean function : It is not test code, only for + initialize and finalize test module +*/ +static BOOL gStartupSuccess = FALSE; +static unsigned int subscription_id = 0; +static void startup() +{ + tet_infoline("utc_tel_req_sap_cardreader_status Test Start\n"); + + if ( tel_init() == TAPI_API_SUCCESS) + { + tel_register_event(TAPI_EVENT_SIM_SAP_CONNECT_CNF,&subscription_id,(TelAppCallback)sim_app_callback,NULL); + tel_register_event(TAPI_EVENT_SIM_SAP_CARD_READER_STATUS_CNF,&subscription_id,(TelAppCallback)sim_app_callback,NULL); + + gStartupSuccess = TRUE; + } else { + tet_infoline("startup fail. tel_init() failed"); + } + tel_register_app_name("org.samsung.test"); + return; +} + + +static void cleanup() +{ + tet_infoline("utc_tel_req_sap_cardreader_status Test Finished\n"); + if (gStartupSuccess == TRUE) + { + tel_deregister_event(subscription_id); + } + tel_deinit(); + + return; +} + + +/* + Unit Test Case functions +*/ + +/** +* @brief tel_req_sap_cardreader_status() API : Normal condition(Request card reader status) +* @par ID: UTC_TEL_REQ_SAP_CARDREADER_STATUS_01 +* @param [out] &pRequestId +* @return TAPI_API_SUCCESS +* @par Async Response Message: +* The event associated is below and the event data is #TelSimCardReaderStatus_t. \n +* - TAPI_EVENT_SIM_SAP_CARD_READER_STATUS_CNF +*/ +void utc_tel_req_sap_cardreader_status_01() +{ + tet_infoline("TRANSFER SAP READER STATUS\n"); + TET_RESULT_NOT_EQUAL(TET_UNTESTED,gStartupSuccess, TRUE); + + int pRequestId=0; + int tapiRet = TAPI_API_SUCCESS; +#if 0 // we assume sap connect on. + + // Step 1 : make proper condition + tet_printf("Step 1 : sap connect"); + + if( 0 != sim_sap_process_for_condition(1)) + { + tet_printf("condition set is failed!!"); + return; + } +#endif + gAsyncResult = FALSE; + + tapiRet = tel_req_sap_cardreader_status(&pRequestId); + TET_RESULT_NOT_EQUAL(TET_FAIL,TAPI_API_SUCCESS,tapiRet); + + tet_printf("after real tc api - wait start"); + + G_MAIN_LOOP_RUN(3); + + tet_printf("after real tc api - wait stop"); + + TET_RESULT_NOT_EQUAL_GOTO(TET_FAIL,exit,gAsyncResult,TRUE); + TET_RESULT_EQUAL_GOTO(TET_PASS,exit,gAsyncResult,TRUE); + +exit: + // Step 3 : make default condition +#if 0 // we assume sap connect on. + + tet_printf("Step 3 : disconnect sap"); + + if( 0 != sim_sap_process_for_condition(0)) + { + tet_printf("condition set is failed!!"); + } +#endif + return; +} + + +/** +* @brief tel_req_sap_cardreader_status() API : Negative condition(NULL Parameter test) +* @par ID: UTC_TEL_REQ_SAP_CARDREADER_STATUS_02 +* @param [out] &pRequestId = NULL +* @return TAPI_API_INVALID_PTR +*/ +void utc_tel_req_sap_cardreader_status_02() +{ + TET_STAMP_START("TRANSFER SAP READER STATUS WITH INVALID SIM SESSION\n"); + TapiResult_t error = tel_req_sap_cardreader_status(NULL); + TET_CHECK(TAPI_API_INVALID_PTR,error); + TET_STAMP_PASS(); + + tel_reset_modem(); + + return; +} + +/** @} */ diff --git a/TC/telephony_TC/sim/unit/uts_tel_req_sap_cardreader_status.h b/TC/telephony_TC/sim/unit/uts_tel_req_sap_cardreader_status.h new file mode 100644 index 0000000..c48f059 --- /dev/null +++ b/TC/telephony_TC/sim/unit/uts_tel_req_sap_cardreader_status.h @@ -0,0 +1,28 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * 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 _UTS_TEL_REQ_SAP_CARDREADER_STATUS_H +#define _UTS_TEL_REQ_SAP_CARDREADER_STATUS_H + + static void utc_tel_req_sap_cardreader_status_01(); + static void utc_tel_req_sap_cardreader_status_02(); + +#endif diff --git a/TC/telephony_TC/sim/unit/uts_tel_req_sap_connection.c b/TC/telephony_TC/sim/unit/uts_tel_req_sap_connection.c new file mode 100644 index 0000000..0686d32 --- /dev/null +++ b/TC/telephony_TC/sim/unit/uts_tel_req_sap_connection.c @@ -0,0 +1,309 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +/** +* @ingroup TELEPHONY_API +* @addtogroup TAPI_API_SIM_SAT SIM/SAT +*/ + +/** +* @ingroup TAPI_API_SIM_SAT +* @addtogroup UTS_SIM_SAT Unit +*/ + +/** +* @ingroup UTS_SIM_SAT +* @addtogroup UTS_TAPI_SIM_SAP_CONNECT_REQUEST tel_req_sap_connection +* +* @brief Unit test code for tel_req_sap_connection() +* @par Test function Prototype: +* TapiResult_t tel_req_sap_connection( TelSimSapConnect_t *pConnectionReq, int* pRequestId); +* @par Test function description: +* This API is used to request for an external SAP connection +* @par Important Notes: +* None +* @param [in] pConnectionReq This enum gives the SAP ATR response data information +* @code + typedef struct + { + TelSimSapMsgId_t MsgId; // connect or disconnect request /response + TelSimSapConnectionStatus_t ConnectionStatus; // used only in response from tapi + unsigned short MaxMsgSize; // request from app or set by lower layer + }TelSimSapConnect_t; + + // This enum gives the SAP message Ids between SAP client and SAP server. + typedef enum + { + TAPI_SIM_SAP_CONNECT_REQ = 0x00, + TAPI_SIM_SAP_CONNECT_RESP = 0x01, + TAPI_SIM_SAP_DISCONNECT_REQ = 0x02, + TAPI_SIM_SAP_DISCONNECT_RESP = 0x03, + TAPI_SIM_SAP_DISCONNECT_IND = 0x04, + TAPI_SIM_SAP_TRANSFER_APDU_REQ = 0x05, + TAPI_SIM_SAP_TRANSFER_APDU_RESP = 0x06, + TAPI_SIM_SAP_TRANSFER_ATR_REQ = 0x07, + TAPI_SIM_SAP_TRANSFER_ATR_RESP = 0x08, + TAPI_SIM_SAP_POWER_SIM_OFF_REQ = 0x09, + TAPI_SIM_SAP_POWER_SIM_OFF_RESP = 0x0A, + TAPI_SIM_SAP_POWER_SIM_ON_REQ = 0x0B, + TAPI_SIM_SAP_POWER_SIM_ON_RESP = 0x0C, + TAPI_SIM_SAP_RESET_SIM_REQ = 0x0D, + TAPI_SIM_SAP_RESET_SIM_RESP = 0x0E, + TAPI_SIM_SAP_TRANSFER_CARD_READER_STATUS_REQ = 0x0F, + TAPI_SIM_SAP_TRANSFER_CARD_READER_STATUS_RESP = 0x10, + TAPI_SIM_SAP_STATUS_IND = 0x11, + TAPI_SIM_SAP_ERROR_RESP = 0x12, + TAPI_SIM_SAP_SET_TRANSPORT_PROTOCOL_REQ = 0x13, + TAPI_SIM_SAP_SET_TRANSPORT_PROTOCOL_RESP = 0x14 + }TelSimSapMsgId_t + + // This enum gives the SAP connection status information. This is used for Async Response Message + typedef enum + { + TAPI_SIM_SAP_CONNECTION_STATUS_OK = 0x00, + TAPI_SIM_SAP_CONNECTION_STATUS_UNABLE_TO_ESTABLISH , + TAPI_SIM_SAP_CONNECTION_STATUS_NOT_SUPPORT_MAX_SIZE, + TAPI_SIM_SAP_CONNECTION_STATUS_TOO_SMALL_MAX_SIZE + }TelSimSapConnectionStatus_t; +* @endcode +* @param [out] pRequestId Unique identifier for a particular request. +* - request_id value can be any value from 0 to 255 if the API is returned successfully +* - -1 (INVALID_REQUEST_ID) will be sent in case of failure. +* @par Async Response Message: +* The event associated is below and the event data is #TelSimSapConnect_t. +* - TAPI_EVENT_SIM_SAP_CONNECT_CNF +* @pre +* SAP supported sim used to testing +* @post +* None +* @return +* Return Type : (TapiResult_t) +* - TAPI_API_SUCCESS - indicating that the operation has completed successfully. +* - Otherwise it provides an error code (Refer #TapiResult_t) +* @{ +*/ + +/** +* @file uts_tel_req_sap_connection.c +* @brief Test for the tel_req_sap_connection() API that is used to sap connect request +* @author +* @version Initial Creation V0.1 +* @date 2008.07.30 +*/ + +#include +#include +#include + +#include "tet_tapi_util.h" +#include "uts_tel_req_sap_connection.h" +#include "sim_common.h" + +/* Initialize TCM data structures */ +static void startup(); +static void cleanup(); +void (*tet_startup) () = startup; +void (*tet_cleanup) () = cleanup; +struct tet_testlist tet_testlist[] = { + {utc_tel_req_sap_connection_01, 1}, + {utc_tel_req_sap_connection_02, 2}, + {NULL, 0} +}; + + +/* + G_MAIN Utility //////////////////////////////////////////////////////////////////////////// +*/ +// Prototype : User must add function body +gboolean g_timeout_callback (void *data); + +// GMainLoop global handler +GMainLoop *nw_context_loop = NULL; + +void G_MAIN_LOOP_CLOSE() +{ + g_main_loop_quit(nw_context_loop); +} + +int G_MAIN_LOOP_RUN(int sec) +{ + //GMainLoop *mainloop; + nw_context_loop = g_main_loop_new (NULL, FALSE); + g_timeout_add ( (sec * 1000), g_timeout_callback, NULL); + g_main_loop_run (nw_context_loop); + + return 0; +} +// End of G_MAIN Utility////////////////////////////////////////////////////////////////////// + + +/* + User Defined Handler +*/ +// Global variable for user data +static BOOL gAsyncResult; //user defined data : Async callback is called or not + +// G_MAIN Utility : time out callback function +gboolean g_timeout_callback (void *data) +{ + gAsyncResult = FALSE; + tet_printf("[SIM APP][TIME OUT] g_timeout called .Close g_main_roop()"); + G_MAIN_LOOP_CLOSE(); + return FALSE; +} + +static int sim_app_callback (TelTapiEvent_t *sim_event) +{ + tet_printf("\n\n\n***************[SIM APP]Callback data **********************\n"); + tet_printf("[SIM APP]Reques Id[%d]\n", sim_event->RequestId); + tet_printf("[SIM APP]event status [%d]\n", sim_event->Status); + + gAsyncResult = FALSE; + BOOL bReceived = FALSE; + + switch(sim_event->EventType) + { + case TAPI_EVENT_SIM_SAP_CONNECT_CNF: + { + tet_printf("\n[GOT THE EVENT]*******TAPI_EVENT_SIM_SAP_CONNECT_CNF:******\n"); + TelSimSapConnect_t *sap_conn_resp = (TelSimSapConnect_t*)sim_event->pData; + + tet_printf("[SIM APP]SIM SAP connect request event status = [%x]\n", sim_event->Status); +// tet_printf("[SIM APP] message id [%x]\n", sap_conn_resp->MsgId); +// tet_printf("[SIM APP]connection status [%x]\n ", sap_conn_resp->ConnectionStatus); +// tet_printf("[SIM APP]max message size [%d]\n", sap_conn_resp->MaxMsgSize); + + bReceived = TRUE; + gAsyncResult = TRUE; + } + break; + + case TAPI_EVENT_SIM_SAP_CONNECT_STATUS_CNF: + { + tet_printf("\n[GOT THE EVENT]*******TAPI_EVENT_SIM_SAP_CONNECT_STAT_CNF:******\n"); + tet_printf("[SIM APP]SIM SAP connect event status = [%x]\n", sim_event->Status); + + TelSimSapStatusInfo_t *sap_conn_status = (TelSimSapStatusInfo_t*)sim_event->pData; + tet_printf("[SIM APP] connection status info [%x]\n", *sap_conn_status); + bReceived = TRUE; + gAsyncResult = FALSE; + } + break; + + default: + { + bReceived = TRUE; + gAsyncResult = FALSE; + tet_printf("Info : TAPI_EVENT_SIM_SAP_CONNECT_CNF = %d", TAPI_EVENT_SIM_SAP_CONNECT_CNF); + tet_printf("[SIM APP]***************** Undhandled event type [%d] *****************\n",sim_event->EventType); + tet_printf("[SIM APP]Undhandled event state [%d]\n",sim_event->Status); + } + break; + }//end switch + + if (bReceived == TRUE) + G_MAIN_LOOP_CLOSE(); + + return 0; +} + + + +/* Startup & Clean function : It is not test code, only for + initialize and finalize test module +*/ +static BOOL gStartupSuccess = FALSE; +static unsigned int subscription_id = 0; + +static void startup() +{ + tet_infoline("utc_tel_req_sap_connection Test Start\n"); + + if ( tel_init() == TAPI_API_SUCCESS) + { + if (TAPI_API_SUCCESS == tel_register_event(TAPI_EVENT_SIM_SAP_CONNECT_CNF,&subscription_id,(TelAppCallback)sim_app_callback,NULL) ) + gStartupSuccess = TRUE; + else + tet_infoline("startup fail. tel_register_event() failed"); + } else { + tet_infoline("startup fail. tel_init() failed"); + } + tel_register_app_name("org.samsung.test"); + return; +} + + +static void cleanup() +{ + tet_infoline("utc_tel_req_sap_connection Test Finished\n"); + + if (gStartupSuccess == TRUE) + { + tel_deregister_event(subscription_id); + } + tel_deinit(); + + return; +} + +/* + Unit Test Case functions +*/ + +/** +* @brief tel_req_sap_connection() API : Negative condition(Second Parameter is Null) +* @par ID: UTC_TEL_REQ_SAP_CONNECTION_01 +* @param [in] &pConnectionReq +* @param [out]&sim_data = NULL +* @return TAPI_API_INVALID_PTR +*/ +void utc_tel_req_sap_connection_01() +{ + TET_STAMP_START("TAPI_API_INVALID_PTR 1"); + + TelSimSapConnect_t pConnectionReq; + pConnectionReq.MsgId = TAPI_SIM_SAP_CONNECT_REQ; + pConnectionReq.MaxMsgSize = 10; //temp for testing only - not clear + + TET_CHECK(TAPI_API_INVALID_PTR,tel_req_sap_connection(&pConnectionReq,NULL)); + TET_STAMP_PASS(); + return; +} + + +/** +* @brief tel_req_sap_connection() API : Negative condition(First Parameter is Null) +* @par ID: UTC_TEL_REQ_SAP_CONNECTION_02 +* @param [in] &pConnectionReq = NULL +* @param [out]&sim_data +* @return TAPI_API_INVALID_PTR +*/ +void utc_tel_req_sap_connection_02() +{ + TET_STAMP_START("TAPI_API_INVALID_PTR 2"); + + int pRequestId=0; + TET_CHECK(TAPI_API_INVALID_PTR,tel_req_sap_connection(NULL,&pRequestId)); + TET_STAMP_PASS(); + return; +} + +/** @} */ diff --git a/TC/telephony_TC/sim/unit/uts_tel_req_sap_connection.h b/TC/telephony_TC/sim/unit/uts_tel_req_sap_connection.h new file mode 100644 index 0000000..2f551f4 --- /dev/null +++ b/TC/telephony_TC/sim/unit/uts_tel_req_sap_connection.h @@ -0,0 +1,30 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * 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 _uts_tel_req_sap_connection_H +#define _uts_tel_req_sap_connection_H + + + static void utc_tel_req_sap_connection_01(); + static void utc_tel_req_sap_connection_02(); + +#endif + diff --git a/TC/telephony_TC/sim/unit/uts_tel_req_sap_connection_status.c b/TC/telephony_TC/sim/unit/uts_tel_req_sap_connection_status.c new file mode 100644 index 0000000..3fee414 --- /dev/null +++ b/TC/telephony_TC/sim/unit/uts_tel_req_sap_connection_status.c @@ -0,0 +1,275 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +/** +* @ingroup TELEPHONY_API +* @addtogroup TAPI_API_SIM_SAT SIM/SAT +*/ + +/** +* @ingroup TAPI_API_SIM_SAT +* @addtogroup UTS_SIM_SAT Unit +*/ + +/** +* @ingroup UTS_SIM_SAT +* @addtogroup UTS_TAPI_SIM_CONNECT_STATUS_REQ tel_req_sap_connection_status +* +* @brief Unit test code for tel_req_sap_connection_status() +* @par Test function Prototype: +* TapiResult_t tel_req_sap_connection_status(int* pRequestId); +* @par Test function description: +* This API is used to request for the status of the requested SAP connection. +* @par Important Notes: +* None +* @param [out] pRequestId Unique identifier for a particular request. +* - request_id value can be any value from 0 to 255 if the API is returned successfully +* - -1 (INVALID_REQUEST_ID) will be sent in case of failure. +* @par Async Response Message: +* The event associated is below and the event data is #TelSimSapStatusInfo_t. \n +* - TAPI_EVENT_SIM_SAP_CONNECT_STATUS_CNF +* @pre +* - SAP supported sim used to testing +* - tel_req_sap_connection() function called +* @post +* None +* @return +* Return Type : (TapiResult_t) +* - TAPI_API_SUCCESS - indicating that the operation has completed successfully. +* - Otherwise it provides an error code (Refer #TapiResult_t) +* @{ +*/ + +/** +* @file uts_tel_req_sap_connection_status.c +* @brief Test for the tel_req_sap_connection_status() API that is used to get phonebook entry info +* @author +* @version Initial Creation V0.1 +* @date 2008.07.30 +*/ + + +#include +#include +#include + +#include "tet_tapi_util.h" +#include "uts_tel_req_sap_connection_status.h" +#include "sim_common.h" + + +/* Initialize TCM data structures */ +static void startup(); +static void cleanup(); +void (*tet_startup) () = startup; +void (*tet_cleanup) () = cleanup; +struct tet_testlist tet_testlist[] = { + {utc_tel_req_sap_connection_status_01, 1}, + {utc_tel_req_sap_connection_status_02, 2}, + {NULL, 0} +}; + + +/* + G_MAIN Utility //////////////////////////////////////////////////////////////////////////// +*/ +// Prototype : User must add function body +gboolean g_timeout_callback (void *data); + +// GMainLoop global handler +GMainLoop *nw_context_loop = NULL; + +void G_MAIN_LOOP_CLOSE() +{ + g_main_loop_quit(nw_context_loop); +} + +int G_MAIN_LOOP_RUN(int sec) +{ + //GMainLoop *mainloop; + nw_context_loop = g_main_loop_new (NULL, FALSE); + g_timeout_add ( (sec * 1000), g_timeout_callback, NULL); + g_main_loop_run (nw_context_loop); + + return 0; +} +// End of G_MAIN Utility////////////////////////////////////////////////////////////////////// + + +/* + User Defined Handler +*/ +// Global variable for user data +static BOOL gAsyncResult; //user defined data : Async callback is called or not + +// G_MAIN Utility : time out callback function +gboolean g_timeout_callback (void *data) +{ + gAsyncResult = FALSE; + tet_printf("[SIM APP][TIME OUT] g_timeout called .Close g_main_roop()"); + G_MAIN_LOOP_CLOSE(); + return FALSE; +} + + +static int sim_app_callback (TelTapiEvent_t *sim_event) +{ + tet_printf("\n\n\n***************[SIM APP]Callback data **********************\n"); + tet_printf("[SIM APP]Reques Id[%d]\n", sim_event->RequestId); + tet_printf("[SIM APP]event status [%d]\n", sim_event->Status); + + gAsyncResult = FALSE; + BOOL bReceived = FALSE; + + switch(sim_event->EventType) + { + case TAPI_EVENT_SIM_SAP_CONNECT_CNF: + { + tet_printf("\n[GOT THE EVENT]*******TAPI_EVENT_SIM_SAP_CONNECT_CNF:******\n"); + TelSimSapConnect_t *sap_conn_resp = (TelSimSapConnect_t*)sim_event->pData; + + tet_printf("[SIM APP]SIM SAP connect request event status = [%x]\n", sim_event->Status); + tet_printf("[SIM APP] message id [%x]\n", sap_conn_resp->MsgId); + tet_printf("[SIM APP]connection status [%x]\n ", sap_conn_resp->ConnectionStatus); + tet_printf("[SIM APP]max message size [%d]\n", sap_conn_resp->MaxMsgSize); + + bReceived = TRUE; + if (sap_conn_resp->ConnectionStatus==0) + gAsyncResult = TRUE; + else + gAsyncResult = FALSE; + } + break; + + case TAPI_EVENT_SIM_SAP_CONNECT_STATUS_CNF: + { + tet_printf("\n[GOT THE EVENT]*******TAPI_EVENT_SIM_SAP_CONNECT_STAT_CNF:******\n"); + tet_printf("[SIM APP]SIM SAP connect event status = [%x]\n", sim_event->Status); + + TelSimSapStatusInfo_t *sap_conn_status = (TelSimSapStatusInfo_t*)sim_event->pData; + tet_printf("[SIM APP] connection status info [%x]\n", *sap_conn_status); + bReceived = TRUE; + gAsyncResult = TRUE; + } + break; + + default: + { + bReceived = TRUE; + gAsyncResult = FALSE; + tet_printf("Info : TAPI_EVENT_SIM_SAP_CONNECT_CNF = %d", TAPI_EVENT_SIM_SAP_CONNECT_CNF); + tet_printf("[SIM APP]***************** Undhandled event type [%d] *****************\n",sim_event->EventType); + tet_printf("[SIM APP]Undhandled event state [%d]\n",sim_event->Status); + } + break; + }//end switch + + if (bReceived == TRUE) + G_MAIN_LOOP_CLOSE(); + + return 0; +} + + + + +/* Startup & Clean function : It is not test code, only for + initialize and finalize test module +*/ +static BOOL gStartupSuccess = FALSE; +static unsigned int subscription_id = 0; + +static void startup() +{ + tet_infoline("utc_tel_req_sap_connection_status Test Start\n"); + + if ( tel_init() == TAPI_API_SUCCESS) + { + if (TAPI_API_SUCCESS == tel_register_event(TAPI_EVENT_SIM_SAP_CONNECT_STATUS_CNF,&subscription_id,(TelAppCallback)sim_app_callback,NULL) ) + gStartupSuccess = TRUE; + else + tet_infoline("startup fail. tel_register_event() failed"); + } else { + tet_infoline("startup fail. tel_init() failed"); + } + tel_register_app_name("org.samsung.test"); + return; +} + + +static void cleanup() +{ + tet_infoline("utc_tel_req_sap_connection_status Test Finished\n"); + + if (gStartupSuccess == TRUE) + { + tel_deregister_event(subscription_id); + } + tel_deinit(); + + return; +} + + +/* + Unit Test Case functions +*/ + +/** +* @brief tel_req_sap_connection_status() API : Positive condition +* @par ID: UTC_TEL_REQ_SAP_CONNECTIOn_STATUS_01 +* @param [out] &pRequestId +* @return TAPI_API_SUCCESS and async result +*/ +void utc_tel_req_sap_connection_status_01() +{ + TET_STAMP_START("TAPI_API_INVALID_PTR 1"); + int requestId =0; + int tapiRet = TAPI_API_SUCCESS; + gAsyncResult = FALSE; + tapiRet = tel_req_sap_connection_status(&requestId); + TET_RESULT_NOT_EQUAL(TET_FAIL,TAPI_API_SUCCESS,tapiRet); + + tet_printf("after real tc api - wait start"); + + G_MAIN_LOOP_RUN(3); + + tet_printf("after real tc api - wait stop"); + + + TET_RESULT_NOT_EQUAL(TET_FAIL,gAsyncResult,TRUE); // If gAsyncResult != FALSE, then TET_FAIL and return + TET_STAMP_PASS(); +} + +/** +* @brief tel_req_sap_connection_status() API : Negative condition(NULL Parameter test) +* @par ID: UTC_TEL_REQ_SAP_CONNECTIOn_STATUS_02 +* @param [out] &pRequestId = NULL +* @return TAPI_API_INVALID_PTR +*/ +void utc_tel_req_sap_connection_status_02() +{ + TET_STAMP_START("TAPI_API_INVALID_PTR"); + TET_CHECK(TAPI_API_INVALID_PTR, tel_req_sap_connection_status(NULL)); + TET_STAMP_PASS(); +} + +/** @} */ diff --git a/TC/telephony_TC/sim/unit/uts_tel_req_sap_connection_status.h b/TC/telephony_TC/sim/unit/uts_tel_req_sap_connection_status.h new file mode 100644 index 0000000..eb27814 --- /dev/null +++ b/TC/telephony_TC/sim/unit/uts_tel_req_sap_connection_status.h @@ -0,0 +1,27 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * 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 _UTS_TEL_REQ_SAP_CONNECTIOn_STATUS_H +#define _UTS_TEL_REQ_SAP_CONNECTIOn_STATUS_H + static void utc_tel_req_sap_connection_status_01(); + static void utc_tel_req_sap_connection_status_02(); + +#endif diff --git a/TC/telephony_TC/sim/unit/uts_tel_req_sap_power_operation.c b/TC/telephony_TC/sim/unit/uts_tel_req_sap_power_operation.c new file mode 100644 index 0000000..a563324 --- /dev/null +++ b/TC/telephony_TC/sim/unit/uts_tel_req_sap_power_operation.c @@ -0,0 +1,405 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +/** +* @ingroup TELEPHONY_API +* @addtogroup TAPI_API_SIM_SAT SIM/SAT +*/ + +/** +* @ingroup TAPI_API_SIM_SAT +* @addtogroup UTS_SIM_SAT Unit +*/ + +/** +* @ingroup UTS_SIM_SAT +* @addtogroup UTS_TAPI_SIM_SAP_SET_POWER tel_req_sap_power_operation +* +* @brief Unit test code for tel_req_sap_power_operation() +* @par Test function Prototype: +* TapiResult_t tel_req_sap_power_operation(TelSimSapMsgId_t MsgId, int* pRequestId ); +* @par Test function description: +* This API is used to set the SIM power level for SAP. +* @par Important Notes: +* None +* @param [in] MsgId +* This enum gives the SAP message Ids between SAP client and SAP server. +* @code + // This enum gives the SAP message Ids between SAP client and SAP server. + typedef enum + { + TAPI_SIM_SAP_CONNECT_REQ = 0x00, + TAPI_SIM_SAP_CONNECT_RESP = 0x01, + TAPI_SIM_SAP_DISCONNECT_REQ = 0x02, + TAPI_SIM_SAP_DISCONNECT_RESP = 0x03, + TAPI_SIM_SAP_DISCONNECT_IND = 0x04, + TAPI_SIM_SAP_TRANSFER_APDU_REQ = 0x05, + TAPI_SIM_SAP_TRANSFER_APDU_RESP = 0x06, + TAPI_SIM_SAP_TRANSFER_ATR_REQ = 0x07, + TAPI_SIM_SAP_TRANSFER_ATR_RESP = 0x08, + TAPI_SIM_SAP_POWER_SIM_OFF_REQ = 0x09, + TAPI_SIM_SAP_POWER_SIM_OFF_RESP = 0x0A, + TAPI_SIM_SAP_POWER_SIM_ON_REQ = 0x0B, + TAPI_SIM_SAP_POWER_SIM_ON_RESP = 0x0C, + TAPI_SIM_SAP_RESET_SIM_REQ = 0x0D, + TAPI_SIM_SAP_RESET_SIM_RESP = 0x0E, + TAPI_SIM_SAP_TRANSFER_CARD_READER_STATUS_REQ = 0x0F, + TAPI_SIM_SAP_TRANSFER_CARD_READER_STATUS_RESP = 0x10, + TAPI_SIM_SAP_STATUS_IND = 0x11, + TAPI_SIM_SAP_ERROR_RESP = 0x12, + TAPI_SIM_SAP_SET_TRANSPORT_PROTOCOL_REQ = 0x13, + TAPI_SIM_SAP_SET_TRANSPORT_PROTOCOL_RESP = 0x14 + }TelSimSapMsgId_t; +* @endcode +* @param [out] pRequestId Unique identifier for a particular request. +* - request_id value can be any value from 0 to 255 if the API is returned successfully +* - -1 (INVALID_REQUEST_ID) will be sent in case of failure. +* @par Async Response Message: +* The event associated is below and the event data is #TelSimSapPower_t. \n +* - TAPI_EVENT_SIM_SAP_SET_SIM_POWER_CNF +* @pre +* - SAT supported SIM used for test +* @post +* None +* @return +* Return Type : (TapiResult_t) +* - TAPI_API_SUCCESS - indicating that the operation has completed successfully. +* - Otherwise it provides an error code (Refer #TapiResult_t) +* @{ +*/ + +/** +* @file uts_tel_req_sap_power_operation.c +* @brief Test for the tel_req_sap_power_operation() API that is used to sap set power +* @author +* @version Initial Creation V0.1 +* @date 2008.07.30 +*/ + + +#include +#include +#include + +#include "tet_tapi_util.h" +#include "uts_tel_req_sap_power_operation.h" +#include "sim_common.h" + + +/* Initialize TCM data structures */ +static void startup(); +static void cleanup(); +void (*tet_startup) () = startup; +void (*tet_cleanup) () = cleanup; +struct tet_testlist tet_testlist[] = { + {utc_tel_req_sap_power_operation_01, 1}, + {utc_tel_req_sap_power_operation_02, 2}, + {utc_tel_req_sap_power_operation_03, 3}, + {utc_tel_req_sap_power_operation_04, 4}, + {NULL, 0} +}; + + +/* + G_MAIN Utility //////////////////////////////////////////////////////////////////////////// +*/ +// Prototype : User must add function body +gboolean g_timeout_callback (void *data); + +// GMainLoop global handler +GMainLoop *nw_context_loop = NULL; + +void G_MAIN_LOOP_CLOSE() +{ + g_main_loop_quit(nw_context_loop); +} + +int G_MAIN_LOOP_RUN(int sec) +{ + //GMainLoop *mainloop; + nw_context_loop = g_main_loop_new (NULL, FALSE); + g_timeout_add ( (sec * 1000), g_timeout_callback, NULL); + g_main_loop_run (nw_context_loop); + + return 0; +} +// End of G_MAIN Utility////////////////////////////////////////////////////////////////////// + + +/* + User Defined Handler +*/ +// Global variable for user data +static BOOL gAsyncResult; //user defined data : Async callback is called or not + +// G_MAIN Utility : time out callback function +gboolean g_timeout_callback (void *data) +{ + gAsyncResult = FALSE; + tet_printf("[SIM APP][TIME OUT] g_timeout called .Close g_main_roop()"); + G_MAIN_LOOP_CLOSE(); + return FALSE; +} + + +static int sim_sap_process_for_condition(int wish_condition) +{ + TelSimSapConnect_t pConnectionReq; + int pRequestId=0; + int tapiRet = TAPI_API_SUCCESS; + + tet_printf("sap wish condition[%d]:0-disconnect, 1-connect",wish_condition); + + if(wish_condition == 1) + { + pConnectionReq.MsgId = TAPI_SIM_SAP_CONNECT_REQ; + } + else + { + pConnectionReq.MsgId = TAPI_SIM_SAP_DISCONNECT_REQ; + } + + pConnectionReq.MaxMsgSize = 10; //temp for testing only - not clear + + gAsyncResult = FALSE; + + tapiRet = tel_req_sap_connection(&pConnectionReq,&pRequestId); + TET_RESULT_NOT_EQUAL(TET_FAIL,TAPI_API_SUCCESS,tapiRet); + + G_MAIN_LOOP_RUN(2); + + if(gAsyncResult == TRUE) + return 0; + else + return -1; + +} + + +static int sim_app_callback (TelTapiEvent_t *sim_event) +{ + tet_printf("\n\n\n***************[SIM APP]Callback data **********************\n"); + tet_printf("[SIM APP]Reques Id[%d]\n", sim_event->RequestId); + tet_printf("[SIM APP]event status [%d]\n", sim_event->Status); + + gAsyncResult = FALSE; + BOOL bReceived = FALSE; + + switch(sim_event->EventType) + { + case TAPI_EVENT_SIM_SAP_CONNECT_CNF: + { + tet_printf("\n[GOT THE EVENT]*******TAPI_EVENT_SIM_SAP_CONNECT_CNF:******\n"); + TelSimSapConnect_t *sap_conn_resp = (TelSimSapConnect_t*)sim_event->pData; + + tet_printf("[SIM APP]SIM SAP connect request event status = [%x]\n", sim_event->Status); + tet_printf("[SIM APP] message id [%x]\n", sap_conn_resp->MsgId); + tet_printf("[SIM APP]connection status [%x]\n ", sap_conn_resp->ConnectionStatus); + tet_printf("[SIM APP]max message size [%d]\n", sap_conn_resp->MaxMsgSize); + + bReceived = TRUE; + if (sap_conn_resp->ConnectionStatus==0) + gAsyncResult = TRUE; + else + gAsyncResult = FALSE; + } + break; + + case TAPI_EVENT_SIM_SAP_SET_SIM_POWER_CNF: + { + tet_printf("\n[GOT THE EVENT]*******TAPI_EVENT_SIM_SAP_SET_SIM_POWER_CNF:******\n"); + tet_printf("[SIM APP]SIM SAP connect event status = [%x]\n", sim_event->Status); + + TelSimSapPower_t *sap_status = (TelSimSapPower_t*)sim_event->pData; +// tet_printf("[SIM APP] sap_status->MsgID = %d\n", sap_status->MsgId); +// tet_printf("[SIM APP] sap_status->SimPowerResult = %d (enum TelSimSapResultCode_t) \n", sap_status->SimPowerResult); + bReceived = TRUE; + gAsyncResult = TRUE; + } + break; + + default: + { + bReceived = TRUE; + gAsyncResult = FALSE; + tet_printf("Info : TAPI_EVENT_SIM_SAP_SET_SIM_POWER_CNF = %d", TAPI_EVENT_SIM_SAP_SET_SIM_POWER_CNF); + tet_printf("[SIM APP]***************** Undhandled event type [%d] *****************\n",sim_event->EventType); + tet_printf("[SIM APP]Undhandled event state [%d]\n",sim_event->Status); + } + break; + }//end switch + + if (bReceived == TRUE) + G_MAIN_LOOP_CLOSE(); + + return 0; +} + + +/* Startup & Clean function : It is not test code, only for + initialize and finalize test module +*/ +static BOOL gStartupSuccess = FALSE; +static unsigned int subscription_id = 0; + +static void startup() +{ + tet_infoline("utc_tel_req_sap_power_operation Test Start\n"); + + if ( tel_init() == TAPI_API_SUCCESS) + { + tel_register_event(TAPI_EVENT_SIM_SAP_CONNECT_CNF,&subscription_id,(TelAppCallback)sim_app_callback,NULL); + tel_register_event(TAPI_EVENT_SIM_SAP_SET_SIM_POWER_CNF,&subscription_id,(TelAppCallback)sim_app_callback,NULL); + + gStartupSuccess = TRUE; + } else { + tet_infoline("startup fail. tel_init() failed"); + } + tel_register_app_name("org.samsung.test"); + return; +} + + +static void cleanup() +{ + tet_infoline("utc_tel_req_sap_power_operation Test Finished\n"); + + if (gStartupSuccess == TRUE) + { + tel_deregister_event(subscription_id); + } + tel_deinit(); + + return; +} + + +/* + Unit Test Case functions +*/ +/** +* @brief tel_req_sap_power_operation() API : Negative condition(Lower bound test) +* @par ID: UTC_TEL_REQ_SAP_pOWER_OPErATION_01 +* @param [in] MsgId = TAPI_SIM_SAP_CONNECT_REQ-1; // Lower bound +* @param [out]&pRequestId +* @return TAPI_API_INVALID_INPUT +*/ +void utc_tel_req_sap_power_operation_01() +{ + tet_infoline("TAPI_API_INVALID_INPUT 1"); + + TelSimSapMsgId_t MsgId = TAPI_SIM_SAP_CONNECT_REQ-1; + int pRequestId=0; + + TapiResult_t error = tel_req_sap_power_operation(MsgId,&pRequestId); + TET_CHECK( TAPI_API_INVALID_INPUT,error); + TET_STAMP_PASS(); +} + +/** +* @brief tel_req_sap_power_operation() API : Negative condition(Upper bound test) +* @par ID: UTC_TEL_REQ_SAP_pOWER_OPErATION_02 +* @param [in] MsgId = TAPI_SIM_SAP_SET_TRANSPORT_PROTOCOL_RESP+1; // Upper bound +* @param [out]&pRequestId +* @return TAPI_API_INVALID_INPUT +*/ +void utc_tel_req_sap_power_operation_02() +{ + tet_infoline("TAPI_API_INVALID_INPUT 2"); + + TelSimSapMsgId_t MsgId = TAPI_SIM_SAP_SET_TRANSPORT_PROTOCOL_RESP+1; + int pRequestId=0; + + TapiResult_t error = tel_req_sap_power_operation(MsgId,&pRequestId); + TET_CHECK( TAPI_API_INVALID_INPUT,error); + TET_STAMP_PASS(); +} + +/** +* @brief tel_req_sap_power_operation() API : Negative condition(NULL parameter test) +* @par ID: UTC_TEL_REQ_SAP_pOWER_OPErATION_03 +* @param [in] MsgId +* @param [out]&pRequestId = NULL; // NULL parameter +* @return TAPI_API_INVALID_PTR +*/ +void utc_tel_req_sap_power_operation_03() +{ + tet_infoline("TAPI_API_INVALID_PTR 1"); + + TelSimSapMsgId_t MsgId = TAPI_SIM_SAP_SET_TRANSPORT_PROTOCOL_RESP+1; + TapiResult_t error = tel_req_sap_power_operation(MsgId,NULL); + TET_CHECK( TAPI_API_INVALID_PTR,error); + TET_STAMP_PASS(); +} + +/** +* @brief tel_req_sap_power_operation() API : Positive condition(Normal operation) +* @par ID: UTC_TEL_REQ_SAP_pOWER_OPErATION_04 +* @param [in] MsgId = TAPI_SIM_SAP_POWER_SIM_ON_REQ; +* @param [out]&pRequestId +* @return TAPI_API_SUCCESS +* The event associated is below and the event data is #TelSimSapPower_t. \n +* - TAPI_EVENT_SIM_SAP_SET_SIM_POWER_CNF +*/ +void utc_tel_req_sap_power_operation_04() +{ + tet_infoline("Normal operation"); + TET_RESULT_NOT_EQUAL(TET_UNTESTED,gStartupSuccess, TRUE); + + TelSimSapMsgId_t MsgId = (TelSimSapMsgId_t) TAPI_SIM_SAP_POWER_SIM_ON_REQ; + int pRequestId=0; + int tapiRet = TAPI_API_SUCCESS; +#if 0 // we assume sap connect on. + // Step 1 : make proper condition + tet_printf("Step 1 : sap connect"); + + if( 0 != sim_sap_process_for_condition(1)) + { + tet_printf("condition set is failed!!"); + return; + } +#endif + gAsyncResult = FALSE; + + tapiRet = tel_req_sap_power_operation(MsgId,&pRequestId); + TET_RESULT_NOT_EQUAL(TET_FAIL,TAPI_API_SUCCESS,tapiRet); + + G_MAIN_LOOP_RUN(3); + + TET_RESULT_NOT_EQUAL_GOTO(TET_FAIL,exit,gAsyncResult,TRUE); + TET_RESULT_EQUAL_GOTO(TET_PASS,exit,gAsyncResult,TRUE); + +exit: +#if 0 // we assume sap connect on. + // Step 3 : make default condition + tet_printf("Step 3 : disconnect sap"); + + if( 0 != sim_sap_process_for_condition(0)) + { + tet_printf("condition set is failed!!"); + } +#endif + gAsyncResult = FALSE; + return; +} + + +/** @} */ diff --git a/TC/telephony_TC/sim/unit/uts_tel_req_sap_power_operation.h b/TC/telephony_TC/sim/unit/uts_tel_req_sap_power_operation.h new file mode 100644 index 0000000..6100272 --- /dev/null +++ b/TC/telephony_TC/sim/unit/uts_tel_req_sap_power_operation.h @@ -0,0 +1,30 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * 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 _uts_tel_req_sap_power_operation_H +#define _uts_tel_req_sap_power_operation_H + + static void utc_tel_req_sap_power_operation_01(); + static void utc_tel_req_sap_power_operation_02(); + static void utc_tel_req_sap_power_operation_03(); + static void utc_tel_req_sap_power_operation_04(); + +#endif diff --git a/TC/telephony_TC/sim/unit/uts_tel_req_sap_transfer_apdu.c b/TC/telephony_TC/sim/unit/uts_tel_req_sap_transfer_apdu.c new file mode 100644 index 0000000..5ad78d9 --- /dev/null +++ b/TC/telephony_TC/sim/unit/uts_tel_req_sap_transfer_apdu.c @@ -0,0 +1,423 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +/** +* @ingroup TELEPHONY_API +* @addtogroup TAPI_API_SIM_SAT SIM/SAT +*/ + +/** +* @ingroup TAPI_API_SIM_SAT +* @addtogroup UTS_SIM_SAT Unit +*/ + +/** +* @ingroup UTS_SIM_SAT +* @addtogroup UTS_TAPI_SIM_PSAP_TRANSFER_APDU tel_req_sap_transfer_apdu +* +* @brief Unit test code for tel_req_sap_transfer_apdu() +* @par Test function Prototype: +* TapiResult_t tel_req_sap_transfer_apdu(TelSimSapApduData_t *pApduData, int* pRequestId); +* @par Test function description: +* This API is used to transfer APDU from SIM using SAP. +* @par Important Notes: +* None +* @param [in] pApduData SAP APDU data +* @code + typedef struct + { + unsigned char ApduLength; + unsigned char Apdu[TAPI_SIM_APDU_MAX_LEN]; + }TelSimSapApduData_t; +* @endcode +* @param [out] pRequestId Unique identifier for a particular request. +* - request_id value can be any value from 0 to 255 if the API is returned successfully +* - -1 (INVALID_REQUEST_ID) will be sent in case of failure. +* @par Async Response Message: +* The event associated is below and the event data is #TelSimSapApduData_t. \n +* - TAPI_EVENT_SIM_SAP_TRANSFER_APDU_CNF +* @pre +* SAP supported sim used to testing +* @post +* None +* @return +* Return Type : (TapiResult_t) +* - TAPI_API_SUCCESS - indicating that the operation has completed successfully. +* - Otherwise it provides an error code (Refer #TapiResult_t) +* @{ +*/ + +/** +* @file uts_tel_req_sap_transfer_apdu.c +* @brief Test for the tel_req_sap_transfer_apdu() API that is used to transfer APDU +* @author +* @version Initial Creation V0.1 +* @date 2008.07.30 +*/ + +#include +#include +#include + +#include "tet_tapi_util.h" +#include "sim_common.h" +#include "uts_tel_req_sap_transfer_apdu.h" + +/* Initialize TCM data structures */ +static void startup(); +static void cleanup(); +void (*tet_startup) () = startup; +void (*tet_cleanup) () = cleanup; +struct tet_testlist tet_testlist[] = { + {utc_tel_req_sap_transfer_apdu_01, 1}, + {utc_tel_req_sap_transfer_apdu_02, 2}, + {utc_tel_req_sap_transfer_apdu_03, 3}, + {NULL, 0} +}; + + + +/* + G_MAIN Utility //////////////////////////////////////////////////////////////////////////// +*/ +// Prototype : User must add function body +gboolean g_timeout_callback (void *data); + +// GMainLoop global handler +GMainLoop *nw_context_loop = NULL; + +void G_MAIN_LOOP_CLOSE() +{ + g_main_loop_quit(nw_context_loop); +} + +int G_MAIN_LOOP_RUN(int sec) +{ + //GMainLoop *mainloop; + nw_context_loop = g_main_loop_new (NULL, FALSE); + g_timeout_add ( (sec * 1000), g_timeout_callback, NULL); + g_main_loop_run (nw_context_loop); + + return 0; +} +// End of G_MAIN Utility////////////////////////////////////////////////////////////////////// + + +/* + User Defined Handler +*/ +// Global variable for user data +static BOOL gAsyncResult; //user defined data : Async callback is called or not + +// G_MAIN Utility : time out callback function +gboolean g_timeout_callback (void *data) +{ + gAsyncResult = FALSE; + tet_printf("[SIM APP][TIME OUT] g_timeout called .Close g_main_roop()"); + G_MAIN_LOOP_CLOSE(); + return FALSE; +} + + +static int sim_sap_process_for_condition(int wish_condition) +{ + TelSimSapConnect_t pConnectionReq; + int pRequestId=0; + int tapiRet = TAPI_API_SUCCESS; + + tet_printf("sap wish condition[%d]:0-disconnect, 1-connect",wish_condition); + + if(wish_condition == 1) + { + pConnectionReq.MsgId = TAPI_SIM_SAP_CONNECT_REQ; + } + else + { + pConnectionReq.MsgId = TAPI_SIM_SAP_DISCONNECT_REQ; + } + + pConnectionReq.MaxMsgSize = 10; //temp for testing only - not clear + + gAsyncResult = FALSE; + + tapiRet = tel_req_sap_connection(&pConnectionReq,&pRequestId); + TET_RESULT_NOT_EQUAL(TET_FAIL,TAPI_API_SUCCESS,tapiRet); + + G_MAIN_LOOP_RUN(2); + + if(gAsyncResult == TRUE) + return 0; + else + return -1; + +} + + +static int sim_app_callback (TelTapiEvent_t *sim_event) +{ + tet_printf("\n\n\n***************[SIM APP]Callback data **********************\n"); + tet_printf("[SIM APP]Reques Id[%d]\n", sim_event->RequestId); + tet_printf("[SIM APP]event status [%d]\n", sim_event->Status); + + gAsyncResult = FALSE; + BOOL bReceived = FALSE; + + switch(sim_event->EventType) + { + case TAPI_EVENT_SIM_SAP_CONNECT_CNF: + { + tet_printf("\n[GOT THE EVENT]*******TAPI_EVENT_SIM_SAP_CONNECT_CNF:******\n"); + TelSimSapConnect_t *sap_conn_resp = (TelSimSapConnect_t*)sim_event->pData; + + tet_printf("[SIM APP]SIM SAP connect request event status = [%x]\n", sim_event->Status); + // tet_printf("[SIM APP] message id [%x]\n", sap_conn_resp->MsgId); + // tet_printf("[SIM APP]connection status [%x]\n ", sap_conn_resp->ConnectionStatus); + // tet_printf("[SIM APP]max message size [%d]\n", sap_conn_resp->MaxMsgSize); + + bReceived = TRUE; + gAsyncResult = TRUE; + } + break; + + case TAPI_EVENT_SIM_SAP_TRANSFER_APDU_CNF: + { + tet_printf("\n[GOT THE EVENT]*****TAPI_EVENT_SIM_SAP_TRANSFER_APDU_CNF******\n"); + + int i = 0; + TelSimSapApduData_t *sap_transfer_apdu = (TelSimSapApduData_t*)sim_event->pData; + + tet_printf("[SIM APP]SIM SAP trasfer APDU event status = [%x]\n", sim_event->Status); + // tet_printf(" [SIM APP]APDU length [%x]\n", sap_transfer_apdu->ApduLength); + // tet_printf(" [SIM APP]APDU data ---> \n" ); + // for(i =0 ; iApduLength; i++ ) + // tet_printf(" [%x]", sap_transfer_apdu->Apdu[i]); + + bReceived = TRUE; + gAsyncResult = TRUE; + } + break; + + case TAPI_EVENT_SIM_SAP_TRANSFER_ATR_CNF: + { + tet_printf("[SIM APP]*********** SAP TRANSFER ATR *************\n"); + + int i = 0; + TelSimSapAtrInfo_t *sap_transfer_atr = (TelSimSapAtrInfo_t*)sim_event->pData; + + tet_printf("[SIM APP]SIM SAP trasfer ATR event status = [%x]\n", sim_event->Status); + + tet_printf(" [SIM APP]ATR result [%x]\n", sap_transfer_atr->AtrResult); + tet_printf(" [SIM APP]ATR length [%x]\n", sap_transfer_atr->AtrLength); + tet_printf(" [SIM APP]ATR data ---> \n" ); + + for(i =0 ; iAtrLength; i++ ) + tet_printf(" [SIM APP][%x]", sap_transfer_atr->AtrData[i]); + + bReceived = TRUE; + gAsyncResult = TRUE; + } + break; + + default: + { + bReceived = TRUE; + gAsyncResult = FALSE; + tet_printf("Info : TAPI_EVENT_SIM_SAP_CONNECT_CNF = %d", TAPI_EVENT_SIM_SAP_CONNECT_CNF); + tet_printf("[SIM APP]***************** Undhandled event type [%d] *****************\n",sim_event->EventType); + tet_printf("[SIM APP]Undhandled event state [%d]\n",sim_event->Status); + } + break; + }//end switch + + if (bReceived == TRUE) + G_MAIN_LOOP_CLOSE(); + + return 0; +} + + + + +/* Startup & Clean function : It is not test code, only for + initialize and finalize test module +*/ +static BOOL gStartupSuccess = FALSE; +static unsigned int subscription_id = 0; + +static void startup() +{ + tet_infoline("utc_tel_req_sap_transfer_apdu Test Start\n"); + + if ( tel_init() == TAPI_API_SUCCESS) + { + tel_register_event(TAPI_EVENT_SIM_SAP_CONNECT_CNF,&subscription_id,(TelAppCallback)sim_app_callback,NULL); + tel_register_event(TAPI_EVENT_SIM_SAP_TRANSFER_APDU_CNF,&subscription_id,(TelAppCallback)sim_app_callback,NULL); + + gStartupSuccess = TRUE; + } else { + tet_infoline("startup fail. tel_init() failed"); + } + tel_register_app_name("org.samsung.test"); + return; +} + + +static void cleanup() +{ + tet_infoline("utc_tel_req_sap_transfer_apdu Test Finished\n"); + + if (gStartupSuccess == TRUE) + { + tel_deregister_event(subscription_id); + } + tel_deinit(); + + return; +} + + +/* + Unit Test Case functions +*/ + +/** +* @brief tel_req_sap_transfer_apdu() API : Negative condition(Parameter is Null) +* @par ID: UTC_TEL_REQ_SAP_TRANSFER_APDU_01 +* @param [in] pApduData +* @param [out]&sim_data = NULL +* @return TAPI_API_INVALID_PTR +*/ +void utc_tel_req_sap_transfer_apdu_01() +{ + TET_STAMP_START("TAPI_API_INVALID_PTR "); + int file_id = TAPI_SIM_EFILE_ICCID; + + /* for selecting EF ICCID */ + TelSimSapApduData_t apdu_data; + int pRequestId=0; + apdu_data.ApduLength = 7; + apdu_data.Apdu[0] = 0xA0; // class + apdu_data.Apdu[1] = 0xA4; // instruction + apdu_data.Apdu[2] = 0; // p1 = parameter 1 + apdu_data.Apdu[3] = 0; // p2 = parameter 2 + apdu_data.Apdu[4] = 2; // p3 - parameter 3 + + memcpy(&apdu_data.Apdu[5], &file_id, sizeof(unsigned short)); + + TapiResult_t error = tel_req_sap_transfer_apdu(&apdu_data,NULL); + TET_CHECK(TAPI_API_INVALID_PTR, error); + TET_STAMP_PASS(); + +} + +/** +* @brief tel_req_sap_transfer_apdu() API : Negative condition(Parameter is Null) +* @par ID: UTC_TEL_REQ_SAP_TRANSFER_APDU_02 +* @param [in] pApduData = NULL +* @param [out]&sim_data +* @return TAPI_API_INVALID_PTR +*/ +void utc_tel_req_sap_transfer_apdu_02() +{ + TET_STAMP_START("TAPI_API_INVALID_PTR "); + int pRequestId=0; + TapiResult_t error = tel_req_sap_transfer_apdu(NULL,&pRequestId); + TET_CHECK(TAPI_API_INVALID_PTR, error); + TET_STAMP_PASS(); +} + +/** +* @brief tel_req_sap_transfer_apdu() API : Positive condition(Request to transfer Apdu) +* @par ID: UTC_TEL_REQ_SAP_TRANSFER_APDU_03 +* @param [in] pApduData +* @code + int file_id = TAPI_SIM_EFILE_ICCID; + + // for selecting EF ICCID + TelSimSapApduData_t apdu_data; + int pRequestId=0; + apdu_data.ApduLength = 7; + apdu_data.Apdu[0] = 0xA0; // class + apdu_data.Apdu[1] = 0xA4; // instruction + apdu_data.Apdu[2] = 0; // p1 = parameter 1 + apdu_data.Apdu[3] = 0; // p2 = parameter 2 + apdu_data.Apdu[4] = 2; // p3 - parameter 3 + memcpy(&apdu_data.Apdu[5], &file_id, sizeof(unsigned short)); +* @endcode +* @param [out]&sim_data = NULL +* @return TAPI_API_INVALID_PTR +*/ +void utc_tel_req_sap_transfer_apdu_03() +{ + TET_STAMP_START("Normal operation "); + TET_RESULT_NOT_EQUAL(TET_UNTESTED,gStartupSuccess, TRUE); + + int file_id = TAPI_SIM_EFILE_ICCID; + int tapiRet = TAPI_API_SUCCESS; + int pRequestId=0; + + /* for selecting EF ICCID */ + TelSimSapApduData_t apdu_data; + + apdu_data.ApduLength = 7; + apdu_data.Apdu[0] = 0xA0; // class + apdu_data.Apdu[1] = 0xA4; // instruction + apdu_data.Apdu[2] = 0; // p1 = parameter 1 + apdu_data.Apdu[3] = 0; // p2 = parameter 2 + apdu_data.Apdu[4] = 2; // p3 - parameter 3 + + memcpy(&apdu_data.Apdu[5], &file_id, sizeof(unsigned short)); +#if 0 // we assume sap connect on. + // Step 1 : make proper condition + tet_printf("Step 1 : sap connect"); + + if( 0 != sim_sap_process_for_condition(1)) + { + tet_printf("condition set is failed!!"); + return; + } +#endif + gAsyncResult = FALSE; + + tapiRet = tel_req_sap_transfer_apdu(&apdu_data,&pRequestId); + TET_RESULT_NOT_EQUAL(TET_FAIL,TAPI_API_SUCCESS,tapiRet); + + G_MAIN_LOOP_RUN(3); + + TET_RESULT_NOT_EQUAL_GOTO(TET_FAIL,exit,gAsyncResult,TRUE); + TET_RESULT_EQUAL_GOTO(TET_PASS,exit,gAsyncResult,TRUE); + +exit: +#if 0 // we use connection status until finishing sap related api test. + + // Step 3 : make default condition + tet_printf("Step 3 : disconnect sap"); + + if( 0 != sim_sap_process_for_condition(0)) + { + tet_printf("condition set is failed!!"); + } +#endif + gAsyncResult = FALSE; + return; +} + +/** @} */ diff --git a/TC/telephony_TC/sim/unit/uts_tel_req_sap_transfer_apdu.h b/TC/telephony_TC/sim/unit/uts_tel_req_sap_transfer_apdu.h new file mode 100644 index 0000000..bc2aaaf --- /dev/null +++ b/TC/telephony_TC/sim/unit/uts_tel_req_sap_transfer_apdu.h @@ -0,0 +1,30 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * 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 _uts_tel_req_sap_transfer_apdu_H +#define _uts_tel_req_sap_transfer_apdu_H + + static void utc_tel_req_sap_transfer_apdu_01(); + static void utc_tel_req_sap_transfer_apdu_02(); + static void utc_tel_req_sap_transfer_apdu_03(); + +#endif + diff --git a/TC/telephony_TC/sim/unit/uts_tel_req_sap_transfer_atr.c b/TC/telephony_TC/sim/unit/uts_tel_req_sap_transfer_atr.c new file mode 100644 index 0000000..48c8b7c --- /dev/null +++ b/TC/telephony_TC/sim/unit/uts_tel_req_sap_transfer_atr.c @@ -0,0 +1,344 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +/** +* @ingroup TELEPHONY_API +* @addtogroup TAPI_API_SIM_SAT SIM/SAT +*/ + +/** +* @ingroup TAPI_API_SIM_SAT +* @addtogroup UTS_SIM_SAT Unit +*/ + +/** +* @ingroup UTS_SIM_SAT +* @addtogroup UTS_TAPI_SIM_SAP_TRANSFER_ATR_REQUEST tel_req_sap_transfer_atr +* +* @brief Unit test code for tel_req_sap_transfer_atr() +* @par Test function Prototype: +* TapiResult_t tel_req_sap_transfer_atr(int* pRequestId); +* @par Test function description: +* This API is used to request for an external SAP connection. +* @par Important Notes: +* None +* @param [out] pRequestId Unique identifier for a particular request. +* - request_id value can be any value from 0 to 255 if the API is returned successfully +* - -1 (INVALID_REQUEST_ID) will be sent in case of failure. +* @par Async Response Message: +* The event associated is below and the event data is #TelSimSapAtrInfo_t. \n +* - TAPI_EVENT_SIM_SAP_TRANSFER_ATR_CNF +* @pre +* SAP supported sim used to testing +* @post +* None +* @return +* Return Type : (TapiResult_t) +* - TAPI_API_SUCCESS - indicating that the operation has completed successfully. +* - Otherwise it provides an error code (Refer #TapiResult_t) +* @{ +*/ + +/** +* @file uts_tel_req_sap_transfer_atr_request.c +* @brief Test for the tel_req_sap_transfer_atr() API that is used to transfer atr request +* @author +* @version Initial Creation V0.1 +* @date 2008.07.30 +*/ + +#include +#include +#include + +#include "tet_tapi_util.h" +#include "sim_common.h" +#include "uts_tel_req_sap_transfer_atr.h" + +/* Initialize TCM data structures */ +static void startup(); +static void cleanup(); +void (*tet_startup) () = startup; +void (*tet_cleanup) () = cleanup; +struct tet_testlist tet_testlist[] = { + {utc_tel_req_sap_transfer_atr_01, 1}, + {utc_tel_req_sap_transfer_atr_02, 2}, + {NULL, 0} +}; + + + +/* + G_MAIN Utility //////////////////////////////////////////////////////////////////////////// +*/ +// Prototype : User must add function body +gboolean g_timeout_callback (void *data); + +// GMainLoop global handler +GMainLoop *nw_context_loop = NULL; + +void G_MAIN_LOOP_CLOSE() +{ + g_main_loop_quit(nw_context_loop); +} + +int G_MAIN_LOOP_RUN(int sec) +{ + //GMainLoop *mainloop; + nw_context_loop = g_main_loop_new (NULL, FALSE); + g_timeout_add ( (sec * 1000), g_timeout_callback, NULL); + g_main_loop_run (nw_context_loop); + + return 0; +} +// End of G_MAIN Utility////////////////////////////////////////////////////////////////////// + + +/* + User Defined Handler +*/ +// Global variable for user data +static BOOL gAsyncResult; //user defined data : Async callback is called or not + +// G_MAIN Utility : time out callback function +gboolean g_timeout_callback (void *data) +{ + gAsyncResult = FALSE; + tet_printf("[SIM APP][TIME OUT] g_timeout called .Close g_main_roop()"); + G_MAIN_LOOP_CLOSE(); + return FALSE; +} + + +static int sim_sap_process_for_condition(int wish_condition) +{ + TelSimSapConnect_t pConnectionReq; + int pRequestId=0; + int tapiRet = TAPI_API_SUCCESS; + + tet_printf("sap wish condition[%d]:0-disconnect, 1-connect",wish_condition); + + if(wish_condition == 1) + { + pConnectionReq.MsgId = TAPI_SIM_SAP_CONNECT_REQ; + } + else + { + pConnectionReq.MsgId = TAPI_SIM_SAP_DISCONNECT_REQ; + } + + pConnectionReq.MaxMsgSize = 10; //temp for testing only - not clear + + gAsyncResult = FALSE; + + tapiRet = tel_req_sap_connection(&pConnectionReq,&pRequestId); + TET_RESULT_NOT_EQUAL(TET_FAIL,TAPI_API_SUCCESS,tapiRet); + + G_MAIN_LOOP_RUN(5); + + if(gAsyncResult == TRUE) + return 0; + else + return -1; + +} + + +static int sim_app_callback (TelTapiEvent_t *sim_event) +{ + tet_printf("\n\n\n***************[SIM APP]Callback data **********************\n"); + tet_printf("[SIM APP]Reques Id[%d]\n", sim_event->RequestId); + tet_printf("[SIM APP]event status [%d]\n", sim_event->Status); + + gAsyncResult = FALSE; + BOOL bReceived = FALSE; + + switch(sim_event->EventType) + { + case TAPI_EVENT_SIM_SAP_CONNECT_CNF: + { + tet_printf("\n[GOT THE EVENT]*******TAPI_EVENT_SIM_SAP_CONNECT_CNF:******\n"); + TelSimSapConnect_t *sap_conn_resp = (TelSimSapConnect_t*)sim_event->pData; + + tet_printf("[SIM APP]SIM SAP connect request event status = [%x]\n", sim_event->Status); + // tet_printf("[SIM APP] message id [%x]\n", sap_conn_resp->MsgId); + // tet_printf("[SIM APP]connection status [%x]\n ", sap_conn_resp->ConnectionStatus); + // tet_printf("[SIM APP]max message size [%d]\n", sap_conn_resp->MaxMsgSize); + + bReceived = TRUE; + gAsyncResult = TRUE; + } + break; + + case TAPI_EVENT_SIM_SAP_TRANSFER_ATR_CNF: + { + tet_printf("[SIM APP]*********** SAP TRANSFER ATR *************\n"); + + int i = 0; + TelSimSapAtrInfo_t *sap_transfer_atr = (TelSimSapAtrInfo_t*)sim_event->pData; + + tet_printf("[SIM APP]SIM SAP trasfer ATR event status = [%x]\n", sim_event->Status); + + tet_printf(" [SIM APP]ATR result [%x]\n", sap_transfer_atr->AtrResult); + tet_printf(" [SIM APP]ATR length [%x]\n", sap_transfer_atr->AtrLength); + tet_printf(" [SIM APP]ATR data ---> \n" ); + +// for(i =0 ; iAtrLength; i++ ) +// tet_printf(" [SIM APP][%x]", sap_transfer_atr->AtrData[i]); + + bReceived = TRUE; + gAsyncResult = TRUE; + } + break; + + default: + { + bReceived = TRUE; + gAsyncResult = FALSE; + tet_printf("[SIM APP]***************** Undhandled event type [%d] *****************\n",sim_event->EventType); + tet_printf("[SIM APP]Undhandled event state [%d]\n",sim_event->Status); + } + break; + }//end switch + + if (bReceived == TRUE) + G_MAIN_LOOP_CLOSE(); + + return 0; +} + + + +/* Startup & Clean function : It is not test code, only for + initialize and finalize test module +*/ +static BOOL gStartupSuccess = FALSE; +static unsigned int subscription_id = 0; + +static void startup() +{ + tet_infoline("utc_tel_req_sap_transfer_atr Test Start\n"); + + if ( tel_init() == TAPI_API_SUCCESS) + { + tel_register_event(TAPI_EVENT_SIM_SAP_CONNECT_CNF,&subscription_id,(TelAppCallback)sim_app_callback,NULL); + tel_register_event(TAPI_EVENT_SIM_SAP_TRANSFER_ATR_CNF,&subscription_id,(TelAppCallback)sim_app_callback,NULL); + + gStartupSuccess = TRUE; + } else { + tet_infoline("startup fail. tel_init() failed"); + } + tel_register_app_name("org.samsung.test"); + + return; +} + + +static void cleanup() +{ + tet_infoline("utc_tel_req_sap_transfer_atr Test Finished\n"); + if (gStartupSuccess == TRUE) + { + tel_deregister_event(subscription_id); + } + tel_deinit(); + + return; +} + + +/* + Unit Test Case functions +*/ + +/** +* @brief tel_req_sap_transfer_atr() API : Positive condition(Request to transfer Atr) +* @par ID: UTC_TEL_REQ_SAP_TRANSFER_ATR_01 +* @param [out]&pRequestId +* @return TAPI_API_SUCCESS +* @par Async Response Message: +* The event associated is below and the event data is #TelSimSapAtrInfo_t. \n +* - TAPI_EVENT_SIM_SAP_TRANSFER_ATR_CNF +*/ +void utc_tel_req_sap_transfer_atr_01() +{ + TET_STAMP_START("Normal operation"); + TET_RESULT_NOT_EQUAL(TET_UNTESTED,gStartupSuccess, TRUE); + + int pRequestId=0; + int tapiRet = TAPI_API_SUCCESS; + + // Step 1 : make proper condition + tet_printf("Step 1 : sap connect"); + + if( 0 != sim_sap_process_for_condition(1)) + { + tet_printf("condition set is failed!!"); + return; + } + + + tet_printf("Step 2 : sap atr"); + + gAsyncResult = FALSE; + + tapiRet = tel_req_sap_transfer_atr(&pRequestId); + TET_RESULT_NOT_EQUAL(TET_FAIL,TAPI_API_SUCCESS,tapiRet); + + tet_printf("after real tc api - wait start"); + + G_MAIN_LOOP_RUN(3); + + tet_printf("after real tc api - wait stop"); + + TET_RESULT_NOT_EQUAL_GOTO(TET_FAIL,exit,gAsyncResult,TRUE); + TET_RESULT_EQUAL_GOTO(TET_PASS,exit,gAsyncResult,TRUE); + +exit: +#if 0 // we use connection status until finishing sap related api test. + // Step 3 : make default condition + tet_printf("Step 3 : disconnect sap"); + + if( 0 != sim_sap_process_for_condition(0)) + { + tet_printf("condition set is failed!!"); + } +#endif + gAsyncResult = FALSE; + return; +} + +/** +* @brief tel_req_sap_transfer_atr() API : Negative condition(Parameter is Null) +* @par ID: UTC_TEL_REQ_SAP_TRANSFER_ATR_02 +* @param [out]&pRequestId = NULL +* @return TAPI_API_INVALID_PTR +*/ +void utc_tel_req_sap_transfer_atr_02() +{ + TET_STAMP_START("TAPI_API_INVALID_PTR 1"); + + TapiResult_t error = tel_req_sap_transfer_atr(NULL); + TET_CHECK(TAPI_API_INVALID_PTR, error); + TET_STAMP_PASS(); +} + +/** @} */ diff --git a/TC/telephony_TC/sim/unit/uts_tel_req_sap_transfer_atr.h b/TC/telephony_TC/sim/unit/uts_tel_req_sap_transfer_atr.h new file mode 100644 index 0000000..9d1fb5a --- /dev/null +++ b/TC/telephony_TC/sim/unit/uts_tel_req_sap_transfer_atr.h @@ -0,0 +1,30 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * 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 _UTS_TEL_REQ_SAP_TRANSFER_ATR_H +#define _UTS_TEL_REQ_SAP_TRANSFER_ATR_H + + static void utc_tel_req_sap_transfer_atr_01(); + static void utc_tel_req_sap_transfer_atr_02(); + +#endif + diff --git a/TC/telephony_TC/sim/unit/uts_tel_req_sap_transport_protocol.c b/TC/telephony_TC/sim/unit/uts_tel_req_sap_transport_protocol.c new file mode 100644 index 0000000..c28d8b3 --- /dev/null +++ b/TC/telephony_TC/sim/unit/uts_tel_req_sap_transport_protocol.c @@ -0,0 +1,439 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +/** +* @ingroup TELEPHONY_API +* @addtogroup TAPI_API_SIM_SAT SIM/SAT +*/ + +/** +* @ingroup TAPI_API_SIM_SAT +* @addtogroup UTS_SIM_SAT Unit +*/ + +/** +* @ingroup UTS_SIM_SAT +* @addtogroup UTS_TAPI_SIM_SAP_SET_TRANSPORT_PROTOCOL tel_req_sap_transport_protocol +* +* @brief Unit test code for tel_req_sap_transport_protocol() +* @par Test function Prototype: +* TapiResult_t tel_req_sap_transport_protocol(TelSimSapProtocol_t Protocol, int* pRequestId); +* @par Test function description: +* This API is used to transfer APDU from SIM using SAP. +* @par Important Notes: +* None +* @param [in] Protocol SAP transfer protocol type +* @code + typedef enum + { + TAPI_SIM_SAP_PROTOCOL_T0, // T = 0 + TAPI_SIM_SAP_PROTOCOL_T1 // T = 1 + }TelSimSapProtocol_t; +* @endcode +* @param [out] pRequestId Unique identifier for a particular request. +* - request_id value can be any value from 0 to 255 if the API is returned successfully +* - -1 (INVALID_REQUEST_ID) will be sent in case of failure. +* @par Async Response Message: +* The event associated is below and the event data is #TelSimSapResultCode_t. \n +* - TAPI_EVENT_SIM_SAP_SET_PROTOCOL_CNF +* @pre +* SAP supported sim used to testing +* @post +* None +* @return +* Return Type : (TapiResult_t) +* - TAPI_API_SUCCESS - indicating that the operation has completed successfully. +* - Otherwise it provides an error code (Refer #TapiResult_t) +* @{ +*/ + +/** +* @file uts_tel_req_sap_transport_protocol.c +* @brief Test for the tel_req_sap_transport_protocol() API that is used to set transport protocol +* @author +* @version Initial Creation V0.1 +* @date 2008.07.30 +*/ + +#include +#include +#include + +#include "tet_tapi_util.h" +#include "sim_common.h" +#include "uts_tel_req_sap_transport_protocol.h" + + + +/* Initialize TCM data structures */ +static void startup(); +static void cleanup(); +void (*tet_startup) () = startup; +void (*tet_cleanup) () = cleanup; +struct tet_testlist tet_testlist[] = { + {utc_tel_req_sap_transport_protocol_01, 1}, + {utc_tel_req_sap_transport_protocol_02, 2}, + {utc_tel_req_sap_transport_protocol_03, 3}, + {utc_tel_req_sap_transport_protocol_04, 4}, + {utc_tel_req_sap_transport_protocol_05, 5}, + {NULL, 0} +}; + + + + +/* + G_MAIN Utility //////////////////////////////////////////////////////////////////////////// +*/ +// Prototype : User must add function body +gboolean g_timeout_callback (void *data); + +// GMainLoop global handler +GMainLoop *nw_context_loop = NULL; + +void G_MAIN_LOOP_CLOSE() +{ + g_main_loop_quit(nw_context_loop); +} + +int G_MAIN_LOOP_RUN(int sec) +{ + //GMainLoop *mainloop; + nw_context_loop = g_main_loop_new (NULL, FALSE); + g_timeout_add ( (sec * 1000), g_timeout_callback, NULL); + g_main_loop_run (nw_context_loop); + + return 0; +} +// End of G_MAIN Utility////////////////////////////////////////////////////////////////////// + + +/* + User Defined Handler +*/ +// Global variable for user data +static BOOL gAsyncResult; //user defined data : Async callback is called or not + +// G_MAIN Utility : time out callback function +gboolean g_timeout_callback (void *data) +{ + gAsyncResult = FALSE; + tet_printf("[SIM APP][TIME OUT] g_timeout called .Close g_main_roop()"); + G_MAIN_LOOP_CLOSE(); + return FALSE; +} + + +static int sim_sap_process_for_condition(int wish_condition) +{ + TelSimSapConnect_t pConnectionReq; + int pRequestId=0; + int tapiRet = TAPI_API_SUCCESS; + + tet_printf("sap wish condition[%d]:0-disconnect, 1-connect",wish_condition); + + if(wish_condition == 1) + { + pConnectionReq.MsgId = TAPI_SIM_SAP_CONNECT_REQ; + } + else + { + pConnectionReq.MsgId = TAPI_SIM_SAP_DISCONNECT_REQ; + } + + pConnectionReq.MaxMsgSize = 10; //temp for testing only - not clear + + gAsyncResult = FALSE; + + tapiRet = tel_req_sap_connection(&pConnectionReq,&pRequestId); + TET_RESULT_NOT_EQUAL(TET_FAIL,TAPI_API_SUCCESS,tapiRet); + + G_MAIN_LOOP_RUN(2); + + if(gAsyncResult == TRUE) + return 0; + else + return -1; + +} + + +static int sim_app_callback (TelTapiEvent_t *sim_event) +{ + tet_printf("\n\n\n***************[SIM APP]Callback data **********************\n"); + tet_printf("[SIM APP]Reques Id[%d]\n", sim_event->RequestId); + tet_printf("[SIM APP]event status [%d]\n", sim_event->Status); + + gAsyncResult = FALSE; + BOOL bReceived = FALSE; + + switch(sim_event->EventType) + { + case TAPI_EVENT_SIM_SAP_CONNECT_CNF: + { + tet_printf("\n[GOT THE EVENT]*******TAPI_EVENT_SIM_SAP_CONNECT_CNF:******\n"); + TelSimSapConnect_t *sap_conn_resp = (TelSimSapConnect_t*)sim_event->pData; + + tet_printf("[SIM APP]SIM SAP connect request event status = [%x]\n", sim_event->Status); + // tet_printf("[SIM APP] message id [%x]\n", sap_conn_resp->MsgId); + // tet_printf("[SIM APP]connection status [%x]\n ", sap_conn_resp->ConnectionStatus); + // tet_printf("[SIM APP]max message size [%d]\n", sap_conn_resp->MaxMsgSize); + + bReceived = TRUE; + gAsyncResult = TRUE; + } + break; + + case TAPI_EVENT_SIM_SAP_SET_PROTOCOL_CNF: + { + tet_printf("\n[GOT THE EVENT]*****TAPI_EVENT_SIM_SAP_SET_PROTOCOL_CNF******\n"); + TelSimSapProtocol_t *sap_result_code = (TelSimSapProtocol_t*)sim_event->pData; + + tet_printf("[SIM APP]SIM SAP set protocol event status = [%x]\n", sim_event->Status); + // tet_printf("[SIM APP]SAP SET protocol result [%x]\n", *sap_result_code ); + bReceived = TRUE; + gAsyncResult = TRUE; + } + break; + + default: + { + bReceived = TRUE; + gAsyncResult = FALSE; + tet_printf("[SIM APP]***************** Undhandled event type [%d] *****************\n",sim_event->EventType); + tet_printf("[SIM APP]Undhandled event state [%d]\n",sim_event->Status); + } + break; + }//end switch + + if (bReceived == TRUE) + G_MAIN_LOOP_CLOSE(); + + return 0; +} + + + +/* Startup & Clean function : It is not test code, only for + initialize and finalize test module +*/ +static BOOL gStartupSuccess = FALSE; +static unsigned int subscription_id = 0; + +static void startup() +{ + tet_infoline("utc_tel_req_sap_transport_protocol Test Start\n"); + + if ( tel_init() == TAPI_API_SUCCESS) + { + tel_register_event(TAPI_EVENT_SIM_SAP_CONNECT_CNF,&subscription_id,(TelAppCallback)sim_app_callback,NULL); + tel_register_event(TAPI_EVENT_SIM_SAP_SET_PROTOCOL_CNF,&subscription_id,(TelAppCallback)sim_app_callback,NULL); + + gStartupSuccess = TRUE; + } else { + tet_infoline("startup fail. tel_init() failed"); + } + tel_register_app_name("org.samsung.test"); + return; +} + + +static void cleanup() +{ + tet_infoline("utc_tel_req_sap_transport_protocol Test Finished\n"); + + if (gStartupSuccess == TRUE) + { + tel_deregister_event(subscription_id); + } + tel_deinit(); + + return; +} + + +/* + Unit Test Case functions +*/ + +/** +* @brief tel_req_sap_transport_protocol() API : Positive condition(Set protocol TAPI_SIM_SAP_PROTOCOL_T0) +* @par ID: UTC_TEL_REQ_SAP_TRANSPORT_PROTOCOL_01 +* @param [in] Protocol = TAPI_SIM_SAP_PROTOCOL_T0 +* @param [out] &pRequestId +* @return TAPI_API_SUCCESS +* @par Async Response Message: +* The event associated is below and the event data is #TelSimSapResultCode_t. \n +* - TAPI_EVENT_SIM_SAP_SET_PROTOCOL_CNF +*/ +void utc_tel_req_sap_transport_protocol_01() +{ + TET_STAMP_START("Normal operation : TAPI_SIM_SAP_PROTOCOL_T0"); + TET_RESULT_NOT_EQUAL(TET_UNTESTED,gStartupSuccess, TRUE); + + TelSimSapProtocol_t Protocol=TAPI_SIM_SAP_PROTOCOL_T0; + int pRequestId=0; + int tapiRet = TAPI_API_SUCCESS; +#if 0 // we assume sap connect on. + + // Step 1 : make proper condition + tet_printf("Step 1 : sap connect"); + + if( 0 != sim_sap_process_for_condition(1)) + { + tet_printf("condition set is failed!!"); + return; + } +#endif + gAsyncResult = FALSE; + + tapiRet = tel_req_sap_transport_protocol(Protocol,&pRequestId); + TET_RESULT_NOT_EQUAL(TET_FAIL,TAPI_API_SUCCESS,tapiRet); + + G_MAIN_LOOP_RUN(3); + + TET_RESULT_NOT_EQUAL_GOTO(TET_FAIL,exit,gAsyncResult,TRUE); + TET_RESULT_EQUAL_GOTO(TET_PASS,exit,gAsyncResult,TRUE); + +exit: +#if 0 // we assume sap connect on. + + // Step 3 : make default condition + tet_printf("Step 3 : disconnect sap"); + + if( 0 != sim_sap_process_for_condition(0)) + { + tet_printf("condition set is failed!!"); + } +#endif + gAsyncResult = FALSE; + return; +} + +/** +* @brief tel_req_sap_transport_protocol() API : Positive condition(Set protocol TAPI_SIM_SAP_PROTOCOL_T1) +* @par ID: UTC_TEL_REQ_SAP_TRANSPORT_PROTOCOL_02 +* @param [in] Protocol = TAPI_SIM_SAP_PROTOCOL_T1 +* @param [out] &pRequestId +* @return TAPI_API_SUCCESS +* @par Async Response Message: +* The event associated is below and the event data is #TelSimSapResultCode_t. \n +* - TAPI_EVENT_SIM_SAP_SET_PROTOCOL_CNF +*/ +void utc_tel_req_sap_transport_protocol_02() +{ + TET_STAMP_START("Normal operation : TAPI_SIM_SAP_PROTOCOL_T1"); + TET_RESULT_NOT_EQUAL(TET_UNTESTED,gStartupSuccess, TRUE); + + TelSimSapProtocol_t Protocol=TAPI_SIM_SAP_PROTOCOL_T1; + int pRequestId=0; + int tapiRet = TAPI_API_SUCCESS; +#if 0 // we assume sap connect on. + // Step 1 : make proper condition + tet_printf("Step 1 : sap connect"); + + if( 0 != sim_sap_process_for_condition(1)) + { + tet_printf("condition set is failed!!"); + return; + } +#endif + gAsyncResult = FALSE; + + tapiRet = tel_req_sap_transport_protocol(Protocol,&pRequestId); + TET_RESULT_NOT_EQUAL(TET_FAIL,TAPI_API_SUCCESS,tapiRet); + + G_MAIN_LOOP_RUN(2); + + TET_RESULT_NOT_EQUAL_GOTO(TET_FAIL,exit,gAsyncResult,TRUE); + TET_RESULT_EQUAL_GOTO(TET_PASS,exit,gAsyncResult,TRUE); + +exit: +#if 0 // we assume sap connect on. + // Step 3 : make default condition + tet_printf("Step 3 : disconnect sap"); + + if( 0 != sim_sap_process_for_condition(0)) + { + tet_printf("condition set is failed!!"); + } +#endif + gAsyncResult = FALSE; + return; +} + + +/** +* @brief tel_req_sap_transport_protocol() API : Negative condition(Low boundary test) +* @par ID: UTC_TEL_REQ_SAP_TRANSPORT_PROTOCOL_03 +* @param [in] Protocol = TAPI_SIM_SAP_PROTOCOL_T0-1;// Low boundary +* @param [out] &pRequestId +* @return TAPI_API_INVALID_INPUT +*/ +void utc_tel_req_sap_transport_protocol_03() +{ + TET_STAMP_START("TAPI_API_INVALID_INPUT"); + + TelSimSapProtocol_t Protocol=(TelSimSapProtocol_t)TAPI_SIM_SAP_PROTOCOL_T0-1; + int pRequestId=0; + + TapiResult_t error = tel_req_sap_transport_protocol(Protocol,&pRequestId); + TET_CHECK(TAPI_API_INVALID_INPUT, error); + TET_STAMP_PASS(); +} + +/** +* @brief tel_req_sap_transport_protocol() API : Negative condition(Upper boundary test) +* @par ID: UTC_TEL_REQ_SAP_TRANSPORT_PROTOCOL_04 +* @param [in] Protocol = TAPI_SIM_SAP_PROTOCOL_T1+1;// Upper boundary +* @param [out] &pRequestId +* @return TAPI_API_INVALID_INPUT +*/ +void utc_tel_req_sap_transport_protocol_04() +{ + TET_STAMP_START("TAPI_API_INVALID_INPUT"); + + TelSimSapProtocol_t Protocol=(TelSimSapProtocol_t)TAPI_SIM_SAP_PROTOCOL_T1+1; + int pRequestId=0; + + TapiResult_t error = tel_req_sap_transport_protocol(Protocol,&pRequestId); + TET_CHECK(TAPI_API_INVALID_INPUT, error); + TET_STAMP_PASS(); +} + +/** +* @brief tel_req_sap_transport_protocol() API : Negative condition(Null parameter) +* @par ID: UTC_TEL_REQ_SAP_TRANSPORT_PROTOCOL_04 +* @param [in] Protocol = TAPI_SIM_SAP_PROTOCOL_T1 +* @param [out] &pRequestId = NULL +* @return TAPI_API_INVALID_INPUT +*/ +void utc_tel_req_sap_transport_protocol_05() +{ + TET_STAMP_START("TAPI_API_INVALID_PTR"); + + TelSimSapProtocol_t Protocol= TAPI_SIM_SAP_PROTOCOL_T1; + TapiResult_t error = tel_req_sap_transport_protocol(Protocol,NULL); + TET_CHECK(TAPI_API_INVALID_PTR, error); + TET_STAMP_PASS(); +} + +/** @} */ diff --git a/TC/telephony_TC/sim/unit/uts_tel_req_sap_transport_protocol.h b/TC/telephony_TC/sim/unit/uts_tel_req_sap_transport_protocol.h new file mode 100644 index 0000000..132af0d --- /dev/null +++ b/TC/telephony_TC/sim/unit/uts_tel_req_sap_transport_protocol.h @@ -0,0 +1,31 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * 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 _uts_tel_req_sap_transport_protocol_H +#define _uts_tel_req_sap_transport_protocol_H + + static void utc_tel_req_sap_transport_protocol_01(); + static void utc_tel_req_sap_transport_protocol_02(); + static void utc_tel_req_sap_transport_protocol_03(); + static void utc_tel_req_sap_transport_protocol_04(); + static void utc_tel_req_sap_transport_protocol_05(); + +#endif diff --git a/TC/telephony_TC/sim/unit/uts_tel_req_sim_access.c b/TC/telephony_TC/sim/unit/uts_tel_req_sim_access.c new file mode 100644 index 0000000..6ea944b --- /dev/null +++ b/TC/telephony_TC/sim/unit/uts_tel_req_sim_access.c @@ -0,0 +1,224 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** +* @ingroup TELEPHONY_FRAMEWORK_API +* @addtogroup SIM +*/ + +/** +* @ingroup SIM +* @addtogroup UTS_TEL_REQ_SIM_ACCESS Unit +*/ + +/** +* @ingroup UTS_TEL_REQ_SIM_ACCESS Unit +* @addtogroup UTS_TEL_REQ_SIM_ACCESS_ Uts_Tel_Req_Sim_Access +* @{ +*/ + +/** +* @file uts_tel_req_sim_access.c +* @brief This is a suit of unit test cases to test tel_req_sim_access() API function +* @author Gautam Nand Sinha (gnand.sinha@samsung.com) +* @version Initial Creation Version 0.1 +* @date 2010.06.29 +*/ + + +#include "uts_tel_req_sim_access.h" + + +/* Initialize TCM data structures */ +static void startup(); +static void cleanup(); +void (*tet_startup) () = startup; +void (*tet_cleanup) () = cleanup; +struct tet_testlist tet_testlist[] = { + {utc_tel_req_sim_access_01, 1}, + {utc_tel_req_sim_access_02, 2}, + {utc_tel_req_sim_access_03, 3}, + {NULL, 0} +}; + + + +/* + G_MAIN Utility //////////////////////////////////////////////////////////////////////////// +*/ +// Prototype : User must add function body +gboolean g_timeout_callback (void *data); + +// GMainLoop global handler +GMainLoop *nw_context_loop = NULL; + +void G_MAIN_LOOP_CLOSE() +{ + g_main_loop_quit(nw_context_loop); +} + +int G_MAIN_LOOP_RUN(int sec) +{ + //GMainLoop *mainloop; + nw_context_loop = g_main_loop_new (NULL, FALSE); + g_timeout_add ( (sec * 1000), g_timeout_callback, NULL); + g_main_loop_run (nw_context_loop); + + return 0; +} +// End of G_MAIN Utility////////////////////////////////////////////////////////////////////// + + +/* + User Defined Handler +*/ +// Global variable for user data +static BOOL gAsyncResult; //user defined data : Async callback is called or not +static TelSimPinOperationResult_t gSimEventStatus; + +// G_MAIN Utility : time out callback function +gboolean g_timeout_callback (void *data) +{ + gAsyncResult = FALSE; + tet_printf("[SIM APP][TIME OUT] g_timeout called .Close g_main_roop()"); + G_MAIN_LOOP_CLOSE(); + return FALSE; +} + + +static int sim_app_callback (TelTapiEvent_t *sim_event) +{ + tet_printf("\n\n\n***************[SIM APP]Callback data **********************\n"); + tet_printf("[SIM APP]Reques Id[%d]\n", sim_event->RequestId); + tet_printf("[SIM APP]event status [%d]\n", sim_event->Status); + + gAsyncResult = FALSE; + BOOL bReceived = FALSE; + + switch(sim_event->EventType) + { + case TAPI_EVENT_SIM_RSIM_ACCESS_CNF: + { + tet_printf("\n[SIM APP]*****************TAPI_EVENT_SIM_RSIM_ACCESS_CNF (%d) ***************************\n", TAPI_EVENT_SIM_GET_MAILBOX_CNF); + tet_printf("SIM rsim access event status = [%x]\n", sim_event->Status); + + gSimEventStatus = sim_event->Status; + gAsyncResult = TRUE; + bReceived = TRUE; + } + break; + + default: + { + gSimEventStatus = sim_event->Status; + gAsyncResult = FALSE; + tet_printf("[SIM APP]***************** Undhandled event type [%d] *****************\n",sim_event->EventType); + tet_printf("[SIM APP]Undhandled event state [%d]\n",sim_event->Status); + break; + } + }//end switch + + if (bReceived == TRUE) + G_MAIN_LOOP_CLOSE(); + return 0; +} + + +/* Startup & Clean function : It is not test code, only for + initialize and finalize test module +*/ +static BOOL gStartupSuccess = FALSE; +static unsigned int subscription_id = 0; + +static void startup() +{ + tet_infoline("utc_tel_req_sim_access Test Start\n"); + + if ( tel_init() == TAPI_API_SUCCESS) + { + if (TAPI_API_SUCCESS == tel_register_event(TAPI_EVENT_SIM_RSIM_ACCESS_CNF,&subscription_id,(TelAppCallback)sim_app_callback,NULL) ) + gStartupSuccess = TRUE; + else + tet_infoline("startup fail. tel_register_event() failed"); + } else { + tet_infoline("startup fail. tel_init() failed"); + } + + tel_register_app_name("org.samsung.test"); + return; +} + + +static void cleanup() +{ + tet_infoline("utc_tel_req_sim_access Test Finished\n"); + if (gStartupSuccess == TRUE) + { + tel_deregister_event(subscription_id); + } + tel_deinit(); + return; +} + + +void utc_tel_req_sim_access_01() +{ + TET_STAMP_START("utc_tel_req_sim_access_01"); + + int request=0; + TelSimRSimReq_t sim = {0,}; + sim.file_id = 0x6F60; + sim.rsim_cmd = TAPI_SIM_GET_RESPONSE; + + gAsyncResult = FALSE; + + TET_CHECK(TAPI_API_SUCCESS,tel_req_sim_access(&sim,&request)); + + G_MAIN_LOOP_RUN(2); + TET_RESULT_NOT_EQUAL(TET_FAIL,gAsyncResult,TRUE); // If gAsyncResult != TRUE, then TET_FAIL and return + TET_STAMP_PASS(); + return; +} + + +void utc_tel_req_sim_access_02() +{ + TET_STAMP_START("utc_tel_req_sim_access_02"); + + TelSimRSimReq_t sim = {0,}; + sim.file_id = 0x6F60; + sim.rsim_cmd = TAPI_SIM_GET_RESPONSE; + TET_CHECK(TAPI_API_INVALID_PTR,tel_req_sim_access(&sim,NULL)); + TET_STAMP_PASS(); + return; +} + + +void utc_tel_req_sim_access_03() +{ + TET_STAMP_START("utc_tel_req_sim_access_03"); + + int requestId = 0; + TET_CHECK(TAPI_API_INVALID_PTR,tel_req_sim_access(NULL,&requestId)); + TET_STAMP_PASS(); + return; +} + +/** @} */ diff --git a/TC/telephony_TC/sim/unit/uts_tel_req_sim_access.h b/TC/telephony_TC/sim/unit/uts_tel_req_sim_access.h new file mode 100644 index 0000000..ba9adbb --- /dev/null +++ b/TC/telephony_TC/sim/unit/uts_tel_req_sim_access.h @@ -0,0 +1,62 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** +* @ingroup TELEPHONY_FRAMEWORK_API +* @addtogroup SIM +*/ + +/** +* @ingroup SIM +* @addtogroup UTS_TEL_REQ_SIM_ACCESS Unit +*/ + +/** +* @ingroup UTS_TEL_REQ_SIM_ACCESS Unit +* @addtogroup UTS_TEL_REQ_SIM_ACCESS_ Uts_Tel_Req_Sim_Access +* @{ +*/ + +/** +* @file uts_tel_req_sim_access.h +* @brief This is a suit of unit test cases to test tel_req_sim_access() API function +* @author Gautam Nand Sinha (gnand.sinha@samsung.com) +* @version Initial Creation Version 0.1 +* @date 2010.06.29 +*/ + + + +#include +#include +#include +#include + +#include "tet_tapi_util.h" +#include "sim_common.h" + +#ifndef _UTS_TEL_REQ_SIM_ACCESS_H_ +#define _UTS_TEL_REQ_SIM_ACCESS_H_ + + static void utc_tel_req_sim_access_01 (); + static void utc_tel_req_sim_access_02 (); + static void utc_tel_req_sim_access_03 (); + +#endif diff --git a/TC/telephony_TC/sim/unit/uts_tel_req_sim_isim_authentication.c b/TC/telephony_TC/sim/unit/uts_tel_req_sim_isim_authentication.c new file mode 100644 index 0000000..fbee581 --- /dev/null +++ b/TC/telephony_TC/sim/unit/uts_tel_req_sim_isim_authentication.c @@ -0,0 +1,277 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +/** +* @ingroup TELEPHONY_API +* @addtogroup TAPI_API_SIM_SAT SIM/SAT +*/ + +/** +* @ingroup TAPI_API_SIM_SAT +* @addtogroup UTS_SIM_SAT Unit +*/ + +/** +* @ingroup UTS_SIM_SAT +* @addtogroup UTS_TAPI_SIM_SAP_AUTH tel_req_sim_isim_authentication +* +* @brief Unit test code for tel_req_sim_isim_authentication() +* @par Test function Prototype: +* TapiResult_t tel_req_sim_isim_authentication(TelSimIsimAuthenticationData_t* AuthReqData, int *pRequestId); +* @par Test function description: +* This function is a used to do the authentication proceedure of ISIM for IMS application +* @par Important Notes: +* None +* @param [in] AuthReqData +* ISIM Authentication data.(auth_req_data - authentication data to be verified.) +* @code +// GBA(Generic Bootstrapping architecture) Boot strapping parameters. +// This is used for IMS Authentication proceedure. +typedef struct +{ + UINT8 RandomAccessLength; // ISIM random access length + UINT8 AuthDataLength; // ISIM Boot straping transaction ID len + UINT8 RandomAccessData[TAPI_SIM_ISIM_AUTH_MAX_REQ_DATA_LEN]; // ISIM random data + UINT8 AuthData[TAPI_SIM_ISIM_AUTH_MAX_REQ_DATA_LEN]; // ISIM autherisation data +}TelSimIsimAuthenticationData_t; +* @endcode +* @param [out] pRequestId +* - Unique identifier for a particular request. +* - request_id value can be any value from 0 to 255 if the API is returned successfully +* - -1 (INVALID_REQUEST_ID) will be sent in case of failure. +* @par Async Response Message: +* The event associated is below and the event data is #TelSimIsimAuthenticationResponse_t. \n +* - TAPI_EVENT_SIM_ISIM_AUTHENTICATION_CNF +* @pre +* SAP supported sim used to testing +* @post +* None +* @return +* Return Type : (TapiResult_t) +* - TAPI_API_SUCCESS - indicating that the operation has completed successfully. +* - Otherwise it provides an error code (Refer #TapiResult_t) +* @{ +*/ + +/** +* @file uts_tel_req_sim_isim_authentication.c +* @brief Test for the tel_req_sim_isim_authentication() API that is used to isim authentication request +* @author +* @version Initial Creation V0.1 +* @date 2008.07.30 +*/ + + +#include +#include +#include + +#include "tet_tapi_util.h" +#include "uts_tel_req_sim_isim_authentication.h" +#include "sim_common.h" + + + +/* Initialize TCM data structures */ +static void startup(); +static void cleanup(); +void (*tet_startup) () = startup; +void (*tet_cleanup) () = cleanup; +struct tet_testlist tet_testlist[] = { + {utc_tel_req_sim_isim_authentication_01, 1}, + {utc_tel_req_sim_isim_authentication_02, 2}, + {NULL, 0} +}; + + +/* + G_MAIN Utility //////////////////////////////////////////////////////////////////////////// +*/ +// Prototype : User must add function body +gboolean g_timeout_callback (void *data); + +// GMainLoop global handler +GMainLoop *nw_context_loop = NULL; + +void G_MAIN_LOOP_CLOSE() +{ + g_main_loop_quit(nw_context_loop); +} + +int G_MAIN_LOOP_RUN(int sec) +{ + //GMainLoop *mainloop; + nw_context_loop = g_main_loop_new (NULL, FALSE); + g_timeout_add ( (sec * 1000), g_timeout_callback, NULL); + g_main_loop_run (nw_context_loop); + + return 0; +} +// End of G_MAIN Utility////////////////////////////////////////////////////////////////////// + + +/* + User Defined Handler +*/ +// Global variable for user data +static BOOL gAsyncResult; //user defined data : Async callback is called or not + +// G_MAIN Utility : time out callback function +gboolean g_timeout_callback (void *data) +{ + gAsyncResult = FALSE; + tet_printf("[SIM APP][TIME OUT] g_timeout called .Close g_main_roop()"); + G_MAIN_LOOP_CLOSE(); + return FALSE; +} + +static int sim_app_callback (TelTapiEvent_t *sim_event) +{ + tet_printf("\n\n\n***************[SIM APP]Callback data **********************\n"); + tet_printf("[SIM APP]Reques Id[%d]\n", sim_event->RequestId); + tet_printf("[SIM APP]event status [%d]\n", sim_event->Status); + + gAsyncResult = FALSE; + BOOL bReceived = FALSE; + + switch(sim_event->EventType) + { + + case TAPI_EVENT_SIM_ISIM_AUTHENTICATION_CNF: + { + tet_printf("\n[SIM APP]*****************TAPI_EVENT_SIM_ISIM_AUTHENTICATION_CNF***************************\n"); + gAsyncResult = TRUE; + bReceived = TRUE; + } + break; + + default: + { + bReceived = TRUE; + gAsyncResult = FALSE; + tet_printf(" TAPI_EVENT_SIM_ISIM_AUTHENTICATION_CNF = %d", TAPI_EVENT_SIM_ISIM_AUTHENTICATION_CNF); + tet_printf("[SIM APP]***************** Undhandled event type [%d] *****************\n",sim_event->EventType); + tet_printf("[SIM APP]Undhandled event state [%d]\n",sim_event->Status); + break; + } + }//end switch + + if (bReceived == TRUE) + G_MAIN_LOOP_CLOSE(); + + return 0; +} + + +/* Startup & Clean function : It is not test code, only for + initialize and finalize test module +*/ +static BOOL gStartupSuccess = FALSE; +static unsigned int subscription_id = 0; + +static void startup() +{ + tet_infoline("uts_tel_req_sim_isim_authentication Test Start"); + if ( tel_init() == TAPI_API_SUCCESS) + { + if (TAPI_API_SUCCESS == tel_register_event(TAPI_EVENT_SIM_ISIM_AUTHENTICATION_CNF,&subscription_id,(TelAppCallback)sim_app_callback,NULL) ) + gStartupSuccess = TRUE; + else + tet_infoline("startup fail. tel_register_event() failed"); + } else { + tet_infoline("startup fail. tel_init() failed"); + } + tel_register_app_name("org.samsung.test"); + return; +} + + +static void cleanup() +{ + tet_infoline("uts_tel_req_sim_isim_authentication Finished"); + if (gStartupSuccess == TRUE) + { + tel_deregister_event(subscription_id); + } + tel_deinit(); + return; +} + + +/* + Unit Test Case functions +*/ + +/** +* @brief tel_req_sim_isim_authentication() API : Negative condition(Parameter is Null) +* @par ID: UTC_TEL_REQ_SIM_ISIM_AUTHENTICATION_01 +* @param [in] pAuthenticationData +* @param [out] &pRequestId = NULL +* @return TAPI_API_INVALID_PTR +*/ +void utc_tel_req_sim_isim_authentication_01() +{ + TET_STAMP_START("NULL Test 1"); + TelSimIsimAuthenticationData_t pAuthenticationData; + + tet_printf(" Enter RAND data \n"); + strcpy((char*)pAuthenticationData.RandomAccessData, "username@operator.com"); + pAuthenticationData.RandomAccessLength= strlen("username@operator.com"); + + tet_printf(" Enter Authentication data \n"); + strcpy((char*)pAuthenticationData.AuthData, "+1-212-555-12345"); + pAuthenticationData.AuthDataLength = strlen("+1-212-555-12345"); + + /* Calling TAPI API */ + TapiResult_t err = tel_req_sim_isim_authentication(&pAuthenticationData,NULL); + tet_printf("%s[%d] %s(): error code =%d [%s] ",__FILE__,__LINE__,__FUNCTION__, err, TET_ERROR_TO_STRING(err) ); + if (err == TAPI_API_INVALID_PTR ) + TET_STAMP_PASS(); + else if ( err == TAPI_API_NOT_SUPPORTED ) + TET_STAMP(TET_NOTINUSE); + else + TET_STAMP_FAIL(); +} + +/** +* @brief tel_req_sim_isim_authentication() API : Negative condition(Parameter is Null) +* @par ID: UTC_TEL_REQ_SIM_ISIM_AUTHENTICATION_02 +* @param [in] pAuthenticationData = NULL +* @param [out] &pRequestId +* @return TAPI_API_INVALID_PTR +*/ +void utc_tel_req_sim_isim_authentication_02() +{ + TET_STAMP_START("NULL Test 2"); + int pRequestId=0; + + /* Calling TAPI API */ + TapiResult_t err = tel_req_sim_isim_authentication(NULL,&pRequestId); + tet_printf("%s[%d] %s(): error code =%d [%s] ",__FILE__,__LINE__,__FUNCTION__, err, TET_ERROR_TO_STRING(err) ); + if (err == TAPI_API_INVALID_PTR ) + TET_STAMP_PASS(); + else if ( err == TAPI_API_NOT_SUPPORTED ) + TET_STAMP(TET_NOTINUSE); + else + TET_STAMP_FAIL(); +} + +/** @} */ diff --git a/TC/telephony_TC/sim/unit/uts_tel_req_sim_isim_authentication.h b/TC/telephony_TC/sim/unit/uts_tel_req_sim_isim_authentication.h new file mode 100644 index 0000000..749a7f0 --- /dev/null +++ b/TC/telephony_TC/sim/unit/uts_tel_req_sim_isim_authentication.h @@ -0,0 +1,29 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * 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 _uts_tapi_isim_auth_req_H_ +#define _uts_tapi_isim_auth_req_H_ + + static void utc_tel_req_sim_isim_authentication_01(); + static void utc_tel_req_sim_isim_authentication_02(); + +#endif + diff --git a/TC/telephony_TC/sim/unit/uts_tel_set_sim_language.c b/TC/telephony_TC/sim/unit/uts_tel_set_sim_language.c new file mode 100644 index 0000000..5cb66c9 --- /dev/null +++ b/TC/telephony_TC/sim/unit/uts_tel_set_sim_language.c @@ -0,0 +1,199 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * 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 "tet_tapi_util.h" +#include "sim_common.h" +#include "uts_tel_set_sim_language.h" + + +/* Initialize TCM data structures */ +static void startup(); +static void cleanup(); +void (*tet_startup) () = startup; +void (*tet_cleanup) () = cleanup; + +struct tet_testlist tet_testlist[] = { + {utc_tel_set_sim_language_01, 1}, + {utc_tel_set_sim_language_02, 2}, + {NULL, 0} +}; + + +/* + G_MAIN Utility //////////////////////////////////////////////////////////////////////////// +*/ +// Prototype : User must add function body +gboolean g_timeout_callback (void *data); + +// GMainLoop global handler +GMainLoop *nw_context_loop = NULL; + +void G_MAIN_LOOP_CLOSE() +{ + g_main_loop_quit(nw_context_loop); +} + +int G_MAIN_LOOP_RUN(int sec) +{ + //GMainLoop *mainloop; + nw_context_loop = g_main_loop_new (NULL, FALSE); + g_timeout_add ( (sec * 1000), g_timeout_callback, NULL); + g_main_loop_run (nw_context_loop); + + return 0; +} +// End of G_MAIN Utility////////////////////////////////////////////////////////////////////// + + +/* + User Defined Handler +*/ +// Global variable for user data +static BOOL gAsyncResult; //user defined data : Async callback is called or not + +// G_MAIN Utility : time out callback function +gboolean g_timeout_callback (void *data) +{ + gAsyncResult = FALSE; + tet_printf("[SIM APP][TIME OUT] g_timeout called .Close g_main_roop()"); + G_MAIN_LOOP_CLOSE(); + return FALSE; +} + +static int sim_app_callback (TelTapiEvent_t *sim_event) +{ + tet_printf("\n\n\n***************[SIM APP]Callback data **********************\n"); + tet_printf("[SIM APP]Reques Id[%d]\n", sim_event->RequestId); + tet_printf("[SIM APP]event status [%d]\n", sim_event->Status); + + gAsyncResult = FALSE; + BOOL bReceived = FALSE; + + switch(sim_event->EventType) + { + + case TAPI_EVENT_SIM_SET_LANGUAGE_CNF: + { + tet_printf("\n[SIM APP]***************TAPI_EVENT_SIM_SET_LANGUAGE_CNF*****************************\n"); + tet_printf("SIM Disable PIN event status = [%x]\n", sim_event->Status); + + bReceived = TRUE; + if(sim_event->Status == TAPI_SIM_PIN_OPERATION_SUCCESS) + gAsyncResult = TRUE; + else + gAsyncResult = FALSE; + } + break; + + default: + { + bReceived = TRUE; + gAsyncResult = FALSE; + tet_printf("[SIM APP]***************** Undhandled event type [%d] *****************\n",sim_event->EventType); + tet_printf("[SIM APP]Undhandled event state [%d]\n",sim_event->Status); + } + break; + }//end switch + + if (bReceived == TRUE) + G_MAIN_LOOP_CLOSE(); + + return 0; +} + + +/* Startup & Clean function : It is not test code, only for + initialize and finalize test module +*/ +static BOOL gStartupSuccess = FALSE; +static unsigned int subscription_id = 0; + +static void startup() +{ + tet_infoline("utc_tel_set_sim_language Test Start\n"); + if ( tel_init() == TAPI_API_SUCCESS) + { + if ( TAPI_API_SUCCESS == tel_register_event(TAPI_EVENT_SIM_SET_LANGUAGE_CNF,&subscription_id,(TelAppCallback)sim_app_callback, NULL) ) + gStartupSuccess = TRUE; + else + tet_infoline("startup fail. tel_register_event() failed"); + } else { + tet_infoline("startup fail. tel_init() failed"); + } + tel_register_app_name("org.samsung.test"); + + return; +} + + +static void cleanup() +{ + tet_infoline("utc_tel_set_sim_langauge Test Finished\n"); + + if (gStartupSuccess == TRUE) + { + tel_deregister_event(subscription_id); + } + tel_deinit(); + return; +} + + +/* + Unit Test Case functions +*/ + + +void utc_tel_set_sim_language_01() +{ + TET_STAMP_START("utc_tel_set_sim_language_01"); + + TelSimLanguagePreferenceCode_t language = 0x00; + TET_CHECK(TAPI_API_INVALID_PTR,tel_set_sim_language(language,NULL)); + TET_STAMP_PASS(); + return; +} + + +void utc_tel_set_sim_language_02() +{ + TET_STAMP_START("utc_tel_set_sim_language_02"); + + TelSimLanguagePreferenceCode_t language = 0x00; + int req_id = 0; + + gAsyncResult = FALSE; + + TET_CHECK(TAPI_API_SUCCESS,tel_set_sim_language(language,&req_id)); + + G_MAIN_LOOP_RUN(2); + TET_RESULT_NOT_EQUAL(TET_FAIL,gAsyncResult,TRUE); // If gAsyncResult != TRUE, then TET_FAIL and return + TET_STAMP_PASS(); + return; +} + +/** @} */ diff --git a/TC/telephony_TC/sim/unit/uts_tel_set_sim_language.h b/TC/telephony_TC/sim/unit/uts_tel_set_sim_language.h new file mode 100644 index 0000000..3fd22aa --- /dev/null +++ b/TC/telephony_TC/sim/unit/uts_tel_set_sim_language.h @@ -0,0 +1,27 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * 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 _UTS_TEL_SET_SIM_LANGUAGE_H +#define _UTS_TEL_SET_SIM_LANGUAGE_H + + static void utc_tel_set_sim_language_01(); + static void utc_tel_set_sim_language_02(); +#endif diff --git a/TC/telephony_TC/sim/unit/uts_tel_update_sim_pb_record.c b/TC/telephony_TC/sim/unit/uts_tel_update_sim_pb_record.c new file mode 100644 index 0000000..188cebf --- /dev/null +++ b/TC/telephony_TC/sim/unit/uts_tel_update_sim_pb_record.c @@ -0,0 +1,519 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +/** +* @ingroup TELEPHONY_API +* @addtogroup TAPI_API_SIM_SAT SIM/SAT +*/ + +/** +* @ingroup TAPI_API_SIM_SAT +* @addtogroup UTS_SIM_SAT Unit +*/ + +/** +* @ingroup UTS_SIM_SAT +* @addtogroup UTS_TAPI_SIM_PB_UPDATE_RECORD tel_update_sim_pb_record +* +* @brief Unit test code for tel_update_sim_pb_record() +* @par Test function Prototype: +* TapiResult_t tel_update_sim_pb_record(const TelSimPbRecordData_t* pPbRecordData, int* pRequestId); +* @par Test function description: +* This API is used to add or edit SIM phone book record entry information. +* @par Important Notes: +* GSM 7 Bit or Unicode conversion required to make record data +* - GSM 7 Bit conversion +* @code +BOOL oem_encode_gsm_7_bit_chars (char text_len, const char* text_data,char *out_len_max, char* gsm7bit_text ) +{ + int i; + int pos; + UINT16 shift = 0; + + for( pos = 0, i = 0; i < text_len; pos++, i++ ) + { + // pack the low bits - for single char + gsm7bit_text[pos] = text_data[i] >> shift; + + if ( i + 1 < text_len ) + { + // pack the high bits using the low bits of the next character + gsm7bit_text[pos] |= text_data[i+1] << ( 7 - shift ); + shift++; + if( shift == 7 ) + { + shift = 0; + i++; + } + } + } + *out_len_max = (text_len* 7 )/8; + return pos; +} +* @endcode +* - Unicode conversion +* @code +BOOL +oem_encode_text_unicode(char text_len, char *text_data,char *unicode_text_len,char *unicode_text) +{ + int j,i; + i = j = 0; + + if(text_len == 0) + { + tet_printf(LEVEL_ERR,"Unicode encoding failed - input text string length is 0!"); + return FALSE; + } + // UNicode conversion + // a = Ascii is 61 and in Unicode it is 0061 but modem expects 6100 + for(j= 0,i = 0;i +#include +#include + +#include "tet_tapi_util.h" +#include "uts_tel_update_sim_pb_record.h" +#include "sim_common.h" + +/* Initialize TCM data structures */ +static void startup(); +static void cleanup(); +void (*tet_startup) () = startup; +void (*tet_cleanup) () = cleanup; +struct tet_testlist tet_testlist[] = { + {utc_tel_update_sim_pb_record_01, 1}, + {utc_tel_update_sim_pb_record_02, 2}, + {utc_tel_update_sim_pb_record_03, 3}, + {utc_tel_update_sim_pb_record_04, 4}, + {utc_tel_update_sim_pb_record_05, 5}, + {NULL, 0} +}; + +/* + User Defined Handler +*/ +// Global variable for user data +static BOOL gAsyncResult; //user defined data : Async callback is called or not + +static BOOL gStartupSuccess = FALSE; +static unsigned int subscription_id = 0; + + + +/* + G_MAIN Utility //////////////////////////////////////////////////////////////////////////// +*/ + +// Prototype : User must add function body +gboolean g_timeout_callback(void *data); + +// GMainLoop global handler +GMainLoop *sim_loop = NULL; + +void G_MAIN_LOOP_CLOSE() +{ + g_main_loop_quit(sim_loop); +} + +int G_MAIN_LOOP_RUN(int sec) +{ + sim_loop = g_main_loop_new (NULL, FALSE); + g_timeout_add ( (sec * 1000), g_timeout_callback, NULL); + g_main_loop_run (sim_loop); + + return 0; +} + +gboolean g_timeout_callback (void *data) +{ + gAsyncResult = FALSE; + tet_printf("[TIME OUT] g_timeout called .Close g_main_roop()"); + G_MAIN_LOOP_CLOSE(); + return FALSE; +} +// End of G_MAIN Utility////////////////////////////////////////////////////////////////////// + + +static int sim_app_callback (TelTapiEvent_t *sim_event) +{ + tet_printf("\n***************[SIM APP]Callback data **********************\n"); + tet_printf("[SIM]Reques Id[%d]\n", sim_event->RequestId); + tet_printf("[SIM]event status [%d]\n", sim_event->Status); + + gAsyncResult = FALSE; + BOOL bReceived = FALSE; + + switch(sim_event->EventType) + { + case TAPI_EVENT_SIM_PB_UPDATE_CNF: + { + tet_printf("[SIM]*****************TAPI_EVENT_SIM_PB_UPDATE_CNF***************************"); + tet_printf("SIM Delete PB event status = [%x]", sim_event->Status); + + //TelSimPbUpdateResp_t *pUpdateResp = (TelSimPbUpdateResp_t *)sim_event->pData; + // tet_printf(" index [%d]\n",pUpdateResp->PbIndex); + // tet_printf(" storage type [%d]\n",pUpdateResp->PbStorageInfo.StorageFileType); + tet_printf("*******************************************"); + gAsyncResult = TRUE; + bReceived = TRUE; + } + break; + + default: + { + bReceived = TRUE; + gAsyncResult = FALSE; + tet_printf("Info : TAPI_EVENT_SIM_PB_DELETE_CNF = %d", TAPI_EVENT_SIM_PB_DELETE_CNF); + tet_printf("[SIM]***************** Undhandled event type [%d] *****************\n",sim_event->EventType); + tet_printf("[SIM]Undhandled event state [%d]\n",sim_event->Status); + break; + } + }//end switch + + if (bReceived == TRUE) + G_MAIN_LOOP_CLOSE(); + + return 0; +} + + +static void startup() +{ + tet_infoline("utc_tel_update_sim_pb_record Test Start"); + + if ( tel_init() == TAPI_API_SUCCESS) + { + if (TAPI_API_SUCCESS == tel_register_event(TAPI_EVENT_SIM_PB_UPDATE_CNF,&subscription_id,(TelAppCallback)sim_app_callback,NULL)) + gStartupSuccess = TRUE; + else + tet_infoline("startup fail. tel_register_event() failed"); + } else { + tet_infoline("startup fail. tel_init() failed"); + } + tel_register_app_name("org.samsung.test"); + return; +} + + +static void cleanup() +{ + tet_infoline("utc_tel_update_sim_pb_record Finished"); + + if (gStartupSuccess == TRUE) + { + tel_deregister_event(subscription_id); + } + tel_deinit(); + + return; +} + + +/* Utility function +*/ +BOOL oem_encode_gsm_7_bit_chars (char text_len, const char* text_data,char *out_len_max, char* gsm7bit_text ) +{ + int i; + int pos; + UINT16 shift = 0; + + for( pos = 0, i = 0; i < text_len; pos++, i++ ) + { + /* pack the low bits - for single char */ + gsm7bit_text[pos] = text_data[i] >> shift; + + if ( i + 1 < text_len ) + { + /* pack the high bits using the low bits of the next character */ + gsm7bit_text[pos] |= text_data[i+1] << ( 7 - shift ); + + shift++; + + if( shift == 7 ) + { + shift = 0; + i++; + } + } + } + *out_len_max = (text_len* 7 )/8; + + /* done */ + return pos; + +} + +BOOL oem_encode_text_unicode(char text_len, char *text_data,char *unicode_text_len,char *unicode_text) +{ + int j,i; + i = j = 0; + + if(text_len == 0) + { + tet_printf("Unicode encoding failed - input text string length is 0!"); + return FALSE; + } + /*UNicode conversion*/ + /* a = Ascii is 61 and in Unicode it is 0061 but modem expects 6100 */ + for(j= 0,i = 0;i + * + * 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 _UTS_TAPI_PB_REC_MODIFY_ACCESS_H_ +#define _UTS_TAPI_PB_REC_MODIFY_ACCESS_H_ + + static void utc_tel_update_sim_pb_record_01 (); + static void utc_tel_update_sim_pb_record_02 (); + static void utc_tel_update_sim_pb_record_03 (); + static void utc_tel_update_sim_pb_record_04 (); + static void utc_tel_update_sim_pb_record_05 (); +#endif diff --git a/TC/telephony_TC/sim/unit/uts_tel_verifiy_sim_pins.c b/TC/telephony_TC/sim/unit/uts_tel_verifiy_sim_pins.c new file mode 100644 index 0000000..ae5a9b9 --- /dev/null +++ b/TC/telephony_TC/sim/unit/uts_tel_verifiy_sim_pins.c @@ -0,0 +1,366 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + + +/** +* @ingroup TELEPHONY_API +* @addtogroup TAPI_API_SIM_SAT SIM/SAT +*/ + +/** +* @ingroup TAPI_API_SIM_SAT +* @addtogroup UTS_SIM_SAT Unit +*/ + +/** +* @ingroup UTS_SIM_SAT +* @addtogroup UTS_TAPI_SIM_VERIFY_PIN tel_verifiy_sim_pins +* +* @brief Unit test code for tel_verifiy_sim_pins() +* @par Test function Prototype: +* TapiResult_t tel_verifiy_sim_pins(const TelSimPinData_t *pPinData, int *pRequestId); +* @par Test function description: +* This function performs PIN verification. This function performs PIN verification based +* on the pin type passed along with pin data +* @par Important Notes: +* This API is used only Boot time. You will used other API set(tel_change_sim_pins(), etc) when boot finished +* @param [in] pPinData PIN code, entered by the user. +* @code + typedef struct + { + TelSimPinType_t pinType; // Pin type + char szPinCode[TAPI_SIM_PIN_LENGTH+1]; // PIN code + } TelSimPinData_t; + typedef enum + { + TAPI_SIM_PTYPE_PIN1, + TAPI_SIM_PTYPE_PIN2, + TAPI_SIM_PTYPE_PUK1, + TAPI_SIM_PTYPE_PUK2, + TAPI_SIM_PTYPE_UPIN, + TAPI_SIM_PTYPE_ADM + } TelSimPinType_t; +* @endcode +* @param [out] pRequestId Unique identifier for a particular request. +* - request_id value can be any value from 0 to 255 if the API is returned successfully +* - -1 (INVALID_REQUEST_ID) will be sent in case of failure. +* @par Async Response Message: +* The event associated is below and the event data is #TelSimPinInfo_t. \n +* ( Asynchronous return status is indicated by #TelSimPinOperationResult_t.) +* - TAPI_EVENT_SIM_VERIFY_PIN_CNF(API_SIM_PIN_OPERATION_SUCCESS) +* @pre +* - Before test script compile, you set correct PIN1_NORMAL, PIN2_NORMAL, PIN1_CHANGED, PIN2_CHANGED value on 'tet_tapi_util.h' +* - Before test script compile, you set incorrect PIN1_INCORRECT value on 'tet_tapi_util.h' +* @post +* None +* @return +* Return Type : (TapiResult_t) +* - TAPI_API_SUCCESS - indicating that the operation has completed successfully. +* - Otherwise it provides an error code (Refer #TapiResult_t) +* @{ +*/ + +/** +* @file uts_tel_verifiy_sim_pins.c +* @brief Test for the tel_verifiy_sim_pins() API that is used to verify pin code +* @author +* @version Initial Creation V0.1 +* @date 2008.07.30 +*/ + +#include +#include +#include + +#include "tet_tapi_util.h" +#include "sim_common.h" +#include "uts_tel_verifiy_sim_pins.h" +#include "async_util.h" + + +/* Initialize TCM data structures */ +static void startup(); +static void cleanup(); +void (*tet_startup) () = startup; +void (*tet_cleanup) () = cleanup; +struct tet_testlist tet_testlist[] = { + {utc_tel_verifiy_sim_pins_01, 1}, + {utc_tel_verifiy_sim_pins_02, 2}, + {utc_tel_verifiy_sim_pins_03, 3}, + {utc_tel_verifiy_sim_pins_04, 4}, + {NULL, 0} +}; + +/* + User Defined Handler +*/ +// Global variable for user data +static BOOL gAsyncResult; //user defined data : Async callback is called or not + +/* Startup & Clean function : It is not test code, only for + initialize and finalize test module +*/ +static BOOL gStartupSuccess = FALSE; +static unsigned int subscription_id = 0; + +extern sim_info_t g_si; + +/* + G_MAIN Utility //////////////////////////////////////////////////////////////////////////// +*/ +// Prototype : User must add function body +gboolean g_timeout_callback (void *data); + +// GMainLoop global handler +GMainLoop *sim_loop = NULL; + +void G_MAIN_LOOP_CLOSE() +{ + g_main_loop_quit(sim_loop); +} + +int G_MAIN_LOOP_RUN(int sec) +{ + sim_loop = g_main_loop_new (NULL, FALSE); + g_timeout_add ( (sec * 1000), g_timeout_callback, NULL); + g_main_loop_run (sim_loop); + + return 0; +} + +gboolean g_timeout_callback (void *data) +{ + gAsyncResult = FALSE; + tet_printf("[TIME OUT] g_timeout called .Close g_main_roop()"); + G_MAIN_LOOP_CLOSE(); + return FALSE; +} +// End of G_MAIN Utility////////////////////////////////////////////////////////////////////// + + +static int sim_app_callback (TelTapiEvent_t *sim_event) +{ + tet_printf("\n***************[SIM APP]Callback data **********************\n"); + tet_printf("[SIM]Reques Id[%d]\n", sim_event->RequestId); + tet_printf("[SIM]event status [%d]\n", sim_event->Status); + + gAsyncResult = FALSE; + BOOL bReceived = FALSE; + + switch(sim_event->EventType) + { + case TAPI_EVENT_SIM_VERIFY_SEC_CNF: + { + tet_printf("\n[SIM]*****************TAPI_EVENT_SIM_VERIFY_SEC_CNF***************************\n"); + + //TelSimPinInfo_t *pPinInfo = (TelSimPinInfo_t*)sim_event->pData; + tet_printf("SIM Verify PIN event status = [%x]\n", sim_event->Status); + + if(sim_event->Status == TAPI_SIM_PIN_OPERATION_SUCCESS) + { + tet_printf("PIN2 Vefication Success!"); + + } + else + { + tet_printf("PIN1 Verification Failed! - PIN Required \n"); + //tet_printf("Remainint attempts [%d]\n", pPinInfo->RemainingAttempts); + } + bReceived = TRUE; + gAsyncResult = TRUE; + } + break; + + case TAPI_EVENT_SIM_ENABLE_SEC_CNF: + { + tet_printf("\n[SIM]*****************TAPI_EVENT_SIM_ENABLE_SEC_CNF***************************\n"); + //TelSimPinInfo_t *pPinInfo = (TelSimPinInfo_t*)sim_event->pData; + + tet_printf("SIM Enable PIN event status = [%x]\n", sim_event->Status); + bReceived = TRUE; + if(sim_event->Status == TAPI_SIM_PIN_OPERATION_SUCCESS) + gAsyncResult = TRUE; + else + gAsyncResult = FALSE; + + + } + break; + + case TAPI_EVENT_SIM_DISABLE_SEC_CNF: + { + tet_printf("\n[SIM]*****************TAPI_EVENT_SIM_DISABLE_SEC_CNF***************************\n"); + //TelSimPinInfo_t *pPinInfo = (TelSimPinInfo_t*)sim_event->pData; + + tet_printf("SIM Disable PIN event status = [%x]\n", sim_event->Status); + + bReceived = TRUE; + if(sim_event->Status == TAPI_SIM_PIN_OPERATION_SUCCESS) + gAsyncResult = TRUE; + else + gAsyncResult = FALSE; + } + break; + + default: + { + bReceived = TRUE; + gAsyncResult = FALSE; + tet_printf("Info : TAPI_EVENT_SIM_DISABLE_SEC_CNF = %d", TAPI_EVENT_SIM_DISABLE_SEC_CNF); + tet_printf("[SIM]***************** Undhandled event type [%d] *****************\n",sim_event->EventType); + tet_printf("[SIM]Undhandled event state [%d]\n",sim_event->Status); + } + break; + }//end switch + + if (bReceived == TRUE) + G_MAIN_LOOP_CLOSE(); + + return 0; +} + + +static void startup() +{ + tet_infoline("utc_tel_verifiy_sim_pins Test Start\n"); + + sim_pin_info_setup(); + + if ( tel_init() == TAPI_API_SUCCESS) + { + if ( (TAPI_API_SUCCESS == tel_register_event(TAPI_EVENT_SIM_VERIFY_SEC_CNF,&subscription_id,(TelAppCallback)sim_app_callback,NULL) ) || (TAPI_API_SUCCESS == tel_register_event(TAPI_SIM_PIN_OPERATION_SUCCESS,&subscription_id,(TelAppCallback)sim_app_callback,NULL) ) ) + gStartupSuccess = TRUE; + else + tet_infoline("startup fail. tel_register_event() failed"); + } else { + tet_infoline("startup fail. tel_init() failed"); + } + tel_register_app_name("org.samsung.test"); + + return; +} + + +static void cleanup() +{ + tet_infoline("utc_tel_verifiy_sim_pins Test Finished\n"); + + // Disable pin with correct PWD + TelSimSecPw_t pPinData; + int pRequestId=0; + pPinData.type=TAPI_SIM_PTYPE_PIN1; + + pPinData.pw = (unsigned char*)g_si.pin1; + pPinData.pw_len =strlen(g_si.pin1) ; + tel_disable_sim_security(&pPinData,&pRequestId); + + if (gStartupSuccess == TRUE) + { + tel_deregister_event(subscription_id); + } + tel_deinit(); + + return; +} + + +/* + Unit Test Case functions +*/ + +/** +* @brief tel_verifiy_sim_pins() API : Negative condition(Parameter is Null) +* @par ID: UTC_TEL_VERIFY_SIM_PUKS_01 +* @param [in] &pPinData +* @param [out]&pRequestId = NULL +* @return TAPI_API_INVALID_PTR +*/ +void utc_tel_verifiy_sim_pins_01() +{ + TET_STAMP_START("TAPI_API_INVALID_PTR"); + TelSimSecPw_t pPinData; + pPinData.type=TAPI_SIM_PTYPE_PIN1; + pPinData.pw = (unsigned char*)g_si.pin1; + pPinData.pw_len =strlen(g_si.pin1) ; + TET_CHECK(TAPI_API_INVALID_PTR, tel_verifiy_sim_pins(&pPinData, NULL)); + TET_STAMP_PASS(); +} + +/** +* @brief tel_verifiy_sim_pins() API : Negative condition(Parameter is Null) +* @par ID: UTC_TEL_VERIFY_SIM_PUKS_02 +* @param [in] &pPinData = NULL +* @param [out]&pRequestId +* @return TAPI_API_INVALID_PTR +*/ +void utc_tel_verifiy_sim_pins_02() +{ + TET_STAMP_START("TAPI_API_INVALID_PTR"); + int RequestId; + TelSimSecPw_t pPinData; + pPinData.type=TAPI_SIM_PTYPE_PIN1; + pPinData.pw = (unsigned char*)g_si.pin1; + pPinData.pw_len =strlen(g_si.pin1) ; + + TET_CHECK(TAPI_API_INVALID_PTR, tel_verifiy_sim_pins(NULL,&RequestId)); + TET_STAMP_PASS(); +} + +/** +* @brief tel_verifiy_sim_pins() API : Negative condition(Low boundary test) +* @par ID: UTC_TEL_VERIFY_SIM_PUKS_03 +* @param [in] &pPinData.PinType = (TelSimPinType_t)TAPI_SIM_PTYPE_PIN1-1; +* @param [out]&pRequestId +* @return TAPI_API_INVALID_PTR +*/ +void utc_tel_verifiy_sim_pins_03() +{ + TET_STAMP_START("TAPI_API_INVALID_INPUT"); + int RequestId; + TelSimSecPw_t pPinData = {0,}; + pPinData.type = (TelSimPinType_t)TAPI_SIM_PTYPE_PIN1-1; + pPinData.pw = (unsigned char*)g_si.pin1; + pPinData.pw_len =strlen(g_si.pin1) ; + TET_CHECK(TAPI_API_INVALID_INPUT, tel_verifiy_sim_pins(&pPinData, &RequestId)); + TET_STAMP_PASS(); +} + +/** +* @brief tel_verifiy_sim_pins() API : Negative condition(Upper boundary test) +* @par ID: UTC_TEL_VERIFY_SIM_PUKS_04 +* @param [in] &pPinData.PinType = (TelSimPinType_t)TAPI_SIM_PTYPE_SIM+1; +* @param [out]&pRequestId +* @return TAPI_API_INVALID_PTR +*/ +void utc_tel_verifiy_sim_pins_04() +{ + TET_STAMP_START("TAPI_API_INVALID_INPUT"); + int RequestId; + TelSimSecPw_t pPinData; + pPinData.type = (TelSimPinType_t)TAPI_SIM_PTYPE_SIM+1; + pPinData.pw = (unsigned char*)g_si.pin1; + pPinData.pw_len =strlen(g_si.pin1) ; + + TET_CHECK(TAPI_API_INVALID_INPUT, tel_verifiy_sim_pins(&pPinData, &RequestId)); + TET_STAMP_PASS(); +} + +/** @} */ diff --git a/TC/telephony_TC/sim/unit/uts_tel_verifiy_sim_pins.h b/TC/telephony_TC/sim/unit/uts_tel_verifiy_sim_pins.h new file mode 100644 index 0000000..65c885c --- /dev/null +++ b/TC/telephony_TC/sim/unit/uts_tel_verifiy_sim_pins.h @@ -0,0 +1,29 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * 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 _UTS_TEL_VERIFIY_SIM_PINS_H +#define _UTS_TEL_VERIFIY_SIM_PINS_H + + static void utc_tel_verifiy_sim_pins_01(); + static void utc_tel_verifiy_sim_pins_02(); + static void utc_tel_verifiy_sim_pins_03(); + static void utc_tel_verifiy_sim_pins_04(); +#endif diff --git a/TC/telephony_TC/sim/unit/uts_tel_verify_sim_puks.c b/TC/telephony_TC/sim/unit/uts_tel_verify_sim_puks.c new file mode 100644 index 0000000..8f1b7d1 --- /dev/null +++ b/TC/telephony_TC/sim/unit/uts_tel_verify_sim_puks.c @@ -0,0 +1,633 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +/** +* @ingroup TELEPHONY_API +* @addtogroup TAPI_API_SIM_SAT SIM/SAT +*/ + +/** +* @ingroup TAPI_API_SIM_SAT +* @addtogroup UTS_SIM_SAT Unit +*/ + +/** +* @ingroup UTS_SIM_SAT +* @addtogroup UTS_TAPI_SIM_UNBLOCK_PIN tel_verify_sim_puks +* +* @brief Unit test code for tel_verify_sim_puks() +* @par Test function Prototype: +* TapiResult_t tel_verify_sim_puks(const TelSimPinData_t * pPukPinData, const TelSimPinData_t * pNewPinData, int *pRequestId); +* @par Test function description: +* This function performs unblock PIN operation based on PUK information passed along with +* unblock information entered by the user. +* @par Important Notes: +* Based on Pin status (PIN/UPIN/PUK) is blocked, an unsolicited event TAPI_EVENT_SIM_STATUS_IND +* is published to Applications. +* @param [in] pPukPinData Specifies unblocking PIN password +* @code + typedef struct + { + TelSimPinType_t PinType; // Pin type + char szPinCode[TAPI_SIM_PIN_LENGTH+1]; // PIN code + } TelSimPinData_t; +* @endcode +* @param [in] pNewPinData Specifies PIN password. +* @param [out] pRequestId Unique identifier for a particular request. +* - request_id value can be any value from 0 to 255 if the API is returned successfully +* - -1 (INVALID_REQUEST_ID) will be sent in case of failure. +* @par Async Response Message: +* The event associated is below and the event data is #TelSimPinInfo_t. \n +* ( Asynchronous return status is indicated by #TelSimPinOperationResult_t.) +* - TAPI_EVENT_SIM_UNBLOCK_PIN_CNF(TAPI_SIM_PIN_OPERATION_SUCCESS) +* @pre +* - Before test script compile, you set correct PIN1_NORMAL, PIN2_NORMAL, PIN1_CHANGED, PIN2_CHANGED value on 'tet_tapi_util.h' +* - Before test script compile, you set incorrect PIN1_INCORRECT value on 'tet_tapi_util.h' +* @post +* None +* @return +* Return Type : (TapiResult_t) +* - TAPI_API_SUCCESS - indicating that the operation has completed successfully. +* - Otherwise it provides an error code (Refer #TapiResult_t) +* @{ +*/ + +/** +* @file uts_tel_verify_sim_puks.c +* @brief Test for the tel_verify_sim_puks() API that is used to unblock PIN +* @author +* @version Initial Creation V0.1 +* @date 2008.07.30 +*/ + + +#include +#include +#include + +#include "tet_tapi_util.h" +#include "sim_common.h" +#include "uts_tel_verify_sim_puks.h" +#include "async_util.h" + +/* Initialize TCM data structures */ +static void startup(); +static void cleanup(); +void (*tet_startup) () = startup; +void (*tet_cleanup) () = cleanup; +struct tet_testlist tet_testlist[] = { + {utc_tel_verify_sim_puks_01, 1}, + {utc_tel_verify_sim_puks_02, 2}, + {utc_tel_verify_sim_puks_03, 3}, + {utc_tel_verify_sim_puks_04, 4}, + {utc_tel_verify_sim_puks_05, 5}, + {NULL, 0} +}; + +/* + User Defined Handler +*/ +// Global variable for user data +static BOOL gAsyncResult; //user defined data : Async callback is called or not + +/* Startup & Clean function : It is not test code, only for + initialize and finalize test module +*/ +static BOOL gStartupSuccess = FALSE; +static unsigned int subscription_id = 0; + +extern sim_info_t g_si; + + +/* + G_MAIN Utility //////////////////////////////////////////////////////////////////////////// +*/ +// Prototype : User must add function body +gboolean g_timeout_callback (void *data); + +// GMainLoop global handler +GMainLoop *sim_loop = NULL; + +void G_MAIN_LOOP_CLOSE() +{ + g_main_loop_quit(sim_loop); +} + +int G_MAIN_LOOP_RUN(int sec) +{ + sim_loop = g_main_loop_new (NULL, FALSE); + g_timeout_add ( (sec * 1000), g_timeout_callback, NULL); + g_main_loop_run (sim_loop); + + return 0; +} + +gboolean g_timeout_callback (void *data) +{ +// gAsyncResult = FALSE; + tet_printf("[TIME OUT] g_timeout called .Close g_main_roop()"); + G_MAIN_LOOP_CLOSE(); + return FALSE; +} +// End of G_MAIN Utility////////////////////////////////////////////////////////////////////// + + +static int sim_pin_process_for_condition(TelSimPinType_t wish_pin, TelSimPinStatus_t wish_condition) +{ + int pRequestId=0; + int tapiRet = TAPI_API_SUCCESS; + TelSimPinStatus_t pin_status = TAPI_SIM_PIN_STATUS_UNKNOWN; + TelSimSecPw_t sec_data; + memset(&sec_data, 0x00, sizeof(TelSimSecPw_t)); + + tet_printf("pin[%d]:0-pin1, 1-pin2, wish_condition[%d]: 0-dis, 1- enabled, 2-blocked(puk)",wish_pin, wish_condition); + + tapiRet = tel_get_sim_security_status(wish_pin,&pin_status); + if(tapiRet != TAPI_API_SUCCESS) + { + tet_printf("tel_get_sim_security_status is Failed with tapiRet[%d]", tapiRet); + return -1; + } + + if(pin_status == TAPI_SIM_PIN_STATUS_DISABLED ) + { + tet_printf("current pin status is TAPI_SIM_PIN_STATUS_DISABLED"); + } + else if(pin_status == TAPI_SIM_PIN_STATUS_ENABLED) + { + tet_printf("current pin status is TAPI_SIM_PIN_STATUS_ENABLED"); + } + else + { + tet_printf("current pin status is unhandled status[%d]",pin_status ); + return -1; + } + + if(pin_status == wish_condition ) + { + tet_printf("current pin status is same with wished condition"); + return 0; + } + else + { + tet_printf("current pin status is different with wished condition"); + sec_data.type = wish_pin; + + if(wish_pin == TAPI_SIM_PTYPE_PIN1 ) + { + sec_data.pw_len = strlen(g_si.pin1); + sec_data.pw = (unsigned char*)malloc(sec_data.pw_len); + memcpy(sec_data.pw,g_si.pin1,sec_data.pw_len); + } + else if(wish_pin == TAPI_SIM_PTYPE_PIN2) + { + sec_data.pw_len = strlen(g_si.pin2); + sec_data.pw = (unsigned char*)malloc(sec_data.pw_len); + memcpy(sec_data.pw,g_si.pin2,sec_data.pw_len); + } + + gAsyncResult = FALSE; + + if(wish_condition == TAPI_SIM_PIN_STATUS_DISABLED) + { + tet_printf("make pin status with wished condition(TAPI_SIM_PIN_STATUS_DISABLED)"); + + tapiRet = tel_disable_sim_security(&sec_data,&pRequestId); + } + else if(wish_condition == TAPI_SIM_PIN_STATUS_ENABLED) + { + tet_printf("make pin status with wished condition(TAPI_SIM_PIN_STATUS_ENABLED)"); + tapiRet = tel_enable_sim_security(&sec_data,&pRequestId); + } + else + { + tet_printf("Unhandled wish_condition[%d]", wish_condition); + return -1; + } + + if(tapiRet != TAPI_API_SUCCESS) + { + tet_printf("tapi return[%d] when en/disabling pin for condition",tapiRet); + return -1; + } + else + { + tet_printf("wait for condition async event resp - start"); + G_MAIN_LOOP_RUN(5); + tet_printf("wait for condition async event resp - stop"); + } + + tet_printf("gAsyncResult[%d]", gAsyncResult); + + if(gAsyncResult == TRUE) + { + return 0; + } + else + { + return -1; + } + } + + return 0; +} + + +static int sim_app_callback (TelTapiEvent_t *sim_event) +{ + tet_printf("\n***************[SIM APP]Callback data **********************\n"); + tet_printf("[SIM]Reques Id[%d]\n", sim_event->RequestId); + tet_printf("[SIM]event status [%d]\n", sim_event->Status); + + gAsyncResult = FALSE; + BOOL bReceived = FALSE; + + switch(sim_event->EventType) + { + case TAPI_EVENT_SIM_VERIFY_PUK_CNF: + { + tet_printf("[SIM]***************** TAPI_EVENT_SIM_VERIFY_PUK_CNF***************************"); + TelSimPinOperationResult_t opResult = (TelSimPinOperationResult_t)sim_event->Status; + TelSimPinInfo_t *pPinInfo; + pPinInfo = (TelSimPinInfo_t *)sim_event->pData; + tet_printf("SIM Unblock PIN event status = [%x]", opResult); + + if(opResult == TAPI_EVENT_SIM_VERIFY_PUK_CNF) + { + if(pPinInfo->PinType == TAPI_SIM_PTYPE_PIN1) + tet_printf("Unblock PIN1 Success!\n"); + else if(pPinInfo->PinType == TAPI_SIM_PTYPE_PIN2) + tet_printf("Unblock PIN2 Success!\n"); + else if(pPinInfo->PinType == TAPI_SIM_PTYPE_PUK1) + tet_printf("Unblock PUK1 Success!\n"); + else if(pPinInfo->PinType == TAPI_SIM_PTYPE_PUK2) + tet_printf("Unblock PUK2 Success!\n"); + + } + else + { + if(pPinInfo->PinType == TAPI_SIM_PTYPE_PIN1) + { + tet_printf("PIN1 Verification Failed! - PIN Required \n"); + //tet_printf("Remainint attempts [%d]\n", pPinInfo->RemainingAttempts); + } + else if(pPinInfo->PinType == TAPI_SIM_PTYPE_PUK1) + { + tet_printf("PIN1 Verification Failed! - PUK Required \n"); + //tet_printf("Remainint attempts [%d]\n", pPinInfo->RemainingAttempts); + } + else if(pPinInfo->PinType == TAPI_SIM_PTYPE_PIN2) + { + tet_printf("PIN2 Verification Failed! - PIN2 Required \n"); + //tet_printf("Remainint attempts [%d]\n", pPinInfo->RemainingAttempts); + } + else if(pPinInfo->PinType == TAPI_SIM_PTYPE_PUK1) + { + tet_printf("PIN2 Verification Failed! - PUK2 Required \n"); + //tet_printf("Remainint attempts [%d]\n", pPinInfo->RemainingAttempts); + } + + + } + bReceived = TRUE; + gAsyncResult = TRUE; + } + break; + + case TAPI_EVENT_SIM_ENABLE_SEC_CNF: //preet: changed TAPI_EVENT_SIM_ENABLE_PIN_CNF to TAPI_EVENT_SIM_ENABLE_SEC_CNF + { + tet_printf("\n[SIM]*****************TAPI_EVENT_SIM_ENABLE_SEC_CNF***************************\n"); + tet_printf("SIM Enable PIN event status = [%x]\n", sim_event->Status); + + if(sim_event->Status == TAPI_SIM_PIN_OPERATION_SUCCESS) + gAsyncResult = TRUE; + else + gAsyncResult = FALSE; + + tet_printf("gAsyncResult after enpin[%d]",gAsyncResult); + } + break; + + case TAPI_EVENT_SIM_DISABLE_SEC_CNF: ////preet: changed TAPI_EVENT_SIM_DISABLE_PIN_CNF to TAPI_EVENT_SIM_DISABLE_SEC_CNF + { + tet_printf("\n[SIM]*****************TAPI_EVENT_SIM_DISABLE_SEC_CNF***************************\n"); + tet_printf("SIM Disable PIN event status = [%x]\n", sim_event->Status); + + if(sim_event->Status == TAPI_SIM_PIN_OPERATION_SUCCESS) + gAsyncResult = TRUE; + else + gAsyncResult = FALSE; + } + break; + + + default: + { + bReceived = TRUE; + gAsyncResult = FALSE; + tet_printf("Info : TAPI_EVENT_SIM_VERIFY_PUK_CNF = %d", TAPI_EVENT_SIM_VERIFY_PUK_CNF); + tet_printf("[SIM]***************** Undhandled event type [%d] *****************\n",sim_event->EventType); + tet_printf("[SIM]Undhandled event state [%d]\n",sim_event->Status); + } + break; + }//end switch + + if (bReceived == TRUE) + G_MAIN_LOOP_CLOSE(); + + return 0; +} + + +static void startup() +{ + tet_infoline("utc_tel_verify_sim_puks Test Start\n"); + + sim_pin_info_setup(); + + if ( tel_init() == TAPI_API_SUCCESS) + { + + tel_register_event(TAPI_EVENT_SIM_VERIFY_PUK_CNF,&subscription_id,(TelAppCallback)sim_app_callback,NULL); + tel_register_event(TAPI_EVENT_SIM_ENABLE_SEC_CNF,&subscription_id,(TelAppCallback)sim_app_callback,NULL); + tel_register_event(TAPI_EVENT_SIM_DISABLE_SEC_CNF,&subscription_id,(TelAppCallback)sim_app_callback,NULL); + + gStartupSuccess = TRUE; + + } else { + tet_infoline("startup fail. tel_init() failed"); + } + tel_register_app_name("org.samsung.test"); + return; +} + + +static void cleanup() +{ + tet_infoline("utc_tel_verify_sim_puks Test Finished\n"); + if (gStartupSuccess == TRUE) + { + tel_deregister_event(subscription_id); + } + tel_deinit(); + return; +} + + +/* + Unit Test Case functions +*/ + +/** +* @brief tel_verify_sim_puks() API : Negative condition(Parameter is Null) +* @par ID: UTC_TEL_VERIFY_SIM_PUKS_01 +* @param [in] &pPukPinData = NULL +* @param [in] &pNewPinData +* @param [out]&pRequestId +* @return TAPI_API_INVALID_PTR +*/ +void utc_tel_verify_sim_puks_01() +{ + TET_STAMP_START("TAPI_API_INVALID_PTR 1"); + int pRequestId=0; + + TelSimSecPw_t pPukdata; + TelSimSecPw_t pNewPindata; + + tet_printf("THE PUK CODE IS %s\n", g_si.puk1); + tet_printf("NEW PIN1 CODE %s\n", g_si.pin1); + + pPukdata.type = TAPI_SIM_PTYPE_PUK1; // 0x00 + pNewPindata.type = TAPI_SIM_PTYPE_PIN1; // 0x00 + + pPukdata.pw= (unsigned char*)g_si.puk1; + pNewPindata.pw = (unsigned char*)g_si.pin1; + pPukdata.pw_len=strlen(g_si.puk1); + pNewPindata.pw_len=strlen(g_si.pin1); + TET_CHECK(TAPI_API_INVALID_PTR, tel_verify_sim_puks(NULL,&pNewPindata,&pRequestId)); + TET_STAMP_PASS(); +} + +/** +* @brief tel_verify_sim_puks() API : Negative condition(Parameter is Null) +* @par ID: UTC_TEL_VERIFY_SIM_PUKS_02 +* @param [in] &pPukPinData +* @param [in] &pNewPinData = NULL +* @param [out]&pRequestId +* @return TAPI_API_INVALID_PTR +*/ +void utc_tel_verify_sim_puks_02() +{ + TET_STAMP_START("TAPI_API_INVALID_PTR 2"); + int pRequestId=0; + + TelSimSecPw_t pPukdata; + TelSimSecPw_t pNewPindata; + + tet_printf("THE PUK CODE IS %s\n", g_si.puk1); + tet_printf("NEW PIN1 CODE %s\n", g_si.pin1); + + pPukdata.type = TAPI_SIM_PTYPE_PUK1; // 0x00 + pNewPindata.type = TAPI_SIM_PTYPE_PIN1; // 0x00 + pPukdata.pw=(unsigned char*)g_si.puk1; + pNewPindata.pw = (unsigned char*)g_si.pin1; + + pPukdata.pw_len=strlen(g_si.puk1); + pNewPindata.pw_len=strlen(g_si.pin1); + TET_CHECK(TAPI_API_INVALID_PTR, tel_verify_sim_puks(&pPukdata,NULL,&pRequestId)); + TET_STAMP_PASS(); +} + +/** +* @brief tel_verify_sim_puks() API : Negative condition(Parameter is Null) +* @par ID: UTC_TEL_VERIFY_SIM_PUKS_03 +* @param [in] &pPukPinData +* @param [in] &pNewPinData +* @param [out]&pRequestId = NULL +* @return TAPI_API_INVALID_PTR +*/ +void utc_tel_verify_sim_puks_03() +{ + TET_STAMP_START("TAPI_API_INVALID_PTR 3"); + + TelSimSecPw_t pPukdata; + TelSimSecPw_t pNewPindata; + + tet_printf("THE PUK CODE IS %s\n", g_si.puk1); + tet_printf("NEW PIN1 CODE %s\n", g_si.pin1); + + pPukdata.type = TAPI_SIM_PTYPE_PUK1; // 0x00 + pNewPindata.type = TAPI_SIM_PTYPE_PIN1; // 0x00 + + pPukdata.pw=(unsigned char*)g_si.puk1; + pNewPindata.pw = (unsigned char*)g_si.pin1; + + pPukdata.pw_len=strlen(g_si.puk1); + pNewPindata.pw_len=strlen(g_si.pin1); + TET_CHECK(TAPI_API_INVALID_PTR, tel_verify_sim_puks(&pPukdata,&pNewPindata,NULL)); + TET_STAMP_PASS(); +} + +/** +* @brief tel_verify_sim_puks() API : Positive condition(Try to unblock PIN1 code) +* @par ID: UTC_TEL_VERIFY_SIM_PUKS_04 +* @param [in] &pPukPinData +* @param [in] &pNewPinData +* @code + TelSimPinData_t pPukdata; + TelSimPinData_t pNewPindata; + + strcpy(init_puk_val, PUK1_CODE); + strcpy(init_pin_val, PIN1_NORMAL); + + pPukdata.PinType = TAPI_SIM_PTYPE_PUK1; + pNewPindata.PinType = TAPI_SIM_PTYPE_PIN1; + + memcpy(pPukdata.szPinCode,init_puk_val,length); + memcpy(pNewPindata.szPinCode,init_pin_val,length); +* @endcode +* @param [out]&pRequestId +* @return TAPI_API_SUCCESS +* @par Async Response Message: +* The event associated is below and the event data is #TelSimPinInfo_t. \n +* ( Asynchronous return status is indicated by #TelSimPinOperationResult_t.) +* - TAPI_EVENT_SIM_UNBLOCK_PIN_CNF(TAPI_SIM_PIN_OPERATION_SUCCESS) +*/ +void utc_tel_verify_sim_puks_04() +{ + TET_STAMP_START("Normal operation TAPI_SIM_PTYPE_PIN1"); + TET_RESULT_NOT_EQUAL(TET_UNTESTED,gStartupSuccess, TRUE); + + int pRequestId=0; + + TelSimSecPw_t pPukdata; + TelSimSecPw_t pNewPindata; + + // Step 1 : make proper condition + tet_printf("Step 1 : enable pin"); + + if( 0 != sim_pin_process_for_condition(TAPI_SIM_PTYPE_PIN1,TAPI_SIM_PIN_STATUS_ENABLED)) + { + tet_printf("condition set is failed!!"); + return; + } + + // Step 2 : verify puk + tet_printf("Step 2 : verify puk"); + + tet_printf("THE PUK CODE IS %s\n", g_si.puk1); + tet_printf("NEW PIN1 CODE %s\n", g_si.pin1); + + pPukdata.type = TAPI_SIM_PTYPE_PUK1; + pNewPindata.type = TAPI_SIM_PTYPE_PIN1; + pPukdata.pw = (unsigned char*)g_si.puk1; + pNewPindata.pw = (unsigned char*)g_si.pin1; + + pPukdata.pw_len=strlen(g_si.puk1); + pNewPindata.pw_len=strlen(g_si.pin1); + + gAsyncResult = FALSE; + + TapiResult_t err = tel_verify_sim_puks(&pPukdata,&pNewPindata,&pRequestId); + + TET_RESULT_NOT_EQUAL(TET_FAIL,TAPI_API_SUCCESS,err); + + tet_printf("after real tc api - wait start"); + + G_MAIN_LOOP_RUN(10); + + tet_printf("after real tc api - wait stop"); + + TET_RESULT_NOT_EQUAL_GOTO(TET_FAIL,exit,gAsyncResult,TRUE); // If gAsyncResult != FALSE, then TET_FAIL and return + TET_STAMP_PASS(); + +exit: + // Step 3 : make default condition + tet_printf("Step 3 : disable pin"); + + if( 0 != sim_pin_process_for_condition(TAPI_SIM_PTYPE_PIN1,TAPI_SIM_PIN_STATUS_DISABLED)) + { + tet_printf("condition set is failed!!"); + } + return; +} + + +/** +* @brief tel_verify_sim_puks() API : Positive condition(Try to unblock PIN2 code) +* @par ID: UTC_TEL_VERIFY_SIM_PUKS_05 +* @param [in] &pPukPinData +* @param [in] &pNewPinData +* @code + TelSimPinData_t pPukdata; + TelSimPinData_t pNewPindata; + + strcpy(init_puk_val, PUK2_CODE); + strcpy(init_pin_val, PIN2_NORMAL); + + pPukdata.PinType = TAPI_SIM_PTYPE_PUK2; + pNewPindata.PinType = TAPI_SIM_PTYPE_PIN2; + + memcpy(pPukdata.szPinCode,init_puk_val,length); + memcpy(pNewPindata.szPinCode,init_pin_val,length); +* @endcode +* @param [out]&pRequestId +* @return TAPI_API_SUCCESS +* @par Async Response Message: +* The event associated is below and the event data is #TelSimPinInfo_t. \n +* ( Asynchronous return status is indicated by #TelSimPinOperationResult_t.) +* - TAPI_EVENT_SIM_UNBLOCK_PIN_CNF(TAPI_SIM_PIN_OPERATION_SUCCESS) +*/ +void utc_tel_verify_sim_puks_05() +{ + TET_STAMP_START("Normal operation : TAPI_SIM_PTYPE_PIN2"); + TET_RESULT_NOT_EQUAL(TET_UNTESTED,gStartupSuccess, TRUE); + + int pRequestId=0; + TelSimSecPw_t puk_data = {0,}; + TelSimSecPw_t new_pin_data = {0,}; + + puk_data.type = TAPI_SIM_PTYPE_PUK2; // 0x00 + puk_data.pw_len = strlen(g_si.puk2); + puk_data.pw = (unsigned char*)malloc(puk_data.pw_len); + memcpy(puk_data.pw,g_si.puk2,puk_data.pw_len); + + new_pin_data.type = TAPI_SIM_PTYPE_PIN2; // 0x00 + new_pin_data.pw_len = strlen(g_si.pin2); + new_pin_data.pw = (unsigned char*)malloc(new_pin_data.pw_len); + memcpy(new_pin_data.pw,g_si.pin2,new_pin_data.pw_len); + + gAsyncResult = FALSE; + + TapiResult_t err = tel_verify_sim_puks(&puk_data,&new_pin_data,&pRequestId); + TET_CHECK(TAPI_API_SUCCESS, err); + + tet_printf("after real tc api - wait start"); + + G_MAIN_LOOP_RUN(10); + + tet_printf("after real tc api - wait stop"); + + TET_RESULT_NOT_EQUAL(TET_FAIL,gAsyncResult,TRUE); // If gAsyncResult != TRUE, then TET_FAIL and return + TET_STAMP_PASS(); +} + +/** @} */ diff --git a/TC/telephony_TC/sim/unit/uts_tel_verify_sim_puks.h b/TC/telephony_TC/sim/unit/uts_tel_verify_sim_puks.h new file mode 100644 index 0000000..bd36df6 --- /dev/null +++ b/TC/telephony_TC/sim/unit/uts_tel_verify_sim_puks.h @@ -0,0 +1,30 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * 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 _UTS_TEL_VERIFY_SIM_PUKS_H_ +#define _UTS_TEL_VERIFY_SIM_PUKS_H_ + + static void utc_tel_verify_sim_puks_01(); + static void utc_tel_verify_sim_puks_02(); + static void utc_tel_verify_sim_puks_03(); + static void utc_tel_verify_sim_puks_04(); + static void utc_tel_verify_sim_puks_05(); +#endif diff --git a/TC/telephony_TC/sms/README b/TC/telephony_TC/sms/README new file mode 100644 index 0000000..2e920d4 --- /dev/null +++ b/TC/telephony_TC/sms/README @@ -0,0 +1,69 @@ +================================================================================= +* README * +================================================================================= + +1. The SMS Test Script directory (TestCases) includes: + + telephony-framework/sms + |-- README ; This file + `-- Unit ; contains Unit TCs + |-- makefile + |-- tslist + `-- Unit test case source codes + 2 directories, 82 files + + +2. The $(TEST_ROOT) directory must includes following files: + + /$(TEST_ROOT) + |-- tet_scen + |-- tetbuild.cfg + |-- tetclean.cfg + |-- tetexec.cfg + `-- ...(elipsis) + +================================================================================= +* Preconditions * +--------------------------------------------------------------------------------- +| Before Testing SMS Module, you should check the following conditions | +================================================================================= + +1. Prepare a vaild SIM card. + +2. One target for the execution of testcases. + +3. One mobile phone for receiving test message. + +4. Modify the mobile number + - sms_common.h + - Followings are the macro for mobile number customized as per the country. + // Mobile numbers + + #define VALID_SCA_NUM "8210911111" // SMS Center Address + #define RECEIPIENT "01030014342" // Receipient Number + +5. During execution continuously watch the log file at Putty or whatever terminal used for target logging and as per the log instruction, user has to provide a SMS. + + e,g.: log will be printed in the following fashion: + + ****************************************** + * Please send a message to tesing target * + * within 60 seconds !!! * + ****************************************** + +================================================================================= +* Change log * +================================================================================= +1. 18-Dec-2008 + - Initial draft. + +2. 6-Oct-2010 + - Revised + +================================================================================= +* NOTE * +================================================================================= +1. In order to ensure successful working of the Test Scripts, please ensure that all of the IPKG files are installed normally. +2. Testing SMS Module can be executed under target system environment (not simulator). + + diff --git a/TC/telephony_TC/sms/sms_common.h b/TC/telephony_TC/sms/sms_common.h new file mode 100644 index 0000000..922dfbc --- /dev/null +++ b/TC/telephony_TC/sms/sms_common.h @@ -0,0 +1,28 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * 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 _SMS_COMMON_H_ +#define _SMS_COMMON_H_ + +#define VALID_SCA_NUM "8210911111" +#define RECEIPIENT "01030014342" + +#endif + diff --git a/TC/telephony_TC/sms/unit/async_util.c b/TC/telephony_TC/sms/unit/async_util.c new file mode 100644 index 0000000..f854b12 --- /dev/null +++ b/TC/telephony_TC/sms/unit/async_util.c @@ -0,0 +1,129 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * 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 "async_util.h" + +static void G_MAIN_TIMER_HANDLER(int sgi); + +// Global variable for G_MAIN system +#if 0 +static int gEventHandle=0; +static unsigned int gSubscription_id; +#endif +static GMainLoop * nw_context_loop = NULL; +static EvtAlarmCb gpAlarm_Handler = NULL; + +GMainLoop *main_loop = NULL; + +void G_MAIN_LOOP_CLOSE() +{ + g_main_loop_quit(nw_context_loop); +} + +void G_MAIN_TIMER_HANDLER(int sgi) +{ + if (gpAlarm_Handler) + gpAlarm_Handler(sgi); + else { + fprintf(stderr, "SIGALRM received. But user handler not registered. Close g_main_loop()"); + G_MAIN_LOOP_CLOSE(); + } +} + +#if 0 +TS_BOOL G_MAIN_INIT(EvtSysEventCb pNotiHandler, EvtAlarmCb pAlarmHandler) +{ + int open_status; + int error_code; + gpAlarm_Handler = pAlarmHandler; + + g_type_init(); + /* + open_status = EvtSysLibraryOpen(&gEventHandle); + if (open_status!=0) + { + printf("Unable to get connection to event delivery\n"); + printf("the error is %d\n",open_status); + return FALSE; + } + printf("event handle is %d\n",gEventHandle); + + error_code = EvtSysEventSubscribe( + 0, + "Telephony.Nettext.*", // notification ID + NULL, // filter expression // + pNotiHandler, // notification handler + NULL, // local data // + &gSubscription_id // subscription ID // + ); + */ + if (error_code ) + { + fprintf(stderr, "EvtSysEventSubscribe(): error [%#X] for event [Telephony.test.Async]\n", error_code); + return FALSE; + } + return TRUE; +} + +TS_BOOL G_MAIN_CLOSE() +{ + //int close_status = EvtSysLibraryClose(gEventHandle); + if (close_status!=0) + { + printf("Unable to get close connection to event delivery\n"); + printf("The error is %d\n",close_status); + return FALSE; + } + gEventHandle = 0; + sleep(3); + printf("############ Notification subscriber remove #######\n"); + return TRUE; +} +#endif + +void G_MAIN_LOOP_RUN(int sec) +{ + (void) signal(SIGALRM, G_MAIN_TIMER_HANDLER); + alarm(sec); + nw_context_loop = g_main_loop_new(NULL, FALSE); + g_main_loop_run(nw_context_loop); + alarm(0); +} + +gboolean TimeOutFun(void *data) +{ + g_main_loop_quit(main_loop); + printf("[TimeOutFun()] : g_main_loop_quit.\n"); + return FALSE; + +} + +int gmain_loop_for_events(int delay) +{ + main_loop = g_main_loop_new(NULL, FALSE); + g_timeout_add(delay, TimeOutFun, NULL); + g_main_loop_run(main_loop); + + return 0; +} diff --git a/TC/telephony_TC/sms/unit/async_util.h b/TC/telephony_TC/sms/unit/async_util.h new file mode 100644 index 0000000..61be8e1 --- /dev/null +++ b/TC/telephony_TC/sms/unit/async_util.h @@ -0,0 +1,44 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * 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 _ASYNC_UTIL_H_ +#define _ASYNC_UTIL_H_ + +/* + G_MAIN event system + */ +#include +#include +#include +#include +#include + +typedef void (*EvtAlarmCb)(int sgi); +TS_BOOL gAsyncResult; + +// Prototype for G_MAIN system +//TS_BOOL G_MAIN_INIT(EvtSysEventCb pNotiHandler, EvtAlarmCb pAlarmHandler); +//TS_BOOL G_MAIN_CLOSE(); +void G_MAIN_LOOP_RUN(int sec); +void G_MAIN_LOOP_CLOSE(); +int gmain_loop_for_events(int delay); +gboolean TimeOutFun(void *data); + +#endif diff --git a/TC/telephony_TC/sms/unit/error b/TC/telephony_TC/sms/unit/error new file mode 100644 index 0000000..c3d4070 --- /dev/null +++ b/TC/telephony_TC/sms/unit/error @@ -0,0 +1,86 @@ +sbox-arm-none-linux-gnueabi-gcc: /lib/tet3/tcm.o: No such file or directory +uts_tel_delete_sms_in_sim.c: In function 'startup': +uts_tel_delete_sms_in_sim.c:88: warning: passing argument 3 of 'tel_register_event' from incompatible pointer type +/usr/include/telephony/common/include/TapiCommon.h:153: note: expected 'TelAppCallback' but argument is of type 'void (*)(struct TelTapiEvent_t *)' +sms_callback_util.c: In function 'DecodeCellBroadcastMsg': +sms_callback_util.c:69: warning: suggest parentheses around arithmetic in operand of '|' +sms_callback_util.c:92: warning: pointer targets in passing argument 1 of 'SmsUtilUnpackGSMCode' differ in signedness +sms_util.h:465: note: expected 'char *' but argument is of type 'TS_UINT8 *' +sms_callback_util.c:92: warning: pointer targets in passing argument 2 of 'SmsUtilUnpackGSMCode' differ in signedness +sms_util.h:465: note: expected 'const TS_BYTE *' but argument is of type 'char *' +sms_callback_util.c:97: warning: assignment makes integer from pointer without a cast +sms_callback_util.c:106: warning: format '%x' expects type 'unsigned int', but argument 2 has type 'tapi_nettext_coding_scheme' +sms_callback_util.c: In function 'DecodeSmsSubmitTpdu': +sms_callback_util.c:133: warning: pointer targets in passing argument 1 of 'SmsUtilDecodeAddrField' differ in signedness +sms_util.h:475: note: expected 'char *' but argument is of type 'TS_BYTE *' +sms_callback_util.c:133: warning: pointer targets in passing argument 2 of 'SmsUtilDecodeAddrField' differ in signedness +sms_util.h:475: note: expected 'unsigned char *' but argument is of type 'char *' +sms_callback_util.c:137: warning: pointer targets in passing argument 1 of 'strlen' differ in signedness +/usr/include/string.h:397: note: expected 'const char *' but argument is of type 'TS_BYTE *' +sms_callback_util.c:177: warning: pointer targets in passing argument 1 of 'SmsUtilDecodeAddrField' differ in signedness +sms_util.h:475: note: expected 'char *' but argument is of type 'TS_BYTE *' +sms_callback_util.c:177: warning: pointer targets in passing argument 2 of 'SmsUtilDecodeAddrField' differ in signedness +sms_util.h:475: note: expected 'unsigned char *' but argument is of type 'char *' +sms_callback_util.c:217: warning: enumeration value 'TAPI_NETTEXT_VP_NOT_USED' not handled in switch +sms_callback_util.c:257: warning: pointer targets in passing argument 1 of 'SmsUtilUnpackGSMCode' differ in signedness +sms_util.h:465: note: expected 'char *' but argument is of type 'TS_BYTE *' +sms_callback_util.c: In function 'DecodeSmsDeliverTpdu': +sms_callback_util.c:317: warning: pointer targets in passing argument 1 of 'SmsUtilDecodeAddrField' differ in signedness +sms_util.h:475: note: expected 'char *' but argument is of type 'TS_BYTE *' +sms_callback_util.c:317: warning: pointer targets in passing argument 2 of 'SmsUtilDecodeAddrField' differ in signedness +sms_util.h:475: note: expected 'unsigned char *' but argument is of type 'char *' +sms_callback_util.c:351: warning: pointer targets in passing argument 1 of 'SmsUtilDecodeTimeStamp' differ in signedness +sms_util.h:471: note: expected 'unsigned char *' but argument is of type 'char *' +sms_callback_util.c:376: warning: pointer targets in passing argument 1 of 'SmsUtilUnpackGSMCode' differ in signedness +sms_util.h:465: note: expected 'char *' but argument is of type 'TS_BYTE *' +sms_callback_util.c: In function 'DecodeSmsSubmitReportTpdu': +sms_callback_util.c:479: warning: pointer targets in passing argument 1 of 'SmsUtilDecodeTimeStamp' differ in signedness +sms_util.h:471: note: expected 'unsigned char *' but argument is of type 'char *' +sms_callback_util.c:523: warning: pointer targets in passing argument 1 of 'SmsUtilUnpackGSMCode' differ in signedness +sms_util.h:465: note: expected 'char *' but argument is of type 'TS_BYTE *' +sms_callback_util.c: In function 'DecodeSmsStatusReportTpdu': +sms_callback_util.c:579: warning: pointer targets in passing argument 1 of 'SmsUtilDecodeAddrField' differ in signedness +sms_util.h:475: note: expected 'char *' but argument is of type 'TS_BYTE *' +sms_callback_util.c:579: warning: pointer targets in passing argument 2 of 'SmsUtilDecodeAddrField' differ in signedness +sms_util.h:475: note: expected 'unsigned char *' but argument is of type 'char *' +sms_callback_util.c:608: warning: pointer targets in passing argument 1 of 'SmsUtilDecodeTimeStamp' differ in signedness +sms_util.h:471: note: expected 'unsigned char *' but argument is of type 'char *' +sms_callback_util.c:612: warning: pointer targets in passing argument 1 of 'SmsUtilDecodeTimeStamp' differ in signedness +sms_util.h:471: note: expected 'unsigned char *' but argument is of type 'char *' +sms_callback_util.c:661: warning: pointer targets in passing argument 1 of 'SmsUtilUnpackGSMCode' differ in signedness +sms_util.h:465: note: expected 'char *' but argument is of type 'TS_BYTE *' +sms_callback_util.c:555: warning: unused variable 'scaAddr' +sms_callback_util.c: In function 'ReadMsgNotification': +sms_callback_util.c:751: warning: pointer targets in passing argument 1 of 'SmsUtilDecodeAddrField' differ in signedness +sms_util.h:475: note: expected 'char *' but argument is of type 'TS_BYTE *' +sms_callback_util.c:755: warning: pointer targets in passing argument 1 of 'strlen' differ in signedness +/usr/include/string.h:397: note: expected 'const char *' but argument is of type 'TS_BYTE *' +sms_callback_util.c: In function 'tapi_sms_callback': +sms_callback_util.c:961: warning: 'pData' may be used uninitialized in this function +sms_util.c: In function 'SmsUtilEncodeTimeStamp': +sms_util.c:357: warning: format '%02d' expects type 'int', but argument 3 has type 'char *' +sms_util.c: In function 'SmsUtilEncodeDCS': +sms_util.c:742: warning: enumeration value 'TAPI_NETTEXT_CLASS_NONE' not handled in switch +sms_util.c:742: warning: enumeration value 'TAPI_NETTEXT_CLASS_MAX' not handled in switch +sms_util.c:806: warning: enumeration value 'TAPI_NETTEXT_WAITING_MAX' not handled in switch +sms_util.c:839: warning: enumeration value 'TAPI_NETTEXT_WAITING_MAX' not handled in switch +sms_util.c:869: warning: enumeration value 'TAPI_NETTEXT_ALPHABET_UCS2' not handled in switch +sms_util.c:869: warning: enumeration value 'TAPI_NETTEXT_ALPHABET_KSC5601' not handled in switch +sms_util.c:869: warning: enumeration value 'TAPI_NETTEXT_ALPHABET_MAX' not handled in switch +sms_util.c:883: warning: enumeration value 'TAPI_NETTEXT_CLASS_NONE' not handled in switch +sms_util.c:883: warning: enumeration value 'TAPI_NETTEXT_CLASS_MAX' not handled in switch +sms_util.c:731: warning: enumeration value 'TAPI_NETTEXT_CODGRP_CB_GENERAL_LANG' not handled in switch +sms_util.c:731: warning: enumeration value 'TAPI_NETTEXT_CODGRP_CB_ALPHA' not handled in switch +sms_util.c:731: warning: enumeration value 'TAPI_NETTEXT_CODGRP_CB_RES1' not handled in switch +sms_util.c:731: warning: enumeration value 'TAPI_NETTEXT_CODGRP_CB_RES2' not handled in switch +sms_util.c:731: warning: enumeration value 'TAPI_NETTEXT_CODGRP_SM_AUTO_DELETION' not handled in switch +sms_util.c:731: warning: enumeration value 'TAPI_NETTEXT_CODGRP_CB_GENERAL_DCS' not handled in switch +sms_util.c:731: warning: enumeration value 'TAPI_NETTEXT_CODGRP_CB_WAP' not handled in switch +sms_util.c:731: warning: enumeration value 'TAPI_NETTEXT_CODGRP_CB_CLASS_CODING' not handled in switch +sms_util.c:731: warning: enumeration value 'TAPI_NETTEXT_CODGRP_MAX' not handled in switch +async_util.c: In function 'G_MAIN_LOOP_RUN': +async_util.c:111: warning: implicit declaration of function 'alarm' +async_util.c: At top level: +async_util.c:35: warning: 'gEventHandle' defined but not used +async_util.c:38: warning: 'gSubscription_id' defined but not used +make: *** [uts_tel_delete_sms_in_sim] Error 1 diff --git a/TC/telephony_TC/sms/unit/makefile b/TC/telephony_TC/sms/unit/makefile new file mode 100644 index 0000000..ad8e882 --- /dev/null +++ b/TC/telephony_TC/sms/unit/makefile @@ -0,0 +1,82 @@ +CC=gcc -Wall + +TS1 = uts_tel_delete_sms_in_sim +TS2 = uts_tel_get_sms_cb_config +TS3 = uts_tel_get_sms_count +TS4 = uts_tel_get_sms_parameter_count +TS5 = uts_tel_get_sms_parameters +TS6 = uts_tel_get_sms_preferred_bearer +TS7 = uts_tel_get_sms_sca +TS8 = uts_tel_read_sms_in_sim +TS9 = uts_tel_send_sms +TS10 = uts_tel_send_sms_deliver_report +TS11 = uts_tel_send_sms_msg +TS12 = uts_tel_set_sms_cb_config +TS13 = uts_tel_set_sms_memory_status +TS14 = uts_tel_set_sms_message_status +TS15 = uts_tel_set_sms_parameters +TS16 = uts_tel_set_sms_preferred_bearer +TS17 = uts_tel_set_sms_sca +TS18 = uts_tel_write_sms_in_sim + +LIBS = `pkg-config --libs glib-2.0 gconf-2.0 dbus-1 dbus-glib-1 gthread-2.0 tapi` +LIBS +=$(TET_ROOT)/lib/tet3/tcm.o +LIBS +=-L$(TET_ROOT)/lib/tet3 -lapi + +INCS = -I. `pkg-config --cflags glib-2.0 gconf-2.0 dbus-1 dbus-glib-1 gthread-2.0 tapi` +INCS += -I$(TET_ROOT)/inc/tet3 +INCS += -I../ + +CFLAGS = $(INCS) -DXTHREADS -D_REENTRANT -DXUSE_MTSAFE_API -DWITHOUT_APP_MGR -D_TETWARE_MODE_ +CC +=$(CFLAGS) +LDFLAGS = $(LIBS) + +#ifeq ($(ARCH),target) +#CC += -g -mabi=aapcs-linux +#endif + +all : $(TS1) $(TS2) $(TS3) $(TS4) $(TS5) $(TS6) $(TS7) $(TS8) $(TS9) $(TS10) $(TS11) $(TS12) $(TS13) $(TS14) $(TS15) $(TS16) $(TS17) $(TS18) + + +clean : + rm -rf *~ *.o tet_lock tet_captured $(TS1) $(TS2) $(TS3) $(TS4) $(TS5) $(TS6) $(TS7) $(TS8) $(TS9) $(TS10) $(TS11) $(TS12) $(TS13) $(TS14) $(TS15) $(TS16) $(TS17) $(TS18) + + +$(TS1): $(TS1).c + $(CC) -o $(TS1) $(TS1).c sms_callback_util.c sms_util.c async_util.c $(LDFLAGS) +$(TS2): $(TS2).c + $(CC) -o $(TS2) $(TS2).c sms_callback_util.c sms_util.c async_util.c $(LDFLAGS) +$(TS3): $(TS3).c + $(CC) -o $(TS3) $(TS3).c sms_callback_util.c sms_util.c async_util.c $(LDFLAGS) +$(TS4): $(TS4).c + $(CC) -o $(TS4) $(TS4).c sms_callback_util.c sms_util.c async_util.c $(LDFLAGS) +$(TS5): $(TS5).c + $(CC) -o $(TS5) $(TS5).c sms_callback_util.c sms_util.c async_util.c $(LDFLAGS) +$(TS6): $(TS6).c + $(CC) -o $(TS6) $(TS6).c sms_callback_util.c sms_util.c async_util.c $(LDFLAGS) +$(TS7): $(TS7).c + $(CC) -o $(TS7) $(TS7).c sms_callback_util.c sms_util.c async_util.c $(LDFLAGS) +$(TS8): $(TS8).c + $(CC) -o $(TS8) $(TS8).c sms_callback_util.c sms_util.c async_util.c $(LDFLAGS) +$(TS9): $(TS9).c + $(CC) -o $(TS9) $(TS9).c sms_callback_util.c sms_util.c async_util.c $(LDFLAGS) +$(TS10): $(TS10).c + $(CC) -o $(TS10) $(TS10).c sms_callback_util.c sms_util.c async_util.c $(LDFLAGS) +$(TS11): $(TS11).c + $(CC) -o $(TS11) $(TS11).c sms_callback_util.c sms_util.c async_util.c $(LDFLAGS) +$(TS12): $(TS12).c + $(CC) -o $(TS12) $(TS12).c sms_callback_util.c sms_util.c async_util.c $(LDFLAGS) +$(TS13): $(TS13).c + $(CC) -o $(TS13) $(TS13).c sms_callback_util.c sms_util.c async_util.c $(LDFLAGS) +$(TS14): $(TS14).c + $(CC) -o $(TS14) $(TS14).c sms_callback_util.c sms_util.c async_util.c $(LDFLAGS) +$(TS15): $(TS15).c + $(CC) -o $(TS15) $(TS15).c sms_callback_util.c sms_util.c async_util.c $(LDFLAGS) +$(TS16): $(TS16).c + $(CC) -o $(TS16) $(TS16).c sms_callback_util.c sms_util.c async_util.c $(LDFLAGS) +$(TS17): $(TS17).c + $(CC) -o $(TS17) $(TS17).c sms_callback_util.c sms_util.c async_util.c $(LDFLAGS) +$(TS18): $(TS18).c + $(CC) -o $(TS18) $(TS18).c sms_callback_util.c sms_util.c async_util.c $(LDFLAGS) + + diff --git a/TC/telephony_TC/sms/unit/sms_callback_util.c b/TC/telephony_TC/sms/unit/sms_callback_util.c new file mode 100644 index 0000000..115db5c --- /dev/null +++ b/TC/telephony_TC/sms/unit/sms_callback_util.c @@ -0,0 +1,1031 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * 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 +#include + +#include +#include +#include + +#include "sms_callback_util.h" + +int error_code; +int dcs_pos =0; + +TS_UINT8 tp_mr = 0x00; + + +TS_BOOL DecodeCellBroadcastMsg(int length, char *pPDU) +{ + int msgLength; + int sn = 0; //serial number + int msgID; //message identifier + tapi_nettext_coding_scheme dcs; + + TS_UINT8 page[2]; + int contents_length; + TS_UINT8 contents[TAPI_NETTEXT_CB_SIZE_MAX]; + + TS_UINT8 gs; + TS_UINT8 msgCode; + TS_UINT8 updateNumber; + + printf("cb msg type is %x\n", pPDU[0]); + printf("cb msg len is %x\n", pPDU[1]); + + printf("$$$$$$$$$$$$$$$length of cb msg is %d\n", length); + sn = (pPDU[2] << 8) | pPDU[1]; + + gs = (pPDU[2] & 0xC0) >> 6; //bit 7, bit 6 + + msgCode = (((pPDU[2] & 0x3F) << 4) | pPDU[3]) & 0xF0; + + updateNumber = pPDU[3] & 0x0F; //bit3, bit2, bit1, bit0 + + msgID = (pPDU[4] << 4) | pPDU[3]; + + SmsUtilDecodeDCS(&dcs, pPDU[6]); + + page[0] = pPDU[7] & 0x0F; //total page + page[1] = (pPDU[7] & 0xF0) >> 4; //current page + + + msgLength = length - 2; + + contents_length = msgLength - 6; + + if (dcs.alphabet_type == TAPI_NETTEXT_ALPHABET_DEFAULT) { + TS_BYTE inData[TAPI_NETTEXT_CB_SIZE_MAX + 1]; + + memset(inData, 0x00, TAPI_NETTEXT_CB_SIZE_MAX + 1); + + memcpy((void*) inData, (void*) &pPDU[8], contents_length); + SmsUtilUnpackGSMCode((char *) contents, (TS_BYTE *) &pPDU[8], msgLength); + } + else { + memcpy(contents, &pPDU[8], msgLength); + contents[msgLength] = 0; //NULL; + } + + printf("*************************************\n"); + printf("serical number : 0x%04x \n", sn); + printf("Geographical Scope: %x\n", gs); + printf("message code : %x\n", msgCode); + printf("update Number : %x\n", updateNumber); + printf("message identifier : %x\n", msgID); + printf("data coding scheme : %x\n", (unsigned int) &dcs); + printf("contents bytes size : %d\n", contents_length); + printf("page : (%d /%d) (page /total ) \n", page[1], page[0]); + printf("contents: %s\n", contents); + printf("*************************************\n"); + + return TRUE; +} + +TS_BOOL DecodeSmsSubmitTpdu(int pdu_len, char *pPDU) +{ + TPDU_SMS_SUBMIT tpdu_submit; + + TS_BYTE scaAddr_len = 0; + int destAddr_len = 0; + TS_BYTE diallingNum[TAPI_NETTEXT_ADDRESS_LEN_MAX]; + TS_BYTE scaAddr[TAPI_NETTEXT_SCADDRESS_LEN_MAX]; //service center address + TS_BYTE destAddr[TAPI_NETTEXT_ADDRESS_LEN_MAX]; //destination number + int sca_ton, sca_npi, dest_ton, dest_npi; + int position; + + position = 0; + + /* SCA_ADDR */ + memset(diallingNum, 0, sizeof(diallingNum)); + + SmsUtilDecodeAddrField((char *) diallingNum, (unsigned char *) &pPDU[position], &sca_ton, &sca_npi); + + position += 2; //include Address-Length, Type of Address + + scaAddr_len = strlen((char *) diallingNum); + + if (scaAddr_len % 2) + position += scaAddr_len / 2 + 1; + else + position += scaAddr_len / 2; + + if (sca_ton == SIM_TON_INTERNATIONAL) { + scaAddr[0] = '+'; + memcpy(&scaAddr[1], diallingNum, scaAddr_len); + scaAddr[scaAddr_len + 1] = '\0'; + } + else { + memcpy(scaAddr, diallingNum, scaAddr_len); + scaAddr[scaAddr_len] = '\0'; + } + + /* TP-MTI, TP-RD, TP-VPF, TP-RP, TP_UDHI, TP-SRR */ + + tpdu_submit.msg_type = SMS_TPDU_SUBMIT; // bit 0,1(Message Type Indicator ) + tpdu_submit.rd = (pPDU[position] & 0x04) ? TRUE : FALSE;// bit 2 (Message Type Indicator) + tpdu_submit.vpf = (pPDU[position] & 0x18) >> 3; // bits 3, 4 ( validity period format) + tpdu_submit.srr = (pPDU[position] & 0x20) ? TRUE : FALSE; // bit 5 (Status Report Request) + tpdu_submit.udhi = (pPDU[position] & 0x40) ? TRUE : FALSE; // bit 6 (User Data Header Indicator) + tpdu_submit.rp = (pPDU[position] & 0x80) ? TRUE : FALSE; // bit 7 (Reply Path) + + position++; + + /* TP-MR */ + tpdu_submit.mr = pPDU[position]; + + position++; + + /* TP-DA */ + + memset(diallingNum, 0, sizeof(diallingNum)); + + SmsUtilDecodeAddrField((char *) diallingNum, (unsigned char *) &pPDU[position], &dest_ton, &dest_npi); + + position += 2; + + destAddr_len = strlen((char*) diallingNum); + if (destAddr_len % 2) + position += destAddr_len / 2 + 1; + else + position += destAddr_len / 2; + + if (dest_ton == SIM_TON_INTERNATIONAL) { + destAddr[0] = '+'; + memcpy(&destAddr[1], diallingNum, destAddr_len); + destAddr[destAddr_len + 1] = '\0'; + } + else { + memcpy(destAddr, diallingNum, destAddr_len); + destAddr[destAddr_len] = '\0'; + } + + tpdu_submit.desAddr.DialNumLen = destAddr_len; + memcpy(tpdu_submit.desAddr.szDiallingNum, destAddr, destAddr_len); + tpdu_submit.desAddr.Npi = dest_npi; + tpdu_submit.desAddr.Ton = dest_ton; + + /* TP-PID */ + + tpdu_submit.pId = pPDU[position]; + position++; + + /* TP DCS */ + SmsUtilDecodeDCS(&tpdu_submit.dcs, pPDU[position]); + position++; + + /* TP VP */ + tpdu_submit.vp.vp_type = TAPI_NETTEXT_VP_RELATIVE; //temp + + switch (tpdu_submit.vp.vp_type) { + case TAPI_NETTEXT_VP_RELATIVE: + tpdu_submit.vp.vpValue = pPDU[position]; + tpdu_submit.vp.vp_rel_type = TAPI_NETTEXT_VP_REL_1D; + position++; + break; + + case TAPI_NETTEXT_VP_ABSOLUTE: + case TAPI_NETTEXT_VP_ENHANCED: + position += 7; + break; + + default: + break; + } + + /* TP UDL */ + tpdu_submit.udl = pPDU[position]; + + if (tpdu_submit.udl > TAPI_NETTEXT_SMDATA_SIZE_MAX) + tpdu_submit.udl = TAPI_NETTEXT_SMDATA_SIZE_MAX; + + position++; + + /* TP UD */ + tpdu_submit.userData = malloc(sizeof(unsigned char) * (TAPI_NETTEXT_SMDATA_SIZE_MAX + 1)); + + memset(tpdu_submit.userData, 0, sizeof(unsigned char) * (TAPI_NETTEXT_SMDATA_SIZE_MAX + 1)); + + if (tpdu_submit.dcs.alphabet_type == TAPI_NETTEXT_ALPHABET_DEFAULT) { + TS_BYTE inData[TAPI_NETTEXT_SMDATA_SIZE_MAX + 1]; + + memset(inData, 0x00, TAPI_NETTEXT_SMDATA_SIZE_MAX + 1); + + memcpy((void*) inData, (void*) &pPDU[position], tpdu_submit.udl); + + SmsUtilUnpackGSMCode((char *) tpdu_submit.userData, inData, (TS_UINT8) tpdu_submit.udl); + } + + printf("*************************************\n"); + printf("Msg Type: TPDU_SUBMIT\n"); + + if (tpdu_submit.rd) + printf("RD: Reject Duplicate\n"); + else if (!tpdu_submit.rd) + printf("RD: Accept Duplicate\n"); + + if (tpdu_submit.srr) + printf("SRR: A status report is requested\n"); + else if (!tpdu_submit.srr) + printf("SRR: A status report is not requested\n"); + + if (tpdu_submit.udhi) + printf("UDHI: Contains a Header in addition to the short message.\n"); + else if (!tpdu_submit.udhi) + printf("UDHI: Only Short Message\n"); + + if (tpdu_submit.rp) + printf("RP: Set Reply Path\n"); + else if (!tpdu_submit.rp) + printf("RP: Not set Reply Path\n"); + + printf("SCA Addr : %s\n", scaAddr); + printf("To : %s\n", destAddr); + printf("Message : %s \n", tpdu_submit.userData); + printf("*************************************\n"); + + return TRUE; +} + +int DecodeSmsDeliverTpdu(int tpdu_len, char *pTPDU) +{ + TPDU_SMS_DELIVER tpdu_deliver; + TmDateTime SCTimeStamp; + int orgAddr_len = 0; + TS_BYTE diallingNum[TAPI_NETTEXT_ADDRESS_LEN_MAX]; + TS_BYTE orgAddr[TAPI_NETTEXT_ADDRESS_LEN_MAX]; //originating number + int org_ton, org_npi; + int position; + + position = 0; + + /* TP-MTI, TP-MMS, TP-SRI, TP_UDHI, TP-RP */ + tpdu_deliver.msg_type = SMS_TPDU_DELIVER; + tpdu_deliver.mms = (pTPDU[position] & 0x04) ? TRUE : FALSE;// bit 2 (Message Type Indicator) + tpdu_deliver.sri = (pTPDU[position] & 0x20) ? TRUE : FALSE; // bit 5 (Status Report Indication) + tpdu_deliver.udhi = (pTPDU[position] & 0x40) ? TRUE : FALSE; // bit 6 (User Data Header Indicator) + tpdu_deliver.rp = (pTPDU[position] & 0x80) ? TRUE : FALSE; // bit 7 (Reply Path) + + position++; + + /* TP-OA */ + memset(diallingNum, 0, sizeof(diallingNum)); + + SmsUtilDecodeAddrField((char *) diallingNum, (unsigned char *) &pTPDU[position], &org_ton, &org_npi); + + position += 2; + + orgAddr_len = strlen((char*) diallingNum); + if (orgAddr_len % 2) + position += orgAddr_len / 2 + 1; + else + position += orgAddr_len / 2; + + if (org_ton == SIM_TON_INTERNATIONAL) { + orgAddr[0] = '+'; + memcpy(&orgAddr[1], diallingNum, orgAddr_len); + orgAddr[orgAddr_len + 1] = '\0'; + } + else { + memcpy(orgAddr, diallingNum, orgAddr_len); + orgAddr[orgAddr_len] = '\0'; + } + + /* TP-PID */ + tpdu_deliver.pId = pTPDU[position]; + + position++; + + /* TP-DCS */ + SmsUtilDecodeDCS(&tpdu_deliver.dcs, pTPDU[position]); + dcs_pos = position; + position++; + + /* TP-SCTS */ + SmsUtilDecodeTimeStamp((unsigned char *) &pTPDU[position], &SCTimeStamp); + + position += 7; + + /* TP-UDL */ + tpdu_deliver.udl = pTPDU[position]; + if (tpdu_deliver.udl > TAPI_NETTEXT_SMDATA_SIZE_MAX) + tpdu_deliver.udl = TAPI_NETTEXT_SMDATA_SIZE_MAX; + + position++; + + /* TP-UD */ + tpdu_deliver.userData = malloc(sizeof(unsigned char) * (TAPI_NETTEXT_SMDATA_SIZE_MAX + 1)); + + memset(tpdu_deliver.userData, 0, sizeof(unsigned char) * (TAPI_NETTEXT_SMDATA_SIZE_MAX + 1)); + + if (tpdu_deliver.dcs.alphabet_type == TAPI_NETTEXT_ALPHABET_DEFAULT) { + TS_BYTE inData[TAPI_NETTEXT_SMDATA_SIZE_MAX + 1]; + + memset(inData, 0x00, TAPI_NETTEXT_SMDATA_SIZE_MAX + 1); + + memcpy((void*) inData, (void*) &pTPDU[position], tpdu_deliver.udl); + + SmsUtilUnpackGSMCode((char *) tpdu_deliver.userData, inData, (TS_UINT8) tpdu_deliver.udl); + } + + printf("*************************************\n"); + printf("Msg Type: TPDU_DELIVER\n"); + + if (tpdu_deliver.rp) + printf("RP: Set Reply Path\n"); + else if (!tpdu_deliver.rp) + printf("RP: Not set Reply Path\n"); + + if (tpdu_deliver.sri) + printf("SRI: A status report shall be returned to the SME\n"); + else if (!tpdu_deliver.sri) + printf("SRI: A status report shall be not returned to the SME\n"); + + if (tpdu_deliver.mms) + printf("MMS: No more messages are waiting for the MS in this SC\n"); + else if (!tpdu_deliver.mms) + printf("MMS: More messages are waiting for the MS in this SC\n"); + + if (tpdu_deliver.udhi) + printf("UDHI: Contains a Header in addition to the short message.\n"); + else if (!tpdu_deliver.udhi) + printf("UDHI: Only short message.\n"); + + printf("DcsClass : %x \n", tpdu_deliver.dcs.class_type); + + printf("From : %s\n", orgAddr); + printf("Time : %d-%d-%d , %d:%d:%d\n", SCTimeStamp.year, SCTimeStamp.month, SCTimeStamp.day, SCTimeStamp.hour, SCTimeStamp.minute, SCTimeStamp.second); + printf("Message : %s \n", tpdu_deliver.userData); + printf("*************************************\n"); + + return dcs_pos; +} + +TS_BOOL DecodeSmsSubmitReportTpdu(int length, char *data) +{ + TPDU_SMS_SUBMIT_REPORT submit_report; + TmDateTime SCTimeStamp; + int position = 1; + int i = 0; + TS_BYTE msgRef, tpdu_len; + int result = 0; + TS_BYTE mask; + + if (data == NULL) + return FALSE; + + /* Result */ + printf("length :%d\n", length); + + for (i = 0; i < length; i++) + printf("[%02x]", data[i]); + + result = data[position]; + + printf("\nIn ackrecv (return status) result is %x\n", result); + position++; + + /* Msg Reference */ + msgRef = data[position++]; + printf("In ackrecv position :%d msgref is %x\n", position, msgRef); + position++; + + /* TPDU Length */ + tpdu_len = data[position]; + printf("In ackrecv position :%d len is %d\n", position, tpdu_len); + + /**** SUBMIT REPORT TPDU PARSING***/ + + /* TP-MTI , TP-UDHI */ + printf("before TPDU position value:%d\n", position); + + submit_report.msg_type = data[position] & 0x03; //bit 0,1 + submit_report.udhi = data[position] & 0x40 ? TRUE : FALSE; //bit 6; + + position++; + + if (result == FAIL) { + /* TP-FCS */ + submit_report.fcs = data[position]; + position++; + } + + /* TP-PI - set to a 1 indicates that a particular optional parameter is present in the fields which follow. */ + /* Masking Bit - TP -PID (bit 0), TP-DCS(bit 1), TP-UDL(bit 2) */ + + submit_report.paraInd = data[position]; + mask = submit_report.paraInd; + position++; + + /* TP-SCTS */ + + SmsUtilDecodeTimeStamp((unsigned char *) &data[position], &SCTimeStamp); + + position += 7; + + if ((mask != 0xFF) && (mask != 0)) { + /* TP-PID */ + if (mask & 0x01) { + submit_report.pId = data[position]; + position++; + printf("TP-PID :%x\n", submit_report.pId); + } + + /* TP-DCS */ + if (mask & 0x02) { + SmsUtilDecodeDCS(&submit_report.dcs, data[position]); + position++; + printf("TP-DCS :%x\n", data[position]); + } + + if (mask & 0x04) { + /* TP-UDL */ + submit_report.udl = data[position]; + position++; + + printf("TP-UDL :%x\n", data[position]); + + /* TP-UD */ + + submit_report.userData = malloc(sizeof(TS_BYTE) * (TAPI_NETTEXT_SMDATA_SIZE_MAX + 1)); + + memset(submit_report.userData, 0, sizeof(TS_BYTE) * (TAPI_NETTEXT_SMDATA_SIZE_MAX + 1)); + + if (submit_report.dcs.alphabet_type == TAPI_NETTEXT_ALPHABET_DEFAULT) { + TS_BYTE inData[TAPI_NETTEXT_SMDATA_SIZE_MAX + 1]; + + memset(inData, 0x00, TAPI_NETTEXT_SMDATA_SIZE_MAX + 1); + + memcpy((void*) inData, (void*) &data[position], submit_report.udl); + + SmsUtilUnpackGSMCode((char *) submit_report.userData, inData, (TS_UINT8) submit_report.udl); + } + + } + } + + printf("*************************************\n"); + + if (result != 0x00) + printf("SMS SEND FAIL!!\n"); + else + printf("SMS SEND SUCCESS!!\n"); + + if (result != 0x00) + printf("Failure Code : %x\n", submit_report.fcs); + + printf("*************************************\n"); + + return TRUE; +} + +TS_BOOL DecodeSmsStatusReportTpdu(int tpdu_len, char *pTPDU) +{ + TPDU_SMS_STATUS_REPORT status_report; + + TmDateTime SCTimeStamp; + TmDateTime DischargeTime; + + int rcpAddr_len = 0; + TS_BYTE diallingNum[TAPI_NETTEXT_ADDRESS_LEN_MAX]; + // TS_BYTE scaAddr[TAPI_NETTEXT_SCADDRESS_LEN_MAX]; //service center address + TS_BYTE rcpAddr[TAPI_NETTEXT_ADDRESS_LEN_MAX]; //recipient number + int rcp_ton, rcp_npi; + int position = 0; + TS_UINT mask; + + /* TP-MTI, TP MMS, TP SRQ, TP_UDHI */ + + status_report.msg_type = pTPDU[position] & 0x03; // bit 0,1 + status_report.mms = pTPDU[position] & 0x04 ? TRUE : FALSE; // bit 2 + status_report.srq = pTPDU[position] & 0x20 ? TRUE : FALSE; //bit 5 + status_report.udhi = pTPDU[position] & 0x40 ? TRUE : FALSE; //bit 6 + + position++; + + /* TP-MR */ + status_report.mr = pTPDU[position]; + position++; + + /* TP-RA */ + + memset(diallingNum, 0, sizeof(diallingNum)); + + SmsUtilDecodeAddrField((char *) diallingNum, (unsigned char *) &pTPDU[position], &rcp_ton, &rcp_npi); + + position += 2; + + rcpAddr_len = strlen((char*) diallingNum); + if (rcpAddr_len % 2) + position += rcpAddr_len / 2 + 1; + else + position += rcpAddr_len / 2; + + if (rcp_ton == SIM_TON_INTERNATIONAL) { + rcpAddr[0] = '+'; + memcpy(&rcpAddr[1], diallingNum, rcpAddr_len); + rcpAddr[rcpAddr_len + 1] = '\0'; + } + else { + memcpy(rcpAddr, diallingNum, rcpAddr_len); + rcpAddr[rcpAddr_len] = '\0'; + } + + status_report.rcpAddr.DialNumLen = rcpAddr_len; + memcpy(status_report.rcpAddr.szDiallingNum, rcpAddr, rcpAddr_len); + status_report.rcpAddr.Npi = rcp_npi; + status_report.rcpAddr.Ton = rcp_ton; + + /* TP-SCTS */ + SmsUtilDecodeTimeStamp((unsigned char *) &pTPDU[position], &SCTimeStamp); + position += 7; + + /* TP-DT */ + SmsUtilDecodeTimeStamp((unsigned char *) &pTPDU[position], &DischargeTime); + position += 7; + + /* TP-ST */ + status_report.status = pTPDU[position]; + position++; + + /* TP-PI */ + status_report.paraInd = pTPDU[position]; + + mask = status_report.paraInd; + + if ((mask != 0xFF) && (mask != 0)) { + /* Increment only if mask is valid */ + position++; + + /* TP-PID */ + if (mask & 0x01) { + status_report.pId = pTPDU[position]; + position++; + } + + /* TP-DCS */ + if (mask & 0x02) { + SmsUtilDecodeDCS(&status_report.dcs, pTPDU[position]); + position++; + } + + if (mask & 0x04) { + /* TP-UDL */ + status_report.udl = pTPDU[position]; + position++; + + /* TP-UD */ + + status_report.userData = malloc(sizeof(unsigned char) * (TAPI_NETTEXT_SMDATA_SIZE_MAX + 1)); + + memset(status_report.userData, 0, sizeof(unsigned char) * (TAPI_NETTEXT_SMDATA_SIZE_MAX + 1)); + + if (status_report.dcs.alphabet_type == TAPI_NETTEXT_ALPHABET_DEFAULT) { + TS_BYTE inData[TAPI_NETTEXT_SMDATA_SIZE_MAX + 1]; + + memset(inData, 0x00, TAPI_NETTEXT_SMDATA_SIZE_MAX + 1); + + memcpy((void*) inData, (void*) &pTPDU[position], status_report.udl); + + SmsUtilUnpackGSMCode((char *) status_report.userData, inData, (TS_UINT8) status_report.udl); + } + } + } + + printf("*************************************\n"); + printf("Msg Type: STATUS_REPORT\n"); + + if (status_report.mms) + printf("MMS: No more messages are waiting for the MS in this SC\n"); + else if (!status_report.mms) + printf("MMS: More messages are waiting for the MS in this SC\n"); + + if (status_report.srq) + printf("SRQ: the result of an SMS COMMAND \n"); + else if (!status_report.srq) + printf("SRQ: the result of a SMS SUBMIT.\n"); + + if (status_report.udhi) + printf("UDHI: Contains a Header in addition to the short message.\n"); + else if (!status_report.udhi) + printf("UDHI: Only Short Message\n"); + + printf("STATUS:%x\n", status_report.status); + + if (status_report.status == 0x00) + printf("STATUS : Short message received by the SME\n"); + else if (status_report.status == 0x01) + printf("STATUS : Short message forwarded by the SC to the SME\nbut the SC is unable to confirm delivery\n"); + else if (status_report.status == 0x02) + printf("STATUS : Short message replaced by the SC\n"); + + printf("Recipient Number : %s\n", rcpAddr); + printf("SC Time Stamp : %d-%d-%d , %d:%d:%d\n", SCTimeStamp.year, SCTimeStamp.month, SCTimeStamp.day, SCTimeStamp.hour, SCTimeStamp.minute, + SCTimeStamp.second); + printf("Discharge Time : %d-%d-%d , %d:%d:%d\n", DischargeTime.year, DischargeTime.month, DischargeTime.day, DischargeTime.hour, DischargeTime.minute, + DischargeTime.second); + + if (mask & 0x04) + printf("Message : %s \n", status_report.userData); + + printf("*************************************\n"); + + return TRUE; +} + +void MsgCountNotification(int length, char *pData) +{ + static TelSmsStoredMsgCountInfo_t *countInfo; + + printf("length %d", length); + printf("pdata %s", pData); + + countInfo = (TelSmsStoredMsgCountInfo_t*) pData; + printf("In MsgCountNotification total cnt is %d, usedcnt is %d\n", countInfo->TotalCount, countInfo->UsedCount); + printf("In MsgCountNotification total cnt is %d, usedcnt is %d\n", countInfo->TotalCount, countInfo->UsedCount); +} + +void ReadMsgNotification(int length, char *pData) +{ + TelSmsData_t * sim_data; + int scaAddr_len = 0; + char * pTPDU; + int tpdu_len = 0; + TS_BYTE diallingNum[TAPI_NETTEXT_ADDRESS_LEN_MAX]; + TS_BYTE scaAddr[TAPI_NETTEXT_SCADDRESS_LEN_MAX]; //service center address + int sca_ton, sca_npi; + int position; + + sim_data = (TelSmsData_t *) pData; + printf("length in readmsg notification is %d\n", length); + + if (sim_data->MsgStatus == 0x00) + printf("Msg Staus : unknown msg\n"); + else if (sim_data->MsgStatus == 0x01) + printf("Msg Staus : received unread msg\n"); + else if (sim_data->MsgStatus == 0x02) + printf("Msg Staus : received read msg\n"); + else if (sim_data->MsgStatus == 0x03) + printf("Msg Staus : unsent msg\n"); + else if (sim_data->MsgStatus == 0x04) + printf("Msg Staus : stored sent msg\n"); + + if (sim_data->MsgStatus == 0x01 || sim_data->MsgStatus == 0x02) { + position = 0; + // SCA_ADDR + memset(diallingNum, 0, sizeof(diallingNum)); + + SmsUtilDecodeAddrField((char *) diallingNum, &sim_data->SmsData.szData[position], &sca_ton, &sca_npi); + + position += 2; //include Address-Length, Type of Address + + scaAddr_len = strlen((char *) diallingNum); + + if (scaAddr_len % 2) + position += scaAddr_len / 2 + 1; + else + position += scaAddr_len / 2; + + if (sca_ton == SIM_TON_INTERNATIONAL) { + scaAddr[0] = '+'; + memcpy(&scaAddr[1], diallingNum, scaAddr_len); + scaAddr[scaAddr_len + 1] = '\0'; + } + else { + memcpy(scaAddr, diallingNum, scaAddr_len); + scaAddr[scaAddr_len] = '\0'; + } + + tpdu_len = sim_data->SmsData.MsgLength - position; + + printf("SCA Number : %s tpdu_len is %d\n", scaAddr, tpdu_len); + + pTPDU = malloc(sizeof(TS_BYTE) * tpdu_len); + printf("bfor memcopy position is %d\n", position); + memcpy(pTPDU, &(sim_data->SmsData.szData[position]), tpdu_len); + printf("after memcpy\n"); + + DecodeSmsDeliverTpdu(tpdu_len, pTPDU); + } +} + +void MemoryFullNotification(int length, char *pData) +{ + int *memory_ind; + + memory_ind = (int *) pData; + printf("In memory full notification status %d\n", *memory_ind); +} + +void DeleteMsgNotification(int length, char *pData) +{ + tel_delete_sms_in_simMsg_status_ind *delete_ind; + + delete_ind = (tel_delete_sms_in_simMsg_status_ind *) pData; + printf("In deletenotifcation the result and index are %x %d\n", delete_ind->result, delete_ind->index); +} + +void SaveMsgNotification(int length, char *pData) +{ + tapi_nettext_save_status_ind *save_ind; + + save_ind = (tapi_nettext_save_status_ind *) pData; + printf("In savestatus noti, index %x result %x\n", save_ind->index, save_ind->result); +} + +void GetCBNotification(int length, char *pData) +{ + TelSmsCbConfig_t *CBConfig; + int i = 0; + + CBConfig = (TelSmsCbConfig_t *) pData; + + printf("=========CB Configuration=========\n"); + + /*** CB Enable/Diable ***/ + if (CBConfig->bCBEnabled == 0x01) + printf("Cell Broadcast Msg Enabled...\n"); + else if (CBConfig->bCBEnabled == 0x02) + printf("Cell Broadcast Msg Disabled...\n"); + + /*** Selected ID ***/ + if (CBConfig->SelectedId == 0x01) + printf("All CBMI is selected... \n"); + else if (CBConfig->SelectedId == 0x02) + printf("There are some selected CBMI...\n"); + + /*** CBMI Count ***/ + printf("CBMI Count: %d \n\n", CBConfig->MsgIdCount); + + /*** CBMI List ***/ + + if (CBConfig->MsgIdCount != 0) { + printf("----- CBMI List -----\n"); + + for (i = 0; i < CBConfig->MsgIdCount; i++) { + printf("No.%d - [0x%04x]\n", i, CBConfig->MsgIDs[i]); + } + + } + printf("\n==================================\n"); +} + +void Deliver_ReportNoti() +{ + printf("DELIVERY REPORT SUCCESS\n"); +} + +void get_preferred_bearer_noti(int length, char *pData) +{ + int svc = 0; + TelSmsBearerType_t *bearer; + + printf("get preferred bearer\n"); + bearer = (TelSmsBearerType_t *) pData; + printf("In GetPreferredBearer noti bearer:%d\n", *bearer); + svc = *bearer; + printf("svc:%d\n", svc); + + if (svc == TAPI_NETTEXT_BEARER_PS_ONLY) + printf("Packet Domain\n"); + else if (svc == TAPI_NETTEXT_BEARER_CS_ONLY) + printf("Circuit Switched\n"); + else if (svc == TAPI_NETTEXT_BEARER_PS_PREFERRED) + printf("Packet Domain preferred \n"); + else if (svc == TAPI_NETTEXT_BEARER_CS_PREFERRED) + printf("Circuit Switched preferred\n"); + +} + +void set_request_confirm_noti() +{ + printf("***Set Request confirm Notification*******\n"); + printf("Notification Received Successfully\n"); +} + +void param_get_noti(int length, char *pData) +{ + TelSmsParams_t *smsp_param; + + smsp_param = (TelSmsParams_t *) pData; + + printf("record index is %x\n", smsp_param->RecordIndex); + printf("record len is %x\n", smsp_param->RecordLen); + printf("alpha_id len is %lu \n", smsp_param->AlphaIdLen); + printf("alpha_id is %s \n", smsp_param->szAlphaId); + printf("param indicator is %xn", smsp_param->ParamIndicator); + printf("dest dialling num is %s\n", smsp_param->TpDestAddr.szDiallingNum); + printf("svcaddr dialling num is %s\n", smsp_param->TpSvcCntrAddr.szDiallingNum); + printf("pid %x\n", smsp_param->TpProtocolId); + printf("dcs is %x\n", smsp_param->TpDataCodingScheme); + printf("validity is %x\n", smsp_param->TpValidityPeriod); +} + +void Device_ReadyNoti(int length, char *pData) +{ + //TelSmsDeviceReadyInd *device_status; + + //device_status = (TelSmsDeviceReadyInd *)pData; + + //printf("In device ready noti the result is %d\n",device_status->Result); +} + +void param_count_noti(int length, char *pData) +{ + printf("In param_count_noti the record count:"); +} + +int tapi_sms_callback(const TelTapiEvent_t *TapiEvent, void *data) +{ + printf("\n****** Inside SMS Callback func........ ******\n"); + + int eventClass; + int eventType; + int requestId; + int status; + char *EventData = NULL; + int param1 = 0; + char *pData = NULL; + + int expected_event = (int) data; + + if (TapiEvent == NULL) { + printf("Event is NULL\n"); + return 0; + } + + eventClass = TapiEvent->EventClass; + eventType = TapiEvent->EventType; + requestId = TapiEvent->RequestId; + status = TapiEvent->Status; + EventData = (char *) TapiEvent->pData; + + if (EventData == NULL) { + printf("\n****** EventData is NULL.........******\n"); + } + else { + printf("\nClass:[%d], Event Type:[%d], RequestId:[%d], Status:[%d] \n", eventClass, eventType, requestId, status); + + param1 = strlen((char *) TapiEvent->pData); + printf("\n param1 = %d", param1); + if (TapiEvent->pData != NULL) { + pData = (char *) TapiEvent->pData; + printf("pData(size):%d\n", strlen(pData)); + } + } + + if (eventClass != TAPI_EVENT_CLASS_NETTEXT) { + return 0; + } + + switch (eventType) { + case TAPI_EVENT_NETTEXT_INCOM_IND: + printf("\n***************************************\n"); + printf("\n$$$$$$ INCOMING MESSAGE NOTIFICATION $$$$$$ \n"); + printf("param1(length):%d\n", param1); + // ReceiveMessage(param1,pData); + printf("\n***************************************\n"); + break; + + case TAPI_EVENT_NETTEXT_SENTSTATUS_CNF: + printf("\n***************************************\n"); + printf("\n$$$$$$ RECEIVE ACK NOTIFICATION $$$$$$ \n"); + printf("param1(length):%d\n", param1); + DecodeSmsSubmitReportTpdu(param1, pData); + printf("\n***************************************\n"); + break; + + case TAPI_EVENT_NETTEXT_CB_INCOM_IND: + printf("\n***************************************\n"); + printf("\n$$$$$$ INCOMING CB NOTIFICATION $$$$$$ \n"); + printf("length:%d\n", param1); + DecodeCellBroadcastMsg(param1, pData); + printf("\n***************************************\n"); + break; + + case TAPI_EVENT_NETTEXT_MEMORY_STATUS_IND: + printf("\n***************************************\n"); + printf("\n$$$$$$ MEMORYF FULL NOTIFICATION $$$$$$ \n"); + printf("param1(length):%d\n", param1); + MemoryFullNotification(param1, pData); + printf("\n***************************************\n"); + break; + + case TAPI_EVENT_NETTEXT_GET_COUNT_CNF: + printf("\n***************************************\n"); + printf("\n$$$GetMsgCountNotification$$$$\n"); + MsgCountNotification(param1, pData); + printf("\n***************************************\n"); + break; + + case TAPI_EVENT_NETTEXT_READ_SMS_CNF: + printf("\n***************************************\n"); + printf("\n$$Read Msg Notification $$$\n"); + printf("param1(length):%d\n", param1); + //ReadMsgNotification(param1, pData); + printf("\n***************************************\n"); + break; + + case TAPI_EVENT_NETTEXT_DELETE_STATUS_CNF: + printf("\n***************************************\n"); + printf("\n$$Delete Notification$$$\n"); + printf("param1(length):%d\n", param1); + DeleteMsgNotification(param1, pData); + printf("\n***************************************\n"); + break; + + case TAPI_EVENT_NETTEXT_SAVE_STATUS_CNF: + printf("\n***************************************\n"); + printf("\n$$Save Status Notification$$\n"); + printf("param1(length):%d\n", param1); + SaveMsgNotification(param1, pData); + printf("\n***************************************\n"); + break; + + case TAPI_EVENT_NETTEXT_GET_CB_CONFIG_CNF: + printf("\n***************************************\n"); + printf("\n$$$GET CB Config$$$\n"); + printf("param1(length):%d\n", param1); + GetCBNotification(param1, pData); + printf("\n***************************************\n"); + break; + + case TAPI_EVENT_NETTEXT_DELIVERY_REPORT_CNF: + printf("\n***************************************\n"); + printf("\n$$$ DELIVER REPORT NOTI$$$\n"); + Deliver_ReportNoti(); + printf("\n***************************************\n"); + break; + + case TAPI_EVENT_NETTEXT_GET_PARAM_CNF: + printf("\n***************************************\n"); + printf("\n$$$ GET PARAM NOTI$$$\n"); + printf("param1(length):%d\n", param1); + param_get_noti(param1, pData); + printf("\n***************************************\n"); + break; + + case TAPI_EVENT_NETTEXT_GET_SMSBEARER_CNF: + printf("\n****************************************\n"); + printf("\n$$$ GET PREFERRED BEARER$$$\n"); + printf("param1(length):%d\n", param1); + get_preferred_bearer_noti(param1, pData); + printf("\n****************************************\n"); + break; + + case TAPI_EVENT_NETTEXT_SET_REQUEST_CNF: + printf("\n***************************************\n"); + printf("\n$$$ SET REQUESTCONFIRM NOTI$$$\n"); + set_request_confirm_noti(); + printf("\n***************************************\n"); + break; + + case TAPI_EVENT_NETTEXT_DEVICE_READY_IND: + printf("\n***************************************\n"); + printf("\n$$$ DEVICE READY NOTI$$$\n"); + Device_ReadyNoti(param1, pData); + printf("\n***************************************\n"); + break; + + case TAPI_EVENT_NETTEXT_PARAM_COUNT_IND: + printf("\n***************************************\n"); + printf("\n$$$ PARAM COUNT NOTI$$$\n"); + param_count_noti(param1, pData); + printf("\n***************************************\n"); + break; + + default: + printf("\n****************DEFAULT***************\n"); + break; + } + + if (eventType == expected_event) + TimeOutFun(NULL); + + return 0; +}//end callback + + diff --git a/TC/telephony_TC/sms/unit/sms_callback_util.h b/TC/telephony_TC/sms/unit/sms_callback_util.h new file mode 100644 index 0000000..d54b9bf --- /dev/null +++ b/TC/telephony_TC/sms/unit/sms_callback_util.h @@ -0,0 +1,30 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * 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 _SMS_CALLBACK_UTIL_H_ +#define _SMS_CALLBACK_UTIL_H_ + +#include "async_util.h" +#include "sms_util.h" + +int tapi_sms_callback(const TelTapiEvent_t *TapiEvent, void *data); + +#endif diff --git a/TC/telephony_TC/sms/unit/sms_util.c b/TC/telephony_TC/sms/unit/sms_util.c new file mode 100644 index 0000000..c4cefba --- /dev/null +++ b/TC/telephony_TC/sms/unit/sms_util.c @@ -0,0 +1,956 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * 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 "sms_util.h" +#include + +void reverse(char *x, int len) +{ + int i, j = len - 1; + + for (i = 0; i < j; i++) { + int t = x[i]; + x[i] = x[j]; + x[j--] = t; + } +} + +char *AcItoa(int n, char *str, int b) +{ + int i = 0; + + do { + str[i++] = "0123456789ABCDEF"[n % b]; + } while ((n /= b) > 0); + + reverse(str, i); + str[i] = '\0'; + + return str; +} + +int AcToupper(int ch) +{ + return (('a' <= (ch) && (ch) <= 'z') ? ((ch) - ('a' - 'A')) : (ch)); +} + +char *SmsUtilUnpackGSMCode(char *szData, const TS_BYTE *pIn, int in_len) +{ + int i; + int pos = 0; + int shift = 0; + + /* If the number of fill bits != 0, then it would cause an additional shift */ + /* + if ( shift != 0 ) + pos = pos + 1; + + if ( shift ==7 ) + shift = 0; + */ + + for (i = 0; i < in_len; i++, pos++) { + szData[i] = (pIn[pos] << shift) & 0x7F; + + if (pos != 0) { + /* except the first byte, a character contains some bits + ** from the previous byte. + */ + szData[i] |= pIn[pos - 1] >> (8 - shift); + } + + shift++; + + if (shift == 7) { + shift = 0; + + /* a possible extra complete character is available */ + i++; + szData[i] = pIn[pos] >> 1; + + if (szData[i] == 0) { + /* this is the end of the input, quit */ + break; + } + } + } + + return szData; +} + +int SmsUtilPackGSMCode(TS_BYTE *pOut, const char *szData, int in_len) +{ + int i; + int pos; + int shift = 0; + //shift = fill_bits; + + // memset( out, 0, out_len_max ); + + /* pack the ASCII characters + */ + /* + if ( shift == 7 ) + shift = 0; + */ + + for (pos = 0, i = 0; /*pos < out_len_max &&*/i < in_len; pos++, i++) { + /* pack the low bits */ + pOut[pos] = szData[i] >> shift; + + if (i + 1 < in_len) { + /* pack the high bits using the low bits of the next character */ + pOut[pos] |= szData[i + 1] << (7 - shift); + + shift++; + + if (shift == 7) { + shift = 0; + i++; + } + } + } + + /* done */ + return pos; +} + +void SmsUtilConvertBCD2Digit(char *pDigits, char *pBCD, int digitLen) +{ + int i, bcdLen; + char c[2]; + unsigned char higher, lower; + + //SysDebug( ( MID_SMS, "__SmsConvertBCD2Digit: start.\n" ) ); + + if (pBCD == NULL || pDigits == NULL) { + printf("__SmsConvertBCD2Digit: pBCD == NULL || pDigits == NULL. return.\n"); + return; + } + + if (digitLen == 0) { + //printf("__SmsConvertBCD2Digit: digitLen == 0. return.\n" ); + + pDigits[0] = 0x00; + + return; + } + + if (digitLen % 2) + bcdLen = digitLen / 2 + 1; + else + bcdLen = digitLen / 2; + + memset(pDigits, 0, bcdLen * 2); + + for (i = 0; i < bcdLen; i++) { + lower = pBCD[i] & 0x0F; // get low nibble + + if (lower == 0x0A) + lower = '*'; + else if (lower == 0x0B) + lower = '#'; + else if (lower == 0x0C) + lower = 'p'; //DTMF Control pDigits seperator + else if (lower == 0x0F) + lower = 0; + else { + AcItoa(lower, c, 16); + lower = (char) AcToupper(c[0]); + } + + higher = (pBCD[i] >> 4) & 0x0F; // get high nibble + + if (higher == 0x0A) + higher = '*'; // =0x2A + else if (higher == 0x0B) + higher = '#'; // =0x23 + else if (higher == 0x0C) + higher = 'p'; // =0x70, DTMF Control pDigits seperator + else if (higher == 0x0F) // if higher semi-octet is 0x0F, filled bits. + { + //higher = 0; + sprintf(pDigits + strlen(pDigits), "%c", lower); + pDigits[/*digitLen-1*/bcdLen * 2 - 1] = '\0'; + + //printf("__SmsConvertBCD2Digit: pDigits [%s].\n", pDigits ); + + return; + } + else { + AcItoa(higher, c, 16); + higher = (char) AcToupper(c[0]); + } + + //sprintf(pDigits, "%s%c%c", pDigits, lower, higher); + sprintf(pDigits + strlen(pDigits), "%c%c", lower, higher); + } + + pDigits[digitLen] = '\0'; + + //printf("__SmsConvertBCD2Digit: pDigits [%s].\n", pDigits ); +} + +void SmsUtilConvertDigit2BCD(char *pBCD, char *pDigits, int digitLen) +{ + int i, j, digit; + + unsigned char higher, lower; + + if (pBCD == NULL || pDigits == NULL) + return; + + // 0123456789 -> 1032547698 + for (i = 0, j = 0; i < digitLen; i = i + 2, j++) { + if (pDigits[i] == '*') + digit = 0x0A; + else if (pDigits[i] == '#') + digit = 0x0B; + else if (AcToupper(pDigits[i]) == 'P') + digit = 0x0C; + else + digit = (int) (pDigits[i] - '0'); + + lower = digit & 0x0F; + + if (digitLen != i + 1) { + if (pDigits[i + 1] == '*') + digit = 0x0A; + else if (pDigits[i + 1] == '#') + digit = 0x0B; + else if (AcToupper(pDigits[i + 1]) == 'P') + digit = 0x0C; + else + digit = (int) (pDigits[i + 1] - '0'); + + higher = digit & 0x0F; + } + else { + higher = 0xFF; + } + + pBCD[j] = (higher << 4) | lower; + } +} + +TmDateTime* SmsUtilDecodeTimeStamp(unsigned char *pTimeStamp, TmDateTime *tmDateTime) +{ + //TmDateTime tmDateTime; + char szBuf[3]; + //TS_UINT32 time; + + if (pTimeStamp == NULL) + return NULL; + + SmsUtilConvertBCD2Digit(szBuf, (char*) &pTimeStamp[0], 2); + tmDateTime->year = atoi(szBuf) + 2000; + if ((tmDateTime->year >= 1900 + MAX_YEAR)/* && ( tmDateTime->year < 2000 + BASE_YEAR )*/) + tmDateTime->year -= 100; + SmsUtilConvertBCD2Digit(szBuf, (char*) &pTimeStamp[1], 2); + tmDateTime->month = atoi(szBuf); + SmsUtilConvertBCD2Digit(szBuf, (char*) &pTimeStamp[2], 2); + tmDateTime->day = atoi(szBuf); + SmsUtilConvertBCD2Digit(szBuf, (char*) &pTimeStamp[3], 2); + tmDateTime->hour = atoi(szBuf); + SmsUtilConvertBCD2Digit(szBuf, (char*) &pTimeStamp[4], 2); + tmDateTime->minute = atoi(szBuf); + SmsUtilConvertBCD2Digit(szBuf, (char*) &pTimeStamp[5], 2); + tmDateTime->second = atoi(szBuf); + + if ((tmDateTime->year < 1900 + BASE_YEAR) || (tmDateTime->year > 1900 + MAX_YEAR)) + tmDateTime->year = 1900 + BASE_YEAR; + + /* + time = TmDateTimeToSeconds( &tmDateTime ); + if ( time > MAX_SECONDS ) + time = MAX_SECONDS; + + */ + + return tmDateTime; +} + +unsigned char *SmsUtilEncodeTimeStamp(TmDateTime *tmDateTime, unsigned char *pTimeStamp) +{ + //TmDateTime tmDateTime; + char szBuf[3]; + int year; + + if (pTimeStamp == NULL) + return NULL; + + memset((void*) pTimeStamp, 0x00, sizeof(unsigned char) * 7); + + //TmSecondsToDateTime( timeStamp, &tmDateTime ); + + year = tmDateTime->year - 2000; + if (year < 0) + year += 100; + sprintf(szBuf, "%02d", year); + SmsUtilConvertDigit2BCD((char*) &pTimeStamp[0], szBuf, 2); + sprintf(szBuf, "%02d", tmDateTime->month); + SmsUtilConvertDigit2BCD((char*) &pTimeStamp[1], szBuf, 2); + sprintf(szBuf, "%02d", tmDateTime->day); + SmsUtilConvertDigit2BCD((char*) &pTimeStamp[2], szBuf, 2); + sprintf(szBuf, "%02d", tmDateTime->hour); + SmsUtilConvertDigit2BCD((char*) &pTimeStamp[3], szBuf, 2); + sprintf(szBuf, "%02d", tmDateTime->minute); + SmsUtilConvertDigit2BCD((char*) &pTimeStamp[4], szBuf, 2); + sprintf(szBuf, "%02d", tmDateTime->second); + SmsUtilConvertDigit2BCD((char*) &pTimeStamp[5], szBuf, 2); + + /* ignore Time zone (assume it is using 0x00 as default) + timeZone = TmGetTimeZoneOffset() /15; + if ( timeZone < 0 ) + absTimeZone = -timeZone; + else + absTimeZone = timeZone; + */ + + sprintf(szBuf, "%02d", 0); + SmsUtilConvertDigit2BCD((char*) &pTimeStamp[6], szBuf, 2); + + //if ( timeZone < 0 ) + // pTimeStamp[6] |= 0x80; + + return pTimeStamp; +} + +void SmsUtilDecodeAddrField(char *diallingNum, unsigned char *pAddrField, int *result_ton, int *result_npi) +{ + int index = 0; + int ton, npi; + int dialnumLen = 0; + + ton = (pAddrField[index + 1] & 0x70) >> 4; + npi = pAddrField[index + 1] & 0x0F; + + if (ton != SIM_TON_ALPHA_NUMERIC) { + // Origination/Destination address �ʵ忡���� length�� ���� address length + // origination/destination address �ʵ��� ��� length�� 0 �� ���� number type/plan �ʵ�� 0xFF ���� ���´�. + dialnumLen = pAddrField[index++]; + } + else { + dialnumLen = (((pAddrField[index++] + 1) / 2) * 8) / 7; + } + + // SIM_SMSP_ADDRESS_LEN ���� address length �� ũ�� SIM_SMSP_ADDRESS_LEN ��ŭ�� ��ȯ�� �Ѵ�. + if (dialnumLen > SIM_SMSP_ADDRESS_LEN) { + dialnumLen = SIM_SMSP_ADDRESS_LEN; + } + + //printf(" dialnumLen = %d\n", dialnumLen ); + + index++; /* ignore Type of Address field */ + + if (ton != SIM_TON_ALPHA_NUMERIC) { + SmsUtilConvertBCD2Digit(diallingNum, (char*) &pAddrField[index], dialnumLen); + } + else { + SmsUtilUnpackGSMCode(diallingNum, &pAddrField[index], dialnumLen); + } + + //printf( "__SmsDecodeAddrField: diallingNum [%s].\n", (char*) diallingNum ); + + *result_ton = ton; + *result_npi = npi; +} + +int SmsUtilEncodeAddrField(unsigned char *pAddrField, char *diallingNum, int dialnumLen, int ton, int npi) +{ + int index = 0; + + if (diallingNum == NULL || pAddrField == NULL) { + printf("SmsUtilEncodeAddrField: invalid input\n"); + return -1; + } + + if (ton != SIM_TON_ALPHA_NUMERIC) { + // Origination/Destination address �ʵ忡���� length�� ���� address length + pAddrField[index++] = (unsigned char) dialnumLen; + printf("SmsUtilEncodeAddrField: addr len packet: %d\n", pAddrField[index]); + } + else { + pAddrField[index] = (unsigned char) (((dialnumLen * 7 + 7) / 8) * 2); + + // ������ ����Ʈ���� ���� 4��Ʈ�� ������ ������ length �ʵ尪�� -1�� �Ѵ�. + if (((dialnumLen * 7) % 8) <= 4) + pAddrField[index]--; + + printf("SmsUtilEncodeAddrField: addr len packet: %d out of SIM_TON_ALPAHA\n", pAddrField[index]); + + index++; + } + + SET_TON_NPI(pAddrField[index], ton, npi); + + index++; // SET_TON_NPI �� MACRO �̹Ƿ� ���ο��� ������Ű�� ���� + + if (ton != SIM_TON_ALPHA_NUMERIC) { + SmsUtilConvertDigit2BCD((char*) &pAddrField[index], (char*) diallingNum, dialnumLen); + + if (dialnumLen % 2) + index += dialnumLen / 2 + 1; + else + index += dialnumLen / 2; + } + else { + index += SmsUtilPackGSMCode(&pAddrField[index], diallingNum, (int) dialnumLen); + } + + return index; +} + +int SmsUtilDecodeScAddrField(TelSmsAddressInfo_t *pSmsAddrField, TS_BYTE *pAddrField) +{ + printf("SmsUtilDecodeScAddrField\n"); + int index = 0; + int length = 0; + + //SysDebug( ( MID_SMS, "__SmsDecodeScAddrField: start.\n" ) ); + + if (pSmsAddrField == NULL || pAddrField == NULL) { + printf("SmsUtilDecodeScAddrField: pSimAddrField or pAddrField is NULL.\n"); + return 0; + } + + // Service Center address �ʵ忡���� length�� �ڿ� ������ byte�� �� + // -> ���� address ���̴� TON/API ����Ʈ�� �����ϰ� ������ ����Ʈ�� 2�� or 2�� - 1(���� ���̰� Ȧ���ΰ��) + length = pAddrField[index]; + // ������ ���� �޽����� ��쿡�� service center address�� ���� ���� �ִ�. + // �� ��쿡 length �� 0 �̸� number type, plan �� ��� ��� + // length �� 1 �̸� type, plan �� �ִ� ��� + if (length > 1) { + pSmsAddrField->DialNumLen = (pAddrField[index++] - 1) * 2; // -1�� TON/API �ʵ� + + // SIM_SMSP_ADDRESS_LEN ���� address length �� ũ�� SIM_SMSP_ADDRESS_LEN ��ŭ�� ��ȯ�� �Ѵ�. + if (pSmsAddrField->DialNumLen > SIM_SMSP_ADDRESS_LEN) { + pSmsAddrField->DialNumLen = SIM_SMSP_ADDRESS_LEN; + } + + pSmsAddrField->Ton = (pAddrField[index] & 0x70) >> 4; + pSmsAddrField->Npi = pAddrField[index] & 0x0F; + + index++; /* ignore Type of Address field */ + + SmsUtilConvertBCD2Digit((char*) pSmsAddrField->szDiallingNum, (char*) &pAddrField[index], pSmsAddrField->DialNumLen); + + printf("SmsUtilDecodeScAddrField: diallingNum [%s].\n", (char*) pSmsAddrField->szDiallingNum); + printf("length=%d , ton %d, npi =%d\n", pSmsAddrField->DialNumLen, pSmsAddrField->Ton, pSmsAddrField->Npi); + } + + return ++length; +} + +int SmsUtilEncodeScAddrField(TS_BYTE *pAddrField, TelSmsAddressInfo_t *pSmsAddrField) +{ + int index = 0; + + if (pSmsAddrField == NULL || pAddrField == NULL) + return -1; + + // Service Center address �ʵ忡���� length�� �ڿ� ������ byte�� �� + // -> ���� address ���̴� TON/API ����Ʈ�� �����ϰ� ������ ����Ʈ�� 2�� or 2�� - 1(���� ���̰� Ȧ���ΰ��) + if (pSmsAddrField->DialNumLen % 2) { + pAddrField[index++] = pSmsAddrField->DialNumLen / 2 + 1 + 1; // +1 �� TON/NPI �ʵ�, Ȧ������ ���� ������ ���߱� ���� �ѹ� �� +1 + } + else { + pAddrField[index++] = pSmsAddrField->DialNumLen / 2 + 1; // +1 �� TON/NPI �ʵ� + } + + SET_TON_NPI( pAddrField[index], pSmsAddrField->Ton, pSmsAddrField->Npi ); + + index++; // SET_TON_NPI �� MACRO �̹Ƿ� ���ο��� ������Ű�� ���׹߻� + + SmsUtilConvertDigit2BCD((char*) &pAddrField[index], (char*) pSmsAddrField->szDiallingNum, pSmsAddrField->DialNumLen); + + if (pSmsAddrField->DialNumLen % 2) + index += pSmsAddrField->DialNumLen / 2 + 1; + else + index += pSmsAddrField->DialNumLen / 2; + + return index; +} + +void SmsUtilDecodeDCS(tapi_nettext_coding_scheme *pCodingScheme, unsigned char dcs) +{ + assert( pCodingScheme != NULL ); + + memset(pCodingScheme, 0, sizeof(tapi_nettext_coding_scheme)); + + if (dcs < 0x40) // bits 7..4 = 00xx : general data coding indication + { + pCodingScheme->coding_group_type = TAPI_NETTEXT_CODGRP_SM_GENERAL_DCS; + + if (dcs & 0x20) // bit 5 = 1 : indicates the text is compressed + pCodingScheme->bCompressed = TRUE; + + if (dcs & 0x10) // bit 4 = 1 : indicates that bits 1 to 0 have a message class meaning + { + pCodingScheme->bmsg_class_set = TRUE; + + switch (dcs & 0x03) // bits 1 to 0 : message class + { + case 0x00: + pCodingScheme->class_type = TAPI_NETTEXT_CLASS_0; + break; + case 0x01: + pCodingScheme->class_type = TAPI_NETTEXT_CLASS_1; + break; + case 0x02: + pCodingScheme->class_type = TAPI_NETTEXT_CLASS_2; + break; + case 0x03: + pCodingScheme->class_type = TAPI_NETTEXT_CLASS_3; + break; + } + } + else { + // bit 4 = 0 : indicates that bits 1 to 0 are reserved and have no message class meaning + pCodingScheme->class_type = TAPI_NETTEXT_CLASS_NONE; + } + + switch (dcs & 0x0C) // bits 4 to 3 : character set + { + case 0x00: + pCodingScheme->alphabet_type = TAPI_NETTEXT_ALPHABET_DEFAULT; + break; + case 0x04: + pCodingScheme->alphabet_type = TAPI_NETTEXT_ALPHABET_8BIT; + break; + case 0x08: + pCodingScheme->alphabet_type = TAPI_NETTEXT_ALPHABET_UCS2; + break; + case 0x0C: + pCodingScheme->alphabet_type = TAPI_NETTEXT_ALPHABET_MAX; + break; + } + } + else if (dcs >= 0x40 && dcs < 0x80) // bits 7..4 = 01xx : message marked for automatic deletion group. bits 5..0 are coded exactly the same as group 00xx + { + pCodingScheme->coding_group_type = TAPI_NETTEXT_CODGRP_SM_AUTO_DELETION; + + if (dcs & 0x20) // bit 5 = 1 : indicates the text is compressed + pCodingScheme->bCompressed = TRUE; + + if (dcs & 0x10) // bit 4 = 1 : indicates that bits 1 to 0 have a message class meaning + { + pCodingScheme->bmsg_class_set = TRUE; + + switch (dcs & 0x03) // bits 1 to 0 : message class + { + case 0x00: + pCodingScheme->class_type = TAPI_NETTEXT_CLASS_0; + break; + case 0x01: + pCodingScheme->class_type = TAPI_NETTEXT_CLASS_1; + break; + case 0x02: + pCodingScheme->class_type = TAPI_NETTEXT_CLASS_2; + break; + case 0x03: + pCodingScheme->class_type = TAPI_NETTEXT_CLASS_3; + break; + } + } + else { + // bit 4 = 0 : indicates that bits 1 to 0 are reserved and have no message class meaning + pCodingScheme->class_type = TAPI_NETTEXT_CLASS_NONE; + } + + switch (dcs & 0x0C) // bits 4 to 3 : character set + { + case 0x00: + pCodingScheme->alphabet_type = TAPI_NETTEXT_ALPHABET_DEFAULT; + break; + case 0x04: + pCodingScheme->alphabet_type = TAPI_NETTEXT_ALPHABET_8BIT; + break; + case 0x08: + pCodingScheme->alphabet_type = TAPI_NETTEXT_ALPHABET_UCS2; + break; + case 0x0C: + pCodingScheme->alphabet_type = TAPI_NETTEXT_ALPHABET_MAX; + break; + } + } + // bits 7..4 = 1000 ~ 1011 : reserved + else if (dcs == 0xC0) // bits 7..4 = 1100 : message waiting indication group, discard message + { + pCodingScheme->coding_group_type = TAPI_NETTEXT_CODGRP_SM_WAITING_DISCARD; + } + else if (dcs < 0xE0) { + pCodingScheme->coding_group_type = TAPI_NETTEXT_CODGRP_SM_WAITING_STORE; + + if (dcs & 0x08) + pCodingScheme->bmsg_ind_active = TRUE; + + switch (dcs & 0x03) { + case 0x00: + pCodingScheme->waiting_type = TAPI_NETTEXT_WAITING_VOICE_MSG; + break; + case 0x01: + pCodingScheme->waiting_type = TAPI_NETTEXT_WAITING_FAX_MSG; + break; + case 0x02: + pCodingScheme->waiting_type = TAPI_NETTEXT_WAITING_EMAIL_MSG; + break; + case 0x03: + pCodingScheme->waiting_type = TAPI_NETTEXT_WAITING_OTHER_MSG; + break; + } + } + else if (dcs < 0xF0) { + pCodingScheme->coding_group_type = TAPI_NETTEXT_CODGRP_SM_WAITING_STORE_UCS2; + + if (dcs & 0x08) + pCodingScheme->bmsg_ind_active = TRUE; + + switch (dcs & 0x03) { + case 0x00: + pCodingScheme->waiting_type = TAPI_NETTEXT_WAITING_VOICE_MSG; + break; + case 0x01: + pCodingScheme->waiting_type = TAPI_NETTEXT_WAITING_FAX_MSG; + break; + case 0x02: + pCodingScheme->waiting_type = TAPI_NETTEXT_WAITING_EMAIL_MSG; + break; + case 0x03: + pCodingScheme->waiting_type = TAPI_NETTEXT_WAITING_OTHER_MSG; + break; + } + } + else { + pCodingScheme->coding_group_type = TAPI_NETTEXT_CODGRP_SM_CLASS_CODING; + + if (dcs & 0x04) + pCodingScheme->alphabet_type = TAPI_NETTEXT_ALPHABET_8BIT; + + switch (dcs & 0x03) { + case 0x00: + pCodingScheme->class_type = TAPI_NETTEXT_CLASS_0; + break; + case 0x01: + pCodingScheme->class_type = TAPI_NETTEXT_CLASS_1; + break; + case 0x02: + pCodingScheme->class_type = TAPI_NETTEXT_CLASS_2; + break; + case 0x03: + pCodingScheme->class_type = TAPI_NETTEXT_CLASS_3; + break; + } + } +} + +void SmsUtilEncodeDCS(TS_BYTE *pDCS, tapi_nettext_coding_scheme *pCodingScheme) +{ + printf("SmsUtilEncodeDCS Start\n"); + TS_BYTE dcs = 0x00; + + assert( pCodingScheme != NULL ); + + switch (pCodingScheme->coding_group_type) { + case TAPI_NETTEXT_CODGRP_SM_GENERAL_DCS: // bit 7..4 is 00xx + if (pCodingScheme->bCompressed) + dcs |= 0x20; // bit 5 is 1 + + if (pCodingScheme->bmsg_class_set) { + dcs |= 0x10; // bit 4 is 1 + + switch (pCodingScheme->class_type) { + case TAPI_NETTEXT_CLASS_0: // bit 1..0 is 00 + dcs |= 0x00; + break; + case TAPI_NETTEXT_CLASS_1: // bit 1..0 is 01 + dcs |= 0x01; + break; + case TAPI_NETTEXT_CLASS_2: // bit 1..0 is 10 + dcs |= 0x02; + break; + case TAPI_NETTEXT_CLASS_3: // bit 1..0 is 11 + dcs |= 0x03; + break; + default: + break; + } + } + + switch (pCodingScheme->alphabet_type) { + case TAPI_NETTEXT_ALPHABET_DEFAULT: // bit 3..2 is 00 + dcs |= 0x00; + break; + case TAPI_NETTEXT_ALPHABET_8BIT: // bit 3..2 is 01 + dcs |= 0x04; + break; + case TAPI_NETTEXT_ALPHABET_UCS2: // bit 3..2 is 10 + dcs |= 0x08; + break; + default: // bit 3..2 is 11 + dcs |= 0x0C; + break; + } + break; + + case TAPI_NETTEXT_CODGRP_SM_WAITING_DISCARD: // bit 7..4 is 1100 + dcs |= 0xC0; + break; + + case TAPI_NETTEXT_CODGRP_SM_WAITING_STORE: // bit 7..4 is 1101 + dcs |= 0xD0; + + if (pCodingScheme->bmsg_ind_active) // bit 3..2 is 10 + dcs |= 0x08; + + switch (pCodingScheme->waiting_type) { + case TAPI_NETTEXT_WAITING_VOICE_MSG: // bit 1..0 is 00 + dcs |= 0x00; + break; + case TAPI_NETTEXT_WAITING_FAX_MSG: // bit 1..0 is 01 + dcs |= 0x01; + break; + case TAPI_NETTEXT_WAITING_EMAIL_MSG: // bit 1..0 is 10 + dcs |= 0x02; + break; + case TAPI_NETTEXT_WAITING_OTHER_MSG: // bit 1..0 is 11 + dcs |= 0x03; + break; + default: + break; + } + break; + + case TAPI_NETTEXT_CODGRP_SM_WAITING_STORE_UCS2: // bit 7..4 is 1110 + dcs |= 0xE0; + + if (pCodingScheme->bmsg_ind_active) // bit 3..2 is 10 + dcs |= 0x08; + + switch (pCodingScheme->waiting_type) { + case TAPI_NETTEXT_WAITING_VOICE_MSG: // bit 1..0 is 00 + dcs |= 0x00; + break; + case TAPI_NETTEXT_WAITING_FAX_MSG: // bit 1..0 is 01 + dcs |= 0x01; + break; + case TAPI_NETTEXT_WAITING_EMAIL_MSG: // bit 1..0 is 10 + dcs |= 0x02; + break; + case TAPI_NETTEXT_WAITING_OTHER_MSG: // bit 1..0 is 11 + dcs |= 0x03; + break; + default: + break; + } + + break; + case TAPI_NETTEXT_CODGRP_SM_CLASS_CODING: // bit 7..4 is 1111 + dcs |= 0xF0; + + switch (pCodingScheme->alphabet_type) { + case TAPI_NETTEXT_ALPHABET_DEFAULT: // bit 2 is 0 + dcs |= 0x00; + break; + case TAPI_NETTEXT_ALPHABET_8BIT: // bit 2 is 1 + dcs |= 0x04; + break; + default: + break; + } + + switch (pCodingScheme->class_type) { + case TAPI_NETTEXT_CLASS_0: // bit 1..0 is 00 + break; + case TAPI_NETTEXT_CLASS_1: // bit 1..0 is 01 + dcs |= 0x01; + break; + case TAPI_NETTEXT_CLASS_2: // bit 1..0 is 10 + dcs |= 0x02; + break; + case TAPI_NETTEXT_CLASS_3: // bit 1..0 is 11 + dcs |= 0x03; + break; + default: + break; + } + break; + + default: + break; + } + + memcpy(pDCS, &dcs, sizeof(TS_BYTE)); + + printf("SmsUtilEncodeDCS End\n"); +} + +TS_UINT8 SmsUtilEncodeValidity(TS_BYTE *pValidity, tapi_nettext_vp *pVP) +{ + TS_UINT8 pos = 0; + + switch (pVP->vp_type) { + case TAPI_NETTEXT_VP_NOT_USED: + break; + + case TAPI_NETTEXT_VP_RELATIVE: + pValidity[pos] = (TS_UINT8) pVP->vpValue; + pos++; + break; + + case TAPI_NETTEXT_VP_ABSOLUTE: + //TO DO + //SmsUtilEncodeTimeStamp( pValidity, pVP->vpValue ); + pos += 7; + break; + + case TAPI_NETTEXT_VP_ENHANCED: + break; + } + + return pos; +} + +void EncodeSmsSubmitTPDU(TelSmsDatapackageInfo_t *pDataPackage, char *diallingNum, int dialNumLen, char *msg, int msg_len) +{ + TPDU_SMS_SUBMIT tpdu_submit; + TS_BYTE packet[TAPI_NETTEXT_MSG_SIZE_MAX]; + TS_UINT8 tp_mr = 0x01; + TS_UINT8 tp_pid = 0; //reaplace type (65) + TS_UINT8 tp_dcs; //=17; //class_1(17),class_2(18) + TS_UINT8 tp_vp; + + int pos; + int index = 0, ScIndex = 0; + int i; + + char *SCA = VALID_SCA_NUM; + + memset(packet, 0, TAPI_NETTEXT_MSG_SIZE_MAX); + + ScIndex = SmsUtilEncodeAddrField(pDataPackage->Sca, SCA, strlen(SCA), 0x01, 0x01); + + printf("ScIndex is %d\n", ScIndex); + + for (i = 0; i < strlen((char *) pDataPackage->Sca); i++) + printf("[%02x]", pDataPackage->Sca[i]); + printf("\n"); + + tpdu_submit.msg_type = SMS_TPDU_SUBMIT; + tpdu_submit.rd = TRUE; //false :accept duplicate msg , true: reject duplicate msg + tpdu_submit.vpf = TAPI_NETTEXT_VP_RELATIVE; + tpdu_submit.srr = TRUE; //false :A status report is not requested , true: A status report is requested + tpdu_submit.udhi = FALSE; //false: contains only the short message , true :a Header in addition to the short message + tpdu_submit.rp = TRUE; //false :TP Reply Path parameter is not set in this SMS SUBMIT, true : TP Reply Path parameter is set in this SMS SUBMIT + + packet[index] = tpdu_submit.msg_type; + packet[index] |= tpdu_submit.rd ? 0x04 : 0; + packet[index] |= tpdu_submit.vpf << 3; + packet[index] |= tpdu_submit.srr ? 0x20 : 0; + packet[index] |= tpdu_submit.udhi ? 0x40 : 0; + packet[index] |= tpdu_submit.rp ? 0x80 : 0; + + index++; + printf("index of message ref is %d, msgref is %d\n", index, tp_mr); + + packet[index++] = tp_mr; + + index += SmsUtilEncodeAddrField(packet + index, diallingNum, dialNumLen, 0x01, 0x01); + + //printf("DESTINATTION ADDR Encoded =========\n"); + packet[index++] = tp_pid; + + tpdu_submit.dcs.bCompressed = FALSE; + tpdu_submit.dcs.bmsg_class_set = TRUE; + tpdu_submit.dcs.coding_group_type = TAPI_NETTEXT_CODGRP_SM_GENERAL_DCS; + tpdu_submit.dcs.alphabet_type = TAPI_NETTEXT_ALPHABET_DEFAULT; + tpdu_submit.dcs.class_type = TAPI_NETTEXT_CLASS_2; + + SmsUtilEncodeDCS(&tp_dcs, &tpdu_submit.dcs); + + packet[index++] = tp_dcs; + + tpdu_submit.vp.vp_rel_type = TAPI_NETTEXT_VP_REL_6H; + tpdu_submit.vp.vp_type = TAPI_NETTEXT_VP_RELATIVE; + tpdu_submit.vp.vpValue = 0xff; + + SmsUtilEncodeValidity(&tp_vp, &tpdu_submit.vp); + + //tp_vp =65; + packet[index++] = tp_vp; + packet[index++] = msg_len; + + /*********TP-UD **********/ + if (tpdu_submit.dcs.alphabet_type == TAPI_NETTEXT_ALPHABET_DEFAULT) { + pos = SmsUtilPackGSMCode(packet + index, msg, msg_len); + index += pos; + } + + printf("\nSend packet to phonseSever[%d] -----\n", index); + + for (i = 0; i < index; i++) { + printf("[%02x]", packet[i]); + if (i % 10 == 9) + printf("\n"); + } + printf("\n"); + + // Copy the packet to the pDataPackage + pDataPackage->MsgLength = index; + memcpy(pDataPackage->szData, packet, index); +} + +void PrepareMessage(TelSmsDatapackageInfo_t *pDataPackage) +{ + int msg_len = 0; + char buf[512]; + char message[512]; + char diallingNum[TAPI_NETTEXT_ADDRESS_LEN_MAX]; + int diallingNum_len = 0; + + memset(buf, 0, sizeof(buf)); + memset(diallingNum, 0, sizeof(diallingNum)); + memset(message, 0, sizeof(message)); + + strcpy(message, "This is a test message"); + strncpy(diallingNum, RECEIPIENT, TAPI_NETTEXT_ADDRESS_LEN_MAX); + + diallingNum_len = strlen(diallingNum); + printf("dialling num %s and dialling num len is %d\n", diallingNum, diallingNum_len); + diallingNum[diallingNum_len] = 0; + // diallingNum_len = diallingNum_len-1; + + msg_len = strlen(message); + + printf("==========================\n"); + printf("To :%s\n", diallingNum); + printf("Message: %s\nMsg Length:%d\n", message, msg_len); + printf("Dialling number Length : %d\n", diallingNum_len); + printf("==========================\n"); + + EncodeSmsSubmitTPDU(pDataPackage, diallingNum, diallingNum_len, message, msg_len); +} + diff --git a/TC/telephony_TC/sms/unit/sms_util.h b/TC/telephony_TC/sms/unit/sms_util.h new file mode 100644 index 0000000..8f3dd39 --- /dev/null +++ b/TC/telephony_TC/sms/unit/sms_util.h @@ -0,0 +1,455 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * 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 __TET_SMS_UTIL_H_ +#define __TET_SMS_UTIL_H_ + +#include "ITapiNetText.h" + +#define SIM_TON_UNKNOWN 0 //unknown +#define SIM_TON_INTERNATIONAL 1 //international number +#define SIM_TON_NATIONAL 2 //national number +#define SIM_TON_NETWORK_SPECIFIC 3 //natwork specific number +#define SIM_TON_DEDICATED_ACCESS 4 //subscriber number +#define SIM_TON_ALPHA_NUMERIC 5//alphanumeric, GSM 7-bit default alphabet) +#define SIM_TON_ABBREVIATED_NUMBER 6 //abbreviated number +#define SIM_TON_RESERVED_FOR_EXT 7 //reserved for extension + + +#define MAX_UDH_LEN 137 +#define UDH_MAX 7 +#define SMDATA_SIZE_MAX 160 + +#define FAIL 0x00 +#define SUCCESS 0x01 + +//////////////////////////////////TPDU type//////////////////////////////// +typedef enum { + SMS_TPDU_DELIVER = 0x00, // sc -> ms + SMS_TPDU_DELIVER_REPORT = 0x00, // ms -> sc + SMS_TPDU_SUBMIT = 0x01, // ms -> sc + SMS_TPDU_SUBMIT_REPORT = 0x01, // sc -> ms + SMS_TPDU_STATUS_REPORT = 0x02, // sc -> ms + SMS_TPDU_COMMAND = 0x02, // ms -> sc + SMS_PDU_INVALID_TYPE +} SmsTPDUType; + +typedef enum { + SMS_DAEMON_UNKNOWN_MESSAGE, + SMS_DAEMON_RECEIVED_UNREAD_MESSAGE, + SMS_DAEMON_RECEIVED_READ_MESSAGE, + SMS_DAEMON_UNSENT_MESSAGE, + SMS_DAEMON_STORED_SENT_MESSAGE, +} sd_message_status; + + +/* + * tapi_nettext_vp_type + * This enumeration defines the validity period type. + */ +typedef enum { + TAPI_NETTEXT_VP_NOT_USED = 0, /**< validity period not used */ + TAPI_NETTEXT_VP_RELATIVE = 2, /**< after a predetermined time period after the service center has received the message */ + TAPI_NETTEXT_VP_ABSOLUTE = 3, + TAPI_NETTEXT_VP_ENHANCED = 1, + + TAPI_NETTEXT_VP_MAX +} tapi_nettext_vp_type; + +/* + * tapi_nettext_coding_group_type + This enum defined the different sms coding group types + */ +typedef enum { + TAPI_NETTEXT_CODGRP_SM_GENERAL_DCS, /**< Bits 7..4 00xx */ + TAPI_NETTEXT_CODGRP_CB_GENERAL_LANG, /**< 0000 */ + TAPI_NETTEXT_CODGRP_CB_ALPHA, /**< 0001 */ + TAPI_NETTEXT_CODGRP_CB_RES1, /**< 0010 */ + TAPI_NETTEXT_CODGRP_CB_RES2, /**< 0011 */ + TAPI_NETTEXT_CODGRP_SM_AUTO_DELETION, /**< 01xx Bits 5..0 are coded the same as SM_GENERAL_DCS */ + TAPI_NETTEXT_CODGRP_CB_GENERAL_DCS, /**< 01xx behavior is as SM_GENERAL_DCS */ + TAPI_NETTEXT_CODGRP_SM_WAITING_DISCARD, /**< 1100 */ + TAPI_NETTEXT_CODGRP_SM_WAITING_STORE, /**< 1101 */ + TAPI_NETTEXT_CODGRP_SM_WAITING_STORE_UCS2, /**< 1110 */ + TAPI_NETTEXT_CODGRP_CB_WAP, /**< 1110 Cell Broadcast */ + TAPI_NETTEXT_CODGRP_SM_CLASS_CODING, /**< 1111 */ + TAPI_NETTEXT_CODGRP_CB_CLASS_CODING, /**< 1111 Cell Broadcast */ + + TAPI_NETTEXT_CODGRP_MAX +} tapi_nettext_coding_group_type; + +/* + * tapi_nettext_waiting_type + Defines different types of waiting indicators + */ +typedef enum { + TAPI_NETTEXT_WAITING_VOICE_MSG, /**< voice message waiting */ + TAPI_NETTEXT_WAITING_FAX_MSG, /**< FAX message waiting */ + TAPI_NETTEXT_WAITING_EMAIL_MSG, /**< E-mail waiting */ + TAPI_NETTEXT_WAITING_OTHER_MSG, /**< Other message waiting */ + + TAPI_NETTEXT_WAITING_MAX +} tapi_nettext_waiting_type; + +/* + * tapi_nettext_alphabet_type + Defines different alphabet types of an sms + */ +typedef enum { + TAPI_NETTEXT_ALPHABET_DEFAULT, /**< GSM alphabet default 7bit */ + TAPI_NETTEXT_ALPHABET_8BIT, /**< 8bit */ + TAPI_NETTEXT_ALPHABET_UCS2, /**< 16bit ucs2 */ + + TAPI_NETTEXT_ALPHABET_KSC5601, /**< for Korean */ + + TAPI_NETTEXT_ALPHABET_MAX +} tapi_nettext_alphabet_type; + +/* + * tapi_nettext_class_type + This enum defines the different classes of SMS which indicates the + type of storage of the sms. + */ +typedef enum { + TAPI_NETTEXT_CLASS_0, /**< display immediately */ + TAPI_NETTEXT_CLASS_1, /**< may be stored */ + TAPI_NETTEXT_CLASS_2, /**< store in SIM */ + TAPI_NETTEXT_CLASS_3, /**< transfer to TE */ + TAPI_NETTEXT_CLASS_NONE, + + TAPI_NETTEXT_CLASS_MAX +} tapi_nettext_class_type; + +/* +This structure contains the information related to sms coding schemes + +*/ +typedef struct { + TS_BOOL bCompressed; /**< if text is compressed this is TRUE */ + TS_BOOL bmsg_class_set; /**< message class indication. if TRUE = bits 1..0, if FALSE = reserved */ + TS_BOOL bmsg_ind_active; /**< message indication group. if TRUE = on, FALSE = off */ + tapi_nettext_coding_group_type coding_group_type; /**< Coding group, GSM 03.38 */ + tapi_nettext_waiting_type waiting_type; /**< Type of message waiting */ + tapi_nettext_alphabet_type alphabet_type; /**< How to encode a message. */ + tapi_nettext_class_type class_type; /**< The message class */ +} tapi_nettext_coding_scheme; + +/* + * tapi_nettext_vp_rel_Value + * This structure defines the validity period types. + */ +typedef enum { + TAPI_NETTEXT_VP_REL_1H, /**< One hour */ + TAPI_NETTEXT_VP_REL_6H, /**< Six hours */ + TAPI_NETTEXT_VP_REL_12H, /**< Twelve hours */ + TAPI_NETTEXT_VP_REL_1D, /**< One day */ + TAPI_NETTEXT_VP_REL_3D, /**< Three days */ + TAPI_NETTEXT_VP_REL_1W, /**< One week */ + TAPI_NETTEXT_VP_REL_1M, /**< One Month */ + TAPI_NETTEXT_VP_REL_MAX /**< Max = 63 weeks */ +} tapi_nettext_vp_rel_Value; + +/* +This structure contains all the information +related to validity period of a message. +*/ +typedef struct { + tapi_nettext_vp_type vp_type; /**< Validity period format */ + tapi_nettext_vp_rel_Value vp_rel_type; /**< Validity period value duration the message must retain in the service center while application attempts delivery */ + TS_UINT32 vpValue; /** Validity period value */ +} tapi_nettext_vp; + + +/* This structure contains the details of delete status notification, which comes after calling + tel_delete_sms_in_simMsg*/ +typedef struct { + TS_UINT16 result; + TS_UINT8 index; +} tel_delete_sms_in_simMsg_status_ind; + + +/* This structure contains the details of save status notification, which comes after calling + tel_write_sms_in_simMsg*/ + +typedef struct { + TS_UINT16 result; + TS_UINT8 index; +} tapi_nettext_save_status_ind; + +typedef struct { + int year; + int month; + int day; + int hour; + int minute; + int second; +} TmDateTime; + + +#define BASE_YEAR 70L /* 1970 is the base year */ +#define MAX_YEAR 130L /* 2030 is the max year */ +#define SIM_SMSP_ADDRESS_LEN 20 /* digit length */ + +#define SET_TON_NPI(dest, ton, npi) { \ + dest = 0x80; \ + dest |= (ton & 0x07) << 4; \ + dest |= npi & 0x0F; \ +} + +typedef struct { + /************HEADER************/ + + // message type [M] + SmsTPDUType msg_type; //bit 0 ,1 + + // reject duplicates [M] + TS_BOOL rd; // bit 2 + + // validity period format [M] + tapi_nettext_vp_type vpf; // bits 3, 4 + + // reply path [M] + TS_BOOL rp; //bit 7 + + // user data header indication + TS_BOOL udhi; //bit 6 + + // status report request + TS_BOOL srr; // bit 5 + + /************BODY************/ + + //message reference [M] + TS_UINT mr; + + // destination address [M] + TelSmsAddressInfo_t desAddr; + + // protocol identifier [M] + TS_BYTE pId; + + // data coding scheme [M] + tapi_nettext_coding_scheme dcs; + + // validity period + tapi_nettext_vp vp; + + // user data length [M] + TS_UINT udl; + + // user data + TS_BYTE * userData; + +} TPDU_SMS_SUBMIT; + +typedef struct { + /************HEADER************/ + + // message type [M] + SmsTPDUType msg_type; //bit 0 ,1 + + // user data header indication + TS_BOOL udhi; //bit 6 + + /************BODY************/ + + // failure Cause [M] + TS_UINT fcs; + + // parameter indicator [M] + TS_BYTE paraInd; + + // service centre time stamp [M] + TmDateTime scts; + + // protocol identifier [M] + TS_BYTE pId; + + // data coding scheme + tapi_nettext_coding_scheme dcs; + + // user data length [M] + TS_UINT udl; + + // user data + TS_BYTE * userData; + +} TPDU_SMS_SUBMIT_REPORT; + +typedef struct { + /************HEADER************/ + SmsTPDUType msg_type; //bit 0 ,1 + + TS_BOOL mms; // bit 2 + + TS_BOOL rp; // bit 7 + + TS_BOOL udhi; //bit 6 + + TS_BOOL sri; // bit , 5status_report_indication + + /************BODY************/ + + TelSmsAddressInfo_t orgAddr; + + TS_BYTE pId; + + TmDateTime scts; + + tapi_nettext_coding_scheme dcs; + + TS_UINT udl; + + TS_BYTE * userData; + +} TPDU_SMS_DELIVER; + +typedef struct { + /************HEADER************/ + SmsTPDUType msg_type; //bit 0 ,1 + + TS_BOOL udhi; //bit 6 + + /************BODY************/ + + TS_UINT fcs; + + TS_BYTE paraInd; + + TS_BYTE pId; + + tapi_nettext_coding_scheme dcs; + + TS_UINT udl; + + TS_BYTE * userData; + +} TPDU_SMS_DELIVER_REPORT; + +typedef struct { + /************HEADER************/ + SmsTPDUType msg_type; //bit 0 ,1 + + TS_BOOL udhi; //bit 6 + + TS_BOOL srr; //bit 5, status_report_request + + /************BODY************/ + + TS_UINT mr; //message_ref + + TS_BYTE pId; + + TS_BYTE cmdType; + + TS_BYTE msgNum; + + TelSmsAddressInfo_t destAddr; + + TS_UINT udl; + + TS_BYTE * userData; + +} TPDU_SMS_COMMAND; + +typedef struct { + /************HEADER************/ + + SmsTPDUType msg_type; //bit 0 ,1 + + TS_BOOL udhi; //bit 6 + + TS_BOOL mms; //bit 2 + + TS_BOOL srq; //bit 5, status_report_qualifier + + /************BODY************/ + + TS_UINT mr; + + TelSmsAddressInfo_t rcpAddr; //recipient_addr + + TmDateTime scts; + + TmDateTime dt; //discharge_time + + TS_BYTE status; + + TS_BYTE paraInd; + + TS_BYTE pId; + + tapi_nettext_coding_scheme dcs; + + TS_UINT udl; + + TS_BYTE * userData; + +} TPDU_SMS_STATUS_REPORT; + +/************************************************************************************** +*** (main.c) function header**************************************************************** +*************************************************************************************** +***************************************************************************************/ +int SendMessage(); +int ReadMessage(); +int DeleteMessage(); +int ReceiveMessage(int pdu_len, char * pPDU); +int GetInformation(); +int Setting(); + +TS_BOOL DecodeCellBroadcastMsg(int length, char * pPDU); +TS_BOOL EncodeSmsSubmitTpdu(char* diallingNum, int dialNumLen, char* msg, int msg_len); +TS_BOOL DecodeSmsSubmitTpdu(int pdu_len, char * pPDU); +int DecodeSmsDeliverTpdu(int pdu_len, char * pPDU); +TS_BOOL EncodeSmsDeliverReportTpdu(); +TS_BOOL DecodeSmsSubmitReportTpdu(int length, char *data); +TS_BOOL DecodeSmsStatusReportTpdu(int pdu_len, char * pPDU); + +/***************************************************************************************/ +void reverse(char* x, int len); +char* AcItoa(int n, char* str, int b); +int AcToupper(int ch); + +char* SmsUtilUnpackGSMCode(char* szData, const TS_BYTE* pIn, int in_len); +int SmsUtilPackGSMCode(TS_BYTE* pOut, const char* szData, int in_len); + +void SmsUtilConvertBCD2Digit(char* pDigits, char* pBCD, int digitLen); +void SmsUtilConvertDigit2BCD(char* pBCD, char* pDigits, int digitLen); + +TmDateTime* SmsUtilDecodeTimeStamp(unsigned char* pTimeStamp, TmDateTime *tmDateTime); +unsigned char* SmsUtilEncodeTimeStamp(TmDateTime* tmDateTime, unsigned char* pTimeStamp); + +void SmsUtilDecodeAddrField(char *diallingNum, unsigned char * pAddrField, int *result_ton, int *result_npi); +int SmsUtilEncodeAddrField(unsigned char* pAddrField, char* diallingNum, int dialnumLen, int ton, int npi); + +int SmsUtilDecodeScAddrField(TelSmsAddressInfo_t* pSmsAddrField, TS_BYTE* pAddrField); +int SmsUtilEncodeScAddrField(TS_BYTE* pAddrField, TelSmsAddressInfo_t * pSmsAddrField); + +void SmsUtilDecodeDCS(tapi_nettext_coding_scheme* pCodingScheme, unsigned char dcs); +void SmsUtilEncodeDCS(TS_BYTE* pDCS, tapi_nettext_coding_scheme* pCodingScheme); +TS_UINT8 SmsUtilEncodeValidity(TS_BYTE* pValidity, tapi_nettext_vp* pVP); + +void PrepareMessage(TelSmsDatapackageInfo_t *pDataPackage); + +#endif + + diff --git a/TC/telephony_TC/sms/unit/tet_macro.h b/TC/telephony_TC/sms/unit/tet_macro.h new file mode 100644 index 0000000..b386b3e --- /dev/null +++ b/TC/telephony_TC/sms/unit/tet_macro.h @@ -0,0 +1,36 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * 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 TET_MACRO_H +#define TET_MACRO_H + + +#define TET_CHECK(x) if(x) tet_result(TET_PASS); else tet_result(TET_FAIL) +#define TET_CHECK_EQUAL(x,y) if ((x)==(y)) tet_result(TET_PASS); else tet_result(TET_FAIL) +#define TET_CHECK_NOT_EQUAL(x,y) if ((x)!=(y)) tet_result(TET_PASS); else tet_result(TET_FAIL) + + +#define TET_CHECK_MESSAGE(x,y) if ((y)==(TRUE)) tet_result(TET_PASS); else {tet_result(TET_FAIL); tet_printf(x);} +#define TET_CHECK_EQUAL_MESSAGE(x,y,z) if ((y)==(z)) tet_result(TET_PASS); else {tet_result(TET_FAIL); tet_printf(x);} +#define TET_CHECK_NOT_EQUAL_MESSAGE(x,y,z) if ((y)!=(z)) tet_result(TET_PASS); else {tet_result(TET_FAIL); tet_printf(x);} + + +#endif + diff --git a/TC/telephony_TC/sms/unit/tet_tapi_util_new.h b/TC/telephony_TC/sms/unit/tet_tapi_util_new.h new file mode 100644 index 0000000..a474546 --- /dev/null +++ b/TC/telephony_TC/sms/unit/tet_tapi_util_new.h @@ -0,0 +1,130 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * 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 _TET_UTIL_NEW_ +#define _TET_UTIL_NEW_ + +#include + +// TET_Error Code string return macro +typedef struct { + TapiResult_t err; + char * string; +} TAPI_Error_String; + +#ifndef BOOL +typedef int BOOL; +#endif + +#ifndef TRUE +#define TRUE 1 +#endif + +#ifndef FALSE +#define FALSE 0 +#endif + +#define TAPI_ERROR_MAX TAPI_API_MISC_VALIDITY_ERROR+1 + +TAPI_Error_String g_ErrorString[TAPI_ERROR_MAX] = { + + /* #################### COMMON START ################ */ + + {TAPI_API_SUCCESS, "No Error occured"}, + {TAPI_API_INVALID_INPUT, "Input values are not correct"}, + {TAPI_API_INVALID_PTR, "TAPI_API_INVALID_PTR"}, + {TAPI_API_API_DEPRICATED, "This API is depricated and will be so in future also."}, + {TAPI_API_SYSTEM_OUT_OF_MEM, "TAPI_API_SYSTEM_OUT_OF_MEM"}, + {TAPI_API_SYSTEM_RPC_LINK_DOWN, "TAPI_API_SYSTEM_RPC_LINK_DOWN"}, + {TAPI_API_SYSTEM_RPC_LINK_NOT_EST, "TAPI_API_SYSTEM_RPC_LINK_NOT_EST"}, + {TAPI_API_SERVICE_NOT_READY, "Phone was powered on, but yet to receive the power up completed noti"}, + {TAPI_API_SERVER_LAYER_FAILURE, "Erros happend in executing the following layer fucntions"}, + {TAPI_API_TRANSPORT_LAYER_FAILURE, "TAPI_API_TRANSPORT_LAYER_FAILURE"}, + + /* #################### COMMON END ################ */ + + /* CALL */ + {TAPI_API_INVALID_CALL_HANDLE, "TAPI_API_INVALID_CALL_HANDLE"}, + {TAPI_API_INVALID_CALL_STATE, "TAPI_API_INVALID_CALL_STATE"}, + {TAPI_API_INVALID_LINE_ID, "TAPI_API_INVALID_LINE_ID"}, + + /* POWER */ + {TAPI_API_MODEM_ALREADY_ON, "TAPI_API_MODEM_ALREADY_ON"}, + {TAPI_API_MODEM_ALREADY_OFF, "TAPI_API_MODEM_ALREADY_OFF"}, + + /* SAT */ + {TAPI_API_SAT_PARSER_ENCODING_ERROR, "TAPI_API_SAT_PARSER_ENCODING_ERROR"}, + {TAPI_API_SAT_COMMAND_NUMBER_INVALID, "TAPI_API_SAT_COMMAND_NUMBER_INVALID"}, + {TAPI_API_SAT_COMMAND_NUMBER_MISMATCH, "TAPI_API_SAT_COMMAND_NUMBER_MISMATCH"}, + {TAPI_API_SAT_COMMAND_TYPE_MISMATCH, "TAPI_API_SAT_COMMAND_TYPE_MISMATCH"}, + + /* Misc */ + {TAPI_API_MISC_RETURN_NULL, "TAPI_API_MISC_RETURN_NULL"}, + {TAPI_API_MISC_INPUTPARM_ERROR, "TAPI_API_MISC_INPUTPARM_ERROR"}, + {TAPI_API_MISC_OUTPARAM_NULL, "TAPI_API_MISC_OUTPARAM_NULL"}, + {TAPI_API_MISC_VALIDITY_ERROR, "TAPI_API_MISC_VALIDITY_ERROR"}, +}; + +static const char *TET_ERROR_TO_STRING(TapiResult_t err_code) +{ + int index; + for (index = 0; g_ErrorString[index].err != TAPI_ERROR_MAX; index++) { + if (g_ErrorString[index].err == err_code || g_ErrorString[index].err == TAPI_ERROR_MAX) + return g_ErrorString[index].string; + } + return NULL; +} + +#define TET_CHECK(x1, y...) \ + { \ + TapiResult_t err = y;\ + if (err != (x1)) \ + { \ + tet_printf("%s[%d] : test fail. error code =%d [%s] ",__FILE__,__LINE__, err, TET_ERROR_TO_STRING(err) ); \ + tet_result(TET_FAIL); \ + return;\ + } \ + } + +#define TET_CHECK2(x1,x2, y...) \ + { \ + TapiResult_t err = y;\ + if (!(err == (x1) || err == (x2))) \ + { \ + tet_printf("%s[%d] : test fail. error code =%d [%s] ",__FILE__,__LINE__, err, TET_ERROR_TO_STRING(err) ); \ + tet_result(TET_FAIL); \ + return;\ + } \ + } + +#define TET_CHECK3(x1,x2,x3, y...) \ + { \ + TapiResult_t err = y;\ + if (!(err == (x1) || err == (x2) || err == (x3))) \ + { \ + tet_printf("%s[%d] : test fail. error code =%d [%s] ",__FILE__,__LINE__, err, TET_ERROR_TO_STRING(err) ); \ + tet_result(TET_FAIL); \ + return;\ + } \ + } + + +#endif //_TET_UTIL_ diff --git a/TC/telephony_TC/sms/unit/tslist b/TC/telephony_TC/sms/unit/tslist new file mode 100644 index 0000000..0aa1b3d --- /dev/null +++ b/TC/telephony_TC/sms/unit/tslist @@ -0,0 +1,15 @@ +/sms/unit/uts_tel_send_sms_deliver_report +/sms/unit/uts_tel_delete_sms_in_sim +/sms/unit/uts_tel_get_sms_cb_config +/sms/unit/uts_tel_get_sms_count +/sms/unit/uts_tel_get_sms_parameter_count +/sms/unit/uts_tel_get_sms_parameters +/sms/unit/uts_tel_get_sms_sca +/sms/unit/uts_tel_read_sms_in_sim +/sms/unit/uts_tel_send_sms +/sms/unit/uts_tel_set_sms_cb_config +/sms/unit/uts_tel_set_sms_memory_status +/sms/unit/uts_tel_set_sms_message_status +/sms/unit/uts_tel_set_sms_parameters +/sms/unit/uts_tel_set_sms_sca +/sms/unit/uts_tel_write_sms_in_sim diff --git a/TC/telephony_TC/sms/unit/uts_tel_delete_sms_in_sim.c b/TC/telephony_TC/sms/unit/uts_tel_delete_sms_in_sim.c new file mode 100644 index 0000000..5908435 --- /dev/null +++ b/TC/telephony_TC/sms/unit/uts_tel_delete_sms_in_sim.c @@ -0,0 +1,181 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * 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 + +#include +#include + +#include +#include +#include +#include + +#include +#include "tet_macro.h" + +#include +#include + +#include "sms_callback_util.h" +#include "uts_tel_delete_sms_in_sim.h" + +static void startup(); +static void cleanup(); +void (*tet_startup) () = startup; +void (*tet_cleanup) () = cleanup; +struct tet_testlist tet_testlist[] = { + {utc_tel_delete_sms_in_sim_01, 1}, + {utc_tel_delete_sms_in_sim_02, 2}, + {utc_tel_delete_sms_in_sim_03, 3}, + {NULL, 0} +}; + +static TapiResult_t gStartupSuccess; +unsigned int subscription_id; + +void alarm_received(int sgi) +{ + gAsyncResult = FALSE; + printf("Signal [SIGALARM] Received. Close g_main_loop()"); + G_MAIN_LOOP_CLOSE(); +} + +/* + * Startup & Clean function : It is not test code, only for initialize and finalize test module + */ +static void startup() +{ + tapi_dbus_connection_name dname; + int bStatus; + + gStartupSuccess = tel_init(); + if (gStartupSuccess != TAPI_API_SUCCESS) { + printf("tel_init() Failed gStartupSuccess = %d \n", gStartupSuccess); + } + /* if( !(G_MAIN_INIT((EvtSysEventCb)on_sms_check_event_received, alarm_received) ) ) + + printf("G_MAIN_INIT() Failed\n"); */ + + gStartupSuccess = tel_register_event(TAPI_EVENT_NETTEXT_DELETE_STATUS_CNF, &subscription_id, tapi_sms_callback, NULL); + + if (gStartupSuccess != TAPI_API_SUCCESS) { + printf("TapiCommonRegisterEvent Failed gStartupSuccess = %d \n", gStartupSuccess); + } + else { + tel_register_app_name("org.samsung.test"); + if (tel_get_app_name(&dname)) + printf("Dbus Get app name error\n"); + else + printf("Dbus Name is %s\n", dname.name); + + tel_check_service_ready(&bStatus); + printf("Telephpny service %d\n", bStatus); + + printf("after TapiCommonRegisterEvent subscription_id is %d gStartupSuccess is %d\n", subscription_id, gStartupSuccess); + } +} + +static void cleanup() +{ + if (gStartupSuccess == TAPI_API_SUCCESS) + tel_deregister_event(subscription_id); + tel_deinit(); + return; +} + +/** + * @brief This tests TelTapiDeleteSms() API in normal conditions + * @par ID: + * UTC_TEL_DELETE_SMS_01 + * @param [in] Index = 1 + * @param [out] pRequestId + * @return TAPI_API_SUCCESS + */ +void utc_tel_delete_sms_in_sim_01() +{ + TapiResult_t returnStatus; + int pRequestId; + + returnStatus = tel_delete_sms_in_sim(1, &pRequestId); + gmain_loop_for_events(5000); + printf("The return value is %d\n", returnStatus); + printf("The pRequestId value is %d\n", pRequestId); + + TET_CHECK(returnStatus == TAPI_API_SUCCESS); + if (returnStatus == TAPI_API_SUCCESS) + printf("uts_tel_delete_sms_01 pass\n"); + + return; +} + +/** + * @brief This tests TelTapiDeleteSms() API in abnormal conditions + * @par ID: + * UTC_TEL_DELETE_SMS_02 + * @param [in] Index = 1 + * @param [out] pRequestId = NULL + * @return TAPI_API_INVALID_PTR + */ +void utc_tel_delete_sms_in_sim_02() +{ + TapiResult_t returnStatus; + + returnStatus = tel_delete_sms_in_sim(1, NULL); + printf("The return value is %d\n", returnStatus); + + TET_CHECK(returnStatus == TAPI_API_INVALID_PTR); + if (returnStatus == TAPI_API_INVALID_PTR) + printf("uts_tel_delete_sms_02 pass\n"); + + return; +} + +/** + * @brief This tests TelTapiDeleteSms() API in abnormal conditions + * @par ID: + * UTC_TEL_DELETE_SMS_03 + * @param [in] Index + * @code + Index = -1; + * @endcode + * @param [out] pRequestId + * @return TAPI_API_INVALID_INPUT + */ +void utc_tel_delete_sms_in_sim_03() +{ + TapiResult_t returnStatus; + int pRequestId; + + returnStatus = tel_delete_sms_in_sim(-1, &pRequestId); + printf("The return value is %d\n", returnStatus); + printf("The pRequestId value is %d\n", pRequestId); + + TET_CHECK(returnStatus == TAPI_API_INVALID_INPUT); + if (returnStatus == TAPI_API_INVALID_INPUT) + printf("uts_tel_delete_sms_03 pass\n"); + return; +} + +/** @} */ diff --git a/TC/telephony_TC/sms/unit/uts_tel_delete_sms_in_sim.h b/TC/telephony_TC/sms/unit/uts_tel_delete_sms_in_sim.h new file mode 100644 index 0000000..4d8e5bf --- /dev/null +++ b/TC/telephony_TC/sms/unit/uts_tel_delete_sms_in_sim.h @@ -0,0 +1,28 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * 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 _UTS_DELETE_SMS_IN_SIM_H_ +#define _UTS_DELETE_SMS_IN_SIM_H_ + +static void utc_tel_delete_sms_in_sim_01(); +static void utc_tel_delete_sms_in_sim_02(); +static void utc_tel_delete_sms_in_sim_03(); + +#endif diff --git a/TC/telephony_TC/sms/unit/uts_tel_get_sms_cb_config.c b/TC/telephony_TC/sms/unit/uts_tel_get_sms_cb_config.c new file mode 100644 index 0000000..cebbcaa --- /dev/null +++ b/TC/telephony_TC/sms/unit/uts_tel_get_sms_cb_config.c @@ -0,0 +1,153 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * 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 + +#include +#include + +#include +#include +#include +#include + +#include +#include "tet_macro.h" + +#include +#include + +#include "sms_callback_util.h" +#include "uts_tel_get_sms_cb_config.h" + +static TapiResult_t gStartupSuccess; +unsigned int subscription_id; + +/* Initialize TCM data structures */ +static void startup(); +static void cleanup(); +void (*tet_startup)() = startup; +void (*tet_cleanup)() = cleanup; +struct tet_testlist tet_testlist[] = { { utc_tel_get_sms_cb_config_01, 1 }, { utc_tel_get_sms_cb_config_02, 2 }, { NULL, 0 } }; + +void alarm_received(int sgi) +{ + gAsyncResult = FALSE; + printf("Signal [SIGALARM] Received. Close g_main_loop()"); + G_MAIN_LOOP_CLOSE(); +} + +/* Startup & Clean function : It is not test code, only for + initialize and finalize test module */ + +static void startup() +{ + tapi_dbus_connection_name dname; + int bStatus; + + gStartupSuccess = tel_init(); + if (gStartupSuccess != TAPI_API_SUCCESS) { + printf("tel_init() Failed gStartupSuccess = %d \n", gStartupSuccess); + } + + gStartupSuccess = tel_register_event(TAPI_EVENT_NETTEXT_GET_CB_CONFIG_CNF, &subscription_id, tapi_sms_callback, NULL); + + if (gStartupSuccess != TAPI_API_SUCCESS) { + printf("tel_register_event Failed gStartupSuccess = %d \n", gStartupSuccess); + } + else { + tel_register_app_name("org.samsung.test"); + if (tel_get_app_name(&dname)) + printf("Dbus Get app name error\n"); + else + printf("Dbus Name is %s\n", dname.name); + + tel_check_service_ready(&bStatus); + printf("Telephony service %d\n", bStatus); + + printf("after tel_register_event subscription_id is %d gStartupSuccess is %d\n", subscription_id, gStartupSuccess); + } +} + +static void cleanup() +{ + if (gStartupSuccess == TAPI_API_SUCCESS) + tel_deregister_event(subscription_id); + tel_deinit(); + return; +} + +/** + * @brief This tests tel_get_sms_cb_config() API in normal conditions + * @par ID: + * UTC_TEL_SMS_CB_GET_CONFIG_01 + * @param [in] None + * @param [out] pRequestId + * @return TAPI_API_SUCCESS + */ +void utc_tel_get_sms_cb_config_01() +{ + TapiResult_t returnStatus; + int pRequestId = -1; + + /* CALLING TAPI SMS SET SMS GET CB CONFIG API */ + returnStatus = tel_get_sms_cb_config(&pRequestId); + + gmain_loop_for_events(5000); + + printf("The return value is %d\n", returnStatus); + printf("The pRequestId value is %d\n", pRequestId); + + TET_CHECK(returnStatus == TAPI_API_SUCCESS); + if (returnStatus == TAPI_API_SUCCESS) + printf("utc_tel_get_cbconfig_01 pass\n"); + + return; +} + +/** + * @brief This tests tel_get_sms_cb_config() API in abnormal conditions + * @par ID: + * UTC_TEL_SMS_CB_GET_CONFIG_02 + * @param [in] None + * @param [out] pRequestId = NULL + * @return TAPI_API_INVALID_PTR + */ +void utc_tel_get_sms_cb_config_02() +{ + TapiResult_t returnStatus; + + /* CALLING TAPI SMS SET SMS GET CB CONFIG API */ + returnStatus = tel_get_sms_cb_config(NULL); + + printf("The return value is %d\n", returnStatus); + + TET_CHECK(returnStatus == TAPI_API_INVALID_PTR); + if (returnStatus == TAPI_API_INVALID_PTR) + printf("utc_tel_get_cbconfig_02 pass\n"); + + return; +} +/** @} */ + diff --git a/TC/telephony_TC/sms/unit/uts_tel_get_sms_cb_config.h b/TC/telephony_TC/sms/unit/uts_tel_get_sms_cb_config.h new file mode 100644 index 0000000..d714699 --- /dev/null +++ b/TC/telephony_TC/sms/unit/uts_tel_get_sms_cb_config.h @@ -0,0 +1,28 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * 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 _UTS_TEL_GET_SMS_CB_CONFIG_H_ +#define _UTS_TEL_GET_SMS_CB_CONFIG_H_ + +static void utc_tel_get_sms_cb_config_01(); +static void utc_tel_get_sms_cb_config_02(); + +#endif diff --git a/TC/telephony_TC/sms/unit/uts_tel_get_sms_count.c b/TC/telephony_TC/sms/unit/uts_tel_get_sms_count.c new file mode 100644 index 0000000..baa4683 --- /dev/null +++ b/TC/telephony_TC/sms/unit/uts_tel_get_sms_count.c @@ -0,0 +1,152 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * 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 + +#include +#include + +#include +#include +#include +#include + +#include +#include "tet_macro.h" + +#include +#include + +#include "sms_callback_util.h" +#include "uts_tel_get_sms_count.h" + +static void startup(); +static void cleanup(); +void (*tet_startup)() = startup; +void (*tet_cleanup)() = cleanup; + +struct tet_testlist tet_testlist[] = { { utc_tel_get_sms_count_01, 1 }, { utc_tel_get_sms_count_02, 2 }, { NULL, 0 } }; + +static TapiResult_t gStartupSuccess; +unsigned int subscription_id; + +void alarm_received(int sgi) +{ + gAsyncResult = FALSE; + printf("Signal [SIGALARM] Received. Close g_main_loop()"); + G_MAIN_LOOP_CLOSE(); +} + +/* Startup & Clean function : It is not test code, only for + initialize and finalize test module + */ + +static void startup() +{ + tapi_dbus_connection_name dname; + int bStatus; + + gStartupSuccess = tel_init(); + if (gStartupSuccess != TAPI_API_SUCCESS) { + printf("tel_init() Failed gStartupSuccess = %d \n", gStartupSuccess); + } + + gStartupSuccess = tel_register_event(TAPI_EVENT_NETTEXT_GET_COUNT_CNF, &subscription_id, tapi_sms_callback, NULL); + + if (gStartupSuccess != TAPI_API_SUCCESS) { + printf("tel_register_event Failed gStartupSuccess = %d \n", gStartupSuccess); + } + else { + tel_register_app_name("org.samsung.test"); + if (tel_get_app_name(&dname)) + printf("Dbus Get app name error\n"); + else + printf("Dbus Name is %s\n", dname.name); + + tel_check_service_ready(&bStatus); + printf("Telephony service %d\n", bStatus); + + printf("after tel_register_event subscription_id is %d gStartupSuccess is %d\n", subscription_id, gStartupSuccess); + } +} + +static void cleanup() +{ + if (gStartupSuccess == TAPI_API_SUCCESS) + tel_deregister_event(subscription_id); + tel_deinit(); + return; +} + +/** + * @brief This tests tel_get_sms_count() API in normal conditions + * @par ID: + * UTC_TEL_SMS_GET_COUNT_01 + * @param [in] None + * @param [out] pRequestId + * @return TAPI_API_SUCCESS + */ +void utc_tel_get_sms_count_01() +{ + TapiResult_t returnStatus = TAPI_API_SUCCESS; + int pRequestId = -1; + + returnStatus = tel_get_sms_count(&pRequestId); + + gmain_loop_for_events(5000); + + printf("The request id value is %d\n", pRequestId); + printf("The return value is %d\n", returnStatus); + + TET_CHECK(returnStatus == TAPI_API_SUCCESS); + if (returnStatus == TAPI_API_SUCCESS) + printf("utc_tel_get_count_01 pass\n"); + + return; +} + +/** + * @brief This tests tel_get_sms_count() API in abnormal conditions + * @par ID: + * UTC_TEL_SMS_GET_COUNT_02 + * @param [in] None + * @param [out] pRequestId = NULL + * @return TAPI_API_INVALID_PTR + */ +void utc_tel_get_sms_count_02() +{ + TapiResult_t returnStatus = TAPI_API_SUCCESS; + + returnStatus = tel_get_sms_count(NULL); + + printf("The return value is %d\n", returnStatus); + + TET_CHECK(returnStatus == TAPI_API_INVALID_PTR); + if (returnStatus == TAPI_API_INVALID_PTR) + printf("utc_tel_get_count_02 pass\n"); + + return; +} + +/** @} */ diff --git a/TC/telephony_TC/sms/unit/uts_tel_get_sms_count.h b/TC/telephony_TC/sms/unit/uts_tel_get_sms_count.h new file mode 100644 index 0000000..e530f06 --- /dev/null +++ b/TC/telephony_TC/sms/unit/uts_tel_get_sms_count.h @@ -0,0 +1,28 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * 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 _UTS_TEL_GET_SMS_COUNT_H_ +#define _UTS_TEL_GET_SMS_COUNT_H_ + +static void utc_tel_get_sms_count_01(); +static void utc_tel_get_sms_count_02(); + +#endif diff --git a/TC/telephony_TC/sms/unit/uts_tel_get_sms_parameter_count.c b/TC/telephony_TC/sms/unit/uts_tel_get_sms_parameter_count.c new file mode 100644 index 0000000..623bc61 --- /dev/null +++ b/TC/telephony_TC/sms/unit/uts_tel_get_sms_parameter_count.c @@ -0,0 +1,151 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * 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 + +#include +#include + +#include +#include +#include +#include + +#include +#include "tet_macro.h" + +#include +#include + +#include "sms_callback_util.h" +#include "uts_tel_get_sms_parameter_count.h" + +static void startup(); +static void cleanup(); + +void (*tet_startup)() = startup; +void (*tet_cleanup)() = cleanup; +struct tet_testlist tet_testlist[] = { { utc_tel_get_sms_parameter_count_01, 1 }, { utc_tel_get_sms_parameter_count_02, 2 }, { NULL, 0 } }; + +static TapiResult_t gStartupSuccess; +unsigned int subscription_id; + +void alarm_received(int sgi) +{ + gAsyncResult = FALSE; + printf("Signal [SIGALARM] Received. Close g_main_loop()"); + G_MAIN_LOOP_CLOSE(); +} + +/* Startup & Clean function : It is not test code, only for + initialize and finalize test module + */ + +static void startup() +{ + tapi_dbus_connection_name dname; + int bStatus; + + gStartupSuccess = tel_init(); + if (gStartupSuccess != TAPI_API_SUCCESS) { + printf("tel_init() Failed gStartupSuccess = %d \n", gStartupSuccess); + } + gStartupSuccess = tel_register_event(TAPI_EVENT_NETTEXT_PARAM_COUNT_IND, &subscription_id, tapi_sms_callback, NULL); + + if (gStartupSuccess != TAPI_API_SUCCESS) { + printf("tel_register_event Failed gStartupSuccess = %d \n", gStartupSuccess); + } + else { + tel_register_app_name("org.samsung.test"); + if (tel_get_app_name(&dname)) + printf("Dbus Get app name error\n"); + else + printf("Dbus Name is %s\n", dname.name); + + tel_check_service_ready(&bStatus); + printf("Telephony service %d\n", bStatus); + + printf("after tel_register_event subscription_id is %d gStartupSuccess is %d\n", subscription_id, gStartupSuccess); + } +} + +static void cleanup() +{ + if (gStartupSuccess == TAPI_API_SUCCESS) + tel_deregister_event(subscription_id); + + tel_deinit(); + return; +} + +/** + * @brief This tests TelTapiGetParamCount() API in normal conditions + * @par ID: + * UTC_TEL_GET_PARAM_COUNT_01 + * @param [in] None + * @param [out] pRequestId + * @return TAPI_API_SUCCESS + */ +void utc_tel_get_sms_parameter_count_01() +{ + TapiResult_t returnStatus; + int pRequestId = -1; + + returnStatus = tel_get_sms_parameter_count(&pRequestId); + + gmain_loop_for_events(5000); + printf("The request id value is %d\n", pRequestId); + printf("The return value is %d\n", returnStatus); + + TET_CHECK(returnStatus == TAPI_API_SUCCESS); + if (returnStatus == TAPI_API_SUCCESS) + printf("utc_tel_get_sms_parameter_count_01 pass\n"); + + return; +} + +/** + * @brief This tests TelTapiGetParamCount() API in abnormal conditions + * @par ID: + * UTC_TEL_GET_PARAM_COUNT_02 + * @param [in] None + * @param [out] pRequestId = NULL + * @return TAPI_API_INVALID_PTR + */ +void utc_tel_get_sms_parameter_count_02() +{ + TapiResult_t returnStatus; + + returnStatus = tel_get_sms_parameter_count(NULL); + + printf("The return value is %d\n", returnStatus); + + TET_CHECK(returnStatus == TAPI_API_INVALID_PTR); + if (returnStatus == TAPI_API_INVALID_PTR) + printf("utc_tel_get_sms_parameter_count_02 pass\n"); + + return; +} + +/** @} */ diff --git a/TC/telephony_TC/sms/unit/uts_tel_get_sms_parameter_count.h b/TC/telephony_TC/sms/unit/uts_tel_get_sms_parameter_count.h new file mode 100644 index 0000000..53b3012 --- /dev/null +++ b/TC/telephony_TC/sms/unit/uts_tel_get_sms_parameter_count.h @@ -0,0 +1,28 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * 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 _UTS_TEL_GET_SMS_PARAMETER_COUNT_H_ +#define _UTS_TEL_GET_SMS_PARAMETER_COUNT_H_ + +static void utc_tel_get_sms_parameter_count_01(); +static void utc_tel_get_sms_parameter_count_02(); + +#endif diff --git a/TC/telephony_TC/sms/unit/uts_tel_get_sms_parameters.c b/TC/telephony_TC/sms/unit/uts_tel_get_sms_parameters.c new file mode 100644 index 0000000..4984781 --- /dev/null +++ b/TC/telephony_TC/sms/unit/uts_tel_get_sms_parameters.c @@ -0,0 +1,236 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * 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 + +#include +#include + +#include +#include +#include +#include + +#include +#include "tet_macro.h" + +#include +#include + +#include "sms_callback_util.h" +#include "uts_tel_get_sms_parameters.h" + +/* Initialize TCM data structures */ +static void startup(); +static void cleanup(); +void (*tet_startup)() = startup; +void (*tet_cleanup)() = cleanup; +struct tet_testlist tet_testlist[] = { { utc_tel_get_sms_parameters_01, 1 }, { utc_tel_get_sms_parameters_02, 2 }, { utc_tel_get_sms_parameters_03, 3 }, { + utc_tel_get_sms_parameters_04, 4 }, { utc_tel_get_sms_parameters_05, 5 }, { NULL, 0 } }; + +unsigned int subscription_id; +static TapiResult_t gStartupSuccess; + +void alarm_received(int sgi) +{ + gAsyncResult = FALSE; + printf("Signal [SIGALARM] Received. Close g_main_loop()"); + G_MAIN_LOOP_CLOSE(); +} + +/* Startup & Clean function : It is not test code, only for + initialize and finalize test module */ + +static void startup() +{ + tapi_dbus_connection_name dname; + int bStatus; + + gStartupSuccess = tel_init(); + if (gStartupSuccess != TAPI_API_SUCCESS) { + printf("tel_init() Failed gStartupSuccess = %d \n", gStartupSuccess); + } + + gStartupSuccess = tel_register_event(TAPI_EVENT_NETTEXT_GET_PARAM_CNF, &subscription_id, tapi_sms_callback, NULL); + + if (gStartupSuccess != TAPI_API_SUCCESS) { + printf("TapiCommonRegisterEvent Failed gStartupSuccess = %d \n", gStartupSuccess); + } + else { + tel_register_app_name("org.samsung.test"); + if (tel_get_app_name(&dname)) + printf("Dbus Get app name error\n"); + else + printf("Dbus Name is %s\n", dname.name); + + tel_check_service_ready(&bStatus); + printf("Telephony service %d\n", bStatus); + + printf("after TapiCommonRegisterEvent subscription_id is %d gStartupSuccess is %d\n", subscription_id, gStartupSuccess); + } +} + +static void cleanup() +{ + if (gStartupSuccess == TAPI_API_SUCCESS) + tel_deregister_event(subscription_id); + tel_deinit(); + return; +} + +/** + * @brief This tests tel_get_sms_parameters() API in normal conditions + * @par ID: + * UTC_TEL_GET_SMS_PARAM_01 + * @param [in] SmsRecordIndex = 1 + * @param [out] pRequestId + * @return TAPI_API_SUCCESS + */ +void utc_tel_get_sms_parameters_01() +{ + TapiResult_t returnStatus; + int pRequestId; + int SmsRecordIndex = 1; + + /* CALLING TAPI SMS GET PARAMETERS */ + returnStatus = tel_get_sms_parameters(SmsRecordIndex, &pRequestId); + gmain_loop_for_events(5000); + + printf("The return value is %d\n", returnStatus); + printf("The pRequestId value is %d\n", pRequestId); + + TET_CHECK(returnStatus == TAPI_API_SUCCESS); + if (returnStatus == TAPI_API_SUCCESS) + printf("utc_tel_get_sms_parameters_01 pass\n"); + + return; +} + +/** + * @brief This tests tel_get_sms_parameters() API in normal conditions + * @par ID: + * UTC_TEL_GET_SMS_PARAM_02 + * @param [in] SmsRecordIndex = 0 + * @param [out] pRequestId + * @return TAPI_API_SUCCESS + */ +void utc_tel_get_sms_parameters_02() +{ + TapiResult_t returnStatus; + int pRequestId; + int SmsRecordIndex = 0; + + /* CALLING TAPI SMS GET PARAMETERS */ + returnStatus = tel_get_sms_parameters(SmsRecordIndex, &pRequestId); + gmain_loop_for_events(5000); + + printf("The return value is %d\n", returnStatus); + printf("The pRequestId value is %d\n", pRequestId); + + TET_CHECK(returnStatus == TAPI_API_SUCCESS); + if (returnStatus == TAPI_API_SUCCESS) + printf("utc_tel_get_sms_parameters_02 pass\n"); + + return; +} + +/** + * @brief This tests tel_get_sms_parameters() API in abnormal conditions + * @par ID: + * UTC_TEL_GET_SMS_PARAM_03 + * @param [in] SmsRecordIndex = -1 + * @param [out] pRequestId + * @return TAPI_API_INVALID_INPUT + */ +void utc_tel_get_sms_parameters_03() +{ + TapiResult_t returnStatus; + int pRequestId; + int SmsRecordIndex = -1; + + /* CALLING TAPI SMS GET PARAMETERS */ + returnStatus = tel_get_sms_parameters(SmsRecordIndex, &pRequestId); + printf("The return value is %d\n", returnStatus); + printf("The pRequestId value is %d\n", pRequestId); + + TET_CHECK(returnStatus == TAPI_API_INVALID_INPUT); + if (returnStatus == TAPI_API_INVALID_INPUT) + printf("utc_tel_get_sms_parameters_03 pass\n"); + + return; +} + +/** + * @brief This tests tel_get_sms_parameters() API in abnormal conditions + * @par ID: + * UTC_TEL_GET_SMS_PARAM_04 + * @param [in] SmsRecordIndex = 256 + * @param [out] pRequestId + * @return TAPI_API_INVALID_INPUT + */ +void utc_tel_get_sms_parameters_04() +{ + TapiResult_t returnStatus; + int pRequestId; + int SmsRecordIndex = 256; + + /* CALLING TAPI SMS GET PARAMETERS */ + returnStatus = tel_get_sms_parameters(SmsRecordIndex, &pRequestId); + + printf("The return value is %d\n", returnStatus); + printf("The pRequestId value is %d\n", pRequestId); + + TET_CHECK(returnStatus == TAPI_API_INVALID_INPUT); + if (returnStatus == TAPI_API_INVALID_INPUT) + printf("utc_tel_get_sms_parameters_04 pass\n"); + + return; +} + +/** + * @brief This tests tel_get_sms_parameters() API in abnormal conditions + * @par ID: + * UTC_TEL_GET_SMS_PARAM_05 + * @param [in] SmsRecordIndex = 1 + * @param [out] pRequestId = NULL + * @return TAPI_API_INVALID_PTR + */ +void utc_tel_get_sms_parameters_05() +{ + TapiResult_t returnStatus; + int SmsRecordIndex = 1; + + /* CALLING TAPI SMS GET PARAMETERS */ + returnStatus = tel_get_sms_parameters(SmsRecordIndex, NULL); + + printf("The return value is %d\n", returnStatus); + TET_CHECK(returnStatus == TAPI_API_INVALID_PTR); + + if (returnStatus == TAPI_API_INVALID_PTR) + printf("utc_tel_get_sms_parameters_05 pass\n"); + + return; +} + +/** @} */ diff --git a/TC/telephony_TC/sms/unit/uts_tel_get_sms_parameters.h b/TC/telephony_TC/sms/unit/uts_tel_get_sms_parameters.h new file mode 100644 index 0000000..f1c470c --- /dev/null +++ b/TC/telephony_TC/sms/unit/uts_tel_get_sms_parameters.h @@ -0,0 +1,35 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * 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 _UTS_TEL_GET_SMS_PARAMETERS_H_ +#define _UTS_TEL_GET_SMS_PARAMETERS_H_ + +static void utc_tel_get_sms_parameters_01(); + +static void utc_tel_get_sms_parameters_02(); + +static void utc_tel_get_sms_parameters_03(); + +static void utc_tel_get_sms_parameters_04(); + +static void utc_tel_get_sms_parameters_05(); + +#endif diff --git a/TC/telephony_TC/sms/unit/uts_tel_get_sms_preferred_bearer.c b/TC/telephony_TC/sms/unit/uts_tel_get_sms_preferred_bearer.c new file mode 100644 index 0000000..611c01c --- /dev/null +++ b/TC/telephony_TC/sms/unit/uts_tel_get_sms_preferred_bearer.c @@ -0,0 +1,150 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * 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 + +#include +#include + +#include +#include +#include +#include + +#include +#include "tet_macro.h" + +#include +#include + +#include "sms_callback_util.h" +#include "uts_tel_get_sms_preferred_bearer.h" + +/* Initialize TCM data structures */ +static void startup(); +static void cleanup(); +void (*tet_startup)() = startup; +void (*tet_cleanup)() = cleanup; +struct tet_testlist tet_testlist[] = { { uts_tel_get_sms_preferred_bearer_01, 1 }, { uts_tel_get_sms_preferred_bearer_02, 2 }, { NULL, 0 } }; + +static TapiResult_t gStartupSuccess; +unsigned int subscription_id; + +void alarm_received(int sgi) +{ + gAsyncResult = FALSE; + printf("Signal [SIGALARM] Received. Close g_main_loop()"); + G_MAIN_LOOP_CLOSE(); +} + +/* Startup & Clean function : It is not test code, only for + initialize and finalize test module */ + +static void startup() +{ + tapi_dbus_connection_name dname; + int bStatus; + + gStartupSuccess = tel_init(); + if (gStartupSuccess != TAPI_API_SUCCESS) { + printf("tel_init() Failed gStartupSuccess = %d \n", gStartupSuccess); + } + gStartupSuccess = tel_register_event(TAPI_EVENT_NETTEXT_GET_SMSBEARER_CNF, &subscription_id, tapi_sms_callback, NULL); + + if (gStartupSuccess != TAPI_API_SUCCESS) { + printf("tel_register_event Failed gStartupSuccess = %d \n", gStartupSuccess); + } + else { + tel_register_app_name("org.samsung.test"); + if (tel_get_app_name(&dname)) + printf("Dbus Get app name error\n"); + else + printf("Dbus Name is %s\n", dname.name); + + tel_check_service_ready(&bStatus); + printf("Telephony service %d\n", bStatus); + + printf("after tel_register_event subscription_id is %d gStartupSuccess is %d\n", subscription_id, gStartupSuccess); + } +} + +static void cleanup() +{ + if (gStartupSuccess == TAPI_API_SUCCESS) + tel_deregister_event(subscription_id); + tel_deinit(); + return; +} + +/** + * @brief This tests tel_get_sms_preferred_bearer() API in normal conditions + * @par ID: + * UTC_TEL_GET_PREFEERED_BEARER_01 + * @param [in] None + @param [out] pRequestId + * @return TAPI_API_SUCCESS + */ +void uts_tel_get_sms_preferred_bearer_01() +{ + TapiResult_t returnStatus; + int pRequestId = -1; + + returnStatus = tel_get_sms_preferred_bearer(&pRequestId); + + gmain_loop_for_events(5000); + + printf("The request id value is %d\n", pRequestId); + printf("The return value is %d\n", returnStatus); + + TET_CHECK(returnStatus == TAPI_API_NOT_SUPPORTED); + if (returnStatus == TAPI_API_NOT_SUPPORTED) + printf("uts_tel_get_sms_preferred_bearer_01 pass\n"); + + return; +} + +/** + * @brief This tests tel_get_sms_preferred_bearer() API in abnormal conditions + * @par ID: + * UTC_TEL_GET_PREFEERED_BEARER_02 + * @param [in] None + * @param [out] pRequestId = NULL + * @return TAPI_API_INVALID_PTR + */ +void uts_tel_get_sms_preferred_bearer_02() +{ + TapiResult_t returnStatus; + + returnStatus = tel_get_sms_preferred_bearer(NULL); + + printf("The return value is %d\n", returnStatus); + + TET_CHECK(returnStatus == TAPI_API_INVALID_PTR); + if (returnStatus == TAPI_API_INVALID_PTR) + printf("uts_tel_get_sms_preferred_bearer_02 pass\n"); + + return; +} + +/** @} */ diff --git a/TC/telephony_TC/sms/unit/uts_tel_get_sms_preferred_bearer.h b/TC/telephony_TC/sms/unit/uts_tel_get_sms_preferred_bearer.h new file mode 100644 index 0000000..3135dbb --- /dev/null +++ b/TC/telephony_TC/sms/unit/uts_tel_get_sms_preferred_bearer.h @@ -0,0 +1,27 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * 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 _UTS_TEL_GET_SMS_PREFERRED_BEARER_H_ +#define _UTS_TEL_GET_SMS_PREFERRED_BEARER_H_ + +static void uts_tel_get_sms_preferred_bearer_01(); +static void uts_tel_get_sms_preferred_bearer_02(); + +#endif diff --git a/TC/telephony_TC/sms/unit/uts_tel_get_sms_sca.c b/TC/telephony_TC/sms/unit/uts_tel_get_sms_sca.c new file mode 100644 index 0000000..1d8f715 --- /dev/null +++ b/TC/telephony_TC/sms/unit/uts_tel_get_sms_sca.c @@ -0,0 +1,179 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * 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 + +#include +#include + +#include +#include +#include +#include + +#include +#include "tet_macro.h" + +#include +#include + +#include "sms_callback_util.h" +#include "uts_tel_get_sms_sca.h" +#include "sms_common.h" + +/* Initialize TCM data structures */ +static void startup(); +static void cleanup(); +void (*tet_startup)() = startup; +void (*tet_cleanup)() = cleanup; +struct tet_testlist tet_testlist[] = { { utc_tel_get_sms_sca_01, 1 }, { utc_tel_get_sms_sca_02, 2 }, { NULL, 0 } }; + +TelSmsAddressInfo_t *pSCA; +/* Startup & Clean function : It is not test code, only for + initialize and finalize test module + */ +static void startup() +{ +#if 0 + char scaNum[TAPI_NETTEXT_SCADDRESS_LEN_MAX]; + int scaNum_len = 0; + int Index = 0; + int i = 0; + int pRequestId = -1; + TS_BYTE packet[500]; + TapiResult_t returnStatus = TAPI_API_SUCCESS; + + pSCA = (TelSmsAddressInfo_t*) malloc(sizeof(TelSmsAddressInfo_t)); + memset(pSCA, 0, sizeof(pSCA)); + + sprintf(scaNum, "%d", VALID_SCA_NUM); + scaNum_len = strlen(scaNum); + scaNum[scaNum_len] = '\0'; + scaNum_len = scaNum_len - 1; + + printf("Sca Number :%s\n", scaNum); + printf("sca number length : %d \n", scaNum_len); + + Index = SmsUtilEncodeAddrField(packet, scaNum, scaNum_len, 0x01, 0x01); + + printf("Index =%d\n", Index); + + for (i = 0; i < Index; i++) + printf("[%02x]", packet[i]); + + pSCA->DialNumLen = Index; + + memcpy(pSCA->szDiallingNum, packet, Index); +#endif + + tel_init(); + tel_register_app_name("org.samsung.test"); + +#if 0 + printf("\nSET INVALID SERVICE CENTER ADDRESS\n"); + /* Calling TAPI SMS SET SCA API */ + returnStatus = tel_set_sms_sca(pSCA, Index, &pRequestId); + printf("The return value is %d\n", returnStatus); + printf("The pRequestId value is %d\n", pRequestId); + if (returnStatus == TAPI_API_SUCCESS) + printf("Set SCA settings successful\n"); +#endif +} + +static void cleanup() +{ + tel_deinit(); + + //free(pSCA); +} + +/** + * @brief This tests tel_get_sms_sca() API in normal conditions + * @par ID: + * UTC_TEL_GET_SERV_CENTER_ADDR_01 + * @param [in] Index = 0 + * @param [out] pSCA + * @return TAPI_API_SUCCESS + */ +void utc_tel_get_sms_sca_01() +{ + TapiResult_t returnStatus = TAPI_API_SUCCESS; + TelSmsAddressInfo_t *pSCA; + int req; + + pSCA = (TelSmsAddressInfo_t *) malloc(sizeof(TelSmsAddressInfo_t)); + + returnStatus = tel_get_sms_sca(0, &req); + + printf("The return value is %d\n", returnStatus); + +#if 0 + TS_BYTE SCA[TAPI_NETTEXT_SCADDRESS_LEN_MAX]; + char decode_sca_addr[TAPI_NETTEXT_SCADDRESS_LEN_MAX]; + int sca_len = -1; + + /* Decode the service center address */ + printf("Service center addr returned from TAPI SCA address %s returnStatus %d\n", pSCA->szDiallingNum, returnStatus); + SmsUtilDecodeAddrField(decode_sca_addr, &(pSCA->szDiallingNum[0]), &(pSCA->Ton), &(pSCA->Npi)); + sca_len = strlen(decode_sca_addr); + + memcpy(SCA, decode_sca_addr, sca_len); + SCA[sca_len] = '\0'; + + printf("Decode SCA Address =========\n"); + printf("SCA Number :%s, SCA Length :%d \n", SCA, sca_len); + printf("========================\n"); + printf("decodeScaAddr :%s\n", decode_sca_addr); +#endif + + TET_CHECK(returnStatus == TAPI_API_SUCCESS); + if (returnStatus == TAPI_API_SUCCESS) + printf("utc_tel_set_sms_sca_01 pass\n"); + + return; +} + +/** + * @brief This tests tel_get_sms_sca() API in abnormal conditions + * @par ID: + * UTC_TEL_GET_SERV_CENTER_ADDR_02 + * @param [in] Index = 0 + * @param [out] pSCA = NULL + * @return TAPI_API_INVALID_PTR + */ +void utc_tel_get_sms_sca_02() +{ + TapiResult_t returnStatus = TAPI_API_SUCCESS; + int req; + + returnStatus = tel_get_sms_sca(-1, &req); + + printf("The return value is %d\n", returnStatus); + TET_CHECK(returnStatus == TAPI_API_INVALID_INPUT); + if (returnStatus == TAPI_API_INVALID_INPUT) + printf("utc_tel_set_sms_sca_02 pass\n"); + + return; +} +/** @} */ diff --git a/TC/telephony_TC/sms/unit/uts_tel_get_sms_sca.h b/TC/telephony_TC/sms/unit/uts_tel_get_sms_sca.h new file mode 100644 index 0000000..9d36720 --- /dev/null +++ b/TC/telephony_TC/sms/unit/uts_tel_get_sms_sca.h @@ -0,0 +1,28 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * 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 _UTS_TEL_GET_SMS_SCA_H_ +#define _UTS_TEL_GET_SMS_SCA_H_ + +static void utc_tel_get_sms_sca_01(); +static void utc_tel_get_sms_sca_02(); + +#endif //_UTS_GET_SERV_CENTER_ADDR_H_ diff --git a/TC/telephony_TC/sms/unit/uts_tel_read_sms_in_sim.c b/TC/telephony_TC/sms/unit/uts_tel_read_sms_in_sim.c new file mode 100644 index 0000000..8c0670e --- /dev/null +++ b/TC/telephony_TC/sms/unit/uts_tel_read_sms_in_sim.c @@ -0,0 +1,202 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * 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 + +#include +#include + +#include +#include +#include +#include + +#include +#include "tet_macro.h" + +#include +#include + +#include "sms_callback_util.h" +#include "uts_tel_read_sms_in_sim.h" + +static void startup(); +static void cleanup(); +void (*tet_startup)() = startup; +void (*tet_cleanup)() = cleanup; +struct tet_testlist tet_testlist[] = { { utc_tel_read_sms_in_sim_01, 1 }, { utc_tel_read_sms_in_sim_02, 2 }, { utc_tel_read_sms_in_sim_03, 3 }, { + utc_tel_read_sms_in_sim_04, 4 }, { NULL, 0 } }; + +static TapiResult_t gStartupSuccess; +unsigned int subscription_id; + +void alarm_received(int sgi) +{ + gAsyncResult = FALSE; + printf("Signal [SIGALARM] Received. Close g_main_loop()"); + G_MAIN_LOOP_CLOSE(); +} + +/* Startup & Clean function : It is not test code, only for + initialize and finalize test module + */ + +static void startup() +{ + tapi_dbus_connection_name dname; + int bStatus; + + gStartupSuccess = tel_init(); + if (gStartupSuccess != TAPI_API_SUCCESS) { + printf("tel_init() Failed gStartupSuccess = %d \n", gStartupSuccess); + } + + gStartupSuccess = tel_register_event(TAPI_EVENT_NETTEXT_READ_SMS_CNF, &subscription_id, tapi_sms_callback, NULL); + + if (gStartupSuccess != TAPI_API_SUCCESS) { + printf("TapiCommonRegisterEvent Failed gStartupSuccess = %d \n", gStartupSuccess); + } + else { + tel_register_app_name("org.samsung.test"); + if (tel_get_app_name(&dname)) + printf("Dbus Get app name error\n"); + else + printf("Dbus Name is %s\n", dname.name); + + tel_check_service_ready(&bStatus); + printf("Telephony service %d\n", bStatus); + + printf("TapiCommonRegisterEvent subscription_id is %d gStartupSuccess is %d\n", subscription_id, gStartupSuccess); + } +} + +static void cleanup() +{ + if (gStartupSuccess == TAPI_API_SUCCESS) + tel_deregister_event(subscription_id); + tel_deinit(); + return; +} + +/** + * @brief This tests tel_read_sms_in_sim() API in normal conditions + * @par ID: + * UTC_TEL_READ_SMS_01 + * @param [in] Index = 1 + * @param [out] pRequestId + * @return TAPI_API_SUCCESS + */ +void utc_tel_read_sms_in_sim_01() +{ + TapiResult_t returnStatus; + int pRequestId; + + returnStatus = tel_read_sms_in_sim(1, &pRequestId); + gmain_loop_for_events(5000); + + printf("The return value is %d\n", returnStatus); + printf("The pRequestId value is %d\n", pRequestId); + + TET_CHECK(returnStatus == TAPI_API_SUCCESS); + if (returnStatus == TAPI_API_SUCCESS) + printf("utc_tel_read_sms_01 pass\n"); + + return; +} + +/** + * @brief This tests tel_read_sms_in_sim() API in normal conditions + * @par ID: + * UTC_TEL_READ_SMS_02 + * @param [in] Index = 0 + * @param [out] pRequestId + * @return TAPI_API_SUCCESS + */ +void utc_tel_read_sms_in_sim_02() +{ + TapiResult_t returnStatus; + int pRequestId; + + returnStatus = tel_read_sms_in_sim(0, &pRequestId); + + gmain_loop_for_events(5000); + printf("The return value is %d\n", returnStatus); + printf("The pRequestId value is %d\n", pRequestId); + + TET_CHECK(returnStatus == TAPI_API_SUCCESS); + if (returnStatus == TAPI_API_SUCCESS) + printf("utc_tel_read_sms_02 pass\n"); + + return; +} + +/** + * @brief This tests tel_read_sms_in_sim() API in abnormal conditions + * @par ID: + * UTC_TEL_READ_SMS_03 + * @param [in] Index = -1 + * @param [out] pRequestId + * @return TAPI_API_INVALID_INPUT + */ +void utc_tel_read_sms_in_sim_03() +{ + TapiResult_t returnStatus; + int pRequestId = -1; + + returnStatus = tel_read_sms_in_sim(-1, &pRequestId); + + printf("The return value is %d\n", returnStatus); + printf("The pRequestId value is %d\n", pRequestId); + + TET_CHECK(returnStatus == TAPI_API_INVALID_INPUT); + if (returnStatus == TAPI_API_INVALID_INPUT) + printf("utc_tel_read_sms_03 pass\n"); + + return; +} + +/** + * @brief This tests tel_read_sms_in_sim() API in abnormal conditions + * @par ID: + * UTC_TEL_READ_SMS_04 + * @param [in] Index = 1 + * @param [out] pRequestId = NULL + * @return TAPI_API_INVALID_PTR + */ +void utc_tel_read_sms_in_sim_04() +{ + TapiResult_t returnStatus; + + returnStatus = tel_read_sms_in_sim(1, NULL); + + printf("The return value is %d\n", returnStatus); + + TET_CHECK(returnStatus == TAPI_API_INVALID_PTR); + if (returnStatus == TAPI_API_INVALID_PTR) + printf("utc_tel_read_sms_04 pass\n"); + + return; +} + +/** @} */ diff --git a/TC/telephony_TC/sms/unit/uts_tel_read_sms_in_sim.h b/TC/telephony_TC/sms/unit/uts_tel_read_sms_in_sim.h new file mode 100644 index 0000000..44daa6d --- /dev/null +++ b/TC/telephony_TC/sms/unit/uts_tel_read_sms_in_sim.h @@ -0,0 +1,33 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * 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 _UTS_TEL_READ_SMS_IN_SIM_H_ +#define _UTS_TEL_READ_SMS_IN_SIM_H_ + +static void utc_tel_read_sms_in_sim_01(); + +static void utc_tel_read_sms_in_sim_02(); + +static void utc_tel_read_sms_in_sim_03(); + +static void utc_tel_read_sms_in_sim_04(); + + +#endif diff --git a/TC/telephony_TC/sms/unit/uts_tel_send_sms.c b/TC/telephony_TC/sms/unit/uts_tel_send_sms.c new file mode 100644 index 0000000..afccf52 --- /dev/null +++ b/TC/telephony_TC/sms/unit/uts_tel_send_sms.c @@ -0,0 +1,243 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * 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 + +#include +#include + +#include +#include +#include +#include + +#include "tet_api.h" +#include "tet_macro.h" + +#include +#include + +#include "sms_callback_util.h" +#include "sms_util.h" +#include "uts_tel_send_sms.h" +#include "sms_common.h" + +static void startup(); +static void cleanup(); +void (*tet_startup) () = startup; +void (*tet_cleanup) () = cleanup; +struct tet_testlist tet_testlist[] = { + {utc_tel_send_sms_01, 1}, + {utc_tel_send_sms_02, 2}, + {utc_tel_send_sms_03, 3}, + {utc_tel_send_sms_04, 4}, + {utc_tel_send_sms_05, 5}, + {NULL, 0} +}; + +static TapiResult_t gStartupSuccess; +unsigned int subscription_id; + +void alarm_received(int sgi) +{ + gAsyncResult = FALSE; + printf("Signal [SIGALARM] Received. Close g_main_loop()"); + G_MAIN_LOOP_CLOSE(); +} + +/* Startup & Clean function : It is not test code, only for + initialize and finalize test module + */ + +static void startup() +{ + tapi_dbus_connection_name dname; + int bStatus; + + gStartupSuccess = tel_init(); + if (gStartupSuccess != TAPI_API_SUCCESS) { + printf("tel_init() Failed gStartupSuccess = %d \n", gStartupSuccess); + } + + gStartupSuccess = tel_register_event(TAPI_EVENT_NETTEXT_SENTSTATUS_CNF, &subscription_id, tapi_sms_callback, NULL); + + if (gStartupSuccess != TAPI_API_SUCCESS) { + printf("TapiCommonRegisterEvent Failed gStartupSuccess = %d \n", gStartupSuccess); + } + else { + tel_register_app_name("org.samsung.test"); + if (tel_get_app_name(&dname)) + printf("Dbus Get app name error\n"); + else + printf("Dbus Name is %s\n", dname.name); + + tel_check_service_ready(&bStatus); + printf("Telephony service %d\n", bStatus); + + printf("TapiCommonRegisterEvent subscription_id is %d gStartupSuccess is %d\n", subscription_id, gStartupSuccess); + } +} + +static void cleanup() +{ + if (gStartupSuccess == TAPI_API_SUCCESS) + tel_deregister_event(subscription_id); + tel_deinit(); + return; +} + +/** + * @brief This tests tel_send_sms() API in normal conditions + * @par ID: + * UTC_TEL_SEND_SMS_01 + * @param [in] pDataPackage = valid + * @param [in] bMoreMsgToSend = FALSE + * @param [out] pRequestId + * @return TAPI_API_SUCCESS + */ +void utc_tel_send_sms_01() +{ + TapiResult_t returnStatus = TAPI_API_SUCCESS; + TS_BOOL bMoreMsgToSend = FALSE; + int pRequestId = -1; + TelSmsDatapackageInfo_t smsDataPackage; + + PrepareMessage(&smsDataPackage); + returnStatus = tel_send_sms(&smsDataPackage, bMoreMsgToSend, &pRequestId); + gmain_loop_for_events(5000); + + printf("The return value is %d\n", returnStatus); + printf("The pRequestId value is %d\n", pRequestId); + + TET_CHECK(returnStatus == TAPI_API_SUCCESS); + if (returnStatus == TAPI_API_SUCCESS) + printf("utc_tel_send_sms_01 pass\n"); + return; +} + +/** + * @brief This tests tel_send_sms() API in abnormal conditions + * @par ID: + * UTC_TEL_SEND_SMS_02 + * @param [in] pDataPackage = NULL + * @param [in] bMoreMsgToSend = FALSE + * @param [out] pRequestId + * @return TAPI_API_INVALID_PTR + */ +void utc_tel_send_sms_02() +{ + TapiResult_t returnStatus = TAPI_API_SUCCESS; + TS_BOOL bMoreMsgToSend = FALSE; + int pRequestId = -1; + + returnStatus = tel_send_sms(NULL, bMoreMsgToSend, &pRequestId); + printf("The return value is %d\n", returnStatus); + printf("The pRequestId value is %d\n", pRequestId); + + TET_CHECK(returnStatus == TAPI_API_INVALID_PTR); + if (returnStatus == TAPI_API_INVALID_PTR) + printf("utc_tel_send_sms_02 pass\n"); + return; +} + +/** + * @brief This tests tel_send_sms() API in abnormal conditions + * @par ID: + * UTC_TEL_SEND_SMS_03 + * @param [in] pDataPackage = valid + * @param [in] bMoreMsgToSend = FALSE + * @param [out] pRequestId = NULL + * @return TAPI_API_INVALID_PTR + */ + +void utc_tel_send_sms_03() +{ + TapiResult_t returnStatus = TAPI_API_SUCCESS; + TelSmsDatapackageInfo_t smsDataPackage; + TS_BOOL bMoreMsgToSend = FALSE; + PrepareMessage(&smsDataPackage); + returnStatus = tel_send_sms(&smsDataPackage, bMoreMsgToSend, NULL); + printf("The return value is %d\n", returnStatus); + + TET_CHECK(returnStatus == TAPI_API_INVALID_PTR); + if (returnStatus == TAPI_API_INVALID_PTR) + printf("utc_tel_send_sms_03 pass\n"); + return; +} + +/** + * @brief This tests tel_send_sms() API in normal conditions + * @par ID: + * UTC_TEL_SEND_SMS_04 + * @param [in] pDataPackage = valid + * @param [in] bMoreMsgToSend = TRUE + * @param [out] pRequestId + * @return TAPI_API_SUCCESS + */ + +void utc_tel_send_sms_04() +{ + TapiResult_t returnStatus = TAPI_API_SUCCESS; + TS_BOOL bMoreMsgToSend = TRUE; + TelSmsDatapackageInfo_t smsDataPackage; + int pRequestId = -1; + PrepareMessage(&smsDataPackage); + returnStatus = tel_send_sms(&smsDataPackage, bMoreMsgToSend, &pRequestId); + + gmain_loop_for_events(5000); + + printf("The return value is %d\n", returnStatus); + printf("The pRequestId value is %d\n", pRequestId); + + TET_CHECK(returnStatus == TAPI_API_SUCCESS); + if (returnStatus == TAPI_API_SUCCESS) + printf("utc_tel_send_sms_04 pass\n"); + return; +} + +/** + * @brief This tests tel_send_sms() API in abnormal conditions + * @par ID: + * UTC_TEL_SEND_SMS_05 + * @param [in] pDataPackage = NULL + * @param [in] bMoreMsgToSend = FALSE + * @param [out] pRequestId = NULL + * @return TAPI_API_INVALID_PTR + */ +void utc_tel_send_sms_05() +{ + + TapiResult_t returnStatus = TAPI_API_SUCCESS; + TS_BOOL bMoreMsgToSend = FALSE; + returnStatus = tel_send_sms(NULL, bMoreMsgToSend, NULL); + + printf("The return value is %d\n", returnStatus); + + TET_CHECK(returnStatus == TAPI_API_INVALID_PTR); + if (returnStatus == TAPI_API_INVALID_PTR) + printf("utc_tel_send_sms_05 pass\n"); + return; +} + +/** @} */ diff --git a/TC/telephony_TC/sms/unit/uts_tel_send_sms.h b/TC/telephony_TC/sms/unit/uts_tel_send_sms.h new file mode 100644 index 0000000..83846ea --- /dev/null +++ b/TC/telephony_TC/sms/unit/uts_tel_send_sms.h @@ -0,0 +1,30 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * 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 _UTS_TEL_SEND_SMS_H_ +#define _UTS_TEL_SEND_SMS_H_ + +static void utc_tel_send_sms_01(); +static void utc_tel_send_sms_02(); +static void utc_tel_send_sms_03(); +static void utc_tel_send_sms_04(); +static void utc_tel_send_sms_05(); + +#endif diff --git a/TC/telephony_TC/sms/unit/uts_tel_send_sms_deliver_report.c b/TC/telephony_TC/sms/unit/uts_tel_send_sms_deliver_report.c new file mode 100644 index 0000000..0832f48 --- /dev/null +++ b/TC/telephony_TC/sms/unit/uts_tel_send_sms_deliver_report.c @@ -0,0 +1,312 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * 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 + +#include +#include + +#include +#include +#include +#include + +#include +#include "tet_macro.h" + +#include +#include + +#include "sms_common.h" +#include "sms_callback_util.h" +#include "uts_tel_send_sms_deliver_report.h" + +/* Initialize TCM data structures */ +static void startup(); +static void cleanup(); +void (*tet_startup) () = startup; +void (*tet_cleanup) () = cleanup; +struct tet_testlist tet_testlist[] = { + {utc_tel_send_sms_deliver_report_01, 1}, + {utc_tel_send_sms_deliver_report_02, 2}, + {utc_tel_send_sms_deliver_report_03, 3}, + {utc_tel_send_sms_deliver_report_04, 4}, + {NULL, 0} +}; + + +static TapiResult_t gStartupSuccess; +unsigned int subscription_id; + +void alarm_received(int sgi) +{ + gAsyncResult = FALSE; + printf("Signal [SIGALARM] Received. Close g_main_loop()"); + G_MAIN_LOOP_CLOSE(); +} + +/* Startup & Clean function : It is not test code, only for + initialize and finalize test module */ + +static void startup() +{ + tapi_dbus_connection_name dname; + int bStatus; + + gStartupSuccess = tel_init(); + if (gStartupSuccess != TAPI_API_SUCCESS) { + printf("tel_init() Failed gStartupSuccess = %d \n", gStartupSuccess); + } + + gStartupSuccess = tel_register_event(TAPI_EVENT_NETTEXT_DELIVERY_REPORT_CNF, &subscription_id, tapi_sms_callback, (void *)TAPI_EVENT_NETTEXT_DELIVERY_REPORT_CNF); + gStartupSuccess = tel_register_event(TAPI_EVENT_NETTEXT_INCOM_IND, &subscription_id, tapi_sms_callback, (void *)TAPI_EVENT_NETTEXT_INCOM_IND); + + if (gStartupSuccess != TAPI_API_SUCCESS) { + printf("TapiCommonRegisterEvent Failed gStartupSuccess = %d \n", gStartupSuccess); + } + else { + tel_register_app_name("org.samsung.test"); + if (tel_get_app_name(&dname)) + printf("Dbus Get app name error\n"); + else + printf("Dbus Name is %s\n", dname.name); + + tel_check_service_ready(&bStatus); + printf("Telephony service %d\n", bStatus); + + printf("after TapiCommonRegisterEvent subscription_id1 is %d gStartupSuccess is %d\n", subscription_id, gStartupSuccess); + } + + printf("\n## TEST START ##\n"); +} + +static void cleanup() +{ + if (gStartupSuccess == TAPI_API_SUCCESS) + tel_deregister_event(subscription_id); + tel_deinit(); + + printf("\n## TEST FINISH ##\n"); + return; +} + +void EncodeSmsDeliveryReportTpdu(TelSmsDatapackageInfo_t *pDataPackage) +{ + TPDU_SMS_DELIVER_REPORT deliver_report; + unsigned char packet[TAPI_NETTEXT_MSG_SIZE_MAX] = {0,}; + char *SCA = VALID_SCA_NUM; + + TS_BYTE tp_dcs; + TS_BYTE mask = 0x69; + int index = 0, ScIndex = 0, sca_len; + int i; + + ScIndex = SmsUtilEncodeAddrField(pDataPackage->Sca, SCA, strlen(SCA), 0x01, 0x01); + sca_len = strlen(SCA); + + /* TP-MTI , TP-UDHI */ + deliver_report.msg_type = SMS_TPDU_DELIVER_REPORT; + deliver_report.udhi = FALSE; + + packet[index] = deliver_report.msg_type; //DELIVER REPORT + packet[index] |= deliver_report.udhi ? 0x40 : 0; //bit 6 + + index++; + + /* TP -PI */ + deliver_report.paraInd = mask; + packet[index] = deliver_report.paraInd; + + if ((mask != 0xFF) && (mask != 0)) { + index++; + /* TP-PID */ + if (mask & 0x01) { + deliver_report.pId = 0x65; + packet[index++] = deliver_report.pId; + } + + /* TP-DCS */ + if (mask & 0x02) { + deliver_report.dcs.bCompressed = FALSE; + deliver_report.dcs.bmsg_class_set = TRUE; + deliver_report.dcs.coding_group_type = TAPI_NETTEXT_CODGRP_SM_GENERAL_DCS; + deliver_report.dcs.alphabet_type = TAPI_NETTEXT_ALPHABET_DEFAULT; + deliver_report.dcs.class_type = TAPI_NETTEXT_CLASS_2; + + SmsUtilEncodeDCS(&tp_dcs, &deliver_report.dcs); + packet[index++] = tp_dcs; + } + /* TP-UDL */ + if (mask & 0x04) { + deliver_report.udl = 0x00; + packet[index++] = deliver_report.udl; + + /* TP-UD */ + + if (deliver_report.dcs.alphabet_type == TAPI_NETTEXT_ALPHABET_DEFAULT) { + //SmsUtilPackGSMCode( packet + index, msg, msg_len); + } + } + } + printf("EncodeSmsDeliveryReportTpdu: Send packet to phonseSever[%d] : ", index); + + for (i = 0; i < index; i++) { + printf("[%02x]", packet[i]); + if (i % 10 == 9) + printf("\n"); + } + printf("\n"); + + memcpy(pDataPackage->szData, packet, index); + pDataPackage->MsgLength = index; + printf("- msgLength:%d\n", pDataPackage->MsgLength); + printf("- SCA Number:[%s], SCA Length:%d\n", SCA, sca_len); + printf("- SCA Addr:"); + + for (i = 0; i < sca_len; i++) { + printf("%02x ", pDataPackage->Sca[i]); + if (i % 10 == 9) + printf(" "); + } + printf("\n\n"); + + return; +} + +/** + * @brief This tests tel_send_sms_deliver_report() API in normal conditions + * @par ID: + * UTC_TEL_SEND_DELIVERY_REPORT_01 + * @param [in] pDataPackage = valid + * @param [out] pRequestId + * @return TAPI_API_SUCCESS + */ +void utc_tel_send_sms_deliver_report_01() +{ + TapiResult_t returnStatus = TAPI_API_SUCCESS; + int pRequestId = 1; + TelSmsDatapackageInfo_t deliveryReportDataPackage = {{0,},0,{0,},}; + + printf("/******************************************\n"); + printf("* Please send a message to tesing target *\n"); + printf("* within 60 seconds !!! *\n"); + printf("*******************************************\n"); + + EncodeSmsDeliveryReportTpdu(&deliveryReportDataPackage); + returnStatus = tel_send_sms_deliver_report(&deliveryReportDataPackage, TAPI_NETTEXT_SENDSMS_SUCCESS, &pRequestId); + + gmain_loop_for_events(5000); + + printf("The return value is %d\n", returnStatus); + printf("The pRequestId value is %d\n", pRequestId); + + /* return TAPI_API_OEM_PLUGIN_FAILURE is ok. because call tel_send_sms_deliver_report() without tel_send_sms() */ + TET_CHECK(returnStatus == TAPI_API_OEM_PLUGIN_FAILURE); + if (returnStatus == TAPI_API_OEM_PLUGIN_FAILURE) + printf("utc_tel_send_sms_deliver_report_01 pass\n"); + else + printf("utc_tel_send_sms_deliver_report_01 fail\n"); + + return; +} + +/** + * @brief This tests tel_send_sms_deliver_report() API in abnormal conditions + * @par ID: + * UTC_TEL_SEND_DELIVERY_REPORT_02 + * @param [in] pDataPackage = valid + * @param [out] pRequestId = NULL + * @return TAPI_API_INVALID_PTR + */ +void utc_tel_send_sms_deliver_report_02() +{ + TapiResult_t returnStatus = TAPI_API_SUCCESS; + TelSmsDatapackageInfo_t deliveryReportDataPackage; + EncodeSmsDeliveryReportTpdu(&deliveryReportDataPackage); + + returnStatus = tel_send_sms_deliver_report(&deliveryReportDataPackage, TAPI_NETTEXT_SENDSMS_SUCCESS, NULL); + + printf("The return value is %d\n", returnStatus); + + TET_CHECK(returnStatus == TAPI_API_INVALID_PTR); + if (returnStatus == TAPI_API_INVALID_PTR) + printf("utc_tel_send_sms_deliver_report_02 pass\n"); + else + printf("utc_tel_send_sms_deliver_report_02 fail\n"); + + return; +} + +/** + * @brief This tests tel_send_sms_deliver_report() API in abnormal conditions + * @par ID: + * UTC_TEL_SEND_DELIVERY_REPORT_03 + * @param [in] pDataPackage = NULL + * @param [out] pRequestId + * @return TAPI_API_INVALID_PTR + */ +void utc_tel_send_sms_deliver_report_03() +{ + TapiResult_t returnStatus = TAPI_API_SUCCESS; + int pRequestId = -1; + + returnStatus = tel_send_sms_deliver_report(NULL, TAPI_NETTEXT_SENDSMS_SUCCESS, &pRequestId); + + printf("The return value is %d\n", returnStatus); + printf("The pRequestId value is %d\n", pRequestId); + + TET_CHECK(returnStatus == TAPI_API_INVALID_PTR); + if (returnStatus == TAPI_API_INVALID_PTR) + printf("utc_tel_send_sms_deliver_report_03 pass\n"); + else + printf("utc_tel_send_sms_deliver_report_03 fail\n"); + + return; +} + +/** + * @brief This tests tel_write_sms_in_sim() API in abnormal conditions + * @par ID: + * UTC_TEL_SEND_DELIVERY_REPORT_04 + * @param [in] pDataPackage = NULL + * @param [out] pRequestId = NULL + * @return TAPI_API_INVALID_PTR + */ +void utc_tel_send_sms_deliver_report_04() +{ + TapiResult_t returnStatus = TAPI_API_SUCCESS; + + returnStatus = tel_send_sms_deliver_report(NULL, TAPI_NETTEXT_SENDSMS_SUCCESS, NULL); + + printf("The return value is %d\n", returnStatus); + + TET_CHECK(returnStatus == TAPI_API_INVALID_PTR); + if (returnStatus == TAPI_API_INVALID_PTR) + printf("utc_tel_send_sms_deliver_report_04 pass\n"); + else + printf("utc_tel_send_sms_deliver_report_04 fail\n"); + + return; +} +/** @} */ diff --git a/TC/telephony_TC/sms/unit/uts_tel_send_sms_deliver_report.h b/TC/telephony_TC/sms/unit/uts_tel_send_sms_deliver_report.h new file mode 100644 index 0000000..97b6db3 --- /dev/null +++ b/TC/telephony_TC/sms/unit/uts_tel_send_sms_deliver_report.h @@ -0,0 +1,29 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * 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 _UTS_TEL_SEND_SMS_DELIVER_REPORT_H_ +#define _UTS_TEL_SEND_SMS_DELIVER_REPORT_H_ + +static void utc_tel_send_sms_deliver_report_01(); +static void utc_tel_send_sms_deliver_report_02(); +static void utc_tel_send_sms_deliver_report_03(); +static void utc_tel_send_sms_deliver_report_04(); + +#endif diff --git a/TC/telephony_TC/sms/unit/uts_tel_send_sms_msg.c b/TC/telephony_TC/sms/unit/uts_tel_send_sms_msg.c new file mode 100644 index 0000000..e55e271 --- /dev/null +++ b/TC/telephony_TC/sms/unit/uts_tel_send_sms_msg.c @@ -0,0 +1,448 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * 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 + +#include +#include + +#include +#include +#include +#include + +#include "tet_api.h" +#include "tet_macro.h" + +#include +#include + +#include "sms_callback_util.h" +#include "uts_tel_send_sms_msg.h" +#include "sms_common.h" + +#define BOOL int + +unsigned int SmsMsgId = 0; + +static void startup(); +static void cleanup(); +void (*tet_startup) () = startup; +void (*tet_cleanup) () = cleanup; +struct tet_testlist tet_testlist[] = { + {utc_tel_send_sms_msg_01, 1}, + {utc_tel_send_sms_msg_02, 2}, + {utc_tel_send_sms_msg_03, 3}, + {utc_tel_send_sms_msg_04, 4}, + {NULL, 0} +}; + +TelSmsMsgInfo_t *pDataPackage; +static TapiResult_t gStartupSuccess; +unsigned int subscription_id; + +void EncodeCdmaSmsSubmitTpdu(char* diallingNum, int dialNumLen, char* msgTxt, int msg_len); +void alarm_received(int sgi) +{ + gAsyncResult = FALSE; + printf("Signal [SIGALARM] Received. Close g_main_loop()"); + G_MAIN_LOOP_CLOSE(); +} + +/* Startup & Clean function : It is not test code, only for + initialize and finalize test module + */ + +static void startup() +{ + tapi_dbus_connection_name dname; + int bStatus; + + pDataPackage = malloc(sizeof(TelSmsMsgInfo_t)); + memset(pDataPackage, 0, sizeof(TelSmsMsgInfo_t)); + + gStartupSuccess = tel_init(); + if (gStartupSuccess != TAPI_API_SUCCESS) { + printf("tel_init() Failed gStartupSuccess = %d \n", gStartupSuccess); + } + + gStartupSuccess = tel_register_event(TAPI_EVENT_NETTEXT_SENTSTATUS_CNF, &subscription_id, tapi_sms_callback, NULL); + + if (gStartupSuccess != TAPI_API_SUCCESS) { + printf("TapiCommonRegisterEvent Failed gStartupSuccess = %d \n", gStartupSuccess); + } + else { + tel_register_app_name("org.samsung.test"); + if (tel_get_app_name(&dname)) + printf("Dbus Get app name error\n"); + else + printf("Dbus Name is %s\n", dname.name); + + tel_check_service_ready(&bStatus); + printf("Telephony service %d\n", bStatus); + + printf("TapiCommonRegisterEvent subscription_id is %d gStartupSuccess is %d\n", subscription_id, gStartupSuccess); + } +} + +static void cleanup() +{ + free(pDataPackage); + if (gStartupSuccess == TAPI_API_SUCCESS) + tel_deregister_event(subscription_id); + tel_deinit(); + return; +} + +///////////////////// + + +BOOL EncodeCdmaSmsParamTeleservice(int teleservice_id, ParamTeleserv_t *ParamTeleserv) +{ + BOOL ret = FALSE; + + if (ParamTeleserv == NULL) { + printf("[EncodeCdmaSmsParamTeleservice] NULL pointer \n"); + return ret; + } + + switch (teleservice_id) { + case TELESERVICEID_CPT95: + case TELESERVICEID_CMT95: + case TELESERVICEID_VMN95: + case TELESERVICEID_WAP: + ret = TRUE; + break; + + default: + ret = FALSE; + } + + if (ret == TRUE) { + ParamTeleserv->param_id = PARAMID_TELESERVICE_ID; + ParamTeleserv->param_len = 2; + ParamTeleserv->teleserv_id = teleservice_id; + } + + return ret; +} + +BOOL EncodeCdmaSmsParamDestAddress(int NumberPlan, char *diallingNum, ParamAddress_t *ParamAddr) +{ + int length = 0; + + if (ParamAddr == NULL || diallingNum == NULL) { + printf("[EncodeCdmaSmsParamAddress] NULL pointer \n"); + return FALSE; + } + + length = strlen(diallingNum); //remove CR + + ParamAddr->param_id = PARAMID_ADDRESS; + ParamAddr->len = length; + ParamAddr->digit = DIGITMODE_4BITDTMF; + ParamAddr->num = NUMMODE_NONE_DATANETWORK; + ParamAddr->numtype = NUMBER_TYPE_UNKNOWN; + ParamAddr->numplan = NumberPlan; + + strncpy((char *) ParamAddr->CHARi, diallingNum, length); + + length += 5; + ParamAddr->param_len = length; + + return TRUE; +} + +BOOL EncodeCdmaSmsParamCallbackAddress(int NumberPlan, char *diallingNum, ParamCallback_t *ParamCallback) +{ + int length = 0; + + if (ParamCallback == NULL || diallingNum == NULL) { + printf("[EncodeCdmaSmsParamAddress] NULL pointer \n"); + return FALSE; + } + + length = strlen(diallingNum); //remove CR + + ParamCallback->param_id = PARAMID_CALLBACK; + ParamCallback->digit = DIGITMODE_4BITDTMF; + ParamCallback->numtype = NUMBER_TYPE_UNKNOWN; + ParamCallback->numplan = NumberPlan; + ParamCallback->len = length; + strncpy((char *) ParamCallback->CHARi, diallingNum, length); + + length += 4; + ParamCallback->param_len = length; + + return TRUE; +} + +BOOL EncodeCdmaSmsParamMsgId(int type, ParamMsgId_t *ParamMsg) +{ + BOOL ret = FALSE; + + if (ParamMsg == NULL) { + printf("[EncodeCdmaSmsParamMsgId] NULL pointer \n"); + return ret; + } + + ParamMsg->param_id = PARAMID_MESSAGE_ID; + ParamMsg->param_len = 3; + ParamMsg->type = type; + ParamMsg->msg_id = SmsMsgId++; + + ret = TRUE; + + return ret; +} + +BOOL EncodeCdmaSmsParamUserData(char *SendTxt, ParamUserData_t *ParamUser) +{ + BOOL ret = FALSE; + int length = 0; + + if (ParamUser == NULL || SendTxt == NULL) { + printf("[EncodeCdmaSmsParamUserData] NULL pointer \n"); + return ret; + } + + length = strlen(SendTxt); + + ParamUser->param_id = PARAMID_USER_DATA; + ParamUser->encoding = MSGENCODING_7BIT_ASCII; + strncpy((char *) ParamUser->CHARi, SendTxt, length); + + ParamUser->len = length; + length += 2; + ; + ParamUser->param_len = length; + + ret = TRUE; + + return ret; +} +//////////////////// + +void EncodeCdmaSmsSubmitTpdu(char *diallingNum, int dialNumLen, char *msgTxt, int msg_len) +{ + ParamTeleserv_t ParamTeleserv = { 0, }; + ParamAddress_t ParamAddr = { 0, }; + ParamCallback_t Paramcallback = { 0, }; + ParamMsgId_t ParamMsg = { 0, }; + ParamUserData_t ParamUser = { 0, }; + int i; + char CallbackNum[] = "1117908499"; + + printf("EncodeCdmaSmsSubmitTpdu Func Enter\n"); + + memset(pDataPackage, 0, sizeof(TelSmsMsgInfo_t)); + pDataPackage->MsgType = TAPI_NETTEXT_MESSAGETYPE_SUBMIT; + EncodeCdmaSmsParamTeleservice(TELESERVICEID_CMT95, &ParamTeleserv); + pDataPackage->ParamMask |= TAPI_NETTEXT_PARAM_TELESERVICE_MASK; + memcpy(&pDataPackage->MsgData.OutSubmit.TeleService, &ParamTeleserv.teleserv_id, sizeof(unsigned short)); + printf("teleservice at TEST APP=%x\n", pDataPackage->MsgData.OutSubmit.TeleService); + + diallingNum[dialNumLen] = '\0'; + EncodeCdmaSmsParamDestAddress(NUMBER_PLAN_TELEPHONY, diallingNum, &ParamAddr); + pDataPackage->ParamMask |= TAPI_NETTEXT_PARAM_ADDRESS_MASK; + pDataPackage->MsgData.OutSubmit.DstAddr.Digit = ParamAddr.digit; + pDataPackage->MsgData.OutSubmit.DstAddr.NumberMode = ParamAddr.num; + pDataPackage->MsgData.OutSubmit.DstAddr.NumberType = ParamAddr.numtype; + pDataPackage->MsgData.OutSubmit.DstAddr.NumberPlan = ParamAddr.numplan; + pDataPackage->MsgData.OutSubmit.DstAddr.szAddrLength = ParamAddr.len; + memcpy(pDataPackage->MsgData.OutSubmit.DstAddr.szAddress, ParamAddr.CHARi, ParamAddr.len); + + EncodeCdmaSmsParamMsgId(MESSAGETYPE_SUBMIT, &ParamMsg); + pDataPackage->ParamMask |= TAPI_NETTEXT_PARAM_MESSAGE_ID_MASK; + pDataPackage->MsgData.OutSubmit.MsgId = ParamMsg.type; + pDataPackage->MsgType = ParamMsg.type; + + EncodeCdmaSmsParamCallbackAddress(NUMBER_PLAN_UNKNOWN, CallbackNum, &Paramcallback); + pDataPackage->ParamMask |= TAPI_NETTEXT_PARAM_CALLBACK_MASK; + pDataPackage->MsgData.OutSubmit.CallBackNumber.Digit = Paramcallback.digit; + pDataPackage->MsgData.OutSubmit.CallBackNumber.NumberType = Paramcallback.numtype; + pDataPackage->MsgData.OutSubmit.CallBackNumber.NumberPlan = Paramcallback.numplan; + pDataPackage->MsgData.OutSubmit.CallBackNumber.szAddrLength = Paramcallback.len; + memcpy(pDataPackage->MsgData.OutSubmit.CallBackNumber.szAddress, Paramcallback.CHARi, Paramcallback.len); + + msgTxt[msg_len - 1] = '\0'; + EncodeCdmaSmsParamUserData(msgTxt, &ParamUser); + pDataPackage->ParamMask |= TAPI_NETTEXT_PARAM_USER_DATA_MASK; + pDataPackage->MsgData.OutSubmit.MsgEncoding = ParamUser.encoding; + pDataPackage->MsgData.OutSubmit.MsgLength = ParamUser.len; + memcpy(pDataPackage->MsgData.OutSubmit.szData, ParamUser.CHARi, ParamUser.len); + + printf("\n=============== Test App Message =================\n"); + printf("0000: "); + for (i = 0; i < sizeof(TelSmsMsgInfo_t); i++) { + printf("[%2x] ", *(((unsigned char *) pDataPackage) + i)); + if ((i+1)%32 == 0) { + printf("\n%04x: ", i+1); + } + } + printf("\n==============================================\n"); +} + +void PrepareCDMAMessage() +{ + int msg_len = 0; + char buf[512]; + char message[512]; + char diallingNum[TAPI_NETTEXT_ADDRESS_LEN_MAX]; + int diallingNum_len = 0; + + memset(buf, 0, sizeof(buf)); + memset(diallingNum, 0, sizeof(diallingNum)); + memset(message, 0, sizeof(message)); + + strcpy(message, "This is a test message"); + strncpy(diallingNum, RECEIPIENT, TAPI_NETTEXT_ADDRESS_LEN_MAX); + + diallingNum_len = strlen(diallingNum); + printf("dialling num %s and dialling num len is %d\n", diallingNum, diallingNum_len); + diallingNum[diallingNum_len] = 0; + diallingNum_len = diallingNum_len - 1; + + msg_len = strlen(message); + + printf("==========================\n"); + printf("To :%s\n", diallingNum); + printf("Message: %s\nMsg Length:%d\n", message, msg_len); + printf("Dialling number Length : %d\n", diallingNum_len); + printf("==========================\n"); + + EncodeCdmaSmsSubmitTpdu(diallingNum, diallingNum_len, message, msg_len); +} + +/** + * @brief This tests tel_send_sms_msg() API in normal conditions + * @par ID: + * UTC_TEL_SEND_SMS_01 + * @param [in] pDataPackage = valid + * @param [in] bMoreMsgToSend = FALSE + * @param [out] pRequestId + * @return TAPI_API_SUCCESS + */ +void utc_tel_send_sms_msg_01() +{ + TapiResult_t returnStatus = TAPI_API_SUCCESS; + int pRequestId = -1; + + PrepareCDMAMessage(); + returnStatus = tel_send_sms_msg(pDataPackage, 0, &pRequestId); + gmain_loop_for_events(5000); + + printf("The return value is %d\n", returnStatus); + printf("The pRequestId value is %d\n", pRequestId); + + TET_CHECK(returnStatus == TAPI_API_SUCCESS); + if (returnStatus == TAPI_API_SUCCESS) + printf("utc_tel_send_sms_msg_01 pass\n"); + else + printf("utc_tel_send_sms_msg_01 fail\n"); + + printf("\n"); + return; +} + +void utc_tel_send_sms_msg_02() +{ + TapiResult_t returnStatus = TAPI_API_SUCCESS; + TS_BOOL bMoreMsgToSend = FALSE; + int pRequestId = -1; + + returnStatus = tel_send_sms_msg(NULL, bMoreMsgToSend, &pRequestId); + printf("The return value is %d\n", returnStatus); + printf("The pRequestId value is %d\n", pRequestId); + + TET_CHECK(returnStatus == TAPI_API_INVALID_PTR); + if (returnStatus == TAPI_API_INVALID_PTR) + printf("utc_tel_send_sms_msg_02 pass\n"); + else + printf("utc_tel_send_sms_msg_02 fail\n"); + + printf("\n"); + return; +} + +/** + * @brief This tests tel_send_sms_msg() API in abnormal conditions + * @par ID: + * UTC_TEL_SEND_SMS_03 + * @param [in] pDataPackage = valid + * @param [in] bMoreMsgToSend = FALSE + * @param [out] pRequestId = NULL + * @return TAPI_API_INVALID_PTR + */ +void utc_tel_send_sms_msg_03() +{ + TapiResult_t returnStatus = TAPI_API_SUCCESS; + TS_BOOL bMoreMsgToSend = FALSE; + + returnStatus = tel_send_sms_msg(pDataPackage, bMoreMsgToSend, NULL); + printf("The return value is %d\n", returnStatus); + + TET_CHECK(returnStatus == TAPI_API_INVALID_PTR); + if (returnStatus == TAPI_API_INVALID_PTR) + printf("utc_tel_send_sms_msg_03 pass\n"); + else + printf("utc_tel_send_sms_msg_03 fail\n"); + + printf("\n"); + return; +} + +/** + * @brief This tests tel_send_sms() API in normal conditions + * @par ID: + * UTC_TEL_SEND_SMS_04 + * @param [in] pDataPackage = valid + * @param [in] bMoreMsgToSend = TRUE + * @param [out] pRequestId + * @return TAPI_API_SUCCESS + */ +void utc_tel_send_sms_msg_04() +{ + TapiResult_t returnStatus = TAPI_API_SUCCESS; + TS_BOOL bMoreMsgToSend = TRUE; + int pRequestId = -1; + + PrepareCDMAMessage(); + returnStatus = tel_send_sms_msg(pDataPackage, bMoreMsgToSend, &pRequestId); + + gmain_loop_for_events(5000); + + printf("The return value is %d\n", returnStatus); + printf("The pRequestId value is %d\n", pRequestId); + + TET_CHECK(returnStatus == TAPI_API_SUCCESS); + if (returnStatus == TAPI_API_SUCCESS) + printf("utc_tel_send_sms_msg_04 pass\n"); + else + printf("utc_tel_send_sms_msg_04 fail\n"); + + printf("\n"); + return; +} +/** @} */ diff --git a/TC/telephony_TC/sms/unit/uts_tel_send_sms_msg.h b/TC/telephony_TC/sms/unit/uts_tel_send_sms_msg.h new file mode 100644 index 0000000..7952f7a --- /dev/null +++ b/TC/telephony_TC/sms/unit/uts_tel_send_sms_msg.h @@ -0,0 +1,149 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * 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 _UTS_TEL_SEND_SMS_MSG_H_ +#define _UTS_TEL_SEND_SMS_MSG_H_ + +static void utc_tel_send_sms_msg_01(); +static void utc_tel_send_sms_msg_02(); +static void utc_tel_send_sms_msg_03(); +static void utc_tel_send_sms_msg_04(); + +#define MAXLENGTH_SMS_ADDRESS 20 +#define MAXLENGTH_SMS_USER_DATA 160 +#define TELESERVICEID_CMT95 0x1002 +#define NUMBER_PLAN_TELEPHONY 0x01 +#define NUMBER_PLAN_UNKNOWN 0 +#define MESSAGETYPE_SUBMIT 2 + +/* Common TELESERVICE ID's */ +#define TELESERVICEID_CPT95 0x1001 /* 4097 : Paging */ +#define TELESERVICEID_CMT95 0x1002 /* 4098 : Text Message */ +#define TELESERVICEID_VMN95 0x1003 /* 4099 : Voice Mail Notification */ +#define TELESERVICEID_WAP 0x1004 /* WAP Message */ + +/* DIGIT MODE : CHARi[] filed°¡ 4bit dtmf codeÀÎÁö 8bit codeÀÎÁöžŠ ÀǹÌÇÑŽÙ. +*/ +#define DIGITMODE_4BITDTMF 0x00 +#define DIGITMODE_8BITCODE 0x01 + +/* NUMBER MODE +*/ +#define NUMMODE_NONE_DATANETWORK 0x00 /* in ANSI TI.607 */ +#define NUMMODE_DATANETWORK 0x01 + +/* MESSAGE_ENCODING +*/ +#define MSGENCODING_UNSPECIFIED 0x00 /* OCTET */ +#define MSGENCODING_IS91_EXTENDED_PROTOCOL 0x01 /* */ +#define MSGENCODING_7BIT_ASCII 0x02 /* */ +#define MSGENCODING_IA5 0x03 /* */ +#define MSGENCODING_UNICODE 0x04 /* */ +#define MSGENCODING_SHIFT_JIS 0x05 /* */ +#define MSGENCODING_KSC5601 0x06 /* Korean */ +#define MSGENCODING_HEBREW 0x07 /* ISO_8859_8 */ +#define MSGENCODING_LATIN 0x08 /* ISO_8859_1 */ +#define MSGENCODING_KSC5601_3PCS 0x10 /* Korean Standard */ + + +/* NUMBER TYPE +*/ +/* The following are used when number mode is not data network address. +*/ +#define NUMBER_TYPE_UNKNOWN 0x00 +#define NUMBER_TYPE_INTERNATIONAL 0x01 +#define NUMBER_TYPE_NATIONAL 0x02 +#define NUMBER_TYPE_NETWORK 0x03 +#define NUMBER_TYPE_SUBSCRIBER 0x04 +#define NUMBER_TYPE_RESERVED_5 0x05 +#define NUMBER_TYPE_ABREVIATED 0x06 +#define NUMBER_TYPE_RESERVED_7 0x07 + +//============================================================= +#define PARAMID_TELESERVICE_ID 0x01 /* Teleservice Identifier */ +#define PARAMID_SERVICE_CATEGORY 0x02 /* Broadcast Service Category */ +#define PARAMID_ADDRESS 0x03 /* Address */ +#define PARAMID_SUBADDRESS 0x04 /* Subaddress */ +#define PARAMID_BEARER_REPLY 0x05 /* Bearer Reply Option */ +#define PARAMID_CAUSE_CODES 0x06 /* Cause Codes */ +#define PARAMID_MESSAGE_ID 0x07 /* Message Identifier */ +#define PARAMID_USER_DATA 0x08 /* User Data */ +#define PARAMID_USER_RESPONSE_CODE 0x09 /* User Response Code */ +#define PARAMID_MC_TIME_STAMP 0x0A /* Message Center Time Stamp */ +#define PARAMID_VALIDITY_PERIOD_ABS 0x0B /* Validity Period - Absolute */ +#define PARAMID_VALIDITY_PERIOD_REL 0x0C /* Validiry Period - Relative */ +#define PARAMID_DEFERRED_DELIVERY_ABS 0x0D /* Deferred Delivery Time - Absolute */ +#define PARAMID_DEFERRED_DELIVERY_REL 0x0E /* Deferred Delivery Time - Relative */ +#define PARAMID_PRIORITY 0x0F /* Priority Indicator */ +#define PARAMID_PRIVACY 0x10 /* Privacy Indicator */ +#define PARAMID_REPLY_OPTION 0x11 /* Reply Option */ +#define PARAMID_NUMBER_OF_MESSAGE 0x12 /* Number of Messages : Voice Mail Count */ +#define PARAMID_ALERT_ON_DELIVERY 0x13 /* Alert on Message Delivery */ +#define PARAMID_LANGUAGE 0x14 /* Langauge Indicator */ +#define PARAMID_CALLBACK 0x15 /* Call Back Number */ +#define PARAMID_DISPLAY_MODE 0x16 /* Display Mode */ +#define PARAMID_MULTI_ENCODING_USER_DATA 0x17 /* Multiply Encoding User Data */ +#define PARAMID_MEMORY_INDEX 0x18 /* Memory address stored in Phone Memory */ +#define PARAMID_BEARER_DATA 0x19 /* Bearer data - raw data */ + +typedef struct { + TS_UINT8 param_id; + TS_UINT8 param_len; + TS_UINT16 teleserv_id; +} ParamTeleserv_t; + +typedef struct { + TS_UINT8 param_id; + TS_UINT8 param_len; + TS_UINT8 digit; + TS_UINT8 num; + TS_UINT8 numtype; + TS_UINT8 numplan; + TS_UINT8 len; + TS_UINT8 CHARi[MAXLENGTH_SMS_ADDRESS]; +} ParamAddress_t; + +typedef struct { + TS_UINT8 param_id; + TS_UINT8 param_len; + TS_UINT8 type; + TS_UINT16 msg_id; +} ParamMsgId_t; + +typedef struct { + TS_UINT8 param_id; + TS_UINT8 param_len; + TS_UINT8 encoding; + TS_UINT8 len; + TS_UINT8 CHARi[MAXLENGTH_SMS_USER_DATA]; +} ParamUserData_t; + +typedef struct { + TS_UINT8 param_id; + TS_UINT8 param_len; + TS_UINT8 digit; + TS_UINT8 numtype; + TS_UINT8 numplan; + TS_UINT8 len; + TS_UINT8 CHARi[MAXLENGTH_SMS_ADDRESS]; +} ParamCallback_t; + + +#endif diff --git a/TC/telephony_TC/sms/unit/uts_tel_set_sms_cb_config.c b/TC/telephony_TC/sms/unit/uts_tel_set_sms_cb_config.c new file mode 100644 index 0000000..276094b --- /dev/null +++ b/TC/telephony_TC/sms/unit/uts_tel_set_sms_cb_config.c @@ -0,0 +1,287 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * 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 + +#include +#include + +#include +#include +#include +#include + +#include +#include "tet_macro.h" + +#include +#include + +#include "sms_callback_util.h" +#include "uts_tel_set_sms_cb_config.h" + +/* Initialize TCM data structures */ + +TelSmsCbConfig_t *pCBConfig; +unsigned int subscription_id; + +static void startup(); +static void cleanup(); +void (*tet_startup) () = startup; +void (*tet_cleanup) () = cleanup; +struct tet_testlist tet_testlist[] = { + {utc_tel_set_sms_cb_config_01, 1}, + {utc_tel_set_sms_cb_config_02, 2}, + {utc_tel_set_sms_cb_config_03, 3}, + {utc_tel_set_sms_cb_config_04, 4}, + {utc_tel_set_sms_cb_config_05, 5}, + {NULL, 0} +}; + + +static TapiResult_t gStartupSuccess; + +void alarm_received(int sgi) +{ + gAsyncResult = FALSE; + printf("Signal [SIGALARM] Received. Close g_main_loop()"); + G_MAIN_LOOP_CLOSE(); +} + +/* Startup & Clean function : It is not test code, only for + initialize and finalize test module */ + +static void startup() +{ + tapi_dbus_connection_name dname; + int bStatus; + + pCBConfig = (TelSmsCbConfig_t *) malloc(sizeof(TelSmsCbConfig_t)); + + gStartupSuccess = tel_init(); + if (gStartupSuccess != TAPI_API_SUCCESS) { + printf("tel_init() Failed gStartupSuccess = %d \n", gStartupSuccess); + } + gStartupSuccess = tel_register_event(TAPI_EVENT_NETTEXT_SET_REQUEST_CNF, &subscription_id, tapi_sms_callback, NULL); + + if (gStartupSuccess != TAPI_API_SUCCESS) { + printf("TapiCommonRegisterEvent Failed gStartupSuccess = %d \n", gStartupSuccess); + } + else { + tel_register_app_name("org.samsung.test"); + if (tel_get_app_name(&dname)) + printf("Dbus Get app name error\n"); + else + printf("Dbus Name is %s\n", dname.name); + + tel_check_service_ready(&bStatus); + printf("Telephony service %d\n", bStatus); + + printf("after TapiCommonRegisterEvent subscription_id is %d gStartupSuccess is %d\n", subscription_id, gStartupSuccess); + } +} + +static void cleanup() +{ + free(pCBConfig); + if (gStartupSuccess == TAPI_API_SUCCESS) + tel_deregister_event(subscription_id); + tel_deinit(); + return; +} + + +/** + * @brief This tests tel_set_sms_cb_config() API in normal conditions + * @par ID: + * UTC_TEL_SMS_CB_SET_CONFIG_01 + * @param [in] pCBConfig + * @code + pCBConfig->bCBEnabled = TRUE; + pCBConfig->SelectedId = 0x01; + pCBConfig->MsgIdCount = 0x04; + pCBConfig->MsgIDs[0] = 0x03; + pCBConfig->MsgIDs[1] = 0x0c; + pCBConfig->MsgIDs[2] = 0x0d; + pCBConfig->MsgIDs[3] = 0x0f; + * @endcode + * @param [out] pRequestId + * @return TAPI_API_SUCCESS + */ +void utc_tel_set_sms_cb_config_01() +{ + TapiResult_t returnStatus = TAPI_API_SUCCESS; + + int pRequestId; + pCBConfig->bCBEnabled = TRUE; + pCBConfig->SelectedId = 0x01; + pCBConfig->MsgIdCount = 0x04; + + pCBConfig->MsgIDs[0] = 0x03; + pCBConfig->MsgIDs[1] = 0x0c; + pCBConfig->MsgIDs[2] = 0x0d; + pCBConfig->MsgIDs[3] = 0x0f; + + /* Calling TAPI SMS SET CB CONFIG API */ + returnStatus = tel_set_sms_cb_config(pCBConfig, &pRequestId); + gmain_loop_for_events(5000); + + printf("The return value is %d\n", returnStatus); + printf("The pRequestId value is %d\n", pRequestId); + + TET_CHECK(returnStatus == TAPI_API_SUCCESS); + if (returnStatus == TAPI_API_SUCCESS) + printf("utc_tel_set_sms_cb_config_01 pass\n"); + return; +} + +/** + * @brief This tests tel_set_sms_cb_config() API in normal conditions + * @par ID: + * UTC_TEL_SMS_CB_SET_CONFIG_02 + * @param [in] pCBConfig + * @code + pCBConfig->bCBEnabled = TRUE; + pCBConfig->SelectedId = 0x02; + pCBConfig->MsgIdCount = 0x04; + pCBConfig->MsgIDs[0] = 0x0c; + pCBConfig->MsgIDs[1] = 0x0d; + pCBConfig->MsgIDs[2] = 0x0f; + pCBConfig->MsgIDs[3] = 0x00; + * @endcode + * @param [out] pRequestId = NULL + * @return TAPI_API_SUCCESS + */ +void utc_tel_set_sms_cb_config_02() +{ + TapiResult_t returnStatus = TAPI_API_SUCCESS; + pCBConfig->bCBEnabled = TRUE; + pCBConfig->SelectedId = 0x02; + pCBConfig->MsgIdCount = 0x04; + + pCBConfig->MsgIDs[0] = 0x0c; + pCBConfig->MsgIDs[1] = 0x0d; + pCBConfig->MsgIDs[2] = 0x0f; + pCBConfig->MsgIDs[3] = 0x00; + + /* Calling TAPI SMS SET CB CONFIG API */ + returnStatus = tel_set_sms_cb_config(pCBConfig, NULL); + gmain_loop_for_events(5000); + + printf("The return value is %d\n", returnStatus); + TET_CHECK(returnStatus == TAPI_API_INVALID_PTR); + if (returnStatus == TAPI_API_INVALID_PTR) + printf("utc_tel_set_sms_cb_config_02 pass\n"); + return; +} + +/** + * @brief This tests tel_set_sms_cb_config() API in abnormal conditions + * @par ID: + * UTC_TEL_SMS_CB_SET_CONFIG_03 + * @param [in] pCBConfig = NULL + * @param [out] pRequestId + * @return TAPI_API_INVALID_PTR + */ +void utc_tel_set_sms_cb_config_03() +{ + TapiResult_t returnStatus = TAPI_API_SUCCESS; + + int pRequestId; + + /* Calling TAPI SMS SET CB CONFIG API */ + returnStatus = tel_set_sms_cb_config(NULL, &pRequestId); + + printf("The return value is %d\n", returnStatus); + printf("The pRequestId value is %d\n", pRequestId); + + TET_CHECK(returnStatus == TAPI_API_INVALID_PTR); + if (returnStatus == TAPI_API_INVALID_PTR) + printf("utc_tel_set_sms_cb_config_03 pass\n"); + return; +} + +/** + * @brief This tests tel_set_sms_cb_config() API in abnormal conditions + * @par ID: + * UTC_TEL_SMS_CB_SET_CONFIG_04 + * @param [in] pCBConfig = NULL + * @param [out] pRequestId = NULL + * @return TAPI_API_INVALID_PTR + */ +void utc_tel_set_sms_cb_config_04() +{ + TapiResult_t returnStatus = TAPI_API_SUCCESS; + + /* Calling TAPI SMS SET CB CONFIG API */ + returnStatus = tel_set_sms_cb_config(NULL, NULL); + + printf("The return value is %d\n", returnStatus); + + TET_CHECK(returnStatus == TAPI_API_INVALID_PTR); + if (returnStatus == TAPI_API_INVALID_PTR) + printf("utc_tel_set_sms_cb_config_04 pass\n"); + return; +} + +/** + * @brief This tests tel_set_sms_cb_config() API in abnormal conditions + * @par ID: + * UTC_TEL_SMS_CB_SET_CONFIG_05 + * @param [in] pCBConfig + * @code + pCBConfig->bCBEnabled = TRUE; + pCBConfig->SelectedId = -1; + pCBConfig->MsgIdCount = -1; + + * @endcode + * @param [out] pRequestId + * @return TAPI_API_INVALID_INPUT + */ +void utc_tel_set_sms_cb_config_05() +{ + TapiResult_t returnStatus = TAPI_API_SUCCESS; + int pRequestId; + + pCBConfig->bCBEnabled = TRUE; + pCBConfig->SelectedId = -1; + pCBConfig->MsgIdCount = -1; + + pCBConfig->MsgIDs[0] = 0x0c; + pCBConfig->MsgIDs[1] = 0x00; + pCBConfig->MsgIDs[2] = 0x0d; + pCBConfig->MsgIDs[3] = 0x0f; + + /* Calling TAPI SMS SET CB CONFIG API */ + returnStatus = tel_set_sms_cb_config(pCBConfig, &pRequestId); + + printf("The return value is %d\n", returnStatus); + printf("The pRequestId value is %d\n", pRequestId); + + TET_CHECK(returnStatus == TAPI_API_INVALID_INPUT); + if (returnStatus == TAPI_API_INVALID_INPUT) + printf("utc_tel_set_sms_cb_config_05 pass\n"); + return; +} +/** @} */ diff --git a/TC/telephony_TC/sms/unit/uts_tel_set_sms_cb_config.h b/TC/telephony_TC/sms/unit/uts_tel_set_sms_cb_config.h new file mode 100644 index 0000000..30e47db --- /dev/null +++ b/TC/telephony_TC/sms/unit/uts_tel_set_sms_cb_config.h @@ -0,0 +1,36 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * 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 _UTS_TEL_SET_SMS_CB_CONFIG_H_ +#define _UTS_TEL_SET_SMS_CB_CONFIG_H_ + +static void utc_tel_set_sms_cb_config_01(); + +static void utc_tel_set_sms_cb_config_02(); + +static void utc_tel_set_sms_cb_config_03(); + +static void utc_tel_set_sms_cb_config_04(); + +static void utc_tel_set_sms_cb_config_05(); + +#endif + diff --git a/TC/telephony_TC/sms/unit/uts_tel_set_sms_memory_status.c b/TC/telephony_TC/sms/unit/uts_tel_set_sms_memory_status.c new file mode 100644 index 0000000..34e466e --- /dev/null +++ b/TC/telephony_TC/sms/unit/uts_tel_set_sms_memory_status.c @@ -0,0 +1,240 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * 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 + +#include +#include + +#include +#include +#include +#include + +#include +#include "tet_macro.h" + +#include +#include + +#include "sms_callback_util.h" +#include "uts_tel_set_sms_memory_status.h" + + +/* Initialize TCM data structures */ +static void startup(); +static void cleanup(); +void (*tet_startup) () = startup; +void (*tet_cleanup) () = cleanup; +struct tet_testlist tet_testlist[] = { + {utc_tel_set_sms_memory_status_01, 1}, + {utc_tel_set_sms_memory_status_02, 2}, + {utc_tel_set_sms_memory_status_03, 3}, + {utc_tel_set_sms_memory_status_04, 4}, + {utc_tel_set_sms_memory_status_05, 5}, + {NULL, 0} +}; + +static TapiResult_t gStartupSuccess; +unsigned int subscription_id; + +void alarm_received(int sgi) +{ + gAsyncResult = FALSE; + printf("Signal [SIGALARM] Received. Close g_main_loop()"); + G_MAIN_LOOP_CLOSE(); +} + +/* Startup & Clean function : It is not test code, only for + initialize and finalize test module */ + +static void startup() +{ + tapi_dbus_connection_name dname; + int bStatus; + + gStartupSuccess = tel_init(); + if (gStartupSuccess != TAPI_API_SUCCESS) { + printf("tel_init() Failed gStartupSuccess = %d \n", gStartupSuccess); + } + gStartupSuccess = tel_register_event(TAPI_EVENT_NETTEXT_SET_REQUEST_CNF, &subscription_id, tapi_sms_callback, NULL); + + if (gStartupSuccess != TAPI_API_SUCCESS) { + printf("TapiCommonRegisterEvent Failed gStartupSuccess = %d \n", gStartupSuccess); + } + else { + tel_register_app_name("org.samsung.test"); + if (tel_get_app_name(&dname)) + printf("Dbus Get app name error\n"); + else + printf("Dbus Name is %s\n", dname.name); + + tel_check_service_ready(&bStatus); + printf("Telephony service %d\n", bStatus); + + printf("after TapiCommonRegisterEvent subscription_id is %d gStartupSuccess is %d\n", subscription_id, gStartupSuccess); + } +} + +static void cleanup() +{ + if (gStartupSuccess == TAPI_API_SUCCESS) + tel_deregister_event(subscription_id); + // G_MAIN_CLOSE(); + tel_deinit(); + return; +} + +/** + * @brief This tests tel_set_sms_memory_status() API in normal conditions + * @par ID: + * UTC_TEL_SET_MEMORY_STATUS_01 + * @param [in] memory_status = TAPI_NETTEXT_MEMORY_STATUS_AVAILABLE + * @param [out] pRequestId + * @return TAPI_API_SUCCESS + */ +void utc_tel_set_sms_memory_status_01() +{ + TapiResult_t returnStatus = TAPI_API_SUCCESS; + int pRequestId = -1; + + /* CALLING TAPI SET MEMORY STATUS API */ + + returnStatus = tel_set_sms_memory_status(TAPI_NETTEXT_PDA_MEMORY_STATUS_AVAILABLE, &pRequestId); + gmain_loop_for_events(5000); + + printf("The return value is %d\n", returnStatus); + printf("The pRequestId value is %d\n", pRequestId); + + TET_CHECK(returnStatus == TAPI_API_SUCCESS); + if (returnStatus == TAPI_API_SUCCESS) + printf("utc_tel_set_sms_memory_status_01 pass\n"); + + return; +} + +/** + * @brief This tests tel_set_sms_memory_status() API in normal conditions + * @par ID: + * UTC_TEL_SET_MEMORY_STATUS_02 + * @param [in] memory_status = TAPI_NETTEXT_MEMORY_STATUS_FULL + * @param [out] pRequestId + * @return TAPI_API_SUCCESS + */ +void utc_tel_set_sms_memory_status_02() +{ + TapiResult_t returnStatus = TAPI_API_SUCCESS; + int pRequestId = -1; + + /* CALLING TAPI SET MEMORY STATUS API */ + + returnStatus = tel_set_sms_memory_status(TAPI_NETTEXT_PDA_MEMORY_STATUS_FULL, &pRequestId); + gmain_loop_for_events(5000); + + printf("The return value is %d\n", returnStatus); + printf("The pRequestId value is %d\n", pRequestId); + + TET_CHECK(returnStatus == TAPI_API_SUCCESS); + if (returnStatus == TAPI_API_SUCCESS) + printf("utc_tel_set_sms_memory_status_02 pass\n"); + + return; +} + +/** + * @brief This tests tel_set_sms_memory_status() API in abnormal conditions + * @par ID: + * UTC_TEL_SET_MEMORY_STATUS_03 + * @param [in] memory_status = TAPI_NETTEXT_MEMORY_STATUS_AVAILABLE - 1 + * @param [out] pRequestId + * @return TAPI_API_INVALID_INPUT + */ +void utc_tel_set_sms_memory_status_03() +{ + TapiResult_t returnStatus = TAPI_API_SUCCESS; + int pRequestId = -1; + + /* CALLING TAPI SET MEMORY STATUS API */ + + returnStatus = tel_set_sms_memory_status(TAPI_NETTEXT_PDA_MEMORY_STATUS_AVAILABLE - 1, &pRequestId); + + printf("The return value is %d\n", returnStatus); + printf("The pRequestId value is %d\n", pRequestId); + + TET_CHECK(returnStatus == TAPI_API_INVALID_INPUT); + if (returnStatus == TAPI_API_INVALID_INPUT) + printf("utc_tel_set_sms_memory_status_03 pass\n"); + + return; +} + +/** + * @brief This tests tel_set_sms_memory_status() API in abnormal conditions + * @par ID: + * UTC_TEL_SET_MEMORY_STATUS_04 + * @param [in] memory_status = TAPI_NETTEXT_MEMORY_STATUS_FULL + 1 + * @param [out] pRequestId + * @return TAPI_API_INVALID_INPUT + */ +void utc_tel_set_sms_memory_status_04() +{ + TapiResult_t returnStatus = TAPI_API_SUCCESS; + int pRequestId = -1; + returnStatus = tel_set_sms_memory_status(TAPI_NETTEXT_PDA_MEMORY_STATUS_FULL + 1, &pRequestId); + + printf("The return value is %d\n", returnStatus); + printf("The pRequestId value is %d\n", pRequestId); + + TET_CHECK(returnStatus == TAPI_API_INVALID_INPUT); + if (returnStatus == TAPI_API_INVALID_INPUT) + printf("utc_tel_set_sms_memory_status_04 pass\n"); + + return; +} + +/** + * @brief This tests tel_set_sms_memory_status() API in abnormal conditions + * @par ID: + * UTC_TEL_SET_MEMORY_STATUS_05 + * @param [in] memory_status = TAPI_NETTEXT_MEMORY_STATUS_FULL + * @param [out] pRequestId = NULL + * @return TAPI_API_INVALID_PTR + */ +void utc_tel_set_sms_memory_status_05() +{ + TapiResult_t returnStatus = TAPI_API_SUCCESS; + + returnStatus = tel_set_sms_memory_status(TAPI_NETTEXT_PDA_MEMORY_STATUS_FULL, NULL); + + printf("The return value is %d\n", returnStatus); + + TET_CHECK(returnStatus == TAPI_API_INVALID_PTR); + if (returnStatus == TAPI_API_INVALID_PTR) + printf("utc_tel_set_sms_memory_status_05 pass\n"); + + return; +} + +/** @} */ diff --git a/TC/telephony_TC/sms/unit/uts_tel_set_sms_memory_status.h b/TC/telephony_TC/sms/unit/uts_tel_set_sms_memory_status.h new file mode 100644 index 0000000..4b825cb --- /dev/null +++ b/TC/telephony_TC/sms/unit/uts_tel_set_sms_memory_status.h @@ -0,0 +1,34 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * 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 _UTS_TEL_SET_SMS_MEMORY_STATUS_H_ +#define _UTS_TEL_SET_SMS_MEMORY_STATUS_H_ + +static void utc_tel_set_sms_memory_status_01(); + +static void utc_tel_set_sms_memory_status_02(); + +static void utc_tel_set_sms_memory_status_03(); + +static void utc_tel_set_sms_memory_status_04(); + +static void utc_tel_set_sms_memory_status_05(); + +#endif diff --git a/TC/telephony_TC/sms/unit/uts_tel_set_sms_message_status.c b/TC/telephony_TC/sms/unit/uts_tel_set_sms_message_status.c new file mode 100644 index 0000000..02b3e02 --- /dev/null +++ b/TC/telephony_TC/sms/unit/uts_tel_set_sms_message_status.c @@ -0,0 +1,335 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * 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 + +#include +#include + +#include +#include +#include +#include + +#include +#include "tet_macro.h" + +#include +#include + +#include "sms_callback_util.h" +#include "uts_tel_set_sms_message_status.h" + +/* Initialize TCM data structures */ +static void startup(); +static void cleanup(); +void (*tet_startup) () = startup; +void (*tet_cleanup) () = cleanup; +struct tet_testlist tet_testlist[] = { + {utc_tel_set_sms_message_status_01, 1}, + {utc_tel_set_sms_message_status_02, 2}, + {utc_tel_set_sms_message_status_03, 3}, + {utc_tel_set_sms_message_status_04, 4}, + {utc_tel_set_sms_message_status_05, 5}, + {utc_tel_set_sms_message_status_06, 6}, + {utc_tel_set_sms_message_status_07, 7}, + {utc_tel_set_sms_message_status_08, 8}, + {NULL, 0} +}; + +static TapiResult_t gStartupSuccess; +unsigned int subscription_id; + +void alarm_received(int sgi) +{ + gAsyncResult = FALSE; + printf("Signal [SIGALARM] Received. Close g_main_loop()"); + G_MAIN_LOOP_CLOSE(); +} + +/* Startup & Clean function : It is not test code, only for + initialize and finalize test module */ + +static void startup() +{ + tapi_dbus_connection_name dname; + int bStatus; + + gStartupSuccess = tel_init(); + if (gStartupSuccess != TAPI_API_SUCCESS) { + printf("tel_init() Failed gStartupSuccess = %d \n", gStartupSuccess); + } + gStartupSuccess = tel_register_event(TAPI_EVENT_NETTEXT_SET_REQUEST_CNF, &subscription_id, tapi_sms_callback, NULL); + + if (gStartupSuccess != TAPI_API_SUCCESS) { + printf("TapiCommonRegisterEvent Failed gStartupSuccess = %d \n", gStartupSuccess); + } + else { + tel_register_app_name("org.samsung.test"); + if (tel_get_app_name(&dname)) + printf("Dbus Get app name error\n"); + else + printf("Dbus Name is %s\n", dname.name); + + tel_check_service_ready(&bStatus); + printf("Telephony service %d\n", bStatus); + + printf("after TapiCommonRegisterEvent subscription_id is %d gStartupSuccess is %d\n", subscription_id, gStartupSuccess); + } +} + +static void cleanup() +{ + if (gStartupSuccess == TAPI_API_SUCCESS) + tel_deregister_event(subscription_id); + tel_deinit(); + return; +} + +/** + * @brief This tests tel_set_sms_message_status() API in normal conditions + * @par ID: + * UTC_TEL_SET_MESSAGE_STATUS_01 + * @param [in] Index = 0 + * @param [in] msgStatus = TAPI_NETTEXT_STATUS_READ + * @param [out] pRequestId + * @return TAPI_API_SUCCESS + */ +void utc_tel_set_sms_message_status_01() +{ + TapiResult_t returnStatus = TAPI_API_SUCCESS; + int pRequestId = -1; + + /* CALLING TAPI SET MSG STATUS API */ + + returnStatus = tel_set_sms_message_status(0, TAPI_NETTEXT_STATUS_READ, &pRequestId); + gmain_loop_for_events(5000); + + printf("The return value is %d\n", returnStatus); + printf("The pRequestId value is %d\n", pRequestId); + + TET_CHECK(returnStatus == TAPI_API_SUCCESS); + if (returnStatus == TAPI_API_SUCCESS) + printf("utc_tel_set_sms_message_status_01 pass\n"); + + return; +} + +/** + * @brief This tests tel_set_sms_message_status() API in normal conditions + * @par ID: + * UTC_TEL_SET_MESSAGE_STATUS_02 + * @param [in] Index = 0 + * @param [in] msgStatus = TAPI_NETTEXT_STATUS_UNREAD + * @param [out] pRequestId + * @return TAPI_API_SUCCESS + */ +void utc_tel_set_sms_message_status_02() +{ + TapiResult_t returnStatus = TAPI_API_SUCCESS; + int pRequestId = -1; + + /* CALLING TAPI SET MSG STATUS API */ + + returnStatus = tel_set_sms_message_status(1, TAPI_NETTEXT_STATUS_UNREAD, &pRequestId); + gmain_loop_for_events(5000); + + printf("The return value is %d\n", returnStatus); + printf("The pRequestId value is %d\n", pRequestId); + + TET_CHECK(returnStatus == TAPI_API_SUCCESS); + if (returnStatus == TAPI_API_SUCCESS) + printf("utc_tel_set_sms_message_status_02 pass\n"); + + return; +} + +/** + * @brief This tests tel_set_sms_message_status() API in normal conditions + * @par ID: + * UTC_TEL_SET_MESSAGE_STATUS_03 + * @param [in] Index = 1 + * @param [in] msgStatus = TAPI_NETTEXT_STATUS_SENT + * @param [out] pRequestId + * @return TAPI_API_SUCCESS + */ +void utc_tel_set_sms_message_status_03() +{ + TapiResult_t returnStatus = TAPI_API_SUCCESS; + int pRequestId = -1; + + /* CALLING TAPI SET MSG STATUS API */ + + returnStatus = tel_set_sms_message_status(1, TAPI_NETTEXT_STATUS_SENT, &pRequestId); + gmain_loop_for_events(5000); + + printf("The return value is %d\n", returnStatus); + printf("The pRequestId value is %d\n", pRequestId); + + TET_CHECK(returnStatus == TAPI_API_SUCCESS); + if (returnStatus == TAPI_API_SUCCESS) + printf("utc_tel_set_sms_message_status_03 pass\n"); + + return; +} + +/** + * @brief This tests tel_set_sms_message_status() API in abnormal conditions + * @par ID: + * UTC_TEL_SET_MESSAGE_STATUS_04 + * @param [in] Index = -1 + * @param [in] msgStatus = TAPI_NETTEXT_STATUS_UNSENT + * @param [out] pRequestId + * @return TAPI_API_INVALID_INPUT + */ +void utc_tel_set_sms_message_status_04() +{ + TapiResult_t returnStatus = TAPI_API_SUCCESS; + int pRequestId = -1; + + /* CALLING TAPI SET MSG STATUS API */ + + returnStatus = tel_set_sms_message_status(-1, TAPI_NETTEXT_STATUS_UNSENT, &pRequestId); + + printf("The return value is %d\n", returnStatus); + printf("The pRequestId value is %d\n", pRequestId); + + TET_CHECK(returnStatus == TAPI_API_INVALID_INPUT); + if (returnStatus == TAPI_API_INVALID_INPUT) + printf("utc_tel_set_sms_message_status_04 pass\n"); + + return; +} + +/** + * @brief This tests tel_set_sms_message_status() API in abnormal conditions + * @par ID: + * UTC_TEL_SET_MESSAGE_STATUS_05 + * @param [in] Index = 256 + * @param [in] msgStatus = TAPI_NETTEXT_STATUS_RESERVED + * @param [out] pRequestId + * @return TAPI_API_INVALID_INPUT + */ +void utc_tel_set_sms_message_status_05() +{ + TapiResult_t returnStatus = TAPI_API_SUCCESS; + int pRequestId = -1; + + /* CALLING TAPI SET MSG STATUS API */ + + returnStatus = tel_set_sms_message_status(256, TAPI_NETTEXT_STATUS_RESERVED, &pRequestId); + + printf("The return value is %d\n", returnStatus); + printf("The pRequestId value is %d\n", pRequestId); + + TET_CHECK(returnStatus == TAPI_API_INVALID_INPUT); + if (returnStatus == TAPI_API_INVALID_INPUT) + printf("utc_tel_set_sms_message_status_05 pass\n"); + + return; +} + +/** + * @brief This tests tel_set_sms_message_status() API in abnormal conditions + * @par ID: + * UTC_TEL_SET_MESSAGE_STATUS_06 + * @param [in] Index = 1 + * @param [in] msgStatus = TAPI_NETTEXT_STATUS_RESERVED +1 + * @param [out] pRequestId + * @return TAPI_API_INVALID_INPUT + */ +void utc_tel_set_sms_message_status_06() +{ + TapiResult_t returnStatus = TAPI_API_SUCCESS; + int pRequestId = -1; + + /* CALLING TAPI SET MSG STATUS API */ + + returnStatus = tel_set_sms_message_status(1, TAPI_NETTEXT_STATUS_RESERVED + 1, &pRequestId); + + printf("The return value is %d\n", returnStatus); + printf("The pRequestId value is %d\n", pRequestId); + + TET_CHECK(returnStatus == TAPI_API_INVALID_INPUT); + if (returnStatus == TAPI_API_INVALID_INPUT) + printf("utc_tel_set_sms_message_status_06 pass\n"); + + return; +} + +/** + * @brief This tests tel_set_sms_message_status() API in abnormal conditions + * @par ID: + * UTC_TEL_SET_MESSAGE_STATUS_07 + * @param [in] Index = 1 + * @param [in] msgStatus = TAPI_NETTEXT_STATUS_READ - 1 + * @param [out] pRequestId + * @return TAPI_API_INVALID_INPUT + */ +void utc_tel_set_sms_message_status_07() +{ + TapiResult_t returnStatus = TAPI_API_SUCCESS; + int pRequestId = -1; + + /* CALLING TAPI SET MSG STATUS API */ + + returnStatus = tel_set_sms_message_status(1, TAPI_NETTEXT_STATUS_READ - 1, &pRequestId); + + printf("The return value is %d\n", returnStatus); + printf("The pRequestId value is %d\n", pRequestId); + + TET_CHECK(returnStatus == TAPI_API_INVALID_INPUT); + if (returnStatus == TAPI_API_INVALID_INPUT) + printf("utc_tel_set_sms_message_status_07 pass\n"); + + return; +} + +/** + * @brief This tests tel_set_sms_message_status() API in abnormal conditions + * @par ID: + * UTC_TEL_SET_MESSAGE_STATUS_08 + * @param [in] Index = 1 + * @param [in] msgStatus = TAPI_NETTEXT_STATUS_DELIVERED + * @param [out] pRequestId = NULL + * @return TAPI_API_INVALID_PTR + */ +void utc_tel_set_sms_message_status_08() +{ + TapiResult_t returnStatus = TAPI_API_SUCCESS; + + /* CALLING TAPI SET MSG STATUS API */ + + returnStatus = tel_set_sms_message_status(1, TAPI_NETTEXT_STATUS_DELIVERED, NULL); + + printf("The return value is %d\n", returnStatus); + + TET_CHECK(returnStatus == TAPI_API_INVALID_PTR); + if (returnStatus == TAPI_API_INVALID_PTR) + printf("utc_tel_set_sms_message_status_08 pass\n"); + + return; +} +/** @} */ diff --git a/TC/telephony_TC/sms/unit/uts_tel_set_sms_message_status.h b/TC/telephony_TC/sms/unit/uts_tel_set_sms_message_status.h new file mode 100644 index 0000000..58cd061 --- /dev/null +++ b/TC/telephony_TC/sms/unit/uts_tel_set_sms_message_status.h @@ -0,0 +1,41 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * 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 _UTS_TEL_SET_SMS_MESSAGE_STATUS_H_ +#define _UTS_TEL_SET_SMS_MESSAGE_STATUS_H_ + +static void utc_tel_set_sms_message_status_01(); + +static void utc_tel_set_sms_message_status_02(); + +static void utc_tel_set_sms_message_status_03(); + +static void utc_tel_set_sms_message_status_04(); + +static void utc_tel_set_sms_message_status_05(); + +static void utc_tel_set_sms_message_status_06(); + +static void utc_tel_set_sms_message_status_07(); + +static void utc_tel_set_sms_message_status_08(); + +#endif diff --git a/TC/telephony_TC/sms/unit/uts_tel_set_sms_parameters.c b/TC/telephony_TC/sms/unit/uts_tel_set_sms_parameters.c new file mode 100644 index 0000000..a446a4d --- /dev/null +++ b/TC/telephony_TC/sms/unit/uts_tel_set_sms_parameters.c @@ -0,0 +1,178 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * 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 + +#include +#include + +#include +#include +#include +#include + +#include +#include "tet_macro.h" + +#include +#include + +#include "sms_callback_util.h" +#include "uts_tel_set_sms_parameters.h" + +/* Initialize TCM data structures */ +static void startup(); +static void cleanup(); +void (*tet_startup) () = startup; +void (*tet_cleanup) () = cleanup; +struct tet_testlist tet_testlist[] = { + {tel_set_sms_parameters_01, 1}, + {tel_set_sms_parameters_02, 2}, + {NULL, 0} +}; + +static TapiResult_t gStartupSuccess; +unsigned int subscription_id; + +void alarm_received(int sgi) +{ + gAsyncResult = FALSE; + printf("Signal [SIGALARM] Received. Close g_main_loop()"); + G_MAIN_LOOP_CLOSE(); +} + +/* Startup & Clean function : It is not test code, only for + initialize and finalize test module */ + +static void startup() +{ + tapi_dbus_connection_name dname; + int bStatus; + + gStartupSuccess = tel_init(); + if (gStartupSuccess != TAPI_API_SUCCESS) { + printf("tel_init() Failed gStartupSuccess = %d \n", gStartupSuccess); + } + + gStartupSuccess = tel_register_event(TAPI_EVENT_NETTEXT_SET_REQUEST_CNF, &subscription_id, tapi_sms_callback, NULL); + + if (gStartupSuccess != TAPI_API_SUCCESS) { + printf("TapiCommonRegisterEvent Failed gStartupSuccess = %d \n", gStartupSuccess); + } + else { + tel_register_app_name("org.samsung.test"); + if (tel_get_app_name(&dname)) + printf("Dbus Get app name error\n"); + else + printf("Dbus Name is %s\n", dname.name); + + tel_check_service_ready(&bStatus); + printf("Telephony service %d\n", bStatus); + + printf("after TapiCommonRegisterEvent subscription_id is %d gStartupSuccess is %d\n", subscription_id, gStartupSuccess); + } +} + +static void cleanup() +{ + if (gStartupSuccess == TAPI_API_SUCCESS) + tel_deregister_event(subscription_id); + tel_deinit(); + return; +} + + +/** + * @brief This tests tel_set_sms_parameters() API in normal conditions + * @par ID: + * UTC_SET_SMS_PARAMS_01 + * @param [in] smsParameters + * @code + smsParameters.RecordIndex = 0; + smsParameters.RecordLen = 28; + smsParameters.AlphaIdLen = 10; + smsParameters.ParamIndicator = TAPI_SIM_SMSP_TP_DEST_ADDR_PRESENT; + strcpy(smsParameters.TpDestAddr.szDiallingNum,DESTINATION_NUMBER); + smsParameters.TpDestAddr.DialNumLen=strlen(smsParameters.TpDestAddr.szDiallingNum); + smsParameters.TpDestAddr.Ton=TAPI_SIM_TON_NATIONAL; + smsParameters.TpDestAddr.Npi=TAPI_SIM_NPI_NATIONAL; + * @endcode + * @param [out] pRequestId + * @return TAPI_API_SUCCESS + */ +void tel_set_sms_parameters_01() +{ + TapiResult_t returnStatus = TAPI_API_SUCCESS; + int pRequestId; + TelSmsParams_t smsParameters; + + printf("****Setting SMS Parameters****\n"); + + smsParameters.RecordIndex = 0; + smsParameters.RecordLen = 28; + smsParameters.AlphaIdLen = 10; + returnStatus = tel_set_sms_parameters(&smsParameters, &pRequestId); + gmain_loop_for_events(5000); + printf("The return value is %d\n", returnStatus); + printf("The pRequestId value is %d\n", pRequestId); + + TET_CHECK(returnStatus == TAPI_API_SUCCESS); + + if (returnStatus == TAPI_API_SUCCESS) + printf("tel_set_sms_parameters_01 pass\n"); + + return; +} + +/** + * @brief This tests tel_set_sms_parameters() API in abnormal conditions + * @par ID: + * UTC_SET_SMS_PARAMS_02 + * @param [in] smsParameters + * @param [out] pRequestId = NULL + * @return TAPI_API_INVALID_PTR + */ + +void tel_set_sms_parameters_02() +{ + TapiResult_t returnStatus = TAPI_API_SUCCESS; + TelSmsParams_t smsParameters = { 0, }; + + printf("****Setting SMS Parameters****\n"); + + smsParameters.RecordIndex = 1; + smsParameters.RecordLen = 28; + returnStatus = tel_set_sms_parameters(&smsParameters, NULL); + + printf("The return value is %d\n", returnStatus); + + TET_CHECK(returnStatus == TAPI_API_INVALID_PTR); + + if (returnStatus == TAPI_API_INVALID_PTR) + printf("tel_set_sms_parameters_03 pass\n"); + + return; +} +/** @} */ diff --git a/TC/telephony_TC/sms/unit/uts_tel_set_sms_parameters.h b/TC/telephony_TC/sms/unit/uts_tel_set_sms_parameters.h new file mode 100644 index 0000000..41e4edc --- /dev/null +++ b/TC/telephony_TC/sms/unit/uts_tel_set_sms_parameters.h @@ -0,0 +1,28 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * 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 _UTS_SET_SMS_PARAMETERS_H_ +#define _UTS_SET_SMS_PARAMETERS_H_ + +static void tel_set_sms_parameters_01(); +static void tel_set_sms_parameters_02(); + + +#endif diff --git a/TC/telephony_TC/sms/unit/uts_tel_set_sms_preferred_bearer.c b/TC/telephony_TC/sms/unit/uts_tel_set_sms_preferred_bearer.c new file mode 100644 index 0000000..268c8c2 --- /dev/null +++ b/TC/telephony_TC/sms/unit/uts_tel_set_sms_preferred_bearer.c @@ -0,0 +1,291 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * 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 + +#include +#include + +#include +#include +#include +#include + +#include +#include "tet_macro.h" + +#include +#include + +#include "sms_callback_util.h" +#include "uts_tel_set_sms_preferred_bearer.h" + + +/* Initialize TCM data structures */ +static void startup(); +static void cleanup(); +void (*tet_startup) () = startup; +void (*tet_cleanup) () = cleanup; +struct tet_testlist tet_testlist[] = { + {utc_tel_set_sms_preferred_bearer_01, 1}, + {utc_tel_set_sms_preferred_bearer_02, 2}, + {utc_tel_set_sms_preferred_bearer_03, 3}, + {utc_tel_set_sms_preferred_bearer_04, 4}, + {utc_tel_set_sms_preferred_bearer_05, 5}, + {utc_tel_set_sms_preferred_bearer_06, 6}, + {NULL, 0} +}; + +static TapiResult_t gStartupSuccess; +unsigned int subscription_id; + +void alarm_received(int sgi) +{ + gAsyncResult = FALSE; + printf("Signal [SIGALARM] Received. Close g_main_loop()"); + G_MAIN_LOOP_CLOSE(); +} + +/* Startup & Clean function : It is not test code, only for + initialize and finalize test module */ + +static void startup() +{ + tapi_dbus_connection_name dname; + int bStatus; + + gStartupSuccess = tel_init(); + if (gStartupSuccess != TAPI_API_SUCCESS) { + printf("tel_init() Failed gStartupSuccess = %d \n", gStartupSuccess); + } + gStartupSuccess = tel_register_event(TAPI_EVENT_NETTEXT_SET_REQUEST_CNF, &subscription_id, tapi_sms_callback, NULL); + + if (gStartupSuccess != TAPI_API_SUCCESS) { + printf("TapiCommonRegisterEvent Failed gStartupSuccess = %d \n", gStartupSuccess); + } + else { + tel_register_app_name("org.samsung.test"); + if (tel_get_app_name(&dname)) + printf("Dbus Get app name error\n"); + else + printf("Dbus Name is %s\n", dname.name); + + tel_check_service_ready(&bStatus); + printf("Telephony service %d\n", bStatus); + + printf("after TapiCommonRegisterEvent subscription_id is %d gStartupSuccess is %d\n", subscription_id, gStartupSuccess); + } +} + +static void cleanup() +{ + if (gStartupSuccess == TAPI_API_SUCCESS) + tel_deregister_event(subscription_id); + //G_MAIN_CLOSE(); + tel_deinit(); + return; +} + +/** + * @brief This tests tel_set_sms_preferred_bearer() API in normal conditions + * @par ID: + * UTC_TEL_SET_PREFERRED_BEARER_01() + * @param [in] BearerType = TAPI_NETTEXT_BEARER_PS_PREFERRED + * @param [out] pRequestId + * @return TAPI_API_SUCCESS + */ +void utc_tel_set_sms_preferred_bearer_01() +{ + TapiResult_t returnStatus = TAPI_API_SUCCESS; + + int pRequestId = -1; + printf("SET PREFERRED BEARER TO PS MODE.\n"); + + returnStatus = tel_set_sms_preferred_bearer(TAPI_NETTEXT_BEARER_PS_PREFERRED, &pRequestId); + + gmain_loop_for_events(5000); + + printf("The return value is %d\n", returnStatus); + printf("The pRequestId value is %d\n", pRequestId); + + TET_CHECK(returnStatus == TAPI_API_SUCCESS); + if (returnStatus == TAPI_API_SUCCESS) + printf("utc_tel_set_sms_preferred_bearer pass\n"); + else + printf("utc_tel_set_sms_preferred_bearer fail\n"); + + printf("\n"); + return; +} + +/** + * @brief This tests tel_set_sms_preferred_bearer() API in normal conditions + * @par ID: + * UTC_TEL_SET_PREFERRED_BEARER_02() + * @param [in] BearerType = TAPI_NETTEXT_BEARER_CS_PREFERRED + * @param [out] pRequestId + * @return TAPI_API_SUCCESS + */ +void utc_tel_set_sms_preferred_bearer_02() +{ + TapiResult_t returnStatus = TAPI_API_SUCCESS; + + int pRequestId = -1; + printf("SET PREFERRED BEARER TO CS MODE.\n"); + + returnStatus = tel_set_sms_preferred_bearer(TAPI_NETTEXT_BEARER_CS_PREFERRED, &pRequestId); + + gmain_loop_for_events(5000); + + printf("The return value is %d\n", returnStatus); + printf("The pRequestId value is %d\n", pRequestId); + + TET_CHECK(returnStatus == TAPI_API_SUCCESS); + if (returnStatus == TAPI_API_SUCCESS) + printf("utc_tel_set_sms_preferred_bearer_02 pass\n"); + else + printf("utc_tel_set_sms_preferred_bearer_02 fail\n"); + + printf("\n"); + return; +} + +/** + * @brief This tests tel_set_sms_preferred_bearer() API in normal conditions + * @par ID: + * UTC_TEL_SET_PREFERRED_BEARER_03() + * @param [in] BearerType = TAPI_NETTEXT_NO_PREFERRED_BEARER + * @param [out] pRequestId + * @return TAPI_API_SUCCESS + */ +void utc_tel_set_sms_preferred_bearer_03() +{ + TapiResult_t returnStatus = TAPI_API_SUCCESS; + + int pRequestId = -1; + printf("SET PREFERRED BEARER to No Preferred Mode.\n"); + + returnStatus = tel_set_sms_preferred_bearer(TAPI_NETTEXT_NO_PREFERRED_BEARER, &pRequestId); + + gmain_loop_for_events(5000); + + printf("The return value is %d\n", returnStatus); + printf("The pRequestId value is %d\n", pRequestId); + + TET_CHECK(returnStatus == TAPI_API_SUCCESS); + if (returnStatus == TAPI_API_SUCCESS) + printf("utc_tel_set_sms_preferred_bearer_03 pass\n"); + else + printf("utc_tel_set_sms_preferred_bearer_03 fail\n"); + + printf("\n"); + return; +} + +/** + * @brief This tests tel_set_sms_preferred_bearer() API in abnormal conditions + * @par ID: + * UTC_TEL_SET_PREFERRED_BEARER_04() + * @param [in] BearerType = TAPI_NETTEXT_NO_PREFERRED_BEARER + 1 + * @param [out] pRequestId + * @return TAPI_API_INVALID_INPUT + */ +void utc_tel_set_sms_preferred_bearer_04() +{ + TapiResult_t returnStatus = TAPI_API_SUCCESS; + + int pRequestId = -1; + printf("SET PREFERRED BEARER TO INVALID MODE.\n"); + + returnStatus = tel_set_sms_preferred_bearer(TAPI_NETTEXT_NO_PREFERRED_BEARER + 1, &pRequestId); + + printf("The return value is %d\n", returnStatus); + printf("The pRequestId value is %d\n", pRequestId); + + TET_CHECK(returnStatus == TAPI_API_INVALID_INPUT); + if (returnStatus == TAPI_API_INVALID_INPUT) + printf("utc_tel_set_sms_preferred_bearer_04 pass\n"); + else + printf("utc_tel_set_sms_preferred_bearer_04 fail\n"); + + printf("\n"); + return; +} + +/** + * @brief This tests tel_set_sms_preferred_bearer() API in abnormal conditions + * @par ID: + * UTC_TEL_SET_PREFERRED_BEARER_05() + * @param [in] BearerType = TAPI_NETTEXT_BEARER_PS_ONLY - 1 + * @param [out] pRequestId + * @return TAPI_API_INVALID_INPUT + */ +void utc_tel_set_sms_preferred_bearer_05() +{ + TapiResult_t returnStatus = TAPI_API_SUCCESS; + + int pRequestId = -1; + printf("SET PREFERRED BEARER TO INVALID MODE.\n"); + + returnStatus = tel_set_sms_preferred_bearer(TAPI_NETTEXT_BEARER_PS_ONLY - 1, &pRequestId); + + printf("The return value is %d\n", returnStatus); + printf("The pRequestId value is %d\n", pRequestId); + + TET_CHECK(returnStatus == TAPI_API_INVALID_INPUT); + if (returnStatus == TAPI_API_INVALID_INPUT) + printf("utc_tel_set_sms_preferred_bearer_05 pass\n"); + else + printf("utc_tel_set_sms_preferred_bearer_05 fail\n"); + + printf("\n"); + return; +} + +/** + * @brief This tests tel_set_sms_preferred_bearer() API in abnormal conditions + * @par ID: + * UTC_TEL_SET_PREFERRED_BEARER_05() + * @param [in] BearerType = TAPI_NETTEXT_BEARER_PS_PREFERRED + * @param [out] pRequestId = NULL + * @return TAPI_API_INVALID_PTR + */ +void utc_tel_set_sms_preferred_bearer_06() +{ + TapiResult_t returnStatus = TAPI_API_SUCCESS; + + returnStatus = tel_set_sms_preferred_bearer(TAPI_NETTEXT_BEARER_PS_PREFERRED, NULL); + + printf("The return value is %d\n", returnStatus); + + TET_CHECK(returnStatus == TAPI_API_INVALID_PTR); + if (returnStatus == TAPI_API_INVALID_PTR) + printf("utc_tel_set_sms_preferred_bearer_06 pass\n"); + else + printf("utc_tel_set_sms_preferred_bearer_06 fail\n"); + + printf("\n"); + return; +} +/** @} */ diff --git a/TC/telephony_TC/sms/unit/uts_tel_set_sms_preferred_bearer.h b/TC/telephony_TC/sms/unit/uts_tel_set_sms_preferred_bearer.h new file mode 100644 index 0000000..631b78e --- /dev/null +++ b/TC/telephony_TC/sms/unit/uts_tel_set_sms_preferred_bearer.h @@ -0,0 +1,36 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * 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 _UTS_TEL_SET_SMS_PREFERRED_BEARER_H_ +#define _UTS_TEL_SET_SMS_PREFERRED_BEARER_H_ + +static void utc_tel_set_sms_preferred_bearer_01(); + +static void utc_tel_set_sms_preferred_bearer_02(); + +static void utc_tel_set_sms_preferred_bearer_03(); + +static void utc_tel_set_sms_preferred_bearer_04(); + +static void utc_tel_set_sms_preferred_bearer_05(); + +static void utc_tel_set_sms_preferred_bearer_06(); + +#endif diff --git a/TC/telephony_TC/sms/unit/uts_tel_set_sms_sca.c b/TC/telephony_TC/sms/unit/uts_tel_set_sms_sca.c new file mode 100644 index 0000000..02d5b8c --- /dev/null +++ b/TC/telephony_TC/sms/unit/uts_tel_set_sms_sca.c @@ -0,0 +1,408 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * 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 "string.h" +#include + +#include +#include + +#include +#include +#include +#include + +#include +#include + +#include +#include "tet_macro.h" + +#include "sms_callback_util.h" +#include "uts_tel_set_sms_sca.h" +#include "sms_common.h" + + +/* Initialize TCM data structures */ +static void startup(); +static void cleanup(); +void (*tet_startup) () = startup; +void (*tet_cleanup) () = cleanup; +struct tet_testlist tet_testlist[] = { + {utc_tel_set_sms_sca_01, 1}, + {utc_tel_set_sms_sca_02, 2}, + {utc_tel_set_sms_sca_03, 3}, + {utc_tel_set_sms_sca_04, 4}, + {utc_tel_set_sms_sca_05, 5}, + {utc_tel_set_sms_sca_06, 6}, + {NULL, 0} +}; + +TelSmsAddressInfo_t *pSCA; +static TapiResult_t gStartupSuccess; +unsigned int subscription_id; + +void alarm_received(int sgi) +{ + gAsyncResult = FALSE; + printf("Signal [SIGALARM] Received. Close g_main_loop()"); + G_MAIN_LOOP_CLOSE(); +} + +/* Startup & Clean function : It is not test code, only for + initialize and finalize test module */ + +static void startup() +{ + tapi_dbus_connection_name dname; + int bStatus; + + pSCA = (TelSmsAddressInfo_t*) malloc(sizeof(TelSmsAddressInfo_t)); + memset(pSCA, 0, sizeof(pSCA)); + + gStartupSuccess = tel_init(); + if (gStartupSuccess != TAPI_API_SUCCESS) { + printf("tel_init() Failed gStartupSuccess = %d \n", gStartupSuccess); + } + + gStartupSuccess = tel_register_event(TAPI_EVENT_NETTEXT_SET_REQUEST_CNF, &subscription_id, tapi_sms_callback, NULL); + + if (gStartupSuccess != TAPI_API_SUCCESS) { + printf("TapiCommonRegisterEvent Failed gStartupSuccess = %d \n", gStartupSuccess); + } + else { + tel_register_app_name("org.samsung.test"); + if (tel_get_app_name(&dname)) + printf("Dbus Get app name error\n"); + else + printf("Dbus Name is %s\n", dname.name); + + tel_check_service_ready(&bStatus); + printf("Telephony service %d\n", bStatus); + + printf("TapiCommonRegisterEvent subscription_id is %d gStartupSuccess is %d\n", subscription_id, gStartupSuccess); + } +} + +static void cleanup() +{ + if (gStartupSuccess == TAPI_API_SUCCESS) + tel_deregister_event(subscription_id); + tel_deinit(); + return; +} + + +/** + * @brief This tests tel_set_sms_sca() API in normal conditions + * @par ID: + * UTC_TEL_SET_SERV_CENTER_ADDR_01 + * @param [in] pSCA + * @param [in] Index = 0 + * @code + sprintf (scaNum,"%d", VALID_SCA_NUM); + scaNum_len = strlen(scaNum); + scaNum[scaNum_len] = '\0'; + pSCA->DialNumLen = scaNum_len; + pSCA->Ton = SIM_TON_NATIONAL; + pSCA->Npi = TAPI_SIM_NPI_ISDN_TEL; + memcpy(pSCA->szDiallingNum,scaNum,scaNum_len); + * @endcode + * @param [out] pRequestId + * @return TAPI_API_SUCCESS + */ +void utc_tel_set_sms_sca_01() +{ + TapiResult_t returnStatus = TAPI_API_SUCCESS; + int pRequestId = -1; + char scaNum[TAPI_SIM_SMSP_ADDRESS_LEN + 1]; + int scaNum_len = 0; + int Index = 0; + int i = 0; + TS_BYTE packet[500]; + + sprintf(scaNum, "%s", VALID_SCA_NUM); + scaNum_len = strlen(scaNum); + scaNum[scaNum_len] = '\0'; + scaNum_len = scaNum_len - 1; + + printf("Sca Number :%s\n", scaNum); + printf("sca number length : %d \n", scaNum_len); + + Index = SmsUtilEncodeAddrField(packet, scaNum, scaNum_len, 0x01, 0x01); + + printf("Index =%d\n", Index); + + for (i = 0; i < Index; i++) + printf("[%02x]", packet[i]); + + pSCA->DialNumLen = Index; + + memcpy(pSCA->szDiallingNum, packet, Index); + + printf("\nSET VALID SERVICE CENTER ADDRESS\n"); + /* Calling TAPI SMS SET SCA API */ + returnStatus = tel_set_sms_sca(pSCA, 0, &pRequestId); + + gmain_loop_for_events(5000); + + printf("The return value is %d\n", returnStatus); + printf("The pRequestId value is %d\n", pRequestId); + + TET_CHECK(returnStatus == TAPI_API_SUCCESS); + if (returnStatus == TAPI_API_SUCCESS) + printf("utc_tel_set_sms_sca_01 pass\n"); + + return; +} + + +/** + * @brief This tests tel_set_sms_sca() API in abnormal conditions + * @par ID: + * UTC_TEL_SET_SERV_CENTER_ADDR_02 + * @param [in] pSCA + * @param [in] Index = 0 + * @code + sprintf (scaNum,"%d", INVALID_SCA_ADDR); + scaNum_len = strlen(scaNum); + scaNum[scaNum_len] = '\0'; + pSCA->DialNumLen = scaNum_len; + pSCA->Ton = SIM_TON_NATIONAL; + pSCA->Npi = TAPI_SIM_NPI_ISDN_TEL; + memcpy(pSCA->szDiallingNum,scaNum,scaNum_len); + * @endcode + * @param [out] pRequestId + * @return TAPI_API_INVALID_INPUT + */ +void utc_tel_set_sms_sca_02() +{ + TapiResult_t returnStatus = TAPI_API_SUCCESS; + int pRequestId = -1; + char scaNum[TAPI_NETTEXT_SCADDRESS_LEN_MAX]; + int scaNum_len = 0; + int Index = 0; + int i = 0; + TS_BYTE packet[500]; + + sprintf(scaNum, "%s", INVALID_SCA_ADDR); + scaNum_len = strlen(scaNum); + scaNum[scaNum_len] = '\0'; + scaNum_len = scaNum_len - 1; + + printf("Sca Number :%s\n", scaNum); + printf("sca number length : %d \n", scaNum_len); + + Index = SmsUtilEncodeAddrField(packet, scaNum, scaNum_len, 0x01, 0x01); + + printf("Index =%d\n", Index); + + for (i = 0; i < Index; i++) + printf("[%02x]", packet[i]); + + pSCA->DialNumLen = Index; + + memcpy(pSCA->szDiallingNum, packet, Index); + + printf("\nSET INVALID SERVICE CENTER ADDRESS\n"); + /* Calling TAPI SMS SET SCA API */ + returnStatus = tel_set_sms_sca(pSCA, Index, &pRequestId); + printf("The return value is %d\n", returnStatus); + printf("The pRequestId value is %d\n", pRequestId); + + if (Index != 0) { + TET_CHECK(returnStatus == TAPI_API_NOT_SUPPORTED); + if (returnStatus == TAPI_API_NOT_SUPPORTED) + printf("utc_tel_set_sms_sca_02 pass\n"); + } + else { + TET_CHECK(returnStatus == TAPI_API_SUCCESS); + if (returnStatus == TAPI_API_SUCCESS) + printf("utc_tel_set_sms_sca_02 pass\n"); + } + return; + +} + +/** + * @brief This tests tel_set_sms_sca() API in abnormal conditions + * @par ID: + * UTC_TEL_SET_SERV_CENTER_ADDR_03() + * @param [in] pSCA + * @param [in] Index = 0 + * @code + sprintf (scaNum,"%d", VALID_SCA_NUM); + scaNum_len = strlen(scaNum); + scaNum[scaNum_len] = '\0'; + pSCA->DialNumLen = -1; + pSCA->Ton = SIM_TON_NATIONAL; + pSCA->Npi = TAPI_SIM_NPI_ISDN_TEL; + memcpy(pSCA->szDiallingNum,scaNum,scaNum_len); + * @endcode + * @param [out] pRequestId + * @return TAPI_API_INVALID_INPUT + */ +void utc_tel_set_sms_sca_03() +{ + TapiResult_t returnStatus = TAPI_API_SUCCESS; + int pRequestId = -1; + char scaNum[TAPI_NETTEXT_SCADDRESS_LEN_MAX]; + int scaNum_len = 0; + int Index = 0; + int i = 0; + TS_BYTE packet[500]; + + sprintf(scaNum, "%s", VALID_SCA_NUM); + scaNum_len = strlen(scaNum); + scaNum[scaNum_len] = '\0'; + scaNum_len = scaNum_len - 1; + + printf("Sca Number :%s\n", scaNum); + printf("sca number length : %d \n", scaNum_len); + + Index = SmsUtilEncodeAddrField(packet, scaNum, scaNum_len, 0x01, 0x01); + + printf("Index =%d\n", Index); + + for (i = 0; i < Index; i++) + printf("[%02x]", packet[i]); + + pSCA->DialNumLen = -1; + + memcpy(pSCA->szDiallingNum, packet, Index); + + printf("\nSET INVALID SERVICE CENTER ADDRESS LENGTH\n"); + /* Calling TAPI SMS SET SCA API */ + returnStatus = tel_set_sms_sca(pSCA, Index, &pRequestId); + printf("The return value is %d\n", returnStatus); + printf("The pRequestId value is %d\n", pRequestId); + + TET_CHECK(returnStatus == TAPI_API_INVALID_INPUT); + if (returnStatus == TAPI_API_INVALID_INPUT) + printf("utc_tel_set_sms_sca_03 pass\n"); + + return; +} + +/** + * @brief This tests tel_set_sms_sca() API in abnormal conditions + * @par ID: + * UTC_TEL_SET_SERV_CENTER_ADDR_04() + * @param [in] pSCA + * @param [in] Index = 0 + * @code + sprintf (scaNum,"%d", VALID_SCA_NUM); + scaNum_len = strlen(scaNum); + scaNum[scaNum_len] = '\0'; + pSCA->DialNumLen = -1; + pSCA->Ton = SIM_TON_NATIONAL; + pSCA->Npi = TAPI_SIM_NPI_ISDN_TEL; + memcpy(pSCA->szDiallingNum,scaNum,scaNum_len); + * @endcode + * @param [out] pRequestId = NULL + * @return TAPI_API_INVALID_PTR + */ +void utc_tel_set_sms_sca_04() +{ + TapiResult_t returnStatus = TAPI_API_SUCCESS; + //int pRequestId = -1; + char scaNum[TAPI_NETTEXT_SCADDRESS_LEN_MAX]; + int scaNum_len = 0; + int Index = 0; + + sprintf(scaNum, "%s", VALID_SCA_NUM); + scaNum_len = strlen(scaNum); //shlee, temporary divide the length by 2 + scaNum[scaNum_len] = '\0'; + + pSCA->DialNumLen = scaNum_len; + pSCA->Ton = SIM_TON_NATIONAL; + pSCA->Npi = TAPI_SIM_NPI_ISDN_TEL; + + memcpy(pSCA->szDiallingNum, scaNum, scaNum_len); + + /* Calling TAPI SMS SET SCA API */ + returnStatus = tel_set_sms_sca(pSCA, Index, NULL); + printf("The return value is %d\n", returnStatus); + //printf ("The pRequestId value is %d\n",pRequestId); + + TET_CHECK(returnStatus == TAPI_API_INVALID_PTR); + if (returnStatus == TAPI_API_INVALID_PTR) + printf("utc_tel_set_sms_sca_04 pass\n"); + + return; +} + +/** + * @brief This tests tel_set_sms_sca() API in abnormal conditions + * @par ID: + * UTC_TEL_SET_SERV_CENTER_ADDR_05() + * @param [in] pSCA = NULL + * @param [in] Index = 0 + * @param [out] pRequestId + * @return TAPI_API_INVALID_PTR + */ +void utc_tel_set_sms_sca_05() +{ + TapiResult_t returnStatus = TAPI_API_SUCCESS; + int pRequestId = -1; + + int Index = 0; + /* Calling TAPI SMS SET SCA API */ + returnStatus = tel_set_sms_sca(NULL, Index, &pRequestId); + printf("The return value is %d\n", returnStatus); + printf("The pRequestId value is %d\n", pRequestId); + + TET_CHECK(returnStatus == TAPI_API_INVALID_PTR); + if (returnStatus == TAPI_API_INVALID_PTR) + printf("utc_tel_set_sms_sca_05 pass\n"); + + return; +} + +/** + * @brief This tests tel_set_sms_sca() API in abnormal conditions + * @par ID: + * UTC_TEL_SET_SERV_CENTER_ADDR_06() + * @param [in] pSCA = NULL + * @param [in] Index = 0 + * @param [out] pRequestId = NULL + * @return TAPI_API_INVALID_PTR + */ + +void utc_tel_set_sms_sca_06() +{ + TapiResult_t returnStatus = TAPI_API_SUCCESS; + int Index = 0; + /* Calling TAPI SMS SET SCA API */ + returnStatus = tel_set_sms_sca(NULL, Index, NULL); + printf("The return value is %d\n", returnStatus); + + TET_CHECK(returnStatus == TAPI_API_INVALID_PTR); + if (returnStatus == TAPI_API_INVALID_PTR) + printf("utc_tel_set_sms_sca_06 pass\n"); + + return; +} + +/** @} */ diff --git a/TC/telephony_TC/sms/unit/uts_tel_set_sms_sca.h b/TC/telephony_TC/sms/unit/uts_tel_set_sms_sca.h new file mode 100644 index 0000000..1519e84 --- /dev/null +++ b/TC/telephony_TC/sms/unit/uts_tel_set_sms_sca.h @@ -0,0 +1,39 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * 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 _UTS_SET_SERV_ADDR_H_ +#define _UTS_SET_SERV_ADDR_H_ + +#define INVALID_SCA_ADDR "919910010000" + +static void utc_tel_set_sms_sca_01(); + +static void utc_tel_set_sms_sca_02(); + +static void utc_tel_set_sms_sca_03(); + +static void utc_tel_set_sms_sca_04(); + +static void utc_tel_set_sms_sca_05(); + +static void utc_tel_set_sms_sca_06(); + + +#endif diff --git a/TC/telephony_TC/sms/unit/uts_tel_write_sms_in_sim.c b/TC/telephony_TC/sms/unit/uts_tel_write_sms_in_sim.c new file mode 100644 index 0000000..933ae53 --- /dev/null +++ b/TC/telephony_TC/sms/unit/uts_tel_write_sms_in_sim.c @@ -0,0 +1,360 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * 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 "string.h" +#include + +#include +#include + +#include +#include "assert.h" +#include "glib.h" +#include +#include +#include "tet_macro.h" + + +#include "TapiCommon.h" +#include + +#include "sms_callback_util.h" +#include "uts_tel_write_sms_in_sim.h" + + + +static void startup(); +static void cleanup(); +void (*tet_startup) () = startup; +void (*tet_cleanup) () = cleanup; +struct tet_testlist tet_testlist[] = { + {utc_tel_write_sms_in_sim_01, 1}, + {utc_tel_write_sms_in_sim_02, 2}, + {utc_tel_write_sms_in_sim_03, 3}, + {utc_tel_write_sms_in_sim_04, 4}, + {utc_tel_write_sms_in_sim_05, 5}, + {utc_tel_write_sms_in_sim_06, 6}, + {utc_tel_write_sms_in_sim_07, 7}, + {NULL, 0} +}; + +static TapiResult_t gStartupSuccess; +unsigned int subscription_id; + +void alarm_received(int sgi) +{ + gAsyncResult = FALSE; + printf("Signal [SIGALARM] Received. Close g_main_loop()"); + G_MAIN_LOOP_CLOSE(); +} + +static void startup() +{ + tapi_dbus_connection_name dname; + int bStatus; + + gStartupSuccess = tel_init(); + if (gStartupSuccess != TAPI_API_SUCCESS) { + printf("tel_init() Failed gStartupSuccess = %d \n", gStartupSuccess); + } + gStartupSuccess = tel_register_event(TAPI_EVENT_NETTEXT_SAVE_STATUS_CNF, &subscription_id, tapi_sms_callback, NULL); + + if (gStartupSuccess != TAPI_API_SUCCESS) { + printf("TapiCommonRegisterEvent Failed gStartupSuccess = %d \n", gStartupSuccess); + } + else { + tel_register_app_name("org.samsung.test"); + if (tel_get_app_name(&dname)) + printf("Dbus Get app name error\n"); + else + printf("Dbus Name is %s\n", dname.name); + + tel_check_service_ready(&bStatus); + printf("Telephony service %d\n", bStatus); + + printf("TapiCommonRegisterEvent subscription_id1 is %d gStartupSuccess is %d\n", subscription_id, gStartupSuccess); + } +} + +static void cleanup() +{ + + if (gStartupSuccess == TAPI_API_SUCCESS) + tel_deregister_event(subscription_id); + tel_deinit(); + return; +} + + + +/** + * @brief This tests tel_write_sms_in_sim() API in normal conditions + * @par ID: + * UTC_TEL_WRITE_SMS_01 + * @param [in] MsgStatus = TAPI_NETTEXT_STATUS_READ + * @param [in] pDataPackage + * @code + pDataPackage->SimIndex = 0; + pDataPackage->MsgLength = pdu_len; + memcpy(pDataPackage->szData, pPDU, pDataPackage->MsgLength); + * @endcode + * @param [out] pRequestId + * @return TAPI_API_SUCCESS + */ +void utc_tel_write_sms_in_sim_01() +{ + TapiResult_t returnStatus = TAPI_API_SUCCESS; + int pRequestId = -1; + char *scaNum = "8210911111"; + char *pPDU = "This is a Test SMS"; + int pdu_len = strlen(pPDU); + TelSmsData_t WriteData; + + memset(&WriteData, 0, sizeof(TelSmsData_t)); + memcpy(WriteData.SmsData.Sca, scaNum, strlen(scaNum)); + WriteData.SmsData.MsgLength = pdu_len; + memcpy(WriteData.SmsData.szData, pPDU, pdu_len); + WriteData.MsgStatus = TAPI_NETTEXT_STATUS_READ; + + returnStatus = tel_write_sms_in_sim(&WriteData, &pRequestId); + + gmain_loop_for_events(5000); + printf("The return value is %d\n", returnStatus); + printf("The pRequestId value is %d\n", pRequestId); + + TET_CHECK(returnStatus == TAPI_API_SUCCESS); + if (returnStatus == TAPI_API_SUCCESS) + printf("utc_tel_write_sms_in_sim_01 pass\n"); + return; +} + +/** + * @brief This tests tel_write_sms_in_sim() API in abnormal conditions + * @par ID: + * UTC_TEL_WRITE_SMS_02 + * @param [in] MsgStatus = TAPI_NETTEXT_STATUS_READ - 1 + * @param [in] pDataPackage + * @code + pDataPackage->SimIndex = 2; + pDataPackage->MsgLength = pdu_len; + memcpy(pDataPackage->szData, pPDU, pDataPackage->MsgLength); + * @endcode + * @param [out] pRequestId + * @return TAPI_API_INVALID_INPUT + */ +void utc_tel_write_sms_in_sim_02() +{ + TapiResult_t returnStatus = TAPI_API_SUCCESS; + int pRequestId = -1; + char *scaNum = "8210911111"; + char *pPDU = "This is a Test SMS"; + int pdu_len = strlen(pPDU); + + TelSmsData_t WriteData; + + memset(&WriteData, 0, sizeof(TelSmsData_t)); + memcpy(WriteData.SmsData.Sca, scaNum, strlen(scaNum)); + WriteData.SmsData.MsgLength = pdu_len; + memcpy(WriteData.SmsData.szData, pPDU, pdu_len); + WriteData.MsgStatus = TAPI_NETTEXT_STATUS_READ - 1; + + returnStatus = tel_write_sms_in_sim(&WriteData, &pRequestId); + + printf("The return value is %d\n", returnStatus); + printf("The pRequestId value is %d\n", pRequestId); + + TET_CHECK(returnStatus == TAPI_API_INVALID_INPUT); + if (returnStatus == TAPI_API_INVALID_INPUT) + printf("utc_tel_write_sms_in_sim_02 pass\n"); + return; +} + +/** + * @brief This tests tel_write_sms_in_sim() API in abnormal conditions + * @par ID: + * UTC_TEL_WRITE_SMS_03 + * @param [in] MsgStatus = TAPI_NETTEXT_STATUS_RESERVED + 1 + * @param [in] pDataPackage + * @code + pDataPackage->SimIndex = 0; + pDataPackage->MsgLength = pdu_len; + memcpy(pDataPackage->szData, pPDU, pDataPackage->MsgLength); + * @endcode + * @param [out] pRequestId + * @return TAPI_API_INVALID_INPUT + */ +void utc_tel_write_sms_in_sim_03() +{ + TapiResult_t returnStatus = TAPI_API_SUCCESS; + int pRequestId = -1; + char *scaNum = "8210911111"; + char *pPDU = "This is a Test SMS"; + int pdu_len = strlen(pPDU); + + TelSmsData_t WriteData; + + memset(&WriteData, 0, sizeof(TelSmsData_t)); + memcpy(WriteData.SmsData.Sca, scaNum, strlen(scaNum)); + WriteData.SmsData.MsgLength = pdu_len; + memcpy(WriteData.SmsData.szData, pPDU, pdu_len); + WriteData.MsgStatus = TAPI_NETTEXT_STATUS_RESERVED + 1; + + returnStatus = tel_write_sms_in_sim(&WriteData, &pRequestId); + + printf("The return value is %d\n", returnStatus); + printf("The pRequestId value is %d\n", pRequestId); + + TET_CHECK(returnStatus == TAPI_API_INVALID_INPUT); + if (returnStatus == TAPI_API_INVALID_INPUT) + printf("utc_tel_write_sms_in_sim_03 pass\n"); + return; +} + +/** + * @brief This tests tel_write_sms_in_sim() API in normal conditions + * @par ID: + * UTC_TEL_WRITE_SMS_04 + * @param [in] MsgStatus = TAPI_NETTEXT_STATUS_SENT + * @param [in] pDataPackage + * @code + pDataPackage->SimIndex = 1; + pDataPackage->MsgLength = pdu_len; + memcpy(pDataPackage->szData, pPDU, pDataPackage->MsgLength); + memcpy(pDataPackage->pSCA, pSCA, strlen(pSCA)); + * @endcode + * @param [out] pRequestId + * @return TAPI_API_INVALID_INPUT + */ +void utc_tel_write_sms_in_sim_04() +{ + TapiResult_t returnStatus = TAPI_API_SUCCESS; + int pRequestId = -1; + + char *scaNum = "8210911111"; + char *pPDU = "This is a Test SMS"; + int pdu_len = strlen(pPDU); + + TelSmsData_t WriteData; + + memset(&WriteData, 0, sizeof(TelSmsData_t)); + memcpy(WriteData.SmsData.Sca, scaNum, strlen(scaNum)); + WriteData.SmsData.MsgLength = pdu_len; + memcpy(WriteData.SmsData.szData, pPDU, pdu_len); + WriteData.MsgStatus = TAPI_NETTEXT_STATUS_SENT; + + returnStatus = tel_write_sms_in_sim(&WriteData, &pRequestId); + gmain_loop_for_events(5000); + + printf("The return value is %d\n", returnStatus); + printf("The pRequestId value is %d\n", pRequestId); + + TET_CHECK(returnStatus == TAPI_API_SUCCESS); + if (returnStatus == TAPI_API_SUCCESS) + printf("utc_tel_write_sms_in_sim_04 pass\n"); + return; +} + +/** + * @brief This tests tel_write_sms_in_sim() API in abnormal conditions + * @par ID: + * UTC_TEL_WRITE_SMS_05 + * @param [in] MsgStatus = TAPI_NETTEXT_STATUS_READ + * @param [in] pDataPackage = NULL + * @param [out] pRequestId + * @return TAPI_API_INVALID_PTR + */ +void utc_tel_write_sms_in_sim_05() +{ + TapiResult_t returnStatus = TAPI_API_SUCCESS; + int pRequestId = -1; + + returnStatus = tel_write_sms_in_sim(NULL, &pRequestId); + + printf("The return value is %d\n", returnStatus); + printf("The pRequestId value is %d\n", pRequestId); + + TET_CHECK(returnStatus == TAPI_API_INVALID_PTR); + if (returnStatus == TAPI_API_INVALID_PTR) + printf("utc_tel_write_sms_in_sim_05 pass\n"); + return; +} + +/** + * @brief This tests tel_write_sms_in_sim() API in abnormal conditions + * @par ID: + * UTC_TEL_WRITE_SMS_06 + * @param [in] MsgStatus = TAPI_NETTEXT_STATUS_READ + * @param [in] pDataPackage + * @param [out] pRequestId = NULL + * @return TAPI_API_INVALID_PTR + */ +void utc_tel_write_sms_in_sim_06() +{ + TapiResult_t returnStatus = TAPI_API_SUCCESS; + char *scaNum = "8210911111"; + char *pPDU = "This is a Test SMS"; + int pdu_len = strlen(pPDU); + + TelSmsData_t WriteData; + + memset(&WriteData, 0, sizeof(TelSmsData_t)); + memcpy(WriteData.SmsData.Sca, scaNum, strlen(scaNum)); + WriteData.SmsData.MsgLength = pdu_len; + memcpy(WriteData.SmsData.szData, pPDU, pdu_len); + WriteData.MsgStatus = TAPI_NETTEXT_STATUS_SENT; + + returnStatus = tel_write_sms_in_sim(&WriteData, NULL); + + printf("The return value is %d\n", returnStatus); + + TET_CHECK(returnStatus == TAPI_API_INVALID_PTR); + if (returnStatus == TAPI_API_INVALID_PTR) + printf("utc_tel_write_sms_in_sim_06 pass\n"); + return; +} + +/** + * @brief This tests tel_write_sms_in_sim() API in abnormal conditions + * @par ID: + * UTC_TEL_WRITE_SMS_07 + * @param [in] MsgStatus = TAPI_NETTEXT_STATUS_READ + * @param [in] pDataPackage = NULL + * @param [out] pRequestId = NULL + * @return TAPI_API_INVALID_PTR + */ +void utc_tel_write_sms_in_sim_07() +{ + TapiResult_t returnStatus = TAPI_API_SUCCESS; + + returnStatus = tel_write_sms_in_sim(NULL, NULL); + + printf("The return value is %d\n", returnStatus); + + TET_CHECK(returnStatus == TAPI_API_INVALID_PTR); + if (returnStatus == TAPI_API_INVALID_PTR) + printf("utc_tel_write_sms_in_sim_07 pass\n"); + return; +} + +/** @} */ diff --git a/TC/telephony_TC/sms/unit/uts_tel_write_sms_in_sim.h b/TC/telephony_TC/sms/unit/uts_tel_write_sms_in_sim.h new file mode 100644 index 0000000..716edff --- /dev/null +++ b/TC/telephony_TC/sms/unit/uts_tel_write_sms_in_sim.h @@ -0,0 +1,38 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * 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 _UTS_WRITE_SMS_IN_SIM_H_ +#define _UTS_WRITE_SMS_IN_SIM_H_ + +static void utc_tel_write_sms_in_sim_01(); + +static void utc_tel_write_sms_in_sim_02(); + +static void utc_tel_write_sms_in_sim_03(); + +static void utc_tel_write_sms_in_sim_04(); + +static void utc_tel_write_sms_in_sim_05(); + +static void utc_tel_write_sms_in_sim_06(); + +static void utc_tel_write_sms_in_sim_07(); + +#endif diff --git a/TC/telephony_TC/sound/unit/async_util.c b/TC/telephony_TC/sound/unit/async_util.c new file mode 100644 index 0000000..0b5bdbc --- /dev/null +++ b/TC/telephony_TC/sound/unit/async_util.c @@ -0,0 +1,56 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * 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 "sound_callback_util.h" +#include "async_util.h" + +static void G_MAIN_TIMER_HANDLER(int sgi); + +// Global variable for G_MAIN system +static int gEventHandle=0; +static GMainLoop * context_loop = NULL; +static EvtAlarmCb gpAlarm_Handler = NULL; +static unsigned int gSubscription_id; + +void G_MAIN_LOOP_CLOSE() +{ + g_main_loop_quit(context_loop); +} + +void G_MAIN_TIMER_HANDLER(int sgi) +{ + if (gpAlarm_Handler) + gpAlarm_Handler(sgi); + else + { + fprintf(stderr, "SIGALRM received. But user handler not registered. Close g_main_loop()"); + G_MAIN_LOOP_CLOSE(); + } +} + +void G_MAIN_LOOP_RUN(int sec) +{ + (void) signal(SIGALRM, G_MAIN_TIMER_HANDLER); + alarm(sec); + context_loop = g_main_loop_new(NULL, FALSE); + g_main_loop_run(context_loop); + alarm(0); +} diff --git a/TC/telephony_TC/sound/unit/async_util.h b/TC/telephony_TC/sound/unit/async_util.h new file mode 100644 index 0000000..d60d2d5 --- /dev/null +++ b/TC/telephony_TC/sound/unit/async_util.h @@ -0,0 +1,31 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * 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 _ASYNC_UTIL_H_ +#define _ASYNC_UTIL_H_ + +#include + +typedef void (*EvtAlarmCb) (int sgi); +TS_BOOL gAsyncResult; +void G_MAIN_LOOP_RUN(int sec); +void G_MAIN_LOOP_CLOSE(); + +#endif //_ASYNC_UTIL_H_ diff --git a/TC/telephony_TC/sound/unit/makefile b/TC/telephony_TC/sound/unit/makefile new file mode 100644 index 0000000..170109a --- /dev/null +++ b/TC/telephony_TC/sound/unit/makefile @@ -0,0 +1,41 @@ +CC=gcc -Wall + +TS1 = uts_tel_get_sound_volume_info +TS2 = uts_tel_set_sound_volume_info +TS3 = uts_tel_set_sound_path +TS4 = uts_tel_set_sound_mute_status +TS5 = uts_tel_get_sound_mute_status +#TS6 = uts_tel_control_sound_voice_recording +#TS7 = uts_tel_set_sound_loopback +#TS8 = uts_tel_set_sound_clock + +LIBS = `pkg-config --libs glib-2.0 gconf-2.0 dbus-1 dbus-glib-1 gthread-2.0 tapi` +LIBS +=$(TET_ROOT)/lib/tet3/tcm.o +LIBS +=-L$(TET_ROOT)/lib/tet3 -lapi + +INCS = -I. `pkg-config --cflags glib-2.0 gconf-2.0 dbus-1 dbus-glib-1 gthread-2.0 tapi` +INCS += -I$(TET_ROOT)/inc/tet3 + +CFLAGS += $(INCS) -D__arm__ -D_ARM_TOUCH -DTELEPHONY_TIMER +CC +=$(CFLAGS) +LDFLAGS = $(LIBS) + +#ifeq ($(ARCH),target) +#CC += -g -mabi=aapcs-linux +#endif + +all : $(TS1) $(TS2) $(TS3) $(TS4) $(TS5) + +clean : + rm -rf *~ *.o tet_lock tet_captured $(TS1) $(TS2) $(TS3) $(TS4) $(TS5) + +$(TS1): $(TS1).c + $(CC) -o $(TS1) $(TS1).c sound_callback_util.c $(LDFLAGS) +$(TS2): $(TS2).c + $(CC) -o $(TS2) $(TS2).c sound_callback_util.c $(LDFLAGS) +$(TS3): $(TS3).c + $(CC) -o $(TS3) $(TS3).c sound_callback_util.c $(LDFLAGS) +$(TS4): $(TS4).c + $(CC) -o $(TS4) $(TS4).c sound_callback_util.c $(LDFLAGS) +$(TS5): $(TS5).c + $(CC) -o $(TS5) $(TS5).c sound_callback_util.c $(LDFLAGS) diff --git a/TC/telephony_TC/sound/unit/sound_callback_util.c b/TC/telephony_TC/sound/unit/sound_callback_util.c new file mode 100644 index 0000000..a661b71 --- /dev/null +++ b/TC/telephony_TC/sound/unit/sound_callback_util.c @@ -0,0 +1,145 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * 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 "sound_callback_util.h" + +static unsigned int subscription_id[7]; +GMainLoop *main_loop = NULL; + +int app_sound_callback (const TelTapiEvent_t * TapiEvent) +{ + + int eventClass; + int eventType; + int requestId; + int status; + void *EventData = NULL; + + eventClass = TapiEvent->EventClass; + eventType = TapiEvent->EventType; + requestId = TapiEvent->RequestId; + status = TapiEvent->Status; + EventData = TapiEvent->pData; + + printf("\nClass:[%d], Event Type:[%d], RequestId:[%d], Status:[%d] \n", eventClass, eventType , requestId, status ); + + if( EventData==NULL) + { + printf("\n****** EventData is NULL......... ******\n"); + } + + switch(eventClass) + { + case TAPI_EVENT_CLASS_SOUND: + switch(eventType) + { + case TAPI_EVENT_SOUND_VOLUMECTRL_RSP : + printf("*** TAPI_EVENT_SOUND_VOLUMECTRL_RSP received : %x ****\n", eventType); + break; + + //case TAPI_EVENT_SOUND_MICGAINCTRL_RSP: + // printf("*** TAPI_EVENT_SOUND_MICGAINCTRL_RSP received : %x ****\n", eventType); + // break; + + case TAPI_EVENT_SOUND_MICMUTECTRL_RSP: + printf("*** TAPI_EVENT_SOUND_MICMUTECTRL_RSP received : %x ****\n", eventType); + break; + + case TAPI_EVENT_SOUND_AUDIOPATHCTRL_NOTI: + printf("*** TAPI_EVENT_SOUND_AUDIOPATHCTRL_NOTI received : %x ****\n", eventType); + break; + + case TAPI_EVENT_SOUND_AUDIOSOURCECTRL_NOTI: + printf("*** TAPI_EVENT_SOUND_AUDIOSOURCECTRL_NOTI received : %x ****\n", eventType); + break; + + case TAPI_EVENT_SOUND_ERROR_IND: + printf("*** TAPI_EVENT_SOUND_ERROR_IND received : %x ****\n", eventType); + break; + //case TAPI_EVENT_SOUND_USRCONFIGURATIONCTRL_RSP: + // printf("*** TAPI_EVENT_SOUND_USRCONFIGURATIONCTRL_RSP received : %x ****\n", eventType); + // break; + default: + printf("*** Default Event %x ****\n", eventType); + break; + + } + + break; + + default: + printf("*** Other TAPI EVENT received : class : %x ****\n", eventClass); + break; + } + return 0; +} + +gboolean TimeOutFun (void *data) +{ + g_main_loop_quit (main_loop); + printf ("Exit from this callback\n"); + return FALSE; +} + +int gmain_loop_for_tapi_events(int delay) +{ + main_loop = g_main_loop_new (NULL, FALSE); + g_timeout_add (delay, TimeOutFun, NULL); + g_main_loop_run (main_loop); + + return 0; +} + +void print_all_subsciption_ids() +{ + int i=0; + for(i=0;i<7;i++) + { + printf("\n subscription_id[%d] has value %d \n",i,subscription_id[i]); + } +} + +TapiResult_t register_all_events() +{ + TapiResult_t api_err = TAPI_API_SUCCESS; + + api_err = tel_register_event(TAPI_EVENT_SOUND_VOLUMECTRL_RSP, &subscription_id[0], (TelAppCallback)&app_sound_callback,NULL); + + //api_err = tel_register_event(TAPI_EVENT_SOUND_USRCONFIGURATIONCTRL_RSP, &subscription_id[1], (TelAppCallback)&app_sound_callback,NULL); + api_err = tel_register_event(TAPI_EVENT_SOUND_ERROR_IND, &subscription_id[2], (TelAppCallback)&app_sound_callback,NULL); + api_err = tel_register_event(TAPI_EVENT_SOUND_AUDIOPATHCTRL_NOTI, &subscription_id[3],(TelAppCallback)&app_sound_callback,NULL); + api_err = tel_register_event(TAPI_EVENT_SOUND_AUDIOSOURCECTRL_NOTI, &subscription_id[4],(TelAppCallback) &app_sound_callback,NULL); + api_err = tel_register_event(TAPI_EVENT_SOUND_MICMUTECTRL_RSP, &subscription_id[5],(TelAppCallback) &app_sound_callback,NULL); +// api_err = tel_register_event(TAPI_EVENT_SOUND_MICGAINCTRL_RSP, &subscription_id[6], (TelAppCallback)&app_sound_callback,NULL); + print_all_subsciption_ids(); + return 0; +} + +TapiResult_t deregister_all() +{ + tel_deregister_event(subscription_id[0]); + tel_deregister_event(subscription_id[1]); + tel_deregister_event(subscription_id[2]); + tel_deregister_event(subscription_id[3]); + tel_deregister_event(subscription_id[4]); + tel_deregister_event(subscription_id[5]); + tel_deregister_event(subscription_id[6]); + return 0; +} diff --git a/TC/telephony_TC/sound/unit/sound_callback_util.h b/TC/telephony_TC/sound/unit/sound_callback_util.h new file mode 100644 index 0000000..7d3f781 --- /dev/null +++ b/TC/telephony_TC/sound/unit/sound_callback_util.h @@ -0,0 +1,57 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * 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 _SOUND_CALLBACK_UTIL_H_ +#define _SOUND_CALLBACK_UTIL_H_ + + +#include +#include +#include +#include "string.h" +#include "assert.h" +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include "tet_macro.h" +#include +#include +#include +#include + + +#define TIME_DELAY 5000 + +extern int app_sound_callback (const TelTapiEvent_t * TapiEvent); + +extern TapiResult_t register_all_events(); +extern TapiResult_t deregister_all(); +void print_all_subsciption_ids(); +extern int gmain_loop_for_tapi_events(int delay); +extern gboolean TimeOutFun (void *data); + +#endif //_SOUND_CALLBACK_UTIL_H_ diff --git a/TC/telephony_TC/sound/unit/tet_macro.h b/TC/telephony_TC/sound/unit/tet_macro.h new file mode 100644 index 0000000..89744c0 --- /dev/null +++ b/TC/telephony_TC/sound/unit/tet_macro.h @@ -0,0 +1,33 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * 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 TET_MACRO_H +#define TET_MACRO_H + +#define TET_CHECK(x) if(x) tet_result(TET_PASS); else tet_result(TET_FAIL) +#define TET_CHECK_EQUAL(x,y) if ((x)==(y)) tet_result(TET_PASS); else tet_result(TET_FAIL) +#define TET_CHECK_NOT_EQUAL(x,y) if ((x)!=(y)) tet_result(TET_PASS); else tet_result(TET_FAIL) + +#define TET_CHECK_MESSAGE(x,y) if ((y)==(TRUE)) tet_result(TET_PASS); else {tet_result(TET_FAIL); tet_printf(x);} +#define TET_CHECK_EQUAL_MESSAGE(x,y,z) if ((y)==(z)) tet_result(TET_PASS); else {tet_result(TET_FAIL); tet_printf(x);} +#define TET_CHECK_NOT_EQUAL_MESSAGE(x,y,z) if ((y)!=(z)) tet_result(TET_PASS); else {tet_result(TET_FAIL); tet_printf(x);} + +#endif + diff --git a/TC/telephony_TC/sound/unit/tslist b/TC/telephony_TC/sound/unit/tslist new file mode 100644 index 0000000..c129d13 --- /dev/null +++ b/TC/telephony_TC/sound/unit/tslist @@ -0,0 +1,5 @@ +/sound/unit/uts_tel_get_sound_mute_status +/sound/unit/uts_tel_set_sound_mute_status +/sound/unit/uts_tel_set_sound_path +/sound/unit/uts_tel_get_sound_volume_info +/sound/unit/uts_tel_set_sound_volume_info diff --git a/TC/telephony_TC/sound/unit/uts_tel_control_sound_voice_recording.c b/TC/telephony_TC/sound/unit/uts_tel_control_sound_voice_recording.c new file mode 100644 index 0000000..8a23dda --- /dev/null +++ b/TC/telephony_TC/sound/unit/uts_tel_control_sound_voice_recording.c @@ -0,0 +1,268 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** +* @ingroup TELEPHONY_FRAMEWORK_API +* @addtogroup MMS +*/ + +/** +* @ingroup SOUND +* @addtogroup UTS_TEL_CONTROL_SOUND_VOICE_RECORDING Unit +*/ + +/** +* @ingroup UTS_TEL_CONTROL_SOUND_VOICE_RECORDING Unit +* @addtogroup UTS_TEL_CONTROL_SOUND_VOICE_RECORDING_ Uts_Tel_Control_Sound_Voice_Recording +* @{ +*/ + +/** +* @file uts_tel_control_sound_voice_recording.c +* @brief This is a suit of unit test cases to test tel_control_sound_voice_recording() API function +* @author Gautam Nand Sinha (gnand.sinha@samsung.com) +* @version Initial Creation Version 0.1 +* @date 2008.09.08 +*/ + +#include "uts_tel_control_sound_voice_recording.h" + + +static void startup(); +static void cleanup(); +void (*tet_startup) () = startup; +void (*tet_cleanup) () = cleanup; + + +static TapiResult_t gStartupSuccess; + +/* Startup & Clean function : It is not test code, only for + initialize and finalize test module */ + +static void startup() +{ + tapi_dbus_connection_name dname; + int bStatus; + + gStartupSuccess = tel_init(); + if(gStartupSuccess != TAPI_API_SUCCESS) + { + printf("tel_init() Failed gStartupSuccess = %d \n",gStartupSuccess); + } + + register_all_events(); + tel_register_app_name("org.samsung.test"); + if(tel_get_app_name(&dname)) + printf("Dbus Get app name error\n"); + else + printf("Dbus Name is %s\n",dname.name); + + tel_check_service_ready(&bStatus); + printf("Telephpny service %d\n",bStatus); + +} + +static void cleanup() +{ + deregister_all(); + tel_deinit(); + return; + +} + +struct tet_testlist tet_testlist[] = { + {utc_tel_control_sound_voice_recording_000, 1}, + {utc_tel_control_sound_voice_recording_001, 2}, + {utc_tel_control_sound_voice_recording_002, 3}, + {utc_tel_control_sound_voice_recording_003, 4}, + {NULL, 0} +}; + + + + + +/** + * @brief This tests + * @par ID: + * utc_tel_control_sound_voice_recording_000 + * @param [in] mic_mute + * @param [in] *pRequestId + * @code + * @endcode + * @param [out] snd_mask + * @param [out] snd_value + * @param [out] *pRequestId + * @return TapiResult_t +*/ + + +void utc_tel_control_sound_voice_recording_000() +{ + + + TapiResult_t returnStatus = TAPI_API_SUCCESS; + int pRequestId = -1; + gmain_loop_for_tapi_events(TIME_DELAY); + returnStatus = tel_control_sound_voice_recording(TAPI_SOUND_VOICE_RECORDING_OFF,&pRequestId); + gmain_loop_for_tapi_events(TIME_DELAY); + printf ("The return value is %d\n", returnStatus); + printf ("The pRequestId value is %d\n",pRequestId); + + if(returnStatus == TAPI_API_SUCCESS) + { + tet_infoline("utc_tel_control_sound_voice_recording_000 pass\n"); + tet_result(TET_PASS); + } + else + { + tet_infoline("utc_tel_control_sound_voice_recording_000 has failed\n"); + tet_result(TET_FAIL); + } + + + +} + + +/** + * @brief This tests + * @par ID: + * utc_tel_control_sound_voice_recording_001 + * @param [in] mic_mute + * @param [in] *pRequestId + * @code + * @endcode + * @param [out] snd_mask + * @param [out] snd_value + * @param [out] *pRequestId + * @return TapiResult_t +*/ + + +void utc_tel_control_sound_voice_recording_001() +{ + TapiResult_t returnStatus = TAPI_API_SUCCESS; + int pRequestId = -1; + gmain_loop_for_tapi_events(TIME_DELAY); + returnStatus = tel_control_sound_voice_recording(TAPI_SOUND_VOICE_RECORDING_ON,&pRequestId); + gmain_loop_for_tapi_events(TIME_DELAY); + printf ("The return value is %d\n", returnStatus); + printf ("The pRequestId value is %d\n",pRequestId); + + if(returnStatus == TAPI_API_SUCCESS) + { + tet_infoline("utc_tel_control_sound_voice_recording_001 pass\n"); + tet_result(TET_PASS); + } + else + { + tet_infoline("utc_tel_control_sound_voice_recording_001 has failed\n"); + tet_result(TET_FAIL); + } + + +} + + +/** + * @brief This tests + * @par ID: + * utc_tel_control_sound_voice_recording_002 + * @param [in] mic_mute + * @param [in] *pRequestId + * @code + * @endcode + * @param [out] snd_mask + * @param [out] snd_value + * @param [out] *pRequestId + * @return TapiResult_t +*/ + + +void utc_tel_control_sound_voice_recording_002() +{ + + TapiResult_t returnStatus = TAPI_API_SUCCESS; + int pRequestId = -1; + gmain_loop_for_tapi_events(TIME_DELAY); + returnStatus = tel_control_sound_voice_recording(TAPI_SOUND_VOICE_RECORDING_ON + 1,&pRequestId); + + gmain_loop_for_tapi_events(TIME_DELAY); + printf ("The return value is %d\n", returnStatus); + printf ("The pRequestId value is %d\n",pRequestId); + + if(returnStatus == TAPI_API_INVALID_INPUT) + { + tet_infoline("utc_tel_control_sound_voice_recording_002 pass\n"); + tet_result(TET_PASS); + } + else + { + tet_infoline("utc_tel_control_sound_voice_recording_002 has failed\n"); + tet_result(TET_FAIL); + } + + +} +/** + * @brief This tests + * @par ID: + * utc_tel_control_sound_voice_recording_003 + * @param [in] mic_mute + * @param [in] *pRequestId + * @code + * @endcode + * @param [out] snd_mask + * @param [out] snd_value + * @param [out] *pRequestId + * @return TapiResult_t +*/ + + +void utc_tel_control_sound_voice_recording_003() +{ + + TapiResult_t returnStatus = TAPI_API_SUCCESS; + int pRequestId = -1; + gmain_loop_for_tapi_events(TIME_DELAY); + returnStatus = tel_control_sound_voice_recording(TAPI_SOUND_VOICE_RECORDING_OFF - 1,&pRequestId); + gmain_loop_for_tapi_events(TIME_DELAY); + + printf ("The return value is %d\n", returnStatus); + printf ("The pRequestId value is %d\n",pRequestId); + + if(returnStatus == TAPI_API_INVALID_INPUT) + { + tet_infoline("utc_tel_control_sound_voice_recording_003 pass\n"); + tet_result(TET_PASS); + } + else + { + tet_infoline("utc_tel_control_sound_voice_recording_003 has failed\n"); + tet_result(TET_FAIL); + } + +} + + + +/** @} */ + diff --git a/TC/telephony_TC/sound/unit/uts_tel_control_sound_voice_recording.h b/TC/telephony_TC/sound/unit/uts_tel_control_sound_voice_recording.h new file mode 100644 index 0000000..d24bb9c --- /dev/null +++ b/TC/telephony_TC/sound/unit/uts_tel_control_sound_voice_recording.h @@ -0,0 +1,69 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** +* @ingroup TELEPHONY_FRAMEWORK_API +* @addtogroup MMS +*/ + +/** +* @ingroup SOUND +* @addtogroup UTS_TEL_CONTROL_SOUND_VOICE_RECORDING Unit +*/ + +/** +* @ingroup UTS_TEL_CONTROL_SOUND_VOICE_RECORDING Unit +* @addtogroup UTS_TEL_CONTROL_SOUND_VOICE_RECORDING_ Uts_Tel_Control_Sound_Voice_Recording +* @{ +*/ + +/** +* @file uts_tel_control_sound_voice_recording.c +* @brief This is a suit of unit test cases to test tel_control_sound_voice_recording() API function +* @author Gautam Nand Sinha (gnand.sinha@samsung.com) +* @version Initial Creation Version 0.1 +* @date 2008.09.08 +*/ + +#include "sound_callback_util.h" + +#ifndef _UTC_TEL_CONTROL_SOUND_VOICE_RECORDING_ +#define _UTC_TEL_CONTROL_SOUND_VOICE_RECORDING_ + + + +void utc_tel_control_sound_voice_recording_000(); + + + +void utc_tel_control_sound_voice_recording_001(); + + + +void utc_tel_control_sound_voice_recording_002(); + + + +void utc_tel_control_sound_voice_recording_003(); + + + +#endif // _UTC_TEL_CONTROL_SOUND_VOICE_RECORDING_ + diff --git a/TC/telephony_TC/sound/unit/uts_tel_get_sound_mute_status.c b/TC/telephony_TC/sound/unit/uts_tel_get_sound_mute_status.c new file mode 100644 index 0000000..90f928a --- /dev/null +++ b/TC/telephony_TC/sound/unit/uts_tel_get_sound_mute_status.c @@ -0,0 +1,216 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** +* @ingroup TELEPHONY_FRAMEWORK_API +* @addtogroup MMS +*/ + +/** +* @ingroup SOUND +* @addtogroup UTS_TEL_GET_SOUND_MUTE_STATUS Unit +*/ + +/** +* @ingroup UTS_TEL_GET_SOUND_MUTE_STATUS Unit +* @addtogroup UTS_TEL_GET_SOUND_MUTE_STATUS_ Uts_Tel_Get_Sound_Mute_Status +* @{ +*/ + +/** +* @file uts_tel_get_sound_mute_status.c +* @brief This is a suit of unit test cases to test tel_get_sound_mute_status() API function +* @author Gautam Nand Sinha (gnand.sinha@samsung.com) +* @version Initial Creation Version 0.1 +* @date 2008.09.08 +*/ + +#include "uts_tel_get_sound_mute_status.h" + + +static void startup(); +static void cleanup(); +void (*tet_startup) () = startup; +void (*tet_cleanup) () = cleanup; + + +static TapiResult_t gStartupSuccess; + +/* Startup & Clean function : It is not test code, only for + initialize and finalize test module */ + +static void startup() +{ + tapi_dbus_connection_name dname; + int bStatus; + + gStartupSuccess = tel_init(); + if(gStartupSuccess != TAPI_API_SUCCESS) + { + printf("tel_init() Failed gStartupSuccess = %d \n",gStartupSuccess); + } + register_all_events(); + tel_register_app_name("org.samsung.test"); + if(tel_get_app_name(&dname)) + printf("Dbus Get app name error\n"); + else + printf("Dbus Name is %s\n",dname.name); + + tel_check_service_ready(&bStatus); + printf("Telephony service %d\n",bStatus); + +} + +static void cleanup() +{ + deregister_all(); + tel_deinit(); + return; + +} + +struct tet_testlist tet_testlist[] = { + {utc_tel_get_sound_mute_status_000, 1}, + {utc_tel_get_sound_mute_status_001, 2}, + {utc_tel_get_sound_mute_status_002, 3}, + {NULL, 0} +}; + + + + + +/** + * @brief This tests + * @par ID: + * utc_tel_get_sound_mute_status_000 + * @param [out] pRequestId + * @code + * @endcode + * @return TapiResult_t +*/ + + +void utc_tel_get_sound_mute_status_000() +{ + + + TapiResult_t returnStatus = TAPI_API_SUCCESS; + int pRequestId = -1; + gmain_loop_for_tapi_events(TIME_DELAY); + tel_set_sound_mute_status(TAPI_SOUND_MIC_MUTE,&pRequestId); + returnStatus = tel_get_sound_mute_status(&pRequestId); + gmain_loop_for_tapi_events(TIME_DELAY); + tet_printf ("The return value is %d\n", returnStatus); + tet_printf ("The pRequestId value is %d\n",pRequestId); + + + if(returnStatus == TAPI_API_SUCCESS) + { + tet_infoline("utc_tel_set_sound_mute_status_000 pass\n"); + tet_result(TET_PASS); + } + else + { + tet_infoline("utc_tel_set_sound_mute_status_000 has failed\n"); + tet_result(TET_FAIL); + } + + + +} + + +/** + * @brief This tests + * @par ID: + * utc_tel_get_sound_mute_status_001 + * @param [out] pRequestId + * @code + * @endcode + * @return TapiResult_t +*/ + + + +void utc_tel_get_sound_mute_status_001() +{ + TapiResult_t returnStatus = TAPI_API_SUCCESS; + int pRequestId = -1; + gmain_loop_for_tapi_events(TIME_DELAY); + tel_set_sound_mute_status(TAPI_SOUND_MIC_UNMUTE,&pRequestId); + returnStatus = tel_get_sound_mute_status(&pRequestId); + gmain_loop_for_tapi_events(TIME_DELAY); + tet_printf ("The return value is %d\n", returnStatus); + tet_printf ("The pRequestId value is %d\n",pRequestId); + + if(returnStatus == TAPI_API_SUCCESS) + { + tet_infoline("utc_tel_set_sound_mute_status_001 pass\n"); + tet_result(TET_PASS); + } + else + { + tet_infoline("utc_tel_set_sound_mute_status_001 has failed\n"); + tet_result(TET_FAIL); + } + + +} + + + + +/** + * @brief This tests + * @par ID: + * utc_tel_get_sound_mute_status_002 + * @param [out] pRequestId + * @code + * @endcode + * @return TapiResult_t +*/ + + +void utc_tel_get_sound_mute_status_002() +{ + + TapiResult_t returnStatus = TAPI_API_SUCCESS; + returnStatus = tel_get_sound_mute_status(NULL); + gmain_loop_for_tapi_events(TIME_DELAY); + + tet_printf ("The return value is %d\n", returnStatus); + + if(returnStatus == TAPI_API_INVALID_PTR) + { + tet_infoline("utc_tel_set_sound_mute_status_002 pass\n"); + tet_result(TET_PASS); + } + else + { + tet_infoline("utc_tel_set_sound_mute_status_002 has failed\n"); + tet_result(TET_FAIL); + } + + +} + +/** @} */ + diff --git a/TC/telephony_TC/sound/unit/uts_tel_get_sound_mute_status.h b/TC/telephony_TC/sound/unit/uts_tel_get_sound_mute_status.h new file mode 100644 index 0000000..4f6364f --- /dev/null +++ b/TC/telephony_TC/sound/unit/uts_tel_get_sound_mute_status.h @@ -0,0 +1,70 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** +* @ingroup TELEPHONY_FRAMEWORK_API +* @addtogroup MMS +*/ + +/** +* @ingroup SOUND +* @addtogroup UTS_TEL_GET_SOUND_MUTE_STATUS Unit +*/ + +/** +* @ingroup UTS_TEL_GET_SOUND_MUTE_STATUS Unit +* @addtogroup UTS_TEL_GET_SOUND_MUTE_STATUS_ Uts_Tel_Get_Sound_Mute_Status +* @{ +*/ + +/** +* @file uts_tel_get_sound_mute_status.h +* @brief This is a suit of unit test cases to test tel_get_sound_mute_status() API function +* @author Gautam Nand Sinha (gnand.sinha@samsung.com) +* @version Initial Creation Version 0.1 +* @date 2008.09.08 +*/ +#include "sound_callback_util.h" + +#ifndef _UTC_TEL_GET_SOUND_MUTE_STATUS_ +#define _UTC_TEL_GET_SOUND_MUTE_STATUS_ + + + +void utc_tel_get_sound_mute_status_000(); + + + +void utc_tel_get_sound_mute_status_001(); + + + +void utc_tel_get_sound_mute_status_002(); + + + +void utc_tel_get_sound_mute_status_003(); + +void utc_tel_get_sound_mute_status_004(); + + + +#endif // _UTC_TEL_GET_SOUND_MUTE_STATUS_ + diff --git a/TC/telephony_TC/sound/unit/uts_tel_get_sound_volume_info.c b/TC/telephony_TC/sound/unit/uts_tel_get_sound_volume_info.c new file mode 100644 index 0000000..bc1128f --- /dev/null +++ b/TC/telephony_TC/sound/unit/uts_tel_get_sound_volume_info.c @@ -0,0 +1,278 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * 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 "uts_tel_get_sound_volume_info.h" + +static void startup(); +static void cleanup(); + +void (*tet_startup) () = startup; +void (*tet_cleanup) () = cleanup; + + +static TapiResult_t gStartupSuccess; + +/* Startup & Clean function : It is not test code, only for + initialize and finalize test module */ + +static void startup() +{ + tapi_dbus_connection_name dname; + int bStatus; + + gStartupSuccess = tel_init(); + if(gStartupSuccess != TAPI_API_SUCCESS) + { + printf("tel_init() Failed gStartupSuccess = %d \n",gStartupSuccess); + } + + register_all_events(); + tel_register_app_name("org.samsung.test"); + if(tel_get_app_name(&dname)) + printf("Dbus Get app name error\n"); + else + printf("Dbus Name is %s\n",dname.name); + + tel_check_service_ready(&bStatus); + printf("Telephony service %d\n",bStatus); + +} + +static void cleanup() +{ + deregister_all(); + tel_deinit(); + return; + +} + + +struct tet_testlist tet_testlist[] = { + {utc_tel_get_sound_volume_info_000, 1}, + {utc_tel_get_sound_volume_info_001, 2}, + {utc_tel_get_sound_volume_info_002, 3}, + {utc_tel_get_sound_volume_info_003, 4}, + {utc_tel_get_sound_volume_info_004, 5}, + {utc_tel_get_sound_volume_info_005, 6}, + {utc_tel_get_sound_volume_info_006, 7}, + {NULL, 0} +}; + + + +/** + * @brief This tests + * @par ID: + * UTC_TEL_GET_SOUND_VOLUME_INFO_000 + * @param [in] vol_control_type + * @param [in] *pRequestId + * @code + * @endcode + * @param [out] vol_control_type + * @param [out] *pRequestId + * @return TapiResult_t +*/ + + +void utc_tel_get_sound_volume_info_000() +{ + TapiResult_t returnStatus = TAPI_API_SUCCESS; + int pRequestId = -1; + gmain_loop_for_tapi_events(TIME_DELAY); + returnStatus = tel_get_sound_volume_info(TAPI_SOUND_VOL_SPK_PHONE, &pRequestId); + gmain_loop_for_tapi_events(TIME_DELAY); + + printf ("The return value is %d\n", returnStatus); + printf ("The pRequestId value is %d\n",pRequestId); + + TET_CHECK(returnStatus == TAPI_API_SUCCESS); + if(returnStatus == TAPI_API_SUCCESS) + printf("utc_tel_get_sound_volume_info_000 pass\n"); +} + +/** + * @brief This tests + * @par ID: + * UTC_TEL_GET_SOUND_VOLUME_INFO_001 + * @param [in] vol_control_type + * @param [in] *pRequestId + * @code + * @endcode + * @param [out] vol_control_type + * @param [out] *pRequestId + * @return TapiResult_t +*/ +void utc_tel_get_sound_volume_info_001() +{ + + TapiResult_t returnStatus = TAPI_API_SUCCESS; + int pRequestId = -1; + gmain_loop_for_tapi_events(TIME_DELAY); + returnStatus = tel_get_sound_volume_info(TAPI_SOUND_VOL_BT_VOICE, &pRequestId); + + gmain_loop_for_tapi_events(TIME_DELAY); + printf ("The return value is %d\n", returnStatus); + printf ("The pRequestId value is %d\n",pRequestId); + + TET_CHECK(returnStatus == TAPI_API_SUCCESS); + if(returnStatus == TAPI_API_SUCCESS) + printf("utc_tel_get_sound_volume_info_001 pass\n"); + +} + +/** + * @brief This tests + * @par ID: + * UTC_TEL_GET_SOUND_VOLUME_INFO_002 + * @param [in] vol_control_type + * @param [in] *pRequestId + * @code + * @endcode + * @param [out] vol_control_type + * @param [out] *pRequestId + * @return TapiResult_t +*/ +void utc_tel_get_sound_volume_info_002() +{ + TapiResult_t returnStatus = TAPI_API_SUCCESS; + int pRequestId = -1; + gmain_loop_for_tapi_events(TIME_DELAY); + returnStatus = tel_get_sound_volume_info(TAPI_SOUND_VOL_TYPE_ALL, &pRequestId); + + gmain_loop_for_tapi_events(TIME_DELAY); + printf ("The return value is %d\n", returnStatus); + printf ("The pRequestId value is %d\n",pRequestId); + + TET_CHECK(returnStatus == TAPI_API_SUCCESS); + if(returnStatus == TAPI_API_SUCCESS) + printf("utc_tel_get_sound_volume_info_002 pass\n"); +} + +/** + * @brief This tests + * @par ID: + * UTC_TEL_GET_SOUND_VOLUME_INFO_003 + * @param [in] vol_control_type + * @param [in] *pRequestId + * @code + * @endcode + * @param [out] vol_control_type + * @param [out] *pRequestId + * @return TapiResult_t +*/ + + +void utc_tel_get_sound_volume_info_003() +{ + TapiResult_t returnStatus = TAPI_API_SUCCESS; + int pRequestId = -1; + gmain_loop_for_tapi_events(TIME_DELAY); + returnStatus = tel_get_sound_volume_info(TAPI_SOUND_VOL_VOICE - 1, &pRequestId); + gmain_loop_for_tapi_events(TIME_DELAY); + printf ("The return value is %d\n", returnStatus); + printf ("The pRequestId value is %d\n",pRequestId); + + TET_CHECK(returnStatus == TAPI_API_INVALID_INPUT); + if(returnStatus == TAPI_API_INVALID_INPUT) + printf("utc_tel_get_sound_volume_info_003 pass\n"); +} + +/** + * @brief This tests + * @par ID: + * UTC_TEL_GET_SOUND_VOLUME_INFO_004 + * @param [in] vol_control_type + * @param [in] *pRequestId + * @code + * @endcode + * @param [out] vol_control_type + * @param [out] *pRequestId + * @return TapiResult_t +*/ +void utc_tel_get_sound_volume_info_004() +{ + TapiResult_t returnStatus = TAPI_API_SUCCESS; + int pRequestId = -1; + gmain_loop_for_tapi_events(TIME_DELAY); + returnStatus = tel_get_sound_volume_info(TAPI_SOUND_VOL_VOICE - 1, &pRequestId); + gmain_loop_for_tapi_events(TIME_DELAY); + printf ("The return value is %d\n", returnStatus); + printf ("The pRequestId value is %d\n",pRequestId); + + TET_CHECK(returnStatus == TAPI_API_INVALID_INPUT); + if(returnStatus == TAPI_API_INVALID_INPUT) + printf("utc_tel_get_sound_volume_info_004 pass\n"); +} + +/** + * @brief This tests + * @par ID: + * UTC_TEL_GET_SOUND_VOLUME_INFO_005 + * @param [in] vol_control_type + * @param [in] *pRequestId + * @code + * @endcode + * @param [out] vol_control_type + * @param [out] *pRequestId + * @return TapiResult_t +*/ +void utc_tel_get_sound_volume_info_005() +{ + TapiResult_t returnStatus = TAPI_API_SUCCESS; + int pRequestId = -1; + gmain_loop_for_tapi_events(TIME_DELAY); + returnStatus = tel_get_sound_volume_info(TAPI_SOUND_VOL_TYPE_ALL + 1, &pRequestId); + gmain_loop_for_tapi_events(TIME_DELAY); + printf ("The return value is %d\n", returnStatus); + printf ("The pRequestId value is %d\n",pRequestId); + + TET_CHECK(returnStatus == TAPI_API_INVALID_INPUT); + if(returnStatus == TAPI_API_INVALID_INPUT) + printf("utc_tel_get_sound_volume_info_005 pass\n"); +} + +/** + * @brief This tests + * @par ID: + * UTC_TEL_GET_SOUND_VOLUME_INFO_006 + * @param [in] vol_control_type + * @param [in] *pRequestId + * @code + * @endcode + * @param [out] vol_control_type + * @param [out] *pRequestId + * @return TapiResult_t +*/ +void utc_tel_get_sound_volume_info_006() +{ + TapiResult_t returnStatus = TAPI_API_SUCCESS; + int pRequestId = -1; + gmain_loop_for_tapi_events(TIME_DELAY); + returnStatus = tel_get_sound_volume_info(TAPI_SOUND_VOL_VOICE, NULL); + gmain_loop_for_tapi_events(TIME_DELAY); + printf ("The return value is %d\n", returnStatus); + printf ("The pRequestId value is %d\n",pRequestId); + + TET_CHECK(returnStatus == TAPI_API_INVALID_PTR); + if(returnStatus == TAPI_API_INVALID_PTR) + printf("utc_tel_get_sound_volume_info_006 pass\n"); +} + +/** @} */ diff --git a/TC/telephony_TC/sound/unit/uts_tel_get_sound_volume_info.h b/TC/telephony_TC/sound/unit/uts_tel_get_sound_volume_info.h new file mode 100644 index 0000000..ccbfea7 --- /dev/null +++ b/TC/telephony_TC/sound/unit/uts_tel_get_sound_volume_info.h @@ -0,0 +1,49 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * 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 "sound_callback_util.h" + +#ifndef _UTC_TAPI_GET_SOUND_VOLUME_INFO_ +#define _UTC_TAPI_GET_SOUND_VOLUME_INFO_ + + + +void utc_tel_get_sound_volume_info_000(); + + + +void utc_tel_get_sound_volume_info_001(); + + + +void utc_tel_get_sound_volume_info_002(); + + + +void utc_tel_get_sound_volume_info_003(); + +void utc_tel_get_sound_volume_info_004(); + +void utc_tel_get_sound_volume_info_005(); + +void utc_tel_get_sound_volume_info_006(); + + +#endif // _UTC_TAPI_GET_SOUND_VOLUME_INFO_ diff --git a/TC/telephony_TC/sound/unit/uts_tel_set_sound_clock.c b/TC/telephony_TC/sound/unit/uts_tel_set_sound_clock.c new file mode 100644 index 0000000..0ea84f8 --- /dev/null +++ b/TC/telephony_TC/sound/unit/uts_tel_set_sound_clock.c @@ -0,0 +1,238 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * 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 "uts_tel_set_sound_clock.h" + + +static void startup(); +static void cleanup(); +void (*tet_startup) () = startup; +void (*tet_cleanup) () = cleanup; + + +static TapiResult_t gStartupSuccess; + +/* Startup & Clean function : It is not test code, only for + initialize and finalize test module */ + +static void startup() +{ + tapi_dbus_connection_name dname; + int bStatus; + + gStartupSuccess = tel_init(); + if(gStartupSuccess != TAPI_API_SUCCESS) + { + printf("tel_init() Failed gStartupSuccess = %d \n",gStartupSuccess); + } + + register_all_events(); + + tel_register_app_name("org.samsung.test"); + if(tel_get_app_name(&dname)) + printf("Dbus Get app name error\n"); + else + printf("Dbus Name is %s\n",dname.name); + + tel_check_service_ready(&bStatus); + printf("Telephony service %d\n",bStatus); + +} + +static void cleanup() +{ + deregister_all(); + tel_deinit(); + return; + +} + + +struct tet_testlist tet_testlist[] = { + {utc_tel_set_sound_clock_000, 1}, + {utc_tel_set_sound_clock_001, 2}, + {utc_tel_set_sound_clock_002, 3}, + {utc_tel_set_sound_clock_003, 4}, + {NULL, 0} +}; + + + + + + +/** + * @brief This tests + * @par ID: + * UTC_TEL_SET_SOUND_CLOCK_000 + * @param [in] vc_clock + * @param [in] *pRequestId + * @code + * @endcode + * @param [out] vc_clock + * @param [out] *pRequestId + * @return TapiResult_t +*/ + + +void utc_tel_set_sound_clock_000() +{ + + TapiResult_t returnStatus = TAPI_API_SUCCESS; + int pRequestId = -1; + gmain_loop_for_tapi_events(TIME_DELAY); + returnStatus = tel_set_sound_clock(1, &pRequestId); + gmain_loop_for_tapi_events(TIME_DELAY); + + tet_printf ("The return value is %d\n", returnStatus); + tet_printf ("The pRequestId value is %d\n",pRequestId); + + + if(returnStatus == TAPI_API_SUCCESS) + { + tet_printf("utc_tel_set_sound_clock_000 pass\n"); + tet_result(TET_PASS); + } + else + { + tet_printf("utc_tel_set_sound_clock_000 has failed\n"); + tet_result(TET_FAIL); + } + +} + +/** + * @brief This tests + * @par ID: + * UTC_TEL_SET_SOUND_CLOCK_001 + * @param [in] vc_clock + * @param [in] *pRequestId + * @code + * @endcode + * @param [out] vc_clock + * @param [out] *pRequestId + * @return TapiResult_t +*/ + + +void utc_tel_set_sound_clock_001() +{ + + TapiResult_t returnStatus = TAPI_API_SUCCESS; + int pRequestId = -1; + gmain_loop_for_tapi_events(TIME_DELAY); + returnStatus = tel_set_sound_clock(0, &pRequestId); + gmain_loop_for_tapi_events(TIME_DELAY); + + tet_printf ("The return value is %d\n", returnStatus); + tet_printf ("The pRequestId value is %d\n",pRequestId); + + + if(returnStatus == TAPI_API_SUCCESS) + { + tet_printf("utc_tel_set_sound_clock_000 pass\n"); + tet_result(TET_PASS); + } + else + { + tet_printf("utc_tel_set_sound_clock_000 has failed\n"); + tet_result(TET_FAIL); + } + +} + + +/** + * @brief This tests + * @par ID: + * UTC_TEL_SET_SOUND_CLOCK_002 + * @param [in] vc_clock + * @param [in] *pRequestId + * @code + * @endcode + * @param [out] vc_clock + * @param [out] *pRequestId + * @return TapiResult_t +*/ +void utc_tel_set_sound_clock_002() +{ + + TapiResult_t returnStatus = TAPI_API_SUCCESS; + int pRequestId = -1; + gmain_loop_for_tapi_events(TIME_DELAY); + returnStatus = tel_set_sound_clock(0, NULL); + gmain_loop_for_tapi_events(TIME_DELAY); + + tet_printf ("The return value is %d\n", returnStatus); + tet_printf ("The pRequestId value is %d\n",pRequestId); + + + if(returnStatus == TAPI_API_INVALID_PTR) + { + tet_printf("utc_tel_set_sound_clock_003 pass\n"); + tet_result(TET_PASS); + } + else + { + tet_printf("utc_tel_set_sound_clock_003 has failed\n"); + tet_result(TET_FAIL); + } + +} +/** + * @brief This tests + * @par ID: + * UTC_TEL_SET_SOUND_CLOCK_003 + * @param [in] vc_clock + * @param [in] *pRequestId + * @code + * @endcode + * @param [out] vc_clock + * @param [out] *pRequestId + * @return TapiResult_t +*/ +void utc_tel_set_sound_clock_003() +{ + + TapiResult_t returnStatus = TAPI_API_SUCCESS; + int pRequestId = -1; + gmain_loop_for_tapi_events(TIME_DELAY); + returnStatus = tel_set_sound_clock(1, NULL); + gmain_loop_for_tapi_events(TIME_DELAY); + + tet_printf ("The return value is %d\n", returnStatus); + tet_printf ("The pRequestId value is %d\n",pRequestId); + + + if(returnStatus == TAPI_API_INVALID_PTR) + { + tet_printf("utc_tel_set_sound_clock_003 pass\n"); + tet_result(TET_PASS); + } + else + { + tet_printf("utc_tel_set_sound_clock_003 has failed\n"); + tet_result(TET_FAIL); + } + +} + + +/** @} */ diff --git a/TC/telephony_TC/sound/unit/uts_tel_set_sound_clock.h b/TC/telephony_TC/sound/unit/uts_tel_set_sound_clock.h new file mode 100644 index 0000000..eee8c6b --- /dev/null +++ b/TC/telephony_TC/sound/unit/uts_tel_set_sound_clock.h @@ -0,0 +1,49 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * 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 "sound_callback_util.h" + +#ifndef _UTC_TEL_SET_SOUND_CLOCK_ +#define _UTC_TEL_SET_SOUND_CLOCK_ + + + +void utc_tel_set_sound_clock_000(); + + + +void utc_tel_set_sound_clock_001(); + + + +void utc_tel_set_sound_clock_002(); + + + +void utc_tel_set_sound_clock_003(); + +void utc_tel_set_sound_clock_004(); + +void utc_tel_set_sound_clock_005(); + +void utc_tel_set_sound_clock_006(); + + +#endif // _UTC_TEL_SET_SOUND_CLOCK_ diff --git a/TC/telephony_TC/sound/unit/uts_tel_set_sound_loopback.c b/TC/telephony_TC/sound/unit/uts_tel_set_sound_loopback.c new file mode 100644 index 0000000..aa3db5b --- /dev/null +++ b/TC/telephony_TC/sound/unit/uts_tel_set_sound_loopback.c @@ -0,0 +1,359 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * 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 "uts_tel_set_sound_loopback.h" + + +static void startup(); +static void cleanup(); +void (*tet_startup) () = startup; +void (*tet_cleanup) () = cleanup; + + +static TapiResult_t gStartupSuccess; + +/* Startup & Clean function : It is not test code, only for + initialize and finalize test module */ + +static void startup() +{ + tapi_dbus_connection_name dname; + int bStatus; + + gStartupSuccess = tel_init(); + if(gStartupSuccess != TAPI_API_SUCCESS) + { + printf("tel_init() Failed gStartupSuccess = %d \n",gStartupSuccess); + } + + register_all_events(); + + tel_register_app_name("org.samsung.test"); + if(tel_get_app_name(&dname)) + printf("Dbus Get app name error\n"); + else + printf("Dbus Name is %s\n",dname.name); + + tel_check_service_ready(&bStatus); + printf("Telephony service %d\n",bStatus); + +} + +static void cleanup() +{ + deregister_all(); + tel_deinit(); + return; + +} + + +struct tet_testlist tet_testlist[] = { + {utc_tel_set_sound_loopback_000, 1}, + {utc_tel_set_sound_loopback_001, 2}, + {utc_tel_set_sound_loopback_002, 3}, + {utc_tel_set_sound_loopback_003, 4}, + {utc_tel_set_sound_loopback_004, 5}, + {utc_tel_set_sound_loopback_005, 6}, + {utc_tel_set_sound_loopback_006, 7}, + {NULL, 0} +}; + + + + + + +/** + * @brief This tests + * @par ID: + * UTC_TEL_SET_SOUND_LOOPBACK_000 + * @param [in] vc_loopback + * @param [in] *pRequestId + * @code + * @endcode + * @param [out] vc_loopback + * @param [out] *pRequestId + * @return TapiResult_t +*/ +void utc_tel_set_sound_loopback_000() +{ + + TapiResult_t returnStatus = TAPI_API_SUCCESS; + int pRequestId = -1; + TelAudioLoopbackMode_t Mode; + Mode.path = TAPI_SOUND_HANDSET; + Mode.status = TAPI_SOUND_AUDIO_LOOPBACK_OFF; + + returnStatus = tel_set_sound_loopback(Mode, &pRequestId); + gmain_loop_for_tapi_events(TIME_DELAY); + + tet_printf ("The return value is %d\n", returnStatus); + tet_printf ("The pRequestId value is %d\n",pRequestId); + + if(returnStatus == TAPI_API_SUCCESS) + { + tet_printf("utc_tel_set_sound_loopback_000 pass\n"); + tet_result(TET_PASS); + } + else + { + tet_printf("utc_tel_set_sound_loopback_000 has failed\n"); + tet_result(TET_FAIL); + } +} + + +/** + * @brief This tests + * @par ID: + * UTC_TEL_SET_SOUND_LOOPBACK_001 + * @param [in] vc_loopback + * @param [in] *pRequestId + * @code + * @endcode + * @param [out] vc_loopback + * @param [out] *pRequestId + * @return TapiResult_t +*/ +void utc_tel_set_sound_loopback_001() +{ + TapiResult_t returnStatus = TAPI_API_SUCCESS; + int pRequestId = -1; + TelAudioLoopbackMode_t Mode; + Mode.path = TAPI_SOUND_STEREO_BLUETOOTH; + Mode.status = TAPI_SOUND_AUDIO_LOOPBACK_OFF; + + returnStatus = tel_set_sound_loopback(Mode, &pRequestId); + gmain_loop_for_tapi_events(TIME_DELAY); + + tet_printf ("The return value is %d\n", returnStatus); + tet_printf ("The pRequestId value is %d\n",pRequestId); + + if(returnStatus == TAPI_API_SUCCESS) + { + tet_printf("utc_tel_set_sound_loopback_001 pass\n"); + tet_result(TET_PASS); + } + else + { + tet_printf("utc_tel_set_sound_loopback_001 has failed\n"); + tet_result(TET_FAIL); + } +} + + +/** + * @brief This tests + * @par ID: + * UTC_TEL_SET_SOUND_LOOPBACK_002 + * @param [in] vc_loopback + * @param [in] *pRequestId + * @code + * @endcode + * @param [out] vc_loopback + * @param [out] *pRequestId + * @return TapiResult_t +*/ +void utc_tel_set_sound_loopback_002() +{ + TapiResult_t returnStatus = TAPI_API_SUCCESS; + int pRequestId = -1; + TelAudioLoopbackMode_t Mode; + Mode.path = TAPI_SOUND_HEADSET_3_5PI; + Mode.status = TAPI_SOUND_AUDIO_LOOPBACK_OFF; + + returnStatus = tel_set_sound_loopback(Mode, &pRequestId); + gmain_loop_for_tapi_events(TIME_DELAY); + + tet_printf ("The return value is %d\n", returnStatus); + tet_printf ("The pRequestId value is %d\n",pRequestId); + + + if(returnStatus == TAPI_API_SUCCESS) + { + tet_printf("utc_tel_set_sound_loopback_002 pass\n"); + tet_result(TET_PASS); + } + else + { + tet_printf("utc_tel_set_sound_loopback_002 has failed\n"); + tet_result(TET_FAIL); + } +} + + +/** + * @brief This tests + * @par ID: + * UTC_TEL_SET_SOUND_LOOPBACK_003 + * @param [in] vc_loopback + * @param [in] *pRequestId + * @code + * @endcode + * @param [out] vc_loopback + * @param [out] *pRequestId + * @return TapiResult_t +*/ +void utc_tel_set_sound_loopback_003() +{ + TapiResult_t returnStatus = TAPI_API_SUCCESS; + int pRequestId = -1; + TelAudioLoopbackMode_t Mode; + Mode.path = TAPI_SOUND_HANDSET; + Mode.status = TAPI_SOUND_AUDIO_LOOPBACK_ON; + + returnStatus = tel_set_sound_loopback(Mode, &pRequestId); + gmain_loop_for_tapi_events(TIME_DELAY); + + tet_printf ("The return value is %d\n", returnStatus); + tet_printf ("The pRequestId value is %d\n",pRequestId); + + + if(returnStatus == TAPI_API_SUCCESS) + { + tet_printf("utc_tel_set_sound_loopback_003 pass\n"); + tet_result(TET_PASS); + } + else + { + tet_printf("utc_tel_set_sound_loopback_003 has failed\n"); + tet_result(TET_FAIL); + } +} + + +/** + * @brief This tests + * @par ID: + * UTC_TEL_SET_SOUND_LOOPBACK_004 + * @param [in] vc_loopback + * @param [in] *pRequestId + * @code + * @endcode + * @param [out] vc_loopback + * @param [out] *pRequestId + * @return TapiResult_t +*/ +void utc_tel_set_sound_loopback_004() +{ + TapiResult_t returnStatus = TAPI_API_SUCCESS; + int pRequestId = -1; + TelAudioLoopbackMode_t Mode; + Mode.path = TAPI_SOUND_STEREO_BLUETOOTH; + Mode.status = TAPI_SOUND_AUDIO_LOOPBACK_ON; + + returnStatus = tel_set_sound_loopback(Mode, &pRequestId); + gmain_loop_for_tapi_events(TIME_DELAY); + + tet_printf ("The return value is %d\n", returnStatus); + tet_printf ("The pRequestId value is %d\n",pRequestId); + + + if(returnStatus == TAPI_API_SUCCESS) + { + tet_printf("utc_tel_set_sound_loopback_004 pass\n"); + tet_result(TET_PASS); + } + else + { + tet_printf("utc_tel_set_sound_loopback_004 has failed\n"); + tet_result(TET_FAIL); + } +} + + +/** + * @brief This tests + * @par ID: + * UTC_TEL_SET_SOUND_LOOPBACK_005 + * @param [in] vc_loopback + * @param [in] *pRequestId + * @code + * @endcode + * @param [out] vc_loopback + * @param [out] *pRequestId + * @return TapiResult_t +*/ + +void utc_tel_set_sound_loopback_005() +{ + TapiResult_t returnStatus = TAPI_API_SUCCESS; + int pRequestId = -1; + TelAudioLoopbackMode_t Mode; + Mode.path = TAPI_SOUND_STEREO_BLUETOOTH; + Mode.status = TAPI_SOUND_AUDIO_LOOPBACK_MAX + 1; + + returnStatus = tel_set_sound_loopback(Mode, &pRequestId); + + tet_printf ("The return value is %d\n", returnStatus); + tet_printf ("The pRequestId value is %d\n",pRequestId); + + if(returnStatus == TAPI_API_INVALID_PTR) + { + tet_printf("utc_tel_set_sound_loopback_005 pass\n"); + tet_result(TET_PASS); + } + else + { + tet_printf("utc_tel_set_sound_loopback_005 has failed\n"); + tet_result(TET_FAIL); + } +} + + +/** + * @brief This tests + * @par ID: + * UTC_TEL_SET_SOUND_LOOPBACK_005 + * @param [in] vc_loopback + * @param [in] *pRequestId + * @code + * @endcode + * @param [out] vc_loopback + * @param [out] *pRequestId + * @return TapiResult_t +*/ +void utc_tel_set_sound_loopback_006() +{ + TapiResult_t returnStatus = TAPI_API_SUCCESS; + int pRequestId = -1; + TelAudioLoopbackMode_t Mode; + Mode.path = TAPI_SOUND_HEADSET_3_5PI + 1; + Mode.status = TAPI_SOUND_AUDIO_LOOPBACK_MAX + 1; + + returnStatus = tel_set_sound_loopback(Mode, &pRequestId); + + tet_printf ("The return value is %d\n", returnStatus); + tet_printf ("The pRequestId value is %d\n",pRequestId); + + if(returnStatus == TAPI_API_INVALID_PTR) + { + tet_printf("utc_tel_set_sound_loopback_006 pass\n"); + tet_result(TET_PASS); + } + else + { + tet_printf("utc_tel_set_sound_loopback_006 has failed\n"); + tet_result(TET_FAIL); + } +} + +/** @} */ diff --git a/TC/telephony_TC/sound/unit/uts_tel_set_sound_loopback.h b/TC/telephony_TC/sound/unit/uts_tel_set_sound_loopback.h new file mode 100644 index 0000000..689e3ad --- /dev/null +++ b/TC/telephony_TC/sound/unit/uts_tel_set_sound_loopback.h @@ -0,0 +1,50 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * 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 "sound_callback_util.h" +#include + +#ifndef _UTC_TEL_SET_SOUND_LOOPBACK_ +#define _UTC_TEL_SET_SOUND_LOOPBACK_ + + + +void utc_tel_set_sound_loopback_000(); + + + +void utc_tel_set_sound_loopback_001(); + + + +void utc_tel_set_sound_loopback_002(); + + + +void utc_tel_set_sound_loopback_003(); + +void utc_tel_set_sound_loopback_004(); + +void utc_tel_set_sound_loopback_005(); + +void utc_tel_set_sound_loopback_006(); + + +#endif // _UTC_TEL_SET_SOUND_LOOPBACK_ diff --git a/TC/telephony_TC/sound/unit/uts_tel_set_sound_mute_status.c b/TC/telephony_TC/sound/unit/uts_tel_set_sound_mute_status.c new file mode 100644 index 0000000..5304295 --- /dev/null +++ b/TC/telephony_TC/sound/unit/uts_tel_set_sound_mute_status.c @@ -0,0 +1,199 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * 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 "uts_tel_set_sound_mute_status.h" + + +static void startup(); +static void cleanup(); +void (*tet_startup) () = startup; +void (*tet_cleanup) () = cleanup; + + +static TapiResult_t gStartupSuccess; + +/* Startup & Clean function : It is not test code, only for + initialize and finalize test module */ + +static void startup() +{ + tapi_dbus_connection_name dname; + int bStatus; + + gStartupSuccess = tel_init(); + if(gStartupSuccess != TAPI_API_SUCCESS) + { + printf("tel_init() Failed gStartupSuccess = %d \n",gStartupSuccess); + } + register_all_events(); + tel_register_app_name("org.samsung.test"); + if(tel_get_app_name(&dname)) + printf("Dbus Get app name error\n"); + else + printf("Dbus Name is %s\n",dname.name); + + tel_check_service_ready(&bStatus); + printf("Telephony service %d\n",bStatus); + +} + +static void cleanup() +{ + deregister_all(); + tel_deinit(); + return; + +} + +struct tet_testlist tet_testlist[] = { + {utc_tel_set_sound_mute_status_000, 1}, + {utc_tel_set_sound_mute_status_001, 2}, + {utc_tel_set_sound_mute_status_002, 3}, + {utc_tel_set_sound_mute_status_003, 4}, + {NULL, 0} +}; + + +/** + * @brief This tests + * @par ID: + * utc_tel_set_sound_mute_status_000 + * @param [in] mic_mute + * @param [in] *pRequestId + * @code + * @endcode + * @param [out] snd_mask + * @param [out] snd_value + * @param [out] *pRequestId + * @return TapiResult_t +*/ + + +void utc_tel_set_sound_mute_status_000() +{ + + + TapiResult_t returnStatus = TAPI_API_SUCCESS; + int pRequestId = -1; + + returnStatus = tel_set_sound_mute_status(TAPI_SOUND_MIC_MUTE,&pRequestId); + gmain_loop_for_tapi_events(TIME_DELAY); + printf ("The return value is %d\n", returnStatus); + printf ("The pRequestId value is %d\n",pRequestId); + + TET_CHECK(returnStatus == TAPI_API_SUCCESS); + if(returnStatus == TAPI_API_SUCCESS) + printf("utc_tel_set_sound_mute_status_000 pass\n"); +} + + +/** + * @brief This tests + * @par ID: + * utc_tel_set_sound_mute_status_001 + * @param [in] mic_mute + * @param [in] *pRequestId + * @code + * @endcode + * @param [out] snd_mask + * @param [out] snd_value + * @param [out] *pRequestId + * @return TapiResult_t +*/ + + +void utc_tel_set_sound_mute_status_001() +{ + TapiResult_t returnStatus = TAPI_API_SUCCESS; + int pRequestId = -1; + + returnStatus = tel_set_sound_mute_status(TAPI_SOUND_MIC_UNMUTE,&pRequestId); + gmain_loop_for_tapi_events(TIME_DELAY); + printf ("The return value is %d\n", returnStatus); + printf ("The pRequestId value is %d\n",pRequestId); + + TET_CHECK(returnStatus == TAPI_API_SUCCESS); + if(returnStatus == TAPI_API_SUCCESS) + printf("utc_tel_set_sound_mute_status_001 pass\n"); +} + + +/** + * @brief This tests + * @par ID: + * utc_tel_set_sound_mute_status_002 + * @param [in] mic_mute + * @param [in] *pRequestId + * @code + * @endcode + * @param [out] snd_mask + * @param [out] snd_value + * @param [out] *pRequestId + * @return TapiResult_t +*/ +void utc_tel_set_sound_mute_status_002() +{ + + TapiResult_t returnStatus = TAPI_API_SUCCESS; + int pRequestId = -1; + + returnStatus = tel_set_sound_mute_status(TAPI_SOUND_MIC_MUTE + 1,&pRequestId); + + printf ("The return value is %d\n", returnStatus); + printf ("The pRequestId value is %d\n",pRequestId); + + TET_CHECK(returnStatus == TAPI_API_INVALID_INPUT); + if(returnStatus == TAPI_API_INVALID_INPUT) + printf("utc_tel_set_sound_mute_status_002 pass\n"); + +} + + +/** + * @brief This tests + * @par ID: + * utc_tel_set_sound_mute_status_003 + * @param [in] mic_mute + * @param [in] *pRequestId + * @code + * @endcode + * @param [out] snd_mask + * @param [out] snd_value + * @param [out] *pRequestId + * @return TapiResult_t +*/ +void utc_tel_set_sound_mute_status_003() +{ + TapiResult_t returnStatus = TAPI_API_SUCCESS; + int pRequestId = -1; + + returnStatus = tel_set_sound_mute_status(TAPI_SOUND_MIC_UNMUTE - 1,&pRequestId); + + printf ("The return value is %d\n", returnStatus); + printf ("The pRequestId value is %d\n",pRequestId); + + TET_CHECK(returnStatus == TAPI_API_INVALID_INPUT); + if(returnStatus == TAPI_API_INVALID_INPUT) + printf("utc_tel_set_sound_mute_status_003 pass\n"); + +} + +/** @} */ diff --git a/TC/telephony_TC/sound/unit/uts_tel_set_sound_mute_status.h b/TC/telephony_TC/sound/unit/uts_tel_set_sound_mute_status.h new file mode 100644 index 0000000..85822de --- /dev/null +++ b/TC/telephony_TC/sound/unit/uts_tel_set_sound_mute_status.h @@ -0,0 +1,45 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * 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 "sound_callback_util.h" + +#ifndef _UTC_TEL_SET_SOUND_MUTE_STATUS_ +#define _UTC_TEL_SET_SOUND_MUTE_STATUS_ + + + +void utc_tel_set_sound_mute_status_000(); + + + +void utc_tel_set_sound_mute_status_001(); + + + +void utc_tel_set_sound_mute_status_002(); + + + +void utc_tel_set_sound_mute_status_003(); + + + +#endif // _UTC_TEL_SET_SOUND_MUTE_STATUS_ + diff --git a/TC/telephony_TC/sound/unit/uts_tel_set_sound_path.c b/TC/telephony_TC/sound/unit/uts_tel_set_sound_path.c new file mode 100644 index 0000000..800bb23 --- /dev/null +++ b/TC/telephony_TC/sound/unit/uts_tel_set_sound_path.c @@ -0,0 +1,256 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * 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 "uts_tel_set_sound_path.h" + + +static void startup(); +static void cleanup(); +void (*tet_startup) () = startup; +void (*tet_cleanup) () = cleanup; + + +static TapiResult_t gStartupSuccess; + +/* Startup & Clean function : It is not test code, only for + initialize and finalize test module */ + +static void startup() +{ + tapi_dbus_connection_name dname; + int bStatus; + + gStartupSuccess = tel_init(); + if(gStartupSuccess != TAPI_API_SUCCESS) + { + printf("tel_init() Failed gStartupSuccess = %d \n",gStartupSuccess); + } + + register_all_events(); + + tel_register_app_name("org.samsung.test"); + if(tel_get_app_name(&dname)) + printf("Dbus Get app name error\n"); + else + printf("Dbus Name is %s\n",dname.name); + + tel_check_service_ready(&bStatus); + printf("Telephony service %d\n",bStatus); + +} + +static void cleanup() +{ + deregister_all(); + tel_deinit(); + return; + +} + + +struct tet_testlist tet_testlist[] = { + {utc_tel_set_sound_path_000, 1}, + {utc_tel_set_sound_path_001, 2}, + {utc_tel_set_sound_path_002, 3}, + {utc_tel_set_sound_path_003, 4}, + {utc_tel_set_sound_path_004, 5}, + {utc_tel_set_sound_path_005, 6}, + {NULL, 0} +}; + + + + + + +/** + * @brief This tests + * @par ID: + * UTC_TEL_SET_SOUND_PATH_000 + * @param [in] vc_path + * @param [in] *pRequestId + * @code + * @endcode + * @param [out] vc_path + * @param [out] *pRequestId + * @return TapiResult_t +*/ + + +void utc_tel_set_sound_path_000() +{ + + TapiResult_t returnStatus = TAPI_API_SUCCESS; + int pRequestId = -1; + + returnStatus = tel_set_sound_path(TAPI_SOUND_HANDSET, &pRequestId); + gmain_loop_for_tapi_events(TIME_DELAY); + + printf ("The return value is %d\n", returnStatus); + printf ("The pRequestId value is %d\n",pRequestId); + + TET_CHECK(returnStatus == TAPI_API_SUCCESS); + if(returnStatus == TAPI_API_SUCCESS) + printf("utc_tel_set_sound_path_000 pass\n"); +} + +/** + * @brief This tests + * @par ID: + * UTC_TEL_SET_SOUND_PATH_001 + * @param [in] vc_path + * @param [in] *pRequestId + * @code + * @endcode + * @param [out] vc_path + * @param [out] *pRequestId + * @return TapiResult_t +*/ + + +void utc_tel_set_sound_path_001() +{ + TapiResult_t returnStatus = TAPI_API_SUCCESS; + int pRequestId = -1; + + returnStatus = tel_set_sound_path(TAPI_SOUND_STEREO_BLUETOOTH, &pRequestId); + gmain_loop_for_tapi_events(TIME_DELAY); + + printf ("The return value is %d\n", returnStatus); + printf ("The pRequestId value is %d\n",pRequestId); + + TET_CHECK(returnStatus == TAPI_API_SUCCESS); + if(returnStatus == TAPI_API_SUCCESS) + printf("utc_tel_set_sound_path_001 pass\n"); +} + +/** + * @brief This tests + * @par ID: + * UTC_TEL_SET_SOUND_PATH_002 + * @param [in] vc_path + * @param [in] *pRequestId + * @code + * @endcode + * @param [out] vc_path + * @param [out] *pRequestId + * @return TapiResult_t +*/ + +void utc_tel_set_sound_path_002() +{ + TapiResult_t returnStatus = TAPI_API_SUCCESS; + int pRequestId = -1; + + returnStatus = tel_set_sound_path(TAPI_SOUND_HEADSET_3_5PI, &pRequestId); + gmain_loop_for_tapi_events(TIME_DELAY); + + printf ("The return value is %d\n", returnStatus); + printf ("The pRequestId value is %d\n",pRequestId); + + TET_CHECK(returnStatus == TAPI_API_SUCCESS); + if(returnStatus == TAPI_API_SUCCESS) + printf("utc_tel_set_sound_path_002 pass\n"); +} + +/** + * @brief This tests + * @par ID: + * UTC_TEL_SET_SOUND_PATH_003 + * @param [in] vc_path + * @param [in] *pRequestId + * @code + * @endcode + * @param [out] vc_path + * @param [out] *pRequestId + * @return TapiResult_t +*/ +void utc_tel_set_sound_path_003() +{ + TapiResult_t returnStatus = TAPI_API_SUCCESS; + int pRequestId = -1; + + returnStatus = tel_set_sound_path(TAPI_SOUND_HANDSET-1, &pRequestId); + + printf ("The return value is %d\n", returnStatus); + printf ("The pRequestId value is %d\n",pRequestId); + + TET_CHECK(returnStatus == TAPI_API_INVALID_INPUT); + if(returnStatus == TAPI_API_INVALID_INPUT) + printf("utc_tel_set_sound_path_003 pass\n"); +} + +/** + * @brief This tests + * @par ID: + * UTC_TEL_SET_SOUND_PATH_004 + * @param [in] vc_path + * @param [in] *pRequestId + * @code + * @endcode + * @param [out] vc_path + * @param [out] *pRequestId + * @return TapiResult_t +*/ +void utc_tel_set_sound_path_004() +{ + TapiResult_t returnStatus = TAPI_API_SUCCESS; + int pRequestId = -1; + + returnStatus = tel_set_sound_path(TAPI_SOUND_HEADSET_3_5PI +1, &pRequestId); + + printf ("The return value is %d\n", returnStatus); + printf ("The pRequestId value is %d\n",pRequestId); + + TET_CHECK(returnStatus == TAPI_API_INVALID_INPUT); + if(returnStatus == TAPI_API_INVALID_INPUT) + printf("utc_tel_set_sound_path_004 pass\n"); +} + +/** + * @brief This tests + * @par ID: + * UTC_TEL_SET_SOUND_PATH_005 + * @param [in] vc_path + * @param [in] *pRequestId + * @code + * @endcode + * @param [out] vc_path + * @param [out] *pRequestId + * @return TapiResult_t +*/ + +void utc_tel_set_sound_path_005() +{ + TapiResult_t returnStatus = TAPI_API_SUCCESS; + int pRequestId = -1; + + returnStatus = tel_set_sound_path(TAPI_SOUND_HANDSET , NULL); + + printf ("The return value is %d\n", returnStatus); + printf ("The pRequestId value is %d\n",pRequestId); + + TET_CHECK(returnStatus == TAPI_API_INVALID_PTR); + if(returnStatus == TAPI_API_INVALID_PTR) + printf("utc_tel_set_sound_path_005 pass\n"); +} + + +/** @} */ diff --git a/TC/telephony_TC/sound/unit/uts_tel_set_sound_path.h b/TC/telephony_TC/sound/unit/uts_tel_set_sound_path.h new file mode 100644 index 0000000..b03cb5f --- /dev/null +++ b/TC/telephony_TC/sound/unit/uts_tel_set_sound_path.h @@ -0,0 +1,47 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * 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 "sound_callback_util.h" + +#ifndef _UTC_TEL_SET_SOUND_PATH_ +#define _UTC_TEL_SET_SOUND_PATH_ + + + +void utc_tel_set_sound_path_000(); + + + +void utc_tel_set_sound_path_001(); + + + +void utc_tel_set_sound_path_002(); + + + +void utc_tel_set_sound_path_003(); + +void utc_tel_set_sound_path_004(); + +void utc_tel_set_sound_path_005(); + + +#endif // _UTC_TEL_SET_SOUND_PATH_ diff --git a/TC/telephony_TC/sound/unit/uts_tel_set_sound_volume_info.c b/TC/telephony_TC/sound/unit/uts_tel_set_sound_volume_info.c new file mode 100644 index 0000000..c64d5eb --- /dev/null +++ b/TC/telephony_TC/sound/unit/uts_tel_set_sound_volume_info.c @@ -0,0 +1,316 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * 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 "uts_tel_set_sound_volume_info.h" + +static void startup(); +static void cleanup(); +void (*tet_startup) () = startup; +void (*tet_cleanup) () = cleanup; + + +static TapiResult_t gStartupSuccess; + +/* Startup & Clean function : It is not test code, only for + initialize and finalize test module */ + +static void startup() +{ + tapi_dbus_connection_name dname; + int bStatus; + + gStartupSuccess = tel_init(); + if(gStartupSuccess != TAPI_API_SUCCESS) + { + printf("tel_init() Failed gStartupSuccess = %d \n",gStartupSuccess); + } + + register_all_events(); + + tel_register_app_name("org.samsung.test"); + if(tel_get_app_name(&dname)) + printf("Dbus Get app name error\n"); + else + printf("Dbus Name is %s\n",dname.name); + + tel_check_service_ready(&bStatus); + printf("Telephony service %d\n",bStatus); + +} + +static void cleanup() +{ + deregister_all(); + tel_deinit(); + return; + +} + + +struct tet_testlist tet_testlist[] = { + {utc_tel_set_sound_volume_info_000, 1}, + {utc_tel_set_sound_volume_info_001, 2}, + {utc_tel_set_sound_volume_info_002, 3}, + {utc_tel_set_sound_volume_info_003, 4}, + {utc_tel_set_sound_volume_info_004, 5}, + {utc_tel_set_sound_volume_info_005, 6}, + {utc_tel_set_sound_volume_info_006, 7}, + {NULL, 0} +}; + + + +/** + * @brief This tests sound volume control api valid case + * @par ID: + * TEL_SET_SOUND_VOLUME_INFO_000 + * @param [in] vol_control + * @param [in] *pRequestId + * @code + * @endcode + * @param [out] vol_control + * @param [out] *pRequestId + * @return TapiResult_t +*/ + + +void utc_tel_set_sound_volume_info_000() +{ + + TapiResult_t returnStatus = TAPI_API_SUCCESS; + tapi_sound_volume_control_t vol_control; + vol_control.volume = TAPI_SOUND_MUTE; + vol_control.vol_type = TAPI_SOUND_VOL_VOICE; + + int pRequestId = -1; + + returnStatus = tel_set_sound_volume_info(vol_control, &pRequestId); + gmain_loop_for_tapi_events(TIME_DELAY); + + printf ("The return value is %d\n", returnStatus); + printf ("The pRequestId value is %d\n",pRequestId); + + TET_CHECK(returnStatus == TAPI_API_SUCCESS); + if(returnStatus == TAPI_API_SUCCESS) + printf("utc_tel_set_sound_volume_info_000 pass\n"); + +} + +/** + * @brief This tests + * @par ID: + * TEL_SET_SOUND_VOLUME_INFO_001 + * @param [in] vol_control + * @param [in] *pRequestId + * @code + * @endcode + * @param [out] vol_control + * @param [out] *pRequestId + * @return TapiResult_t +*/ + + +void utc_tel_set_sound_volume_info_001() +{ + + + TapiResult_t returnStatus = TAPI_API_SUCCESS; + tapi_sound_volume_control_t vol_control; + vol_control.volume = TAPI_SOUND_VOLUME_LEVEL_6; + vol_control.vol_type = TAPI_SOUND_VOL_HFK_KEYTONE; + + int pRequestId = -1; + + returnStatus = tel_set_sound_volume_info(vol_control, &pRequestId); + gmain_loop_for_tapi_events(TIME_DELAY); + + printf ("The return value is %d\n", returnStatus); + printf ("The pRequestId value is %d\n",pRequestId); + + TET_CHECK(returnStatus == TAPI_API_SUCCESS); + if(returnStatus == TAPI_API_SUCCESS) + printf("utc_tel_set_sound_volume_info_001 pass\n"); +} + +/** + * @brief This tests + * @par ID: + * TEL_SET_SOUND_VOLUME_INFO_002 + * @param [in] vol_control + * @param [in] *pRequestId + * @code + * @endcode + * @param [out] vol_control + * @param [out] *pRequestId + * @return TapiResult_t +*/ + + +void utc_tel_set_sound_volume_info_002() +{ + TapiResult_t returnStatus = TAPI_API_SUCCESS; + tapi_sound_volume_control_t vol_control; + vol_control.volume = TAPI_SOUND_VOLUME_LEVEL_8; + vol_control.vol_type = TAPI_SOUND_VOL_TYPE_ALL; + + int pRequestId = -1; + + returnStatus = tel_set_sound_volume_info(vol_control, &pRequestId); + gmain_loop_for_tapi_events(TIME_DELAY); + + printf ("The return value is %d\n", returnStatus); + printf ("The pRequestId value is %d\n",pRequestId); + + TET_CHECK(returnStatus == TAPI_API_SUCCESS); + if(returnStatus == TAPI_API_SUCCESS) + printf("utc_tel_set_sound_volume_info_002 pass\n"); + +} + +/** + * @brief This tests + * @par ID: + * TEL_SET_SOUND_VOLUME_INFO_003 + * @param [in] vol_control + * @param [in] *pRequestId + * @code + * @endcode + * @param [out] vol_control + * @param [out] *pRequestId + * @return TapiResult_t +*/ +void utc_tel_set_sound_volume_info_003() +{ + TapiResult_t returnStatus = TAPI_API_SUCCESS; + tapi_sound_volume_control_t vol_control; + vol_control.volume = TAPI_SOUND_MUTE - 1; + vol_control.vol_type = TAPI_SOUND_VOL_TYPE_ALL; + + int pRequestId = -1; + + returnStatus = tel_set_sound_volume_info(vol_control, &pRequestId); + + printf ("The return value is %d\n", returnStatus); + printf ("The pRequestId value is %d\n",pRequestId); + + TET_CHECK(returnStatus == TAPI_API_INVALID_INPUT); + if(returnStatus == TAPI_API_INVALID_INPUT) + printf("utc_tel_set_sound_volume_info_003 pass\n"); +} +/** + * @brief This tests + * @par ID: + * TEL_SET_SOUND_VOLUME_INFO_004 + * @param [in] vol_control + * @param [in] *pRequestId + * @code + * @endcode + * @param [out] vol_control + * @param [out] *pRequestId + * @return TapiResult_t +*/ +void utc_tel_set_sound_volume_info_004() +{ + TapiResult_t returnStatus = TAPI_API_SUCCESS; + tapi_sound_volume_control_t vol_control; + vol_control.volume = TAPI_SOUND_MUTE; + vol_control.vol_type = TAPI_SOUND_VOL_TYPE_ALL + 1; + + int pRequestId = -1; + + returnStatus = tel_set_sound_volume_info(vol_control, &pRequestId); + + printf ("The return value is %d\n", returnStatus); + printf ("The pRequestId value is %d\n",pRequestId); + + TET_CHECK(returnStatus == TAPI_API_INVALID_INPUT); + if(returnStatus == TAPI_API_INVALID_INPUT) + printf("utc_tel_set_sound_volume_info_004 pass\n"); +} + + +/** + * @brief This tests + * @par ID: + * TEL_SET_SOUND_VOLUME_INFO_005 + * @param [in] vol_control + * @param [in] *pRequestId + * @code + * @endcode + * @param [out] vol_control + * @param [out] *pRequestId + * @return TapiResult_t +*/ + + +void utc_tel_set_sound_volume_info_005() +{ + TapiResult_t returnStatus = TAPI_API_SUCCESS; + tapi_sound_volume_control_t vol_control; + vol_control.volume = TAPI_SOUND_VOLUME_LEVEL_8 + 1 ; + vol_control.vol_type = TAPI_SOUND_VOL_VOICE - 1; + + int pRequestId = -1; + + returnStatus = tel_set_sound_volume_info(vol_control, &pRequestId); + + printf ("The return value is %d\n", returnStatus); + printf ("The pRequestId value is %d\n",pRequestId); + + TET_CHECK(returnStatus == TAPI_API_INVALID_INPUT); + if(returnStatus == TAPI_API_INVALID_INPUT) + printf("utc_tel_set_sound_volume_info_005 pass\n"); +} + +/** + * @brief This tests + * @par ID: + * TEL_SET_SOUND_VOLUME_INFO_006 + * @param [in] vol_control + * @param [in] *pRequestId + * @code + * @endcode + * @param [out] vol_control + * @param [out] *pRequestId + * @return TapiResult_t +*/ + + +void utc_tel_set_sound_volume_info_006() +{ + TapiResult_t returnStatus = TAPI_API_SUCCESS; + tapi_sound_volume_control_t vol_control; + vol_control.volume = TAPI_SOUND_VOLUME_LEVEL_8 + 1 ; + vol_control.vol_type = TAPI_SOUND_VOL_VOICE - 1; + + int pRequestId = -1; + + returnStatus = tel_set_sound_volume_info(vol_control, NULL); + + printf ("The return value is %d\n", returnStatus); + printf ("The pRequestId value is %d\n",pRequestId); + + TET_CHECK(returnStatus == TAPI_API_INVALID_PTR); + if(returnStatus == TAPI_API_INVALID_PTR) + printf("utc_tel_set_sound_volume_info_006 pass\n"); +} + + +/** @} */ diff --git a/TC/telephony_TC/sound/unit/uts_tel_set_sound_volume_info.h b/TC/telephony_TC/sound/unit/uts_tel_set_sound_volume_info.h new file mode 100644 index 0000000..ceda084 --- /dev/null +++ b/TC/telephony_TC/sound/unit/uts_tel_set_sound_volume_info.h @@ -0,0 +1,50 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * 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 "sound_callback_util.h" + +#ifndef _UTC_TEL_SET_SOUND_VOLUME_INFO_ +#define _UTC_TEL_SET_SOUND_VOLUME_INFO_ + + + +void utc_tel_set_sound_volume_info_000(); + + + +void utc_tel_set_sound_volume_info_001(); + + + +void utc_tel_set_sound_volume_info_002(); + + + +void utc_tel_set_sound_volume_info_003(); + +void utc_tel_set_sound_volume_info_004(); + +void utc_tel_set_sound_volume_info_005(); + +void utc_tel_set_sound_volume_info_006(); + + + +#endif // _UTC_TEL_SET_SOUND_VOLUME_INFO_ diff --git a/TC/telephony_TC/ss/README b/TC/telephony_TC/ss/README new file mode 100644 index 0000000..6aebe55 --- /dev/null +++ b/TC/telephony_TC/ss/README @@ -0,0 +1,59 @@ +================================================================================= +* README * +================================================================================= + +1. The SS Test Script directory (TestCases) includes: + + telephony-framework/ss + |-- README ; This file + `-- Unit ; contains Unit TCs + |-- makefile + |-- tslist + `-- Unit test case source codes + + +2. The $(TEST_ROOT) directory must includes following files: + + /$(TEST_ROOT) + |-- tet_scen + |-- tetbuild.cfg + |-- tetclean.cfg + |-- tetexec.cfg + `-- ...(elipsis) + +================================================================================= +* Preconditions * +--------------------------------------------------------------------------------- +| Before Testing SMS Module, you should check the following conditions | +================================================================================= + +1. Prepare a vaild SIM card. + +2. One target for the execution of testcases. + +4. Modify the mobile number + - ss_common.h + - Followings are the macro for mobile number customized as per the country. + - Barring password should be valid. Otherwise, it cause blocking of all barring features. + + #define BARRING_PWD "4291" + #define FWD_NUM "01030018654" + #define OLD_PWD "4291" + #define NEW_PWD "4291" + +================================================================================= +* Change log * +================================================================================= +1. 18-Dec-2008 + - Initial draft. + +2. 6-Oct-2010 + - Revised + +================================================================================= +* NOTE * +================================================================================= +1. In order to ensure successful working of the Test Scripts, please ensure that all of the IPKG files are installed normally. +2. Testing SS Module can be executed under target system environment (not simulator). + + diff --git a/TC/telephony_TC/ss/ss_common.h b/TC/telephony_TC/ss/ss_common.h new file mode 100644 index 0000000..de82b66 --- /dev/null +++ b/TC/telephony_TC/ss/ss_common.h @@ -0,0 +1,32 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * 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. + */ + + +/********************************************** + * Caution + * If you use invalid barring password, + * it can block all barring feature + * ********************************************/ + +#define BARRING_PWD "4291" +#define FWD_NUM "01030018654" +#define OLD_PWD "4291" +#define NEW_PWD "4291" + diff --git a/TC/telephony_TC/ss/unit/makefile b/TC/telephony_TC/ss/unit/makefile new file mode 100644 index 0000000..e3711d5 --- /dev/null +++ b/TC/telephony_TC/ss/unit/makefile @@ -0,0 +1,81 @@ +CC=gcc -Wall + +LB1 = tet_tapi_util +TS1 = uts_tel_change_ss_barring_password +TS2 = uts_tel_get_ss_aoc_info +TS3 = uts_tel_get_ss_barring_status +TS4 = uts_tel_get_ss_cli_status +TS5 = uts_tel_get_ss_forward_status +TS6 = uts_tel_get_ss_waiting_status +TS7 = uts_tel_send_ss_ussd_cancel +TS8 = uts_tel_send_ss_ussd_request +TS9 = uts_tel_send_ss_ussd_response +TS10 = uts_tel_set_ss_barring +TS11 = uts_tel_set_ss_forward +#TS12 = uts_tapi_ussd_send_rsp +TS12 = uts_tel_set_ss_aoc_info +TS13 = uts_tel_set_ss_waiting + +LIBS =$(LB1).o +LIBS +=`pkg-config --libs gconf-2.0 glib-2.0 dbus-1 dbus-glib-1 gthread-2.0 tapi` +LIBS +=$(TET_ROOT)/lib/tet3/tcm.o +LIBS +=-L$(TET_ROOT)/lib/tet3 -lapi + +INCS = -I. `pkg-config --cflags gconf-2.0 glib-2.0 dbus-1 dbus-glib-1 gthread-2.0 tapi` +INCS += -I$(TET_ROOT)/inc/tet3 +INCS += -I../ + +CFLAGS += $(INCS) -D__arm__ -D_ARM_TOUCH -DTELEPHONY_TIMER +CC +=$(CFLAGS) +LDFLAGS = $(LIBS) + +#ifeq ($(ARCH),target) +#CC += -g -mabi=aapcs-linux +#endif + +all : $(LB1) $(TS1) $(TS2) $(TS3) $(TS4) $(TS5) $(TS6) $(TS7) $(TS8) $(TS9) $(TS10) $(TS11) $(TS12) $(TS13) + +clean : + rm -rf *~ *.o tet_lock tet_captured $(LB1) $(TS1) $(TS2) $(TS3) $(TS4) $(TS5) $(TS6) $(TS7) $(TS8) $(TS9) $(TS10) $(TS11) $(TS12) $(TS13) + +$(LB1): $(LB1).c + $(CC) -c $(LB1).c + +$(TS1): $(TS1).c $(LB1) + $(CC) -o $(TS1) $(TS1).c $(LDFLAGS) + +$(TS2): $(TS2).c $(LB1) + $(CC) -o $(TS2) $(TS2).c $(LDFLAGS) + +$(TS3): $(TS3).c $(LB1) + $(CC) -o $(TS3) $(TS3).c $(LDFLAGS) + +$(TS4): $(TS4).c $(LB1) + $(CC) -o $(TS4) $(TS4).c $(LDFLAGS) + +$(TS5): $(TS5).c $(LB1) + $(CC) -o $(TS5) $(TS5).c $(LDFLAGS) + +$(TS6): $(TS6).c $(LB1) + $(CC) -o $(TS6) $(TS6).c $(LDFLAGS) + +$(TS7): $(TS7).c $(LB1) + $(CC) -o $(TS7) $(TS7).c $(LDFLAGS) + +$(TS8): $(TS8).c $(LB1) + $(CC) -o $(TS8) $(TS8).c $(LDFLAGS) + +$(TS9): $(TS9).c $(LB1) + $(CC) -o $(TS9) $(TS9).c $(LDFLAGS) + +$(TS10): $(TS10).c $(LB1) + $(CC) -o $(TS10) $(TS10).c $(LDFLAGS) + +$(TS11): $(TS11).c $(LB1) + $(CC) -o $(TS11) $(TS11).c $(LDFLAGS) + +$(TS12): $(TS12).c $(LB1) + $(CC) -o $(TS12) $(TS12).c $(LDFLAGS) + +$(TS13): $(TS13).c $(LB1) + $(CC) -o $(TS13) $(TS13).c $(LDFLAGS) diff --git a/TC/telephony_TC/ss/unit/tet_tapi_util.c b/TC/telephony_TC/ss/unit/tet_tapi_util.c new file mode 100644 index 0000000..5d973e5 --- /dev/null +++ b/TC/telephony_TC/ss/unit/tet_tapi_util.c @@ -0,0 +1,439 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * 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 "tet_tapi_util.h" +#include "glib.h" + +GMainLoop *nw_context_loop = NULL; + +void G_MAIN_LOOP_CLOSE() +{ + g_main_loop_quit(nw_context_loop); +} + +gboolean g_timeout_callback(void * data) +{ + G_MAIN_LOOP_CLOSE(); + return FALSE; +} + +int G_MAIN_LOOP_RUN(int sec) +{ + nw_context_loop = g_main_loop_new(NULL, FALSE); + g_timeout_add_seconds(sec, g_timeout_callback, NULL); + g_main_loop_run(nw_context_loop); + + return 0; +} +#if 0 +#define TAPI_EVENT_CLASS_MAX TAPI_EVENT_CLASS_SAT+2 + + +TAPI_EventClass_String g_TAPI_event_class_string[TAPI_EVENT_CLASS_MAX] = { /* Tapi Call Related Event Types */ + {TAPI_EVENT_NONE,"TAPI_EVENT_NONE"}, /**< Event None */ + {TAPI_EVENT_CLASS_CALL_VOICE, "TAPI_EVENT_CLASS_CALL_VOICE"}, /**< Voice Call Event Class */ + {TAPI_EVENT_CLASS_CALL_DATA,"TAPI_EVENT_CLASS_CALL_DATA"}, /**< Data Call Event Class */ + {TAPI_EVENT_CLASS_NETTEXT,"TAPI_EVENT_CLASS_NETTEXT"}, /**< Nettext (SMS/CB) Event Class */ + {TAPI_EVENT_CLASS_NETWORK,"TAPI_EVENT_CLASS_NETWORK"}, /**< Network Event Class */ + {TAPI_EVENT_CLASS_SS,"TAPI_EVENT_CLASS_SS"}, /**< SS Event Class */ + {TAPI_EVENT_CLASS_SIM,"TAPI_EVENT_CLASS_SIM"}, /**< SIM Event Class */ +// {TAPI_EVENT_CLASS_ERR,"TAPI_EVENT_CLASS_ERR"}, /**< Fatal error Event Class */ +// {TAPI_EVENT_CLASS_UTIL,"TAPI_EVENT_CLASS_UTIL"}, /**< Utility Events Class */ +// {TAPI_EVENT_CLASS_POWER,"TAPI_EVENT_CLASS_POWER"}, /**< POWEREvents Class */ +// {TAPI_EVENT_CLASS_DISPLAY,"TAPI_EVENT_CLASS_DISPLAY"}, /**< DISPLAY Events Class */ +// {TAPI_EVENT_CLASS_MISC,"TAPI_EVENT_CLASS_MISC"}, /**< MISC Events Class */ + {TAPI_EVENT_CLASS_DATA,"TAPI_EVENT_CLASS_DATA"}, /**< DATA Events Class */ + {TAPI_EVENT_CLASS_SOUND,"TAPI_EVENT_CLASS_SOUND"}, /**< SOUND Events Class */ + {TAPI_EVENT_CLASS_SAT,"TAPI_EVENT_CLASS_SAT"}, /**< SAT Events Class */ +// {TAPI_EVENT_CLASS_GPS,"TAPI_EVENT_CLASS_GPS"}, /**EventClass; + eventType= Event->EventType; + + int expected_event = (int)data; + + if(expected_event == data){ + printf("expected event=%d, received=%d\n", expected_event, eventType); + G_MAIN_LOOP_CLOSE(); + } + + return; +} diff --git a/TC/telephony_TC/ss/unit/tet_tapi_util.h b/TC/telephony_TC/ss/unit/tet_tapi_util.h new file mode 100644 index 0000000..7e406b4 --- /dev/null +++ b/TC/telephony_TC/ss/unit/tet_tapi_util.h @@ -0,0 +1,250 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * 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 _TET_TAPI_UTIL_ +#define _TET_TAPI_UTIL_ + +//#include +#include "TapiCommon.h" + +extern void G_MAIN_LOOP_CLOSE(); +extern int G_MAIN_LOOP_RUN(int); +extern void ss_utc_callback(TelTapiEvent_t *, void *data); +extern const char* TET_RESULT_TO_STRING(TapiResult_t err_code); + +typedef enum{ + SS_NO_RESPONSE, + SS_OK, + SS_FAIL +} SsAsyncResponse_t; + +#ifndef BOOL + typedef int BOOL; +#endif + +#ifndef TRUE +#define TRUE 1 +#endif + +#ifndef FALSE +#define FALSE 0 +#endif + +// TET_Error Code string return macro +typedef struct { + TapiResult_t err; + char * string; +}TAPI_Error_String; + +// TET_Event Code string return macro +typedef struct { + int event_class; + char * string; +}TAPI_EventClass_String; + + +// TET_Event Code string return macro +typedef struct { + int event; + char * string; +}TAPI_Event_String; + + +///////////////////////////////////////////////////////////////////////// +// TETware Utility Function +///////////////////////////////////////////////////////////////////////// + + +// TET_STAMP ****************************************************************************** +#define TET_STAMP_START(log) \ +do {\ + tet_printf("\n###########################################\n## %s \n## %s ", __FUNCTION__,log);\ +} while(0) + +#define TET_STAMP_PASS() \ +do {\ + tet_printf("%s : pass",__FUNCTION__);\ + tet_result(TET_PASS);\ +} while(0) + +#define TET_STAMP_FAIL() \ +do {\ + tet_printf("%s : fail",__FUNCTION__);\ + tet_result(TET_FAIL);\ +} while(0) + +#define TET_STAMP(result) \ +do {\ + tet_printf("%s[%d] %s() TET_STAMP(%d)",__FILE__,__LINE__,__FUNCTION__,result); \ + tet_result(result);\ +} while(0) + +// TET_RESULT Function ********************************************************************* +#define TET_RESULT_IF_EQUAL(result,x1,x2) \ +do { \ + if ((x1) == (x2)) \ + { \ + tet_printf("[line %d] Expected Result: %d Actual Result: %d",__LINE__, x1,x2); \ + tet_result(result); \ + if(result==TET_PASS || result==TET_FAIL || result == TET_UNTESTED) return;\ + } \ + } while(0) + +#define TET_RESULT_IF_EQUAL_THEN_GOTO(result,label,x1,x2) \ +do { \ + if ((x1) == (x2)) \ + { \ + tet_result(result); \ + goto label; \ + } \ + else \ + { \ + tet_printf("[line %d] Expected Result: %d Actual Result: %d",__LINE__, x1,x2); \ + } \ + } while(0) + +#define TET_RESULT_IF_NOT_EQUAL(result,x1,x2) \ +do { \ + if ((x1) != (x2)) \ + { \ + tet_printf("[line %d] Expected Result: %d Actual Result: %d",__LINE__, x1,x2); \ + tet_result(result); \ + if(result==TET_PASS || result==TET_FAIL || result == TET_UNTESTED) return; \ + } \ + } while(0) + + +#define TET_RESULT_IF_NOT_EQUAL_THEN_GOTO(result,label,x1,x2) \ +do { \ + if ((x1) != (x2)) \ + { \ + tet_printf("[line %d] Expected Result: %d Actual Result: %d",__LINE__, x1,x2); \ + tet_result(result); \ + tet_result(result); \ + goto label;\ + } \ + } while(0) + + +// TET_CHECK Macro : TAPI api return value test macro. If it is not TAPI_API_SUCCESS, tet_retult(TET_FAIL) is called +#define TET_CHECK(x1, y...) \ +do { \ + TapiResult_t err = y;\ + if (err != (x1)) \ + { \ + tet_printf("[line %d] Expected Result: %d Actual Result: %d",__LINE__, x1,x2); \ + tet_result(TET_FAIL); \ + return;\ + } \ + } while(0) + + +#define TET_PRECONDITION(x1, y...) \ +do { \ + TapiResult_t err = y;\ + if (err != (x1)) \ + { \ + tet_printf("%s[%d] %s : Test precondition fail. error code =%d [%s] ",__FILE__,__LINE__,__FUNCTION__, err, TET_ERROR_TO_STRING(err) ); \ + tet_result(TET_UNTESTED); \ + return;\ + } \ + } while(0) + +#define TET_PRECONDITION2(x1, x2, y...) \ +do { \ + TapiResult_t err = y;\ + if ( !(err == (x1) || err == (x2))) \ + { \ + tet_printf("%s[%d] %s : Test precondition fail. error code =%d [%s] ",__FILE__,__LINE__,__FUNCTION__, err, TET_ERROR_TO_STRING(err) ); \ + tet_result(TET_UNTESTED); \ + return;\ + } \ + } while(0) + + +#define TET_CHECK_GOTO(x1,label, y...) \ +do { \ + TapiResult_t err = y;\ + if (err != (x1)) \ + { \ + tet_printf("%s[%d] %s() : test fail. error code =%x [%s] ",__FILE__,__LINE__,__FUNCTION__, err, TET_ERROR_TO_STRING(err) ); \ + tet_result(TET_FAIL); \ + goto label;\ + } \ + } while(0) + +#define TET_PRECONDITION_GOTO(x1,label, y...) \ +do { \ + TapiResult_t err = y;\ + if (err != (x1)) \ + { \ + tet_printf("%s[%d] %s() : Test precondition fail. error code =%d [%s] ",__FILE__,__LINE__,__FUNCTION__, err, TET_ERROR_TO_STRING(err) ); \ + tet_result(TET_UNTESTED); \ + goto label;\ + } \ + } while(0) + +#define TET_PRECONDITION2_GOTO(x1,x2,label, y...) \ +do { \ + TapiResult_t err = y;\ + if ( !(err == (x1)||err == (x2))) \ + { \ + tet_printf("%s[%d] %s() : Test precondition fail. error code =%d [%s] ",__FILE__,__LINE__,__FUNCTION__, err, TET_ERROR_TO_STRING(err) ); \ + tet_result(TET_UNTESTED); \ + goto label;\ + } \ + } while(0) + + +#define TET_CHECK2(x1,x2, y...) \ +do { \ + TapiResult_t err = y;\ + if (!(err == (x1) || err == (x2))) \ + { \ + tet_printf("%s[%d] %s() : test fail. error code =%d [%s] ",__FILE__,__LINE__,__FUNCTION__, err, TET_ERROR_TO_STRING(err) ); \ + tet_result(TET_FAIL); \ + return;\ + } \ + } while(0) + +#define TET_CHECK2_GOTO(x1,x2, label, y...) \ +do { \ + TapiResult_t err = y;\ + if (!(err == (x1) || err == (x2))) \ + { \ + tet_printf("%s[%d] %s() : test fail. error code =%d [%s] ",__FILE__,__LINE__,__FUNCTION__, err, TET_ERROR_TO_STRING(err) ); \ + tet_result(TET_FAIL); \ + goto label;\ + } \ + else tet_printf("%s[%d] %s() : test success. error code =%d [%s] ",__FILE__,__LINE__,__FUNCTION__, err, TET_ERROR_TO_STRING(err) ); \ + } while(0) + + +#define TET_CHECK3(x1,x2,x3, y...) \ +do { \ + TapiResult_t err = y;\ + if (!(err == (x1) || err == (x2) || err == (x3))) \ + { \ + tet_printf("%s[%d] %s() : test fail. error code =%d [%s] ",__FILE__,__LINE__,__FUNCTION__, err, TET_ERROR_TO_STRING(err) ); \ + tet_result(TET_FAIL); \ + return;\ + } \ + } while(0) +#endif //_TET_TAPI_UTIL_ diff --git a/TC/telephony_TC/ss/unit/tslist b/TC/telephony_TC/ss/unit/tslist new file mode 100644 index 0000000..8f06a23 --- /dev/null +++ b/TC/telephony_TC/ss/unit/tslist @@ -0,0 +1,11 @@ +/ss/unit/uts_tel_set_ss_barring +/ss/unit/uts_tel_get_ss_barring_status +/ss/unit/uts_tel_change_ss_barring_password +/ss/unit/uts_tel_set_ss_forward +/ss/unit/uts_tel_get_ss_forward_status +/ss/unit/uts_tel_set_ss_waiting +/ss/unit/uts_tel_get_ss_waiting_status +/ss/unit/uts_tel_get_ss_cli_status +/ss/unit/uts_tel_send_ss_ussd_request +/ss/unit/uts_tel_send_ss_ussd_response +/ss/unit/uts_tel_send_ss_ussd_cancel diff --git a/TC/telephony_TC/ss/unit/uts_tel_change_ss_barring_password.c b/TC/telephony_TC/ss/unit/uts_tel_change_ss_barring_password.c new file mode 100644 index 0000000..91cedd8 --- /dev/null +++ b/TC/telephony_TC/ss/unit/uts_tel_change_ss_barring_password.c @@ -0,0 +1,299 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * 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 "uts_tel_change_ss_barring_password.h" + +#include +#include +#include +#include +#include +#include +#include + +#include +#include "assert.h" +#include "glib.h" + +#include "TapiCommon.h" +//#include "tapi_utility.h" +#include +#include "string.h" + +#include "tet_tapi_util.h" +#include + +/* Initialize TCM data structures */ +static void startup(); +static void cleanup(); +void (*tet_startup) () = startup; +void (*tet_cleanup) () = cleanup; +struct tet_testlist tet_testlist[] = { + {utc_tel_change_ss_barring_password_01, 1}, + {utc_tel_change_ss_barring_password_02, 2}, + {utc_tel_change_ss_barring_password_03, 3}, + {utc_tel_change_ss_barring_password_04, 4}, + {utc_tel_change_ss_barring_password_05, 5}, + {utc_tel_change_ss_barring_password_06, 6}, + {NULL, 0} +}; + + +/* Startup & Clean function : It is not test code, only for + initialize and finalize test module +*/ +static BOOL gStartupSuccess = FALSE; +static unsigned int subscription_id = 0; + +static void startup() +{ + tapi_dbus_connection_name dname; + int bStatus; + gStartupSuccess = FALSE; + if(tel_init() == TAPI_API_SUCCESS) + { + if(tel_register_event(TAPI_EVENT_SS_BARRING_CHANGEPASS_CNF, &subscription_id, (TelAppCallback)ss_utc_callback,NULL) == TAPI_API_SUCCESS) + { + gStartupSuccess = TRUE; + tel_register_app_name("org.samsung.test"); + if(tel_get_app_name(&dname)) + printf("Dbus Get app name error\n"); + else + printf("Dbus Name is %s\n",dname.name); + + tel_check_service_ready(&bStatus); + printf("Telephpny service %d\n",bStatus); + + } + else + tet_infoline("startup fail. tel_register_event()"); + }else { + tet_infoline("startup fail. tel_init() failed"); + } + + return; +} + +static void cleanup() +{ + if(gStartupSuccess == TRUE) + tel_deregister_event(subscription_id); + tel_deinit(); + return; +} + + +/** + * @brief This tests TelTapiSsChangeBarPassword() API in normal conditions + * @par ID: + * UTC_TAPI_SS_CHANGE_BAR_PASSWORD_001 + * @param [in] oldPwd "0000" + * @param [in] newPwd "1111" +* @param [out] RequestId +* @return TAPI_API_SUCCESS +*/ + +void utc_tel_change_ss_barring_password_01() +{ + TET_STAMP_START("Positive Test"); + + + TapiResult_t ret_status = TAPI_API_SUCCESS; + int pRequestId; + + char *oldPwd=OLD_PWD; + char *newPwd=OLD_PWD; + char *newPwdAgain=OLD_PWD; + + ret_status = tel_change_ss_barring_password(oldPwd,newPwd,newPwdAgain, &pRequestId); + + TET_RESULT_IF_NOT_EQUAL_THEN_GOTO(TET_FAIL, exit, TAPI_API_SUCCESS, ret_status ); + G_MAIN_LOOP_RUN(5); + + tet_result(TET_PASS); +exit: + return; +} + + +/** + * @brief Error handling of the old password for TelTapiSsChangeBarPassword() API + * @par ID: + * UTC_TAPI_SS_CHANGE_BAR_PASSWORD_002 + * @param [in] oldPwd "00000" //Long password + * @param [in] newPwd "1111" +* @param [out] RequestId +* @return TAPI_API_INVALID_INPUT +*/ + +void utc_tel_change_ss_barring_password_02() +{ + TET_STAMP_START("Invalid long old password"); + + + TapiResult_t ret_status = TAPI_API_SUCCESS; + int pRequestId; + char *oldPwd="00000"; + char *newPwd="1111"; + char *newPwdAgain="1111"; + + ret_status = tel_change_ss_barring_password(oldPwd,newPwd,newPwdAgain, &pRequestId); + + TET_RESULT_IF_EQUAL_THEN_GOTO(TET_PASS, exit, TAPI_API_INVALID_INPUT, ret_status); + + G_MAIN_LOOP_RUN(7); + + tet_result(TET_FAIL); +exit: + return; +} + +/** + * @brief Error handling of the new password for TelTapiSsChangeBarPassword() API + * @par ID: + * UTC_TAPI_SS_CHANGE_BAR_PASSWORD_003 + * @param [in] oldPwd "0000" + * @param [in] newPwd "11111" //Long password +* @param [out] RequestId +* @return TAPI_API_INVALID_INPUT +*/ + +void utc_tel_change_ss_barring_password_03() +{ + TET_STAMP_START("Invalid long new password"); + + + TapiResult_t ret_status = TAPI_API_SUCCESS; + int pRequestId; + char *oldPwd="0000"; + char *newPwd="11111"; + char *newPwdAgain="11111"; + + ret_status = tel_change_ss_barring_password(oldPwd,newPwd,newPwdAgain, &pRequestId); + + TET_RESULT_IF_EQUAL_THEN_GOTO(TET_PASS, exit, TAPI_API_INVALID_INPUT, ret_status); + + G_MAIN_LOOP_RUN(7); + + tet_result(TET_FAIL); +exit: + return; +} + +/** + * @brief Null testing of the old password for TelTapiSsChangeBarPassword() API + * @par ID: + * UTC_TAPI_SS_CHANGE_BAR_PASSWORD_004 + * @param [in] oldPwd NULL + * @param [in] newPwd "1111" +* @param [out] RequestId +* @return TAPI_API_INVALID_INPUT +*/ + +void utc_tel_change_ss_barring_password_04() +{ + TET_STAMP_START("Null old password"); + + + TapiResult_t ret_status = TAPI_API_SUCCESS; + int pRequestId; + char *oldPwd=NULL; + char *newPwd="1111"; + char *newPwdAgain="1111"; + + ret_status = tel_change_ss_barring_password(oldPwd,newPwd,newPwdAgain, &pRequestId); + + TET_RESULT_IF_EQUAL_THEN_GOTO(TET_PASS, exit, TAPI_API_INVALID_PTR, ret_status); + + G_MAIN_LOOP_RUN(7); + + tet_result(TET_FAIL); +exit: + return; +} + +/** + * @brief Null testing of the new password for TelTapiSsChangeBarPassword() API + * @par ID: + * UTC_TAPI_SS_CHANGE_BAR_PASSWORD_005 + * @param [in] oldPwd "0000" + * @param [in] newPwd NULL +* @param [out] RequestId +* @return TAPI_API_INVALID_INPUT +*/ + +void utc_tel_change_ss_barring_password_05() +{ + TET_STAMP_START("Null new password"); + + + TapiResult_t ret_status = TAPI_API_SUCCESS; + int pRequestId; + char *oldPwd="0000"; + char *newPwd=NULL; + char *newPwdAgain=NULL; + + ret_status = tel_change_ss_barring_password(oldPwd,newPwd,newPwdAgain, &pRequestId); + + TET_RESULT_IF_EQUAL_THEN_GOTO(TET_PASS, exit, TAPI_API_INVALID_PTR, ret_status); + + G_MAIN_LOOP_RUN(5); + + tet_result(TET_FAIL); +exit: + return; +} + +/** + * @brief Null testing of the request ID for TelTapiSsChangeBarPassword() API + * @par ID: + * UTC_TAPI_SS_CHANGE_BAR_PASSWORD_006 + * @param [in] oldPwd "0000" + * @param [in] newPwd "1111" +* @param [out] RequestId +* @return TAPI_API_INVALID_INPUT +*/ + +void utc_tel_change_ss_barring_password_06() +{ + TET_STAMP_START("Null RequstId"); + + + TapiResult_t ret_status = TAPI_API_SUCCESS; + char *oldPwd="0000"; + char *newPwd="1111"; + char *newPwdAgain="1111"; + + ret_status = tel_change_ss_barring_password(oldPwd,newPwd,newPwdAgain, NULL); + + TET_RESULT_IF_EQUAL_THEN_GOTO(TET_PASS, exit, TAPI_API_INVALID_PTR, ret_status); + + G_MAIN_LOOP_RUN(5); + + tet_result(TET_FAIL); +exit: + return; +} + + + +/** @} */ diff --git a/TC/telephony_TC/ss/unit/uts_tel_change_ss_barring_password.h b/TC/telephony_TC/ss/unit/uts_tel_change_ss_barring_password.h new file mode 100644 index 0000000..0f0d1cc --- /dev/null +++ b/TC/telephony_TC/ss/unit/uts_tel_change_ss_barring_password.h @@ -0,0 +1,31 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * 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 _UTS_TAPI_SS_CHANGE_BAR_PASSWORD_H_ +#define _UTS_TAPI_SS_CHANGE_BAR_PASSWORD_H_ + +static void utc_tel_change_ss_barring_password_01(); +static void utc_tel_change_ss_barring_password_02(); +static void utc_tel_change_ss_barring_password_03(); +static void utc_tel_change_ss_barring_password_04(); +static void utc_tel_change_ss_barring_password_05(); +static void utc_tel_change_ss_barring_password_06(); + +#endif //_ITS_TAPI_CALL_BARRING_ACT_H_ diff --git a/TC/telephony_TC/ss/unit/uts_tel_get_ss_aoc_info.c b/TC/telephony_TC/ss/unit/uts_tel_get_ss_aoc_info.c new file mode 100644 index 0000000..601fa2e --- /dev/null +++ b/TC/telephony_TC/ss/unit/uts_tel_get_ss_aoc_info.c @@ -0,0 +1,203 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * 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 +#include +#include + +#include +#include "assert.h" +#include "glib.h" + +#include "TapiCommon.h" +#include +#include "uts_tel_get_ss_aoc_info.h" +#include "tet_tapi_util.h" + +/* Initialize TCM data structures */ +static void startup(); +static void cleanup(); +void (*tet_startup) () = startup; +void (*tet_cleanup) () = cleanup; +struct tet_testlist tet_testlist[] = { + {utc_tel_get_ss_aoc_info_01, 1}, + {utc_tel_get_ss_aoc_info_02, 2}, + {utc_tel_get_ss_aoc_info_03, 3}, + {utc_tel_get_ss_aoc_info_04, 4}, + {NULL, 0} +}; + + +/* Startup & Clean function : It is not test code, only for + initialize and finalize test module +*/ +static BOOL gStartupSuccess = FALSE; +static unsigned int subscription_id = 0; + +static void startup() +{ + tapi_dbus_connection_name dname; + int bStatus; + + gStartupSuccess = FALSE; + if(tel_init() != TAPI_API_SUCCESS) + { + tet_infoline("startup fail. tel_init() failed"); + } + + return; +} + +static void cleanup() +{ + if(gStartupSuccess == TRUE) + tel_deregister_event(subscription_id); + tel_deinit(); + return; +} + +/** + * @brief This tests TelTapiReadAocInfoRequest() API in normal conditions + * @par ID: + * UTC_TAPI_READ_AOC_INFO_REQUEST_001 + * @param [in] aoc_type TAPI_SS_AOC_TYPE_CCM + * @param [out] RequestId +* @return TAPI_API_SUCCESS +*/ + +static void utc_tel_get_ss_aoc_info_01() +{ + TET_STAMP_START("Positive Test"); + + TapiResult_t ret_status = TAPI_API_SUCCESS; + int request_id; + TelSsAocType_t aoc_type; + aoc_type =(TelSsAocType_t)TAPI_SS_AOC_TYPE_CCM; + + if(tel_register_event(TAPI_EVENT_SS_AOC_RSP, &subscription_id, (TelAppCallback)ss_utc_callback,TAPI_EVENT_SS_AOC_RSP) == TAPI_API_SUCCESS) + { + gStartupSuccess = TRUE; + tel_register_app_name("org.samsung.test"); + } + + ret_status = tel_get_ss_aoc_info(aoc_type,&request_id); + + TET_RESULT_IF_NOT_EQUAL_THEN_GOTO(TET_FAIL, exit, TAPI_API_SUCCESS, ret_status ); + G_MAIN_LOOP_RUN(5); + + tet_result(TET_PASS); +exit: + return; +} + + +/** + * @brief Lower boundary testing of the AoC type for TelTapiReadAocInfoRequest() API + * @par ID: + * UTC_TAPI_READ_AOC_INFO_REQUEST_002 + * @param [in] aoc_type -1 + * @param [out] RequestId +* @return TAPI_API_INVALID_INPUT +*/ + +static void utc_tel_get_ss_aoc_info_02() +{ + TET_STAMP_START("Invalid AoC type -1"); + + + TapiResult_t ret_status = TAPI_API_SUCCESS; + int request_id; + TelSsAocType_t aoc_type; + aoc_type =(TelSsAocType_t) -1; + + ret_status = tel_get_ss_aoc_info(aoc_type,&request_id); + + TET_RESULT_IF_EQUAL_THEN_GOTO(TET_PASS, exit, TAPI_API_INVALID_INPUT, ret_status ); + G_MAIN_LOOP_RUN(5); + tet_result(TET_FAIL); + +exit: + return; +} + +/** + * @brief Upper boundary testing of the AoC type for TelTapiReadAocInfoRequest() API + * @par ID: + * UTC_TAPI_READ_AOC_INFO_REQUEST_003 + * @param [in] aoc_type TAPI_SS_AOC_TYPE_PUC+1 + * @param [out] RequestId +* @return TAPI_API_INVALID_INPUT +*/ + +static void utc_tel_get_ss_aoc_info_03() +{ + TET_STAMP_START("Invalid AoC type +1"); + + + TapiResult_t ret_status = TAPI_API_SUCCESS; + int request_id; + TelSsAocType_t aoc_type; + aoc_type =(TelSsAocType_t)( TAPI_SS_AOC_TYPE_PUC+1); + + ret_status = tel_get_ss_aoc_info(aoc_type,&request_id); + + TET_RESULT_IF_EQUAL_THEN_GOTO(TET_PASS, exit, TAPI_API_INVALID_INPUT, ret_status ); + G_MAIN_LOOP_RUN(5); + tet_result(TET_FAIL); + +exit: + return; +} + +/** + * @brief Null testing of the request ID for TelTapiReadAocInfoRequest() API + * @par ID: + * UTC_TAPI_READ_AOC_INFO_REQUEST_004 + * @param [in] aoc_type TAPI_SS_AOC_TYPE_PUC + * @param [out] RequestId NULL +* @return TAPI_API_INVALID_PTR +*/ + +static void utc_tel_get_ss_aoc_info_04() +{ + TET_STAMP_START("Null Request ID"); + + + TapiResult_t ret_status = TAPI_API_SUCCESS; + + TelSsAocType_t aoc_type; + aoc_type =TAPI_SS_AOC_TYPE_PUC; + + ret_status = tel_get_ss_aoc_info(aoc_type,NULL); + + TET_RESULT_IF_EQUAL_THEN_GOTO(TET_PASS, exit, TAPI_API_INVALID_PTR, ret_status ); + G_MAIN_LOOP_RUN(5); + tet_result(TET_FAIL); + +exit: + return; +} + + +/** @} */ diff --git a/TC/telephony_TC/ss/unit/uts_tel_get_ss_aoc_info.h b/TC/telephony_TC/ss/unit/uts_tel_get_ss_aoc_info.h new file mode 100644 index 0000000..948119e --- /dev/null +++ b/TC/telephony_TC/ss/unit/uts_tel_get_ss_aoc_info.h @@ -0,0 +1,30 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * 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 _UTS_TAPI_READ_AOC_INFO_REQUEST_H_ +#define _UTS_TAPI_READ_AOC_INFO_REQUEST_H_ + +static void utc_tel_get_ss_aoc_info_01(); +static void utc_tel_get_ss_aoc_info_02(); +static void utc_tel_get_ss_aoc_info_03(); +static void utc_tel_get_ss_aoc_info_04(); + +#endif //_ITS_TAPI_CALL_BARRING_ACT_H_ diff --git a/TC/telephony_TC/ss/unit/uts_tel_get_ss_barring_status.c b/TC/telephony_TC/ss/unit/uts_tel_get_ss_barring_status.c new file mode 100644 index 0000000..730cd00 --- /dev/null +++ b/TC/telephony_TC/ss/unit/uts_tel_get_ss_barring_status.c @@ -0,0 +1,300 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * 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 +#include +#include +#include + +#include +#include "assert.h" +#include "glib.h" + +#include "TapiCommon.h" +//#include "tapi_utility.h" +#include +#include "string.h" + +#include "tet_tapi_util.h" + +#include "uts_tel_get_ss_barring_status.h" + +/* Initialize TCM data structures */ +static void startup(); +static void cleanup(); +void (*tet_startup) () = startup; +void (*tet_cleanup) () = cleanup; +struct tet_testlist tet_testlist[] = { + {utc_tel_get_ss_barring_status_01, 1}, + {utc_tel_get_ss_barring_status_02, 2}, + {utc_tel_get_ss_barring_status_03, 3}, + {utc_tel_get_ss_barring_status_04, 4}, + {utc_tel_get_ss_barring_status_05, 5}, + {utc_tel_get_ss_barring_status_06, 6}, + {NULL, 0} +}; + +/* Startup & Clean function : It is not test code, only for + initialize and finalize test module +*/ +static BOOL gStartupSuccess = FALSE; +static unsigned int subscription_id = 0; + +static void startup() +{ + tapi_dbus_connection_name dname; + int bStatus; + + gStartupSuccess = FALSE; + if(tel_init() == TAPI_API_SUCCESS) + { + if(tel_register_event(TAPI_EVENT_SS_BARRING_QUERYSTATUS_CNF, &subscription_id, (TelAppCallback)ss_utc_callback,NULL) == TAPI_API_SUCCESS) + { + gStartupSuccess = TRUE; + tel_register_app_name("org.samsung.test"); + if(tel_get_app_name(&dname)) + printf("Dbus Get app name error\n"); + else + printf("Dbus Name is %s\n",dname.name); + + tel_check_service_ready(&bStatus); + printf("Telephony service %d\n",bStatus); + } + else + tet_infoline("startup fail. tel_register_event()"); + }else { + tet_infoline("startup fail. tel_init() failed"); + } + + return; +} + +static void cleanup() +{ + if(gStartupSuccess == TRUE) + tel_deregister_event(subscription_id); + tel_deinit(); + return; +} + + + +/** + * @brief This tests TelTapiSsGetCallbarringStatus() API in normal conditions + * @par ID: + * UTC_TAPI_SS_GET_CALL_BARRING_STATUS_001 + * @param [in] bar_type TAPI_CALL_BARRING_OUTGOING + * @param [in] CallType TAPI_CALL_TYPE_VOICE_EV + * @param [out] RequestId + * @return TAPI_API_SUCCESS +*/ + +void utc_tel_get_ss_barring_status_01() +{ + TET_STAMP_START("Positive Test"); + TapiResult_t ret_status = TAPI_API_SUCCESS; + TelSsCallBarType_t bar_type; + TelSsCallType_t call_type; + int request_id; + + bar_type = TAPI_CALL_BARRING_OUTGOING; + call_type = TAPI_CALL_TYPE_VOICE_EV; + + ret_status = tel_get_ss_barring_status(bar_type, call_type, &request_id); + + TET_RESULT_IF_NOT_EQUAL_THEN_GOTO(TET_FAIL, exit, TAPI_API_SUCCESS, ret_status ); + G_MAIN_LOOP_RUN(5); + + tet_result(TET_PASS); +exit: + return; +} + +/** + * @brief Lower boundary testing of the barring type for TelTapiSsGetCallBarringStatus() API + * @par ID: + * UTC_TAPI_SS_GET_CALL_BARRING_STATUS_002 + * @param [in] bar_type -1 + * @param [in] call_type TAPI_CALL_TYPE_VOICE_EV + * @param [out] RequestId +* @return TAPI_API_INVALID_INPUT +*/ + +void utc_tel_get_ss_barring_status_02() +{ + TET_STAMP_START("Invalid Barring type -1"); + + TapiResult_t ret_status = TAPI_API_SUCCESS; + TelSsCallBarType_t bar_type; + TelSsCallType_t call_type; + int request_id; + + bar_type = (TelSsCallBarType_t)-1;//TAPI_CALL_BARRING_OUTGOING; + call_type = TAPI_CALL_TYPE_VOICE_EV; + + ret_status = tel_get_ss_barring_status(bar_type, call_type, &request_id); + + TET_RESULT_IF_EQUAL_THEN_GOTO(TET_PASS, exit, TAPI_API_INVALID_INPUT, ret_status); + + G_MAIN_LOOP_RUN(5); + + tet_result(TET_FAIL); +exit: + return; +} + +/** + * @brief Upper boundary testing of the barring type for TelTapiSsGetCallBarringStatus() API + * @par ID: + * UTC_TAPI_SS_GET_CALL_BARRING_STATUS_003 + * @param [in] bar_type TAPI_CALL_BARRING_ALL_INCOMING_CALLS_INSIM+1 + * @param [in] call_type TAPI_CALL_TYPE_VOICE_EV + * @param [out] RequestId +* @return TAPI_API_INVALID_INPUT +*/ + +void utc_tel_get_ss_barring_status_03() +{ + TET_STAMP_START("Invalid Barring type +1"); + + TapiResult_t ret_status = TAPI_API_SUCCESS; + TelSsCallBarType_t bar_type; + TelSsCallType_t call_type; + int request_id; + + bar_type = (TelSsCallBarType_t)(TAPI_CALL_BARRING_ALL_INCOMING_CALLS_INSIM+1); + call_type = TAPI_CALL_TYPE_VOICE_EV; + + ret_status = tel_get_ss_barring_status(bar_type, call_type, &request_id); + + TET_RESULT_IF_EQUAL_THEN_GOTO(TET_PASS, exit, TAPI_API_INVALID_INPUT, ret_status); + + G_MAIN_LOOP_RUN(5); + + tet_result(TET_FAIL); +exit: + return; +} + +/** + * @brief Lower boundary testing for the call type of TelTapiSsGetCallBarringStatus() API + * @par ID: + * UTC_TAPI_SS_GET_CALL_BARRING_STATUS_004 + * @param [in] bar_type TAPI_CALL_BARRING_ALL_OUTGOING_CALLS + * @param [in] call_type -1 + * @param [out] RequestId +* @return TAPI_API_INVALID_INPUT +*/ + +void utc_tel_get_ss_barring_status_04() +{ + TET_STAMP_START("Invalid Call type -1"); + + TapiResult_t ret_status = TAPI_API_SUCCESS; + TelSsCallBarType_t bar_type; + TelSsCallType_t call_type; + int request_id; + + bar_type = TAPI_CALL_BARRING_ALL_OUTGOING_CALLS; + call_type = (TelSsCallType_t)-1; + + ret_status = tel_get_ss_barring_status(bar_type, call_type, &request_id); + + TET_RESULT_IF_EQUAL_THEN_GOTO(TET_PASS, exit, TAPI_API_INVALID_INPUT, ret_status); + + G_MAIN_LOOP_RUN(5); + + tet_result(TET_FAIL); +exit: + return; +} + +/** + * @brief Upper boundary testing for the call type of TelTapiSsGetCallBarringStatus() API + * @par ID: + * UTC_TAPI_SS_GET_CALL_BARRING_STATUS_005 + * @param [in] bar_type TAPI_CALL_BARRING_ALL_OUTGOING_CALLS + * @param [in] call_type TAPI_CALL_TYPE_ALL_TELE+1 + * @param [out] RequestId +* @return TAPI_API_INVALID_INPUT +*/ + +void utc_tel_get_ss_barring_status_05() +{ + TET_STAMP_START("Invalid Call Type +1"); + + TapiResult_t ret_status = TAPI_API_SUCCESS; + TelSsCallBarType_t bar_type; + TelSsCallType_t call_type; + int request_id; + + bar_type = TAPI_CALL_BARRING_ALL_OUTGOING_CALLS; + call_type = (TelSsCallType_t)(TAPI_CALL_TYPE_ALL_TELE+1); + + ret_status = tel_get_ss_barring_status(bar_type, call_type, &request_id); + + TET_RESULT_IF_EQUAL_THEN_GOTO(TET_PASS, exit, TAPI_API_INVALID_INPUT, ret_status); + + G_MAIN_LOOP_RUN(5); + + tet_result(TET_FAIL); +exit: + return; +} + +/** + * @brief Null testing for the request ID of TelTapiSsGetCallBarringStatus() API + * @par ID: + * UTC_TAPI_SS_GET_CALL_BARRING_STATUS_005 + * @param [in] bar_type TAPI_CALL_BARRING_ALL_OUTGOING_CALLS + * @param [in] call_type TAPI_CALL_TYPE_VOICE_EV + * @param [out] RequestId NULL +* @return TAPI_API_INVALID_PTR +*/ + +void utc_tel_get_ss_barring_status_06() +{ + TET_STAMP_START("Null request id"); + + TapiResult_t ret_status = TAPI_API_SUCCESS; + TelSsCallBarType_t bar_type; + TelSsCallType_t call_type; + + bar_type = TAPI_CALL_BARRING_ALL_OUTGOING_CALLS; + call_type = (TelSsCallType_t)TAPI_CALL_TYPE_VOICE_EV; + + ret_status = tel_get_ss_barring_status(bar_type, call_type, NULL); + + TET_RESULT_IF_EQUAL_THEN_GOTO(TET_PASS, exit, TAPI_API_INVALID_PTR, ret_status); + + G_MAIN_LOOP_RUN(5); + + tet_result(TET_FAIL); +exit: + return; +} + + + diff --git a/TC/telephony_TC/ss/unit/uts_tel_get_ss_barring_status.h b/TC/telephony_TC/ss/unit/uts_tel_get_ss_barring_status.h new file mode 100644 index 0000000..c4afe6d --- /dev/null +++ b/TC/telephony_TC/ss/unit/uts_tel_get_ss_barring_status.h @@ -0,0 +1,33 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * 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 _UTS_TAPI_CALL_BARRING_STATUS_H_ +#define _UTS_TAPI_CALL_BARRING_STATUS_H_ + +static void utc_tel_get_ss_barring_status_01(); + + static void utc_tel_get_ss_barring_status_02(); + static void utc_tel_get_ss_barring_status_03(); + static void utc_tel_get_ss_barring_status_04(); + static void utc_tel_get_ss_barring_status_05(); + static void utc_tel_get_ss_barring_status_06(); + +#endif //_UTS_TAPI_CALL_BARRING_ACT_H_ diff --git a/TC/telephony_TC/ss/unit/uts_tel_get_ss_cli_status.c b/TC/telephony_TC/ss/unit/uts_tel_get_ss_cli_status.c new file mode 100644 index 0000000..27f7421 --- /dev/null +++ b/TC/telephony_TC/ss/unit/uts_tel_get_ss_cli_status.c @@ -0,0 +1,145 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * 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 +#include +#include +#include + +#include +#include "assert.h" +#include "glib.h" + +#include "TapiCommon.h" +//#include "tapi_utility.h" +#include +//#include "tapi_proxy_utility.h" +#include "string.h" + +#include "tet_tapi_util.h" +#include "uts_tel_get_ss_cli_status.h" +#include + +/* Initialize TCM data structures */ +static void startup(); +static void cleanup(); +void (*tet_startup) () = startup; +void (*tet_cleanup) () = cleanup; +struct tet_testlist tet_testlist[] = { + {utc_tel_get_ss_cli_status_01, 1}, + {utc_tel_get_ss_cli_status_02, 2}, + {NULL, 0} +}; + +/* Startup & Clean function : It is not test code, only for + initialize and finalize test module +*/ +static int gStartupSuccess = FALSE; +static unsigned int subscription_id = 0; + +static void startup() +{ + tapi_dbus_connection_name dname; + int bStatus; + + gStartupSuccess = FALSE; + if(tel_init() == TAPI_API_SUCCESS) + { + if(tel_register_event(TAPI_EVENT_SS_CLI_QUERYSTATUS_CNF, &subscription_id, (TelAppCallback)ss_utc_callback,NULL) == TAPI_API_SUCCESS) + { + gStartupSuccess = TRUE; + + tel_register_app_name("org.samsung.test"); + if(tel_get_app_name(&dname)) + printf("Dbus Get app name error\n"); + else + printf("Dbus Name is %s\n",dname.name); + + tel_check_service_ready(&bStatus); + printf("Telephony service %d\n",bStatus); + + } + else + tet_infoline("startup fail. tel_register_event()"); + }else { + tet_infoline("startup fail. tel_init() failed"); + } + + return; +} + +static void cleanup() +{ + if(gStartupSuccess == TRUE) + tel_deregister_event(subscription_id); + tel_deinit(); + return; +} + + +/** + * @brief This tests TelTapiSsCliServiceStatus API in normal condition + * @par ID: + * UTS_TAPI_SS_QUERY_CLI_SERVICE_STATUS_001 + * @param [in] pBarringInfo + * @param [out] RequestId + * @return TAPI_API_SUCCESS +*/ + +void utc_tel_get_ss_cli_status_01() +{ + TET_STAMP_START("Positive Test"); + + TapiResult_t ret_status = TAPI_API_SUCCESS; + TelSsCliType_t Cli_Service_Type; + int pRequestId=0; + Cli_Service_Type = TAPI_SS_CLI_CLIP; + ret_status = tel_get_ss_cli_status(Cli_Service_Type, &pRequestId ); + TET_RESULT_IF_NOT_EQUAL_THEN_GOTO(TET_FAIL, exit, TAPI_API_SUCCESS, ret_status ); + G_MAIN_LOOP_RUN(5); + + tet_result(TET_PASS); +exit: + return; +} + +void utc_tel_get_ss_cli_status_02() +{ + TET_STAMP_START("Positive Test"); + + TapiResult_t ret_status = TAPI_API_SUCCESS; + TelSsCliType_t Cli_Service_Type; + int pRequestId=0; + Cli_Service_Type = TAPI_SS_CLI_CLIP; + ret_status = tel_get_ss_cli_status(Cli_Service_Type, NULL ); + if(ret_status ==tel_get_ss_cli_status) + tet_result(TET_FAIL); + + G_MAIN_LOOP_RUN(5); + + tet_result(TET_PASS); + + return; +} + diff --git a/TC/telephony_TC/ss/unit/uts_tel_get_ss_cli_status.h b/TC/telephony_TC/ss/unit/uts_tel_get_ss_cli_status.h new file mode 100644 index 0000000..64f8731 --- /dev/null +++ b/TC/telephony_TC/ss/unit/uts_tel_get_ss_cli_status.h @@ -0,0 +1,29 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * 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 _UTS_TAPI_SS_QUERY_CLI_SERVICE_STATUS_H_ +#define _UTS_TAPI_SS_QUERY_CLI_SERVICE_STATUS_H_ + + static void utc_tel_get_ss_cli_status_01(); + static void utc_tel_get_ss_cli_status_02(); + +#endif //_UTS_TAPI_SS_QUERY_CLI_SERVICE_STATUS_H + diff --git a/TC/telephony_TC/ss/unit/uts_tel_get_ss_forward_status.c b/TC/telephony_TC/ss/unit/uts_tel_get_ss_forward_status.c new file mode 100644 index 0000000..ba116c1 --- /dev/null +++ b/TC/telephony_TC/ss/unit/uts_tel_get_ss_forward_status.c @@ -0,0 +1,281 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * 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 +#include +#include +#include + +#include +#include "assert.h" +#include "glib.h" + +#include "TapiCommon.h" +//#include "tapi_utility.h" +#include +#include "string.h" + +#include "tet_tapi_util.h" +#include "uts_tel_get_ss_forward_status.h" + +/* Initialize TCM data structures */ +static void startup(); +static void cleanup(); +void (*tet_startup) () = startup; +void (*tet_cleanup) () = cleanup; +struct tet_testlist tet_testlist[] = { + {utc_tel_get_ss_forward_status_01, 1}, + {utc_tel_get_ss_forward_status_02, 2}, + {utc_tel_get_ss_forward_status_03, 3}, + {utc_tel_get_ss_forward_status_04, 4}, + {utc_tel_get_ss_forward_status_05, 5}, + {utc_tel_get_ss_forward_status_06, 6}, + {NULL, 0} +}; +/* Startup & Clean function : It is not test code, only for + initialize and finalize test module +*/ +static BOOL gStartupSuccess = FALSE; +static unsigned int subscription_id = 0; + +static void startup() +{ + tapi_dbus_connection_name dname; + int bStatus; + gStartupSuccess = FALSE; + if(tel_init() == TAPI_API_SUCCESS) + { + if(tel_register_event(TAPI_EVENT_SS_FORWARD_QUERYSTATUS_CNF, &subscription_id, (TelAppCallback)ss_utc_callback,NULL) == TAPI_API_SUCCESS) + { + gStartupSuccess = TRUE; + tel_register_app_name("org.samsung.test"); + if(tel_get_app_name(&dname)) + printf("Dbus Get app name error\n"); + else + printf("Dbus Name is %s\n",dname.name); + + tel_check_service_ready(&bStatus); + printf("Telephony service %d\n",bStatus); + + } + else + tet_infoline("startup fail. tel_register_event()"); + }else { + tet_infoline("startup fail. tel_init() failed"); + } + + return; +} + +static void cleanup() +{ + if(gStartupSuccess == TRUE) + tel_deregister_event(subscription_id); + tel_deinit(); + return; +} + + + +/** + * @brief This tests TelTapiSsGetCallForwardStatus() API in normal conditions + * @par ID: + * UTC_TAPI_SS_GET_CALL_FORWARD_STATUS_001 + * @param [in] forward_type TAPI_CS_FORWARD_TYPE_VOICE_EV + * @param [in] Condition TAPI_SS_FORWARD_WHEN_UNCONDITIONAL_EV + * @param [out] RequestId + * @return TAPI_API_SUCCESS +*/ + +void utc_tel_get_ss_forward_status_01() +{ + TET_STAMP_START("Positive Test"); + + + TapiResult_t ret_status = TAPI_API_SUCCESS; + TelSsForwardType_t Type = TAPI_CS_FORWARD_TYPE_VOICE_EV; + TelSsForwardWhen_t Condition = TAPI_SS_FORWARD_WHEN_UNCONDITIONAL_EV; + int pRequestId=0; + +/* Calling TAPI SS Call Frwd Query Req Status Api */ + ret_status = tel_get_ss_forward_status(Type,Condition,&pRequestId); + TET_RESULT_IF_NOT_EQUAL_THEN_GOTO(TET_FAIL, exit, TAPI_API_SUCCESS, ret_status ); + G_MAIN_LOOP_RUN(5); + + tet_result(TET_PASS); +exit: + return; +} + +/** + * @brief Lower boundary testing of the forward type for TelTapiSsGetCallForwardStatus() API + * @par ID: + * UTC_TAPI_SS_GET_CALL_FORWARD_STATUS_001 + * @param [in] forward_type -1 + * @param [in] Condition TAPI_SS_FORWARD_WHEN_UNCONDITIONAL_EV + * @param [out] RequestId + * @return TAPI_API_INVALID_INPUT +*/ + + +void utc_tel_get_ss_forward_status_02() +{ + TET_STAMP_START("Invalid Forward type -1"); + + + TapiResult_t ret_status = TAPI_API_SUCCESS; + TelSsForwardType_t Type = (TelSsForwardType_t)-1;//TAPI_CS_FORWARD_TYPE_VOICE_EV; + TelSsForwardWhen_t Condition = TAPI_SS_FORWARD_WHEN_UNCONDITIONAL_EV; + int pRequestId=0; + + ret_status = tel_get_ss_forward_status(Type,Condition,&pRequestId); + TET_RESULT_IF_EQUAL_THEN_GOTO(TET_PASS, exit, TAPI_API_INVALID_INPUT, ret_status); + + G_MAIN_LOOP_RUN(5); + + tet_result(TET_FAIL); +exit: + return; +} + +/** + * @brief Upper boundary testing of the forward type for TelTapiSsGetCallForwardStatus() API + * @par ID: + * UTC_TAPI_SS_GET_CALL_FORWARD_STATUS_003 + * @param [in] forward_type TAPI_CS_FORWARD_TYPE_ALL_TELE+1 + * @param [in] Condition TAPI_SS_FORWARD_WHEN_UNCONDITIONAL_EV + * @param [out] RequestId + * @return TAPI_API_INVALID_INPUT +*/ + + +void utc_tel_get_ss_forward_status_03() +{ + + TET_STAMP_START("Invalid Forward Type +1"); + + + TapiResult_t ret_status = TAPI_API_SUCCESS; + TelSsForwardType_t Type = (TelSsForwardType_t)(TAPI_CS_FORWARD_TYPE_ALL_TELE+1); + TelSsForwardWhen_t Condition = TAPI_SS_FORWARD_WHEN_UNCONDITIONAL_EV; + int pRequestId=0; + + ret_status = tel_get_ss_forward_status(Type,Condition,&pRequestId); + TET_RESULT_IF_EQUAL_THEN_GOTO(TET_PASS, exit, TAPI_API_INVALID_INPUT, ret_status ); + G_MAIN_LOOP_RUN(7); + + tet_result(TET_FAIL); +exit: + return; +} + +/** + * @brief Lower boundary testing of the forward condition for TelTapiSsGetCallForwardStatus() API + * @par ID: + * UTC_TAPI_SS_GET_CALL_FORWARD_STATUS_004 + * @param [in] forward_type TAPI_CS_FORWARD_TYPE_VOICE_EV + * @param [in] Condition -1 + * @param [out] RequestId + * @return TAPI_API_INVALID_INPUT +*/ + +void utc_tel_get_ss_forward_status_04() +{ + TET_STAMP_START("Invalid Condition -1"); + + + TapiResult_t ret_status = TAPI_API_SUCCESS; + TelSsForwardType_t Type = TAPI_CS_FORWARD_TYPE_VOICE_EV; + TelSsForwardWhen_t Condition = (TelSsForwardWhen_t)-1; + int pRequestId=0; + + ret_status = tel_get_ss_forward_status(Type,Condition,&pRequestId); + TET_RESULT_IF_EQUAL_THEN_GOTO(TET_PASS, exit, TAPI_API_INVALID_INPUT, ret_status ); + G_MAIN_LOOP_RUN(7); + + tet_result(TET_FAIL); +exit: + return; +} + +/** + * @brief upper boundary testing of the forward condition for TelTapiSsGetCallForwardStatus() API + * @par ID: + * UTC_TAPI_SS_GET_CALL_FORWARD_STATUS_004 + * @param [in] forward_type TAPI_CS_FORWARD_TYPE_VOICE_EV + * @param [in] Condition TAPI_SS_FORWARD_WHEN_ALL_CONDITIONAL_EV+1 + * @param [out] RequestId + * @return TAPI_API_INVALID_INPUT +*/ + +void utc_tel_get_ss_forward_status_05() +{ + TET_STAMP_START("Invalid Condition +1"); + + + TapiResult_t ret_status = TAPI_API_SUCCESS; + TelSsForwardType_t Type = TAPI_CS_FORWARD_TYPE_VOICE_EV; + TelSsForwardWhen_t Condition = (TelSsForwardWhen_t)(TAPI_SS_FORWARD_WHEN_ALL_CONDITIONAL_EV+1); + int pRequestId=0; + + ret_status = tel_get_ss_forward_status(Type,Condition,&pRequestId); + TET_RESULT_IF_EQUAL_THEN_GOTO(TET_PASS, exit, TAPI_API_INVALID_INPUT, ret_status ); + G_MAIN_LOOP_RUN(7); + + tet_result(TET_FAIL); +exit: + return; +} + +/** + * @brief Null testing for the request ID of TelTapiSsGetCallForwardStatus() API + * @par ID: + * UTC_TAPI_SS_GET_CALL_FORWARD_STATUS_006 + * @param [in] forward_type TAPI_CS_FORWARD_TYPE_VOICE_EV + * @param [in] Condition TAPI_SS_FORWARD_WHEN_UNCONDITIONAL_EV + * @param [out] RequestId + * @return TAPI_API_INVALID_PTR +*/ + + +void utc_tel_get_ss_forward_status_06() +{ + TET_STAMP_START("Null Request Id"); + + + TapiResult_t ret_status = TAPI_API_SUCCESS; + TelSsForwardType_t Type = TAPI_CS_FORWARD_TYPE_VOICE_EV; + TelSsForwardWhen_t Condition = TAPI_SS_FORWARD_WHEN_UNCONDITIONAL_EV; + + ret_status = tel_get_ss_forward_status(Type,Condition,NULL); + TET_RESULT_IF_EQUAL_THEN_GOTO(TET_PASS, exit, TAPI_API_INVALID_PTR, ret_status ); + G_MAIN_LOOP_RUN(7); + + tet_result(TET_FAIL); +exit: + return; +} + + + diff --git a/TC/telephony_TC/ss/unit/uts_tel_get_ss_forward_status.h b/TC/telephony_TC/ss/unit/uts_tel_get_ss_forward_status.h new file mode 100644 index 0000000..b58a3ef --- /dev/null +++ b/TC/telephony_TC/ss/unit/uts_tel_get_ss_forward_status.h @@ -0,0 +1,26 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * 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. + */ +static void utc_tel_get_ss_forward_status_01(); +static void utc_tel_get_ss_forward_status_02(); +static void utc_tel_get_ss_forward_status_03(); +static void utc_tel_get_ss_forward_status_04(); +static void utc_tel_get_ss_forward_status_05(); +static void utc_tel_get_ss_forward_status_06(); + diff --git a/TC/telephony_TC/ss/unit/uts_tel_get_ss_waiting_status.c b/TC/telephony_TC/ss/unit/uts_tel_get_ss_waiting_status.c new file mode 100644 index 0000000..64e80cf --- /dev/null +++ b/TC/telephony_TC/ss/unit/uts_tel_get_ss_waiting_status.c @@ -0,0 +1,205 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * 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 +#include +#include +#include + +#include +#include "assert.h" +#include "glib.h" + +#include "TapiCommon.h" +//#include "tapi_utility.h" +#include +#include "string.h" + +#include "tet_tapi_util.h" +#include "uts_tel_get_ss_waiting_status.h" + +/* Initialize TCM data structures */ +static void startup(); +static void cleanup(); +void (*tet_startup) () = startup; +void (*tet_cleanup) () = cleanup; +struct tet_testlist tet_testlist[] = { + {utc_tel_get_ss_waiting_status_01, 1}, + {utc_tel_get_ss_waiting_status_02, 2}, + {utc_tel_get_ss_waiting_status_03, 3}, + {utc_tel_get_ss_waiting_status_04, 4}, + {NULL, 0} +}; + +/* Startup & Clean function : It is not test code, only for + initialize and finalize test module +*/ +static BOOL gStartupSuccess = FALSE; +static unsigned int subscription_id = 0; + +static void startup() +{ + tapi_dbus_connection_name dname; + int bStatus; + + gStartupSuccess = FALSE; + if(tel_init() == TAPI_API_SUCCESS) + { + if(tel_register_event(TAPI_EVENT_SS_WAITING_QUERYSTATUS_CNF, &subscription_id, (TelAppCallback)ss_utc_callback,NULL) == TAPI_API_SUCCESS) + { + gStartupSuccess = TRUE; + + tel_register_app_name("org.samsung.test"); + if(tel_get_app_name(&dname)) + printf("Dbus Get app name error\n"); + else + printf("Dbus Name is %s\n",dname.name); + + tel_check_service_ready(&bStatus); + printf("Telephony service %d\n",bStatus); + } + else + tet_infoline("startup fail. tel_register_event()"); + }else { + tet_infoline("startup fail. tel_init() failed"); + } + + return; +} + +static void cleanup() +{ + if(gStartupSuccess == TRUE) + tel_deregister_event(subscription_id); + tel_deinit(); + return; +} + + +/** + * @brief This tests TelTapiSsGetCallWaitingStatus() API in normal conditions + * @par ID: + * UTC_TAPI_SS_GET_CALL_WAITING_STATUS_001 + * @param [in] CallType TAPI_CALL_TYPE_VOICE_EV +* @param [out] RequestId +* @return TAPI_API_SUCCESS +*/ + +void utc_tel_get_ss_waiting_status_01() +{ + TET_STAMP_START("Positive Test"); + TapiResult_t ret_status = TAPI_API_SUCCESS; + TelSsCallType_t CallType = TAPI_CALL_TYPE_VOICE_EV; + int request_id=0; + + ret_status = tel_get_ss_waiting_status(CallType, &request_id); + + TET_RESULT_IF_NOT_EQUAL_THEN_GOTO(TET_FAIL, exit, TAPI_API_SUCCESS, ret_status ); + G_MAIN_LOOP_RUN(5); + + tet_result(TET_PASS); +exit: + return; +} + +/** + * @brief Upper boundary testing of the ss call type for TelTapiSsGetCallWaitingStatus() API + * @par ID: + * UTC_TAPI_SS_GET_CALL_WAITING_STATUS_002 + * @param [in] CallType (TelSsCallType_t)(TAPI_CALL_TYPE_ALL_TELE+1) +* @param [out] RequestId +* @return TAPI_API_INVALID_INPUT +*/ + +void utc_tel_get_ss_waiting_status_02() +{ + TET_STAMP_START("Invalid call type +1"); + TapiResult_t ret_status = TAPI_API_SUCCESS; + TelSsCallType_t CallType = (TelSsCallType_t)(TAPI_CALL_TYPE_ALL_TELE+1); + int request_id=0; + + ret_status = tel_get_ss_waiting_status(CallType, &request_id); + + TET_RESULT_IF_EQUAL_THEN_GOTO(TET_PASS, exit, TAPI_API_INVALID_INPUT, ret_status); + + G_MAIN_LOOP_RUN(5); + + tet_result(TET_FAIL); +exit: + return; +} + +/** + * @brief Lower boundary testing of the ss call type for TelTapiSsGetCallWaitingStatus() API + * @par ID: + * UTC_TAPI_SS_GET_CALL_WAITING_STATUS_003 + * @param [in] CallType (TelSsCallType_t)-1 +* @param [out] RequestId +* @return TAPI_API_INVALID_INPUT +*/ + +void utc_tel_get_ss_waiting_status_03() +{ + TET_STAMP_START("Invalid call type -1"); + TapiResult_t ret_status = TAPI_API_SUCCESS; + TelSsCallType_t CallType = (TelSsCallType_t)-1;//TAPI_CALL_TYPE_VOICE_EV; + int request_id=0; + + ret_status = tel_get_ss_waiting_status(CallType, &request_id); + TET_RESULT_IF_EQUAL_THEN_GOTO(TET_PASS, exit, TAPI_API_INVALID_INPUT, ret_status); + + G_MAIN_LOOP_RUN(5); + + tet_result(TET_FAIL); +exit: + return; +} + +/** + * @brief Null test of the forward info for TelTapiSsGetCallWaitingStatus() API + * @par ID: + * UTC_TAPI_SS_GET_CALL_WAITING_STATUS_004 + * @param [in] CallType TAPI_CALL_TYPE_VOICE_EV +* @param [out] RequestId NULL +* @return TAPI_API_INVALID_PTR +*/ + +void utc_tel_get_ss_waiting_status_04() +{ + TET_STAMP_START("Null request ID"); + TapiResult_t ret_status = TAPI_API_SUCCESS; + TelSsCallType_t CallType = TAPI_CALL_TYPE_VOICE_EV; + + ret_status = tel_get_ss_waiting_status(CallType, NULL); + TET_RESULT_IF_EQUAL_THEN_GOTO(TET_PASS, exit, TAPI_API_INVALID_PTR, ret_status ); + G_MAIN_LOOP_RUN(5); + + tet_result(TET_FAIL); +exit: + return; +} + +/** @} */ diff --git a/TC/telephony_TC/ss/unit/uts_tel_get_ss_waiting_status.h b/TC/telephony_TC/ss/unit/uts_tel_get_ss_waiting_status.h new file mode 100644 index 0000000..80cedde --- /dev/null +++ b/TC/telephony_TC/ss/unit/uts_tel_get_ss_waiting_status.h @@ -0,0 +1,31 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * 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 _UTS_TAPI_SS_SET_CALL_WAITING_STATUS_H_ +#define _UTS_TAPI_SS_SET_CALL_WAITING_STATUS_H_ + + static void utc_tel_get_ss_waiting_status_01(); + static void utc_tel_get_ss_waiting_status_02(); + static void utc_tel_get_ss_waiting_status_03(); + static void utc_tel_get_ss_waiting_status_04(); + +#endif //_UTS_TAPI_CALL_BARRING_ACT_H_ + diff --git a/TC/telephony_TC/ss/unit/uts_tel_send_ss_ussd_cancel.c b/TC/telephony_TC/ss/unit/uts_tel_send_ss_ussd_cancel.c new file mode 100644 index 0000000..a5c0738 --- /dev/null +++ b/TC/telephony_TC/ss/unit/uts_tel_send_ss_ussd_cancel.c @@ -0,0 +1,134 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * 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 "uts_tel_send_ss_ussd_cancel.h" +#include +#include +#include +#include +#include +#include +#include "TapiCommon.h" +#include "tet_tapi_util.h" + +/* Initialize TCM data structures */ +static void startup(); +static void cleanup(); +void (*tet_startup) () = startup; +void (*tet_cleanup) () = cleanup; +struct tet_testlist tet_testlist[] = { + {utc_tel_send_ss_ussd_cancel_01, 1}, + {utc_tel_send_ss_ussd_cancel_02, 2}, + {NULL, 0} +}; + +/* Startup & Clean function : It is not test code, only for + initialize and finalize test module +*/ +static BOOL gStartupSuccess = FALSE; +static unsigned int subscription_id = 0; + +static void startup() +{ + tapi_dbus_connection_name dname; + int bStatus; + + gStartupSuccess = FALSE; + if(tel_init() == TAPI_API_SUCCESS) + { + if(tel_register_event(TAPI_EVENT_SS_USSD_CANCEL_CNF, &subscription_id, (TelAppCallback)ss_utc_callback,NULL) == TAPI_API_SUCCESS) + { + gStartupSuccess = TRUE; + tel_register_app_name("org.samsung.test"); + if(tel_get_app_name(&dname)) + printf("Dbus Get app name error\n"); + else + printf("Dbus Name is %s\n",dname.name); + + tel_check_service_ready(&bStatus); + printf("Telephony service %d\n",bStatus); + } + else + tet_infoline("startup fail. tel_register_event()"); + }else { + tet_infoline("startup fail. tel_init() failed"); + } + + return; +} + +static void cleanup() +{ + if(gStartupSuccess == TRUE) + tel_deregister_event(subscription_id); + tel_deinit(); + return; +} + + +/** + * @brief This tests TelTapiUssdSendCancel() API in normal conditions + * @par ID: + * UTC_TAPI_USSD_SEND_CANCEL_001 + * @param [out] RequestId + * @return TAPI_API_SUCCESS +*/ + +void utc_tel_send_ss_ussd_cancel_01() +{ + TET_STAMP_START("Positive Test"); + TapiResult_t ret_status = TAPI_API_SUCCESS; + int pRequestId; + + ret_status = tel_send_ss_ussd_cancel(&pRequestId); +// tet_printf("%s",TET_RESULT_TO_STRING(ret_status)); + +// TET_RESULT_IF_NOT_EQUAL_THEN_GOTO(TET_FAIL, exit, TAPI_API_SUCCESS, ret_status ); + G_MAIN_LOOP_RUN(5); + + tet_result(TET_PASS); + return; +} + + +/** + * @brief This tests TelTapiUssdSendCancel() API in normal conditions + * @par ID: + * UTC_TAPI_USSD_SEND_CANCEL_002 + * @param [out] RequestId + * @return TAPI_API_SUCCESS +*/ + +void utc_tel_send_ss_ussd_cancel_02() +{ + TET_STAMP_START("Test with Null Parameter"); + TapiResult_t ret_status = TAPI_API_SUCCESS; + + ret_status = tel_send_ss_ussd_cancel(NULL); + tet_printf("ret_status %d",ret_status); +// tet_infoline("aaa"); + TET_RESULT_IF_EQUAL_THEN_GOTO(TET_PASS, exit, TAPI_API_INVALID_PTR,ret_status); + + G_MAIN_LOOP_RUN(7); + tet_result(TET_FAIL); + exit: + return; +} diff --git a/TC/telephony_TC/ss/unit/uts_tel_send_ss_ussd_cancel.h b/TC/telephony_TC/ss/unit/uts_tel_send_ss_ussd_cancel.h new file mode 100644 index 0000000..0e021cf --- /dev/null +++ b/TC/telephony_TC/ss/unit/uts_tel_send_ss_ussd_cancel.h @@ -0,0 +1,28 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * 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 _UTS_TAPI_USSD_SEND_CANCEL_H_ +#define _UTS_TAPI_USSD_SEND_CANCEL_H_ + + static void utc_tel_send_ss_ussd_cancel_01(); + static void utc_tel_send_ss_ussd_cancel_02(); +#endif //_UTS_TAPI_USSD_SEND_CANCEL_H_ + diff --git a/TC/telephony_TC/ss/unit/uts_tel_send_ss_ussd_request.c b/TC/telephony_TC/ss/unit/uts_tel_send_ss_ussd_request.c new file mode 100644 index 0000000..85a91e8 --- /dev/null +++ b/TC/telephony_TC/ss/unit/uts_tel_send_ss_ussd_request.c @@ -0,0 +1,198 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * 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 "uts_tel_send_ss_ussd_request.h" + + +#include +#include +#include +#include +#include +#include +#include + +#include +#include "assert.h" +#include "glib.h" + +#include "TapiCommon.h" +#include +#include "string.h" + +#include "tet_tapi_util.h" + +/* Initialize TCM data structures */ +static void startup(); +static void cleanup(); +void (*tet_startup) () = startup; +void (*tet_cleanup) () = cleanup; +struct tet_testlist tet_testlist[] = { + {utc_tel_send_ss_ussd_request_01, 1}, + {utc_tel_send_ss_ussd_request_02, 2}, + {utc_tel_send_ss_ussd_request_03, 3}, + {NULL, 0} +}; + +/* Startup & Clean function : It is not test code, only for + initialize and finalize test module +*/ +static BOOL gStartupSuccess = FALSE; +static unsigned int subscription_id = 0; + +static void startup() +{ + tapi_dbus_connection_name dname; + int bStatus; + + gStartupSuccess = FALSE; + if(tel_init() == TAPI_API_SUCCESS) + { + if(tel_register_event(TAPI_EVENT_SS_USSD_CNF, &subscription_id, (TelAppCallback)ss_utc_callback,NULL) == TAPI_API_SUCCESS) + { + gStartupSuccess = TRUE; + + tel_register_app_name("org.samsung.test"); + if(tel_get_app_name(&dname)) + printf("Dbus Get app name error\n"); + else + printf("Dbus Name is %s\n",dname.name); + + tel_check_service_ready(&bStatus); + printf("Telephony service %d\n",bStatus); + } + else + tet_infoline("startup fail. tel_register_event()"); + }else { + tet_infoline("startup fail. tel_init() failed"); + } + + return; +} + +static void cleanup() +{ + if(gStartupSuccess == TRUE) + tel_deregister_event(subscription_id); + tel_deinit(); + return; +} + + +/** + * @brief This tests TelTapiUssdSendRequest() API in normal conditions + * @par ID: + * UTC_TAPI_USSD_SEND_REQUEST_001 + * @param [in] forward_type TAPI_CS_FORWARD_TYPE_VOICE_EV + * @param [in] Condition TAPI_SS_FORWARD_WHEN_UNCONDITIONAL_EV + * @param [out] RequestId + * @return TAPI_API_SUCCESS +*/ + +void utc_tel_send_ss_ussd_request_01() +{ + TET_STAMP_START("Positive Test"); + TapiResult_t ret_status = TAPI_API_SUCCESS; + TelSsUssdMsgInfo_t pAppMsg; + int pRequestId; + + char ussd_str[25] = {"*123*0#"}; + strncpy(pAppMsg.szUssdString, ussd_str, strlen(ussd_str)); + pAppMsg.UssdStringLength = strlen(pAppMsg.szUssdString); + + ret_status = tel_send_ss_ussd_request(&pAppMsg, &pRequestId); + tet_printf("%s",TET_RESULT_TO_STRING(ret_status)); + + TET_RESULT_IF_NOT_EQUAL_THEN_GOTO(TET_FAIL, exit, TAPI_API_SUCCESS, ret_status ); + G_MAIN_LOOP_RUN(5); + + tet_result(TET_PASS); +exit: + return; +} + +/** + * @brief Null testing of the pAppMsg for TelTapiUssdSendRequest() API + * @par ID: + * UTC_TAPI_USSD_SEND_REQUEST_002 + * @param [in] pAppMsg NULL + * @param [out] RequestId + * @return TAPI_API_INVALID_INPUT +*/ + +void utc_tel_send_ss_ussd_request_02() +{ + TET_STAMP_START("Test for null pAppMsg"); + + TapiResult_t ret_status = TAPI_API_SUCCESS; + TelSsUssdMsgInfo_t *pAppMsg=NULL; + int pRequestId; + + ret_status = tel_send_ss_ussd_request(pAppMsg, &pRequestId); + tet_printf("ret_status %d",ret_status); + tet_infoline("aaa"); + TET_RESULT_IF_EQUAL_THEN_GOTO(TET_PASS, exit, TAPI_API_INVALID_PTR,ret_status); + + G_MAIN_LOOP_RUN(7); + + tet_result(TET_FAIL); +exit: + return; +} + +/** + * @brief Null testing of the request ID for TelTapiUssdSendRequest() API + * @par ID: + * UTC_TAPI_USSD_SEND_REQUEST_003 + * @param [in] pAppMsg + * @code + pAppMsg.Dcs = 0x0f; + pAppMsg.IndType = TAPI_USSD_IND_NOTIFY; + char ussd_str[25] = {"*123*0#"}; + strcpy(pAppMsg.szUssdString,ussd_str); + pAppMsg.UssdStringLength = strlen(ussd_str); +* @endcode + * @param [out] RequestId NULL + * @return TAPI_API_INVALID_INPUT +*/ + + +void utc_tel_send_ss_ussd_request_03() +{ + TET_STAMP_START("Test for null pRequestId"); + + TapiResult_t ret_status = TAPI_API_SUCCESS; + TelSsUssdMsgInfo_t pAppMsg; + + char ussd_str[25] = {"*123*0#"}; + strncpy(pAppMsg.szUssdString, ussd_str, strlen(ussd_str)); + pAppMsg.UssdStringLength = strlen(ussd_str); + + ret_status = tel_send_ss_ussd_request(&pAppMsg, NULL); + + TET_RESULT_IF_EQUAL_THEN_GOTO(TET_PASS, exit, TAPI_API_INVALID_PTR,ret_status); + G_MAIN_LOOP_RUN(7); + + tet_result(TET_FAIL); +exit: + return; +} + diff --git a/TC/telephony_TC/ss/unit/uts_tel_send_ss_ussd_request.h b/TC/telephony_TC/ss/unit/uts_tel_send_ss_ussd_request.h new file mode 100644 index 0000000..b0396d1 --- /dev/null +++ b/TC/telephony_TC/ss/unit/uts_tel_send_ss_ussd_request.h @@ -0,0 +1,28 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * 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 _ITS_TAPI_USSD_SEND_REQUEST_H_ +#define _ITS_TAPI_USSD_SEND_REQUEST_H_ + + static void utc_tel_send_ss_ussd_request_01(); + static void utc_tel_send_ss_ussd_request_02(); + static void utc_tel_send_ss_ussd_request_03(); + +#endif //_ITS_TAPI_CALL_BARRING_ACT_H_ diff --git a/TC/telephony_TC/ss/unit/uts_tel_send_ss_ussd_response.c b/TC/telephony_TC/ss/unit/uts_tel_send_ss_ussd_response.c new file mode 100644 index 0000000..72ed039 --- /dev/null +++ b/TC/telephony_TC/ss/unit/uts_tel_send_ss_ussd_response.c @@ -0,0 +1,175 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * 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 "uts_tel_send_ss_ussd_response.h" + + +#include +#include +#include +#include +#include +#include +#include + +#include +#include "assert.h" +#include "glib.h" + +#include "TapiCommon.h" +#include +#include "string.h" + +#include "tet_tapi_util.h" + +/* Initialize TCM data structures */ +static void startup(); +static void cleanup(); +void (*tet_startup) () = startup; +void (*tet_cleanup) () = cleanup; +struct tet_testlist tet_testlist[] = { + {utc_tel_send_ss_ussd_response_01, 1}, + {utc_tel_send_ss_ussd_response_02, 2}, + {utc_tel_send_ss_ussd_response_03, 3}, + {NULL, 0} +}; + +/* Startup & Clean function : It is not test code, only for + initialize and finalize test module +*/ +static BOOL gStartupSuccess = FALSE; +static unsigned int subscription_id = 0; + +static void startup() +{ + tapi_dbus_connection_name dname; + int bStatus; + + gStartupSuccess = FALSE; + if(tel_init() == TAPI_API_SUCCESS) + { + if(tel_register_event(TAPI_EVENT_SS_USSD_CNF, &subscription_id, (TelAppCallback)ss_utc_callback,NULL) == TAPI_API_SUCCESS) + { + gStartupSuccess = TRUE; + tel_register_app_name("org.samsung.test"); + if(tel_get_app_name(&dname)) + printf("Dbus Get app name error\n"); + else + printf("Dbus Name is %s\n",dname.name); + + tel_check_service_ready(&bStatus); + printf("Telephony service %d\n",bStatus); + } + else + tet_infoline("startup fail. tel_register_event()"); + }else { + tet_infoline("startup fail. tel_init() failed"); + } + + return; +} + +static void cleanup() +{ + if(gStartupSuccess == TRUE) + tel_deregister_event(subscription_id); + tel_deinit(); + return; +} + + +/** + * @brief This tests TelTapiUssdSendRequest() API in normal conditions + * @par ID: + * UTC_TAPI_USSD_SEND_REQUEST_001 + * @param [in] forward_type TAPI_CS_FORWARD_TYPE_VOICE_EV + * @param [in] Condition TAPI_SS_FORWARD_WHEN_UNCONDITIONAL_EV + * @param [out] RequestId + * @return TAPI_API_SUCCESS +*/ + +void utc_tel_send_ss_ussd_response_01() +{ + TET_STAMP_START("Positive Test"); + TapiResult_t ret_status = TAPI_API_SUCCESS; + TelSsUssdMsgInfo_t pAppMsg; + int pRequestId; + + char ussd_str[25] = {"*123*0#"}; + strncpy(pAppMsg.szUssdString, ussd_str, TAPI_SS_USSD_DATA_SIZE_MAX); + pAppMsg.UssdStringLength = strlen(pAppMsg.szUssdString); + + ret_status = tel_send_ss_ussd_response(&pAppMsg, &pRequestId); +// tet_printf("%s",TET_RESULT_TO_STRING(ret_status)); + +// TET_RESULT_IF_NOT_EQUAL_THEN_GOTO(TET_FAIL, exit, TAPI_API_SUCCESS, ret_status ); + G_MAIN_LOOP_RUN(5); + + tet_result(TET_PASS); + return; +} + +void utc_tel_send_ss_ussd_response_02() +{ + TET_STAMP_START("Negative Test"); + TapiResult_t ret_status = TAPI_API_SUCCESS; + TelSsUssdMsgInfo_t pAppMsg; + int pRequestId; + + char ussd_str[25] = {"*123*0#"}; + strncpy(pAppMsg.szUssdString, ussd_str, TAPI_SS_USSD_DATA_SIZE_MAX); + pAppMsg.UssdStringLength = strlen(pAppMsg.szUssdString); + + ret_status = tel_send_ss_ussd_response(&pAppMsg, NULL); + if(ret_status ==TAPI_API_SUCCESS) + tet_result(TET_FAIL); +// tet_printf("%s",TET_RESULT_TO_STRING(ret_status)); + +// TET_RESULT_IF_NOT_EQUAL_THEN_GOTO(TET_FAIL, exit, TAPI_API_SUCCESS, ret_status ); + G_MAIN_LOOP_RUN(5); + + tet_result(TET_PASS); + return; +} + +void utc_tel_send_ss_ussd_response_03() +{ + TET_STAMP_START("Negative Test"); + TapiResult_t ret_status = TAPI_API_SUCCESS; + TelSsUssdMsgInfo_t pAppMsg; + int pRequestId; + + char ussd_str[25] = {"*123*0#"}; + strncpy(pAppMsg.szUssdString, ussd_str, TAPI_SS_USSD_DATA_SIZE_MAX); + pAppMsg.UssdStringLength = strlen(pAppMsg.szUssdString); + + ret_status = tel_send_ss_ussd_response(NULL, &pRequestId); + if(ret_status ==TAPI_API_SUCCESS) + tet_result(TET_FAIL); +// tet_printf("%s",TET_RESULT_TO_STRING(ret_status)); + +// TET_RESULT_IF_NOT_EQUAL_THEN_GOTO(TET_FAIL, exit, TAPI_API_SUCCESS, ret_status ); + G_MAIN_LOOP_RUN(5); + + tet_result(TET_PASS); + return; +} diff --git a/TC/telephony_TC/ss/unit/uts_tel_send_ss_ussd_response.h b/TC/telephony_TC/ss/unit/uts_tel_send_ss_ussd_response.h new file mode 100644 index 0000000..ce553e6 --- /dev/null +++ b/TC/telephony_TC/ss/unit/uts_tel_send_ss_ussd_response.h @@ -0,0 +1,31 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * 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 _UTS_TAPI_USSD_SEND_RSP_H_ +#define _UTS_TAPI_USSD_SEND_RSP_H_ + + + static void utc_tel_send_ss_ussd_response_01(); + static void utc_tel_send_ss_ussd_response_02(); + static void utc_tel_send_ss_ussd_response_03(); + +#endif //_UTS_TAPI_USSD_SEND_RSP_H_ + diff --git a/TC/telephony_TC/ss/unit/uts_tel_set_ss_aoc_info.c b/TC/telephony_TC/ss/unit/uts_tel_set_ss_aoc_info.c new file mode 100644 index 0000000..e35fbe3 --- /dev/null +++ b/TC/telephony_TC/ss/unit/uts_tel_set_ss_aoc_info.c @@ -0,0 +1,207 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * 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 +#include +#include + +#include +#include "assert.h" +#include "glib.h" + +#include "TapiCommon.h" +#include +#include "uts_tel_set_ss_aoc_info.h" +#include "tet_tapi_util.h" + +/* Initialize TCM data structures */ +static void startup(); +static void cleanup(); +void (*tet_startup) () = startup; +void (*tet_cleanup) () = cleanup; +struct tet_testlist tet_testlist[] = { + {utc_tel_set_ss_aoc_info_01, 1}, + {utc_tel_set_ss_aoc_info_02, 2}, + {utc_tel_set_ss_aoc_info_03, 3}, + {utc_tel_set_ss_aoc_info_04, 4}, + {utc_tel_set_ss_aoc_info_05, 5}, + {NULL, 0} +}; + +/* Startup & Clean function : It is not test code, only for + initialize and finalize test module +*/ +static BOOL gStartupSuccess = FALSE; +static unsigned int subscription_id = 0; + +static void startup() +{ + tapi_dbus_connection_name dname; + int bStatus; + + gStartupSuccess = FALSE; + if(tel_init() == TAPI_API_SUCCESS) + { + if(tel_register_event(TAPI_EVENT_SS_SET_AOC_CNF, &subscription_id, (TelAppCallback)ss_utc_callback,NULL) == TAPI_API_SUCCESS) + { + gStartupSuccess = TRUE; + + tel_register_app_name("org.samsung.test"); + if(tel_get_app_name(&dname)) + printf("Dbus Get app name error\n"); + else + printf("Dbus Name is %s\n",dname.name); + + tel_check_service_ready(&bStatus); + printf("Telephony service %d\n",bStatus); + + } + else + tet_infoline("startup fail. tel_register_event()"); + }else { + tet_infoline("startup fail. tel_init() failed"); + } + + return; +} + +static void cleanup() +{ + if(gStartupSuccess == TRUE) + tel_deregister_event(subscription_id); + tel_deinit(); + return; +} + +/** + * @brief This tests TelTapiReadAocInfoRequest() API in normal conditions + * @par ID: + * UTC_TAPI_SET_AOC_INFO_REQUEST_001 + * @param [in] aoc_type TAPI_SS_AOC_TYPE_CCM + * @param [out] RequestId +* @return TAPI_API_SUCCESS +*/ + +void utc_tel_set_ss_aoc_info_01() +{ + TET_STAMP_START("Positive Test"); + + TapiResult_t ret_status = TAPI_API_SUCCESS; + int request_id; + TelCallAocInfo_t aocInfo; + + aocInfo.AocType=TAPI_SS_AOC_TYPE_MAXACM; + aocInfo.MaxAcm=10; + + ret_status = tel_set_ss_aoc_info(&aocInfo,&request_id); + + TET_RESULT_IF_NOT_EQUAL_THEN_GOTO(TET_FAIL, exit, TAPI_API_SUCCESS, ret_status ); + G_MAIN_LOOP_RUN(5); + + tet_result(TET_PASS); +exit: + return; +} + + +/** + * @brief Lower boundary testing of the AoC type for TelTapiReadAocInfoRequest() API + * @par ID: + * UTC_TAPI_SET_AOC_INFO_REQUEST_002 + * @param [in] aoc_type -1 + * @param [out] RequestId +* @return TAPI_API_INVALID_INPUT +*/ +void utc_tel_set_ss_aoc_info_02() +{ + + TET_STAMP_START("InvalidAocType -1"); + + TapiResult_t ret_status = TAPI_API_SUCCESS; + int request_id; + TelCallAocInfo_t aocInfo; + + aocInfo.AocType=(TelSsAocType_t)-1; + aocInfo.MaxAcm=10; + + ret_status = tel_set_ss_aoc_info(&aocInfo,&request_id); + + TET_RESULT_IF_NOT_EQUAL_THEN_GOTO(TET_PASS, exit, TAPI_API_INVALID_INPUT, ret_status ); + G_MAIN_LOOP_RUN(5); + + tet_result(TET_PASS); +exit: + return; +} + +void utc_tel_set_ss_aoc_info_03() +{ + TET_STAMP_START("Invalid AocType +1"); + TapiResult_t ret_status=TAPI_API_SUCCESS; + int request_id; + TelCallAocInfo_t aocInfo; + aocInfo.AocType=(TelSsAocType_t)( TAPI_SS_AOC_TYPE_PUC+1); + aocInfo.MaxAcm=10; + ret_status = tel_set_ss_aoc_info(&aocInfo,&request_id); + + TET_RESULT_IF_NOT_EQUAL_THEN_GOTO(TET_PASS,exit,TAPI_API_INVALID_INPUT,ret_status); + G_MAIN_LOOP_RUN(50); + + tet_result(TET_PASS); + +exit: + return; +} + +void utc_tel_set_ss_aoc_info_04() +{ + TET_STAMP_START("NULL RequestId"); + TapiResult_t ret_status=TAPI_API_SUCCESS; + TelCallAocInfo_t aocInfo; + aocInfo.AocType=TAPI_SS_AOC_TYPE_MAXACM; + aocInfo.MaxAcm=10; + ret_status = tel_set_ss_aoc_info(&aocInfo,NULL); + + TET_RESULT_IF_NOT_EQUAL_THEN_GOTO(TET_PASS,exit,TAPI_API_INVALID_INPUT,ret_status); + G_MAIN_LOOP_RUN(50); + tet_result(TET_PASS); +exit: + return; +} + + +void utc_tel_set_ss_aoc_info_05() +{ + TET_STAMP_START("NULL AocInfo"); + TapiResult_t ret_status=TAPI_API_SUCCESS; + int request_id; + ret_status = tel_set_ss_aoc_info(NULL,&request_id); + + TET_RESULT_IF_NOT_EQUAL_THEN_GOTO(TET_PASS,exit,TAPI_API_INVALID_INPUT,ret_status); + G_MAIN_LOOP_RUN(50); + tet_result(TET_PASS); +exit: + return; +} + diff --git a/TC/telephony_TC/ss/unit/uts_tel_set_ss_aoc_info.h b/TC/telephony_TC/ss/unit/uts_tel_set_ss_aoc_info.h new file mode 100644 index 0000000..ba02c28 --- /dev/null +++ b/TC/telephony_TC/ss/unit/uts_tel_set_ss_aoc_info.h @@ -0,0 +1,31 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * 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 _UTS_TAPI_SET_AOC_INFO_REQUEST_H_ +#define _UTS_TAPI_SET_AOC_INFO_REQUEST_H_ + +static void utc_tel_set_ss_aoc_info_01(); +static void utc_tel_set_ss_aoc_info_02(); +static void utc_tel_set_ss_aoc_info_03(); +static void utc_tel_set_ss_aoc_info_04(); +static void utc_tel_set_ss_aoc_info_05(); + +#endif //_ITS_TAPI_CALL_BARRING_ACT_H_ diff --git a/TC/telephony_TC/ss/unit/uts_tel_set_ss_barring.c b/TC/telephony_TC/ss/unit/uts_tel_set_ss_barring.c new file mode 100644 index 0000000..b2ea7ef --- /dev/null +++ b/TC/telephony_TC/ss/unit/uts_tel_set_ss_barring.c @@ -0,0 +1,534 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * 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 +#include +#include +#include + +#include +#include "assert.h" +#include "glib.h" + +#include "TapiCommon.h" +//#include "tapi_utility.h" +#include +//#include "tapi_proxy_utility.h" +#include "string.h" + +#include "tet_tapi_util.h" +#include "uts_tel_set_ss_barring.h" +#include + +/* Initialize TCM data structures */ +static void startup(); +static void cleanup(); +void (*tet_startup) () = startup; +void (*tet_cleanup) () = cleanup; +struct tet_testlist tet_testlist[] = { + {utc_tel_set_ss_barring_01, 1}, + {utc_tel_set_ss_barring_02, 2}, + {utc_tel_set_ss_barring_03, 3}, + {utc_tel_set_ss_barring_04, 4}, + {utc_tel_set_ss_barring_05, 5}, + {utc_tel_set_ss_barring_06, 6}, + {utc_tel_set_ss_barring_07, 7}, + {utc_tel_set_ss_barring_08, 8}, + {utc_tel_set_ss_barring_09, 9}, + {utc_tel_set_ss_barring_10, 10}, + {utc_tel_set_ss_barring_11, 11}, + {NULL, 0} +}; + +/* Startup & Clean function : It is not test code, only for + initialize and finalize test module +*/ +static int gStartupSuccess = FALSE; +static unsigned int subscription_id = 0; + +static void startup() +{ + tapi_dbus_connection_name dname; + int bStatus; + + gStartupSuccess = FALSE; + if(tel_init() == TAPI_API_SUCCESS) + { + if(tel_register_event(TAPI_EVENT_SS_BARRING_CNF, &subscription_id, (TelAppCallback)ss_utc_callback,NULL) == TAPI_API_SUCCESS) + { + gStartupSuccess = TRUE; + tel_register_app_name("org.samsung.test"); + if(tel_get_app_name(&dname)) + printf("Dbus Get app name error\n"); + else + printf("Dbus Name is %s\n",dname.name); + + tel_check_service_ready(&bStatus); + printf("Telephony service %d\n",bStatus); + + } + else + tet_infoline("startup fail. tel_register_event()"); + }else { + tet_infoline("startup fail. tel_init() failed"); + } + + return; +} + +static void cleanup() +{ + //Erase the service registration + TelSsCallBarringInfo_t pBarringInfo;// = {0,}; + int pRequestId=0; + char bar_pwd[5]=BARRING_PWD;//{'0','0','0','0',}; + pBarringInfo.Mode = TAPI_SS_CALL_BAR_DEACTIVATE; + pBarringInfo.Type = TAPI_CALL_BARRING_ALL; + pBarringInfo.CallType = TAPI_CALL_TYPE_ALL_TELE; + strncpy(pBarringInfo.szPassword, bar_pwd, TAPI_SS_GSM_BARR_PW_LEN_MAX); + + tel_set_ss_barring(&pBarringInfo,&pRequestId); + G_MAIN_LOOP_RUN(5); + + if(gStartupSuccess == TRUE) + tel_deregister_event(subscription_id); + tel_deinit(); + return; +} + + +/** + * @brief This tests TelTapiSsSetCallBarring() API in normal conditions + * @par ID: + * UTC_TAPI_SS_SET_CALL_BARRING_001 + * @param [in] pBarringInfo + * @code + char bar_pwd[5]="0000"; + pBarringInfo.Mode = TAPI_SS_CALL_BAR_DEACTIVATE; + pBarringInfo.Type = TAPI_CALL_BARRING_ALL_OUTGOING_CALLS; + pBarringInfo.CallType = TAPI_CALL_TYPE_VOICE_EV; + strcpy(pBarringInfo.szPassword,bar_pwd); +* @endcode +* @param [out] RequestId +* @return TAPI_API_SUCCESS +*/ + +void utc_tel_set_ss_barring_01() +{ + TET_STAMP_START("Positive Test"); + + TapiResult_t ret_status = TAPI_API_SUCCESS; + TelSsCallBarringInfo_t pBarringInfo;// = {0,}; + int pRequestId=0; + char bar_pwd[5]=BARRING_PWD;//{'0','0','0','0',}; + pBarringInfo.Mode = TAPI_SS_CALL_BAR_DEACTIVATE; + pBarringInfo.Type = TAPI_CALL_BARRING_ALL_OUTGOING_CALLS; + pBarringInfo.CallType = TAPI_CALL_TYPE_VOICE_EV; + strncpy(pBarringInfo.szPassword,bar_pwd,4); + + ret_status = tel_set_ss_barring(&pBarringInfo,&pRequestId); + TET_RESULT_IF_NOT_EQUAL_THEN_GOTO(TET_FAIL, exit, TAPI_API_SUCCESS, ret_status ); + G_MAIN_LOOP_RUN(5); + + tet_result(TET_PASS); +exit: + return; +} + + +/** + * @brief Lower boundary testing of the barring mode for TelTapiSsSetCallBarring() API + * @par ID: + * UTC_TAPI_SS_SET_CALL_BARRING_002 + * @param [in] pBarringInfo + * @code + char bar_pwd[5] ="0000"; + pBarringInfo.Mode = (TelSsCallBarOperationMode_t)-1;//TAPI_SS_CALL_BAR_DEACTIVATE+1 + pBarringInfo.Type = TAPI_CALL_BARRING_ALL_OUTGOING_CALLS;//TAPI_CALL_BARRING_ALL_INCOMING_CALLS_INSIM+1 + pBarringInfo.CallType = TAPI_CALL_TYPE_VOICE_EV;//TAPI_CALL_TYPE_DATA_CIRCUIT_SYNC_EV+1 + strcpy(pBarringInfo.szPassword,bar_pwd); +* @endcode +* @param [out] RequestId +* @return TAPI_API_INVALID_INPUT +*/ + +void utc_tel_set_ss_barring_02() +{ + TET_STAMP_START("Invalid Operation Mode -1"); + TapiResult_t ret_status = TAPI_API_SUCCESS; + TelSsCallBarringInfo_t pBarringInfo;// = {0,}; + + int pRequestId=0; + char bar_pwd[5] =BARRING_PWD; + pBarringInfo.Mode = (TelSsCallBarOperationMode_t)-1;//TAPI_SS_CALL_BAR_DEACTIVATE+1 + pBarringInfo.Type = TAPI_CALL_BARRING_ALL_OUTGOING_CALLS;//TAPI_CALL_BARRING_ALL_INCOMING_CALLS_INSIM+1 + pBarringInfo.CallType = TAPI_CALL_TYPE_VOICE_EV;//TAPI_CALL_TYPE_DATA_CIRCUIT_SYNC_EV+1 + strncpy(pBarringInfo.szPassword,bar_pwd,4); + + ret_status = tel_set_ss_barring(&pBarringInfo,&pRequestId); + TET_RESULT_IF_EQUAL_THEN_GOTO(TET_PASS, exit, TAPI_API_INVALID_INPUT, ret_status); + + G_MAIN_LOOP_RUN(5); + + tet_result(TET_FAIL); +exit: + return; +} + +/** + * @brief Upper boundary testing of the barring mode for TelTapiSsSetCallBarring() API + * @par ID: + * UTC_TAPI_SS_SET_CALL_BARRING_003 + * @param [in] pBarringInfo + * @code + char bar_pwd[5] ="0000"; + pBarringInfo.Mode = (TelSsCallBarOperationMode_t)-1;//TAPI_SS_CALL_BAR_DEACTIVATE+1 + pBarringInfo.Type = TAPI_CALL_BARRING_ALL_OUTGOING_CALLS;//TAPI_CALL_BARRING_ALL_INCOMING_CALLS_INSIM+1 + pBarringInfo.CallType = TAPI_CALL_TYPE_VOICE_EV;//TAPI_CALL_TYPE_DATA_CIRCUIT_SYNC_EV+1 + strcpy(pBarringInfo.szPassword,bar_pwd); +* @endcode +* @param [out] RequestId +* @return TAPI_API_INVALID_INPUT +*/ + +void utc_tel_set_ss_barring_03() +{ + TET_STAMP_START("Invalid Operation Mode +1"); + TapiResult_t ret_status = TAPI_API_SUCCESS; + TelSsCallBarringInfo_t pBarringInfo;// = {0,}; + + int pRequestId=0; + char bar_pwd[5] =BARRING_PWD; + pBarringInfo.Mode = (TelSsCallBarOperationMode_t)(TAPI_SS_CALL_BAR_DEACTIVATE+1); + pBarringInfo.Type = TAPI_CALL_BARRING_ALL_OUTGOING_CALLS; + pBarringInfo.CallType = TAPI_CALL_TYPE_VOICE_EV; + strncpy(pBarringInfo.szPassword, bar_pwd, TAPI_SS_GSM_BARR_PW_LEN_MAX); + + ret_status = tel_set_ss_barring(&pBarringInfo,&pRequestId); + + TET_RESULT_IF_EQUAL_THEN_GOTO(TET_PASS, exit, TAPI_API_INVALID_INPUT, ret_status); + + G_MAIN_LOOP_RUN(5); + + tet_result(TET_FAIL); +exit: + return;} + +/** + * @brief Lower boundary testing of the call type for TelTapiSsSetCallBarring() API + * @par ID: + * UTC_TAPI_SS_SET_CALL_BARRING_004 + * @param [in] pBarringInfo + * @code + char bar_pwd[5] ="0000"; + pBarringInfo.Mode = TAPI_SS_CALL_BAR_ACTIVATE; + pBarringInfo.Type = TAPI_CALL_BARRING_ALL_OUTGOING_CALLS; + pBarringInfo.CallType = (TelSsCallType_t)-1; + strcpy(pBarringInfo.szPassword,bar_pwd); +* @endcode +* @param [out] RequestId +* @return TAPI_API_INVALID_INPUT +*/ + +void utc_tel_set_ss_barring_04() +{ + TET_STAMP_START("Invalid Call Type -1"); + TapiResult_t ret_status = TAPI_API_SUCCESS; + TelSsCallBarringInfo_t pBarringInfo;// = {0,}; + + int pRequestId=0; + char bar_pwd[5] =BARRING_PWD; + pBarringInfo.Mode = TAPI_SS_CALL_BAR_ACTIVATE; + pBarringInfo.Type = TAPI_CALL_BARRING_ALL_OUTGOING_CALLS; + pBarringInfo.CallType = (TelSsCallType_t)-1; + strncpy(pBarringInfo.szPassword, bar_pwd, TAPI_SS_GSM_BARR_PW_LEN_MAX); + + ret_status = tel_set_ss_barring(&pBarringInfo,&pRequestId); + TET_RESULT_IF_EQUAL_THEN_GOTO(TET_PASS, exit, TAPI_API_INVALID_INPUT, ret_status); + + G_MAIN_LOOP_RUN(5); + + tet_result(TET_FAIL); +exit: + return;} + +/** + * @brief Upper boundary testing of the call type for TelTapiSsSetCallBarring() API + * @par ID: + * UTC_TAPI_SS_SET_CALL_BARRING_005 + * @param [in] pBarringInfo + * @code + char bar_pwd[5] ="0000"; + pBarringInfo.Mode = TAPI_SS_CALL_BAR_ACTIVATE; + pBarringInfo.Type = TAPI_CALL_BARRING_ALL_OUTGOING_CALLS; + pBarringInfo.CallType = (TelSsCallType_t)TAPI_CALL_TYPE_ALL_TELE+1; + strcpy(pBarringInfo.szPassword,bar_pwd); +* @endcode +* @param [out] RequestId +* @return TAPI_API_INVALID_INPUT +*/ + +void utc_tel_set_ss_barring_05() +{ + TET_STAMP_START("Invalid Call Type +1"); + TapiResult_t ret_status = TAPI_API_SUCCESS; + TelSsCallBarringInfo_t pBarringInfo;// = {0,}; + + int pRequestId=0; + char bar_pwd[5] =BARRING_PWD; + pBarringInfo.Mode = TAPI_SS_CALL_BAR_ACTIVATE; + pBarringInfo.Type = TAPI_CALL_BARRING_ALL_OUTGOING_CALLS;//TAPI_CALL_BARRING_ALL_INCOMING_CALLS_INSIM+1 + pBarringInfo.CallType = (TelSsCallType_t)TAPI_CALL_TYPE_ALL_TELE+1; + strncpy(pBarringInfo.szPassword, bar_pwd, TAPI_SS_GSM_BARR_PW_LEN_MAX); + + ret_status = tel_set_ss_barring(&pBarringInfo,&pRequestId); + TET_RESULT_IF_EQUAL_THEN_GOTO(TET_PASS, exit, TAPI_API_INVALID_INPUT, ret_status); + + G_MAIN_LOOP_RUN(5); + + tet_result(TET_FAIL); +exit: + return; +} + +/** + * @brief Lower boundary testing of the barring type for TelTapiSsSetCallBarring() API + * @par ID: + * UTC_TAPI_SS_SET_CALL_BARRING_006 + * @param [in] pBarringInfo + * @code + char bar_pwd[5] ="0000"; + pBarringInfo.Mode = TAPI_SS_CALL_BAR_ACTIVATE; + pBarringInfo.Type = (TelSsCallBarType_t)-1; + pBarringInfo.CallType = TAPI_CALL_TYPE_VOICE_EV; + strcpy(pBarringInfo.szPassword,bar_pwd); +* @endcode +* @param [out] RequestId +* @return TAPI_API_INVALID_INPUT +*/ + +void utc_tel_set_ss_barring_06() +{ + TET_STAMP_START("Invalid Barring Type -1"); + TapiResult_t ret_status = TAPI_API_SUCCESS; + TelSsCallBarringInfo_t pBarringInfo;// = {0,}; + + int pRequestId=0; + char bar_pwd[5] =BARRING_PWD; + pBarringInfo.Mode = TAPI_SS_CALL_BAR_ACTIVATE; + pBarringInfo.Type = (TelSsCallBarType_t)-1;//TAPI_CALL_BARRING_ALL_OUTGOING_CALLS;//TAPI_CALL_BARRING_ALL_INCOMING_CALLS_INSIM+1 + pBarringInfo.CallType = TAPI_CALL_TYPE_VOICE_EV;//TAPI_CALL_TYPE_DATA_CIRCUIT_SYNC_EV+1 + strncpy(pBarringInfo.szPassword, bar_pwd, TAPI_SS_GSM_BARR_PW_LEN_MAX); + + ret_status = tel_set_ss_barring(&pBarringInfo,&pRequestId); + TET_RESULT_IF_EQUAL_THEN_GOTO(TET_PASS, exit, TAPI_API_INVALID_INPUT, ret_status); + + G_MAIN_LOOP_RUN(5); + + tet_result(TET_FAIL); +exit: + return; +} + +/** + * @brief Upper boundary testing of the barring type for TelTapiSsSetCallBarring() API + * @par ID: + * UTC_TAPI_SS_SET_CALL_BARRING_007 + * @param [in] pBarringInfo + * @code + char bar_pwd[5] ="0000"; + pBarringInfo.Mode = TAPI_SS_CALL_BAR_ACTIVATE; + pBarringInfo.Type = (TelSsCallBarType_t)(TAPI_CALL_BARRING_ALL_INCOMING_CALLS_INSIM+1); + pBarringInfo.CallType = TAPI_CALL_TYPE_VOICE_EV; + strcpy(pBarringInfo.szPassword,bar_pwd); +* @endcode +* @param [out] RequestId +* @return TAPI_API_INVALID_INPUT +*/ + + +void utc_tel_set_ss_barring_07() +{ + TET_STAMP_START("Invalid Barring Type +1"); + TapiResult_t ret_status = TAPI_API_SUCCESS; + TelSsCallBarringInfo_t pBarringInfo;// = {0,}; + + int pRequestId=0; + char bar_pwd[5] =BARRING_PWD; + pBarringInfo.Mode = TAPI_SS_CALL_BAR_ACTIVATE; + pBarringInfo.Type = (TelSsCallBarType_t)(TAPI_CALL_BARRING_ALL_INCOMING_CALLS_INSIM+1); + pBarringInfo.CallType = TAPI_CALL_TYPE_VOICE_EV;//TAPI_CALL_TYPE_DATA_CIRCUIT_SYNC_EV+1 + strncpy(pBarringInfo.szPassword, bar_pwd, TAPI_SS_GSM_BARR_PW_LEN_MAX); + + ret_status = tel_set_ss_barring(&pBarringInfo,&pRequestId); + TET_RESULT_IF_EQUAL_THEN_GOTO(TET_PASS, exit, TAPI_API_INVALID_INPUT, ret_status); + + G_MAIN_LOOP_RUN(5); + + tet_result(TET_FAIL); +exit: + return; +} + +/** + * @brief Error handling for the invaild long password of TelTapiSsSetCallBarring() API + * @par ID: + * UTC_TAPI_SS_SET_CALL_BARRING_008 + * @param [in] pBarringInfo + * @code + char bar_pwd[6] ="00000"; + pBarringInfo.Mode = TAPI_SS_CALL_BAR_ACTIVATE; + pBarringInfo.Type = TAPI_CALL_BARRING_ALL_OUTGOING_CALLS;//TAPI_CALL_BARRING_ALL_INCOMING_CALLS_INSIM+1 + pBarringInfo.CallType = TAPI_CALL_TYPE_VOICE_EV;//TAPI_CALL_TYPE_DATA_CIRCUIT_SYNC_EV+1 + strcpy(pBarringInfo.szPassword,bar_pwd); +* @endcode +* @param [out] RequestId +* @return TAPI_API_INVALID_INPUT +*/ + +void utc_tel_set_ss_barring_08() +{ + TET_STAMP_START("Invalid short password"); + TapiResult_t ret_status = TAPI_API_SUCCESS; + TelSsCallBarringInfo_t pBarringInfo;// = {0,}; + + int pRequestId=0; + char bar_pwd[6] ="000"; + pBarringInfo.Mode = TAPI_SS_CALL_BAR_ACTIVATE; + pBarringInfo.Type = TAPI_CALL_BARRING_ALL_OUTGOING_CALLS;//TAPI_CALL_BARRING_ALL_INCOMING_CALLS_INSIM+1 + pBarringInfo.CallType = TAPI_CALL_TYPE_VOICE_EV;//TAPI_CALL_TYPE_DATA_CIRCUIT_SYNC_EV+1 + strncpy(pBarringInfo.szPassword,bar_pwd,4); + + ret_status = tel_set_ss_barring(&pBarringInfo,&pRequestId); + TET_RESULT_IF_EQUAL_THEN_GOTO(TET_PASS, exit, TAPI_API_INVALID_INPUT, ret_status); + + G_MAIN_LOOP_RUN(5); + + tet_result(TET_FAIL); +exit: + return; +} + +/** + * @brief Error handling for the invaild long password of TelTapiSsSetCallBarring() API + * @par ID: + * UTC_TAPI_SS_SET_CALL_BARRING_009 + * @param [in] pBarringInfo + * @code + char bar_pwd[6] ="00000"; + pBarringInfo.Mode = TAPI_SS_CALL_BAR_ACTIVATE; + pBarringInfo.Type = TAPI_CALL_BARRING_ALL_OUTGOING_CALLS;//TAPI_CALL_BARRING_ALL_INCOMING_CALLS_INSIM+1 + pBarringInfo.CallType = TAPI_CALL_TYPE_VOICE_EV;//TAPI_CALL_TYPE_DATA_CIRCUIT_SYNC_EV+1 + strcpy(pBarringInfo.szPassword,bar_pwd); +* @endcode +* @param [out] RequestId +* @return TAPI_API_INVALID_INPUT +*/ + +void utc_tel_set_ss_barring_09() +{ + TET_STAMP_START("Null RequestId"); + TapiResult_t ret_status = TAPI_API_SUCCESS; + TelSsCallBarringInfo_t pBarringInfo;// = {0,}; + + char bar_pwd[5] ="0000"; + pBarringInfo.Mode = TAPI_SS_CALL_BAR_ACTIVATE; + pBarringInfo.Type = TAPI_CALL_BARRING_ALL_OUTGOING_CALLS;//TAPI_CALL_BARRING_ALL_INCOMING_CALLS_INSIM+1 + pBarringInfo.CallType = TAPI_CALL_TYPE_VOICE_EV;//TAPI_CALL_TYPE_DATA_CIRCUIT_SYNC_EV+1 + strncpy(pBarringInfo.szPassword, bar_pwd, TAPI_SS_GSM_BARR_PW_LEN_MAX); + + ret_status = tel_set_ss_barring(&pBarringInfo,NULL); + TET_RESULT_IF_EQUAL_THEN_GOTO(TET_PASS, exit, TAPI_API_INVALID_PTR, ret_status ); + G_MAIN_LOOP_RUN(7); + + tet_result(TET_FAIL); +exit: + return; +} + +/** + * @brief Null testing for pBarringInfo of TelTapiSsSetCallBarring() API + * @par ID: + * UTC_TAPI_SS_SET_CALL_BARRING_010 + * @param [in] pBarringInfo NULL + * @param [out] RequestId +* @return TAPI_API_INVALID_PTR +*/ + +void utc_tel_set_ss_barring_10() +{ + TET_STAMP_START("Null BarringInfo"); + TapiResult_t ret_status = TAPI_API_SUCCESS; + + int pRequestId=0; + + ret_status = tel_set_ss_barring(NULL,&pRequestId); + TET_RESULT_IF_EQUAL_THEN_GOTO(TET_PASS, exit, TAPI_API_INVALID_PTR, ret_status ); + G_MAIN_LOOP_RUN(7); + + tet_result(TET_FAIL); +exit: + return; +} + +/** + * @brief Null testing for the barring password of TelTapiSsSetCallBarring() API + * @par ID: + * UTC_TAPI_SS_SET_CALL_BARRING_011 + * @param [in] pBarringInfo + * @code + char *bar_pwd = NULL; + pBarringInfo.Mode = TAPI_SS_CALL_BAR_ACTIVATE; + pBarringInfo.Type = TAPI_CALL_BARRING_ALL_OUTGOING_CALLS; + pBarringInfo.CallType = TAPI_CALL_TYPE_VOICE_EV; +* @endcode + * @param [out] RequestId +* @return TAPI_API_INVALID_INPUT +*/ + +void utc_tel_set_ss_barring_11() +{ + TET_STAMP_START("Test for null password"); + TapiResult_t ret_status = TAPI_API_SUCCESS; + TelSsCallBarringInfo_t pBarringInfo;// = {0,}; + + int pRequestId=0; + char *bar_pwd = "\0"; + + pBarringInfo.Mode = TAPI_SS_CALL_BAR_ACTIVATE; + pBarringInfo.Type = TAPI_CALL_BARRING_ALL_OUTGOING_CALLS;//TAPI_CALL_BARRING_ALL_INCOMING_CALLS_INSIM+1 + pBarringInfo.CallType = TAPI_CALL_TYPE_VOICE_EV;//TAPI_CALL_TYPE_DATA_CIRCUIT_SYNC_EV+1 + strncpy(pBarringInfo.szPassword, bar_pwd, TAPI_SS_GSM_BARR_PW_LEN_MAX); + + ret_status = tel_set_ss_barring(&pBarringInfo,&pRequestId); + TET_RESULT_IF_EQUAL_THEN_GOTO(TET_PASS, exit, TAPI_API_INVALID_INPUT, ret_status ); + G_MAIN_LOOP_RUN(7); + + tet_result(TET_FAIL); +exit: + return; +} + +/** @} */ diff --git a/TC/telephony_TC/ss/unit/uts_tel_set_ss_barring.h b/TC/telephony_TC/ss/unit/uts_tel_set_ss_barring.h new file mode 100644 index 0000000..cbb9f08 --- /dev/null +++ b/TC/telephony_TC/ss/unit/uts_tel_set_ss_barring.h @@ -0,0 +1,37 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * 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 _UTS_TAPI_SET_CALL_BARRING_H_ +#define _UTS_TAPI_SET_CALL_BARRING_H_ + + static void utc_tel_set_ss_barring_01(); + static void utc_tel_set_ss_barring_02(); + static void utc_tel_set_ss_barring_03(); + static void utc_tel_set_ss_barring_04(); + static void utc_tel_set_ss_barring_05(); + static void utc_tel_set_ss_barring_06(); + static void utc_tel_set_ss_barring_07(); + static void utc_tel_set_ss_barring_08(); + static void utc_tel_set_ss_barring_09(); + static void utc_tel_set_ss_barring_10(); + static void utc_tel_set_ss_barring_11(); + +#endif //_UTS_TAPI_CALL_BARRING_ACT_H_ + diff --git a/TC/telephony_TC/ss/unit/uts_tel_set_ss_forward.c b/TC/telephony_TC/ss/unit/uts_tel_set_ss_forward.c new file mode 100644 index 0000000..6046f68 --- /dev/null +++ b/TC/telephony_TC/ss/unit/uts_tel_set_ss_forward.c @@ -0,0 +1,520 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * 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 +#include +#include +#include + +#include +#include "assert.h" +#include "glib.h" + +#include "TapiCommon.h" +#include +#include "string.h" + +#include "tet_tapi_util.h" +#include "uts_tel_set_ss_forward.h" +#include "ss_common.h" + +/* Initialize TCM data structures */ +static void startup(); +static void cleanup(); +void (*tet_startup) () = startup; +void (*tet_cleanup) () = cleanup; +struct tet_testlist tet_testlist[] = { + {utc_tel_set_ss_forward_01, 1}, + {utc_tel_set_ss_forward_02, 2}, + {utc_tel_set_ss_forward_03, 3}, + {utc_tel_set_ss_forward_04, 4}, + {utc_tel_set_ss_forward_05, 5}, + {utc_tel_set_ss_forward_06, 6}, + {utc_tel_set_ss_forward_07, 7}, + {utc_tel_set_ss_forward_08, 8}, + {utc_tel_set_ss_forward_09, 9}, + {NULL, 0} +}; + +/* Startup & Clean function : It is not test code, only for + initialize and finalize test module +*/ +static BOOL gStartupSuccess = FALSE; +static unsigned int subscription_id = 0; + +static void startup() +{ + tapi_dbus_connection_name dname; + int bStatus; + + gStartupSuccess = FALSE; + if(tel_init() == TAPI_API_SUCCESS) + { + if(tel_register_event(TAPI_EVENT_SS_FORWARD_CNF, &subscription_id, (TelAppCallback)ss_utc_callback,NULL) == TAPI_API_SUCCESS) + { + gStartupSuccess = TRUE; + + tel_register_app_name("org.samsung.test"); + if(tel_get_app_name(&dname)) + printf("Dbus Get app name error\n"); + else + printf("Dbus Name is %s\n",dname.name); + + tel_check_service_ready(&bStatus); + printf("Telephony service %d\n",bStatus); + + } + else + tet_infoline("startup fail. tel_register_event()"); + }else { + tet_infoline("startup fail. tel_init() failed"); + } + + return; +} + +static void cleanup() +{ + //Erase the service registration + TelSsForwardInfo_t pForwardInfo; + int len; + + int pRequestId=0; + pForwardInfo.Mode = TAPI_CALL_FORWARD_MODE_ERASURE_EV; + pForwardInfo.Type = TAPI_CS_FORWARD_TYPE_ALL_TELE; + pForwardInfo.Condition = TAPI_SS_FORWARD_WHEN_ALL_CONDITIONAL_EV; + pForwardInfo.NoReplyConditionTimer = 0; + + char cf_number[20]= {FWD_NUM}; + len = strlen(cf_number); + strncpy(pForwardInfo.szPhoneNumber, cf_number, TAPI_CALL_DIALDIGIT_LEN_MAX); + + tel_set_ss_forward(&pForwardInfo,&pRequestId); + G_MAIN_LOOP_RUN(5); + printf("CF ERASE\n"); + if(gStartupSuccess == TRUE) + tel_deregister_event(subscription_id); + tel_deinit(); + return; +} + + +/** + * @brief This tests TelTapiSsSetCallForwarding() API in normal conditions + * @par ID: + * UTC_TAPI_SS_SET_CALL_FORWARDING_001 + * @param [in] pForwardInfo + * @code + pForwardInfo.Mode = TAPI_CALL_FORWARD_MODE_REGISTRATION_EV; + pForwardInfo.Type = TAPI_CS_FORWARD_TYPE_VOICE_EV; + pForwardInfo.Condition = TAPI_SS_FORWARD_WHEN_UNCONDITIONAL_EV; + pForwardInfo.NoReplyConditionTimer = 0; + char cf_number[20]= {FWD_NUM}; + len = strlen(cf_number); + strcpy(pForwardInfo.szPhoneNumber,cf_number); +* @endcode +* @param [out] RequestId +* @return TAPI_API_SUCCESS +*/ + +void utc_tel_set_ss_forward_01() +{ + TET_STAMP_START("This tests TelTapiSsSetCallForwarding() API in normal conditions"); + TapiResult_t ret_status = TAPI_API_SUCCESS; + TelSsForwardInfo_t pForwardInfo; + int len; + + int pRequestId=0; + pForwardInfo.Mode = TAPI_CALL_FORWARD_MODE_REGISTRATION_EV; + pForwardInfo.Type = TAPI_CS_FORWARD_TYPE_VOICE_EV; + pForwardInfo.Condition = TAPI_SS_FORWARD_WHEN_UNCONDITIONAL_EV; + pForwardInfo.NoReplyConditionTimer = 0; + + char cf_number[20]= {FWD_NUM}; + len = strlen(cf_number); + strncpy(pForwardInfo.szPhoneNumber, cf_number, TAPI_CALL_DIALDIGIT_LEN_MAX); + + printf("CF REGISTRATION\n"); + ret_status = tel_set_ss_forward(&pForwardInfo,&pRequestId); + + TET_RESULT_IF_NOT_EQUAL_THEN_GOTO(TET_FAIL, exit, TAPI_API_SUCCESS, ret_status ); + G_MAIN_LOOP_RUN(5); + + tet_result(TET_PASS); +exit: + return; +} + +/** + * @brief Lower boundary testing of the forward mode for TelTapiSsSetCallForwarding() API + * @par ID: + * UTC_TAPI_SS_SET_CALL_FORWARDING_002 + * @param [in] pForwardInfo + * @code + pForwardInfo.Mode = (TelSsForwardMode_t)-1; + pForwardInfo.Type = TAPI_CS_FORWARD_TYPE_VOICE_EV; + pForwardInfo.Condition = TAPI_SS_FORWARD_WHEN_UNCONDITIONAL_EV; + pForwardInfo.NoReplyConditionTimer = 10; + char cf_number[20]= {FWD_NUM}; + len = strlen(cf_number); + strcpy(pForwardInfo.szPhoneNumber,cf_number); +* @endcode +* @param [out] RequestId +* @return TAPI_API_INVALID_INPUT +*/ + +void utc_tel_set_ss_forward_02() +{ + TET_STAMP_START("Invalid forward mode -1"); + //invalid mode + TapiResult_t ret_status = TAPI_API_SUCCESS; + + int pRequestId=0; + TelSsForwardInfo_t pForwardInfo; + pForwardInfo.Mode = (TelSsForwardMode_t)-1;//TAPI_CALL_FORWARD_MODE_ENABLE_EV; + pForwardInfo.Type = TAPI_CS_FORWARD_TYPE_VOICE_EV; + pForwardInfo.Condition = TAPI_SS_FORWARD_WHEN_UNCONDITIONAL_EV; + pForwardInfo.NoReplyConditionTimer = 10; + + int len; + char cf_number[20]= {FWD_NUM}; + len = strlen(cf_number); + + memcpy(&(pForwardInfo.szPhoneNumber),cf_number,len); + + ret_status = tel_set_ss_forward(&pForwardInfo,&pRequestId); + TET_RESULT_IF_EQUAL_THEN_GOTO(TET_PASS, exit, TAPI_API_INVALID_INPUT, ret_status); + + G_MAIN_LOOP_RUN(5); + + tet_result(TET_FAIL); +exit: + return; +} + +/** + * @brief Upper boundary testing of the forward mode for TelTapiSsSetCallForwarding() API + * @par ID: + * UTC_TAPI_SS_SET_CALL_FORWARDING_003 + * @param [in] pForwardInfo + * @code + pForwardInfo.Mode = (TelSsForwardMode_t)(TAPI_CALL_FORWARD_MODE_ERASURE_EV+1); + pForwardInfo.Type = TAPI_CS_FORWARD_TYPE_VOICE_EV; + pForwardInfo.Condition = TAPI_SS_FORWARD_WHEN_UNCONDITIONAL_EV; + pForwardInfo.NoReplyConditionTimer = 10; + char cf_number[20]= {FWD_NUM}; + len = strlen(cf_number); + strcpy(pForwardInfo.szPhoneNumber,cf_number); +* @endcode +* @param [out] RequestId +* @return TAPI_API_INVALID_INPUT +*/ + +void utc_tel_set_ss_forward_03() +{ + //invalid mode + TET_STAMP_START("Invalid forward mode +1"); + TapiResult_t ret_status = TAPI_API_SUCCESS; + + TelSsForwardInfo_t pForwardInfo; + pForwardInfo.Mode = (TelSsForwardMode_t)(TAPI_CALL_FORWARD_MODE_ERASURE_EV+1);//TAPI_CALL_FORWARD_MODE_ENABLE_EV; + pForwardInfo.Type = TAPI_CS_FORWARD_TYPE_VOICE_EV; + pForwardInfo.Condition = TAPI_SS_FORWARD_WHEN_UNCONDITIONAL_EV; + pForwardInfo.NoReplyConditionTimer = 10; + int pRequestId=0; + int len; + char cf_number[20]= {FWD_NUM}; + len = strlen(cf_number); + + memcpy(&(pForwardInfo.szPhoneNumber),cf_number,len); + + ret_status = tel_set_ss_forward(&pForwardInfo,&pRequestId); + TET_RESULT_IF_EQUAL_THEN_GOTO(TET_PASS, exit, TAPI_API_INVALID_INPUT, ret_status); + + G_MAIN_LOOP_RUN(5); + + tet_result(TET_FAIL); +exit: + return; +} + +/** + * @brief Lower boundary testing of the forward type for TelTapiSsSetCallForwarding() API + * @par ID: + * UTC_TAPI_SS_SET_CALL_FORWARDING_004 + * @param [in] pForwardInfo + * @code + pForwardInfo.Mode = TAPI_CALL_FORWARD_MODE_ENABLE_EV; + pForwardInfo.Type = (TelSsForwardType_t)-1; + pForwardInfo.Condition = TAPI_SS_FORWARD_WHEN_UNCONDITIONAL_EV; + pForwardInfo.NoReplyConditionTimer = 10; + + char cf_number[20]= {FWD_NUM}; + len = strlen(cf_number); + strcpy(pForwardInfo.szPhoneNumber,cf_number); +* @endcode +* @param [out] RequestId +* @return TAPI_API_INVALID_INPUT +*/ + +void utc_tel_set_ss_forward_04() +{ + //invalid type + TET_STAMP_START("Invalid forward type -1"); + TapiResult_t ret_status = TAPI_API_SUCCESS; +int pRequestId=0; + TelSsForwardInfo_t pForwardInfo; + pForwardInfo.Mode = TAPI_CALL_FORWARD_MODE_ENABLE_EV; + pForwardInfo.Type = (TelSsForwardType_t)-1;//TAPI_CS_FORWARD_TYPE_VOICE_EV; + pForwardInfo.Condition = TAPI_SS_FORWARD_WHEN_UNCONDITIONAL_EV; + pForwardInfo.NoReplyConditionTimer = 10; + + int len; + char cf_number[20]= {FWD_NUM}; + len = strlen(cf_number); + + memcpy(&(pForwardInfo.szPhoneNumber),cf_number,len); + + ret_status = tel_set_ss_forward(&pForwardInfo,&pRequestId); + TET_RESULT_IF_EQUAL_THEN_GOTO(TET_PASS, exit, TAPI_API_INVALID_INPUT, ret_status); + + G_MAIN_LOOP_RUN(5); + + tet_result(TET_FAIL); +exit: + return; +} + +/** + * @brief Upper boundary testing of the forward type for TelTapiSsSetCallForwarding() API + * @par ID: + * UTC_TAPI_SS_SET_CALL_FORWARDING_005 + * @param [in] pForwardInfo + * @code + pForwardInfo.Mode = TAPI_CALL_FORWARD_MODE_ENABLE_EV; + pForwardInfo.Type = (TelSsForwardType_t)(TAPI_CS_FORWARD_TYPE_ALL_TELE +1); + pForwardInfo.Condition = TAPI_SS_FORWARD_WHEN_UNCONDITIONAL_EV; + pForwardInfo.NoReplyConditionTimer = 10; + char cf_number[20]= {FWD_NUM}; + len = strlen(cf_number); + strcpy(pForwardInfo.szPhoneNumber,cf_number); +* @endcode +* @param [out] RequestId +* @return TAPI_API_INVALID_INPUT +*/ + +void utc_tel_set_ss_forward_05() +{ + //invalid type + TET_STAMP_START("Invalid forward type +1"); + TapiResult_t ret_status = TAPI_API_SUCCESS; +int pRequestId=0; + TelSsForwardInfo_t pForwardInfo; + pForwardInfo.Mode = TAPI_CALL_FORWARD_MODE_ENABLE_EV; + pForwardInfo.Type = (TelSsForwardType_t)(TAPI_CS_FORWARD_TYPE_ALL_TELE +1); + pForwardInfo.Condition = TAPI_SS_FORWARD_WHEN_UNCONDITIONAL_EV; + pForwardInfo.NoReplyConditionTimer = 10; + + int len; + char cf_number[20]= {FWD_NUM}; + len = strlen(cf_number); + + memcpy(&(pForwardInfo.szPhoneNumber),cf_number,len); + + ret_status = tel_set_ss_forward(&pForwardInfo,&pRequestId); + TET_RESULT_IF_EQUAL_THEN_GOTO(TET_PASS, exit, TAPI_API_INVALID_INPUT, ret_status); + + G_MAIN_LOOP_RUN(5); + + tet_result(TET_FAIL); +exit: + return; +} + +/** + * @brief Lower boundary testing of the forward condition for TelTapiSsSetCallForwarding() API + * @par ID: + * UTC_TAPI_SS_SET_CALL_FORWARDING_006 + * @param [in] pForwardInfo + * @code + pForwardInfo.Mode = TAPI_CALL_FORWARD_MODE_ENABLE_EV; + pForwardInfo.Type = TAPI_CS_FORWARD_TYPE_VOICE_EV; + pForwardInfo.Condition = (TelSsForwardWhen_t)-1; + pForwardInfo.NoReplyConditionTimer = 10; + char cf_number[20]= {FWD_NUM}; + len = strlen(cf_number); + strcpy(pForwardInfo.szPhoneNumber,cf_number); +* @endcode +* @param [out] RequestId +* @return TAPI_API_INVALID_INPUT +*/ + +void utc_tel_set_ss_forward_06() +{ + //invalid condition + TET_STAMP_START("Invalid forward condition -1"); + TapiResult_t ret_status = TAPI_API_SUCCESS; +int pRequestId=0; + TelSsForwardInfo_t pForwardInfo; + pForwardInfo.Mode = TAPI_CALL_FORWARD_MODE_ENABLE_EV; + pForwardInfo.Type = TAPI_CS_FORWARD_TYPE_VOICE_EV; + pForwardInfo.Condition = (TelSsForwardWhen_t)-1; + pForwardInfo.NoReplyConditionTimer = 10; + + int len; + char cf_number[20]= {FWD_NUM}; + len = strlen(cf_number); + + memcpy(&(pForwardInfo.szPhoneNumber),cf_number,len); + + ret_status = tel_set_ss_forward(&pForwardInfo,&pRequestId); + TET_RESULT_IF_EQUAL_THEN_GOTO(TET_PASS, exit, TAPI_API_INVALID_INPUT, ret_status); + G_MAIN_LOOP_RUN(5); + + tet_result(TET_FAIL); +exit: + return; +} + +/** + * @brief Upper boundary testing of the forward condition for TelTapiSsSetCallForwarding() API + * @par ID: + * UTC_TAPI_SS_SET_CALL_FORWARDING_007 + * @param [in] pForwardInfo + * @code + pForwardInfo.Mode = TAPI_CALL_FORWARD_MODE_ENABLE_EV; + pForwardInfo.Type = TAPI_CS_FORWARD_TYPE_VOICE_EV; + pForwardInfo.Condition = (TelSsForwardWhen_t)(TAPI_SS_FORWARD_WHEN_ALL_CONDITIONAL_EV+1); + pForwardInfo.NoReplyConditionTimer = 10; + char cf_number[20]= {FWD_NUM}; + len = strlen(cf_number); + strcpy(pForwardInfo.szPhoneNumber,cf_number); +* @endcode +* @param [out] RequestId +* @return TAPI_API_INVALID_INPUT +*/ + +void utc_tel_set_ss_forward_07() +{ + //invalid condition + TET_STAMP_START("Invalid Forward Condition +1"); + TapiResult_t ret_status = TAPI_API_SUCCESS; +int pRequestId=0; + TelSsForwardInfo_t pForwardInfo; + pForwardInfo.Mode = TAPI_CALL_FORWARD_MODE_ENABLE_EV; + pForwardInfo.Type = TAPI_CS_FORWARD_TYPE_VOICE_EV; + pForwardInfo.Condition = (TelSsForwardWhen_t)(TAPI_SS_FORWARD_WHEN_ALL_CONDITIONAL_EV+1); + pForwardInfo.NoReplyConditionTimer = 10; + + int len; + char cf_number[20]= {FWD_NUM}; + len = strlen(cf_number); + + memcpy(&(pForwardInfo.szPhoneNumber),cf_number,len); + + ret_status = tel_set_ss_forward(&pForwardInfo,&pRequestId); + TET_RESULT_IF_EQUAL_THEN_GOTO(TET_PASS, exit, TAPI_API_INVALID_INPUT, ret_status); + G_MAIN_LOOP_RUN(5); + + tet_result(TET_FAIL); +exit: + return; +} + + +/** + * @brief Null test of the Request ID for TelTapiSsSetCallForwarding() API + * @par ID: + * UTC_TAPI_SS_SET_CALL_FORWARDING_008 + * @param [in] pForwardInfo + * @code + pForwardInfo.Mode = TAPI_CALL_FORWARD_MODE_ENABLE_EV; + pForwardInfo.Type = TAPI_CS_FORWARD_TYPE_VOICE_EV; + pForwardInfo.Condition = TAPI_SS_FORWARD_WHEN_UNCONDITIONAL_EV; + pForwardInfo.NoReplyConditionTimer = 10; + + int len; + char cf_number[20]= {FWD_NUM}; + len = strlen(cf_number); + memcpy(&(pForwardInfo.szPhoneNumber),cf_number,len); + * @endcode +* @param [out] RequestId NULL +* @return TAPI_API_INVALID_PTR +*/ + +void utc_tel_set_ss_forward_08() +{ + //null out param + TET_STAMP_START("Null Request ID"); + TapiResult_t ret_status = TAPI_API_SUCCESS; + TelSsForwardInfo_t pForwardInfo; + pForwardInfo.Mode = TAPI_CALL_FORWARD_MODE_ENABLE_EV; + pForwardInfo.Type = TAPI_CS_FORWARD_TYPE_VOICE_EV; + pForwardInfo.Condition = TAPI_SS_FORWARD_WHEN_UNCONDITIONAL_EV; + pForwardInfo.NoReplyConditionTimer = 10; + + int len; + char cf_number[20]= {FWD_NUM}; + len = strlen(cf_number); + memcpy(&(pForwardInfo.szPhoneNumber),cf_number,len); + + ret_status = tel_set_ss_forward(&pForwardInfo,NULL); + TET_RESULT_IF_EQUAL_THEN_GOTO(TET_PASS, exit, TAPI_API_INVALID_PTR, ret_status); + + G_MAIN_LOOP_RUN(5); + + tet_result(TET_FAIL); +exit: + return; +} + + +/** + * @brief Null test of the forward info for TelTapiSsSetCallForwarding() API + * @par ID: + * UTC_TAPI_SS_SET_CALL_FORWARDING_009 + * @param [in] pForwardInfo + * @endcode +* @param [out] RequestId NULL +* @return TAPI_API_INVALID_PTR +*/ + +void utc_tel_set_ss_forward_09() +{ + //null out param + TET_STAMP_START("Null Forward Info"); + TapiResult_t ret_status = TAPI_API_SUCCESS; + int pRequestId=0; + + ret_status = tel_set_ss_forward(NULL,&pRequestId); + TET_RESULT_IF_EQUAL_THEN_GOTO(TET_PASS, exit, TAPI_API_INVALID_PTR, ret_status); + + G_MAIN_LOOP_RUN(5); + + tet_result(TET_FAIL); +exit: + return; +} + +/** @} */ diff --git a/TC/telephony_TC/ss/unit/uts_tel_set_ss_forward.h b/TC/telephony_TC/ss/unit/uts_tel_set_ss_forward.h new file mode 100644 index 0000000..e0d00be --- /dev/null +++ b/TC/telephony_TC/ss/unit/uts_tel_set_ss_forward.h @@ -0,0 +1,35 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * 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 _UTS_TAPI_SS_SET_CALL_FORWARD_H_ +#define _UTS_TAPI_SS_SET_CALL_FORWARD_H_ + + static void utc_tel_set_ss_forward_01(); + static void utc_tel_set_ss_forward_02(); + static void utc_tel_set_ss_forward_03(); + static void utc_tel_set_ss_forward_04(); + static void utc_tel_set_ss_forward_05(); + static void utc_tel_set_ss_forward_06(); + static void utc_tel_set_ss_forward_07(); + static void utc_tel_set_ss_forward_08(); + static void utc_tel_set_ss_forward_09(); + + +#endif //_UTS_TAPI_CALL_BARRING_ACT_H_ diff --git a/TC/telephony_TC/ss/unit/uts_tel_set_ss_waiting.c b/TC/telephony_TC/ss/unit/uts_tel_set_ss_waiting.c new file mode 100644 index 0000000..599899b --- /dev/null +++ b/TC/telephony_TC/ss/unit/uts_tel_set_ss_waiting.c @@ -0,0 +1,327 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * 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 +#include +#include + +#include +#include "assert.h" +#include "glib.h" + +#include "TapiCommon.h" +#include +#include "string.h" + +#include "tet_tapi_util.h" +#include + +#include "uts_tel_set_ss_waiting.h" + +/* Initialize TCM data structures */ +static void startup(); +static void cleanup(); +void (*tet_startup) () = startup; +void (*tet_cleanup) () = cleanup; +struct tet_testlist tet_testlist[] = { + {utc_tel_set_ss_waiting_01, 1}, + {utc_tel_set_ss_waiting_02, 2}, + {utc_tel_set_ss_waiting_03, 3}, + {utc_tel_set_ss_waiting_04, 4}, + {utc_tel_set_ss_waiting_05, 5}, + {utc_tel_set_ss_waiting_06, 6}, + {utc_tel_set_ss_waiting_07, 7}, + {NULL, 0} +}; + + +/* Startup & Clean function : It is not test code, only for + initialize and finalize test module +*/ +static BOOL gStartupSuccess = FALSE; +static unsigned int subscription_id = 0; + +static void startup() +{ + tapi_dbus_connection_name dname; + int bStatus; + + gStartupSuccess = FALSE; + if(tel_init() == TAPI_API_SUCCESS) + { + if(tel_register_event(TAPI_EVENT_SS_WAITING_CNF, &subscription_id, (TelAppCallback)ss_utc_callback,NULL) == TAPI_API_SUCCESS) + { + gStartupSuccess = TRUE; + tel_register_app_name("org.samsung.test"); + if(tel_get_app_name(&dname)) + printf("Dbus Get app name error\n"); + else + printf("Dbus Name is %s\n",dname.name); + + tel_check_service_ready(&bStatus); + printf("Telephony service %d\n",bStatus); + } + else + { + tet_infoline("startup fail. tel_register_event()"); + } + }else { + tet_infoline("startup fail. tel_init() failed"); + } + + return; +} + +static void cleanup() +{ + if(gStartupSuccess == TRUE) + tel_deregister_event(subscription_id); + tel_deinit(); + return; +} + +/** + * @brief This tests TelTapiSsSetCallWaiting() API in normal conditions + * @par ID: + * UTC_TAPI_SS_SET_CALL_WAITING_001 + * @param [in] waitInfo + * @code + * waitInfo.CallType = TAPI_CALL_TYPE_VOICE_EV; + * waitInfo.Mode =(TelSsCallWaitOperationMode_t)TAPI_SS_CW_ACTIVATE; +* @endcode +* @param [out] RequestId +* @return TAPI_API_SUCCESS +*/ + +void utc_tel_set_ss_waiting_01() +{ + TET_STAMP_START("This tests TelTapiSsSetCallWaiting() API in normal conditions"); + TapiResult_t ret_status = TAPI_API_SUCCESS; + TelSsWaitingInfo_t waitInfo; + + int request_id=0; + waitInfo.CallType = TAPI_CALL_TYPE_VOICE_EV; + waitInfo.Mode =(TelSsCallWaitOperationMode_t)TAPI_SS_CW_ACTIVATE; + + ret_status = tel_set_ss_waiting(&waitInfo, &request_id); + + TET_RESULT_IF_NOT_EQUAL_THEN_GOTO(TET_FAIL, exit, TAPI_API_SUCCESS, ret_status ); + G_MAIN_LOOP_RUN(5); + + tet_result(TET_PASS); +exit: + return; +} + +/** + * @brief Lower boundary testing of the call type for TelTapiSsSetCallWaiting() API + * @par ID: + * UTC_TAPI_SS_SET_CALL_WAITING_002 + * @param [in] waitInfo + * @code + * waitInfo.CallType = (TelSsCallType_t)-1; + * waitInfo.Mode =(TelSsCallWaitOperationMode_t)TAPI_SS_CW_ACTIVATE; +* @endcode +* @param [out] RequestId +* @return TAPI_API_INVALID_INPUT +*/ + +void utc_tel_set_ss_waiting_02() +{ + TET_STAMP_START("Lower boundary testing of the call type for TelTapiSsSetCallWaiting() API"); + + TapiResult_t ret_status = TAPI_API_SUCCESS; + TelSsWaitingInfo_t waitInfo; + int request_id=0; + + waitInfo.CallType = (TelSsCallType_t)-1; + waitInfo.Mode =(TelSsCallWaitOperationMode_t)TAPI_SS_CW_ACTIVATE; + + ret_status = tel_set_ss_waiting(&waitInfo, &request_id); + + TET_RESULT_IF_EQUAL_THEN_GOTO(TET_PASS, exit, TAPI_API_INVALID_INPUT, ret_status ); + G_MAIN_LOOP_RUN(5); + + tet_result(TET_FAIL); +exit: + return; +} + + +/** + * @brief Upper boundary testing of the call type for TelTapiSsSetCallWaiting() API + * @par ID: + * UTC_TAPI_SS_SET_CALL_WAITING_003 + * @param [in] waitInfo + * @code +* waitInfo.CallType = (TelSsCallType_t)(TAPI_CALL_TYPE_ALL_TELE+1); +* waitInfo.Mode =(TelSsCallWaitOperationMode_t)TAPI_SS_CW_ACTIVATE; +* @endcode +* @param [out] RequestId +* @return TAPI_API_INVALID_INPUT +*/ + +void utc_tel_set_ss_waiting_03() +{ + TET_STAMP_START("Upper boundary testing of the call type for TelTapiSsSetCallWaiting() API"); + TapiResult_t ret_status = TAPI_API_SUCCESS; + TelSsWaitingInfo_t waitInfo; + waitInfo.CallType = (TelSsCallType_t)(TAPI_CALL_TYPE_ALL_TELE+1); + waitInfo.Mode =(TelSsCallWaitOperationMode_t)TAPI_SS_CW_ACTIVATE; + int request_id=0; + + ret_status = tel_set_ss_waiting(&waitInfo, &request_id); + + TET_RESULT_IF_EQUAL_THEN_GOTO(TET_PASS, exit, TAPI_API_INVALID_INPUT, ret_status ); + G_MAIN_LOOP_RUN(5); + + tet_result(TET_FAIL); +exit: + return; +} + + +/** + * @brief Lower boundary testing of the waiting operation mode for TelTapiSsSetCallWaiting() API + * @par ID: + * UTC_TAPI_SS_SET_CALL_WAITING_004 + * @param [in] waitInfo + * @code + * waitInfo.CallType = TAPI_CALL_TYPE_VOICE_EV; +* waitInfo.Mode =(TelSsCallWaitOperationMode_t)-1; +* @endcode +* @param [out] RequestId +* @return TAPI_API_INVALID_INPUT +*/ + +void utc_tel_set_ss_waiting_04() +{ + TET_STAMP_START("Lower boundary testing of the waiting operation mode for TelTapiSsSetCallWaiting() API"); + TapiResult_t ret_status = TAPI_API_SUCCESS; + TelSsWaitingInfo_t waitInfo; + waitInfo.CallType = TAPI_CALL_TYPE_VOICE_EV; + waitInfo.Mode =(TelSsCallWaitOperationMode_t)-1; + int request_id=0; + + ret_status = tel_set_ss_waiting(&waitInfo, &request_id); + + TET_RESULT_IF_EQUAL_THEN_GOTO(TET_PASS, exit, TAPI_API_INVALID_INPUT, ret_status ); + G_MAIN_LOOP_RUN(5); + + tet_result(TET_FAIL); +exit: + return; +} + +/** + * @brief Upper boundary testing of the waiting operation mode for TelTapiSsSetCallWaiting() API + * @par ID: + * UTC_TAPI_SS_SET_CALL_WAITING_005 + * @param [in] waitInfo + * @code + * waitInfo.CallType = TAPI_CALL_TYPE_VOICE_EV; + * waitInfo.Mode =(TelSsCallWaitOperationMode_t)(TAPI_SS_CW_DEACTIVATE+1); +* @endcode +* @param [out] RequestId +* @return TAPI_API_INVALID_INPUT +*/ + +void utc_tel_set_ss_waiting_05() +{ + TET_STAMP_START("Upper boundary testing of the waiting operation mode for TelTapiSsSetCallWaiting() API"); + TapiResult_t ret_status = TAPI_API_SUCCESS; + TelSsWaitingInfo_t waitInfo; + waitInfo.CallType = TAPI_CALL_TYPE_VOICE_EV; + waitInfo.Mode =(TelSsCallWaitOperationMode_t)(TAPI_SS_CW_DEACTIVATE+1); + int request_id=0; + + ret_status = tel_set_ss_waiting(&waitInfo, &request_id); + TET_RESULT_IF_EQUAL_THEN_GOTO(TET_PASS, exit, TAPI_API_INVALID_INPUT, ret_status ); + G_MAIN_LOOP_RUN(5); + + tet_result(TET_FAIL); +exit: + return; +} + +/** + * @brief Null testing of the waitInfo for TelTapiSsSetCallWaiting() API + * @par ID: + * UTC_TAPI_SS_SET_CALL_WAITING_006 + * @param [in] waitInfo NULL +* @param [out] RequestId +* @return TAPI_API_INVALID_PTR +*/ + +void utc_tel_set_ss_waiting_06() +{ + TET_STAMP_START("Null testing of the waitInfo for TelTapiSsSetCallWaiting() API"); + TapiResult_t ret_status = TAPI_API_SUCCESS; + int request_id=0; + + ret_status = tel_set_ss_waiting(NULL, &request_id); + + TET_RESULT_IF_EQUAL_THEN_GOTO(TET_PASS, exit, TAPI_API_INVALID_PTR, ret_status ); + G_MAIN_LOOP_RUN(5); + + tet_result(TET_FAIL); +exit: + return; +} + +/** + * @brief Null testing of the request ID for TelTapiSsSetCallWaiting() API + * @par ID: + * UTC_TAPI_SS_SET_CALL_WAITING_007 + * @param [in] waitInfo + * @code + * waitInfo.CallType = TAPI_CALL_TYPE_VOICE_EV; +* waitInfo.Mode =(TelSsCallWaitOperationMode_t)TAPI_SS_CW_DEACTIVATE; +* @param [out] RequestId NULL +* @return TAPI_API_INVALID_PTR +*/ + +void utc_tel_set_ss_waiting_07() +{ + TET_STAMP_START("Null testing of the request ID for TelTapiSsSetCallWaiting() API"); + TapiResult_t ret_status = TAPI_API_SUCCESS; + TelSsWaitingInfo_t waitInfo; + waitInfo.CallType = TAPI_CALL_TYPE_VOICE_EV; + waitInfo.Mode =(TelSsCallWaitOperationMode_t)TAPI_SS_CW_DEACTIVATE; + + ret_status = tel_set_ss_waiting(&waitInfo, NULL); + + TET_RESULT_IF_EQUAL_THEN_GOTO(TET_PASS, exit, TAPI_API_INVALID_PTR, ret_status ); + G_MAIN_LOOP_RUN(5); + + tet_result(TET_FAIL); +exit: + return; +} + + +/** @} */ + + diff --git a/TC/telephony_TC/ss/unit/uts_tel_set_ss_waiting.h b/TC/telephony_TC/ss/unit/uts_tel_set_ss_waiting.h new file mode 100644 index 0000000..1574e7d --- /dev/null +++ b/TC/telephony_TC/ss/unit/uts_tel_set_ss_waiting.h @@ -0,0 +1,33 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * 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 _UTS_TAPI_SS_SET_CALL_WAITING_H_ +#define _UTS_TAPI_SS_SET_CALL_WAITING_H_ + static void utc_tel_set_ss_waiting_01(); + static void utc_tel_set_ss_waiting_02(); + static void utc_tel_set_ss_waiting_03(); + static void utc_tel_set_ss_waiting_04(); + static void utc_tel_set_ss_waiting_05(); + static void utc_tel_set_ss_waiting_06(); + static void utc_tel_set_ss_waiting_07(); + +#endif //_UTS_TAPI_CALL_BARRING_ACT_H_ + diff --git a/TC/telephony_TC/tet_scen b/TC/telephony_TC/tet_scen new file mode 100644 index 0000000..6df76f3 --- /dev/null +++ b/TC/telephony_TC/tet_scen @@ -0,0 +1,25 @@ +all + ^common + ^sim + ^sat + ^sound + ^ss + ^sms + ^gprs + ^net +sim + :include:/sim/unit/tslist +sms + :include:/sms/unit/tslist +net + :include:/network/unit/tslist +ss + :include:/ss/unit/tslist +sat + :include:/sat/unit/tslist +gprs + :include:/gprs/unit/tslist +sound + :include:/sound/unit/tslist +common + :include:/common/unit/tslist diff --git a/TC/telephony_TC/tetbuild.cfg b/TC/telephony_TC/tetbuild.cfg new file mode 100644 index 0000000..9aec41e --- /dev/null +++ b/TC/telephony_TC/tetbuild.cfg @@ -0,0 +1,3 @@ +TET_OUTPUT_CAPTURE=True +TET_BUILD_TOOL=make +TET_BUILD_FILE=-f makefile diff --git a/TC/telephony_TC/tetclean.cfg b/TC/telephony_TC/tetclean.cfg new file mode 100644 index 0000000..2cc5be7 --- /dev/null +++ b/TC/telephony_TC/tetclean.cfg @@ -0,0 +1,3 @@ +TET_OUTPUT_CAPTURE=False +TET_CLEAN_TOOL=rm +TET_CLEAN_FILE=-f diff --git a/TC/telephony_TC/tetexec.cfg b/TC/telephony_TC/tetexec.cfg new file mode 100644 index 0000000..afec781 --- /dev/null +++ b/TC/telephony_TC/tetexec.cfg @@ -0,0 +1,8 @@ +TET_OUTPUT_CAPTURE=False +# Parameters to be passed to test cases. +# These allow you to parameterize your test suite. +# The name of a character device file (or "unsup" if not supported) +#CHARDEV=/dev/null + +# The name of a block device file (or "unsup" if not supported) +#BLOCKDEV=unsup diff --git a/TC/tet_scen b/TC/tet_scen new file mode 100644 index 0000000..334caba --- /dev/null +++ b/TC/tet_scen @@ -0,0 +1,103 @@ +# auto generated tet_scen +all + "Starting Full Test Suite" + /telephony_TC/sim/unit/uts_tel_change_sim_pins{1-5,9} + /telephony_TC/sim/unit/uts_tel_delete_sim_pb_record{1-3} + /telephony_TC/sim/unit/uts_tel_disable_sim_fdn + /telephony_TC/sim/unit/uts_tel_disable_sim_security + /telephony_TC/sim/unit/uts_tel_enable_sim_fdn + /telephony_TC/sim/unit/uts_tel_enable_sim_security + /telephony_TC/sim/unit/uts_tel_get_sim_ecc + /telephony_TC/sim/unit/uts_tel_get_sim_fdn_status + /telephony_TC/sim/unit/uts_tel_get_sim_imsi + /telephony_TC/sim/unit/uts_tel_get_sim_init_info + /telephony_TC/sim/unit/uts_tel_get_sim_language + /telephony_TC/sim/unit/uts_tel_get_sim_mailbox_info + /telephony_TC/sim/unit/uts_tel_get_sim_callforwarding_info + /telephony_TC/sim/unit/uts_tel_get_sim_messagewaiting_info + /telephony_TC/sim/unit/uts_tel_get_sim_cphs_info + /telephony_TC/sim/unit/uts_tel_get_sim_msisdn + /telephony_TC/sim/unit/uts_tel_get_sim_pb_3g_meta_info{1} + /telephony_TC/sim/unit/uts_tel_get_sim_pb_count{1-3} + /telephony_TC/sim/unit/uts_tel_get_sim_pb_init_info + /telephony_TC/sim/unit/uts_tel_get_sim_pb_meta_info{1-3} + /telephony_TC/sim/unit/uts_tel_get_sim_security_status + /telephony_TC/sim/unit/uts_tel_get_sim_type + /telephony_TC/sim/unit/uts_tel_lock_sim_personalization + /telephony_TC/sim/unit/uts_tel_read_sim_pb_record{1-3} + /telephony_TC/sim/unit/uts_tel_req_sap_cardreader_status + /telephony_TC/sim/unit/uts_tel_req_sap_connection + /telephony_TC/sim/unit/uts_tel_req_sap_connection_status + /telephony_TC/sim/unit/uts_tel_req_sap_power_operation + /telephony_TC/sim/unit/uts_tel_req_sap_transfer_apdu + /telephony_TC/sim/unit/uts_tel_req_sap_transfer_atr + /telephony_TC/sim/unit/uts_tel_req_sap_transport_protocol + /telephony_TC/sim/unit/uts_tel_req_sim_access + /telephony_TC/sim/unit/uts_tel_req_sim_isim_authentication + /telephony_TC/sim/unit/uts_tel_set_sim_language + /telephony_TC/sim/unit/uts_tel_update_sim_pb_record #{1-4} + /telephony_TC/sim/unit/uts_tel_verifiy_sim_pins{1-4} + /telephony_TC/sim/unit/uts_tel_verify_sim_puks + /telephony_TC/call/unit/uts_tel_exe_call_mo + /telephony_TC/call/unit/uts_tel_answer_call + /telephony_TC/call/unit/uts_tel_release_call + /telephony_TC/call/unit/uts_tel_release_call_all_active + /telephony_TC/call/unit/uts_tel_retrieve_call + /telephony_TC/call/unit/uts_tel_hold_call + /telephony_TC/call/unit/uts_tel_swap_call + /telephony_TC/call/unit/uts_tel_join_call + /telephony_TC/call/unit/uts_tel_split_call + /telephony_TC/call/unit/uts_tel_exe_call_explicit_transfer + /telephony_TC/call/unit/uts_tel_get_call_act_line + /telephony_TC/call/unit/uts_tel_set_call_act_line + /telephony_TC/call/unit/uts_tel_get_call_status + /telephony_TC/call/unit/uts_tel_get_call_duration + /telephony_TC/call/unit/uts_tel_send_call_dtmf + /telephony_TC/call/unit/uts_tel_release_call_all_held + /telephony_TC/call/unit/uts_tel_get_call_conf_list + /telephony_TC/call/unit/uts_tel_release_call_all + /telephony_TC/call/unit/uts_tel_activate_call_ccbs + /telephony_TC/call/unit/uts_tel_deflect_call + /telephony_TC/common/unit/uts_tel_check_service_ready + /telephony_TC/common/unit/uts_tel_deinit + /telephony_TC/common/unit/uts_tel_deinit_ecore_loop + /telephony_TC/common/unit/uts_tel_register_event + /telephony_TC/common/unit/uts_tel_deregister_event_at_ecore_loop + /telephony_TC/common/unit/uts_tel_init_ecore_loop + /telephony_TC/common/unit/uts_tel_deregister_event + /telephony_TC/common/unit/uts_tel_init + /telephony_TC/common/unit/uts_tel_register_event_at_ecore_loop + /telephony_TC/network/unit/uts_tel_get_network_band + /telephony_TC/network/unit/uts_tel_get_network_hybrid_in_cdma + /telephony_TC/network/unit/uts_tel_get_network_preferred_plmn + /telephony_TC/network/unit/uts_tel_get_network_roaming + /telephony_TC/network/unit/uts_tel_get_network_selection_mode + /telephony_TC/network/unit/uts_tel_get_network_service_domain + /telephony_TC/network/unit/uts_tel_search_network + /telephony_TC/network/unit/uts_tel_set_network_band + /telephony_TC/network/unit/uts_tel_set_network_hybrid_in_cdma + /telephony_TC/network/unit/uts_tel_set_network_preferred_plmn + /telephony_TC/network/unit/uts_tel_set_network_roaming + /telephony_TC/network/unit/uts_tel_set_network_service_domain + /telephony_TC/network/unit/uts_tel_get_network_mode + /telephony_TC/network/unit/uts_tel_select_network_automatic + /telephony_TC/network/unit/uts_tel_select_network_manual + /telephony_TC/network/unit/uts_tel_set_network_mode + /telephony_TC/gprs/unit/uts_tel_activate_gprs_pdp + /telephony_TC/gprs/unit/uts_tel_control_gprs_btdun_pin + /telephony_TC/gprs/unit/uts_tel_deactivate_gprs_pdp + /telephony_TC/ss/unit/uts_tel_change_ss_barring_password + /telephony_TC/ss/unit/uts_tel_get_ss_aoc_info + /telephony_TC/ss/unit/uts_tel_get_ss_barring_status + /telephony_TC/ss/unit/uts_tel_get_ss_cli_status + /telephony_TC/ss/unit/uts_tel_get_ss_forward_status + /telephony_TC/ss/unit/uts_tel_get_ss_waiting_status + /telephony_TC/ss/unit/uts_tel_send_ss_ussd_cancel + /telephony_TC/ss/unit/uts_tel_send_ss_ussd_request + /telephony_TC/ss/unit/uts_tel_send_ss_ussd_response + /telephony_TC/ss/unit/uts_tel_set_ss_barring + /telephony_TC/ss/unit/uts_tel_set_ss_forward + /telephony_TC/ss/unit/uts_tapi_ussd_send_rsp + /telephony_TC/ss/unit/uts_tel_set_ss_waiting + "Completed Full Test Suite" +# EOF diff --git a/TC/tslist.txt b/TC/tslist.txt new file mode 100644 index 0000000..cd01962 --- /dev/null +++ b/TC/tslist.txt @@ -0,0 +1,6 @@ +telephony_TC/sim/unit/tslist +telephony_TC/call/unit/tslist +telephony_TC/common/unit/tslist +telephony_TC/network/unit/tslist +telephony_TC/gprs/unit/tslist +telephony_TC/ss/unit/tslist diff --git a/debian/changelog b/debian/changelog new file mode 100644 index 0000000..07a3066 --- /dev/null +++ b/debian/changelog @@ -0,0 +1,31 @@ +libslp-tapi (0.5.78) unstable; urgency=low + + * Removed fast dormancy api + * Git: pkgs/l/libslp-tapi + * Tag: libslp-tapi_0.5.78 + + -- Inho Oh Wed, 28 Dec 2011 16:05:18 +0900 + +libslp-tapi (0.5.77) unstable; urgency=low + + * code clean up + * Git: pkgs/l/libslp-tapi + * Tag: libslp-tapi_0.5.77 + + -- Kyeongchul Kim Fri, 23 Dec 2011 18:04:11 +0900 + +libslp-tapi (0.5.76) unstable; urgency=low + + * Factory Omission Avoidance Bug Fix ( Confirm Message Broadcasting Problem ) + * Git: pkgs/l/libslp-tapi + * Tag: libslp-tapi_0.5.76 + + -- Youngman Park Fri, 09 Dec 2011 19:19:47 +0900 + +libslp-tapi (0.5.75) unstable; urgency=low + + * TIZEN initial version + * Git: pkgs/l/libslp-tapi + * Tag: libslp-tapi_0.5.75 + + -- Kyeongchul Kim Wed, 07 Dec 2011 20:19:47 +0900 diff --git a/debian/compat b/debian/compat new file mode 100644 index 0000000..7ed6ff8 --- /dev/null +++ b/debian/compat @@ -0,0 +1 @@ +5 diff --git a/debian/control b/debian/control new file mode 100644 index 0000000..732f778 --- /dev/null +++ b/debian/control @@ -0,0 +1,30 @@ +Source: libslp-tapi +Section: libs +Priority: extra +Maintainer: Danny Jeongseok Seo +Uploaders: Danny Jeongseok Seo , Gunwang Jeong , HyunJung Park , kyeongchul.kim , Sunghyuk Lee , Youngman Park , Inho Oh +Build-Depends: debhelper (>= 5), + libglib2.0-dev, libdbus-1-dev, libdbus-glib-1-dev, + libslp-setting-dev, dlog-dev, libsecurity-server-client-dev +Standards-Version: 0.0.0 + +Package: libslp-tapi-dev +Section: libs +Architecture: any +Depends: libslp-tapi-0 (= ${Source-Version}), + libglib2.0-dev, libdbus-1-dev, libdbus-glib-1-dev, + libslp-setting-dev, dlog-dev, libsecurity-server-client-dev +Description: telephony client API library (Development) + +Package: libslp-tapi-0 +Section: libs +Architecture: any +Depends: ${shlibs:Depends}, ${misc:Depends}, +Description: telephony client API library (Shared Object) + +Package: libslp-tapi-0-dbg +Section: debug +Architecture: any +Depends: ${shlibs:Depends}, ${misc:Depends}, libslp-tapi-0 (= ${Source-Version}) +Description: telephony client API library (dbg package) + diff --git a/debian/dirs b/debian/dirs new file mode 100644 index 0000000..ca882bb --- /dev/null +++ b/debian/dirs @@ -0,0 +1,2 @@ +usr/bin +usr/sbin diff --git a/debian/docs b/debian/docs new file mode 100644 index 0000000..e69de29 diff --git a/debian/libslp-tapi-0.install.in b/debian/libslp-tapi-0.install.in new file mode 100644 index 0000000..37a7d08 --- /dev/null +++ b/debian/libslp-tapi-0.install.in @@ -0,0 +1,2 @@ +@PREFIX@/lib/libSLP-tapi.so.* +@PREFIX@/lib/libSLP-tapi.so diff --git a/debian/libslp-tapi-dev.install.in b/debian/libslp-tapi-dev.install.in new file mode 100644 index 0000000..eff7d16 --- /dev/null +++ b/debian/libslp-tapi-dev.install.in @@ -0,0 +1,5 @@ +@PREFIX@/include/telephony/tapi/I* +@PREFIX@/include/telephony/common/T* +@PREFIX@/lib/libSLP-tapi.la +#@PREFIX@/lib/libSLP-tapi.a +@PREFIX@/lib/pkgconfig/tapi.pc diff --git a/debian/rules b/debian/rules new file mode 100755 index 0000000..0ca9918 --- /dev/null +++ b/debian/rules @@ -0,0 +1,117 @@ +#!/usr/bin/make -f +# -*- makefile -*- +# Sample debian/rules that uses debhelper. +# This file was originally written by Joey Hess and Craig Small. +# As a special exception, when this file is copied by dh-make into a +# dh-make output file, you may use that output file without restriction. +# This special exception was added by Craig Small in version 0.37 of dh-make. + +# Uncomment this to turn on verbose mode. +#export DH_VERBOSE=1 + +CFLAGS ?= -Wall -g +CXXFLAGS ?= -Wall -g +LDFLAGS ?= +PREFIX ?= /usr +DATADIR ?= /opt + +ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS))) + CFLAGS += -O0 + CXXFLAGS += -O0 +else + CFLAGS += -O2 + CXXFLAGS += -O2 +endif + +CFLAGS += -fvisibility=hidden -fpic +LDFLAGS += -Wl,--rpath=$(PREFIX)/lib -Wl,--as-needed +LDFLAGS += -Wl,--unresolved-symbols=ignore-in-shared-libs,--as-needed + +CMAKE_TMP_DIR = $(CURDIR)/cmake_tmp + +configure: configure-stamp +configure-stamp: + dh_testdir + # Add here commands to configure the package. + mkdir -p $(CMAKE_TMP_DIR); + cd $(CMAKE_TMP_DIR); CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)" cmake .. -DCMAKE_INSTALL_PREFIX=$(PREFIX) + + touch configure-stamp + +build: build-stamp + +build-stamp: configure-stamp + dh_testdir + + # Add here commands to compile the package. + cd $(CMAKE_TMP_DIR) && $(MAKE) all + + for f in `find $(CURDIR)/debian/ -name "*.in"`; do \ + cat $$f > $${f%.in}; \ + sed -i -e "s#@PREFIX@#$(PREFIX)#g" $${f%.in}; \ + sed -i -e "s#@DATADIR@#$(DATADIR)#g" $${f%.in}; \ + done + + touch $@ + +clean: + dh_testdir + dh_testroot + rm -f build-stamp configure-stamp + + # Add here commands to clean up after the build process. + rm -rf $(CMAKE_TMP_DIR) + + for f in `find $(CURDIR)/debian/ -name "*.in"`; do \ + rm -f $${f%.in}; \ + done + + dh_clean + +install: build + dh_testdir + dh_testroot + dh_clean -k + dh_installdirs + + # Add here commands to install the package into debian/wavplayer. + cd $(CMAKE_TMP_DIR) && $(MAKE) DESTDIR=$(CURDIR)/debian/tmp install + + +# Build architecture-independent files here. +binary-indep: build install +# We have nothing to do by default. + +# Build architecture-dependent files here. +binary-arch: build install + dh_testdir + dh_testroot + dh_installchangelogs + dh_installdocs + dh_installexamples + dh_install --sourcedir=debian/tmp +# dh_installmenu +# dh_installdebconf +# dh_installlogrotate +# dh_installemacsen +# dh_installpam +# dh_installmime +# dh_python +# dh_installinit +# dh_installcron +# dh_installinfo + dh_installman + dh_link + dh_strip --dbg-package=libslp-tapi-0-dbg + dh_compress + dh_fixperms +# dh_perl + dh_makeshlibs + dh_installdeb + dh_shlibdeps + dh_gencontrol + dh_md5sums + dh_builddeb + +binary: binary-indep binary-arch +.PHONY: build clean binary-indep binary-arch binary install configure diff --git a/image/SLP_TelephonyFW_PG_image001.png b/image/SLP_TelephonyFW_PG_image001.png new file mode 100755 index 0000000..af8da9e Binary files /dev/null and b/image/SLP_TelephonyFW_PG_image001.png differ diff --git a/image/SLP_TelephonyFW_PG_image002.png b/image/SLP_TelephonyFW_PG_image002.png new file mode 100755 index 0000000..fa22ee2 Binary files /dev/null and b/image/SLP_TelephonyFW_PG_image002.png differ diff --git a/image/SLP_TelephonyFW_PG_image003.png b/image/SLP_TelephonyFW_PG_image003.png new file mode 100755 index 0000000..c518ec7 Binary files /dev/null and b/image/SLP_TelephonyFW_PG_image003.png differ diff --git a/image/SLP_TelephonyFW_PG_image004.png b/image/SLP_TelephonyFW_PG_image004.png new file mode 100755 index 0000000..96f5184 Binary files /dev/null and b/image/SLP_TelephonyFW_PG_image004.png differ diff --git a/include/SLP_TelephonyFW_PG.h b/include/SLP_TelephonyFW_PG.h new file mode 100644 index 0000000..c2ea8f6 --- /dev/null +++ b/include/SLP_TelephonyFW_PG.h @@ -0,0 +1,9398 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @ingroup SLP_PG + * @defgroup TELEPHONY Telephony +@{ + +

Introduction

+

Purpose

+The purpose of this document is to describe how applications can use Telephony Framework APIs. This document gives programming guidelines to application engineers. + +

Scope

+The scope of this document is limited to Samsung Linux platform Telephony Framework API usage. + +

Abbreviations

+ + + + + + + + + +
OEMOriginal Equipment Manufacturer
RPCRemote Procedure Call
SAPSim Access Profile
SATSIM Application Toolkit
SIMSubscriber Identity Module
SVCService
TAPITelephony API
EFLEnlightenment Foundation Libraries
+ +

Restriction Modules

+CALL, SMS, GPRS, SAT have the permission. Refer to each module API description +@} +@defgroup Telephony_Architecture 1.Architecture +@ingroup TELEPHONY +@{ +

Telephony Framework Architecture

+@image html SLP_TelephonyFW_PG_image001.png + +@image html SLP_TelephonyFW_PG_image002.png System Architecture of Telephony Framework + +Telephony is a middleware component which acts as an interface layer between applications and the OEM. +@n Telephony Framework provides interfaces to applications in the form of a library and to the OEM providers in the form of OEM plug-in. +@n The applications make use of the library of exported APIs, which uses a RPC mechanism for making telephony service requests. +@n On the other side, OEM-Plug-in library is the OEM layer, which is the wireless protocol stack specific implementation. This layer acts as a plug-in giving flexibility for any wireless protocol stack to be used avoiding any changes to be made in the Telephony clients. +@n Telephony has certain synchronous and asynchronous exported APIs. Synchronous APIs provide data as the function parameter passed to Telephony. Asynchronous APIs provide data using an event based mechanism. +@image html SLP_TelephonyFW_PG_image003.png Asynchronous service request (response Use-Case Diagram) +@image html SLP_TelephonyFW_PG_image003.png Synchronous service request (response Use-Case Diagram) +@} +@defgroup Telephony_Feature 2.SubModules & Services +@ingroup TELEPHONY +@{ + +

Telephony Framework SubModules & Services

+

Call & Call-dependent SS

+ Also see Use Cases of @ref Use_Cases2_CALL +- Initiate, accept, reject and end calls. +- Call supplementary service ( Hold,CLI, Multiparty, Call Waiting, Forwarding, Barring) +- Get Call Time, Status, Duration, Conference List +- Get and Set Active Line +- Retrieve, swap, and transfer call. +- For CDMA + - Call Flash Information + - Get and Set voice privacy mode + +

SMS

+ Also see Use Cases of @ref Use_Cases4_SMS +SMS service in Telephony Framework only provides the interface to the modem and doesn’t handle Transport layer, storing and deleting the SMS in the storage except SIM. We recommend you use MAPI of Message Framework. +- Send, save, receive, read and delete network texts. +- Receive Cell-Broadcast Message. +- Set and Get Cell broadcast configuration. +- Set message status, memory status. +- Set and Get sms parameters + +

Supplementary Service

+- Interrogation and activation for Call Barring, forwarding and waiting. +- USSD services, AOC Services. + +

Network Registration/Configuration

+- Search and Select Network. +- Set and Get Selection Mode, Service Domain, network Mode and Band. +- Get Network information. +- For CDMA + - Get and Set CDMA Hybrid Mode + - Get and Set Roaming Mode, Preferred PLMN + +

SIM

+- Handling SIM security procedure (PIN, PUK). +- Get / Update / Delete SIM EF files. +- Support 2G/3G Phonebook data. +- SIM Lock Personalisation enable or disable +- SIM lock enable or disable +- SAP + +

SAT (SIM Application Tool Kit)

+- Get main menu information from the SIM application +- Send envelope commands to the SIM application +- Send the execution results of which the SIM application requests to applications +- Send UI / User confirmation to the SIM application + +

Sound

+Sound that is related with voice call is used to control modem configuration +- Sound user configuration +- Voice path control +- Volume control +- Mic mute control + +

Common

+ +- TAPI initialization & De-initialization +- Register, Deregister event +- TAPI Initialization & De-initialization for Ecore +- Register, Deregister Ecore event +- Request Connection name + +@} + +

Feature Description

+

COMMON

+ +@defgroup Use_Cases1_1 TAPI Initialization +@ingroup Use_Cases1_COMMON +@{ +

TAPI Initialization

+This API shall be used to initialize the TAPI library. This API internally performs initialization routines related to Event delivery. +@n This API should be called before any other TAPI APIs. This API should be used by GTK/Glib applications. + +@code +int tel_init (void); +@endcode + +SAMPLE CODE +@code +#include +#include +#include + +void tapiinit() +{ + int api_err; + + api_err = tel_init(); + if (api_err != TAPI_API_SUCCESS) + { + printf ("tel_init Failed - api_err = %d\n", api_err); + } +} +@endcode +@} +@defgroup Use_Cases1_2 TAPI De-initialization +@ingroup Use_Cases1_COMMON +@{ +

TAPI De-initialization

+This API shall be used to de initialize the Tapi library. +@n It shall perform the deinitializing routines related to event delivery. +@n The API shall be called finally, as a part of clean up routines. This API should be used by GTK/Glib applications. + +@code +int tel_deinit (void); +@endcode + +SAMPLE CODE +@code +#include +#include +#include + +void tapideinit() +{ + int api_err; + + api_err = tel_deinit(); + if (api_err != TAPI_API_SUCCESS) + { + printf ("tel_deinit Failed - api_err = %d\n", api_err); + } +} +@endcode +@} +@defgroup Use_Cases1_3 Register Event +@ingroup Use_Cases1_COMMON +@{ + +

Register Event

+API is used to register the callback function for a specific TAPI Event. Upon successful registration of the event, the function shall return a valid subscription id. + +If Application registers multiple callbacks for a specific event, then all the callbacks will be called when an event indication is received. +@n This API should be used by GTK/Glib applications. + +@code +int tel_register_event (int EventType , unsigned int * SubscriptionId, TelAppCallback AppCallBack); +@endcode + +SAMPLE CODE +@code +#include +#include +#include + +void app_callback(TelTapiEvent_t *event); + +// REGISTER EVENT +void registerevent() +{ + unsigned int subscription_id = 0; + int api_err; + + api_err = tel_init(); + if (api_err != TAPI_API_SUCCESS) + { + printf ("tel_init Failed - api_err = %d\n", api_err); + } + + api_err = tel_register_event (TAPI_EVENT_CALL_SETUP_CNF, &subscription_id, (TelAppCallback)&app_callback); + + printf("MISC Event registeration is Done: sub id is %d, api_err is %d\n", subscription_id, api_err); + + tel_register_app_name("org.tizen.appname"); +} + +void app_callback(TelTapiEvent_t *event) +{ + //Callback function to be called +} +@endcode +@} + +@defgroup Use_Cases1_4 Deregister Event +@ingroup Use_Cases1_COMMON +@{ + +

Deregister Event

+API shall de-register the pre-registered TAPI event and the associated application callback, based on the subscription id. +@n This identifier is the same as the subscription identifier returned to the application during the TAPI registration procedure. If the de-register API is called during any service requests, the registered callback will be cleared based on the subscription id. No application callback shall be called when any confirmation/indication events are received after de-registration. +@n This API should be used by GTK/Glib applications. + +@code +int tel_deregister_event ( unsigned int SubscriptionId); +@endcode + +SAMPLE CODE +@code +#include +#include +#include + +void app_callback(TelTapiEvent_t *event); + +void registerevent() +{ + unsigned int subscription_id = 0; + int api_err; + + api_err = tel_init(); + if (api_err != TAPI_API_SUCCESS) + { + printf ("tel_deregister_event Failed - api_err = %d\n", api_err); + } + + // REGISTER EVENT + api_err = tel_register_event (TAPI_EVENT_CALL_SETUP_CNF, &subscription_id, (TelAppCallback)&app_callback); + printf("MISC Event registeration is Done: sub id is %d, api_err is %d\n",subscription_id,api_err); + + tel_register_app_name("org.tizen.appname"); + + // DEREGISTER EVENT + api_err = tel_deregister_event (subscription_id); + if (api_err != TAPI_API_SUCCESS) + { + printf("Event Deregistration Failed\n"); + } +} + +void app_callback(TelTapiEvent_t *event) +{ + // callback function to be called +} +@endcode +@} + + +@defgroup Use_Cases1_5 TAPI Ecore Initialization +@ingroup Use_Cases1_COMMON +@{ + +

TAPI Ecore Initialization

+This API shall be used by Ecore based applications, to initialize TAPI library. This API internally performs event delivery related initialization routines. This API shall be called before any other TAPI APIs. +@n This API is for applications using Ecore library. + +@code +int tel_init_ecore_loop (void); +@endcode + +SAMPLE CODE +@code +#include +#include +#include + +void tapiinitecore() +{ + int api_err; + + api_err = tel_init_ecore_loop(); + if (api_err != TAPI_API_SUCCESS) + { + printf("tel_init_ecore_loop Failed - api_err = %d\n", api_err); + } +} +@endcode + +5

TAPI Ecore De-Initialization

+API shall be used to de-initialize the TAPI library. It shall be used by Ecore based applications. +@n This API shall be called finally, as a part of cleanup routine. This API is for applications using Ecore library. + +@code +int tel_deinit_ecore_loop (void); +@endcode + +SAMPLE CODE +@code +#include +#include +#include + +void tapideinitecore() +{ + int api_err; + + api_err = tel_deinit_ecore_loop(); + if (api_err != TAPI_API_SUCCESS) + { + printf("tel_deinit_ecore_loop Failed - api_err = %d\n", api_err); + } +} +@endcode +@} + +@defgroup Use_Cases1_6 TAPI RegisterEvent Ecore +@ingroup Use_Cases1_COMMON +@{ + +

TAPI RegisterEvent Ecore

+API shall be used to register for TAPI events (for application that use EFL). +@n Upon successful registration of the event, the API shall return a valid subscription id. +@n If Application registers multiple callbacks for a specific event, then all the callbacks will be called when an event indication is received +@n This API is for applications using Ecore library. + +@code +int tel_register_event_at_ecore_loop(int EventType, unsigned int * SubscriptionId, TelAppCallback AppCallBack); +@endcode + +SAMPLE CODE +@code +#include +#include +#include + +void app_callback(TelTapiEvent_t *event); + +void registereventecore() +{ + int api_err; + unsigned int subscription_id = 0; + + api_err = tel_register_event_at_ecore_loop (TAPI_EVENT_CALL_SETUP_CNF, &subscription_id, (TellAppCallback)&app_callback); + if (api_err != TAPI_API_SUCCESS) + { + printf ("tel_register_event_at_ecore_loop Failed - api_err = %d \n", api_err); + } + printf("RegisterEventEcore done with subscription_id:%d and return Status:%d\n", subscription_id, api_err); + + tel_register_app_name("org.tizen.appname"); +} + +void app_callback(TelTapiEvent_t *event) +{ + //Callback function to be called +} +@endcode +@} + + +@defgroup Use_Cases1_7 TAPI DeRegisterEvent Ecore +@ingroup Use_Cases1_COMMON +@{ + +

TAPI DeRegisterEvent Ecore

+API shall de-register the pre-registered TAPI event and the associated application callback, based on the subscription id. +@n This identifier is the same as the subscription identifier returned to the application during the TAPI registration procedure. +@n If the de-register API is called during any service requests, the registered callback will be cleared based on the subscription id. No application callback shall be called when any confirmation/indication events are received after de-registration. +@n This API is for applications based on Ecore library. + +@code +int tel_deregister_event_at_ecore_loop (unsigned int SubscriptionId); +@endcode + +SAMPLE CODE +@code +#include +#include +#include + +Void deregistereventecore() +{ + int api_err; + unsigned int subscription_id = 0; + + // REGISTER EVENT + api_err = tel_register_event_at_ecore_loop (TAPI_EVENT_CALL_SETUP_CNF, &subscription_id, (TellAppCallback)&app_callback); + printf("RegisterEventEcore done with subscription_id:%d and return Status:%d\n", subscription_id, api_err); + + tel_register_app_name("org.tizen.appname"); + + // DEREGISTER EVENT + api_err = tel_deregister_event_at_ecore_loop (subscription_id); + if (api_err != TAPI_API_SUCCESS) + { + printf("tel_deregister_event_at_ecore_loop Failed - api_err = %d\n", api_err); + } +} +@endcode +@} + +@defgroup Use_Cases1_8 Register Application Name +@ingroup Use_Cases1_COMMON +@{ + +

Register Application Name

+This function registers the application name which requests any telephony service. Telephony Server uses this name as the destination name of response message upon the service request. If the name is not set, the request will fails. Before an application invoke this function, it shall initialize a connection to Telephony Sever with #tel_init or #tel_init_ecore_loop. And the application name shall be registered prior to start a event loop. + +@code +int tel_register_app_name(char *name) +@endcode + +SAMPLE CODE +@code +#include +#include +#include + +Void register_app_name() +{ + tel_init(); + //register telephony event + tel_register_event(...); + //... + tel_register_app_name("org.tizen.appname"); + GMainLoop *loop = g_main_loop_new(NULL, false); + g_main_loop_run(loop); +} +@endcode +@} + +@defgroup Use_Cases1_9 Get Application Name +@ingroup Use_Cases1_COMMON +@{ + +

Get Application Name

+This function get the application name which was registered with #tel_register_application_name. + +@code +int tel_get_app_name(tapi_dbus_connection_name *app_name) +@endcode + +SAMPLE CODE +@code +#include +#include + +void get_app_name() +{ + tapi_dbus_connection_name app_name; + tel_get_app_name(&app_name); + printf("app_name = %s\n", app_name.name); +} +@endcode +@} +@defgroup Use_Cases1_10 TAPI Check service ready +@ingroup Use_Cases1_COMMON +@{ + +

TAPI Check service ready

+API is used to get the modem status i.e. whether modem is on or off. + +@code +int tel_check_service_ready (int* bStatus) +@endcode + +SAMPLE CODE: +@code +#include +#include + +void getmodemstatus() +{ + int bStatus = 0; + int err_code; + + err_code = tel_check_service_ready(&bStatus); + if (err_code != TAPI_API_SUCCESS) { + printf("Error Code [%x]\n", err_code); + } + else { + if (bStatus == 0) + printf("Telephony Service Not Ready"; + else if (bStatus == 1) + printf("Telephony Service Ready"; + } +} +@endcode +@} + + +

CALL

+ +@defgroup Use_Cases2_1 Event Register and Deregister +@ingroup Use_Cases2_CALL +@{ + +

Event Register and Deregister

+To receive asynchronous event notifications for the call APIs, the registration of related events with their associated call backs is required. After these are registered, when an asynchronous API is called, the confirmation is returned as an asynchronous event notification which invokes the callback function along with the event data. + +SAMPLE CODE: +@code +// REGISTER EVENT +int api_err; +unsigned int subscription_id = 0; + +api_err = tel_init(); +if (api_err != TAPI_API_SUCCESS) +{ + printf("tel_init Failed - api_err = %d \n", api_err); +} + +api_err = tel_register_event (TAPI_EVENT_CALL_CALL_SETUP_CNF, &subscription_id, (TelAppCallback)&app_callback); +printf("VOICE CALL Event registration is Done: sub id is %d, api_err is %d\n",subscription_id,api_err); + +tel_register_app_name("org.tizen.appname"); + +// DEREGISTER EVENT +api_err = tel_deregister_event (subscription_id); +if (api_err != TAPI_API_SUCCESS) +{ + printf("Event Class Unregistration Fail\n"); +} +@endcode +@} + +@defgroup Use_Cases2_2 Call Setup +@ingroup Use_Cases2_CALL +@{ + +

Call Setup

+This API originates an MO call setup. + +@code +int tel_exe_call_mo _t (const TelCallSetupParams_t* const pParams, unsigned int * pCallHandle, int * pRequestID); +@endcode + +On success, this API returns a valid call handle and the request ID as out parameters. +@n The MO call setup procedure continues in background. There are multiple states involved in the call setup procedure. Upon completion of the setup request, the event notifications and associated event data are sent to the client, based on the indication or response received by the Telephony Server. + +This API is restricted for direct use. Use the Voice call engine API instead. + +SAMPLE CODE: +@code +#include +#include +#include "TapiCommon.h" + +//SUBSCRIBE FOR EVENTS AS MENTIONED IN Event Register and Deregister +void callsetup() +{ + int ret_status; + int pRequestID = 0; + unsigned int pCallHandle; + TelCallSetupParams_t pParams; + char normal[16] = "1234"; //Called party number + + memset(&pParams, 0, sizeof(TelCallSetupParams_t)); + pParams.CallType = TAPI_CALL_TYPE_VOICE; + strcpy(pParams.szNumber, normal); + + ret_status = tel_exe_call_mo (&pParams, &pCallHandle, &pRequestID); + if (ret_status == TAPI_API_SUCCESS) + printf("successful\n"); + else + printf("error=%d\n", ret_status); //WAIT FOR EVENT HERE +} + +//CALLBACK FUNCTION TO BE USED +static void app_callback (TelTapiEvent_t *event) +{ + int eventClass; + int eventType; + int requestId; + int status; + void* EventData = NULL; + + unsigned int temp_handle = 0; + + eventClass = event->EventClass; + eventType = event->EventType; + requestId = event->RequestId; + status = event->Status; + EventData = event->pData; + + //TEST_DEBUG("Class:[%d], Event Type:[%d], RequestId:[%d], Status:[%d]\n", eventClass, eventType , requestId, status ); + + if (status != 0) + { + //TEST_DEBUG("******This is nonzero status. ******\n"); + return; + } + + switch (eventType) + { + case TAPI_EVENT_CALL_SETUP_CNF: + printf("TAPI_EVENT_CALL_SETUP_CNF"); + memcpy(&temp_handle, EventData, sizeof(unsigned int)); + TEST_DEBUG("Received setup cnf for call Handle [%d]", temp_handle); + + break; + + case TAPI_EVENT_CALL_ALERT_IND: + int index; + TEST_DEBUG("TAPI_EVENT_CALL_ALERT_IND"); + memcpy(&temp_handle, event->pData, sizeof(unsigned int)); + TEST_DEBUG("Received Alert for call Handle [%d]", temp_handle); + break; + + case TAPI_EVENT_CALL_CONNECTED_IND: + int index; + TEST_DEBUG("TAPI_EVENT_CALL_CONNECTED_IND"); + memcpy(&temp_handle, event->pData, sizeof(TS_UINT)); + TEST_DEBUG("Received Connected Event for call Handle [%d]", temp_handle); + break; + } + //... +} +@endcode +@} +@defgroup Use_Cases2_3 Call Answer +@ingroup Use_Cases2_CALL +@{ + +

Call Answer

+This API responds to an incoming call either by accepting or rejecting the call. + +Pre Conditions: +@n Call associated with the call handle should be in TAPI_CALL_STATE_INCOM state. +@n There should be no more than one existing call. + +@code +int tel_answer_call (unsigned int CallHandle,TelCallAnswerType_t AnsType, int * pRequestID); +@endcode + +This API is restricted for direct use. Use the Voice call engine API instead. + +SAMPLE CODE: +@code +#include +#include +#include "TapiCommon.h" +//SUBSCRIBE FOR EVENTS AS MENTIONED IN Event Register and Deregister + +void callsetup(unsigned int CallHandle) +{ + int ret_status; + int pRequestID = 0; + + ret_status = tel_answer_call (CallHandle, &pRequestID); + if (ret_status == TAPI_API_SUCCESS) + printf("successful\n"); + else + printf("error=%d\n", ret_status); //WAIT FOR EVENT HERE +} + +//CALLBACK FUNCTION TO BE USED +static void app_callback (TelTapiEvent_t *event) +{ + //.. + switch (eventType) //REFER Call Setup TO GET eventType + { + //GET CALL HANDLE FROM INCOMING CALL EVENT DATA + case TAPI_EVENT_CALL_INCOM_IND: + unsigned int CallHandle; + TelCallIncomingCallInfo_t IncomingInfo; + memcpy(&IncomingInfo, event->pData, sizeof(TelCallIncomingCallInfo_t)); + CallHandle = IncomingInfo.CallHandle; + break; + + case TAPI_EVENT_CALL_ANSWER_CNF: + memcpy(&CallHandle, event->pData, sizeof(unsigned int)); + printf("TAPI_EVENT_CALL_ANSWER_CNF\n"); + break; + } + //.. +} +@endcode +@} +@defgroup Use_Cases2_4 Call Release +@ingroup Use_Cases2_CALL +@{ + +

Call Release

+This API is used to release the call. +@n The call to be released can be a single call based on the call handle, or all active calls or all calls. + +Pre Conditions: +@n Call handle should be valid and there should be an existing call in Active/hold state. + +@code +int tel_release_call (unsigned int CallHandle, int * pRequestID); +int tel_release_call_all (int * pRequestId); +int tel_release_call_all_active (int *pRequestID); +int tel_release_call_all_held (int *pRequestID); +@endcode + +This API is restricted for direct use. Use the Voice call engine API instead. + +SAMPLE CODE: +@code +#include +#include +#include "TapiCommon.h" + +//SUBSCRIBE FOR EVENTS AS MENTIONED IN Event Register and Deregister + +void callrelease(unsigned int CallHandle) +{ + int ret_status; + int pRequestID = 0; + + ret_status = tel_release_call (CallHandle, &pRequestID); + //OR + ret_status = tel_release_call_all (&pRequestID); + //OR + ret_status = tel_release_call_all_active (&pRequestID); + //OR + ret_status = tel_release_call_all_held (&pRequestID); + + if (ret_status == TAPI_API_SUCCESS) + printf("successful\n"); + else + printf("error=%d\n", ret_status); +} //WAIT FOR EVENT HERE + +//CALLBACK FUNCTION TO BE USED +static void app_callback(TelTapiEvent_t *event) +{ + //... + switch (eventType) //REFER Call Setup TO GET eventType + { + //GET CALL HANDLE FROM INCOMING CALL EVENT DATA + case TAPI_EVENT_CALL_INCOM_IND: + TelCallIncomingCallInfo_t IncomingInfo; + memcpy(&IncomingInfo, event->pData, sizeof(TelCallIncomingCallInfo_t)); + CallHandle = IncomingInfo.CallHandle; + break; + + case TAPI_EVENT_CALL_RELEASE_CNF: + case TAPI_EVENT_CALL_RELEASE_ALL_CNF: + case TAPI_EVENT_CALL_RELEASE_ALL_ACTIVE_CNF: + case TAPI_EVENT_CALL_RELEASE_ALL_HELD_CNF: + case TAPI_EVENT_CALL_END_IND_IND: + unsigned int handle; + memcpy(&handle, event->pData, sizeof(unsigned int)); + printf("TAPI_EVENT_CALL_RELEASE_CNF\n"); + break; + //... + } +} +@endcode +@} +@defgroup Use_Cases2_5 Call Hold +@ingroup Use_Cases2_CALL +@{ + +

Call Hold

+This API puts the specified call on hold. The call identified by Call Handle should be in the active state. + +@code +int tel_hold_call (unsigned int CallHandle, int * pRequestID); +@endcode + +This API is restricted for direct use. Use the Voice call engine API instead. + +SAMPLE CODE +@code +#include +#include +#include "TapiCommon.h" + +//SUBSCRIBE FOR EVENTS AS MENTIONED IN Event Register and Deregister +void callhold(unsigned int CallHandle) +{ + int ret_status; + int pRequestID = 0; + + ret_status = tel_hold_call(CallHandle, &pRequestID); + if (ret_status == TAPI_API_SUCCESS) + printf("successful\n"); + else + printf("error=%d\n", ret_status); +} //WAIT FOR EVENT HERE + +//CALLBACK FUNCTION TO BE USED +static void app_callback (TelTapiEvent_t *event) +{ + //.. + switch (eventType) //REFER Call Setup TO GET eventType + { + case TAPI_EVENT_CALL_HOLD_CNF: + unsigned int CallHandle; + memcpy(&CallHandle, event->pData, sizeof(unsigned int)); + printf("TAPI_EVENT_CALL_HOLD_CNF\n"); + break; + //... + } + //... +} +@endcode +@} +@defgroup Use_Cases2_6 Call Retrieve +@ingroup Use_Cases2_CALL +@{ + +

Call Retrieve

+This API can be used to retrieve a held call. + +Pre Conditions: +@n Call should be in held state in order to return to the active state, and no other call should be active. + +@code +int tel_retrieve_call (unsigned int CallHandle, int * pRequestID); +@endcode + +This API is restricted for direct use. Use the Voice call engine API instead. + +SAMPLE CODE: +@code +#include +#include +#include "TapiCommon.h" + + +//SUBSCRIBE FOR EVENTS AS MENTIONED IN Event Register and Deregister +void callretrieve(unsigned int CallHandle) +{ + int ret_status; + int pRequestID=0; + + ret_status = tel_retrieve_call(CallHandle, &pRequestID); + if (ret_status == TAPI_API_SUCCESS) + printf("successful\n"); + else + printf("error=%d\n", ret_status); +} //WAIT FOR EVENT HERE + +//CALLBACK FUNCTION TO BE USED +static void app_callback(TelTapiEvent_t *event) +{ + //.. + switch (eventType) //REFER Call Setup TO GET eventType + { + case TAPI_EVENT_CALL_HOLD_CNF: + unsigned int CallHandle; + memcpy(&CallHandle, event->pData, sizeof(unsigned int)); + printf("TAPI_EVENT_CALL_HOLD_CNF\n"); + break; + + case TAPI_EVENT_CALL_RETRIEVE_CNF: + unsigned int CallHandle; + memcpy(&CallHandle, event->pData, sizeof(unsigned int)); + printf("TAPI_EVENT_CALL_RETRIEVE_CNF "); + break; + } + //... +} +//... +@endcode +@} +@defgroup Use_Cases2_7 Call Swap +@ingroup Use_Cases2_CALL +@{ + +

Call Swap

+This API can be used to swap calls. This feature is only available for the calls that have been setup and answered using the Telephony service. The swap functionality is only available for voice calls. + +Pre Conditions: +@n Two calls should be present, one of them in the Active state and the other in the held state + +@code +int tel_swap_call (unsigned int CallHandle1, const TS_UINT CallHandle2, int * pRequestID); +@endcode + +This API is restricted for direct use. Use the Voice call engine API instead. + +SAMPLE CODE: +@code +#include +#include +#include "TapiCommon.h" +//SUBSCRIBE FOR EVENTS AS MENTIONED IN Event Register and Deregister + +void callswap(unsigned int CallHandle1, unsigned int CallHandle2) +{ + int ret_status; + int pRequestID = 0; + + ret_status = tel_swap_call(CallHandle1, CallHandle2, &pRequestID); + if (ret_status == TAPI_API_SUCCESS) + printf("successful\n"); + else + printf("error=%d\n", ret_status); + //.. +} //WAIT FOR EVENT HERE + +//CALLBACK FUNCTION TO BE USED +static void app_callback (TelTapiEvent_t *event) +{ + //.. + switch (eventType) //REFER Call Setup TO GET eventType + { + case TAPI_EVENT_CALL_SWAP_CNF: + printf("TAPI_EVENT_CALL_RETRIEVE_CNF\n"); + break; + } + //.. +} +//.. +@endcode +@} +@defgroup Use_Cases2_8 Send DTMF +@ingroup Use_Cases2_CALL +@{ + +

Send DTMF

+This API can be used for sending one or more DTMF digits during the call. + +Pre Conditions: +@n Active call should be present. + +@code +int tel_send_call_dtmf (char const * const pDtmfString, int * pRequestID); +@endcode + +This API is restricted for direct use. Use the Voice call engine API instead. + +SAMPLE CODE: +@code +#include +#include +#include "TapiCommon.h" + +//SUBSCRIBE FOR EVENTS AS MENTIONED IN Event Register and Deregister +void senddtmf() +{ + int ret_status; + int pRequestID = 0; + char DtmfString[10]; + + strcpy(DtmfString, "123456789"); //Sample DTMF digits that need to be sent + + ret_status = tel_send_call_dtmf(DtmfString, &pRequestID); + if (ret_status == TAPI_API_SUCCESS) + printf("successful\n"); + else + printf("error=%d\n", ret_status); +} +//WAIT FOR EVENT HERE +static void app_callback(TelTapiEvent_t *event) +{ + //.. + switch (eventType) //REFER Call Setup TO GET eventType + { + case TAPI_EVENT_CALL_SEND_DTMF_CNF: + printf("TAPI_EVENT_CALL_SEND_DTMF_CNF\n"); + break; + } + //.. +} +@endcode +@} +@defgroup Use_Cases2_9 Call Join +@ingroup Use_Cases2_CALL +@{ + +

Call Join

+This API joins the specified two calls (one call which is in the active state and other call which is in the held state) into a conference call. + +Pre Conditions: +@n For a Multiparty call or for joining two calls into conference, there should be one call in active state and another call in held state. + +@code +int tel_join_call (unsigned int CallHandle1, const unsigned int CallHandle2,int * pRequestID); +@endcode + +This API is restricted for direct use. Use the Voice call engine API instead. + +SAMPLE CODE +@code +#include +#include +#include "TapiCommon.h" + +//SUBSCRIBE FOR EVENTS AS MENTIONED IN Event Register and Deregister +void calljoin(unsigned int CallHandle1, unsigned int CallHandle2) +{ + int ret_status; + int pRequestID = 0; + + ret_status= tel_join_call(CallHandle1, CallHandle2, &pRequestID); + if (ret_status == TAPI_API_SUCCESS) + printf("successful\n"); + else + printf("error=%d\n", ret_status); +} //WAIT FOR EVENT HERE + +//CALLBACK FUNCTION TO BE USED +static void app_callback (TelTapiEvent_t *event) +{ + //.. + switch (eventType) //REFER Call Setup TO GET eventType + { + case TAPI_EVENT_CALL_SETUPCONFERENCE_CNF: + unsigned int temp_handle; + memcpy(&temp_handle, event->pData, sizeof(unsigned int)); + printf("TAPI_EVENT_CALL_SETUPCONFERENCE_CNF "); + break; + } + //.. +} +@endcode +@} +@defgroup Use_Cases2_10 Call Split +@ingroup Use_Cases2_CALL +@{ + +

Call Split

+This API triggers the split of a single call from multiparty call. This can be used for creating a private communication with one of remote parties in a multiparty session. +@n TAPI client application has to pass the call handle which should be split from the multiparty call. + +Pre Conditions: +@n Call should be in multiparty conference call. + +Post Conditions: +@n Split call will be the active call and the conference will be held call. + +@code +int tel_split_call (unsigned int CallHandle, int * pRequestID); +@endcode + +This API is restricted for direct use. Use the Voice call engine API instead. + +SAMPLE CODE +@code +#include +#include +#include "TapiCommon.h" + +//SUBSCRIBE FOR EVENTS AS MENTIONED IN Event Register and Deregister +void callsplit(unsigned int CallHandle) +{ + int ret_status; + int pRequestID = 0; + + ret_status = tel_split_call(CallHandle, &pRequestID); + if (ret_status == TAPI_API_SUCCESS) + printf("successful\n"); + else + printf("error=%d\n", ret_status); +}//WAIT FOR EVENT HERE + +//CALLBACK FUNCTION TO BE USED +static void app_callback (TelTapiEvent_t *event) +{ + //.. + switch (eventType) //REFER Call Setup TO GET eventType + { + case TAPI TAPI_EVENT_CALL_SPLITCONFERENCE_CNF: + unsigned int temp_handle; + memcpy(&temp_handle, event->pData, sizeof(unsigned int)); + printf("TAPI_EVENT_CALL_SPLITCONFERENCE_CNF "); + break; + } + //.. +} +@endcode +@} +@defgroup Use_Cases2_11 Active Line +@ingroup Use_Cases2_CALL +@{ + +

Active Line

+[Note] Telephony Emulator does not support this feature. +@n Telephony provides APIs for setting and getting the current calling line identification number. + +@code +int tel_set_call_act_line const TelCallActiveLine_t active_line, int * pRequestID); +int tel_get_call_act_line ( int * pRequestID); +@endcode + +This API is restricted for direct use. Use the Voice call engine API instead. + +SAMPLE CODE +@code +#include +#include +#include "TapiCommon.h" + +//SET ACTIVE LINE +void activeline() +{ + int ret_status; + int pRequestID = 0; + TelCallActiveLine_t g_curLine = TAPI_CALL_ACTIVE_LINE1; + TelCallActiveLine_t active_line; + + printf (" Set Active Line with TAPI_ACTIVE_LINE1."); + + ret_status = tel_set_call_act_line (g_curLine, &pRequestID); + if (ret_status == TAPI_API_SUCCESS) + printf("successful\n"); + else + printf("error=%d\n", ret_status); + + //GET ACTIVE LINE + ret_status = tel_get_call_act_line (&pRequestID); + if (ret_status == TAPI_API_SUCCESS) + printf("successful\n"); + else + printf("error=%d\n", ret_status); + //.. +} + +//CALLBACK FUNCTION TO BE USED +static void app_callback (TelTapiEvent_t *event) +{ + //.. + switch (eventType) //REFER Call Setup TO GET eventType + { + case TAPI_EVENT_CALL_SET_LINEID_CNF: + //TEST_DEBUG("Received TAPI_EVENT_CALL_SET_LINEID_CNF"); + //AUTO_LOG("EVENT: SET_LINEID_CNF:"); + break; + + case TAPI_EVENT_CALL_GET_LINEID_CNF: + TelCallActiveLine_t active_line; + memcpy(&active_line, event->pData, sizeof(TelCallActiveLine_t)); + TEST_DEBUG("Received TAPI_EVENT_CALL_GET_LINEID_CNF"); + break; + } + //.. +} +@endcode +@} +@defgroup Use_Cases2_12 Call transfer +@ingroup Use_Cases2_CALL +@{ + +

Call transfer

+This API triggers an explicit call transfer by connecting two parties, one of which is in the active state with the other in the held state. + +Pre Conditions: +@n In order to call transfer, 2 calls should be present. One in the active state and the other in the Held state. + +Post Conditions: +@n When the request has been completed successfully, Call end indication will be sent to both the calls (active and held). + +@code +int tel_exe_call_explicit_transfer (unsigned int CallHandle, int * pRequestID); +@endcode + +This API is restricted for direct use. Use the Voice call engine API instead. + +SAMPLE CODE: +@code +#include +#include +#include "TapiCommon.h" + +//SUBSCRIBE FOR EVENTS AS MENTIONED IN Event Register and Deregister +void calltransfer(unsigned int CallHandle) +{ + int ret_status; + int pRequestID = 0; + + ret_status = tel_exe_call_explicit_transfer (CallHandle, &pRequestID); + if (ret_status == TAPI_API_SUCCESS) + printf("successful\n"); + else + printf("error=%d\n", ret_status); +}//WAIT FOR EVENT HERE + +//CALLBACK FUNCTION TO BE USED +static void app_callback (TelTapiEvent_t *event) +{ + //.. + switch (eventType) //REFER Call Setup TO GET eventType + { + case TAPI_EVENT_CALL_TRANSFER_CNF: + unsigned int temp_handle = 0; + memcpy(&temp_handle, event->pData, sizeof(unsigned int)); + printf("TAPI_EVENT_CALL_TRANSFER_CNF. "); + break; + } + //.. +} +@endcode +@} +@defgroup Use_Cases2_13 Get Call Status +@ingroup Use_Cases2_CALL +@{ + +

Get Call Status

+When call status is requested by the application, this API gets the status of the call associated with the input Call Handle. Call status information consists of destination number, call direction (MO or MT), call type (voice or data etc), multiparty state (whether the call is in conference state or not) and present call state. +@n Call handle must be valid. + +@code +int tel_get_call_status (unsigned int CallHandle, TelCallStatus_t * pCallStatus) +@endcode + +This API is restricted for direct use. Use the Voice call engine API instead. + +SAMPLE CODE +@code +#include +#include +#include "TapiCommon.h" + +void getcallstatus(unsigned int CallHandle) +{ + int ret_status; + TelCallStatus_t callStatus; + + ret_status = tel_get_call_status(CallHandle, &callStatus); + if (ret_status == TAPI_API_SUCCESS) + { + printf("successful\n"); + printf("CallNumber: %s\n", callStatus.pNumber); + printf("Is Mobile Originated:%d n\t CallType : %d \n\t CallActiveState: %d\n\t CallState : %d\n\t isConferenceState:%d \n", + callStatus.bMoCall, + callStatus.CallType, + callStatus.CallActiveState, + callStatus.CallState, + callStatus.bConferenceState); + } + else { + printf("error=%d\n", ret_status); + } +} +@endcode +@} +@defgroup Use_Cases2_14 Get Call Duration +@ingroup Use_Cases2_CALL +@{ + +

Get Call Duration

+This API gets the duration of the specified call. +@n This is a synchronous API. Duration is timed from the moment the connection is established, i.e. call goes into active state for first time. The total call duration is provided in seconds, from the call connecting time to the current time. + +@code +int tel_get_call_duration unsigned int CallHandle, unsigned int * pDurationInSecs); +@endcode + +This API is restricted for direct use. Use the Voice call engine API instead. + +SAMPLE CODE +@code +#include +#include +#include "TapiCommon.h" + +void getcallduration(unsigned int CallHandle) +{ + int ret_status; + unsigned int duration; + + ret_status = tel_get_call_duration (CallHandle, &duration); + if (ret_status == TAPI_API_SUCCESS) + { + printf("successful\n"); + printf("Call Duration : %d Seconds\n", duration); + } + else { + printf("error=%d\n", ret_status); + } +} +@endcode +@} +@defgroup Use_Cases2_15 Get Call Conference List +@ingroup Use_Cases2_CALL +@{ + +

Get Call Conference List

+This is a synchronous API which returns information about all the call handles and the total number of call handles, within the specified conference call. + +Pre Conditions: +@n Call should be a multi-party conference call in order to return actual number of calls and call handles in the conference call. + +@code +int tel_get_call_conf_list(unsigned int CallHandle, unsigned int * pCallList, int * pNoOfCalls); +@endcode + +This API is restricted for direct use. Use the Voice call engine API instead. + +SAMPLE CODE +@code +#include +#include +#include "TapiCommon.h" + +void getconferencelist(unsigned int CallHandle) +{ + int ret_status ; + unsigned int callList[5]; + int noOfCalls; + + ret_status = tel_get_call_conf_list(CallHandle, callList, &noOfCalls); + if (ret_status == TAPI_API_SUCCESS) + { + printf("successful\n"); + printf("\n No.of Calls %d, \n", noOfCalls); + for (i = 0; i < noOfCalls; i++) + { + printf("\n Call Handle in conference calls %d \n", callList[i]); + } + } + else { + printf("error=%d\n", ret_status); + } +} +@endcode +@} +@defgroup Use_Cases2_16 Voice Privacy Mode +@ingroup Use_Cases2_CALL +@{ + +

Voice Privacy Mode

+Telephony provides two APIs which can be used to set and get the CDMA voice privacy mode . + +@code +int tel_get_call_privacy_mode (TelCallVoicePrivacyInfo_t PrivacyInfo, int *pRequestID); +int tel_set_call_privacy_mode (TelCallPrivacyType_t PrivacyType, int *pRequestID); +@endcode + +This API is restricted for direct use. Use the Voice call engine API instead. + +SAMPLE CODE +@code +#include +#include +#include "TapiCommon.h" + +//SUBSCRIBE FOR EVENTS AS MENTIONED IN Event Register and Deregister + +//SetVoicePrivacyMode +void setvoiceprivacymode() +{ + int ReqId = -1; + int ret_status = -1; + int api_err; + TelCallPrivacyMode_t PrivacyMode_info; + + pPrivacyMode_info = TAPI_CALL_PRIVACY_MODE_STANDARD; + + ret_status = tel_set_call_privacy_mode (pPrivacyMode_info, &reqId); + if (ret_status == TAPI_API_SUCCESS) + printf("Successful\n"); + else + printf("error:%d\n", ret_status); +} +//WAIT FOR EVENT HERE + +//CALLBACK FUNCTION TO BE USED + +bool call_app_callback (TelTapiEvent_t *Event) +{ + int ret = -1; + int eventClass = Event->EventClass; + int eventType = Event->EventType; + int RequestId = Event->RequestId; + int Status = Event->Status; + + if (eventClass == TAPI_EVENT_CLASS_CALL_VOICE) + { + switch (eventType) { + case TAPI_EVENT_CALL_SET_PRIVACYMODE_CNF: + if (RequestId != reqId) { + printf("Invalid RequestID received %d \n", reqId); + return false; + } + + if (Status != TAPI_CAUSE_SUCCESS) { + printf("Invalid Status value received"); + return false; + } + break; + } + } +} + +//GetVoicePrivacyMode +void getprivacymode() +{ + Int ReqId = -1; + int ret_status = -1; + int api_err; + TelCallPrivacyType_t privacyType; + + privacyType = TAPI_CALL_PRIVACY_TYPE_MS; + + ret_status = tel_get_call_privacy_mode (privacyType, &req_id); + if (ret_status == TAPI_API_SUCCESS) + printf("Successful\n"); + else + printf("error:%d\n", ret_status); +} + +//WAIT FOR EVENT HERE + +//CALLBACK FUNCTION TO BE USED + +bool call_app_callback (TelTapiEvent_t *Event) +{ + int ret = -1; + int eventClass = Event->EventClass; + int eventType = Event->EventType; + int RequestId = Event->RequestId; + int Status = Event->Status; + + if (eventClass == TAPI_EVENT_CLASS_CALL_VOICE) + { + switch (eventType) { + case TAPI_EVENT_CALL_GET_PRIVACYMODE_CNF: + TelCallVoicePrivacyInfo_t vp_info; + memcpy(&vp_info, event->pData, sizeof(TelCallVoicePrivacyInfo_t)); + if (Status != TAPI_CAUSE_SUCCESS) + { + printf("Invalid Status value received"); + return false; + } + break; + } + } +} +@endcode +@} +@defgroup Use_Cases2_17 Call FlashInformation +@ingroup Use_Cases2_CALL +@{ + +

Call FlashInformation

+The user makes an additional outgoing call in CDMA, this API is used instead of the CALL Outgoing API because there is no additional voice call transaction in CDMA. So the voice call id is only one in CDMA. The multiparty call is not supported in CDMA. + +@code +int tel_exe_call_flash_info (const char* pDialNumber, int *pRequestID); +@endcode + +This API is restricted for direct use. Use the Voice call engine API instead. + +SAMPLE CODE +@code +#include +#include +#include "TapiCommon.h" + +//SUBSCRIBE FOR EVENTS AS MENTIONED IN Event Register and Deregister +//CallFlashInfo +void callflashinfo() +{ + int ret_status = -1; + int api_err; + const char *pDialNumber = "9999900000"; + + ret_status = tel_exe_call_flash_info(pDialNumber, &reqId); + if (ret_status == TAPI_API_SUCCESS) + printf("Successful\n"); + else + printf("error:%d\n", ret_status); +} +//WAIT FOR EVENT HERE + +//CALLBACK FUNCTION TO BE USED +bool call_app_callback(TelTapiEvent_t *Event) +{ + int ret = -1; + int eventClass = Event->EventClass; + int eventType = Event->EventType; + int RequestId = Event->RequestId; + int Status = Event->Status; + + if (eventClass == TAPI_EVENT_CLASS_CALL_VOICE) + { + switch (eventType) + { + case TAPI_EVENT_CALL_FLASHINFO_CNF: + if (RequestId != reqId) + { + printf("Invalid RequestID received %d \n", reqId); + return false; + } + + if (Status != TAPI_CAUSE_SUCCESS) + { + printf("Invalid Status value received"); + return false; + } + printf("\n Received TAPI_EVENT_CALL_FLASHINFO_CNF \n"); + break; + + } + } + return true; +} +@endcode +@} +@defgroup Use_Cases2_18 Getting Call Time +@ingroup Use_Cases2_CALL +@{ + +

Getting Call Time

+This API is used to query information about a call time and call count. + +@code +int tel_get_call_time (const TS_WORD req_mask, int *pRequestID); +@endcode + +This API is restricted for direct use. Use the Voice call engine API instead. + +SAMPLE CODE +@code +#include +#include +#include "TapiCommon.h" + +void getcalltime() +{ + int ret_status = -1; + int api_err; + TelCallTimeMaskType_t mask_byte1; + TelCallTimeMaskType_t mask_byte2; + unsigned short mask_type; + + mask_byte1 = TAPI_CALL_TIME_TYPE_TOTAL_CALL_CNT; + mask_byte2 = TAPI_CALL_TIME_TYPE_TOTAL_CALL_TIME; + + mask_type = (mask_byte1 | mask_byte2); + + ret_status = tel_get_call_time(mask_type, &reqId); + if (ret_status == TAPI_API_SUCCESS) + printf("Successful\n"); + else + printf("error:%d\n", ret_status); +} +//WAIT FOR EVENT HERE + +bool call_app_callback(TelTapiEvent_t *Event) +{ + int ret = -1; + int eventClass = Event->EventClass; + int eventType = Event->EventType; + int RequestId = Event->RequestId; + int Status = Event->Status; + + if (eventClass == TAPI_EVENT_CLASS_CALL_VOICE) + { + switch (eventType) + { + case TAPI_EVENT_CALL_SET_PRIVACYMODE_CNF: + if (RequestId != reqId) + { + printf("Invalid RequestID received %d \n", reqId); + return false; + } + + if (Status != TAPI_CAUSE_SUCCESS) + { + printf("Invalid Status value received"); + return false; + } + break; + } + } +} +@endcode +@} + +

SUPPLEMENTARY SERVICE

+@defgroup Use_Cases3_1 Event register and deregister +@ingroup Use_Cases3_SUPPLEMENTARY_SERVICE +@{ +

Event register and deregister

+To receive asynchronous event notifications for the SS APIs, the registration of related events with their associated call backs is required. After these are registered, when an asynchronous API is called, the confirmation is returned as an asynchronous event notification which invokes the callback function along with the event data. + +SAMPLE CODE +@code +// REGISTER EVENT +unsigned int subscription_id = 0; +int api_err; + +api_err = tel_init(); +if (api_err != TAPI_API_SUCCESS) +{ + TEST_DEBUG("tel_init Failed - api_err = %d \n", api_err); +} + +api_err = tel_register_event (TAPI_EVENT_SS_WAITING_CNF, &subscription_id, (TelAppCallback)&app_callback); +printf("SS Event registration is Done: sub id is %d, api_err is %d\n",subscription_id,api_err); + +tel_register_app_name("org.tizen.appname"); + +// DEREGISTER EVENT +api_err = tel_deregister_event(subscription_id); +if (api_err != TAPI_API_SUCCESS) +{ + printf("Event Class Unregisteration Fail\n"); +} +@endcode +@} +@defgroup Use_Cases3_2 Call Barring +@ingroup Use_Cases3_SUPPLEMENTARY_SERVICE +@{ + +

Call Barring

+Telephony provides APIs to activate/deactivate call barring, get the barring status and change the barring password. It also provides APIs for applications to provide barring password requested by network for Call Barring Request or Change barring password request. +@n This service makes it possible for a mobile subscriber to activate barring for certain categories of outgoing or incoming calls. It also allows the deactivation of call barring based on categories set. +@n The mobile subscriber may also determine the type of barring preferrred for incoming/outgoing calls, by subscribing to a set of one or more unique barring programs . + +@code +int tel_set_ss_barring (const TelSsCallBarringInfo_t *pBarringInfo, int * pRequestId); +int tel_get_ss_barring_status (TelSsCallBarType_t BarType, TelSsCallType_t CallType, int * pRequestId ) +int tel_change_ss_barring_password ( const char* pOldPassword,const char* pNewPassword,const char * pNewPasswordAgain, int * pRequestId); +@endcode + +SAMPLE CODE FOR CALL BARRING +@code +#include +#include +#include + +//SUBSCRIBE FOR EVENTS AS MENTIONED IN Event Register and Deregister +void callbarring() +{ + int ret_status = -1; + TelSsCallBarringInfo_t BarringInfo; + int RequestId = 0; + char *bar_pwd = "0000"; + + BarringInfo.Mode = TAPI_SS_CALL_BAR_ACTIVATE; + BarringInfo.Type = TAPI_CALL_BARRING_ALL_OUTGOING_CALLS; + BarringInfo.CallType = TAPI_CALL_TYPE_VOICE_EV; + strcpy(BarringInfo.szPassword, bar_pwd); + + ret_status = tel_set_ss_barring (&BarringInfo, &RequestId); + if (ret_status == TAPI_API_SUCCESS) { + printf("successful\n"); + } + else { + printf("Error = %d \n", ret_status); + } +} +//WAIT FOR THE EVENT HERE + +static void app_callback (TelTapiEvent_t *event) +{ + int eventClass; + int eventType; + int requestId; + int status; + void* EventData = NULL; + unsigned int temp_handle = -1; + + //... + eventClass = event->EventClass; + eventType = event->EventType; + requestId = event->RequestId; + status = event->Status; + EventData = event->pData; + + //TEST_DEBUG("Class:[%d], Event Type:[%d], RequestId:[%d], Status:[%d] \n", eventClass, eventType , requestId, status ); + + if (status != 0) + { + //TEST_DEBUG("******This is nonzero status. ******\n"); + return; + } + + switch (eventType) + { + case TAPI_EVENT_SS_BARRING_CNF: + TelSsInfo_t SsInfo; + memcpy(&SsInfo, (TelSsInfo_t*)event->pData, sizeof(TelSsInfo_t)); + printf("Received Event :TAPI_EVENT_SS_BARRING_CNF\n"); + break; + } +} +@endcode + +SAMPLE CODE FOR BARRING STATUS +@code +#include +#include +#include + +void callbarringstatus() +{ + //SUBSCRIBE FOR EVENTS AS MENTIONED IN Event Register and Deregister + int ret_status; + TelSsCallBarType_t BarType = TAPI_CALL_BARRING_ALL_OUTGOING_INTERN_CALL; + TelSsCallType_t CallType = TAPI_CALL_TYPE_VOICE_EV; + int pRequestId = 0; + + ret_status = tel_get_ss_barring_status (BarType, CallType, &pRequestId); + if (ret_status == TAPI_API_SUCCESS) + { + printf("successful\n"); + } + else + { + printf("Error = %d \n", ret_status); + } +} +//WAIT FOR THE EVENT HERE + +static void app_callback (TelTapiEvent_t *event) +{ + int eventClass; + int eventType; + int requestId, i; + int status; + void* EventData = NULL; + unsigned int temp_handle = -1; + + //... + eventClass = event->EventClass; + eventType = event->EventType; + requestId = event->RequestId; + status = event->Status; + EventData = event->pData; + + if (status != 0) + { + //TEST_DEBUG("******This is nonzero status. ******\n"); + return; + } + + switch (eventType) + { + case TAPI_EVENT_SS_BARRING_QUERYSTATUS_CNF: + printf(" Received Event :TAPI_EVENT_SS_BARRING_QUERYSTATUS_CNF \n"); + TelSsInfo_t SsInfo; + memcpy(&SsInfo, (TelSsInfo_t*)EventData, sizeof(TelSsInfo_t)); + + for (i=0; i +#include +#include + +//SUBSCRIBE FOR EVENTS AS MENTIONED IN Event Register and Deregister +void changebarpwd() +{ + int ret_status; + int pRequestId = 0; + + ret_status = tel_change_ss_barring_password ("0000", "0000", "0000", &pRequestId); + if (ret_status == TAPI_API_SUCCESS) + { + printf("successful\n"); + } + else + { + printf("Error = %d \n", ret_status); + } +} + +//WAIT FOR THE EVENT HERE + +static void app_callback (TelTapiEvent_t *event) +{ + int eventClass; + int eventType; + int requestId; + int status; + void* EventData = NULL; + unsigned int temp_handle = -1; + + //... + eventClass = event->EventClass; + eventType = event->EventType; + requestId = event->RequestId; + status = event->Status; + EventData = event->pData; + + if (status != 0) + { + //TEST_DEBUG("******This is nonzero status. ******\n"); + return; + } + + //... + switch (eventType) + { + case TAPI_EVENT_SS_BARRING_CHANGEPASS_CNF: + printf("Received Event : TAPI_EVENT_SS_BARRING_CHANGEPASS_CNF\n"); + //check data + // + printf("Call barring Password Changed successfully\n"); + break; + //... + } +} +@endcode +@} +@defgroup Use_Cases3_3 Call Forward +@ingroup Use_Cases3_SUPPLEMENTARY_SERVICE +@{ + + +

Call Forward

+These APIs are used to set (activate/deactivate) the call forwarding option at the Network and to get call forward status. Call forwarding allows a user to forward incoming calls to another party. This service permits a called mobile subscriber to have the network send all incoming calls, or just those associated with a specific Basic service group meeting various call FORWARD conditions, to another directory number. The ability of the served mobile subscriber to originate calls is unaffected. If the service is activated, a call is forwarded only if the enabled forward condition is satisfied. +@n Application has to call this API in order to explicitly register/erase/activate/deactivate the call forwarding. Request will be sent irrespective of whether another SS call forward is already ongoing. + +@code +int tel_set_ss_forward ( const TelSsForwardInfo_t *pForwardInfo, int * pRequestId); +int tel_get_ss_forward_status (TelSsForwardType_t Type, TelSsForwardWhen_t Condition, int * pRequestId); +@endcode + +SAMPLE CODE FOR CALL FORWARD +@code +#include +#include +#include + +//SUBSCRIBE FOR EVENTS AS MENTIONED INEvent Register and Deregister +void callfwd() +{ + int ret_status = 0; + int pRequestId = 0; + TelSsForwardInfo_t pForwardInfo; + + pForwardInfo.Mode = TAPI_CALL_FORWARD_MODE_ENABLE_EV; + pForwardInfo.Type = TAPI_CS_FORWARD_TYPE_VOICE_EV; + pForwardInfo.Condition = TAPI_SS_FORWARD_WHEN_UNCONDITIONAL_EV; + pForwardInfo.NoReplyConditionTimer = 10; + + int len; + char *cf_number = "9986529874"; //number to which calles need to be forwarded. + + len = strlen(cf_number); + printf("Length of CF number :%d \n", len); + memcpy(&(pForwardInfo.szPhoneNumber), cf_number, len); + + ret_status = tel_set_ss_forward (&pForwardInfo, &pRequestId); + if (ret_status == TAPI_API_SUCCESS) + { + printf("successful\n"); + } + else + { + printf("Error = %d \n", ret_status); + } +} +//WAIT FOR THE EVENT HERE + +static void app_callback (TelTapiEvent_t *event) +{ + int eventClass; + int eventType; + int requestId,i; + int status; + void* EventData = NULL; + unsigned int temp_handle = -1; + + //... + eventClass = event->EventClass; + eventType = event->EventType; + requestId = event->RequestId; + status = event->Status; + EventData = event->pData; + + if (status != 0) + { + //TEST_DEBUG("******This is nonzero status. ******\n"); + return; + } + + //REFER Call Barring TO GET eventType AND EventData + switch (eventType) + { + case TAPI_EVENT_SS_FORWARD_CNF: + printf("Received Event :TAPI_EVENT_SS_FORWARD_CNF \n"); + TelSsInfo_t SsInfo; + + if (EventData != NULL) { + memcpy(&SsInfo, (TelSsInfo_t*)EventData, sizeof(TelSsInfo_t)); + printf("Number of records %d\n", SsInfo.NumberOfRecords); + } + + for (i=0; i +#include +#include + +//SUBSCRIBE FOR EVENTS AS MENTIONED IN Event Register and Deregister +void callfwdstatus() +{ + int ret_status = 0; + TelSsForwardType_t Type = TAPI_CS_FORWARD_TYPE_VOICE_EV; + TelSsForwardWhen_t Condition = TAPI_SS_FORWARD_WHEN_UNCONDITIONAL_EV; + int pRequestId = 0; + + ret_status = tel_get_ss_forward_status(Type, Condition, &pRequestId); + if (ret_status == TAPI_API_SUCCESS) + { + printf("successful\n"); + } + else + { + printf("Error = %d \n", ret_status); + } +} + +//WAIT FOR THE EVENT HERE + +static void app_callback (TelTapiEvent_t *event) +{ + int eventClass; + int eventType; + int requestId, i; + int status; + void* EventData = NULL; + unsigned int temp_handle = -1; + + //... + eventClass = event->EventClass; + eventType = event->EventType; + requestId = event->RequestId; + status = event->Status; + EventData = event->pData; + + //TEST_DEBUG("Class:[%d], Event Type:[%d], RequestId:[%d], Status:[%d] \n", eventClass, eventType , requestId, status ); + + if (status != 0) + { + //TEST_DEBUG("******This is nonzero status. ******\n"); + return; + } + + //... + //... + switch (eventType) + { + case TAPI_EVENT_SS_FORWARD_QUERYSTATUS_CNF: + // REFER Call Barring TO GET eventType AND EventData + TelSsInfo_t SsInfo; + + if (EventData != NULL) + memcpy(&SsInfo, (TelSsInfo_t*)EventData, sizeof(TelSsInfo_t)); + + for (i=0; iCall Waiting +These APIs activate/deactivate the call waiting service and provide the status of call wait feature. The call waiting service permits a mobile to be notified of an incoming call (as per basic call procedures) whilst the traffic channel is not available for the incoming call or when the mobile subscriber is engaged in an active or held call. Subsequently, the subscriber can accept, reject, or ignore the incoming call. + +@code +int tel_set_ss_waiting ( const TelSsWaitingInfo_t *waitInfo, int * RequestID); +int tel_get_ss_waiting_status ( const TelSsCallType_t CallType, int * RequestID); +@endcode + +SAMPLE CODE FOR CALL WAITING +@code +#include +#include +#include + +//SUBSCRIBE FOR EVENTS AS MENTIONED IN Event Register and Deregister +void callwaiting() +{ + int ret_status; + int RequestID; + TelSsWaitingInfo_t waitInfo; + + waitInfo.Mode = TAPI_SS_CW_ACTIVATE; + waitInfo.CallType = TAPI_CALL_TYPE_VOICE_EV; + + ret_status = tel_set_ss_waiting (&waitInfo, &RequestID); + if (ret_status == TAPI_API_SUCCESS) + { + printf("successful\n"); + } + else + { + printf("Error = %d \n", ret_status); + } +} +//WAIT FOR THE EVENT HERE + +//CALLBACK FUNCTION TO BE USED +static void app_callback (TelTapiEvent_t *event) +{ + int eventClass; + int eventType; + int requestId, i; + int status; + void* EventData = NULL; + unsigned int temp_handle = -1; + + //... + eventClass = event->EventClass; + eventType = event->EventType; + requestId = event->RequestId; + status = event->Status; + EventData = event->pData; + + //TEST_DEBUG("Class:[%d], Event Type:[%d], RequestId:[%d], Status:[%d] \n", eventClass, eventType , requestId, status ); + + if (status != 0) + { + //TEST_DEBUG("******This is nonzero status. ******\n"); + return; + } + + //... + switch (eventType) + { + case TAPI_EVENT_SS_WAITING_CNF: + printf("Received Event : TAPI_EVENT_SS_WAITING_CNF \n"); + //REFER Call Barring TO GET eventType AND EventData + + TelSsInfo_t SsInfo; + + memcpy(&SsInfo, (TelSsInfo_t*)EventData, sizeof(TelSsInfo_t)); + + for (i=0; i +#include +#include + +//SUBSCRIBE FOR EVENTS AS MENTIONED IN Event Register and Deregister +void callwaiting() +{ + int ret_status; + TelSsCallType_t CallType = TAPI_CALL_TYPE_VOICE_EV; + int RequestID=0; + + ret_status = tel_get_ss_waiting_status(CallType, &RequestID); + if (ret_status == TAPI_API_SUCCESS) + { + printf("successful\n"); + } + else + { + printf("Error = %d \n", ret_status); + } +} +//WAIT FOR THE EVENT HERE + +//CALLBACK FUNCTION TO BE USED +static void app_callback (TelTapiEvent_t *event) +{ + int eventClass; + int eventType; + int requestId, i; + int status; + void* EventData = NULL; + unsigned int temp_handle = -1; + + // + eventClass = event->EventClass; + eventType = event->EventType; + requestId = event->RequestId; + status = event->Status; + EventData = event->pData; + + //TEST_DEBUG("Class:[%d], Event Type:[%d], RequestId:[%d], Status:[%d]\n", eventClass, eventType , requestId, status ); + + if (status != 0) + { + //TEST_DEBUG("******This is nonzero status. ******\n"); + return; + } + + //... + switch (eventType) + { + case TAPI_EVENT_SS_WAITING_QUERYSTATUS_CNF: + printf("Received Event :TAPI_EVENT_SS_WAITING_QUERYSTATUS_CNF\n"); + //REFER Call Barring TO GET eventType AND EventData + + TelSsInfo_t SsInfo; + if (EventData != NULL) + memcpy(&SsInfo, (TelSsInfo_t*)EventData, sizeof(TelSsInfo_t)); + + for (i=0; iCLI Service Status +[Note] Telephony Emulator does not support this feature. + +Telephony provides an API to query the status of calling line identity service. The CLI service permits a mobile to show or hide his identity to the called party. + +@code +int tel_get_ss_cli_status (TelSsCliType_t CliType,int * pRequestId ); +@endcode + +SAMPLE CODE +@code +#include +#include + +//SUBSCRIBE FOR EVENTS AS MENTIONED IN Event Register and Deregister +void cliservicestatus() +{ + int ret_status; + TelSsCliType_t CliType = TAPI_SS_CLI_CDIP; + int pRequestId; + + ret_status = tel_get_ss_cli_status (CliType, &pRequestId); + if (ret_status == TAPI_API_SUCCESS) + { + printf("successful\n"); + } + else + { + printf("Error = %d \n", ret_status); + } +} +//WAIT FOR THE EVENT HERE + +//CALLBACK FUNCTION TO BE USED +static void app_callback (TelTapiEvent_t *event) +{ + int eventClass; + int eventType; + Int requestId; + int status; + void* EventData = NULL; + unsigned int temp_handle = -1; + + //... + eventClass = event->EventClass; + eventType = event->EventType; + requestId = event->RequestId; + status = event->Status; + EventData = event->pData; + + // TEST_DEBUG("Class:[%d], Event Type:[%d], RequestId:[%d], Status:[%d]\n", eventClass, eventType , requestId, status ); + + if (status != 0) + { + //TEST_DEBUG("******This is nonzero status. ******\n"); + return; + } + + //... + switch (eventType) + { + //REFER Call Barring TO GET eventType AND EventData + + case TAPI_EVENT_SS_IDENTIFY_IND: + TelSsInfo_t SsInfo; + memcpy(&SsInfo, (TelSsInfo_t*)EventData, sizeof(TelSsInfo_t)); + printf("Received Event : TAPI_EVENT_SS_IDENTIFY_IND \n"); + printf("Status :%d CLI Service : %d\n", + SsInfo.SsRecord.CliRecord.CliStatus, + SsInfo.SsRecord.CliRecord.IdentificationType); + break; + //... + } +} +@endcode +@} +@defgroup Use_Cases3_6 Send USSD Request +@ingroup Use_Cases3_SUPPLEMENTARY_SERVICE +@{ + + +

Send USSD Request

+This API is used to send a USSD string to the Network. This is an Asynchronous API. + +Pre Conditions: +@n No SS and USSD Transaction should be ongoing. If there an ongoing transaction, new USSD request will be returned to the Application with an error (USSD_BUSY) + +@code +int tel_send_ss_ussd_request( const char* szUssdString, int * pRequestId); +@endcode + +SAMPLE CODE +@code +#include +#include +#include + +//SUBSCRIBE FOR EVENTS AS MENTIONED IN Event Register and Deregister +void sendussdreq() +{ + char ussdString[TAPI_SS_USSD_DATA_SIZE_MAX]; + int ret; + + memset(ussdString, 0, TAPI_SS_USSD_DATA_SIZE_MAX); + strcpy(ussdString, "*124#"); + + ret = tel_send_ss_ussd_request (ussdString, &request_id); + + ret = tel_send_ss_ussd_request (pAppMsg, &pRequestId); +} +//WAIT FOR THE EVENT HERE + +static void app_callback (TelTapiEvent_t *event) +{ + int eventClass; + int eventType; + int requestId; + int status; + void* EventData = NULL; + unsigned int temp_handle = -1; + + //.. + eventClass = event->EventClass; + eventType = event->EventType; + requestId = event->RequestId; + status = event->Status; + EventData = event->pData; + + //TEST_DEBUG("Class:[%d], Event Type:[%d], RequestId:[%d], Status:[%d]\n", eventClass, eventType , requestId, status ); + + if (status != 0) + { + //TEST_DEBUG("******This is nonzero status. ******\n"); + return; + } + //.. + + switch (eventType) + { + case TAPI_EVENT_SS_USSD_CNF: + TelSsUssdMsgIndInfo_t UssdRecord; + memcpy(&UssdRecord, (TelSsInfo_t*)EventData, sizeof(TelSsUssdMsgIndInfo_t)); + printf("got event : TAPI_EVENT_SS_USSD_CNF:\n"); + //... + break; + //.. + } +} +@endcode +@} +@defgroup Use_Cases3_7 Send USSD Response +@ingroup Use_Cases3_SUPPLEMENTARY_SERVICE +@{ + + +

Send USSD Response

+This API is used to send a User response to the Network. This is an Asynchronous API. + +Pre Conditions: +No SS and USSD Transaction should be ongoing. If there an ongoing transaction, new USSD request will be returned to the Application with an error (USSD_BUSY) +@code +int tel_send_ss_ussd_response( const TelSsUssdMsgRspInfo_t* ussdRspRecord, int * RequestID); +@endcode + +SAMPLE CODE +@code +#include +#include +#include + +//SUBSCRIBE FOR EVENTS AS MENTIONED IN Event Register and Deregister +void sendussdresp() +{ + char *ussd_str = "*123*0#"; + int ret = 0; + int pRequestId = 0; + + TelSsUssdMsgRspInfo_t *ussdRspRecord; + + ussdRspRecord = (TelSsUssdMsgRspInfo_t*)malloc(sizeof(TelSsUssdMsgRspInfo_t)); + ussdRspRecord->SsRespType = TAPI_USSD_RES_OK; + ussdRspRecord->IndType = TAPI_USSD_IND_NOTIFY; + ussdRspRecord->UssdInfo.Dcs = 0x0f; + ussdRspRecord->UssdInfo.RequestedBySAT = 0; + strncpy(ussdRspRecord->UssdInfo.szUssdString, ussd_str, TAPI_SS_USSD_DATA_SIZE_MAX); + ussdRspRecord->UssdInfo.szUssdString[strlen(ussdRspRecord->UssdInfo.szUssdString)] = '\0'; + ussdRspRecord->UssdInfo.UssdStringLength = strlen(ussd_str); + + ret = tel_send_ss_ussd_response (ussdRspRecord, &pRequestId); + printf ("The return value is %d\n", ret); +} +//WAIT FOR THE EVENT HERE + +static void app_callback (TelTapiEvent_t *event) +{ + int eventClass; + int eventType; + int requestId; + int status; + void* EventData = NULL; + unsigned int temp_handle = -1; + + //... + eventClass = event->EventClass; + eventType = event->EventType; + requestId = event->RequestId; + status = event->Status; + EventData = event->pData; + + //TEST_DEBUG("Class:[%d], Event Type:[%d], RequestId:[%d], Status:[%d]\n", eventClass, eventType , requestId, status ); + + if (status != 0) + { + //TEST_DEBUG("******This is nonzero status. ******\n"); + return; + } + //... + //... + switch (eventType) + { + case TAPI_EVENT_SS_USSD_CNF: + TelSsUssdMsgIndInfo_t UssdRecord; + memcpy(&UssdRecord, (TelSsInfo_t*)EventData, sizeof(TelSsUssdMsgIndInfo_t)); + printf("got event : TAPI_EVENT_SS_USSD_CNF:\n"); + //... + break; + //... + } +} +@endcode +@} +@defgroup Use_Cases3_8 Send USSD Cancel Request +@ingroup Use_Cases3_SUPPLEMENTARY_SERVICE +@{ + + +

Send USSD Cancel Request

+This API sends a USSD cancel request to the Network to release USSD session. + +Pre Conditions: +@n SS and USSD Transaction should be ongoing. + +@code +int tel_send_ss_ussd_cancel ( int * pRequestId); +@endcode + +SAMPLE CODE +@code +#include +#include +#include + +//SUBSCRIBE FOR EVENTS AS MENTIONED IN Event Register and Deregister +void sendussdcancelreq() +{ + char ussdString[TAPI_SS_USSD_DATA_SIZE_MAX]; + int ret; + int requestId = 0; + + memset(ussdString, 0, TAPI_SS_USSD_DATA_SIZE_MAX); + strcpy(ussdString, "*124#"); + + ret = tel_send_ss_ussd_request(ussdString, &requestId); + printf ("The return value is %d\n", ret); + + ret = tel_send_ss_ussd_cancel(&equestId); + printf ("The return value is %d\n", ret); +} + +//WAIT FOR THE EVENTS HERE + +static void app_callback (TelTapiEvent_t *event) +{ + int eventClass; + int eventType; + int requestId; + int status; + void* EventData = NULL; + unsigned int temp_handle = -1; + + //... + eventClass = event->EventClass; + eventType = event->EventType; + requestId = event->RequestId; + status = event->Status; + EventData = event->pData; + + //TEST_DEBUG("Class:[%d], Event Type:[%d], RequestId:[%d], Status:[%d] \n", eventClass, eventType , requestId, status ); + + if (status != 0) + { + //TEST_DEBUG("******This is nonzero status. ******\n"); + return; + } + //... + //... + switch (eventType) + { + case TAPI_EVENT_SS_USSD_CNF: + printf("got event : TAPI_EVENT_SS_USSD_CNF:\n"); + //... + break; + + case TAPI_EVENT_SS_USSD_CANCEL_CNF: + printf("got event : TAPI_EVENT_SS_USSD_CANCEL_CNF:\n"); + //... + break; + + //... + } +} +@endcode +@} +@defgroup Use_Cases3_9 AOC Info +@ingroup Use_Cases3_SUPPLEMENTARY_SERVICE +@{ + + +

AOC Info

+These APIs set and read AOC parameter values on the SIM. + +Pre Conditions: +@n Advice of charge feature is dependent on the SIM for setting or reading aoc parameters. Setting of AOC requires PIN2 Verification + +@code +int tel_get_ss_aoc_info ( TelSsAocType_t AocType, int * pRequestId); +int tel_set_ss_aoc_info ( TelCallAocInfo_t * pAocSetInfo, int * pRequestId); +@endcode + +SAMPLE CODE +@code +#include +#include +#include + +//SUBSCRIBE FOR EVENTS AS MENTIONED IN Event Register and Deregister + +//Complete PIN2verification process as mentioned in SIM +void aocinforeq() +{ + //set aoc + printf(" Resetting Total Cost \n"); + + TelCallAocInfo_t *pAocSetInfo; + int request_id; + int ret_status = 0; + + pAocSetInfo = (TelCallAocInfo_t *)calloc(1, sizeof(TelCallAocInfo_t)); + pAocSetInfo->AocType = TAPI_SS_AOC_TYPE_RESET; + + ret = tel_set_ss_aoc_info (pAocSetInfo, &request_id); + if (ret_status == TAPI_API_SUCCESS) + { + printf("successful\n"); + } + else + { + printf("Error = %d \n", ret_status); + } +} + +//WAIT FOR THE EVENT HERE +static void app_callback (TelTapiEvent_t *event) +{ + int eventClass; + int eventType; + int requestId; + int status; + void* EventData = NULL; + unsigned int temp_handle = -1; + + // + eventClass = event->EventClass; + eventType = event->EventType; + requestId = event->RequestId; + status = event->Status; + EventData = event->pData; + + //TEST_DEBUG("Class:[%d], Event Type:[%d], RequestId:[%d], Status:[%d]\n", eventClass, eventType , requestId, status ); + + if (status != 0) + { + //TEST_DEBUG("******This is nonzero status. ******\n"); + return; + } + switch (eventType) + { + case TAPI_EVENT_SS_SET_AOC_CNF: + printf("Received Event : SS -- TAPI_EVENT_SS_SET_AOC_CNF\n"); + break; + }//... +} + +//read aoc +void readaoc() +{ + TelSsAocType_t AocType = TAPI_SS_AOC_TYPE_ACM; + + ret_status = tel_get_ss_aoc_info (AocType, &pRequestId); + if (ret_status == TAPI_API_SUCCESS) + { + printf("successful\n"); + } + else + { + printf("Error = %d \n", ret_status); + } +} +//WAIT FOR THE EVENT HERE + +static void app_callback (TelTapiEvent_t *event) +{ + int eventClass; + int eventType; + int requestId; + int status; + void* EventData = NULL; + unsigned int temp_handle = -1; + + eventClass = event->EventClass; + eventType = event->EventType; + requestId = event->RequestId; + status = event->Status; + EventData = event->pData; + + //TEST_DEBUG("Class:[%d], Event Type:[%d], RequestId:[%d], Status:[%d]\n", eventClass, eventType , requestId, status ); + + if (status != 0) + { + //TEST_DEBUG("******This is nonzero status. ******\n"); + return; + } + + switch (eventType) + { + case TAPI_EVENT_SS_AOC_RSP: + TelCallAocInfo_t aoc_info; + memcpy(&aoc_info, (TelCallAocInfo_t*)EventData, sizeof(TelCallAocInfo_t)); + printf("Received Event : SS -- TAPI_EVENT_SS_AOC_RSP\n"); + printf(" AOC TYPE :%d\n", aoc_info.AocType); + break; + } + +}//... +@endcode +@} + +

SMS

+ +@defgroup Use_Cases4_1 Event register and deregister +@ingroup Use_Cases4_SMS +@{ + +

Event register and deregister

+To receive asynchronous event notifications for the SMS APIs, the registration of related events with their associated call backs is required. When an asynchronous API is called, the confirmation is returned as an asynchronous event notification which invokes the callback function along with the event data. +@nSMS in the telephony framework only provides an interface to the modem and doesn’t handle Transport layer, storing and deleting the SMS in the storage except SIM. Because of this we recommend you shouldn’t access this API directly, and should use the MAPI of Message Framework instead. + +Notification Events are as follows. +@code +TAPI_EVENT_NETTEXT_INCOM_IND +TAPI_EVENT_NETTEXT_CB_INCOM_IND +TAPI_EVENT_NETTEXT_INCOM_EX_IND +TAPI_EVENT_NETTEXT_CB_INCOM_EX_IND +TAPI_EVENT_NETTEXT_MEMORY_STATUS_IND +TAPI_EVENT_NETTEXT_DEVICE_READY_IND +@endcode + +SAMPLE CODE +@code +// REGISTER EVENT +unsigned int subscription_id = 0; +int api_err; + +api_err = tel_init(); +if (api_err != TAPI_API_SUCCESS) +{ + TEST_DEBUG("tel_init Failed - api_err = %d \n", api_err); +} +api_err = tel_register_event(TAPI_EVENT_NETTEXT_SENTSTATUS_CNF, &subscription_id, (TelAppCallback)&app_callback); +printf("Nettext Class registration is Done: sub id is %d, api_err is %d\n", subscription_id, api_err); + +tel_register_app_name("org.tizen.appname"); + +// DEREGISTER EVENT +api_err = tel_deregister_event(subscription_id); +if (api_err != TAPI_API_SUCCESS) +{ + printf("Event Class Unregistration Fail\n"); +} + +// SMS notification callback function +void app_callback(void) +{ + int eventClass; + int eventType; + int requestId; + int status; + void *EventData = NULL; + + eventClass = event->EventClass; + eventType = event->EventType; + requestId = event->RequestId; + status = event->Status; + EventData = event->pData; + + printf(" app _callback is called \n"); + + print_events((int)eventType); + printf("\n event came in power_callback [%d] \n", eventType); + printf("\n expected event is in callback [%d] \n", expected_event); + + switch (eventType) + { + case TAPI_EVENT_NETTEXT_INCOM_IND: + TelSmsDatapackageInfo_t *ptrDataPackage; + printf("SMS Incoming Message\n"); + ptrDataPackage = (TelSmsDatapackageInfo_t *)EventData; + // Decoding Service Center Address + // Decoding TPDU(SMS-DELIVER, SMS-STATUS) + break; + + case TAPI_EVENT_NETTEXT_CB_INCOM_IND: + TelSmsCbMsg_t *ptrCbMsgInfo; + printf("SMS Cell Broadcasting Incoming Message\n"); + ptrCbMsgInfo = (TelSmsCbMsg_t *)EventData; + // Decoding Cell broadcasting Message in szData [Refer to 3GPP TS23.041 9.4.1] + break; + + case TAPI_EVENT_NETTEXT_INCOM_EX_IND: + TelSmsMsgInfo_t *pMsgInfo; + printf("CDMA SMS Incoming Message\n"); + pMsgInfo = (TelSmsMsgInfo_t *)EventData; + // Decoding TPDU(SMS-DELIVER, SMS-STATUS) + break; + + case TAPI_EVENT_NETTEXT_CB_INCOM_EX_IND: + TelSmsMsgInfo_t *pMsgInfo = NULL; + printf("CDMA SMS Incoming Message\n"); + pMsgInfo = (TelSmsMsgInfo_t *)EventData; + // Decoding Cell broadcasting Message in szData + break; + + case TAPI_EVENT_NETTEXT_MEMORY_STATUS_IND: + int *status = NULL; + printf("SIM Memory Status Notification\n"); + status = (TelSmsMemStatusType *)EventData; + if (*status == TAPI_NETTEXT_PHONE_MEMORY_STATUS_AVAILABLE) + printf("SIM Memory Available\n"); + else if (*status == TAPI_NETTEXT_PHONE_MEMORY_STATUS_FULL) + printf("SIM Memory Full\n"); + else + printf("Unknown Type\n"); + break; + + case TAPI_EVENT_NETTEXT_DEVICE_READY_IND: + int *pDeviceReady = NULL; + printf("SMS Device Ready Status Notification\n"); + pDeviceReady = (int*)EventData; + if (pDeviceReady->Result == 1) + printf("Device Ready\n"); + else + printf("Unknown Type\n"); + break; + } + return; +} +@endcode +@} +@defgroup Use_Cases4_2 Send SMS +@ingroup Use_Cases4_SMS +@{ + + +

Send SMS

+Telephony provides an API to send an SMS to the network. This API allows the transmission of an SMS PDU as defined by 3GPP TS 23.040 (SMS-SUBMIT, SMS-COMMAND) to the lower layers. If there is a need to send multiple parts of a concatenated message, this API requests for a dedicated link, through the input parameter MoreMessageToSend, from the lower layers. This will ensure the lower layers do not release the dedicated connection if there are more messages expected. + +@code +int tel_send_sms (const TelSmsDatapackageInfo_t* pDataPackage, int bMoreMsgToSend, int *pRequestId); +@endcode + +This API is restricted for direct use. Use the Message Framework API instead. + +SAMPLE CODE +@code +#include +#include +#include +#include + +void send_sms() +{ + //SUBSCRIBE FOR EVENTS AS MENTIONED IN Event Register and Deregister + TelSmsDatapackageInfo_t *pDataPackage; + int ret_status; + int pRequestId = 0; + + pDataPackage = (TelSmsDatapackageInfo_t *)malloc(sizeof(TelSmsDatapackageInfo_t)); + + //fill the structure appropriately + //Sca parameter is optional. If you don't provide Service center address, you should fill "00" in sca array. + //MsgLength is length of szData//fill the szData in TelSmsDatapackageInfo_t with SMS-SUBMIT or SMS-COMMAND TPDU. + + ret_status = tel_send_sms (pDataPackage, 0, &pRequestId); + if (ret_status == TAPI_API_SUCCESS) + { + printf("successful\n"); + } + else + { + printf("error = %d\n", ret_status); + } + //WAIT FOR THE EVENT HERE +} + +static void app_callback (TelTapiEvent_t* event) +{ + int eventClass; + int eventType; + int requestId; + int status; + void* EventData = NULL; + + //... + eventClass = event->EventClass; + eventType = event->EventType; + requestId = event->RequestId; + status = event->Status; + EventData = event->pData; + + //TEST_DEBUG("Class:[%d], Event Type:[%d], RequestId:[%d], Status:[%d] \n", eventClass, eventType , requestId, status ); + + if (status != 0) + { + //TEST_DEBUG("******This is nonzero status. ******\n"); + return; + } + + switch (eventType) { + case TAPI_EVENT_NETTEXT_SENTSTATUS_CNF: + printf("\n***************************************\n"); + printf("\n$$$ TAPI_EVENT_NETTEXT_SENTSTATUS_CNF $$$\n"); + // Extract the Event Data here + + break; + } + //.. +} +@endcode +@} +@defgroup Use_Cases4_3 Send SMS Message +@ingroup Use_Cases4_SMS +@{ + + +

Send SMS Message

+This API is used to send an SMS message to the network. This API allows the transmission of an SMS PDU as defined by 3GPP2 C.S0015 (SMS-SUBMIT, SMS-ACK, SMS-CANCEL) to the lower layers. If there is a need to send multiple parts of a concatenated message, this API requests for a dedicated link, through the input parameter MoreMessageToSend, from the lower layers. This will ensure the lower layers do not release the dedicated connection if there are more messages expected. This is currently supported in CDMA. + +@code +int tel_send_sms_msg (const TelSmsMsgInfo_t* pSmsMsgInfo,unsigned int MoreMsgToSend, int *pRequestId); +@endcode + +This API is restricted for direct use. Use the Message Framework API instead. + +SAMPLE CODE +@code +#include +#include +#include +#include + +void send_sms_ex() +{ + //SUBSCRIBE FOR EVENTS AS MENTIONED IN Event Register and Deregister + int ret_status; + int requestId = 0; + TelSmsMsgInfo_t pMsgInfo; + char* diallingNum; + int dialNumLen; + TelSmsMsgInfo_t *pDataPackage = malloc(sizeof(TelSmsMsgInfo_t)); + + memset(pDataPackage, 0, sizeof(TelSmsMsgInfo_t)); + pDataPackage->MsgType = TAPI_NETTEXT_MESSAGETYPE_SUBMIT; + pDataPackage->ParamMask |= TAPI_NETTEXT_PARAM_TELESERVICE_MASK; + //fill structure appropriately + + ret_status = tel_send_sms_msg (pDataPackage, 0, &requestId); + if (ret_status == TAPI_API_SUCCESS) + { + printf("successful\n"); + } + else + { + printf("error = %d\n", ret_status); + } +} +//WAIT FOR EVENT HERE +//CALLBACK FUNTION TO BE USED +static void app_callback (TelTapiEvent_t *event) +{ + int eventClass; + int eventType; + int requestId; + int status; + void* EventData = NULL; + + //... + eventClass = event->EventClass; + eventType = event->EventType; + requestId = event->RequestId; + status = event->Status; + EventData = event->pData; + + //TEST_DEBUG("Class:[%d], Event Type:[%d], RequestId:[%d], Status:[%d] \n", eventClass, eventType , requestId, status ); + + if (status != 0) + { + //TEST_DEBUG("******This is nonzero status. ******\n"); + return; + } + + switch (eventType) { + case TAPI_EVENT_NETTEXT_SENTSTATUS_EX_CNF: + printf("\n***************************************\n"); + printf("\n$$$ TAPI_EVENT_NETTEXT_SENTSTATUS_EX_CNF $$$\n"); + break; + } + //... +} +@endcode +@} +@defgroup Use_Cases4_4 Read SMS +@ingroup Use_Cases4_SMS +@{ + + +

Read SMS

+This API reads a message from SIM card storage. You should not access this API directly; instead use the Message Framework API. + +@code +int tel_read_sms_in_sim(int Index, int *pRequestId); +@endcode + +This API is restricted for direct use. Use the Message Framework API instead. + +SAMPLE CODE +@code +#include +#include +#include +#include + +void read_sms() +{ + //SUBSCRIBE FOR EVENTS AS MENTIONED IN Event Register and Deregister + int ret_status; + int pRequestId = 0; + + ret_status = tel_read_sms_in_sim(0, &pRequestId); + if (ret_status == TAPI_API_SUCCESS) + { + printf("successful\n"); + } + else + { + printf("Error = %d \n", ret_status); + } + //WAIT FOR EVENT HERE +} + +static void app_callback (TelTapiEvent_t *event) +{ + int eventClass; + int eventType; + int requestId; + int status; + void* EventData = NULL; + + // + eventClass = event->EventClass; + eventType = event->EventType; + requestId = event->RequestId; + status = event->Status; + EventData = event->pData; + + //TEST_DEBUG("Class:[%d], Event Type:[%d], RequestId:[%d], Status:[%d] \n", eventClass, eventType , requestId, status ); + + if (status != 0) + { + //TEST_DEBUG("******This is nonzero status. ******\n"); + return; + } + //... + //... + switch (eventType) //REFER Send SMS TO GET eventType + { + case TAPI_EVENT_NETTEXT_READ_SMS_CNF: + TelSmsData_t *pReadData; + printf("\n$$Read Msg Notification $$$\n"); + pReadData = (TelSmsData_t *) event->pData; + printf("\n$$Read Msg index = [%d] $$$\n", pReadData->SimIndex); + printf("\n$$Read Msg status = [%d] $$$\n", pReadData->MsgStatus); + // TPDU + // pReadData->SmsData.szData + + break; + } +} +//... +@endcode +@} +@defgroup Use_Cases4_5 Write Sms +@ingroup Use_Cases4_SMS +@{ + + +

Write Sms

+This API writes a message to SIM storage area. +@n The parameter of this API is changed into TelSmsData_t. +@n If SIM index in TelSmsData_t is -1, SMS message is stored at the first empty SIM index . The contents of szData is SMS-SUBMIT, SMS-DELIVER or SMS-STATUS REPORT TPDU. You should not access this API directly; use the Message Framework API. + +@code +int tel_write_sms_in_sim(const TelSmsData_t *pWriteData, int *pRequestId); +@endcode + +This API is restricted for direct use. Use the Message Framework API instead. + +SAMPLE CODE +@code +#include +#include +#include +#include + +void write_sms() +{ + // SUBSCRIBE FOR EVENTS AS MENTIONED IN Event Register and Deregister + int ret_status; + TelSmsData_t *pWriteData; + int pRequestId = 0; + char *msg = "This is an Test SMS"; + char *SCA = "821091"; + + pWriteData = malloc(sizeof(TelSmsData_t)); + if (pWriteData == NULL) { + printf("Memory Allocation fails\n"); + return; + } + + // conv_service_center_address(pWriteData->SmsData.Sca, SCA); + // conv_msg_into_tpdu(pWriteData->SmsData.szData, pWriteData->SmsData.MsgLength, msg); + pWrite->MsgStatus = TAPI_NETTEXT_STATUS_READ; + pWrite-> SimIndex = -1; + + ret_status = tel_write_sms_in_sim (pWriteData, &pRequestId); + if (ret_status == TAPI_API_SUCCESS) + { + printf("successful\n"); + } + else + { + printf("error = %d\n", ret_status); + } + //WAIT FOR EVENT HERE +} +static void app_callback (TelTapiEvent_t *event) +{ + int eventClass; + int eventType; + int requestId; + int status; + void* EventData = NULL; + + //.. + eventClass = event->EventClass; + eventType = event->EventType; + requestId = event->RequestId; + status = event->Status; + EventData = event->pData; + + //TEST_DEBUG("Class:[%d], Event Type:[%d], RequestId:[%d], Status:[%d] \n", eventClass, eventType , requestId, status ); + + if (status != 0) + { + //TEST_DEBUG("******This is nonzero status. ******\n"); + return; + } + //.. + switch (eventType) //REFER Send SMS TO GET eventType + { + case TAPI_EVENT_NETTEXT_SAVE_STATUS_CNF: + int *SimIndex = NULL; + printf("\n***************************************\n"); + printf("\n$$Save Status Notification$$\n"); + SimIndex = (int *)EventData; + printf("SIM Index stored SMS is [%d]\n", *SimIndex); + break; + } + //.. +} +@endcode +@} +@defgroup Use_Cases4_6 Delete Sms +@ingroup Use_Cases4_SMS +@{ + + +

Delete Sms

+This API deletes a message specified by the index (SIM index used when storing the sms) number or all the messages in the SIM storage area. If SIM index is -1, all SMS stored in SIM are deleted. You should not access this API directly; use the Message Framework API. + +@code +int tel_delete_sms_in_sim(int Index, int *pRequestId); +@endcode + +This API is restricted for direct use. Use the Message Framework API instead. + +SAMPLE CODE: +@code +#include +#include +#include +#include + +void delete_sms() +{ + //SUBSCRIBE FOR EVENTS AS MENTIONED IN Event Register and Deregister + int ret_status; + int pRequestId = 0; + + ret_status = tel_delete_sms_in_sim(1, &pRequestId); + if (ret_status == TAPI_API_SUCCESS) + { + printf("successful\n"); + } + else + { + printf("error = %d\n", ret_status); + } + //WAIT FOR EVENT HERE +} +static void app_callback (TelTapiEvent_t *event) +{ + int eventClass; + int eventType; + int requestId; + int status; + void* EventData = NULL; + + //... + eventClass = event->EventClass; + eventType = event->EventType; + requestId = event->RequestId; + status = event->Status; + EventData = event->pData; + + //TEST_DEBUG("Class:[%d], Event Type:[%d], RequestId:[%d], Status:[%d] \n", eventClass, eventType , requestId, status ); + + if (status != 0) + { + //TEST_DEBUG("******This is nonzero status. ******\n"); + return; + } + + switch (eventType) //REFER Send SMS TO GET eventType + { + case TAPI_EVENT_NETTEXT_DELETE_STATUS_CNF: + printf("\n***************************************\n"); + printf("\n$$Delete Notification$$$\n"); + break; + } + //.. +} +@endcode +@} +@defgroup Use_Cases4_7 Getting Sms Count +@ingroup Use_Cases4_SMS +@{ + + +

Getting Sms Count

+This API is used to retrieve message count information such as Total record count, used record count and the indices list for SIM Storage. You should not access this API directly; use the Message Framework API. + +@code +int tel_get_sms_count (int *pRequestId); +@endcode + +This API is restricted for direct use. Use the Message Framework API instead. + +SAMPLE CODE +@code +#include +#include +#include +#include + +void get_count() +{ + //SUBSCRIBE FOR EVENTS AS MENTIONED IN Event Register and Deregister + int ret_status; + int pRequestId = 0; + + ret_status = tel_get_sms_count (&pRequestId); + if (ret_status == TAPI_API_SUCCESS) + { + printf("successful\n"); + } + else + { + printf("error = %d\n", ret_status); + } + //WAIT FOR EVENT HERE +} +static void app_callback (TelTapiEvent_t *event) +{ + int eventClass; + int eventType; + int requestId; + int status; + void* EventData = NULL; + + // + eventClass = event->EventClass; + eventType = event->EventType; + requestId = event->RequestId; + status = event->Status; + EventData = event->pData; + + //TEST_DEBUG("Class:[%d], Event Type:[%d], RequestId:[%d], Status:[%d] \n", eventClass, eventType , requestId, status ); + + if (status != 0) + { + //TEST_DEBUG("******This is nonzero status. ******\n"); + return; + } + //.. + switch (eventType) //REFER Send SMS TO GET eventType + { + case TAPI_EVENT_NETTEXT_GET_COUNT_CNF: + printf("\n***************************************\n"); + printf("\n$$$GetMsgCountNotification$$$$\n"); + MsgCountNotification(tapiEvent.pData); + break; + } + //.. +} +void MsgCountNotification (char *pData) +{ + static TelSmsStoredMsgCountInfo_t *countInfo; + int loop_counter = 0; + int returnStatus; + countInfo = (TelSmsStoredMsgCountInfo_t *)pData; + int requestId = 0; + + if (countInfo->UsedCount != 0x00) + { + fprintf(stderr, "Index LIST..........\n"); + for (loop_counter = 0; loop_counter < countInfo->UsedCount; loop_counter++) + { + fprintf(stderr, "[%02x]", countInfo->IndexList[loop_counter]); + returnStatus = tel_read_sms_in_sim (countInfo->IndexList[loop_counter], &requestId); + printf("After read msg: returnstatus %d request id is %d\n", returnStatus, requestId); + } + printf("In MsgCountNotification total cnt is %d, usedcnt is %dapi_err %d\n", + countInfo->TotalCount, + countInfo->UsedCount, + returnStatus); + } + + printf("In MsgCountNotification total cnt is %d, usedcnt is %d\n", countInfo->TotalCount, countInfo->UsedCount); +} +@endcode +@} +@defgroup Use_Cases4_8 Setting Sms CB message +@ingroup Use_Cases4_SMS +@{ + + +

Setting Sms CB message

+[Note] Telephony Emulator does not support this feature. +@n This API is used to set the SMS CB Message Identifiers in the appropriate EF-CBMI/EF-CBMIR file in (U)SIM. This API also indicates the underlying provider to enable or disable CB Channel on which CB messages are received. You should not access this API directly; use the Message Framework API. + +@code +int tel_set_sms_cb_config(const TelSmsCbConfig_t *pCBConfig, int *pRequestId); +@endcode + +This API is restricted for direct use. Use the Message Framework API instead. + +SAMPLE CODE +@code +#include +#include +#include +#include + +void set_cbconfig() +{ + //SUBSCRIBE FOR EVENTS AS MENTIONED IN Event Register and Deregister + int ret_status; + int pRequestId = 0; + TelSmsCbConfig_t *pCBConfig = NULL; + + pCBConfig = (TelSmsCbConfig_t *)malloc(sizeof(TelSmsCbConfig_t)); + pCBConfig->bCBEnabled = 1; + pCBConfig->SelectedId = 0x01; + pCBConfig->MsgIdCount = 0x02; + + pCBConfig->MsgIDs[0] = 0x0c; + pCBConfig->MsgIDs[1] = 0x0c; + pCBConfig->MsgIDs[2] = 0xdf; + pCBConfig->MsgIDs[3] = 0x00; + + ret_status = tel_set_sms_cb_config(pCBConfig, &pRequestId); + if (ret_status == TAPI_API_SUCCESS) + { + printf("successful\n"); + } + else + { + printf("error = %d\n", ret_status); + } + //WAIT FOR EVENT HERE +} + +//CALLBACK FUNCTION TO BE USED +static void app_callback (TelTapiEvent_t *event) +{ + int eventClass; + int eventType; + int requestId; + int status; + void* EventData = NULL; + + //.. + eventClass = event->EventClass; + eventType = event->EventType; + requestId = event->RequestId; + status = event->Status; + EventData = event->pData; + + //TEST_DEBUG("Class:[%d], Event Type:[%d], RequestId:[%d], Status:[%d] \n", eventClass, eventType , requestId, status ); + + if (status != 0) + { + //TEST_DEBUG("******This is nonzero status. ******\n"); + return; + } + + switch (eventType) //REFER Send SMS TO GET eventType + { + case TAPI_EVENT_NETTEXT_SET_REQUEST_CNF: + TelSmsSetResponse *RequestType; + printf("\n***************************************\n"); + printf("\n$$$$$$ SET CONFIRMATION $$$$$$ \n"); + RequestType = (TelSmsSetResponse *)EventData; + if (*RequestType == TAPI_NETTEXT_CBSETCONFIG_RSP) { + printf("\n$$$$$$ SET CB CONFIRMATION $$$$$$ \n"); + } + break; + } +} +@endcode +@} +@defgroup Use_Cases4_9 Getting Sms CB configuration +@ingroup Use_Cases4_SMS +@{ + + +

Getting Sms CB configuration

+[Note] Telephony Emulator does not support this feature. +@n This API is used to retrieve SMS CB configuration options from EFcbmi file in the SIM. You should not access this API directly; use the Message Framework API. + +@code +TapiResult_t tel_get_sms_cb_config (int *pRequestId); +@endcode + +This API is restricted for direct use. Use the Message Framework API instead. + +SAMPLE CODE: + +@code +#include +#include +#include +#include + +void get_cbconfig() +{ + int ret_status; + int pRequestId = 0; + + //SUBSCRIBE FOR EVENTS AS MENTIONED IN Event Register and Deregister + ret_status = tel_get_sms_cb_config (&pRequestId); + + printf ("The return value is %d\n", ret_status); + if (ret_status == TAPI_API_SUCCESS) + { + printf("successful\n"); + } + else + { + printf("error = %d\n", ret_status); + } + //WAIT FOR EVENT HERE +} +static void app_callback (TelTapiEvent_t *event) +{ + int eventClass; + int eventType; + int requestId; + int status; + void* EventData = NULL; + + //.. + eventClass = event->EventClass; + eventType = event->EventType; + requestId = event->RequestId; + status = event->Status; + EventData = event->pData; + + //TEST_DEBUG("Class:[%d], Event Type:[%d], RequestId:[%d], Status:[%d] \n", eventClass, eventType , requestId, status ); + + if (status != 0) + { + //TEST_DEBUG("******This is nonzero status. ******\n"); + return; + } + //.. + switch (eventType) //REFER Send SMS TO GET eventType + { + case TAPI_EVENT_NETTEXT_GET_CB_CONFIG_CNF: + printf("\n***************************************\n"); + printf("\n$$$GET CB Config$$$\n"); + GetCBNotification(tapiEvent.pData); + break; + } + //.. +} + +void GetCBNotification (char *pData) +{ + TelSmsCbConfig_t *CBConfig; + int i = 0; + + CBConfig = (TelSmsCbConfig_t *) pData; + printf("=========CB Configuration=========\n"); + + // CB Enable/Diable + if (CBConfig->bCBEnabled == 0x01) + printf("Cell Broadcast Msg Enabled...\n"); + else if (CBConfig->bCBEnabled == 0x02) + printf("Cell Broadcast Msg Disabled...\n"); + + // Selected ID + if (CBConfig->SelectedId == 0x01) + printf("All CBMI is selected... \n"); + else if (CBConfig->SelectedId == 0x02) + printf("There are some selected CBMI...\n"); + + // CBMI Count + printf("CBMI Count: %d \n\n", CBConfig->MsgIdCount); + // CBMI List + if (CBConfig->MsgIdCount != 0) + { + printf("----- CBMI List -----\n"); + for (i=0; i < CBConfig->MsgIdCount; i++) + { + printf("No.%d - [0x%04x]\n", i, CBConfig->MsgIDs[i]); + } + } +} +//... +@endcode +@} +@defgroup Use_Cases4_10 Service Center Address +@ingroup Use_Cases4_SMS +@{ + + +

Service Center Address

+This API sets the SMS Service Centre Address information in order to send the SMS. +@n It is also possible to get current SMS Service Centre Address information. Currently Only index 0 is supported in Aquila’s Telephony OEM Plugin. You should not access this API directly; use the Message Framework API. + +@code +int tel_set_sms_sca(const TelSmsAddressInfo_t *pSCA, int Index, int *pRequestId); +int tel_get_sms_sca (int Index, int *pRequestId) +@endcode + +This API is restricted for direct use. Use the Message Framework API instead. + +SAMPLE CODE +@code +#include +#include +#include +#include + +void set_sca() +{ + + //SUBSCRIBE FOR EVENTS AS MENTIONED IN Event Register and Deregister + int ret_status; + int pRequestId = 0; + BYTE scabuf[512]; + char scaNum[TAPI_NETTEXT_SCADDRESS_LEN_MAX]; + BYTE scaNum_len = 0; + TelSmsAddressInfo_t *sc_addr = NULL; + BYTE packet[500]; + int idx = 0; + int i; + + printf("***Setting the SCA(Api:SetSCA)****\n"); + sc_addr = (TelSmsAddressInfo_t *)malloc(sizeof(TelSmsAddressInfo_t)); + memset(sc_addr, 0, sizeof(sc_addr)); + memset(scaNum, 0, sizeof(scaNum)); + memset(scabuf, 0, sizeof(scabuf)); + sprintf(scaNum, "821091"); + scaNum_len = strlen(scaNum); + scaNum_len = strlen(scaNum); + scaNum[scaNum_len] = 0; + scaNum_len = scaNum_len - 1; + + printf("==========================\n"); + printf("Sca Number :%s\n", scaNum); + printf("sca number length : %d \n", scaNum_len); + printf("==========================\n"); + + //idx = SmsUtilEncodeAddrField( packet, scaNum, scaNum_len, 0x01, 0x01); + //get idx + printf("idx =%d\n", idx); + sc_addr->DialNumLen = idx ; + memcpy(sc_addr->szDiallingNum, packet, (unsigned int)idx); + + ret_status = tel_set_sms_sca(sc_addr, 0, &pRequestId); + //[Note] Telephony Emulator Not Support + + printf("returnstatus after scaddr set is %d requestId:%d \n", ret_status, pRequestId); + if (ret_status == TAPI_API_SUCCESS) + { + printf("successful\n"); + } + else + { + printf("error = %d\n", ret_status); + } + //WAIT FOR EVENT HERE +} + +static void app_callback (TelTapiEvent_t *event) +{ + int eventClass; + int eventType; + int requestId; + int status; + void* EventData = NULL; + + //.. + eventClass = event->EventClass; + eventType = event->EventType; + requestId = event->RequestId; + status = event->Status; + EventData = event->pData; + + //TEST_DEBUG("Class:[%d], Event Type:[%d], RequestId:[%d], Status:[%d] \n", eventClass, eventType , requestId, status ); + + if (status != 0) + { + //TEST_DEBUG("******This is nonzero status. ******\n"); + return; + } + //.. + switch (eventType) //REFER Send SMS TO GET eventType + { + case TAPI_EVENT_NETTEXT_SET_REQUEST_CNF: + TelSmsSetResponse *RequestType; + printf("\n***************************************\n"); + RequestType = (TelSmsSetResponse *)EventData; + if (*RequestType == TAPI_NETTEXT_SETSCADDR_RSP) { + printf("\n$$$TAPI_EVENT_NETTEXT_SET_SCA_CNF$$$\n"); + // service center address decoding + } + break; + } +} +//.. + +//get SCA +#include +#include +#include +#include + +void get_sca() +{ + int ret_status; + int pRequestId = 0; + + ret_status = tel_get_sms_sca(0, &pRequestId); + if (ret_status == TAPI_API_SUCCESS) + { + printf("successful\n"); + } + else + { + printf("error = %d\n", ret_status); + } + + //WAIT FOR EVENT HERE +} + +static void app_callback (TelTapiEvent_t *event) +{ + int eventClass; + int eventType; + int requestId; + int status; + void* EventData = NULL; + unsigned int temp_handle = -1; + + // + eventClass = event->EventClass; + eventType = event->EventType; + requestId = event->RequestId; + status = event->Status; + EventData = event->pData; + + //TEST_DEBUG("Class:[%d], Event Type:[%d], RequestId:[%d], Status:[%d] \n", eventClass, eventType , requestId, status ); + + if (status != 0) + { + //TEST_DEBUG("******This is nonzero status. ******\n"); + return; + } + + //... + switch (eventType) //REFER Send SMS TO GET eventType + { + case TAPI_EVENT_NETTEXT_GET_SCA_CNF: + printf("\n****************************************\n"); + printf("\n$$$ TAPI_EVENT_NETTEXT_GET_SCA_CNF$$$\n"); + // SCA address decoding + printf("\n****************************************\n"); + break; + } + //... +} +@endcode +@} +@defgroup Use_Cases4_11 Sms Preferred Bearer +@ingroup Use_Cases4_SMS +@{ + + +

Sms Preferred Bearer

+[Note] Telephony Emulator and Aquila’s Telephony OEM Plugin do not support this feature. +@n Telephony provides APIs to set SMS preferred bearer on which SMS has to be transmitted. You should not access this API directly; use the Message Framework API. + +@code +int tel_set_sms_preferred_bearer (TelSmsBearerType_t BearerType, int *pRequestId); +int tel_get_sms_preferred_bearer(int *pRequestId); +@endcode + +This API is restricted for direct use. Use the Message Framework API instead. + +SAMPLE CODE: +@code +#include +#include +#include +#include + +void set_pb() +{ + //SUBSCRIBE FOR EVENTS AS MENTIONED IN Event Register and Deregister + int ret_status; + int pRequestId = 0; + TelSmsBearerType_t BearerType = TAPI_NETTEXT_BEARER_PS_ONLY; + + ret_status = tel_set_sms_preferred_bearer(BearerType, &pRequestId); + if (ret_status == TAPI_API_SUCCESS) + { + printf("successful\n"); + } + else + { + printf("error = %d\n", ret_status); + } + //WAIT FOR EVENT HERE +} +static void app_callback (TelTapiEvent_t *event) +{ + int eventClass; + int eventType; + int requestId; + int status; + void* EventData = NULL; + + // + eventClass = event->EventClass; + eventType = event->EventType; + requestId = event->RequestId; + status = event->Status; + EventData = event->pData; + + //TEST_DEBUG("Class:[%d], Event Type:[%d], RequestId:[%d], Status:[%d] \n", eventClass, eventType , requestId, status ); + + if (status != 0) + { + //TEST_DEBUG("******This is nonzero status. ******\n"); + return; + } + //... + //... + switch (eventType) //REFER Send SMS TO GET eventType + { + case TAPI_EVENT_NETTEXT_SET_REQUEST_CNF: + TelSmsSetResponse *RequestType; + RequestType = (TelSmsSetResponse *)EventData; + if (*RequestType == TAPI_NETTEXT_SETPREFERREDBEARER_RSP) { + printf("\n$$$TAPI_EVENT_NETTEXT_SET_Preferred Bearer_CNF$$$\n"); + } + break; + } + //... +} + +//get preferred bearer +#include +#include +#include +#include +void get_pb() +{ + int ret_status; + int pRequestId = 0; + + ret_status = tel_get_sms_preferred_bearer(&pRequestId); + if (ret_status == TAPI_API_SUCCESS) + { + printf("successful\n"); + } + else + { + printf("error = %d\n", ret_status); + } + //WAIT FOR EVENT HERE +} + +static void app_callback (TelTapiEvent_t *event) +{ + int eventClass; + int eventType; + int requestId; + int status; + void* EventData = NULL; + + // + eventClass = event->EventClass; + eventType = event->EventType; + requestId = event->RequestId; + status = event->Status; + EventData = event->pData; + + //TEST_DEBUG("Class:[%d], Event Type:[%d], RequestId:[%d], Status:[%d] \n", eventClass, eventType , requestId, status ); + + if (status != 0) + { + //TEST_DEBUG("******This is nonzero status. ******\n"); + return; + } + + //... + //... + switch (eventType) //REFER Send SMS TO GET eventType + { + case TAPI_EVENT_NETTEXT_GET_SMSBEARER_CNF: + printf("\n****************************************\n"); + printf("\n$$$ GET PREFERRED BEARER$$$\n"); + printf("\n****************************************\n"); + break; + } + //... +} +@endcode +@} +@defgroup Use_Cases4_12 Sms Parameters +@ingroup Use_Cases4_SMS +@{ + + +

Sms Parameters

+[Note] Telephony Emulator does not support this feature. +@n Telephony provides APIs to set the header parameters of SMS, which are used in the origination of MO messages. It also provides API to get the SMS parameters for a particular SMS (sent/received) based on the SIM index where it is stored. You should not access this API directly; use the Message Framework API. + +@code +int tel_set_sms_parameters(const TelSmsParams_t SmsSetParameters, int *pRequestId); +int tel_get_sms_parameters(const int SmsRecordIndex, int *pRequestId); +@endcode + +This API is restricted for direct use. Use the Message Framework API instead. + +SAMPLE CODE: +@code +#include +#include +#include +#include + +void set_param() +{ + //SUBSCRIBE FOR EVENTS AS MENTIONED IN Event Register and Deregister + int ret_status; + int pRequestId = 0; + TelSmsParams_t SmsSetParameters; + + SmsSetParameters.RecordIndex = 0x01; + SmsSetParameters.RecordLen = 28; + memcpy(SmsSetParameters.TpDestAddr.szDiallingNum, "9986529874", 10); + printf("\ndial no is %s\n", SmsSetParameters.TpDestAddr.szDiallingNum); + + SmsSetParameters.TpDestAddr.DialNumLen = 10; + SmsSetParameters.TpDestAddr.Ton = TAPI_SIM_TON_NATIONAL;//national no + SmsSetParameters.TpDestAddr.Npi = TAPI_SIM_NPI_NATIONAL; + + ret_status = tel_set_sms_parameters(SmsSetParameters, &pRequestId); + if (ret_status == TAPI_API_SUCCESS) + { + printf("successful\n"); + } + else + { + printf("error = %d\n", ret_status); + } + //WAIT FOR EVENT HERE +} +static void app_callback (TelTapiEvent_t *event) +{ + int eventClass; + int eventType; + int requestId; + int status; + void* EventData = NULL; + + // + eventClass = event->EventClass; + eventType = event->EventType; + requestId = event->RequestId; + status = event->Status; + EventData = event->pData; + + //TEST_DEBUG("Class:[%d], Event Type:[%d], RequestId:[%d], Status:[%d] \n", eventClass, eventType , requestId, status ); + + if (status != 0) + { + //TEST_DEBUG("******This is nonzero status. ******\n"); + return; + } + //... + //... + switch (eventType) //REFER Send SMS TO GET eventType + { + case TAPI_EVENT_NETTEXT_SET_REQUEST_CNF: + TelSmsSetResponse *RequestType; + RequestType = (TelSmsSetResponse *)EventData; + if (*RequestType == TAPI_NETTEXT_SETPARAMETERS_RSP) { + printf("\n$$$TAPI_EVENT_NETTEXT_SET_Parameter_CNF$$$\n"); + } + break; + } +} +//... + +//get params +#include +#include +#include +#include + +void get_params() +{ + int ret_status; + int pRequestId = 0; + + ret_status = tel_get_sms_parameters(1, &pRequestId); + if (ret_status == TAPI_API_SUCCESS) + { + printf("successful\n"); + } + else + { + printf("error = %d\n", ret_status); + } + //WAIT FOR EVENT HERE +} +static void app_callback (TelTapiEvent_t *event) +{ + int eventClass; + int eventType; + int requestId; + int status; + void* EventData = NULL; + + // + eventClass = event->EventClass; + eventType = event->EventType; + requestId = event->RequestId; + status = event->Status; + EventData = event->pData; + + //TEST_DEBUG("Class:[%d], Event Type:[%d], RequestId:[%d], Status:[%d]\n", eventClass, eventType , requestId, status ); + + if (status != 0) + { + //TEST_DEBUG("******This is nonzero status. ******\n"); + return; + } + //... + //... + switch (eventType) //REFER Send SMS TO GET eventType + { + case TAPI_EVENT_NETTEXT_GET_PARAM_CNF: + printf("\n***************************************\n"); + printf("\n$$$ GET PARAM NOTI$$$\n"); + // decoding SMS parameter + break; + } + //... +} +@endcode +@} +@defgroup Use_Cases4_13 Sending Delivery Report +@ingroup Use_Cases4_SMS +@{ + + +

Sending Delivery Report

+This API sends a SMS-deliver report to the network, after receiving an incoming SMS. You should not access this API directly. + +@code +int tel_send_sms_deliver_report(const TelSmsDatapackageInfo_t *pDataPackage, TelSmsResponse_t RPCause, int *pRequestId); +@endcode + +This API is restricted for direct use. Use the Message Framework API instead. + +SAMPLE CODE +@code +#include +#include +#include +#include +void send_delivery() +{ + int ret_status; + int requestId = -1; + TelSmsResponse_t RPCause; + //SUBSCRIBE FOR EVENTS AS MENTIONED IN Event Register and Deregister + TelSmsDatapackageInfo_t *del_report = NULL; + + del_report = malloc(sizeof(TelSmsDatapackageInfo_t)); + memset(del_report, 0, sizeof(TelSmsDatapackageInfo_t)); + //Encode Send Delivery Report here + //EncodeSmsDeliveryReportTpdu(); + + RPCause = TAPI_NETTEXT_SENDSMS_SUCCESS; + printf("***receive message (Api:SendDeliverreport)****\n"); + + ret_status = tel_send_sms_deliver_report(del_report, RPCause, &requestId); + if (ret_status == TAPI_API_SUCCESS) + { + printf("successful\n"); + } + else + { + printf("error = %d\n", ret_status); + } + //WAIT FOR EVENT HERE +} +static void app_callback (TelTapiEvent_t *event) +{ + int eventClass; + int eventType; + int requestId; + int status; + void* EventData = NULL; + + // + eventClass = event->EventClass; + eventType = event->EventType; + requestId = event->RequestId; + status = event->Status; + EventData = event->pData; + + //TEST_DEBUG("Class:[%d], Event Type:[%d], RequestId:[%d], Status:[%d]\n", eventClass, eventType , requestId, status ); + + if (status != 0) + { + //TEST_DEBUG("******This is nonzero status. ******\n"); + return; + } + //... + //... + switch (eventType) //REFER Send SMS TO GET eventType + { + case TAPI_EVENT_NETTEXT_DELIVERY_REPORT_CNF: + printf("\n***************************************\n"); + printf("\n$$$ DELIVER REPORT NOTI$$$\n"); + printf("\n***************************************\n"); + break; + } + //... +} +@endcode +@} +@defgroup Use_Cases4_14 Setting Memory Status +@ingroup Use_Cases4_SMS +@{ + + +

Setting Memory Status

+[Note] Telephony Emulator does not support this feature. +@n This API is used by applications to inform the modem about the memory status of PDA (whether FULL or AVAILABLE) so that modem can inform network. You should not access this API directly. + +@code +int tel_set_sms_memory_status (int MemoryStatus , int *pRequestId); +@endcode + +This API is restricted for direct use. Use the Message Framework API instead. + +SAMPLE CODE: +@code +#include +#include +#include +#include +void set_memstatus() +{ + + //SUBSCRIBE FOR EVENTS AS MENTIONED IN Event Register and Deregister + int ret_status; + int pRequestId = 0; + int MemoryStatus = TAPI_NETTEXT_PDA_MEMORY_STATUS_AVAILABLE; + + ret_status = tel_set_sms_memory_status(MemoryStatus, &pRequestId); + if (ret_status == TAPI_API_SUCCESS) + { + printf("successful\n"); + } + else + { + printf("error = %d\n", ret_status); + } + //WAIT FOR EVENT HERE +} +static void app_callback (TelTapiEvent_t *event) +{ + int eventClass; + int eventType; + int requestId; + int status; + void* EventData = NULL; + + //... + eventClass = event->EventClass; + eventType = event->EventType; + requestId = event->RequestId; + status = event->Status; + EventData = event->pData; + + //TEST_DEBUG("Class:[%d], Event Type:[%d], RequestId:[%d], Status:[%d] \n", eventClass, eventType , requestId, status ); + + if (status != 0) + { + //TEST_DEBUG("******This is nonzero status. ******\n"); + return; + } + //... + //... + switch (eventType) //REFER Send SMS TO GET eventType + { + case TAPI_EVENT_NETTEXT_SET_REQUEST_CNF: + TelSmsSetResponse *RequestType; + printf("\n***************************************\n"); + printf("\n$$$$$$ SET CONFIRMATION $$$$$$ \n"); + RequestType = (TelSmsSetResponse *)EventData; + if (*RequestType == TAPI_NETTEXT_SETMEMORYSTATUS_RSP) { + printf("\n$$$$$$ SET Memory Status $$$$$$ \n"); + } + break; + } + //... +} +@endcode +@} +@defgroup Use_Cases4_15 Setting Message Status +@ingroup Use_Cases4_SMS +@{ + + +

Setting Message Status

+[Note] Telephony Emulator does not support this feature. +This API is used by applications to set the message status in the Sim file. You should not access this API directly; use the Message Framework API. + +@code +int tel_set_sms_message_status(int Index, TelSmsMsgStatus_t MsgStatus, int *pRequestId); +@endcode + +This API is restricted for direct use. Use the Message Framework API instead. + +SAMPLE CODE: +@code +#include +#include +#include +#include + +void set_msgstatus() +{ + //SUBSCRIBE FOR EVENTS AS MENTIONED IN Event Register and Deregister + int ret_status; + int Index = 2; + int pRequestId = 0; + TelSmsMsgStatus_t MsgStatus = TAPI_NETTEXT_STATUS_READ; + + ret_status = tel_set_sms_message_status (Index, MsgStatus, &pRequestId); + printf ("The return value is %d\n", ret_status); + printf("RequestId is %d\n", pRequestId); + if (ret_status == TAPI_API_SUCCESS) + { + printf("successful\n"); + } + else + { + printf("error = %d\n", ret_status); + } + //WAIT FOR EVENT HERE +} +static void app_callback (TelTapiEvent_t *event) +{ + int eventClass; + int eventType; + int requestId; + int status; + void* EventData = NULL; + + // + eventClass = event->EventClass; + eventType = event->EventType; + requestId = event->RequestId; + status = event->Status; + EventData = event->pData; + + //TEST_DEBUG("Class:[%d], Event Type:[%d], RequestId:[%d], Status:[%d] \n", eventClass, eventType , requestId, status ); + + if (status != 0) + { + //TEST_DEBUG("******This is nonzero status. ******\n"); + return; + } + //... + //... + switch (eventType) + { + case TAPI_EVENT_NETTEXT_SET_REQUEST_CNF: + TelSmsSetResponse *RequestType; + printf("\n***************************************\n"); + printf("\n$$$$$$ SET CONFIRMATION $$$$$$ \n"); + RequestType = (TelSmsSetResponse *)EventData; + if (*RequestType == TAPI_NETTEXT_SETMESSAGESTATUS_RSP) { + printf("\n$$$$$$ SET Memory Status $$$$$$ \n"); + } + break; + } + //... +} +@endcode +@} +@defgroup Use_Cases4_16 Getting SMS Parameter Count +@ingroup Use_Cases4_SMS +@{ + + +

Getting SMS Parameter Count

+[Note] Telephony Emulator does not support this feature. +@n This API is used by applications to get the count of sms parameter records stored in Sim EF. You should not access this API directly. + +@code +int tel_get_sms_parameter_count (int *pRequestId); +@endcode + +This API is restricted for direct use. Use the Message Framework API instead. + +SAMPLE CODE: +@code +#include +#include +#include +#include + +void get_paramcount() +{ + //SUBSCRIBE FOR EVENTS AS MENTIONED IN Event Register and Deregister + int ret_status; + int pRequestId = 0; + + ret_status = tel_get_sms_parameter_count (&pRequestId); + printf ("The return value is %d\n", ret_status); + if (ret_status == TAPI_API_SUCCESS) + { + printf("successful\n"); + } + else + { + printf("error = %d\n", ret_status); + } + //WAIT FOR EVENT HERE +} +static void app_callback (TelTapiEvent_t *event) +{ + int eventClass; + int eventType; + int requestId; + int status; + void* EventData = NULL; + + // + eventClass = event->EventClass; + eventType = event->EventType; + requestId = event->RequestId; + status = event->Status; + EventData = event->pData; + + //TEST_DEBUG("Class:[%d], Event Type:[%d], RequestId:[%d], Status:[%d] \n", eventClass, eventType , requestId, status ); + + if (status != 0) + { + //TEST_DEBUG("******This is nonzero status. ******\n"); + return; + } + //... + //... + switch (eventType) //REFER Send SMS TO GET eventType + { + case TAPI_EVENT_NETTEXT_PARAM_COUNT_IND: + printf("\n***************************************\n"); + printf("\n$$$ PARAM COUNT NOTI$$$\n"); + printf("\n***************************************\n"); + break; + } + //... +} +@endcode +@} +

NETWORK Registration and Configuration + +@defgroup Use_Cases5_1 Event register and deregister +@ingroup Use_Cases5_NETWORK +@{ + +

Event register and deregister

+To receive asynchronous event notifications for the network APIs, the registration of related events with their associated call backs is required. When an asynchronous API is called, the confirmation is returned as an asynchronous event notification which invokes the callback function along with the event data. + +Network Notification Events +@code +TAPI_EVENT_NETWORK_LOCATIONCELLINFO_IND +TAPI_EVENT_NETWORK_RADIO_INFO_IND +TAPI_EVENT_NETWORK_SPN_INFO +TAPI_EVENT_NETWORK_DISPLAYINFO_IND +@endcode + +SAMPLE CODE: +@code +// REGISTER EVENT +unsigned int subscription_id = 0; +int api_err; + +api_err = tel_init(); +if (api_err != TAPI_API_SUCCESS) +{ + TEST_DEBUG("TelTapiInit Failed - api_err = %d \n", api_err); +} + +api_err = tel_register_event(TAPI_EVENT_NETWORK_GETNWBAND_CNF, &subscription_id, (TelAppCallback)&app_callback); +printf("Network Event registration is Done: sub id is %d, api_err is %d\n", subscription_id, api_err); + +tel_register_app_name("org.tizen.appname"); + +// DEREGISTER EVENT +api_err = tel_deregister_event (subscription_id); +if (api_err != TAPI_API_SUCCESS) +{ + printf("Event Class Unregeration Fail\n"); +} + +// Network notification callback function +void app_callback(void) +{ + int eventClass; + int eventType; + int requestId; + int status; + void *EventData = NULL; + + eventClass = event->EventClass; + eventType = event->EventType; + requestId = event->RequestId; + status = event->Status; + EventData = event->pData; + printf(" app _callback is called \n"); + + print_events((int)eventType); + printf("\n event came in power_callback [%d] \n", eventType); + printf("\n expected event is in callback [%d] \n", expected_event); + + switch (eventType) + { + case TAPI_EVENT_NETWORK_LOCATIONCELLINFO_IND: + TelSmsDatapackageInfo_t *ptrDataPackage = NULL; + printf("SMS Incoming Message\n"); + ptrDataPackage = (TelSmsDatapackageInfo_t *)EventData; + // Decoding Service Center Address + // Decoding TPDU(SMS-DELIVER, SMS-STATUS) + break; + + case TAPI_EVENT_NETWORK_RADIO_INFO_IND: + TelSmsDatapackageInfo_t *ptrDataPackage = NULL; + printf("SMS Incoming Message\n"); + ptrDataPackage = (TelSmsDatapackageInfo_t *)EventData; + // Decoding Service Center Address + // Decoding TPDU(SMS-DELIVER, SMS-STATUS) + break; + + case TAPI_EVENT_NETWORK_SPN_INFO: + TelSmsDatapackageInfo_t *ptrDataPackage = NULL; + printf("SMS Incoming Message\n"); + ptrDataPackage = (TelSmsDatapackageInfo_t *)EventData; + // Decoding Service Center Address + // Decoding TPDU(SMS-DELIVER, SMS-STATUS) + break; + + case TAPI_EVENT_NETWORK_DISPLAYINFO_IND: + TelSmsDatapackageInfo_t *ptrDataPackage = NULL; + printf("SMS Incoming Message\n"); + ptrDataPackage = (TelSmsDatapackageInfo_t *)EventData; + // Decoding Service Center Address + // Decoding TPDU(SMS-DELIVER, SMS-STATUS) + break; + } +} +@endcode +@} +@defgroup Use_Cases5_2 Network Selection +@ingroup Use_Cases5_NETWORK +@{ + + +

Network Selection

+Telephony provides APIs which can request the lower layers use the network (PLMN) which has been selected by the user from the Network List displayed to the User. + +@code +int tel_select_network_automatic(int *pRequestId) +int tel_select_network_manual(unsigned int Plmn, int *pRequestId) +@endcode + +SAMPLE CODE: +@code +#include +#include +#include "TapiCommon.h" + +void select_nw() +{ + //SUBSCRIBE FOR EVENTS AS MENTIONED IN Event Register and Deregister + int ret_status; + int pRequestID; + unsigned int plmn = 0; + + //CASE 1. MANUAL MODE + plmn = 45454; + ret_status = tel_select_network_manual(Plmn, &pRequestId); + + // CASE 2. AUTOMATIC MODE + // selectionMode = TAPI_NETWORK_SELECTIONMODE_AUTOMATIC; + ret_status = tel_select_network_automatic(&pRequestId); + if (ret_status == TAPI_API_SUCCESS) + printf("successful\n"); + else + printf("error=%d\n", ret_status); + + //WAIT FOR EVENT HERE +} + +//CALLBACK FUNCTION TO BE USED +static void app_callback (TelTapiEvent_t *event) +{ + int eventClass; + int eventType; + int requestId; + int status; + void* EventData = NULL; + + //... + eventClass = event->EventClass; + eventType = event->EventType; + requestId = event->RequestId; + status = event->Status; + EventData = event->pData; + + //TEST_DEBUG("Class:[%d], Event Type:[%d], RequestId:[%d], Status:[%d] \n", eventClass, eventType , requestId, status ); + + if (status != 0) + { + //TEST_DEBUG("******This is nonzero status. ******\n"); + return; + } + //... + //... + switch (eventType) + { + case TAPI_EVENT_NETWORK_SELECT_CNF: + printf("\n$$$$$$ TAPI_EVENT_NETWORK_SELECT_CNF $$$$$$ \n"); + } +} +@endcode +@} +@defgroup Use_Cases5_3 Network Search +@ingroup Use_Cases5_NETWORK +@{ + + +

Network Search

+This API is used to search for the available networks, and to provide the Network List to the User/Application. + +@code +int tel_search_network (int *pRequestId); +@endcode + +SAMPLE CODE: +@code +#include +#include +#include "TapiCommon.h" + +void searchnw() +{ + //SUBSCRIBE FOR EVENTS AS MENTIONED IN Event Register and Deregister + int ret_status; + + ret_status = tel_search_network(&pRequestId); + if (ret_status == TAPI_API_SUCCESS) + printf("successful\n"); + else + printf("error=%d\n", ret_status); + //WAIT FOR EVENT HERE +} +//CALLBACK FUNCTION TO BE USED +static void app_callback (TelTapiEvent_t *event) +{ + int eventClass; + int eventType; + int requestId; + int status; + void* EventData = NULL; + unsigned int temp_handle = -1; + + // + eventClass = event->EventClass; + eventType = event->EventType; + requestId = event->RequestId; + status = event->Status; + EventData = event->pData; + + //TEST_DEBUG("Class:[%d], Event Type:[%d], RequestId:[%d], Status:[%d] \n", eventClass, eventType , requestId, status ); + + if (status != 0) + { + //TEST_DEBUG("******This is nonzero status. ******\n"); + return; + } + //... + //... + switch (eventType) //REFER Network Selection TO GET eventType + { + case TAPI_EVENT_NETWORK_SEARCH_CNF: + int ui_entry_count = 0; + TelNetworkPlmnList_t *pNetSearchCnf; + pNetSearchCnf = (TelNetworkPlmnList_t *)EventData; + while (ui_entry_count < pNetSearchCnf->networks_count) + { + printf("Type_of_plmn[%d] 0:unkwon,1:home,2:available,3:forbidden, NetworkName[%s]", + pNetSearchCnf->network_list[ui_entry_count].type_of_plmn, + pNetSearchCnf->network_list[ui_entry_count].network_name); + printf("ServiceProviderName[%s]", pNetSearchCnf->network_list[ui_entry_count].service_provider_name); + printf("PLMN ID[%lu]", pNetSearchCnf->network_list[ui_entry_count].plmn_id); + ui_entry_count++; + } + break; + } + //... +} +@endcode +@} +@defgroup Use_Cases5_4 Selection Mode +@ingroup Use_Cases5_NETWORK +@{ + + +

Selection Mode

+Telephony provides APIs to set and retrieve the current mode of network selection i.e. automatic or manual. Request for Automatic network selection or Manual network selection will allow OEM provider to do PLMN Selection based on network selection preference. + +@code +int tel_get_network_selection_mode (int *pRequestId); +@endcode + +SAMPLE CODE +@code +#include +#include +#include "TapiCommon.h" +void get_selmode() +{ + //SUBSCRIBE FOR EVENTS AS MENTIONED IN Event Register and Deregister + int ret_status; + int pRequestId; + //GET THE SELECTION MODE + + ret_status = tel_get_network_selection_mode (&pRequestId); + if (ret_status == TAPI_API_SUCCESS) + printf("successful\n"); + else + printf("error=%d\n", ret_status); + //WAIT FOR EVENT HERE +} +//CALLBACK FUNCTION TO BE USED +static void app_callback (TelTapiEvent_t *event) +{ + int eventClass; + int eventType; + int requestId; + int status; + void* EventData = NULL; + + // + eventClass = event->EventClass; + eventType = event->EventType; + requestId = event->RequestId; + status = event->Status; + EventData = event->pData; + + //TEST_DEBUG("Class:[%d], Event Type:[%d], RequestId:[%d], Status:[%d] \n", eventClass, eventType , requestId, status ); + + if (status != 0) + { + //TEST_DEBUG("******This is nonzero status. ******\n"); + return; + } + //... + //... + switch (eventType) // REFER Network Selection TO GET eventType + { + case TAPI_EVENT_NETWORK_GETSELECTIONMODE_CNF: + printf("\n$$$$$$ TAPI_EVENT_NETWORK_GETSELECTIONMODE_CNF $$$$$$ \n"); + break; + } + //... +} +@endcode +@} +@defgroup Use_Cases5_5 Service Domain +@ingroup Use_Cases5_NETWORK +@{ + + +

Service Domain

+Telephony provides APIs so that User/application can configure the service domain and also retrieve the present network service domain. + +@code +int tel_set_network_service_domain (TelNetworkServiceDomain_t ServiceDomain, int *pRequestId); +int tel_get_network_service_domain (int *pRequestId); +@endcode + +SAMPLE CODE +@code +#include +#include +#include +#include "TapiCommon.h" + +void set_servicedomain() +{ + //SUBSCRIBE FOR EVENTS AS MENTIONED IN Event Register and Deregister + int ret_status; + int pRequestId; + //SET NETWORK SERVICE DOMAIN + TelNetworkServiceDomain_t ServiceDomain = TAPI_NETWORK_SERVICE_DOMAIN_AUTOMATIC; + + ret_status = tel_set_network_service_domain (ServiceDomain, &pRequestId); + if (ret_status == TAPI_API_SUCCESS) + printf("successful\n"); + else + printf("error=%d\n", ret_status); + //WAIT FOR EVENT HERE +} +//CALLBACK FUNCTION TO BE USED +static void app_callback (TelTapiEvent_t *event) +{ + int eventClass; + int eventType; + int requestId; + int status; + void* EventData = NULL; + unsigned int temp_handle = -1; + + //... + eventClass = event->EventClass; + eventType = event->EventType; + requestId = event->RequestId; + status = event->Status; + EventData = event->pData; + + //TEST_DEBUG("Class:[%d], Event Type:[%d], RequestId:[%d], Status:[%d] \n", eventClass, eventType , requestId, status ); + + if (status != 0) + { + //TEST_DEBUG("******This is nonzero status. ******\n"); + return; + } + //... + //... + switch (eventType) //REFER Network Selection TO GET eventType + { + case TAPI_EVENT_NETWORK_SET_SVC_DOMAIN_CNF: + printf("\n$$$$$$ TAPI_EVENT_NETWORK_SET_SVC_DOMAIN_CNF $$$$$$ \n"); + break; + } + + //... +} + +//GET NETWORK SERVICE DOMAIN +#include +#include +#include "TapiCommon.h" +void get_servicedomain() +{ + int ret_status; + ret_status = tel_get_network_service_domain (&pRequestId); + if (ret_status == TAPI_API_SUCCESS) + printf("successful\n"); + else + printf("error=%d\n", ret_status); + //WAIT FOR EVENT HERE +} +//CALLBACK FUNCTION TO BE USED +static void app_callback (TelTapiEvent_t *event) +{ + int eventClass; + int eventType; + int requestId; + int status; + void* EventData = NULL; + //... + eventClass = event->EventClass; + eventType = event->EventType; + requestId = event->RequestId; + status = event->Status; + EventData = event->pData; + + //TEST_DEBUG("Class:[%d], Event Type:[%d], RequestId:[%d], Status:[%d] \n", eventClass, eventType , requestId, status ); + + if (status != 0) + { + //TEST_DEBUG("******This is nonzero status. ******\n"); + return; + } + //... + //... + switch (eventType) //REFER Network Selection TO GET eventType + { + case TAPI_EVENT_NETWORK_GET_SVC_DOMAIN_CNF: + printf("\n$$$$$$ TAPI_EVENT_NETWORK_GET_SVC_DOMAIN_CNF $$$$$$ \n"); + break; + //... + } +} +@endcode +@} +@defgroup Use_Cases5_6 Network Mode +@ingroup Use_Cases5_NETWORK +@{ + + +

Network Mode

+[Note] Telephony Emulator does not support this feature. +@n The Network Mode (Automatic, GSM, and WCDMA) can be configured at OEM provider, based on which lower layers can scan only those radio access technologies, to register with network. + +@code +int tel_set_network_mode (TelNetworkMode_t NwMode, int *pRequestId); +int tel_get_network_mode (int *pRequestId); +@endcode + +SAMPLE CODE +@code +#include +#include +#include "TapiCommon.h" +void setnwmode() +{ + //SUBSCRIBE FOR EVENTS AS MENTIONED IN Event Register and Deregister + int ret_status; + int pRequestId; + + ret_status = tel_set_network_mode(NwMode, &pRequestId); + if (ret_status == TAPI_API_SUCCESS) + printf("successful\n"); + else + printf("error=%d\n", ret_status); + //WAIT FOR EVENT HERE +} +//CALLBACK FUNCTION TO BE USED +static void app_callback (TelTapiEvent_t *event) +{ + int eventClass; + int eventType; + int requestId; + int status; + void* EventData = NULL; + + //... + eventClass = event->EventClass; + eventType = event->EventType; + requestId = event->RequestId; + status = event->Status; + EventData = event->pData; + + //TEST_DEBUG("Class:[%d], Event Type:[%d], RequestId:[%d], Status:[%d] \n", eventClass, eventType , requestId, status ); + + if (status != 0) + { + //TEST_DEBUG("******This is nonzero status. ******\n"); + return; + } + //... + //... + switch (eventType) //REFER Network Selection TO GET eventType + { + case TAPI_EVENT_NETWORK_SETNWMODE_CNF: + printf("\n$$$$$$ TAPI_EVENT_NETWORK_SETNWMODE_CNF $$$$$$ \n"); + break; + //... + } +} + +//GET NETWORK MODE +#include +#include +#include "TapiCommon.h" + +void getnwmode() +{ + int ret_status; + int pRequestId; + + ret_status = tel_get_network_mode(&pRequestId); + if (ret_status == TAPI_API_SUCCESS) + printf("successful\n"); + else + printf("error=%d\n", ret_status); + //WAIT FOR EVENT HERE +} +//CALLBACK FUNCTION TO BE USED +static void app_callback (TelTapiEvent_t *event) +{ + int eventClass; + int eventType; + int requestId; + int status; + void* EventData = NULL; + + //... + eventClass = event->EventClass; + eventType = event->EventType; + requestId = event->RequestId; + status = event->Status; + EventData = event->pData; + + //TEST_DEBUG("Class:[%d], Event Type:[%d], RequestId:[%d], Status:[%d] \n", eventClass, eventType , requestId, status ); + + if (status != 0) + { + //TEST_DEBUG("******This is nonzero status. ******\n"); + return; + } + //... + //... + switch (eventType) //REFER Network Selection TO GET eventType + { + case TAPI_EVENT_NETWORK_GETNWMODE_CNF: + printf("\n$$$$$$ TAPI_EVENT_NETWORK_GETNWMODE_CNF $$$$$$ \n"); + break; + //... + } +} +@endcode +@} +@defgroup Use_Cases5_7 Network Band +@ingroup Use_Cases5_NETWORK +@{ + + +

Network Band

+Telephony provides APIs to set and retrieve the network band and allows the underlying OEM provider to scan the set band. + +@code +int tel_set_network_band (TelNetworkBandPreferred_t BandMode, TelNetworkBand_t Band, int *pRequestId); +int tel_get_network_band ( int *pRequestId); +@endcode + +SAMPLE CODE: +@code +#include +#include +#include "TapiCommon.h" +void setnwband() +{ + //SUBSCRIBE FOR EVENTS AS MENTIONED IN Event Register and Deregister + int ret_status; + int pRequestId; + TelNetworkBandPreferred_t BandMode = TAPI_NETWORK_BAND_MODE_PREFERRED; + TelNetworkBand_t Band = TAPI_NETWORK_BAND_TYPE_GSM_900_1800; + int pRequestId = 0; + + ret_status = tel_set_network_band (BandMode,Band, &pRequestId); + if (ret_status == TAPI_API_SUCCESS) + printf("successful\n"); + else + printf("error=%d\n", ret_status); + //WAIT FOR EVENT HERE +} +//CALLBACK FUNCTION TO BE USED +static void app_callback (TelTapiEvent_t *event) +{ + int eventClass; + int eventType; + int requestId; + int status; + void* EventData = NULL; + + eventClass = event->EventClass; + eventType = event->EventType; + requestId = event->RequestId; + status = event->Status; + EventData = event->pData; + + //TEST_DEBUG("Class:[%d], Event Type:[%d], RequestId:[%d], Status:[%d] \n", eventClass, eventType , requestId, status ); + + if (status != 0) + { + //TEST_DEBUG("******This is nonzero status. ******\n"); + return; + } + //... + //... + switch (eventType) //REFER Network Selection TO GET eventType + { + case TAPI_EVENT_NETWORK_SETNWBAND_CNF: + printf("\n$$$$$$ TAPI_EVENT_NETWORK_SETNWBAND_CNF $$$$$$ \n"); + break; + //... + } +} + +//GET NETWORK BAND +#include +#include +#include "TapiCommon.h" +void getnwband() +{ + int ret_status; + int pRequestId; + ret_status = tel_get_network_band (BandMode, Band, &pRequestId); + if (ret_status == TAPI_API_SUCCESS) + printf("successful\n"); + else + printf("error=%d\n", ret_status); + //WAIT FOR EVENT HERE +} +//CALLBACK FUNCTION TO BE USED +static void app_callback (TelTapiEvent_t *event) +{ + int eventClass; + int eventType; + int requestId; + int status; + void* EventData = NULL; + + // + eventClass = event->EventClass; + eventType = event->EventType; + requestId = event->RequestId; + status = event->Status; + EventData = event->pData; + + //TEST_DEBUG("Class:[%d], Event Type:[%d], RequestId:[%d], Status:[%d] \n", eventClass, eventType , requestId, status ); + + if (status != 0) + { + //TEST_DEBUG("******This is nonzero status. ******\n"); + return; + } + //... + //... + switch (eventType) // REFER Network Selection TO GET eventType + { + case TAPI_EVENT_NETWORK_GETNWBAND_CNF: + printf("\n$$$$$$ TAPI_EVENT_NETWORK_GTNWBAND_CNF $$$$$$ \n"); + break; + //... + } +} +@endcode +@} +@defgroup Use_Cases5_8 Preferred PLMN +@ingroup Use_Cases5_NETWORK +@{ + + +

Preferred PLMN

+[Note] Telephony Emulator does not support this feature. +@n Telephony provides APIs which can be used to set and retrieve the preferred plmn of network. + +@code +int tel_set_network_preferred_plmn (TelNetworkPrefferedPlmnOp_t Operation, TelNetworkPrefferedPlmnInfo_t PreffPlmnInfo, int *pRequestId); +int tel_get_network_preferred_plmn ( int *pRequestId); +@endcode + +SAMPLE CODE +@code +#include +#include +#include "TapiCommon.h" +void set_preferredplmn() +{ + //SUBSCRIBE FOR EVENTS AS MENTIONED IN Event Register and Deregister + int ret_status; + int pRequestId; + + //SET PLMN + TelNetworkPrefferedPlmnOp_t Operation = TAPI_NETWORK_PREF_PLMN_ADD; + TelNetworkPrefferedPlmnInfo_t PreffPlmnInfo; + unsigned char *plmn = "45454"; + + memset(&PreffPlmnInfo, 0, sizeof(TelNetworkPrefferedPlmnInfo_t)); + PreffPlmnInfo.Index = 0; + PreffPlmnInfo.SystemType = TAPI_NETWORK_SYSTEM_GSM; + memcpy(PreffPlmnInfo.Plmn, plmn, 6); + + ret_status = tel_set_network_preferred_plmn (Operation,PreffPlmnInfo, &pRequestId); + if (ret_status == TAPI_API_SUCCESS) + printf("successful\n"); + else + printf("error=%d\n", ret_status); + //WAIT FOR EVENT HERE +} +//CALLBACK FUNCTION TO BE USED +static void app_callback (TelTapiEvent_t *event) +{ + int eventClass; + int eventType; + int requestId; + int status; + void* EventData = NULL; + + //... + eventClass = event->EventClass; + eventType = event->EventType; + requestId = event->RequestId; + status = event->Status; + EventData = event->pData; + + //TEST_DEBUG("Class:[%d], Event Type:[%d], RequestId:[%d], Status:[%d] \n", eventClass, eventType , requestId, status ); + + if (status != 0) + { + //TEST_DEBUG("******This is nonzero status. ******\n"); + return; + } + + //... + //... + switch (eventType) //REFER Network Selection TO GET eventType + { + case TAPI_EVENT_NETWORK_SETPREFFPLMN_CNF: + printf("\n$$$$$$ TAPI TAPI_EVENT_NETWORK_SETPREFFPLMN_CNF $$$$$$ \n"); + break; + } + //... +} +@endcode + +@code +//GET PLMN +#include +#include +#include "TapiCommon.h" +void get_preferredplmn() +{ + int ret_status; + int pRequestId; + + ret_status = tel_get_network_preferred_plmn (&pRequestId); + if (ret_status == TAPI_API_SUCCESS) + printf("successful\n"); + else + printf("error=%d\n", ret_status); //WAIT FOR EVENT HERE + //WAIT FOR EVENT HERE +} + +//CALLBACK FUNCTION TO BE USED +static void app_callback (TelTapiEvent_t *event) +{ + int eventClass; + int eventType; + int requestId; + int status; + void* EventData = NULL; + + //... + eventClass = event->EventClass; + eventType = event->EventType; + requestId = event->RequestId; + status = event->Status; + EventData = event->pData; + + //TEST_DEBUG("Class:[%d], Event Type:[%d], RequestId:[%d], Status:[%d] \n", eventClass, eventType , requestId, status ); + + if (status != 0) + { + //TEST_DEBUG("******This is nonzero status. ******\n"); + return; + } + //... + //... + switch (eventType) //REFER Network Selection TO GET eventType + { + case TAPI_EVENT_NETWORK_GETPREFFPLMN_CNF: + printf("\n$$$$$$ TAPI TAPI_EVENT_NETWORK_GETPREFFPLMN_CNF $$$$$$ \n"); + break; + } +@endcode +@} +@defgroup Use_Cases5_9 Network Roaming Mode +@ingroup Use_Cases5_NETWORK +@{ + + +

Network Roaming Mode

+[Note] Telephony Emulator does not support this feature. +Telephony provides APIs which can be used to set and retrieve the mode of network roaming. This is for CDMA. + +@code +int tel_set_network_roaming (TelNetworkRoamingMode_t *RoamingMode, int *pRequestId); +int tel_get_network_roaming (int *pRequestId); +@endcode + +SAMPLE CODE: +@code +//SetRoamingMode +#include +#include +#include "TapiCommon.h" +void set_roamingmode() +{ + //SUBSCRIBE FOR EVENTS AS MENTIONED IN Event Register and Deregister + + TelNetworkRoamingMode_t roamingMode; + int ret_status; + + roamingMode.pref_net_type = TAPI_NETWORK_PREF_NET_HOME_ONLY; + roamingMode.prl_pref_only = TAPI_NETWORK_PRL_PREF_ONLY_ON; + + ret_status = tel_get_network_roaming (&roamingMode, &requestId); + if (ret_status == TAPI_API_SUCCESS) + printf("Successful\n"); + else + printf("error:%d\n", ret_status); + + //WAIT FOR EVENT HERE +} +//CALLBACK FUNCTION TO BE USED +static void app_callback (TelTapiEvent_t *event) +{ + int eventClass; + int eventType; + int requestId; + int status; + void* EventData = NULL; + //... + eventClass = event->EventClass; + eventType = event->EventType; + requestId = event->RequestId; + status = event->Status; + EventData = event->pData; + + //TEST_DEBUG("Class:[%d], Event Type:[%d], RequestId:[%d], Status:[%d] \n", eventClass, eventType , requestId, status ); + + if (status != 0) + { + //TEST_DEBUG("******This is nonzero status. ******\n"); + return; + } + //... + //... + switch (eventType) //REFER Network Selection TO GET eventType + { + case TAPI_EVENT_NETWORK_SET_ROAMING_MODE_CNF: + printf("$$$$$TAPI_EVENT_NETWORK_SET_ROAMING_MODE_CNF$$$$$\n"); + //.... + break; + } + //... +} +@endcode + +@code +//GetRoamingMode +#include +#include +#include +void set_roamingmode() +{ + int ret_status; + + ret_status = tel_get_network_roaming(&requestId); + if (ret_status == TAPI_API_SUCCESS) + ("Successful\n"); + else + printf("error:%d\n", ret_status); + + //WAIT FOR EVENT HERE +} + +//CALLBACK FUNCTION TO BE USED +static void app_callback (TelTapiEvent_t *event) +{ + int eventClass; + int eventType; + int requestId; + int status; + void* EventData = NULL; + //... + eventClass = event->EventClass; + eventType = event->EventType; + requestId = event->RequestId; + status = event->Status; + EventData = event->pData; + + //TEST_DEBUG("Class:[%d], Event Type:[%d], RequestId:[%d], Status:[%d] \n", eventClass, eventType , requestId, status ); + + if (status != 0) + { + //TEST_DEBUG("******This is nonzero status. ******\n"); + return; + } + //... + //... + switch (eventType) //REFER Network Selection TO GET eventType + { + case TAPI_EVENT_NETWORK_GET_ROAMING_MODE_CNF: + printf("$$$$TAPI_EVENT_NETWORK_GET_ROAMING_MODE_CNF$$$$\n"); + //... + break; + } + //... +} +@endcode +@} +@defgroup Use_Cases5_10 Network CDMA Hybrid Mode +@ingroup Use_Cases5_NETWORK +@{ + + +

Network CDMA Hybrid Mode

+[Note] Telephony Emulator does not support this feature. +Telephony provides APIs which can be used to set and get the CDMA Hybrid Mode. This is for CDMA. +Hybrid means 1x only, EVDO only combined. we can set network mode separately also in CDMA network. + +@code +int tel_set_network_hybrid_in_cdma (TelNetworkCDMAHybridMode_t CDMAHybridMode, int *pRequestId); +int tel_get_network_hybrid_in_cdma (int *pRequestId); +@endcode + +SAMPLE CODE: +@code +//Set CDMA Hybrid Mode +#include +#include +#include "TapiCommon.h" +void set_hybridmode() +{ + int ret_status; + + //SUBSCRIBE FOR EVENTS AS MENTIONED IN Event Register and Deregister + + TelNetworkCDMAHybridMode_t cdmaHybridMode; + cdmaHybridMode = TAPI_NETWORK_CDMA_HYBRID; // TAPI_NETWORK_CDMA_1X_ONLY, TAPI_NETWORK_CDMA_EVDO_ONLY, TAPI_NETWORK_CDMA_HYBRID(1X + EVDO) + + ret_status = tel_get_network_hybrid_in_cdma(cdmaHybridMode, &requestId); + if (ret_status == TAPI_API_SUCCESS) + printf("Successful\n"); + else + printf("error:%d\n", ret_status); + + //WAIT FOR EVENT HERE +} +//CALLBACK FUNCTION TO BE USED + +static void app_callback (TelTapiEvent_t *event) +{ + int eventClass; + int eventType; + int requestId; + int status; + void* EventData = NULL; + + //... + eventClass = event->EventClass; + eventType = event->EventType; + requestId = event->RequestId; + status = event->Status; + EventData = event->pData; + + //TEST_DEBUG("Class:[%d], Event Type:[%d], RequestId:[%d], Status:[%d] \n", eventClass, eventType , requestId, status ); + + if (status != 0) + { + //TEST_DEBUG("******This is nonzero status. ******\n"); + return; + } + //... + //... + switch (eventType) //REFER Network Selection TO GET eventType + { + case TAPI_EVENT_NETWORK_SET_CDMA_HYBRID_MODE_CNF: + printf("\n$$$$$$ TAPI_EVENT_NETWORK_SET_CDMA_HYBRID_MODE_CNF $$$$$$ \n"); + break; + //... + } +} +@endcode + +@code +//Get CDMA Hybrid Mode +#include +#include +#include +void get_hybridmode() +{ + int ret_status; + + ret_status = tel_get_network_hybrid_in_cdma (&requestId); + if (ret_status == TAPI_API_SUCCESS) + printf(successful\n); + else + printf(error=%d\n, ret_status); + //WAIT FOR EVENT HERE +} + +//CALLBACK FUNCTION TO BE USED +static void app_callback (TelTapiEvent_t *event) +{ + int eventClass; + int eventType; + int requestId; + int status; + void* EventData = NULL; + + //... + + eventClass = event->EventClass; + + eventType = event->EventType; + + requestId = event->RequestId; + status = event->Status; + EventData = event->pData; + + //TEST_DEBUG("Class:[%d], Event Type:[%d], RequestId:[%d], Status:[%d] \n", eventClass, eventType , requestId, status ); + + if (status != 0) + { + //TEST_DEBUG("******This is nonzero status. ******\n"); + return; + } + //... + //... + switch (eventType) //REFER Network Selection TO GET eventType + { + case TAPI_EVENT_NETWORK_GET_CDMA_HYBRID_MODE_CNF: + printf("$$$$$TAPI_EVENT_NETWORK_GET_CDMA_HYBRID_MODE_CNF$$$$\n"); + //... + break; + } +} +@endcode +@} +@defgroup Use_Cases5_11 SIM +@ingroup Use_Cases5_NETWORK +@{ + + +

SIM

+Event Register and Deregister +To receive asynchronous event notifications for the SIM APIs, the registration of related events with their associated call backs is required. When an asynchronous API is called, the confirmation is returned as an asynchronous event notification which invokes the callback function along with the event data. + +SAMPLE CODE: +@code +// REGISTER EVENT +unsigned int subscription_id = 0; +TapiResult_t api_err; + +api_err = TelTapiInit(); +if (api_err != TAPI_API_SUCCESS) +{ + TEST_DEBUG("TelTapiInit Failed - api_err = %d \n", api_err); +} + +api_err = TelTapiRegisterEvent (TAPI_EVENT_SIM_ENABLE_PERS_CNF, &subscription_id, (TelAppCallback)&app_callback); +printf("VSIM Event registration is Done: sub id is %d, api_err is %d\n",subscription_id,api_err); + + +// DEREGISTER EVENT +api_err = TelTapiDeRegister(subscription_id); +if (api_err != TAPI_API_SUCCESS) +{ + printf("Event Class Unregeration Fail\n"); + +} +@endcode +@} +@defgroup Use_Cases5_12 PIN, SIM Lock operations +@ingroup Use_Cases5_NETWORK +@{ + + +

PIN, SIM Lock operations

+Telephony provides APIs to enable/disable pin, change pin, unblock pin, pin verification and sim lock enable/disable/verification. It is also possible to retrieve the pin/sim lock status. + +@code +int tel_enable_sim_security(TelSimSecPw_t *sec_data, int *req_id); +int tel_disable_sim_security(TelSimSecPw_t *sec_data, int *req_id); +int tel_change_sim_pins(const TelSimSecPw_t *old_pin , const TelSimSecPw_t *new_pin, int *req_id); +int tel_verify_sim_puks(const TelSimSecPw_t *puk_data, const TelSimSecPw_t *new_pin_data, int *req_id) +int tel_verifiy_sim_pins(const TelSimSecPw_t *pin_data, int *req_id) +int tel_get_sim_security_status(TelSimPinType_t type, TelSimPinStatus_t *status) +@endcode + +SAMPLE CODE: PIN1/PIN2/SIM LOCK/PUK1 VERIFICATION AND CHANGE PIN1 +@code +#include +#include +#include "TapiCommon.h" + +// OPERATION REQUEST PIN1 VERIFICATION PART +#define PIN1_NORMAL "0000" //Sample PIN1 code + +Void pin1_verify() +{ + int request_id = 0; + int err_code; + int length = TAPI_SIM_PIN_LENGTH + 1; + char init_pin_val[length] ; + TelSimSecPw_t pin_data; + + strcpy(init_pin_val, PIN1_NORMAL); + + pin_data.type = TAPI_SIM_PTYPE_PIN1; + pin_data.pw_len = strlen(init_pin_val); + + printf("pw_len[%d]", pin_data.pw_len); + + pin_data.pw = (char*)malloc(length); + memcpy(pin_data.pw, init_pin_val, length); + + err_code = tel_verifiy_sim_pins(&pin_data, &request_id); + if (err_code != TAPI_API_SUCCESS) + { + printf("TAPI API FAIL: Error Code [0x%x]", err_code); + } + // WAIT FOR EVENT FROM HERE +} + +// OPERATION REQUEST PIN2 VERIFICATION PART +#define PIN2_NORMAL "0000" //Sample PIN2 code +Void verify_pin2() +{ + int request_id = 0; + int err_code; + int length = TAPI_SIM_PIN_LENGTH+1; + char init_pin_val[length] ; + TelSimSecPw_t pin_data; + + strcpy(init_pin_val, PIN2_NORMAL); + + pin_data.type = TAPI_SIM_PTYPE_PIN2; + pin_data.pw_len = strlen(init_pin_val); + + printf("pw_len[%d]", pin_data.pw_len); + + pin_data.pw = (char*)malloc(length); + memcpy(pin_data.pw, init_pin_val, length); + + err_code = tel_verifiy_sim_pins(&pin_data, &request_id); + if (err_code != TAPI_API_SUCCESS) + { + printf("TAPI API FAIL: Error Code [0x%x]", err_code); + } + // WAIT FOR EVENT FROM HERE +} + +// OPERATION REQUEST CHANGE PIN1 PART +#define PIN1_ORG "0000" //Sample old PIN1 code +#define PIN1_NEW "1111" //Sample new PIN1 code +void change_pins() +{ + int request_id = 0; + int err_code; + int length = TAPI_SIM_PIN_LENGTH+1; + char init_old_pin_val[length] ; + char init_new_pin_val[length]; + TelSimSecPw_t old_pin; + TelSimSecPw_t new_pin; + + memset(&init_old_pin_val, 0, length); + memset(&init_new_pin_val, 0, length); + + strcpy(init_old_pin_val, PIN1_ORG); + + old_pin.type = TAPI_SIM_PTYPE_PIN1; + old_pin.pw_len = strlen(init_old_pin_val); + printf("pw_len[%d]", old_pin.pw_len); + old_pin.pw = (char*)malloc(length); + memcpy(old_pin.pw, init_old_pin_val, length); + + strcpy(init_new_pin_val, PIN1_NEW); + + new_pin.type = TAPI_SIM_PTYPE_PIN1; + new_pin.pw_len = strlen(init_new_pin_val); + printf("pw_len[%d]", new_pin.pw_len); + new_pin.pw = (char*)malloc(length); + memcpy(new_pin.pw, init_new_pin_val, length); + + err_code = tel_change_sim_pins(&old_pin, &new_pin, &request_id); + if (err_code != TAPI_API_SUCCESS) + { + printf("TAPI API FAIL: Error Code [0x%x]", err_code); + } + // WAIT EVENT RESPONSE FROM HERE +} + +// OPERATION REQUEST VERIFICATION PUK1 PART +#define PUK1_NORMAL "00000000" //Sample PUK1 code +#define PIN1_NORMAL "0000" //Sample PIN1 code + +void verify_puks() +{ + int request_id = 0; + int err_code; + int length = TAPI_SIM_PIN_LENGTH + 1; + + char init_pin_val[length]; + char init_puk_val[length]; + + TelSimSecPw_t puk_data; + TelSimSecPw_t new_pin_data; + + strcpy(init_pin_val, PIN1_NORMAL); + strcpy(init_puk_val, PUK1_NORMAL); + + puk_data.type = TAPI_SIM_PTYPE_PUK1; // 0x00 + puk_data.pw_len = length; + puk_data.pw_len = strlen(init_puk_val); + printf("pw_len[%d]", puk_data.pw_len); + memcpy(puk_data.pw, init_pin_val, length); + + new_pin_data.type = TAPI_SIM_PTYPE_PIN1; // 0x00 + new_pin_data.pw_len = strlen(init_pin_val); + printf("pw_len[%d]", new_pin_data.pw_len); + new_pin_data.pw = (char*)malloc(length); + memcpy(new_pin_data.pw, init_pin_val, length); + + err_code = tel_verify_sim_puks(&puk_data, &new_pin_data, &request_id); + if (err_code != TAPI_API_SUCCESS) + { + printf("TAPI API FAIL: Error Code [0x%x]", err_code); + } + // WAIT EVENT RESPONSE FROM HERE +} +// OPERATION REQUEST SIM LOCK VERIFICATION PART +#define SIM_NORMAL "0000" //Sample SIM Lock code +Void verify_sim() +{ + int request_id = 0; + int err_code; + int length = TAPI_SIM_PIN_LENGTH + 1; + char init_pin_val[length] ; + TelSimSecPw_t pin_data; + + strcpy(init_pin_val, SIM_NORMAL); + + pin_data.type = TAPI_SIM_PTYPE_SIM; + pin_data.pw_len = strlen(init_pin_val); + + printf("pw_len[%d]", pin_data.pw_len); + + pin_data.pw = (char*)malloc(length); + memcpy(pin_data.pw, init_pin_val, length); + + err_code = tel_verifiy_sim_pins(&pin_data, &request_id); + if (err_code != TAPI_API_SUCCESS) + { + printf("TAPI API FAIL: Error Code [0x%x]", err_code); + } + // WAIT FOR EVENT FROM HERE +} + +// EVENT RESPONSE PART +//CALLBACK FUNCTION TO BE USED + +static void app_callback(TelTapiEvent_t *event) +{ + int eventClass; + int eventType; + int requestId; + int status; + void* EventData = NULL; + + TelTapiEvent_t *sim_event = (TelTapiEvent_t*)event; + + unsigned int temp_handle = -1; + + // + eventClass = event->EventClass; + eventType = event->EventType; + requestId = event->RequestId; + status = event->Status; + EventData = event->pData; + + printf("Class:[%d], Event Type:[%d], RequestId:[%d], Status:[%d] \n", eventClass, eventType , requestId, status ); + + switch (EventType) + { + case TAPI_EVENT_SIM_VERIFY_SEC_CNF: + printf("********TAPI_EVENT_SIM_VERIFY_SEC_CNF**********"); + + TelSimSecResult_t *pPinInfo = (TelSimSecResult_t*) EventData; + + if (status == TAPI_SIM_OPERATION_TIMEOUT ) + { + printf("TAPI SIM Operation Timeout!!"); + } + else if (sim_event->Status == TAPI_SIM_PIN_OPERATION_SUCCESS) + { + if (pPinInfo->type == TAPI_SIM_PTYPE_PIN1) + { + printf("PIN1 Verification Success!"); + } + else if (pPinInfo->type == TAPI_SIM_PTYPE_SIM) + { + printf("SIM Lock Verification Success!"); + } + else + { + printf("PIN2 Vefication Success!"); + } + } + else + { + if (pPinInfo->type == TAPI_SIM_PTYPE_PIN1) + { + printf("PIN1 Verification Failed! - PIN Required "); + printf("Remainint attempts [%d]", pPinInfo->retry_count); + } + else if (pPinInfo->type == TAPI_SIM_PTYPE_PUK1) + { + printf("PIN1 Verification Failed! - PUK Required "); + printf("Remainint attempts [%d]", pPinInfo->retry_count); + } + else if (pPinInfo->type == TAPI_SIM_PTYPE_PIN2) + { + printf("PIN2 Verification Failed! - PIN2 Required "); + printf("Remainint attempts [%d]", pPinInfo->retry_count); + } + else if (pPinInfo->type == TAPI_SIM_PTYPE_PUK2) + { + printf("PIN2 Verification Failed! - PUK2 Required "); + printf("Remainint attempts [%d]", pPinInfo->retry_count); + } + else if (pPinInfo->type == TAPI_SIM_PTYPE_SIM) + { + printf("SIM Lock Verification Failed! - SIM Lock code Required"); + printf("Remainint attempts [%d]", pPinInfo->retry_count); + } + } + printf("********************************************"); + break; + + case TAPI_EVENT_SIM_VERIFY_PUK_CNF: + printf("**********TAPI_EVENT_SIM_VERIFY_PUK_CNF********"); + + TelSimSecResult_t *pPinInfo = (TelSimSecResult_t*)EventData; + + if (status == TAPI_SIM_PIN_OPERATION_SUCCESS) + { + if (pPinInfo->type == TAPI_SIM_PTYPE_PIN1) + { + printf("Unblock PIN1 Success!"); + } + else if (pPinInfo->type == TAPI_SIM_PTYPE_PIN2) + { + printf("Unblock PIN2 Success!"); + } + } + else + { + if (pPinInfo->type == TAPI_SIM_PTYPE_PUK1) + { + printf("PIN1 Verification Failed! - PUK Required "); + printf("Remainint attempts [%d]", pPinInfo->retry_count); + } + else if (pPinInfo->type == TAPI_SIM_PTYPE_PUK2) + { + printf("PIN2 Verification Failed! - PUK2 Required "); + printf("Remainint attempts [%d]", pPinInfo->retry_count); + } + } + printf("********************************************"); + break; + + case TAPI_EVENT_SIM_CHANGE_PINS_CNF: + printf("*********TAPI_EVENT_SIM_CHANGE_PINS_CNF*******************"); + + TelSimSecResult_t *pPinInfo = (TelSimSecResult_t*)EventData; + + printf("PinType[%d]", pPinInfo->type); + + if (status == TAPI_SIM_PIN_OPERATION_SUCCESS) + { + if (pPinInfo->type == TAPI_SIM_PTYPE_PIN1) + { + printf("Change PIN1 Success!"); + } + else + { + printf("Change PIN2 Success!"); + } + + } + else + { + if (pPinInfo->type == TAPI_SIM_PTYPE_PIN1) + { + printf("Change PIN1 Failed! - PIN Required "); + printf("Remainint attempts [%d]", pPinInfo->retry_count); + } + else if (pPinInfo->type == TAPI_SIM_PTYPE_PUK1) + { + printf("Change PIN1 Failed! - PUK Required "); + printf("Remainint attempts [%d]", pPinInfo->retry_count); + } + else if (pPinInfo->type == TAPI_SIM_PTYPE_PIN2) + { + printf("Change PIN2 Failed! - PIN2 Required "); + printf("Remainint attempts [%d]", pPinInfo->retry_count); + } + else if (pPinInfo->type == TAPI_SIM_PTYPE_PUK2) + { + printf("Change PIN2 Failed! - PUK2 Required "); + printf("Remainint attempts [%d]", pPinInfo->retry_count); + } + } + printf("********************************************"); + break; + } + //... +} +@endcode + +SAMPLE CODE: ENABLE/DISABLE PIN1 and SIM LOCK +@code +#include +#include +#include "TapiCommon.h" + +// OPERATION REQUEST DISABLING PIN1 PART +#define PIN1_NORMAL "0000" //Sample PIN1 code +void disable_pin1() +{ + int request_id = 0; + int err_code; + int length = TAPI_SIM_PIN_LENGTH+1; + char init_pin_val[length]; + + strcpy(init_pin_val, PIN1_NORMAL); + + TelSimSecPw_t sec_data; + sec_data.type = TAPI_SIM_PTYPE_PIN1; // 0x00 + sec_data.pw_len = strlen(init_pin_val); + printf("pw_len[%d]", sec_data.pw_len); + + sec_data.pw = (char*)malloc(length); + memcpy(sec_data.pw, init_pin_val, length); + + err_code = tel_disable_sim_security(&sec_data, &request_id); + if (err_code != TAPI_API_SUCCESS) + { + printf("TAPI API FAIL: Error Code [0x%x]", err_code); + } + // WAIT EVENT RESPONSE FROM HERE +} + +// OPERATION REQUEST ENABLING PIN1 PART +#define PIN1_NORMAL "0000" //Sample PIN1 code +void enable_pin1() +{ + int request_id = 0; + int err_code; + int length = TAPI_SIM_PIN_LENGTH+1; + char init_pin_val[length]; + + strcpy(init_pin_val, PIN1_NORMAL); + + TelSimSecPw_t sec_data; + sec_data.type = TAPI_SIM_PTYPE_PIN1; // 0x00 + sec_data.pw_len = strlen(init_pin_val); + printf("pw_len[%d]", sec_data.pw_len); + + sec_data.pw = (char*)malloc(length); + memcpy(sec_data.pw, init_pin_val, length); + + err_code = tel_enable_sim_security(&sec_data, &request_id); + if (err_code != TAPI_API_SUCCESS) + { + printf("TAPI API FAIL: Error Code [0x%x]", err_code); + } + //WAIT EVENT RESPONSE FROM HERE +} + +// OPERATION REQUEST DISABLING SIM LOCK PART +#define SIM_NORMAL "0000" //Sample SIM LOCK code +void disable_sim() +{ + int request_id = 0; + int err_code; + int length = TAPI_SIM_PIN_LENGTH+1; + char init_pin_val[length]; + + strcpy(init_pin_val, SIM_NORMAL); + + TelSimSecPw_t sec_data; + sec_data.type = TAPI_SIM_PTYPE_SIM; // 0x00 + sec_data.pw_len = strlen(init_pin_val); + printf("pw_len[%d]", sec_data.pw_len); + + sec_data.pw = (char*)malloc(length); + memcpy(sec_data.pw, init_pin_val, length); + + err_code = tel_disable_sim_security(&sec_data, &request_id); + if (err_code != TAPI_API_SUCCESS) + { + printf("TAPI API FAIL: Error Code [0x%x]", err_code); + } + //WAIT EVENT RESPONSE FROM HERE +} + + +// OPERATION REQUEST ENABLING SIM LOCK PART +#define SIM_NORMAL "0000" //Sample SIM LOCK code +void enable_sim() +{ + int request_id = 0; + int err_code; + int length = TAPI_SIM_PIN_LENGTH+1; + char init_pin_val[length]; + + strcpy(init_pin_val, SIM_NORMAL); + + TelSimSecPw_t sec_data; + sec_data.type = TAPI_SIM_PTYPE_SIM; // 0x00 + sec_data.pw_len = strlen(init_pin_val); + printf("pw_len[%d]", sec_data.pw_len); + + sec_data.pw = (char*)malloc(length); + memcpy(sec_data.pw, init_pin_val, length); + + err_code = tel_enable_sim_security(&sec_data, &request_id); + if (err_code != TAPI_API_SUCCESS) + { + printf("TAPI API FAIL: Error Code [0x%x]", err_code); + } + //WAIT EVENT RESPONSE FROM HERE +} + + +// EVENT RESPONSE PART +//CALLBACK FUNCTION TO BE USED +static void app_callback(TelTapiEvent_t *event) +{ + int eventClass; + int eventType; + int requestId; + int status; + void* EventData = NULL; + + TelTapiEvent_t *sim_event = (TelTapiEvent_t*) event; + + unsigned int temp_handle = -1; + + // + eventClass = event->EventClass; + eventType = event->EventType; + requestId = event->RequestId; + status = event->Status; + EventData = event->pData; + + printf("Class:[%d], Event Type:[%d], RequestId:[%d], Status:[%d] \n", eventClass, eventType , requestId, status ); + + switch (EventType) + { + case TAPI_EVENT_SIM_DISABLE_SEC_CNF: + printf("****************TAPI_EVENT_SIM_DISABLE_SEC_CNF****************"); + + TelSimSecResult_t *pPinInfo = (TelSimSecResult_t*)EventData; + + if (status == TAPI_SIM_PIN_OPERATION_SUCCESS) + { + if (pPinInfo->type == TAPI_SIM_PTYPE_PIN1) + { + printf("Disable PIN1 Success!"); + } + else if (pPinInfo->type == TAPI_SIM_PTYPE_PIN2) + { + printf("Disable PIN2 Success!"); + } + else if (pPinInfo->type == TAPI_SIM_PTYPE_SIM) + { + printf("Disable SIM LOCK Success!"); + } + } + else + { + if (pPinInfo->type == TAPI_SIM_PTYPE_PIN1) + { + printf("Disable PIN1 Failed! - PIN1Required "); + printf("Remainint attempts [%d]", pPinInfo->retry_count); + } + else if (pPinInfo->type == TAPI_SIM_PTYPE_PIN2) + { + printf("Disable PIN2 Failed! - PIN2 Required "); + printf("Remainint attempts [%d]", pPinInfo->retry_count); + } + else if (pPinInfo->type == TAPI_SIM_PTYPE_PUK1) + { + printf("Disable PIN1 Failed! - PUK1 Required "); + printf("Remainint attempts [%d]", pPinInfo->retry_count); + } + else if (pPinInfo->type == TAPI_SIM_PTYPE_PUK2) + { + printf("Disable PIN2 Failed! - PUK2 Required "); + printf("Remainint attempts [%d]", pPinInfo->retry_count); + } + else if (pPinInfo->type == TAPI_SIM_PTYPE_SIM) + { + printf("Disable SIM LOCK Failed! - SIM LOCK CODE Required "); + } + } + printf("********************************************"); + break; + + case TAPI_EVENT_SIM_ENABLE_SEC_CNF: + printf("*****************TAPI_EVENT_SIM_ENABLE_SEC_CNF****************"); + + TelSimSecResult_t *pPinInfo = (TelSimSecResult_t*)EventData; + + if (status == TAPI_SIM_PIN_OPERATION_SUCCESS) + { + if (pPinInfo->type == TAPI_SIM_PTYPE_PIN1) + { + printf("Enable PIN1 Success!"); + } + else if (pPinInfo->type == TAPI_SIM_PTYPE_PIN2) + { + printf("Enable PIN2 Success!"); + } + else if (pPinInfo->type == TAPI_SIM_PTYPE_SIM) + { + printf("Enable SIM LOCK Success!"); + } + } + else + { + if (pPinInfo->type == TAPI_SIM_PTYPE_PIN1) + { + printf("Enable PIN1 Failed! - PIN1Required "); + printf("Remainint attempts [%d]", pPinInfo->retry_count); + } + else if (pPinInfo->type == TAPI_SIM_PTYPE_PIN2) + { + printf("Enable PIN2 Failed! - PIN2 Required "); + printf("Remainint attempts [%d]", pPinInfo->retry_count); + } + else if (pPinInfo->type == TAPI_SIM_PTYPE_PUK1) + { + printf("Enable PIN1 Failed! - PUK1 Required "); + printf("Remainint attempts [%d]", pPinInfo->retry_count); + } + else if (pPinInfo->type == TAPI_SIM_PTYPE_PUK2) + { + printf("Enable PIN2 Failed! - PUK2 Required "); + printf("Remainint attempts [%d]", pPinInfo->retry_count); + } + + else if (pPinInfo->type == TAPI_SIM_PTYPE_SIM) + { + printf("Enable SIM LOCK Failed! - SIM LOCK CODE Required "); + } + } + printf("********************************************"); + break; + } + //... +} +@endcode + +SAMPLE CODE: GET PIN1/PIN2/SIM LOCK STATUS +@code +#include +#include +#include "TapiCommon.h" + +// OPERATION REQUEST GET PIN1/PIN2/SIM LOCK STATUS PART +void get_security_status() +{ + int error_code; + TelSimPinType_t type = TAPI_SIM_PTYPE_PIN1 // or TAPI_SIM_PTYPE_PIN2 or TAPI_SIM_PTYPE_SIM; + TelSimPinStatus_t status = -1; + printf("Get Security status"); + + err_code = tel_get_sim_security_status(type, &status); + if (err_code == TAPI_API_SUCCESS) + { + printf(" *****************************************************"); + switch (status) + { + case TAPI_SIM_PIN_STATUS_DISABLED: + printf("TAPI_SIM_PIN_STATUS_DISABLED "); + break; + + case TAPI_SIM_PIN_STATUS_ENABLED: + printf("TAPI_SIM_PIN_STATUS_ENABLED "); + break; + + case TAPI_SIM_PIN_STATUS_BLOCKED: + printf("TAPI_SIM_PIN_STATUS_BLOCKED "); + break; + + case TAPI_SIM_PIN_STATUS_PUK_BLOCKED: + printf("TAPI_SIM_PIN_STATUS_PUK_BLOCKED "); + break; + + case TAPI_SIM_PIN_STATUS_UNKNOWN: + printf("TAPI_SIM_PIN_STATUS_UNKNOWN "); + break; + + default: + printf(" Default case statment: sim_status(%d)", status); + break; + } + } + else + { + printf("TAPI API FAIL: Error Code [0x%x]", err_code); + } + printf("*****************************************************"); +} +@endcode +@} +@defgroup Use_Cases5_13 Personalisation Lock +@ingroup Use_Cases5_NETWORK +@{ + + +

Personalisation Lock

+These APIs are used to enable/disable and get the status information about personalisation of network, network subset, corporate, service provider personalisation. + +@code +int tel_enable_sim_personalization(TelSimPersPw_t *pers_data, int *req_id); +int tel_disable_sim_personalization(TelSimPersPw_t *pers_data, int *req_id); +int tel_get_sim_personalization_status(TelSimPersType_t type, int *req_id); +@endcode + +SAMPLE CODE: GET PERSONALIZATION STATUS +@code +#include +#include +#include "TapiCommon.h" + +//SUBSCRIBE FOR EVENTS AS MENIONED IN Event Register and Deregister +// OPERATION REQUEST GET NETWORK PERSONALIZATION PART +void get_net_pers() +{ + int request_id = 0; + int err_code; + + TelSimPersType_t type = TAPI_SIM_PERS_NET; + + err_code = tel_get_sim_personalization_status(type, &request_id); + if (err_code != TAPI_API_SUCCESS) + { + printf("TAPI API FAIL: Error Code [0x%x]", err_code); + } + // WAIT EVENT RESPONSE FROM HERE +} + +// EVENT RESPONSE PART +//CALLBACK FUNCTION TO BE USED +static void app_callback (TelTapiEvent_t *event) +{ + int eventClass; + int eventType; + int requestId; + int status; + void* EventData = NULL; + + TelTapiEvent_t *sim_event = (TelTapiEvent_t*) event ; + + unsigned int temp_handle = -1; + //... + eventClass = event->EventClass; + eventType = event->EventType; + requestId = event->RequestId; + status = event->Status; + EventData = event->pData; + + switch (eventType) + { + case TAPI_EVENT_SIM_PERS_STATUS_CNF: + int i = 0; + TelSimPersStatus_t* pers_status = (TelSimPersStatus_t*)EventData; + + printf("[SIM APP]*********** TAPI_EVENT_SIM_PERS_STATUS_CNF************\n"); + printf("[SIM APP]SIM lock personalisation event status = [%x]\n", status); + printf("[SIM APP]SIM lock personalisation status - net0-ns1-sp2-cp3 = [%d]\n", pers_status->type); + printf("[SIM APP]SIM lock personalisation status - unlock0-lock1 = [%d]\n", pers_status->mode); + printf("[SIM APP]***************************************************\n"); + break; + } +} +@endcode + +SAMPLE CODE: ENABLE/DISABLE PERSONALIZATION +@code +#include +#include +#include "TapiCommon.h" + +//SUBSCRIBE FOR EVENTS AS MENIONED IN Event Register and Deregister +// OPERATION REQUEST ENABLING NETWORK PERSONALIZATION PART +#define NET_ENCODE "54500112345678" //Sample Network Personalization code +void enable_net_pers() +{ + printf("Lock Personalisation MCC+MNC 5\n"); + printf("Plese input Network Lock CODE : length of MCC+MNC, MCC, MNC, NCK\n"); + printf("We need to use this for testing : length of MCC+MNC(5), MCC(450), MNC(01), NCK(12345678) => 54500112345678\n"); + + int request_id = 0; + int err_code; + int length = 14+1; + char init_pin_val[length]; + + strcpy(init_pin_val, NET_ENCODE); + + TelSimPersPw_t lock_pers = {0,}; + lock_pers.type = TAPI_SIM_PERS_NET; + lock_pers.pw_len = 14; + lock_pers.pw = (char*)malloc(length); + memcpy(lock_pers.pw, init_password_val, length); + + err_code = tel_enable_sim_personalization(&lock_pers, &request_id); + if (err_code != TAPI_API_SUCCESS) + { + printf("TAPI API FAIL: Error Code [0x%x]", err_code); + } + // WAIT EVENT RESPONSE FROM HERE +} + +// OPERATION REQUEST DISABLING NETWORK PERSONALIZATION PART +#define NET_DISCODE "12345678" //Sample Network Personalization code +void disable_net_pers() +{ + printf("de Personalisation key is 8 byte \n"); + printf("We need to use this for testing : 12345678\n"); + + int request_id = 0; + int err_code; + int length = 8+1; + char init_pin_val[length]; + + strcpy(init_pin_val, NET_DISCODE); + + TelSimPersPw_t lock_pers = {0,}; + lock_pers.pw_len = 8; //control key + lock_pers.pw = (char*)malloc(length); + memcpy(lock_pers.pw,init_password_val,length); + + err_code = tel_disable_sim_personalization(&lock_pers, &request_id); + if (err_code != TAPI_API_SUCCESS) + { + printf("TAPI API FAIL: Error Code [0x%x]", err_code); + } + // WAIT EVENT RESPONSE FROM HERE +} + +// EVENT RESPONSE PART +//CALLBACK FUNCTION TO BE USED +static void app_callback (TelTapiEvent_t *event) +{ + int eventClass; + int eventType; + int requestId; + int status; + void* EventData = NULL; + + TelTapiEvent_t *sim_event = (TelTapiEvent_t*) event ; + + unsigned int temp_handle = -1; + //... + eventClass = event->EventClass; + eventType = event->EventType; + requestId = event->RequestId; + status = event->Status; + EventData = event->pData; + + switch (eventType) + { + case TAPI_EVENT_SIM_DISABLE_PERS_CNF: + TelSimPinOperationResult_t opResult = (TelSimPinOperationResult_t)status; + + printf("[SIM APP]**** *TAPI_EVENT_SIM_DISABLE_PERS_CNF********\n"); + printf("[SIM APP]Eable Personalization event status = [%x]\n", opResult); + + if (opResult == TAPI_SIM_PIN_OPERATION_SUCCESS) + { + ("[SIM APP]Disable Personalization Success!\n"); + } + else + { + printf("[SIM APP]Verification Failed! - Correct Password Required\n"); + } + printf("\n***************************************************************\n"); + break; + + case TAPI_EVENT_SIM_ENABLE_PERS_CNF: + TelSimPinOperationResult_t opResult = (TelSimPinOperationResult_t)status; + + printf("[SIM APP]****** *TAPI_EVENT_SIM_ENABLE_PERS_CNF*********\n"); + printf("[SIM APP]Eable Personalization event status = [%x]\n", opResult); + + if (opResult == TAPI_SIM_PIN_OPERATION_SUCCESS) + { + printf("[SIM APP]Enable Personalization Success!\n"); + } + else + { + printf("[SIM APP]Verification Failed! - Correct Password Required\n"); + } + printf("\n***************************************************************\n"); + break; + } +} +@endcode +@} +@defgroup Use_Cases5_14 FDN +@ingroup Use_Cases5_NETWORK +@{ + + +

FDN

+These APIs are used to enable/disable FDN and to retrieve the current FDN status. + +@code +int tel_enable_sim_fdn(const unsigned char *pin2, int *pin2_len, int *req_id); +int tel_disable_sim_fdn(const unsigned char *pin2, int *pin2_len, int *req_id); +int tel_get_sim_fdn_status(int *fdn_status); +@endcode + +SAMPLE CODE +@code +#include +#include +#include "TapiCommon.h" + +//SUBSCRIBE FOR EVENTS AS MENIONED IN Event Register and Deregister + +// OPERATION REQUEST ENABLE FDN MODE PART +#define PIN2_NORMAL "0000" //Sample PIN2 code +void enable_fdn() +{ + int request_id = 0; + int api_ret; + int length = TAPI_SIM_PIN_LENGTH+1; + char init_pin_val[length] ; + + strcpy(init_pin_val, PIN2_NORMAL); + + TelSimSecPw_t pin_data = {0,}; + + pin_data.type = TAPI_SIM_PTYPE_PIN2; + pin_data.pw_len = strlen(init_pin_val); + + printf("pw_len[%d]", pin_data.pw_len); + + pin_data.pw = (char*)malloc(length); + memcpy(pin_data.pw, init_pin_val, length); + + err_code = tel_enable_sim_fdn(pin_data.pw, &pin_data.pw_len, &request_id); + if (err_code != TAPI_API_SUCCESS) + { + printf("TAPI API FAIL: Error Code [0x%x]", err_code); + } + // WAIT FOR EVENT FROM HERE +} + + +// OPERATION REQUEST DISABLE FDN MODE PART +#define PIN2_NORMAL "0000" //Sample PIN2 code +void disable_fdn() +{ + int request_id = 0; + int api_ret; + int length = TAPI_SIM_PIN_LENGTH+1; + char init_pin_val[length] ; + + strcpy(init_pin_val, PIN2_NORMAL); + + TelSimSecPw_t pin_data = {0,}; + + pin_data.type = TAPI_SIM_PTYPE_PIN2; + pin_data.pw_len = strlen(init_pin_val); + + printf("pw_len[%d]", pin_data.pw_len); + + pin_data.pw = (char*)malloc(length); + memcpy(pin_data.pw, init_pin_val, length); + + err_code = tel_disable_sim_fdn(pin_data.pw, &pin_data.pw_len, &request_id); + if (err_code != TAPI_API_SUCCESS) + { + printf("TAPI API FAIL: Error Code [0x%x]", err_code); + } + // WAIT FOR EVENT FROM HERE + + + // EVENT RESPONSE PART + //CALLBACK FUNCTION TO BE USED + static void app_callback (TelTapiEvent_t *event) + { + int eventClass; + int eventType; + int requestId; + int status; + void* EventData = NULL; + + TelTapiEvent_t *sim_event = (TelTapiEvent_t*) event; + + unsigned int temp_handle = -1; + // + eventClass = event->EventClass; + eventType = event->EventType; + requestId = event->RequestId; + status = event->Status; + EventData = event->pData; + + switch (eventType) + { + case TAPI_EVENT_SIM_DISABLE_FDNMODE_CNF: + printf("**********TAPI_EVENT_SIM_DISABLE_FDNMODE_CNF***********"); + + TelSimSecResult_t *pPinInfo = (TelSimSecResult_t*)EventData; + + if (status == TAPI_SIM_PIN_OPERATION_SUCCESS) + { + if (pPinInfo->type == TAPI_SIM_PTYPE_PIN2) + { + printf("Disable FDN Success!"); + } + else + { + printf("Unhandled type[%d]", pPinInfo->type); + } + } + else + { + if (pPinInfo->type == TAPI_SIM_PTYPE_PIN2) + { + printf("Disable FDN Failed! - PIN2 Required "); + printf("Remainint attempts [%d]", pPinInfo->retry_count); + } + else if (pPinInfo->type == TAPI_SIM_PTYPE_PUK2) + { + printf("Disable FDN Failed! - PUK2 Required "); + printf("Remainint attempts [%d]", pPinInfo->retry_count); + } + else + { + printf("Unhandled type[%d]", pPinInfo->type); + } + } + printf("********************************************"); + break; + + case TAPI_EVENT_SIM_ENABLE_FDNMODE_CNF: + printf("*******TAPI_EVENT_SIM_ENABLE_FDNMODE_CNF*******"); + + TelSimSecResult_t *pPinInfo = (TelSimSecResult_t*)EventData; + + if (status == TAPI_SIM_PIN_OPERATION_SUCCESS) + { + if (pPinInfo->type == TAPI_SIM_PTYPE_PIN2) + { + printf("Enable FDN Success!"); + } + else + { + printf("Unhandled type[%d]", pPinInfo->type); + } + } + else + { + if (pPinInfo->type == TAPI_SIM_PTYPE_PIN2) + { + printf("Enable FDN Failed! - PIN2 Required "); + printf("Remainint attempts [%d]", pPinInfo->retry_count); + } + else if (pPinInfo->type == TAPI_SIM_PTYPE_PUK2) + { + printf("Enable FDN Failed! - PUK2 Required "); + printf("Remainint attempts [%d]", pPinInfo->retry_count); + } + else + { + printf("Unhandled type[%d]", pPinInfo->type); + } + } + printf("********************************************"); + break; + } + } + + + // OPERATION REQUEST GET FDN STATUS PART + void get_fdn_status() + { + printf("Get FDN status"); + int fdn_status = 0 ; + + err_code = tel_get_sim_fdn_status(&fdn_status); + if (err_code == TAPI_API_SUCCESS) + { + if (fdn_status == 0) + { + printf("*************************"); + printf("FDN disabled "); + printf("*************************"); + } + else + { + printf("*************************"); + printf("FDN enabled"); + printf("*************************"); + } + } + else + { + printf("TAPI API FAIL: Error Code [0x%x]", err_code); + } + + } +@endcode +@} +@defgroup Use_Cases5_15 IMSI Information +@ingroup Use_Cases5_NETWORK +@{ + + +

IMSI Information

+This API retrieves the IMSI (International Mobile Subscriber Identity) information. + +@code +int tel_get_sim_imsi(TelSimImsiInfo_t* imsi); +@endcode + +SAMPLE CODE: +@code +#include +#include +#include "TapiCommon.h" + +void getimsiInfo() +{ + int err_code; + TelSimImsiInfo_t sim_imsi_info; + + err_code = tel_get_sim_imsi (&sim_imsi_info); + if (err_code == TAPI_API_SUCCESS) + { + printf("[SIM APP] IMSI [mcc,mnc,msin]= "); + printf(" [%s]",sim_imsi_info.szMcc); + printf(" [%s]",sim_imsi_info.szMnc); + printf(" [%s]",sim_imsi_info.szMsin); + } + else + { + printf("Error Code [%x]\n", err_code); + } +} +@endcode +@} +@defgroup Use_Cases5_16 ECC Information +@ingroup Use_Cases5_NETWORK +@{ + + +

ECC Information

+This API retreieves the ECC (Emergency Call Codes) data. + +@code +int tel_get_sim_ecc(TelSimEccData_t *ecc_data, int *ecc_count); +@endcode + +SAMPLE CODE: +@code +#include +#include +#include "TapiCommon.h" + +void geteccinfo() +{ + int err_code; + int ecc_rec_count = 0; + TelSimEccData_t ecc_info = {0,}; + + err_code = tel_get_sim_ecc (&ecc_info, &ecc_rec_count); + printf("The Retrun Status is %d", err_code); + + printf(" ECC count [%d]\n", ecc_rec_count); + printf("ECC1 [%s]\n", ecc_info.EccInfo.szEcc1); + printf("ECC2 [%s]\n", ecc_info.EccInfo.szEcc2); + printf("ECC3 [%s]\n", ecc_info.EccInfo.szEcc3); + printf("ECC4 [%s]\n", ecc_info.EccInfo.szEcc4); + printf("ECC5 [%s]\n", ecc_info.EccInfo.szEcc5); +} + +void get_uecc() +{ + int err_code; + int i = 0; + int uecc_rec_count = 0; + + printf(" Get USIM ECC "); + + TelSimEccData_t uecc_info = {{{0,}}}; + + err_code = tel_get_sim_ecc(&uecc_info, &uecc_rec_count); + if (err_code == TAPI_API_SUCCESS) + { + printf("ECC count [%d]",uecc_rec_count ); + + for (i=0; iLanguage Preference Information

+These APIs are used to get and set the language preference information stored in SIM. + +@code +int tel_get_sim_language(TelSimLanguageInfo_t *sim_language); +int tel_set_sim_language(TelSimLanguagePreferenceCode_t language, int *req_id); +@endcode + +SAMPLE CODE: GET SIM LANGUAGE +@code +#include +#include +#include "TapiCommon.h" + +void getlanguageprefinfo() +{ + int err_code; + TelSimLanguageInfo_t li_info; + int i; + + err_code = tel_get_sim_language (&li_info); + printf("Error Code [%x]\n", err_code); + + for (i =0; i Val [%d]\n", i, li_info.Lp[i]); +} +@endcode + +SAMPLE CODE: UPDATE SIM LANGUAGE +@code +#include +#include +#include "TapiCommon.h" + +//SUBSCRIBE FOR EVENTS AS MENIONED IN Event Register and Deregister +// OPERATION REQUEST UPDATE SIM LANGUAGE PART +void get_net_pers() +{ + int err_code; + int request_id = 0; + TelSimLanguagePreferenceCode_t language = 0x00; + + language = TAPI_SIM_LP_ENGLISH; //0x01 + + err_code = tel_set_sim_language(language, &request_id); + if (err_code != TAPI_API_SUCCESS) + { + printf("TAPI API FAIL: Error Code [0x%x]", err_code); + } + // WAIT EVENT RESPONSE FROM HERE +} + + +// EVENT RESPONSE PART +//CALLBACK FUNCTION TO BE USED +static void app_callback (TelTapiEvent_t *event) +{ + int eventClass; + int eventType; + int requestId; + int status; + void* EventData = NULL; + + TelTapiEvent_t *sim_event = (TelTapiEvent_t*) event; + + unsigned int temp_handle = -1; + // + eventClass = event->EventClass; + eventType = event->EventType; + requestId = event->RequestId; + status = event->Status; + EventData = event->pData; + + switch (eventType) + { + case TAPI_EVENT_SIM_SET_LANGUAGE_CNF: + printf("*****TAPI_EVENT_SIM_SET_LANGUAGE_CNF*********"); + printf("update event status = [0x%x]", status); + printf("*********************************************"); + break; + + } +} +@endcode +@} +@defgroup Use_Cases5_18 Getting Card Type +@ingroup Use_Cases5_NETWORK +@{ + + +

Getting Card Type

+This API is a synchronous API which gets the Card Type i.e. whether the SIM Card is a GSM SIM or a 3G SIM. + +@code +int tel_get_sim_type(TelSimCardType_t *card_type); +@endcode + +SAMPLE CODE: +@code +#include +#include +#include "TapiCommon.h" + +void getcardtype() +{ + int err_code; + TelSimCardType_t cardInfo; + + printf("Get card type !!!\n"); + err_code = tel_get_sim_type (&cardInfo); + printf("card type is %d\n", cardInfo); +} +@endcode +@} +@defgroup Use_Cases5_19 Getting SIM Card Initialization Status +@ingroup Use_Cases5_NETWORK +@{ + + +

Getting SIM Card Initialization Status

+API is a synchronous API which gets the Card Init status and Identification. + +@code +int tel_get_sim_init_info(TelSimCardStatus_t *sim_status, int *card_changed); +@endcode + +SAMPLE CODE: +@code +#include +#include +#include "TapiCommon.h" + +// OPERATION REQUEST GET CARD INIT STATUS PART +void get_sim_init_status() +{ + int err_code; + TelSimCardStatus_t status = 0x00; + int b_card_changed = 0; + + err_code = tel_get_sim_init_info(&status, &b_card_changed); + if (err_code == TAPI_API_SUCCESS) + { + printf("**********************************************"); + printf("CardStatus:[0x%x]",status); + printf("b_card_changed[%d]\n",b_card_changed); + printf("**********************************************"); + } + else + { + printf("TAPI Fail: Error Code [%d]\n", err_code); + } +} +@endcode +@} +@defgroup Use_Cases5_20 SIM ACCESS COMMANDS Interface +@ingroup Use_Cases5_NETWORK +@{ + + +

SIM ACCESS COMMANDS Interface

+This API is used to handle SIM EF data directly according to sim access command (select-file info, read, update command). Use_Cases is defined in the 3GPP or ETSI SIM specifications. + +@code +int tel_req_sim_access(const TelSimRSimReq_t *rsim_data, int *req_id); +@endcode + +SAMPLE CODE: EF HANDLING ( SELECT-FILE INFO) +@code +#include +#include +#include "TapiCommon.h" + +//SUBSCRIBE FOR EVENTS AS MENIONED IN Event Register and Deregister +// OPERATION REQUEST GET SIM FILE INFO PART +void get_sim_file_info() +{ + int err_code; + int request_id = 0; + + TelRSimReq_t rsim_data; + rsim_data.file_id = TAPI_SIM_EFILE_SPN; // rsim access : sim file id to access + rsim_data.rsim_cmd = TAPI_SIM_GET_RESPONSE; // rsim access : get response, read, update available + + err_code = tel_req_sim_access(&rsim_data, &request_id); + if (err_code != TAPI_API_SUCCESS) + { + printf("TAPI API FAIL: Error Code [0x%x]", err_code); + } + // WAIT EVENT RESPONSE FROM HERE +} + +// EVENT RESPONSE PART +//CALLBACK FUNCTION TO BE USED +static void app_callback (TelTapiEvent_t *event) +{ + int eventClass; + int eventType; + int requestId; + + int status; + + void* EventData = NULL; + + TelTapiEvent_t *sim_event = (TelTapiEvent_t*) event; + + unsigned int temp_handle = -1; + // + eventClass = event->EventClass; + eventType = event->EventType; + requestId = event->RequestId; + status = event->Status; + EventData = event->pData; + + switch (eventType) + { + case TAPI_EVENT_SIM_RSIM_ACCESS_CNF: + TelSimReadFileRaw_t* rsim_resp = (TelSimReadFileRaw_t*)EventData; + + printf("*******TAPI_EVENT_SIM_RSIM_ACCESS_CNF**********"); + printf("Read event status = [0x%x]", status); + + if ((rsim_resp->sw1 == 0x90 && rsim_resp->sw2 == 0x00) ||rsim_resp->sw1 == 0x91) + { + printf("**********GET FILE INFO************"); + printf("you should parse current data array value properly regarding 3GPP or ETSI TS 102 221 SPEC"); + } + printf("************************************************"); + break; + } +} +@endcode +@} +@defgroup Use_Cases5_21 SIM Mailbox EF management +@ingroup Use_Cases5_NETWORK +@{ + + +

SIM Mailbox EF management

+These APIs are used to get and update the mailbox information stored in SIM. + +@code +int tel_get_sim_mailbox_info(TelSimMsgWaitingGroup_t type, int *req_id); +int tel_set_sim_mailbox_info(TelSimMsgWaitingGroup_t type, const TelSimDialingNumberInfo_t *update_data, int *req_id); +@endcode + +SAMPLE CODE: READ / UPDATE MAILBOX INFO +@code +#include +#include +#include "TapiCommon.h" + +//SUBSCRIBE FOR EVENTS AS MENIONED IN Event Register and Deregister + +void get_sim_mailbox() +{ + int err_code; + int request_id = 0; + TelSimMsgWaitingGroup_t type = 0x00; + + type = TAPI_SIM_MWG_VOICE; + + err_code = tel_get_sim_mailbox_info(type, &request_id); + if (err_code != TAPI_API_SUCCESS) + { + printf("TAPI API FAIL: Error Code [0x%x]", err_code); + } + // WAIT EVENT RESPONSE FROM HERE +} +// OPERATION REQUEST UPDATE SIM MAILBOX INFO PART +void update_sim_mailbox() +{ + int err_code; + int request_id = 0; + + TelSimMsgWaitingGroup_t type = 0x00; + TelSimDialingNumberInfo_t update_data; + + type = TAPI_SIM_MWG_VOICE; + + memcpy(update_data.AlphaId, "TestUpdate", 10); + update_data.AlphaIdLength = strlen(update_data.AlphaId); + update_data.CapaConfigId = 1; + memcpy(update_data.DiallingNum, "101020203030", 12); + update_data.DiallingnumLength = strlen(update_data.DiallingNum); + update_data.Ext1RecordId = 1; + update_data.NumberingPlanIdent =2; + update_data.TypeOfNumber = 2; + + err_code = tel_set_sim_mailbox_info(type, &update_data, &request_id); + if (err_code != TAPI_API_SUCCESS) + { + printf("TAPI API FAIL: Error Code [0x%x]", err_code); + } + // WAIT EVENT RESPONSE FROM HERE +} + +// EVENT RESPONSE PART +//CALLBACK FUNCTION TO BE USED +static void app_callback (TelTapiEvent_t *event) +{ + int eventClass; + int eventType; + int requestId; + int status; + void* EventData = NULL; + + TelTapiEvent_t *sim_event = (TelTapiEvent_t*) event; + + unsigned int temp_handle = -1; + // + eventClass = event->EventClass; + eventType = event->EventType; + requestId = event->RequestId; + status = event->Status; + EventData = event->pData; + + switch (eventType) + { + case TAPI_EVENT_SIM_GET_MAILBOX_CNF: + TelSimDialingNumberInfo_t* mailbox = (TelSimDialingNumberInfo_t*)EventData; + + printf("*******TAPI_EVENT_SIM_GET_MAILBOX_CNF*********"); + printf("Read event status = [0x%x]", status); + printf("bUsed[%d]", mailbox->bUsed); + printf("AlphaIDMaxLength[%d]", mailbox->AlphaIDMaxLength); + printf("AlphaIdLength[%d]", mailbox->AlphaIdLength); + printf("AlphaId[%s]", mailbox->AlphaId); + printf("DiallingNumMaxLength[%d]", mailbox->DiallingNumMaxLength); + printf("DiallingnumLength[%d]", mailbox->DiallingnumLength); + printf("TypeOfNumber:0-unknown,1-international,2-national[%d]", mailbox->TypeOfNumber); + printf("NumberingPlanIdent:0-unknown,1-isdn,3-data[%d]", mailbox->NumberingPlanIdent); + printf("DiallingNum[%s]", mailbox->DiallingNum); + printf("CapaConfigId[%c]", mailbox->CapaConfigId); + printf("Ext1RecordId[%c]", mailbox->Ext1RecordId); + printf("**********************************************************"); + break; + + case TAPI_EVENT_SIM_SET_MAILBOX_CNF: + printf("*********NEW*TAPI_EVENT_SIM_SET_MAILBOX_CNF************"); + printf("update event status = [0x%x]", status); + printf("**********************************************************"); + break; + } +} +@endcode +@} +@defgroup Use_Cases5_22 SIM Indication Status EFs management +@ingroup Use_Cases5_NETWORK +@{ + + +

SIM Indication Status EFs management

+These APIs are used to get and set the message indication status stored in SIM. + +@code +int tel_get_sim_indicator_info(TelSimIndicationStatusType_t type, int *req_id); +int tel_set_sim_indicator_info(const TelSimIndicationStatusData_t *update_data, int *req_id); +@endcode + +SAMPLE CODE: READ / UPDATE INDICATION STATUS DATA +@code +#include +#include +#include "TapiCommon.h" + +//SUBSCRIBE FOR EVENTS AS MENIONED IN Event Register and Deregister + +// OPERATION REQUEST READ SIM MESSAGE WAITING INDICATION STATUS INFO PART +void read_sim_mwis() +{ + int err_code; + int request_id = 0; + + TelSimIndicationStatusType_t type = 0x00; + + type = TAPI_SIM_INDICATION_MW; + + err_code = tel_get_sim_indicator_info(type, &request_id); + if (err_code != TAPI_API_SUCCESS) + { + printf("TAPI API FAIL: Error Code [0x%x]", err_code); + } + // WAIT EVENT RESPONSE FROM HERE +} + +// OPERATION REQUEST UPDATE SIM MESSAGE WAITING INDICATION STATUS INFO PART +//SUBSCRIBE FOR EVENTS AS MENIONED IN Event Register and Deregister + +void update_sim_mwis() +{ + int err_code; + int request_id = 0; + + TelSimIndicationStatusType_t type = 0x00; + TelSimIndicationStatusData_t update_data; + memset(&update_data, 0x00, sizeof(TelSimIndicationStatusData_t)); + + type = TAPI_SIM_INDICATION_MW; + + update_data.requested_type = type; + update_data.data.Mwis.VoiceMailCount = 1; // VoiceMail Count + update_data.data.Mwis.FaxCount = 2; // Fax Count + update_data.data.Mwis.EmailCount = 3; // Email Count + update_data.data.Mwis.OtherCount = 4; // Other Count + update_data.data.Mwis.VideoMailCount = 5; // VideoMail Count + + err_code = tel_set_sim_indicator_info(&update_data, &request_id); + if (err_code != TAPI_API_SUCCESS) + { + printf("TAPI API FAIL: Error Code [0x%x]", err_code); + } + // WAIT EVENT RESPONSE FROM HERE +} + + +// EVENT RESPONSE PART +//CALLBACK FUNCTION TO BE USED +static void app_callback (TelTapiEvent_t *event) +{ + int eventClass; + int eventType; + int requestId; + int status; + void* EventData = NULL; + + TelTapiEvent_t *sim_event = (TelTapiEvent_t*) event; + + unsigned int temp_handle = -1; + // + eventClass = event->EventClass; + eventType = event->EventType; + requestId = event->RequestId; + status = event->Status; + EventData = event->pData; + + switch (eventType) + { + case TAPI_EVENT_SIM_GET_INDICATION_CNF: + TelSimIndicationStatusData_t* indi_data = (TelSimIndicationStatusData_t*)EventData; + + printf("*******TAPI_EVENT_SIM_GET_INDICATION_CNF**********"); + printf("Read event status = [0x%x]", status); + + if (indi_data->requested_type == TAPI_SIM_INDICATION_MW) + { + printf("**********MWIS************"); + printf("IndicatorType[%d]", indi_data->data.Mwis.IndicatorType); + printf("VoiceMailCount[%d]", indi_data->data.Mwis.VoiceMailCount); + printf("FaxCount[%d]", indi_data->data.Mwis.FaxCount); + printf("EmailCount[%d]", indi_data->data.Mwis.EmailCount); + printf("OtherCount[%d]", indi_data->data.Mwis.OtherCount); + printf("VideoMailCount[%d]", indi_data->data.Mwis.VideoMailCount); + } + else if (indi_data->requested_type == TAPI_SIM_INDICATION_CF) + { + printf("**********CFIS************"); + printf("bUsed[%d]", indi_data->data.Cfis.bUsed); + printf("MspNumber[%d]", indi_data->data.Cfis.MspNumber); + printf("Status[%d]", indi_data->data.Cfis.Status); + printf("DiallingnumLen[%d]", indi_data->data.Cfis.DiallingnumLen); + printf("TypeOfNumber[%d]", indi_data->data.Cfis.TypeOfNumber); + printf("NumberingPlanIdent[%d]", indi_data->data.Cfis.NumberingPlanIdent); + printf("DiallingNum[%s]", indi_data->data.Cfis.DiallingNum); + printf("CapaConfig2Id[%d]", indi_data->data.Cfis.CapaConfig2Id); + printf("Ext7RecordId[%d]", indi_data->data.Cfis.Ext7RecordId); + } + else + { + printf("Unhandled indication status type[%d]",indi_data->requested_type ); + } + printf("************************************************"); + break; + + case TAPI_EVENT_SIM_SET_INDICATION_CNF: + printf("******TAPI_EVENT_SIM_SET_INDICATION_CNF*******"); + printf("update event status = [0x%x]", status); + printf("**********************************************"); + break; + } +} +@endcode +@} +@defgroup Use_Cases5_23 Phone Book +@ingroup Use_Cases5_NETWORK +@{ + + +

Phone Book

+[Note] Telephony Emulator does not support this feature. + +Telephony provides APIs for various phone book related features, such as getting total records in phone book, retrieving phone book entry information, reading, updating and deleting phone book information, getting first valid index. + +@code +int tel_get_sim_pb_count(TelSimPbFileType_t pb_type, int* req_id); +int tel_get_sim_pb_meta_info(TelSimPbFileType_t pb_type, int* req_id); +int tel_read_sim_pb_record(TelSimPbFileType_t pb_type, unsigned short index, int *req_id ); +int tel_update_sim_pb_record(const TelSimPbRecordData_t *req_data, int *req_id ); +int tel_delete_sim_pb_record(TelSimPbFileType_t pb_type, unsigned short index, int *req_id ); +int tel_get_sim_pb_init_info(int *init_completed, TelSimPbList_t *pb_list, int *first_index ); +@endcode + +SAMPLE CODE FOR GETTING STORAGE COUNT +@code +#include +#include +#include "TapiCommon.h" + +//SUBSCRIBE FOR EVENTS AS MENTIONED IN Event Register and Deregister +void getstoragecount() +{ + int ret_status; + TelSimPbFileType_t StorageFileType = TAPI_SIM_PB_LDN; + int pRequestId = 0; + + ret_status = tel_get_sim_pb_count (StorageFileType, &pRequestId); + if (ret_status == TAPI_API_SUCCESS) + printf("successful\n"); + else + printf("error=%d\n", ret_status); +} +//WAIT FOR EVENT HERE + +//CALLBACK FUNCTION TO BE USED +static void app_callback (TelTapiEvent_t *event) +{ + int eventClass; + int eventType; + int requestId; + int status; + void* EventData = NULL; + + TelTapiEvent_t *sim_event = (TelTapiEvent_t*) event ; + + unsigned int temp_handle = -1; + //... + eventClass = event->EventClass; + eventType = event->EventType; + requestId = event->RequestId; + status = event->Status; + EventData = event->pData; + + switch (eventType) + { + case TAPI_EVENT_SIM_PB_STORAGE_COUNT_CNF: + printf("TAPI_EVENT_SIM_PB_STORAGE_COUNT_CNF"); + break; + } +} +@endcode + +SAMPLE CODE TO GET PHONE BOOK ENTRY INFO +@code +#include +#include +#include "TapiCommon.h" + +//SUBSCRIBE FOR EVENTS AS MENIONED IN Event Register and Deregister +void getPBEntryInfo() +{ + int ret_status; + TelSimPbFileType_t StorageFileType = TAPI_SIM_PB_FDN; + int pRequestId = 0; + + ret_status = tel_get_sim_pb_meta_info (StorageFileType, &pRequestId); + if (ret _status == TAPI_API_SUCCESS) + printf(successful\n); + else + printf(error=%d\n, ret_status); + //WAIT FOR EVENT HERE +} +//CALLBACK FUNCTION TO BE USED +static void app_callback (TelTapiEvent_t *event) +{ + int eventClass; + int eventType; + int requestId; + int status; + void* EventData = NULL; + + TelTapiEvent_t *sim_event = (TelTapiEvent_t*) event; + + unsigned int temp_handle = -1; + eventClass = event->EventClass; + eventType = event->EventType; + requestId = event->RequestId; + status = event->Status; + EventData = event->pData; + + switch (EventType) { + case TAPI_EVENT_SIM_PB_ENTRY_INFO_CNF: + TelSimPbEntryInfo_t *entryInfo = (TelSimPbEntryInfo_t*)sim_event->pData ; + printf("SIM PB entry info event status = [%x]\n", sim_event->Status); + printf("[SIM APP]STORAGE TYPE [%d]\n", entryInfo->StorageFileType); + printf("[SIM APP]PB_INDEX_MIN %d\n", entryInfo->PbIndexMin); + printf("[SIM APP]PB_INDEX_MAX = %d\n", entryInfo->PbIndexMax); + printf("[SIM APP]PB_NUM_LEN_MAX = %d\n", entryInfo->PbNumLenMax); + printf("[SIM APP]PB_TEXT_LEN_MAX = %d\n", entryInfo->PbTextLenMax); + printf("********************************************\n"); + break; + } +} +@endcode + +SAMPLE CODE FOR READING RECORD +@code +#include +#include +#include "TapiCommon.h" + +//SUBSCRIBE FOR EVENTS AS MENTIONED IN Event Register and Deregister +void simreadrecord() +{ + int ret_status; + TelSimPbFileType_t StorageFileType = TAPI_SIM_PB_FDN; + unsigned short Index = 4; + int pRequestId = 0; + + ret_status = tel_read_sim_pb_record (StorageFileType,Index, &pRequestId); + if (ret_status == TAPI_API_SUCCESS) + printf(successful\n); + else + printf(error=%d\n, ret_status); +} +//WAIT FOR EVENT HERE + +//CALLBACK FUNCTION TO BE USED +static void app_callback (TelTapiEvent_t *event) +{ + int eventClass; + int eventType; + int requestId; + int status; + void* EventData = NULL; + + TelTapiEvent_t *sim_event = (TelTapiEvent_t*) event ; + + unsigned int temp_handle = -1; + eventClass = event->EventClass; + eventType = event->EventType; + requestId = event->RequestId; + status = event->Status; + EventData = event->pData; + + switch (eventType) { + case TAPI TAPI_EVENT_SIM_PB_ACCESS_READ_CNF: + printf("TAPI_EVENT_SIM_PB_ACCESS_READ_CNF"); + //READ DATA + break; + // + } +} +@endcode + +SAMPLE CODE FOR UPDATING RECORD +@code +#include +#include +#include "TapiCommon.h" + +//SUBSCRIBE FOR EVENTS AS MENTIONED IN Event Register and Deregister +void simupdaterecord() +{ + int ret_status; + TelSimPbRecordData_t pb_add; + pb_add.StorageFileType = TAPI_SIM_PB_GAS; + int pRequestId = 0; + + pb_add.Index = 1; + + ret_status = tel_update_sim_pb_record (&pb_add, &pRequestId); +} +//WAIT FOR EVENT HERE + +//CALLBACK FUNCTION TO BE USED +static void app_callback (TelTapiEvent_t *event) +{ + int eventClass; + int eventType; + int requestId; + int status; + void* EventData = NULL; + + TelTapiEvent_t *sim_event = (TelTapiEvent_t*) event ; + + unsigned int temp_handle = -1; + // + eventClass = event->EventClass; + eventType = event->EventType; + requestId = event->RequestId; + status = event->Status; + EventData = event->pData; + + switch (EventType) + { + case TAPI_EVENT_SIM_PB_UPDATE_CNF: + printf("TAPI_EVENT_SIM_PB_UPDATE_CNF"); + break; + //... + } +} +@endcode + +SAMPLE CODE FOR DELETING RECORD +@code +#include +#include +#include "TapiCommon.h" + +//SUBSCRIBE FOR EVENTS AS MENTIONED IN Event Register and Deregister +void contactdelete() +{ + int ret_status; + //DELETE RECORD + TelSimPbFileType_t StorageFileType = TAPI_SIM_PB_3GSIM; + unsigned short RecordIndex = 1; + int pRequestId = 0; + + ret_status = tel_delete_sim_pb_record (StorageFileType, RecordIndex, &pRequestId); +}//WAIT FOR EVENT HERE + +//CALLBACK FUNCTION TO BE USED +static void app_callback (TelTapiEvent_t *event) +{ + int eventClass; + int eventType; + int requestId; + int status; + void* EventData = NULL; + + TelTapiEvent_t *sim_event = (TelTapiEvent_t*) event ; + + unsigned int temp_handle = -1; + // + eventClass = event->EventClass; + eventType = event->EventType; + requestId = event->RequestId; + status = event->Status; + EventData = event->pData; + + switch (EventType) + { + case TAPI_EVENT_SIM_PB_DELETE_CNF: + printf(TAPI_EVENT_SIM_PB_DELETE_CNF); + // + break; + } +} +@endcode + +SAMPLE CODE FOR GETTING PHONEBOOK INIT INFO +@code +#include +#include +#include "TapiCommon.h" + +// OPERATION REQUEST GET SIM PHONEBOOK INIT STATUS PART +void get_sim_phonebook_init_status() +{ + int valid_index = 0; + TelSimPbList_t pb_list; + int pPbInitCompleted = 0; + + err_code = tel_get_sim_pb_init_info(&pPbInitCompleted, &pb_list, &valid_index); + if (err_code == TAPI_API_SUCCESS) + { + if (pPbInitCompleted == 0) + { + printf(" SIM PB INIT NOT completed "); + } + else + { + printf("SIM PB INIT completed"); + // if no sim records at all then valid_index = 0xFF + printf ("ADN First index is [%d]",valid_index); + printf ("SIM phone book storage list Information "); + printf ("********************************************"); + printf ("pb_list.b_fdn[%d]",pb_list.b_fdn); + printf ("pb_list.b_msisdn[%d]",pb_list.b_msisdn); + printf ("pb_list.b_adn[%d]",pb_list.b_adn); + printf ("pb_list.b_sdn[%d]",pb_list.b_sdn); + printf ("pb_list.b_3g[%d]",pb_list.b_3g); + printf ("pb_list.b_aas[%d]",pb_list.b_aas); + printf ("pb_list.b_gas[%d]",pb_list.b_gas); + } + } + else + { + printf("TAPI API FAIL: Error Code [0x%x]", err_code); + } +} +@endcode +@} +@defgroup Use_Cases5_24 Getting 3G Phone Book Information +@ingroup Use_Cases5_NETWORK +@{ + + +

Getting 3G Phone Book Information

+[Note] Telephony Emulator does not support this feature. + +Telephony provides APIs to retrieve SIM EFs supported by 3G phone , such as ANR, SNE, GRP, EMAIL etc and corresponding EFs max text length, number length and size. + +@code +int tel_get_sim_pb_3g_meta_info(int *req_id); +@endcode + +SAMPLE CODE: +@code +#include +#include +#include "TapiCommon.h" + +//SUBSCRIBE FOR EVENTS AS MENTIONED IN Event Register and Deregister +void get3gcapainfo() +{ + int ret_status; + int req_id = 0; + + ret_status = tel_get_sim_pb_3g_meta_info (&req_id); +} +//WAIT FOR EVENT HERE + +//CALLBACK FUNCTION TO BE USED +static void app_callback (TelTapiEvent_t *event) +{ + int eventClass; + int eventType; + int requestId, i; + int status; + void* EventData = NULL; + + TelTapiEvent_t *sim_event = (TelTapiEvent_t*) event ; + + unsigned int temp_handle = -1; + // + eventClass = event->EventClass; + eventType = event->EventType; + requestId = event->RequestId; + status = event->Status; + EventData = event->pData; + + switch (eventType) { + case TAPI_EVENT_SIM_PB_CAPABILITY_INFO_CNF: + printf("[SIM APP]SIM PB Capability Info event status = [%x]\n", sim_event->Status); + TelSimPbCapabilityInfo_t *sim_capability_info = (TelSimPbCapabilityInfo_t*)sim_event->pData; + int i; + for (i=0; iFileTypeCount; i++) + { + printf(" [SIM APP]Filed tag type[%d]", sim_capability_info->FileTypeInfo[i].FileType3G); + printf(" [SIM APP]max index [%d]\n", sim_capability_info->FileTypeInfo[i].PbIndexMax); + printf(" [SIM APP]max text [%d]\n", sim_capability_info->FileTypeInfo[i].PbTextMax); + printf(" [SIM APP]used count [%d]\n", sim_capability_info->FileTypeInfo[i].TotalRecordCount); + } + break; + //... + } +} +@endcode + +@} +@defgroup Use_Cases5_25 SAP (Sim access Profile) features +@ingroup Use_Cases5_NETWORK +@{ + +

SAP (Sim access Profile) features

+[Note] Telephony Emulator does not support this feature. + +The SIM Access Profile defines the protocols and procedures that shall be used to access data and services of GSM SIM card, a UICC card or a R-UIM card via a Bluetooth link. + +The SIM Access Profile specifies the following features: +- Connection Management +- Transfer APDU +- Transfer ATR +- Power SIM off/on +- Transfer Card Reader Status +- Set Transport Protocol + +

Connection Management:

+An established SIM Access Profile connection is the prerequisite for all other features. +Telephony exposes APIs to make a connection request to SIM and to get connection status information. + +@code +int tel_req_sap_connection( TelSimSapConnect_t *req_data, int *req_id); +int tel_req_sap_connection_status( int *req_id); +@endcode + +SAMPLE CODE: +@code +#include +#include +#include "TapiCommon.h" +//SUBSCRIBE FOR EVENTS AS MENTIONED IN Event Register and Deregister +void sapconnectreq() +{ + int ret_status; + TelSimSapConnect_t pConnectionReq; + int pRequestId = 0; + + pConnectionReq.MsgId = TAPI_SIM_SAP_CONNECT_REQ; + pConnectionReq.MaxMsgSize = 10; //temp for testing only - not clear + + ret_status = tel_req_sap_connection (&pConnectionReq, &pRequestId); + if (ret_status == TAPI_API_SUCCESS) + printf("successful\n"); + else + printf("error=%d\n", ret_status); +} +//WAIT FOR EVENT HERE + +//CALLBACK FUNCTION TO BE USED +static void app_callback (TelTapiEvent_t *event) +{ + int eventClass; + int eventType; + int requestId; + int status; + void* EventData = NULL; + + TelTapiEvent_t *sim_event = (TelTapiEvent_t*) event ; + + unsigned int temp_handle = -1; + // + eventClass = event->EventClass; + eventType = event->EventType; + requestId = event->RequestId; + status = event->Status; + EventData = event->pData; + + switch (eventType) + { + case TAPI_SIM_EVENT_SAP_CONNECT_CNF: + printf("TAPI_SIM_EVENT_SAP_CONNECT_CNF"); + break; + //... + } +} + +//GET STATUS +void sapconnectstatusreq() +{ + int request_id = 0; + int ret_status = tel_req_sap_connection_status (&request_id); + if (ret_status == TAPI_API_SUCCESS) + printf("successful\n"); + else + printf("error=%d\n", ret_status); +} +//WAIT FOR EVENT HERE + +//CALLBACK FUNCTION TO BE USED + +static void app_callback (TelTapiEvent_t *event) +{ + int eventClass; + int eventType; + int requestId; + int status; + void* EventData = NULL; + + TelTapiEvent_t *sim_event = (TelTapiEvent_t*) event ; + + unsigned int temp_handle = -1; + eventClass = event->EventClass; + eventType = event->EventType; + requestId = event->RequestId; + status = event->Status; + EventData = event->pData; + + switch (eventType) + { + case TAPI_SIM_EVENT_SAP_CONNECT_STATUS_CNF: + printf("TAPI_SIM_EVENT_SAP_CONNECT_STATUS_CNF"); + break; + //... + } +} +@endcode + +

Transfer APDU:

+The ability to send APDUs (Application Protocol Data Units) over the Bluetooth link +@n Telephony provides API to transfer APDU to sim. + +@code +int tel_req_sap_transfer_apdu(TelSimSapApduData_t *apdu_data, int *req_id); +@endcode + +SAMPLE CODE: +@code +#include +#include +#include "TapiCommon.h" + +//SUBSCRIBE FOR EVENTS AS MENTIONED IN Event Register and Deregister +void saptransferapdu() +{ + int err_code; + int file_id = TAPI_SIM_EFILE_ICCID; + + // for selecting EF ICCID + TelSimSapApduData_t apdu_data; + int pRequestId = 0; + + apdu_data.ApduLength = 7; + apdu_data.Apdu[0] = 0xA0; // class + apdu_data.Apdu[1] = 0xA4; // instruction + apdu_data.Apdu[2] = 0; // p1 = parameter 1 + apdu_data.Apdu[3] = 0; // p2 = parameter 2 + apdu_data.Apdu[4] = 2; // p3 - parameter 3 + + memcpy(&apdu_data.Apdu[5], &file_id, sizeof(unsigned short)); + err_code = tel_req_sap_transfer_apdu (&apdu_data, NULL); + if (err_code == TAPI_API_SUCCESS) + printf("successful\n"); + else + printf("error=%d\n", err_code); +} +//WAIT FOR EVENT HERE +//CALLBACK FUNCTION TO BE USED +static void app_callback (TelTapiEvent_t *event) +{ + int eventClass; + int eventType; + int requestId; + int status; + void* EventData = NULL; + + TelTapiEvent_t *sim_event = (TelTapiEvent_t*) event ; + + unsigned int temp_handle = -1; + //... + eventClass = event->EventClass; + eventType = event->EventType; + requestId = event->RequestId; + status = event->Status; + EventData = event->pData; + + switch (eventType) + { + case TAPI_SIM_EVENT_SAP_TRANSFER_APDU_CNF: + printf("TAPI_SIM_EVENT_SAP_TRANSFER_APDU_CNF"); + break; + }//... +} +@endcode + +

Transfer ATR:

+The ability to send the content of the ATR (Answer to Reset) from the Server to the Client over the Bluetooth link. It contains information about the interface provided by the subscription module and the services on the GSM SIM, the UICC or the R-UIM. + +@code +int tel_req_sap_transfer_atr( int *req_id); +@endcode + +SAMPLE CODE +@code +#include +#include +#include "TapiCommon.h" + +//SUBSCRIBE FOR EVENTS AS MENTIONED IN Event Register and Deregister +void saptransferatrreq() +{ + int ret_status; + int pRequestId = 0; + + ret_status = tel_req_sap_transfer_atr (&pRequestId); + if (ret_status == TAPI_API_SUCCESS) + printf("successful\n"); + else + printf("error=%d\n", ret_status); +} +//WAIT FOR EVENT HERE + +//CALLBACK FUNCTION TO BE USED +static void app_callback (TelTapiEvent_t *event) +{ + int eventClass; + int eventType; + int requestId; + int status; + void* EventData = NULL; + + TelTapiEvent_t *sim_event = (TelTapiEvent_t*) event ; + + unsigned int temp_handle = -1; + //... + eventClass = event->EventClass; + eventType = event->EventType; + requestId = event->RequestId; + status = event->Status; + EventData = event->pData; + + switch (eventType) + { + case TAPI_SIM_EVENT_SAP_TRANSFER_ATR_CNF: + printf("TAPI_SIM_EVENT_SAP_TRANSFER_ATR_CNF"); + break; + //... + } +} +@endcode + +

Power sim on/off:

+The ability to power the subscription module on/off remotely. + +@code +int tel_req_sap_power_operation(TelSimSapMsgId_t req_data, int *req_id ); +@endcode + +SAMPLE CODE +@code +#include +#include +#include "TapiCommon.h" + +//SUBSCRIBE FOR EVENTS AS MENTIONED IN Event Register and Deregister +void sapsetpower() +{ + int ret_status; + TelSimSapMsgId_t MsgId = TAPI_SIM_SAP_CONNECT_REQ; + int pRequestId = 0; + + ret_status = tel_req_sap_power_operation (MsgId, &pRequestId); + if (ret_status == TAPI_API_SUCCESS) + printf("successful\n"); + else + printf("error=%d\n", ret_status); +} +//WAIT FOR EVENT HERE + +//CALLBACK FUNCTION TO BE USED +static void app_callback (TelTapiEvent_t *event) +{ + int eventClass; + int eventType; + int requestId; + int status; + void* EventData = NULL; + + TelTapiEvent_t *sim_event = (TelTapiEvent_t*) event ; + + unsigned int temp_handle = -1; + //... + eventClass = event->EventClass; + eventType = event->EventType; + requestId = event->RequestId; + status = event->Status; + EventData = event->pData; + + + switch (EventType) + { + case TAPI_SIM_EVENT_SAP_SET_SIM_POWER_CNF: + printf("TAPI_SIM_EVENT_SAP_SET_SIM_POWER_CNF"); + break; + //... + } +} +@endcode + +

Transfer Card Reader Status:

+The card reader status contains some basic information about the Card Reader and the subscription module (e.g. the size of the SIM or if the SIM is removable). + +@code +int tel_req_sap_cardreader_status(int *req_id); +@endcode + +SAMPLE CODE +@code +#include +#include +#include "TapiCommon.h" + +//SUBSCRIBE FOR EVENTS AS MENTIONED IN Event Register and Deregister +void simsapcardreaderstatus() +{ + int ret_status; + int pRequestId = 0; + + ret_status = tel_req_sap_cardreader_status (&pRequestId); + if (ret_status == TAPI_API_SUCCESS) + printf("successful\n"); + else + printf("error=%d\n", ret_status); +} +//WAIT FOR EVENT HERE + +//CALLBACK FUNCTION TO BE USED +static void app_callback (TelTapiEvent_t *event) +{ + int eventClass; + int eventType; + int requestId; + int status; + void* EventData = NULL; + + TelTapiEvent_t *sim_event = (TelTapiEvent_t*) event ; + + unsigned int temp_handle = -1; + // + eventClass = event->EventClass; + eventType = event->EventType; + requestId = event->RequestId; + status = event->Status; + EventData = event->pData; + + + switch (eventType) + { + case TAPI_SIM_EVENT_SAP_CARD_READER_STATUS_CNF: + printf("TAPI_SIM_EVENT_SAP_CARD_READER_STATUS_CNF"); + break; + //... + } +} +@endcode + +

Set Transport Protocol:

+The server shall reset the subscription module and switch to the desired protocol if supported by subscription module and Server. + +@code +int tel_req_sap_transport_protocol(TelSimSapProtocol_t protocol, int *req_id); +@endcode + +SAMPLE CODE +@code +#include +#include +#include "TapiCommon.h" + +//SUBSCRIBE FOR EVENTS AS MENTIONED IN Event Register and Deregister +void sapsettransportprotocol() +{ + int ret_status; + TelSimSapProtocol_t Protocol = TAPI_SIM_SAP_PROTOCOL_T0; + int pRequestId = 0; + + ret_status = tel_req_sap_transport_protocol (Protocol, &pRequestId); + if (ret_status == TAPI_API_SUCCESS) + printf("successful\n"); + else + printf("error=%d\n", ret_status); +} +//WAIT FOR EVENT HERE + +//CALLBACK FUNCTION TO BE USED +static void app_callback (TelTapiEvent_t *event) +{ + int eventClass; + int eventType; + int requestId; + int status; + void* EventData = NULL; + + TelTapiEvent_t *sim_event = (TelTapiEvent_t*) event ; + + unsigned int temp_handle = -1; + //... + eventClass = event->EventClass; + eventType = event->EventType; + requestId = event->RequestId; + status = event->Status; + EventData = event->pData; + + switch (EventType) + { + case TAPI_SIM_EVENT_SAP_SET_PROTOCOL_CNF: + printf("TAPI_SIM_EVENT_SAP_SET_PROTOCOL_CNF"); + break; + //... + } +} +@endcode +@} +@defgroup Use_Cases5_26 ISIM Features +@ingroup Use_Cases5_NETWORK +@{ + + +

ISIM Features

+[Note] Telephony Emulator does not support this feature. + +@code +int tel_req_sim_isim_authentication( TelSimIsimAuthenticationData_t *authentication_data, int *req_id); +@endcode + +Application uses this API to send the ISIM authentication request to telephony. + +SAMPLE CODE +@code +#include +#include +#include "TapiCommon.h" + +//SUBSCRIBE FOR EVENTS AS MENTIONED IN Event Register and Deregister +void isimauthreq() +{ + int ret_status; + TelSimIsimAuthenticationData_t authenticationData; + authenticationData.RandomAccessLength = 100; + authenticationData.RandomAccessLength = 100; + authenticationData.RandomAccessData = "test data"; + authenticationData.AuthData = "test data"; + int pRequestId = 0; + + ret_status = tel_req_sim_isim_authentication (&authenticationData, &pRequestId); + if (ret_status == TAPI_API_SUCCESS) + printf("successful\n"); + else + printf("error=%d\n", ret_status); +} +//WAIT FOR EVENT HERE + +//CALLBACK FUNCTION TO BE USED +static void app_callback (TelTapiEvent_t *event) +{ + int eventClass; + int eventType; + int requestId; + int status; + void* EventData = NULL; + + TelTapiEvent_t *sim_event = (TelTapiEvent_t*) event ; + + unsigned int temp_handle = -1; + //... + eventClass = event->EventClass; + eventType = event->EventType; + requestId = event->RequestId; + status = event->Status; + EventData = event->pData; + + switch (EventType) + { + case TAPI_EVENT_SIM_ISIM_AUTHENTICATION_CNF: + printf("TAPI_EVENT_SIM_ISIM_AUTHENTICATION_CNF"); + break; + //... + } +} +@endcode +@} +@defgroup Use_Cases5_27 SIM NOTIFICATION MESSAGE +@ingroup Use_Cases5_NETWORK +@{ + + +

SIM NOTIFICATION MESSAGE

+These are not APIs, but EVENTs from the low layer. User can receive the following events: +@code +TAPI_EVENT_SIM_STATUS_IND +TAPI_EVENT_SIM_FDN_STATUS_IND +@endcode + +Application uses this event as follows. +SAMPLE CODE +@code +#include +#include +#include "TapiCommon.h" + +//SUBSCRIBE FOR EVENTS AS MENTIONED IN Event Register and Deregister + +//CALLBACK FUNCTION TO BE USED +static void app_callback (TelTapiEvent_t *event) +{ + int eventClass; + int eventType; + int requestId; + int status; + void* EventData = NULL; + + TelTapiEvent_t *sim_event = (TelTapiEvent_t*) event ; + + unsigned int temp_handle = -1; + //... + eventClass = event->EventClass; + eventType = event->EventType; + requestId = event->RequestId; + status = event->Status; + EventData = event->pData; + + switch (EventType) + { + case TAPI_EVENT_SIM_STATUS_IND: + printf("***********TAPI_EVENT_SIM_STATUS_IND**************"); + + if (status == TAPI_SIM_STATUS_CARD_ERROR) + { + printf("SIM CARD ERROR"); + } + else if (status == TAPI_SIM_STATUS_CARD_NOT_PRESENT) + { + printf("SIM CARD NOT INSERTED"); + } + else if (status == TAPI_SIM_STATUS_SIM_INITIALIZING) + { + printf("SIM INITITIALIZING"); + } + else if (status == TAPI_SIM_STATUS_SIM_INIT_COMPLETED) + { + printf("SIM INIT COMPLETED"); + } + else if (status == TAPI_SIM_STATUS_SIM_PIN_REQUIRED) + { + printf("SIM PIN REQUIRED"); + } + else if (status == TAPI_SIM_STATUS_SIM_PUK_REQUIRED) + { + printf("SIM PUK REQUIRED"); + } + else if (status == TAPI_SIM_STATUS_CARD_BLOCKED) + { + printf("SIM CARD BLOCKED"); + } + printf("********************************************"); + break; + + case TAPI_EVENT_SIM_FDN_STATUS_IND: + printf("*********TAPI_EVENT_SIM_FDN_STATUS_IND***********"); + printf("SIM FDN status event status = [0x%x]", status); + printf("********************************************"); + break; + //... + } +} +@endcode +@} + +

SOUND

+[Note] Telephony Emulator does not support this feature. +These APIs provide the interface for configuring sound related parameters. + +@defgroup Use_Cases6_1 Event Register and Deregister +@ingroup Use_Cases6_SOUND +@{ + + +

Event Register and Deregister

+To receive asynchronous event notifications for the Sound APIs, the registration of related events with their associated call backs is required. When an asynchronous API is called, the confirmation is returned as an asynchronous event notification which invokes the callback function along with the event data. + +SAMPLE CODE: +@code +// REGISTER EVENT +unsigned int subscription_id = 0; +int api_err; + +api_err = tel_init (); +if (api_err != TAPI_API_SUCCESS) +{ + TEST_DEBUG("tel_init Failed - api_err = %d \n", api_err); +} + +api_err = tel_register_event (TAPI_EVENT_SOUND_VOLUMECTRL_CNF, &subscription_id, (TelAppCallback)&app_callback); +printf("VSOUND Event registration is Done: sub id is %d, api_err is %d\n",subscription_id,api_err); + +tel_register_app_name("org.tizen.appname"); + +// DEREGISTER EVENT +api_err = tel_deregister_event (subscription_id); +if (api_err != TAPI_API_SUCCESS) +{ + printf("Event Class Deregestration Fail\n"); +} +@endcode + +The main features provided by the Sound APIs include setting the volume,voice path and user configuration such as minute alert,Service change,Connet tone, Disconnect Tone...etc. +@} +@defgroup Use_Cases6_2 Voice path control +@ingroup Use_Cases6_SOUND +@{ + + +

Voice path control

+This API provides an interface for controlling voice path via application. + +@code +int tel_set_sound_path (tapi_sound_audio_path_t vc_path, int *pRequestId); +@endcode + +@} +@defgroup Use_Cases6_3 Volume control +@ingroup Use_Cases6_SOUND +@{ + + +

Volume control

+These APIs provide interfaces for controlling volume via application. + +@code +int tel_set_sound_volume_info (tapi_sound_volume_control_t vol_control, int *pRequestId); +int tel_get_sound_volume_info (tapi_sound_volume_type_t vol_control, int *pRequestId); +@endcode + +@} +@defgroup Use_Cases6_4 Mic mute control +@ingroup Use_Cases6_SOUND +@{ + + +

Mic mute control

+This API provides an interface for mute/unmute mic via application. + +@code +int tel_set_sound_mute_status(tapi_sound_mic_mute_t micmute_set, int * pRequestId); +@endcode + + +SAMPLE CODE +@code +#include +#include +#include + +//SUBSCRIBE FOR EVENTS AS MENTIONED IN Event Register and Deregister + +//VOLUME CONTROL +void vol_controlset() +{ + int ret_val; + int requestId = -1; + tapi_sound_volume_control_t vol_control; + + vol_control.volume = TAPI_SOUND_VOLUME_LEVEL_3; + vol_control.vol_type = TAPI_SOUND_VOL_VOICE; + + ret_val = tel_set_sound_volume_info(vol_control, &requestId); + if (ret_val == TAPI_API_SUCCESS) + printf("successful\n"); + else + printf("error=%d\n", ret_val); + //WAIT FOR EVENT HERE +} +void vol_controlget() +{ + int ret_val; + int requestId = -1; + api_sound_volume_type_t vol_type; + vol_type = TAPI_SOUND_VOL_VOICE; + + ret_val = tel_get_sound_volume_info (vol_type, &requestId); + if (ret_val == TAPI_API_SUCCESS) + printf("successful\n"); + else + printf("error=%d\n", ret_val); + //WAIT FOR EVENT HERE +} + +//VOICE PATH AND USER CONFIGURATION +void voicepathset() +{ + int ret_val; + int requestId = -1; + + tapi_sound_audio_path_t vc_path; + //VOICE PATH + vc_path = TAPI_SOUND_HANDSET; + + ret_val = tel_set_sound_path (vc_path, &requestId); + if (ret_val == TAPI_API_SUCCESS) + printf("successful\n"); + else + printf("error=%d\n", ret_status); + //WAIT FOR EVENT HERE +} + + +//USER CONFIGURATION +void usr_configset() +{ + int ret_val; + Int requestId = -1; + tapi_sound_user_sound_mask_t snd_mask; + tapi_sound_user_sound_value_t snd_value; + + snd_mask = TAPI_SOUND_USER_MASK_ONE_MIN_ALERT; + snd_value = TAPI_SOUND_ON; + printf("tapi_sound_usr_configuration_set\n"); + ret_val = tapi_sound_usr_configuration_set(snd_mask,snd_value, &requestId); + if (ret_val == TAPI_API_SUCCESS) + printf("successful\n"); + else + printf("error=%d\n", ret_status); + //WAIT FOR EVENT HERE +} + +void usr_configget() +{ + int ret_val; + tapi_sound_user_sound_mask_t snd_mask; + + snd_mask = TAPI_SOUND_USER_MASK_SERVICE_CHANGE_ALERT; + printf("tel_get_sound_mute_status \n"); + ret_val = tel_get_sound_mute_status(snd_mask, &requestId); + if (ret_val == TAPI_API_SUCCESS) + printf("successful\n"); + else + printf("error=%d\n", ret_status); + //WAIT FOR EVENT HERE +} + +//MIC MUTE CONT\ROL +void micmute_controlset() +{ + int ret_val; + tapi_sound_mic_mute_t set_micmute; + + set_micmute = TAPI_SOUND_MIC_MUTE; + + printf(" tel_set_sound_mute_status \n"); + ret_val = tel_set_sound_mute_status (set_micmute, &requestId); + if (ret_val == TAPI_API_SUCCESS) + printf("successful\n"); + else + printf("error=%d\n", ret_status); + //WAIT FOR EVENT HERE +} + + +//CALL BACK TO BE USED +static void app_callback (TelTapiEvent_t *event) +{ + int eventClass; + int eventType; + int requestId; + int status; + void* EventData = NULL; + + unsigned int temp_handle = -1; + // + eventClass = event->EventClass; + eventType = event->EventType; + requestId = event->RequestId; + status = event->Status; + EventData = event->pData; + + //TEST_DEBUG("Class:[%d], Event Type:[%d], RequestId:[%d], Status:[%d]\n", eventClass, eventType , requestId, status ); + + if (status != 0) + { + //TEST_DEBUG("******This is nonzero status. ******\n"); + return; + } + + + switch (eventClass) + { + case TAPI_EVENT_CLASS_SOUND: + switch (eventType) + { + case TAPI_EVENT_SOUND_VOLUMECTRL_RSP : + printf("*** TAPI_EVENT_SOUND_VOLUMECTRL_RSP received : %x ****\n", eventType); + tapi_sound_volumn_ctrl_res vlm_ctrl_info; + int index; + + memcpy(&vlm_ctrl_info, event->pData, + sizeof(tapi_sound_volumn_ctrl_res)); + break; + + case TAPI_EVENT_SOUND_AUDIOPATHCTRL_NOTI: + tapi_sound_audio_path_t AudioPath = 0; + int OldSndOutPath = MM_SOUND_PATH_NONE; + AudioPath = *((tapi_sound_audio_path_t *)(event->pData)); + printf("*** TAPI_EVENT_SOUND_AUDIOPATHCTRL_NOTI received : %x ****\n", eventType); + break; + + case TAPI_EVENT_SOUND_AUDIOSOURCECTRL_NOTI: + tapi_sound_audio_source_type_t *pAudioSrcCtrl = NULL; + pAudioSrcCtrl = (tapi_sound_audio_source_type_t*)(event->pData); + printf("*** TAPI_EVENT_SOUND_AUDIOSOURCECTRL_NOTI received : %x ****\n", eventType); + break; + + case TAPI_EVENT_SOUND_ERROR_IND: + tapi_phone_err_t errorCause; + errorCause = *(( tapi_phone_err_t *)(event->pData)); + printf("*** TAPI_EVENT_SOUND_ERROR_IND received : %x ****\n", eventType); + break; + + case TAPI_EVENT_SOUND_MICMUTECTRL_RSP: + tapi_sound_mic_mute_t *mute_status = NULL; + mute_status = (tapi_sound_audio_source_type_t*)(event->pData); + + printf("*** TAPI_EVENT_SOUND_MICMUTECTRL_RSP received : %x ****\n", eventType); + break; + + default: + printf("*** Default Event %x ****\n", eventType); + break; + } + //... + break; + + default: + printf("*** Other TAPI EVENT received : class : %x ****\n", eventClass); + break; + } +} +@endcode +@} + + +

SAT (SIM Application Toolkit)

+@defgroup Use_Cases7_1 Event register and deregister +@ingroup Use_Cases7_SAT +@{ + +

Event register and deregister

+To receive asynchronous event notifications for SAT APIs, the registration of related events with their associated call backs is required. When an asynchronous API is called, the confirmation is returned as an asynchronous event notification which invokes the callback function along with the event data. + +SAMPLE CODE +@code +// REGISTER EVENT +unsigned int subscription_id = 0; +int api_err; + +api_err = tel_init(); +if (api_err != TAPI_API_SUCCESS) +{ + TEST_DEBUG("tel_init Failed - api_err = %d \n", api_err); +} + +api_err = tel_register_event(TAPI_EVENT_SAT_MENU_SELECTION_CNF, &subscription_id, (TelAppCallback)&app_callback); +printf("SAT Event registration is Done: sub id is %d, api_err is %d\n",subscription_id,api_err); + +tel_register_app_name("org.tizen.appname"); + +// DEREGISTER EVENT +api_err = tel_deregister_event(subscription_id); +if (api_err != TAPI_API_SUCCESS) +{ + printf("Event Class Unregeration Fail\n"); +} + +api_err = tel_deinit(); +if (api_err != TAPI_API_SUCCESS) +{ + printf("tel_deinit Fail\n"); +} + +static void app_callback(TelTapiEvent_t *event) +{ + //CALL BACK FUNTION TO BE CALLED + switch (event->EventType) + { + case TAPI_EVENT_SAT_DISPLAY_TEXT_IND: + TelSatDisplayTextInd_t *event_data; + event_data = (TelSatDisplayTextInd_t*)event->pData; + break; + case TAPI_EVENT_SAT_GET_INKEY_IND: + TelSatGetInkeyIndInfo_t *event_data; + event_data = (TelSatGetInkeyIndInfo_t *)event->pData; + break; + case TAPI_EVENT_SAT_GET_INPUT_IND: + TelSatGetInputInd_t *event_data; + event_data = (TelSatGetInputInd_t *)event->pData; + break; + + case TAPI_EVENT_SAT_UI_PLAY_TONE_IND: + TelSatPlayToneInd_t *event_data; + event_data = (TelSatPlayToneInd_t *)event->pData; + break; + + case TAPI_EVENT_SAT_PLAY_TONE_IND: + TelSatPlayToneInd_t *event_data; + event_data = (TelSatPlayToneInd_t *)event->pData; + break; + + case TAPI_EVENT_SAT_UI_REFRESH_IND: + TelSatRefreshIndUiInfo_t *event_data; + event_data = (TelSatRefreshIndUiInfo_t *)event->pData; + break; + + case TAPI_EVENT_SAT_SETUP_MENU_IND: + TelSatSetupMenuInfo_t *event_data; + event_data = (TelSatSetupMenuInfo_t *)event->pData; + break; + + case TAPI_EVENT_SAT_UI_SETUP_MENU_IND: + TelSatSetupMenuInfo_t *event_data; + event_data = (TelSatSetupMenuInfo_t *)event->pData; + break; + + case TAPI_EVENT_SAT_SELECT_ITEM_IND: + TelSatSelectItemInd_t *event_data; + event_data = (TelSatSelectItemInd_t *)event->pData; + break; + + case TAPI_EVENT_SAT_UI_SEND_SMS_IND: + TelSatSendSmsIndUiInfo_t *event_data; + event_data = (TelSatSendSmsIndUiInfo_t *)event->pData; + break; + + case TAPI_EVENT_SAT_UI_SEND_SS_IND: + TelSatSendSsIndUiInfo_t *event_data; + event_data = (TelSatSendSsIndUiInfo_t *)event->pData; + break; + + case TAPI_EVENT_SAT_UI_SEND_USSD_IND: + TelSatSendUssdIndUiInfo_t *event_data; + event_data = (TelSatSendUssdIndUiInfo_t *)event->pData; + break; + + case TAPI_EVENT_SAT_UI_SETUP_CALL_IND: + TelSatSetupCallIndUiInfo_t *event_data; + event_data = (TelSatSetupCallIndUiInfo_t *)event->pData; + break; + + case TAPI_EVENT_SAT_PROVIDE_LOCAL_INFO_IND: + TelSatProvideLocalInfoInd_t *event_data; + event_data = (TelSatProvideLocalInfoInd_t *)event->pData; + break; + + case TAPI_EVENT_SAT_SETUP_IDLE_MODE_TEXT_IND: + TelSatSetupIdleModeTextInd_t *event_data; + event_data = (TelSatSetupIdleModeTextInd_t *)event->pData; + break; + + case TAPI_EVENT_SAT_UI_SEND_DTMF_IND: + TelSatSendDtmfIndUiInfo_t *event_data; + event_data = (TelSatSendDtmfIndUiInfo_t *)event->pData; + break; + + case TAPI_EVENT_SAT_LANGUAGE_NOTIFICATION_IND: + TelSatLanguageNotiInfoInd_t *event_data; + event_data = (TelSatLanguageNotiInfoInd_t *)event->pData; + break; + + case TAPI_EVENT_SAT_UI_LAUNCH_BROWSER_IND: + TelSatLaunchBrowserIndUiInfo_t *event_data; + event_data = (TelSatLaunchBrowserIndUiInfo_t *)event->pData; + break; + + case TAPI_EVENT_SAT_END_PROACTIVE_SESSION_IND: + TelSatEndProactiveSessionIndInfo_t *event_data; + event_data = (TelSatEndProactiveSessionIndInfo_t *)event->pData; + break; + + case TAPI_EVENT_SAT_MENU_SELECTION_CNF: + TelSatEnvelopeResp_t *event_data; + event_data = (TelSatEnvelopeResp_t *)event->pData; + break; + + case TAPI_EVENT_SAT_CALL_CONTROL_IND: + TelSatCallCtrlIndData_t *event_data; + event_data = (TelSatCallCtrlIndData_t *)event->pData; + break; + + case TAPI_EVENT_SAT_MO_SMS_CONTROL_IND: + TelSatMoSmCtrlIndData_t *event_data; + event_data = (TelSatMoSmCtrlIndData_t *)event->pData; + break; + + case TAPI_EVENT_SAT_EVENT_DOWNLOAD_CNF: + TelSatEnvelopeResp_t *event_data; + event_data = (TelSatEnvelopeResp_t *)event->pData; + break; + + case TAPI_EVENT_SAT_SMS_REFRESH_IND: + case TAPI_EVENT_SAT_PB_REFRESH_IND: + case TAPI_EVENT_SAT_IDLE_REFRESH_IND: + TelSatRefreshInd_t *event_data; + event_data = (TelSatRefreshInd_t *)event->pData; + break; + + case TAPI_EVENT_SAT_SEND_SMS_IND: + TelSatSendSmsIndSmsData_t *event_data; + event_data = (TelSatSendSmsIndSmsData_t *)event->pData; + break; + + case TAPI_EVENT_SAT_SETUP_CALL_IND: + TelSatSetupCallIndCallData_t *event_data; + event_data = (TelSatSetupCallIndCallData_t *)event->pData; + break; + + case TAPI_EVENT_SAT_SEND_SS_IND: + TelSatSendSsIndSsData_t *event_data; + event_data = (TelSatSendSsIndSsData_t *)event->pData; + break; + + case TAPI_EVENT_SAT_SEND_USSD_IND: + TelSatSendUssdIndUssdData_t *event_data; + event_data = (TelSatSendUssdIndUssdData_t *)event->pData; + break; + + case TAPI_EVENT_SAT_SEND_DTMF_IND: + TelSatSendDtmfIndDtmfData_t *event_data; + event_data = (TelSatSendDtmfIndDtmfData_t *)event->pData; + break; + + case TAPI_EVENT_SAT_LAUNCH_BROWSER_IND: + TelSatLaunchBrowserIndBrowserData_t *event_data; + event_data = (TelSatLaunchBrowserIndBrowserData_t *)event->pData; + break; + + case TAPI_EVENT_SAT_END_OF_APP_EXEC_IND: + TelSatProactiveCmdEndIndInfo_t *event_data; + event_data = (TelSatProactiveCmdEndIndInfo_t *)event->pData; + break; + + default: + break; + } +} +@endcode +@} +@defgroup Use_Cases7_2 Main Menu Information +@ingroup Use_Cases7_SAT +@{ + + +

Main Menu Information

+[Note] Telephony Emulator does not support this feature. + +Telephony provides APIs for retreiving SAT Main Menu Information. + + +@code +int tel_get_sat_main_menu_info(TelSatSetupMenuInfo_t* pMainMenu) +@endcode + +SAMPLE CODE: +@code +//SAT MAIN MENU INFORMATION +#include +#include +#include + +void mainmenuinformation() +{ + int i = 0; + int ReturnStatus; + TelSatSetupMenuInfo_t SatMainMenuInfo; + + ReturnStatus = tel_get_sat_main_menu_info(&SatMainMenuInfo); + if (ReturnStatus == TAPI_API_SUCCESS) + { + printf(" SAT Main Menu Information \n"); + printf("Main Menu Title :%s\n", satMainMenuInfo.satMainTitle); + printf("Number of SAT Menu Items :%d\n", satMainMenuNum); + printf("Sat Menu Items are:\n"); + for (i=0; iEnvelope Commands +[Note] Telephony Emulator does not support this feature. + +This API sends a USIM application toolkit command to the USIM, using the envelope mechanism of USIM application toolkit. (See GSM TS 31.111) + + +@code +int tel_select_sat_menu(TelSatMenuSelectionReqInfo_t* pMenuSelect, int* pRequestId); +int tel_download_sat_event(TelSatEventDownloadReqInfo_t* pEventData, int* pRequestId); +@endcode + +SAMPLE CODE: +@code +//MENU SELECTION ENVELOPE +#include +#include +#include + +//Precondition +//SUBSCRIBE TO SAT EVENT(TAPI_EVENT_SAT_MENU_SELECTION_CNF) AS MENTIONED IN //Event Register and Deregister + +void satmenuselectionenvelope() +{ + int RequestId = -1; + int ReturnStatus; + TelSatMenuSelectionReqInfo_t SatMenuSelect; + + SatMenuSelect.itemIdentifier = 1; + SatMenuSelect.bIsHelpRequested = FALSE; + + ReturnStatus = tel_select_sat_menu(&SatMenuSelect, &RequestId); + if (ReturnStatus != TAPI_API_SUCCESS) + { + printf("ReturnStatus =%d\n", ReturnStatus); + } + else + { + //WAIT FOR TAPI_EVENT_SAT_MENU_SELECTION_CNF EVENT HERE + } +} + +//CALLBACK FUNCTION TO BE USED +static void SatAppCallback (TelTapiEvent_t *event) +{ + int EventClass = event->EventClass; + int EventType = event->EventType; + int RequestId = event->RequestId; + void* EventData = event->pData; + int Status = event->Status; + + if (EventType == TAPI_EVENT_SAT_MENU_SELECTION_CNF) + { + printf(" TAPI_EVENT_SAT_MENU_SELECTION_CNF Event Received \n"); + } +} +@endcode + +@code +//EVENT DOWNLOAD ENVELOPE +#include +#include +#include + + +//Precondition +//SUBSCRIBE TO SAT EVENT(TAPI_EVENT_SAT_EVENT_DOWNLOAD_CNF) AS MENTIONED IN //Event Register and Deregister +void eventdownloadenvelope() +{ + int RequestId = -1; + int ReturnStatus; + TelSatEventDownloadReqInfo_t SatEventData; + + SatEventData.eventDownloadType = TAPI_EVENT_SAT_DW_TYPE_IDLE_SCREEN_AVAILABLE; + + SatEventData.u.bIdleScreenAvailable = TRUE; + + ReturnStatus = tel_download_sat_event(&SatEventData, &RequestId); + if (ReturnStatus != TAPI_API_SUCCESS) + { + printf("ReturnStatus =%d\n", ReturnStatus); + } + else + { + //WAIT FOR TAPI_EVENT_SAT_EVENT_DOWNLOAD_CNF EVENT HERE + } +} + +//CALLBACK FUNCTION TO BE USED +static void SatAppCallback (TelTapiEvent_t *event) +{ + int EventClass = event->EventClass; + int EventType = event->EventType; + int RequestId = event->RequestId; + void* EventData = event->pData; + int Status = event->Status; + + if (EventType == TAPI_EVENT_SAT_EVENT_DOWNLOAD_CNF) + { + printf("TAPI_EVENT_SAT_EVENT_DOWNLOAD_CNF Event Received \n"); + //Extract Event Data here + } +} +@endcode +@} +@defgroup Use_Cases7_4 Application Execution result +@ingroup Use_Cases7_SAT +@{ + + +

Application Execution result

+[Note] Telephony Emulator does not support this feature. + +Telephony provides this API to get the Application execution result. + + +@code +Int tel_send_sat_app_exec_result(TelSatAppsRetInfo_t* pAppRetInfo); +@endcode + +SAMPLE CODE: +@code +//SAT MAIN MENU TITLE +#include +#include +#include + +void sendappexecutionresult() +{ + int ReturnStatus; + TelSatAppsRetInfo_t SatAppRetInfo; + + SatAppRetInfo.commandType = TAPI_SAT_CMD_TYPE_SETUP_IDLE_MODE_TEXT; + SatAppRetInfo.appsRet.setupIdleModeText.resp = TAPI_SAT_R_SUCCESS; + + ReturnStatus = tel_send_sat_app_exec_result(&SatAppRetInfo); + if (ReturnStatus == TAPI_API_SUCCESS) + { + printf(" Sending Application Execution Result Successful \n"); + } + else + printf("ReturnStatus =%d\n", ReturnStatus); +} +@endcode +@} +@defgroup Use_Cases7_5 UI /User Confirmation +@ingroup Use_Cases7_SAT +@{ + + +

UI /User Confirmation

+[Note] Telephony Emulator does not support this feature. + +Send user’s confirmation message to the USIM application + + +@code +int tel_send_sat_ui_display_status(int commandId, TelSatUiDisplayStatusType_t status); +int tel_send_sat_ui_user_confirm(TelSatUiUserConfirmInfo_t * pUserConfirmData) ; +@endcode + +SAMPLE CODE: +@code +//UI DISPLAY STATUS +#include +#include +#include + +void senduidisplaystatus() +{ + int ReturnStatus; + TelSatUiDisplayStatusType_t DisplatStatus; + int CommandId; + + DisplatStatus = TAPI_SAT_DISPLAY_SUCCESS; + CommandId = commandId; //Command Id of the Proactive Command + + ReturnStatus = tel_send_ui_display_status(CommandId, DisplayStatus); + if (ReturnStatus == TAPI_API_SUCCESS) + printf(" Sending UI Display Status Successful \n"); + else + printf("ReturnStatus =%d\n", ReturnStatus); +} +@endcode + +@code +//USER CONFIRMATION +#include +#include +#include + +void senduiuserconfirm() +{ + int ReturnStatus; + TelSatUiUserConfirmInfo_t UserConfirmData; + + UserConfirmData.commandId = commandId ; //Command Id of the Proactive Command + + UserConfirmData.commandType = TAPI_SAT_CMD_TYPE_PLAY_TONE; + UserConfirmData.keyType = TAPI_SAT_USER_CONFIRM_YES; + + UserConfirmData.pAdditionalData = NULL; + UserConfirmData.dataLen = 0; + + ReturnStatus = tel_send_sat_ui_user_confirm(&UserConfirmData); + if (ReturnStatus == TAPI_API_SUCCESS) + printf(" Sending User Confirmation Data Successful \n"); + else + printf("ReturnStatus =%d\n", ReturnStatus); +} +@endcode +@} + + +

GPRS

+@defgroup Use_Cases8_1 Event Register and Deregister +@ingroup Use_Cases8_GPRS +@{ + +

Event Register and Deregister

+To receive asynchronous event notifications for GPRS APIs, the registration of related events with their associated call backs is required. When an asynchronous API is called, the confirmation is returned as an asynchronous event notification which invokes the callback function along with the event data. + +SAMPLE CODE: +@code +// REGISTER EVENT +unsigned int subscription_id = 0; +int api_err; + +api_err = tel_init(); +if (api_err != 0) +{ + printf ("tel_init Failed - api_err = %d \n", api_err); +} + +api_err = tel_register_event(TAPI_EVENT_PS_PDP_ACT_RSP, &subscription_id , (TelAppCallback)&app_callback); +printf("Power Event registeration is Done: sub id is %d, api_err is %d\n", subscription_id, api_err); + +tel_register_app_name("org.tizen.appname"); + +void app_callback(TelTapiEvent_t *event) +{ + //callback function to be called +} +@endcode +@} +@defgroup Use_Cases8_2 Pdp Activation +@ingroup Use_Cases8_GPRS +@{ + + +

Pdp Activation

+This API is used to start a GPRS session successfully. + +@code +int tel_activate_gprs_pdp (const tapi_ps_net_start_req_t *pNet_start_req_info,int * pRequestID); +@endcode + +This API is restricted for direct use. Use the Data Network API instead. + +SAMPLE CODE +@code +#include +#include +#include + +int ret_status; +tapi_ps_net_start_req_t start_req; +int request_id = 0; + +#define CONTEXT_ID 1 +#define APN_ADDRESS "nate.sktelecom.com" + +void gprsstart() +{ + int ret_status; + tapi_ps_net_start_req_t start_req; + int request_id = 0; + + start_req.cont_id = CONTEXT_ID; + strcpy(start_req.pdp_info.apn , APN_ADDRESS); + + ret_status = tel_activate_gprs_pdp (&start_req, &request_id); + if (ret_status == TAPI_API_SUCCESS) + { + printf("/n/ gprs mode Started successfully \\n"); + } + else + { + printf("/n/ gprs mode not started \\n"); + } +} +//WAIT FOR EVENT HERE + +//CALLBACK FUNCTION TO BE USED +void ps_app_callback (TelTapiEvent_t *event) +{ + int eventClass; + int eventType; + int requestId; + int status; + void *EventData = NULL; + + eventClass = event->EventClass; + eventType = event->EventType; + requestId = event->RequestId; + status = event->Status; + EventData = event->pData; + printf(" app _callback is called \n"); + + switch (eventClass) + { + case TAPI_EVENT_CLASS_DATA: + switch (eventType) + { + case TAPI_EVENT_PS_PDP_ACT_RSP: + tapi_ps_net_activation_rsp_t pdp_ip_resp; + memcpy(&pdp_ip_resp, psEvent->pData, sizeof(tapi_ps_net_activation_rsp_t)); + printf("TAPI_EVENT_PS_PDP_ACT_RSP\n"); + break; + + case TAPI_EVENT_PS_PDP_ACT_IPCONFIG_INFO: + tapi_ps_net_start_rsp_t pdp_ip_resp; + memcpy(&pdp_ip_resp, psEvent->pData, sizeof(tapi_ps_net_start_rsp_t)); + + case TAPI_EVENT_PS_STATUS: + tapi_ps_attach_response_t res; + memcpy(&res, psEvent->pData, sizeof(tapi_ps_attach_response_t)); + } + } +} +@endcode +@} +@defgroup Use_Cases8_3 Check PDP Signal line On +@ingroup Use_Cases8_GPRS +@{ + + +

Check PDP Signal line On

+This API is used to check whether the PDP siganl line is on or not. + +Precondition: +@n GPRS session should be started before running this API. + +@code +int tel_control_gprs_btdun_pin (tapi_ps_btdun_pincontrol pincontrol,int * pRequestID); +@endcode + +This API is restricted for direct use. Use the Data Network API instead. + +SAMPLE CODE +@code +#include +#include +#include + +void pdpbtduncontrolget() +{ + int ret_status; + int request_id = 0; + tapi_ps_btdun_pincontrol bt_control; + + bt_control.signal = GPRS_SIGNAL_DCD ; + bt_control.status = GPRS_SIGNAL_STATUS_OFF; + + ret_status = tel_control_gprs_btdun_pin(bt_control, &request_id) ; + if (ret_status == TAPI_API_SUCCESS) + { + printf("/n/ Successful \\n"); + } + else + { + printf("/n/error:%d \n", ret_status); + } +} +//WAIT FOR EVENT HERE + +//CALLBACK FUNCTION TO BE USED +void ps_app_callback (TelTapiEvent_t *event) +{ + int eventClass; + int eventType; + int requestId; + int status; + void *EventData = NULL; + + eventClass = event->EventClass; + eventType = event->EventType; + requestId = event->RequestId; + status = event->Status; + EventData = event->pData; + printf(" app _callback is called \n"); + + switch (eventClass) + { + case TAPI_EVENT_CLASS_DATA: + switch (eventType) + { + case TAPI_EVENT_PS_BTDUN_PINCONTROL_NOTI: + tapi_ps_btdun_pincontrol pincontrol; + memcpy(&pincontrol, psEvent->pData, sizeof(tapi_ps_btdun_pincontrol)); + printf("TAPI_EVENT_PS_BTDUN_PINCONTROL_NOTI\n"); + break; + } + } +} +@endcode +@} +@defgroup Use_Cases8_4 Set PDP deactivation +@ingroup Use_Cases8_GPRS +@{ + + +

Set PDP deactivation

+This API is used to deactivate the PDP service. + +Precondition: +@n GPRS session must be started before executing this API. + +@code +int tel_deactivate_gprs_pdp (const tapi_ps_net_stop_req_t *net_stop_req_info,int * pRequestID); +@endcode + +This API is restricted for direct use. Use the Data Network API instead. + +SAMPLE CODE +@code +#include +#include +#include + +#define CONTEXT_ID 1 + +void setpdpdeactivation() +{ + int ret_status; + tapi_ps_net_stop_req_t end_req; + int request_id = 0; + + memset(&end_req, 0, sizeof(tapi_ps_net_stop_req_t)); + + end_req.cont_id = CONTEXT_ID; + + ret_status = tel_deactivate_gprs_pdp (&end_req, &request_id); + if (ret_status == TAPI_API_SUCCESS) + { + printf("/n/ gprs active session ended successfully \\n"); + } + else + { + printf("/n/ gprs active session not ended \\n"); + } +} +//WAIT FOR EVENT HERE + +//CALLBACK FUNCTION TO BE USED +void ps_app_callback (TelTapiEvent_t *event) +{ + int eventClass; + int eventType; + int requestId; + int status; + void *EventData = NULL; + + eventClass = event->EventClass; + eventType = event->EventType; + requestId = event->RequestId; + status = event->Status; + EventData = event->pData; + printf(" app _callback is called \n"); + + switch (eventClass) + { + case TAPI_EVENT_CLASS_DATA: + switch (eventType) + { + case TAPI_EVENT_PS_PDP_DEACT_IND: + tapi_ps_net_stop_rsp_t* pdp_stop_resp; + memcpy(pdp_stop_resp, psEvent->pData, sizeof(tapi_ps_net_stop_rsp_t)); + printf("TAPI_EVENT_PS_PDP_DEACT_IND\n"); + break; + + case TAPI_EVENT_PS_CALL_STATISTICS: + tapi_ps_call_statistics_t call_stats; + memcpy(&call_stats, psEvent->pData, + sizeof(tapi_ps_call_statistics_t)); + break; + } + break; + } + break; +} +@endcode +@} +@defgroup Appendixes1 Appendix A. Sample Codes +@ingroup Appendix +@{ +

Appendixes

+

Appendix A. Sample Codes

+Some reference sample code is attached to help the application developer understand the telephony Framework Module + +How to use supplementary service APIs and handle SS events +@code +#include +#include +#include +#include + +GMainLoop *nw_context_loop = NULL; + +typedef struct +{ + int group; + int type; + int len; + void *dst; +} data_t; + +static int SS_Callback(int eventClass, int eventType, void * param2) +{ + int i; + printf ("\n\n\n SS_Callback is called! eventClass : %d\n, eventType : %d\n", eventClass, eventType); + fflush(stdout); + switch (eventType) + { + case TAPI_EVENT_SS_REL_COMP_MSG_NOTIFY: + if (param2 != NULL) { + int x = 0; + TelSsRelCompMsgInfo_t rel_comp_msg; + memcpy(&rel_comp_msg, (TelSsRelCompMsgInfo_t *)param2, + sizeof(TelSsRelCompMsgInfo_t)); + printf("Printing the Release Complete Message \n"); + + for (x=0; xEventClass; + eventType = event->EventType; + requestId = event->RequestId; + status = event->Status; + EventData = event->pData; + //TEST_DEBUG("Class:[%d], Event Type:[%d], RequestId:[%d], Status:[%d] \n", eventClass, eventType , requestId, status ); + if (status != 0) + { + //TEST_DEBUG("******This is nonzero status. ******\n"); + return; + } + SS_Callback((int)eventClass, (int)eventType, EventData); +} + +ss_test_subscribe_tapi_events() +{ + //REGISTER EVENT + unsigned int subscription_id = 0; + TapiResult_t api_err; + + api_err = TelTapiInit(); + if (api_err != TAPI_API_SUCCESS) + { + printf("TelTapiInit Failed - api_err = %d \n", api_err); + } + api_err = TelTapiRegisterEvent(TAPI_EVENT_SS_WAITING_CNF, &subscription_id, (TelAppCallback)&app_callback); + printf("SS Class registeration is Done: sub id is %d, api_err is %d\n",subscription_id,api_err); + fflush(stdout); +} + +noti_finish() +{ + //DEREGISTER EVENT + unsigned int subscription_id = 0; + TapiResult_t api_err; + + api_err = tel_deregister_event(subscription_id); + if (api_err != TAPI_API_SUCCESS) + { + printf("Event Class Unregeration Fail\n"); + } +} + +tapi_ss_call_barr() +{ + TapiResult_t ret_status; + TelSsCallBarringInfo_t pBarringInfo; + int pRequestId = 0; + char *bar_pwd = "0000"; + + printf("Before copying ,,,length is %d\n", strlen(pBarringInfo.szPassword)); + printf("len initially is %d\n", strlen(bar_pwd)); + + pBarringInfo.Mode = TAPI_SS_CALL_BAR_ACTIVATE; + pBarringInfo.Type = TAPI_CALL_BARRING_ALL_OUTGOING_CALLS;//TAPI_CALL_BARRING_ALL_OUTGOING_INTERN_CALL; + pBarringInfo.CallType = TAPI_CALL_TYPE_VOICE_EV; + strcpy(pBarringInfo.szPassword, bar_pwd); + printf("length is %d\n", strlen(pBarringInfo.szPassword)); + ret_status = tel_set_ss_barring(&pBarringInfo, &pRequestId); + if (ret_status != TAPI_API_SUCCESS) { + return; + } + + nw_context_loop = g_main_loop_new(NULL, FALSE); + g_main_loop_run(nw_context_loop); + + + //now , get the status + TelSsCallBarType_t BarType = TAPI_CALL_BARRING_ALL_OUTGOING_INTERN_CALL; + TelSsCallType_t CallType = TAPI_CALL_TYPE_VOICE_EV; + ret_status = tel_get_ss_barring_status(BarType,CallType, &pRequestId); + if (ret_status != TAPI_API_SUCCESS) { + return ; + } + + nw_context_loop = g_main_loop_new(NULL, FALSE); + g_main_loop_run(nw_context_loop); +} + +tapi_ss_call_fwd() +{ + TapiResult_t ret_status; + TelSsForwardInfo_t pForwardInfo; + int len; + int pRequestId = 0; + char *cf_number = "9986529874"; + + pForwardInfo.Mode = TAPI_CALL_FORWARD_MODE_ENABLE_EV; + pForwardInfo.Type = TAPI_CS_FORWARD_TYPE_VOICE_EV; + pForwardInfo.Condition = TAPI_SS_FORWARD_WHEN_UNCONDITIONAL_EV; + pForwardInfo.NoReplyConditionTimer = 10; + + len = strlen(cf_number); + printf("Length of CF number :%d \n", len); + memcpy(&(pForwardInfo.szPhoneNumber), cf_number, len); + ret_status = tel_set_ss_forward(&pForwardInfo, &pRequestId); + if (ret_status != TAPI_API_SUCCESS) { + return ; + } + + nw_context_loop = g_main_loop_new(NULL, FALSE); + g_main_loop_run(nw_context_loop); + + //now , get call forward status + TelSsForwardType_t Type = TAPI_CS_FORWARD_TYPE_VOICE_EV; + TelSsForwardWhen_t Condition = TAPI_SS_FORWARD_WHEN_UNCONDITIONAL_EV; + + // Calling TAPI SS Call Frwd Query Req Status Api + ret_status = tel_get_ss_forward_status(Type,Condition, &pRequestId); + if (ret_status != TAPI_API_SUCCESS) { + return ; + } + + nw_context_loop = g_main_loop_new(NULL, FALSE); + g_main_loop_run(nw_context_loop); +} + +tapi_ss_call_wait() +{ + //set and get call waiting + TapiResult_t ret_status; + TelSsWaitingInfo_t waitInfo; + int RequestID; + + waitInfo.Mode = TAPI_SS_CW_ACTIVATE; + waitInfo.CallType = TAPI_CALL_TYPE_VOICE_EV; + + //set call wait + ret_status = tel_set_ss_waiting(&waitInfo, &RequestID); + if (ret_status != TAPI_API_SUCCESS) { + return; + } + + nw_context_loop = g_main_loop_new(NULL, FALSE); + g_main_loop_run(nw_context_loop); + + sleep(4); + + //now get call wait + TelSsCallType_t CallType = TAPI_CALL_TYPE_VOICE_EV; + ret_status = tel_get_ss_waiting_status(CallType, &RequestID); + if (ret_status != TAPI_API_SUCCESS) { + return; + } + nw_context_loop = g_main_loop_new(NULL, FALSE); + g_main_loop_run(nw_context_loop); +} + +ss_test() +{ + ss_test_subscribe_tapi_events(); + tapi_ss_call_barr(); + tapi_ss_call_fwd(); + tapi_ss_call_wait(); + noti_finish(); +} + +int main(int argc, char *argv[]) +{ + ss_test(); + return 0; +} +@endcode +@} +@defgroup Appendixes2 Appendix B. Error Code +@ingroup Appendix +@{ + +

Appendix B. Error Code

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Error Num.Error CodeError Description
0TAPI_API_SUCCESSNo Error occurred
-1TAPI_API_INVALID_INPUTInput values are not correct in TAPI Library
-2TAPI_API_INVALID_PTRinvalid pointer
-3TAPI_API_NOT_SUPPORTEDThe feature corresponding to requested API is not supported. This may be due to market/network/vendor reasons such as the feature is not available in the network.
-4TAPI_API_DEPRICATED This API is deprecated and will be so in future also
-5TAPI_API_SYSTEM_OUT_OF_MEMOut of memory
-6TAPI_API_SYSTEM_RPC_LINK_DOWNRPC link down
-7TAPI_API_SERVICE_NOT_READY Phone was powered on, but yet to receive the power up completed notification
-8TAPI_API_SERVER_FAILUREerror occurred in Telephony server
-9TAPI_API_OEM_PLUGIN_FAILUREPlug-in layer failure
-10TAPI_API_TRANSPORT_LAYER_FAILURETransport layer Failure
-11TAPI_API_INVALID_DATA_LENInvalid data length
+@} +*/ +/** +* @defgroup TELEPHONY + @{ +* @defgroup Appendix Reference +* @defgroup TELEPHONY_USECASES Use Cases + @{ +* @defgroup Use_Cases1_COMMON COMMON +* @defgroup Use_Cases2_CALL CALL +* @defgroup Use_Cases3_SUPPLEMENTARY_SERVICE SUPPLEMENTARY_SERVICE +* @defgroup Use_Cases4_SMS SMS +* @defgroup Use_Cases5_NETWORK NETWORK_Registration_and_Configuration +* @defgroup Use_Cases6_SOUND SOUND +* @defgroup Use_Cases7_SAT SAT +* @defgroup Use_Cases8_GPRS GPRS + @} + @} +*/ diff --git a/include/common/TapiCommon.h b/include/common/TapiCommon.h new file mode 100644 index 0000000..93ddbd0 --- /dev/null +++ b/include/common/TapiCommon.h @@ -0,0 +1,615 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * 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. + */ + +/** + * @open + * @ingroup TelephonyAPI + * @addtogroup COMMON_TAPI COMMON + * @{ + * + * @file TapiCommon.h + * @brief This file serves as a "C" header file defines functions for Tapi Common Interfaces like Callback Registration / De-registration. \n + It contains a sample set of function prototypes that would be required by applications. + + + */ + +#ifndef _TAPI_COMMON_H_ +#define _TAPI_COMMON_H_ + +/*================================================================================================== + INCLUDE FILES + ==================================================================================================*/ +#include +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/*================================================================================================== + CONSTANTS + ==================================================================================================*/ + +/*================================================================================================== + MACROS + ==================================================================================================*/ + +#define TAPI_EVENT_NAME_MAX_LEN 128 /**< Maximum length of theevent name */ +#define TAPI_REQUEST_NOTI_ID 0xff /**< Request id for notification message */ +#define TAPI_REQUEST_INVALID_ID -1 /**< Invalid request id */ +#define TAPI_DBUS_CONNECTION_NAME_LEN_MAX 255 + +/*================================================================================================== + ENUMS + ==================================================================================================*/ + +/*================================================================================================== + STRUCTURES AND OTHER TYPEDEFS + ==================================================================================================*/ + +/** + *This structure retrieves current application name registered in DBUS. + */ +typedef struct { + char name[TAPI_DBUS_CONNECTION_NAME_LEN_MAX]; /** + * + * int api_err; + * api_err = tel_init(); //initialize telephony api if application use gmain loop + * @endcode + * + * @see tel_register_event tel_deinit + * + * @remarks + * - None. + * + */ +/*================================================================================================*/ +int tel_init(void); + +/** + * @brief This function is used to register the callback function for a specific TAPI Event. + * If Application tries to register a callback for a specific event multiple times, then multiple callbacks will be registered. + * When an event indication is received, then registered callbacks for the specific event will be invoked multiple times. + * + * + * @par Sync (or) Async: + * This is a Synchronous API. + * + * @par Important Notes: + * - Incase Application has registered for multiple callbacks for a event and it wants to have only one callback to be registered + * for that particular event, then Application needs to explicitly deregister the callbacks based on subscription id. + * If Application wants to modify the already registered event with a different callback, then it needs to deregister the already + * registered TAPI event with subscription id received and Application has to register again with a new callback for that TAPI event. + * + * @warning + * + * @param[in] EventType + * - TAPI Event for which the callback registration is required. + * + * @param [out] SubscriptionId + * - An unique identifier identifying the callback registration. + * + * @param[in] AppCallBack + * - Callback which will be invoked when an event occurs for that particular event class. + * + * @param[in] data + * - User data which is passed as the callback parameter + * + * @par Async Response Message: + * - None. + * + * @pre + * - None. + * + * @post + * - None. + * + * @return Return Type (int) \n + * - TAPI_API_SUCCESS - indicating that the operation has completed successfully. \n + * - Else it will return failure and error code (Refer #TapiResult_t) + * + * @par Prospective Clients: + * External Apps. + * + * @code + * #include + * #include + * #include + * #include + * + * void app_callback(TelTapiEvent_t *event); + * // REGISTER EVENT + * void registerevent() + * { + * unsigned int subscription_id = 0; + * int api_err = 0; + * + * api_err = tel_init(); + * if(api_err != 0){ + * printf ("tel_init Failed - api_err = %d \n",api_err); + * } + * api_err = tel_register_event (TAPI_EVENT_CALL_SETUP_CNF , + * &subscription_id, (TelAppCallback)&app_callback); + * printf("MISC Event registeration is Done: sub id is %d, api_err is %d\n", subscription_id, api_err); + * } + * + * void callsetup() + * { + * int ret_status = 0; + * int RequestID = 0; + * unsigned int CallHandle; + * TelCallSetupParams_t Params; + * char *normal = "1234";//Called party number + * + * memset(&Params, 0, sizeof(TelCallSetupParams_t)); + * Params.CallType = TAPI_CALL_TYPE_VOICE; + * strcpy(Params.szNumber, normal); + * + * ret_status = tel_exe_call_mo (&Params, &CallHandle, &RequestID); + * printf ("The return value is %d\n", ret_status); + * + * if (ret_status == 0) + * printf("successful\n"); + * else + * printf("error=%d\n", ret_status); //WAIT FOR EVENT HERE + * } + * + * static void app_callback(TelTapiEvent_t *event) + * { + * int eventClass; + * int eventType; + * int requestId; + * int status; + * void *EventData = NULL; + * + * unsigned int temp_handle = 0; + * eventClass = event->EventClass; + * eventType = event->EventType; + * requestId = event->RequestId; + * status = event->Status; + * EventData = event->pData; + * + * + * if (status != 0) { + * return; + * } + * + * switch (eventType) { + * case TAPI_EVENT_CALL_SETUP_CNF: + * memcpy(&temp_handle, EventData, sizeof(unsigned int)); + * break; + * case TAPI_EVENT_CALL_ALERT_IND: + * memcpy(&temp_handle, event->pData, sizeof(unsigned int)); + * break; + * case TAPI_EVENT_CALL_CONNECTED_IND: + * memcpy(&temp_handle, event->pData, sizeof(unsigned int)); + * break; + * } + * + * // Handle the event data + * ... + * } + * @endcode + * + * @see None. + * + * @remarks + * - None. + * + */ +/*================================================================================================*/ +int tel_register_event(int EventType, unsigned int *SubscriptionId, TelAppCallback AppCallBack, void *data); + +/** + * @brief This function will de-register the application callback registered for the specific event or event class based on the + * subscription id. This identifier is the same subscription identifier which is returned back to the application during + * TAPI registration procedure.If de-register API is called during any service requests, Application registered callback + * will be cleared based on the subscription id. No application callback shall be invoked in case any confirmations/indications + * are received from TS. + * + * + * @par Sync (or) Async: + * This is a Synchronous API. + * + * @par Important Notes: + * - Application has to de-register each registration using subscription id explicitly as there is no overriding of callback registration. + * + * @warning + * + * @param[in] SubscriptionId + * - An unique identifier identifying the callback registration. + * + * @par Async Response Message: + * - None. + * + * @pre + * - None. + * + * @post + * - None. + * + * @return Return Type (TapiResult_t) \n + * - TAPI_API_SUCCESS - indicating that the operation has completed successfully. \n + * - Else it will return failure and error code (Refer #TapiResult_t) + * + * @par Prospective Clients: + * External Apps. + * + * @code + * #include + * #include + * + * unsigned int subscription_id = 0; + * + * void registerevent() + * { + * int api_err = 0; + * api_err = tel_init(); + * if (api_err != 0) { + * printf ("tel_init Failed - api_err = %d \n", api_err); + * return; + * } + * api_err = tel_register_event (TAPI_EVENT_CALL_SETUP_CNF, + * &subscription_id, (TelAppCallback)&app_callback); + * printf("MISC Event registeration is Done: sub id is %d, api_err is %d\n", subscription_id, api_err); + * } + * + * void deregisterevent() + * { + * int api_err = 0; + * api_err = tel_deregister_event (subscription_id); //should be used subscription id which is generated at register time + * } + * @endcode + * + * @see None. + * + * @remarks + * - None. + * + */ +/*================================================================================================*/ +int tel_deregister_event(unsigned int SubscriptionId); + +/** + * @brief This API shall be used to de-initialize TAPI library. + * It shall handle the reinitializing routines related to Event delivery mechanism. + * This API internally shall handle Event delivery related de-initialization routines . + * This API should be called before any other TAPI API. + * + * + * @par Sync (or) Async: + * This is a Synchronous API. + * + * @par Important Notes: + * - None. + * + * @warning + * + * @par Async Response Message: + * - NA + * + * @pre + * - None. + * + * @post + * - None. + * + * @return Return Type (int) \n + * - TAPI_API_SUCCESS - indicating that the operation has completed successfully. \n + * - Else it will return failure and error code (Refer #TapiResult_t) + * + * @par Prospective Clients: + * External Apps. + * + * @code + * #include + * + * int api_err = 0; + * api_err = tel_deinit(); //no in,out param required + * @endcode + * + * @see None. + * + * @remarks + * - None. + * + */ +/*================================================================================================*/ +int tel_deinit(void); + + +/** + * @brief This API shall be used to check whether telephony service is ready or not. + * + * + * @par Sync (or) Async: + * This is a Synchronous API. + * + * @par Important Notes: + * - None. + * + * @warning + * + * + * @param[out] bStatus + * - Status of the telephony service + * + * + * @par Async Response Message: + * - NA + * + * @pre + * - None. + * + * @post + * - None. + * + * @return Return Type (int) \n + * - TAPI_API_SUCCESS - indicating that the operation has completed successfully. \n + * - Else it will return failure and error code (Refer #TapiResult_t) + * + * @par Prospective Clients: + * External Apps. + * + * @code + * #include + * + * int bStatus = 0; + * int err_code; + * err_code = tel_check_service_ready(&bStatus); //bStatus value is set 1 if ready + * + * @endcode + * + * @see None. + * + * @remarks + * - None. + * + */ +/*================================================================================================*/ +int tel_check_service_ready(int *bStatus); + +/** + * @brief This API shall be used to register the application name which listen + * the async response upon the TAPI requests + * + * @par Notes: + * This function sets the application name. It is to determine the destination + * which the Telephony Server send the asynchronous response upon TAPI request. + * The TAPI callee can receive the response event. + * + * + * @par Sync (or) Async: + * This is a Synchronous API. + * + * @par Important Notes: + * - Before register an application name, tel_init() has to be called. + * Otherwise it will fail in registering the name. + * + * @warning + * + * + * @param[in] name + * - Application name. + * + * + * @par Async Response Message: + * - NA + * + * @pre + * - It should be invoked after registering telephony events and before starting a event loop. + * + * @post + * - None. + * + * @return Return Type (int) \n + * - TAPI_API_SUCCESS - indicating that the operation has completed successfully. \n + * - Else it will return failure and error code (Refer #TapiResult_t) + * + * @par Prospective Clients: + * External Apps. + * + * @code + * #include + * #include + * + * GMainLoop *loop = g_main_loop_new(NULL, false); + * + * tel_init(); + * tel_register_app_name("org.tizen.test"); //register application name. the format of name is not fixed + * g_main_loop_run(loop); + * + * @endcode + * + * @see tel_get_app_name + * + * @remarks + * - None. + */ +/*================================================================================================*/ +int tel_register_app_name(char *name); + +/** + * @brief This API shall be used to get the registered application name. + * + * + * @par Sync (or) Async: + * This is a Synchronous API. + * + * @par Important Notes: + * - None. + * + * @warning + * + * + * @param[out] app_name + * - Application name which is registered in telephony server. + * + * + * @par Async Response Message: + * - NA + * + * @pre + * - It should be invoked after registering telephony events and before starting a event loop. + * + * @post + * - None. + * + * @return Return Type (int) \n + * - TAPI_API_SUCCESS - indicating that the operation has completed successfully. \n + * - Else it will return failure and error code (Refer #TapiResult_t) + * + * @par Prospective Clients: + * External Apps. + * + * @code + * #include + * + * tapi_dbus_connection_name app_name; + * tel_get_app_name(&app_name); //if application want to get registered name itself + * + * @endcode + * + * @see tel_register_app_name + * + * @remarks + * - None. + */ +/*================================================================================================*/ +int tel_get_app_name(tapi_dbus_connection_name *app_name); + +/** + * @brief This API allows Application to send any proprietary information to OEM. + * + * @par Notes: + * This API shall be used when any proprietary information what telephony server is transparent is needed to send the OEM layer. + * + * @par Sync (or) Async: + * This is an Asynchronous API. + * + * @par Important Notes: + * - None. + * + * @warning + * + * @param[in] pTunnelInfo + * - This information holds the length of the tunneling data and actual tunneling data. + * + * @param[out] pRequestId + * - Callback which will be invoked when an event occurs for that particular event class. + * + * @par Async Response Message: + * - This Asynchronous event TAPI_EVENT_TUNNEL_INFO_CNF is returned in response and associated event + * data is #TelTunnelInfo_t with this event. Asynchronous return status will be indicated by tunnel_status + * which is a Boolean indicating success(1-True) or Failure(0-False) + * + * @pre + * - None. + * + * @post + * - None. + * + * @return Return Type (int) \n + * - TAPI_API_SUCCESS - indicating that the operation has completed successfully. \n + * - Else it will return failure and error code (Refer #TapiResult_t) + * + * @par Prospective Clients: + * External Apps. + * + * @code + * #include + * + * int requestId = 0; + * TelTunnelInfo_t ti; + * int test = 1234; + * + * ti.pTunnelData = (void *)test; + * ti.TunnelDataLen = sizeof(test); //should be set correct size + * ret = tel_request_tunnel (&ti, &requestId); + * + * @endcode + * + * @see None. + * + * @remarks + * - None. + * + */ +/*================================================================================================*/ +int tel_request_tunnel(const TelTunnelInfo_t *pTunnelInfo, int *pRequestId); + +#ifdef __cplusplus +} +#endif + +#endif /* _TAPI_COMMON_H_ */ + +/** + * @} + */ + diff --git a/include/common/TapiEvent.h b/include/common/TapiEvent.h new file mode 100644 index 0000000..cba2372 --- /dev/null +++ b/include/common/TapiEvent.h @@ -0,0 +1,610 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * 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. + */ + +/** + * @open + * @ingroup TelephonyAPI + * @addtogroup COMMON_TAPI EVENT + * @{ + * + * @file TapiEvent.h + * @brief This file serves as a "C" header file defines type of events. \n + */ + +#ifndef _TAPI_EVENT_H_ +#define _TAPI_EVENT_H_ + +/*================================================================================================== + INCLUDE FILES + ==================================================================================================*/ + +#ifdef __cplusplus +extern "C" { +#endif + +/*================================================================================================== + CONSTANTS + ==================================================================================================*/ +/** + * This value defines the Telephony Event Class. Class is nothing but a group of events + * related to a particular subsystem. Example of one Event Class is TAPI_EVENT_CLASS_CALL_VOICE. + * This becomes the first parameter of telephony notifications. + */ + +#define TAPI_EVENT_NAME_MAX_LEN 128 /**< Maximum length of theevent name */ +#define TAPI_REQUEST_NOTI_ID 0xff /**< Request id for notification message */ +#define TAPI_REQUEST_INVALID_ID -1 /**< Invalid request id */ + +#define TAPI_EVENT_TYPE_CONFIRMATION (0 << 16) +#define TAPI_EVENT_TYPE_NOTIFICATION (1 << 16) +#define TAPI_EVENT_TYPE_RESERVED (2 << 16) +#define TAPI_EVENT_TYPE_MAX (3 << 16) + +#define TAPI_EVENT_NONE (-1) /**< Event None */ +#define TAPI_EVENT_CLASS_BASE (0) /**< Event None */ +#define TAPI_EVENT_CLASS_CALL_VOICE (TAPI_EVENT_CLASS_BASE + 0) /**< Voice Call Event Class */ +#define TAPI_EVENT_CLASS_CALL_DATA (TAPI_EVENT_CLASS_BASE + 1) /**< Data Call Event Class */ +#define TAPI_EVENT_CLASS_SIM (TAPI_EVENT_CLASS_BASE + 2) /**< SIM Event Class */ +#define TAPI_EVENT_CLASS_NETTEXT (TAPI_EVENT_CLASS_BASE + 3) /**< Nettext (SMS/CB) Event Class */ +#define TAPI_EVENT_CLASS_NETWORK (TAPI_EVENT_CLASS_BASE + 4) /**< Network Event Class */ +#define TAPI_EVENT_CLASS_SS (TAPI_EVENT_CLASS_BASE + 5) /**< SS Event Class */ +#define TAPI_EVENT_CLASS_SAT (TAPI_EVENT_CLASS_BASE + 6) /**< SAT Events Class */ +#define TAPI_EVENT_CLASS_DATA (TAPI_EVENT_CLASS_BASE + 7) /**< GPRS DATA Events Class */ +#define TAPI_EVENT_CLASS_SOUND (TAPI_EVENT_CLASS_BASE + 8) /**< SOUND Events Class */ +#define TAPI_EVENT_CLASS_UTIL (TAPI_EVENT_CLASS_BASE + 9) /**< COMMON Events Class */ +#define TAPI_EVENT_CLASS_EXTENSION (TAPI_EVENT_CLASS_BASE + 0x1F) /**< Extension Event */ +#define TAPI_EVENT_CLASS_MAX (TAPI_EVENT_CLASS_BASE + 0x3F) /**< MAX event Class */ + +#define TAPI_EVENT_CLASS_ERR (TAPI_EVENT_CLASS_EXTENSION) /**< Fatal error Event Class */ +#define TAPI_EVENT_CLASS_POWER (TAPI_EVENT_CLASS_EXTENSION + 1) /**< POWEREvents Class */ +#define TAPI_EVENT_CLASS_DISPLAY (TAPI_EVENT_CLASS_EXTENSION + 2) /**< DISPLAY Events Class */ +#define TAPI_EVENT_CLASS_MISC (TAPI_EVENT_CLASS_EXTENSION + 3) /**< MISC Events Class */ +#define TAPI_EVENT_CLASS_CFG (TAPI_EVENT_CLASS_EXTENSION + 4) /**< CFG Events Class */ +#define TAPI_EVENT_CLASS_IMEI (TAPI_EVENT_CLASS_EXTENSION + 5) /**< MISC Events Class */ +#define TAPI_EVENT_CLASS_GPS (TAPI_EVENT_CLASS_EXTENSION + 6) /****/ +#define TAPI_EVENT_SS_CLI_QUERYSTATUS_CNF (TAPI_EVENT_SS_CONFIRMATION + 9) /**< This event is indicated to the Application for CLI service interrogation*/ +#define TAPI_EVENT_SS_AOC_RSP (TAPI_EVENT_SS_CONFIRMATION + 10) /**< This event is used to send the aoc information */ +#define TAPI_EVENT_SS_SET_AOC_CNF (TAPI_EVENT_SS_CONFIRMATION + 11) /**< This event is used to send the confirmation for setting aoc values */ +#define TAPI_EVENT_SS_USSD_RSP_CNF (TAPI_EVENT_SS_CONFIRMATION + 12) /**< This event is returned as USSD response confirmation >**/ +#define TAPI_EVENT_SS_CNF_MAX (TAPI_EVENT_SS_CONFIRMATION + 13) + +#define TAPI_EVENT_SS_NOTIFICATION (TAPI_EVENT_TYPE_NOTIFICATION + (TAPI_EVENT_CLASS_SS << 8)) +#define TAPI_EVENT_SS_USSD_IND (TAPI_EVENT_SS_NOTIFICATION + 0) /**< This is an unsolicited USSD indication*/ +#define TAPI_EVENT_SS_BARRING_TYPE_IND (TAPI_EVENT_SS_NOTIFICATION + 1) /**< This event is used to send the barring type while making an MO call */ +#define TAPI_EVENT_SS_REL_COMP_MSG_NOTIFY (TAPI_EVENT_SS_NOTIFICATION + 2) /**< This event is indicated to the Application when tapi receives Release complete message notification for any SS transactions*/ +#define TAPI_EVENT_SS_REL_CO (TAPI_EVENT_SS_NOTIFICATION + 3) /**< This event is indicated to the Application when tapi receives Release complete message notification for any SS transactions*/ +#define TAPI_EVENT_SS_IND_MAX (TAPI_EVENT_SS_NOTIFICATION + 4) + +/*SAT events*/ +#define TAPI_EVENT_SAT_CONFIRMATION (TAPI_EVENT_TYPE_CONFIRMATION + (TAPI_EVENT_CLASS_SAT << 8)) +#define TAPI_EVENT_SAT_EVENT_DOWNLOAD_CNF (TAPI_EVENT_SAT_CONFIRMATION + 0) /**< response from sim for event download request */ +#define TAPI_EVENT_SAT_MENU_SELECTION_CNF (TAPI_EVENT_SAT_CONFIRMATION + 1) /**< response from sim for menu selection request */ +#define TAPI_EVENT_SAT_CNF_MAX (TAPI_EVENT_SAT_CONFIRMATION + 2) + +#define TAPI_EVENT_SAT_NOTIFICATION (TAPI_EVENT_TYPE_NOTIFICATION + (TAPI_EVENT_CLASS_SAT << 8)) +#define TAPI_EVENT_SAT_DISPLAY_TEXT_IND (TAPI_EVENT_SAT_NOTIFICATION + 0) /**< 0x0D00, SAT Display Text Event*/ +#define TAPI_EVENT_SAT_GET_INKEY_IND (TAPI_EVENT_SAT_NOTIFICATION + 1) /**< SAT Get Inkey Event */ +#define TAPI_EVENT_SAT_GET_INPUT_IND (TAPI_EVENT_SAT_NOTIFICATION + 2) /**< SAT Get Input Event */ +#define TAPI_EVENT_SAT_UI_PLAY_TONE_IND (TAPI_EVENT_SAT_NOTIFICATION + 3) /**< SAT Play Tone Event for UI client*/ +#define TAPI_EVENT_SAT_PLAY_TONE_IND (TAPI_EVENT_SAT_NOTIFICATION + 4) /**< SAT Play Tone Event for MM client */ +#define TAPI_EVENT_SAT_UI_REFRESH_IND (TAPI_EVENT_SAT_NOTIFICATION + 5) /**< SAT Refresh Event for UI client*/ +#define TAPI_EVENT_SAT_SETUP_MENU_IND (TAPI_EVENT_SAT_NOTIFICATION + 6) /**< SAT Setup Menu Event for UI client */ +#define TAPI_EVENT_SAT_UI_SETUP_MENU_IND (TAPI_EVENT_SAT_NOTIFICATION + 7) /**< SAT Setup Menu Event for UI client */ +#define TAPI_EVENT_SAT_SELECT_ITEM_IND (TAPI_EVENT_SAT_NOTIFICATION + 8) /**< SAT Select Item Event */ +#define TAPI_EVENT_SAT_UI_SEND_SMS_IND (TAPI_EVENT_SAT_NOTIFICATION + 9) /**< SAT Send SMS Event for UI client */ +#define TAPI_EVENT_SAT_UI_SEND_SS_IND (TAPI_EVENT_SAT_NOTIFICATION + 10) /**< SAT Send SS Event for UI client */ +#define TAPI_EVENT_SAT_UI_SEND_USSD_IND (TAPI_EVENT_SAT_NOTIFICATION + 11) /**< SAT Send USSD Event for UI client */ +#define TAPI_EVENT_SAT_UI_SETUP_CALL_IND (TAPI_EVENT_SAT_NOTIFICATION + 12) /**< SAT Setup Call Event for UI client */ +#define TAPI_EVENT_SAT_PROVIDE_LOCAL_INFO_IND (TAPI_EVENT_SAT_NOTIFICATION + 13) /**< SAT Provide Local Information Event*/ +#define TAPI_EVENT_SAT_SETUP_IDLE_MODE_TEXT_IND (TAPI_EVENT_SAT_NOTIFICATION + 14) /**< SAT Setup Idle Mode Event*/ +#define TAPI_EVENT_SAT_UI_SEND_DTMF_IND (TAPI_EVENT_SAT_NOTIFICATION + 15) /**< SAT Send DTMF Event for UI client*/ +#define TAPI_EVENT_SAT_LANGUAGE_NOTIFICATION_IND (TAPI_EVENT_SAT_NOTIFICATION + 16) /**< SAT Language notification Event */ +#define TAPI_EVENT_SAT_UI_LAUNCH_BROWSER_IND (TAPI_EVENT_SAT_NOTIFICATION + 17) /**< SAT Launch Browser Event for UI client*/ +#define TAPI_EVENT_SAT_END_PROACTIVE_SESSION_IND (TAPI_EVENT_SAT_NOTIFICATION + 18) /**< SAT End Proactive Command Session Event. This is to indicate that Proactive UICC Session ended*/ +#define TAPI_EVENT_SAT_CALL_CONTROL_IND (TAPI_EVENT_SAT_NOTIFICATION + 19) /**< response from sim for call control by USIM. This is to indicate that the voice call/ss/ussd parameters have been modified by USIM */ +#define TAPI_EVENT_SAT_MO_SMS_CONTROL_IND (TAPI_EVENT_SAT_NOTIFICATION + 20) /**< response from sim for Mo sms control by USIM. This is to indicate that the SMS parameters have been modified by USIM */ +#define TAPI_EVENT_SAT_SMS_REFRESH_IND (TAPI_EVENT_SAT_NOTIFICATION + 21) /**< SAT Refresh Event for SMS client */ +#define TAPI_EVENT_SAT_PB_REFRESH_IND (TAPI_EVENT_SAT_NOTIFICATION + 22) /**< SAT Refresh Event for Phonebook client*/ +#define TAPI_EVENT_SAT_IDLE_REFRESH_IND (TAPI_EVENT_SAT_NOTIFICATION + 23) /**< SAT Refresh Event for Idle Mode client */ +#define TAPI_EVENT_SAT_SEND_SMS_IND (TAPI_EVENT_SAT_NOTIFICATION + 24) /**< SAT Send SMS Event for SMS client*/ +#define TAPI_EVENT_SAT_SETUP_CALL_IND (TAPI_EVENT_SAT_NOTIFICATION + 25) /**< SAT Setup Call Event for Call client */ +#define TAPI_EVENT_SAT_SEND_SS_IND (TAPI_EVENT_SAT_NOTIFICATION + 26) /**< SAT Send SS Event for SS client*/ +#define TAPI_EVENT_SAT_SEND_USSD_IND (TAPI_EVENT_SAT_NOTIFICATION + 27) /**< SAT Send SS Event for USSD client */ +#define TAPI_EVENT_SAT_SEND_DTMF_IND (TAPI_EVENT_SAT_NOTIFICATION + 28) /**< SAT Send DTMF Event for UI client*/ +#define TAPI_EVENT_SAT_LAUNCH_BROWSER_IND (TAPI_EVENT_SAT_NOTIFICATION + 29) /**< SAT Launch Browser Event for Browser */ +#define TAPI_EVENT_SAT_END_OF_APP_EXEC_IND (TAPI_EVENT_SAT_NOTIFICATION + 30) /**< SAT End Proactive command Execution Event. This event will be indicated to the application to end the execution of a Proactive Command when required */ +#define TAPI_EVENT_SAT_EVENT_DOWNLOAD_IND (TAPI_EVENT_SAT_NOTIFICATION + 31) /**< SAT Event Download Indication for Idle, Browser, Setting applications */ +#define TAPI_EVENT_SAT_IND_MAX (TAPI_EVENT_SAT_NOTIFICATION + 32) + +/* DATA Events */ +#define TAPI_EVENT_PS_CONFIRMATION (TAPI_EVENT_TYPE_CONFIRMATION + (TAPI_EVENT_CLASS_DATA << 8)) +#define TAPI_EVENT_PS_PDP_ACT_RSP (TAPI_EVENT_PS_CONFIRMATION + 0) /**< 0x0B00, - PDP activation response event */ +#define TAPI_EVENT_PS_PDP_DEACT_RSP (TAPI_EVENT_PS_CONFIRMATION + 1) /**< PDP deactivation response event */ +#define TAPI_EVENT_PS_CNF_MAX (TAPI_EVENT_PS_CONFIRMATION + 5) + +#define TAPI_EVENT_PS_NOTIFICATION (TAPI_EVENT_TYPE_NOTIFICATION + (TAPI_EVENT_CLASS_DATA << 8)) +#define TAPI_EVENT_PS_PDP_DEACT_IND (TAPI_EVENT_PS_NOTIFICATION + 0) /**< PDP deactivation indication event. */ +#define TAPI_EVENT_PS_STATUS (TAPI_EVENT_PS_NOTIFICATION + 1) /**< PDP status event. */ +#define TAPI_EVENT_PS_CALL_STATISTICS (TAPI_EVENT_PS_NOTIFICATION + 2) /**< publish notification or response of the call statistics */ +#define TAPI_EVENT_PS_HSDPA_STATUS_NOTI (TAPI_EVENT_PS_NOTIFICATION + 3) /**< HSDPA Status notification event */ +#define TAPI_EVENT_PS_BTDUN_PINCONTROL_NOTI (TAPI_EVENT_PS_NOTIFICATION + 4) /**< BT DUN PIN notification event */ +#define TAPI_EVENT_PS_PDP_ACT_IPCONFIG_INFO (TAPI_EVENT_PS_NOTIFICATION + 5) /**< PDP IP information event */ +#define TAPI_EVENT_PS_EXTERNAL_CALL_IND (TAPI_EVENT_PS_NOTIFICATION + 6) /**< External call indication event */ +#define TAPI_EVENT_PS_ERROR_IND (TAPI_EVENT_PS_NOTIFICATION + 7) /**< PS Error event */ +#define TAPI_EVENT_PS_IND_MAX (TAPI_EVENT_PS_NOTIFICATION + 8) + +/* Sound events */ +#define TAPI_EVENT_SOUND_CONFIRMATION (TAPI_EVENT_TYPE_CONFIRMATION + (TAPI_EVENT_CLASS_SOUND << 8)) +#define TAPI_EVENT_SOUND_VOLUMECTRL_RSP (TAPI_EVENT_SOUND_CONFIRMATION + 0) /**< Phone volumn response event */ +#define TAPI_EVENT_SOUND_MICMUTECTRL_RSP (TAPI_EVENT_SOUND_CONFIRMATION + 1) /**< MIC mute response event */ +#define TAPI_EVENT_SOUND_SUCCESS_IND (TAPI_EVENT_SOUND_CONFIRMATION + 2) /**< Sound Error response event */ +#define TAPI_EVENT_SOUND_ERROR_IND (TAPI_EVENT_SOUND_CONFIRMATION + 3) /**< Sound Success response event */ +#define TAPI_EVENT_SOUND_CNF_MAX (TAPI_EVENT_SOUND_CONFIRMATION + 4) + +#define TAPI_EVENT_SOUND_NOTIFICATION (TAPI_EVENT_TYPE_NOTIFICATION + (TAPI_EVENT_CLASS_SOUND << 8)) +#define TAPI_EVENT_SOUND_AUDIOPATHCTRL_NOTI (TAPI_EVENT_SOUND_NOTIFICATION + 0) /**< Audio path indication event */ +#define TAPI_EVENT_SOUND_AUDIOSOURCECTRL_NOTI (TAPI_EVENT_SOUND_NOTIFICATION + 1) /**< Audio source indication event */ +#define TAPI_EVENT_SOUND_IND_MAX (TAPI_EVENT_SOUND_NOTIFICATION + 2) + +/* Util events */ +#define TAPI_EVENT_UTIL_CONFIRMATION (TAPI_EVENT_TYPE_CONFIRMATION + (TAPI_EVENT_CLASS_UTIL << 8)) +#define TAPI_EVENT_UTIL_TUNNEL_CNF (TAPI_EVENT_UTIL_CONFIRMATION + 0) /**< tunnel response event */ + +#define TAPI_EVENT_UTIL_NOTIFICATION (TAPI_EVENT_TYPE_NOTIFICATION + (TAPI_EVENT_CLASS_UTIL << 8)) +#define TAPI_EVENT_UTIL_TUNNEL_NOTI (TAPI_EVENT_UTIL_NOTIFICATION + 0) /**< tunnel notification event */ + +/* Extension events */ +#define TAPI_EVENT_CLASS_ERR (TAPI_EVENT_CLASS_EXTENSION) /**< Fatal error Event Class */ +#define TAPI_EVENT_CLASS_POWER (TAPI_EVENT_CLASS_EXTENSION + 1) /**< POWEREvents Class */ +#define TAPI_EVENT_CLASS_DISPLAY (TAPI_EVENT_CLASS_EXTENSION + 2) /**< DISPLAY Events Class */ +#define TAPI_EVENT_CLASS_MISC (TAPI_EVENT_CLASS_EXTENSION + 3) /**< MISC Events Class */ +#define TAPI_EVENT_CLASS_CFG (TAPI_EVENT_CLASS_EXTENSION + 4) /**< CFG Events Class */ +#define TAPI_EVENT_CLASS_IMEI (TAPI_EVENT_CLASS_EXTENSION + 5) /**< MISC Events Class */ +#define TAPI_EVENT_CLASS_GPS (TAPI_EVENT_CLASS_EXTENSION + 6) /**< GPS Events Class */ +#define TAPI_EVENT_CLASS_OMADM (TAPI_EVENT_CLASS_EXTENSION + 7) /**< OMADM Events Class */ +#define TAPI_EVENT_CLASS_SVCMODE (TAPI_EVENT_CLASS_EXTENSION + 8) +#define TAPI_EVENT_CLASS_FACTORY (TAPI_EVENT_CLASS_EXTENSION + 9) +#define TAPI_EVENT_CLASS_CALL_E911 (TAPI_EVENT_CLASS_EXTENSION + 10) // check why this is needed. +#define TAPI_EVENT_CLASS_CDMA_DATA (TAPI_EVENT_CLASS_EXTENSION + 11) /**< CDMA Data Events Class */ + +#define TAPI_EVENT_NETWORK_GETPOWERONATTACH_CNF (TAPI_EVENT_NETWORK_CNF_MAX + 0) /**< This event indicates the Power on attach options has been identified and returned */ +#define TAPI_EVENT_NETWORK_SETPOWERONATTACH_CNF (TAPI_EVENT_NETWORK_CNF_MAX + 1) /**< This event indicates the Power on attach has been set */ +#define TAPI_EVENT_NETWORK_GETNWORDER_CNF (TAPI_EVENT_NETWORK_CNF_MAX + 2) /**< This event is returned on getting network order */ +#define TAPI_EVENT_NETWORK_SETNWORDER_CNF (TAPI_EVENT_NETWORK_CNF_MAX + 3) /**< This event is returned on setting network order */ +#define TAPI_EVENT_NETWORK_CANCELMANUALSELECTION_CNF (TAPI_EVENT_NETWORK_CNF_MAX + 4) /**< This event is returned on cancellation of manual network selection from network list */ +#define TAPI_EVENT_NETWORK_CANCELMANUALSEARCH_CNF (TAPI_EVENT_NETWORK_CNF_MAX + 5) /**< This event is returned on cancellation of manual network search */ +#define TAPI_EVENT_NETWORK_SEARCH_POPUP_ENABLE (TAPI_EVENT_NETWORK_CNF_MAX + 6) /**< This event indicates a status which applications refer to show network search popup */ +#define TAPI_EVENT_NETWORK_SEARCH_POPUP_DISABLE (TAPI_EVENT_NETWORK_CNF_MAX + 7) /**< This event indicates a status which applications refer to show network search popup */ +#define TAPI_EVENT_NETWORK_INTERNAL_CNF_MAX (TAPI_EVENT_NETWORK_CNF_MAX + 8) + +/* Error Class Events*/ +#define TAPI_EVENT_ERR_NOTIFICATION (TAPI_EVENT_TYPE_NOTIFICATION + (TAPI_EVENT_CLASS_ERR<<8)) +#define TAPI_EVENT_ERR (TAPI_EVENT_ERR_NOTIFICATION + 0) /**< Fatal Error Information */ +#define TAPI_EVENT_ERR_RESERVED1_IND (TAPI_EVENT_ERR_NOTIFICATION + 1) /**< This event is notified to application about some error has occurred at OEM and can be used for debugging purpose */ +#define TAPI_EVENT_ERR_RESERVED2_IND (TAPI_EVENT_ERR_NOTIFICATION + 2) /**< This event is notified to application about some error has occurred at OEM and can be used for debugging purpose */ +#define TAPI_EVENT_ERR_RESERVED3_IND (TAPI_EVENT_ERR_NOTIFICATION + 3) /**< This event is notified to application about some error has occurred at OEM and can be used for debugging purpose */ +#define TAPI_EVENT_ERR_RESERVED4_IND (TAPI_EVENT_ERR_NOTIFICATION + 4) /**< This event is notified to application about some error has occurred at OEM and can be used for debugging purpose */ +#define TAPI_EVENT_ERR_RESERVED5_IND (TAPI_EVENT_ERR_NOTIFICATION + 5) /**< This event is notified to application about some error has occurred at OEM and can be used for debugging purpose */ + +/* Power Module Event Types... */ +#define TAPI_EVENT_POWER_CONFIRMATION (TAPI_EVENT_TYPE_CONFIRMATION + (TAPI_EVENT_CLASS_POWER<<8)) +#define TAPI_EVENT_POWER_FLIGHT_MODE_RESP (TAPI_EVENT_POWER_CONFIRMATION + 0) /**< Flight Mode Response */ +#define TAPI_EVENT_POWER_CNF_MAX (TAPI_EVENT_POWER_CONFIRMATION + 1) + +#define TAPI_EVENT_POWER_NOTIFICATION (TAPI_EVENT_TYPE_NOTIFICATION + (TAPI_EVENT_CLASS_POWER<<8)) +#define TAPI_EVENT_POWER_PHONE_OFF (TAPI_EVENT_POWER_NOTIFICATION + 0) /**< Modem power Off */ +#define TAPI_EVENT_POWER_BATT_STAT_IND (TAPI_EVENT_POWER_NOTIFICATION + 1) /**< Battery level Indication */ +#define TAPI_EVENT_POWER_SERVICE_READY_IND (TAPI_EVENT_POWER_NOTIFICATION + 2) /**< telephony service ready */ +#define TAPI_EVENT_POWER_IND_MAX (TAPI_EVENT_POWER_NOTIFICATION + 3) + +/* Display Module Event Types... */ +#define TAPI_EVENT_DISPLAY_NOTIFICATION (TAPI_EVENT_TYPE_NOTIFICATION + (TAPI_EVENT_CLASS_DISPLAY<<8)) +#define TAPI_EVENT_DISPLAY_ICON_INFO_IND (TAPI_EVENT_DISPLAY_NOTIFICATION + 0) /**< Display Icon Info Indication */ +#define TAPI_EVENT_DISPLAY_HMZ_O2_IND (TAPI_EVENT_DISPLAY_NOTIFICATION + 1) /**< Home Zone Info Indication */ +#define TAPI_EVENT_DISPLAY_PHONE_FATAL_NOTI (TAPI_EVENT_DISPLAY_NOTIFICATION + 2) /**< Phone Fatal Message Notification */ +#define TAPI_EVENT_DISPLAY_EXT_ROAM_INFO_NOTI (TAPI_EVENT_DISPLAY_NOTIFICATION + 3) /**< Roam Information Notification */ +#define TAPI_EVENT_DISPLAY_EXT_USER_IND_MSG_NOTI (TAPI_EVENT_DISPLAY_NOTIFICATION + 4) /**< User Indication Message Notification */ +#define TAPI_EVENT_DISPLAY_IND_MAX (TAPI_EVENT_DISPLAY_NOTIFICATION + 5) + +/* Misc Module Types... */ +#define TAPI_EVENT_MISC_CONFIRMATION (TAPI_EVENT_TYPE_CONFIRMATION + (TAPI_EVENT_CLASS_MISC<<8)) +#define TAPI_EVENT_MISC_NITZ_GETCNF (TAPI_EVENT_MISC_CONFIRMATION + 0) +#define TAPI_EVENT_MISC_NITZ_NOTIFY (TAPI_EVENT_MISC_CONFIRMATION + 1) +#define TAPI_EVENT_MISC_NITZ_IND (TAPI_EVENT_MISC_CONFIRMATION + 2) +#define TAPI_EVENT_MISC_AT_FUS (TAPI_EVENT_MISC_CONFIRMATION + 3) +#define TAPI_EVENT_MISC_SERIAL_NUMBER_IND (TAPI_EVENT_MISC_CONFIRMATION + 4) +#define TAPI_EVENT_MISC_GET_NAM_INFO_CNF (TAPI_EVENT_MISC_CONFIRMATION + 5) +#define TAPI_EVENT_MISC_SET_NAM_INFO_CNF (TAPI_EVENT_MISC_CONFIRMATION + 6) +#define TAPI_EVENT_MISC_NAM_INFO_NOTI (TAPI_EVENT_MISC_CONFIRMATION + 7) +#define TAPI_EVENT_MISC_CNF_MAX (TAPI_EVENT_MISC_CONFIRMATION + 8) + +/* Config Module Types... */ +#define TAPI_EVENT_CFG_CONFIRMATION (TAPI_EVENT_TYPE_CONFIRMATION + (TAPI_EVENT_CLASS_CFG<<8)) +#define TAPI_CFG_EVENT_DEFAULTCFG_IND (TAPI_EVENT_CFG_CONFIRMATION + 0) /**< Default configuration Event Type */ +#define TAPI_EVENT_CFG_GET_A_KEY_CNF (TAPI_EVENT_CFG_CONFIRMATION + 1) /**< Get A key Event Type */ +#define TAPI_EVENT_CFG_VERIFY_A_KEY_CNF (TAPI_EVENT_CFG_CONFIRMATION + 2) /**< A key verification Event Type */ +#define TAPI_EVENT_CFG_GET_MSL_INFO_CNF (TAPI_EVENT_CFG_CONFIRMATION + 3) /**< Get MSL information Event Type */ +#define TAPI_EVENT_CFG_GET_VOCODER_OPTION_CNF (TAPI_EVENT_CFG_CONFIRMATION + 4) /**< Get vocoder option Event Type */ +#define TAPI_EVENT_CFG_SET_VOCODER_OPTION_CNF (TAPI_EVENT_CFG_CONFIRMATION + 5) /**< Set vocoder option Event Type */ +#define TAPI_EVENT_CFG_GET_HIDDEN_MENU_ACCESS_CNF (TAPI_EVENT_CFG_CONFIRMATION + 6) /**< Get hidden menu access Event Type */ +#define TAPI_EVENT_CFG_SET_HIDDEN_MENU_ACCESS_CNF (TAPI_EVENT_CFG_CONFIRMATION + 7) /**< Set hidden menu access Event Type */ +#define TAPI_EVENT_CFG_GET_CURRENT_CARRIER_CNF (TAPI_EVENT_CFG_CONFIRMATION + 8) /**< Get current carrier Event */ +#define TAPI_EVENT_CFG_SET_CURRENT_CARRIER_CNF (TAPI_EVENT_CFG_CONFIRMATION + 9) /**< Set current carrier Event */ +#define TAPI_EVENT_CFG_GET_SIO_MODE_CNF (TAPI_EVENT_CFG_CONFIRMATION + 10) /**< Get Phone SIO mode Event */ +#define TAPI_EVENT_CFG_SET_SIO_MODE_CNF (TAPI_EVENT_CFG_CONFIRMATION + 11) /**< Set Phone SIO mode Event */ +#define TAPI_EVENT_CFG_GET_ACTIVATION_DATE_CNF (TAPI_EVENT_CFG_CONFIRMATION + 12) /**< Get Activated Data Event */ +#define TAPI_EVENT_CFG_GET_RECONDITIONED_DATE_CNF (TAPI_EVENT_CFG_CONFIRMATION + 13) /**< Get Reconditioned data Event */ +#define TAPI_EVENT_CFG_SET_TTY_MODE_CNF (TAPI_EVENT_CFG_CONFIRMATION + 14) /**< Set TTY mode Event */ +#define TAPI_EVENT_CFG_GET_TTY_MODE_CNF (TAPI_EVENT_CFG_CONFIRMATION + 15) /**< Get TTY mode Event */ +#define TAPI_EVENT_CFG_CNF_MAX (TAPI_EVENT_CFG_CONFIRMATION + 16) + +/* IMEI Module Types... */ +#define TAPI_EVENT_IMEI_CONFIRMATION (TAPI_EVENT_TYPE_CONFIRMATION + (TAPI_EVENT_CLASS_IMEI<<8)) +#define TAPI_EVENT_IMEI_CMLA_IND (TAPI_EVENT_IMEI_CONFIRMATION + 0) +#define TAPI_EVENT_IMEI_COMPAREITEM (TAPI_EVENT_IMEI_CONFIRMATION + 1) +#define TAPI_EVENT_IMEI_CNF_MAX (TAPI_EVENT_IMEI_CONFIRMATION + 2) + +/* GPS Module Types... */ +#define TAPI_EVENT_GPS_CONFIRMATION (TAPI_EVENT_TYPE_CONFIRMATION + (TAPI_EVENT_CLASS_GPS<<8)) +#define TAPI_EVENT_GPS_INIT_RESP (TAPI_EVENT_GPS_CONFIRMATION + 0) /**< Start session response event type. */ +#define TAPI_EVENT_GPS_DEINIT_RESP (TAPI_EVENT_GPS_CONFIRMATION + 1) /**< GPS option set response event type. */ +#define TAPI_EVENT_GPS_FIX_REQUEST_RESP (TAPI_EVENT_GPS_CONFIRMATION + 2) +#define TAPI_EVENT_GPS_STOP_SESSION_RESP (TAPI_EVENT_GPS_CONFIRMATION + 3) /**< Close session response event type */ +#define TAPI_EVENT_GPS_PARAMETERS_SET_RESP (TAPI_EVENT_GPS_CONFIRMATION + 4) +#define TAPI_EVENT_GPS_XTRA_INIT (TAPI_EVENT_GPS_CONFIRMATION + 5) +#define TAPI_EVENT_GPS_XTRA_DEINIT (TAPI_EVENT_GPS_CONFIRMATION + 6) +#define TAPI_EVENT_GPS_XTRA_ENABLE_SET_RESP (TAPI_EVENT_GPS_CONFIRMATION + 7) +#define TAPI_EVENT_GPS_XTRA_SET_TIME_RESP (TAPI_EVENT_GPS_CONFIRMATION + 8) +#define TAPI_EVENT_GPS_XTRA_SET_DATA_RESP (TAPI_EVENT_GPS_CONFIRMATION + 9) +#define TAPI_EVENT_GPS_PARAMETERS_GET_RESP (TAPI_EVENT_GPS_CONFIRMATION + 10) +#define TAPI_EVENT_GPS_FREQ_AIDING_SET_RESP (TAPI_EVENT_GPS_CONFIRMATION + 11) +#define TAPI_EVENT_GPS_CNF_MAX (TAPI_EVENT_GPS_CONFIRMATION + 12) + +#define TAPI_EVENT_GPS_NOTIFICATION (TAPI_EVENT_TYPE_NOTIFICATION + (TAPI_EVENT_CLASS_GPS<<8)) +#define TAPI_EVENT_GPS_POSITION_NOTI (TAPI_EVENT_GPS_NOTIFICATION + 0) +#define TAPI_EVENT_GPS_EXT_POSITION_NOTI (TAPI_EVENT_GPS_NOTIFICATION + 1) +#define TAPI_EVENT_GPS_PD_CMD_CB_NOTI (TAPI_EVENT_GPS_NOTIFICATION + 2) +#define TAPI_EVENT_GPS_PDP_CONNECTION_IND (TAPI_EVENT_GPS_NOTIFICATION + 3) +#define TAPI_EVENT_GPS_DNS_LOOKUP_IND (TAPI_EVENT_GPS_NOTIFICATION + 4) +#define TAPI_EVENT_GPS_VERIFICATION_IND (TAPI_EVENT_GPS_NOTIFICATION + 5) /**< Verification indication event type. */ +#define TAPI_EVENT_GPS_SUPL_NOTI (TAPI_EVENT_GPS_NOTIFICATION + 6) /**< SUPL Notification event type. */ +#define TAPI_EVENT_GPS_XTRA_TIME_NOTI (TAPI_EVENT_GPS_NOTIFICATION + 7) /**< XTRA Time info notification event type. */ +#define TAPI_EVENT_GPS_XTRA_DATA_NOTI (TAPI_EVENT_GPS_NOTIFICATION + 8) /**< XTRA DATA Status injection notification. */ +#define TAPI_EVENT_GPS_ASSIST_DATA_NOTI (TAPI_EVENT_GPS_NOTIFICATION + 9) /**< XTRA DATA Status injection notification. */ +#define TAPI_EVENT_GPS_MEASURE_POSITION_IND (TAPI_EVENT_GPS_NOTIFICATION + 10) /**< XTRA DATA Status injection notification. */ +#define TAPI_EVENT_GPS_MEASURE_POSITION_CNF (TAPI_EVENT_GPS_NOTIFICATION + 11) /**< XTRA DATA Status injection notification. */ +#define TAPI_EVENT_GPS_RESET_ASSIST_DATA_NOTI (TAPI_EVENT_GPS_NOTIFICATION + 12) /**< XTRA DATA Status injection notification. */ +#define TAPI_EVENT_GPS_IND_MAX (TAPI_EVENT_GPS_NOTIFICATION + 13) + +/* OMA-DM events */ +#define TAPI_EVENT_OMADM_CONFIRMATION (TAPI_EVENT_TYPE_CONFIRMATION + (TAPI_EVENT_CLASS_OMADM<<8)) +#define TAPI_EVENT_OMADM_PRL_SIZE_GET_CNF (TAPI_EVENT_OMADM_CONFIRMATION + 0) /**< OMA-DM PRL size get confirm event type. */ +#define TAPI_EVENT_OMADM_MODEL_NAME_GET_CNF (TAPI_EVENT_OMADM_CONFIRMATION + 1) /**< OMA-DM Model name get confirm event type. */ +#define TAPI_EVENT_OMADM_OEM_NAME_GET_CNF (TAPI_EVENT_OMADM_CONFIRMATION + 2) /**< OMA-DM OEM name get confirm event type. */ +#define TAPI_EVENT_OMADM_SW_VERSION_GET_CNF (TAPI_EVENT_OMADM_CONFIRMATION + 3) /**< OMA-DM SW version get confirm event type. */ +#define TAPI_EVENT_OMADM_PRL_READ_GET_CNF (TAPI_EVENT_OMADM_CONFIRMATION + 4) /**< OMA-DM PRL Data read confirm event type. */ +#define TAPI_EVENT_OMADM_PRL_WRITE_SET_CNF (TAPI_EVENT_OMADM_CONFIRMATION + 5) /**< OMA-DM PRL Data write confirm event type. */ +#define TAPI_EVENT_OMADM_CNF_MAX (TAPI_EVENT_OMADM_CONFIRMATION + 6) + +/* SVC event */ +#define TAPI_EVENT_SVCMODE_CONFIRMATION (TAPI_EVENT_TYPE_CONFIRMATION + (TAPI_EVENT_CLASS_SVCMODE<<8)) +#define TAPI_EVENT_SVCMODE_START_NOTI (TAPI_EVENT_SVCMODE_CONFIRMATION + 0) // should be checked +#define TAPI_EVENT_SVCMODE_END_NOTI (TAPI_EVENT_SVCMODE_CONFIRMATION + 1) +#define TAPI_EVENT_SVCMODE_DEBUG_DUMP_CNF (TAPI_EVENT_SVCMODE_CONFIRMATION + 2) +#define TAPI_EVENT_SVCMODE_CNF_MAX (TAPI_EVENT_SVCMODE_CONFIRMATION + 3) + +#define TAPI_EVENT_SVCMODE_NOTIFICATION (TAPI_EVENT_TYPE_NOTIFICATION + (TAPI_EVENT_CLASS_SVCMODE<<8)) +#define TAPI_EVENT_SVCMODE_CHANGE_NOTI (TAPI_EVENT_SVCMODE_NOTIFICATION + 0) +#define TAPI_EVENT_SVCMODE_SCREEN_CFG_NOTI (TAPI_EVENT_SVCMODE_NOTIFICATION + 1) +#define TAPI_EVENT_SVCMODE_DISP_SCREEN_NOTI (TAPI_EVENT_SVCMODE_NOTIFICATION + 2) +#define TAPI_EVENT_SVCMODE_DEVICE_TEST_NOTI (TAPI_EVENT_SVCMODE_NOTIFICATION + 3) +#define TAPI_EVENT_SVCMODE_IND_MAX (TAPI_EVENT_SVCMODE_NOTIFICATION + 4) + +#define TAPI_EVENT_FACTORY_CONFIRMATION (TAPI_EVENT_TYPE_CONFIRMATION + (TAPI_EVENT_CLASS_FACTORY<<8)) +#define TAPI_EVENT_FACTORY_OMISSION_AVOIDANCE_SET_CNF (TAPI_EVENT_FACTORY_CONFIRMATION + 0) +#define TAPI_EVENT_FACTORY_OMISSION_AVOIDANCE_GET_CNF (TAPI_EVENT_FACTORY_CONFIRMATION + 1) + +#define TAPI_EVENT_FACTORY_NOTIFICATION (TAPI_EVENT_TYPE_NOTIFICATION + (TAPI_EVENT_CLASS_FACTORY<<8)) +#define TAPI_EVENT_FACTORY_DFT_SMS (TAPI_EVENT_FACTORY_NOTIFICATION + 0) +#define TAPI_EVENT_FACTORY_IND_MAX (TAPI_EVENT_FACTORY_NOTIFICATION + 1) + +/* CDMA DATA events */ +#define TAPI_EVENT_CDMA_DATA_CONFIRMATION (TAPI_EVENT_TYPE_CONFIRMATION + (TAPI_EVENT_CLASS_CDMA_DATA<<8)) +#define TAPI_EVENT_DATA_MIP_NAI_GET_CNF (TAPI_EVENT_CDMA_DATA_CONFIRMATION + 0) /**< CDMA Data Service PIN Control confirm event type. */ +#define TAPI_EVENT_DATA_MIP_NAI_SET_CNF (TAPI_EVENT_CDMA_DATA_CONFIRMATION + 1) /**< CDMA Data MIP NAI set confirm event type. */ +#define TAPI_EVENT_DATA_CURRENT_NAI_INDEX_GET_CNF (TAPI_EVENT_CDMA_DATA_CONFIRMATION + 2) /**< CDMA Data Current NAI Index get confirm event type. */ +#define TAPI_EVENT_DATA_TE2_STATUS_GET_CNF (TAPI_EVENT_CDMA_DATA_CONFIRMATION + 3) /**< CDMA Data TE2 Status get confirm event type. */ +#define TAPI_EVENT_DATA_BYTES_COUNTER_RESET_CNF (TAPI_EVENT_CDMA_DATA_CONFIRMATION + 4) /**< CDMA Data Bytes Counter Reset confirm event type. */ +#define TAPI_EVENT_DATA_BYTES_COUNTER_GET_CNF (TAPI_EVENT_CDMA_DATA_CONFIRMATION + 5) /**< CDMA Data Bytes Counter get confirm event type. */ +#define TAPI_EVENT_DATA_PACKET_DATA_CALL_CONFIGURATION_GET_CNF (TAPI_EVENT_CDMA_DATA_CONFIRMATION + 6) /**< CDMA Data Packet data call configuration get confirm event type. */ +#define TAPI_EVENT_DATA_HDR_SESSION_CLEAR_SET_CNF (TAPI_EVENT_CDMA_DATA_CONFIRMATION + 7) /**< CDMA Data HDR session clear set confirm event type. */ +#define TAPI_EVENT_DATA_ROAM_GUARD_GET_CNF (TAPI_EVENT_CDMA_DATA_CONFIRMATION + 8) /**< CDMA Roam guard get confirm event type. */ +#define TAPI_EVENT_DATA_ROAM_GUARD_SET_CNF (TAPI_EVENT_CDMA_DATA_CONFIRMATION + 9) /**< CDMA Roam guard set confirm event type. */ +#define TAPI_EVENT_DATA_MODEM_NAI_GET_CNF (TAPI_EVENT_CDMA_DATA_CONFIRMATION + 10) /**< CDMA Modem NAI get confirm event type. */ +#define TAPI_EVENT_DATA_EVDO_REV_CONFIG_GET_CNF (TAPI_EVENT_CDMA_DATA_CONFIRMATION + 11) /**< CDMA Force RevA mode get confirm event type. */ +#define TAPI_EVENT_DATA_EVDO_REV_CONFIG_SET_CNF (TAPI_EVENT_CDMA_DATA_CONFIRMATION + 12) /**< CDMA Force RevA mode set confirm event type. */ +#define TAPI_EVENT_DATA_NAI_SETTING_MODE_GET_CNF (TAPI_EVENT_CDMA_DATA_CONFIRMATION + 13) /**< CDMA NAI setting mode get confirm event type. */ +#define TAPI_EVENT_DATA_NAI_SETTING_MODE_SET_CNF (TAPI_EVENT_CDMA_DATA_CONFIRMATION + 14) /**< CDMA NAI setting mode set confirm event type. */ +#define TAPI_EVENT_DATA_RESTORE_NAI_SET_CNF (TAPI_EVENT_CDMA_DATA_CONFIRMATION + 15) /**< CDMA Data Restore NAI set confirm event type. */ +#define TAPI_EVENT_DATA_DDTM_CONFIGURATION_GET_CNF (TAPI_EVENT_CDMA_DATA_CONFIRMATION + 16) /**< CDMA Data DDTM Configuration get confirm event type. */ +#define TAPI_EVENT_DATA_DDTM_CONFIGURATION_SET_CNF (TAPI_EVENT_CDMA_DATA_CONFIRMATION + 17) /**< CDMA Data DDTM Configuration set confirm event type. */ +#define TAPI_EVENT_DATA_INTERNAL_CNF_MAX (TAPI_EVENT_CDMA_DATA_CONFIRMATION + 18) + +#define TAPI_EVENT_CDMA_DATA_NOTIFICATION (TAPI_EVENT_TYPE_NOTIFICATION + (TAPI_EVENT_CLASS_CDMA_DATA<<8)) +#define TAPI_EVENT_DATA_TE2_STATUS_NOTI (TAPI_EVENT_CDMA_DATA_NOTIFICATION + 0) /**< CDMA Data TE2 Status changed indication event type. */ +#define TAPI_EVENT_DATA_DS_TE2_DATA_RATE_INFO_NOTI (TAPI_EVENT_CDMA_DATA_NOTIFICATION + 1) /**< CDMA Data DS TE2 Data Rate changed indication event type. */ +#define TAPI_EVENT_DATA_INTERNAL_IND_MAX (TAPI_EVENT_CDMA_DATA_NOTIFICATION + 2) + +/*================================================================================================== + MACROS + ==================================================================================================*/ + +/*================================================================================================== + ENUMS + ==================================================================================================*/ + +/*================================================================================================== + STRUCTURES AND OTHER TYPEDEFS + ==================================================================================================*/ + +/** + *This structure defines the Telephony Event. + */ +typedef struct { + int EventClass; /**< Event Class */ + int EventType; /**< Event type */ + int RequestId; /**< This parameter is applicable only for Asynchronous solicited responses. The request id for a service request is sent back in the asynchronous response. For unsolicited indications, request id will be -1 */ + int Status; /**< This parameter is applicable only for Asynchronous solicited responses. This status parameter informs the actual result of Asynchronous response. For unsolicited indications, status will be -1 */ + void *pData; /**< Event Data - Based on Event type response/indications. Event data information is captured in each API Section */ + int pDataLen; /**< Event Data size */ +} TelTapiEvent_t; + +typedef void (*TapiCallback)(int eventClass, int eventType, int param1, char *param2); + +/** + * This structure defines the Telephony Event . + */ +typedef struct { + int eventClass; /**< Event class */ + int eventType; /**< Event type */ + int param1; /**< Event Data Length */ + void *param2; /**< Event Data */ +} TapiEvent; + +/* New Telephony Fw Event structure to be used with ts_delivery_power_display_event() */ +typedef struct { + int group; // Event Class + int type; // Event Group + char name[TAPI_EVENT_NAME_MAX_LEN]; // Event Name + int len; // Data Length + void *data; // Data +} tapi_event_type_t; + +/** + * prototype for TAPI Callback function. + */ +typedef int (*TelAppCallback)(const TelTapiEvent_t *pTapiEvent, void *data); + +/** + * this structure contains the necessary information on subscription list. + */ +typedef struct TapiSubscription { + int SubscriptId; /**< Subscription ID */ + int EventClass; /**< Event Class */ + TelAppCallback AppCallback; /**< Callback function pointer */ + struct TapiSubscription * next; /**< Link to the next subscription */ +} TapiSubscriptionList; + +/*================================================================================================== + FUNCTION PROTOTYPES + ==================================================================================================*/ + +#ifdef __cplusplus +} +#endif + +#endif /* _TAPI_EVENT_H_ */ + +/** + * @} + */ + diff --git a/include/common/TapiUtility.h b/include/common/TapiUtility.h new file mode 100644 index 0000000..fa45172 --- /dev/null +++ b/include/common/TapiUtility.h @@ -0,0 +1,437 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * 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 _TAPI_UTILITY_H_ +#define _TAPI_UTILITY_H_ + +/*================================================================================================== + INCLUDE FILES + ==================================================================================================*/ +#include + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/*================================================================================================== + CONSTANTS + ==================================================================================================*/ + +/*================================================================================================== + MACROS + ==================================================================================================*/ + +/** + * Log levels, refer man syslog() + * + * LOG_EMERG A panic condition. This is normally broadcast to all users. + * LOG_ALERT A condition that should be corrected immediately, such as a corrupted system database. + * LOG_CRIT Critical conditions, e.g., hard device errors. + * LOG_ERR Errors. + * LOG_WARNING Warning messages. + * LOG_NOTICE Conditions that are not error conditions, but should possibly be handled specially. + * LOG_INFO Informational messages. + * LOG_DEBUG Messages that contain information normally of use only when debugging a program. + */ +#define LEVEL_DEBUG LOG_DEBUG +#define LEVEL_INFO LOG_DEBUG +#define LEVEL_NOTICE LOG_DEBUG +#define LEVEL_WARNING LOG_DEBUG +#define LEVEL_ERR LOG_WARN +#define LEVEL_CRIT LOG_WARN +#define LEVEL_ALERT LOG_WARN +#define LEVEL_LOGGING LOG_WARN +#define LEVEL_EMERG LOG_FATAL + +#define LOG_TELEPHONY "TELEPHONY" + +/** + * Default we are disabling the logging. If we want enable logging based on our + * requirement whether to log on to STD or to syslog we have to compile telephony + * code with flags as mentioned below + * + * DISABLE LOGGING ----> No Flag + * ENABLE LOGGING(to SYSLOG) ----> Enable Flag _TAPI_DEBUG_ON_SYSLOG_ in Sconscript + * ENABLE LOGGING(to STD) ----> Enable Flag _TAPI_DEBUG_ON_SCREEN_ in Sconscript + */ + +#define TAPI_LIB_DEBUG(level, frmt, args...) do {RLOG(level,LOG_TELEPHONY, "[TAPI] %s; "frmt"\n", __func__, ##args);} while (0) +#define TAPI_PRINT_TIME(str, args...) do { } while (0) + +/* +#define TAPI_LIB_DEBUG(level, frmt, args...) do { fprintf(stderr, "\n[TAPI Library] [PID: %d, %s:%d] " frmt , getpid(), __func__, __LINE__, ##args); } while (FALSE) +#define TAPI_PRINT_TIME(str, args...) do { } while(0) +#define TAPI_SYSLOG_DEBUG(args...) {\ + syslog(LOG_USER , "\n[Telephony Server] [%s:%d] ", __func__, __LINE__); \ + syslog(LOG_USER , args); } +*/ + +/** + * This will check the 'scalar_exp' for TRUE, if failed then return 'err_value' from function. + */ +#define TAPI_RET_ERR_NUM_IF_FAIL(scalar_exp, err_num) {\ + if (!(scalar_exp)) \ + { \ + TAPI_LIB_DEBUG(LEVEL_ERR, "TAPI_RET_ERR_NUM_IF_FAIL Failed. returning [%d]", err_num);\ + return err_num; \ + } \ +} + +/** + * Returns from the current function if the expression is not true. If the expression evaluates to FALSE, + * a critical message is logged and the function returns. This can only be used in functions which do not + * return a value. + * + * expr : the expression to check. + */ +#define TAPI_RETURN_IF_FAIL(scalar_exp) {\ + if (!scalar_exp) \ + { \ + TAPI_LIB_DEBUG(LEVEL_ERR, "TAPI_RETURN_IF_FAIL: Failed: Returning from here."); \ + return; \ + } \ +} + +/** + * Returns from the current function, returning the value ret, if the expression is not true. + * If the expression evaluates to FALSE, a critical message is logged and ret is returned. + */ +#define TAPI_RETURN_VAL_IF_FAIL(scalar_exp, ret) { \ + if (!scalar_exp) \ + { \ + TAPI_LIB_DEBUG(LEVEL_ERR, "TAPI_RETURN_VAL_IF_FAIL: Failed: Returning [%d]", ret); \ + return ret; \ + } \ +} + +/** + * Returns from the current function, returning the value ret, if the expression is not true. + * If the expression evaluates to FALSE, a critical message is logged and ret is returned. + */ +#define TAPI_RETURN_VAL_IF_SUCCESS(scalar_exp, ret) { \ + if (scalar_exp) \ + { \ + TAPI_LIB_DEBUG(LEVEL_DEBUG, "TAPI_RETURN_VAL_IF_SUCCESS: Failed Returning [%d]", ret); \ + return ret; \ + } \ +} + +/** + * This assert will log an err on stderr and abort, if assertion failed, + * Use this only if the telephpny sevrer needs to be exited, if asertion fails + */ +#define TAPI_ASSERT(scalar_exp) assert(scalar_exp); + +/** + * Returns from the current function, returning the value ret, if the exp1 and exp2 are of same value. + * If the equal expression evaluates to TRUE, a critical message is logged and ret is returned. + */ +#define TAPI_RETURN_VAL_IF_EQUAL(exp1, exp2, ret) { \ + if (exp1 == exp2) \ + { \ + TAPI_LIB_DEBUG(LEVEL_ALERT, "TAPI_RETURN_VAL_IF_EQUAL: FAILED, Returning [%d]", ret); \ + return ret; \ + } \ +} + +/** + * void *calloc(size_t nelements, size_t bytes); + * which allocates a region of memory large enough to hold nelements of size bytes each. + * The allocated region is initialized to zero. + */ +#define TAPI_CALLOC(ptr, no_elements, type) \ + ptr = (type *) calloc (no_elements , sizeof (type)); \ + if (ptr == NULL) { \ + perror("NULL is returned"); \ + TAPI_LIB_DEBUG(LEVEL_ERR, "calloc error -NULL, errno is [%d]", errno); \ + fprintf(stderr,"Calloc ERRNO %d\n", errno); \ + TAPI_ASSERT(ptr); \ + } + +/** + * why ptr = NULL; after free()?. + * If the same pointer is passed to free twice, known as a double free. To avoid this, set pointers to + * NULL after passing them to free: free(NULL) is safe (it does nothing). + */ +#define TAPI_FREE(ptr) \ + if (ptr != NULL) { \ + free(ptr); \ + ptr = NULL; \ + } \ + else { \ + TAPI_LIB_DEBUG(LEVEL_ALERT, "Double Free or NULL"); \ + } + +/** + * check for available destination buffer size before copying source buffer data to destination buffer. + * Assert if destination buffer size less than source buffer size. + */ +#define TAPI_MEMCPY(dest, src, dest_len, src_len) \ + if (dest_len >= src_len) { \ + memcpy(dest, src, src_len); \ + } \ + else { \ + TAPI_LIB_DEBUG(LEVEL_ERR, "TAPI_MEMCPY FAILURE - dest_len(%d) < src_len(%d)", dest_len, src_len); \ + assert(0); \ + } + +/** + * Encode a sequence of binary data into its Base-64 stringified representation. + * + * data : the binary data to encode. + * len : the length of data. + * Returns : a newly allocated, zero-terminated Base-64 encoded string representing data. + * gchar *g_base64_encode (const guchar *data, gsize len); + */ +#define TAPI_BASE64_ENCODE(data, len, encoded_data) \ + encoded_data = g_base64_encode((const guchar *)data, (gsize) len); + +/** + * Decode a sequence of Base-64 encoded text into binary data + * + * text : zero-terminated string with base64 text to decode. + * out_len : The length of the decoded data is written here. + * Returns : a newly allocated buffer containing the binary data that text represents + * guchar *g_base64_decode (const gchar *text, gsize *out_len); + */ +#define TAPI_BASE64_DECODE(text, decoded_data, ptr_out_len) \ + decoded_data = g_base64_decode((const gchar *)text, (gsize *)ptr_out_len); + +/** + * Define Macro for calculate the length of SCA in BCD type. + */ +#define TAPI_GET_LENGTH_FROM_BCD(nLength, rtn) { \ + if (nLength <= 0) { \ + rtn = 0; \ + } \ + else if ((nLength) % 2) { \ + rtn = ((nLength) / 2) + 1; \ + } \ + else { \ + rtn = (nLength) / 2; \ + } \ +} + + +#define TAPI_VALIDATE_EVENTTYPE(val_min ,val_max, type, ret) { \ + if (type < val_min || type > val_max ) { \ + return ret; \ + } \ +} + +/** + * Initialize the in-put & out-put params for the TAPI API's + */ +#define TAPI_GLIB_INIT_PARAMS() \ + GArray* in_param1 = NULL; \ + GArray* in_param2 = NULL; \ + GArray* in_param3 = NULL; \ + GArray* in_param4 = NULL; \ + GArray* out_param1 = NULL; \ + GArray* out_param2 = NULL; \ + GArray* out_param3 = NULL; \ + GArray* out_param4 = NULL; + + +/** + * If alloc fails any where in between IP1 to OP4 then free allocated params, + * and return FLASE to Application who ever called our API. + * + * GArray *g_array_new(gboolean zero_terminated, gboolean clear_ ,guint element_size); + */ +#define TAPI_GLIB_ALLOC_PARAMS(IP1,IP2,IP3,IP4,OP1,OP2,OP3,OP4) \ + IP1 = g_array_new(FALSE, FALSE, sizeof(gchar)); \ + IP2 = g_array_new(FALSE, FALSE, sizeof(gchar)); \ + IP3 = g_array_new(FALSE, FALSE, sizeof(gchar)); \ + IP4 = g_array_new(FALSE, FALSE, sizeof(gchar)); \ + if(IP1 && IP2 && IP3 && IP4) \ + { \ + } \ + else \ + { \ + TAPI_GLIB_FREE_PARAMS(IP1,IP2,IP3,IP4,OP1,OP2,OP3,OP4); \ + return TAPI_API_SYSTEM_OUT_OF_MEM; \ + } + + +/** + * Free any allocated in-put & out-put params + */ +#define TAPI_GLIB_FREE_PARAMS(IP1,IP2,IP3,IP4,OP1,OP2,OP3,OP4) \ + if (IP1) \ + g_array_free(IP1, TRUE); \ + if (IP2) \ + g_array_free(IP2, TRUE); \ + if (IP3) \ + g_array_free(IP3, TRUE); \ + if (IP4) \ + g_array_free(IP4, TRUE); \ + if (OP1) \ + g_array_free(OP1, TRUE); \ + if (OP2) \ + g_array_free(OP2, TRUE); \ + if (OP3) \ + g_array_free(OP3, TRUE); \ + if (OP4) \ + g_array_free(OP4, TRUE); + +#define TAPI_SIGNAL_OBJPATH "/org/projectx/telephony_event" +#define TAPI_SIGNAL_SENDER "org.projectx.telephony_event" +#define TAPI_SIGNAL_MEMBER_ARG0 "ARG0" +#define TAPI_SIGNAL_MEMBER_ARG1 "ARG1" +#define TAPI_SIGNAL_MEMBER_ARG2 "ARG2" +#define TAPI_SIGNAL_MEMBER_ARG3 "ARG3" +#define TAPI_SIGNAL_MEMBER_ARG4 "ARG4" +#define TAPI_SIGNAL_MEMBER_ARG5 "ARG5" +#define TAPI_SIGNAL_MEMBER_GENRESP "GENRESP" + +#define IF_NAME_MAX 100 +/* Generate a unique signal interface name for each dbus message */ +#ifndef TAPI_GET_EVENT_NAME +#define TAPI_GET_EVENT_NAME(TYPE, SIG_IF_NAME) { \ + char *_class = NULL; \ + char *_type = NULL; \ + switch((TYPE >>8)&0xFF)\ + {\ + case TAPI_EVENT_CLASS_CALL_VOICE:\ + _class = "Voicecall"; \ + break;\ + case TAPI_EVENT_CLASS_CALL_DATA:\ + _class = "Datacall"; \ + break;\ + case TAPI_EVENT_CLASS_SIM:\ + _class = "Sim"; \ + break;\ + case TAPI_EVENT_CLASS_NETTEXT:\ + _class = "Nettext"; \ + break;\ + case TAPI_EVENT_CLASS_NETWORK:\ + _class = "Network"; \ + break;\ + case TAPI_EVENT_CLASS_SS:\ + _class = "Ss"; \ + break;\ + case TAPI_EVENT_CLASS_SAT:\ + _class = "Sat"; \ + break;\ + case TAPI_EVENT_CLASS_DATA:\ + _class = "Data"; \ + break;\ + case TAPI_EVENT_CLASS_SOUND:\ + _class = "Sound"; \ + break;\ + case TAPI_EVENT_CLASS_UTIL:\ + _class = "Util"; \ + break;\ + case TAPI_EVENT_CLASS_ERR:\ + _class = "Error"; \ + break;\ + case TAPI_EVENT_CLASS_POWER:\ + _class = "Power"; \ + break;\ + case TAPI_EVENT_CLASS_DISPLAY:\ + _class = "Display"; \ + break;\ + case TAPI_EVENT_CLASS_MISC:\ + _class = "Misc"; \ + break;\ + case TAPI_EVENT_CLASS_CFG:\ + _class = "Cfg"; \ + break;\ + case TAPI_EVENT_CLASS_IMEI:\ + _class = "Imei"; \ + break;\ + case TAPI_EVENT_CLASS_GPS:\ + _class = "Gps"; \ + break;\ + case TAPI_EVENT_CLASS_OMADM:\ + _class = "Omadm"; \ + break;\ + case TAPI_EVENT_CLASS_SVCMODE:\ + _class = "Svcmode"; \ + break;\ + case TAPI_EVENT_CLASS_FACTORY:\ + _class = "Factory"; \ + break;\ + case TAPI_EVENT_CLASS_CALL_E911:\ + _class = "EmergencyCall"; \ + break;\ + case TAPI_EVENT_CLASS_CDMA_DATA:\ + _class = "CdmaData"; \ + break;\ + default:\ + _class = "Unknown"; \ + TAPI_LIB_DEBUG(LEVEL_ERR,"Invalid event class = 0lx%x",(TYPE >>8)&0xFF);\ + }\ + switch(TYPE&0xFF0000)\ + {\ + case TAPI_EVENT_TYPE_NOTIFICATION:\ + _type = "Noti"; \ + break;\ + case TAPI_EVENT_TYPE_CONFIRMATION:\ + _type = "Resp"; \ + break;\ + default:\ + _type = "Unknown"; \ + TAPI_LIB_DEBUG(LEVEL_ERR, "Invalid event type = 0x%lx",TYPE&0xFF0000);\ + }\ + snprintf(SIG_IF_NAME, IF_NAME_MAX, "Telephony.%s.%s_0x%x", _class, _type, TYPE);\ + TAPI_LIB_DEBUG(LEVEL_DEBUG, "event_string = %s", SIG_IF_NAME);\ +} +#endif + +#define TAPI_BACKTRACE { \ + void *buffer[128]; \ + char **strings; \ + int i, nptrs; \ + nptrs = backtrace(buffer, 128); \ + TAPI_LIB_DEBUG(LEVEL_INFO, "backtrace() returned %d addresses", nptrs); \ + strings = backtrace_symbols(buffer, nptrs); \ + if (strings == NULL) { \ + TAPI_LIB_DEBUG(LEVEL_INFO, "backtrace_symbols() failed. (errno=%d)", errno); \ + } \ + else { \ + for (i=0; i + * + * 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. + */ + +/** + * @open + * @ingroup TelephonyAPI + * @addtogroup TAPI_CALL CALL + * @{ + * + * @file TelCall.h + + @brief This file serves as a "C" header file defines structures for Tapi Call Services. \n + It contains a sample set of constants, enums, structs that would be required by applications. + */ + +#ifndef _TEL_CALL_H_ +#define _TEL_CALL_H_ +/*================================================================================================== + INCLUDE FILES + ==================================================================================================*/ +#include +#include +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/*================================================================================================== + CONSTANTS + ==================================================================================================*/ + +/*================================================================================================== + MACROS + ==================================================================================================*/ +#define TAPI_CALLING_NAME_SIZE_MAX 80 /**< The maximum length of the string for calling party name. */ +#define TAPI_CALL_UUS_DATA_LEN_MAX 131 /**< The Maximum length of the user to user singnalling data string. */ +#define TAPI_CALL_DISPLAY_RECORD_MAX 32 /**< The maximum length of the string for display record in CDMA */ +#define MAX_TAPI_CALL_COUNT 6 /**< Maximum number of call can be possible at a time */ +#define MAX_TAPI_CONF_CALL_COUNT 5 /**< Maximum number of Call can be possible in a conference call at a time */ +#define INVALID_CALL_HANDLE 0 /**< TS_UINT is used for call handle */ + +/* Call */ +#define TAPI_CALL_DIALDIGIT_LEN_MAX 82 /**< Maximum Dialling Digit Length */ +#define TAPI_CALL_SUBADDRESS_LEN_MAX 40 /**< Maximum Call Subaddress Length */ +#define TAPI_CALL_NUMBER_LEN_MAX 7 /**< Dialling Num length */ +#define TAPI_CONTEXT_CALL_SIZE_MAX 6 /**< Maximum Call context */ +#define TAPI_CALL_DIAL_NUMBER_LEN_MAX 82 + +#define TAPI_INVALID_CONTEXTHANDLE (HTapiContext)-1 +#define TAPI_CLIENT_SIZE_MAX 30 + + +/*================================================================================================== + ENUMS + ==================================================================================================*/ + +/** + * @enum TelCallCause_t + * This structure defines the values for Call Cause. + */ +typedef enum { + TAPI_CAUSE_SUCCESS, /**< Success */ + TAPI_CAUSE_ACCESSDISCARD, /**< Access discarded */ + TAPI_CAUSE_BARR_BYOPERATOR, /**< Barred by operator */ + TAPI_CAUSE_BEARERMODE_NOTIMPL, /**< Bearer mode not implemented */ + TAPI_CAUSE_BEARERMODE_RESTRICTED, /**< Bearer mode restricted */ + TAPI_CAUSE_BEARERMODE_UNAUTH, /**< Bearer mode un authorized */ + TAPI_CAUSE_BEARERMODE_UNAVAIL, /**< Bearer mode not available */ + TAPI_CAUSE_BUSY, /**< (Network/Server) busy */ + TAPI_CAUSE_CALLMETER_EXPIRED, /**< Call meter expired */ + TAPI_CAUSE_CALLNO_ERROR, /**< Call number error */ + TAPI_CAUSE_CKTUNAVAIL, /**< Circuit channel unavailable */ //10 + TAPI_CAUSE_CONGESTION, /**< Congestion happened */ + TAPI_CAUSE_NO_CIRCUIT_AVAIL, /**< Circuit not available */ + TAPI_CAUSE_DESTIN_INCOMPAT, /**< Destination incompatibility */ + TAPI_CAUSE_DTMF_NOSPEECH, /**< No speech in DTMF */ + TAPI_CAUSE_DTMF_REJECTED, /**< DTMF rejected */ + TAPI_CAUSE_FACILITY_NOTIMPL, /**< Facility not implemented */ + TAPI_CAUSE_FACILITY_NOTSUBSCRIBED, /**< Facility not subscribed */ + TAPI_CAUSE_INCOMINGCUGCALLS_BARRED, /**< Incoming CUG Calls barred */ + TAPI_CAUSE_INVALNUM, /**< Invalid number */ + TAPI_CAUSE_MPTY_ERROR, /**< Multiparty error */ //20 + TAPI_CAUSE_NOANSWER, /**< No answer */ + TAPI_CAUSE_NONCUGMEMBER, /**< Non CUG member */ + TAPI_CAUSE_NUMBERCHANGED, /**< Number changed */ + TAPI_CAUSE_NUMBER_ERROR, /**< Number error */ + TAPI_CAUSE_NWFAILURE, /**< Network failure */ + TAPI_CAUSE_OPERATIONUNAVAIL, /**< Operation not available */ + TAPI_CAUSE_OUTOFORDER, /**< Out of order */ + TAPI_CAUSE_PROTOCOL_ERROR, /**< Protocol error */ + TAPI_CAUSE_QOSUNAVAIL, /**< QOS unavailable */ + TAPI_CAUSE_REJECT, /**< Rejected */ //30 + TAPI_CAUSE_REJ_FAIL, /**< Rejection failed */ + TAPI_CAUSE_REJ_SRVC_NOT_AVL, /**< Rejection service not available */ + TAPI_CAUSE_REMOTE_CKTUNAVAIL, /**< Remote Circuit channel unavailable */ + TAPI_CAUSE_RESOURCEUNAVAIL, /**< Resource not available */ + TAPI_CAUSE_SERVICEID_ERROR, /**< Service id error */ + TAPI_CAUSE_SERVICE_NOTIMPL, /**< Service not implemented */ + TAPI_CAUSE_SERVICE_UNAVAIL, /**< Service not available */ + TAPI_CAUSE_MODIFY_SAME_BEARER, /**< Modify same bearer */ + TAPI_CAUSE_MODIFY_NOT_PERMITTED, /**< Modification not permitted */ + TAPI_CAUSE_HOLD_FAIL, /**< Call hold fail */ //40 + TAPI_CAUSE_TEMPFAILURE, /**< Temporary failure */ + TAPI_CAUSE_WRONGNUM, /**< Wrong number */ + TAPI_CAUSE_NORMAL_UNSPECIFIED, /**< Normal but unspecified */ + TAPI_CAUSE_SSERRINVALIDTIVALUE, /**< SS invalid Transaction ID Value */ + TAPI_CAUSE_SSERRINVALIDTI, /**< SS Invalid transaction ID */ + TAPI_CAUSE_SSINCOMPATIBLESTATE, /**< SS incompatible state */ + TAPI_CAUSE_SSERRSYNTAXERROR, /**< SS syntax error */ + TAPI_CAUSE_SSPROTOCOLERROR, /**< Protocol error */ + TAPI_CAUSE_SSNEGATIVEPASSWORDCHECK, /**< Negative password check */ + TAPI_CAUSE_SSSENTASPHASE1, /**< SS sent as phase1 message */ //50 + TAPI_CAUSE_SSERROR, /**< Supplementary service error */ + TAPI_CAUSE_SS_USSD_BUSY, /**< Second USSD request will be rejected when already USSD transaction is ongoing. */ + TAPI_CAUSE_IDLE, /**< Idle */ + TAPI_CAUSE_NETWORK_SPECIFIC, /**< Network specific error */ + TAPI_CAUSE_FADE, /**< voice call was dropped e.g. because of a loss of signal */ + TAPI_CAUSE_UNKNOWN, /**< unknown no details available */ + TAPI_CAUSE_INCOM_CALL, /**< terminated by incoming call */ + TAPI_CAUSE_ALERT_STOP, /**< terminated by alert stop */ + TAPI_CAUSE_INTERCEPT, /**< voice call was dropped by interception */ + TAPI_CAUSE_REORDER, /**< voice call was dropped by reordering */ //60 + TAPI_CAUSE_CLIENT_END, /**< client ended the call */ + TAPI_CAUSE_ACCESS_CLASS_BLOCKED, /**< access class blocked */ + TAPI_CAUSE_MEMCAPEXCEEDED, /**< Memory capacity exceeded */ + TAPI_CAUSE_TYPENOTSUPPORTED, /**< Type not supported */ + TAPI_CAUSE_REPLACENOTSUPPORTED, /**< Replace not supported */ + TAPI_CAUSE_PROTOCOLID_ERROR, /**< Protocol id error */ + TAPI_CAUSE_CLASSNOTSUPPORTED, /**< Class not supported */ + TAPI_CAUSE_DATACODING_ERROR, /**< Data coding error */ + TAPI_CAUSE_INVAL_MSG, /**< Invalid message */ + TAPI_CAUSE_CALL_BARRED, /**< Call barred */ //70 + TAPI_CAUSE_SIM_CALL_CONTROL_CHANGED_TO_SS, /**< Sim call control changed to SS */ + TAPI_CAUSE_SIM_CALL_CONTROL_CHANGED_TO_CALL, /**< SIM Call control changed to call */ + TAPI_CAUSE_SIM_ERROR, /**< SIM error */ + TAPI_CAUSE_SIM_CALL_CONTROL_MODIFIED, /**< SIM call control modified */ + TAPI_CAUSE_RANDOM_ACCESS_FAILURE, /**< Random access error */ + TAPI_CAUSE_LOWER_LAYER_FAILURE, /**< Lower layer error */ + TAPI_CAUSE_ACCESS_REJECTED, /**< Access rejected */ + TAPI_CAUSE_RESET_NOT_ALLOWED, /**< Reset not allowed */ + TAPI_CAUSE_EMERGENCY_CALL_NOT_ALLOWED, /**< Emergency call not allowed */ + TAPI_CAUSE_ACCESS_NOT_ALLOWED, /**< Access not allowed */ //80 + TAPI_CAUSE_RADIO_LINK_FAILURE, /**< Radio link failure */ + TAPI_CAUSE_INVALID_IDENTITY, /**< Invalid identity */ + TAPI_CAUSE_UNKNOWN_IDENTITY, /**< Unknown identity */ + TAPI_CAUSE_UNACCEPTABLE_IDENTITY, /**< Un acceptable identity */ + TAPI_CAUSE_NO_SERVICE_HERE, /**< No service here */ + TAPI_CAUSE_SERVICE_NOT_ALLOWED, /**< Service not allowed */ + TAPI_CAUSE_SERVICE_NOT_AVAIL, /**< Service not available */ + TAPI_CAUSE_SERVICE_NOT_WORKING, /**< Service not working */ + TAPI_CAUSE_CANNOT_IDENTIFY_CALL, /**< Cannot identify the call */ + TAPI_CAUSE_DEACTIVATION, /**< Deactivation */ //90 + TAPI_CAUSE_FATAL_ERROR, /**< Fatal error */ + TAPI_CAUSE_SEND_DTMF_SUCCESS, /**< Sending DTMF Success */ + TAPI_CAUSE_SEND_DTMF_FAIL, /**< Sending DTMF Failed */ + TAPI_CAUSE_TIMER_EXPIRED, /**< Call Timer Expired */ +} TelCallCause_t; + +/** + * @enum TelTapiEndCause_t + * When a call is ended, this end cause is given with the CALL END notification to the application. This end cause can be originated + * from different elements in the communication path or different modules in the same element. + */ +typedef enum { + TAPI_CALL_END_NO_CAUSE = 0x00, /**< No Cause */ + + TAPI_CC_CAUSE_UNASSIGNED_NUMBER, /**< Unassigned Number */ + TAPI_CC_CAUSE_NO_ROUTE_TO_DEST, /**< No Route to Destination */ + TAPI_CC_CAUSE_CHANNEL_UNACCEPTABLE, /**< Channel Unacceptable */ + TAPI_CC_CAUSE_OPERATOR_DETERMINED_BARRING, /**< Operator Determined Barring */ + TAPI_CC_CAUSE_NORMAL_CALL_CLEARING, /**< Normal Call Clearing */ + + TAPI_CC_CAUSE_USER_BUSY, /**< User Busy */ + TAPI_CC_CAUSE_NO_USER_RESPONDING, /**< No user Responding */ + TAPI_CC_CAUSE_USER_ALERTING_NO_ANSWER, /**< User Alerting no Answer */ + TAPI_CC_CAUSE_CALL_REJECTED, /**< Call Rejected */ + TAPI_CC_CAUSE_NUMBER_CHANGED, /**< Number Changed */ + + TAPI_CC_CAUSE_NON_SELECTED_USER_CLEARING, /**< Non Selected User Clearing */ + TAPI_CC_CAUSE_DESTINATION_OUT_OF_ORDER, /**< Destination out of Order */ + TAPI_CC_CAUSE_INVALID_NUMBER_FORMAT, /**< Invalid Number Format */ + TAPI_CC_CAUSE_FACILITY_REJECTED, /**< Facility Rejected */ + TAPI_CC_CAUSE_RESPONSE_TO_STATUS_ENQUIRY, /**< Response to Status Enquiry */ + + TAPI_CC_CAUSE_NORMAL_UNSPECIFIED, /**< Normal Unspecified */ + TAPI_CC_CAUSE_NO_CIRCUIT_CHANNEL_AVAILABLE, /**< No Circuit Channel Available */ + TAPI_CC_CAUSE_NETWORK_OUT_OF_ORDER, /**< Network out of Order */ + TAPI_CC_CAUSE_TEMPORARY_FAILURE, /**< Temporary Failure */ + TAPI_CC_CAUSE_SWITCHING_EQUIPMENT_CONGESTION, /**< Switching Equipment Congestion */ + + TAPI_CC_CAUSE_ACCESS_INFORMATION_DISCARDED, /**< Access Information Discarded */ + TAPI_CC_CAUSE_REQUESTED_CIRCUIT_CHANNEL_NOT_AVAILABLE, /**< Requested Circuit channel not available */ + TAPI_CC_CAUSE_RESOURCES_UNAVAILABLE_UNSPECIFIED, /**< Resources unavailable unspecified */ + TAPI_CC_CAUSE_QUALITY_OF_SERVICE_UNAVAILABLE, /**< Quality of service unavailable */ + TAPI_CC_CAUSE_REQUESTED_FACILITY_NOT_SUBSCRIBED, /**< Requested facility not subscribed */ + + TAPI_CC_CAUSE_INCOMING_CALL_BARRED_WITHIN_CUG, /**< incomming call barred within CUG */ + TAPI_CC_CAUSE_BEARER_CAPABILITY_NOT_AUTHORISED, /**< Bearer Capability not Authorised */ + TAPI_CC_CAUSE_BEARER_CAPABILITY_NOT_PRESENTLY_AVAILABLE,/**< Bearer capability not presently Available */ + TAPI_CC_CAUSE_SERVICE_OR_OPTION_NOT_AVAILABLE, /**< Service or Option not available */ + TAPI_CC_CAUSE_BEARER_SERVICE_NOT_IMPLEMENTED, /**< Service not implemented */ + + TAPI_CC_CAUSE_ACM_GEQ_ACMMAX, /**< ACM GEQ ACMAX */ + TAPI_CC_CAUSE_REQUESTED_FACILITY_NOT_IMPLEMENTED, /**< Requested facility not implemented */ + TAPI_CC_CAUSE_ONLY_RESTRICTED_DIGITAL_INFO_BC_AVAILABLE,/**< Resticted digital info BC not available */ + TAPI_CC_CAUSE_SERVICE_OR_OPTION_NOT_IMPLEMENTED, /**< Service or Option not Implemented */ + TAPI_CC_CAUSE_INVALID_TRANSACTION_ID_VALUE, /**< Transaction ID value */ + + TAPI_CC_CAUSE_USER_NOT_MEMBER_OF_CUG, /**< Not member of CUG */ + TAPI_CC_CAUSE_INCOMPATIBLE_DESTINATION, /**< Incompatible Destination */ + TAPI_CC_CAUSE_INVALID_TRANSIT_NETWORK_SELECTION, /**< Transit Network selection */ + TAPI_CC_CAUSE_SEMANTICALLY_INCORRECT_MESSAGE, /**< Semantically Incorrect message */ + TAPI_CC_CAUSE_INVALID_MANDATORY_INFORMATION, /**< Invalid Mandatory Message */ + + TAPI_CC_CAUSE_MESSAGE_TYPE_NON_EXISTENT, /**< Message Type Non Existent */ + TAPI_CC_CAUSE_MESSAGE_TYPE_NOT_COMPATIBLE_WITH_PROT_STATE, /**< Message type not compatible with Prot state */ + TAPI_CC_CAUSE_IE_NON_EXISTENT_OR_NOT_IMPLEMENTED, /**< IE non exitent or not implemented */ + TAPI_CC_CAUSE_CONDITIONAL_IE_ERROR, /**< Conditional IE error */ + TAPI_CC_CAUSE_MESSAGE_NOT_COMPATIBLE_WITH_PROTOCOL_STATE, /**< Not Compatible with protocol state */ + + TAPI_CC_CAUSE_RECOVERY_ON_TIMER_EXPIRY, /**< Recovery on timer expiry */ + TAPI_CC_CAUSE_PROTOCOL_ERROR_UNSPECIFIED, /**< Protocol error unspecified */ + TAPI_CC_CAUSE_INTERWORKING_UNSPECIFIED, /**< Interworking unspecified */ + + TAPI_CC_CAUSE_END = 128, + + /* Reject causes*/ + TAPI_REJECT_CAUSE_IMSI_UNKNOWN_IN_HLR, /**< IMSI unknown in HLR */ + TAPI_REJECT_CAUSE_ILLEGAL_MS, /**< Illegal MS */ + TAPI_REJECT_CAUSE_IMSI_UNKNOWN_IN_VLR, /**< IMSI unknown in VLR */ + TAPI_REJECT_CAUSE_IMEI_NOT_ACCEPTED, /**< IMEI not accepted */ + TAPI_REJECT_CAUSE_ILLEGAL_ME, /**< Illegal ME */ + + TAPI_REJECT_CAUSE_GPRS_SERVICES_NOT_ALLOWED, /**< GPRS service not allowed */ + TAPI_REJECT_CAUSE_GPRS_SERVICES_AND_NON_GPRS_SERVICES_NOT_ALLOWED, /**< GPRS services and Non-GPRS services not allowed */ + TAPI_REJECT_CAUSE_MS_IDENTITY_CANNOT_BE_DERIVED_BY_THE_NETWORK, /**< MS device cannot be derived by the network */ + TAPI_REJECT_CAUSE_IMPLICITLY_DETACHED, /**< Implicitly detached */ + TAPI_REJECT_CAUSE_PLMN_NOT_ALLOWED, /**< PLMN not allowed */ + + TAPI_REJECT_CAUSE_LA_NOT_ALLOWED, /**< LA not allowed */ + TAPI_REJECT_CAUSE_NATIONAL_ROAMING_NOT_ALLOWED, /**< National roaming not allowed */ + TAPI_REJECT_CAUSE_GPRS_SERVICES_NOT_ALLOWED_IN_THIS_PLMN, /**< GPRS services not allowed in this PLMN */ + TAPI_REJECT_CAUSE_NO_SUITABLE_CELLS_IN_LA, /**< No suitable cells in the LA */ + TAPI_REJECT_CAUSE_MSC_TEMPORARILY_NOT_REACHABLE, /**< MSC temporarily not reachable */ + + TAPI_REJECT_CAUSE_NETWORK_FAILURE, /**< Network unavailable */ + TAPI_REJECT_CAUSE_MAC_FAILURE, /**< MAC failure */ + TAPI_REJECT_CAUSE_SYNCH_FAILURE, /**< SYNCh failure */ + TAPI_REJECT_CAUSE_CONGESTTION, /**< Congestion */ + TAPI_REJECT_CAUSE_GSM_AUTH_UNACCEPTED, /**< GSM Auth unaccepted */ + + TAPI_REJECT_CAUSE_SERVICE_OPTION_NOT_SUPPORTED, /**< Service option not supported */ + TAPI_REJECT_CAUSE_REQ_SERV_OPT_NOT_SUBSCRIBED, /**< REQ_SERV option not suscribed */ + TAPI_REJECT_CAUSE_SERVICE_OPT__OUT_OF_ORDER, /**< Service OPT out of order */ + TAPI_REJECT_CAUSE_CALL_CANNOT_BE_IDENTIFIED, /**< Call cannot be identified */ + TAPI_REJECT_CAUSE_NO_PDP_CONTEXT_ACTIVATED, /**< No PDP context Activated */ + + TAPI_REJECT_CAUSE_RETRY_UPON_ENTRY_INTO_A_NEW_CELL_MIN_VALUE, /**< Retry upon entry into a new call min value */ + TAPI_REJECT_CAUSE_RETRY_UPON_ENTRY_INTO_A_NEW_CELL_MAX_VALUE, /**< Retry upon entry into a new call max value */ + TAPI_REJECT_CAUSE_SEMANTICALLY_INCORRECT_MSG, /**< Semantically incorret message */ + TAPI_REJECT_CAUSE_INVALID_MANDATORY_INFO, /**< Invalid mandatory information */ + TAPI_REJECT_CAUSE_MESSAGE_TYPE_NON_EXISTANT, /**< Message type non-existant */ + + TAPI_REJECT_CAUSE_MESSAGE_TYPE_NOT_COMP_PRT_ST, /**< Message type not COMP PRT ST */ + TAPI_REJECT_CAUSE_IE_NON_EXISTANT, /**< IE not existant */ + TAPI_REJECT_CAUSE_MSG_NOT_COMPATIBLE_PROTOCOL_STATE, /**< MSG not compatible protocol state */ + + /* Connection Management establishment rejection cause */ + TAPI_REJECT_CAUSE_REJ_UNSPECIFIED, /**< rej unspecified */ + + /* AS reject causes */ + TAPI_REJECT_CAUSE_AS_REJ_RR_REL_IND, /**< RR release indication */ + TAPI_REJECT_CAUSE_AS_REJ_RR_RANDOM_ACCESS_FAILURE, /**< Random Access Failure */ + TAPI_REJECT_CAUSE_AS_REJ_RRC_REL_IND, /**< RRC release indication */ + TAPI_REJECT_CAUSE_AS_REJ_RRC_CLOSE_SESSION_IND, /**< RRC close session indication */ + TAPI_REJECT_CAUSE_AS_REJ_RRC_OPEN_SESSION_FAILURE, /**< RRC open session failure */ + TAPI_REJECT_CAUSE_AS_REJ_LOW_LEVEL_FAIL, /**< Low level failure */ + TAPI_REJECT_CAUSE_AS_REJ_LOW_LEVEL_FAIL_REDIAL_NOT_ALLOWED, /**< Low level failure redial not alowed */ + TAPI_REJECT_CAUSE_AS_REJ_LOW_LEVEL_IMMED_RETRY, /**< low level immediate retry */ + + /* MM reject causes */ + TAPI_REJECT_CAUSE_MM_REJ_INVALID_SIM, /**< invalid Sim */ + TAPI_REJECT_CAUSE_MM_REJ_NO_SERVICE, /**< No service */ + TAPI_REJECT_CAUSE_MM_REJ_TIMER_T3230_EXP, /**< Timer T3230 expire */ + TAPI_REJECT_CAUSE_MM_REJ_NO_CELL_AVAILABLE, /**< No call available */ + TAPI_REJECT_CAUSE_MM_REJ_WRONG_STATE, /**< wrong state */ + TAPI_REJECT_CAUSE_MM_REJ_ACCESS_CLASS_BLOCKED, /**< Access class blocked */ + + /* Definitions for release ind causes between MM and CNM*/ + TAPI_REJECT_CAUSE_ABORT_MSG_RECEIVED, /**< Abort Message received */ + TAPI_REJECT_CAUSE_OTHER_CAUSE, /**< Other cause */ + + /* CNM reject causes */ + TAPI_REJECT_CAUSE_CNM_REJ_TIMER_T303_EXP, /**< Timer T303 expiry */ + TAPI_REJECT_CAUSE_CNM_REJ_NO_RESOURCES, /**< Rejected due to unavailibilty of resources */ + TAPI_REJECT_CAUSE_CNM_MM_REL_PENDING, /**< MM release pending */ + TAPI_REJECT_CAUSE_CNM_INVALID_USER_DATA, /**< Invalid user data */ + TAPI_CALL_END_CAUSE_MAX = 255, /**< Maximum End Cause limit for gsm/wcdma */ + + /* CDMA CALL END CAUSE */ + TAPI_CDMA_END_CAUSE_REL_BY_USER = 0x1001, /**< Call Released by User */ + TAPI_CDMA_END_CAUSE_REL_BY_NET, /**< Call Released by Network */ + TAPI_CDMA_END_CAUSE_REL_NET_BUSY, /**< Call Released because of Network busy */ + TAPI_CDMA_END_CAUSE_NO_SVC, /**< Call Released because of No Service area */ + TAPI_CDMA_END_CAUSE_FADING, /**< Call Released because of Fading */ + TAPI_CDMA_END_CAUSE_RELEASE_BY_REORDER, /**< Call Released because of reorder */ + TAPI_CDMA_END_CAUSE_RELEASE_BY_INTERCEPT, /**< Call Released because of intercept */ + TAPI_CDMA_END_CAUSE_SILENT_ZONE_RETRY, /**< Call Released because of silent zone retry */ + TAPI_CDMA_END_CAUSE_OTA_CALL_FAIL, /**< Call Released because of OTA cal failure */ + TAPI_CDMA_END_CAUSE_PHONE_OFFLINE, /**< Call Released because of phone offline */ + TAPI_CDMA_END_CAUSE_PHONE_IS_CDMA_LOCKED, /**< Call Released because of CDMA locked */ + TAPI_CDMA_END_CAUSE_FLASH_IS_IN_PROGRESS_ERR, /**< Call Released because of flash-is-in-progress error */ + TAPI_CDMA_END_CAUSE_E911_MODE_ERR, /**< Call Released because of e911 mode */ + TAPI_CDMA_END_CAUSE_OTHERS, /**< Call Released by Others */ + TAPI_CDMA_END_CAUSE_MAX /**< Maximum End Cause limit for cdma */ +} TelTapiEndCause_t; + +/** + * @enum TelConferenceCallState_t + * This enum defines the call conference states + */ +typedef enum { + TAPI_CALL_CONFERENCE_IDLE, /**< idle */ + TAPI_CALL_CONFERENCE_ACTIVE /**< active */ +} TelConferenceCallState_t; + +/** + * @enum TelCallStates_t + * Applications can use these sates or can have their own states. + */ +typedef enum { + TAPI_CALL_STATE_IDLE, /**< Call is in idle state - i.e. no call */ + TAPI_CALL_STATE_ORIG, /**< Call is in origination state */ + TAPI_CALL_STATE_SETUPIND, /**< Call is in setup state */ + TAPI_CALL_STATE_CONNECTING, /**< Call is in connecting state */ + TAPI_CALL_STATE_ALERT, /**< Call is in alerting state */ + TAPI_CALL_STATE_INCOM, /**< Call is in incoming state */ + TAPI_CALL_STATE_ANSWER, /**< Call is in answered state, and waiting for connected indication event */ + TAPI_CALL_STATE_CONV, /**< Call is in connected and conversation state */ + TAPI_CALL_STATE_ENDING, /**< Call is in end-requested state */ + TAPI_CALL_STATE_END, /**< Call is in disconnected state */ + TAPI_CALL_STATE_INVALID /**< Call is in invalid(unknown) state */ +} TelCallStates_t; + +/** + * IN GSM ONLY: call identification number. + */ +typedef enum { + TAPI_CALL_ACTIVE_LINE1, /**< Line 1 */ + TAPI_CALL_ACTIVE_LINE2 /**< Line 2 */ +} TelCallActiveLine_t; + +typedef enum { + TAPI_CALL_UUS_NONE, /**< No User to User information */ + TAPI_CALL_UUS_1, /**< User to User information 1 */ +} TelCallUusType_t; + +/** + * The Incoming call indication could have be one of the following SS info messages in it. + */ +typedef enum { + /* Number details are present in the "char number" of call info struct. if number is not present + then "no cli cause" member in mt_ss_info is set accordingly. */ + TAPI_CALL_MT_CLI_PRESENT = 0x31, + + /* Calling Name Info presnet, TelCallingNameInfo_t of call info struct contains this info. */ + TAPI_CALL_MT_CNA_PRESENT = 0x32, + + /* Undefined ss indication. Ignore mt_ss_info */ + TAPI_CALL_MT_SS_UNDEFINED = 0x00, + +} TelCallMtSSInfo_t; + +/** + * @enum TelCallAnswerType_t + * Answer type used as in parameter in the answer call API. + */ +typedef enum { + TAPI_CALL_ANSWER_ACCEPT = 0, /**< Used to answer an incoming call when there are no current active calls. */ + TAPI_CALL_ANSWER_REJECT, /**< Used to reject the incoming call */ + TAPI_CALL_ANSWER_REPLACE, /**< Release current active call and accept the */ + TAPI_CALL_ANSWER_HOLD_AND_ACCEPT, /**< Hold the current active call, and accept the wating call */ +} TelCallAnswerType_t; + +/** + * @enum TelCallType_t + * Applications needs to use this call type while using the setup call API. Like the requested call is a voice call or video call. + */ +typedef enum { + TAPI_CALL_TYPE_VOICE, /**< Voice call type. */// in ipcv4, 0x0100 + TAPI_CALL_TYPE_DATA, /**< Data call type - (for modem, fax, packet, etc. calls). */// in ipcv4, 0x0200 + TAPI_CALL_TYPE_E911 /**< Emergency call type. */// in ipcv4, 0x0700 +} TelCallType_t; + +/** + * @enum TelCallAlertingPattern_t + * This enumeration defines the different alerting patterns available. + */ +typedef enum { + TAPI_CALL_ALERTING_PATTERN_1 = 0x00, /**< Pattern 1 */ + TAPI_CALL_ALERTING_PATTERN_2 = 0x01, /**< Pattern 2 */ + TAPI_CALL_ALERTING_PATTERN_3 = 0x02, /**< Pattern 3 */ + TAPI_CALL_ALERTING_PATTERN_4 = 0x03, /**< Pattern 4 */ + TAPI_CALL_ALERTING_PATTERN_5 = 0x04, /**< Pattern 5 */ + TAPI_CALL_ALERTING_PATTERN_6 = 0x05, /**< Pattern 6 */ + TAPI_CALL_ALERTING_PATTERN_7 = 0x06, /**< Pattern 7 */ + TAPI_CALL_ALERTING_PATTERN_8 = 0x07, /**< Pattern 8 */ + TAPI_CALL_NO_ALERTING_PATTERN = 0x08 /**< No Alerting Pattern */ +} TelCallAlertingPattern_t; + +/** + * @enum TelCallActiveState_t + * State of the current call. + */ +typedef enum { + TAPI_CALL_CONNECT_IDLE, /**< Call is in Idle state. */ + TAPI_CALL_CONNECT_ACTIVE, /**< Call is in Active state.*/ + TAPI_CALL_CONNECT_HELD /**< Call is in Held state. */ +} TelCallActiveState_t; + +/** + * @enum TelCallCugOptions_t + * This enumeration defines the closed user group options + */ +typedef enum { + TAPI_CALL_CUG_NO_INFO = 0x00, /**< No information */ + TAPI_CALL_CUG_SUPRESS_OA, /**< suppress OA */ + TAPI_CALL_CUG_SUPRESS_PRF_CUG, /**< suppress preferential CUG */ + TAPI_CALL_CUG_SUPRESS_OA_AND_CUG /**< suppress OA and preferential CUG */ +} TelCallCugOptions_t; + +/** + * @enum TelCallUusProtocolType_t + * This enumeration defines the tapi call uus protocol types + */ +typedef enum { + TAPI_CALL_UUS_PROTO_SPECIFIC = 0, /**< The user information is structured according to user needs. */ + TAPI_CALL_UUS_PROTO_OSI_HIGHER_LAYER = 1, /**< OSI high layer protocols */ + TAPI_CALL_UUS_PROTO_IA5_CHARS = 4, /**< user information consists of IA5 characters */ + TAPI_CALL_UUS_PROTO_V120 = 7, /**< rate adaptation */ + TAPI_CALL_UUS_PROTO_Q931 = 8 /**< user-network call control messages */ +} TelCallUusProtocolType_t; + +/** + * @enum TelCallNameMode_t + * This enumeration defines the call name mode + */ +typedef enum { + TAPI_CALL_NAME_AVAIL = 0, /**< This identifier refers to the presentation of the calling party's name identity to the called party. */ + TAPI_CALL_NAME_RESTRICTED = 1, /**< This identifier refers to the restriction of presentation of the name identity of the calling party to the called party. */ + TAPI_CALL_NAME_UNAVAIL = 2, /**< This identifier refers to the unavailability of the calling party's name identity to be offered to the called party. */ + TAPI_CALL_NAME_AVAIL_RESTRICTED = 3 /**< This identifier refers to the calling party's name identity to be offered to the called party with which presentation restriction is overridden. */ +} TelCallNameMode_t; + +/** + * @enum TelCallSSNocliCause_t + * This enumeration defines the value for "No Cli cause". + */ +typedef enum { + TAPI_SS_NO_CLI_CAUSE_UNAVAILABLE = 0x00, /**< Unavailable */ + TAPI_SS_NO_CLI_CAUSE_REJECTBY_USER = 0x01, /**< Rejected by User */ + TAPI_SS_NO_CLI_CAUSE_INTERACTION_OTHERSERVICES = 0x02, /**< Other services */ + TAPI_SS_NO_CLI_CAUSE_COINLINE_PAYPHONE = 0x03, /**< Coin line phone */ + TAPI_SS_NO_CLI_CAUSE_MAX /**< maximum usage */ +} TelCallSSNocliCause_t; + +/** + * Fwded Ind Type used for MO and Mt from SS Noti Info + */ +typedef enum { + TAPI_CALL_OUTGOING_FWDED = 0x00, /* Outgoing call forwarded */ + TAPI_CALL_INCOMMING_FWDED = 0x01, /* Incoming call forwarded */ +} TelCallForwardType_t; + +/** + * @enum TelCallPrivacyMode_t + * This structure contains the voice privacy option mode(CDMA only). + */ +typedef enum { + TAPI_CALL_PRIVACY_MODE_STANDARD = 0x00, /**< Standard mode */ + TAPI_CALL_PRIVACY_MODE_ENHANCED /**< Enhanced mode */ +} TelCallPrivacyMode_t; + +/** + * @enum TelCallPrivacyType_t + * This structure contains the voice privacy request type(CDMA only). + */ +typedef enum { + TAPI_CALL_PRIVACY_TYPE_MS = 0x01, /**< Mobile Station Voice Privacy Mode */ + TAPI_CALL_PRIVACY_TYPE_BS, /**< Base Station Voice Privacy Mode */ + TAPI_CALL_PRIVACY_TYPE_CURRENT /**< Current Serving Privacy Mode */ +} TelCallPrivacyType_t; + +/** + * @enum TelCallEmergecyMode_t + * This structure contains the emergency callback mode(CDMA only). + */ +typedef enum { + TAPI_CALL_EMERGENCY_MODE_EXIT, /**< Emergency CB Exit mode */ + TAPI_CALL_EMERGENCY_MODE_ENTER /**< Emergency CB Enter mode */ +} TelCallEmergecyMode_t; + +/** + * @enum TelCallOtaType_t + * This structure contains the OTA type(CDMA only). + */ +typedef enum { + TAPI_CALL_OTATYPE_OTASP = 0x01, /**< OTASP : mobile initiated OTA*/ + TAPI_CALL_OTATYPE_OTAPA, /**< OTAPA : network initiated OTA */ +} TelCallOtaType_t; + +/** + * @enum TelCallOtaspStatus_t + * This structure contains the OTASP Status(CDMA only). + */ +typedef enum { + TAPI_CALL_OTASP_OK_SPL_UNLOCKED = 0x01, /**< OTASP : SPL unlocked ok*/ + TAPI_CALL_OTASP_OK_AKEY_EXCESS, /**< OTASP : A-Key excess ok*/ + TAPI_CALL_OTASP_OK_SSD_UPDATE, /**< OTASP : SSD update ok */ + TAPI_CALL_OTASP_OK_NAM_DWNLD, /**< OTASP : NAM download ok */ + TAPI_CALL_OTASP_OK_MDN_DWNLD, /**< OTASP : MDN download ok */ + TAPI_CALL_OTASP_OK_IMSI_DWNLD, /**< OTASP : IMSI download ok*/ + TAPI_CALL_OTASP_OK_PRL_DWNLD, /**< OTASP : PRL download ok */ + TAPI_CALL_OTASP_OK_COMMIT, /**< OTASP : commit ok */ + TAPI_CALL_OTASP_OK_PROGRAMMING, /**< OTASP : programming ok */ + TAPI_CALL_OTASP_SUCCESS, /**< OTASP : success */ + TAPI_CALL_OTASP_UNSUCCESS, /**< OTASP : unsuccess */ + TAPI_CALL_OTASP_OK_OTAPA_VERIFY, /**< OTASP : verify ok */ + TAPI_CALL_OTASP_PROGRESS, /**< OTASP : progress */ + TAPI_CALL_OTASP_FAILURES_EXCESS_SPC, /**< OTASP : SPC excess failure */ + TAPI_CALL_OTASP_LOCK_CODE_PW_SET, /**< OTASP : lock code password set*/ +} TelCallOtaspStatus_t; + +/** + * @enum TelCallOtapaStatus_t + * This structure contains the OTAPA Status(CDMA only). + */ +typedef enum { + TAPI_CALL_OTAPA_STOP = 0x00, /**< OTAPA : stop */ + TAPI_CALL_OTAPA_START, /**< OTAPA : start */ +} TelCallOtapaStatus_t; + +/** + * @enum TelCallTimeMaskType_t + * This structure contains call time request mask type. + */ +typedef enum { + TAPI_CALL_TIME_TYPE_TOTAL_CALL_CNT = 0x01, /**< Total Call Count Mask */ + TAPI_CALL_TIME_TYPE_TOTAL_CALL_TIME = 0x02, /**< Total Call Time Mask */ + TAPI_CALL_TIME_TYPE_LAST_CALL_TIME = 0x04, /**< Last Call Time Mask */ +} TelCallTimeMaskType_t; + +/** + * @enum TelCallToneDuration_t + * This structure contains dtmf tone length. + */ +typedef enum { + TAPI_CALL_TONE_DURATION_SHORT = 0x01, + TAPI_CALL_TONE_DURATION_LONG +} TelCallToneDuration_t; + +/** + * @enum TelCallEmergencyCategory_t + * This structure contains emergency category type + */ +typedef enum { + TAPI_CALL_ECC_DEFAULT = 0x00, + TAPI_CALL_ECC_POLICE = 0x01, + TAPI_CALL_ECC_AMBULANCE = 0x02, + TAPI_CALL_ECC_FIREBRIGADE = 0x04, + TAPI_CALL_ECC_MARINEGUARD = 0x08, + TAPI_CALL_ECC_MOUNTAINRESCUE = 0x10, + TAPI_CALL_ECC_MANUAL_ECALL = 0x20, + TAPI_CALL_ECCY_AUTO_ECALL = 0x40 +} TelCallEmergencyCategory_t; + +typedef enum { + TAPI_CALL_IDENTITY_DEFAULT, /**< Calling line identity will be sent. Based on network setting, Line identity will presented to the called party. */ + TAPI_CALL_IDENTITY_SHOW, /**< Display calling line identity */ + TAPI_CALL_IDENTITY_HIDE /**< Hide the display of Calling line identity */ +} TelCallIdentityMode_t; + + +/** + * context type + */ +typedef enum { + TAPI_CONTEXT_TYPE_NONE = 0x00, + TAPI_CONTEXT_TYPE_VOICE_CALL = 0x01, + TAPI_CONTEXT_TYPE_DATA_CALL = 0x2, + TAPI_CONTEXT_TYPE_VIDEO_CALL = 0x3, + TAPI_CONTEXT_TYPE_NETTEXT, + TAPI_CONTEXT_TYPE_E911, +} TapiContextType; + + +/** + * Timer State and or Call Timer ID + */ +typedef enum { + TAPI_CALL_TSTATE_IDLE = 0x00, /**< No timer running */ + TAPI_CALL_TSTATE_SETUP_PENDING, /**< Setup Timer */ + TAPI_CALL_TSTATE_CONNECT_PENDING, /**< Connected Timer */ + TAPI_CALL_TSTATE_END_PENDING, /**< Release Timer */ + TAPI_CALL_TSTATE_HOLD_PENDING, /**< Hold Timer */ + TAPI_CALL_TSTATE_RETRIEVE_PENDING, /**< Retrieve Timer */ + TAPI_CALL_TSTATE_JOIN_PENDING, /**< Join Timer */ + TAPI_CALL_TSTATE_SPLIT_PENDING, /**< Split Timer */ + TAPI_CALL_TSTATE_ECT_PENDING, /**< ECT Timer */ + TAPI_CALL_TSTATE_DTMF_PENDING, /**< DTMF Timer */ +} TelTapiCallTimerState; + + +/*================================================================================================== + STRUCTURES AND OTHER TYPEDEFS + ==================================================================================================*/ + +typedef struct { + TS_BOOL bRequestedBySAT; /** This flag is to indicate whether the request has been initiated by SAT or not.Possible values are 0 and 1. This flag should be updated only when originating a setup request */ + TelCallIdentityMode_t IdentityMode; /**< Sets Calling Line Identity mode. If default value TAPI_IDENTITY_DEFAULT is set, OEM will set the default value. */ + TelCallEmergencyCategory_t ecc; +} tel_set_call_satflag_identiymode; + +/** + * This structure contains information about the redirect destination information. + */ +typedef struct { + unsigned char number[TAPI_CALL_DIAL_NUMBER_LEN_MAX + 1]; /**< Redirect destination number */ +} TelCallDeflectDstInfo_t; + +/** + * This structure defines the calling name information + */ +typedef struct { + TelCallNameMode_t NameMode; /**< Display mode of the szNameData. */ + char szNameData[TAPI_CALLING_NAME_SIZE_MAX]; /**< Calling party name string. */ +} TelCallingNameInfo_t; + +/** + * This structure contains information about an outgoing call. + */ +typedef struct { + TelCallType_t CallType; /**< sets type of call (voice, data, video, emergency) */ + char szNumber[TAPI_CALL_DIALDIGIT_LEN_MAX + 1]; /**< A string containing the destination phone number. This follows the dial number format.*/ +} TelCallSetupParams_t; + +/** + * This structure contains information about call status. + */ +typedef struct { + int bMoCall; /**< Status will be yes for MO Call. If MT call, then FALSE*/ + char pNumber[TAPI_CALL_DIALDIGIT_LEN_MAX + 1]; /**< Mobile Number */ + TelCallType_t CallType; /**< Specifies type of call (voice, data, emergency) */ + TelCallStates_t CallState; /**< Current Call state */ + TelCallActiveState_t CallActiveState; /**< Current Active state */ + int bConferenceState; /**< Whether Call is in Conference or not*/ +} TelCallStatus_t; + +/** + * This structure contains information about Call end information. + */ +typedef struct { + TelTapiEndCause_t CallEndCause; /**< End cause for the call indicates whether the call is released normally or due to other cause*/ + unsigned int pCallHandle; /**< Call handle*/ + unsigned int CallStartTime; /**< Start time of the call(time in secs) */ + unsigned int CallEndTime; /**< End time of the call(time in secs)*/ +} TelCallEndInfo_t; + +/** + * This structure contains information about call redirection details. + */ +typedef struct { + char szRedirectedNumber[TAPI_CALL_DIALDIGIT_LEN_MAX + 1]; /**< Redirected party number */ + char szRedirectSubAddress[TAPI_CALL_SUBADDRESS_LEN_MAX + 1]; /**< Redirect party sub-address */ +} TelCallRedirectionInfo_t; + +/** + * This structure contains the incoming call information. + */ +typedef struct { + unsigned int CallHandle; /**< At Foundation API Level, Call handle indicates the Handle of the Call for the Application . At Framework API Level, call handle indicates the Call identifier used for call by the OEM Adaptation Layer Plug-in */ + TelCallType_t CallType; /**< Call type */ + TelSsLineIdentificationType_t CliPresentationIndicator; /**< Calling Party presentation indicator */ + char szCallingPartyNumber[TAPI_CALL_DIALDIGIT_LEN_MAX + 1]; /**< caller number,null terminated ASCII */ + TelCallingNameInfo_t CallingNameInfo; /**< Call name info. If there is no information from network, this information will be NULL.*/ + TelCallRedirectionInfo_t RedirectInfo; /**< The data for the Call Redirect information. If there is no information from network, this information will be NULL. */ + TelCallSSNocliCause_t CliCause; /**< No of CLI cause */ + int fwded; /**< True or false. If Incoming call is a forwarded call, then true else false. */ + TelCallActiveLine_t ActiveLine; /**< Current Active Line */ +} TelCallIncomingCallInfo_t; + +/** + *SS Info message. + */ +typedef struct { + TelCallMtSSInfo_t type; /* Type of the SS Info presnet. */ + TelCallSSNocliCause_t no_cli_cause; +} TelCallMtSsInfo_t; // not used + +typedef struct { + int isMobileOriginated; /* Is this call Mobile Originated? */ + TelCallNameMode_t nameMode; /* Calling Party Name availability mode */ + char callNumber[TAPI_CALL_DIALDIGIT_LEN_MAX + 1]; /* A character array of the destination address. This follows the dial callNumber format. */ + unsigned int startTime; /* Time when a call is started */ + unsigned int endTime; /* Time when a call is ended */ + TelCallType_t callType; /* Type of a call */ + TelCallStates_t callState; /* State of a call */ + TelCallActiveState_t activeState; /* Status of a call */ + TelConferenceCallState_t conferenceState; /* State of a conference call */ + TelCallingNameInfo_t callingNameInfo; /* Calling name information of a call */ + TelCallActiveLine_t current_line; /* Line information of a call */ + TelCallCause_t cause; /* End type of a call when a call is ended */ + TelTapiEndCause_t endCause; /* EndCause */ +} TelTapiCallInfo_t; + +/** + * This structure contains the connected number information. + */ +typedef struct { + TelCallSSNocliCause_t no_cli_cause; /**< Cause when no CLI number. */ + unsigned char dcs; /**< DCS */ + unsigned char number_type; /**< Number type */ + TelCallNameMode_t name_mode; /**< Display mode of the name. */ + char number[TAPI_CALL_DIALDIGIT_LEN_MAX + 1]; /**< Caller number, null terminated ASCII */ + char sub_address[TAPI_CALL_SUBADDRESS_LEN_MAX + 1]; /**< Called sub-address, null terminated ASCII */ +} TelCallConnectedNumberInfo_t; + +/** + * This structure contains the voice privacy info(CDMA only). + */ +typedef struct { + TelCallPrivacyType_t PrivacyType; /**< Voice Privacy Request Type */ + TelCallPrivacyMode_t PrivacyMode; /**< Voice Privacy Mode */ +} TelCallVoicePrivacyInfo_t; + +/** + * This structure contains the OTA progress indication information(CDMA only). + */ +typedef struct { + TelCallOtaType_t OtaType; /**< OTA type */ + TelCallOtaspStatus_t OtaspStatus; /**< OTASP status : if OTA type is OTASP, it is valid */ + TelCallOtapaStatus_t OtapaStatus; /**< OTAPA status : if OTA type is OTAPA, it is valid */ +} TelCallOtaProgressInfo_t; + +/** + * This structure contains information about a call time and call count. + */ +typedef struct { + unsigned short req_type_mask; /**< call time request type */ + unsigned long TotalCallCnt; /**< Total Call Count */ + unsigned long OutgoingCallCnt; /**< Outgoing Call Count */ + unsigned long IncomingCallCnt; /**< Incoming Call Count */ + unsigned long TotalCallTime; /**< Overall Call Time(Outgoing + Incoming, in second) */ + unsigned long OutgoingCallTime; /**< Overall Outgoing Call Time(in second) */ + unsigned long IncomingCallTime; /**< Overall Incoming Call Time(in second) */ + unsigned long LastCallTime; /**< Last Call Time(in second) */ +} TelCallTimeInfo_t; + +/** + * This structure contains information about display record in CDMA. + */ +typedef struct { + unsigned char Record[TAPI_CALL_DISPLAY_RECORD_MAX + 1]; /**< display record */ +} TelCallDisplayRecordInfo_t; + + +/** + * context handle + */ +typedef TS_UINT HTapiContext; + +typedef struct { + TS_BOOL bUsed; /* This slot is used or not */ + int eventClass; /* Event group to notify */ + TapiCallback callback; /* callback function pointer of the application */ +} TapiClient; + +typedef struct _TapiContext { + TapiContextType type; + TS_BOOL bUsed; + HTapiContext hContext; + TapiClient *pClient; /* the client that has ownership on this call */ +} TapiContext; + + +/** + * Call Timer object + */ +typedef struct { + TelTapiCallTimerState t_state; /**< Timer State Map to Publish Call RSP Event */ + int source_id; /**< Unique Timer Source ID. Returned by g_timeout_add() */ +} TelTapiCallTimer_t; + +/** + * structure of voice call information + */ +typedef struct _TapiCallContext { + TapiContextType type; /* Voice or Video */ + TS_BOOL bUsed; + TS_UINT CallHandle; + int call_number; /* Call Id of OEM layer */ + TelTapiCallInfo_t callInfo; + TelCallForwardType_t forwardIndType; + TelCallConnectedNumberInfo_t connected_info; + int requestId; + TelTapiCallTimer_t timer_obj; /** + * + * 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. + */ + +/** + * @internal + * @ingroup TELEPHONY_API + * @addtogroup Data_Service Data Services + * @{ + * @file TelData.h + * + * Data APIs allow an application to accomplish the following services: @n + * - process data pin control. @n + */ + +#ifndef _TEL_DATA_H +#define _TEL_DATA_H + +/*================================================================================================== + INCLUDE FILES + ==================================================================================================*/ +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/*================================================================================================== + CONSTANTS + ==================================================================================================*/ + +/*================================================================================================== + MACROS + ==================================================================================================*/ +#define TAPI_DATA_MAX_DIAL_NUM_LEN 32 /** Maximum length of dial number */ +#define TAPI_DATA_MIP_CONNECT_SUCCESS 0xFF /** For Sprint */ +#define TAPI_DATA_MAX_USER_NAI_LEN 72 /** Maximum length of user NAI */ +#define TAPI_DATA_MAX_SHARED_SECRET_LEN 16 /** Maximum length of shared secret */ + +#define TAPI_DATA_MAX_PKT_DATA_ORIGINSTRING_LEN 16 /** Maximum length of Packet data origin string */ +#define TAPI_DATA_MAX_PAP_USER_ID_LEN 64 /** Maximum length of Packet PAP user ID */ +#define TAPI_DATA_MAX_PAP_USER_PASSWORD_LEN 14 /** Maximum length of Packet PAP password */ + +/*================================================================================================== + ENUMS + ==================================================================================================*/ + +typedef enum { + TAPI_DATA_NO_ERR = 0x00, /**< There is no error for any data operation. */ + TAPI_DATA_PARAMETER_ERR, /**< There is no error for any data operation. */ + TAPI_DATA_OFFLINE_ERR, /**< This error is sent when any network option is tried when phone is in offline mode */ + TAPI_DATA_OTHER_ERR /**< This error to indicate other failure */ +} TelDataOperationCause_t; + +/** + * @enum TelDataSignalType + * Data Signal Type + */ +typedef enum { + TAPI_DATA_SIGNAL_DCD = 0x01, /**< DCD Signal */ + TAPI_DATA_SIGNAL_DTR = 0x04, /**< DTR Signal */ + TAPI_DATA_SIGNAL_DSR = 0x06, /**< DSR Signal */ + TAPI_DATA_SIGNAL_RTS = 0x07, /**< RTS Signal */ + TAPI_DATA_SIGNAL_CTS = 0x08, /**< CTS Signal */ + TAPI_DATA_SIGNAL_RI = 0x09, /**< RI Signal */ +} TelDataSignalType_t; + +/** + * @enum TelDataSignalStatus + * Data Signal Status + */ +typedef enum { + TAPI_DATA_SIGNAL_STATUS_OFF = 0x00, /**< Signal Status Off */ + TAPI_DATA_SIGNAL_STATUS_ON = 0x01 /**< Signal Status On */ +} TelDataSignalStatus_t; + +typedef enum { + TAPI_DATA_TE2_TYPE_UART = 0x00, + TAPI_DATA_TE2_TYPE_USB = 0x01, + TAPI_DATA_TE2_TYPE_BLUETOOTH = 0x02 +} TelDataTE2Type_t; + +typedef enum { + TAPI_DATA_TE2_DETACHED = 0x00, + TAPI_DATA_TE2_ATTACHED = 0x01 +} TelDataTE2CableStatus_t; + +typedef enum { + TAPI_DATA_CALL_TYPE_DEFAULT = 0x00, + TAPI_DATA_CALL_TYPE_FAX_FOR_NEXT_CALL = 0x01, + TAPI_DATA_CALL_TYPE_FAX_FOR_ALL_CALLS = 0x02, + TAPI_DATA_CALL_TYPE_ASYNC_FOR_NEXT_CALL = 0x03, + TAPI_DATA_CALL_TYPE_ASYNC_FOR_ALL_CALLS = 0x04 +} TelDataCallType_t; + +typedef enum { + TAPI_DATA_CALL_STATUS_ALLOWED = 0x00, + TAPI_DATA_CALL_STATUS_NOT_ALLOWED_NO_SERVICE = 0x01, + TAPI_DATA_CALL_STATUS_NOT_ALLOWED_CALLING_VOICE = 0x02, + TAPI_DATA_CALL_STATUS_NOT_ALLOWED_NOT_CDMA = 0x03, + TAPI_DATA_CALL_STATUS_NOT_ALLOWED_LOCKED = 0x04, + TAPI_DATA_CALL_STATUS_NOT_CALL_GUARD = 0x05 +} TelDataDialingStatus_t; + +typedef enum { + TAPI_DATA_BAUDRATE_19200_BPS = 0x00, + TAPI_DATA_BAUDRATE_38400_BPS = 0x01, + TAPI_DATA_BAUDRATE_57600_BPS = 0x02, + TAPI_DATA_BAUDRATE_115200_BPS = 0x03, + TAPI_DATA_BAUDRATE_230400_BPS = 0x04 +} TelDataBaudRate_t; + +typedef enum { + TAPI_DATA_FACTORY_NAI = 0x00, + TAPI_DATA_CUSTOM_NAI = 0x01 +} TelDataNAIIndex_t; + +typedef enum { + TAPI_DATA_NAI_MIP_MASK_NONE = 0x0000, + TAPI_DATA_NAI_MIP_MASK_USER_NAI = 0x0001, + TAPI_DATA_NAI_MIP_MASK_SPI_MN_HA = 0x0002, + TAPI_DATA_NAI_MIP_MASK_SPI_MN_AAA = 0x0004, + TAPI_DATA_NAI_MIP_MASK_REVERSE_TUNNEL = 0x0008, + TAPI_DATA_NAI_MIP_MASK_HOME_ADDRESS = 0x0010, + TAPI_DATA_NAI_MIP_MASK_PRIMARY_HOME_AGENT_IP = 0x0020, + TAPI_DATA_NAI_MIP_MASK_SECONDARY_HOME_AGENT_IP = 0x0040, + TAPI_DATA_NAI_MIP_MASK_MN_AAA_SS = 0x0080, + TAPI_DATA_NAI_MIP_MASK_MN_HA_SS = 0x0100, + TAPI_DATA_NAI_MIP_MASK_ALGO_SIP_SS = 0x0200, + TAPI_DATA_NAI_MIP_MASK_ALGO_MIP_MN_AAA_SS = 0x0400, + TAPI_DATA_NAI_MIP_MASK_ALGO_MIP_MN_HA_SS = 0x0800, + TAPI_DATA_NAI_MIP_MASK_ALL = 0xFFFF +} TelDataNaiMipParamMask_t; + +typedef enum { + TAPI_DATA_NAI_GENERIC_INFO_CHANGED = 0x0, /**< NAI, MN-HA SPI Set, MN-HA SPI Value, MN-AAA SPI Set, MN-AAA SPI Value, Rev Tunnel Preferred, Mobile IP Address, Primary HA Address, Secondary HA Address */ + TAPI_DATA_SHARED_SECRET_CHANGED /**< HA Shared Secret, AAA Shared Secret */ +} TelDataNaiChangedItem_t; + +typedef enum { + TAPI_DATA_MIP_CHANGED_ITEM_NAI_INFO = 0x00, + TAPI_DATA_MIP_CHANGED_ITEM_SHARED_SECRET = 0x01 +} TelDataNAIItem_t; + +typedef enum { + TAPI_DATA_PACKET_NAI_SIGNIN_OUT = 0x00, + TAPI_DATA_PACKET_NAI_SIGNIN_IN = 0x01 +} TelDataSignStatus_t; + +typedef enum { + TAPI_DATA_ROAM_GUARD_DEFAULT = 0x00, + TAPI_DATA_ROAM_GUARD_ALWAYS_ASK = 0x01, + TAPI_DATA_ROAM_ROAM_GUARD_NEVER_ASK = 0x02, + TAPI_DATA_ROAM_ROAM_GUARD_OFF = 0x03, + TAPI_DATA_ROAM_ROAM_GUARD_ON = 0x04 +} TelDataRoamGuardMode_t; + +typedef enum { + TAPI_DATA_MODEM_NAI_OFF = 0x00, + TAPI_DATA_MODEM_NAI_ON = 0x01 +} TelDataModemNAIMode_t; + +typedef enum { + TAPI_DATA_DS_TYPE_NORMAL = 0x01, + TAPI_DATA_DS_TYPE_DUN = 0x02, + TAPI_DATA_DS_TYPE_BTDUN = 0x03, + TAPI_DATA_DS_TYPE_IS = 0x04, + TAPI_DATA_DS_TYPE_MMS = 0x05 +} TelDataDSType_t; + +typedef enum { + TAPI_DATA_REVA = 0x00, + TAPI_DATA_REV0 = 0x01 +} TelDataRevConfig_t; + +typedef enum { + TAPI_DATA_COMMERCIAL_NETWORK = 0x00, + TAPI_DATA_DOMESTIC_NETWORK = 0x01, + TAPI_DATA_RESERVED = 0x02 +} TelDataNAISettingMode_t; + +typedef enum { + TAPI_DATA_DDTM_MODE_OFF = 0x00, + TAPI_DATA_DDTM_MODE_ON = 0x01 +} TelDataDDTMStatus_t; + +typedef enum { + TAPI_DATA_DSWORKING_MODE_OFF = 0x00, + TAPI_DATA_DSWORKING_MODE_ON = 0x01 +} TelDataDSWorkingMode_t; + +typedef enum { + TAPI_DATA_PACKET_DATA_TYPE_QNC = 0x00, + TAPI_DATA_PACKET_DATA_TYPE_MIP = 0x01, + TAPI_DATA_PACKET_DATA_TYPE_CALL_TYPE = 0x02, + TAPI_DATA_PACKET_DATA_TYPE_PKT_ORIGIN_STRING = 0x03, + TAPI_DATA_PACKET_DATA_TYPE_PAP_USER_ID = 0x04, + TAPI_DATA_PACKET_DATA_TYPE_PAP_USER_PASSWORD = 0x05 +} TelDataPacketConfigType_t; + +typedef enum { + TAPI_DATA_QNC_DISABLE = 0x00, + TAPI_DATA_QNC_ENABLE = 0x01 +} TelDataQncType_t; + +typedef enum { + TAPI_DATA_MIP_SIMPLE_IP_ONLY = 0x00, + TAPI_DATA_MIP_IF_AVAIL = 0x01, + TAPI_DATA_MIP_ONLY = 0x02 +} TelDataMipType_t; + +typedef enum { + TAPI_DATA_CALL_TYPE_ONLY_MDR_SVC = 0x00, + TAPI_DATA_CALL_TYPE_MDR_SVC = 0x01, + TAPI_DATA_CALL_TYPE_ONLY_LSPD = 0x02, + TAPI_DATA_CALL_TYPE_HSPD = 0x02 +} TelDataPacketDataCallType_t; + + +/*================================================================================================== + STRUCTURES AND OTHER TYPEDEFS + ==================================================================================================*/ + +/** + * This structure contains Data pin control information. + * + */ +typedef struct { + TelDataSignalType_t signaltype; /** + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @ingroup TelephonyAPI + * @addtogroup COMMON_TAPI COMMON + * @{ + * + * @file TelDefines.h + * @brief This file provides #defines required for Telephony server and TAPI Client Library + */ + +#ifndef _TEL_DEFINES_H_ +#define _TEL_DEFINES_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +/*================================================================================================== + INCLUDE FILES + ==================================================================================================*/ + +/*================================================================================================== + CONSTANTS + ==================================================================================================*/ + +/*================================================================================================== + MACROS + ==================================================================================================*/ + +/*================================================================================================== + ENUMS + ==================================================================================================*/ + +/*================================================================================================== + STRUCTURES AND OTHER TYPEDEFS + ==================================================================================================*/ +/* Machine independence */ +typedef long TS_INT32; +typedef unsigned long TS_UINT32; + +typedef int TS_INT; +typedef unsigned int TS_UINT; +typedef double TS_DOUBLE; + +typedef int TS_BOOL; + +/* Programming concept */ +typedef unsigned char TS_BYTE; +typedef unsigned short TS_WORD; +typedef unsigned long TS_DWORD; +typedef unsigned char TS_UINT8; +typedef char TS_INT8; +typedef unsigned short TS_UINT16; +typedef unsigned long TS_ULONG; +typedef unsigned long long TS_UINT64; +typedef unsigned short TS_USHORT; + +#ifndef TRUE +#define TRUE 1 +#endif + +#ifndef FALSE +#define FALSE 0 +#endif + +#ifndef DEPRECATED +#define DEPRECATED __attribute__((deprecated)) +#endif + +typedef int HObj; + +/*================================================================================================== + FUNCTION PROTOTYPES + ==================================================================================================*/ + +#ifdef __cplusplus +} +#endif + +#endif /* _TEL_DEFINES_H_ */ + +/** + * @} + */ + diff --git a/include/common/TelDisplay.h b/include/common/TelDisplay.h new file mode 100644 index 0000000..8204e32 --- /dev/null +++ b/include/common/TelDisplay.h @@ -0,0 +1,224 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * 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. + */ + +/** + * @internal + * @ingroup TelephonyAPI + * @addtogroup DISPLAY_TAPI DISPLAY + * @{ + * + * These APIs allow an application to accomplish the following services: @n + * - Get the Display Icon Information. @n + */ + +#ifndef _TEL_DISPLAY_H_ +#define _TEL_DISPLAY_H_ + +/*================================================================================================== + INCLUDE FILES + ==================================================================================================*/ + +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/*================================================================================================== + CONSTANTS + ==================================================================================================*/ + +/*================================================================================================== + MACROS + ==================================================================================================*/ +#define TAPI_MAX_DISP_O2_HOMEZONE_TAG_LEN 13 /** Maximum number of bytes Home Zone Tag name */ +#define TAPI_MAX_DISP_ROAM_INFO_LEN 49 /* Roaming location information Maximum length is 32 bytes, But, 49 bytes in Modem code*/ +#define TAPI_MAX_DISP_PHONE_FATAL_ERR_MSG_LEN 64 /* Phone fatal error message length */ + +/*================================================================================================== + ENUMS + ==================================================================================================*/ + +/** + * This defines the RSSI levels. + * In GSM, this field represent the radio signal strength in dBm , but in the CDMA this field represents + * the number of the antenna bar as follows + */ +typedef enum { + TAPI_DISPLAY_RSSI_0 = 0x00, + TAPI_DISPLAY_RSSI_1 = 0x01, + TAPI_DISPLAY_RSSI_2 = 0x02, + TAPI_DISPLAY_RSSI_3 = 0x03, + TAPI_DISPLAY_RSSI_4 = 0x04, + TAPI_DISPLAY_RSSI_5 = 0x05, + TAPI_DISPLAY_RSSI_6 = 0x06 +} tapi_display_rssi_level_t; + +/** + * This enum defines the strength of the battery in levels + */ +typedef enum { + TAPI_POWER_PHONE_BATT_LEVEL0 = 0x00, /**< BLANK(Critical Low) */ + TAPI_POWER_PHONE_BATT_LEVEL1 = 0x01, /**< bar1 */ + TAPI_POWER_PHONE_BATT_LEVEL2 = 0x02, /**< bar2 */ + TAPI_POWER_PHONE_BATT_LEVEL3 = 0x03, /**< bar3 */ + TAPI_POWER_PHONE_BATT_LEVEL4 = 0x04, /**< bar4 */ + TAPI_POWER_PHONE_BATT_LEVEL5 = 0x05, /**< bar5 */ + TAPI_POWER_PHONE_BATT_LEVEL_INIT = 0x06 /**< init value */ +} tapi_phone_battery_level_t; + +/** + * Home Zone UI Icon Indiction Type + */ +typedef enum { + TAPI_DISPLAY_HMZ_O2_ZONE_INDI_NONE = 0x00, /**< None */ + TAPI_DISPLAY_HMZ_O2_ZONE_INDI_IND = 0x01, /**< Ind */ + TAPI_DISPLAY_HMZ_O2_ZONE_INDI_CLEAR = 0x02 /**< Clear */ +} tapi_display_hmz_02_zone_ind_t; + +/** + * Home Zone Type + */ +typedef enum { + TAPI_DISPLAY_HMZ_O2_ZONE_TYPE_NONE = 0x00, /**< None */ + TAPI_DISPLAY_HMZ_O2_ZONE_TYPE_HOME = 0x01, /**< Home Zone */ + TAPI_DISPLAY_HMZ_O2_ZONE_TYPE_CITY = 0x02 /**< City Zone */ +} tapi_display_hmz_02_zone_type_t; + +/** + * ZONE_TAG_PRESENT + */ +typedef enum { + TAPI_DISPLAY_HMZ_O2_ZONE_TAG_NONE = 0x00, /**< None */ + TAPI_DISPLAY_HMZ_O2_ZONE_TAG_PRESENT = 0x01, /**< Present */ + TAPI_DISPLAY_HMZ_O2_ZONE_TAG_ABSENT = 0x02 /**< Absent */ +} tapi_display_hmz_02_zone_tag_t; + +/** + * This enumeration is used to identify what icon info the client is interested in.. + */ +typedef enum { + TAPI_DISPLAY_GET_ICON_RSSI = 0x01, /**< Signal Strength */ + TAPI_DISPLAY_GET_ICON_BATT = 0x02, /**< Battery Level */ + TAPI_DISPLAY_GET_ICON_HDR_RSSI = 0x04, /**< HDR(High Data Rate RSSI - CDMA */ + TAPI_DISPLAY_GET_ICON_ALL = 0xFF /**< All Values Request */ +} tapi_display_get_icon_req_type_t; + +/** + * roam info Control Indication Type + */ +typedef enum { + TAPI_DISPLAY_ROAM_INDI_NONE = 0x00, /**< None */ + TAPI_DISPLAY_ROAM_TEXT_OFF = 0x01, /**< Roam Text Off */ + TAPI_DISPLAY_ROAM_TEXT_ON = 0x02 /**< Roam Text On */ +} tapi_display_roam_control_ind_t; + +/** + * roam info data roam guard Indication Type + */ +typedef enum { + TAPI_DISPLAY_DATA_ROAM_GUARD_NONE = 0x00, /**< None */ + TAPI_DISPLAY_DATA_ROAM_GUARD_OFF = 0x01, /**< Data Roam Guard Off */ + TAPI_DISPLAY_DATA_ROAM_GUARD_ON = 0x02 /**< Data Roam Guard On */ +} tapi_display_data_roam_guard_ind_t; + +/** + * roam info data roam guard Indication Type + */ +typedef enum { + TAPI_DISPLAY_USER_IND_NORMAL_MODE = 0x01, /**< Normal Mode */ + TAPI_DISPLAY_USER_IND_INITIAL_PROGRAMMING = 0x02, /**< Initial Programming needed */ + TAPI_DISPLAY_USER_IND_MAINTENANCE_REQUIRED = 0x03, /**< Maintenance Required */ + TAPI_DISPLAY_USER_IND_AUTHENTICATION_REQUIRED = 0x04 /**< Authentication Required */ +} tapi_display_user_ind_message_t; + +/*================================================================================================== + STRUCTURES AND OTHER TYPEDEFS + ==================================================================================================*/ + +/** + * This structure defines the display icon information + */ +typedef struct { + tapi_display_rssi_level_t rssi; /**< RSSI Levels */ + tapi_display_rssi_level_t hdrRssi; /**< HDR(High Data Rate) RSSI Levels -CDMA */ + tapi_phone_battery_level_t batt; /**< Battery Level */ +} tapi_display_icon_info_t; + +/** + * HomeZone Information Notification Message + * + * This service specifies the implementation of o2 DE's HomeZone Indication (HZI) service + * in 3G or 2G handsets. The HZI service consists of displaying a text and, optionally depending + * on the zone, an icon in the handset (UE) when the UE is located within a zone which is defined + * individually for each customer. The zone is defined by a set of cells, i. e. for each cell the + * indication is either displayed or not. If the display of a MS is too small to display the complete + * operator name together with the complete tag, it will be allowed to display the operator + * name and the HomeZone/CityZone-tag in the same line ('o2 - de city' or 'o2 - de home'). + * + * Reference O2 Home Zone spec. + */ +typedef struct { + tapi_display_hmz_02_zone_ind_t ind; + tapi_display_hmz_02_zone_type_t type; + tapi_display_hmz_02_zone_tag_t tag_presnet; + + /** + * The coding is 12-character string coded in the short message alphabet given + * In GSM 03.38 with bit 8 set to zero. Default FF. FF indicates no display. + * If ZONE_TAG_PRESENT, then this is 13 bytes. + * If ZONE_TAG_ABSENT, then this is zero byte. + */ + unsigned char tag_name[TAPI_MAX_DISP_O2_HOMEZONE_TAG_LEN]; +} tapi_display_hmz_o2_ind_t; + +/** + * Notify the TS of the occurrence of the phone fatal in the phone + */ +typedef struct { + unsigned char Msg_len; + unsigned char Message[TAPI_MAX_DISP_PHONE_FATAL_ERR_MSG_LEN]; +} tapi_display_phone_fatal_info_noti_t; + +/** + * Notify the TS of the occurrence of the ext roam info in the phone + */ +typedef struct { + tapi_display_roam_control_ind_t control; + tapi_display_data_roam_guard_ind_t data_roam_guard; + unsigned char txt_len; + unsigned char text[TAPI_MAX_DISP_ROAM_INFO_LEN]; +} tapi_display_ext_roam_info_noti_t; + +/*================================================================================================== + FUNCTION PROTOTYPES + ==================================================================================================*/ + +#ifdef __cplusplus +} +#endif + +#endif /* _TEL_DISPLAY_H_ */ + +/** + * @} + */ + diff --git a/include/common/TelErr.h b/include/common/TelErr.h new file mode 100644 index 0000000..3424db2 --- /dev/null +++ b/include/common/TelErr.h @@ -0,0 +1,215 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * 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. + */ + +/** + * @open + * @ingroup TelephonyAPI + * @addtogroup COMMON_TAPI COMMON + * @{ + * These error codes are used by Applications. + */ + + +#ifndef _TEL_ERR_H_ +#define _TEL_ERR_H_ +/*================================================================================================== + INCLUDE FILES +==================================================================================================*/ + +#ifdef __cplusplus +extern "C" +{ +#endif + +/*================================================================================================== + CONSTANTS +==================================================================================================*/ + + +/*================================================================================================== + MACROS +==================================================================================================*/ + + +/*================================================================================================== + ENUMS +==================================================================================================*/ + +/************************************************************ +** Errors defined in "+CME ERROR" , +** - see 3GPP TS 27.007 +** - ranges are 0x00 ~ 0x7FFF +************************************************************/ +/** + Error codes sent by the modem in response to the above operations. +*/ +typedef enum +{ + /* GENERAL ERRORS */ + TAPI_OP_GEN_ERR_PHONE_FAILURE = 0, /* 0 */ + TAPI_OP_GEN_ERR_NO_CONNECTION_TO_PHONE, /* 1 */ + TAPI_OP_GEN_ERR_PHONE_ADAPTOR_LINK_RESERVED, /* 2 */ + TAPI_OP_GEN_ERR_OPER_NOT_ALLOWED, /* 3 */ + TAPI_OP_GEN_ERR_OPER_NOT_SUPPORTED, /* 4 */ + TAPI_OP_GEN_ERR_PH_SIM_PIN_REQU, /* 5 */ + TAPI_OP_GEN_ERR_PH_FSIM_PIN_REQU, /* 6 */ + TAPI_OP_GEN_ERR_PH_FSIM_PUK_REQU, /* 7 */ + TAPI_OP_GEN_ERR_SIM_NOT_INSERTED =10, /* 10 */ + TAPI_OP_GEN_ERR_SIM_PIN_REQU, /* 11 */ + TAPI_OP_GEN_ERR_SIM_PUK_REQU, /* 12 */ + TAPI_OP_GEN_ERR_SIM_FAILURE, /* 13 */ + TAPI_OP_GEN_ERR_SIM_BUSY, /* 14 */ + TAPI_OP_GEN_ERR_SIM_WRONG, /* 15 */ + TAPI_OP_GEN_ERR_INCORRECT_PW, /* 16 */ + TAPI_OP_GEN_ERR_SIM_PIN2_REQU, /* 17 */ + TAPI_OP_GEN_ERR_SIM_PUK2_REQU, /* 18 */ + TAPI_OP_GEN_ERR_MEM_FULL = 20, /* 20 */ + TAPI_OP_GEN_ERR_INVALID_INDEX, /* 21 */ + TAPI_OP_GEN_ERR_NOT_FOUND, /* 22 */ + TAPI_OP_GEN_ERR_MEM_FAILURE, /* 23 */ + TAPI_OP_GEN_ERR_TEXT_STR_TOO_LONG, /* 24 */ + TAPI_OP_GEN_ERR_INVALID_CHARACTERS_IN_TEXT_STR, /* 25 */ + TAPI_OP_GEN_ERR_DIAL_STR_TOO_LONG, /* 26 */ + TAPI_OP_GEN_ERR_INVALID_CHARACTERS_IN_DIAL_STR, /* 27 */ + TAPI_OP_GEN_ERR_NO_NET_SVC = 30, /* 30 */ + TAPI_OP_GEN_ERR_NET_TIMEOUT, /* 31 */ + TAPI_OP_GEN_ERR_NET_NOT_ALLOWED_EMERGENCY_CALLS_ONLY, /* 32 */ + TAPI_OP_GEN_ERR_NET_PERS_PIN_REQU = 40, /* 40 */ + TAPI_OP_GEN_ERR_NET_PERS_PUK_REQU, /* 41 */ + TAPI_OP_GEN_ERR_NET_SUBSET_PERS_PIN_REQU, /* 42 */ + TAPI_OP_GEN_ERR_NET_SUBSET_PERS_PUK_REQU, /* 43 */ + TAPI_OP_GEN_ERR_SVC_PROVIDER_PERS_PIN_REQU, /* 44 */ + TAPI_OP_GEN_ERR_SVC_PROVIDER_PERS_PUK_REQU, /* 45 */ + TAPI_OP_GEN_ERR_CORPORATE_PERS_PIN_REQU, /* 46 */ + TAPI_OP_GEN_ERR_CORPORATE_PERS_PUK_REQU, /* 47 */ + TAPI_OP_GEN_ERR_HIDDEN_KEY_REQU, /* 48 */ + TAPI_OP_GEN_ERR_UNKNOWN = 100, /* 100 */ + + /* Errors related to a failure to perform an Attach */ + TAPI_OP_GEN_ERR_ILLEGAL_MS = 103, /* 103 */ + TAPI_OP_GEN_ERR_ILLEGAL_ME = 106, /* 106 */ + TAPI_OP_GEN_ERR_GPRS_SVC_NOT_ALLOWED, /* 107 */ + TAPI_OP_GEN_ERR_PLMN_NOT_ALLOWED = 111, /* 111 */ + TAPI_OP_GEN_ERR_LOCATION_AREA_NOT_ALLOWED, /* 112 */ + TAPI_OP_GEN_ERR_ROAMING_NOT_ALLOWED_IN_THIS_LOCATION_AREA,/* 113 */ + + /* Errors related to a failure to Activate a Context */ + TAPI_OP_GEN_ERR_SVC_OPT_NOT_SUPPORTED = 132, /* 132 */ + TAPI_OP_GEN_ERR_REQ_SVC_OPT_NOT_SUBSCRIBED, /* 133 */ + TAPI_OP_GEN_ERR_SVC_OPT_TEMPORARILY_OUT_OF_ORDER, /* 134 */ + TAPI_OP_GEN_ERR_UNSPECIFIED_GPRS_ERR = 148, /* 148 */ + TAPI_OP_GEN_ERR_PDP_AUTHENTICATION_FAILURE, /* 149 */ + TAPI_OP_GEN_ERR_INVALID_MOBILE_CLASS, /* 150 */ + + /* VBS / VGCS and eMLPP -related errors */ + TAPI_OP_GEN_ERR_VBS_VGCS_NOT_SUPPORTED_BY_THE_NET = 151, /* 151 */ + TAPI_OP_GEN_ERR_NO_SVC_SUBSCRIPTION_ON_SIM, /* 152 */ + TAPI_OP_GEN_ERR_NO_SUBSCRIPTION_FOR_GROUP_ID, /* 153 */ + TAPI_OP_GEN_ERR_GROUP_ID_NOT_ACTIVATED_ON_SIM, /* 154 */ + TAPI_OP_GEN_ERR_NO_MATCHING_NOTI = 155, /* 155 */ + TAPI_OP_GEN_ERR_VBS_VGCS_CALL_ALREADY_PRESENT, /* 156 */ + TAPI_OP_GEN_ERR_CONGESTION, /* 157 */ + TAPI_OP_GEN_ERR_NET_FAILURE, /* 158 */ + TAPI_OP_GEN_ERR_UPLINK_BUSY, /* 159 */ + TAPI_OP_GEN_ERR_NO_ACCESS_RIGHTS_FOR_SIM_FILE = 160, /* 160 */ + TAPI_OP_GEN_ERR_NO_SUBSCRIPTION_FOR_PRIORITY, /* 161 */ + TAPI_OP_GEN_ERR_OPER_NOT_APPLICABLE_OR_NOT_POSSIBLE, /* 162 */ + + + TAPI_OP_GEN_ERR_NONE = 0x8000, /* 0x8000 : No Errors */ + + /* General Common Errors : 0x8000 - 0x80FF */ + TAPI_OP_GEN_ERR_INVALID_IPC, /* 0x8001 : Invalid IPC_GSM Parameter or Format */ + TAPI_OP_GEN_ERR_PHONE_OFFLINE, /* 0x8002 : */ + TAPI_OP_GEN_ERR_CMD_NOT_ALLOWED, /* 0x8003 : */ + TAPI_OP_GEN_ERR_PHONE_IS_INUSE, /* 0x8004 : */ + TAPI_OP_GEN_ERR_INVALID_STATE = 0x8005, /* 0x8005 : */ + + TAPI_OP_GEN_ERR_NO_BUFFER, /* 0x8006 : No internal free buffers */ + TAPI_OP_GEN_ERR_OPER_REJ, /* 0x8007 : Operation Rejected */ + TAPI_OP_GEN_ERR_INSUFFICIENT_RESOURCE, /* 0x8008 : insufficient resource */ + TAPI_OP_GEN_ERR_NET_NOT_RESPOND, /* 0x8009 : Network not responding */ + TAPI_OP_GEN_ERR_SIM_PIN_ENABLE_REQ = 0x800A, /* 0x800A : SIM Pin Enable Required */ + TAPI_OP_GEN_ERR_SIM_PERM_BLOCKED, /* 0x800B : SIM Permanent Blocked */ + TAPI_OP_GEN_ERR_SIM_PHONEBOOK_RESTRICTED, /*0x800C: SIM Phonebook Restricted*/ + TAPI_OP_GEM_ERR_FIXED_DIALING_NUMBER_ONLY, /*0x800D: Restricted By FDN Mode */ + + /* Reserved : 0x800E ~ 0x80FF */ + TAPI_OP_GEN_ERR_800E_RESERVED_START = 0x800E, /* 0x800E */ + + TAPI_OP_GEN_ERR_80FF_RESERVED_END = 0x80ff, /* 0x80FF */ + + /* the other errors */ + TAPI_OP_GEN_ERR_OTHERS = 0xFFFE, /* 0xFFFE */ + + TAPI_OP_GEN_ERR_MAX = 0xFFFF + +}tapi_phone_err_t; + +typedef enum { + TAPI_PDP_FAILURE_CAUSE_NORMAL = 0x00, // 0x00 : Normal Process ( no problem ) + TAPI_PDP_FAILURE_CAUSE_REL_BY_USER = 0x01, // Call Released by User + TAPI_PDP_FAILURE_CAUSE_REGULAR_DEACTIVATION = 0x02, // Regular de-activation + TAPI_PDP_FAILURE_CAUSE_LLC_SNDCP = 0x03, // LLC SNDCP failure + TAPI_PDP_FAILURE_CAUSE_INSUFFICIENT_RESOURCE = 0x04, // Insufficient resources + TAPI_PDP_FAILURE_CAUSE_UNKNOWN_APN = 0x05, // Missing or unknown APN + TAPI_PDP_FAILURE_CAUSE_UNKNOWN_PDP_ADDRESS = 0x06, // Unknown PDP address or type + TAPI_PDP_FAILURE_CAUSE_USER_AUTH_FAILED = 0x07, // Unknown PDP address or type + TAPI_PDP_FAILURE_CAUSE_ACT_REJ_GGSN = 0x08, // Unknown PDP address or type + TAPI_PDP_FAILURE_CAUSE_ACT_REJ_UNSPECIFIED = 0x09, // Unknown PDP address or type + TAPI_PDP_FAILURE_CAUSE_SVC_OPTION_NOT_SUPPORTED = 0x0A, // Service option not supported + TAPI_PDP_FAILURE_CAUSE_SVC_NOT_SUBSCRIBED = 0x0B, // Requested service option not subscribed + TAPI_PDP_FAILURE_CAUSE_SVC_OPT_OUT_ORDER = 0x0C, // Service out of order + TAPI_PDP_FAILURE_CAUSE_NSAPI_USED = 0x0D, // NSAPI already used + TAPI_PDP_FAILURE_CAUSE_QOS_NOT_ACCEPTED = 0x0E, // QoS not accepted + TAPI_PDP_FAILURE_CAUSE_NETWORK_FAILURE = 0x0F, // Network Failure + TAPI_PDP_FAILURE_CAUSE_REACT_REQUIRED = 0x10, // Reactivation Required + TAPI_PDP_FAILURE_CAUSE_FEATURE_NOT_SUPPORTED = 0x11, // Feature not supported + TAPI_PDP_FAILURE_CAUSE_TFT_FILTER_ERROR = 0x12, // TFT or filter error + TAPI_PDP_FAILURE_CAUSE_UNKOWN_PDP_CONTEXT = 0x13, // Unknown PDP context + TAPI_PDP_FAILURE_CAUSE_INVALID_MSG = 0x14, // Invalid MSG + TAPI_PDP_FAILURE_CAUSE_PROTOCOL_ERROR = 0x15, // Protocol error + TAPI_PDP_FAILURE_CAUSE_MOBILE_FAILURE_ERROR = 0x16, // Mobile failure error + TAPI_PDP_FAILURE_CAUSE_TIMEOUT_ERROR = 0x17, // Timeout error + TAPI_PDP_FAILURE_CAUSE_UNKNOWN_ERROR = 0x18, // Unknown error + TAPI_PDP_FAILURE_CAUSE_MAX , +} tapi_pdp_err_t; + + +/*================================================================================================== + STRUCTURES AND OTHER TYPEDEFS +==================================================================================================*/ + + +/*================================================================================================== + FUNCTION PROTOTYPES +==================================================================================================*/ + + +#ifdef __cplusplus +} +#endif + +#endif // _TEL_ERR_H_ + +/** +* @} +*/ + diff --git a/include/common/TelMisc.h b/include/common/TelMisc.h new file mode 100644 index 0000000..b8d4651 --- /dev/null +++ b/include/common/TelMisc.h @@ -0,0 +1,371 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * 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. + */ + +/** + * @internal + * @ingroup TelephonyAPI + * @addtogroup MISC_TAPI MISC + * @{ + * + * @file TelMisc.h + + @brief This file serves as a "C" header file defines structures for Tapi Misc Services. \n + It contains a sample set of constants, enums, structs that would be required by applications. + + */ + +#ifndef _TEL_MISC_H_ +#define _TEL_MISC_H_ + +/*================================================================================================== + INCLUDE FILES + ==================================================================================================*/ + +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/*================================================================================================== + MACROS + ==================================================================================================*/ + +#define MAX_VERSION_LEN 32 /**< Maximum version length *///sw version, hw version, rf cal date, me sn +#define FUS_DUMMY_DATA_SIZE 2 /**< Data Size*/ + +#define MMICHECK_CALL_RELEASE_NOTI "User.LauncherUi.RequestTermination" +#define MMICHECK_END_ALL_NOTI "User.LauncherUi.RequestTermination" +#define MMICHECK_DIALER_KEY_NOTI "User.LauncherUi.DialerKeyInsert" +#define MMICHECK_ACTIVITY_VIEW_NOTI "User.MMICheck.ActivityView.ChangeStatus" + +#define TAPI_MISC_ME_SN_LEN_MAX 32 +#define TAPI_MISC_PRODUCT_CODE_LEN_MAX 32 +#define TAPI_MISC_MODEL_ID_LEN_MAX 17 +#define TAPI_MISC_PRL_ERI_VER_LEN_MAX 17 + +#define TAPI_MISC_MCC_LEN_MAX 3 +#define TAPI_MISC_MNC_LEN_MAX 2 +#define TAPI_MISC_MIN_LEN_MAX 10 +#define TAPI_MISC_MDN_LEN_MAX 15 +#define TAPI_MISC_NAME_LEN_MAX 17 + +/*================================================================================================== + ENUMS + ==================================================================================================*/ + +/** + * @enum TelMiscApplicationKey_t + * This enumeration defines mmi check key values + */ +typedef enum { + MMI_CHECK_DIAL_STAR = 0x2A, // 20 00 2A AF 4B 7E + MMI_CHECK_DIAL_SHARP = 0x23, // 20 00 23 6E D6 7E + MMI_CHECK_DIAL_0 = 0x30, // 20 00 30 74 F4 7E + MMI_CHECK_DIAL_1, // 20 00 31 FD E5 7E + MMI_CHECK_DIAL_2, // 20 00 32 66 D7 7E + MMI_CHECK_DIAL_3, // 20 00 33 EF C6 7E + MMI_CHECK_DIAL_4, // 20 00 34 50 B2 7E + MMI_CHECK_DIAL_5, // 20 00 35 D9 A3 7E + MMI_CHECK_DIAL_6, // 20 00 36 42 91 7E + MMI_CHECK_DIAL_7, // 20 00 37 CB 80 7E + MMI_CHECK_DIAL_8, // 20 00 38 3C 78 7E + MMI_CHECK_DIAL_9, // 20 00 39 B5 69 7E + + MMI_CHECK_END_ALL = 0x41, // + + MMI_CHECK_CALL = 0x50, // 20 00 50 72 97 7E + MMI_CHECK_END = 0x51, // 20 00 51 FB 86 7E + MMI_CHECK_CANCEL = 0x52, // 20 00 52 60 B4 7E + MMI_CHECK_RIGHT = 0x53, // 20 00 5C 1E 5D 7E + MMI_CHECK_SIDE_UP = 0x54, // 20 00 54 56 D1 7E + MMI_CHECK_SIDE_DOWN = 0x55, // 20 00 55 DF C0 7E + + MMI_CHECK_LEFT = 0x5B, // 20 00 5B A1 29 7E + MMI_CHECK_ARROW_UP = 0x63, // 20 00 63 6A 94 7E + MMI_CHECK_ARROW_DOWN = 0x64, // 20 00 64 D5 E0 7E + MMI_CHECK_ARROW_LEFT = 0x65, // 20 00 65 5C F1 7E + MMI_CHECK_ARROW_RIGHT = 0x66, // 20 00 66 C7 C3 7E + + MMI_CHECK_WAP = 0x8C, // 20 00 53 E9 A5 7E + MMI_CHECK_CAMERA = 0x8D, // 20 01 8D C2 83 7E + MMI_CHECK_MP3 = 0xDD, // 20 00 DD 9F C8 7E + MMI_CHECK_POWER = 0x95, // 20 00 95 D3 06 7E + MMI_CHECK_LONG_PRESS = 0xFF +} TelMiscMMICHECK_t; + +/** + * @enum TelMiscApplicationKey_t + * This enumeration defines application key type + */ +typedef enum { + KEY_EXT_DIAL_0 = 0, + KEY_EXT_DIAL_1, + KEY_EXT_DIAL_2, + KEY_EXT_DIAL_3, + KEY_EXT_DIAL_4, + KEY_EXT_DIAL_5, + KEY_EXT_DIAL_6, + KEY_EXT_DIAL_7, + KEY_EXT_DIAL_8, + KEY_EXT_DIAL_9, + KEY_EXT_DIAL_STAR, // 10 : * + KEY_EXT_DIAL_SHARP, // 11 : # + + KEY_EXT_DIAL_BACK, // 12 : <- (backkey) + KEY_EXT_DIAL_HIDE, // 13 :�� (hidekey) + KEY_EXT_DIAL_P, // 14 : p + KEY_EXT_DIAL_PLUS, // 15 : + + KEY_EXT_DIAL_MUTE, // 16 : mute + + KEY_EXT_DIAL_CALL = 100, // 100 : BTN1 (call) + KEY_EXT_DIAL_MESSAGE, // 101 : BTN2 (message) + KEY_EXT_DIAL_VIDEO_CALL, // 102 : BTN3 (video call) + KEY_EXT_DIAL_SAVE, // 103 : BTN4 (save) + KEY_EXT_DIAL_CALL_END, // noti publish + KEY_EXT_TERMINATE_ALL, + + KEY_EXT_PAGEDOWN = 114, // Volume down + KEY_EXT_PAGEUP = 115, // Volume up + KEY_EXT_POWER = 116, // Power short + KEY_EXT_PEOPLE_VIEW = 132, // People view + KEY_EXT_TIMELINE = 169, // Lifedrive + KEY_EXT_PREPARE_CAMERA = 171, // Prepare Camera + KEY_EXT_ACTIVITY_VIEW = 174, // Activity view + KEY_EXT_CAMERA = 212, // Camera + KEY_EXT_SEARCH = 217, // Phone Search + KEY_EXT_POWER_LONG = 356, // Power off + + KEY_EXT_INVALID_KEY = 500 +} TelMiscApplicationKey_t; + +/** + * @enum TelMiscDiagTouchEventType_t + * This enumeration defines the touch event type + */ +typedef enum { + TAPI_DIAG_TOUCH_CLICK_DOWN = 0x000F, /**< 0x0F00: Click Down */ + TAPI_DIAG_TOUCH_MOVE = 0x0010, /**< 0x1000: Move */ + TAPI_DIAG_TOUCH_CLICK_UP = 0x0011, /**< 0x1100: Click Up */ + TAPI_DIAG_TOUCH_HOLD = 0x0012 /**< 0x1200: Hold */ +} TelMiscDiagTouchEventType_t; + +/** + * @enum TelMiscAlarmMode_t + * Enum type for Validity of the Alarm booting + */ +typedef enum { + TAPI_MISC_ALARMBOOT_INACTIVATE, /**< 0x00: Inactivated */ + TAPI_MISC_ALARMBOOT_ACTIVATE /**< 0x00: Activated */ +} TelMiscAlarmMode_t; + +typedef enum { + TAPI_MISC_ME_IMEI = 0x00, /**< 0x00: IMEI, GSM/UMTS device */ + TAPI_MISC_ME_ESN = 0x01, /**< 0x01: ESN(Electronic Serial Number), It`s essentially run out. CDMA device */ + TAPI_MISC_ME_MEID = 0x02, /**< 0x02: MEID, This value can have hexa decimal digits. CDMA device */ + TAPI_MISC_ME_MAX = 0xff /**< 0xff: reserved */ +} TelMiscSNIndexType_t; + +/** + * NAM Information MASK fiel + */ +typedef enum { + TAPI_MISC_NAM_INFO_MASK_TOTAL = 0x0001, + TAPI_MISC_NAM_INFO_MASK_CURRENT_INDEX = 0x0002, + TAPI_MISC_NAM_INFO_MASK_REQUEST_INDEX = 0x0004, + TAPI_MISC_NAM_INFO_MASK_AUTONAM = 0x0008, + TAPI_MISC_NAM_INFO_MASK_MCC = 0x0010, + TAPI_MISC_NAM_INFO_MASK_MNC = 0x0020, + TAPI_MISC_NAM_INFO_MASK_MIN = 0x0040, + TAPI_MISC_NAM_INFO_MASK_MDN = 0x0080, + TAPI_MISC_NAM_INFO_MASK_NAM_NAME = 0x0100, + TAPI_MISC_NAM_INFO_MASK_NAM_CHANGE = 0x0200, + TAPI_MISC_NAM_INFO_MASK_NAM_NUM = 0x0400, + TAPI_MISC_NAM_INFO_MASK_ALL = 0x8000 +} TelMiscNamInfoMaskType_t; + +/** + * NAMIndex Field + */ +typedef enum { + TAPI_MISC_NAM_1 = 0x00, + TAPI_MISC_NAM_2, + TAPI_MISC_NAM_3, + TAPI_MISC_NAM_4, + TAPI_MISC_NAM_5 +} TelMiscNamIndex_t; + + +/** + * @enum tapi_misc_nitz_dayofweek_t + * Enum type for day of week + */ +typedef enum { + TAPI_MISC_NITZ_DOW_SUN = 0x00, /**< Sunday */ + TAPI_MISC_NITZ_DOW_MON = 0x01, /**< Monday */ + TAPI_MISC_NITZ_DOW_TUE = 0x02, /**< Tuesday */ + TAPI_MISC_NITZ_DOW_WED = 0x03, /**< Wednesday */ + TAPI_MISC_NITZ_DOW_THU = 0x04, /**< Thursday */ + TAPI_MISC_NITZ_DOW_FRI = 0X05, /**< Friday */ + TAPI_MISC_NITZ_DOW_SAT = 0x06 /**< Saturday */ +} tapi_misc_nitz_dayofweek_t; + +/** + * @enum tapi_misc_nitz_daylight_t + * Enum type for daylight + */ +typedef enum { + TAPI_MISC_NITZ_NOADJUST = 0x00, /**< No daylight adjustment */ + TAPI_MISC_NITZ_ONE_HR = 0x01, /**< One hour */ + TAPI_MISC_NITZ_TW0_HR = 0x02 /**< two hours */ +} tapi_misc_nitz_daylight_t; + +/** + * @enum tapi_misc_nitz_timeinfo_t + * Enum type for types of data + */ +typedef enum { + TAPI_MISC_NITZ_INVALID = 0x00, /**< Invalid */ + TAPI_MISC_NITZ_TIMEINFO_NW_CDMA = 0x01, /**< Time info network */ + TAPI_MISC_NITZ_TIMEINFO_NW_GSM = 0x02, /**< Time info network */ + TAPI_MISC_NITZ_RTC_INFO_LINE = 0x03, /**< RTC Info line */ + TAPI_MISC_NITZ_RTC_BKUP_PHONE = 0x04, /**< RTC Backup phone */ + TAPI_MISC_NITZ_NO_TIME_INFO = 0x05 /**< No time info */ +} tapi_misc_nitz_timeinfo_t; + + +/*================================================================================================== + STRUCTURES AND OTHER TYPEDEFS + ==================================================================================================*/ + +/** + * Mobile Equipment Version Information + */ +typedef struct { + unsigned char ver_mask; /**< version mask - 0x01:SW_ver, 0x02:HW_ver, 0x04:RF_CAL_date, 0x08:Product_code, 0x10:Model_ID, 0x20:PRL, 0x04:ERI, 0xff:all */ + unsigned char szSwVersion[MAX_VERSION_LEN]; /**< Software version, null termination */ + unsigned char szHwVersion[MAX_VERSION_LEN]; /**< Hardware version, null termination */ + unsigned char szRfCalDate[MAX_VERSION_LEN]; /**< Calculation Date, null termination */ + unsigned char szProductCode[TAPI_MISC_PRODUCT_CODE_LEN_MAX]; /**< product code, null termination */ + unsigned char szModelId[TAPI_MISC_MODEL_ID_LEN_MAX]; /**< model id (only for CDMA), null termination */ + unsigned char prl_nam_num; /**< number of PRL NAM fields */ + unsigned char szPrlVersion[TAPI_MISC_PRL_ERI_VER_LEN_MAX * 3];/**< prl version (only for CDMA), null termination */ + unsigned char eri_nam_num; /**< number of PRL NAM fields */ + unsigned char szEriVersion[TAPI_MISC_PRL_ERI_VER_LEN_MAX * 3];/**< eri version (only for CDMA), null termination */ +} TelMiscVersionInformation; + +/** + * Mobile Equipment Serial Number Information + */ +typedef struct { + TelMiscSNIndexType_t sn_index; /**< serial number index */ + int sn_len; /**< Length */ + unsigned char szNumber[TAPI_MISC_ME_SN_LEN_MAX]; /**< Number */ +} TelMiscSNInformation; + +/** + * Event delivery - event type + */ +typedef struct { + struct timeval time; /**< Time information */ + unsigned short type; /**< Type of event */ + unsigned short code; /**< Code */ + long value; /**< Value */ +} input_event_t; + +/** + * Diagnostic Key Code Information + */ +typedef struct { + unsigned char keycode; /**< Key Code */ + unsigned char keyhold; /**< Key Hold */ +} TelMiscDiagKeyCodeInfomation; + +/** + * Struct for alarm info + */ +typedef struct { + unsigned char year; /**< year */ + unsigned char month; /**< month */ + unsigned char day; /**< day */ + unsigned char hour; /**< hour */ + unsigned char minute; /**< minute */ + unsigned char second; /**< second */ + unsigned char time_zone; /**< time zone */ + tapi_misc_nitz_dayofweek_t day_of_week; /**< day of week */ +} TelMiscAlarmInfo_t; + +/** + * Struct for alarm response + */ +typedef struct { + TelMiscAlarmMode_t validity; /**< validity */ + TelMiscAlarmInfo_t alarm_info; /**< alarm info */ +} TelMiscAlarmStatus_t; + +/** + * @struct TelMiscNamInfo_t + * struct type for nam info + */ +typedef struct { + unsigned short nam_info_mask; + unsigned char nam_total; // this field is not used in case of nam set req. + unsigned char nam_current_index; + unsigned char nam_req_index; + unsigned char nam_auto; + unsigned char nam_mcc[TAPI_MISC_MCC_LEN_MAX+1]; + unsigned char nam_mnc[TAPI_MISC_MCC_LEN_MAX+1]; + unsigned char nam_min[TAPI_MISC_MIN_LEN_MAX+1]; + unsigned char nam_mdn[TAPI_MISC_MDN_LEN_MAX+1]; + unsigned char nam_name[TAPI_MISC_NAME_LEN_MAX+1]; +} TelMiscNamInfo_t; + +/** + * Struct for time info + */ +typedef struct { + tapi_misc_nitz_timeinfo_t time_zone_valid; /**< time zone */ + int bDaylight_valid; /**< day light */ + unsigned char year; /**< year */ + unsigned char month; /**< month */ + unsigned char day; /**< day */ + unsigned char hour; /**< hour */ + unsigned char minute; /**< minute */ + unsigned char second; /**< second */ + unsigned char time_zone; /**< time zone */ + tapi_misc_nitz_daylight_t daylight_adjust; /**< day light adjust */ + tapi_misc_nitz_dayofweek_t day_of_week; /**< day of week */ + unsigned long plmn; /**< day of week */ +} tapi_misc_time_zone_info_type; + +/*================================================================================================== + FUNCTION PROTOTYPES + ==================================================================================================*/ + +#ifdef __cplusplus +} +#endif + +#endif // _TEL_MISC_H_ +/** + * @} + */ + diff --git a/include/common/TelNetText.h b/include/common/TelNetText.h new file mode 100644 index 0000000..2798f2b --- /dev/null +++ b/include/common/TelNetText.h @@ -0,0 +1,775 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * 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. + */ + +/** +* @open +* @ingroup TelephonyAPI +* @addtogroup NetText_TAPI NetText(SMS) +* @{ +* +* @file TelNetText.h + + @brief This file serves as a "C" header file defines structures for Tapi Network Text Services. \n + It contains a sample set of constants, enums, structs that would be required by applications. + + */ +#ifndef _TEL_NETTEXT_H_ +#define _TEL_NETTEXT_H_ + +/*================================================================================================== + INCLUDE FILES +==================================================================================================*/ +#include +#include + +#ifdef __cplusplus +extern "C" +{ +#endif + +/*================================================================================================== + CONSTANTS +==================================================================================================*/ + + +/*================================================================================================== + MACROS +==================================================================================================*/ +/* NetText */ +#define TAPI_NETTEXT_MSG_SIZE_MAX 918 /**< Maximum Message Size */ +#define TAPI_NETTEXT_CB_SIZE_MAX 93 /** Maximum CB Message Size */ +#define TAPI_NETTEXT_ADDRESS_LEN_MAX 20 /* Nettext Address Length */ +#define TAPI_NETTEXT_SCADDRESS_LEN_MAX 18 /* SC Address Length */ + +#define TAPI_NETTEXT_CB_PAGE_SIZE_MAX 93 /**< CB maximum page size*/ +#define TAPI_NETTEXT_GSM_SMS_MSG_NUM_MAX 90 /**< Maximum GSM SMS message number*/ +#define TAPI_NETTEXT_GSM_SMS_CBMI_LIST_SIZE_MAX 50 /**< Maximum GSM SMS CBMI list size*/ +#define TAPI_NETTEXT_SMDATA_SIZE_MAX 165 /**< Maximum SMS data size that can be stored*/ +#define TAPI_NETTEXT_MAX_SMS_SERVICE_CENTER_ADDR 12 /** + * + * 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. + */ + +/** +* @open +* @ingroup TelephonyAPI +* @addtogroup Network_TAPI Network +* @{ +* +* @file TelNetwork.h + + @brief This file serves as a "C" header file and defines structures for Tapi Network Services\n + It contains a sample set of constants, enums, structs that would be required by applications. + */ + +#ifndef _TEL_NETWORK_H_ +#define _TEL_NETWORK_H_ +/*================================================================================================== + INCLUDE FILES +==================================================================================================*/ +#include + +#ifdef __cplusplus +extern "C" +{ +#endif + + +/*================================================================================================== + CONSTANTS +==================================================================================================*/ + + +/*================================================================================================== + MACROS +==================================================================================================*/ +#define TAPI_NETWORK_ORDER_MAX 5 /**< Maximum network order */ +#define TAPI_NETWORK_LIST_MAX 15 /**< Maximum network list */ +#define TAPI_NETWORK_NAME_LEN_MAX 40 /**< Maximum network name or PLMN name length*/ +#define TAPI_NETWORK_SPN_LEN_MAX 20 /**< Maximum network service provider name length */ +#define TAPI_PREFERRED_PLMN_RECORDS_MAX 150 /**< Maximum record length for preferred plmn list*/ +#define TAPI_NETWORK_DISPLAY_INFO_ELEMENTS 4 /**< Maximum network Display info element length */ +#define TAPI_NETWORK_HOMEZONE_TAG_MAX_LEN 13 /**< Maximum Network Home zone tag length */ +#define TAPI_NETWORK_CS_DISP_INDEX 0 /**< Maximum Network CS display index length */ +#define TAPI_NETWORK_PS_DISP_INDEX 1 /**< Maximum Network PS display index length */ +#define TAPI_NETWORK_SVC_DISP_INDEX 2 /**< Maximum Network SVC display index length */ +#define TAPI_NETWORK_ROAM_DISP_INDEX 3 /**< Maximum Network roaming display index length */ +#define TAPI_NETWORK_SUBS_SVC_NUM_MAX 6 /**< Maximum number of the Subscriber's services */ +#define TAPI_NETWORK_SUBS_NUM_LEN_MAX 40 /**< Maximum Subscriber Number Length */ +#define TAPI_NETWORK_SUBS_ALPHA_LEN_MAX 16 /**< Maximum Subscriber Name Length */ + + +/*================================================================================================== + ENUMS +==================================================================================================*/ + +/** + * @enum TelNetworkSelectionMode_t + * This enumeration defines the network selection modes. + */ +typedef enum +{ + TAPI_NETWORK_SELECTIONMODE_AUTOMATIC, /**< Network selection is in Automatic selection mode*/ + TAPI_NETWORK_SELECTIONMODE_MANUAL, /**< Network selection is in Manual selection mode */ + TAPI_NETWORK_SELECTIONMODE_GLOBAL_AUTOMAITIC, /** + * + * 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. + */ + +/** + * @internal + * @ingroup TelephonyAPI + * @addtogroup POWER_TAPI POWER + * @{ + * + * These APIs allow an application to accomplish the following services: @n + * - Get current phone power status, @n + * - Reset the phone power (on / off), @n + * - Get the Display Icon Information. @n + */ + +#ifndef _TEL_POWER_H_ +#define _TEL_POWER_H_ + +/*================================================================================================== + INCLUDE FILES + ==================================================================================================*/ + +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/*================================================================================================== + CONSTANTS + ==================================================================================================*/ + +/*================================================================================================== + MACROS + ==================================================================================================*/ + +/*================================================================================================== + ENUMS + ==================================================================================================*/ + +/** + * This defines the phone power reset commands. + */ +typedef enum { + TAPI_PHONE_POWER_OFF = 0, TAPI_PHONE_POWER_ON, TAPI_PHONE_POWER_RESET, +} tapi_power_phone_cmd_t; + +/** + * This defines the phone power status values. + */ +typedef enum { + TAPI_PHONE_POWER_STATUS_OFF = 0, TAPI_PHONE_POWER_STATUS_ON +} tapi_power_phone_power_status_t; + +/** + * Use to Enter or Leave Flight Mode. + * + */ +typedef enum { + TAPI_POWER_FLIGHT_MODE_ENTER = 0x01, /**< ONLINE OFF */ + TAPI_POWER_FLIGHT_MODE_LEAVE, /**< ONLINE ON */ + TAPI_POWER_FLIGHT_MODE_MAX +} tapi_power_flight_mode_type_t; + +typedef enum { + TAPI_POWER_FLIGHT_MODE_RESP_ON = 0x01, /**< Flight Mode On Success */ + TAPI_POWER_FLIGHT_MODE_RESP_OFF, /**< Flight Mode Off Success */ + TAPI_POWER_FLIGHT_MODE_RESP_FAIL, /**< Flight Mode Request Fail */ + TAPI_POWER_FLIGHT_MODE_RESP_MAX +} tapi_power_flight_mode_resp_type_t; + +/** + * This enum defines the phone battery status levels. + * + * 0x01 : Power Off Level => PhoneLevel = power off + * 0x02 : Critical-Low Battery Level => PhoneLevel = 0 + * 0x03 : Low Battery Level => PhoneLevel = 1 + * 0x04 : Normal Level => PhoneLevel = 2,3,4 + */ +typedef enum { + TAPI_POWER_BATT_STAT_POWER_OFF_LEVEL = 0x01, /**< Power Off Level */ + TAPI_POWER_BATT_STAT_CRIT_LOW_LEVEL = 0x02, /**< Critical-Low Battery Level */ + TAPI_POWER_BATT_STAT_LOW_LEVEL = 0x03, /**< Low Battery Level */ + TAPI_POWER_BATT_STAT_NORMAL_LEVEL = 0x04 /**< Normal Level */ +} tapi_power_battery_status_level_t; + +/*================================================================================================== + STRUCTURES AND OTHER TYPEDEFS + ==================================================================================================*/ + +/*================================================================================================== + FUNCTION PROTOTYPES + ==================================================================================================*/ + +#ifdef __cplusplus +} +#endif + +#endif /* _TEL_POWER_H_ */ + +/** + * @} + */ + diff --git a/include/common/TelSat.h b/include/common/TelSat.h new file mode 100644 index 0000000..191c060 --- /dev/null +++ b/include/common/TelSat.h @@ -0,0 +1,948 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * 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. + */ + +/** +* @open +* @ingroup TelephonyAPI +* @addtogroup SAT_TAPI SAT +* @{ +* +* @file TelSat.h + + @brief This file serves as a "C" header file defines structures for Telephony SAT Services. \n + It contains a sample set of constants, enums, structs that would be required by applications. + + + */ + +#ifndef _TEL_SAT_H_ +#define _TEL_SAT_H_ + +/*================================================================================================== + INCLUDE FILES +==================================================================================================*/ +#include +#include +#include +#include +#include +#include + +#ifdef __cplusplus +extern "C" +{ +#endif + + +/*================================================================================================== + CONSTANTS +==================================================================================================*/ + + +/*================================================================================================== + MACROS +==================================================================================================*/ + +#define TAPI_SAT_DEF_TITLE_LEN_MAX 50 /**< max length for Menu Title */ +#define TAPI_SAT_DEF_ITEM_STR_LEN_MAX 50 /**< max length for Menu Item */ +#define TAPI_SAT_DEF_TEXT_STRING_LEN_MAX 500 /**< max length for Text String */ +#define TAPI_SAT_DEF_BIT_MASK_CONTACT 0x01 /**< Bit Mask for Contact */ +#define TAPI_SAT_DEF_BIT_MASK_MSG 0x02 /**< Bit Mask for Msg */ +#define TAPI_SAT_DEF_BIT_MASK_OTHER 0x04 /**< Bit Mask for Psh */ +#define TAPI_SAT_REFRESH_FILE_LIST 20 /**< Refresh File List*/ +#define TAPI_SAT_DEF_SS_LEN_MAX 250 +#define TAPI_SAT_DEF_USSD_LEN_MAX 250 + + +/*================================================================================================== + ENUMS +==================================================================================================*/ +/////////////////////////////////////////////////////////////////////////////////////////// +// Telephony UI USER CONFIRM TYPE +/////////////////////////////////////////////////////////////////////////////////////////// +/** + * @enum TelSatUiUserConfirmType_t + * This enumeration defines the UI User Confirm Type. + */ +typedef enum +{ + TAPI_SAT_USER_CONFIRM_YES, /** + * + * 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. + */ + +/** +* @open +* @ingroup TelephonyAPI +* @addtogroup SAT_TAPI SAT +* @{ +* +* @file TelSatEnvelope.h + + @brief This file serves as a "C" header file defines structures for Tapi Sat envelope command Services. \n + It contains a sample set of constants, enums, structs that would be required by applications. + + + */ + +#ifndef _TEL_SAT_ENVELOPE_H_ +#define _TEL_SAT_ENVELOPE_H_ + +/*================================================================================================== + INCLUDE FILES +==================================================================================================*/ +#include + +#ifdef __cplusplus +extern "C" +{ +#endif + +/*================================================================================================== + CONSTANTS +==================================================================================================*/ + + +/*================================================================================================== + MACROS +==================================================================================================*/ + + +/*================================================================================================== + ENUMS +==================================================================================================*/ + +/** + * @enum TelSatCallType_t + * This enum indicates the SAT call type + */ +typedef enum +{ + TAPI_SAT_CALL_TYPE_MO_VOICE = 0X00, /**< call type - mo voice */ + TAPI_SAT_CALL_TYPE_MO_SMS, /**< call type - mo sms */ + TAPI_SAT_CALL_TYPE_SS, /**< call type - ss */ + TAPI_SAT_CALL_TYPE_USSD, /**< call type - ussd */ + TAPI_SAT_PDP_CNTXT_ACT, /**< call type - pdp context action */ + TAPI_SAT_CALL_TYPE_MAX /**< call type - max */ +}TelSatCallType_t; + +/** + * @enum TelSatCallCtrlResultType_t + * This enum indicates the result of call control by SIM. + */ +typedef enum +{ + TAPI_SAT_CALL_CTRL_R_ALLOWED_NO_MOD = 0, /**< call control result type - ALLOWED WITH NO MOD */ + TAPI_SAT_CALL_CTRL_R_NOT_ALLOWED = 1, /**< call control result type - NOT ALLOWED */ + TAPI_SAT_CALL_CTRL_R_ALLOWED_WITH_MOD = 2, /**< call control result type - ALLOWED WITH MOD */ + TAPI_SAT_CALL_CTRL_R_RESERVED = 0xFF /**< call control result type - RESERVED */ + +} TelSatCallCtrlResultType_t; + +/** + * @enum TelSatEnvelopeResp_t + * This enum indicates the general result of sending an envelope command to USIM. + */ +typedef enum +{ + TAPI_SAT_ENVELOPE_SUCCESS, /**< envelope result - success */ + TAPI_SAT_ENVELOPE_SIM_BUSY, /**< envelope result - USIM busy */ + TAPI_SAT_ENVELOPE_FAILED /**< envelope result - failed */ + +}TelSatEnvelopeResp_t; + +/*================================================================================================== + STRUCTURES AND OTHER TYPEDEFS +==================================================================================================*/ + +////////////////////////////////////////////////////////////////////////////////////////// +// 8. MENU SELECTION +////////////////////////////////////////////////////////////////////////////////////////// +/** + * This structure contains the data objects for MENU SELECTION envelope. + */ +typedef struct +{ + unsigned char itemIdentifier; /**< menu selection item identifier */ + int bIsHelpRequested; /**< flag to check whether help information required or not */ +} TelSatMenuSelectionReqInfo_t; + +////////////////////////////////////////////////////////////////////////////////////////// +// 9.1 CALL CONTROL BY SIM +////////////////////////////////////////////////////////////////////////////////////////// +/** + * This struct contains the data objects for Call Control result data sent by USIM. + */ +typedef struct +{ + TelSatAddressInfo_t address; /**< call number */ + TelSatSubAddressInfo_t subAddress; /**< call number sub address */ + TelSatBcRepeatIndicatorType_t bcRepeatIndicator; /**< bc repeat indicator */ + TelSatCapaConfigParamInfo_t ccp1; /**< capability configuration parameter1 */ + TelSatCapaConfigParamInfo_t ccp2; /**< capability configuration parameter2 */ +}TelSatVoiceCallCtrlIndInfo_t; + +/** + * This struct contains SAT ss control result data sent by USIM. + */ +typedef struct +{ + TelSatSsStringInfo_t ssString; /**< ss number */ + TelSatSubAddressInfo_t subAddress; /**< ss sub address */ + TelSatBcRepeatIndicatorType_t bcRepeatIndicator; /**< bc repeat indicator */ + TelSatCapaConfigParamInfo_t ccp1; /**< capability configuration parameter1 */ + TelSatCapaConfigParamInfo_t ccp2; /**< capability configuration parameter2 */ +}TelSatSsCtrlIndInfo_t; + +/** + * This struct contains SAT mo SMS control configuration data + */ +typedef struct +{ + TelSatAddressInfo_t rpDestAddress; /**< sms control rp destination address */ + TelSatAddressInfo_t tpDestAddress; /**< sms control tp destination address */ +} TelSatMoSmsCtrlIndInfo_t; + +/** + * This struct contains SAT call control configuration data + */ +typedef struct +{ + TelSatCallType_t callType; /**< call type */ + TelSatCallCtrlResultType_t callCtrlResult; /**< call control result */ + TelSatAlphaIdentifierInfo_t alphaIdentifier;/**< alpha identifier */ + unsigned char callId; /**< call id */ + TelSatCallType_t oldCallType; /**< old call type */ + union + { + TelSatVoiceCallCtrlIndInfo_t voiceCallData; /**< voice call control data */ + TelSatSsCtrlIndInfo_t ssData; /**< ss control data */ + TelSatMoSmsCtrlIndInfo_t smsData; + }u; /**< Union */ +} TelSatCallCtrlIndInfo_t; + +////////////////////////////////////////////////////////////////////////////////////////// +// 9.2 MO SHORT MESSAGE CONTROL BY SIM RESULT +////////////////////////////////////////////////////////////////////////////////////////// +/** + * This struct contains SAT mo ss control request data + */ + typedef struct +{ + TelSatCallCtrlResultType_t callCtrlResult; /**< call control result */ + TelSatAlphaIdentifierInfo_t alphaIdentifier; /**< alpha identifier */ + TelSatMoSmsCtrlIndInfo_t smsData; /**< sms control data */ +}TelSatMoSMCtrlResult_t; + +////////////////////////////////////////////////////////////////////////////////////////// +// 11.5 EVENT DOWNLOAD - USER ACTIVITY EVENT +////////////////////////////////////////////////////////////////////////////////////////// +/** + * This struct contains SAT user activity event request data + */ +typedef struct +{ + TelSatEventListInfo_t eventList; /**< event List */ + TelSatDeviceIdentitiesInfo_t deviceIdentities; /**< device identities info */ + +} TelSatUserActivityEventReqInfo_t; + +////////////////////////////////////////////////////////////////////////////////////////// +// 11.6 EVENT DOWNLOAD - IDLE SCREEN AVAILABLE EVENT +////////////////////////////////////////////////////////////////////////////////////////// +/** + * This structure contains the data objects for IDLE SCREEN AVAILABLE event download. + */ +typedef struct +{ + TelSatEventDownloadType_t eventData; /**< event type */ +} TelSatIdleScreenAvailableEventReqInfo_t; + + +////////////////////////////////////////////////////////////////////////////////////////// +// 11.8 EVENT DOWNLOAD - LANGUAGE SELECTION EVENT +////////////////////////////////////////////////////////////////////////////////////////// +/** + * This structure contains the data objects for LANGUAGE SELECTION event download. + */ +typedef struct +{ + TelSatLanguageType_t language; /**< selected language info */ +} TelSatLanguageSelectionEventReqInfo_t; + + +////////////////////////////////////////////////////////////////////////////////////////// +// 11.9 EVENT DOWNLOAD - BROWSER TERMINATION EVENT +////////////////////////////////////////////////////////////////////////////////////////// +/** + * This structure contains the data objects for BROWSER TERMINATION event download. + */ +typedef struct +{ + TelSatBrowserTerminationCauseType_t browserTerminationCause; /**< browser Termination Cause */ +} TelSatBrowserTerminationEventReqInfo_t; + + +////////////////////////////////////////////////////////////////////////////////////////// +// 11.10 EVENT DOWNLOAD - DATA AVAILABLE EVENT +////////////////////////////////////////////////////////////////////////////////////////// +/** + * This struct contains SAT data available event request data + */ +typedef struct +{ + TelSatEventListInfo_t eventList; /**< event List */ + TelSatDeviceIdentitiesInfo_t deviceIdentities; /**< device identities info */ + TelSatChannelStatusInfo_t channelStatus; /**< channel status */ + TelSatChannelDataLengthInfo_t channelDataLen; /**< channel data length */ + +} TelSatDataAvailableEventReqInfo_t; + +////////////////////////////////////////////////////////////////////////////////////////// +// 11.11 EVENT DOWNLOAD - CHANNEL STATUS EVENT +////////////////////////////////////////////////////////////////////////////////////////// +/** + * This struct contains SAT channel status even request data + */ +typedef struct +{ + TelSatEventListInfo_t eventList; /**< event list */ + TelSatDeviceIdentitiesInfo_t deviceIdentities; /**< device identities info */ + TelSatChannelStatusInfo_t channelStatus; /**< channel Status */ +} TelSatChannelStatusEventReqInfo_t; + +/*================================================================================================== + FUNCTION PROTOTYPES +==================================================================================================*/ + +#ifdef __cplusplus +} +#endif + +#endif /* _TEL_SAT_ENVELOPE_H_ */ + +/** + * @} + */ + diff --git a/include/common/TelSatObj.h b/include/common/TelSatObj.h new file mode 100644 index 0000000..146a89f --- /dev/null +++ b/include/common/TelSatObj.h @@ -0,0 +1,1518 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * 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. + */ + +/** +* @open +* @ingroup TelephonyAPI +* @addtogroup SAT_TAPI SAT +* @{ +* +* @file TelSatObj.h + + @brief This file serves as a "C" header file defines structures for Telephony SAT Services. \n + It contains a sample set of constants, enums, structs that would be required by applications. + + + */ + +#ifndef _TEL_SAT_OBJ_H_ +#define _TEL_SAT_OBJ_H_ + +/*================================================================================================== + INCLUDE FILES +==================================================================================================*/ +#include +#include + +#ifdef __cplusplus +extern "C" +{ +#endif + +/*================================================================================================== + CONSTANTS +==================================================================================================*/ + + +/*================================================================================================== + MACROS +==================================================================================================*/ +#define EXTENDED_ASCII 1 + +#define TAPI_SAT_DIALLING_NUMBER_LEN_MAX 200 /**< max length of dialing number */ +#define TAPI_SAT_ALPHA_ID_LEN_MAX 255 /**< max length of alpha identifier */ +#define TAPI_SAT_TEXT_STRING_LEN_MAX 500 /**< max length of text string -when the string data is in 7Bit packed format, this length is not enough to support the maximum size so should increase the value to a value > 275 */ +#define TAPI_SAT_SUB_ADDR_LEN_MAX 30 /**< max length of sub address */ +#define TAPI_SAT_CCP_DATA_LEN_MAX 30 /**< max length of ccp data */ +#define TAPI_SAT_ITEM_TEXT_LEN_MAX 45 /**< max length of item text */ +#define TAPI_SAT_SMS_TPDU_SMS_DATA_LEN_MAX 175 /**< max length of sms tpdu data */ +#define TAPI_SAT_SS_STRING_LEN_MAX 160 /**< max length of ss string */ +#define TAPI_SAT_USSD_STRING_LEN_MAX 255 /**< max length of ussd string */ +#define TAPI_SAT_FILE_ID_LIST_MAX_COUNT 255 /**< max count of file id list */ +#define TAPI_SAT_ITEMS_NEXT_ACTION_INDI_LIST_MAX_COUNT 50 /**< max count of items next action indication list */ +#define TAPI_SAT_EVENT_LIST_MAX_COUNT 17 /**< max count of sat event list */ +#define TAPI_SAT_IMG_INSTANT_RAW_DATA_LEN_MAX 256 /**< max length of image instant raw */ +#define TAPI_SAT_CLUT_DATA_LEN_MAX 256 /**< max length of clut data */ +#define TAPI_SAT_IMG_DATA_FILE_PATH_LEN_MAX 50 /**< max length of image data file name (Icon, CLUT) */ +#define TAPI_SAT_ICON_LIST_MAX_COUNT 50 /**< max count of icon list */ +#define TAPI_SAT_DTMF_STRING_LEN_MAX 30 /**< max length of dtmf string */ +#define TAPI_SAT_DATE_TIME_AND_TIME_ZONE_LEN 7 /**< max length of date time and time zone */ +#define TAPI_SAT_URL_LEN_MAX 129 /**< max length of url */ +#define TAPI_SAT_BEARER_LIST_MAX_COUNT 50 /**< max count of bearer list */ +#define TAPI_SAT_PROVISIONING_FILE_PATH_LEN_MAX 50 /**< max length of provisioning file path */ +#define TAPI_SAT_BEARER_PARAMS_LEN_MAX 10 /**< max length of bearer parameters */ +#define TAPI_SAT_CHANNEL_DATA_STRING_LEN_MAX 255 /**< max length of channel data string */ +#define TAPI_SAT_CHANNEL_STATUS_LEN 2 /**< max length of channel status */ +#define TAPI_SAT_CHANNEL_ID_LEN 3 /**< max length of channel id */ +#define TAPI_SAT_OTHER_ADDR_LEN_MAX 30 /**< max length of other address */ +#define TAPI_SAT_PORT_NUMBER_LEN 2 /**< max length of port number */ +#define TAPI_SAT_NET_ACC_NAM_LEN_MAX 30 /**< max length of net acc name */ +#define TAPI_SAT_AID_LEN_MAX 128 /**< max length of aid */ +#define TAPI_SAT_REMOTE_ENTITY_ADDR_LEN_MAX 50 /**< max length of remote entity address */ +#define TAPI_SAT_ITEM_TEXT_ATTRIBUTES_LIST_MAX_COUNT 50 /**< max count of item text attributes list */ +#define TAPI_SAT_MCC_CODE_LEN 3 /**< max length of mcc */ +#define TAPI_SAT_MNC_CODE_LEN 3 /**< max length of mnc */ +#define TAPI_SAT_LAC_CODE_LEN 2 /**< max length of lac */ +#define TAPI_SAT_CELL_ID_LEN 2 /**< max length of cell id */ + +/*================================================================================================== + ENUMS +==================================================================================================*/ + +/** + * @enum TelSatAlphabetFormatType_t + * This enum lists the Alphabet Format. + */ +typedef enum +{ + TAPI_SAT_ALPHABET_FORMAT_SMS_DEFAULT = 0x00, /**< ALPHABET FROMAT SMS DEFAULT */ + TAPI_SAT_ALPHABET_FORMAT_8BIT_DATA = 0x01, /**< ALPHABET FROMAT 8BIT DATA */ + TAPI_SAT_ALPHABET_FORMAT_UCS2 = 0x02, /**< ALPHABET FROMAT UCS2 */ + TAPI_SAT_ALPHABET_FORMAT_RESERVED = 0x03 /**< ALPHABET FROMAT RESERVED */ +} TelSatAlphabetFormatType_t; + +/** + * @enum TelSatMsgClassType_t + * This enum lists the message class. + */ +typedef enum +{ + TAPI_SAT_MSG_CLASS_NONE = 0x00, /**< none */ + TAPI_SAT_MSG_CLASS_0 = 0x01, /**< class 0 */ + TAPI_SAT_MSG_CLASS_1, /**< class 1 Default meaning:ME-specific */ + TAPI_SAT_MSG_CLASS_2, /**< class 2 SIM specific message */ + TAPI_SAT_MSG_CLASS_3, /**< class 3 Default meaning: TE specific */ + TAPI_SAT_MSG_CLASS_RESERVED = 0xFF /**< class reserved */ + +} TelSatMsgClassType_t; + +/** + * @enum TelSatCommandType_t + * This enum lists the type of command and the next action indicator. + */ +typedef enum +{ + TAPI_SAT_CMD_TYPE_NONE = 0x00, /**< command type - None */ + + TAPI_SAT_CMD_TYPE_REFRESH = 0x01, /**< command type - refresh */ + TAPI_SAT_CMD_TYPE_MORE_TIME = 0x02, /**< command type - more time */ + TAPI_SAT_CMD_TYPE_SETUP_EVENT_LIST = 0x05, /**< command type - setup event list */ + TAPI_SAT_CMD_TYPE_SETUP_CALL = 0x10, /**< command type - setup call */ + TAPI_SAT_CMD_TYPE_SEND_SS = 0x11, /**< command type - send ss */ + TAPI_SAT_CMD_TYPE_SEND_USSD = 0x12, /**< command type - send ussd */ + TAPI_SAT_CMD_TYPE_SEND_SMS = 0x13, /**< command type - send sms */ + TAPI_SAT_CMD_TYPE_SEND_DTMF = 0x14, /**< command type - send dtmf */ + TAPI_SAT_CMD_TYPE_LAUNCH_BROWSER = 0x15, /**< command type - launch browser */ + TAPI_SAT_CMD_TYPE_PLAY_TONE = 0x20, /**< command type - play tone */ + TAPI_SAT_CMD_TYPE_DISPLAY_TEXT = 0x21, /**< command type - display text */ + TAPI_SAT_CMD_TYPE_GET_INKEY = 0x22, /**< command type - get inkey */ + TAPI_SAT_CMD_TYPE_GET_INPUT = 0x23, /**< command type - get input */ + TAPI_SAT_CMD_TYPE_SELECT_ITEM = 0x24, /**< command type - select item */ + TAPI_SAT_CMD_TYPE_SETUP_MENU = 0x25, /**< command type - setup menu */ + TAPI_SAT_CMD_TYPE_PROVIDE_LOCAL_INFO = 0x26, /**< command type - provide local info */ + TAPI_SAT_CMD_TYPE_SETUP_IDLE_MODE_TEXT = 0x28, /**< command type - setup idle mode text */ + TAPI_SAT_CMD_TYPE_LANGUAGE_NOTIFICATION = 0x35, /**< command type - language notification */ + TAPI_SAT_CMD_TYPE_OPEN_CHANNEL = 0x40, /**< command type - open channel -class e */ + TAPI_SAT_CMD_TYPE_CLOSE_CHANNEL = 0x41, /**< command type - close channel - class e */ + TAPI_SAT_CMD_TYPE_RECEIVE_DATA = 0x42, /**< command type - receive data -class e */ + TAPI_SAT_CMD_TYPE_SEND_DATA = 0x43, /**< command type - send data */ + TAPI_SAT_CMD_TYPE_GET_CHANNEL_STATUS = 0x44, /**< command type - get channel status -class e */ + TAPI_SAT_CMD_TYPE_END_OF_APP_EXEC = 0xFD, /**< inform to End the execution of a Proactive Command*/ + TAPI_SAT_CMD_TYPE_END_PROACTIVE_SESSION = 0xFE, /**< inform end proactive session */ + TAPI_SAT_CMD_TYPE_RESERVED = 0xFF /**< command type - reserved */ +} TelSatCommandType_t; + +/** + * @enum TelSatCmdQualiRefresh_t + * This enum lists the Command qualifier values for Refresh command. + */ +typedef enum +{ + TAPI_SAT_REFRESH_SIM_INIT_AND_FULL_FCN = 0x00, /**< command qualifier for REFRESH SIM INIT AND FULL FILE CHANGE_NOTIFICATION */ + TAPI_SAT_REFRESH_FCN = 0x01, /**< command qualifier for REFRESH FILE CHANGE NOTIFICATION */ + TAPI_SAT_REFRESH_SIM_INIT_AND_FCN = 0x02, /**< command qualifier for REFRESH SIM INIT AND FILE CHANGE NOTIFICATION */ + TAPI_SAT_REFRESH_SIM_INIT = 0x03, /**< command qualifier for REFRESH SIM INIT */ + TAPI_SAT_REFRESH_SIM_RESET = 0x04, /**< command qualifier for REFRESH SIM RESET */ + TAPI_SAT_REFRESH_3G_APPLICATION_RESET = 0x05, /**< command qualifier for REFRESH 3G APPLICATION RESET */ + TAPI_SAT_REFRESH_3G_SESSION_RESET = 0x06, /**< command qualifier for REFRESH 3G SESSION RESET */ + TAPI_SAT_REFRESH_RESERVED = 0xFF /**< command qualifier for REFRESH RESERVED */ +} TelSatCmdQualiRefresh_t; + +/** + * @enum TelSatCmdQualiSetupCall_t + * This enum lists the Command qualifier values for setup call command. + */ +typedef enum +{ + TAPI_SAT_SETUP_CALL_IF_ANOTHER_CALL_NOT_BUSY = 0x00, /**< command qualifier for SETUP CALL IF ANOTHER CALL NOT BUSY */ + TAPI_SAT_SETUP_CALL_IF_ANOTHER_CALL_NOT_BUSY_WITH_REDIAL = 0x01, /**< command qualifier for SETUP CALL IF ANOTHER CALL NOT BUSY WITH REDIAL */ + TAPI_SAT_SETUP_CALL_PUT_ALL_OTHER_CALLS_ON_HOLD = 0x02, /**< command qualifier for SETUP CALL PUTTING ALL OTHER CALLS ON HOLD */ + TAPI_SAT_SETUP_CALL_PUT_ALL_OTHER_CALLS_ON_HOLD_WITH_REDIAL = 0x03, /**< command qualifier for SETUP CALL PUTTING ALL OTHER CALLS ON HOLD WITH REDIAL */ + TAPI_SAT_SETUP_CALL_DISCONN_ALL_OTHER_CALLS = 0x04, /**< command qualifier for SETUP CALL DISCONNECTING ALL OTHER CALLS */ + TAPI_SAT_SETUP_CALL_DISCONN_ALL_OTHER_CALLS_WITH_REDIAL = 0x05, /**< command qualifier for SETUP CALL DISCONNECTING ALL OTHER CALLS WITH REDIAL */ + TAPI_SAT_SETUP_CALL_RESERVED = 0xFF /**< command qualifier for SETUP CALL RESERVED */ +} TelSatCmdQualiSetupCall_t; + +/** + * @enum TelSatDisplayTextPriorityType_t + * This is associated with the command qualifier for display text. + */ +typedef enum +{ + TAPI_SAT_MSG_PRIORITY_NORMAL = 0, /**< MSG PRIORITY NORMAL */ + TAPI_SAT_MSG_PRIORITY_HIGH = 1 /**< MSG PRIORITY HIGH */ +} TelSatDisplayTextPriorityType_t; + +/** + * @enum TelSatDisplayTextMsgClearType_t + * This is associated with the command qualifier for display text. + */ +typedef enum +{ + TAPI_SAT_AUTO_CLEAR_MSG_AFTER_A_DELAY = 0, /**< message clear type - AUTO CLEAR MSG AFTER A DELAY */ + TAPI_SAT_WAIT_FOR_USER_TO_CLEAR_MSG = 1 /**< message clear type - WAIT FOR USER TO CLEAR MSG */ +} TelSatDisplayTextMsgClearType_t; + +/** + * @enum TelSatInkeyType_t + * This is associated with the command qualifier for get inkey. + */ +typedef enum +{ + TAPI_SAT_INKEY_TYPE_CHARACTER_SET_ENABLED = 0, /**< command qualifier for INKEY TYPE CHARACTER SET ENABLED */ + TAPI_SAT_INKEY_TYPE_YES_NO_REQUESTED = 1 /**< command qualifier for INKEY TYPE YES NO REQUESTED */ + +} TelSatInkeyType_t; + +/** + * @enum TelSatUseInputAlphabetType_t + * This is associated with the command qualifier for get input. + */ +typedef enum +{ + TAPI_SAT_USER_INPUT_ALPHABET_TYPE_SMS_DEFAULT = 1, /**< command qualifier for ALPHABET TYPE SMS DEFAULT */ + TAPI_SAT_USER_INPUT_ALPHABET_TYPE_UCS2 = 2 /**< command qualifier for ALPHABET TYPE UCS2 */ +} TelSatUseInputAlphabetType_t; + +/** + * @enum TelSatDisplayVibrateAlertType_t + * This is associated with the command qualifier for play tone command. + */ +typedef enum +{ + TAPI_SAT_VIBRATE_ALERT_OPTIONAL = 0, /**< VIBRATE ALERT UPTO THE TERMINAL */ + TAPI_SAT_VIBRATE_ALERT_REQUIRED = 1 /**< VIBRATE, IF AVAILABLE, WITH TONE. */ +} TelSatDisplayVibrateAlertType_t; + +/** + * @enum TelSatPresentationType_t + * This is associated with the command qualifier for select item command. + */ +typedef enum +{ + TAPI_SAT_PRESENTATION_TYPE_NOT_SPECIFIED = 0x00, /**< command qualifier for PRESENTATION TYPE NOT SPECIFIED */ + TAPI_SAT_PRESENTATION_TYPE_DATA_VALUE = 0x01, /**< command qualifier for PRESENTATION TYPE DATA VALUE */ + TAPI_SAT_PRESENTATION_TYPE_NAVIGATION_OPTION = 0x02 /**< command qualifier for PRESENTATION TYPE NAVIGATION OPTION */ + +} TelSatPresentationType_t; + +/** + * @enum TelSatSelectionPreferenceType_t + * This is associated with the command qualifier for select item command. + */ +typedef enum +{ + TAPI_SAT_SELECTION_PREFERENCE_NONE_REQUESTED = 0, /**< command qualifier for SELECTION PREFERENCE NONE REQUESTED */ + TAPI_SAT_SELECTION_PREFERENCE_USING_SOFT_KEY = 1 /**< command qualifier for SELECTION PREFERENCE USING SOFT KEY */ +} TelSatSelectionPreferenceType_t; + + +/** + * @enum TelSatCmdQualiProvideLocalInfo_t + * This enum defines the Command qualifier values for provide local info command. + */ +typedef enum +{ + TAPI_SAT_PROVIDE_DATE_TIME_AND_TIME_ZONE = 0x03, /**< command qualifier for PROVIDE DATE TIME AND TIME ZONE */ + TAPI_SAT_PROVIDE_LANGUAGE_SETTING = 0x04, /**< command qualifier for PROVIDE LANGUAGE SETTING */ + TAPI_SAT_PROVIDE_IMEISV = 0x08, + TAPI_SAT_PROVIDE_RESERVED = 0xFF /**< reserved */ +} TelSatCmdQualiProvideLocalInfo_t; + +/** + * @enum TelSatCmdQualiLaunchBrowser_t + * This enum defines the Command qualifier values for launch browser command. + */ +typedef enum +{ + TAPI_SAT_LAUNCH_BROWSER = 0, /**< command qualifier for LAUNCH BROWSER */ + TAPI_SAT_NOT_USED = 1, /**< command qualifier for NOT USED */ + TAPI_SAT_USE_EXISTING_BROWSER = 2, /**< command qualifier for USE EXISTING BROWSER if secure session, do not use it. */ + TAPI_SAT_CLOSE_AND_LAUNCH_NEW_BROWSER = 3, /**< command qualifier for CLOSE AND LAUNCH NEW BROWSER */ + TAPI_SAT_NOT_USED2 = 4, /**< command qualifier for NOT USED2 */ + TAPI_SAT_LB_RESERVED = 0xFF /**< reserved */ + +} TelSatCmdQualiLaunchBrowser_t; + +/** + * @enum TelSatDeviceIdentitiesTagType_t + * This enum lists the device identity tag value IDs. + */ +typedef enum +{ + TAPI_SAT_DEVICE_ID_KEYPAD = 0x01, /**< DEVICE ID KEYPAD */ + TAPI_SAT_DEVICE_ID_DISPLAY = 0x02, /**< DEVICE ID DISPLAY */ + TAPI_SAT_DEVICE_ID_EARPIECE = 0x03, /**< DEVICE ID EARPIECE */ + + TAPI_SAT_DEVICE_ID_SIM = 0x81, /**< DEVICE ID SIM */ + TAPI_SAT_DEVICE_ID_ME = 0x82, /**< DEVICE ID ME */ + TAPI_SAT_DEVICE_ID_NETWORK = 0x83, /**< DEVICE ID NETWORK */ + + TAPI_SAT_DEVICE_ID_RESERVED = 0XFF /**< reserved */ +} TelSatDeviceIdentitiesTagType_t; + +/** + * @enum TelSatTimeUnitType_t + * This enum lists the time units for the duration data object. + */ +typedef enum +{ + TAPI_SAT_TIME_UNIT_MINUTES = 0x0, /**< time unit - minutes */ + TAPI_SAT_TIME_UNIT_SECONDS = 0x01, /**< time unit - second */ + TAPI_SAT_TIME_UNIT_TENTHS_OF_SECONDS = 0x02, /**< time unit - tenths of seconds */ + TAPI_SAT_TIME_UNIT_RESERVED = 0xFF /**< reserved */ + +} TelSatTimeUnitType_t; + +/** + * @enum TelSatResultType_t + * This enum lists the values for the RESULT data object - General Response. + */ +typedef enum +{ + TAPI_SAT_R_SUCCESS = 0x0, /**< command performed successfully */ + TAPI_SAT_R_SUCCESS_WITH_PARTIAL_COMPREHENSION = 0x01, /**< command performed with partial comprehension */ + TAPI_SAT_R_SUCCESS_WITH_MISSING_INFO = 0x02, /**< command performed, with missing information */ + + TAPI_SAT_R_REFRESH_PERFORMED_WITH_ADDITIONAL_EFS_READ = 0x03, /**< REFRESH PERFORMED WITH ADDITIONAL EFS READ */ + TAPI_SAT_R_SUCCESS_BUT_REQUESTED_ICON_NOT_DISPLAYED = 0x04, /**< command performed but REQUESTED ICON NOT DISPLAYED */ + TAPI_SAT_R_SUCCESS_BUT_MODIFIED_BY_CALL_CONTROL_BY_SIM = 0x05, /**< command performed but MODIFIED BY CALL CONTROL BY SIM */ + TAPI_SAT_R_SUCCESS_LIMITED_SERVICE = 0x06, /**< command performed with LIMITED SERVICE */ + TAPI_SAT_R_SUCCESS_WITH_MODIFICATION = 0x07, /**< command performed with MODIFICATION */ + TAPI_SAT_R_REFRESH_PRFRMD_BUT_INDICATED_USIM_NOT_ACTIVE = 0x08, /**< REFRESH PERFORMED BUT INDICATED USIM NOT ACTIVE */ + + TAPI_SAT_R_PROACTIVE_SESSION_TERMINATED_BY_USER = 0x10, /**< proactive sim application session terminated by user */ + TAPI_SAT_R_BACKWARD_MOVE_BY_USER = 0x11, /**< backward move in the proactive sim application session request by the user */ + TAPI_SAT_R_NO_RESPONSE_FROM_USER = 0x12, /**< no response from user */ + + TAPI_SAT_R_HELP_INFO_REQUIRED_BY_USER = 0x13, /**< HELP INFO REQUIRED BY USER */ + TAPI_SAT_R_USSD_OR_SS_TRANSACTION_TERMINATED_BY_USER = 0x14, /**< USSD OR SS TRANSACTION TERMINATED BY USER */ + + TAPI_SAT_R_ME_UNABLE_TO_PROCESS_COMMAND = 0x20, /**< ME currently unable to process command */ + TAPI_SAT_R_NETWORK_UNABLE_TO_PROCESS_COMMAND = 0x21, /**< Network currently unable to process command */ + TAPI_SAT_R_USER_DID_NOT_ACCEPT_CALL_SETUP_REQ = 0x22, /**< User did not accept call setup request */ + TAPI_SAT_R_USER_CLEAR_DOWN_CALL_BEFORE_CONN = 0x23, /**< User cleared down call before connection or network released */ + + TAPI_SAT_R_INTERACTION_WITH_CC_BY_SIM_IN_TMP_PRBLM = 0x25, /**< INTERACTION WITH CALL CONTROL BY SIM IN TEMPORARY PROBLEM */ + TAPI_SAT_R_LAUNCH_BROWSER_GENERIC_ERROR_CODE = 0x26, /**< LAUNCH BROWSER GENERIC ERROR CODE */ + + TAPI_SAT_R_BEYOND_ME_CAPABILITIES = 0x30, /**< command beyond ME's capabilities */ + TAPI_SAT_R_COMMAND_TYPE_NOT_UNDERSTOOD_BY_ME = 0x31, /**< command type not understood by ME */ + TAPI_SAT_R_COMMAND_DATA_NOT_UNDERSTOOD_BY_ME = 0x32, /**< command data not understood by ME */ + TAPI_SAT_R_COMMAND_NUMBER_NOT_KNOWN_BY_ME = 0x33, /**< command number not known by ME */ + TAPI_SAT_R_SS_RETURN_ERROR = 0x34, /**< SS return error */ + TAPI_SAT_R_SMS_RP_ERROR = 0x35, /**< SMS rp-error */ + TAPI_SAT_R_ERROR_REQUIRED_VALUES_ARE_MISSING = 0x36, /**< Error, required values are missing */ + + TAPI_SAT_R_USSD_RETURN_ERROR = 0x37, /**< USSD_RETURN_ERROR */ + TAPI_SAT_R_INTRCTN_WITH_CC_OR_SMS_CTRL_PRMNT_PRBLM = 0x39, /**< INTERACTION WITH CALL CONTROL OR SMS CONTROL PERMANENT PROBLEM */ + TAPI_SAT_R_BEARER_INDEPENDENT_PROTOCOL_ERROR = 0x3A, /**< BEARER INDEPENDENT PROTOCOL ERROR */ + TAPI_SAT_R_FRAMES_ERROR = 0x3C /**< FRAMES ERROR */ +} TelSatResultType_t; + + +/** + * @enum TelSatMeProblemType_t + * This enum lists the values for the Additional response for the RESULT object and specifies a particular ME PROBLEM. + */ +typedef enum +{ + TAPI_SAT_ME_PROBLEM_NO_SPECIFIC_CAUSE = 0x0, /**< ME problem with NO SPECIFIC CAUSE */ + TAPI_SAT_ME_PROBLEM_SCREEN_BUSY = 0x01, /**< ME problem with SCREEN BUSY */ + TAPI_SAT_ME_PROBLEM_ME_BUSY_ON_CALL = 0x02, /**< ME problem with ME BUSY ON CALL */ + TAPI_SAT_ME_PROBLEM_ME_BUSY_ON_SS = 0x03, /**< ME problem with ME_BUSY ON SS */ + TAPI_SAT_ME_PROBLEM_NO_SERVICE = 0x04, /**< ME problem with NO SERVICE */ + TAPI_SAT_ME_PROBLEM_ACCESS_CONTROL_CLASS_BAR = 0x05, /**< ME problem with ACCESS CONTROL CLASS BAR */ + TAPI_SAT_ME_PROBLEM_RADIO_RES_NOT_GRANTED = 0x06, /**< ME problem with RADIO RES NOT GRANTED */ + TAPI_SAT_ME_PROBLEM_NOT_IN_SPEECH_CALL = 0x07, /**< ME problem with NOT IN SPEECH CALL */ + TAPI_SAT_ME_PROBLEM_ME_BUSY_ON_USSD = 0x08, /**< ME problem with ME BUSY ON USSD */ + TAPI_SAT_ME_PROBLEM_ME_BUSY_ON_SEND_DTMF_CMD = 0x09, /**< ME problem with ME BUSY ON SEND DTMF CMD */ + TAPI_SAT_ME_PROBLEM_NO_USIM_ACTIVE = 0x0A, /**< ME problem with NO USIM ACTIVE */ + TAPI_SAT_ME_PROBLEM_INVALID = 0xFF /**< ME problem with INVALID */ +} TelSatMeProblemType_t; + +/** + * @enum TelSatNetworkProblemType_t + * This enum lists the values for the Additional response for the RESULT object and specifies a particular network PROBLEM. + */ +typedef enum +{ + TAPI_SAT_NETWORK_PROBLEM_NO_SPECIFIC_CAUSE = 0x0, /**< Network problem with no specific cause */ + TAPI_SAT_NETWORK_PROBLEM_USER_BUSY = 0x91 /**< Network problem with USER BUSY */ +} TelSatNetworkProblemType_t; + +/** + * @enum TelSatSsProblemType_t + * This enum lists the values for the Additional response for the RESULT object related to SEND SS. + */ +typedef enum +{ + TAPI_SAT_SS_PROBLEM_NO_SPECIFIC_CAUSE = 0, /**< SS problem with no specific cause */ + TAPI_SAT_SS_PROBLEM_FACILITY_NOT_SUPPORTED = 0x15 /**< SS problem with FACILITY NOT SUPPORTED */ +} TelSatSsProblemType_t; + +/** + * @enum TelSatSmsProblemType_t + * This enum lists the values for the Additional response for the RESULT object related to SEND SMS. + */ +typedef enum +{ + TAPI_SAT_SMS_PROBLEM_NO_SPECIFIC_CAUSE = 0 /**< SMS problem with no specific cause */ +} TelSatSmsProblemType_t; + +/** + * @enum TelSatUssdProblemType_t + * This enum lists the values for the Additional response for the RESULT object related to SEND USSD STRING. + */ +typedef enum +{ + TAPI_SAT_USSD_PROBLEM_NO_SPECIFIC_CAUSE = 0, /**< USSD problem with no specific cause */ + TAPI_SAT_USSD_PROBLEM_UNKNOWN_ALPHABET = 0x47 /**< USSD problem with UNKNOWN ALPHABET */ + +} TelSatUssdProblemType_t; + +/** + * @enum TelSatCallCtrlProblemType_t + * This enum lists the values for the Additional response for the RESULT object related to CALL CONTROL or MO SMS CONTROL. + */ +typedef enum +{ + TAPI_SAT_CC_PROBLEM_NO_SPECIFIC_CAUSE = 0, /**< Call Control problem with no specific cause */ + TAPI_SAT_CC_PROBLEM_ACTION_NOT_ALLOWED = 1, /**< Call Control problem with action not allowed */ + TAPI_SAT_CC_PROBLEM_REQUEST_TYPE_HAS_CHANGED = 2 /**< Call Control problem with request type has changed */ +} TelSatCallCtrlProblemType_t; + +/** + * @enum TelSatLaunchBrowserProblemType_t + * This enum lists the values for the Additional response for the RESULT object related to LAUNCH BROWSER PROBLEM + */ +typedef enum +{ + TAPI_SAT_BROWSER_PROBLEM_NO_SPECIFIC_CAUSE = 0, /**< Browser problem with no specific cause */ + TAPI_SAT_BROWSER_PROBLEM_BEARER_UNAVAILABLE = 1, /**< Browser problem with bearer unavailable */ + TAPI_SAT_BROWSER_PROBLEM_BROWSER_UNAVAILABLE = 2, /**< Browser problem with browser unavailable */ + TAPI_SAT_BROWSER_PRBLM_ME_UNABLE_TO_READ_PROV_DATA = 3 /**< Browser problem with ME unable to read provisioning data */ + +} TelSatLaunchBrowserProblemType_t; + +/** + * @enum TelSatBipProblemType_t + * This enum lists the values for the Additional response for the RESULT object. + * Permanent Problems ::: 12.12.11 ADDITIONAL INFORMATION : BEARER INDEPENDENT PROTOCOL + */ +typedef enum +{ + TAPI_SAT_BIP_PROBLEM_NO_SPECIFIC_CAUSE = 0x00, /**< BIP problem with no specific cause */ + TAPI_SAT_BIP_PROBLEM_NO_CHANNEL_AVAILABLE = 0x01, /**< BIP problem with no channel available */ + TAPI_SAT_BIP_PROBLEM_CHANNEL_CLOSED = 0x02, /**< BIP problem with channel closed */ + TAPI_SAT_BIP_PROBLEM_CHANNEL_ID_NOT_VALID = 0x03, /**< BIP problem with channel id not valid */ + TAPI_SAT_BIP_PROBLEM_BUF_SIZE_NOT_AVAILABLE = 0x04, /**< BIP problem with buffer size not available */ + TAPI_SAT_BIP_PROBLEM_SECURITY_ERROR = 0x05, /**< BIP problem with security error */ + TAPI_SAT_BIP_PRBLM_SIM_ME_IF_TRNSPRT_LEVEL_NOT_AVL = 0x06, /**< BIP problem with SIM ME interface transport level not available */ + TAPI_SAT_BIP_REMOTE_DEV_NOT_REACHABLE = 0x07, /**< BIP problem with remote device not reachable */ + TAPI_SAT_BIP_SERVICE_ERROR = 0x08, /**< BIP service error */ + TAPI_SAT_BIP_SERVICE_IDENTIFIER_UNKNOWN = 0x09 /**< BIP service identifier unknown */ + +} TelSatBipProblemType_t; + +/** + * @enum TelSatSmsTpduType_t + * This enum lists the values for the SMS TPDU type. + */ +typedef enum +{ + TAPI_SAT_SMS_TPDU_TYPE_DELIVER_TPDU = 0, /**< sms tpdu type - DELIVER TPDU */ + TAPI_SAT_SMS_TPDU_TYPE_DELIVER_RPT = 1, /**< sms tpdu type - DELIVER RPT */ + TAPI_SAT_SMS_TPDU_TYPE_SUBMIT_TPDU = 2, /**< sms tpdu type - SUBMIT TPDU */ + TAPI_SAT_SMS_TPDU_TYPE_SUBMIT_RPT = 3, /**< sms tpdu type - SUBMIT RPT */ + TAPI_SAT_SMS_TPDU_TYPE_STATUS_RPT = 4, /**< sms tpdu type - STATUS RPT */ + TAPI_SAT_SMS_TPDU_TYPE_TPDU_CMD = 5 /**< sms tpdu type - TPDU CMD */ + +} TelSatSmsTpduType_t; + +/** + * @enum TelSatToneType_t + * This enum lists the values tones type. + */ +typedef enum +{ + // standard supervisory tones + TAPI_SAT_DIAL_TONE = 0x01, /**< TONE TYPE DIAL TONE */ + TAPI_SAT_CALLED_SUBSCRIBER_BUSY = 0x02, /**< TONE TYPE CALLED SUBSCRIBER BUSY */ + TAPI_SAT_CONGESTION = 0x03, /**< TONE TYPE CONGESTION */ + TAPI_SAT_RADIO_PATH_ACK = 0x04, /**< TONE TYPE RADIO PATH ACK */ + TAPI_SAT_RADIO_PATH_NOT_AVAILABLE_CALL_DROPPED = 0x05, /**< TONE TYPE RADIO PATH NOT AVAILABLE CALL DROPPED */ + TAPI_SAT_ERR_SPECIAL_INFO = 0x06, /**< TONE TYPE ERR SPECIAL INFO */ + TAPI_SAT_CALL_WAITING_TONE = 0x07, /**< TONE TYPE CALL WAITING TONE */ + TAPI_SAT_RINGING_TONE = 0x08, /**< TONE TYPE RINGING TONE */ + + // ME proprietary tones + TAPI_SAT_GENERAL_BEEP = 0x10, /**< TONE TYPE GENERAL BEEP */ + TAPI_SAT_POSITIVE_ACK_TONE = 0x11, /**< TONE TYPE POSITIVE ACK TONE */ + TAPI_SAT_NEGATIVE_ACK_OR_ERROR_TONE = 0x12, /**< TONE TYPE NEGATIVE ACK OR ERROR TONE */ + TAPI_SAT_RINGING_TONE_SLCTD_BY_USR_FOR_INCOM_SPEECH_CALL = 0x13, /**< TONE TYPE RINGING TONE SELECTED BY USER FOR INCOMING SPEECH CALL */ + TAPI_SAT_ALERT_TONE_SELECTED_BY_USER_FOR_INCOMING_SMS = 0x14, /**< TONE TYPE ALERT TONE SELECTED BY USER FOR INCOMING SMS */ + TAPI_SAT_CRITICAL_ALERT = 0x15, /**< TONE TYPE CRITICAL ALERT */ + + //Themed tones + TAPI_SAT_HAPPY_TONE = 0x30, /**< TONE TYPE HAPPY TONE */ + TAPI_SAT_SAD_TONE = 0x31, /**< TONE TYPE SAD TONE */ + TAPI_SAT_URGENT_ACTION_TONE = 0x32, /**< TONE TYPE URGENT ACTION TONE */ + TAPI_SAT_QUESTION_TONE = 0x33, /**< TONE TYPE QUESTION TONE */ + TAPI_SAT_MESSAGE_RECEIVED_TONE = 0x34, /**< TONE TYPE MESSAGE RECEIVED TONE */ + + //Melody tones + TAPI_SAT_MELODY_1 = 0x40, /**< TONE TYPE MELODY 1 */ + TAPI_SAT_MELODY_2 = 0x41, /**< TONE TYPE MELODY 2 */ + TAPI_SAT_MELODY_3 = 0x42, /**< TONE TYPE MELODY 3 */ + TAPI_SAT_MELODY_4 = 0x43, /**< TONE TYPE MELODY 4 */ + TAPI_SAT_MELODY_5 = 0x44, /**< TONE TYPE MELODY 5 */ + TAPI_SAT_MELODY_6 = 0x45, /**< TONE TYPE MELODY 6 */ + TAPI_SAT_MELODY_7 = 0x46, /**< TONE TYPE MELODY 7 */ + TAPI_SAT_MELODY_8 = 0x47, /**< TONE TYPE MELODY 8 */ + + TAPI_SAT_TONE_TYPE_RESERVED = 0xFF /**< TONE TYPE RESERVED */ +} TelSatToneType_t; + +/** + * @enum TelSatEventDownloadType_t + * This enum lists event types required by ME to monitor and report to SIM. + */ +typedef enum +{ + TAPI_EVENT_SAT_DW_TYPE_MT_CALL = 0, + TAPI_EVENT_SAT_DW_TYPE_CALL_CONNECTED = 1, + TAPI_EVENT_SAT_DW_TYPE_CALL_DISCONNECTED = 2, + TAPI_EVENT_SAT_DW_TYPE_LOCATION_STATUS = 3, + TAPI_EVENT_SAT_DW_TYPE_USER_ACTIVITY = 4, /**< data download type - USER_ACTIVITY */ + TAPI_EVENT_SAT_DW_TYPE_IDLE_SCREEN_AVAILABLE = 5, /**< data download type - IDLE SCREEN AVAILABLE */ + TAPI_EVENT_SAT_DW_TYPE_CARD_READER_STATUS = 6, + TAPI_EVENT_SAT_DW_TYPE_LANGUAGE_SELECTION = 7, /**< data download type - LANGUAGE SELECTION */ + TAPI_EVENT_SAT_DW_TYPE_BROWSER_TERMINATION = 8, /**< data download type - BROWSER TERMINATION */ + TAPI_EVENT_SAT_DW_TYPE_DATA_AVAILABLE = 9, /**< data download type -DATA AVAILABLE */ + TAPI_EVENT_SAT_DW_TYPE_CHANNEL_STATUS = 0x0A, /**< data download type - CHANNEL STATUS */ + TAPI_EVENT_SAT_DW_TYPE_ACCESS_TECHNOLOGY_CHANGED = 0x0B, + TAPI_EVENT_SAT_DW_TYPE_DISPLAY_PARAMETERS_CHANGED = 0x0C, + TAPI_EVENT_SAT_DW_TYPE_LOCAL_CONNECTION = 0x0D, + TAPI_EVENT_SAT_DW_TYPE_NW_SEARCH_MODE_CHANGED = 0X0E, + TAPI_EVENT_SAT_DW_TYPE_BROWSING_STATUS = 0X0F, + TAPI_EVENT_SAT_DW_TYPE_FRAMES_INFORMATION_CHANGED = 0X10, + TAPI_EVENT_SAT_DW_TYPE_RESERVED_FOR_3GPP = 0X11, + TAPI_EVENT_SAT_DW_TYPE_UNKNOWN = 0xFF /**< data download type - unknown */ +} TelSatEventDownloadType_t; + +/** + * @enum TelSatImageCodingSchemeType_t + * This enum lists image coding scheme types required by ME to show. + */ +typedef enum +{ + TAPI_SAT_SIM_IMAGE_CODING_SCHEME_BASIC = 0x11, /**< IMAGE CODING SCHEME BASIC */ + TAPI_SAT_SIM_IMAGE_CODING_SCHEME_COLOUR = 0x21, /**< IMAGE CODING SCHEME COLOUR */ + TAPI_SAT_SIM_IMAGE_CODING_SCHEME_RESERVED = 0xFF /**< RESERVED */ + +} TelSatImageCodingSchemeType_t; + +/** + * @enum TelSatIconQualifierType_t + * This enum defines the icon qualifier. + */ +typedef enum +{ + TAPI_SAT_ICON_QUALI_SELF_EXPLANATORY = 0, /**< ICON QUALI SELF EXPLANATORY */ + TAPI_SAT_ICON_QUALI_NOT_SELF_EXPLANATORY = 1, /**< ICON QUALI NOT SELF EXPLANATORY */ + TAPI_SAT_ICON_QUALI_RESERVED = 0xFF /**< RESERVED */ + +} TelSatIconQualifierType_t; + +/** + * @enum TelSatBcRepeatIndicatorType_t + * This enum defines the SIM ATK BC repeat indicator type. + */ +typedef enum +{ + TAPI_SAT_BC_REPEAT_INDI_ALTERNATE_MODE = 0x01, /**< BC REPEAT ALTERNATE MODE */ + TAPI_SAT_BC_REPEAT_INDI_SEQUENTIAL_MODE = 0x03, /**< BC REPEAT SEQUENTIAL MODE */ + TAPI_SAT_BC_REPEAT_INDI_RESERVED = 0xFF /**< RESERVED */ + +} TelSatBcRepeatIndicatorType_t; + +/** + * @enum TelSatCallCtrlStringType_t + * This enum defines call control string type. + */ +typedef enum +{ + TAPI_SAT_CC_VOICE = 0x00, /**< Call Control String Type - voice */ + TAPI_SAT_CC_SS = 0x01, /**< Call Control String Type - ss */ + TAPI_SAT_CC_USSD = 0x02, /**< Call Control String Type - ussd */ + TAPI_SAT_CC_NONE = 0xFF /**< Call Control String Type - none */ +}TelSatCallCtrlStringType_t; + +/** + * @enum TelSatLanguageType_t + * This enum lists the language values. + */ +typedef enum +{ + TAPI_SAT_LP_GERMAN = 0x00, /**< GERMAN */ + TAPI_SAT_LP_ENGLISH = 0x01, /**< ENGLISH */ + TAPI_SAT_LP_ITALIAN = 0x02, /**< ITALIAN */ + TAPI_SAT_LP_FRENCH = 0x03, /**< FRENCH */ + TAPI_SAT_LP_SPANISH = 0x04, /**< SPANISH */ + TAPI_SAT_LP_DUTCH = 0x05, /**< DUTCH */ + TAPI_SAT_LP_SWEDISH = 0x06, /**< SWEDISH */ + TAPI_SAT_LP_DANISH = 0x07, /**< DANISH */ + TAPI_SAT_LP_PORTUGUESE = 0x08, /**< PORTUGUESE */ + TAPI_SAT_LP_FINNISH = 0x09, /**< FINNISH */ + TAPI_SAT_LP_NORWEGIAN = 0x0A, /**< NORWEGIAN */ + TAPI_SAT_LP_GREEK = 0x0B, /**< GREEK */ + TAPI_SAT_LP_TURKISH = 0x0C, /**< TURKISH */ + TAPI_SAT_LP_HUNGARIAN = 0x0D, /**< HUNGARIAN */ + TAPI_SAT_LP_POLISH = 0x0E, /**< POLISH */ + TAPI_SAT_LP_LANG_UNSPECIFIED = 0x0F /**< LANGUAGE UNSPECIFIED */ +}TelSatLanguageType_t; + +/** + * @enum TelSatBrowserIdentityType_t + * This enum lists the SAT browser identity type. + */ +typedef enum +{ + TAPI_SAT_BROWSER_ID_DEFAULT = 0x0, /**< DEFAULT BROWSER */ + TAPI_SAT_BROWSER_ID_WML, /**< BROWSER WML */ + TAPI_SAT_BROWSER_ID_HTML, /**< BROWSER HTML */ + TAPI_SAT_BROWSER_ID_XHTML, /**< BROWSER XHTML */ + TAPI_SAT_BROWSER_ID_CHTML, /**< BROWSER CHTML */ + TAPI_SAT_BROWSER_ID_RESERVED = 0xFF /**< RESERVED */ +} TelSatBrowserIdentityType_t; + +/** + * @enum TelSatBearerType_t + * This enum lists the SAT bearer type. + */ +typedef enum +{ + TAPI_SAT_BEARER_TYPE_SMS = 0x0, /**< BEARER SMS */ + TAPI_SAT_BEARER_TYPE_CSD = 0x1, /**< BEARER CSD */ + TAPI_SAT_BEARER_TYPE_USSD = 0x2, /**< BEARER USSD */ + TAPI_SAT_BEARER_TYPE_GPRS = 0x3, /**< BEARER GPRS */ + TAPI_SAT_BEARER_TYPE_RESERVED = 0xFF /**< BEARER RESERVED */ + +} TelSatBearerType_t; + +/** + * @enum TelSatBrowserTerminationCauseType_t + * This enum lists the SAT browser termination cause type. + */ +typedef enum +{ + TAPI_SAT_BROWSER_TERMINATED_BY_USER = 0, /**< BROWSER TERMINATED BY USER */ + TAPI_SAT_BROWSER_TERMINATED_BY_ERROR = 1, /**< BROWSER TERMINATED BY ERROR */ +} TelSatBrowserTerminationCauseType_t; + +/** + * @enum TelSatBearerDescType_t + * This enum lists the SAT bearer destination type. + */ +typedef enum +{ + TAPI_SAT_BEARER_CSD = 0x1, /**< BEARER DESC CSD */ + TAPI_SAT_BEARER_GPRS = 0x2, /**< BEARER DESC GPRS */ + TAPI_SAT_BEARER_DEFAULT_BEARER_FROM_TRANSPORT_LAYER = 0x3, /**< BEARER DESC DEFAULT BEARER FROM TRANSPORT LAYER */ + TAPI_SAT_BEARER_LOCAL_LINK_TECHNOLOGY_INDEPENDENT = 0x4, /**< BEARER DESC LOCAL LINK TECHNOLOGY INDEPENDENT */ + TAPI_SAT_BEARER_BLUETOOTH = 0x5, /**< BEARER DESC BLUETOOTH */ + TAPI_SAT_BEARER_IrDA = 0x6, /**< BEARER DESC IrDA */ + TAPI_SAT_BEARER_RS232 = 0x7, /**< BEARER DESC RS232 */ + TAPI_SAT_BEARER_USB = 0x10, /**< BEARER DESC USB */ + TAPI_SAT_BEARER_RESERVED = 0xFF /**< RESERVED */ +} TelSatBearerDescType_t; + + +/** + * @enum TelSatBearerParamCsdDataRateType_t + * This enum lists the SAT bearer parameter csd data rate. refer TS 27.007 + */ +typedef enum +{ + TAPI_SAT_BIP_DR_AUTOBAUDING = 0, /**< CSD data rate - AUTOBAUDING */ + TAPI_SAT_BIP_DR_300BPS_V21 = 1, /**< CSD data rate -300BPS V21 */ + TAPI_SAT_BIP_DR_1200BPS_V22 = 2, /**< CSD data rate - 1200BPS V22 */ + TAPI_SAT_BIP_DR_1200_75BPS_V23 = 3, /**< CSD data rate -1200 75BPS V23 */ + TAPI_SAT_BIP_DR_2400BPS_V22 = 4, /**< CSD data rate -2400BPS V22 */ + TAPI_SAT_BIP_DR_2400BPS_V26 = 5, /**< CSD data rate - 2400BPS V26 */ + TAPI_SAT_BIP_DR_4800BPS_V32 = 6, /**< CSD data rate - 4800BPS V32 */ + TAPI_SAT_BIP_DR_9600BPS_V32 = 7, /**< CSD data rate - 9600BPS V32 */ + TAPI_SAT_BIP_DR_9600BPS_V34 = 12, /**< CSD data rate - 9600BPS_V34 */ + TAPI_SAT_BIP_DR_14400BPS_V34 = 14, /**< CSD data rate -14400BPS V34 */ + TAPI_SAT_BIP_DR_19200BPS_V34 = 15, /**< CSD data rate -19200BPS V34 */ + TAPI_SAT_BIP_DR_28800BPS_V34 = 16, /**< CSD data rate -28800BPS V34 */ + TAPI_SAT_BIP_DR_33600BPS_V34 = 17, /**< CSD data rate -33600BPS V34 */ + TAPI_SAT_BIP_DR_1200BPS_V120 = 34, /**< CSD data rate -1200BPS V120 */ + TAPI_SAT_BIP_DR_2400BPS_V120 = 36, /**< CSD data rate -2400BPS V120 */ + TAPI_SAT_BIP_DR_4800BPS_V120 = 38, /**< CSD data rate -4800BPS V120 */ + TAPI_SAT_BIP_DR_9600BPS_V120 = 39, /**< CSD data rate -9600BPS V120 */ + TAPI_SAT_BIP_DR_14400BPS_V120 = 43, /**< CSD data rate -14400BPS V120 */ + TAPI_SAT_BIP_DR_19200BPS_V120 = 47, /**< CSD data rate -19200BPS V120 */ + TAPI_SAT_BIP_DR_28800BPS_V120 = 48, /**< CSD data rate -28800BPS V120 */ + TAPI_SAT_BIP_DR_38400BPS_V120 = 49, /**< CSD data rate -38400BPS V120 */ + TAPI_SAT_BIP_DR_48000BPS_V120 = 50, /**< CSD data rate -48000BPS V120 */ + TAPI_SAT_BIP_DR_56000BPS_V120 = 51, /**< CSD data rate -56000BPS V120 */ + TAPI_SAT_BIP_DR_300BPS_V110 = 65, /**< CSD data rate - 300BPS V110 */ + TAPI_SAT_BIP_DR_1200BPS_V110 = 66, /**< CSD data rate -1200BPS V110 */ + TAPI_SAT_BIP_DR_2400BPS_V110_OR_X31_FALG_STUFFING = 68, /**< CSD data rate - 2400BPS V110 OR X31 FALG STUFFING */ + TAPI_SAT_BIP_DR_4800BPS_V110_OR_X31_FALG_STUFFING = 70, /**< CSD data rate - 4800BPS V110 OR X31 FALG STUFFING */ + TAPI_SAT_BIP_DR_9600BPS_V110_OR_X31_FALG_STUFFING = 71, /**< CSD data rate - 9600BPS V110 OR X31 FALG STUFFING */ + TAPI_SAT_BIP_DR_14400BPS_V110_OR_X31_FALG_STUFFING = 75, /**< CSD data rate - 14400BPS V110 OR X31 FALG STUFFING */ + TAPI_SAT_BIP_DR_19200BPS_V110_OR_X31_FALG_STUFFING = 79, /**< CSD data rate -19200BPS V110 OR X31 FALG STUFFING */ + TAPI_SAT_BIP_DR_28800BPS_V110_OR_X31_FALG_STUFFING = 80, /**< CSD data rate -28800BPS V110 OR X31 FALG STUFFING */ + TAPI_SAT_BIP_DR_38400BPS_V110_OR_X31_FALG_STUFFING = 81, /**< CSD data rate -38400BPS V110 OR X31 FALG STUFFING */ + TAPI_SAT_BIP_DR_48000BPS_V110_OR_X31_FALG_STUFFING = 82, /**< CSD data rate -48000BPS V110 OR X31 FALG STUFFING */ + TAPI_SAT_BIP_DR_56000BPS_V110_OR_X31_FALG_STUFFING = 83, /**< CSD data rate -56000BPS V110 OR X31 FALG STUFFING */ + TAPI_SAT_BIP_DR_64000BPS = 84, /**< CSD data rate -64000BPS */ + TAPI_SAT_BIP_DR_56000BPS_BIT_TRANSPERENT = 115, /**< CSD data rate -56000BPS BIT TRANSPERENT */ + TAPI_SAT_BIP_DR_64000BPS_BIT_TRANSPERENT = 116, /**< CSD data rate -64000BPS BIT TRANSPERENT */ + TAPI_SAT_BIP_DR_32000BPS_PIAFS32K = 120, /**< CSD data rate -32000BPS PIAFS32K */ + TAPI_SAT_BIP_DR_64000BPS_PIAFS64K = 121, /**< CSD data rate - 64000BPS PIAFS64K */ + TAPI_SAT_BIP_DR_28800BPS_MULTIMEDIA = 130, /**< CSD data rate -28800BPS MULTIMEDIA */ + TAPI_SAT_BIP_DR_32000BPS_MULTIMEDIA = 131, /**< CSD data rate -32000BPS MULTIMEDIA */ + TAPI_SAT_BIP_DR_33600BPS_MULTIMEDIA = 132, /**< CSD data rate - 33600BPS MULTIMEDIA */ + TAPI_SAT_BIP_DR_56000BPS_MULTIMEDIA = 133, /**< CSD data rate -56000BPS MULTIMEDIA */ + TAPI_SAT_BIP_DR_64000BPS_MULTIMEDIA = 134 /**< CSD data rate -64000BPS MULTIMEDIA */ + +}TelSatBearerParamCsdDataRateType_t; + +/** + * @enum TelSatBearerParamCsdBearerServiceType_t + * This enum lists the SAT bearer parameter csd bearer service + */ +typedef enum +{ + TAPI_SAT_BIP_CSD_BS_DATA_CIRCUIT_ASYNC_UDI =0, /**< CSD Bearer service - DATA CIRCUIT ASYNCHRONOUS UDI */ + TAPI_SAT_BIP_CSD_BS_DATA_CIRCUIT_SYNC =1, /**< CSD Bearer service - DATA CIRCUIT SYNCHRONOUS UDI */ + TAPI_SAT_BIP_CSD_BS_PAD_ACCESS_ASYNC_UDI =2, /**< CSD Bearer service - PAD ACCESS ASYNCHRONOUS UDI */ + TAPI_SAT_BIP_CSD_BS_PACKET_ACCESS_SYNC =3, /**< CSD Bearer service - PACKET ACCESS SYNCHRONOUS UDI */ + TAPI_SAT_BIP_CSD_BS_DATA_CIRCUIT_ASYNC_RDI =4, /**< CSD Bearer service - DATA CIRCUIT ASYNCHRONOUS RDI */ + TAPI_SAT_BIP_CSD_BS_DATA_CIRCUIT_SYNC_RDI =5, /**< CSD Bearer service - DATA CIRCUIT SYNCHRONOUS RDI */ + TAPI_SAT_BIP_CSD_BS_PAD_ACCESS_ASYNC_RDI =6, /**< CSD Bearer service - PAD ACCESS ASYNCHRONOUS RDI */ + TAPI_SAT_BIP_CSD_BS_PACKET_ACCESS_SYNC_RDI =7 /**< CSD Bearer service - PACKET ACCESS SYNCHRONOUS RDI */ + +}TelSatBearerParamCsdBearerServiceType_t; + +/** + * @enum TelSatBearerParamCsdConnectionElementType_t + * This enum lists the SAT bearer parameter csd connection element + */ +typedef enum +{ + TAPI_SAT_BIP_CSD_CONN_ELEM_TRANSPARENT = 0, /**< CSD connection element - TRANSPARENT */ + TAPI_SAT_BIP_CSD_CONN_ELEM_NON_TRANSPARENT = 1, /**< CSD connection element - NON TRANSPARENT */ + TAPI_SAT_BIP_CSD_CONN_ELEM_BOTH_TRANSPARENT_PREF = 2, /**< CSD connection element -BOTH TRANSPARENT PREFFERED */ + TAPI_SAT_BIP_CSD_CONN_ELEM_BOTH_NON_TRANSPARENT_PREF = 3 /**< CSD connection element - NON TRANSPARENT PREFFERED */ + +}TelSatBearerParamCsdConnectionElementType_t; + +/** + * @enum TelSatBearerParamGprsPrecedenceClassType_t + * This enum lists the SAT bearer parameter GPRS precedence class. refer TS 23.107 + */ +typedef enum +{ + TAPI_SAT_BIP_GPRS_PRECED_CLASS_HIGH_PRIORITY = 0x01, /**< GPRS precedence class -HIGH PRIORITY */ + TAPI_SAT_BIP_GPRS_PRECED_CLASS_NORM_PRIORITY = 0x02, /**< GPRS precedence class -NORM PRIORITY */ + TAPI_SAT_BIP_GPRS_PRECED_CLASS_LOW_PRIORITY = 0x03 /**< GPRS precedence class - LOW PRIORITY */ + +}TelSatBearerParamGprsPrecedenceClassType_t; + + +/** + * @enum TelSatBearerParamGprsDelayClassType_t + * This enum lists the SAT bearer parameter GPRS delay class. + */ +typedef enum +{ + TAPI_SAT_BIP_GPRS_DELAY_CLASS_1 = 0x01, /**< GPRS delay class - 1 */ + TAPI_SAT_BIP_GPRS_DELAY_CLASS_2 = 0x02, /**< GPRS delay class - 2 */ + TAPI_SAT_BIP_GPRS_DELAY_CLASS_3 = 0x03, /**< GPRS delay class - 3 */ + TAPI_SAT_BIP_GPRS_DELAY_CLASS_4 = 0x04 /**< GPRS delay class - 4 */ + +}TelSatBearerParamGprsDelayClassType_t; + + +/** + * @enum TelSatBearerParamGprsReliabilityClassType_t + * This enum lists the SAT bearer parameter GPRS Reliability class. + */ +typedef enum +{ + TAPI_SAT_BIP_GPRS_RELIABILITY_CLASS_1 = 0x01, /**< GPRS Reliability class -1 */ + TAPI_SAT_BIP_GPRS_RELIABILITY_CLASS_2 = 0x02, /**< GPRS Reliability class -2 */ + TAPI_SAT_BIP_GPRS_RELIABILITY_CLASS_3 = 0x03, /**< GPRS Reliability class -3 */ + TAPI_SAT_BIP_GPRS_RELIABILITY_CLASS_4 = 0x04, /**< GPRS Reliability class -4 */ + TAPI_SAT_BIP_GPRS_RELIABILITY_CLASS_5 = 0x05 /**< GPRS Reliability class -5 */ + +}TelSatBearerParamGprsReliabilityClassType_t; + + +/** + * @enum TelSatBearerParamGprsPeakThroughputClassType_t + * This enum lists the SAT bearer parameter GPRS peak throughput class. + */ +typedef enum +{ + TAPI_SAT_BIP_GPRS_PEAK_THROUGHPUT_CLASS_UPTO_8KBPS = 0x01, /**< GPRS peak throughput class- UPTO 8KBPS */ + TAPI_SAT_BIP_GPRS_PEAK_THROUGHPUT_CLASS_UPTO_16KBPS = 0x02, /**< GPRS peak throughput class- UPTO 16KBPS */ + TAPI_SAT_BIP_GPRS_PEAK_THROUGHPUT_CLASS_UPTO_32KBPS = 0x03, /**< GPRS peak throughput class-UPTO 32KBPS */ + TAPI_SAT_BIP_GPRS_PEAK_THROUGHPUT_CLASS_UPTO_64KBPS = 0x04, /**< GPRS peak throughput class-UPTO 64KBPS */ + TAPI_SAT_BIP_GPRS_PEAK_THROUGHPUT_CLASS_UPTO_128KBPS = 0x05, /**< GPRS peak throughput class- UPTO 128KBPS */ + TAPI_SAT_BIP_GPRS_PEAK_THROUGHPUT_CLASS_UPTO_256KBPS = 0x06, /**< GPRS peak throughput class- UPTO 256KBPS */ + TAPI_SAT_BIP_GPRS_PEAK_THROUGHPUT_CLASS_UPTO_512KBPS = 0x07, /**< GPRS peak throughput class- UPTO 512KBPS */ + TAPI_SAT_BIP_GPRS_PEAK_THROUGHPUT_CLASS_UPTO_1024KBPS = 0x08, /**< GPRS peak throughput class-UPTO 1024KBPS */ + TAPI_SAT_BIP_GPRS_PEAK_THROUGHPUT_CLASS_UPTO_2048KBPS = 0x09 /**< GPRS peak throughput class- UPTO 2048KBPS */ + +}TelSatBearerParamGprsPeakThroughputClassType_t; + +/** + * @enum TelSatBearerParamGprsMeanThroughputClassType_t + * This enum lists the SAT bearer parameter GPRS mean throughput class. + */ +typedef enum +{ + TAPI_SAT_BIP_GPRS_MEAN_THROUGHPUT_CLASS_DOT_22_BPS = 0x01, /**< GPRS mean throughput class - DOT 22 BPS */ + TAPI_SAT_BIP_GPRS_MEAN_THROUGHPUT_CLASS_DOT_44_BPS = 0x02, /**< GPRS mean throughput class - DOT 44 BPS */ + TAPI_SAT_BIP_GPRS_MEAN_THROUGHPUT_CLASS_1_DOT_11_BPS = 0x03, /**< GPRS mean throughput class -1 DOT 11 BPS */ + TAPI_SAT_BIP_GPRS_MEAN_THROUGHPUT_CLASS_2_DOT_2_BPS = 0x04, /**< GPRS mean throughput class -2 DOT 2 BPS */ + TAPI_SAT_BIP_GPRS_MEAN_THROUGHPUT_CLASS_2_DOT_4_BPS = 0x05, /**< GPRS mean throughput class -2 DOT 4 BPS */ + TAPI_SAT_BIP_GPRS_MEAN_THROUGHPUT_CLASS_11_DOT_1_BPS = 0x06, /**< GPRS mean throughput class - 11 DOT 1 BPS */ + TAPI_SAT_BIP_GPRS_MEAN_THROUGHPUT_CLASS_22BPS = 0x07, /**< GPRS mean throughput class -22BPS */ + TAPI_SAT_BIP_GPRS_MEAN_THROUGHPUT_CLASS_44BPS = 0x08, /**< GPRS mean throughput class - 44BPS */ + TAPI_SAT_BIP_GPRS_MEAN_THROUGHPUT_CLASS_111BPS = 0x09, /**< GPRS mean throughput class - 111BPS */ + TAPI_SAT_BIP_GPRS_MEAN_THROUGHPUT_CLASS_DOT_22_KBPS = 0x0A, /**< GPRS mean throughput class - DOT 22 KBPS */ + TAPI_SAT_BIP_GPRS_MEAN_THROUGHPUT_CLASS_DOT_44_KBPS = 0x0B, /**< GPRS mean throughput class -DOT 44 KBPS */ + TAPI_SAT_BIP_GPRS_MEAN_THROUGHPUT_CLASS_1_DOT_11_KBPS = 0x0C, /**< GPRS mean throughput class -1 DOT 11 KBPS */ + TAPI_SAT_BIP_GPRS_MEAN_THROUGHPUT_CLASS_2_DOT_2_KBPS = 0x0D, /**< GPRS mean throughput class -2 DOT 2 KBPS */ + TAPI_SAT_BIP_GPRS_MEAN_THROUGHPUT_CLASS_4_DOT_4_KBPS = 0x0E, /**< GPRS mean throughput class - 4 DOT 4 KBPS */ + TAPI_SAT_BIP_GPRS_MEAN_THROUGHPUT_CLASS_11_DOT_1_KBPS = 0x0F, /**< GPRS mean throughput class -11 DOT 1 KBPS */ + TAPI_SAT_BIP_GPRS_MEAN_THROUGHPUT_CLASS_22KBPS = 0x10, /**< GPRS mean throughput class - 22KBPS */ + TAPI_SAT_BIP_GPRS_MEAN_THROUGHPUT_CLASS_44KBPS = 0x11, /**< GPRS mean throughput class - 44KBPS */ + TAPI_SAT_BIP_GPRS_MEAN_THROUGHPUT_CLASS_111KBPS = 0x12, /**< GPRS mean throughput class -111KBPS */ + TAPI_SAT_BIP_GPRS_MEAN_THROUGHPUT_CLASS_BEST_EFFORT = 0x13 /**< GPRS mean throughput class - BEST EFFORT */ + +}TelSatBearerParamGprsMeanThroughputClassType_t; + +/** + * @enum TelSatBearerParamGprsPdpType_t + * This enum lists the SAT bearer parameter GPRS pdp type. + */ +typedef enum +{ + TAPI_SAT_BIP_GPRS_PDP_TYPE_IP = 0x02, /**< bearer parameter GPRS pdp type - IP */ + TAPI_SAT_BIP_GPRS_PDP_TYPE_RESERVED = 0xff /**< reserved */ +}TelSatBearerParamGprsPdpType_t; + +/** + * @enum TelSatBearerParamLocalLinksServiceIdentityType_t + * This enum lists the SAT bearer parameters local links service identity. + */ +typedef enum +{ + TAPI_SAT_BIP_LL_SERVICE_IDENT_VALUE_ASSIGNED_BY_USIM = 0x00, /**< local links service identity - value assigned by USIM */ + TAPI_SAT_BIP_LL_SERVICE_IDENT_VALUE_ASSIGNED_BY_REMOTED_DEVICE = 0xFF /**< local links service identity - value assigned by remote service */ + +}TelSatBearerParamLocalLinksServiceIdentityType_t; + +/** + * @enum TelSatChannelStatusType_t + * This enum lists the SAT channel status type. + */ +typedef enum +{ + TAPI_SAT_CS_LINK_ESTABLISHED_OR_PDP_CTX_NOT_ACTIVATED, /**< channel status type-CS LINK ESTABLISHED OR PDP CTX NOT ACTIVATED */ + TAPI_SAT_CS_LINK_ESTABLISHED_OR_PDP_CTX_ACTIVATED, /**< channel status type-CS LINK ESTABLISHED OR PDP CTX ACTIVATED */ + TAPI_SAT_UICC_SERVER_MODE_TCP_IN_CLOSED_STATE, /**< channel status type-UICC SERVER MODE TCP IN CLOSED STATE */ + TAPI_SAT_UICC_SERVER_MODE_TCP_IN_LISTEN_STATE, /**< channel status type-UICC SERVER MODE TCP IN LISTEN STATE */ + TAPI_SAT_UICC_SERVER_MODE_TCP_IN_ESTABLISHED_STATE, /**< channel status type-UICC SERVER MODE TCP IN ESTABLISHED STATE */ + TAPI_SAT_UICC_SERVER_MODE_RESERVED /**< reserved */ +} TelSatChannelStatusType_t; + +/** + * @enum TelSatChannelStatusInfoType_t + * This enum lists the SAT channel status info type. + */ +typedef enum +{ + TAPI_SAT_CHANNEL_STATUS_NO_FURTHER_INFO_AVAILABLE = 0, /**< CHANNEL STATUS NO FURTHER INFO AVAILABLE */ + TAPI_SAT_CHANNEL_STATUS_NOT_USED = 1, /**< CHANNEL STATUS NOT USED */ + TAPI_SAT_CHANNEL_STATUS_LINK_DROPPED = 5 /**< CHANNEL STATUS LINK DROPPED */ +}TelSatChannelStatusInfoType_t; + +/** + * @enum TelSatAddressType_t + * This enum lists the SAT address type. + */ +typedef enum +{ + TAPI_SAT_ADDR_TYPE_IPv4 = 0x21, /**< address type - IPv4 */ + TAPI_SAT_ADDR_TYPE_IPv6 = 0x57, /**< address type - IPv6 */ + TAPI_SAT_ADDR_RESERVED = 0xFF /**< reserved */ + +} TelSatAddressType_t; + +/** + * @enum TelSatTransportProtocolType_t + * This enum lists the SAT transport protocol type. + */ +typedef enum +{ + TAPI_SAT_TP_TYPE_UDP_UICC_CLIENT = 0x01, /**< transport protocol type- UDP UICC CLIENT */ + TAPI_SAT_TP_TYPE_TCP_UICC_CLIENT = 0x02, /**< transport protocol type-TCP UICC CLIENT */ + TAPI_SAT_TP_TYPE_TCP_UICC_SERVER = 0x03 /**< transport protocol type- TCP UICC SERVER */ +} TelSatTransportProtocolType_t; + +/** + * @enum TelSatRemoteEntityAddrCodingType_t + * This enum lists the SAT remote entity address coding type. + */ +typedef enum +{ + TAPI_SAT_REMOTE_ENTITY_ADDR_CODING_TYPE_IEEE802_48BIT = 0, /**< remote entity address coding type- IEEE802 48BIT */ + TAPI_SAT_REMOTE_ENTITY_ADDR_CODING_TYPE_IRDA_32BIT = 1, /**< remote entity address coding type- IRDA 32BIT */ + TAPI_SAT_REMOTE_ENTITY_ADDR_CODING_TYPE_RESERVED = 0xFF /**< reserved */ +} TelSatRemoteEntityAddrCodingType_t; + +/*================================================================================================== + STRUCTURES AND OTHER TYPEDEFS +==================================================================================================*/ + +/** + * This structure defines the Address data object. + */ +typedef struct { + TelSimTypeOfNum_t ton; /**< type of number */ + TelSimNumberingPlanIdentity_t npi; /**< number plan identity */ + unsigned char diallingNumberLen; /**< dialing number length */ + char diallingNumber[TAPI_SAT_DIALLING_NUMBER_LEN_MAX]; /**< dialing number */ +} TelSatAddressInfo_t; + +/** + * This structure defines the data coding scheme object. + */ +typedef struct { + int bIsCompressedFormat; /**< flag to verify compressed format */ + TelSatAlphabetFormatType_t alphabetFormat; /**< alphabet format Type */ + TelSatMsgClassType_t msgClass; /**< Type of message class */ + unsigned char rawDcs; /**< raw dcs info */ +} TelSatDataCodingSchemeInfo_t; + +/** + * This structure defines the Alpha ID data object. + */ +typedef struct { + int bIsPresent; /**< flag for checking existence of alpha identifier */ + TelSatDataCodingSchemeInfo_t dcs; /**< dcs info */ + unsigned char stringLen; /**< alpha identifier length */ + char string[TAPI_SAT_ALPHA_ID_LEN_MAX]; /**< alpha identifier info */ +} TelSatAlphaIdentifierInfo_t; + +/** + * This structure defines the Sub Address data object. + */ +typedef struct { + unsigned char subAddressLen; /**< sub address length */ + char subAddress[TAPI_SAT_SUB_ADDR_LEN_MAX]; /**< sub address */ +} TelSatSubAddressInfo_t; + +/** + * This structure defines the Capability Configuration Parameters data object. + */ +typedef struct { + unsigned char dataLen; /**< capability configuration parameter length */ + char data[TAPI_SAT_CCP_DATA_LEN_MAX]; /**< capability configuration parameter */ +} TelSatCapaConfigParamInfo_t; + +/** + * This struct defines the Command qualifier values for send SMS command. + */ +typedef struct { + int bIsPackingByMeRequired; /**< flag to verify packing requirement, if FALSE, packing by ME not required */ +} TelSatCmdQualiSendSms_t; + +/** + * This struct defines the Command qualifier values for display text command. + */ +typedef struct { + TelSatDisplayTextPriorityType_t msgPriority; /**< message priority */ + TelSatDisplayTextMsgClearType_t msgClear; /**< message clear type */ +} TelSatCmdQualiDisplayText_t; + +/** + * This struct defines the Command qualifier values for get inkey command. + */ +typedef struct { + TelSatInkeyType_t inkeyType; /**< inkey type */ + int bIsUsingAlphabetSet; /**< flag for checking whether using alphabet set or not. if FALSE, digits(0-9,*,#and+) only */ + TelSatUseInputAlphabetType_t alphabetType; /**< alphabet type */ + int bIsImmediateResponseRequired;/**< flag for checking whether immediate response required or not */ + int bIsHelpInfoAvailable; /**< flag for checking whether help info available or not. if FALSE, no help information available */ + +} TelSatCmdQualiGetInkey_t; + +/** + * This struct defines the Command qualifier values for get input command. + */ +typedef struct { + int bIsUsingAlphabetSet; /**< flag for checking whether using alphabet set. if FALSE, digits(0-9,*,#and+) only */ + TelSatUseInputAlphabetType_t alphabetType; /**< alphabet type. only using alphabet set case. */ + int bIsMeEchoUserInput; /**< flag for checking whether ME should echo user input. if FALSE, user input shall not be displayed*/ + int bIsUserInputUnpackedFormat; /**< flag for checking whether user input is in unpacked format or not. if FALSE, user input in SMS packed format */ + int bIsHelpInfoAvailable; /**< flag to verify if help info available or not. if FALSE, no help information available */ + +} TelSatCmdQualiGetInput_t; + +/** + * This struct defines the Command qualifier values for play tone command. + */ +typedef struct { + TelSatDisplayVibrateAlertType_t vibrateAlert; /**< type of vibrate alert */ +} TelSatCmdQualiPlayTone_t; + +/** + * This struct defines the Command qualifier values for select item command. + */ +typedef struct { + TelSatPresentationType_t presentationType; /**< type of presentation. only presentation type specified */ + TelSatSelectionPreferenceType_t selectionPreference; /**< type of selection preference */ + int bIsHelpInfoAvailable; /**< flag for checking whether help info available or not. if FALSE, no help information available */ +} TelSatCmdQualiSelectItem_t; + +/** + * This struct defines the Command qualifier values for setup menu command. + */ +typedef struct { + TelSatSelectionPreferenceType_t selectionPreference; /**< type of selection preference */ + int bIsHelpInfoAvailable; /**< flag to verify help info available or not. if FALSE, no help information available */ + +} TelSatCmdQualiSetupMenu_t; + +/** + * This struct defines the Command qualifier values for language notification command. + */ +typedef struct { + int bSpecificLanguageNotification; /**< flag for specific language notification. if FALSE, non-specific language notification */ +} TelSatCmdQualiLanguageNotification_t; + +/** + * SAT command qualifier open channel + */ +typedef struct { + int bIsEstablishImmediateLink; /**< flag whether establishing immediate link or not. if FALSE, on demand link establishment */ + int bIsAutomaticReconnection; /**< flag whether automatic reconnection or not. if FALSE, no automatic reconnection */ + int bIsModeBackground; /**< flag whether background mode or not. */ +} TelSatCmdQualiOpenChannel_t; + +/** + * SAT command qualifier send data + */ +typedef struct { + int bIsSendDataImmediately; /**< flag whether to send data immediately or not. if FALSE, store data in Tx buffer*/ +} TelSatCmdQualiSendData_t; + +/** + * This structure contains the command number, type and the qualifier objects of a SATK command. + */ +typedef struct { + unsigned char commandNumber; /**< specific command number */ + TelSatCommandType_t commandType; /**< proactive command type */ + + union { + TelSatCmdQualiRefresh_t cmdQualiRefresh; /**< refresh command qualifier info */ + TelSatCmdQualiSetupCall_t cmdQualiSetupCall; /**< setup call command qualifier info */ + TelSatCmdQualiSendSms_t cmdQualiSendSms; /**< send sms command qualifier info */ + TelSatCmdQualiDisplayText_t cmdQualiDisplayText; /**< display text command qualifier info */ + TelSatCmdQualiGetInkey_t cmdQualiGetInkey; /**< get inkey command qualifier info */ + TelSatCmdQualiGetInput_t cmdQualiGetInput; /**< get input command qualifier info */ + TelSatCmdQualiPlayTone_t cmdQualiPlayTone; /**< play tone command qualifier info */ + TelSatCmdQualiSelectItem_t cmdQualiSelectItem; /**< select item command qualifier info */ + TelSatCmdQualiSetupMenu_t cmdQualiSetupMenu; /**< setup menu command qualifier info */ + TelSatCmdQualiProvideLocalInfo_t cmdQualiProvideLocalInfo;/**< provide local info command qualifier info */ + TelSatCmdQualiLanguageNotification_t cmdQualiLanguageNotification;/**< language notification command qualifier info */ + TelSatCmdQualiLaunchBrowser_t cmdQualiLaunchBrowser; /**< launch Browser command qualifier info */ + TelSatCmdQualiOpenChannel_t cmdQualiOpenChannel; /**< Open channel command qualifier info */ + TelSatCmdQualiSendData_t cmdQualiSendData; /**< send data command qualifier info */ + } u; /**< Union */ +} TelSatCommandDetailInfo_t; + +/** + * This struct defines the device identity values. + */ +typedef struct { + TelSatDeviceIdentitiesTagType_t source; /**< device identity tag for source */ + TelSatDeviceIdentitiesTagType_t destination; /**< device identity for destination */ + +} TelSatDeviceIdentitiesInfo_t; + +/** + * This structure defines the Duration data object. + */ +typedef struct { + TelSatTimeUnitType_t timeUnit; /**< time units for the duration data */ + unsigned char timeInterval; /**< time interval */ + +} TelSatDurationInfo_t; + +/** + * This structure defines the menu item data object. + */ +typedef struct { + unsigned char itemId; /**< item identifier */ + unsigned char textLen; /**< text length */ + unsigned char text[TAPI_SAT_ITEM_TEXT_LEN_MAX + 1]; /**< text information */ + +} TelSatMenuItemInfo_t; + +/** + * This structure defines the item identifier object. + */ +typedef struct { + unsigned char selectedItemIdentifier; /**< selected item identifier */ + +} TelSatItemIdentifierInfo_t; + +/** + * This structure defines expected user response length. + */ +typedef struct { + unsigned char min; /**< user response length minimum value */ + unsigned char max; /**< user response length maximum value */ +} TelSatRespLenInfo_t; + +/** + * This structure defines RESUlT data object. + */ +typedef struct { + TelSatResultType_t generalResult; /**< general result */ + TelSatMeProblemType_t meProblem; /**< additional information on general result */ +} TelSatResultInfo_t; + +/** + * This structure defines RESUlT data object. + */ +typedef struct { + TelSatSmsTpduType_t tpduType; /**< SMS TPDU TYPE */ + unsigned char dataLen; /**< SMS TPDU DATA LENGTH */ + unsigned char data[TAPI_SAT_SMS_TPDU_SMS_DATA_LEN_MAX]; /**< SMS TPDU DATA*/ + +} TelSatSmsTpduInfo_t; + +/** + * This structure defines SS STRING data object. + */ +typedef struct { + TelSimTypeOfNum_t ton; /**< type of number */ + TelSimNumberingPlanIdentity_t npi; /**< number plan identity */ + unsigned char stringLen; /**< ss string length */ + char string[TAPI_SAT_SS_STRING_LEN_MAX]; /**< ss string */ +} TelSatSsStringInfo_t; + +/** + * This structure defines TEXT STRING data object. + */ +typedef struct { + int bIsDigitOnly; /**< flag for checking whether only digits used or not */ + TelSatDataCodingSchemeInfo_t dcs; /**< data coding scheme */ + unsigned short stringLen; /**< text length */ + char string[TAPI_SAT_TEXT_STRING_LEN_MAX + 1]; /**< text string */ +} TelSatTextTypeInfo_t; + +/** + * This structure defines menu item text object. + */ +typedef struct { + int bIsDigitOnly; /**< flag for checking whether only digits used or not */ + TelSatDataCodingSchemeInfo_t dcs; /**< data coding scheme */ + unsigned char stringLen; /**< menu item string length */ + char* pString; /**< Menu Item String */ +} TelSatMenuItemTextInfo_t; + +/** + * This structure defines tone object. + */ +typedef struct { + TelSatToneType_t type; /**< tone type */ +} TelSatToneInfo_t; + +/** + * This structure defines USSD string data object. + */ +typedef struct { + TelSatDataCodingSchemeInfo_t dcs; /**< data coding scheme */ + unsigned char ussdStringLen; /**< ussd string length */ + char ussdString[TAPI_SAT_USSD_STRING_LEN_MAX]; /**< ussd string */ +} TelSatUssdStringInfo_t; + +/** + * This structure defines File list data object. + */ +typedef struct { + unsigned char fileCount; /**< file count */ + TelSimFileName_t fileId[TAPI_SAT_FILE_ID_LIST_MAX_COUNT]; /**< file identifier */ +} TelSatFileListInfo_t; + +/** + * This structure defines default text data object. + */ +typedef struct { + int bIsPresent; /**< flag for checking whether default text exists or not */ + int bIsDigitOnly; /**< flag for checking whether only digits used or not */ + TelSatDataCodingSchemeInfo_t dcs; /**< data coding scheme */ + unsigned char stringLen; /**< default text string length */ + char string[TAPI_SAT_TEXT_STRING_LEN_MAX]; /**< default text */ +} TelSatDefaultTextInfo_t; + +/** + * This structure defines Next Action Indicator List data object. + */ +typedef struct { + unsigned char listCount; /**< next action identifier count */ + unsigned char list[TAPI_SAT_ITEMS_NEXT_ACTION_INDI_LIST_MAX_COUNT]; /**< next action identifier list */ +} TelSatItemsNextActionIndiListInfo_t; + +/** + * This structure defines event list data object. + */ +typedef struct { + unsigned char eventListCount; /**< event list count */ + TelSatEventDownloadType_t list[TAPI_SAT_EVENT_LIST_MAX_COUNT]; /**< event list */ +} TelSatEventListInfo_t; + +/** + * This structure defines icon info object. + */ +typedef struct { + unsigned char width; /**< icon width */ + unsigned char height; /**< icon height */ + TelSatImageCodingSchemeType_t ics; /**< image coding scheme */ + unsigned short iconDataLen; /**< icon data length */ + unsigned short clutDataLen; /**< clut data length */ + char iconFile[TAPI_SAT_IMG_DATA_FILE_PATH_LEN_MAX]; + char clutFile[TAPI_SAT_IMG_DATA_FILE_PATH_LEN_MAX]; +} TelSatIconInfo_t; + +/** + * This structure defines icon data object. + */ +typedef struct { + int bIsPresent; /**< flag for checking whether icon identifier exists or not */ + TelSatIconQualifierType_t iconQualifier; /**< icon qualifier type */ + unsigned char iconIdentifier; /**< icon identifier */ + TelSatIconInfo_t iconInfo; /**< icon info */ +} TelSatIconIdentifierInfo_t; + +/** + * This structure defines icon identifier data object. + */ +typedef struct { + int bIsPresent; /**< flag for checking whether icon identifier exists or not */ + TelSatIconQualifierType_t iconListQualifier; /**< icon list qualifier */ + unsigned char iconCount; /**< icon count */ + unsigned char iconIdentifierList[TAPI_SAT_ICON_LIST_MAX_COUNT]; /**< icon identifier list */ + TelSatIconInfo_t iconInfo[TAPI_SAT_ICON_LIST_MAX_COUNT]; /**< icon list info */ +} TelSatIconIdentifierListInfo_t; + +/** + * This structure defines SAT bc repeat indicator Info + */ +typedef struct { + TelSatBcRepeatIndicatorType_t indType; /**< bc repeat indicator type */ +} TelSatBcRepeatIndicatorInfo_t; + +/** + * This structure defines call control strings. + */ +typedef struct { + TelSatCallCtrlStringType_t callCtrlStringType; /**< call control type */ + union { + TelSatAddressInfo_t voiceString; /**< voice call string */ + TelSatSsStringInfo_t ssString; /**< ss string */ + TelSatUssdStringInfo_t ussdString; /**< ussd string */ + } u; /**< Union */ +} TelSatCallCtrlAddressStringInfo_t; + +/** + * This structure defines the Action requested call control data. + */ +typedef struct { + TelSatCallCtrlAddressStringInfo_t callCtrlAddString; /**< Call control address string */ + TelSatCapaConfigParamInfo_t ccp1; /**< Capability configuration parameter 1 */ + TelSatSubAddressInfo_t subAddress; /**< Subaddress */ + TelSatAlphaIdentifierInfo_t alphaId; /**< Alpha identifier */ + TelSatBcRepeatIndicatorInfo_t bcRepeatIndicator; /**< Bc repeat indicator */ + TelSatCapaConfigParamInfo_t ccp2; /**< Capability configuration parameter 2 */ +} TelSatCallCtrlRequestedActionInfo_t; + +/** + * This structure defines dtmf string data object. + */ +typedef struct { + unsigned char stringLen; /**< dtmf string lengh */ + char dtmfTone[TAPI_SAT_DTMF_STRING_LEN_MAX]; /**< dtmf tone data */ + +} TelSatDtmfStringInfo_t; + +/** + * This structure defines language data object. + */ +typedef struct { + TelSatLanguageType_t language; /**< language type */ +} TelSatLanguageInfo_t; + +/** + * This structure defines date time and time zone data object. + */ +typedef struct { + unsigned char year; /**< year */ + unsigned char month; /**< month */ + unsigned char day; /**< day */ + unsigned char hour; /**< hour */ + unsigned char minute; /**< minute */ + unsigned char second; /**< second */ + unsigned char timeZone; /**< timeZone */ +} TelSatDataTimeZoneInfo_t; + +/** + * This structure defines SAT browser identities. + */ +typedef struct { + TelSatBrowserIdentityType_t browserIdentity; /**< browser identity */ +} TelSatBrowserIdentitiesInfo_t; + +/** + * This structure defines SAT browser URL Data Object. + */ +typedef struct { + char string[TAPI_SAT_URL_LEN_MAX + 1]; /**< url string */ +} TelSatUrlInfo_t; + +/** + * This structure defines SAT bearer type. + */ +typedef struct { + unsigned char listLen; /**< bearer list length */ + TelSatBearerType_t bearerList[TAPI_SAT_BEARER_LIST_MAX_COUNT]; /**< bearer list */ +} TelSatBearerInfo_t; + +/** + * This structure defines SAT provisioning reference. + */ +typedef struct { + char provisioningFilePath[TAPI_SAT_PROVISIONING_FILE_PATH_LEN_MAX]; /**< provisioning file path */ + +} TelSatProvisioningRefInfo_t; + +/** + * This structure defines SAT browser termination cause. + */ +typedef struct { + TelSatBrowserTerminationCauseType_t cause; /**< browser termination cause */ +} TelSatBrowserTerminationCauseInfo_t; + +/** + * This structure defines SAT Csd bearer parameters . + */ +typedef struct { + TelSatBearerParamCsdDataRateType_t dataRate; /**< bearer csd data rate */ + TelSatBearerParamCsdBearerServiceType_t bearerService; /**< bearer csd service type */ + TelSatBearerParamCsdConnectionElementType_t connectionElement; /**< bearer connection element type */ +} TelSatBearerParametersCsdInfo_t; + +/** + * This structure defines SAT bearer parameters GPRS. + */ +typedef struct { + TelSatBearerParamGprsPrecedenceClassType_t precedenceClass; /**< bearer gprs precedence class */ + TelSatBearerParamGprsDelayClassType_t delayClass; /**< bearer gprs delay */ + TelSatBearerParamGprsReliabilityClassType_t reliabilityClass; /**< bearer gprs reliability */ + TelSatBearerParamGprsPeakThroughputClassType_t peakThroughputClass;/**< bearer gprs peak throughput */ + TelSatBearerParamGprsMeanThroughputClassType_t meanThroughputClass;/**< bearer gprs mean throughput */ + TelSatBearerParamGprsPdpType_t pdpType; /**< bearer gprs pdp type */ +} TelSatBearerParametersGprsInfo_t; + +/** + * This structure defines SAT bearer parameters local links. + */ +typedef struct { + TelSatBearerParamLocalLinksServiceIdentityType_t serviceIdentifier; /**< bearer local link service identifier */ + char serviceRecord[TAPI_SAT_BEARER_PARAMS_LEN_MAX]; /**< bearer local link service record */ +} TelSatBearerParametersLocalLinksInfo_t; + +/** + * This structure defines SAT bearer description. + */ +typedef struct { + TelSatBearerDescType_t bearerType; /**< bearer type */ + union { + TelSatBearerParametersCsdInfo_t bearerParamsCsd; /**< csd */ + TelSatBearerParametersGprsInfo_t bearerParamsGprs; /**< gprs */ + TelSatBearerParametersLocalLinksInfo_t bearerParamsLocalLinks; /**< local link */ + } bearer_params; /** + * + * 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. + */ + +/** +* @open +* @ingroup TelephonyAPI +* @addtogroup SAT_TAPI SAT +* @{ +* +* @file TelSatProactvCmd.h + + @brief This file serves as a "C" header file defines structures for Tapi SAT Proactive commands and terminal response Services. \n + It contains a sample set of constants, enums, structs that would be required by applications. + */ + +#ifndef _TEL_SAT_PROACTV_CMD_H_ +#define _TEL_SAT_PROACTV_CMD_H_ +/*================================================================================================== + INCLUDE FILES +==================================================================================================*/ +#include + +#ifdef __cplusplus +extern "C" +{ +#endif + +/*================================================================================================== + MACROS +==================================================================================================*/ +#define TAPI_SAT_MENU_ITEM_COUNT_MAX 40 /**< max count of sat menu items */ +#define TAPI_SAT_PROVISIONING_REF_MAX_COUNT 10 /**< max count of sat provisioning reference */ + +/*================================================================================================== + ENUMS +==================================================================================================*/ + + +/*================================================================================================== + STRUCTURES AND OTHER TYPEDEFS +==================================================================================================*/ +/** + * This structure contains the data objects for DISPLAY TEXT proactive command indication. + */ +typedef struct +{ + TelSatCommandDetailInfo_t commandDetail; /**< command detail info. includes command number, type, qualifier */ + TelSatDeviceIdentitiesInfo_t deviceIdentities; /**< device identities info. includes source and destination devices */ +} TelSatMoreTimeIndInfo_t; + +/** + * This structure contains the data objects for DISPLAY TEXT proactive command indication. + */ +typedef struct +{ + TelSatCommandDetailInfo_t commandDetail; /**< command detail info. includes command number, type, qualifier */ + TelSatDeviceIdentitiesInfo_t deviceIdentities; /**< device identities info. includes source and destination devices */ + TelSatTextTypeInfo_t text; /**< display text info */ + TelSatIconIdentifierInfo_t iconId; /**< icon identifier info */ + int bImmediateRespRequested; /**< flag for checking whether immediate response required or not */ + TelSatDurationInfo_t duration; /**< duration for which text should be displayed */ + TelSatTextAttributeInfo_t textAttribute; /**< text attribute info -e.g. bold, center align */ +} TelSatDisplayTextIndInfo_t; + +/** + * This structure contains the data objects for GET INKEY proactive command indication. + */ +typedef struct +{ + TelSatCommandDetailInfo_t commandDetail; /**< command detail info. includes command number, type, qualifier */ + TelSatDeviceIdentitiesInfo_t deviceIdentities; /**< device identities info. includes source and destination devices */ + TelSatTextTypeInfo_t text; /**< display text info */ + TelSatIconIdentifierInfo_t iconId; /**< icon identifier info */ + TelSatDurationInfo_t duration; /**< duration for which text should be displayed */ + TelSatTextAttributeInfo_t textAttribute; /**< text attribute info -e.g. bold, center align */ +} TelSatGetInkeyIndInfo_t; + +/** + * This structure contains the data objects for GET INPUT proactive command indication. + */ +typedef struct +{ + TelSatCommandDetailInfo_t commandDetail; /**< command detail info. includes command number, type, qualifier */ + TelSatDeviceIdentitiesInfo_t deviceIdentities; /**< device identities info. includes source and destination devices */ + TelSatTextTypeInfo_t text; /**< display text info */ + TelSatRespLenInfo_t respLen; /**< input response length */ + TelSatTextTypeInfo_t defaultText; /**< default text info */ + TelSatIconIdentifierInfo_t iconId; /**< icon identifier info */ + TelSatTextAttributeInfo_t textAttribute; /**< text attribute info -e.g. bold, center align */ +} TelSatGetInputIndInfo_t; + +/** + * This structure contains the data objects for PLAY TONE proactive command indication. + */ +typedef struct +{ + TelSatCommandDetailInfo_t commandDetail; /**< command detail info. includes command number, type, qualifier */ + TelSatDeviceIdentitiesInfo_t deviceIdentities; /**< device identities info. includes source and destination devices */ + TelSatAlphaIdentifierInfo_t alphaId; /**< alpha identifier(string) info */ + TelSatToneInfo_t tone; /**< tone info */ + TelSatDurationInfo_t duration; /**< duration for which tone should be played */ + TelSatIconIdentifierInfo_t iconId; /**< icon identifier info */ + TelSatTextAttributeInfo_t textAttribute; /**< text attribute info -e.g. bold, center align */ +} TelSatPlayToneIndInfo_t; + +/** + * This structure contains the data objects for SETUP MENU proactive command indication. + */ +typedef struct +{ + TelSatCommandDetailInfo_t commandDetail; /**< command detail info. includes command number, type, qualifier */ + TelSatDeviceIdentitiesInfo_t deviceIdentities; /**< device identities info. includes source and destination devices */ + TelSatAlphaIdentifierInfo_t alphaId; /**< alpha identifier(string) info */ + unsigned char menuItemCount; /**< count of menu items */ + TelSatMenuItemInfo_t menuItem[TAPI_SAT_MENU_ITEM_COUNT_MAX]; /**< menu item data */ + TelSatItemsNextActionIndiListInfo_t itemNextActionIndList; /**< next action indication list */ + TelSatIconIdentifierInfo_t iconId; /**< icon identifier info */ + TelSatIconIdentifierListInfo_t iconIdList; /**< icon identifier list info */ + TelSatTextAttributeInfo_t textAttribute; /**< text attribute info -e.g. bold, center align */ + TelSatTextAttributeListInfo_t itemTextAttributeList; /**< item text attribute list */ + +} TelSatSetupMenuIndInfo_t; + +/** + * This structure contains the data objects for SELECT ITEM proactive command indication data. + */ +typedef struct +{ + TelSatCommandDetailInfo_t commandDetail; /**< command detail info. includes command number, type, qualifier */ + TelSatDeviceIdentitiesInfo_t deviceIdentities; /**< device identities info. includes source and destination devices */ + TelSatAlphaIdentifierInfo_t alphaId; /**< alpha identifier(string) info */ + TelSatItemsNextActionIndiListInfo_t itemNextActionIndList; /**< next action indication list */ + unsigned char defaultItemIdentifier; /**< default item identifier(default selected item id) */ + TelSatIconIdentifierInfo_t iconId; /**< icon identifier info */ + TelSatIconIdentifierListInfo_t iconIdList; /**< icon identifier list info */ + TelSatTextAttributeInfo_t textAttribute; /**< text attribute info -e.g. bold, center align */ + TelSatTextAttributeListInfo_t itemTextAttributeList; /**< item text attribute list */ + unsigned char menuItemCount; /**< count of menu items */ + TelSatMenuItemInfo_t menuItem[TAPI_SAT_MENU_ITEM_COUNT_MAX]; /**< menu item data */ + +} TelSatSelectItemIndInfo_t; + +/** + * This structure contains the data objects for SEND SHORT MESSAGE proactive command indication. + */ +typedef struct +{ + TelSatCommandDetailInfo_t commandDetail; /**< command detail info. includes command number, type, qualifier */ + TelSatDeviceIdentitiesInfo_t deviceIdentities; /**< device identities info. includes source and destination devices */ + TelSatAlphaIdentifierInfo_t alphaId; /**< alpha identifier(string) info */ + TelSatAddressInfo_t address; /**< address for sending sms */ + TelSatSmsTpduInfo_t smsTpdu; /**< sms tpdu info */ + TelSatIconIdentifierInfo_t iconId; /**< icon identifier info */ + TelSatTextAttributeInfo_t textAttribute; /**< text attribute info -e.g. bold, center align */ +} TelSatSendSmsIndInfo_t; + +/** + * This structure contains the data objects for SEND SS proactive command indication. + */ +typedef struct +{ + TelSatCommandDetailInfo_t commandDetail; /**< command detail info. includes command number, type, qualifier */ + TelSatDeviceIdentitiesInfo_t deviceIdentities; /**< device identities info. includes source and destination devices */ + TelSatAlphaIdentifierInfo_t alphaId; /**< alpha identifier(string) info */ + TelSatSsStringInfo_t ssString; /**< ss string */ + TelSatIconIdentifierInfo_t iconId; /**< icon identifier info */ + TelSatTextAttributeInfo_t textAttribute; /**< text attribute info -e.g. bold, center align */ +} TelSatSendSsIndInfo_t; + +/** + * This structure contains the data objects for SEND USSD proactive command indication. + */ +typedef struct +{ + TelSatCommandDetailInfo_t commandDetail; /**< command detail info. includes command number, type, qualifier */ + TelSatDeviceIdentitiesInfo_t deviceIdentities; /**< device identities info. includes source and destination devices */ + TelSatAlphaIdentifierInfo_t alphaId; /**< alpha identifier(string) info */ + TelSatUssdStringInfo_t ussdString; /**< ussd string info */ + TelSatIconIdentifierInfo_t iconId; /**< icon identifier info */ + TelSatTextAttributeInfo_t textAttribute; /**< text attribute info -e.g. bold, center align */ +} TelSatSendUssdIndInfo_t; + +/** + * This structure contains the data objects for SETUP CALL proactive command indication. + */ +typedef struct +{ + TelSatCommandDetailInfo_t commandDetail; /**< command detail info. includes command number, type, qualifier */ + TelSatDeviceIdentitiesInfo_t deviceIdentities; /**< device identities info. includes source and destination devices */ + TelSatAddressInfo_t address; /**< setup call address info*/ + TelSatCapaConfigParamInfo_t ccp; /**< capability configuration parameter */ + TelSatSubAddressInfo_t subAddress; /**< setup call sub address */ + TelSatDurationInfo_t duration; /**< command execution time duration */ + TelSatAlphaIdentifierInfo_t userConfirmPhaseAlphaId;/**< user Confirmation Phase AlphaId */ + TelSatAlphaIdentifierInfo_t callSetupPhaseAlphaId; /**< call Setup Phase AlphaId */ + TelSatIconIdentifierInfo_t userConfirmPhaseIconId; /**< user Confirmation Phase IconId */ + TelSatIconIdentifierInfo_t callSetupPhaseIconId; /**< call Setup Phase IconId */ + TelSatTextAttributeInfo_t userConfirmPhaseTextAttribute; /**< user Confirmation Phase Text Attribute */ + TelSatTextAttributeInfo_t callSetupPhaseTextAttribute; /**< call Setup PhaseText Attribute */ +} TelSatSetupCallIndInfo_t; + +/** + * This structure contains the data objects for REFRESH proactive command indication. + */ +typedef struct +{ + TelSatCommandDetailInfo_t commandDetail; /**< command detail info. includes command number, type, qualifier */ + TelSatDeviceIdentitiesInfo_t deviceIdentities; /**< device identities info. includes source and destination devices */ + TelSatFileListInfo_t fileList; /**< file list for refresh */ + TelSatAidInfo_t aid; /**< application Id */ +} TelSatRefreshIndInfo_t; + +/** + * This structure contains the data objects for PROVIDE LOCAL INFO proactive command indication. + */ +typedef struct +{ + TelSatCommandDetailInfo_t commandDetail; /**< command detail info. includes command number, type, qualifier */ + TelSatDeviceIdentitiesInfo_t deviceIdentities; /**< device identities info. includes source and destination devices */ + +} TelSatProvideLocalInfoIndInfo_t; + +/** + * This structure contains the data objects for SETUP EVENT LIST proactive command indication data. + */ +typedef struct +{ + TelSatCommandDetailInfo_t commandDetail; /**< command detail info. includes command number, type, qualifier */ + TelSatDeviceIdentitiesInfo_t deviceIdentities; /**< device identities info. includes source and destination devices */ + TelSatEventListInfo_t eventList; /**< event list contains events which are required by USIM application */ + +} TelSatSetupEventListIndInfo_t; + +/** + * This structure contains the data objects for SETUP IDLE MODE TEXT proactive command indication. + */ +typedef struct +{ + TelSatCommandDetailInfo_t commandDetail; /**< command detail info. includes command number, type, qualifier */ + TelSatDeviceIdentitiesInfo_t deviceIdentities; /**< device identities info. includes source and destination devices */ + TelSatTextTypeInfo_t text; /**< text to be shown on idle screen */ + TelSatIconIdentifierInfo_t iconId; /**< icon identifier info */ + TelSatTextAttributeInfo_t textAttribute; /**< text attribute info -e.g. bold, center align */ +} TelSatSetupIdleModeTextIndInfo_t; + +/** + * This structure contains the data objects for SEND DTMF COMMAND proactive command indication. + */ +typedef struct +{ + TelSatCommandDetailInfo_t commandDetail; /**< command detail info. includes command number, type, qualifier */ + TelSatDeviceIdentitiesInfo_t deviceIdentities; /**< device identities info. includes source and destination devices */ + TelSatAlphaIdentifierInfo_t alphaId; /**< alpha identifier(string) info */ + TelSatDtmfStringInfo_t dtmfString; /**< dtmf string */ + TelSatIconIdentifierInfo_t iconId; /**< icon identifier info */ + TelSatTextAttributeInfo_t textAttribute; /**< text attribute info -e.g. bold, center align */ +} TelSatSendDtmfIndInfo_t; + +/** + * This structure contains the data objects for LANGUAGE NOTIFICATION proactive command indication. + */ +typedef struct +{ + TelSatCommandDetailInfo_t commandDetail; /**< command detail info. includes command number, type, qualifier */ + TelSatDeviceIdentitiesInfo_t deviceIdentities; /**< device identities info. includes source and destination devices */ + TelSatLanguageInfo_t language; /**< language info from USIM application */ +} TelSatLanguageNotificationIndInfo_t; + +/** + * This structure contains the data objects for LAUNCH BROWSER proactive command indication. + */ +typedef struct +{ + TelSatCommandDetailInfo_t commandDetail; /**< command detail info. includes command number, type, qualifier */ + TelSatDeviceIdentitiesInfo_t deviceIdentities; /**< device identities info. includes source and destination devices */ + TelSatBrowserIdentitiesInfo_t browserId; /**< browser identity */ + TelSatUrlInfo_t url; /**< url */ + TelSatBearerInfo_t bearer; /**< bearer which is used by browser */ + unsigned char provisioningRefCount; /**< provisioning reference count */ + TelSatProvisioningRefInfo_t provisioningRef[TAPI_SAT_PROVISIONING_REF_MAX_COUNT]; /**< provisioning reference data */ + TelSatTextTypeInfo_t text; /**< display text info */ + TelSatAlphaIdentifierInfo_t alphaId; /**< alpha identifier(string) info */ + TelSatIconIdentifierInfo_t iconId; /**< icon identifier info */ + TelSatTextAttributeInfo_t textAttribute; /**< text attribute info -e.g. bold, center align */ +} TelSatLaunchBrowserIndInfo_t; + +/** + * This structure contains the data objects for OPEN CHANNEL CSB proactive command indication data. + */ +typedef struct +{ + TelSatAddressInfo_t address; /**< channel address */ + TelSatSubAddressInfo_t subAddress; /**< channel sub address */ + TelSatDurationInfo_t duration1; /**< connection require time */ + TelSatDurationInfo_t duration2; /**< connection require time2 */ + TelSatBearerParametersCsdInfo_t bearerParamsCsd; /**< csd info */ + TelSatBufferSizeInfo_t bufferSize; /**< bufferSize */ + TelSatOtherAddressInfo_t otherAddress; /**< otherAddress */ + TelSatTextTypeInfo_t userLogin; /**< userLogin */ + TelSatTextTypeInfo_t userPassword; /**< userPassword */ + TelSatSimMeInterfaceTransportLevelInfo_t simMeInterfaceTransportLevel; /**< simMeInterfaceTransportLevel */ + TelSatOtherAddressInfo_t dataDestinationAddress; /**< dataDestinationAddress */ +} TelSatOpenChannelCsbInfo_t; + +/** + * This structure contains the data objects for OPEN CHANNEL (packet) proactive command indication data. + */ +typedef struct +{ + TelSatBearerParametersGprsInfo_t bearerParamsGprs; /**< gprs info */ + TelSatBufferSizeInfo_t bufferSize; /**< bufferSize */ + TelSatnetworkAccessNameInfo_t networkAccessName; /**< networkAccessName */ + TelSatOtherAddressInfo_t otherAddress; /**< otherAddress */ + TelSatTextTypeInfo_t userLogin; /**< userLogin */ + TelSatTextTypeInfo_t userPassword; /**< userPassword */ + TelSatSimMeInterfaceTransportLevelInfo_t simMeInterfaceTransportLevel; /**< simMeInterfaceTransportLevel */ + TelSatOtherAddressInfo_t dataDestinationAddress; /**< dataDestinationAddress */ + TelSatTextAttributeInfo_t textAttribute; /**< text attribute info -e.g. bold, center align */ +} TelSatOpenChannelpdbInfo_t; + +/** + * This structure contains the data objects for OPEN CHANNEL LOCAL LINK proactive command indication data. + */ +typedef struct +{ + TelSatDurationInfo_t duration1; /**< command execution time duration1 */ + TelSatDurationInfo_t duration2; /**< command execution time duration2 */ + TelSatBearerParametersLocalLinksInfo_t bearerParamsLocalLinks; /**< local link info */ + TelSatBufferSizeInfo_t bufferSize; /**< bufferSize */ + TelSatTextTypeInfo_t userPassword; /**< userPassword */ + TelSatSimMeInterfaceTransportLevelInfo_t simMeInterfaceTransportLevel; /**< simMeInterfaceTransportLevel */ + TelSatOtherAddressInfo_t dataDestinationAddress; /**< dataDestinationAddress */ + TelSatRemoteEntityAddressInfo_t remoteEntityAddress; /**< remoteEntityAddress */ + TelSatTextAttributeInfo_t textAttribute; /**< text attribute info -e.g. bold, center align */ +} TelSatOpenChannelLocalBearerInfo_t; + +/** + * This structure contains the data objects for OPEN CHANNEL (DEFAULT BEARER) proactive command indication data. + */ +typedef struct +{ + TelSatBufferSizeInfo_t bufferSize; /**< bufferSize */ + TelSatOtherAddressInfo_t otherAddress; /**< otherAddress */ + TelSatTextTypeInfo_t userLogin; /**< userLogin */ + TelSatTextTypeInfo_t userPassword; /**< userPassword */ + TelSatSimMeInterfaceTransportLevelInfo_t simMeInterfaceTransportLevel;/**< simMeInterfaceTransportLevel */ + TelSatOtherAddressInfo_t dataDestinationAddress; /**< dataDestinationAddress */ +} TelSatOpenChannelDefaultBearerInfo_t; + +/** + * This structure contains the data objects for OPEN CHANNEL (UICC Server Mode) proactive command indication data. + */ +typedef struct +{ + TelSatBufferSizeInfo_t bufferSize; /**< bufferSize */ + TelSatSimMeInterfaceTransportLevelInfo_t simMeInterfaceTransportLevel; /**< simMeInterfaceTransportLevel */ +} TelSatOpenChannelUiccServerModeInfo_t; + +/** + * This structure contains the data objects for OPEN CHANNEL proactive command indication data. + */ +typedef struct +{ + TelSatCommandDetailInfo_t commandDetail; /**< command detail info. includes command number, type, qualifier */ + TelSatDeviceIdentitiesInfo_t deviceIdentities; /**< device identities info. includes source and destination devices */ + int bIsUiccServerMode; /**< flag whether UICC server mode or not */ + TelSatBearerDescType_t bearerType; /**< bearer destination type */ + TelSatAlphaIdentifierInfo_t alphaId; /**< alpha identifier(string) info */ + TelSatIconIdentifierInfo_t iconId; /**< icon identifier info */ + union + { + TelSatOpenChannelCsbInfo_t csBearer; /**< cs info */ + TelSatOpenChannelpdbInfo_t pdBearer; /**< pbd info */ + TelSatOpenChannelLocalBearerInfo_t locBearer; /**< local link info */ + TelSatOpenChannelDefaultBearerInfo_t defaultBearer; /**< defaultBearer */ + TelSatOpenChannelUiccServerModeInfo_t uiccServerMode; /**< uiccServerMode */ + }details; /**< Open Channel Details */ +}TelSatOpenChannelIndInfo_t; + +/** + * This structure contains the data objects for CLOSE CHANNEL proactive command indication data. + */ +typedef struct +{ + TelSatCommandDetailInfo_t commandDetail; /**< command detail info. includes command number, type, qualifier */ + TelSatDeviceIdentitiesInfo_t deviceIdentities; /**< device identities info. includes source and destination devices */ + TelSatAlphaIdentifierInfo_t alphaId; /**< alpha identifier(string) info */ + TelSatIconIdentifierInfo_t iconId; /**< icon identifier info */ + TelSatTextAttributeInfo_t textAttribute; /**< text attribute info -e.g. bold, center align */ +} TelSatCloseChannelIndInfo_t; + +/** + * This structure contains the data objects for RECEIVE DATA proactive command indication data. + */ +typedef struct +{ + TelSatCommandDetailInfo_t commandDetail; /**< command detail info. includes command number, type, qualifier */ + TelSatDeviceIdentitiesInfo_t deviceIdentities; /**< device identities info. includes source and destination devices */ + TelSatAlphaIdentifierInfo_t alphaId; /**< alpha identifier(string) info */ + TelSatIconIdentifierInfo_t iconId; /**< icon identifier info */ + TelSatChannelDataLengthInfo_t channelDataLen; /**< channel data length */ +} TelSatReceiveDataIndInfo_t; + +/** + * This structure contains the data objects for SEND DATA proactive command indication data. + */ +typedef struct +{ + TelSatCommandDetailInfo_t commandDetail; /**< command detail info. includes command number, type, qualifier */ + TelSatDeviceIdentitiesInfo_t deviceIdentities; /**< device identities info. includes source and destination devices */ + TelSatAlphaIdentifierInfo_t alphaId; /**< alpha identifier(string) info */ + TelSatIconIdentifierInfo_t iconId; /**< icon identifier info */ + TelSatChannelDataInfo_t channel_data; /**< channel data for sending */ +} TelSatSendDataIndInfo_t; + +/** + * This structure contains the data objects for GET CHANNEL STATUS proactive command indication data. + */ +typedef struct +{ + TelSatCommandDetailInfo_t commandDetail; /**< command detail info. includes command number, type, qualifier */ + TelSatDeviceIdentitiesInfo_t deviceIdentities; /**< device identities info. includes source and destination devices */ +} TelSatGetChannelStatusIndInfo_t; + +/** + * This structure contains the data object for END PROACTIVE SESSION command indication. + */ +typedef struct +{ + TelSatCommandType_t commandType; /**< proactive command type */ +} TelSatEndProactiveSessionIndInfo_t; + +/** + * This structure contains the data objects for PROACTIVE command indication union data. + */ +typedef struct +{ + union + { + TelSatMoreTimeIndInfo_t moreTime; + TelSatDisplayTextIndInfo_t displayText; /**< Parsed proactive command info from TLV to Telephony data type - display text */ + TelSatGetInkeyIndInfo_t getInkey; /**< Parsed proactive command info from TLV to Telephony data type - getInkey */ + TelSatGetInputIndInfo_t getInput; /**< Parsed proactive command info from TLV to Telephony data type - getInput */ + TelSatPlayToneIndInfo_t playTone; /**< Parsed proactive command info from TLV to Telephony data type - play tone */ + TelSatSetupMenuIndInfo_t setupMenu; /**< Parsed proactive command info from TLV to Telephony data type - setup menu */ + TelSatSelectItemIndInfo_t selectItem; /**< Parsed proactive command info from TLV to Telephony data type - select item */ + TelSatSendSmsIndInfo_t sendSms; /**< Parsed proactive command info from TLV to Telephony data type - send sms */ + TelSatSendSsIndInfo_t sendSs; /**< Parsed proactive command info from TLV to Telephony data type - send ss */ + TelSatSendUssdIndInfo_t sendUssd; /**< Parsed proactive command info from TLV to Telephony data type - send ussd */ + TelSatSetupCallIndInfo_t setupCall; /**< Parsed proactive command info from TLV to Telephony data type - setup call */ + TelSatRefreshIndInfo_t refresh; /**< Parsed proactive command info from TLV to Telephony data type - refresh */ + TelSatProvideLocalInfoIndInfo_t provideLocInfo; /**< Parsed proactive command info from TLV to Telephony data type - provide local info */ + TelSatLaunchBrowserIndInfo_t launchBrowser; /**< Parsed proactive command info from TLV to Telephony data type - launch browser */ + TelSatSetupIdleModeTextIndInfo_t idleText; /**< Parsed proactive command info from TLV to Telephony data type - setup idle mode text */ + TelSatSendDtmfIndInfo_t sendDtmf; /**< Parsed proactive command info from TLV to Telephony data type - send dtmf */ + TelSatLanguageNotificationIndInfo_t languageNotification;/**< Parsed proactive command info from TLV to Telephony data type - language notification */ + TelSatSetupEventListIndInfo_t setupEventList; /**< Parsed proactive command info from TLV to Telephony data type - setup event list */ + TelSatOpenChannelIndInfo_t openChannel; /**< Parsed proactive command info from TLV to Telephony data type - open channel */ + TelSatCloseChannelIndInfo_t closeChannel; /**< Parsed proactive command info from TLV to Telephony data type - close channel */ + TelSatReceiveDataIndInfo_t receiveData; /**< Parsed proactive command info from TLV to Telephony data type - receive data */ + TelSatSendDataIndInfo_t sendData; /**< Parsed proactive command info from TLV to Telephony data type - send data */ + TelSatGetChannelStatusIndInfo_t getChannelStatus; /**< Parsed proactive command info from TLV to Telephony data type - get channel status */ + }cmdInfo; /**< Union */ +}TelSatProactiveCmdData_t; + +/** + * This structure contains the data objects for the Terminal Response of DISPLAY TEXT proactive command. + */ +typedef struct +{ + TelSatResultInfo_t result; /**< result whether current proactive command request was executed successfully or not */ +}TelSatDisplayTextRespInfo_t; + +/** + * This structure contains the data objects for the Terminal Response of GET INKEY proactive command. + */ +typedef struct +{ + TelSatResultInfo_t result; /**< result whether current proactive command request was executed successfully or not */ + TelSatTextTypeInfo_t text; /**< inserted key info */ + TelSatDurationInfo_t duration; +}TelSatGetInkeyRespInfo_t; + +/** + * This structure contains the data objects for the Terminal Response of PLAY TONE proactive command. + */ +typedef struct +{ + TelSatResultInfo_t result; /**< result whether current proactive command request was executed successfully or not */ +}TelSatPlayToneRespInfo_t; + +/** + * This structure contains the data objects for the Terminal Response of MORE TIME proactive command. + */ +typedef struct +{ + TelSatResultInfo_t result; /**< result whether current proactive command request was executed successfully or not */ +}TelSatMoreTimeRespInfo_t; + +/** + * This structure contains the data objects for the Terminal Response of SETUP MENU proactive command. + */ +typedef struct +{ + TelSatResultInfo_t result; /**< result whether current proactive command request was executed successfully or not */ +}TelSatSetupMenuRespInfo_t; + +/** + * This structure contains the data objects for the Terminal Response of GET INPUT proactive command. + */ +typedef struct +{ + TelSatResultInfo_t result; /**< result whether current proactive command request was executed successfully or not */ + TelSatTextTypeInfo_t text; /**< inserted string info */ +}TelSatGetInputRespInfo_t; + +/** + * This structure contains the data objects for the Terminal Response of SELECT ITEM proactive command. + */ +typedef struct +{ + TelSatResultInfo_t result; /**< result whether current proactive command request was executed successfully or not */ + int bOtherInfo; /**< flag to check whether other information is required or not */ + unsigned char itemIdentifier; /**< item identifier */ +}TelSatSelectItemRespInfo_t; + +/** + * This structure contains the data objects for the Terminal Response of PROVIDE LOCAL INFORMATION proactive command. + */ +typedef struct +{ + TelSatResultInfo_t result; /**< result whether current proactive command request was executed successfully or not */ + int bOtherInfo; /**< flag to check whether other information is required or not */ + TelSatCmdQualiProvideLocalInfo_t infoType; /**< local info type - e.g. time zone or language info, etc */ + union + { + TelSatDataTimeZoneInfo_t timeZoneInfo; /**< current time zone info */ + TelSatLanguageInfo_t languageInfo; /**< current ME language setting info */ + }u; /**< Union */ +}TelSatProvideLocalInfoRespInfo_t; + +/** + * This structure contains the data objects for the Terminal Response of SETUP EVENT LIST proactive command. + */ +typedef struct +{ + TelSatResultInfo_t result; /**< result whether current proactive command request was executed successfully or not */ +}TelSatSetupEventListRespInfo_t; + +/** + * This structure contains the data objects for the Terminal Response of SEND SMS proactive command. + */ +typedef struct +{ + TelSatResultInfo_t result; /**< result whether current proactive command request was executed successfully or not */ + TelSatCallCtrlProblemType_t additionalCallCtrlProblemInfo; /**< call control problem */ +}TelSatSendSmsRespInfo_t; + +/** + * This structure contains the data objects for the Terminal Response of SET UP CALL proactive command. + */ +typedef struct +{ + TelSatResultInfo_t result; /**< result whether current proactive command request was executed successfully or not */ + int bOtherInfo; /**< flag to check whether other information are required or not */ + TelSatNetworkProblemType_t networkProblem; /**< network problem during setup call */ + TelSatCallCtrlProblemType_t permanentCallCtrlProblem; /**< permanent call control problem */ + TelSatCallCtrlRequestedActionInfo_t callCtrlRequestedAction; /**< call control requested action info */ + TelSatResultInfo_t result2; /**< additional response on general result */ + TelSatTextTypeInfo_t text; /**< text string info */ + int bIsTapiCause; /**< flag to check whether tapi makes problem or not */ + unsigned long tapiCause; /**< tapi call level cause */ + unsigned long tapiSsCause; /**< tapi ss level cause */ + }TelSatSetupCallRespInfo_t; + +/** + * This structure contains the data objects for the Terminal Response of SEND SS proactive command. + */ +typedef struct +{ + TelSatResultInfo_t result; /**< result whether current proactive command request was executed successfully or not */ + int bOtherInfo; /**< flag to check whether whether other information is required or not */ + TelSatSsProblemType_t additionalSsProblemInfo; /**< additional ss problem */ + TelSatCallCtrlProblemType_t additionalCallCtrlProblemInfo; /**< additional call control problem */ + TelSatCallCtrlRequestedActionInfo_t callCtrlRequestedAction; /**< call control requested action info */ + TelSatResultInfo_t result2; /**< additional response on general result */ + TelSatTextTypeInfo_t text; /**< text string info */ +}TelSatSendSsRespInfo_t; + +/** + * This structure contains the data objects for the Terminal Response of SEND USSD proactive command. + */ +typedef struct +{ + TelSatResultInfo_t result; /**< result whether current proactive command request was executed successfully or not */ + int bOtherInfo; /**< flag to check whether other information is required or not */ + TelSatUssdProblemType_t additionalUssdProblemInfo; /**< additional ussd problem */ + TelSatCallCtrlProblemType_t additionalCallCtrlProblemInfo; /**< additional call control problem */ + int bCallCtrlHasModification; /**< flag to check whether modification happens during call control */ + TelSatTextTypeInfo_t text; /**< text string info */ + TelSatCallCtrlRequestedActionInfo_t callCtrlRequestedAction; /**< call control requested action info */ + TelSatResultInfo_t result2; /**< additional response on general result */ + TelSatTextTypeInfo_t text2; /**< text string info */ +}TelSatSendUssdRespInfo_t; + +/** + * This structure contains the data objects for the Terminal Response of REFRESH proactive command. + */ +typedef struct +{ + TelSatResultInfo_t result; /**< result whether current proactive command request was executed successfully or not */ +}TelSatRefreshRespInfo_t; + +/** + * This structure contains the data objects for the Terminal Response of GET CHANNEL STATUS proactive command. + */ +typedef struct +{ + TelSatResultInfo_t result; /**< result whether current proactive command request was executed successfully or not */ + int bOtherInfo; /**< flag whether other information are required or not */ + TelSatBipProblemType_t additionalProblemInfo; /**< bip specific problem info */ + TelSatChannelStatusInfo_t channelStatus; /**< channel Status */ +}TelSatGetChannelStatusRespInfo_t; + +/** + * This structure contains the data objects for the Terminal Response of CLOSE CHANNEL proactive command. + */ +typedef struct +{ + TelSatResultInfo_t result; /**< result whether current proactive command request was executed successfully or not */ + TelSatBipProblemType_t additionalProblemInfo; /**< bip specific problem info */ +}TelSatCloseChannelRespInfo_t; + +/** + * This structure contains the data objects for the Terminal Response of OPEN CHANNEL proactive command. + */ +typedef struct +{ + TelSatResultInfo_t result; /**< result whether current proactive command request was executed successfully or not */ + int bOtherInfo; /**< flag whether other information are required or not */ + TelSatBearerDescriptionInfo_t bearerDescription; /**< bearerDescription */ + TelSatBipProblemType_t additionalProblemInfo; /**< bip specific problem info */ + TelSatChannelStatusInfo_t channelStatus; /**< channelStatus */ + TelSatBufferSizeInfo_t bufferSize; /**< bufferSize */ +}TelSatOpenChannelRespInfo_t; + +/** + * This structure contains the data objects for the Terminal Response of LANGAUGE NOTIFICATION proactive command. + */ +typedef struct +{ + TelSatResultInfo_t result; /**< result whether current proactive command request was executed successfully or not */ +}TelSatLanguageNotificationRespInfo_t; + +/** + * This structure contains the data objects for the Terminal Response of LAUNCH BROWSER proactive command. + */ +typedef struct +{ + TelSatResultInfo_t result; /**< result whether current proactive command request was executed successfully or not */ + TelSatLaunchBrowserProblemType_t additionalProblemInfo; /**< browser specific problem info */ +}TelSatLaunchBrowserRespInfo_t; + +/** + * This structure contains the data objects for the Terminal Response of RECEIVE DATA proactive command. + */ +typedef struct +{ + TelSatResultInfo_t result; /**< result whether current proactive command request was executed successfully or not */ + TelSatBipProblemType_t additionalProblemInfo; /**< bip specific problem info */ + int bOtherInfo; /**< flag whether other information are required or not */ + TelSatChannelDataInfo_t channel_data; /**< channel data */ + unsigned char channelDataLen; /**< channel data length */ +}TelSatReceiveDataRespInfo_t; + + +/** + * This structure contains the data objects for the Terminal Response of SEND DATA proactive command. + */ +typedef struct +{ + TelSatResultInfo_t result; /**< result whether current proactive command request was executed successfully or not */ + TelSatBipProblemType_t additionalProblemInfo; /**< bip specific problem info */ + unsigned char channelDataLen; /**< channel data length */ +}TelSatSendDataRespInfo_t; + + +/** + * This structure contains the data objects for the Terminal Response of SETUP IDLE MODE TEXT proactive command. + */ +typedef struct +{ + TelSatResultInfo_t result; /**< result whether current proactive command request was executed successfully or not */ +}TelSatSetupIdlemodeTextRespInfo_t; + +/** + * This structure contains the data objects for the Terminal Response of SEND DTMF proactive command. + */ +typedef struct +{ + TelSatResultInfo_t result; /**< result whether current proactive command request was executed successfully or not */ +}TelSatSendDtmfRespInfo_t; + +/** + * This contains the data structures to be used to send proactive command response. + */ +typedef struct +{ + unsigned char commandNumber; /**< proactive command number */ + TelSatCommandType_t commandType; /**< proactive command type */ + union + { + TelSatMoreTimeRespInfo_t moreTime; + TelSatDisplayTextRespInfo_t displayText; /**< terminal response info from displayText proactive command */ + TelSatGetInkeyRespInfo_t getInkey; /**< terminal response info from getInkey proactive command */ + TelSatGetInputRespInfo_t getInput; /**< terminal response info from getInput proactive command */ + TelSatPlayToneRespInfo_t playTone; /**< terminal response info from playTone proactive command */ + TelSatSetupMenuRespInfo_t setupMenu; /**< terminal response info from setupMenu proactive command */ + TelSatSelectItemRespInfo_t selectItem; /**< terminal response info from selectItem proactive command */ + TelSatSendSmsRespInfo_t sendSms; /**< terminal response info from sendSms proactive command */ + TelSatSendSsRespInfo_t sendSs; /**< terminal response info from sendSs proactive command */ + TelSatSendUssdRespInfo_t sendUssd; /**< terminal response info from sendUssd proactive command */ + TelSatSetupCallRespInfo_t setupCall; /**< terminal response info from setupCall proactive command */ + TelSatRefreshRespInfo_t refresh; /**< terminal response info from refresh proactive command */ + TelSatProvideLocalInfoRespInfo_t provideLocInfo; /**< terminal response info from provide Local Info proactive command */ + TelSatLaunchBrowserRespInfo_t launchBrowser; /**< terminal response info from launch Browser proactive command */ + TelSatSetupIdlemodeTextRespInfo_t idleText; /**< terminal response info from setup idle mode text proactive command */ + TelSatSendDtmfRespInfo_t sendDtmf; /**< terminal response info from send Dtmf proactive command */ + TelSatLanguageNotificationRespInfo_t languageNotification; /**< terminal response info from language Notification proactive command */ + TelSatSetupEventListRespInfo_t setupEventList; /**< terminal response info from setup Event List proactive command */ + TelSatOpenChannelRespInfo_t openChannel; /**< terminal response info from openChannel proactive command */ + }terminalRespInfo; /**< Union */ +}TelSatRespInfo_t; + +/* +*SAT Icon Data +*/ + +typedef struct{ + unsigned char iconId; + unsigned char imgType; + unsigned char imgLen; + unsigned char imgData[256]; +} TelSatIconDataResp_t; + +typedef struct{ + unsigned char iconId; + unsigned char imgType; + unsigned char fileId[2]; + unsigned char reqDataLen[2]; + unsigned char offset[2]; +}TelsatIconDataGet_t; + +/*================================================================================================== + FUNCTION PROTOTYPES +==================================================================================================*/ + +#ifdef __cplusplus +} +#endif + +#endif /* _TEL_SAT_PROACTV_CMD_H_ */ + +/** + * @} + */ + diff --git a/include/common/TelSim.h b/include/common/TelSim.h new file mode 100644 index 0000000..809e53b --- /dev/null +++ b/include/common/TelSim.h @@ -0,0 +1,2026 @@ +/* + * libslp-tapi + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Kyeongchul Kim + * + * 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. + */ + +/** +* @open +* @ingroup TelephonyAPI +* @addtogroup SIM_TAPI SIM +* @{ +* +* @file TelSim.h + + @brief This file serves as a "C" header file defines structures for Tapi SIM Services. \n + It contains a sample set of constants, enums, structs that would be required by applications. +*/ + +#ifndef _TELSIM_H_ +#define _TELSIM_H_ +/*================================================================================================== + INCLUDE FILES +==================================================================================================*/ +#include +#include + +#ifdef __cplusplus +extern "C" +{ +#endif + +/*================================================================================================== + CONSTANTS +==================================================================================================*/ + + +/*================================================================================================== + MACROS +==================================================================================================*/ +/** max length for PIN */ +#define TAPI_SIM_PIN_LENGTH 8 + +/** maximum MCC code length*/ +#define TAPI_SIM_MCC_CODE_LEN 3 + +/** maximum MNC Code length*/ +#define TAPI_SIM_MNC_CODE_LEN 2 + +/** Maximum MSIN code length */ +#define TAPI_SIM_MSIN_CODE_LEN 10 + +/** Maximum ICCID Length */ +#define TAPI_SIM_ICCID_LEN_MAX 20 + +/** Maximum Text length for number */ +#define TAPI_SIM_NUM_TEXT_LEN_MAX 256 + +/** Maximum ECC code length */ +#define TAPI_SIM_ECC_CODE_LEN 3 + +/** Maximum ECC Alpha string length */ +#define TAPI_SIM_ECC_ALPHA_STRING_LEN_MAX 50 + +/** Maximum Language indication length */ +#define TAPI_SIM_LP_LEN_MAX 30 + +/** Maximum group identifier length */ +#define TAPI_SIM_GROUP_IDENTIFIER_LEN_MAX 10 + +/** Maximum UECC Record count */ +#define TAPI_SIM_UECC_RECORD_COUNT_MAX 15 + +/** Defines the maximum number of 3G phone book records at a time */ +#define TAPI_SIM_3G_PB_MAX_RECORD_COUNT 10 + +/** SIM 3G Phone book EF Max count */ +#define TAPI_SIM_PB_3G_FILE_MAX_COUNT 13 + +/** Operator Name max length */ +#define TAPI_SIM_CPHS_OPERATOR_NAME_LEN_MAX 25 + +/** Operator Name short form max length */ +#define TAPI_SIM_CPHS_OPERATOR_NAME_SHORT_FORM_LEN_MAX 10 + +/** Alpha Id max length */ +#define TAPI_SIM_XDN_ALPHA_ID_MAX_LEN 30 + +/** Dialing number max length */ +#define TAPI_SIM_XDN_DIALING_NUMBER_LEN 20 + +/** CSP profile entry count max length */ +#define TAPI_SIM_CPHS_CUSTOMER_SERVICE_PROFILE_ENTRY_COUNT_MAX 11 + +/** ISIM authentication code max length */ +#define TAPI_SIM_ISIM_AUTH_MAX_REQ_DATA_LEN 256 + +/** ISIM authentication response data max length */ +#define TAPI_SIM_ISIM_AUTH_MAX_RESP_DATA_LEN 128 + +/** SAP Answer to Reset data max length */ +#define TAPI_SIM_SAP_ATR_DATA 256 + +/** SAP APDU max length */ +#define TAPI_SIM_APDU_MAX_LEN 256+2 // to be fine tuned according to lower layers, 2bytes for SW1 & SW2 should be added + +/** EF-SMSP digit length */ +#define TAPI_SIM_SMSP_ADDRESS_LEN 20 + +/** EF-SMSP alpha id length */ +#define TAPI_SIM_SMSP_ALPHA_ID_LEN_MAX 128 + +/**< Maximum OPLMNWACT length*/ +#define TAPI_SIM_OPLMNWACT_MAX_LEN 100 + +/**< Maximum rsim access data length for 1 time*/ +#define TAPI_SIM_DATA_LEN_MAX 256 + +/** Request Id for Notification */ +#define TAPI_SIM_REQUEST_ID_FOR_NOTI 0xFF + +/**< Event status for operation timeout */ +#define TAPI_SIM_OPERATION_TIMEOUT 1234 + +#define TAPI_SIM_LOCK_TYPE_INFO_MAX 8 + + +/*================================================================================================== + ENUMS +==================================================================================================*/ +/** + * @enum TelSimCardType_t + * This enumeration defines the card type. + */ +typedef enum +{ + TAPI_SIM_CARD_TYPE_UNKNOWN, /**< Unknown card */ + TAPI_SIM_CARD_TYPE_GSM, /**< SIm(GSM) card*/ + TAPI_SIM_CARD_TYPE_USIM, /**< USIM card */ + +} TelSimCardType_t; + +/** + * @enum TelSimFileName_t + * This enumeration defines the file id. + */ +typedef enum +{ + /* common Elementary files */ + TAPI_SIM_EFILE_DIR = 0x2F00, /**< Root Directory for the USIM */ + TAPI_SIM_EFILE_ICCID = 0x2FE2, /**< the ICC Identification file */ + TAPI_SIM_EFILE_ADN = 0x6F3A, /**< the Abbrv. Dialing Number file */ + TAPI_SIM_EFILE_FDN = 0x6F3B, /**< the Fixed Dialing Number file */ + TAPI_SIM_EFILE_SMS = 0x6F3C, /**< the Short Messages file */ + TAPI_SIM_EFILE_CCP = 0x6F3D, /**< the Capab. Config Parameters file */ + TAPI_SIM_EFILE_IMSI = 0x6F07, /**< the IMSI file */ + TAPI_SIM_EFILE_SST = 0x6F38, /**< the SIM Service Table file */ + TAPI_SIM_EFILE_EST = 0x6F56, /**< the Enabled Service Table file */ + TAPI_SIM_EFILE_ACM = 0x6F39, /**< the Accumul. Call Meter file */ + TAPI_SIM_EFILE_OPLMN_ACT = 0x6F61, /**< the OPLMN List file*/ + TAPI_SIM_EFILE_MBDN = 0x6FC7, /** < SIM Mail Box Dialing Number file */ + + TAPI_SIM_EFILE_GID1 = 0x6F3E, /**< the Group Identifier Level 1 */ + TAPI_SIM_EFILE_GID2 = 0x6F3F, /**< the Group Identifier Level 2 */ + + /* For PHASE 2 only */ + TAPI_SIM_EFILE_MSISDN = 0x6F40, /**< the MSISDN file */ + TAPI_SIM_EFILE_SMSP = 0x6F42, /**< the Short Msg Srv. Parameters file*/ + TAPI_SIM_EFILE_SMSS = 0x6F43, /**< the SMS Status */ + TAPI_SIM_EFILE_EXT1 = 0x6F4A, /**< the Extension 1 file */ + TAPI_SIM_EFILE_EXT2 = 0x6F4B, /**< the Extension 2 file */ + TAPI_SIM_EFILE_ELP = 0x2F05, /**< the Extended Language Preference file */ + TAPI_SIM_EFILE_LP = 0x6F05, /**< SIM: Language preference */ + TAPI_SIM_EFILE_ACM_MAX = 0x6F37, /**< the ACM maximum value file */ + TAPI_SIM_EFILE_PUCT = 0x6F41, /**< the Price per Unit and. file */ + TAPI_SIM_EFILE_CBMI = 0x6F45, /**< the Cell Brd msg Id sel file */ + TAPI_SIM_EFILE_PHASE = 0x6FAE, /**< the PHASE identification file*/ + + /* For Phase 2+ */ + TAPI_SIM_EFILE_SDN = 0x6F49, /**< the Service Dialing Numbers */ + TAPI_SIM_EFILE_EXT3 = 0x6F4C, /**< the Extension 3 file */ + TAPI_SIM_EFILE_BDN = 0x6F4D, /**< the BDN file */ + TAPI_SIM_EFILE_EXT4 = 0x6F4E, /**< the Extension 4 file */ + TAPI_SIM_EFILE_ECC = 0x6FB7, /**< the Emergency Call Codes */ + TAPI_SIM_EFILE_SPN = 0x6F46, /**< the Service Provider Name */ + TAPI_SIM_EFILE_SPDI = 0x6FCD, /**< the Service provider display information*/ + TAPI_SIM_EFILE_PNN = 0x6FC5 , /**< the PLMN Network Name File*/ + TAPI_SIM_EFILE_OPL = 0x6FC6 , /**< the Operator PLMN List File*/ + + /* Contents of files at the DF GRAPHICS level */ + TAPI_SIM_EFILE_IMG = 0x4F20, /**< image */ + + /* 4.2 Contents of files at the SIM ADF (Application DF) level */ + TAPI_SIM_EFILE_USIM_LI = 0x6A05, /**< USIM: Language Indication */ + TAPI_SIM_EFILE_USIM_PL = 0x2A05, /**< the Language Preference file of USIM */ + TAPI_SIM_EFILE_USIM_IMSI = 0x6A07, /**< IMSI */ + TAPI_SIM_EFILE_USIM_ACM_MAX = 0x6A37, /**< ACM maximum value */ + TAPI_SIM_EFILE_USIM_UST = 0x6A38, /**< USIM Service Table */ + TAPI_SIM_EFILE_USIM_ACM = 0x6A39, /**< Accumulated Call Meter */ + TAPI_SIM_EFILE_USIM_SPN = 0x6A46, /**< Service Provider Name */ + TAPI_SIM_EFILE_USIM_PUCT = 0x6A41, /**< Price per Unit and Currency Table */ + TAPI_SIM_EFILE_USIM_CBMI = 0x6A45, /**< Cell Broadcaster Message Identifier selection */ + TAPI_SIM_EFILE_USIM_ECC = 0x6AB7, /**< Emergency Call Codes */ + TAPI_SIM_EFILE_USIM_FDN = 0x6A3B, /**< Fixed Dialing Number */ + TAPI_SIM_EFILE_USIM_SMS = 0x6A3C, /**< SMS */ + TAPI_SIM_EFILE_USIM_MSISDN = 0x6A40, /**< My own number */ + TAPI_SIM_EFILE_USIM_SMSP = 0x6A42, /** < SMS parameter */ + TAPI_SIM_EFILE_USIM_SMSS = 0x6A43, /** < SMS status */ + TAPI_SIM_EFILE_USIM_SDN = 0x6A49, /** < Service dialing number */ + TAPI_SIM_EFILE_USIM_EXT1 = 0X6A4A, /** < EXT1 record file */ + TAPI_SIM_EFILE_USIM_EXT2 = 0x6A4B, /** < EXT2 record file */ + TAPI_SIM_EFILE_USIM_EXT3 = 0x6A4C, /** < EXT3 record file */ + TAPI_SIM_EFILE_USIM_EXT4 = 0x6A55, /** < EXT4 record file */ + TAPI_SIM_EFILE_USIM_EXT5 = 0x6A4E, /** < EXT5 record file */ + TAPI_SIM_EFILE_USIM_EXT6 = 0x6FC8, /** < EXT6 record file */ + TAPI_SIM_EFILE_USIM_EXT7 = 0x6FCC, /** < EXT7 record file */ + + TAPI_SIM_EFILE_USIM_CCP2 = 0x6A4F, /**< Capability Configuration Parameters 2 */ + TAPI_SIM_EFILE_USIM_HIDDEN_KEY = 0x6FC3, /**< Key for hidden phonebook entries */ + TAPI_SIM_EFILE_USIM_BDN = 0x6A4D, /**< Barred Dialing Numbers */ + + TAPI_SIM_EFILE_USIM_MBDN = 0x6FC7, /** < Mailbox dialing number -linear fixed*/ + TAPI_SIM_EFILE_USIM_MBI = 0x6FC9, /** < Mailbox Identifier -linear fixed*/ + + TAPI_SIM_EFILE_USIM_MWIS = 0x6FCA, /** < Message Waiting Indication Status -linear fixed*/ + TAPI_SIM_EFILE_USIM_CFIS = 0x6FCB, /** < Call forward indication status -linear fixed*/ + + TAPI_SIM_EFILE_USIM_APN_ACL = 0x6F57, /** < Access point name control list */ + + /* Contents of files at USIM ADF PHONEBOOK level */ + TAPI_SIM_EFILE_USIM_PHONEBOOK_PBR = 0x4FF0, /**< Phonebook Reference File */ + TAPI_SIM_EFILE_USIM_PHONEBOOK_CCP1 = 0x4FFE, /**< Capability Configuration Parameters 1 */ + TAPI_SIM_EFILE_USIM_PHONEBOOK_UID = 0x4FF8, /**< unique identifier */ + TAPI_SIM_EFILE_USIM_PHONEBOOK_PSC = 0x4FFF, /**< phonebook synchronization counter */ + TAPI_SIM_EFILE_USIM_PHONEBOOK_CC = 0x4FEF, /**< change counter */ + TAPI_SIM_EFILE_USIM_PHONEBOOK_PUID = 0x4FEE, /**< previous unique identifier */ + + TAPI_SIM_EFILE_USIM_PHONEBOOK_ADN = 0x4FF1, /**< Abbreviated Dialing Number */ + TAPI_SIM_EFILE_USIM_PHONEBOOK_IAP = 0x4FF2, /**< Index Administration Phonebook */ + TAPI_SIM_EFILE_USIM_PHONEBOOK_PBC = 0x4FF3, /**< Phonebook Control */ + TAPI_SIM_EFILE_USIM_PHONEBOOK_EXT1 = 0x4FFB, /**< Extension 1 */ + TAPI_SIM_EFILE_USIM_PHONEBOOK_GRP = 0x4FF7, /**< Grouping File */ + + TAPI_SIM_EFILE_USIM_PHONEBOOK_AAS = 0x4FFC, /**< Additional number Alpha String */ + TAPI_SIM_EFILE_USIM_PHONEBOOK_AAS1 = 0x4FFD, /**< Additional number Alpha String */ + + TAPI_SIM_EFILE_USIM_PHONEBOOK_GAS = 0x4F0E, /**< Additional Number */ + TAPI_SIM_EFILE_USIM_PHONEBOOK_GAS1 = 0x4F0F, /**< Second Name Entry */ + + TAPI_SIM_EFILE_USIM_PHONEBOOK_ANR = 0x4FF4, /**< Additional Number */ + TAPI_SIM_EFILE_USIM_PHONEBOOK_SNE = 0x4FF9, /**< Second Name Entry */ + TAPI_SIM_EFILE_USIM_PHONEBOOK_EMAIL = 0x4FFA, /**< e-mail address */ + + TAPI_SIM_EFILE_USIM_PHONEBOOK_ANRA = 0x4F13, /**< Additional Number */ + TAPI_SIM_EFILE_USIM_PHONEBOOK_ANRB = 0x4F14, /**< Additional Number */ + TAPI_SIM_EFILE_USIM_PHONEBOOK_ANRC = 0x4F15, /**< Additional Number */ + TAPI_SIM_EFILE_USIM_PHONEBOOK_ANR1 = 0x4F16, /**< Additional Number */ + TAPI_SIM_EFILE_USIM_PHONEBOOK_ANRA1 = 0x4F17, /**< Additional Number */ + TAPI_SIM_EFILE_USIM_PHONEBOOK_ANRB1 = 0x4F18, /**< Additional Number */ + TAPI_SIM_EFILE_USIM_PHONEBOOK_ANRC1 = 0x4F21, /**< Additional Number */ + + TAPI_SIM_EFILE_USIM_PHONEBOOK_ADN1 = 0x4F1A, /**< Abbreviated Dialing Number */ + TAPI_SIM_EFILE_USIM_PHONEBOOK_PBC1 = 0x4F1B, /**< Phonebook Control */ + TAPI_SIM_EFILE_USIM_PHONEBOOK_GRP1 = 0x4F1C, /**< Grouping File */ + TAPI_SIM_EFILE_USIM_PHONEBOOK_SNE1 = 0x4F1D, /**< Second Name Entry */ + TAPI_SIM_EFILE_USIM_PHONEBOOK_UID1 = 0x4F1E, /**< unique identifier */ + + TAPI_SIM_EFILE_USIM_PHONEBOOK_EMAIL1 = 0x4F1F, /**< e-mail address */ + TAPI_SIM_EFILE_USIM_PHONEBOOK_IAP1 = 0x4FF5, /**< Index Administration Phonebook */ + + /* Contents of files at TELECOM DF PHONEBOOK level */ + TAPI_SIM_EFILE_TELECOM_PHONEBOOK_PBR = 0x4F30, /**< Phonebook Reference File */ + TAPI_SIM_EFILE_TELECOM_PHONEBOOK_PBR1 = 0x4F29, /**< Phonebook Reference File 1 */ + TAPI_SIM_EFILE_TELECOM_PHONEBOOK_PBR2 = 0x4F28, /**< Phonebook Reference File 1 */ + TAPI_SIM_EFILE_TELECOM_PHONEBOOK_CCP1 = 0x4F3D, /**< Capability Configuration Parameters 1 */ + TAPI_SIM_EFILE_TELECOM_PHONEBOOK_UID = 0x4F00, /**< unique identifier */ + TAPI_SIM_EFILE_TELECOM_PHONEBOOK_PSC = 0x4F22, /**< Phonebook synchronization counter */ + TAPI_SIM_EFILE_TELECOM_PHONEBOOK_CC = 0x4F23, /**< change counter */ + TAPI_SIM_EFILE_TELECOM_PHONEBOOK_PUID = 0x4F24, /**< previous unique identifier */ + + TAPI_SIM_EFILE_TELECOM_PHONEBOOK_ADN = 0x4F3A, /**< Abbreviated Dialing Number */ + TAPI_SIM_EFILE_TELECOM_PHONEBOOK_IAP = 0x4F25, /**< Index Administration Phonebook */ + TAPI_SIM_EFILE_TELECOM_PHONEBOOK_PBC = 0x4F09, /**< Phonebook Control */ + TAPI_SIM_EFILE_TELECOM_PHONEBOOK_EXT1 = 0x4F4A, /**< Extension 1 */ + TAPI_SIM_EFILE_TELECOM_PHONEBOOK_GRP = 0x4F26, /**< Grouping File */ + + TAPI_SIM_EFILE_TELECOM_PHONEBOOK_AAS = 0x4F4B, /**< Additional number Alpha String */ + TAPI_SIM_EFILE_TELECOM_PHONEBOOK_GAS = 0x4F4C, /**< Additional Number */ + + TAPI_SIM_EFILE_TELECOM_PHONEBOOK_ANR = 0x4F11, /**< Additional Number */ + TAPI_SIM_EFILE_TELECOM_PHONEBOOK_SNE = 0x4F19, /**< Second Name Entry */ + TAPI_SIM_EFILE_TELECOM_PHONEBOOK_EMAIL = 0x4F50, /**< e-mail address */ + + TAPI_SIM_EFILE_TELECOM_PHONEBOOK_ANRA = 0x4F31, /**< Additional Number */ + TAPI_SIM_EFILE_TELECOM_PHONEBOOK_ANRB = 0x4F32, /**< Additional Number */ + TAPI_SIM_EFILE_TELECOM_PHONEBOOK_ANRC = 0x4F40, /**< Additional Number */ + TAPI_SIM_EFILE_TELECOM_PHONEBOOK_ANR1 = 0x4F33, /**< Additional Number */ + TAPI_SIM_EFILE_TELECOM_PHONEBOOK_ANRA1 = 0x4F34, /**< Additional Number */ + TAPI_SIM_EFILE_TELECOM_PHONEBOOK_ANRB1 = 0x4F35, /**< Additional Number */ + + TAPI_SIM_EFILE_TELECOM_PHONEBOOK_ADN1 = 0x4F36, /**< Abbreviated Dialing Number */ + TAPI_SIM_EFILE_TELECOM_PHONEBOOK_PBC1 = 0x4F37, /**< Phonebook Control */ + TAPI_SIM_EFILE_TELECOM_PHONEBOOK_GRP1 = 0x4F38, /**< Grouping File */ + TAPI_SIM_EFILE_TELECOM_PHONEBOOK_SNE1 = 0x4F39, /**< Second Name Entry */ + TAPI_SIM_EFILE_TELECOM_PHONEBOOK_UID1 = 0x4F3B, /**< unique identifier */ + + TAPI_SIM_EFILE_TELECOM_PHONEBOOK_EMAIL1 = 0x4F3C, /**< e-mail address */ + TAPI_SIM_EFILE_TELECOM_PHONEBOOK_IAP1 = 0x4F3E, /**< Index Administration Phonebook */ + + TAPI_SIM_EFILE_MSG_WAITING_INDICATION_STATUS =0x6FCA, /** < MSG waiting indication *///WILL BE REMOVED + + /* CPHS FILE ID */ + TAPI_SIM_EFILE_CPHS_VOICE_MSG_WAITING = 0x6F11, /** < CPHS voice MSG waiting indication */ + TAPI_SIM_EFILE_CPHS_SERVICE_STRING_TABLE = 0x6F12, /** < CPHS service string table */ + TAPI_SIM_EFILE_CPHS_CALL_FORWARD_FLAGS = 0x6F13, /** < CPHS call forward flags */ + TAPI_SIM_EFILE_CPHS_OPERATOR_NAME_STRING = 0x6F14, /** < CPHS operator name string */ + TAPI_SIM_EFILE_CPHS_CUSTOMER_SERVICE_PROFILE = 0x6F15, /** < CPHS customer service profile */ + TAPI_SIM_EFILE_CPHS_CPHS_INFO = 0x6F16, /** < CPHS information */ + TAPI_SIM_EFILE_CPHS_MAILBOX_NUMBERS = 0x6F17, /** < CPHS mail box numbers */ + TAPI_SIM_EFILE_CPHS_OPERATOR_NAME_SHORT_FORM_STRING = 0x6F18, /** < CPHS operator name short form string */ + TAPI_SIM_EFILE_CPHS_INFORMATION_NUMBERS = 0x6F19, /** < CPHS information numbers */ + + /* CPHS ALS FILE ID */ + TAPI_SIM_CPHS_DYNAMICFLAGS = 0x6F9F, /** < CPHS Dynamics flags */ + TAPI_SIM_CPHS_DYNAMIC2FLAG = 0x6F92, /** < CPHS Dynamics2 flags */ + TAPI_SIM_CPHS_CUSTOMER_SERVICE_PROFILE_LINE2 = 0x6F98, /** < CPHS CSP2 */ + + /* ISIM files */ + TAPI_SIM_EFILE_ISIM_IMPI = 0x6F02, /** < IMS private user identity */ + TAPI_SIM_EFILE_ISIM_DOMAIN = 0x6F03, /** < IMS Home Network Domain Name */ + TAPI_SIM_EFILE_ISIM_IMPU = 0x6F04, /** < IMS public user identity */ + TAPI_SIM_EFILE_ISIM_AD = 0x6FAD, /** < Administrative data */ /* NOT implemented */ + TAPI_SIM_EFILE_ISIM_ARR = 0x6F06, /** < Access control file */ /* NOT implemented */ + + /* ID clashes with IMSI file Id so changed to 6FFF - actual Id is 0x6F07 */ /* modem no support ?*/ + TAPI_SIM_EFILE_ISIM_IST = 0x6FFF, /**