)
INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${fw_name}.pc DESTINATION lib/pkgconfig)
-ADD_SUBDIRECTORY(test)
-
IF(UNIX)
ADD_CUSTOM_TARGET (distclean @echo cleaning for source distribution)
+++ /dev/null
-#!/bin/sh
-
-. ./config
-export TET_INSTALL_PATH=$TET_INSTALL_HOST_PATH # tetware root path
-export TET_TARGET_PATH=$TET_INSTALL_PATH/tetware-target # tetware target path
-#export TET_TARGET_PATH=$TET_INSTALL_PATH/tetware-simulator # tetware simulator path
-export PATH=$TET_TARGET_PATH/bin:$PATH
-export LD_LIBRARY_PATH=$TET_TARGET_PATH/lib/tet3:$LD_LIBRARY_PATH
-export TET_ROOT=$TET_TARGET_PATH
+++ /dev/null
-#!/bin/sh
-. ./config
-export TET_INSTALL_PATH=$TET_INSTALL_TARGET_PATH # path to path
-export TET_TARGET_PATH=$TET_INSTALL_PATH/tetware-target
-#export TET_TARGET_PATH=$TET_INSTALL_PATH/tetware-simulator # tetware simulator path
-export PATH=$TET_TARGET_PATH/bin:$PATH
-export LD_LIBRARY_PATH=$TET_TARGET_PATH/lib/tet3:$LD_LIBRARY_PATH
-export TET_ROOT=$TET_TARGET_PATH
+++ /dev/null
-#!/bin/sh
-
-. ./_export_env.sh # setting environment variables
-
-export TET_SUITE_ROOT=`pwd`
-FILE_NAME_EXTENSION=`date +%s`
-
-RESULT_DIR=results
-HTML_RESULT=$RESULT_DIR/build-tar-result-$FILE_NAME_EXTENSION.html
-JOURNAL_RESULT=$RESULT_DIR/build-tar-result-$FILE_NAME_EXTENSION.journal
-
-mkdir -p $RESULT_DIR
-
-tcc -c -p ./
-tcc -b -j $JOURNAL_RESULT -p ./
-grw -c 7 -f chtml -o $HTML_RESULT $JOURNAL_RESULT
+++ /dev/null
-#!/bin/sh
-
-. ./_export_env.sh # setting environment variables
-
-export TET_SUITE_ROOT=`pwd`
-RESULT_DIR=results
-
-tcc -c -p ./ # executing tcc, with clean option (-c)
-rm -r $RESULT_DIR
-rm -r tet_tmp_dir
-rm testcase/tet_captured
+++ /dev/null
-TET_INSTALL_HOST_PATH=/home/bwlee/tools/TETware
-TET_INSTALL_TARGET_PATH=/home/bwlee/tools/TETware
+++ /dev/null
-#!/bin/sh
-
-. ./_export_target_env.sh # setting environment variables
-
-export TET_SUITE_ROOT=`pwd`
-FILE_NAME_EXTENSION=`date +%s`
-
-RESULT_DIR=results
-HTML_RESULT=$RESULT_DIR/exec-tar-result-$FILE_NAME_EXTENSION.html
-JOURNAL_RESULT=$RESULT_DIR/exec-tar-result-$FILE_NAME_EXTENSION.journal
-
-mkdir -p $RESULT_DIR
-
-tcc -e -j $JOURNAL_RESULT -p ./
-grw -c 7 -f chtml -o $HTML_RESULT $JOURNAL_RESULT
+++ /dev/null
-CC ?= gcc
-
-C_FILES = $(shell ls *.c)
-
-PKGS = capi-telephony-sim
-
-LDFLAGS = `pkg-config --libs $(PKGS)`
-LDFLAGS += $(TET_ROOT)/lib/tet3/tcm_s.o
-LDFLAGS += -L$(TET_ROOT)/lib/tet3 -ltcm_s
-LDFLAGS += -L$(TET_ROOT)/lib/tet3 -lapi_s
-
-CFLAGS = -I. `pkg-config --cflags $(PKGS)`
-CFLAGS += -I$(TET_ROOT)/inc/tet3
-CFLAGS += -Wall
-
-TCS := $(shell ls -1 *.c | cut -d. -f1)
-
-all: $(TCS)
-
-%: %.c
- $(CC) -o $@ $< $(CFLAGS) $(LDFLAGS)
-
-clean:
- rm -f $(TCS)
+++ /dev/null
-/testcase/utc_telephony_sim
-
+++ /dev/null
-/*
- * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
- *
- * Licensed under the Apache License, Version 2.0 (the License);
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an AS IS BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-
-#include <tet_api.h>
-#include <sim.h>
-#include <stdlib.h>
-
-enum {
- POSITIVE_TC_IDX = 0x01,
- NEGATIVE_TC_IDX,
-};
-
-static void startup(void);
-static void cleanup(void);
-
-void (*tet_startup)(void) = startup;
-void (*tet_cleanup)(void) = cleanup;
-
-static void utc_telephony_sim_get_icc_id_n(void);
-static void utc_telephony_sim_get_icc_id_p(void);
-static void utc_telephony_sim_get_mcc_n(void);
-static void utc_telephony_sim_get_mcc_p(void);
-static void utc_telephony_sim_get_mnc_n(void);
-static void utc_telephony_sim_get_mnc_p(void);
-static void utc_telephony_sim_get_msin_n(void);
-static void utc_telephony_sim_get_msin_p(void);
-static void utc_telephony_sim_get_spn_n(void);
-static void utc_telephony_sim_get_spn_p(void);
-static void utc_telephony_sim_get_cphs_operator_name_n(void);
-static void utc_telephony_sim_get_cphs_operator_name_p(void);
-static void utc_telephony_sim_get_state_n(void);
-static void utc_telephony_sim_get_state_p(void);
-static void utc_telephony_sim_get_subscriber_number_n(void);
-static void utc_telephony_sim_get_subscriber_number_p(void);
-static void utc_telephony_sim_set_state_changed_cb_p(void);
-static void utc_telephony_sim_set_state_changed_cb_n(void);
-static void utc_telephony_sim_unset_state_changed_cb_p(void);
-
-
-
-struct tet_testlist tet_testlist[] = {
- { utc_telephony_sim_get_icc_id_n, NEGATIVE_TC_IDX },
- { utc_telephony_sim_get_icc_id_p, POSITIVE_TC_IDX },
- { utc_telephony_sim_get_mcc_n, NEGATIVE_TC_IDX },
- { utc_telephony_sim_get_mcc_p, POSITIVE_TC_IDX },
- { utc_telephony_sim_get_mnc_n, NEGATIVE_TC_IDX },
- { utc_telephony_sim_get_mnc_p, POSITIVE_TC_IDX },
- { utc_telephony_sim_get_msin_n, NEGATIVE_TC_IDX },
- { utc_telephony_sim_get_msin_p, POSITIVE_TC_IDX },
- { utc_telephony_sim_get_spn_n, NEGATIVE_TC_IDX },
- { utc_telephony_sim_get_spn_p, POSITIVE_TC_IDX },
- { utc_telephony_sim_get_cphs_operator_name_n, NEGATIVE_TC_IDX },
- { utc_telephony_sim_get_cphs_operator_name_p, POSITIVE_TC_IDX },
- { utc_telephony_sim_get_state_n, NEGATIVE_TC_IDX },
- { utc_telephony_sim_get_state_p, POSITIVE_TC_IDX },
- { utc_telephony_sim_get_subscriber_number_n, NEGATIVE_TC_IDX },
- { utc_telephony_sim_get_subscriber_number_p, POSITIVE_TC_IDX },
- { utc_telephony_sim_set_state_changed_cb_p, POSITIVE_TC_IDX },
- { utc_telephony_sim_set_state_changed_cb_n, NEGATIVE_TC_IDX },
- { utc_telephony_sim_unset_state_changed_cb_p, POSITIVE_TC_IDX },
- { NULL, 0 },
-};
-
-
-static void startup(void)
-{
- /* start of TC */
- tet_printf("\n TC start");
-}
-
-
-static void cleanup(void)
-{
- /* end of TC */
- tet_printf("\n TC end");
-}
-
-/**
- * @brief Callback function
- */
-void sim_state_changed(sim_state_e state, void* user_data)
-{
-
-}
-
-/**
- * @brief Negative test case of sim_get_icc_id()
- */
-static void utc_telephony_sim_get_icc_id_n(void)
-{
- int ret = SIM_ERROR_NONE;
-
- // Invalid parameter test
- ret = sim_get_icc_id(NULL);
- dts_check_eq("sim_get_icc_id", ret, SIM_ERROR_INVALID_PARAMETER, "Must return SIM_ERROR_INVALID_PARAMETER in case of invalid parameter");
-}
-
-
-/**
- * @brief Positive test case of sim_get_icc_id()
- */
-static void utc_telephony_sim_get_icc_id_p(void)
-{
- char* icc_id = NULL;
- int ret = SIM_ERROR_NONE;
-
- // Normal operation test
- ret = sim_get_icc_id(&icc_id);
- if( icc_id != NULL )
- free(icc_id);
- dts_check_eq("sim_get_icc_id", ret, SIM_ERROR_NONE, "Failed to get ICC ID");
-}
-
-
-/**
- * @brief Negative test case of sim_get_mcc()
- */
-static void utc_telephony_sim_get_mcc_n(void)
-{
- int ret = SIM_ERROR_NONE;
-
- // Invalid parameter test
- ret = sim_get_mcc(NULL);
- dts_check_eq("sim_get_mcc", ret, SIM_ERROR_INVALID_PARAMETER, "Must return SIM_ERROR_INVALID_PARAMETER in case of invalid parameter");
-}
-
-
-/**
- * @brief Positive test case of sim_get_mcc()
- */
-static void utc_telephony_sim_get_mcc_p(void)
-{
- char* mcc = NULL;
- int ret = SIM_ERROR_NONE;
-
- // Normal operation test
- ret = sim_get_mcc(&mcc);
- if( ret == SIM_ERROR_NONE )
- free(mcc);
- dts_check_eq("sim_get_mcc", ret, SIM_ERROR_NONE, "Failed to get MCC");
-}
-
-
-/**
- * @brief Negative test case of sim_get_mnc()
- */
-static void utc_telephony_sim_get_mnc_n(void)
-{
- int ret = SIM_ERROR_NONE;
-
- // Invalid parameter test
- ret = sim_get_mnc(NULL);
- dts_check_eq("sim_get_mnc", ret, SIM_ERROR_INVALID_PARAMETER, "Must return SIM_ERROR_INVALID_PARAMETER in case of invalid parameter");
-}
-
-
-/**
- * @brief Positive test case of sim_get_mnc()
- */
-static void utc_telephony_sim_get_mnc_p(void)
-{
- char* mnc = NULL;
- int ret = SIM_ERROR_NONE;
-
- // Normal operation test
- ret = sim_get_mnc(&mnc);
- if( ret == SIM_ERROR_NONE )
- free(mnc);
- dts_check_eq("sim_get_mnc", ret, SIM_ERROR_NONE, "Failed to get MNC");
-}
-
-
-/**
- * @brief Negative test case of sim_get_msin()
- */
-static void utc_telephony_sim_get_msin_n(void)
-{
- int ret = SIM_ERROR_NONE;
-
- // Invalid parameter test
- ret = sim_get_msin(NULL);
- dts_check_eq("sim_get_msin", ret, SIM_ERROR_INVALID_PARAMETER, "Must return SIM_ERROR_INVALID_PARAMETER in case of invalid parameter");
-}
-
-
-/**
- * @brief Positive test case of sim_get_msin()
- */
-static void utc_telephony_sim_get_msin_p(void)
-{
- char* msin = NULL;
- int ret = SIM_ERROR_NONE;
-
- // Normal operation test
- ret = sim_get_msin(&msin);
- if( ret == SIM_ERROR_NONE )
- free(msin);
- dts_check_eq("sim_get_msin", ret, SIM_ERROR_NONE, "Failed to get MSIN");
-}
-
-
-/**
- * @brief Negative test case of sim_get_spn()
- */
-static void utc_telephony_sim_get_spn_n(void)
-{
- int ret = SIM_ERROR_NONE;
-
- // Invalid parameter test
- ret = sim_get_spn(NULL);
- dts_check_eq("sim_get_spn", ret, SIM_ERROR_INVALID_PARAMETER, "Must return SIM_ERROR_INVALID_PARAMETER in case of invalid parameter");
-}
-
-
-/**
- * @brief Positive test case of sim_get_spn()
- */
-static void utc_telephony_sim_get_spn_p(void)
-{
- char* spn = NULL;
- int ret = SIM_ERROR_NONE;
-
- // Normal operation test
- ret = sim_get_spn(&spn);
- if( ret == SIM_ERROR_NONE )
- free(spn);
- dts_check_eq("sim_get_spn", ret, SIM_ERROR_NONE, "Failed to get SPN");
-}
-
-
-/**
- * @brief Negative test case of sim_get_cphs_operator_name()
- */
-static void utc_telephony_sim_get_cphs_operator_name_n(void)
-{
- int ret = SIM_ERROR_NONE;
-
- // Invalid parameter test
- ret = sim_get_cphs_operator_name(NULL, NULL);
- dts_check_eq("sim_get_cphs_operator_name", ret, SIM_ERROR_INVALID_PARAMETER, "Must return SIM_ERROR_INVALID_PARAMETER in case of invalid parameter");
-}
-
-
-/**
- * @brief Positive test case of sim_get_cphs_operator_name()
- */
-static void utc_telephony_sim_get_cphs_operator_name_p(void)
-{
- char* full_name = NULL;
- char* short_name = NULL;
- int ret = SIM_ERROR_NONE;
-
- // Normal operation test
- ret = sim_get_cphs_operator_name(&full_name, &short_name);
- if( ret == SIM_ERROR_NONE ) {
- free(full_name);
- free(short_name);
- }
- dts_check_eq("sim_get_cphs_operator_name", ret, SIM_ERROR_NONE, "Failed to get CPHS full/short operator name");
-}
-
-
-/**
- * @brief Negative test case of sim_get_state()
- */
-static void utc_telephony_sim_get_state_n(void)
-{
- int ret = SIM_ERROR_NONE;
-
- // Invalid parameter test
- ret = sim_get_state(NULL);
- dts_check_eq("sim_get_state", ret, SIM_ERROR_INVALID_PARAMETER, "Must return SIM_ERROR_INVALID_PARAMETER in case of invalid parameter");
-}
-
-
-/**
- * @brief Positive test case of sim_get_state()
- */
-static void utc_telephony_sim_get_state_p(void)
-{
- sim_state_e sim_status;
- int ret = SIM_ERROR_NONE;
-
- // Normal operation test
- ret = sim_get_state(&sim_status);
- dts_check_eq("sim_get_state", ret, SIM_ERROR_NONE, "Failed to get the current status of SIM");
-}
-
-
-/**
- * @brief Negative test case of sim_get_subscriber_number()
- */
-static void utc_telephony_sim_get_subscriber_number_n(void)
-{
- int ret = SIM_ERROR_NONE;
-
- // Invalid parameter test
- ret = sim_get_subscriber_number(NULL);
- dts_check_eq("sim_get_subscriber_number", ret, SIM_ERROR_INVALID_PARAMETER, "Must return SIM_ERROR_INVALID_PARAMETER in case of invalid parameter");
-}
-
-
-/**
- * @brief Positive test case of sim_get_subscriber_number()
- */
-static void utc_telephony_sim_get_subscriber_number_p(void)
-{
- char* subscriber_number = NULL;
- int ret = SIM_ERROR_NONE;
-
- // Normal operation test
- ret = sim_get_subscriber_number(&subscriber_number);
- if( ret == SIM_ERROR_NONE )
- {
- free(subscriber_number);
- dts_pass("sim_get_subscriber_number", "Succeeded to get subscriber number.");
- }
- else
- {
- dts_fail("sim_get_subscriber_number", "Failed to get subscriber number.");
- }
-}
-
-
-static void utc_telephony_sim_set_state_changed_cb_p(void)
-{
- sim_error_e ret = sim_set_state_changed_cb(sim_state_changed, NULL);
- dts_check_eq("sim_set_state_changed_cb", ret, SIM_ERROR_NONE,
- "sim_set_state_changed_cb failed.");
-}
-
-static void utc_telephony_sim_set_state_changed_cb_n(void)
-{
- sim_error_e ret = sim_set_state_changed_cb(NULL, NULL);
- dts_check_eq("sim_set_state_changed_cb", ret, SIM_ERROR_INVALID_PARAMETER,
- "SIM_ERROR_INVALID_PARAMETER must be returned when parameter is NULL.");
-}
-
-static void utc_telephony_sim_unset_state_changed_cb_p(void)
-{
- sim_error_e ret = sim_unset_state_changed_cb();
- dts_check_eq("sim_unset_state_changed_cb", ret, SIM_ERROR_NONE,
- "sim_unset_state_changed_cb failed.");
-}
-
-
+++ /dev/null
-all
- ^TEST
-##### Scenarios for TEST #####
-
-# Test scenario
-TEST
- :include:/testcase/tslist
+++ /dev/null
-TET_OUTPUT_CAPTURE=True # capture option for build operation checking
-TET_BUILD_TOOL=make # build with using make command
-TET_BUILD_FILE=-f Makefile # execution file (Makefile) for build
-TET_API_COMPLIANT=True # use TET API in Test Case ?
-TET_PASS_TC_NAME=True # report passed TC name in Journal file?
+++ /dev/null
-TET_OUTPUT_CAPTURE=True # capture option
-TET_CLEAN_TOOL= make clean # clean tool
-TET_CLEAN_FILE= Makefile # file for clean
-TET_API_COMPLIANT=True # TET API useage
-TET_PASS_TC_NAME=True # showing name , passed TC
+++ /dev/null
-TET_OUTPUT_CAPTURE=True # capturing execution or not
-TET_EXEC_TOOL= # ex) exec : execution tool set up/ Optional
-TET_EXEC_FILE= # ex) exectool : execution file/ Optional
-TET_API_COMPLIANT=True # Test case or Tool usesTET API?
-TET_PASS_TC_NAME=True # showing Passed TC name ?
+++ /dev/null
-SET(fw_test "${fw_name}-test")
-
-INCLUDE(FindPkgConfig)
-pkg_check_modules(${fw_test} REQUIRED glib-2.0)
-FOREACH(flag ${${fw_test}_CFLAGS})
- SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
-ENDFOREACH(flag)
-
-SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS} -Wall")
-
-#ADD_EXECUTABLE("system-sensor" system-sensor.c)
-#TARGET_LINK_LIBRARIES("system-sensor" ${fw_name} ${${fw_test}_LDFLAGS})
-
-aux_source_directory(. sources)
-FOREACH(src ${sources})
- GET_FILENAME_COMPONENT(src_name ${src} NAME_WE)
- MESSAGE("${src_name}")
- ADD_EXECUTABLE(${src_name} ${src})
- TARGET_LINK_LIBRARIES(${src_name} ${fw_name} ${${fw_test}_LDFLAGS})
-ENDFOREACH()
+++ /dev/null
-/*
- * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
- *
- * Licensed under the Apache License, Version 2.0 (the License);
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an AS IS BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-
-#include <stdio.h>
-#include <sim.h>
-#include <stdlib.h>
-#include <dlog.h>
-
-#ifdef LOG_TAG
-#undef LOG_TAG
-#endif
-#define LOG_TAG "TIZEN_N_SIM_TEST"
-
-int main()
-{
- int ret = 0;
- char* full_name = NULL;
- char* short_name = NULL;
- int ret_value = sim_get_cphs_operator_name(&full_name, &short_name);
-
- switch(ret_value)
- {
- case SIM_ERROR_NONE:
- ret = 0;
- if( full_name != NULL )
- {
- LOGI("CPHS full ONS is %s", full_name);
- free(full_name);
- }
- else
- {
- LOGI("CPHS full ONS is NULL");
- }
-
- if( short_name != NULL )
- {
- LOGI("CPHS short ONS is %s", short_name);
- free(short_name);
- }
- else
- {
- LOGI("CPHS short ONS is NULL");
- }
- break;
- case SIM_ERROR_INVALID_PARAMETER:
- LOGE("Invalid parameter");
- ret = -1;
- break;
- case SIM_ERROR_OPERATION_FAILED:
- LOGE("Cannot find SPN value");
- ret = -1;
- break;
- case SIM_ERROR_NOT_AVAILABLE:
- LOGE("SIM is not available");
- ret = -1;
- break;
- default:
- LOGE("Unexpected return value");
- ret = -1;
- break;
- }
-
-
- return ret;
-}
+++ /dev/null
-/*
- * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
- *
- * Licensed under the Apache License, Version 2.0 (the License);
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an AS IS BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-
-#include <stdio.h>
-#include <sim.h>
-#include <stdlib.h>
-#include <dlog.h>
-
-#ifdef LOG_TAG
-#undef LOG_TAG
-#endif
-#define LOG_TAG "TIZEN_N_SIM_TEST"
-
-
-int main()
-{
- int ret = 0;
- char* icc_id = NULL;
- int ret_value = sim_get_icc_id(&icc_id);
-
- switch(ret_value)
- {
- case SIM_ERROR_NONE:
- LOGI("ICC-ID is %s", icc_id);
- ret = 0;
- if(icc_id != NULL)
- free(icc_id);
- break;
- case SIM_ERROR_OUT_OF_MEMORY:
- LOGI("Out of memory\n");
- ret = -1;
- break;
- case SIM_ERROR_INVALID_PARAMETER:
- LOGI("Invalid parameter\n");
- ret = -1;
- break;
- case SIM_ERROR_OPERATION_FAILED:
- LOGI("Can not get ICC-ID value\n");
- ret = -1;
- break;
- case SIM_ERROR_NOT_AVAILABLE:
- LOGI("SIM is not available\n");
- ret = -1;
- break;
- default:
- LOGI("Unexpected return value\n");
- ret = -1;
- break;
- }
-
- return ret;
-}
+++ /dev/null
-/*
- * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
- *
- * Licensed under the Apache License, Version 2.0 (the License);
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an AS IS BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <sim.h>
-#include <dlog.h>
-
-#ifdef LOG_TAG
-#undef LOG_TAG
-#endif
-#define LOG_TAG "TIZEN_N_SIM_TEST"
-
-int main()
-{
- int ret = 0;
- char* mcc = NULL;
- int ret_value = sim_get_mcc(&mcc);
-
- switch(ret_value)
- {
- case SIM_ERROR_NONE:
- LOGI("MCC is %s", mcc);
- ret = 0;
- free(mcc);
- break;
- case SIM_ERROR_OUT_OF_MEMORY:
- LOGE("Out of memory");
- ret = -1;
- break;
- case SIM_ERROR_INVALID_PARAMETER:
- LOGE("Invalid parameter");
- ret = -1;
- break;
- case SIM_ERROR_OPERATION_FAILED:
- LOGE("Can not get MCC value");
- ret = -1;
- break;
- case SIM_ERROR_NOT_AVAILABLE:
- LOGE("SIM is not available");
- ret = -1;
- break;
- default:
- LOGE("Unexpected return value");
- ret = -1;
- break;
- }
-
- return ret;
-}
+++ /dev/null
-/*
- * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
- *
- * Licensed under the Apache License, Version 2.0 (the License);
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an AS IS BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-
-#include <stdio.h>
-#include <sim.h>
-#include <stdlib.h>
-#include <dlog.h>
-
-#ifdef LOG_TAG
-#undef LOG_TAG
-#endif
-#define LOG_TAG "TIZEN_N_SIM_TEST"
-
-int main()
-{
- int ret = 0;
- char* mnc = NULL;
- int ret_value = sim_get_mnc(&mnc);
-
- switch(ret_value)
- {
- case SIM_ERROR_NONE:
- LOGI("MNC is %s", mnc);
- ret = 0;
- free(mnc);
- break;
- case SIM_ERROR_OUT_OF_MEMORY:
- LOGE("Out of memory");
- ret = -1;
- break;
- case SIM_ERROR_INVALID_PARAMETER:
- LOGE("Invalid parameter");
- ret = -1;
- break;
- case SIM_ERROR_OPERATION_FAILED:
- LOGE("Can not get MNC value");
- ret = -1;
- break;
- case SIM_ERROR_NOT_AVAILABLE:
- LOGE("SIM is not available");
- ret = -1;
- break;
- default:
- LOGE("Unexpected return value");
- ret = -1;
- break;
- }
-
- return ret;
-}
+++ /dev/null
-/*
- * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
- *
- * Licensed under the Apache License, Version 2.0 (the License);
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an AS IS BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-
-#include <stdio.h>
-#include <sim.h>
-#include <stdlib.h>
-#include <dlog.h>
-
-#ifdef LOG_TAG
-#undef LOG_TAG
-#endif
-#define LOG_TAG "TIZEN_N_SIM_TEST"
-
-int main()
-{
- int ret = 0;
- char* msin = NULL;
- int ret_value = sim_get_msin(&msin);
-
- switch(ret_value)
- {
- case SIM_ERROR_NONE:
- LOGI("MSIN is %s", msin);
- ret = 0;
- free(msin);
- break;
- case SIM_ERROR_OUT_OF_MEMORY:
- LOGE("Out of memory");
- ret = -1;
- break;
- case SIM_ERROR_INVALID_PARAMETER:
- LOGE("Invalid parameter");
- ret = -1;
- break;
- case SIM_ERROR_OPERATION_FAILED:
- LOGE("Can not get MNC value");
- ret = -1;
- break;
- case SIM_ERROR_NOT_AVAILABLE:
- LOGE("SIM is not available");
- ret = -1;
- break;
- default:
- LOGE("Unexpected return value");
- ret = -1;
- break;
- }
-
- return ret;
-}
+++ /dev/null
-/*
- * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
- *
- * Licensed under the Apache License, Version 2.0 (the License);
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an AS IS BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-
-#include <stdio.h>
-#include <sim.h>
-#include <stdlib.h>
-#include <dlog.h>
-
-#ifdef LOG_TAG
-#undef LOG_TAG
-#endif
-#define LOG_TAG "TIZEN_N_SIM_TEST"
-
-int main()
-{
- int ret = 0;
- char* spn = NULL;
- int ret_value = sim_get_spn(&spn);
-
- switch(ret_value)
- {
- case SIM_ERROR_NONE:
- ret = 0;
- if( spn != NULL )
- {
- LOGI("SPN is %s", spn);
- free(spn);
- }
- else
- {
- LOGI("SPN is NULL");
- }
- break;
- case SIM_ERROR_INVALID_PARAMETER:
- LOGE("Invalid parameter");
- ret = -1;
- break;
- case SIM_ERROR_OPERATION_FAILED:
- LOGE("Cannot find SPN value");
- ret = -1;
- break;
- case SIM_ERROR_NOT_AVAILABLE:
- LOGE("SIM is not available");
- ret = -1;
- break;
- default:
- LOGE("Unexpected return value");
- ret = -1;
- break;
- }
-
-
- return ret;
-}
+++ /dev/null
-/*
- * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
- *
- * Licensed under the Apache License, Version 2.0 (the License);
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an AS IS BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-
-#include <stdio.h>
-#include <string.h>
-#include <sim.h>
-#include <dlog.h>
-
-#ifdef LOG_TAG
-#undef LOG_TAG
-#endif
-#define LOG_TAG "TIZEN_N_SIM_TEST"
-
-
-void convert_state_into_string(sim_state_e sim_state, char* sim_state_string)
-{
- switch(sim_state)
- {
- case SIM_STATE_AVAILABLE:
- snprintf(sim_state_string, 256, "available");
- break;
- case SIM_STATE_LOCKED:
- snprintf(sim_state_string, 256, "locked");
- break;
- case SIM_STATE_UNKNOWN:
- snprintf(sim_state_string, 256, "unknown");
- break;
- default:
- snprintf(sim_state_string, 256, "unavailable");
- break;
- }
-
-}
-
-int main()
-{
- int ret = 0;
- sim_state_e sim_state = SIM_STATE_UNAVAILABLE;
- char sim_state_string[256] = "";
- int ret_value = sim_get_state(&sim_state);
-
-
- switch(ret_value)
- {
- case SIM_ERROR_NONE:
- convert_state_into_string(sim_state, sim_state_string);
- LOGI("SIM is %s", sim_state_string);
- ret = 0;
- break;
- case SIM_ERROR_OPERATION_FAILED:
- LOGE("Can not get sim state");
- ret = -1;
- break;
- case SIM_ERROR_INVALID_PARAMETER:
- LOGE("Invalid parameter");
- ret = -1;
- break;
- default:
- LOGE("Unexpected return value");
- ret = -1;
- break;
- }
-
- return ret;
-}
+++ /dev/null
-/*
- * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
- *
- * Licensed under the Apache License, Version 2.0 (the License);
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an AS IS BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-
-#include <stdio.h>
-#include <sim.h>
-#include <stdlib.h>
-#include <dlog.h>
-
-#ifdef LOG_TAG
-#undef LOG_TAG
-#endif
-#define LOG_TAG "TIZEN_N_SIM_TEST"
-
-int main()
-{
- int ret = 0;
- char* subscriber_number = NULL;
- int ret_value = sim_get_subscriber_number(&subscriber_number);
-
- switch(ret_value)
- {
- case SIM_ERROR_NONE:
- LOGI("Subscriber number is \"%s\"", subscriber_number);
- ret = 0;
- free(subscriber_number);
- break;
- case SIM_ERROR_INVALID_PARAMETER:
- LOGE("Invalid parameter");
- ret = -1;
- break;
- case SIM_ERROR_OPERATION_FAILED:
- LOGE("Cannot find subscriber number value");
- ret = -1;
- break;
- case SIM_ERROR_NOT_AVAILABLE:
- LOGE("SIM is not available");
- ret = -1;
- break;
- default:
- LOGE("Unexpected return value");
- ret = -1;
- break;
- }
-
-
- return ret;
-}
+++ /dev/null
-/*
- * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
- *
- * Licensed under the Apache License, Version 2.0 (the License);
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an AS IS BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-
-#include <stdio.h>
-#include <string.h>
-#include <sim.h>
-#include <dlog.h>
-#include <glib.h>
-
-#ifdef LOG_TAG
-#undef LOG_TAG
-#endif
-#define LOG_TAG "TIZEN_N_SIM_TEST"
-
-static GMainLoop *event_loop;
-
-char* convert_state_to_string(sim_state_e sim_state)
-{
- switch(sim_state)
- {
- case SIM_STATE_AVAILABLE:
- return "available";
- case SIM_STATE_LOCKED:
- return "locked";
- case SIM_STATE_UNKNOWN:
- return "unknown";
- case SIM_STATE_UNAVAILABLE:
- return "unavailable";
- default:
- return "unexpected";
- }
-}
-
-void sim_state_changed(sim_state_e state, void* user_data)
-{
- LOGI("[%s] Start sim_state_changed_cb", __FUNCTION__);
-
- LOGI("[%s] Status of sim: %s", __FUNCTION__, convert_state_to_string(state));
- LOGI("[%s] user data: %s", __FUNCTION__, user_data);
-
- LOGI("[%s] End sim_state_changed_cb", __FUNCTION__);
- g_main_loop_quit(event_loop);
-}
-
-int main()
-{
- if( sim_set_state_changed_cb(sim_state_changed, "sim_state_changed_test") == SIM_ERROR_NONE )
- {
- LOGI("[%s] Succeeded to add callback function", __FUNCTION__);
- }
- else
- {
- LOGE("[%s] Failed to add callback function", __FUNCTION__);
- return -1;
- }
-
- LOGI("[%s] If you change the state of SIM card, then callback function will be called", __FUNCTION__);
- event_loop = g_main_loop_new(NULL, FALSE);
- g_main_loop_run(event_loop);
-
- if( sim_unset_state_changed_cb() == SIM_ERROR_NONE )
- {
- LOGI("[%s] Succeeded to remove callback function", __FUNCTION__);
- }
- else
- {
- LOGE("[%s] Failed to remove callback function", __FUNCTION__);
- return -1;
- }
-
- return 0;
-}