From: jk7744.park Date: Sun, 1 Feb 2015 04:53:45 +0000 (+0900) Subject: tizen 2.3 release X-Git-Tag: submit/tizen_2.3/20150202.064015^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=e8d3d2d8cf15b668e0b46d57e841e113d2aace1e;p=framework%2Ftelephony%2Flibslp-tapi.git tizen 2.3 release --- diff --git a/wearable/AUTHORS b/AUTHORS similarity index 100% rename from wearable/AUTHORS rename to AUTHORS diff --git a/wearable/CMakeLists.txt b/CMakeLists.txt similarity index 86% rename from wearable/CMakeLists.txt rename to CMakeLists.txt index 7d1c9fe..73dafcb 100644 --- a/wearable/CMakeLists.txt +++ b/CMakeLists.txt @@ -15,7 +15,9 @@ FOREACH(flag ${pkgs_CFLAGS}) ENDFOREACH(flag) SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} -Wl,-zdefs -fvisibility=hidden ") -SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS} -Werror -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wmissing-declarations -Wredundant-decls -Wcast-align") + +SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS} -Werror -Wextra -Wno-missing-field-initializers -Wdeclaration-after-statement -Wmissing-declarations -Wredundant-decls -O2 -Wall -Wno-array-bounds -Wno-empty-body -Wno-ignored-qualifiers -Wno-unused-parameter -Wwrite-strings -Wswitch-default -Wno-unused-but-set-variable ") + #SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS}") SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--as-needed") @@ -25,7 +27,6 @@ ADD_DEFINITIONS("-DFEATURE_DLOG_DEBUG") ADD_DEFINITIONS("-DTAPI_LOG_TAG=\"LIBTAPI\"") ADD_DEFINITIONS("-DPREFIX=\"${CMAKE_INSTALL_PREFIX}\"") ADD_DEFINITIONS(" -DEXPORT_API=\"__attribute__((visibility(\\\"default\\\")))\" ") -#ADD_DEFINITIONS("-DTIZEN_SUPPORT_SAT_ICON") MESSAGE(${CMAKE_C_FLAGS}) MESSAGE(${CMAKE_EXE_LINKER_FLAGS}) @@ -42,8 +43,7 @@ SET(SRCS src/tapi_sms.c src/tapi_sat.c src/tapi_modem.c - src/tapi_gps.c - ) +) ADD_LIBRARY(SLP-tapi SHARED ${SRCS}) TARGET_LINK_LIBRARIES(SLP-tapi ${pkgs_LDFLAGS}) @@ -59,5 +59,4 @@ INSTALL(TARGETS SLP-tapi DESTINATION lib COMPONENT Runtime) INSTALL(FILES ${CMAKE_SOURCE_DIR}/LICENSE DESTINATION /usr/share/license RENAME libslp-tapi) IF (TIZEN_ENGINEER_MODE) ADD_SUBDIRECTORY(test_src) - ADD_SUBDIRECTORY(unit-test) -ENDIF (TIZEN_ENGINEER_MODE) \ No newline at end of file +ENDIF (TIZEN_ENGINEER_MODE) diff --git a/wearable/LICENSE b/LICENSE similarity index 100% rename from wearable/LICENSE rename to LICENSE diff --git a/doc/libtapi_doc.h b/doc/libtapi_doc.h new file mode 100644 index 0000000..425c67c --- /dev/null +++ b/doc/libtapi_doc.h @@ -0,0 +1,292 @@ +/* + * libslp-tapi + * + * Copyright (c) 2014 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Ja-young Gu + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef __TIZEN_TELEPHONY_SERVICE_DOC_H__ +#define __TIZEN_TELEPHONY_SERVICE_DOC_H__ + +/** + * @internal + * @ingroup CAPI_TELEPHONY_FRAMEWORK + * @defgroup CAPI_TELEPHONY_SERVICE Telephony Service + * @brief The Telephony Service module provides call, modem, network, phonebook, SAT, SIM, SMS, and SS services. + * + * @section CAPI_TELEPHONY_SERVICE_HEADER Required Header + * \#include + * + * @section CAPI_TELEPHONY_SERVICE_OVERVIEW Overview + * The Telephony Service module provides call, modem, network, phonebook, SAT, SIM, SMS, and SS services. + * @section CAPI_TELEPHONY_SERVICE_FEATURE Related Features + * This API is related with the following feature:\n + * - http://tizen.org/feature/network.telephony + * + * It is recommended to design feature related codes in your application for reliability.\n + * + * You can check if a device supports the related features for this API by using @ref CAPI_SYSTEM_SYSTEM_INFO_MODULE, thereby controlling the procedure of your application.\n + * + * To ensure your application is only running on the device with specific features, please define the features in your manifest file using the manifest editor in the SDK.\n + * + * More details on featuring your application can be found from Feature Element. + */ + +/** + * @internal + * @ingroup CAPI_TELEPHONY_SERVICE + * @defgroup CAPI_TELEPHONY_SERVICE_CALL Call + * @brief + * @section CAPI_TELEPHONY_SERVICE_CALL_HEADER Required Header + * \#include + * + * @section CAPI_TELEPHONY_SERVICE_CALL_OVERVIEW Overview + * Call APIs allow an application to accomplish the following services: + * - Make a mobile originated Emergency call, Voice call, or Video call. + * - Accept or Reject incoming calls. + * - Release Calls. + * - Call dependent supplementary services such as call hold, retrieve, DTMF. + * - Multi-party call management, setup conference call, split conference call. + * - Call information such as get call information, get line identification number. + * - To verify whether a call (voice / video) is possible at any given time. + * + * @section CAPI_TELEPHONY_SERVICE_CALL_FEATURE Related Features + * This API is related with the following feature:\n + * - http://tizen.org/feature/network.telephony + * + * It is recommended to design feature related codes in your application for reliability.\n + * + * You can check if a device supports the related features for this API by using @ref CAPI_SYSTEM_SYSTEM_INFO_MODULE, thereby controlling the procedure of your application.\n + * + * To ensure your application is only running on the device with specific features, please define the features in your manifest file using the manifest editor in the SDK.\n + * + * More details on featuring your application can be found from Feature Element. + */ + +/** + * @internal + * @ingroup CAPI_TELEPHONY_SERVICE + * @defgroup CAPI_TELEPHONY_SERVICE_MODEM Modem + * @brief + * + * @section CAPI_TELEPHONY_SERVICE_MODEM_HEADER Required Header + * \#include + * + * @section CAPI_TELEPHONY_SERVICE_MODEM_OVERVIEW Overview + * Modem APIs allow an application to accomplish the following services: + * - Process power command + * - Reset the phone power (on / off) + * - Process airplane mode + * + * @section CAPI_TELEPHONY_SERVICE_MODEM_FEATURE Related Features + * This API is related with the following feature:\n + * - http://tizen.org/feature/network.telephony + * + * It is recommended to design feature related codes in your application for reliability.\n + * + * You can check if a device supports the related features for this API by using @ref CAPI_SYSTEM_SYSTEM_INFO_MODULE, thereby controlling the procedure of your application.\n + * + * To ensure your application is only running on the device with specific features, please define the features in your manifest file using the manifest editor in the SDK.\n + * + * More details on featuring your application can be found from Feature Element. + */ + +/** + * @internal + * @ingroup CAPI_TELEPHONY_SERVICE + * @defgroup CAPI_TELEPHONY_SERVICE_NETWORK Network + * @brief + * @section CAPI_TELEPHONY_SERVICE_NETWORK_HEADER Required Header + * \#include + * + * @section CAPI_TELEPHONY_SERVICE_NETWORK_OVERVIEW Overview + * Network APIs allow an application to accomplish the following services: + * - Search and Select Network + * - Get Network information + * - Get and Set Preferred PLMN + * + * @section CAPI_TELEPHONY_SERVICE_NETWORK_FEATURE Related Features + * This API is related with the following feature:\n + * - http://tizen.org/feature/network.telephony + * + * It is recommended to design feature related codes in your application for reliability.\n + * + * You can check if a device supports the related features for this API by using @ref CAPI_SYSTEM_SYSTEM_INFO_MODULE, thereby controlling the procedure of your application.\n + * + * To ensure your application is only running on the device with specific features, please define the features in your manifest file using the manifest editor in the SDK.\n + * + * More details on featuring your application can be found from Feature Element. + */ + +/** + * @internal + * @ingroup CAPI_TELEPHONY_SERVICE + * @defgroup CAPI_TELEPHONY_SERVICE_PHONEBOOK Phonebook + * @brief + * + * @section CAPI_TELEPHONY_SERVICE_PHONEBOOK_HEADER Required Header + * \#include + * + * @section CAPI_TELEPHONY_SERVICE_PHONEBOOK Overview + * Telephony provides APIs for various phonebook related features such as getting SIM initialization status, + * supported phonebook types, total records and used records in phonebook, phonebook entry information, + * and reading, updating, deleting of SIM phonebook records. + * + * @section CAPI_TELEPHONY_SERVICE_PHONEBOOK_FEATURE Related Features + * This API is related with the following feature:\n + * - http://tizen.org/feature/network.telephony + * + * It is recommended to design feature related codes in your application for reliability.\n + * + * You can check if a device supports the related features for this API by using @ref CAPI_SYSTEM_SYSTEM_INFO_MODULE, thereby controlling the procedure of your application.\n + * + * To ensure your application is only running on the device with specific features, please define the features in your manifest file using the manifest editor in the SDK.\n + * + * More details on featuring your application can be found from Feature Element. + */ + +/** + * @internal + * @ingroup CAPI_TELEPHONY_SERVICE + * @defgroup CAPI_TELEPHONY_SERVICE_SAT SAT + * @brief + * + * @section CAPI_TELEPHONY_SERVICE_SAT_HEADER Required Header + * \#include + * + * @section CAPI_TELEPHONY_SERVICE_SAT_OVERVIEW Overview + * SAT APIs allow an application to accomplish the following services: + * - 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 from other applications + * - Send UI / User confirmation to the SIM application + * Note: Telephony SAT functionality allows message relaying from a USIM application to SAT related applications. + * + * @section CAPI_TELEPHONY_SERVICE_SAT_FEATURE Related Features + * This API is related with the following feature:\n + * - http://tizen.org/feature/network.telephony + * + * It is recommended to design feature related codes in your application for reliability.\n + * + * You can check if a device supports the related features for this API by using @ref CAPI_SYSTEM_SYSTEM_INFO_MODULE, thereby controlling the procedure of your application.\n + * + * To ensure your application is only running on the device with specific features, please define the features in your manifest file using the manifest editor in the SDK.\n + * + * More details on featuring your application can be found from Feature Element. + */ + +/** + * @internal + * @ingroup CAPI_TELEPHONY_SERVICE + * @defgroup CAPI_TELEPHONY_SERVICE_SIM SIM + * @brief + * + * @section CAPI_TELEPHONY_SERVICE_SIM_HEADER Required Header + * \#include + * + * @section CAPI_TELEPHONY_SERVICE_SIM_OVERVIEW Overview + * SIM APIs allow an application to accomplish the following services: + * - Get Card Init status and Identification + * - Get the Card Type i.e. whether the SIM Card is a GSM SIM or a 3G SIM + * - Set and Get the language preference information stored in the SIM + * - Get the ECC (Emergency Call Codes) data + * - Get the IMSI (International Mobile Subscriber Identity) information + * - Set and Get the mailbox information stored in the SIM + * - Set and Get the message indication status stored in the SIM + * - Enable, Disable, Change, and Verify the SIM Lock status + * + * @section CAPI_TELEPHONY_SERVICE_SIM_FEATURE Related Features + * This API is related with the following feature:\n + * - http://tizen.org/feature/network.telephony + * + * It is recommended to design feature related codes in your application for reliability.\n + * + * You can check if a device supports the related features for this API by using @ref CAPI_SYSTEM_SYSTEM_INFO_MODULE, thereby controlling the procedure of your application.\n + * + * To ensure your application is only running on the device with specific features, please define the features in your manifest file using the manifest editor in the SDK.\n + * + * More details on featuring your application can be found from Feature Element. + */ + +/** + * @internal + * @ingroup CAPI_TELEPHONY_SERVICE + * @defgroup CAPI_TELEPHONY_SERVICE_SMS SMS + * @brief + * @section CAPI_TELEPHONY_SERVICE_SMS_HEADER Required Header + * \#include + * + * @section CAPI_TELEPHONY_SERVICE_SMS_OVERVIEW Overview + * SMS APIs allow an application to accomplish the following services: + * - 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 + * + * @section CAPI_TELEPHONY_SERVICE_SMS_FEATURE Related Features + * This API is related with the following feature:\n + * - http://tizen.org/feature/network.telephony + * + * It is recommended to design feature related codes in your application for reliability.\n + * + * You can check if a device supports the related features for this API by using @ref CAPI_SYSTEM_SYSTEM_INFO_MODULE, thereby controlling the procedure of your application.\n + * + * To ensure your application is only running on the device with specific features, please define the features in your manifest file using the manifest editor in the SDK.\n + * + * More details on featuring your application can be found from Feature Element. + */ + +/** + * @internal + * @ingroup CAPI_TELEPHONY_SERVICE + * @defgroup CAPI_TELEPHONY_SERVICE_SS Supplementary Service + * @brief + * + * @section CAPI_TELEPHONY_SERVICE_SS_HEADER Required Header + * \#include + * + * @section CAPI_TELEPHONY_SERVICE_SS_OVERVIEW Overview + * Supplementary Service APIs allow an application to accomplish the following services: + * - Activate, Deactivate, and Change the password for call barring + * - Register, Deregister, Activate, and Deactivate call forwarding and call waiting + * - Set and Get the CLI(Calling Line Identification) status + * - Send USSD request + * + * Telephony provides APIs to activate/deactivate call barring, get the barring status, and change the barring password.\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 that are set.\n + * The mobile subscriber may also determine the type of barring preferred for incoming/outgoing calls, by subscribing to a set of one or more unique barring programs.\n + * Telephony provides APIs to activate/deactivate the call forwarding option at the Network and to get the call forward status.\n + * 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.\n + * 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 + * An application has to call this API in order to explicitly register/deregister/activate/deactivate the call forwarding option. A request will be sent irrespective of whether another SS call forward is already in progress.\n + * + * @section CAPI_TELEPHONY_SERVICE_SS_FEATURE Related Features + * This API is related with the following feature:\n + * - http://tizen.org/feature/network.telephony + * + * It is recommended to design feature related codes in your application for reliability.\n + * + * You can check if a device supports the related features for this API by using @ref CAPI_SYSTEM_SYSTEM_INFO_MODULE, thereby controlling the procedure of your application.\n + * + * To ensure your application is only running on the device with specific features, please define the features in your manifest file using the manifest editor in the SDK.\n + * + * More details on featuring your application can be found from Feature Element. + */ + +#endif /* __TIZEN_TELEPHONY_SERVICE_DOC_H__ */ diff --git a/include/ITapiCall.h b/include/ITapiCall.h new file mode 100644 index 0000000..490ccf3 --- /dev/null +++ b/include/ITapiCall.h @@ -0,0 +1,912 @@ +/* + * libslp-tapi + * + * Copyright (c) 2014 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Ja-young Gu + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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 ITapiCall.h + */ + +/** + * @internal + * @addtogroup CAPI_TELEPHONY_SERVICE_CALL + * @{ + */ + +#ifndef _ITAPI_CALL_H_ +#define _ITAPI_CALL_H_ + +#include +#include + +#ifdef __cplusplus +extern "C" +{ +#endif + +/** + * @brief Originates MO call setup. + * + * @details This is an asynchronous function. The function completes immediately and call setup proceeds in the background.\n + * This API makes a Dbus method call to the Telephony Server and gets an immediate feedback.\n + * However it just means that the API request has been transfered to the CP successfully.\n + * The actual operation result is being delivered in the corresponding event asynchronously. + * + * Sync (or) Async: This is an Asynchronous API. + * + * Prospective Clients: Embedded call application. + * + * @since_tizen 2.3 + * @privlevel platform + * @privilege %http://tizen.org/privilege/telephony.admin + * + * @remarks MO call setup continues in the background. There are multiple states involved in the call setup procedure.\n + * Depending on whether request completion is successful or not, various event notifications are sent to the client along with data\n + * associated with the event(Successful data or error information) based on the indication or response received at the Telephony Server.\n + * Setting up an emergency call when #TelCallType_t is a voice_call, voice call is setup unless the @a dial_number parameter is\n + * an emergency number known to telephony FW(like 112 for all 2G and above, other numbers may be operator specific or device configuration specific,\n + * so Telephony FW will read relevant SIM files and refer to internal configuration records).\n + * If an emergency number is passed and #TelCallType_t is a voice_call, Telephony FW shall setup an emergency phone call.\n + * When #TelCallType_t is an emergency call, emergency call is always set up. + * + * @param[in] handle The handle from tel_init() + * + * @param[in] pParams #TelCallDial_t contains the CallType(whether it is a voice call or data call) and number + * + * @param[in] callback To register a callback function for result + * + * @param[in] user_data The user data for user specification + * + * @return The return type (int) + * @c 0 indicates that the operation is completed successfully,\n + * else it will return failure and an error code (Refer Doxygen doc or #TapiResult_t). + * + * @pre Initialize the Dbus connection with #tel_init.\n + * Register the telephony event to be listened with #tel_register_noti_event.\n + * An event loop runs to listen to events. + * + * @see #tel_answer_call #tel_end_call + */ +int tel_dial_call(TapiHandle *handle, const TelCallDial_t *pParams, tapi_response_cb callback, void *user_data); + +/** + * @brief Supports answering the incoming call by accepting or rejecting the call. + * + * @details This API makes a Dbus method call to the Telephony Server and gets an immediate feedback.\n + * However it just means that the API request has been transfered to the CP successfully.\n + * The actual operation result is being delivered in the corresponding event asynchronously. + * + * Sync (or) Async: This is an Asynchronous API. + * + * Prospective Clients: Embedded call application. + * + * @since_tizen 2.3 + * @privlevel platform + * @privilege %http://tizen.org/privilege/telephony.admin + * + * @param[in] handle The handle from tel_init() + * + * @param[in] CallHandle The unique handle for referring the call \n + * This call handle is available to the application through an incoming call + * (TAPI_NOTI_VOICE_CALL_STATUS_INCOMING) event. + * + * @param[in] AnsType The answer type - accept / reject / replace / hold and accept is allowed + * + * @param[in] callback To register a callback function for result + * + * @param[in] user_data The user data for user specification + * + * @return The return type (int) + * @c 0 indicates that the operation is completed successfully, + * else it will return failure and an error code (Refer Doxygen doc or #TapiResult_t) + * + * @pre Initialize the Dbus connection with #tel_init.\n + * Register the telephony event to be listened with #tel_register_noti_event.\n + * An event loop runs to listen to events.\n + * Call associated with the call handle should be in the #TAPI_CALL_STATE_INCOM state otherwise the API fails and there can be a + * a maximum of 1 existing call. + * + * @see tel_dial_call() + * @see tel_end_call() + */ +int tel_answer_call(TapiHandle *handle, unsigned int CallHandle, TelCallAnswerType_t AnsType, tapi_response_cb callback, void *user_data); + +/** + * @brief Releases the call identified by the call handle irrespective of whether the call is in the hold or active state. + * + * @details It is used when releasing a specific active call from a multiparty call. + * This API makes a Dbus method call to the Telephony Server and gets an immediate feedback. + * However it just means that the API request has been transfered to the CP successfully. + * The actual operation result is being delivered in the corresponding event asynchronously. + * + * Sync (or) Async: This is an Asynchronous API. + * + * Prospective Clients: Embedded call application. + * + * @since_tizen 2.3 + * @privlevel platform + * @privilege %http://tizen.org/privilege/telephony.admin + * + * @remarks In case of the MPTY Call handle, the call end event is returned for each call in MPTY. + * + * @param[in] handle The handle from tel_init() + * + * @param[in] CallHandle A unique handle that refers to the call + * + * @param[in] callback To register a callback function for result + * + * @param[in] EndType The end call type (end specific call/end all calls/end all held calls/end all active calls) + * + * @param[in] user_data The user data for user specification + * + * @return The return type (int) + * @c 0 indicates that the operation is completed successfully, + * else it will return failure and an error code (Refer Doxygen doc or #TapiResult_t) + * + * @pre Initialize the Dbus connection with #tel_init.\n + * Register the telephony event to be listened with #tel_register_noti_event.\n + * An event loop runs to listen to events.\n + * The call handle should be valid and there should be an existing call in the active/hold state. + * + * @see tel_dial_call() + * @see tel_answer_call() + */ +int tel_end_call(TapiHandle *handle, unsigned int CallHandle, TelCallEndType_t EndType, tapi_response_cb callback, void *user_data); + +/** + * @brief Puts the given call on hold. + * + * @details The call identified by the call handle should be in the active state. + * This API makes a Dbus method call to the Telephony Server and gets an immediate feedback. + * However it just means that the API request has been transfered to the CP successfully. + * The actual operation result is being delivered in the corresponding event asynchronously. + * + * Sync (or) Async: This is an Asynchronous API. + * + * Prospective Clients: Embedded call application. + * + * @since_tizen 2.3 + * @privlevel platform + * @privilege %http://tizen.org/privilege/telephony.admin + * + * @param[in] handle The handle from tel_init() + * + * @param[in] CallHandle A unique handle for referring the call + * + * @param[in] callback To register a callback function for result + * + * @param[in] user_data The user data for user specification + * + * @return The return type (int) + * @c 0 indicates that the operation is completed successfully, + * else it will return failure and an error code (Refer Doxygen doc or #TapiResult_t) + * + * @pre Initialize the Dbus connection with #tel_init.\n + * Register the telephony event to be listened with #tel_register_noti_event.\n + * An event loop runs to listen to events.\n + * The call identified by the call handle should be in the active state. + * + * @see tel_retrieve_call() + */ +int tel_hold_call(TapiHandle *handle, unsigned int CallHandle, tapi_response_cb callback, void *user_data); + +/** + * @brief Retrieves the call being held. + * + * @details The call identified by the call handle must be in the held state. + * This API makes a Dbus method call to the Telephony Server and gets an immediate feedback. + * However it just means that the API request has been transfered to the CP successfully. + * The actual operation result is being delivered in the corresponding event asynchronously. + * + * Sync (or) Async: This is an Asynchronous API. + * + * Prospective Clients: Embedded call application. + * + * @since_tizen 2.3 + * @privlevel platform + * @privilege %http://tizen.org/privilege/telephony.admin + * + * @remarks The call duration for the call will be calculated from the moment the call has been connected until the call is released. + * + * @param[in] handle The handle from tel_init() + * + * @param[in] CallHandle A unique handle for referring the call + * + * @param[in] callback To register a callback function for result + * + * @param[in] user_data The user data for user specification + * + * @return The return type (int) + * @c 0 indicates that the operation is completed successfully, + * else it will return failure and an error code (Refer Doxygen doc or #TapiResult_t) + * + * @pre Initialize the Dbus connection with #tel_init.\n + * Register the telephony event to be listened with #tel_register_noti_event.\n + * An event loop runs to listen to events.\n + * Call should be in the held state in order to retrieve it into the active state unless no active call is present. + */ +int tel_active_call(TapiHandle *handle, unsigned int CallHandle, tapi_response_cb callback, void *user_data); + +/** + * @brief Swaps calls. This is only for calls dialed or answered with Telephony. + * + * @details Swap is only available for voice calls. + * This API makes a Dbus method call to the Telephony Server and gets an immediate feedback. + * However it just means that the API request has been transfered to the CP successfully. + * The actual operation result is delivered in the corresponding event asynchronously. + * + * Notes: + * During a call, a user can place all active calls and accept other held calls with this function. + * If the terminal is not within a call, it will fail. + * + * Sync (or) Async: This is an Asynchronous API. + * + * Prospective Clients: Embedded call application. + * + * @since_tizen 2.3 + * @privlevel platform + * @privilege %http://tizen.org/privilege/telephony.admin + * + * @param[in] handle The handle from tel_init() + * + * @param[in] CallHandle1 This is an active call + * + * @param[in] CallHandle2 This is a held call + * + * @param[in] callback To register a callback function for result + * + * @param[in] user_data The user data for user specification + * + * @return The return type (int) + * @c 0 indicates that the operation has completed successfully, + * else it will return failure and an error code (Refer Doxygen doc or #TapiResult_t) + * + * @pre Initialize the Dbus connection with #tel_init.\n + * Register the telephony event to be listened with #tel_register_noti_event.\n + * An event loop runs to listen to events. + */ +int tel_swap_call(TapiHandle *handle, unsigned int CallHandle1, unsigned int CallHandle2, tapi_response_cb callback, void *user_data); + +/** + * @brief Starts continuous DTMF by sending a single digit during the call. + * + * @details DTMF is an abbreviation for Dual-tone-multi-frequency. It is used for telecommunication signaling\n + * over telephone lines in the voice-frequency band between UE and other communication devices.\n + * For example UE sends a DTMF tone to the server to choose from options which the server provides.\n + * If the UE is not within a call, this function will fail with an error code. + * + * This function makes a Dbus method call to the Telephony Sever and gets an immediate feedback.\n + * However it just means that the API request has been transfered to the CP successfully.\n + * The actual operation result is being delivered in the corresponding event asynchronously. + * + * Sync (or) Async: This is an Asynchronous API. + * + * Prospective Clients: Embedded call application. + * + * @since_tizen 2.3 + * @privlevel platform + * @privilege %http://tizen.org/privilege/telephony.admin + * + * @remarks There will be a single asynchronous notification for all the DTMF digits sent. + * If the users of this API need an asynchronous\n + * response for each DTMF digit then the user has to call this API multiple times passing each single DTMF digit in @a pDtmfString. + * + * @remarks To be invoked in the following cases: + * + * i. Key Press during On-going call + * ii. DTMF digits passed with PAUSE (,) or WAIT (;) + * + * In either of the above cases, the application can ONLY send a single DTMF Digit to Telephony.\n + * In case of PAUSE and WAIT, the application needs to invoke tel_stop_call_cont_dtmf() sequentially (for every digit) without waiting for response from tel_start_call_cont_dtmf(). + * + * @param[in] handle The handle from tel_init() + * + * @param[in] dtmf_digit The DTMF digit to be sent from MS + * + * @param[in] callback To register a callback function for result + * + * @param[in] user_data The user data for user specification + * + * @return The return type (TapiHandle *handle, int) \n + * @c 0 indicates that the operation has completed successfully, \n + * else it will return failure and an error code (TapiHandle *handle, Refer Doxygen doc or #TapiResult_t) + * + * @pre Initialize the Dbus connection with #tel_init.\n + * An active call should be present. + */ +int tel_start_call_cont_dtmf(TapiHandle *handle, unsigned char dtmf_digit, tapi_response_cb callback, void *user_data); + +/** + * @brief Stops continuous DTMF during the call. + * + * @details DTMF is an abbreviation for Dual-tone-multi-frequency. It is used for telecommunication signaling\n + * over telephone lines in the voice-frequency band between UE and other communication devices.\n + * For example UE sends a DTMF tone to the server to choose from options which the server provides.\n + * If the UE is not within a call, this function will fail with an error code. + * + * This function makes a Dbus method call to the Telephony Sever and gets an immediate feedback.\n + * However it just means that the API request has been transfered to the CP successfully.\n + * The actual operation result is being delivered in the corresponding event asynchronously. + * + * Sync (or) Async: This is an Asynchronous API. + * + * Prospective Clients: Embedded call application. + * + * @since_tizen 2.3 + * @privlevel platform + * @privilege %http://tizen.org/privilege/telephony.admin + * + * @remarks There will be a single asynchronous notification for all the DTMF digits sent. + * If the users of this API need an asynchronous + * response for each DTMF digit then the user has to call this API multiple times passing each single DTMF digit in @a pDtmfString. + * + * @remarks To be invoked in the following cases: + * + * i. Key Release (post key press) during On-going call + * ii. DTMF digits passed with PAUSE (,) or WAIT (;) + * + * Every tel_start_call_cont_dtmf() call needs to be followed by tel_stop_call_cont_dtmf() sequentially. + * + * @param[in] handle The handle from tel_init() + * + * @param[in] callback To register a callback function for result + * + * @param[in] user_data The user data for user specification + * + * @return The return type (int)\n + * @c 0 indicates that the operation has completed successfully,\n + * else it will return failure and an error code (Refer Doxygen doc or #TapiResult_t) + * + * @pre Initialize the Dbus connection with #tel_init.\n + * An active call should be present.\n + * Start a continuous DTMF request should be sent already. + */ +int tel_stop_call_cont_dtmf(TapiHandle *handle, tapi_response_cb callback, void *user_data); + +/** + * @brief Sends one or more DTMF digits during the call. (3GPP2 specific) + * + * @details DTMF is an abbreviation for Dual-tone-multi-frequency. It is used for telecommunication signaling\n + * over telephone lines in the voice-frequency band between UE and other communication devices.\n + * For example UE sends a DTMF tone to the server to choose from options which the server provides.\n + * If the UE is not within a call, this function will fail with an error code. + * + * This function makes a Dbus method call to the Telephony Sever and gets an immediate feedback.\n + * However it just means that the API request has been transfered to the CP successfully.\n + * The actual operation result is being delivered in the corresponding event asynchronously. + * + * Sync (or) Async: This is an Asynchronous API. + * + * Prospective Clients: Embedded call application. + * + * @since_tizen 2.3 + * @privlevel platform + * @privilege %http://tizen.org/privilege/telephony.admin + * + * @remarks There will be a single asynchronous notification for all the DTMF digits sent. + * If the users of this API need an asynchronous\n + * response for each DTMF digit then the user has to call this API multiple times passing each single DTMF digit in @a pDtmfString. + * + * @param[in] handle The handle from tel_init() + * + * @param[in] info A Burst DTMF info structure containing DTMF string, pulse width, and inter digit interval MS + * + * @param[in] callback To register a callback function for result + * + * @param[in] user_data The user data for user specification + * + * @return The return type (int)\n + * @c 0 indicates that the operation has completed successfully,\n + * else it will return failure and an error code (Refer Doxygen doc or #TapiResult_t) + * + * @pre Initialize the Dbus connection with #tel_init.\n + * An active call should be present. + */ +int tel_send_call_burst_dtmf(TapiHandle *handle, const TelCallBurstDtmf_t *info, tapi_response_cb callback, void *user_data); + +/** + * @brief Joins the given two calls (one call in the active conversation state and the other call in the held state) into conference. + * + * @details This function makes a Dbus method call to the Telephony Server and gets an immediate feedback. + * However it just means that the API request has been transfered to the CP successfully. + * The actual operation result is being delivered in the corresponding event asynchronously. + * + * Sync (or) Async: This is an Asynchronous API. + * + * Prospective Clients: Embedded call application. + * + * @since_tizen 2.3 + * @privlevel platform + * @privilege %http://tizen.org/privilege/telephony.admin + * + * @remarks The call handle of an active call or held call will be made as MPTY-id, and the other call handle will join in a conference. + * + * @param[in] handle The handle from tel_init() + * + * @param[in] CallHandle1 A unique handle which is either an active call or a held call + * + * @param[in] CallHandle2 A unique call handle + * + * @param[in] callback To register a callback function for result + * + * @param[in] user_data The user data for user specification + * + * @return The return type (int) + * @c 0 indicates that the operation is completed successfully, + * else it will return failure and an error code (Refer Doxygen doc or #TapiResult_t) + * + * @pre Initialize the Dbus connection with #tel_init.\n + * Register the telephony event to be listened with #tel_register_noti_event.\n + * An event loop runs to listen to events.\n + * For a Multiparty call or for joining two calls into conference, there should be one call in the active state and another call + * in the held state. + * + * @see tel_split_call() + */ +int tel_join_call(TapiHandle *handle, unsigned int CallHandle1, unsigned int CallHandle2, tapi_response_cb callback, void *user_data); + +/** + * @brief Triggers splitting a private call from a multiparty call. + * + * @details This API allows creating a private communication with one of the remote parties in a + * multiparty session. TAPI client application has to pass the call handle which needs + * to be split from the multiparty call. + * + * This function makes a Dbus method call to the Telephony Server and gets an immediate feedback. + * However it just means that the API request has been transfered to the CP successfully. + * The actual operation result is being delivered in the corresponding event asynchronously. + * + * Sync (or) Async: This is an Asynchronous API. + * + * Prospective Clients: Embedded call application. + * + * @since_tizen 2.3 + * @privlevel platform + * @privilege %http://tizen.org/privilege/telephony.admin + * + * @param[in] handle The handle from tel_init() + * + * @param[in] CallHandle The handle of the call to be made private \n + * The call handle referring to the call that is to be split from the conference + * (call to be made private) + * + * @param[in] callback To register a callback function for result + * + * @param[in] user_data The user data for user specification + * + * @return The return type (int) + * @c 0 indicates that the operation is completed successfully, + * else it will return failure and an error code (Refer Doxygen doc or #TapiResult_t) + * + * @pre Initialize the Dbus connection with #tel_init.\n + * Register the telephony event to be listened with #tel_register_noti_event.\n + * An event loop runs to listen to events.\n + * The call should be in a multiparty conference call. + * + * @post The split call will be the active call and the conference call will be the held call. + * + * @see tel_join_call() + */ +int tel_split_call(TapiHandle *handle, unsigned int CallHandle, tapi_response_cb callback, void *user_data); + +/** + * @brief Triggers making an explicit call transfer by connecting the two parties where one party is being + * active (active state) and another party is being held (held state). + * + * @details This function makes a Dbus method call to the Telephony Server and gets an immediate feedback. + * However it just means that the API request has been transfered to the CP successfully. + * The actual operation result is being delivered in the corresponding event asynchronously. + * + * Notes: + * The ECT supplementary service enables the served mobile subscriber (subscriber A) who has two calls, + * each of which can be an incoming or outgoing call, to connect the other parties in the two calls + * and release the served mobile subscriber's own connection. + * Prior to transfer, the connection shall have been established on the call + * between subscriber A and subscriber B. On the call between subscriber A and subscriber C, + * either the connection shall have been established prior to transfer, or, as a network option, + * or the transfer can occur while subscriber C is being informed of the call + * (i.e. the connection has not yet been established.). + * + * Sync (or) Async: This is an Asynchronous API. + * + * Prospective Clients: Embedded call application. + * + * @since_tizen 2.3 + * @privlevel platform + * @privilege %http://tizen.org/privilege/telephony.admin + * + * @param[in] handle The handle from tel_init() + * + * @param[in] CallHandle The call handle of an active call + * + * @param[in] callback To register the callback function for result + * + * @param[in] user_data The user data for user specification + * + * @return The return type (int) + * @c 0 indicates that the operation is completed successfully, + * else it will return failure and an error code (Refer Doxygen doc or #TapiResult_t) + * + * @pre Initialize the Dbus connection with #tel_init.\n + * Register the telephony event to be listend with #tel_register_noti_event.\n + * An event loop runs to listen to events.\n + * In order to call transfer, served mobile subscriber should have 2 calls, one in the active state and another one + * in the held state. + * + * @post When the request has been completed successfully, a call end indication will be sent to both the calls (active and held). + */ +int tel_transfer_call(TapiHandle *handle, unsigned int CallHandle, tapi_response_cb callback, void *user_data); + +/** + * @brief Gets the status of the current call identified by the call handle whenever the application wants the call status, call handle must be valid. + * + * @details This function makes a Dbus method call to the Telephony Server and gets an immediate feedback. + * However it just means that the API request has been transfered to the CP successfully. + * The actual operation result is being delivered in the corresponding event asynchronously. + * + * Sync (or) Async: This is a Synchronous API. + * + * Prospective Clients: Embedded call application. + * + * @since_tizen 2.3 + * @privlevel public + * @privilege %http://tizen.org/privilege/telephony + * + * @param[in] handle The handle from tel_init() + * + * @param[in] call_id A unique handle for referring the call + * + * @param[out] out The call status information like destination number, call direction (MO or MT), call type (voice or data), whether + * the call is in the conference state or not \n + * The present call state is returned through this parameter + * + * @return The return type (int) + * @c 0 indicates that the operation is completed successfully, + * else it will return failure and an error code (Refer Doxygen doc or #TapiResult_t) + * + * @pre Initialize the Dbus connection with #tel_init. + */ +int tel_get_call_status(TapiHandle *handle, int call_id, TelCallStatus_t *out ); + +/** + * @brief Gets the status all of the current call + * + * Sync (or) Async: This is a Synchronous API. + * + * Prospective Clients: Embedded call application. + * + * @since_tizen 2.3 + * @privlevel public + * @privilege %http://tizen.org/privilege/telephony + * + * @see tel_get_call_status() + */ +int tel_get_call_status_all(TapiHandle *handle, TelCallStatusCallback cb, void *user_data); + +/** + * @brief Redirects the incoming call to another subscriber. + * + * @details If informed about an incoming call this call may be redirected to another destination by + * entering the destination number. The destination number to which the current + * incoming call needs to be redirected is specified via the info argument. + * + * Sync (or) Async: This is an Asynchronous API. + * + * Prospective Clients: Embedded call application. + * + * @since_tizen 2.3 + * @privlevel platform + * @privilege %http://tizen.org/privilege/telephony.admin + * + * @param[in] handle The handle from tel_init() + * + * @param[in] CallHandle An incoming call handle + * + * @param[out] deflect_info The destination number + * + * @param[in] callback To register a callback function for result + * + * @param[in] user_data The user data for user specification + * + * @return The return type (int) + * @c 0 indicates that the operation is completed successfully, + * else it will return failure and an error code (Refer Doxygen doc or #TapiResult_t) + * + * @pre Initialize the Dbus connection with #tel_init.\n + * Register the telephony event to be listened with #tel_register_noti_event.\n + * An event loop runs to listen to events. + */ +int tel_deflect_call(TapiHandle *handle, unsigned int CallHandle, const TelCallDeflectDstInfo_t *deflect_info, tapi_response_cb callback, void *user_data); + +/** + * @brief Gets the call volume. + * + * @details This function makes a Dbus method call to the Telephony Server and returns an immediate value. + * However it just means that the API request has been transfered to the CP successfully. + * The actual operation result is being delivered in the corresponding event asynchronously. + * + * Sync (or) Async: This is a Asynchronous API. + * + * Prospective Clients: Embedded call application. + * + * @since_tizen 2.3 + * @privlevel public + * @privilege %http://tizen.org/privilege/telephony + * + * @param[in] handle The handle from tel_init() + * + * @param[in] device The sound device + * + * @param[in] type The sound type + * + * @param[in] callback To register a callback function for result + * + * @param[in] user_data The user data for user specification + * + * @return The return type (int) + * @c 0 indicates that the operation is completed successfully, + * else it will return failure and an error code (Refer Doxygen doc or #TapiResult_t) + */ +int tel_get_call_volume_info(TapiHandle *handle, TelSoundDevice_t device, TelSoundType_t type, tapi_response_cb callback, void *user_data ); + +/** + * @brief Sets the call volume. + * + * @details This function makes a Dbus method call to the Telephony Server and returns an immediate value. + * However it just means that the API request has been transfered to the CP successfully. + * The actual operation result is being delivered in the corresponding event asynchronously. + * + * Sync (or) Async: This is a Asynchronous API. + * + * Prospective Clients: Embedded call application. + * + * @since_tizen 2.3 + * @privlevel platform + * @privilege %http://tizen.org/privilege/telephony.admin + * + * @param[in] handle The handle from tel_init() + * + * @param[in] info The call volume information + * + * @param[in] callback To register a callback function for result + * + * @param[in] user_data The user data for user specification + * + * @return The return type (int) + * @c 0 indicates that the operation has completed successfully, + * else it will return failure and an error code (Refer Doxygen doc or #TapiResult_t) + */ +int tel_set_call_volume_info(TapiHandle *handle, TelCallVolumeInfo_t *info, tapi_response_cb callback, void *user_data ); + +/** + * @brief Sets the call sound path. + * + * @details This function makes a Dbus method call to the Telephony Server and returns an immediate value. + * However it just means that the API request has been transfered to the CP successfully. + * The actual operation result is being delivered in the corresponding event asynchronously. + * + * Sync (or) Async: This is a Asynchronous API. + * + * Prospective Clients: Embedded call application. + * + * @since_tizen 2.3 + * @privlevel platform + * @privilege %http://tizen.org/privilege/telephony.admin + * + * @param[in] handle The handle from tel_init() + * + * @param[in] path The call sound path information + * + * @param[in] callback To register a callback function for result + * + * @param[in] user_data The user data for user specification + * + * @return The return type (int) + * @c 0 indicates that the operation is completed successfully, + * else it will return failure and an error code (Refer Doxygen doc or #TapiResult_t) + */ +int tel_set_call_sound_path(TapiHandle *handle, TelCallSoundPathInfo_t *path, tapi_response_cb callback, void *user_data ); + +/** + * @brief Sets the call mute state. + * + * @details This function makes a Dbus method call to the Telephony Server and returns an immediate value. + * However it just means that the API request has been transfered to the CP successfully. + * The actual operation result is being delivered in the corresponding event asynchronously. + * + * Sync (or) Async: This is a Asynchronous API. + * + * Prospective Clients: Embedded call application. + * + * @since_tizen 2.3 + * @privlevel platform + * @privilege %http://tizen.org/privilege/telephony.admin + * + * @param[in] handle The handle from tel_init() + * + * @param[in] mute The sound mute status + * + * @param[in] callback To register a callback function for result + * + * @param[in] user_data The user data for user specification + * + * @return The return type (int) + * @c 0 indicating that the operation has completed successfully, + * else it will return failure and an error code (Refer Doxygen doc or #TapiResult_t) + */ +int tel_set_call_mute_status(TapiHandle *handle, TelSoundMuteStatus_t mute, TelSoundMutePath_t path, tapi_response_cb callback, void *user_data ); + +/** + * @brief Gets the call mute state. + * + * @details This function makes a Dbus method call to the Telephony Server and returns an immediate value. + * However it just means that the API request has been transfered to the CP successfully. + * The actual operation result is delivered in the corresponding event asynchronously. + * + * Sync (or) Async: This is a Asynchronous API. + * + * Prospective Clients: Embedded call application. + * + * @since_tizen 2.3 + * @privlevel public + * @privilege %http://tizen.org/privilege/telephony + * + * @param[in] handle The handle from tel_init() + * + * @param[in] callback To register a callback function for result + * + * @param[in] user_data The user data for user specification + * + * @return The return type (int) + * @c 0 indicates that the operation is completed successfully, + * else it will return failure and an error code (Refer Doxygen doc or #TapiResult_t) + */ +int tel_get_call_mute_status(TapiHandle *handle, tapi_response_cb callback, void *user_data ); + +/** + * @brief Gets the voice privacy option mode in the phone. (3GPP2 specific) + * + * @details This function makes a Dbus method call to the Telephony Sever and gets an immediate feedback.\n + * However it just means that the API request has been transfered to the CP successfully.\n + * The actual operation result is being delivered in the corresponding event asynchronously. + * + * Sync (or) Async: This is an Asynchronous API. + * + * Prospective Clients: Embedded call application. + * + * @since_tizen 2.3 + * @privlevel public + * @privilege %http://tizen.org/privilege/telephony + * + * @param[in] handle The handle from tel_init() + * + * @param[in] callback To register a callback function for result + * + * @param[in] user_data The user data for user specification + * + * @return The return type (int)\n + * @c 0 indicates that the operation has completed successfully,\n + * else it will return failure and an error code (Refer Doxygen doc or #TapiResult_t) + * + * @pre Initialize the Dbus connection with #tel_init.\n + * Register the telephony event to be listened with #tel_register_noti_event.\n + * An event loop runs to listen to events. + */ +int tel_get_call_privacy_mode(TapiHandle *handle, tapi_response_cb callback, void *user_data); + +/** + * @brief Sets the voice privacy option mode in the phone. It is available only where a call exists. (3GPP2 specific) + * + * @details This function makes a Dbus method call to the Telephony Sever and gets an immediate feedback.\n + * However it just means that the API request has been transfered to the CP successfully.\n + * The actual operation result is being delivered in the corresponding event asynchronously. + * + * Sync (or) Async: This is an Asynchronous API. + * + * Prospective Clients: Embedded call application. + * + * @since_tizen 2.3 + * @privlevel platform + * @privilege %http://tizen.org/privilege/telephony.admin + * + * @param[in] handle The handle from tel_init() + * + * @param[in] PrivacyMode The voice privacy option mode(TapiHandle *handle, ENHANCED or STANDARD) + * + * @param[in] callback To register a callback function for result + * + * @param[in] user_data The user data for user specification + * + * @return The return type (int)\n + * @c 0 indicates that the operation has completed successfully,\n + * else it will return failure and an error code (Refer Doxygen doc or #TapiResult_t) + * + * @pre Initialize the Dbus connection with #tel_init.\n + * Register the telephony event to be listened with #tel_register_noti_event.\n + * An event loop runs to listen to events. + */ +int tel_set_call_privacy_mode(TapiHandle *handle, TelCallPrivacyMode_t PrivacyMode, tapi_response_cb callback, void *user_data); + +/** + * @brief This function is called to set 'preferred' Voice Subscription. + * + * @since_tizen 2.3 + * @privlevel platform + * @privilege %http://tizen.org/privilege/telephony.admin + * + * @param [in] handle + * - handle from tel_init(). + * + * @param [in] preferred_subscription + * - 'preferred' Voice Subscription. + * - Refer #TelCallPreferredVoiceSubs_t for Subscription details + * + * @param [in] callback + * - To register callback function for result. + * + * @param [in] user_data + * - user_data for user specification. + * + * @post + * - None. + * + * @return Return Type (int) \n + * - TAPI_API_SUCCESS - indicating that the operation has completed successfully. \n + * - Refer #TapiResult_t for failure and error code + * + * @par Prospective Clients: + * External Apps. + */ +int tel_set_call_preferred_voice_subscription(TapiHandle *handle, TelCallPreferredVoiceSubs_t preferred_subscription, + tapi_response_cb callback, void *user_data); + +/** + * @brief This function is called to get the 'preferred' Voice Subscription. + * + * @since_tizen 2.3 + * @privlevel public + * @privilege %http://tizen.org/privilege/telephony + * + * @param [in] handle + * - handle from tel_init(). + * + * @param [out] preferred_subscription + * - 'preferred' Voice Subscription. + * - Refer #TelCallPreferredVoiceSubs_t for Subscription details + * + * @post + * - None. + * + * @return Return Type (int) \n + * - TAPI_API_SUCCESS - indicating that the operation has completed successfully. \n + * - Refer #TapiResult_t for failure and error code + * + * @par Prospective Clients: + * External Apps. + */ +int tel_get_call_preferred_voice_subscription(TapiHandle *handle, TelCallPreferredVoiceSubs_t *preferred_subscription); + +#ifdef __cplusplus +} +#endif + +#endif /* _ITAPI_CALL_H_ */ + +/** + * @} + */ diff --git a/include/ITapiModem.h b/include/ITapiModem.h new file mode 100644 index 0000000..742f493 --- /dev/null +++ b/include/ITapiModem.h @@ -0,0 +1,256 @@ +/* + * libslp-tapi + * + * Copyright (c) 2014 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Ja-young Gu + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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 ITapiModem.h + */ + +/** + * @internal + * @addtogroup CAPI_TELEPHONY_SERVICE_MODEM + * @{ + */ + +#ifndef _ITAPI_MODEM_H_ +#define _ITAPI_MODEM_H_ + +#include +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @brief Turns the modem on/off. + * @details Sync (or) Async: This is a Synchronous API. \n + * + * Prospective Clients: External Apps. \n + * + * @since_tizen 2.3 + * @privlevel platform + * @privilege %http://tizen.org/privilege/telephony.admin + * + * @param[in] handle The handle from tel_init() + * @param[in] cmd The index value, which is the power command #tapi_power_phone_cmd_t + * @param[in] callback To register a callback function for result + * @param[in] user_data The user data for user specification + * + * @return The return type (int) \n + * #TAPI_API_SUCCESS indicates that the operation is completed successfully, + * else it provides an error code (Refer #TapiResult_t). + */ +int tel_process_power_command(TapiHandle *handle, tapi_power_phone_cmd_t cmd, tapi_response_cb callback, void *user_data); + +/** + * @brief Switches the flight mode on/off. + * + * @details Sync (or) Async: This is an Asynchronous API. \n + * + * Prospective Clients: External Apps. + * + * @since_tizen 2.3 + * @privlevel platform + * @privilege %http://tizen.org/privilege/telephony.admin + * + * @param[in] handle The handle from tel_init() + * + * @param[in] mode The mode value, which is the flight flag #tapi_power_flight_mode_type_t + * @param[in] callback To register a callback function for result + * @param[in] user_data The user data for user specification + + * @return The return type (int) \n + * #TAPI_API_SUCCESS indicates that the operation is completed successfully, \n + * else it provides an error code (Refer #TapiResult_t). + */ +int tel_set_flight_mode(TapiHandle *handle, tapi_power_flight_mode_type_t mode, tapi_response_cb callback, void *user_data); + +/** + * @brief Gets the flight mode + * + * @since_tizen 2.3 + * @privlevel public + * @privilege %http://tizen.org/privilege/telephony + * + * @param[in] handle The handle from tel_init() + * @param[in] callback To register a callback function for result + * @param[in] user_data The user data for user specification + */ +int tel_get_flight_mode(TapiHandle *handle, tapi_response_cb callback, void *user_data); + +/** + * @brief Gets ME version information. + * + * @details Sync (or) Async: This is a Synchronous API.\n + * + * Prospective Clients: External Apps.\n + * + * @since_tizen 2.3 + * @privlevel public + * @privilege %http://tizen.org/privilege/telephony + * + * @param[in] handle The handle from tel_init() + * @param[in] callback To register a callback function for result + * @param[in] user_data The user data for user specification + * + * @return The return type (int) \n + * Integer '0' ( same with #TAPI_API_SUCCESS ): indicates that the operation is completed successfully \n + * Negative integer : It provides an error code (Refer #TapiResult_t). + */ +int tel_get_misc_me_version(TapiHandle *handle, tapi_response_cb callback, void *user_data); + +/** + * @brief Gets the Misc ME version. + * + * @details Sync (or) Async: This is a Synchronous API.\n + * + * Prospective Clients: External Apps.\n + * + * @since_tizen 2.3 + * @privlevel public + * @privilege %http://tizen.org/privilege/telephony + * + * @param[in] handle The handle from tel_init() + * + * @return The return type ( TelMiscVersionInformation * ) \n + * The Misc Version Information. + */ +TelMiscVersionInformation *tel_get_misc_me_version_sync(TapiHandle *handle); + +/** + * @brief Gets the ME ESN/MEID for each phone type. + * + * @details Sync (or) Async: This is a Synchronous API. \n + * + * Prospective Clients: External Apps. \n + * + * @since_tizen 2.3 + * @privlevel public + * @privilege %http://tizen.org/privilege/telephony + * + * @param[in] handle The handle from tel_init() + * @param[in] callback To register a callback function for result + * @param[in] user_data The user data for user specification + * + * @return The return type (int) \n + * Integer '0' ( same with #TAPI_API_SUCCESS ): indicates that the operation is completed successfully \n + * Negative integer : It provides an error code (Refer #TapiResult_t). + */ +int tel_get_misc_me_sn(TapiHandle *handle, tapi_response_cb callback, void *user_data); + +/** + * @brief Gets the Misc ME Serial Number. + * + * @details Sync (or) Async: This is a Synchronous API. \n + * + * Prospective Clients: Embedded call application. \n + * + * @since_tizen 2.3 + * @privlevel public + * @privilege %http://tizen.org/privilege/telephony + * + * @remarks This function makes a Dbus method call to the Telephony Server and returns an immediate value. + * However it just means that the API request has been transfered to the CP successfully. + * The actual operation result is delivered in the corresponding event asynchronously. + * + * @param[in] handle The handle from tel_init() + * + * @return The return Type (char*) \n + * The Serial Number string. + */ +TelMiscSNInformation *tel_get_misc_me_sn_sync(TapiHandle *handle); + +/** + * @brief Gets the Misc ME IMEI. + * + * @details Sync (or) Async: This is an Asynchronous API.\n + * + * Prospective Clients: External Apps. + * + * @since_tizen 2.3 + * @privlevel public + * @privilege %http://tizen.org/privilege/telephony + * + * @param[in] handle The handle from tel_init() + * @param[in] callback To register a callback function for result + * @param[in] user_data The user data for user specification + * + * @return The return type (int) \n + * Integer '0' ( same with #TAPI_API_SUCCESS ): indicates that the operation is completed successfully \n + * Negative integer : It provides an error code (Refer #TapiResult_t). + */ +int tel_get_misc_me_imei(TapiHandle *handle, tapi_response_cb callback, void *user_data); + +/** + * @brief Gets the Misc ME IMEI. + * + * @details Sync (or) Async: This is a Synchronous API.\n + * + * Prospective Clients: Embedded call application. + * + * @since_tizen 2.3 + * @privlevel public + * @privilege %http://tizen.org/privilege/telephony + * + * @remarks This function makes a Dbus method call to the Telephony Server and returns an immediate value. + * However it just means that the API request has been transfered to the CP successfully. + * The actual operation result is delivered in the corresponding event asynchronously. + * + * @param[in] handle The handle from tel_init() + * + * @return The return type (char*) \n + * The IMEI string. + */ +char *tel_get_misc_me_imei_sync(TapiHandle *handle); + +/** + * @brief Checks the modem power status. + * + * @details Sync (or) Async: This is an Asynchronous API. \n + * + * Prospective Clients: Embedded call application. + * + * @since_tizen 2.3 + * @privlevel public + * @privilege %http://tizen.org/privilege/telephony + * + * @remarks This function makes a Dbus method call to the Telephony Server and returns an immediate value. + * However it just means that the API request has been transfered to the CP successfully. + * The actual operation result is delivered in the corresponding event asynchronously. + * + * @param[in] handle The handle from tel_init() + * @param[out] result The result of checking the modem power status + * + * @return The return type (int) \n + * @c 0 indicates that the operation is completed successfully, \n + * else it will return failure and an error code (Refer Doxygen doc or #TapiResult_t). + */ +int tel_check_modem_power_status(TapiHandle *handle, int *result); + +#ifdef __cplusplus +} +#endif + +#endif /* _ITAPI_MODEM_H_ */ + +/** + * @} + */ diff --git a/include/ITapiNetText.h b/include/ITapiNetText.h new file mode 100644 index 0000000..65db6e7 --- /dev/null +++ b/include/ITapiNetText.h @@ -0,0 +1,462 @@ +/* + * libslp-tapi + * + * Copyright (c) 2014 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Ja-young Gu + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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 ITapiNetText.h + */ + +/** + * @internal + * @addtogroup CAPI_TELEPHONY_SERVICE_SMS + * @{ + */ + +#ifndef _ITAPI_NETTEXT_H_ +#define _ITAPI_NETTEXT_H_ + +#include +#include + +#ifdef __cplusplus +extern "C" +{ +#endif + +/** + * @brief Sends an SMS message to the network. + * + * @details Allows transmitting SMS PDU as defined by 3GPP TS 23.040 (SMS-SUBMIT, SMS-COMMAND) to lower layers.\n + * It allows keeping the dedicated link at lower layers by passing information as messages to send through parameters.\n + * This will enable to avoid releasing a dedicated connection used for transmission. + * + * Sync (or) Async: This is an Asynchronous API. + * + * Prospective Clients: External Apps. + * + * @since_tizen 2.3 + * @privlevel platform + * @privilege %http://tizen.org/privilege/telephony.admin + * + * @remarks Access to this API is limited to in-house applications and Message Framework API(MAPI) is recommended instead. + * + * @param[in] handle The handle from tel_init() + * @param[in] pDataPackage The SMS-SUBMIT TPDU + * @param[in] bMoreMsgToSend If @c true there is more than one message to be sent or a multiple segmented concatenated + * message has to be sent, otherwise @c false \n + * This flag informs OEM that more messages have to be sent + * @param[in] callback To register a callback function for result + * @param[in] user_data The user data for user specification + * + * @return The return type (int) + * #TAPI_API_SUCCESS indicates that the operation is completed successfully, + * else it will return failure and an error code (Refer #TapiResult_t) + */ +int tel_send_sms(TapiHandle *handle, const TelSmsDatapackageInfo_t *pDataPackage, int bMoreMsgToSend, tapi_response_cb callback, void* user_data); + +/** + * @brief Reads a message from the SIM card storage. + * + * @details The SIM index (index used when storing the SMS) is the number to be passed in order + * to read a particular SMS message. Total number of messages can be retrieved by tel_get_sms_count function. + * + * Sync (or) Async: This is an Asynchronous API. + * + * Prospective Clients: External Apps. + * + * @since_tizen 2.3 + * @privlevel public + * @privilege %http://tizen.org/privilege/telephony + * + * @remarks Access to this API is limited to in-house applications and Message Framework API(MAPI) is recommended instead. + * + * @param[in] handle The handle from tel_init() + * @param[in] read_index The index number of the message to be read + * @param[in] callback To register a callback function for result + * @param[in] user_data The user data for user specification + * + * @return The return type (int) + * #TAPI_API_SUCCESS indicates that the operation is completed successfully, + * else it will return failure and an error code (Refer #TapiResult_t) + */ +int tel_read_sms_in_sim(TapiHandle *handle, int read_index, tapi_response_cb callback, void* user_data); + +/** + * @brief Writes a message to the SIM storage area. + * + * @details Sync (or) Async: This is an Asynchronous API. + * + * Prospective Clients: External Apps. + * + * @since_tizen 2.3 + * @privlevel platform + * @privilege %http://tizen.org/privilege/telephony.admin + * + * @remarks Access to this API is limited to in-house applications and Message Framework API(MAPI) is recommended instead. + * + * @param[in] handle The handle from tel_init() + * @param[in] pWriteData The SMS message structure + * @param[in] callback To register a callback function for result + * @param[in] user_data The user data for user specification + * + * @return The return type (int) + * #TAPI_API_SUCCESS indicates that the operation is completed successfully, + * else it will return failure and an error code (Refer #TapiResult_t) + */ +int tel_write_sms_in_sim(TapiHandle *handle, const TelSmsData_t *pWriteData, tapi_response_cb callback, void* user_data); + +/** + * @brief Deletes the message specified by an index (SIM index used when storing the SMS) + * number from the SIM storage area. + * + * @details Sync (or) Async: This is an Asynchronous API. + * + * Prospective Clients: External Apps. + * + * @since_tizen 2.3 + * @privlevel platform + * @privilege %http://tizen.org/privilege/telephony.admin + * + * @remarks Access to this API is limited to in-house applications and Message Framework API(MAPI) is recommended instead. + * + * @param[in] handle The handle from tel_init() + * @param[in] del_index The message index to delete + * @param[in] callback To register a callback function for result + * @param[in] user_data The user data for user specification + * + * @return The return type (int) + * #TAPI_API_SUCCESS indicates that the operation is completed successfully, + * else it will return failure and an error code (Refer #TapiResult_t) + */ +int tel_delete_sms_in_sim(TapiHandle *handle, int del_index, tapi_response_cb callback, void* user_data); + +/** + * @brief Retrieves message count information like total record count, + * used record count, and indices list for SIM storage. + * + * @details Sync (or) Async: This is an Asynchronous API. + * + * Prospective Clients: External Apps. + * + * @since_tizen 2.3 + * @privlevel public + * @privilege %http://tizen.org/privilege/telephony + * + * @remarks This is an asynchronous function and the response will be sent back in the callback function. + * Access to this API is limited to in-house applications and Message Framework API(MAPI) is recommended instead. + * + * @param[in] handle The handle from tel_init() + * @param[in] callback To register a callback function for result + * @param[in] user_data The user data for user specification + * + * @return The return type (int) + * #TAPI_API_SUCCESS indicates that the operation is completed successfully, + * else it will return failure and an error code (Refer #TapiResult_t) + */ +int tel_get_sms_count(TapiHandle *handle, tapi_response_cb callback, void* user_data); + +/** + * @brief Sets SMS CB Message Identifiers in the appropriate EF-CBMI/EF-CBMIR file in the (U)SIM. + * + * @details This function also indicates an underlying provider to enable or disable the CB Channel on which CB messages are received. + * + * Sync (or) Async: This is an Asynchronous API. + * + * Prospective Clients: External Apps. + * + * @since_tizen 2.3 + * @privlevel platform + * @privilege %http://tizen.org/privilege/telephony.admin + * + * @remarks Access to this API is limited to in-house applications and Message Framework API(MAPI) is recommended instead. + * @a pCBConfig contains parameters to set the SMS CB configuration. + * (i) Cell broadcast service state. (Enabled/disabled.) + * (ii) Cell broadcast message identifier, which denotes whether all cell broadcast message identifiers are selected or only some of them. + * (iii) The list count of message identifiers to be set. + * (iv) The actual list of message identifiers to be set. Each identifier occupies 2 bytes. And the list ranges from 0x00 to 0xff. + * These message identifiers denote the source and type of the CB message. Based on the message identifiers set in the SIM, + * the ME receives CB messages with selected message identifiers. + * + * @param[in] handle The handle from tel_init() + * @param[in] pCBConfig The parameters of the SMS CB configuration + * @param[in] callback To register a callback function for result + * @param[in] user_data The user data for user specification + * + * @return The return type (int) + * #TAPI_API_SUCCESS indicates that the operation is completed successfully, + * else it will return failure and an error code (Refer #TapiResult_t) + */ +int tel_set_sms_cb_config(TapiHandle *handle, const TelSmsCbConfig_t *pCBConfig, tapi_response_cb callback, void* user_data); + +/** + * @brief Retrieves the SMS CB configuration parameters from the EFcbmi file in the SIM. + * + * @details Sync (or) Async: This is an Asynchronous API. + * + * Prospective Clients: External Apps. + * + * @since_tizen 2.3 + * @privlevel public + * @privilege %http://tizen.org/privilege/telephony + * + * @remarks Access to this API is limited to in-house applications and Message Framework API(MAPI) is recommended instead. + * + * @param[in] handle The handle from tel_init() + * @param[in] callback To register a callback function for result + * @param[in] user_data The user data for user specification + * + * @return The return type (int) + * #TAPI_API_SUCCESS indicates that the operation is completed successfully, + * else it will return failure and an error code (Refer #TapiResult_t) + */ +int tel_get_sms_cb_config(TapiHandle *handle, tapi_response_cb callback, void* user_data); + +/** + * @brief Gets the SMS parameters for a particular SMS (sent/received) + * based on the SIM index where it is stored. + * + * @details Sync (or) Async: This is an Asynchronous API. + * + * Prospective Clients: External Apps. + * + * @since_tizen 2.3 + * @privlevel public + * @privilege %http://tizen.org/privilege/telephony + * + * @remarks Access to this API is limited to in-house applications and Message Framework API(MAPI) is recommended instead. + * + * @param[in] handle The handle from tel_init() + * @param[in] get_index The SIM index where the SMS is stored + * @param[in] callback To register a callback function for result + * @param[in] user_data The user data for user specification + * + * @return The return type (int) + * #TAPI_API_SUCCESS indicates that the operation is completed successfully, + * else it will return failure and an error code (Refer #TapiResult_t) + */ +int tel_get_sms_parameters(TapiHandle *handle, int get_index, tapi_response_cb callback, void* user_data); + +/** + * @brief Sets the short message service header parameters which are used in the origination of MO messages. + * + * @details Sync (or) Async: This is an Asynchronous API. + * + * Important Notes: This API updates/sets SMS Parameters in the EFsmsp file in the SIM storage. + * + * Prospective Clients: External Apps. + * + * @since_tizen 2.3 + * @privlevel platform + * @privilege %http://tizen.org/privilege/telephony.admin + * + * @remarks Access to this API is limited to in-house applications and Message Framework API(MAPI) is recommended instead. + * @a pSmsSetParameters contains SMS header parameters information like: service center address, + * destination address, validity period, protocol identifier, and data coding scheme. + * + * @param[in] handle The handle from tel_init() + * + * @param[in] pSmsSetParameters The SMS header parameters information + * @param[in] callback To register a callback function for result + * @param[in] user_data The user data for user specification + * + * @return The return type (int) + * #TAPI_API_SUCCESS indicates that the operation is completed successfully, + * else it will return failure and an error code (Refer #TapiResult_t) + */ +int tel_set_sms_parameters(TapiHandle *handle, const TelSmsParams_t *pSmsSetParameters, tapi_response_cb callback, void* user_data); + +/** + * @brief Sends a delivery report for the received incoming SMS to the network. + * + * @details Sync (or) Async: This is an Asynchronous API. + * + * Prospective Clients: External Apps. + * + * @since_tizen 2.3 + * @privlevel platform + * @privilege %http://tizen.org/privilege/telephony.admin + * + * @remarks Access to this API is limited to in-house applications. + * + * @param[in] handle The handle from tel_init() + * @param[in] pDataPackage The SMS Data package + * @param[in] RPCause The reason for SMS-DELIVER failure + * @param[in] callback To register a callback function for result + * @param[in] user_data The user data for user specification + * + * @return The return type (int) + * #TAPI_API_SUCCESS indicates that the operation has completed successfully, + * else it will return failure and an error code (Refer #TapiResult_t) + * + * @pre The SMS-DELIVER-REPORT message structure should be in the TPDU format as specified by 3GPP TS 23.040 SMS TPDU. + */ +int tel_send_sms_deliver_report(TapiHandle *handle, const TelSmsDatapackageInfo_t *pDataPackage, TelSmsResponse_t RPCause, tapi_response_cb callback, void* user_data); + +/** + * @brief Sets SMS Service Centre Address information in order to send the SMS. + * + * @details Sync (or) Async: This is an Asynchronous API. + * + * Important Notes: This API updates/sets the service center address in the EFsmsp file in the SIM storage. + * + * Prospective Clients: External Apps. + * + * @since_tizen 2.3 + * @privlevel platform + * @privilege %http://tizen.org/privilege/telephony.admin + * + * @remarks Access to this API is limited to in-house applications and Message Framework API(MAPI) is recommended instead. + * + * @param[in] handle The handle from tel_init() + * @param[in] pSCA The service centre address information + * @param[in] sca_index The record index of the Service center address information in the EF + * @param[in] callback To register a callback function for result + * @param[in] user_data The user data for user specification + * + * @return The return type (int) + * #TAPI_API_SUCCESS indicates that the operation is completed successfully, + * else it will return failure and an error code (Refer #TapiResult_t) + */ +int tel_set_sms_sca(TapiHandle *handle, const TelSmsAddressInfo_t *pSCA, int sca_index, tapi_response_cb callback, void* user_data); + +/** + * @brief Gets current SMS Service Centre Address information. + * + * @details Sync (or) Async: This is an Asynchronous API. + * + * Prospective Clients: External Apps. + * + * @since_tizen 2.3 + * @privlevel public + * @privilege %http://tizen.org/privilege/telephony + * + * @remarks Access to this API is limited to in-house applications and Message Framework API(MAPI) is recommended instead. + * + * @param[in] handle The handle from tel_init() + * @param[in] sca_index The record index of the Service center address information in the SIM EF + * @param[in] callback To register a callback function for result + * @param[in] user_data The user data for user specification + * + * @return The return type (int) + * #TAPI_API_SUCCESS indicates that the operation is completed successfully, + * else it will return failure and an error code (Refer #TapiResult_t) + */ +int tel_get_sms_sca(TapiHandle *handle, int sca_index, tapi_response_cb callback, void* user_data); + +/** + * @brief Informs a modem about the memory status of the PDA (whether FULL or AVAILABLE) so that the modem can inform the network. + * + * @details Sync (or) Async: This is an Asynchronous API. + * + * Prospective Clients: External Apps. + * + * @since_tizen 2.3 + * @privlevel platform + * @privilege %http://tizen.org/privilege/telephony.admin + * + * @remarks Access to this API is limited to in-house applications. + * + * @param[in] handle The handle from tel_init() + * @param[in] memoryStatus The Memory Status + * @param[in] callback To register a callback function for result + * @param[in] user_data The user data for user specification + * + * @return The return type (int) + * #TAPI_API_SUCCESS indicates that the operation is completed successfully, + * else it will return failure and an error code (Refer #TapiResult_t) + */ +int tel_set_sms_memory_status(TapiHandle *handle, int memoryStatus, tapi_response_cb callback, void* user_data); + +/** + * @brief Sets the message status in the SIM EF. + * + * @details Sync (or) Async: This is an Asynchronous API. + * + * Prospective Clients: External Apps. + * + * @since_tizen 2.3 + * @privlevel platform + * @privilege %http://tizen.org/privilege/telephony.admin + * + * @remarks Access to this API is limited to in-house applications and Message Framework API(MAPI) is recommended instead. + * + * @param[in] handle The handle from tel_init() + * @param[in] set_index The index of the message whose status has to be set + * @param[in] msgStatus The status of the message to be set + * @param[in] callback To register a callback function for result + * @param[in] user_data The user data for user specification + * + * @return The return type (int) + * #TAPI_API_SUCCESS indicates that the operation is completed successfully, + * else it will return failure and an error code (Refer #TapiResult_t) + */ +int tel_set_sms_message_status(TapiHandle *handle, int set_index, TelSmsMsgStatus_t msgStatus, tapi_response_cb callback, void* user_data); + +/** + * @brief Gets the count of the SMS parameter records stored in the SIM EF. + * + * @details Sync (or) Async: This is an Asynchronous API. + * + * Prospective Clients: External Apps. + * + * @since_tizen 2.3 + * @privlevel public + * @privilege %http://tizen.org/privilege/telephony + * + * @remarks Access to this API is limited to in-house applications. + * + * @param[in] handle The handle from tel_init() + * @param[in] callback To register a callback function for result + * @param[in] user_data The user data for user specification + * + * @return The return type (int) + * #TAPI_API_SUCCESS indicates that the operation is completed successfully, + * else it will return failure and an error code (Refer #TapiResult_t) + */ +int tel_get_sms_parameter_count(TapiHandle *handle, tapi_response_cb callback, void* user_data); + +/** + * @brief Checks the SMS ready status (whether ready or not). + * + * @details Sync (or) Async: This is a Synchronous API. + * + * Prospective Clients: External Apps. + * + * @since_tizen 2.3 + * @privlevel public + * @privilege %http://tizen.org/privilege/telephony + * + * @param[in] handle The handle from tel_init() + * @param[out] pReadyStatus The Ready Status + * + * @return The return type (int) + * #TAPI_API_SUCCESS indicates that the operation is completed successfully, + * else it will return failure and an error code (Refer #TapiResult_t) + */ +int tel_check_sms_device_status(TapiHandle *handle, int *pReadyStatus); + +#ifdef __cplusplus +} +#endif + +#endif /* _ITAPI_NETTEXT_H_ */ + +/** + * @} + */ diff --git a/include/ITapiNetwork.h b/include/ITapiNetwork.h new file mode 100644 index 0000000..9b695bc --- /dev/null +++ b/include/ITapiNetwork.h @@ -0,0 +1,526 @@ +/* + * libslp-tapi + * + * Copyright (c) 2014 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Ja-young Gu + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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 ITapiNetwork.h + */ + +/** + * @internal + * @addtogroup CAPI_TELEPHONY_SERVICE_NETWORK + * @{ + */ + +#ifndef _ITAPI_NETWORK_H_ +#define _ITAPI_NETWORK_H_ + +#include +#include + +#ifdef __cplusplus +extern "C" +{ +#endif + +/** + * @brief Requests the lower layers to select the network automatically. + * + * @details Sync (or) Async: This is an Asynchronous API. \n + * + * Prospective Clients: External Apps.\n + * + * This function makes a Dbus method call to the Telephony Server and returns an immediate value. + * However it just means that the API request has been transferred to the CP successfully. + * The actual operation result is delivered in the corresponding event asynchronously. + * + * @since_tizen 2.3 + * @privlevel platform + * @privilege %http://tizen.org/privilege/telephony.admin + * + * @param[in] handle The handle from tel_init() + * + * @param[in] callback To register a callback function for result + * + * @param[in] user_data The user data for user specification + * + * @return The return type (int)\n + * #TAPI_API_SUCCESS indicates that the operation is completed successfully\n + * Refer #TapiResult_t for failure and an error code. + * + * @pre Initialize the Dbus connection with #tel_init. + */ +int tel_select_network_automatic(TapiHandle *handle, tapi_response_cb callback, void *user_data); + +/** + * @brief Requests the lower layers to select the network (PLMN) which has been selected by the user from the Network List displayed to the user. + * + * @details Sync (or) Async: This is an Asynchronous API. \n + * + * Prospective Clients: External Apps.\n + * + * This function makes a Dbus method call to the Telephony Server and returns an immediate value. + * However it just means that the API request has been transferred to the CP successfully. + * The actual operation result is delivered in the corresponding event asynchronously. + * + * @since_tizen 2.3 + * @privlevel platform + * @privilege %http://tizen.org/privilege/telephony.admin + * + * @param[in] handle The handle from tel_init() + * + * @param[in] plmn The user selected PLMN + * + * @param[in] act The user selected Access Technology + * + * @param[in] callback To register a callback function for result + * + * @param[in] user_data The user data for user specification + * + * @return The return type (int)\n + * #TAPI_API_SUCCESS indicates that the operation is completed successfully\n + * Refer #TapiResult_t for failure and an error code. + * + * @pre Initialize the Dbus connection with #tel_init. + */ +int tel_select_network_manual(TapiHandle *handle, const char *plmn, int act, tapi_response_cb callback, void *user_data); + +/** + * @brief Sends a request to do manual search for the available networks and provides the Network List to the User/Application. + * + * @details Sync (or) Async: This is an Asynchronous API. \n + * + * Prospective Clients: External Apps.\n + * + * This function makes a Dbus method call to the Telephony Server and returns an immediate value. + * However it just means that the API request has been transferred to the CP successfully. + * The actual operation result is delivered in the corresponding event asynchronously. + * + * @since_tizen 2.3 + * @privlevel platform + * @privilege %http://tizen.org/privilege/telephony.admin + * + * @param[in] handle The handle from tel_init() + * + * @param[in] callback To register a callback function for result + * + * @param[in] user_data The user data for user specification + * + * @return The return type (int)\n + * #TAPI_API_SUCCESS indicates that the operation is completed successfully\n + * Refer #TapiResult_t for failure and an error code. + * + * @pre Initialize the Dbus connection with #tel_init. + * + * @post In the available network list, the user can select one of the networks successfully. + */ +int tel_search_network(TapiHandle *handle, tapi_response_cb callback, void *user_data); + +/** + * @brief Gets the present network selection mode i.e. automatic or manual. + * + * @details Sync (or) Async: This is an Asynchronous API. \n + * + * Prospective Clients: External Apps.\n + * + * This function makes a Dbus method call to the Telephony Server and returns an immediate value. + * However it just means that the API request has been transferred to the CP successfully. + * The actual operation result is delivered in the corresponding event asynchronously. + * + * @since_tizen 2.3 + * @privlevel public + * @privilege %http://tizen.org/privilege/telephony + * + * @param[in] handle The handle from tel_init() + * + * @param[in] callback To register a callback function for the result + * + * @param[in] user_data The user data for user specification + * + * @return The return type (int)\n + * #TAPI_API_SUCCESS indicates that the operation is completed successfully\n + * Refer #TapiResult_t for failure and an error code. + * + * @pre Initialize the Dbus connection with #tel_init. + */ +int tel_get_network_selection_mode(struct tapi_handle *handle, tapi_response_cb callback, void *user_data); + +/** + * @brief Sets the network preferred PLMN. + * + * @details Sync (or) Async: This is an Asynchronous API. \n + * + * Prospective Clients: External Apps. \n + * + * This function makes a Dbus method call to the Telephony Server and returns an immediate value. + * However it just means that the API request has been transferred to the CP successfully. + * The actual operation result is delivered in the corresponding event asynchronously. + * + * @since_tizen 2.3 + * @privlevel platform + * @privilege %http://tizen.org/privilege/telephony.admin + * + * @param[in] handle The handle from tel_init() + * + * @param[in] operation The operation to be done on the preferred PLMN + * + * @param[in] info The PLMN Info + * + * @param[in] callback To register a callback function for result + * + * @param[in] user_data The user data for user specification + * + * @return The return type (int)\n + * #TAPI_API_SUCCESS indicates that the operation is completed successfully\n + * Refer #TapiResult_t for failure and an error code. + * + * @pre Initialize the Dbus connection with #tel_init. + */ +int tel_set_network_preferred_plmn(TapiHandle *handle, TelNetworkPreferredPlmnOp_t operation, + TelNetworkPreferredPlmnInfo_t *info, tapi_response_cb callback, void *user_data); + +/** + * @brief Gets the preferred PLMN list. + * + * @details Sync (or) Async: This is an Asynchronous API. \n + * + * Prospective Clients: External Apps. \n + * + * This function makes a Dbus method call to the Telephony Server and returns an immediate value. + * However it just means that the API request has been transferred to the CP successfully. + * The actual operation result is delivered in the corresponding event asynchronously. + * + * @since_tizen 2.3 + * @privlevel public + * @privilege %http://tizen.org/privilege/telephony + * + * @param[in] handle The handle from tel_init() + * + * @param[in] callback To register a callback function for result + * + * @param[in] user_data The user data for user specification + * + * @return The return type (int)\n + * #TAPI_API_SUCCESS indicates that the operation is completed successfully\n + * Refer #TapiResult_t for failure and an error code. + * + * @pre Initialize the Dbus connection with #tel_init. + */ +int tel_get_network_preferred_plmn(TapiHandle *handle, tapi_response_cb callback, void *user_data); + +/** + * @brief Cancels the triggered manual network search. + * + * @details Sync (or) Async: This is an Asynchronous API. \n + * + * Prospective Clients: External Apps. + * + * @since_tizen 2.3 + * @privlevel platform + * @privilege %http://tizen.org/privilege/telephony.admin + * + * @param[in] handle The handle from tel_init() + * + * @param[in] callback To register a callback function for result + * + * @param[in] user_data The user data for user specification + * + * @return The return type (int)\n + * #TAPI_API_SUCCESS indicates that the operation is completed successfully\n + * Refer #TapiResult_t for failure and an error code. + */ +int tel_cancel_network_manual_search(TapiHandle *handle, tapi_response_cb callback, void *user_data); + +/** + * @brief Gets network serving information. + * + * @details Sync (or) Async: This is an Asynchronous API. \n + * + * Prospective Clients: External Apps. + * + * @since_tizen 2.3 + * @privlevel public + * @privilege %http://tizen.org/privilege/telephony + * + * @param[in] handle The handle from tel_init() + * + * @param[in] callback To register a callback function for result + * + * @param[in] user_data The user data for user specification + * + * @return The return type (int)\n + * #TAPI_API_SUCCESS indicates that the operation is completed successfully\n + * Refer #TapiResult_t for failure and an error code. + */ +int tel_get_network_serving(TapiHandle *handle, tapi_response_cb callback, void *user_data); + +/** + * @brief Sets the network mode. + * + * @details Sync (or) Async: This is an Asynchronous API. \n + * + * Prospective Clients: External Apps. + * + * @since_tizen 2.3 + * @privlevel platform + * @privilege %http://tizen.org/privilege/telephony.admin + * + * @param[in] handle The handle from tel_init() + * + * @param[in] mode The network mode (GSM only or WCDMA only or Automatic) + * + * @param[in] callback To register a callback function for result + * + * @param[in] user_data The user data for user specification + * + * @return The return type (int)\n + * #TAPI_API_SUCCESS - indicates that the operation is completed successfully\n + * Refer #TapiResult_t for failure and an error code. + */ +int tel_set_network_mode(TapiHandle *handle, int mode, tapi_response_cb callback, void *user_data); + +/** + * @brief Gets the network mode. + * + * @details Sync (or) Async: This is an Asynchronous API. \n + * + * Prospective Clients: External Apps. + * + * @since_tizen 2.3 + * @privlevel public + * @privilege %http://tizen.org/privilege/telephony + * + * @param[in] handle The handle from tel_init() + * + * @param[in] callback To register a callback function for result + * + * @param[in] user_data The user data for user specification + * + * @return The return type (int)\n + * #TAPI_API_SUCCESS indicates that the operation is completed successfully\n + * Refer #TapiResult_t for failure and an error code. + */ +int tel_get_network_mode(TapiHandle *handle, tapi_response_cb callback, void *user_data); + +/** + * @brief Gets neighboring cell info. + * + * @details Sync (or) Async: This is an Asynchronous API.\n + * + * Prospective Clients: External Apps. + * + * @since_tizen 2.3 + * @privlevel public + * @privilege %http://tizen.org/privilege/telephony + * + * @param[in] handle The handle from tel_init() + * + * @param[in] callback To register a callback function for result + * + * @param[in] user_data The user data for user specification + * + * @return The return type (int)\n + * #TAPI_API_SUCCESS indicates that the operation is completed successfully\n + * Refer #TapiResult_t for failure and an error code. + */ +int tel_get_network_neighboring_cell_info(TapiHandle *handle, tapi_response_cb callback, void *user_data); + +/** + * @brief Enters or exits the emergency callback mode. + * + * @details Sync (or) Async: This is an Asynchronous API. \n + * + * Prospective Clients: External Apps. + * + * @since_tizen 2.3 + * @privlevel platform + * @privilege %http://tizen.org/privilege/telephony.admin + * + * @param[in] handle The handle from tel_init() + * + * @param[in] mode The emergency callback mode (Enter or Exit) + * + * @param[in] callback To register a callback function for result + * + * @param[in] user_data The user data for user specification + * + * @return The return type (int)\n + * #TAPI_API_SUCCESS indicates that the operation is completed successfully\n + * Refer #TapiResult_t for failure and an error code. + */ +int tel_set_network_emergency_callback_mode(TapiHandle *handle, TelNetworkEmergencyCallbackMode_t mode, + tapi_response_cb callback, void *user_data); + +/** + * @brief Sets the network roaming preference. + * + * @details Sync (or) Async: This is an Asynchronous API. \n + * + * Prospective Clients: External Apps. + * + * @since_tizen 2.3 + * @privlevel platform + * @privilege %http://tizen.org/privilege/telephony.admin + * + * @param[in] handle The handle from tel_init() + * + * @param [in] roam_pref The network roaming preference (AUTOMATIC, HOME_ONLY, ROAM_ONLY) + * + * @param[in] callback To register a callback function for result + * + * @param[in] user_data The user data for user specification + * + * @return The return type (int)\n + * #TAPI_API_SUCCESS indicates that the operation is completed successfully\n + * Refer #TapiResult_t for failure and an error code. + */ +int tel_set_network_roaming_preference(TapiHandle *handle, TelNetworkPrefNetType_t roam_pref, tapi_response_cb callback, void *user_data); + +/** + * @brief Gets the network roaming preference. + * + * @details Sync (or) Async: This is an Asynchronous API. \n + * + * Prospective Clients: External Apps. + * + * @since_tizen 2.3 + * @privlevel public + * @privilege %http://tizen.org/privilege/telephony + * + * @param[in] handle The handle from tel_init() + * + * @param[in] callback To register a callback function for result + * + * @param[in] user_data The user data for user specification + * + * @return The return type (int)\n + * #TAPI_API_SUCCESS indicates that the operation is completed successfully\n + * Refer #TapiResult_t for failure and an error code. + */ +int tel_get_network_roaming_preference(TapiHandle *handle, tapi_response_cb callback, void *user_data); + +/** + * @brief Sets the Subscription (related to #TapiHandle) as 'default' Data Subscription. + * + * @since_tizen 2.3 + * @privlevel platform + * @privilege %http://tizen.org/privilege/telephony.admin + * + * @param[in] handle The handle from tel_init() + * + * @param[in] callback To register a callback function for result + * + * @param[in] user_data The user data for user specification + * + * @post None. + * + * @return The return type (int)\n + * #TAPI_API_SUCCESS indicates that the operation has completed successfully\n + * Refer #TapiResult_t for failure and an error code. + * + * @par Prospective Clients: External Apps. + */ +int tel_set_network_default_data_subscription(TapiHandle *handle, tapi_response_cb callback, void *user_data); + +/** + * @brief Gets the Subscription which is configured as 'default' Data Subscription. + * + * @since_tizen 2.3 + * @privlevel public + * @privilege %http://tizen.org/privilege/telephony + * + * @param[in] handle The handle from tel_init() + * + * @param[out] The default subscription + * - 'default' Data Subscription. + * - Refer #TelNetworkDefaultDataSubs_t for Subscription details. + * + * @post None. + * + * @return The return type (int)\n + * #TAPI_API_SUCCESS indicates that the operation has completed successfully\n + * Refer #TapiResult_t for failure and an error code. + * + * @par Prospective Clients: External Apps. + */ +int tel_get_network_default_data_subscription(TapiHandle *handle, TelNetworkDefaultDataSubs_t *default_subscription); + +/** + * @brief This function is called to set the Subscription (related to #TapiHandle) as 'default' Subscription for CS (Voice). + * + * @since_tizen 2.3 + * @privlevel platform + * @privilege %http://tizen.org/privilege/telephony.admin + * + * @param [in] handle + * - handle from tel_init(). + * + * @param [in] callback + * - To register callback function for result. + * + * @param [in] user_data + * - user_data for user specification. + * + * @post + * - None. + * + * @return Return Type (int) \n + * - TAPI_API_SUCCESS - indicating that the operation has completed successfully. \n + * - Refer #TapiResult_t for failure and error code + * + * @par Prospective Clients: + * External Apps. + */ +int tel_set_network_default_subscription(TapiHandle *handle, tapi_response_cb callback, void *user_data); + +/** + * @brief This function is called to get the Subscription which is configured as 'default' Subscription for CS (Voice). + * + * @since_tizen 2.3 + * @privlevel public + * @privilege %http://tizen.org/privilege/telephony + * + * @param [in] handle + * - handle from tel_init(). + * + * @param [out] default_subscription + * - 'default' Subscription for CS (Voice). + * - Refer #TelNetworkDefaultSubs_t for Subscription details + * + * @post + * - None. + * + * @return Return Type (int) \n + * - TAPI_API_SUCCESS - indicating that the operation has completed successfully. \n + * - Refer #TapiResult_t for failure and error code + * + * @par Prospective Clients: + * External Apps. + */ +int tel_get_network_default_subscription(TapiHandle *handle, TelNetworkDefaultSubs_t *default_subscription); + +#ifdef __cplusplus +} +#endif + +#endif /* _ITAPI_NETWORK_H_ */ + +/** + * @} + */ diff --git a/include/ITapiPhonebook.h b/include/ITapiPhonebook.h new file mode 100644 index 0000000..70e6ef9 --- /dev/null +++ b/include/ITapiPhonebook.h @@ -0,0 +1,294 @@ +/* + * libslp-tapi + * + * Copyright (c) 2014 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Ja-young Gu + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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 ITapiPhonebook.h + */ + +/** + * @internal + * @addtogroup CAPI_TELEPHONY_SERVICE_PHONEBOOK + * @{ + */ + +#ifndef _ITAPI_PHONEBOOK_H_ +#define _ITAPI_PHONEBOOK_H_ + +#include +#include + +#ifdef __cplusplus +extern "C" +{ +#endif + +/** + * @brief Gets the current inserted SIM phonebook init status, available phonebook list, and first valid index in case of FDN, ADN, and 3G phonebook. + * + * @details Access to this API is limited to in-house applications and phonebook-engine APIs are recommended instead. \n + * + * Sync (or) Async: This is a synchronous API. \n + * + * Prospective Clients: External Apps. \n + * + * @since_tizen 2.3 + * @privlevel public + * @privilege %http://tizen.org/privilege/telephony + * + * @remarks You must use phonebook-engine APIs to handle a phonebook (including SIM phonebook). + * If a user uses SIM phonebook related APIs directly, it can break device phonebook consistency because of all the phonebook information managed in the phonebook-engine. + * The @a pb_list and @a first_index value are available when the @a init_completed status is '1' only. + * + * @param[in] handle The handle from tel_init() + * + * @param[out] init_completed The phonebook init status to use - '0' is not init, '1' is init complete + * + * @param[out] pb_list The available SIM phonebook list; this value is valid in the phonebook init complete case + * + * @return The return type (int)\n + * Integer '0' ( same with #TAPI_API_SUCCESS ) - indicates that the operation is completed successfully\n + * Negative integer - It provides an error code (Refer #TapiResult_t). + */ +int tel_get_sim_pb_init_info(TapiHandle *handle, int *init_completed, TelSimPbList_t *pb_list); + +/** + * @brief Gets the number of used records and total records of a specific SIM phonebook type. + * + * @details Access to this API is limited to in-house applications and phonebook-engine APIs are recommended instead. \n + * This function makes a Dbus method call to the Telephony Server and returns an immediate value. + * However it just means that the API request has been transfered to the CP successfully. + * The actual operation result is delivered in the corresponding event asynchronously. + * + * Sync (or) Async: This is an Asynchronous API. \n + * + * Prospective Clients: External Apps. + * + * @since_tizen 2.3 + * @privlevel public + * @privilege %http://tizen.org/privilege/telephony + * + * @remarks You must use phonebook-engine APIs to handle a phonebook(including SIM phonebook). + * If the user uses SIM phonebook related APIs directly, it can break device phonebook consistency because of all the phonebook information managed in the phonebook-engine. + * + * @param[in] handle The handle from tel_init() + * + * @param[in] pb_type The different storage types to be selected in the SIM; #TelSimPbType_t + * + * @param[in] callback To register a callback function for result + * + * @param[in] user_data The user data for user specification + * + * @return The return type (int)\n + * Integer '0' ( same with #TAPI_API_SUCCESS ) - indicates that the operation is completed successfully\n + * Negative integer - It provides an error code (Refer #TapiResult_t). + * + * @pre Initialize the Dbus connection with #tel_init. + */ +int tel_get_sim_pb_count(TapiHandle *handle, TelSimPbType_t pb_type, tapi_response_cb callback, void *user_data); + +/** + * @brief Gets the max text length and max number length supported by the SIM phone book elementary file. + * + * @details Access to this API is limited to in-house applications and phonebook-engine APIs are recommended instead. \n + * This function makes a Dbus method call to the Telephony Server and returns an immediate value. + * However it just means that the API request has been transfered to the CP successfully. + * The actual operation result is being delivered in the corresponding event asynchronously. + * + * Sync (or) Async: This is an Asynchronous API. \n + * + * Prospective Clients: External Apps. + * + * @since_tizen 2.3 + * @privlevel public + * @privilege %http://tizen.org/privilege/telephony + * + * @remarks The max number length includes the storage space provided by the corresponding EXT file for a given Dialling Number file.\n + * You must use phonebook-engine APIs to handle a phonebook(including SIM phonebook). + * If a user uses SIM phonebook related APIs directly, it can break device phonebook consistency because of all the phonebook information managed in the phonebook-engine. + * + * @param[in] handle The handle from tel_init() + * + * @param[in] pb_type The different storage types to be selected in the SIM; #TelSimPbType_t + * + * @param[in] callback To register a callback function for result + * + * @param[in] user_data The user data for user specification + * + * @return The return type (int)\n + * Integer '0' ( same with #TAPI_API_SUCCESS ) - indicates that the operation is completed successfully \n + * Negative integer : It provides an error code (Refer #TapiResult_t). + * + * @pre Initialize the Dbus connection with #tel_init. + */ +int tel_get_sim_pb_meta_info(TapiHandle *handle, TelSimPbType_t pb_type, tapi_response_cb callback, void *user_data); + +/** + * @brief Gets SIM 3G phonebook supported EFs like ANR, SNE, GRP, EMAIL and the corresponding EFs max text length, number length, and size. + * + * @details Access to this API is limited to in-house applications and phonebook-engine APIs are recommended instead. \n + * This function makes a Dbus method call to the Telephony Server and returns an immediate value. + * However, it just means that the API request has been transferred to the CP successfully. + * The actual operation result is delivered in the corresponding event asynchronously. + * + * Sync (or) Async: This is an Asynchronous API. \n + * + * Prospective Clients: External Apps. + * + * @since_tizen 2.3 + * @privlevel public + * @privilege %http://tizen.org/privilege/telephony + * + * @remarks You must use phonebook-engine APIs to handle a phonebook (including SIM phonebook). + * If a user uses SIM phonebook related APIs directly, it can break device phonebook consistency because of all the phonebook information managed in the phonebook-engine. + * + * @param[in] handle The handle from tel_init() + * + * @param[in] callback To register a callback function for result + * + * @param[in] user_data The user data for user specification + * + * @return The return type (int)\n + * Integer '0' ( same with #TAPI_API_SUCCESS ) - indicates that the operation is completed successfully\n + * Negative integer : It provides an error code (Refer #TapiResult_t). + * + * @pre Initialize Dbus connection with #tel_init\n + */ +int tel_get_sim_pb_usim_meta_info(TapiHandle *handle, tapi_response_cb callback, void *user_data); + +/** + * @brief Reads SIM phone book entry information from the given storage type and index. + * + * @details Access to this API is limited to in-house applications and phonebook-engine APIs are recommended instead. \n + * This function makes a Dbus method call to the Telephony Server and returns an immediate value. + * However it just means that the API request has been transfered to the CP successfully. + * The actual operation result is being delivered in the corresponding event asynchronously. + * + * Sync (or) Async: This is an Asynchronous API. \n + * + * Prospective Clients: External Apps. + * + * @since_tizen 2.3 + * @privlevel public + * @privilege %http://tizen.org/privilege/telephony + * + * @remarks The index ranges from 1 to a maximum of 254 for a Linear fixed file and 255 for a cyclic file.\n + * You must use phonebook-engine APIs to handle a phonebook (including SIM phonebook). + * If a user uses SIM phonebook related APIs directly, it can break device phonebook consistency because of all the phonebook information managed in the phonebook-engine. + * + * @param[in] handle The handle from tel_init() + * + * @param[in] pb_type The different storage types to be selected in the SIM; #TelSimPbType_t + * + * @param[in] pb_index The index for accessing the SIM data + * + * @param[in] callback To register a callback function for result + * + * @param[in] user_data The user data for user specification + * + * @return The return type (int)\n + * Integer '0' ( same with #TAPI_API_SUCCESS ) - indicates that the operation is completed successfully\n + * Negative integer : It provides an error code (Refer #TapiResult_t) + * + * @pre Initialize the Dbus connection with #tel_init. + */ +int tel_read_sim_pb_record(TapiHandle *handle, TelSimPbType_t pb_type, unsigned short pb_index, tapi_response_cb callback, void *user_data); + +/** + * @brief Adds or edits SIM phone book record entry information. + * + * @details Access to this API is limited to in-house applications and phonebook-engine APIs are recommended instead. \n + * This function makes a Dbus method call to the Telephony Server and returns an immediate value. + * However it just means that the API request has been transfered to the CP successfully. + * The actual operation result is delivered in the corresponding event asynchronously. \n + * + * Sync (or) Async: This is an Asynchronous API. \n + * + * Prospective Clients: External Apps. \n + * + * @since_tizen 2.3 + * @privlevel platform + * @privilege %http://tizen.org/privilege/telephony.admin + * + * @remarks You must use phonebook-engine APIs to handle a phonebook (including SIM phonebook). + * If a user uses SIM phonebook related APIs directly, it can break device phonebook consistency because of all the phonebook information managed in the phonebook-engine. + * + * @param[in] handle The handle from tel_init() + * + * @param[in] req_data The phonebook data to be updated or added; #TelSimPbRecord_t + * + * @param[in] callback To register a callback function for result + * + * @param[in] user_data The user data for user specification + * + * @return The return type (int)\n + * Integer '0' ( same with #TAPI_API_SUCCESS ) - indicates that the operation is completed successfully\n + * Negative integer : It provides an error code (Refer #TapiResult_t). + * + * @pre Initialize the Dbus connection with #tel_init. + */ +int tel_update_sim_pb_record(TapiHandle *handle, const TelSimPbRecord_t *req_data, tapi_response_cb callback, void *user_data); + +/** + * @brief Deletes a SIM phonebook record. + * + * @details Access to this API is limited to in-house applications and phonebook-engine APIs are recommended instead. \n + * This function makes a Dbus method call to the Telephony Server and returns an immediate value. + * However it just means that the API request has been transfered to the CP successfully. + * The actual operation result is delivered in the corresponding event asynchronously. + * + * Sync (or) Async: This is an Asynchronous API. \n + * + * Prospective Clients: External Apps. + * + * @since_tizen 2.3 + * @privlevel platform + * @privilege %http://tizen.org/privilege/telephony.admin + * + * @remarks The index ranges from 1 to a maximum of 254 for a Linear fixed file and 255 for a cyclic file.\n + * You must use phonebook-engine APIs to handle a phonebook(including SIM phonebook). + * If the user uses SIM phonebook related APIs directly, it can break device phonebook consistency because of all the phonebook information managed in the phonebook-engine. + * + * @param[in] handle The handle from tel_init() + * + * @param[in] pb_type The different storage types to be selected in the SIM; #TelSimPbType_t + * + * @param[in] pb_index The index of the record to be deleted + * + * @param[in] callback To register a callback function for result + * + * @param[in] user_data The user data for user specification + * + * @return The return type (int)\n + * Integer '0' ( same with #TAPI_API_SUCCESS ) - indicates that the operation is completed successfully\n + * Negative integer : (It provides an error code (Refer #TapiResult_t). + * + * @pre Initialize the Dbus connection with #tel_init. + */ +int tel_delete_sim_pb_record(TapiHandle *handle, TelSimPbType_t pb_type, unsigned short pb_index, tapi_response_cb callback, void *user_data); + +#ifdef __cplusplus +} +#endif + +#endif /* _ITAPI_PHONEBOOK_H_ */ + +/** +* @} +*/ diff --git a/include/ITapiSap.h b/include/ITapiSap.h new file mode 100644 index 0000000..a047bb7 --- /dev/null +++ b/include/ITapiSap.h @@ -0,0 +1,222 @@ +/* + * libslp-tapi + * + * Copyright (c) 2014 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Ja-young Gu + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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 ITapiSap.h + */ + +/** + * @internal + * @addtogroup CAPI_TELEPHONY_SERVICE_SAP + * @{ + */ + +#ifndef _ITAPI_SAP_H_ +#define _ITAPI_SAP_H_ + +#include +#include + +#ifdef __cplusplus +extern "C" +{ +#endif + +/** + * @brief Requests to connect SAP. + * + * @details Sync (or) Async: This is an Asynchronous API.\n + * + * Prospective Clients: External Apps. + * + * @since_tizen 2.3 + * @privlevel platform + * @privilege %http://tizen.org/privilege/telephony.admin + * + * @param[in] handle The handle from tel_init() + * @param[in] max_msg_size The maximum message size + * @param[in] callback To register a callback function for result + * @param[in] user_data The user data for user specification + * + * @return The return type (int) \n + * Integer '0' ( same with #TAPI_API_SUCCESS ): indicates that the operation has completed successfully \n + * Negative integer : It provides an error code (Refer #TapiResult_t). + */ +int tel_req_sap_connect(TapiHandle *handle, int max_msg_size, tapi_response_cb callback, void *user_data); + +/** + * @brief Requests to disconnect SAP. + * + * @details Sync (or) Async: This is an Asynchronous API.\n + * + * Prospective Clients: External Apps. + * + * @since_tizen 2.3 + * @privlevel platform + * @privilege %http://tizen.org/privilege/telephony.admin + * + * @param[in] handle The handle from tel_init() + * @param[in] callback To register a callback function for result + * @param[in] user_data The user data for user specification + * + * @return The return type (int) \n + * Integer '0' ( same with #TAPI_API_SUCCESS ): indicates that the operation has completed successfully \n + * Negative integer : It provides an error code (Refer #TapiResult_t). + */ +int tel_req_sap_disconnect(TapiHandle *handle, tapi_response_cb callback, void *user_data); + +/** + * @brief Requests for the SAP connection status. + * + * @details Sync (or) Async: This is an Asynchronous API.\n + * + * Prospective Clients: External Apps. + * + * @since_tizen 2.3 + * @privlevel platform + * @privilege %http://tizen.org/privilege/telephony.admin + * + * @param[in] handle The handle from tel_init() + * @param[in] callback To register a callback function for result + * @param[in] user_data The user data for user specification + * + * @return The return type (int) \n + * Integer '0' ( same with #TAPI_API_SUCCESS ): indicates that the operation has completed successfully \n + * Negative integer : It provides an error code (Refer #TapiResult_t). + */ +int tel_req_sap_connection_status(TapiHandle *handle, tapi_response_cb callback, void *user_data); + +/** + * @brief Requests to get atr. + * + * @details Sync (or) Async: This is an Asynchronous API.\n + * + * Prospective Clients: External Apps. + * + * @since_tizen 2.3 + * @privlevel platform + * @privilege %http://tizen.org/privilege/telephony.admin + * + * @param[in] handle The handle from tel_init() + * @param[in] callback To register a callback function for result + * @param[in] user_data The user data for user specification + * + * @return The return type (int) \n + * Integer '0' ( same with #TAPI_API_SUCCESS ): indicates that the operation has completed successfully \n + * Negative integer : It provides an error code (Refer #TapiResult_t). + */ +int tel_req_sap_transfer_atr(TapiHandle *handle, tapi_response_cb callback, void *user_data); + +/** + * @brief Requests to transfer APDU. + * + * @details Sync (or) Async: This is an Asynchronous API.\n + * + * Prospective Clients: External Apps. + * + * @since_tizen 2.3 + * @privlevel platform + * @privilege %http://tizen.org/privilege/telephony.admin + * + * @param[in] handle The handle from tel_init() + * @param[in] apdu_data The APDU data + * @param[in] callback To register a callback function for result + * @param[in] user_data The user data for user specification + * + * @return The return type (int) \n + * Integer '0' ( same with #TAPI_API_SUCCESS ): indicates that the operation has completed successfully \n + * Negative integer : It provides an error code (Refer #TapiResult_t). + */ +int tel_req_sap_transfer_apdu(TapiHandle *handle, TelSapApduData_t *apdu_data, tapi_response_cb callback, void *user_data); + +/** + * @brief Requests to transport protocol. + * + * @details Sync (or) Async: This is an Asynchronous API.\n + * + * Prospective Clients: External Apps. + * + * @since_tizen 2.3 + * @privlevel platform + * @privilege %http://tizen.org/privilege/telephony.admin + * + * @param[in] handle The handle from tel_init() + * @param[in] protocol The SAP transport protocol type + * @param[in] callback To register a callback function for result + * @param[in] user_data The user data for user specification + * + * @return The return type (int)\n + * Integer '0' ( same with #TAPI_API_SUCCESS ): indicates that the operation has completed successfully\n + * Negative integer : It provides an error code (Refer #TapiResult_t). + */ +int tel_req_sap_transport_protocol(TapiHandle *handle, TelSimSapProtocol_t protocol, tapi_response_cb callback, void *user_data); + +/** + * @brief Requests to control power mode. + * + * @details Sync (or) Async: This is an Asynchronous API.\n + * + * Prospective Clients: External Apps. + * + * @since_tizen 2.3 + * @privlevel platform + * @privilege %http://tizen.org/privilege/telephony.admin + * + * @param[in] handle The handle from tel_init() + * @param[in] power_mode The data to control the power mode of client + * @param[in] callback To register a callback function for result + * @param[in] user_data The user data for user specification + * + * @return The return type (int) \n + * Integer '0' ( same with TAPI_API_SUCCESS ): indicates that the operation has completed successfully \n + * Negative integer : It provides an error code (Refer #TapiResult_t). + */ +int tel_req_sap_power_operation(TapiHandle *handle, TelSimSapPowerMode_t power_mode, tapi_response_cb callback, void *user_data); + +/** + * @brief Requests to get the card reader status. + * + * @details Sync (or) Async: This is an Asynchronous API.\n + * + * Prospective Clients: External Apps. + * + * @since_tizen 2.3 + * @privlevel platform + * @privilege %http://tizen.org/privilege/telephony.admin + * + * @param[in] handle The handle from tel_init() + * @param[in] callback To register a callback function for result + * @param[in] user_data The user data for user specification + * + * @return The return type (int) \n + * Integer '0' ( same with #TAPI_API_SUCCESS ): indicates that the operation has completed successfully \n + * Negative integer : It provides an error code (Refer #TapiResult_t). + */ +int tel_req_sap_cardreader_status(TapiHandle *handle, tapi_response_cb callback, void *user_data); + +#ifdef __cplusplus +} +#endif + +#endif /* _ITAPI_SAP_H_ */ + +/** + * @} + */ diff --git a/include/ITapiSat.h b/include/ITapiSat.h new file mode 100644 index 0000000..b6dc22a --- /dev/null +++ b/include/ITapiSat.h @@ -0,0 +1,264 @@ +/* + * libslp-tapi + * + * Copyright (c) 2014 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Ja-young Gu + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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 ITapiSat.h + */ + +/** + * @internal + * @addtogroup CAPI_TELEPHONY_SERVICE_SAT + * @{ + */ + +#ifndef _ITAPI_SAT_H_ +#define _ITAPI_SAT_H_ + +#include +#include + +#ifdef __cplusplus +extern "C" +{ +#endif + +/** + * @brief Sends the user choice of the main menu options to the USIM. + * + * @details Notes: + * A set of possible menu options are supplied by the USIM + * using the proactive command SET UP MENU. The telephony server receives the command + * and publishes this information. The SAT UI application should list the menu when it is initially launched. + * If the user subsequently chooses an option, then the SAT UI application replies to + * the command with the user's choice using this API. \n + * + * This API makes a Dbus method call to the Telephony Server and gets an immediate feedback. + * However it just means that the API request has been transfered to the CP successfully. + * The actual operation result is delivered with the async response as below. \n + * + * Sync (or) Async: This is an Asynchronous API. \n + * + * Prospective Clients: SAT-UI. + * + * @since_tizen 2.3 + * @privlevel platform + * @privilege %http://tizen.org/privilege/telephony.admin + * + * @remarks You must not use this function. This function is dedicated to the SAT UI embedded application only. + * + * @param[in] handle The handle from tel_init() + * + * @param[in] pMenuSelect #TelSatMenuSelectionReqInfo_t contains information like which SAT menu item has been selected or whether help is required + * + * @param[in] callback To register a callback function for result + * + * @param[in] user_data The user data for user specification + * + * @return The return type (int)\n + * #TAPI_API_SUCCESS - indicates that the operation has completed successfully,\n + * else it will return failure and an error code (Refer #TapiResult_t). + * + * @pre This function is supposed to be called after getting the #TAPI_EVENT_SAT_SETUP_MENU_IND event from the telephony server. + * + * @see tel_get_sat_main_menu_info() + */ +int tel_select_sat_menu(TapiHandle *handle, const TelSatMenuSelectionReqInfo_t* pMenuSelect, tapi_response_cb callback, void *user_data); + +/** + * @brief Downloads SAT events to the USIM. + * + * @details Notes: + * A set of events for the terminal to monitor can be supplied by the USIM using the proactive command SET UP EVENT + * LIST. If the USIM has sent this command, and an event which is part of the list subsequently occurs, the terminal + * informs the USIM using this function, relevant for that event. + * If the USIM commands to monitor a browser termination event, the SAT-UI application has to call this function. \n + * + * This API makes a Dbus method call to the Telephony Server and gets an immediate feedback. + * However it just means that the API request has been transfered to the CP successfully. + * The actual operation result is delivered with the async response as below. \n + * + * Sync (or) Async: This is an Asynchronous API. \n + * + * Prospective Clients: SAT-UI \n + * + * @since_tizen 2.3 + * @privlevel platform + * @privilege %http://tizen.org/privilege/telephony.admin + * + * @remarks You must not use this function. This function is dedicated to the SAT UI embedded application only. + * + * @param[in] handle The handle from tel_init() + * + * @param[in] pEventData #TelSatEventDownloadReqInfo_t contains the necessary parameters like event types and information associated with it + * + * @param[in] callback To register a callback function for result + * + * @param[in] user_data The user data for user specification + * + * @return The return type (int) \n + * #TAPI_API_SUCCESS - indicates that the operation is completed successfully, \n + * else it will return failure and an error code (Refer #TapiResult_t). + * + * @pre A SET UP EVENT LIST proactive command supplies a set of events to monitor. + */ +int tel_download_sat_event(TapiHandle *handle, const TelSatEventDownloadReqInfo_t* pEventData, tapi_response_cb callback, void *user_data); + +/** + * @brief Sends the UI display status of the alpha identifier of a specific proactive command to the Telephony Server. + * + * @details When SAT-UI receives a proactive command, SAT-UI should draw a UI for the relevant command. + * As it completes, SAT-UI informs the USIM by calling this function. Afterwards, the USIM is getting ready to send another command. \n + * + * This function makes a Dbus method call to the Telephony Server and gets an immediate feedback. \n + * + * Sync (or) Async: This is a Synchronous API. \n + * + * Prospective Clients: SAT-UI \n + * + * @since_tizen 2.3 + * @privlevel platform + * @privilege %http://tizen.org/privilege/telephony.admin + * + * @remarks You must not use this function. This function is dedicated to the SAT UI embedded application only. + * + * @param[in] handle The handle from tel_init() + * + * @param[in] commandId The proactive command ID from the application + * + * @param[in] status #TelSatUiDisplayStatusType_t contains the display status(SUCCESS/FAIL) + * + * @return The return type (int)\n + * #TAPI_API_SUCCESS - indicates that the operation has completed successfully,\n + * else it will return failure and an error code (Refer #TapiResult_t). + * + * @pre The display request for the alpha identifier of a Proactive Command should be sent by the Telephony Server. + * + * @post If the display status is SUCCESS, the Telephony Server sends a request to the application for Proactive Command Execution. + * If the display status is FAIL, the Telephony Server sends a Terminal Response for the Proactive Command. + */ +int tel_send_sat_ui_display_status(TapiHandle *handle, int commandId, TelSatUiDisplayStatusType_t status); + +/** + * @brief Sends UI User confirmation data for a specific Proactive Command to the Telephony Server. + * + * @details In case the proactive commands need user response, SAT-UI can send it using this function. + * The response can be 'OK', 'Cancel', 'Move Back', and 'End Session'. Upon this response, the USIM can send + * a proactive command subsequently to indicate the next UI action. \n + * + * This function makes a Dbus method call to the Telephony Server and gets an immediate feedback. \n + * + * Sync (or) Async: This is a synchronous API. \n + * + * Prospective Clients: SAT-UI. \n + * + * @since_tizen 2.3 + * @privlevel platform + * @privilege %http://tizen.org/privilege/telephony.admin + * + * @remarks You must not use this function. This function is dedicated to the SAT UI embedded application only. + * + * @param[in] handle The handle from tel_init() + * + * @param[in] pUserConfirmData #TelSatUiUserConfirmInfo_t contains specific user confirmation data + * + * @return The return type (int)\n + * #TAPI_API_SUCCESS - indicates that the operation has completed successfully,\n + * else it will return failure and an error code (Refer #TapiResult_t). + * + * @pre The User Confirmation request for a specific Proactive Command should be sent to the application by the Telephony Server. + * + * @post If the User Confirmation is positive, the Telephony Server sends a request to the application for Proactive Command Execution. + * If the User Confirmation is negative, the Telephony Server sends a Terminal Response for the Proactive Command. + */ +int tel_send_sat_ui_user_confirm(TapiHandle *handle, TelSatUiUserConfirmInfo_t *pUserConfirmData); + +/** + * @brief Provides SAT(Sim Application toolkit) Main Menu information for SAT-UI. + * + * @details Once the USIM supplies the SET UP MENU proactive command, the telephony server not only publishes the + * #TAPI_EVENT_SAT_SETUP_MENU_IND event but also caches the menu information. + * The SAT-UI application can get the menu list using this function. \n + * + * This function makes a Dbus method call to the Telephony Server and gets an immediate feedback. \n + * + * Sync (or) Async: This is a Synchronous API. \n + * + * Prospective Clients: SAT-UI. + * + * @since_tizen 2.3 + * @privlevel public + * @privilege %http://tizen.org/privilege/telephony + * + * @remarks You must not use this function. This function is dedicated to the SAT UI embedded application only. + * + * @param[in] handle The handle from tel_init() + * + * @param[out] pMainMenu #TelSatSetupMenuInfo_t contains all menu related information which is required such as a menu title, an icon, an item count, and so on + * + * @return The return type (int)\n + * #TAPI_API_SUCCESS - indicates that the operation has completed successfully,\n + * else it will return failure and an error code (Refer #TapiResult_t). + * + * @pre When SAT SIM is inserted we can get meaningful data. Without SAT SIM, null is returned. + * + * @see tel_select_sat_menu() + */ +int tel_get_sat_main_menu_info(TapiHandle *handle, TelSatSetupMenuInfo_t *pMainMenu); + +/** + * @brief Provides the Operation result(s) for Proactive Command execution by the Application(s) to the Telephony Server. + * + * @details The USIM commands the terminal to do some predefined action, such as sending a short message, + * making a voice call, launching an Internet browser, and so on. Those actions are defined by 3GPP TS31.111. + * Once an application executes the requested action by USIM, it reports the operation result to the USIM using this function. \n + * + * This function makes a Dbus method call to the Telephony Server and gets an immediate feedback. \n + * + * Sync (or) Async: This is a Synchronous API. \n + * + * Prospective Clients: Embeded applications which are predefined by 3GPP TS31.111. + * + * @since_tizen 2.3 + * @privlevel platform + * @privilege %http://tizen.org/privilege/telephony.admin + * + * @remarks You must not use this function. This function is dedicated to the SAT UI embedded application only. + * + * @param[in] handle The handle from tel_init() + * + * @param[out] pAppRetInfo #TelSatAppsRetInfo_t contains an execution result of a specific proactive command by the application + * + * @return The return type (int)\n + * #TAPI_API_SUCCESS - indicates that the operation has completed successfully,\n + * else it will return failure and an error code (Refer #TapiResult_t). + * + * @pre The Proactive Command execution request should be sent by the Telephony Server to SAT related applications. + */ +int tel_send_sat_app_exec_result(TapiHandle *handle, TelSatAppsRetInfo_t *pAppRetInfo); + +#ifdef __cplusplus +} +#endif + +#endif /* _ITAPI_SAT_H_ */ + +/** + * @} + */ diff --git a/include/ITapiSim.h b/include/ITapiSim.h new file mode 100644 index 0000000..0b9ae60 --- /dev/null +++ b/include/ITapiSim.h @@ -0,0 +1,916 @@ +/* + * libslp-tapi + * + * Copyright (c) 2014 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Ja-young Gu + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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 _ITAPI_SIM_H_ +#define _ITAPI_SIM_H_ + +/** + * @file ITapiSim.h + */ + +/** + * @internal + * @addtogroup CAPI_TELEPHONY_SERVICE_SIM + * @{ + */ + +#include +#include + +#ifdef __cplusplus +extern "C" +{ +#endif + +/** + * @brief Gets SIM card initialization status and SIM card identification. + * @details Most of the modules which require SIM data should definitely check SIM status before using it.\n + * + * Sync (or) Async: This is a Synchronous API.\n + * + * Prospective Clients: External Apps. + * + * @since_tizen 2.3 + * @privlevel public + * @privilege %http://tizen.org/privilege/telephony + * + * @remarks Card identification value is available in case of #TAPI_SIM_STATUS_SIM_INIT_COMPLETED only. + * + * @param[in] handle The handle from tel_init() + * + * @param[out] sim_status The SIM initialization status from the Telephony server boot up time \n + * First, you can find SIM existence if the returned value is not in #TAPI_SIM_STATUS_CARD_NOT_PRESENT and #TAPI_SIM_STATUS_CARD_REMOVED. + * + * @param[out] card_changed The SIM card identification value when @a sim_status is #TAPI_SIM_STATUS_SIM_INIT_COMPLETED \n + * The @a card_changed value is present when the current inserted SIM card differs from the previous SIM. + * + * @return The return type (int) + * Integer '0' ( same with #TAPI_API_SUCCESS & #TAPI_SIM_ACCESS_SUCCESS ) - indicates that the operation has completed successfully + * Negative integer : It provides an error code before actual operations (Refer #TapiResult_t) + * Positive integer : It provides an error code during actual operations (Refer #TelSimAccessResult_t) + */ +int tel_get_sim_init_info(TapiHandle *handle, TelSimCardStatus_t *sim_status, int *card_changed); + +/** + * @brief Gets the card type (SIM/USIM). + * @details Sync (or) Async: This is a Synchronous API.\n + * + * Prospective Clients: External Apps. + * + * @since_tizen 2.3 + * @privlevel public + * @privilege %http://tizen.org/privilege/telephony + * + * @param[in] handle The handle from tel_init() + * + * @param[out] card_type The SIM card type information such as GSM SIM card, USIM, and other unknown types + * TAPI_SIM_CARD_TYPE_UNKNOWN + * TAPI_SIM_CARD_TYPE_GSM + * TAPI_SIM_CARD_TYPE_USIM + * + * @return The return type (int) + * Integer '0' ( same with #TAPI_API_SUCCESS & #TAPI_SIM_ACCESS_SUCCESS ) - indicates that the operation is completed successfully + * Negative integer : It provides an error code before actual operations (Refer #TapiResult_t) + * Positive integer : It provides an error code while actual operations (Refer #TelSimAccessResult_t) + */ +int tel_get_sim_type(TapiHandle *handle, TelSimCardType_t *card_type); + +/** + * @brief Gets IMSI information. + * @details Sync (or) Async: This is a Synchronous API.\n + * + * Prospective Clients: External Apps. + * + * @since_tizen 2.3 + * @privlevel public + * @privilege %http://tizen.org/privilege/telephony + * + * @remarks IMSI value is the value that security requires. + * + * @param[in] handle The handle from tel_init() + * + * @param[out] imsi The IMSI information \n + * Refer #TelSimImsiInfo_t. + * + * @return The return type (int) + * Integer '0' ( same with #TAPI_API_SUCCESS & #TAPI_SIM_ACCESS_SUCCESS ) - indicates that the operation has completed successfully + * Negative integer : It provides an error code before actual operations (Refer #TapiResult_t) + * Positive integer : It provides an error code during actual operations (Refer #TelSimAccessResult_t) + * + * @pre The user can get valid return values or make operations after SIM init completes(card status is #TAPI_SIM_STATUS_SIM_INIT_COMPLETED). + */ +int tel_get_sim_imsi(TapiHandle *handle, TelSimImsiInfo_t *imsi); + +/** + * @brief Gets ECC(SIM) or UECC(USIM) data. + * @details Sync (or) Async: This is a Synchronous API.\n + * + * Prospective Clients: External Apps. + * + * @since_tizen 2.3 + * @privlevel public + * @privilege %http://tizen.org/privilege/telephony + * + * @param[in] handle The handle from tel_init() + * + * @param[out] ecc The SIM emergency call code information like ECC length, service type, and the number of ECC records + * + * @return The return type (int) + * Integer '0' ( same with #TAPI_API_SUCCESS & #TAPI_SIM_ACCESS_SUCCESS ) - indicates that the operation has completed successfully + * Negative integer : It provides an error code before actual operations (Refer #TapiResult_t) + * Positive integer : It provides an error code during actual operations (Refer #TelSimAccessResult_t) + * + * @pre The user can get valid return values or make operations after SIM init completes(card status is #TAPI_SIM_STATUS_SIM_INIT_COMPLETED). + */ +int tel_get_sim_ecc(TapiHandle *handle, TelSimEccList_t *ecc); + +/** + * @brief Gets the unique identification number of the (U)ICC. + * @details ICC means Integrated Circuit Card.\n + * + * Sync (or) Async: This is an Asynchronous API.\n + * + * Prospective Clients: External Apps. + * + * @since_tizen 2.3 + * @privlevel public + * @privilege %http://tizen.org/privilege/telephony + * + * @remarks ICC number value is the value that security needs. + * + * @param[in] handle The handle from tel_init() + * + * @param[in] callback To register a callback function for result + * + * @param[in] user_data The user data for user specification + * + * @return The return type (int) + * Integer '0' ( same with #TAPI_API_SUCCESS & #TAPI_SIM_ACCESS_SUCCESS ) - indicates that the operation is completed successfully + * Negative integer : It provides an error code before actual operations (Refer #TapiResult_t) + * Positive integer : It provides an error code during actual operations (Refer #TelSimAccessResult_t) + * + * @pre The user can get valid return values or make operations after SIM init completes(card status is #TAPI_SIM_STATUS_SIM_INIT_COMPLETED). + */ +int tel_get_sim_iccid(TapiHandle *handle, tapi_response_cb callback, void *user_data); + +/** + * @brief Gets language preference(indication) information. + * @details Sync (or) Async: This is an Asynchronous API.\n + * + * Prospective Clients: External Apps. + * + * @since_tizen 2.3 + * @privlevel public + * @privilege %http://tizen.org/privilege/telephony + * + * @param[in] handle The handle from tel_init() + * + * @param[in] callback To register a callback function for result + * + * @param[in] user_data The user data for user specification + * + * @return The return type (int) + * Integer '0' ( same with #TAPI_API_SUCCESS & #TAPI_SIM_ACCESS_SUCCESS ) - indicates that the operation has completed successfully + * Negative integer : It provides an error code before actual operations (Refer #TapiResult_t) + * Positive integer : It provides an error code during actual operations (Refer #TelSimAccessResult_t) + * + * @pre The user can get valid return values or make operations after SIM init completes(card status is #TAPI_SIM_STATUS_SIM_INIT_COMPLETED). + */ +int tel_get_sim_language(TapiHandle *handle, tapi_response_cb callback, void *user_data); + +/** + * @brief Updates language preference information to the SIM card. + * + * @details This function makes a Dbus method call to the Telephony Server and returns an immediate value. + * However it just means that the API request has been transfered to the CP successfully. + * The actual operation result is being delivered in the corresponding event asynchronously.\n + * + * Sync (or) Async: This is an Asynchronous API.\n + * + * Prospective Clients: External Apps. + * + * @since_tizen 2.3 + * @privlevel platform + * @privilege %http://tizen.org/privilege/telephony.admin + * + * @remarks This function updates SIM Language information directly and can have an effect on the device language setting. Use carefully. + * + * @param[in] handle The handle from tel_init() + * + * @param[in] language The language preference information + * + * @param[in] callback To register a callback function for result + * + * @param[in] user_data The user data for user specification + * + * @return The return type (int) + * Integer '0' ( same with #TAPI_API_SUCCESS & #TAPI_SIM_ACCESS_SUCCESS ) - indicates that the operation has completed successfully + * Negative integer : It provides an error code before actual operations (Refer #TapiResult_t) + * Positive integer : It provides an error code during actual operations (Refer #TelSimAccessResult_t) + */ +int tel_set_sim_language(TapiHandle *handle, TelSimLanguagePreferenceCode_t language, tapi_response_cb callback, void *user_data); + +/** + * @brief Gets SIM call forwarding indication related data(EF-CFIS and CPHS case). + * @details This data is required for Call forwarding related functionality in the handset.\n + * + * Sync (or) Async: This is an Asynchronous API.\n + * + * Prospective Clients: External Apps. + * + * @since_tizen 2.3 + * @privlevel public + * @privilege %http://tizen.org/privilege/telephony + * + * @param[in] handle The handle from tel_init() + * + * @param[in] callback To register a callback function for result + * + * @param[in] user_data The user data for user specification + * + * @return The return type (int) + * Integer '0' ( same with #TAPI_API_SUCCESS & #TAPI_SIM_ACCESS_SUCCESS ) - indicates that the operation has completed successfully + * Negative integer : It provides an error code before actual operations (Refer #TapiResult_t) + * Positive integer : It provides an error code during actual operations (Refer #TelSimAccessResult_t) + * + * @pre The user can get valid return values or make operations after SIM init completes(card status is #TAPI_SIM_STATUS_SIM_INIT_COMPLETED). + */ +int tel_get_sim_callforwarding_info(TapiHandle *handle, tapi_response_cb callback, void *user_data); + +/** + * @brief Sets SIM call forwarding indication related data(EF-CFIS and CPHS case). + * @details This data is required for Call forwarding related functionality in the handset.\n + * + * Sync (or) Async: This is an Asynchronous API.\n + * + * Prospective Clients: External Apps. + * + * @since_tizen 2.3 + * @privlevel platform + * @privilege %http://tizen.org/privilege/telephony.admin + * + * @param[in] handle The handle from tel_init() + * + * @param[in] req_cf The data requesting for call forwarding + * + * @param[in] callback To register a callback function for result + * + * @param[in] user_data The user data for user specification + * + * @return The return type (int) + * Integer '0' ( same with #TAPI_API_SUCCESS & #TAPI_SIM_ACCESS_SUCCESS ) - indicates that the operation has completed successfully + * Negative integer : It provides an error code before actual operations (Refer #TapiResult_t) + * Positive integer : It provides an error code during actual operations (Refer #TelSimAccessResult_t) + * + * @pre The user can get valid return values or make operations after SIM init completes(card status is #TAPI_SIM_STATUS_SIM_INIT_COMPLETED). + */ +int tel_set_sim_callforwarding_info(TapiHandle *handle, TelSimCallForwardingReq_t *req_cf, tapi_response_cb callback, void *user_data); + +/** + * @brief Gets SIM message waiting indication related data(EF-MWIS and CPHS case). + * @details This data is required for Message waiting related functionality in the handset.\n + * + * Sync (or) Async: This is an Asynchronous API.\n + * + * Prospective Clients: External Apps. + * + * @since_tizen 2.3 + * @privlevel public + * @privilege %http://tizen.org/privilege/telephony + * + * @param[in] handle The handle from tel_init() + * + * @param[in] callback To register a callback function for result + * + * @param[in] user_data The user data for user specification + * + * @return The return type (int) + * Integer '0' ( same with #TAPI_API_SUCCESS & #TAPI_SIM_ACCESS_SUCCESS ) - indicates that the operation has completed successfully + * Negative integer : It provides an error code before actual operations (Refer #TapiResult_t) + * Positive integer : It provides an error code during actual operations (Refer #TelSimAccessResult_t) + * + * @pre The user can get valid return values or make operations after SIM init completes(card status is #TAPI_SIM_STATUS_SIM_INIT_COMPLETED). + */ +int tel_get_sim_messagewaiting_info(TapiHandle *handle, tapi_response_cb callback, void *user_data); + +/** + * @brief Sets SIM message waiting indication related data(EF-MWIS and CPHS case). + * @details This data is required for Message waiting related functionality in the handset.\n + * + * Sync (or) Async: This is an Asynchronous API.\n + * + * Prospective Clients: External Apps. + * + * @since_tizen 2.3 + * @privlevel platform + * @privilege %http://tizen.org/privilege/telephony.admin + * + * @param[in] handle The handle from tel_init() + * + * @param[in] req_mw The data requesting for message waiting + * + * @param[in] callback To register a callback function for result + * + * @param[in] user_data The user data for user specification + * + * @return The return type (int) + * Integer '0' ( same with #TAPI_API_SUCCESS & #TAPI_SIM_ACCESS_SUCCESS ) - indicates that the operation has completed successfully + * Negative integer : It provides an error code before actual operations (Refer #TapiResult_t) + * Positive integer : It provides an error code during actual operations (Refer #TelSimAccessResult_t) + * + * @pre The user can get valid return values or make operations after SIM init completes(card status is #TAPI_SIM_STATUS_SIM_INIT_COMPLETED). + */ +int tel_set_sim_messagewaiting_info(TapiHandle *handle, TelSimMessageWaitingReq_t *req_mw, tapi_response_cb callback, void *user_data); + +/** + * @brief Gets SIM mailbox related data(EF-MBDN, MBDI, and CPHS case). + * @details This data is required for Mailbox related functionality in the handset.\n + * + * Sync (or) Async: This is an Asynchronous API.\n + * + * Prospective Clients: External Apps. + * + * @since_tizen 2.3 + * @privlevel public + * @privilege %http://tizen.org/privilege/telephony + * + * @param[in] handle The handle from tel_init() + * + * @param[in] callback To register a callback function for result + * + * @param[in] user_data The user data for user specification + * + * @return The return type (int) + * Integer '0' ( same with #TAPI_API_SUCCESS & #TAPI_SIM_ACCESS_SUCCESS ) - indicates that the operation has completed successfully + * Negative integer : It provides an error code before actual operations (Refer #TapiResult_t) + * Positive integer : It provides an error code during actual operations (Refer #TelSimAccessResult_t) + * + * @pre The user can get valid return values or make operations after SIM init completes(card status is #TAPI_SIM_STATUS_SIM_INIT_COMPLETED). + */ +int tel_get_sim_mailbox_info(TapiHandle *handle, tapi_response_cb callback, void *user_data); + +/** + * @brief Sets SIM mailbox related data(EF-MBDN, MBDI and CPHS case). + * @details This data is required for Mailbox related functionality in the handset.\n + * + * Sync (or) Async: This is an Asynchronous API.\n + * + * Prospective Clients: External Apps. + * + * @since_tizen 2.3 + * @privlevel platform + * @privilege %http://tizen.org/privilege/telephony.admin + * + * @param[in] handle The handle from tel_init() + * + * @param[in] req_mb The data requesting for mailbox info + * + * @param[in] callback To register a callback function for result + * + * @param[in] user_data The user data for user specification + * + * @return The return type (int) + * Integer '0' ( same with #TAPI_API_SUCCESS & #TAPI_SIM_ACCESS_SUCCESS ) - indicates that the operation has completed successfully + * Negative integer : It provides an error code before actual operations (Refer #TapiResult_t) + * Positive integer : It provides an error code during actual operations (Refer #TelSimAccessResult_t) + * + * @pre The user can get valid return values or make operations after SIM init completes(card status is #TAPI_SIM_STATUS_SIM_INIT_COMPLETED). + */ +int tel_set_sim_mailbox_info(TapiHandle *handle, TelSimMailBoxNumber_t *req_mb, tapi_response_cb callback, void *user_data); + +/** + * @brief Gets SIM CPHS specific data. + * @details This data is required for CPHS related functionality in the handset.\n + * + * Sync (or) Async: This is an Asynchronous API.\n + * + * Prospective Clients: External Apps. + * + * @since_tizen 2.3 + * @privlevel public + * @privilege %http://tizen.org/privilege/telephony + * + * @param[in] handle The handle from tel_init() + * + * @param[in] callback To register a callback function for result + * + * @param[in] user_data The user data for user specification + * + * @return The return type (int) + * Integer '0' ( same with #TAPI_API_SUCCESS & #TAPI_SIM_ACCESS_SUCCESS ) - indicates that the operation has completed successfully + * Negative integer : it provides an error code before actual operations (Refer #TapiResult_t) + * Positive integer : it provides an error code during actual operations (Refer #TelSimAccessResult_t) + * + * @pre The user can get valid return values or make operations after SIM init completes(card status is #TAPI_SIM_STATUS_SIM_INIT_COMPLETED). + */ +int tel_get_sim_cphs_info(TapiHandle *handle, tapi_response_cb callback, void *user_data); + +/** + * @brief Gets the SIM Service Table. + * @details This data is required to know which SIM services are enabled or disabled.\n + * + * Sync (or) Async: This is an Asynchronous API.\n + * + * Prospective Clients: External Apps. + * + * @since_tizen 2.3 + * @privlevel public + * @privilege %http://tizen.org/privilege/telephony + * + * @param[in] handle The handle from tel_init() + * + * @param[in] callback To register a callback function for result + * + * @param[in] user_data The user data for user specification + * + * @return The return type (int) + * Integer '0' ( same with #TAPI_API_SUCCESS & #TAPI_SIM_ACCESS_SUCCESS ) - indicates that the operation has completed successfully + * Negative integer : It provides an error code before actual operations (Refer #TapiResult_t) + * Positive integer : It provides an error code during actual operations (Refer #TelSimAccessResult_t) + * + * @pre The user can get valid return values or make operations after SIM init completes(card status is #TAPI_SIM_STATUS_SIM_INIT_COMPLETED). + */ +int tel_get_sim_service_table(TapiHandle *handle, tapi_response_cb callback, void *user_data); + +/** + * @brief Gets SIM MSISDN data. + * @details Regarding 3GPP specification, the current value is optional.\n + * + * Sync (or) Async: This is an Asynchronous API.\n + * + * Prospective Clients: External Apps. + * + * @since_tizen 2.3 + * @privlevel public + * @privilege %http://tizen.org/privilege/telephony + * + * @param[in] handle The handle from tel_init() + * + * @param[in] callback To register a callback function for result + * + * @param[in] user_data The user data for user specification + * + * @return The return type (int) + * Integer '0' ( same with #TAPI_API_SUCCESS & #TAPI_SIM_ACCESS_SUCCESS ) - indicates that the operation has completed successfully + * Negative integer : It provides an error code before actual operations (Refer #TapiResult_t) + * Positive integer : It provides an error code during actual operations (Refer #TelSimAccessResult_t) + * + * @pre The user can get valid return values or make operations after SIM init completes(card status is #TAPI_SIM_STATUS_SIM_INIT_COMPLETED). + */ +int tel_get_sim_msisdn(TapiHandle *handle, tapi_response_cb callback, void *user_data); + +/** + * @brief Gets SIM OPLMNWACT(Operator controlled PLMN Selector with Access Technology) data. + * @details Regarding 3GPP specification, the current value is optional.\n + * + * Sync (or) Async: This is an Asynchronous API.\n + * + * Prospective Clients: External Apps. + * + * @since_tizen 2.3 + * @privlevel public + * @privilege %http://tizen.org/privilege/telephony + * + * @param[in] handle The handle from tel_init() + * + * @param[in] callback To register a callback function for result + * + * @param[in] user_data The user data for user specification + * + * @return The return type (int) + * Integer '0' ( same with #TAPI_API_SUCCESS & #TAPI_SIM_ACCESS_SUCCESS ) - indicates that the operation has completed successfully + * Negative integer : It provides an error code before actual operations (Refer #TapiResult_t) + * Positive integer : It provides an error code while actual operations (Refer #TelSimAccessResult_t) + * + * @pre The user can get valid return values or make operations after SIM init completes(card status is #TAPI_SIM_STATUS_SIM_INIT_COMPLETED). + */ +int tel_get_sim_oplmnwact(TapiHandle *handle, tapi_response_cb callback, void *user_data); + +/** + * @brief Gets SIM SPN data. + * @details Regarding 3GPP specification, the current value is optional.\n + * + * Sync (or) Async: This is an Asynchronous API.\n + * + * Prospective Clients: External Apps. + * + * @since_tizen 2.3 + * @privlevel public + * @privilege %http://tizen.org/privilege/telephony + * + * @param[in] handle The handle from tel_init() + * + * @param[in] callback To register a callback function for result + * + * @param[in] user_data The user data for user specification + * + * @return The return type (int) + * Integer '0' ( same with #TAPI_API_SUCCESS & #TAPI_SIM_ACCESS_SUCCESS ) - indicates that the operation has completed successfully + * Negative integer : It provides an error code before actual operations (Refer #TapiResult_t) + * Positive integer : It provides an error code during actual operations (Refer #TelSimAccessResult_t) + * + * @pre The user can get valid return value or make operations after SIM init completes(card status is #TAPI_SIM_STATUS_SIM_INIT_COMPLETED). + */ +int tel_get_sim_spn(TapiHandle *handle, tapi_response_cb callback, void *user_data); + +/** + * @brief Gets SIM CPHS NETNAME data. + * @details Sync (or) Async: This is an Asynchronous API.\n + * + * Prospective Clients: External Apps. + * + * @since_tizen 2.3 + * @privlevel public + * @privilege %http://tizen.org/privilege/telephony + * + * @param[in] handle The handle from tel_init() + * + * @param[in] callback To register a callback function for result + * + * @param[in] user_data The user data for user specification + * + * @return The return type (int) + * Integer '0' ( same with #TAPI_API_SUCCESS & #TAPI_SIM_ACCESS_SUCCESS ) - indicates that the operation has completed successfully + * Negative integer : It provides an error code before actual operations (Refer #TapiResult_t) + * Positive integer : It provides an error code during actual operations (Refer #TelSimAccessResult_t) + * + * @pre The user can get valid return values or make operations after SIM init completes(card status is #TAPI_SIM_STATUS_SIM_INIT_COMPLETED). + */ +int tel_get_sim_cphs_netname(TapiHandle *handle, tapi_response_cb callback, void *user_data); + +/** + * @brief Executes an authentication procedure by using SIM. + * + * @details This function makes a Dbus method call to the Telephony Server and returns an immediate value. + * However it just means that the API request has been transfered to the CP successfully. + * The actual operation result is delivered in the corresponding event asynchronously.\n + * This function supports IMS, 3G, and GSM authentication.\n + * + * Sync (or) Async: This is an Asynchronous API.\n + * + * Prospective Clients: External Apps. + * + * @since_tizen 2.3 + * @privlevel platform + * @privilege %http://tizen.org/privilege/telephony.admin + * + * @param[in] handle The handle from tel_init() + * + * @param[in] authentication_data The authentication code to be validated by the ISIM, 3G, and GSM application in the SIM card \n + * Refer #TelSimAuthenticationData_t. + * + * @param[in] callback To register a callback function for result + * + * @param[in] user_data The user data for user specification + * + * @return The return type (int) + * Integer '0' ( same with #TAPI_API_SUCCESS & #TAPI_SIM_ACCESS_SUCCESS ) - indicates that the operation has completed successfully + * Negative integer : It provides an error code before actual operations (Refer #TapiResult_t) + * Positive integer : It provides an error code during actual operations (Refer #TelSimAccessResult_t) + */ +int tel_req_sim_authentication(TapiHandle *handle, TelSimAuthenticationData_t *authentication_data, tapi_response_cb callback, void *user_data); + +/** + * @brief Performs PIN1/PIN2/SIM LOCK verification. + * @details This function performs PIN verification based on the PIN type passed along with @a pin_data:\n + * PIN1 code: The SIM card has its own password to check access permissions.\n + * SIM Lock code: Between Device and SIM card using a SIM password is only available on certain handsets to authorize.\n + * + * This function makes a Dbus method call to the Telephony Server and returns an immediate value. + * However it just means that the API request has been transfered to the CP successfully. + * The actual operation result is delivered in the corresponding event asynchronously. + * + * Sync (or) Async: This is an Asynchronous API. + * + * Prospective Clients: External Apps. + * + * @since_tizen 2.3 + * @privlevel platform + * @privilege %http://tizen.org/privilege/telephony.admin + * + * @remarks If the PIN status (PIN/PUK/SIM LOCK) is blocked, an unsolicited event #TAPI_EVENT_SIM_STATUS_IND will be published to Applications on Device boot time. + * If the PIN status is PUK, you should use #tel_verify_sim_puks instead of this API. + * + * @param[in] handle The handle from tel_init() + * + * @param[in] pin_data The PIN code, entered by the user \n + * You should make all the parameters. + * + * @param[in] callback To register a callback function for result + * + * @param[in] user_data The user data for user specification + * + * @return The return type (int) + * Integer '0' ( same with #TAPI_API_SUCCESS & #TAPI_SIM_ACCESS_SUCCESS ) - indicates that the operation is completed successfully + * Negative integer : It provides an error code before actual operations (Refer #TapiResult_t) + * Positive integer : It provides an error code during actual operations (Refer #TelSimAccessResult_t) + * + * @pre This API is used when #TelSimCardStatus_t is #TAPI_SIM_STATUS_SIM_PIN_REQUIRED or #TAPI_SIM_STATUS_SIM_LOCK_REQUIRED on boot time. + */ +int tel_verifiy_sim_pins(TapiHandle *handle, const TelSimSecPw_t *pin_data, tapi_response_cb callback, void *user_data); + +/** + * @brief Performs PIN1/PIN2 unblocking operation based on PUK information passed along with + * unblock information entered by the user. + * + * @details If you get the SIM card status (#TAPI_SIM_STATUS_SIM_PUK_REQUIRED) using #tel_get_sim_init_info on boot time + * or (#TAPI_SIM_PIN_STATUS_BLOCKED) using #tel_get_sim_facility after normal initialization for a specific operation, + * you may unblock PIN1/PIN2. + * + * This function makes a Dbus method call to the Telephony Server and returns an immediate value. + * However it just means that the API request has been transfered to the CP successfully. + * The actual operation result is delivered in the corresponding event asynchronously. + * + * Sync (or) Async: This is an Asynchronous API. + * + * Prospective Clients: External Apps. + * + * @since_tizen 2.3 + * @privlevel platform + * @privilege %http://tizen.org/privilege/telephony.admin + * + * @remarks If the PIN status (PIN1/PIN2) is blocked, an unsolicited event #TAPI_EVENT_SIM_STATUS_IND + * will be published to Applications on boot time. + * If you exceed the specified number of attempts to unblock PIN, the SIM card will be blocked permanently. + * + * @param[in] handle The handle from tel_init() + * + * @param[in] puk_data The unblocking PIN password #TelSimSecPw_t + * + * @param[in] new_pin_data The PIN password to use after the unblocking operation #TelSimSecPw_t + * + * @param[in] callback To register a callback function for result + * + * @param[in] user_data The user data for user specification + * + * @return The return type (int) + * Integer '0' ( same with #TAPI_API_SUCCESS & #TAPI_SIM_ACCESS_SUCCESS ) - indicates that the operation has completed successfully + * Negative integer : It provides an error code before actual operations (Refer #TapiResult_t) + * Positive integer : It provides an error code during actual operations (Refer #TelSimAccessResult_t) + * + * @pre PIN1 or PIN2 status should be #TAPI_SIM_PIN_STATUS_BLOCKED and Card status should be #TAPI_SIM_STATUS_SIM_PUK_REQUIRED on boot time. + * + * @post After success on unblocking for PIN1 or PIN2, each pin check facility is enabled even if the previous facility is disabled. + */ +int tel_verify_sim_puks(TapiHandle *handle, const TelSimSecPw_t *puk_data, const TelSimSecPw_t *new_pin_data, tapi_response_cb callback, void *user_data); + +/** + * @brief Changes the PIN1/PIN2 code based on the PIN type passed along with old PIN data and new PIN data. + * + * @details This function makes a Dbus method call to the Telephony Server and returns an immediate value. + * However it just means that the API request has been transfered to the CP successfully. + * The actual operation result is delivered in the corresponding event asynchronously. + * + * Sync (or) Async: This is an Asynchronous API. + * + * Prospective Clients: External Apps. + * + * @since_tizen 2.3 + * @privlevel platform + * @privilege %http://tizen.org/privilege/telephony.admin + * + * @remarks The user should set the same PIN type for both @a old_pin and @a new_pin. + * + * @param[in] handle The handle from tel_init() + * + * @param[in] old_pin The old PIN code entered by the user \n + * Refer #TelSimSecPw_t. + * + * @param[in] new_pin The new PIN code entered by the user \n + * Refer #TelSimSecPw_t. + * + * @param[in] callback To register a callback function for result + * + * @param[in] user_data The user data for user specification + * + * @return The return type (int) + * Integer '0' ( same with #TAPI_API_SUCCESS & #TAPI_SIM_ACCESS_SUCCESS ) - indicates that the operation is completed successfully + * Negative integer : It provides an error code before actual operations (Refer #TapiResult_t) + * Positive integer : It provides an error code during actual operations (Refer #TelSimAccessResult_t) + * + * @pre The user can get valid return values or make operations after SIM init completes(card status is #TAPI_SIM_STATUS_SIM_INIT_COMPLETED). + */ +int tel_change_sim_pins(TapiHandle *handle, const TelSimSecPw_t *old_pin, const TelSimSecPw_t *new_pin, tapi_response_cb callback, void *user_data); + +/** + * @brief Disables the SIM facility. + * @details Sync (or) Async: This is an Asynchronous API. + * + * Prospective Clients: External Apps. + * + * @since_tizen 2.3 + * @privlevel platform + * @privilege %http://tizen.org/privilege/telephony.admin + * + * @param[in] handle The handle from tel_init() + * + * @param[in] pw A structure which contains the facility type and password + * + * @param[in] callback To register a callback function for result + * + * @param[in] user_data The user data for user specification + * + * @return The return type (int) + * Integer '0' ( same with #TAPI_API_SUCCESS & #TAPI_SIM_ACCESS_SUCCESS ) - indicates that the operation has completed successfully + * Negative integer : It provides an error code before actual operations (Refer #TapiResult_t) + * Positive integer : It provides an error code during actual operations (Refer #TelSimAccessResult_t) + */ +int tel_disable_sim_facility(TapiHandle *handle, TelSimFacilityPw_t *pw, tapi_response_cb callback, void *user_data); + +/** + * @brief Enables the SIM facility. + * @details Sync (or) Async: This is an Asynchronous API. + * + * Prospective Clients: External Apps. + * + * @since_tizen 2.3 + * @privlevel platform + * @privilege %http://tizen.org/privilege/telephony.admin + * + * @param[in] handle The handle from tel_init() + * + * @param[in] pw A structure which contains the facility type and password + * + * @param[in] callback To register a callback function for result + * + * @param[in] user_data The user data for user specification + * + * @return The return type (int) + * Integer '0' ( same with #TAPI_API_SUCCESS & #TAPI_SIM_ACCESS_SUCCESS ) - indicates that the operation has completed successfully + * Negative integer : It provides an error code before actual operations (Refer #TapiResult_t) + * Positive integer : It provides an error code during actual operations (Refer #TelSimAccessResult_t) + */ +int tel_enable_sim_facility(TapiHandle *handle, TelSimFacilityPw_t *pw, tapi_response_cb callback, void *user_data); + +/** + * @brief Gets the SIM facility. + * @details Sync (or) Async: This is an Asynchronous API. + * + * Prospective Clients: External Apps. + * + * @since_tizen 2.3 + * @privlevel public + * @privilege %http://tizen.org/privilege/telephony + * + * @param[in] handle The handle from tel_init() + * + * @param[in] type The type of security lock + * + * @param[in] callback To register a callback function for result + * + * @param[in] user_data The user data for user specification + * + * @return The return type (int) + * Integer '0' ( same with #TAPI_API_SUCCESS & #TAPI_SIM_ACCESS_SUCCESS ) - indicates that the operation has completed successfully + * Negative integer : It provides an error code before actual operations (Refer #TapiResult_t) + * Positive integer : It provides an error code during actual operations (Refer #TelSimAccessResult_t) + */ +int tel_get_sim_facility(TapiHandle *handle, TelSimLockType_t type, tapi_response_cb callback, void *user_data); + +/** + * @brief Gets SIM LOCK TYPE info. + * @details Sync (or) Async: This is an Asynchronous API. + * + * Prospective Clients: External Apps. + * + * @since_tizen 2.3 + * @privlevel public + * @privilege %http://tizen.org/privilege/telephony + * + * @param[in] handle The handle from tel_init() + * + * @param[in] type The type of security lock + * + * @param[in] callback To register a callback function for result + * + * @param[in] user_data The user data for user specification + * + * @return The return type (int) + * Integer '0' ( same with #TAPI_API_SUCCESS & #TAPI_SIM_ACCESS_SUCCESS ) - indicates that the operation has completed successfully + * Negative integer : It provides an error code before actual operations (Refer #TapiResult_t) + * Positive integer : It provides an error code during actual operations (Refer #TelSimAccessResult_t) + */ +int tel_get_sim_lock_info(TapiHandle *handle, TelSimLockType_t type, tapi_response_cb callback, void *user_data); + +/** + * @brief Sets the SIM power state. + * + * @details Sync (or) Async: This is an Asynchronous API. + * + * Prospective Clients: External Apps. + * + * @since_tizen 2.3 + * @privlevel platform + * @privilege %http://tizen.org/privilege/telephony.admin + * + * @param [in] handle The handle from tel_init() + * + * @param[in] state The state of SIM to be set \n + * It is either ON or OFF. + * + * @param [in] callback To register a callback function for result + * + * @param [in] user_data The user data for user specification + * + * @return The return type (int) + * Integer '0' ( same with #TAPI_SIM_POWER_SET_SUCCESS ) - indicates that the operation has completed successfully + * Positive integer : It provides an error code while actual operations (Refer #TelSimPowerSetResult_t) + * + * @par Prospective Clients: + * External Apps. + */ +int tel_set_sim_power_state(TapiHandle *handle, TelSimPowerState_t state, tapi_response_cb callback, void *user_data); + +/** + * @brief Provides a common interface for accessing SIM data. + * + * @details This function is based on the USIM generic command in ETSI TS 102 221 + * and 3GPP TS 31.102 Characteristics of the Universal Subscriber Identity Module (USIM) application. + * + * This API provides only an interface to send APDU. The user should know well how to use APDU. + * + * This function makes a Dbus method call to the Telephony Server and returns an immediate value. + * However it just means that the API request has been transfered to the CP successfully. + * The actual operation result is being delivered in the corresponding event asynchronously. + * + * Sync (or) Async: This is an Asynchronous API. + * + * Prospective Clients: External Apps. + * + * @since_tizen 2.3 + * @privlevel platform + * @privilege %http://tizen.org/privilege/telephony.admin + * + * @param[in] handle The handle from tel_init() + * + * @param[in] apdu_data The APDU data + * + * @param[in] callback To register a callback function for result + * + * @param[in] user_data The user data for user specification + * + * @return The return type (int) + * Integer '0' ( same with #TAPI_API_SUCCESS & #TAPI_SIM_ACCESS_SUCCESS ) - indicates that the operation has completed successfully + * Negative integer : It provides an error code before actual operations (Refer #TapiResult_t) + * Positive integer : It provides an error code during actual operations (Refer #TelSimAccessResult_t) + * + * @pre The user can get valid return values or make operations after SIM init completes(card status is #TAPI_SIM_STATUS_SIM_INIT_COMPLETED). + */ +int tel_req_sim_apdu(TapiHandle *handle, TelSimApdu_t* apdu_data, tapi_response_cb callback, void *user_data); + +/** + * @brief Provides a common interface to get the SIM ATR(Answer To Reset) value. + * + * @details This function makes a Dbus method call to the Telephony Server and returns an immediate value. + * However it just means that the API request has been transfered to the CP successfully. + * The actual operation result is delivered in the corresponding event asynchronously. + * + * Sync (or) Async: This is an Asynchronous API. + * + * Prospective Clients: External Apps. + * + * @since_tizen 2.3 + * @privlevel public + * @privilege %http://tizen.org/privilege/telephony + * + * @param[in] handle The handle from tel_init() + * + * @param[in] callback To register a callback function for result + * + * @param[in] user_data The user data for user specification + * + * @return The return type (int) + * Integer '0' ( same with #TAPI_API_SUCCESS & #TAPI_SIM_ACCESS_SUCCESS ) - indicates that the operation has completed successfully + * Negative integer : It provides an error code before actual operations (Refer #TapiResult_t) + * Positive integer : It provides an error code during actual operations (Refer #TelSimAccessResult_t) + * + * @pre The user can get valid return values or make operations after SIM init completes(card status is #TAPI_SIM_STATUS_SIM_INIT_COMPLETED). + */ +int tel_req_sim_atr(TapiHandle *handle, tapi_response_cb callback, void *user_data); + +#ifdef __cplusplus +} +#endif + +#endif /* _ITAPI_SIM_H_ */ + +/** + * @} + */ diff --git a/include/ITapiSs.h b/include/ITapiSs.h new file mode 100644 index 0000000..41aee06 --- /dev/null +++ b/include/ITapiSs.h @@ -0,0 +1,521 @@ +/* + * libslp-tapi + * + * Copyright (c) 2014 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Ja-young Gu + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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 ITapiSs.h + */ + +/** + * @internal + * @addtogroup CAPI_TELEPHONY_SERVICE_SS + * @{ + */ + +#ifndef _ITAPI_SS_H_ +#define _ITAPI_SS_H_ + +#include +#include + +#ifdef __cplusplus +extern "C" +{ +#endif + +/** + * @brief Sends a request to activate/deactivate call barring. + * + * @details This service allows a mobile subscriber to activate barring of certain categories + * of outgoing or incoming calls according to a barring program which is selected from a set + * of one or more barring programs chosen at provision time and is valid for all outgoing or incoming calls, or just those associated + * with a specific basic service group. Also this API allows deactivating call barring based on categories set. + * If the user calls this function with a wrong password 3 times subsequently, the barring service can be blocked. + * If this function is called normally, the asynchronous response comes in a few seconds from the network. The response indicates + * whether the service request has been granted or not. + * + * This API makes a Dbus method call to the Telephony Server and gets an immediate feedback. + * However it just means that the API request has been transfered to the CP successfully. + * The actual operation result is delivered with the async response as below. + * + * Sync (or) Async: This is an Asynchronous API. + * + * Prospective Clients: External Apps. + * + * @since_tizen 2.3 + * @privlevel platform + * @privilege %http://tizen.org/privilege/telephony.admin + * + * @param[in] handle The handle from tel_init() + * + * @param[in] info The information about call barring + * + * @param[in] callback To register a callback function for result + * + * @param[in] user_data The user data for user specification + * + * @return The return type (int) \n + * #TAPI_API_SUCCESS - indicates that the operation is completed successfully. \n + * Refer #TapiResult_t for failure and error code. + * + * @pre Initialize the Dbus connection with #tel_init. + * + * @see tel_get_ss_barring_status() + * @see tel_change_ss_barring_password() + */ +int tel_set_ss_barring(TapiHandle *handle, TelSsBarringInfo_t *info, tapi_response_cb callback, void *user_data); + +/** + * @brief Gets a call barring status. + * + * @details The mobile subscriber may determine which outgoing or incoming call should be barred + * by subscribing a set of one or more unique barring programs. + * If this function is called normally, the asynchronous response comes in a few seconds from the network. + * The response indicates the service status. + * + * This API makes a Dbus method call to the Telephony Server and gets an immediate feedback. + * However it just means that the API request has been transfered to the CP successfully. + * The actual operation result is delivered with the async response as below. + * + * Sync (or) Async: This is an Asynchronous API. + * + * Prospective Clients: External Apps. + * + * @since_tizen 2.3 + * @privlevel public + * @privilege %http://tizen.org/privilege/telephony + * + * @param[in] handle The handle from tel_init() + * + * @param[in] ss_class The type of call i.e. Voice call, Video Call, and so on + * + * @param[in] type The barring type i.e. Outgoing international, outgoing all, Incoming all, and so on + * + * @param[in] callback To register a callback function for result + * + * @param[in] user_data The user data for user specification + * + * @return The return type (#TapiResult_t) \n + * #TAPI_API_SUCCESS - indicates that the operation is completed successfully. \n + * Refer #TapiResult_t for failure and error code. + * + * @pre Initialize the Dbus connection with #tel_init. + * + * @see tel_set_ss_barring() + * @asee tel_change_ss_barring_password() + */ +int tel_get_ss_barring_status(TapiHandle *handle, TelSsClass_t ss_class, TelSsBarringType_t type, tapi_response_cb callback, void *user_data); + +/** + * @brief Allows changing of the barring password in the network. + * + * @details The user can request the network to change his own barring password. If the old password is not same as + * what the network knows, the request will be rejected by the network. New password should be entered separately twice + * to confirm the correctness of the user input. Otherwise, the request must be rejected by the Telephony Server. + * If the user calls this function with a wrong old password 3 times subsequently, the barring service can be blocked. + * If this function is called normally, the asynchronous response comes in a few seconds from the network. + * The response indicates whether the service request has been granted or not. + * + * This API makes a Dbus method call to the Telephony Server and gets an immediate feedback. + * However it just means that the API request has been transfered to the CP successfully. + * The actual operation result is delivered with the async response as below. + * Sync (or) Async: This is an Asynchronous API. + * + * Prospective Clients: External Apps. + * + * @since_tizen 2.3 + * @privlevel platform + * @privilege %http://tizen.org/privilege/telephony.admin + * + * @remarks Based on 3GPP TS 22.030 section 6.5.4 Registration of New Password. Only one Change Barring Password request is allowed + * at a time and TS might return #TAPI_API_REQUEST_MAX_IN_PROGRESS if another request is received. + * + * @param[in] handle The handle from tel_init() + * + * @param[in] old_password The old password set for Barring in the Network \n + * This is a Null terminated string. + * + * @param[in] new_password The new password set for Barring in the Network \n + * This is a Null terminated string + * + * @param[in] new_password_again A new password again \n + * This is a Null terminated string + * + * @param[in] callback To register a callback function for result + * + * @param[in] user_data The user data for user specification + * + * @return The return type (int) \n + * #TAPI_API_SUCCESS - indicates that the operation is completed successfully. \n + * Refer #TapiResult_t for failure and error code. + * + * @pre Initialize the Dbus connection with #tel_init. + * An event loop runs to listen to events. + */ +int tel_change_ss_barring_password(TapiHandle *handle, + const char *old_password, + const char *new_password, + const char *new_password_again, + tapi_response_cb callback, void *user_data); + +/** + * + * @brief Allows to set the (register/erase/activate/deactivate) call forwarding option at the network. + * + * @details This enables to forward the 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, + * addressed to the called mobile subscriber's directory number and which meets + * 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 this call forward condition occurs. + * An application has to call this API in order to explicitly register/erase/activate/deactivate + * call forwarding. Request will be passed irrespective of whether + * another SS call forward is already ongoing or not. + * + * If this function is called normally, the asynchronous response comes in a few seconds from the network. The response indicates + * whether the service request has been granted or not. + * + * This API makes a Dbus method call to the Telephony Server and gets an immediate feedback. + * However it just means that the API request has been transfered to the CP successfully. + * The actual operation result is delivered with the async response as below. + * + * Sync (or) Async: This is an Asynchronous API. + * + * Prospective Clients: External Apps. + * + * @since_tizen 2.3 + * @privlevel platform + * @privilege %http://tizen.org/privilege/telephony.admin + * + * @param[in] handle The handle from tel_init() + * + * @param[in] info The Call forward information such as a forward mode, a forward type, and so on + * + * @param[in] callback To register a callback function for result + * + * @param[in] user_data The user data for user specification + * + * @return The return type (int) \n + * #TAPI_API_SUCCESS - indicates that the operation is completed successfully. \n + * Refer #TapiResult_t for failure and error code. + * + * @pre Initialize the Dbus connection with #tel_init. + * + * @see tel_get_ss_forward_status() + */ +int tel_set_ss_forward(TapiHandle *handle, const TelSsForwardInfo_t *info, tapi_response_cb callback, void *user_data); + +/** + * @brief Provides an option to get the call forwarding status of different calls from the Network. + * + * @details The data request procedure enables the mobile subscriber to obtain information about the data stored in the PLMN. + * After having requested this procedure the network shall return the following information:\n + * - In response to a general data request the served mobile subscriber should be given a list of all Basic service groups + * to which call forwarding unconditional is registered, including information on whether or not it is active and operative, + * and the associated forwarded-to numbers\n + * - In response to a specific request concerning one particular Basic service group, + * the served mobile subscriber should be informed whether or not call forwarding unconditional is registered, + * including information on whether or not it is active and operative for that Basic service group.\n + * If CFU is registered, the associated forwarded-to number shall be given. + * + * If this function is called normally, the asynchronous response comes in a few seconds from the network. + * The response indicates the service status. + * + * This API makes a Dbus method call to the Telephony Server and gets an immediate feedback. + * However it just means that the API request has been transfered to the CP successfully. + * The actual operation result is delivered with the async response as below. + * Sync (or) Async: This is an Asynchronous API. + * + * Prospective Clients: External Apps. + * + * @since_tizen 2.3 + * @privlevel public + * @privilege %http://tizen.org/privilege/telephony + * + * @param[in] handle The handle from tel_init() + * + * @param[in] ss_class The Forward call type i.e. voice call, Video Call, Data Calls, and so on + * + * @param[in] condition The forward condition i.e. unconditional, when no reply, when busy, when not reachable, and so on + * + * @param[in] callback To register a callback function for result + * + * @param[in] user_data The user data for user specification + * + * @return The return type (int) \n + * #TAPI_API_SUCCESS - indicates that the operation is completed successfully. \n + * Refer #TapiResult_t for failure and error code. + * + * @pre Initialize the Dbus connection with #tel_init. + * + * @see tel_set_ss_forward() + */ +int tel_get_ss_forward_status(TapiHandle *handle, TelSsClass_t ss_class, TelSsForwardWhen_t condition, tapi_response_cb callback, void *user_data); + +/** + * + * @brief Activates/deactivates the call waiting service. + * + * @details The call waiting service permits a mobile to be notified of an incoming + * call (as per basic call procedures) while the traffic channel (BM or LM) is not available for the incoming call and the mobile subscriber + * is engaged in an active or held call. Subsequently, the subscriber can accept, reject, or ignore the incoming call. + * If this function is called normally, the asynchronous response comes in a few seconds from the network. The response indicates + * whether the service request has been granted or not. + * + * This API makes a Dbus method call to the Telephony Server and gets an immediate feedback. + * However it just means that the API request has been transfered to the CP successfully. + * The actual operation result is delivered with the async response as below. + * + * Sync (or) Async: This is an Asynchronous API. + * + * Prospective Clients: External Apps. + * + * @since_tizen 2.3 + * @privlevel platform + * @privilege %http://tizen.org/privilege/telephony.admin + * + * @param[in] handle The handle from tel_init() + * + * @param[in] info The status of call-waiting service i.e. On (TRUE) or off (FALSE) + * + * @param[in] callback To register a callback function for result + * + * @param[in] user_data The user data for user specification + * + * @return The return type (int) \n + * #TAPI_API_SUCCESS - indicates that the operation is completed successfully. \n + * Refer #TapiResult_t for failure and error code + * + * @pre Initialize the Dbus connection with #tel_init. + * + * @see tel_get_ss_waiting_status() + */ +int tel_set_ss_waiting(TapiHandle *handle, const TelSsWaitingInfo_t *info, tapi_response_cb callback, void *user_data); + +/** + * @brief Gets the status of the call waiting service. + * + * @details The call waiting service permits a mobile to be notified of an incoming call + * (as per basic call procedures) while the traffic channel (BM or LM) is not available for the incoming call and the mobile subscriber + * is engaged in an active or held call. Subsequently, the subscriber can accept, reject, or ignore the incoming call. + * If this function is called normally, the asynchronous response comes in a few seconds from the network. + * The response indicates the service status. + * + * This API makes a Dbus method call to the Telephony Server and gets an immediate feedback. + * However it just means that the API request has been transfered to the CP successfully. + * The actual operation result is delivered with the async response as below. + * Sync (or) Async: This is an Asynchronous API. + * + * Prospective Clients: External Apps. + * + * @since_tizen 2.3 + * @privlevel public + * @privilege %http://tizen.org/privilege/telephony + * + * @param[in] handle The handle from tel_init() + * + * @param[in] ss_class The call types + * + * @param[in] callback To register a callback function for result + * + * @param[in] user_data The user data for user specification + * + * @return The return type (int) \n + * #TAPI_API_SUCCESS - indicates that the operation is completed successfully. \n + * Refer #TapiResult_t for failure and error code + * + * @pre Initialize the Dbus connection with #tel_init. + * + * @see tel_set_ss_waiting() + */ +int tel_get_ss_waiting_status(TapiHandle *handle, const TelSsClass_t ss_class, tapi_response_cb callback, void *user_data); + +/** + * @brief Activates/deactivates the status of the calling line identity service. + * + * @details The group of Line Identification Supplementary Services is divided into the following six Supplementary Services:\n + * CLIP - Calling line identification presentation\n + * This Supplementary Service provides the ability to indicate the line identity of the calling party to the called party. + * The network shall deliver the calling line identity to the called party at call set-up time, + * regardless of the terminal capability to handle the information.\n + * CLIR - Calling line identification restriction\n + * The CLIR Supplementary Service is a Supplementary Service offered to the calling party + * to prevent presentation of the calling party's line identity, to the called party.\n + * COLP - Connected line identification presentation\n + * This Supplementary Service is not a dialing check but an indication to the calling subscriber + * of the connected line identity in a full ISDN/PLMN environment, + * the connected line identity shall include all the information necessary to unambiguously identify the connected party. + * The network shall deliver the connected line identity to the calling party + * regardless of the terminal capability to handle the information.\n + * COLR - Connected line identification restriction\n + * The COLR Supplementary Service is a Supplementary Service offered + * to the connected party to prevent presentation of the connected line identity, to the calling party. + * In the case where the calling party has an override category.\n + * CDIP - Called line identification presentation\n + * CNAP - Calling name presentation\n + * This function queries the service status with #TelSsCliType_t. + * + * If this function is called normally, the asynchronous response comes in a few seconds from the network. + * The response indicates the service status. + * + * This API makes a Dbus method call to the Telephony Server and gets an immediate feedback. + * However it just means that the API request has been transfered to the CP successfully. + * The actual operation result is delivered with the async response as below: + * + * Sync (or) Async: This is an Asynchronous API. + * + * Prospective Clients: External Apps. + * + * @since_tizen 2.3 + * @privlevel platform + * @privilege %http://tizen.org/privilege/telephony.admin + * + * @param[in] handle The handle from tel_init() + * + * @param[in] type The Cli service type + * + * @param[in] status The Cli Status + * + * @param[in] callback To register a callback function for result + * + * @param[in] user_data The user data for user specification + * + * @return The return type (int) \n + * #TAPI_API_SUCCESS - indicates that the operation is completed successfully. \n + * Refer #TapiResult_t for failure and error code + * + * @pre Initialize the Dbus connection with #tel_init. + */ +int tel_set_ss_cli_status(TapiHandle *handle, TelSsCliType_t type, TelSsCliStatus_t status, tapi_response_cb callback, void *user_data); + +/** + * @brief Gets the status of the calling line identity service. + * + * @details The group of Line Identification Supplementary Services is divided into the following six Supplementary Services:\n + * CLIP - Calling line identification presentation\n + * This Supplementary Service provides the ability to indicate the line identity of the calling party to the called party. + * The network shall deliver the calling line identity to the called party at call set-up time, + * regardless of the terminal capability to handle the information.\n + * CLIR - Calling line identification restriction\n + * The CLIR Supplementary Service is a Supplementary Service offered to the calling party + * to prevent presentation of the calling party's line identity, to the called party.\n + * COLP - Connected line identification presentation\n + * This Supplementary Service is not a dialing check but an indication to the calling subscriber + * of the connected line identity in a full ISDN/PLMN environment, + * the connected line identity shall include all the information necessary to unambiguously identify the connected party. + * The network shall deliver the connected line identity to the calling party + * regardless of the terminal capability to handle the information.\n + * COLR - Connected line identification restriction\n + * The COLR Supplementary Service is a Supplementary Service offered + * to the connected party to prevent presentation of the connected line identity, to the calling party. + * In the case where the calling party has an override category.\n + * CDIP - Called line identification presentation\n + * CNAP - Calling name presentation\n + * This function queries the service status with #TelSsCliType_t. + * + * If this function is called normally, the asynchronous response comes in a few seconds from the network. + * The response indicates the service status. + * + * This API makes a Dbus method call to the Telephony Server and gets an immediate feedback. + * However it just means that the API request has been transfered to the CP successfully. + * The actual operation result is delivered with the async response as below: + * + * Sync (or) Async: This is an Asynchronous API. + * + * Prospective Clients: External Apps. + * + * @since_tizen 2.3 + * @privlevel public + * @privilege %http://tizen.org/privilege/telephony + * + * @param[in] handle The handle from tel_init() + * + * @param[in] type The Cli service type + * + * @param[in] callback To register a callback function for result + * + * @param[in] user_data The user data for user specification + * + * @return The return type (int) \n + * #TAPI_API_SUCCESS - indicates that the operation is completed successfully. \n + * Refer #TapiResult_t for failure and error code + * + * @pre Initialize the Dbus connection with #tel_init. + */ +int tel_get_ss_cli_status(TapiHandle *handle, TelSsCliType_t type, tapi_response_cb callback, void *user_data); + +/** + * @brief Sends a USSD string or User response to the Network. + * + * @details The unstructured supplementary service data (USSD) mechanism allows the Mobile Station (MS) user and + * a PLMN operator defined application to communicate in a way which is transparent + * to the MS and the intermediate network entities. + * The mechanism allows development of PLMN specific supplementary services. + * A USSD string is like *109, *109*72348937857623#. + * There are two modes of USSD: The MMI-mode and the application mode. + * The MMI-mode USSD is for the transparent transport of MMI strings entered by the user to the network using this function + * and for the transparent transport of text strings from the network that are displayed + * by the mobile for user information. + * The application mode USSD is for the transparent transport of data between the network and the UE. + * The application mode USSD is intended to be used by applications in the network and their peer applications in the UE. + * + * If this function is called normally, the asynchronous response comes in a few seconds from the telephony server. + * The response indicates whether the sending request is successfully delivered or not. + * + * This API makes a Dbus method call to the Telephony Server and gets an immediate feedback. + * However it just means that the API request has been transfered to the CP successfully. + * The actual operation result is delivered with the async response as below: + * + * Sync (or) Async: This is an Asynchronous API. + * + * Prospective Clients: External Apps. + * + * @since_tizen 2.3 + * @privlevel platform + * @privilege %http://tizen.org/privilege/telephony.admin + * + * @param[in] handle The handle from tel_init() + * + * @param[in] info The data coding scheme used (GSM 7bit or 8bit default alphabet etc, defined as 3GPP TS 23.038), USSD String data length, ANSI string passed by the client + * + * @param[in] callback To register a callback function for result + * + * @param[in] user_data The user data for user specification + * + * @return The return type (int) \n + * #TAPI_API_SUCCESS - indicates that the operation is completed successfully. \n + * Refer #TapiResult_t for failure and error code + * + * @pre Initialize the Dbus connection with #tel_init.\n + * Register the telephony event to be listend with #tel_register_noti_event.\n + * An event loop runs to listen to events. + * No SS and USSD transaction should be ongoing. If there is an ongoing transaction, a new USSD request will be returned to the application with an error (USSD_BUSY). + * + */ +int tel_send_ss_ussd_request(TapiHandle *handle, const TelSsUssdMsgInfo_t *info, tapi_response_cb callback, void *user_data); + +#ifdef __cplusplus +} +#endif + +#endif /* _ITAPI_SS_H_ */ + +/** + * @} + */ diff --git a/include/TapiUtility.h b/include/TapiUtility.h new file mode 100644 index 0000000..292af02 --- /dev/null +++ b/include/TapiUtility.h @@ -0,0 +1,283 @@ +/* + * libslp-tapi + * + * Copyright (c) 2014 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Ja-young Gu + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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 TapiUtility.h + */ + +/** + * @internal + * @addtogroup CAPI_TELEPHONY_SERVICE + * @{ + */ + +#ifndef _TEL_UTILITY_H_ +#define _TEL_UTILITY_H_ + +__BEGIN_DECLS + +/** + * @brief Definition for Invalid Request ID value. + */ +#define INVALID_REQUEST_ID -1 +#define DBUS_DEFAULT_PATH "/org/tizen/telephony" + +/** + * @brief Definition for negative error value + * @remarks If result is negative value in callback function, it comply below error. + */ +#define TAPI_ERROR_OPERATION_FAILED -1 +#define TAPI_ERROR_ACCESS_DENIED -2 +#define TAPI_ERROR_OPERATION_NOT_SUPPORTED -3 + +/** + * @brief Enumeration for TAPI return codes. + */ +typedef enum { + TAPI_API_SUCCESS = 0, /**< No Error occurred */ + TAPI_API_INVALID_INPUT = -1, /**< Input values are not correct in the TAPI Library */ + TAPI_API_INVALID_PTR = -2, /**< Invalid pointer */ + TAPI_API_NOT_SUPPORTED = -3, /**< The feature corresponding to the 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 = -4, /**< This API is deprecated and will be so in the future also */ + TAPI_API_SYSTEM_OUT_OF_MEM = -5, /**< Out of memory */ + TAPI_API_SYSTEM_RPC_LINK_DOWN = -6, /**< RPC link down */ + TAPI_API_SERVICE_NOT_READY = -7, /**< Phone is powered on, but is still to receive the power up completed notification */ + TAPI_API_SERVER_FAILURE = -8, /**< Error occurred in the Telephony server */ + TAPI_API_OEM_PLUGIN_FAILURE = -9, /**< Plug-in layer failure */ + TAPI_API_TRANSPORT_LAYER_FAILURE = -10, /**< Transport layer Failure */ + TAPI_API_INVALID_DATA_LEN = -11, /**< Invalid data length */ + TAPI_API_REQUEST_MAX_IN_PROGRESS = -12, /**< Maximum number of API Requests for the same service are already in progress */ + TAPI_API_OFFLINE_MODE_ERROR = -13, /**< OEM Telephony Provider is in the Offline mode */ + TAPI_EVENT_CLASS_UNKNOWN = -14, /**< Event class specified is not present in the Event Class list */ + TAPI_EVENT_UNKNOWN = -15, /**< Event specified is not present in the TAPI Unsolicited Event list */ + TAPI_REGISTRATION_OP_FAILED = -16, /**< Callback Registration/De-registration failed */ + TAPI_API_OPERATION_FAILED = -17, /**< API operation failed */ + TAPI_API_INVALID_OPERATION = -18, /**< API Invalid Operation */ + TAPI_API_ACCESS_DENIED = -19, /**< Access Denied */ + + TAPI_API_SYSTEM_RPC_LINK_NOT_EST = -100, /**< RPC link down */ + TAPI_API_API_NOT_SUPPORTED = -101, /**< API not supported */ + TAPI_API_SERVER_LAYER_FAILURE = -102, /**< Server layer failure */ + + /* CALL */ + TAPI_API_INVALID_CALL_ID = -200, /**< Invalid call ID */ + TAPI_API_CALL_CTXT_OVERFLOW = -201, /**< Call context overflow */ + TAPI_API_COULD_NOT_GET_CALL_CTXT = -202, /**< Could not get the call context */ + TAPI_API_CTXT_SEARCH_RET_NON_CALL_CTXT = -203, /**< Context search returned the non-call context */ + TAPI_API_COULD_NOT_DESTROY_CTXT = -204, /**< Could not destroy the context */ + TAPI_API_INVALID_LINE_ID = -205, /**< Invalid line ID */ + TAPI_API_INVALID_CALL_HANDLE = -206, /**< Invalid call handle */ + TAPI_API_INVALID_CALL_STATE = -207, /**< Invalid call state - Newly added. Need to raise a CR for this */ + TAPI_API_CALL_PRE_COND_FAILED = -208, /**< Pre condition like MO call cannot be established now */ + TAPI_API_CALL_SAME_REQ_PENDING = -209, /**< Cannot accept the same request multiple times */ + + /* POWER */ + TAPI_API_MODEM_POWERED_OFF = -300, /**< Modem is powered off */ + TAPI_API_MODEM_ALREADY_ON = -301, /**< Modem is already on */ + TAPI_API_MODEM_ALREADY_OFF = -302, /**< Modem is already off */ + + /* NETTEXT */ + TAPI_API_NETTEXT_DEVICE_NOT_READY = -400, /**< Nettext device is not ready */ + TAPI_API_NETTEXT_SCADDR_NOT_SET = -401, /**< Nettext SCA address is not set */ + TAPI_API_NETTEXT_INVALID_DATA_LEN = -402, /**< Nettext Invalid data length */ + TAPI_NETTEXT_SCADDRESS_NOT_SET = -403, /**< Nettext SCA address is not set */ + + /* SIM */ + TAPI_API_SIM_CARD_ERROR = -500, /**< SIM general error */ + TAPI_API_SIM_NOT_FOUND = -501, /**< SIM is not present / removed */ + TAPI_API_SIM_NOT_INITIALIZED = -502, /**< SIM has not initialized yet (waiting for PIN verification) */ + TAPI_API_SIM_LOCKED = -503, /**< PIN/PUK/NCK/NSCK/SPCK/CCK required state */ + TAPI_API_SIM_PERM_BLOCKED = -504, /**< SIM Permanently blocked state (no more allowing PUK input) */ + TAPI_API_SIM_SERVICE_IS_DISABLED = -505, /**< Service is disabled in EF-SST due to a given operation */ + + /* SAT */ + TAPI_API_SAT_INVALID_COMMAND_ID = -600, /**< Command Number Invalid */ + TAPI_API_SAT_COMMAND_TYPE_MISMATCH = -601, /**< Command Type Mismatch */ + TAPI_API_SAT_EVENT_NOT_REQUIRED_BY_USIM = -602, /**< Event Not Requested by the USIM */ + + /* Network */ + TAPI_API_NETWORK_INVALID_CTXT = -700, /**< Network invalid contex t*/ + TAPI_API_NETWORK_PLMN_NOT_ALLOWED = -701, /** 3GPP Attache reject cause 11 */ + TAPI_API_NETWORK_ROAMING_NOT_ALLOWED = -702, /** 3GPP Attache reject cause 13 */ + + /*Misc */ + TAPI_API_MISC_RETURN_NULL = -800, /**< MISC return NULL */ + TAPI_API_MISC_VALIDITY_ERROR = -801, /**< MISC validity error */ + TAPI_API_MISC_INPUTPARM_ERROR = -802, /**< MISC input parameter error */ + TAPI_API_MISC_OUTPARAM_NULL = -803, /**< MISC output parameter NULL */ +} TapiResult_t; + +/** + * @brief Checks the 'scalar_exp' for TRUE, if failed then it returns 'err_value' from the function. + */ +#define TAPI_RET_ERR_NUM_IF_FAIL(scalar_exp, err_num) {\ + if (!(scalar_exp)) \ + { \ + err("TAPI_RET_ERR_NUM_IF_FAIL Failed. returning [%d]", err_num);\ + return err_num; \ + } \ +} + +/** + * @brief Returns from the current function if the expression is not true. + * @details 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. + * + * @param[in] scalar_exp The expression to check + */ +#define TAPI_RETURN_IF_FAIL(scalar_exp) {\ + if (!scalar_exp) \ + { \ + err("TAPI_RETURN_IF_FAIL: Failed: Returning from here."); \ + return; \ + } \ +} + +/** + * @brief Returns from the current function, returning the value @a ret, if the expression is not true. + * @details If the expression evaluates to FALSE, a critical message is logged and @a ret is returned. + */ +#define TAPI_RETURN_VAL_IF_FAIL(scalar_exp, ret) { \ + if (!scalar_exp) \ + { \ + err("TAPI_RETURN_VAL_IF_FAIL: Failed: Returning [%d]", ret); \ + return ret; \ + } \ +} + +/** + * @brief Returns from the current function, returning the value @a ret, if the expression is not true. + * @details If the expression evaluates to FALSE, a critical message is logged and @a ret is returned. + */ +#define TAPI_RETURN_VAL_IF_SUCCESS(scalar_exp, ret) { \ + if (scalar_exp) \ + { \ + err("TAPI_RETURN_VAL_IF_SUCCESS: Failed Returning [%d]", ret); \ + return ret; \ + } \ +} + +/** + * @brief Logs an error on stderr and abort, if assertion failed. + * @details Use this only if the telephpny sevrer needs to be exited, if asertion fails. + */ +#define TAPI_ASSERT(scalar_exp) assert(scalar_exp); + +/** + * @brief Returns from the current function, returning the value @a ret, if @a exp1 and @a exp2 are of the same value. + * @details If the equal expression evaluates to TRUE, a critical message is logged and @a ret is returned. + */ +#define TAPI_RETURN_VAL_IF_EQUAL(exp1, exp2, ret) { \ + if (exp1 == exp2) \ + { \ + err("TAPI_RETURN_VAL_IF_EQUAL: FAILED, Returning [%d]", ret); \ + return ret; \ + } \ +} + +/** + * @brief Allocates a region of the memory, which is large enough to hold n elements of size bytes each. + * @details 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"); \ + err("calloc error -NULL, errno is [%d]", errno); \ + TAPI_ASSERT(ptr); \ + } + +/** + * @brief Deletes a pointer with double free check. + * @details 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 { \ + err("Double Free or NULL"); \ + } + +/** + * @brief Checks for available destination buffer size before copying source buffer data to the destination buffer. + * @details It asserts if the destination buffer size is less than the source buffer size. + */ +#define TAPI_MEMCPY(dest, src, dest_len, src_len) \ + if (dest_len >= src_len) { \ + memcpy(dest, src, src_len); \ + } \ + else { \ + err("TAPI_MEMCPY FAILURE - dest_len(%d) < src_len(%d)", dest_len, src_len); \ + assert(0); \ + } + +/** + * @brief Encodes a sequence of binary data into its Base-64 stringified representation. + * + * @param[in] data The binary data to encode + * @param[in] len The length of data + * @param[out] encoded_data The encoded data + * @return A newly allocated, zero-terminated Base-64 encoded string representing data + */ +#define TAPI_BASE64_ENCODE(data, len, encoded_data) \ + encoded_data = g_base64_encode((const guchar *)data, (gsize) len); + +/** + * @brief Decodes a sequence of Base-64 encoded text into binary data. + * + * @param[in] text The zero-terminated string with base64 text to decode + * @param[out] decoded_data The decoded data + * @param[in] ptr_out_len The length of the decoded data + * @return A newly allocated buffer containing the binary data representing text + */ +#define TAPI_BASE64_DECODE(text, decoded_data, ptr_out_len) \ + decoded_data = g_base64_decode((const gchar *)text, (gsize *)ptr_out_len); + +/** + * @brief Calculates 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; \ + } \ +} + +__END_DECLS + +#endif //_TEL_UTILITY_H_ +/** + * @} + */ diff --git a/include/TelCall.h b/include/TelCall.h new file mode 100644 index 0000000..7d38d18 --- /dev/null +++ b/include/TelCall.h @@ -0,0 +1,1218 @@ +/* + * libslp-tapi + * + * Copyright (c) 2014 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Ja-young Gu + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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 TelCall.h + */ + +/** + * @internal + * @addtogroup CAPI_TELEPHONY_SERVICE_CALL + * @{ + * + */ + +#ifndef _TEL_CALL_H_ +#define _TEL_CALL_H_ + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @brief Definition for the maximum length of the string for the calling party name. + * @since_tizen 2.3 + */ +#define TAPI_CALLING_NAME_SIZE_MAX 80 + +/** + * @brief Definition for the maximum length of the user to user signalling data string. + * @since_tizen 2.3 + */ +#define TAPI_CALL_UUS_DATA_LEN_MAX 131 + +/** + * @brief Definition for the maximum length of the string for display record in CDMA. + * @since_tizen 2.3 + */ +#define TAPI_CALL_DISPLAY_RECORD_MAX 32 + +/** + * @brief Definition for the maximum number of calls possible at a time. + * @since_tizen 2.3 + */ +#define MAX_TAPI_CALL_COUNT 6 + +/** + * @brief Definition for the maximum number of calls possible in a conference call at a time. + * @since_tizen 2.3 + */ +#define MAX_TAPI_CONF_CALL_COUNT 5 + +/** + * @brief Definition for the invalid call handle. + * @details TS_UINT is used for the call handle. + * @since_tizen 2.3 + */ +#define INVALID_CALL_HANDLE 0 + +/* Call */ + +/** + * @brief Definition for the maximum dialling digit length. + * @since_tizen 2.3 + */ +#define TAPI_CALL_DIALDIGIT_LEN_MAX 82 + +/** + * @brief Definition for the maximum call subaddress length. + * @since_tizen 2.3 + */ +#define TAPI_CALL_SUBADDRESS_LEN_MAX 40 + +/** + * @brief Definition for the dialling number length. + * @since_tizen 2.3 + */ +#define TAPI_CALL_NUMBER_LEN_MAX 7 + +/** + * @brief Definition for the maximum call context size. + * @since_tizen 2.3 + */ +#define TAPI_CONTEXT_CALL_SIZE_MAX 6 + +/** + * @brief Definition for the maximum dialling number length. + * @since_tizen 2.3 + */ +#define TAPI_CALL_DIAL_NUMBER_LEN_MAX 82 + +/** + * @brief Definition for the maximum Burst DTMF string length. + * @since_tizen 2.3 + */ +#define TAPI_CALL_BURST_DTMF_STRING_MAX 32 + +/** + * @brief Enumeration for the call cause values. + * @since_tizen 2.3 + */ +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 unauthorized */ + 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 occurred */ + 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_REJ_SAT_CALL_CTRL, /**< Rejection SAT Call Control */ + 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 failure */ //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 a USSD transaction is already in progess */ + TAPI_CAUSE_IDLE, /**< Idle */ + TAPI_CAUSE_NETWORK_SPECIFIC, /**< Network specific error */ + TAPI_CAUSE_FADE, /**< Voice call is dropped e.g. because of a loss of signal */ + TAPI_CAUSE_UNKNOWN, /**< Unknown and no details available */ + TAPI_CAUSE_INCOM_CALL, /**< Terminated by an incoming call */ + TAPI_CAUSE_ALERT_STOP, /**< Terminated by an alert stop */ + TAPI_CAUSE_INTERCEPT, /**< Voice call is dropped by interception */ + TAPI_CAUSE_REORDER, /**< Voice call is 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, /**< Unacceptable 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 succeeded */ + TAPI_CAUSE_SEND_DTMF_FAIL, /**< Sending DTMF failed */ + TAPI_CAUSE_FIXED_DIALING_NUMBER_ONLY, /**< Fixed Dialing Number Only */ + TAPI_CAUSE_TIMER_EXPIRED, /**< Call Timer Expired */ +} TelCallCause_t; + +/** + * @brief Enumeration when a call is ended, this end cause is given with the CALL END notification to the application. + * @details This end cause can be originated from different elements in the communication path or different modules in the same element. + * @since_tizen 2.3 + */ +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 and 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, /**< Incoming 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,/**< Restricted 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 a 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_REORDER, /**< Reorder */ + + TAPI_CC_CAUSE_END = 128, /**< End unspecified */ + + /* 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 non existent */ + 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 expiry */ + 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 the network is 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 call failure */ + TAPI_CDMA_END_CAUSE_PHONE_OFFLINE, /**< Call Released because phone is offline */ + TAPI_CDMA_END_CAUSE_PHONE_IS_CDMA_LOCKED, /**< Call Released because CDMA is locked */ + TAPI_CDMA_END_CAUSE_FLASH_IS_IN_PROGRESS_ERR, /**< Call Released because of the flash-is-in-progress error */ + TAPI_CDMA_END_CAUSE_E911_MODE_ERR, /**< Call Released because of the e911 mode */ + TAPI_CDMA_END_CAUSE_OTHERS, /**< Call Released by Others */ + TAPI_CDMA_END_CAUSE_MAX /**< Maximum End Cause limit for CDMA */ +} TelTapiEndCause_t; + +/** + * @brief Enumeration for the call conference states. + * @since_tizen 2.3 + */ +typedef enum { + TAPI_CALL_CONFERENCE_IDLE, /**< Idle */ + TAPI_CALL_CONFERENCE_ACTIVE /**< Active */ +} TelConferenceCallState_t; + +/** + * @brief Enumeration for application usable states. Applications can have their own states as well. + * @since_tizen 2.3 + */ +typedef enum { + TAPI_CALL_STATE_IDLE, /**< Call is in the idle state - i.e. no call */ + TAPI_CALL_STATE_ACTIVE, /**< Call is in the connected and conversation state */ + TAPI_CALL_STATE_HELD, /**< Call is in the held state */ + TAPI_CALL_STATE_DIALING, /**< Call is in the dialing state */ + TAPI_CALL_STATE_ALERT, /**< Call is in the alerting state */ + TAPI_CALL_STATE_INCOMING, /**< Call is in the incoming state */ + TAPI_CALL_STATE_WAITING, /**< Call is in the answered state, and waiting for connected indication event */ + TAPI_CALL_STATE_MAX /**< Call state unknown */ +} TelCallStates_t; + +/** + * @brief IN GSM ONLY: call identification number. + * @since_tizen 2.3 + */ +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; + +/** + * @brief Enumeration for SS info messages of an incoming call indication. + * @since_tizen 2.3 + */ +typedef enum { + TAPI_CALL_MT_CLI_PRESENT = 0x31, /**< Number details are present in the "char number" of the call info struct. If the number is not present then the "no cli cause" member in mt_ss_info is set accordingly */ + TAPI_CALL_MT_CNA_PRESENT = 0x32, /**< Calling Name Info present, #TelCallingNameInfo_t of the call info struct contains this info */ + TAPI_CALL_MT_SS_UNDEFINED = 0x00, /**< Undefined SS indication. Ignore mt_ss_info */ + +} TelCallMtSSInfo_t; + +/** + * @brief Enumeration for the answer type used as a parameter in the answer call API. + * @since_tizen 2.3 + */ +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 waiting call */ + TAPI_CALL_ANSWER_HOLD_AND_ACCEPT, /**< Hold the current active call, and accept the waiting call */ +} TelCallAnswerType_t; + +/** + * @brief Enumeration for the end type used as a parameter in the end call API. + * @since_tizen 2.3 + */ +typedef enum { + TAPI_CALL_END = 0, /**< End Specific Call */ + TAPI_CALL_END_ALL, /**< End All Calls */ + TAPI_CALL_END_ACTIVE_ALL, /**< End All Active Calls */ + TAPI_CALL_END_HOLD_ALL, /**< End All Held Calls */ +} TelCallEndType_t; + + + + +/** + * @brief Enumeration for call type to be used by applications while using the setup call API. Like the requested call is a voice call or video call. + * @since_tizen 2.3 + */ +typedef enum { + TAPI_CALL_TYPE_VOICE, /**< Voice call type */// in ipcv4, 0x0100 + TAPI_CALL_TYPE_DATA, /**< Data call type - (for modem, fax, packet, and other such calls) */// in ipcv4, 0x0200 + TAPI_CALL_TYPE_E911 /**< Emergency call type */// in ipcv4, 0x0700 +} TelCallType_t; + +/** + * @brief Enumeration for the various alerting patterns available. + * @since_tizen 2.3 + */ +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; + +/** + * @brief Enumeration for state of the current call. + * @since_tizen 2.3 + */ +typedef enum { + TAPI_CALL_CONNECT_IDLE, /**< Call is in the Idle state */ + TAPI_CALL_CONNECT_ACTIVE, /**< Call is in the Active state */ + TAPI_CALL_CONNECT_HELD /**< Call is in the Held state */ +} TelCallActiveState_t; + +/** + * @brief Enumeration for closed user group options. + * @since_tizen 2.3 + */ +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; + +/** + * @brief Enumeration for tapi call UUS protocol types. + * @since_tizen 2.3 + */ +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; + +/** + * @brief Enumeration for the call name mode. + * @since_tizen 2.3 + */ +typedef enum { + TAPI_CALL_NAME_AVAIL = 0, /**< This identifier refers to presenting the calling party's name identity to the called party */ + TAPI_CALL_NAME_RESTRICTED = 1, /**< This identifier refers to restricting the name identity of the calling party from being presented to the called party */ + TAPI_CALL_NAME_UNAVAIL = 2, /**< This identifier refers to the unavailability of the calling party's name identity from being offered to the called party */ + TAPI_CALL_NAME_AVAIL_RESTRICTED = 3 /**< This identifier refers to offering the calling party's name identity to the called party with which the presentation restriction is overridden */ +} TelCallNameMode_t; + +/** + * @brief Enumeration for the "No Cli cause" value. + * @since_tizen 2.3 + */ +typedef enum { + TAPI_CALL_NO_CLI_CAUSE_NONE = -1, /**< None */ + TAPI_CALL_NO_CLI_CAUSE_UNAVAILABLE = 0x00, /**< Unavailable */ + TAPI_CALL_NO_CLI_CAUSE_REJECTBY_USER = 0x01, /**< Rejected by User */ + TAPI_CALL_NO_CLI_CAUSE_INTERACTION_OTHERSERVICES = 0x02, /**< Other services */ + TAPI_CALL_NO_CLI_CAUSE_COINLINE_PAYPHONE = 0x03, /**< Coin line phone */ +} TelCallNoCliCause_t; + +/** + * @brief Enumeration for the "Cli mode" value. + * @since_tizen 2.3 + */ +typedef enum { + TAPI_CALL_PRES_AVAIL, /**< Presentation Allowed */ + TAPI_CALL_PRES_RESTRICTED, /**< Presentation Restricted */ + TAPI_CALL_NUM_UNAVAIL, /**< Number Not Available */ +}TelCallCliMode_t; + +/** + * @brief Enumeration for the the fwded ind type used for MO and Mt from SS Noti Info. + * @since_tizen 2.3 + */ +typedef enum { + TAPI_CALL_OUTGOING_FWDED = 0x00, /**< Outgoing call forwarded */ + TAPI_CALL_INCOMMING_FWDED = 0x01, /**< Incoming call forwarded */ +} TelCallForwardType_t; + +/** + * @brief Enumeration for the voice privacy option mode. (CDMA only) + * @since_tizen 2.3 + */ +typedef enum { + TAPI_CALL_PRIVACY_MODE_STANDARD = 0x00, /**< Standard mode */ + TAPI_CALL_PRIVACY_MODE_ENHANCED /**< Enhanced mode */ +} TelCallPrivacyMode_t; + +/** + * @brief Enumeration for the OTASP Status. (CDMA only) + * @since_tizen 2.3 + */ +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; + +/** + * @brief Enumeration for the OTAPA Status. (CDMA only) + * @since_tizen 2.3 + */ +typedef enum { + TAPI_CALL_OTAPA_STOP = 0x00, /**< OTAPA : stop */ + TAPI_CALL_OTAPA_START, /**< OTAPA : start */ +} TelCallOtapaStatus_t; + +/** + * @brief Enumeration for the Alert Signal Type. (CDMA only) + * @since_tizen 2.3 + */ +typedef enum { + TAPI_CALL_SIGNAL_TYPE_TONE = 0x00, + TAPI_CALL_SIGNAL_TYPE_ISDN_ALERTING, + TAPI_CALL_SIGNAL_TYPE_IS54B_ALERTING, + TAPI_CALL_SIGNAL_TYPE_RESERVED +} TelCallAlertSignalType_t; + +/** + * @brief Enumeration for the Alert Pitch Type. (CDMA only) + * @since_tizen 2.3 + */ +typedef enum { + TAPI_CALL_ALERT_PITCH_MED = 0x00, + TAPI_CALL_ALERT_PITCH_HIGH, + TAPI_CALL_ALERT_PITCH_LOW, + TAPI_CALL_ALERT_PITCH_RESERVED +} TelCallAlertPitchType_t; + +/** + * @brief Enumeration for the signals specific to the alert signal type TAPI_CALL_SIGNAL_TYPE_TONE. (CDMA only) + * @since_tizen 2.3 + */ +typedef enum { + TAPI_CALL_SIGNAL_TONE_DIAL = 0x00, + TAPI_CALL_SIGNAL_TONE_RINGBACK_TONE_ON, + TAPI_CALL_SIGNAL_TONE_INTERCEPT_TONE_ON, + TAPI_CALL_SIGNAL_TONE_ABBREV_TONE, + TAPI_CALL_SIGNAL_TONE_NETWORK_CONGESTION_TONE_ON, + TAPI_CALL_SIGNAL_TONE_ABBREV_NETWORK_CONGESTION, + TAPI_CALL_SIGNAL_TONE_BUSY_TONE_ON, + TAPI_CALL_SIGNAL_TONE_CFRM_TONE_ON, + TAPI_CALL_SIGNAL_TONE_ANSWER_TONE_ON, + TAPI_CALL_SIGNAL_TONE_CALL_WAITING_TONE_ON, + TAPI_CALL_SINGNAL_TONE_PIPE_TONE_ON, + TAPI_CALL_SIGNAL_TONE_OFF +} TelCallToneSignal_t; + +/** + * @brief Enumeration for the signals specific to the alert signal type TAPI_CALL_SIGNAL_TYPE_ISDN_ALERTING. (CDMA only) + */ +typedef enum { + TAPI_CALL_SIGNAL_ISDN_ALERT_NORMAL = 0x00, + TAPI_CALL_SIGNAL_ISDN_ALERT_INTER_GROUP, + TAPI_CALL_SIGNAL_ISDN_ALERT_SPECIAL_PRIORITY, + TAPI_CALL_SIGNAL_ISDN_ALERT_ISDN_RESERVED1, + TAPI_CALL_SIGNAL_ISDN_ALERT_PING_RING, + TAPI_CALL_SIGNAL_ISDN_ALERT_ISDN_RESERVED2, + TAPI_CALL_SIGNAL_ISDN_ALERT_ISDN_RESERVED3, + TAPI_CALL_SIGNAL_ISDN_ALERT_ISDN_RESERVED4, + TAPI_CALL_SIGNAL_ISDN_ALERT_OFF +} TelCallIsdnAlertSignal_t; + +/** + * @brief Enumeration for the signals specific to the alert signal type TAPI_CALL_SIGNAL_TYPE_IS54B_ALERTING. (CDMA only) + */ +typedef enum { + TAPI_CALL_SIGNAL_IS54B_ALERT_NOTONE = 0x00, + TAPI_CALL_SIGNAL_IS54B_ALERT_LONG, + TAPI_CALL_SIGNAL_IS54B_ALERT_SHORT_SHORT, + TAPI_CALL_SIGNAL_IS54B_ALERT_SHORT_SHORT_LONG, + TAPI_CALL_SIGNAL_IS54B_ALERT_SHORT_SHORT_2, + TAPI_CALL_SIGNAL_IS54B_ALERT_SHORT_LONG_SHORT, + TAPI_CALL_SIGNAL_IS54B_ALERT_SHORT_SHORT_SHORT_SHORT, + TAPI_CALL_SIGNAL_IS54B_ALERT_PBX_LONG, + TAPI_CALL_SIGNAL_IS54B_ALERT_PBX_SHORT_SHORT, + TAPI_CALL_SIGNAL_IS54B_ALERT_PBX_SHORT_SHORT_LONG, + TAPI_CALL_SIGNAL_IS54B_ALERT_PBX_SHORT_LONG_SHORT, + TAPI_CALL_SIGNAL_IS54B_ALERT_PBX_SHORT_SHORT_SHORT_SHORT, + TAPI_CALL_SIGNAL_IS54B_ALERT_PIP_PIP_PIP_PIP +} TelCallIs54bAlertSignal_t; + +/** + * @brief Enumeration for the call time request mask type. + * @since_tizen 2.3 + */ +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; + +/** + * @brief Enumeration for the DTMF tone length. + * @since_tizen 2.3 + */ +typedef enum { + TAPI_CALL_TONE_DURATION_SHORT = 0x01, /**< Tone Duration Short */ + TAPI_CALL_TONE_DURATION_LONG /**< Tone Duration Long */ +} TelCallToneDuration_t; + +/** + * @brief Enumeration for the emergency category type. + * @since_tizen 2.3 + */ +typedef enum { + TAPI_CALL_ECC_DEFAULT = 0x00, /**< Default case */ + TAPI_CALL_ECC_POLICE = 0x01, /**< Police emergency */ + TAPI_CALL_ECC_AMBULANCE = 0x02, /**< Ambulance emergency */ + TAPI_CALL_ECC_FIREBRIGADE = 0x04, /**< Firebrigade emergency */ + TAPI_CALL_ECC_MARINEGUARD = 0x08, /**< Marineguard emergency */ + TAPI_CALL_ECC_MOUNTAINRESCUE = 0x10, /**< Mountain rescue emergency */ + TAPI_CALL_ECC_MANUAL_ECALL = 0x20, /**< Manual emergency call */ + TAPI_CALL_ECC_AUTO_ECALL = 0x40, /**< Automatic emergency call */ + TAPI_CALL_ECC_NONE = 0xff, /**< Unspecified emergency */ +} TelCallEmergencyCategory_t; + +typedef enum { + TAPI_CALL_IDENTITY_DEFAULT, /**< Calling line identity will be sent. Based on the network setting, the line identity will be presented to the called party */ + TAPI_CALL_IDENTITY_SHOW, /**< Display the calling line identity */ + TAPI_CALL_IDENTITY_HIDE /**< Hide the display of the calling line identity */ +} TelCallIdentityMode_t; + +/** + * @brief Enumeration for the context type. + * @since_tizen 2.3 + */ +typedef enum { + TAPI_CONTEXT_TYPE_NONE = 0x00, /**< Unspecified context */ + TAPI_CONTEXT_TYPE_VOICE_CALL = 0x01, /**< Voice call context */ + TAPI_CONTEXT_TYPE_DATA_CALL = 0x2, /**< Data call context */ + TAPI_CONTEXT_TYPE_VIDEO_CALL = 0x3, /**< Video call context */ + TAPI_CONTEXT_TYPE_NETTEXT, /**< Network text context */ + TAPI_CONTEXT_TYPE_E911, /**< Emergency context */ +} TapiContextType; + +/** + * @brief Enumeration for the timer state and/or call timer ID. + * @since_tizen 2.3 + */ +typedef enum { + TAPI_CALL_TSTATE_IDLE = 0x00, /**< No timer running */ + TAPI_CALL_TSTATE_SETUP_PENDING, /**< Setup Timer */ + TAPI_CALL_TSTATE_CONNECT_PENDING, /**< Connect 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; + +/** + * @brief Enumeration for the offlength to send DTMF. + * @since_tizen 2.3 + */ +typedef enum { + TAPI_CALL_DTMF_OFFLENGTH_60MS, + TAPI_CALL_DTMF_OFFLENGTH_100MS, + TAPI_CALL_DTMF_OFFLENGTH_150MS, + TAPI_CALL_DTMF_OFFLENGTH_200MS, +} TelCallDtmfInterDigitInterval_t; + +/** + * @brief Enumeration for the onlength to send DTMF. + * @since_tizen 2.3 + */ +typedef enum { + TAPI_CALL_DTMF_ONLENGTH_95MS, + TAPI_CALL_DTMF_ONLENGTH_150MS, + TAPI_CALL_DTMF_ONLENGTH_200MS, + TAPI_CALL_DTMF_ONLENGTH_250MS, + TAPI_CALL_DTMF_ONLENGTH_300MS, + TAPI_CALL_DTMF_ONLENGTH_350MS, + TAPI_CALL_DTMF_ONLENGTH_SMS +}TelCallDtmfPulseWidth_t; + +/** + * @brief Enumeration for the Call Record Info Type + * @since_tizen 2.3 + */ +typedef enum { + TAPI_CALL_REC_INFO_TYPE_NAME, + TAPI_CALL_REC_INFO_TYPE_NUMBER, +}TelCallRecordInfoType_t; + +/** + * @brief TelCallPreferredVoiceSubs_t + * This enumeration defines possible 'preferred' Voice Subscriptions + * @since_tizen 2.3 + */ +typedef enum { + TAPI_CALL_PREFERRED_VOICE_SUBS_UNKNOWN = -1, /**< Unknown status **/ + TAPI_CALL_PREFERRED_VOICE_SUBS_CURRENT_NETWORK = 0, /**< Current network **/ + TAPI_CALL_PREFERRED_VOICE_SUBS_ASK_ALWAYS, /**< ASK Always **/ + TAPI_CALL_PREFERRED_VOICE_SUBS_SIM1, /**< SIM 1 **/ + TAPI_CALL_PREFERRED_VOICE_SUBS_SIM2 /**< SIM 2 **/ +} TelCallPreferredVoiceSubs_t; + + +typedef struct { + int bRequestedBySAT; /**< This flag is to indicate whether the request has been initiated by SAT. Possible values are @c 0 and @c 1. This flag should be updated only when initiating a setup request */ + TelCallIdentityMode_t IdentityMode; /**< Sets the Calling Line Identity mode. If the default value #TAPI_IDENTITY_DEFAULT is set, OEM will set the default value */ + TelCallEmergencyCategory_t ecc; +} tel_set_call_satflag_identiymode; + +/** + * @brief The structure type to redirect destination information. + * @since_tizen 2.3 + */ +typedef struct { + unsigned char number[TAPI_CALL_DIAL_NUMBER_LEN_MAX + 1]; /**< Redirect destination number */ +} TelCallDeflectDstInfo_t; + +/** + * @brief The structure type for calling name information. + * @since_tizen 2.3 + */ +typedef struct { + TelCallNameMode_t NameMode; /**< Display mode of @a szNameData */ + char szNameData[TAPI_CALLING_NAME_SIZE_MAX]; /**< Calling party name string */ +} TelCallingNameInfo_t; + +/** + * @brief The structure type for information about an outgoing call. + * @since_tizen 2.3 + */ +typedef struct { + TelCallType_t CallType; /**< Sets type of call (voice, data, video, emergency) */ + TelCallEmergencyCategory_t Ecc; + char szNumber[TAPI_CALL_DIALDIGIT_LEN_MAX + 1]; /**< A string containing the destination phone number. This follows the dial number format */ +} TelCallDial_t; + +/** + * @brief The structure type for information about call status. + * @since_tizen 2.3 + */ +typedef struct { + int CallHandle; + int bMoCall; /**< Status will be yes for MO Calls. If MT call, then FALSE */ + char pNumber[TAPI_CALL_DIALDIGIT_LEN_MAX + 1]; /**< Mobile Number */ + TelCallType_t CallType; /**< Type of call (voice, data, emergency) */ + TelCallStates_t CallState; /**< Current Call state */ + int bConferenceState; /**< Whether Call is in Conference */ +} TelCallStatus_t; + +/** + * @brief Called to get the call status. + * @since_tizen 2.3 + */ +typedef void (*TelCallStatusCallback)( TelCallStatus_t *out, void *user_data ); + + +/** + * @brief The structure type for information about call redirection details. + * @since_tizen 2.3 + */ +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; + +/** + * @brief The structure type for incoming call information. + * @since_tizen 2.3 + */ +typedef struct { + unsigned int CallHandle; /**< At the Foundation API Level, call handle indicates the handle of the call for the application. At the Framework API Level, call handle indicates the call identifier used for a 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 the network, this information will be @c NULL */ + TelCallRedirectionInfo_t RedirectInfo; /**< The data for the Call Redirect information. If there is no information from the network, this information will be @c NULL */ + TelCallCliMode_t CliMode; /**< CLI mode */ + TelCallNoCliCause_t CliCause; /**< No CLI cause */ + int fwded; /**< True or false. If the incoming call is a forwarded call, then @c true else @c false */ + TelCallActiveLine_t ActiveLine; /**< Current Active Line */ +} TelCallIncomingCallInfo_t; + +/** + * @brief The structure type for SS Info message. + * @since_tizen 2.3 + */ +typedef struct { + TelCallMtSSInfo_t type; /**< Type of SS Info present */ + TelCallCliMode_t CliMode; /**< CLI mode */ + TelCallNoCliCause_t no_cli_cause; /**< TBD */ +} 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 @a 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; /**< End Cause */ +} TelTapiCallInfo_t; + +/** + * @brief The structure type for the connected number information. + * @since_tizen 2.3 + */ +typedef struct { + TelCallCliMode_t CliMode; /**< CLI mode */ + TelCallNoCliCause_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; + +/** + * @brief The structure type for information about call time and call count. + * @since_tizen 2.3 + */ +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 seconds) */ + unsigned long OutgoingCallTime; /**< Overall Outgoing Call Time(in seconds) */ + unsigned long IncomingCallTime; /**< Overall Incoming Call Time(in seconds) */ + unsigned long LastCallTime; /**< Last Call Time(in seconds) */ +} TelCallTimeInfo_t; + +/** + * @brief The structure type for information about display record in CDMA. + * @since_tizen 2.3 + */ +typedef struct { + unsigned char Record[TAPI_CALL_DISPLAY_RECORD_MAX + 1]; /**< Display record */ +} TelCallDisplayRecordInfo_t; + +/** + * @brief The structure type for information about burst DTMF in CDMA. + * @since_tizen 2.3 + */ +typedef struct { + char dtmf_string[TAPI_CALL_BURST_DTMF_STRING_MAX + 1]; /** Burst DTMF string NULL terminated */ + TelCallDtmfPulseWidth_t pulse_width; + TelCallDtmfInterDigitInterval_t inter_digit_interval; +} TelCallBurstDtmf_t; + +/** + * @brief Structure type for the information about records in CDMA. + * @since_tizen 2.3 + */ +typedef struct { + unsigned int id; /**< Call id */ + TelCallRecordInfoType_t type; + union { + char name[TAPI_CALLING_NAME_SIZE_MAX + 1]; /**< name record */ + char number[TAPI_CALL_DIAL_NUMBER_LEN_MAX + 1]; /**< number record */ + } data; +} TelCallRecordInfo_t; + +/** + * @brief Enumeration for call sound volume level. + * @since_tizen 2.3 + */ +typedef enum { + TAPI_SOUND_MUTE =0x00, /**< Sound is mute */ + TAPI_SOUND_VOLUME_LEVEL_1=0x01, /**< Volume level is 1 */ + TAPI_SOUND_VOLUME_LEVEL_2=0x02, /**< Volume level is 2 */ + TAPI_SOUND_VOLUME_LEVEL_3=0x03, /**< Volume level is 3 */ + TAPI_SOUND_VOLUME_LEVEL_4=0x04, /**< Volume level is 4 */ + TAPI_SOUND_VOLUME_LEVEL_5=0x05, /**< Volume level is 5 */ + TAPI_SOUND_VOLUME_LEVEL_6=0x06, /**< Volume level is 6 */ + TAPI_SOUND_VOLUME_LEVEL_7=0x07, /**< Volume level is 7 */ + TAPI_SOUND_VOLUME_LEVEL_8=0x08, /**< Volume level is 8 */ + TAPI_SOUND_VOLUME_LEVEL_9=0x09 /**< Volume level is 9 */ +} TelSoundVolume_t; + +/** + * @brief Enumeration for call sound device type. + * @since_tizen 2.3 + */ +typedef enum { + TAPI_SOUND_DEVICE_RECEIVER = 0x00, /**< Device type Receiver */ + TAPI_SOUND_DEVICE_SPEAKER_PHONE = 0x10, /**< Device type Speaker */ + TAPI_SOUND_DEVICE_HFK = 0x20, /**< Device type Handsfree */ + TAPI_SOUND_DEVICE_HEADSET = 0x30, /**< Device type HeadSet */ + TAPI_SOUND_DEVICE_BLUETOOTH = 0x40, /**< Device type Bluetooth */ + TAPI_SOUND_DEVICE_EC = 0xA0, /**< Device type external*/ +} TelSoundDevice_t; + +/** + * @brief Enumeration for call sound type. + * @since_tizen 2.3 + */ +typedef enum { + TAPI_SOUND_TYPE_VOICE = 0x01, /**< Call Sound type voice */ + TAPI_SOUND_TYPE_KEYTONE = 0x02, /**< Call Sound type keytone */ + TAPI_SOUND_TYPE_BELL = 0x03, /**< Call Sound type bell */ + TAPI_SOUND_TYPE_MESSAGE = 0x04, /**< Call Sound type message */ + TAPI_SOUND_TYPE_ALARM = 0x05, /**< Call Sound type alarm */ + TAPI_SOUND_TYPE_PDA_MISC = 0x06, /**< Call Sound type PDA miscellaneous */ +} TelSoundType_t; + + +typedef struct { + TelSoundDevice_t device; /**< Call Sound device info structure */ + TelSoundType_t type; /**< Call Sound type info structure */ + TelSoundVolume_t volume; /**< Call Sound volume info structure */ +} TelCallVolumeInfo_t; + +typedef enum { + TAPI_SOUND_PATH_HANDSET =0x01, /**< Audio path is handset */ + TAPI_SOUND_PATH_HEADSET =0x02, /**< Audio path is handset */ + TAPI_SOUND_PATH_HANDSFREE =0x03, /**< Audio path is Handsfree */ + TAPI_SOUND_PATH_BLUETOOTH =0x04, /**< Audio path is bluetooth */ + TAPI_SOUND_PATH_STEREO_BLUETOOTH =0x05, /**< Audio path is stereo bluetooth */ + TAPI_SOUND_PATH_SPK_PHONE =0x06, /**< Audio path is speaker phone */ + TAPI_SOUND_PATH_HEADSET_3_5PI =0x07, /**< Audio path is headset_3_5PI */ + TAPI_SOUND_PATH_BT_NSEC_OFF =0x08, /**< Audio path Bluetooth NSEC is off */ + TAPI_SOUND_PATH_MIC1 =0x09, /**< Audio path Mic one */ + TAPI_SOUND_PATH_MIC2 =0x0A, /**< Audio path Bluetooth Mic two */ + TAPI_SOUND_PATH_HEADSET_HAC =0x0B, /**< Audio path is headset HAC */ +} TelSoundPath_t; + +typedef struct { + TelSoundPath_t path; /**< TBD */ + enum ExtraVolumeStatus { + TAPI_SOUND_EX_VOLUME_OFF, /**< TBD */ + TAPI_SOUND_EX_VOLUME_ON, /**< TBD */ + } ex_volume; /**< TBD */ +} TelCallSoundPathInfo_t; + +typedef enum { + TAPI_SOUND_MUTE_PATH_TX = 0x00, /**< Sound mute path transmit */ + TAPI_SOUND_MUTE_PATH_RX = 0x02, /**< Sound mute path receiver */ + TAPI_SOUND_MUTE_PATH_ALL= 0x04, /**< Sound mute path all */ +} TelSoundMutePath_t; + +typedef enum { + TAPI_SOUND_MUTE_STATUS_OFF = 0x00, /**< Sound mute status off */ + TAPI_SOUND_MUTE_STATUS_ON = 0x01, /**< Sound mute status on */ +} TelSoundMuteStatus_t; + +typedef enum { + TAPI_SOUND_NOISE_REDUCTION_OFF, /**< Sound noise reduction off */ + TAPI_SOUND_NOISE_REDUCTION_ON, /**< Sound noise reduction on */ +} TelSoundNoiseReduction_t; + +typedef struct { + unsigned int id; /**< TBD */ +} TelCallAnswerCnf_t; + +typedef struct { + TelCallEndType_t type; /**< TBD */ + unsigned int id; /**< TBD */ +} TelCallEndCnf_t; + +typedef struct { + unsigned int id; /**< TBD */ +} TelCallHoldCnf_t; + +typedef struct { + unsigned int id; /**< TBD */ +} TelCallActiveCnf_t; + +typedef struct { + unsigned int id; /**< TBD */ +} TelCallSwapCnf_t; + +typedef struct { + unsigned int id; /**< TBD */ +} TelCallJoinCnf_t; + +typedef struct { + unsigned int id; /**< TBD */ +} TelCallSplitCnf_t; + +typedef struct { + unsigned int id; /**< TBD */ +} TelCallTransferCnf_t; + +typedef struct { + unsigned int record_num; /**< TBD */ + TelCallVolumeInfo_t record[ 20 ]; /**< TBD */ +} TelCallGetVolumeInfoResp_t; + +typedef struct { + TelSoundMutePath_t path; /**< TBD */ + TelSoundMuteStatus_t status; /**< TBD */ +} TelCallGetMuteStatusResp_t; + +typedef struct { + TelCallPrivacyMode_t mode; +} TelCallGetPrivacyModeResp_t; + +typedef struct { + unsigned int id; /**< TBD */ + TelTapiEndCause_t cause; /**< End cause for the call indicates whether the call is released normally or due to some other cause */ +} TelCallStatusIdleNoti_t; + +typedef struct { + unsigned int id; /**< TBD */ +} TelCallStatusActiveNoti_t; + +typedef struct { + unsigned int id; /**< TBD */ +} TelCallStatusHeldNoti_t; + +typedef struct { + unsigned int id; /**< TBD */ +} TelCallStatusDialingNoti_t; + +typedef struct { + unsigned int id; /**< TBD */ +} TelCallStatusAlertNoti_t; + +typedef struct { + unsigned int id; /**< TBD */ +} TelCallStatusIncomingNoti_t; + +typedef struct { + unsigned int id; /**< TBD */ +} TelCallStatusWaitingNoti_t; + +typedef struct { + unsigned int id; /**< TBD */ +} TelCallInfoWaitingNoti_t; + +typedef struct { + unsigned int id; /**< TBD */ +} TelCallInfoForwardedNoti_t; + +typedef struct { + unsigned int id; +} TelCallInfoForwardedCallNoti_t; + +typedef struct { + unsigned int id; /**< TBD */ +} TelCallInfoBarredIncomingNoti_t; + +typedef struct { + unsigned int id; /**< TBD */ +} TelCallInfoBarredOutgoingNoti_t; + +typedef struct { + unsigned int id; /**< TBD */ +} TelCallInfoForwardConditionalNoti_t; + +typedef struct { + unsigned int id; /**< TBD */ +} TelCallInfoForwardUnconditionalNoti_t; + +typedef struct { + unsigned int id; /**< TBD */ +} TelCallInfoActiveNoti_t; + +typedef struct { + unsigned int id; /**< TBD */ +} TelCallInfoHeldNoti_t; + +typedef struct { + unsigned int id; /**< TBD */ +} TelCallInfoJoinedNoti_t; + +typedef struct { + TelCallOtaspStatus_t otasp_status; +} TelCallOtaspStatusNoti_t; + +typedef struct { + TelCallOtapaStatus_t otapa_status; +} TelCallOtapaStatusNoti_t; + + +typedef struct { + TelCallPrivacyMode_t privacy_mode; /**< Voice Privacy Mode */ +} TelCallVoicePrivacyNoti_t; + + +typedef struct { + TelCallRecordInfo_t info; +} TelCallRecordInfoNoti_t; + +typedef struct { + TelCallAlertSignalType_t signal_type; + TelCallAlertPitchType_t pitch_type; + union { + TelCallToneSignal_t sig_tone_type; + TelCallIsdnAlertSignal_t sig_isdn_alert_type; + TelCallIs54bAlertSignal_t sig_is54b_alert_type; + } signal; +} TelCallSignalInfoNoti_t; + +typedef struct { + TelSoundPath_t path; /**< TBD */ +} TelCallSoundPathNoti_t; + +typedef enum { + TAPI_CALL_SOUND_RINGBACK_TONE_END, /**< TBD */ + TAPI_CALL_SOUND_RINGBACK_TONE_START, /**< TBD */ +} TelCallSoundRingbackToneNoti_t; + +typedef enum { + TAPI_CALL_SOUND_WBAMR_STATUS_OFF, /**< TBD */ + TAPI_CALL_SOUND_WBAMR_STATUS_ON, /**< TBD */ + TAPI_CALL_SOUND_WBAMR_STATUS_OFF_16K, /**< TBD */ + TAPI_CALL_SOUND_WBAMR_STATUS_ON_8K, /**< TBD */ +} TelCallSoundWbamrNoti_t; + +typedef struct { + TelSoundNoiseReduction_t status; /**< TBD */ +} TelCallSoundNoiseReductionNoti_t; + +typedef struct { + TelCallPreferredVoiceSubs_t preferred_subs; +} TelCallPreferredVoiceSubsNoti_t; + +#ifdef __cplusplus +} +#endif + +#endif // _TEL_CALL_H_ + +/** + * @} + */ diff --git a/include/TelMisc.h b/include/TelMisc.h new file mode 100644 index 0000000..d564d35 --- /dev/null +++ b/include/TelMisc.h @@ -0,0 +1,356 @@ +/* + * libslp-tapi + * + * Copyright (c) 2014 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Ja-young Gu + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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 TelMisc.h + */ + +/** + * @internal + * @addtogroup CAPI_TELEPHONY_SERVICE_MODEM + * @{ + */ + +#ifndef _TEL_MISC_H_ +#define _TEL_MISC_H_ + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +#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 + +/** + * @brief Enumeration for the MMI check key values. + * @since_tizen 2.3 + */ +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, /**< TBD */ + + 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 /**< TBD */ +} TelMiscMMICHECK_t; + +/** + * @brief Enumeration for the application key types. + * @since_tizen 2.3 + */ +typedef enum { + KEY_EXT_DIAL_0 = 0, /**< TBD */ + KEY_EXT_DIAL_1, /**< TBD */ + KEY_EXT_DIAL_2, /**< TBD */ + KEY_EXT_DIAL_3, /**< TBD */ + KEY_EXT_DIAL_4, /**< TBD */ + KEY_EXT_DIAL_5, /**< TBD */ + KEY_EXT_DIAL_6, /**< TBD */ + KEY_EXT_DIAL_7, /**< TBD */ + KEY_EXT_DIAL_8, /**< TBD */ + KEY_EXT_DIAL_9, /**< TBD */ + 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, /**< TBD */ + + 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 /**< TBD */ +} TelMiscApplicationKey_t; + +/** + * @brief Enumeration for the touch event types. + * @since_tizen 2.3 + */ +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; + +/** + * @brief Enumeration for the validity of alarm booting. + * @since_tizen 2.3 + */ +typedef enum { + TAPI_MISC_ALARMBOOT_INACTIVATE, /**< 0x00: Inactivate */ + TAPI_MISC_ALARMBOOT_ACTIVATE /**< 0x00: Activate */ +} 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 has 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; + +/** + * @brief Enumeration for the NAM Information MASK field. + * @since_tizen 2.3 + */ +typedef enum { + TAPI_MISC_NAM_INFO_MASK_TOTAL = 0x0001, /**< TBD */ + TAPI_MISC_NAM_INFO_MASK_CURRENT_INDEX = 0x0002, /**< TBD */ + TAPI_MISC_NAM_INFO_MASK_REQUEST_INDEX = 0x0004, /**< TBD */ + TAPI_MISC_NAM_INFO_MASK_AUTONAM = 0x0008, /**< TBD */ + TAPI_MISC_NAM_INFO_MASK_MCC = 0x0010, /**< TBD */ + TAPI_MISC_NAM_INFO_MASK_MNC = 0x0020, /**< TBD */ + TAPI_MISC_NAM_INFO_MASK_MIN = 0x0040, /**< TBD */ + TAPI_MISC_NAM_INFO_MASK_MDN = 0x0080, /**< TBD */ + TAPI_MISC_NAM_INFO_MASK_NAM_NAME = 0x0100, /**< TBD */ + TAPI_MISC_NAM_INFO_MASK_NAM_CHANGE = 0x0200, /**< TBD */ + TAPI_MISC_NAM_INFO_MASK_NAM_NUM = 0x0400, /**< TBD */ + TAPI_MISC_NAM_INFO_MASK_ALL = 0x8000 /**< TBD */ +} TelMiscNamInfoMaskType_t; + +/** + * @brief Enumeration for the NAMIndex field. + * @since_tizen 2.3 + */ +typedef enum { + TAPI_MISC_NAM_1 = 0x00, /**< TBD */ + TAPI_MISC_NAM_2, /**< TBD */ + TAPI_MISC_NAM_3, /**< TBD */ + TAPI_MISC_NAM_4, /**< TBD */ + TAPI_MISC_NAM_5 /**< TBD */ +} TelMiscNamIndex_t; + + +/** + * @brief Enumeration for the day of the week. + * @since_tizen 2.3 + */ +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; + +/** + * @brief Enumeration for daylight adjustment. + * @since_tizen 2.3 + */ +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; + +/** + * @brief Enumeration for the types of data. + * @since_tizen 2.3 + */ +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; + +/** + * @brief The structure type for Mobile Equipment Version Information. + * @since_tizen 2.3 + */ +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; + +/** + * @brief The structure type for Mobile Equipment Serial Number Information. + * @since_tizen 2.3 + */ +typedef struct { + unsigned char szEsn[TAPI_MISC_ME_SN_LEN_MAX]; /**< Number */ + unsigned char szMeid[TAPI_MISC_ME_SN_LEN_MAX]; /**< Number */ + unsigned char szImei[TAPI_MISC_ME_SN_LEN_MAX]; /**< Number */ + unsigned char szImeiSv[TAPI_MISC_ME_SN_LEN_MAX]; /**< Number */ +} TelMiscSNInformation; + +/** + * @brief The structure type for the event delivery - event type. + * @since_tizen 2.3 + */ +typedef struct { + struct timeval time; /**< Time information */ + unsigned short type; /**< Type of event */ + unsigned short code; /**< Code */ + long value; /**< Value */ +} input_event_t; + +/** + * @brief The structure type for Diagnostic Key Code Information. + * @since_tizen 2.3 + */ +typedef struct { + unsigned char keycode; /**< Key Code */ + unsigned char keyhold; /**< Key Hold */ +} TelMiscDiagKeyCodeInfomation; + +/** + * @brief The structure type for alarm info. + * @since_tizen 2.3 + */ +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 the week */ +} TelMiscAlarmInfo_t; + +/** + * @brief The structure type for the alarm response. + * @since_tizen 2.3 + */ +typedef struct { + TelMiscAlarmMode_t validity; /**< Validity */ + TelMiscAlarmInfo_t alarm_info; /**< Alarm info */ +} TelMiscAlarmStatus_t; + +/** + * @brief The structure type for nam info. + * @since_tizen 2.3 + */ +typedef struct { + unsigned short nam_info_mask; /**< TBD */ + unsigned char nam_total; /**< TBD */ // this field is not used in case of nam set req. + unsigned char nam_current_index; /**< TBD */ + unsigned char nam_req_index; /**< TBD */ + unsigned char nam_auto; /**< TBD */ + unsigned char nam_mcc[TAPI_MISC_MCC_LEN_MAX+1]; /**< TBD */ + unsigned char nam_mnc[TAPI_MISC_MCC_LEN_MAX+1]; /**< TBD */ + unsigned char nam_min[TAPI_MISC_MIN_LEN_MAX+1]; /**< TBD */ + unsigned char nam_mdn[TAPI_MISC_MDN_LEN_MAX+1]; /**< TBD */ + unsigned char nam_name[TAPI_MISC_NAME_LEN_MAX+1]; /**< TBD */ +} TelMiscNamInfo_t; + +/** + * @brief The structure type for time info. + * @since_tizen 2.3 + */ +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 the week */ + unsigned long plmn; /**< Day of the week */ +} tapi_misc_time_zone_info_type; + +#ifdef __cplusplus +} +#endif + +#endif // _TEL_MISC_H_ + +/** + * @} + */ diff --git a/include/TelNetwork.h b/include/TelNetwork.h new file mode 100644 index 0000000..90a3076 --- /dev/null +++ b/include/TelNetwork.h @@ -0,0 +1,684 @@ +/* + * libslp-tapi + * + * Copyright (c) 2014 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Ja-young Gu + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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 TelNetwork.h + */ + +/** + * @internal + * @addtogroup CAPI_TELEPHONY_SERVICE_NETWORK + * @{ + */ + +#ifndef _TEL_NETWORK_H_ +#define _TEL_NETWORK_H_ + +#ifdef __cplusplus +extern "C" +{ +#endif + +/** + * @brief Definition for the maximum network order. + * @since_tizen 2.3 + */ +#define TAPI_NETWORK_ORDER_MAX 5 + +/** + * @brief Definition for the maximum network list. + * @since_tizen 2.3 + */ +#define TAPI_NETWORK_LIST_MAX 15 + +/** + * @brief Definition for the maximum length of the network PLMN. + * @since_tizen 2.3 + */ +#define TAPI_NETWORK_PLMN_LEN_MAX 6 + +/** + * @brief Definition for the maximum length of the network name. + * @since_tizen 2.3 + */ +#define TAPI_NETWORK_NAME_LEN_MAX 40 + +/** + * @brief Definition for the maximum length of the network service provider's name. + * @since_tizen 2.3 + */ +#define TAPI_NETWORK_SPN_LEN_MAX 20 +/** + * @brief Definition for the maximum records of the preferred PLMN list. + * @since_tizen 2.3 + */ +#define TAPI_PREFERRED_PLMN_RECORDS_MAX 150 + +/** + * @brief Definition for the maximum network display info elements. + * @since_tizen 2.3 + */ +#define TAPI_NETWORK_DISPLAY_INFO_ELEMENTS 4 + +/** + * @brief Definition for the maximum length of the network home zone tag. + * @since_tizen 2.3 + */ +#define TAPI_NETWORK_HOMEZONE_TAG_MAX_LEN 13 + +/** + * @brief Definition for the maximux network CS display index. + * @since_tizen 2.3 + */ +#define TAPI_NETWORK_CS_DISP_INDEX 0 + +/** + * @brief Definition for the maximum network PS display index. + * @since_tizen 2.3 + */ +#define TAPI_NETWORK_PS_DISP_INDEX 1 + +/** + * @brief Definition for the maximum network SVC display index. + * @since_tizen 2.3 + */ +#define TAPI_NETWORK_SVC_DISP_INDEX 2 + +/** + * @brief Definition for the maximum network roaming display index. + * @since_tizen 2.3 + */ +#define TAPI_NETWORK_ROAM_DISP_INDEX 3 + +/** + * @brief Definition for the maximum number of subscriber services. + * @since_tizen 2.3 + */ +#define TAPI_NETWORK_SUBS_SVC_NUM_MAX 6 + +/** + * @brief Definition for the maximum length of the subscriber number. + * @since_tizen 2.3 + */ +#define TAPI_NETWORK_SUBS_NUM_LEN_MAX 40 + +/** + * @brief Definition for the maximum length of the subscriber name. + * @since_tizen 2.3 + */ +#define TAPI_NETWORK_SUBS_ALPHA_LEN_MAX 16 + +/** + * @brief Definition for the maximum GERAN neighboring cell list. + * @since_tizen 2.3 + */ +#define TAPI_NETWORK_GERAN_NEIGHBORING_CELL_LIST_MAX 6 + +/** + * @brief Definition for the maximum UMTS neighboring cell list. + * @since_tizen 2.3 + */ +#define TAPI_NETWORK_UMTS_NEIGHBORING_CELL_LIST_MAX 24 + +/* This value defines the network mode */ +/** + * @brief Definition for the "set network mode to automatic" value. + * @since_tizen 2.3 + */ +#define TAPI_NETWORK_MODE_AUTO 0x00 + +/** + * @brief Definition for "set network mode to GSM" value. + * @since_tizen 2.3 + */ +#define TAPI_NETWORK_MODE_GSM 0x01 + +/** + * @brief Definition for the "set network mode to WCDMA" value. + * @since_tizen 2.3 + */ +#define TAPI_NETWORK_MODE_WCDMA 0x02 + +/** + * @brief Definition for the "set network mode to 1XRTT" value. + * @since_tizen 2.3 + */ +#define TAPI_NETWORK_MODE_1XRTT 0x04 + +/** + * @brief Definition for the "set network mode to LTE" value. + * @since_tizen 2.3 + */ +#define TAPI_NETWORK_MODE_LTE 0x08 + +/** + * @brief Definition for the "set network mode to EVDO" value. + * @since_tizen 2.3 + */ +#define TAPI_NETWORK_MODE_EVDO 0x10 + +/** + * @brief Definition for the "set network mode to CDMA" value. + * @since_tizen 2.3 + */ +#define TAPI_NETWORK_MODE_CDMA 0x14 + +/** + * @brief Enumeration for the network selection modes. + * @since_tizen 2.3 + */ +typedef enum { + TAPI_NETWORK_SELECTIONMODE_AUTOMATIC, /**< Network selection is in the Automatic selection mode */ + TAPI_NETWORK_SELECTIONMODE_MANUAL /**< Network selection is in the Manual selection mode (Not applicable to CDMA) */ +} TelNetworkSelectionMode_t; + +/** + * @brief Enumeration for the network emergency callback mode states (3GPP2 specific enum). + * @since_tizen 2.3 + */ +typedef enum { + TAPI_NETWORK_EMERGENCY_CALLBACK_MODE_ENTER, /**< Enter emergency callback mode */ + TAPI_NETWORK_EMERGENCY_CALLBACK_MODE_EXIT /**< Exit emergency callback mode */ +} TelNetworkEmergencyCallbackMode_t; + +/** + * @brief Enumeration for the status of the network service. + * @since_tizen 2.3 + */ +typedef enum { + TAPI_NETWORK_SERVICE_LEVEL_NO, /**< No service available in the network ME is camped */ + TAPI_NETWORK_SERVICE_LEVEL_EMERGENCY, /**< Only emergency service available in the network ME is camped */ + TAPI_NETWORK_SERVICE_LEVEL_FULL, /**< FULL service available in the network ME is camped */ + TAPI_NETWORK_SERVICE_LEVEL_SEARCH /**< Searching for service */ +} TelNetworkServiceLevel_t; + +/** + * @brief Enumeration for the service types of TAPI. + * @since_tizen 2.3 + */ +typedef enum { + TAPI_NETWORK_SERVICE_TYPE_UNKNOWN = 0x0, /**< Service type is Unknown */ + TAPI_NETWORK_SERVICE_TYPE_NO_SERVICE, /**< No Service available */ + TAPI_NETWORK_SERVICE_TYPE_EMERGENCY, /**< Service type is Emergency */ + TAPI_NETWORK_SERVICE_TYPE_SEARCH, /**< Service type is Searching */ + TAPI_NETWORK_SERVICE_TYPE_2G, /**< Service type is 2G. In case of CDMA, service type is set to 2G when System Type is IS95A/IS95B/CDMA_1X */ + TAPI_NETWORK_SERVICE_TYPE_2_5G, /**< Service type is 2.5G */ + TAPI_NETWORK_SERVICE_TYPE_2_5G_EDGE, /**< Service type is 2.5G (EDGE) */ + TAPI_NETWORK_SERVICE_TYPE_3G, /**< Service type is 3G. In case of CDMA, service type is set to 3G when System Type is EVDO_REV_0/REV_A/REV_B/EHRPD */ + TAPI_NETWORK_SERVICE_TYPE_HSDPA, /**< Service type is HSDPA */ + TAPI_NETWORK_SERVICE_TYPE_LTE /**< Service type is LTE */ +} TelNetworkServiceType_t; + +/** + * @brief Enumeration for the system types of TAPI. + * @since_tizen 2.3 + */ +typedef enum +{ + TAPI_NETWORK_SYSTEM_NO_SRV, /**< No Service available */ + TAPI_NETWORK_SYSTEM_GSM, /**< Available service is GSM */ + TAPI_NETWORK_SYSTEM_GPRS, /**< Available service is GPRS */ + TAPI_NETWORK_SYSTEM_EGPRS, /**< Available service is EGPRS */ + TAPI_NETWORK_SYSTEM_PCS1900, /**< Available service is PCS1900 band */ + TAPI_NETWORK_SYSTEM_UMTS, /**< Available service is UMTS */ + TAPI_NETWORK_SYSTEM_GSM_AND_UMTS, /**< Both GSM and UMTS systems available */ + TAPI_NETWORK_SYSTEM_HSDPA, /**< Available service is HSDPA */ + TAPI_NETWORK_SYSTEM_IS95A, /**< Available service is IS95A */ + TAPI_NETWORK_SYSTEM_IS95B, /**< Available service is IS95B */ + TAPI_NETWORK_SYSTEM_CDMA_1X, /**< Available service is CDMA 1X */ + TAPI_NETWORK_SYSTEM_EVDO_REV_0, /**< Available service is EV-DO rev0 */ + TAPI_NETWORK_SYSTEM_1X_EVDO_REV_0_HYBRID, /**< Available service is 1X and EV-DO rev0 */ + TAPI_NETWORK_SYSTEM_EVDO_REV_A, /**< Available service is EV-DO revA */ + TAPI_NETWORK_SYSTEM_1X_EVDO_REV_A_HYBRID, /**< Available service is 1X and EV-DO revA */ + TAPI_NETWORK_SYSTEM_EVDO_REV_B, /**< Available service is EV-DO revB */ + TAPI_NETWORK_SYSTEM_1X_EVDO_REV_B_HYBRID, /**< Available service is 1X and EV-DO revB */ + TAPI_NETWORK_SYSTEM_EVDV, /**< Available service is EV-DV */ + TAPI_NETWORK_SYSTEM_EHRPD, /**< Available service is EHRPD */ + TAPI_NETWORK_SYSTEM_LTE /**< Available service is LTE */ +} TelNetworkSystemType_t; + +/** + * @brief Enumeration for the different network bands. + * @since_tizen 2.3 + */ +typedef enum +{ + TAPI_NETWORK_BAND_TYPE_ANY = 0x00, /**< All bands can be tried */ + TAPI_NETWORK_BAND_TYPE_GSM850, /**< This member sets the band to GSM 850 */ + TAPI_NETWORK_BAND_TYPE_GSM_900_1800, /**< This member sets the band to GSM 900_1800 */ + TAPI_NETWORK_BAND_TYPE_GSM1900, /**< GSM 1900 */ + TAPI_NETWORK_BAND_TYPE_GSM, /**< This member sets all GSM bands */ + TAPI_NETWORK_BAND_TYPE_WCDMA, /**< This member sets all WCDMA bands */ + TAPI_NETWORK_BAND_TYPE_WCDMA850, /**< This member sets the band to WCDMA 850 */ + TAPI_NETWORK_BAND_TYPE_WCDMA1900, /**< This member sets the band to WCDMA 1900 */ + TAPI_NETWORK_BAND_TYPE_WCDMA2100, /**< This member sets the band to WCDMA 2100 */ + TAPI_NETWORK_BAND_TYPE_GSM900, /**< GSM 900 */ + TAPI_NETWORK_BAND_TYPE_GSM1800, /**< This member sets the band to GSM 1800 */ + TAPI_NETWORK_BAND_TYPE_GSM_850_1900, /**< This member sets the band to GSM 850_1900 */ + TAPI_NETWORK_BAND_TYPE_LTE_BAND_4, /**< This member sets the band to LTE BAND 4 */ + TAPI_NETWORK_BAND_TYPE_LTE_BAND_17 /**< This member sets the band to LTE BAND 17 */ +} TelNetworkBand_t; + +/** + * @brief Enumeration for the different network operation causes. + * @since_tizen 2.3 + */ +typedef enum +{ + TAPI_NETWORK_NO_ERR = 0x00, /**< There is no error for any network operation */ + TAPI_NETWORK_OPERATION_ABORTED, /**< This error is sent when an operation is aborted */ + TAPI_NETWORK_OPERATION_FAILED, /**< There is an error for a network operation */ + TAPI_NETWORK_PHONE_IN_USE_ERR, /**< This error will be returned when a network operation is tried while the phone is in use(eg: Voice / Data call in progress due to which network operation failed) */ + TAPI_NETWORK_OFFLINE_ERR, /**< This error is sent when a network option is tried when the phone is in the offline mode */ + TAPI_NETWORK_CONFIG_SETTINGS_FAILURE_ERR, /**< This error is sent when a modem is unable to process the config settings information */ + TAPI_NETWORK_INTERNAL_FAILURE_ERR, /**< This error is used to indicate an internal failure */ + TAPI_NETWORK_MEMORY_FULL_ERR /**< This error is caused when the memory is full */ +} TelNetworkOperationCause_t; + +/** + * @brief Enumeration for the operation that can be done on a preferred PLMN. + * @since_tizen 2.3 + */ +typedef enum +{ + TAPI_NETWORK_PREF_PLMN_ADD=0x01, /**< Addition to the Network Preferred PLMN list */ + TAPI_NETWORK_PREF_PLMN_EDIT, /**< Edit the network Preferred PLMN list */ + TAPI_NETWORK_PREF_PLMN_DELETE /**< Delete the entry to the network Preferred PLMN list */ +} TelNetworkPreferredPlmnOp_t; + +/** + * @brief Enumeration for the network PLMN type. + * @since_tizen 2.3 + */ +typedef enum +{ + TAPI_UNKNOWN_PLMN=0, /**< Network PLMN type - Unknown */ + TAPI_HOME_PLMN , /**< Network PLMN type - Home PLMN */ + TAPI_AVAILABLE_PLMN, /**< Network PLMN type - Available */ + TAPI_FORBIDDEN_PLMN, /**< Network PLMN type - Forbidden */ +}TelNetworkPlmnType_t; + +/** + * @brief Enumeration for the network home zone command. + * @since_tizen 2.3 + */ +typedef enum +{ + TAPI_NETWORK_ZONEINFO_NONE, /**< Network Zone info none */ + TAPI_NETWORK_ZONEINFO_IND, /**< Network Zone info indication */ + TAPI_NETWORK_ZONEINFO_CLEAR /**< Network Zone info clear */ +}TelNetworkHomeZoneCommand_t; + +/** + * @brief Enumeration for the network home zone type. + * @since_tizen 2.3 + */ +typedef enum +{ + TAPI_NETWORK_ZONE_NONE, /**< Network Zone Type none */ + TAPI_NETWORK_ZONETYPE_HOMEZONE, /**< Network Zone Type Home zone */ + TAPI_NETWORK_ZONETYPE_CITYZONE, /**< Network Zone Type City zone */ +}TelNetworkHomeZone_t; + +/** + * @brief Enumeration for the network name display condition type. + * @since_tizen 2.3 + */ +typedef enum +{ + TAPI_NETWORK_DISP_INVALID= 0x00, /**< Invalid Display Condition */ + TAPI_NETWORK_DISP_SPN = 0x01, /**< Display Condition is SPN */ + TAPI_NETWORK_DISP_PLMN = 0x02, /**< Display Condition is PLMN */ + TAPI_NETWORK_DISP_SPN_PLMN = 0x03, /**< Display Condition is SPN or PLMN */ +}TelNetworkNameDispCondition_t; + +/** + * @brief Enumeration for the CDMA Preferred Network Type(CDMA only). + * @since_tizen 2.3 + */ +typedef enum +{ + TAPI_NETWORK_PREF_NET_TYPE_HOME_ONLY = 0, + TAPI_NETWORK_PREF_NET_TYPE_AFFILIATED = 1, + TAPI_NETWORK_PREF_NET_TYPE_AUTOMATIC = 2, + TAPI_NETWORK_PREF_NET_TYPE_AUTOMATIC_A = 3, + TAPI_NETWORK_PREF_NET_TYPE_AUTOMATIC_B = 4, + TAPI_NETWORK_PREF_NET_TYPE_ROAM_DOMESTIC = 5, + TAPI_NETWORK_PREF_NET_TYPE_ROAM_INTERNATIONAL = 6, + TAPI_NETWORK_PREF_NET_TYPE_ROAM_DUAL = 7, + TAPI_NETWORK_PREF_NET_TYPE_BLANK = 8, +} TelNetworkPrefNetType_t; + +/** + * @brief Enumeration for the CDMA PRL Preferred Only field stored in the PRL(CDMA only). + * @since_tizen 2.3 + */ +typedef enum +{ + TAPI_NETWORK_PRL_PREF_ONLY_OFF, /**< Preferred Only is FALSE */ + TAPI_NETWORK_PRL_PREF_ONLY_ON, /**< Preferred Only is TRUE */ + TAPI_NETWORK_PRL_PREF_ONLY_NONE /**< There isn't any Preferred Only Option */ +} TelNetworkPrlPrefOnly_t; + +/** + * @brief Enumeration for the packet service protocol type. + * @since_tizen 2.3 + */ +typedef enum { + TAPI_NETWORK_PS_TYPE_UNKNOWN, + TAPI_NETWORK_PS_TYPE_HSDPA, + TAPI_NETWORK_PS_TYPE_HSUPA, + TAPI_NETWORK_PS_TYPE_HSPA, + TAPI_NETWORK_PS_TYPE_HSPAP +} TelNetworkPsType_t; + +/** + * @brief Enumeration for the network name option. + * @since_tizen 2.3 + */ +typedef enum { + TAPI_NETWORK_NAME_OPTION_NONE, + TAPI_NETWORK_NAME_OPTION_SPN, + TAPI_NETWORK_NAME_OPTION_OPERATOR, + TAPI_NETWORK_NAME_OPTION_ANY +} TelNetworkNameOption_t; + +/** + * @brief Enumeration for the possible 'default' Data Subscriptions. + * @since_tizen 2.3 + */ +typedef enum { + TAPI_NETWORK_DEFAULT_DATA_SUBS_UNKNOWN = -1, /**< Unknown status */ + TAPI_NETWORK_DEFAULT_DATA_SUBS_SIM1 = 0, /**< SIM 1 */ + TAPI_NETWORK_DEFAULT_DATA_SUBS_SIM2 /**< SIM 2 */ +} TelNetworkDefaultDataSubs_t; + +/** + * @brief TelNetworkDefaultSubs_t + * This enumeration defines possible 'default' Subscription for CS (Voice) + * @since_tizen 2.3 + */ +typedef enum { + TAPI_NETWORK_DEFAULT_SUBS_UNKNOWN = -1, /**< Unknown status **/ + TAPI_NETWORK_DEFAULT_SUBS_SIM1 = 0, /**< SIM 1 network **/ + TAPI_NETWORK_DEFAULT_SUBS_SIM2 /**< SIM 2 network **/ +} TelNetworkDefaultSubs_t; + +/** + * @brief The structure type for the preferred PLMN information. + * @since_tizen 2.3 + */ +typedef struct { + unsigned char Index; /**< Network Preferred PLMN list index */ + char Plmn[TAPI_NETWORK_PLMN_LEN_MAX + 1]; /**< Network Preferred PLMN */ + char network_name[TAPI_NETWORK_NAME_LEN_MAX + 1]; /**< Network Name */ + char service_provider_name[TAPI_NETWORK_NAME_LEN_MAX + 1]; /**< Service provider name */ + TelNetworkSystemType_t SystemType; /**< Network system type */ +} TelNetworkPreferredPlmnInfo_t; + +/** + * @brief The structure type for the preferred PLMN list. + * @since_tizen 2.3 + */ +typedef struct { + unsigned int NumOfPrefPlmns; /**< Number of preferred PLMNs in the list */ + TelNetworkPreferredPlmnInfo_t PrefPlmnRecord[TAPI_PREFERRED_PLMN_RECORDS_MAX]; /**< Preferred PLMNs list */ +} TelNetworkPreferredPlmnList_t; + +/** + * @brief The structure type for the location area code and cell ID. + * @since_tizen 2.3 + */ +typedef struct { + unsigned short LocationAreaCode; /**< Network Location area code */ + unsigned long CellId; /**< Network Cell ID */ +} TelNetworkLocationCellInfo_t; + +/** + * @brief The structure type for the network status. + * @since_tizen 2.3 + */ +typedef struct { + unsigned char svctype; /**< Network SVC type */ + unsigned char roaming; /**< Network roaming */ +} TelNetworkStatus_t; + +/** + * @brief The structure type for the network CS, PS status. + * @since_tizen 2.3 + */ +typedef struct { + unsigned char cstype; /**< Network CS type */ + unsigned char pstype; /**< Network PS type */ +} TelNetworkCsPsStatus_t; + +/** + * @brief The structure type for the network identity. + * @since_tizen 2.3 + */ +typedef struct { + char network_name[TAPI_NETWORK_NAME_LEN_MAX + 1]; /**< Network Name */ + char service_provider_name[TAPI_NETWORK_NAME_LEN_MAX + 1]; /**< Service provider name */ + char plmn[TAPI_NETWORK_PLMN_LEN_MAX+1]; /**< Network PLMN */ + unsigned int plmn_id; /**< PLMN ID */ + TelNetworkPlmnType_t type_of_plmn; /**< PLMN type */ + TelNetworkSystemType_t access_technology; /**< Access technology */ +} TelNetworkIdentity_t; + +/** + * @brief The structure type for the network PLMN list. + * @since_tizen 2.3 + */ +typedef struct { + char networks_count; /**< Network PLMN count */ + TelNetworkIdentity_t network_list[TAPI_NETWORK_LIST_MAX]; /**< Network list */ +} TelNetworkPlmnList_t; + +/** + * @brief The structure type for network display info. + * @since_tizen 2.3 + */ +typedef struct { + int DisplayInfo[TAPI_NETWORK_DISPLAY_INFO_ELEMENTS]; /**< Network display info */ +} TelNetworkDisplayInfo_t; + +typedef struct { + TelNetworkNameDispCondition_t DispCondition; /**< Display condition of SPN & PLMN */ + unsigned char Spn[TAPI_NETWORK_SPN_LEN_MAX + 1]; /**< SPN value */ + unsigned char Plmn[TAPI_NETWORK_NAME_LEN_MAX + 1]; /**< PLMN value, in 2G case if DispPlmn is @c true and the PLMN value is @c NULL then the network module has to display a registered PLMN */ +} TelNetworkSpnPlmnDisplayInfo_t; + +/** + * @brief The structure type for the network's SPN, MCC, and MNC info. + * @since_tizen 2.3 + */ +typedef struct { + int mcc; /**< Network MCC */ + int mnc; /**< Network MNC */ + char bDispCondition; /**< Display condition */ + char short_network_name[TAPI_NETWORK_NAME_LEN_MAX + 1]; /**< Network short name */ + char spn_name[TAPI_NETWORK_NAME_LEN_MAX + 1]; /**< Network SPN name */ +} TelNetworkSpnMccMncInfo_t; + +/** + * @brief The structure type for information related to a CDMA system. + * @since_tizen 2.3 + */ +typedef struct { + int carrier; /**< CDMA Carrier */ + unsigned int system_id; /**< System ID */ + unsigned int network_id; /**< Network ID */ + unsigned int base_station_id; /**< Base station ID */ + int base_station_latitude; /**< Latitude of the current base station */ + int base_station_longitude; /**< Longitude of the current base station */ + unsigned int registration_zone; /**< Registration Zone */ + unsigned int pilot_offset; /**< Pilot Offset */ +} TelNetworkCdmaSysInfo_t; + +typedef struct { + TelNetworkSystemType_t act; /**< Access technology */ + char plmn[TAPI_NETWORK_PLMN_LEN_MAX+1]; /**< Network PLMN */ + union { + int lac; /**< Location Area Code - 3GPP Only */ + TelNetworkCdmaSysInfo_t cdma_info; /**< CDMA Only */ + }info; +} TelNetworkServing_t; + +typedef struct { + int cell_id; /**< Cell ID (@c -1 indicates that cell ID information is not present) */ + int lac; /**< Location area code (this field is ignored when @a cell_id is not present) */ + int bcch; /**< Broadcast Control Channel Frequency number */ + int bsic; /**< Base Station Identification Code */ + int rxlev; /**< Received Signal Strength level. Valid values are (0-63, 99) + * Reference: 33GPP TS 45.008 [20] subclause 8.1.4 + - Rxlev 0 is a signal strength less than -110 dBm + - Rxlev 1 is -110 dBm to -109 dBm + - Rxlev 2 is -109 dBm to -108 dBm + - ... + - Rxlev 62 is -49 dBm to -48 dBm + - Rxlev 63 is greater than -48 dBm + - Rxlev 99 is not known or detectable + */ +} TelNetworkGeranCellInfo_t; + +typedef struct { + int cell_id; /**< UCID (@c -1 indicates that cell ID information is not present) */ + /* UCID : RNCID + Cell ID(16 bit) */ + int lac; /**< Location area code (this field is ignored when @a cell_id is not present) */ + int arfcn; /**< UTRA Absolute RF Channel Number */ + int psc; /**< Primary scrambling Code */ + int rscp; /**< Received Signal Code Power. Valid values are (0-96, 255) + * Reference : 3GPP TS 25.133 [95] subclause 9.1.1.3 and 3GPP TS 25.123 [96] subclause 9.1.1.1.3) + - Rscp 0 is a signal strength less than -120 dBm + - Rscp 1 is -120 dBm to -119 dBm + - Rscp 2 is -119 dBm to -118 dBm + - ... + - Rscp 95 is -26 dBm to -25 dBm + - Rscp 96 is greater than -25 dBm + - Rscp 255 is not known or detectable + */ +} TelNetworkUmtsCellInfo_t; + +typedef struct { + int cell_id; /**< Cell ID (@c -1 indicates that cell ID information is not present) */ + int lac; /**< Location area code (this field is ignored when @a cell_id is not present) */ + int earfcn; /**< E-UTRA Absolute RF Channel Number */ + int tac; /**< Tracking area code */ + int rssi; /**< RSSI in dBm(signed) */ +} TelNetworkLteCellInfo_t; + +typedef struct { + unsigned int system_id; /**< System ID */ + unsigned int network_id; /**< Network ID */ + unsigned int base_station_id; /**< Base station ID */ + unsigned int reference_pn; /**< Reference PN */ + int base_station_latitude; /**< Latitude of the current base station */ + int base_station_longitude; /**< Longitude of the current base station */ +} TelNetworkCdmaCellInfo_t; + +typedef struct { + TelNetworkSystemType_t act; /**< Access technology */ + int mcc; /**< Mobile Country Code */ + int mnc; /**< Mobile Network Code */ + union { + TelNetworkGeranCellInfo_t geran; /**< GERAN cell info */ + TelNetworkUmtsCellInfo_t umts; /**< UMTS cell info */ + TelNetworkLteCellInfo_t lte; /**< LTE cell info */ + TelNetworkCdmaCellInfo_t cdma; /**< CDMA cell info */ + } cell; /**< TBD */ +} TelNetworkServingCellInfo_t; + +typedef struct { + TelNetworkServingCellInfo_t serving; /**< Serving cell info */ + int geran_list_count;/**< GERAN cell info list count */ + TelNetworkGeranCellInfo_t geran_list[TAPI_NETWORK_GERAN_NEIGHBORING_CELL_LIST_MAX];/**< GERAN cell info list */ + int umts_list_count;/**< UMTS cell info list count */ + TelNetworkUmtsCellInfo_t umts_list[TAPI_NETWORK_UMTS_NEIGHBORING_CELL_LIST_MAX];/**< UMTS cell info list */ +} TelNetworkNeighboringCellInfo_t; + +/** + * NEW NEW NEW + */ +typedef struct { + TelNetworkServiceLevel_t cs; /**< Circuit Switched status */ + TelNetworkServiceLevel_t ps; /**< Packet Swithced status */ + TelNetworkServiceType_t type; /**< Registration service type */ + int is_roaming; /**< Roaming status 1: TRUE; FALSE otherwise */ +} TelNetworkRegistrationStatus_t; + +struct tel_noti_network_signal_strength { + int dbm; /**< Signal Strenght in dBm */ +}; + +struct tel_noti_network_cell_info { + int lac; /**< Location Area Code */ + int cell_id; /**< Cell ID */ +}; + +struct tel_noti_network_change { + TelNetworkSystemType_t act; /**< Access technology */ + char plmn[TAPI_NETWORK_PLMN_LEN_MAX+1]; /**< Network PLMN */ +}; + +struct tel_noti_network_time_info { + int year; /**< TBD */ + int month; /**< TBD */ + int day; /**< TBD */ + int hour; /**< TBD */ + int minute; /**< TBD */ + int second; /**< TBD */ + int wday; /**< TBD */ + int gmtoff; /**< TBD */ + int dstoff; /**< TBD */ + int isdst; /**< TBD */ + char plmn[TAPI_NETWORK_PLMN_LEN_MAX+1]; /**< Network PLMN */ +}; + +struct tel_noti_network_identity { + char plmn[TAPI_NETWORK_PLMN_LEN_MAX+1]; /**< Network PLMN */ + char short_name[17]; /**< Short network name */ + char full_name[33]; /**< Full network name */ +}; + +struct tel_noti_network_emergency_callback_mode { + TelNetworkEmergencyCallbackMode_t mode; /**< Emergency Callback Mode status */ +}; + +struct tel_noti_network_neighboring_cell_info { + TelNetworkNeighboringCellInfo_t info; /**< Neighboring Cell Information */ +}; + +struct tel_noti_network_default_data_subs { + TelNetworkDefaultDataSubs_t default_subs; /**< 'default' Data Subscription */ +}; + +struct tel_noti_network_default_subs { + TelNetworkDefaultSubs_t default_subs; /**< 'default' Subscription */ +}; + +#ifdef __cplusplus +} +#endif + +#endif // _TEL_NETWORK_H_ + +/** +* @} +*/ diff --git a/mobile/include/TelPower.h b/include/TelPower.h similarity index 69% rename from mobile/include/TelPower.h rename to include/TelPower.h index ffeb191..c00b6a2 100644 --- a/mobile/include/TelPower.h +++ b/include/TelPower.h @@ -1,7 +1,7 @@ /* * libslp-tapi * - * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * Copyright (c) 2014 Samsung Electronics Co., Ltd. All rights reserved. * * Contact: Ja-young Gu * @@ -19,64 +19,73 @@ */ /** + * @file TelPower.h + */ + +/** * @internal - * @ingroup TelephonyAPI - * @addtogroup POWER_TAPI POWER + * @addtogroup CAPI_TELEPHONY_SERVICE_MODEM * @{ - * - * 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 - #ifdef __cplusplus extern "C" { #endif /** - * This defines the phone power reset commands. + * @brief Enumeration for the phone power reset commands. + * @since_tizen 2.3 */ typedef enum { - TAPI_PHONE_POWER_OFF = 0, TAPI_PHONE_POWER_ON, TAPI_PHONE_POWER_RESET, + TAPI_PHONE_POWER_ON = 0, + TAPI_PHONE_POWER_OFF, + TAPI_PHONE_POWER_RESET, + TAPI_PHONE_POWER_LOW, + TAPI_PHONE_POWER_MAX = TAPI_PHONE_POWER_LOW } tapi_power_phone_cmd_t; /** - * This defines the phone power status values. + * @brief Enumeration for the phone power status values. + * @since_tizen 2.3 */ typedef enum { - TAPI_PHONE_POWER_STATUS_ON = 0, TAPI_PHONE_POWER_STATUS_OFF, TAPI_PHONE_POWER_STATUS_ERROR, + TAPI_PHONE_POWER_STATUS_UNKNOWN = -1, + TAPI_PHONE_POWER_STATUS_ON, + TAPI_PHONE_POWER_STATUS_OFF, + TAPI_PHONE_POWER_STATUS_RESET, + TAPI_PHONE_POWER_STATUS_LOW, + TAPI_PHONE_POWER_STATUS_ERROR } tapi_power_phone_power_status_t; /** - * Use to Enter or Leave Flight Mode. - * + * @details Enumeration for flight modes. + * @since_tizen 2.3 */ 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_MAX /**< TBD */ } 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_MAX /**< TBD */ } tapi_power_flight_mode_resp_type_t; /** - * This enum defines the phone battery status levels. + * @brief Enumeration for the phone battery status levels. * + * @details * 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 + * @since_tizen 2.3 */ typedef enum { TAPI_POWER_BATT_STAT_POWER_OFF_LEVEL = 0x01, /**< Power Off Level */ diff --git a/include/TelSat.h b/include/TelSat.h new file mode 100644 index 0000000..e88dcb5 --- /dev/null +++ b/include/TelSat.h @@ -0,0 +1,793 @@ +/* + * libslp-tapi + * + * Copyright (c) 2014 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Ja-young Gu + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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 TelSat.h + */ + +/** + * @internal + * @addtogroup CAPI_TELEPHONY_SERVICE_SAT + * @{ + */ + +#ifndef _TEL_SAT_H_ +#define _TEL_SAT_H_ + +#include +#include +#include +#include +#include +#include + +#ifdef __cplusplus +extern "C" +{ +#endif + +/** + * @brief Definition for the maximum length of a menu title. + * @since_tizen 2.3 + */ +#define TAPI_SAT_DEF_TITLE_LEN_MAX 255 + +/** + * @brief Definition for the maximum length of a menu item. + * @since_tizen 2.3 + */ +#define TAPI_SAT_DEF_ITEM_STR_LEN_MAX 50 + +/** + * @brief Definition for the maximum length of a text string. + * @since_tizen 2.3 + */ +#define TAPI_SAT_DEF_TEXT_STRING_LEN_MAX 500 + +/** + * @brief Definition for the bit mask of a contact. + * @since_tizen 2.3 + */ +#define TAPI_SAT_DEF_BIT_MASK_CONTACT 0x01 + +/** + * @brief Definition for the bit mask of a message. + * @since_tizen 2.3 + */ +#define TAPI_SAT_DEF_BIT_MASK_MSG 0x02 + +/** + * @brief Definition for the bit mask of others. + * @since_tizen 2.3 + */ +#define TAPI_SAT_DEF_BIT_MASK_OTHER 0x04 + +/** + * @brief Definition for the refresh file list. + * @since_tizen 2.3 + */ +#define TAPI_SAT_REFRESH_FILE_LIST 20 +#define TAPI_SAT_DEF_SS_LEN_MAX 250 +#define TAPI_SAT_DEF_USSD_LEN_MAX 250 + +// Telephony UI USER CONFIRM TYPE +/** + * @brief Enumeration for the UI user confirm type. + * @since_tizen 2.3 + */ +typedef enum +{ + TAPI_SAT_USER_CONFIRM_YES, /**< Informs that the user confirms yes */ + TAPI_SAT_USER_CONFIRM_NO_OR_CANCEL, /**< Informs that the user confirms no/cancel */ + TAPI_SAT_USER_CONFIRM_HELP_INFO, /**< Informs that the user wants help information */ + TAPI_SAT_USER_CONFIRM_END, /**< Informs that the user confirms end */ + TAPI_SAT_USER_CONFIRM_TIMEOUT, /**< Informs that the user did not respond */ +}TelSatUiUserConfirmType_t; + +// Telephony UI INKEY TYPE +/** + * @brief Enumeration for the UI inkey type. + * @since_tizen 2.3 + */ +typedef enum +{ + TAPI_SAT_INKEY_CONFIRM_NO = 0x00, /**< No */ + TAPI_SAT_INKEY_CONFIRM_YES = 0x01, /**< Yes */ +}TelSatUiInkeyYesNoCaseType_t; + +// Telephony UI DISPLAY STATUS +/** + * @brief Enumeration for the UI display status. + * @since_tizen 2.3 + */ +typedef enum +{ + TAPI_SAT_DISPLAY_SUCCESS = 0x00, /**< Informs about UI display success */ + TAPI_SAT_DISPLAY_FAIL = 0x01, /**< Informs about UI display failure */ +}TelSatUiDisplayStatusType_t; + +// TELEPHONY REFRESH APPLICATION TYPE +/** + * @brief Enumeration for the refresh application type. + * @since_tizen 2.3 + */ + typedef enum +{ + TAPI_SAT_REFRESH_CONTACT = 0x00, /**< Refresh application type - Phonebook */ + TAPI_SAT_REFRESH_MSG, /**< Refresh application type - SMS */ + TAPI_SAT_REFRESH_OTHER, /**< Refresh application type - Other */ + TAPI_SAT_REFRESH_MAX, /**< Maximum Enumeration Value */ +}TelSatRefreshAppType_t; + +// Telephony COMMAND PERFORMED RESULT +/** + * @brief Enumeration for the result of proactive command execution. + * @since_tizen 2.3 + */ +typedef enum +{ + TAPI_SAT_CMD_PERFORM_SUCCESS = 0x00, /**< Command performed successfully */ + TAPI_SAT_CMD_PERFORM_FAIL, /**< Command execution failed */ + TAPI_SAT_CMD_PERFORM_MAX, /**< Maximum Enumeration Value */ +}TelSatCommandPerformResultType_t; + +// Telephony CALL CONTROL TYPE +/** + * @brief Enumeration for the call control type. + * @since_tizen 2.3 + */ +typedef enum +{ + TAPI_SAT_CALL_CNF_NONE = 0x00, /**< Call control confirm type - None */ + TAPI_SAT_CALL_CNF_CALL, /**< Call control confirm type - Call */ + TAPI_SAT_CALL_CNF_SS, /**< Call control confirm type - SS */ + TAPI_SAT_CALL_CNF_USSD, /**< Call control confirm type - USSD */ + TAPI_SAT_CALL_CNF_MAX, /**< Maximum Enumeration Value */ +}TelSatCallCtrlType_t; + +// SAT UI USER CONFIRMATION INFO +/** + * @brief The structure type defining user confirmation data. + * @since_tizen 2.3 + */ +typedef struct +{ + int commandId; /**< Proactive Command Number sent by USIM */ + TelSatCommandType_t commandType; /**< Proactive Command Type */ + TelSatUiUserConfirmType_t keyType; /**< User Response Type */ + unsigned char* pAdditionalData; /**< Additional Data */ + int dataLen; /**< Additional Data Length */ +}TelSatUiUserConfirmInfo_t; + +// Telephony TEXT INFO +/** + * @brief The structure type defining character data for the SAT engine data structure. + * @since_tizen 2.3 + */ +typedef struct +{ + unsigned short stringLen; /**< Character data length */ + unsigned char string[TAPI_SAT_DEF_TEXT_STRING_LEN_MAX+1]; /**< Character data */ +}TelSatTextInfo_t; + +// Telephony MAIN MENU TITLE INFO +/** + * @brief The structure type defining the main menu title to check the SAT menu. + * @since_tizen 2.3 + */ +typedef struct +{ + int bIsMainMenuPresent; /**< Flag to check SAT main menu existence */ + TelSatTextInfo_t mainMenuTitle; /**< Main menu title data */ +}TelSatMainMenuTitleInfo_t; + +// Telephony DISPLAY TEXT DATA +/** + * @brief The structure type defining the display text proactive command for SAT UI. + * @since_tizen 2.3 + */ +typedef struct +{ + int commandId; /**< Proactive Command Number sent by USIM */ + TelSatTextInfo_t text; /**< Character data to display on screen */ + unsigned int duration; /**< The duration of the display */ + int bIsPriorityHigh; /**< Flag that indicates whether text is to be displayed if some other app is using the screen */ + int bIsUserRespRequired; /**< Flag that indicates whether user response is required */ + int b_immediately_resp; /**< TBD */ + TelSatIconIdentifierInfo_t iconId; /**< Icon Identifier */ +}TelSatDisplayTextInd_t; + +// Telephony INKEY DATA +/** + * @brief The structure type defining get inkey proactive command data for SAT UI. + * @since_tizen 2.3 + */ +typedef struct +{ + int commandId; /**< Proactive Command Number sent by USIM */ + TelSatInkeyType_t keyType; /**< Input Type: Character Set or Yes/No */ + TelSatUseInputAlphabetType_t inputCharMode; /**< Input character mode(SMS default, UCS2) */ + int bIsNumeric; /**< Is input character numeric(0-9, *, # and +) */ + int bIsHelpInfoAvailable; /**< Help info request flag */ + TelSatTextInfo_t text; /**< Character data to display on the screen */ + unsigned int duration; /**< Duration of the display */ + TelSatIconIdentifierInfo_t iconId; /**< Icon Identifier */ +}TelSatGetInkeyInd_t; + +// Telephony GET INPUT DATA +/** + * @brief The structure type defining get input proactive command data for SAT UI. + * @since_tizen 2.3 + */ +typedef struct +{ + int commandId; /**< Proactive Command Number sent by USIM */ + TelSatUseInputAlphabetType_t inputCharMode; /**< Input character mode(SMS default, UCS2) */ + int bIsNumeric; /**< Is input character numeric(0-9, *, # and +) */ + int bIsHelpInfoAvailable; /**< Help info request flag */ + int bIsEchoInput; /**< Flag that indicates whether to show input data on the screen */ + TelSatTextInfo_t text; /**< Character data to display on the screen*/ + TelSatRespLenInfo_t respLen; /**< Input data min, max length */ + TelSatTextInfo_t defaultText; /**< Default input character data */ + TelSatIconIdentifierInfo_t iconId; /**< Icon Identifier */ +}TelSatGetInputInd_t; + +// Telephony PLAY TONE DATA +/** + * @brief The structure type defining play tone proactive command data for an application. + * @since_tizen 2.3 + */ +typedef struct +{ + int commandId; /**< Proactive Command Number sent by USIM */ + TelSatTextInfo_t text; /**< Character data to display on the screen */ + TelSatToneInfo_t tone; /**< Tone info */ + unsigned int duration; /**< Duration for playing the tone */ + TelSatIconIdentifierInfo_t iconId; /**< Icon Identifier */ +}TelSatPlayToneInd_t; + +// Telephony UI info +/** + * @brief The structure type defining data for SAT UI. + * @since_tizen 2.3 + */ +typedef struct +{ + int commandId; /**< Proactive Command Number sent by USIM */ + int user_confirm; /**< TBD */ + TelSatTextInfo_t text; /**< Character data to display on the screen */ + TelSatIconIdentifierInfo_t iconId; /**< Icon Identifier */ +}TelSatSendUiInfo_t; + +// Telephony MENU ITEM DATA FOR SETUP MENU +/** + * @brief The structure type defining menu item info for the setup menu. + * @since_tizen 2.3 + */ +typedef struct +{ + char itemString[TAPI_SAT_DEF_ITEM_STR_LEN_MAX + 6]; /**< Menu item character data */ + char itemId; /**< Identifies the item on the menu that the user selected */ +}TelSatMenuInfo_t; + +// Telephony SETUP MENU INFO +/** + * @brief The structure type defining SAT main menu info. + * @since_tizen 2.3 + */ +typedef struct +{ + int commandId; /**< Proactive Command Number sent by USIM */ + int bIsMainMenuPresent; /**< TBD */ + char satMainTitle[TAPI_SAT_DEF_TITLE_LEN_MAX + 1]; /**< Menu title text */ + TelSatMenuInfo_t satMainMenuItem[TAPI_SAT_MENU_ITEM_COUNT_MAX]; /**< Menu items */ + unsigned short satMainMenuNum; /**< Number of menu items */ + int bIsSatMainMenuHelpInfo; /**< Flag for a help information request */ + int bIsUpdatedSatMainMenu; /**< TBD */ + TelSatIconIdentifierInfo_t iconId; /**< Icon Identifier */ + TelSatIconIdentifierListInfo_t iconIdList; /**< List of Icon Identifiers */ +}TelSatSetupMenuInfo_t; + +// Telephony SELECT ITEM DATA +/** + * @brief The structure type defining select item proactive command data for SAT UI. + * @since_tizen 2.3 + */ +typedef struct +{ + int commandId; /**< Proactive Command Number sent by USIM */ + int bIsHelpInfoAvailable; /**< Flag for a help information request */ + TelSatTextInfo_t text; /**< Menu title text */ + char defaultItemIndex; /**< Selected default item - default value is @c 0 */ + char menuItemCount; /**< Number of menu items */ + TelSatMenuItemInfo_t menuItem[TAPI_SAT_MENU_ITEM_COUNT_MAX]; /**< Menu items */ + TelSatIconIdentifierInfo_t iconId; /**< Icon Identifier */ + TelSatIconIdentifierListInfo_t iconIdList; /**< List of Icon Identifiers */ + +}TelSatSelectItemInd_t; + +// Telephony IDLE MODE TEXT DATA +/** + * @brief The structure type defining the setup idle mode text proactive command for the idle application. + * @since_tizen 2.3 + */ +typedef struct +{ + int commandId; /**< Proactive Command Number sent by USIM */ + TelSatTextInfo_t text; /**< Character data to display on the screen */ + TelSatIconIdentifierInfo_t iconId; /**< TBD */ +} TelSatSetupIdleModeTextInd_t; + +// Telephony REFRESH DATA +/** + * @brief The structure type defining refresh proactive command data for SAT UI. + * @since_tizen 2.3 + */ +typedef struct +{ + int commandId; /**< Proactive Command Number sent by USIM */ + unsigned int duration; /**< Duration of the display */ + TelSatCmdQualiRefresh_t refreshType; /**< Refresh mode */ +}TelSatRefreshIndUiInfo_t; + +// Telephony REFRESH DATA +/** + * @brief The structure type defining refresh proactive command data for applications that are concerned with files residing on USIM. + * @since_tizen 2.3 + */ +typedef struct +{ + int commandId; /**< Proactive Command Number sent by USIM */ + TelSatRefreshAppType_t appType; /**< Concerned application type */ + TelSatCmdQualiRefresh_t refreshMode; /**< Refresh mode */ + unsigned char fileCount; /**< Refresh file count */ + TelSimFileID_t fileId[TAPI_SAT_REFRESH_FILE_LIST]; /**< Refresh file identifier */ +}TelSatRefreshInd_t; + +// Telephony END PROACTIVE COMMAND INFO +/** + * @brief The structure type defining data objects to indicate to SAT UI, the end of execution of a specific proactive command by another application. + * @since_tizen 2.3 + */ +typedef struct +{ + int commandId; /**< Proactive Command Number sent by USIM */ + char commandType; /**< Command Type */ + TelSatCommandPerformResultType_t result; /**< Result of command execution by the application */ +}TelSatProactiveCmdEndIndInfo_t; + +// Telephony SEND SMS DATA +/** + * @brief The structure type defining send SMS proactive command data for the SMS application. + * @since_tizen 2.3 + */ +typedef struct +{ + int commandId; /**< Proactive Command Number sent by USIM */ + int bIsPackingRequired; /**< Flag to check if packing is required for SMS TPDU */ + TelSatAddressInfo_t address; /**< Destination address */ + TelSatSmsTpduInfo_t smsTpdu; /**< SMS TPDU data */ +} TelSatSendSmsIndSmsData_t; + +// Telephony SEND SS DATA +/** + * @brief The structure type defining send SS proactive command data for the SS application. + * @since_tizen 2.3 + */ +typedef struct +{ + int commandId; /**< Proactive Command Number sent by USIM */ + TelSimTypeOfNum_t ton; /**< Type of number */ + TelSimNumberingPlanIdentity_t npi; /**< Number plan identity */ + unsigned short ssStringLen; /**< TBD */ + unsigned char ssString[TAPI_SAT_DEF_SS_LEN_MAX+1]; /**< TBD */ +}TelSatSendSsIndSsData_t; + +// Telephony USSD DATA +/** + * @brief The structure type defining send USSD proactive command data for the USSD application. + * @since_tizen 2.3 + */ +typedef struct +{ + int commandId; /**< Proactive Command Number sent by USIM */ + unsigned char rawDcs; /**< Data coding scheme */ + unsigned short ussdStringLen; /**< TBD */ + unsigned char ussdString[TAPI_SAT_DEF_USSD_LEN_MAX+1]; /**< TBD */ +}TelSatSendUssdIndUssdData_t; + +// Telephony SEND DTMF DATA +/** + * @brief The structure type defining send DTMF proactive command data for the DTMF application. + * @since_tizen 2.3 + */ +typedef struct +{ + int commandId; /**< Proactive Command Number sent by USIM */ + int bIsHiddenMode; /**< Hidden mode flag */ + TelSatTextInfo_t dtmfString; /**< DTMF string data */ +}TelSatSendDtmfIndDtmfData_t; + +// Telephony SETUP CALL DATA +/** + * @brief The structure type defining setup call proactive command data for the call application. + * @since_tizen 2.3 + */ +typedef struct +{ + int commandId; /**< Proactive Command Number sent by USIM */ + TelSatCmdQualiSetupCall_t calltype; /**< Call type */ + TelSatTextInfo_t dispText; /**< Display data for calling */ + TelSatTextInfo_t callNumber; /**< Call number */ + unsigned int duration; /**< Maximum repeat duration */ + TelSatIconIdentifierInfo_t iconId; /**< Icon identifier for the call application */ +}TelSatSetupCallIndCallData_t; + +// Telephony LAUNCH BROWSER DATA +/** + * @brief The structure type defining launch browser proactive command data for the browser application. + * @since_tizen 2.3 + */ +typedef struct +{ + int commandId; /**< Proactive Command Number sent by USIM */ + TelSatUrlInfo_t url; /**< URL to connect */ + TelSatCmdQualiLaunchBrowser_t launchType; /**< Launch type */ + TelSatBrowserIdentityType_t IdentityType; /**< Browser Identity - default, HTML, and so on */ +}TelSatLaunchBrowserIndBrowserData_t; + +// Telephony PROVIDE LOCAL INFO DATA +/** + * @brief The structure type defining provide local info proactive command data for the application. + * @since_tizen 2.3 + */ +typedef struct +{ + int commandId; /**< Proactive Command Number sent by USIM */ + TelSatCmdQualiProvideLocalInfo_t localInfoType; /**< Provide Local Information Type */ +}TelSatProvideLocalInfoInd_t; + +// Telephony LANGUAGE NOTIFICATION DATA +/** + * @brief The structure type defining language notification proactive command data for the application. + * @since_tizen 2.3 + */ +typedef struct +{ + int commandId; /**< Proactive Command Number sent by USIM */ + int bSpecificLanguageNotification; /**< Flag for checking a specific language notification. If FALSE, non-specific language notification */ + TelSatLanguageInfo_t language; /**< Language info from the USIM application */ +}TelSatLanguageNotiInfoInd_t; + +// Telephony PLAY TONE RETURN INFO +/** + * @brief The structure type defining result data for the Play Tone proactive command. + * @since_tizen 2.3 + */ +typedef struct +{ + TelSatResultType_t resp; /**< Result response value */ +}TelSatSetupMenuRetInfo_t; + +// Telephony REFRESH RETURN INFO +/** + * @brief The structure type defining result data for the refresh proactive command. + * @since_tizen 2.3 + */ +typedef struct +{ + TelSatRefreshAppType_t appType; /**< Application type */ + TelSatResultType_t resp; /**< Result response value */ +}TelSatRefreshRetInfo_t; + +// Telephony CALL RETURN INFO +/** + * @brief The structure type defining result data for the setup call proactive command. + * @since_tizen 2.3 + */ +typedef struct +{ + TelSatResultType_t resp; /**< Result response value */ + int bIsTapiCauseExist; /**< Flag for checking tapi error cause */ + TelCallCause_t tapiCause; /**< Tapi call error cause */ + TelSsCause_t ssCause; /**< Tapi SS error cause */ + TelSatMeProblemType_t meProblem; /**< ME problem error cause */ + int bIsOtherInfoExist; /**< Call control result existence flag */ + TelSatCallCtrlProblemType_t permanentCallCtrlProblem; /**< Call control problem type */ + TelSatCallCtrlRequestedActionInfo_t callCtrlRequestedAction; /**< Call control request data */ + TelSatResultInfo_t result2; /**< Call control envelope result value */ + TelSatTextTypeInfo_t text; /**< Call control envelope display data */ +}TelSatCallRetInfo_t; + +// Telephony SS RETURN INFO +/** + * @brief The structure type defining result data for the send SS proactive command. + * @since_tizen 2.3 + */ +typedef struct +{ + TelSatResultType_t resp; /**< Result response value */ + TelSsCause_t ssCause; /**< Error - SS cause */ + TelSatTextInfo_t ssString; /**< SS result string */ + TelSatMeProblemType_t meProblem; /**< Error - ME problem */ + int bIsOtherInfoExist; /**< Call control result exist flag */ + TelSatCallCtrlProblemType_t additionalCallCtrlProblemInfo; /**< Call control problem */ + TelSatCallCtrlRequestedActionInfo_t callCtrlRequestedAction; /**< Call control request data */ + TelSatResultInfo_t result2; /**< Call control envelope result value */ +}TelSatSsRetInfo_t; + +// Telephony USSD RETURN INFO +/** + * @brief The structure type defining result data for the send USSD proactive command. + * @since_tizen 2.3 + */ +typedef struct +{ + TelSatResultType_t resp; /**< Result response value */ + TelSsCause_t ssCause; /**< Error - SS cause */ + TelSatTextInfo_t ussdString; /**< USSD result string */ + TelSatDataCodingSchemeInfo_t dcsUssdString; /**< DCS of USSD result string */ + TelSatMeProblemType_t meProblem; /**< Error - ME problem */ + int bIsOtherInfoExist; /**< Call control result exist flag */ + TelSatCallCtrlProblemType_t additionalCallCtrlProblemInfo; /**< Call control problem */ + int bCallCtrlHasModification; /**< Call control request modification flag */ + TelSatCallCtrlRequestedActionInfo_t callCtrlRequestedAction; /**< Call control request data */ + TelSatResultInfo_t result2; /**< Call control envelope result value */ + TelSatTextTypeInfo_t text2; /**< CC envelope display data */ +}TelSatUssdRetInfo_t; + +// Telephony SMS RETURN INFO +/** + * @brief The structure type defining result data for the send SMS proactive command. + * @since_tizen 2.3 + */ +typedef struct +{ + TelSatResultType_t resp; /**< Result response value */ +}TelSatSmsRetInfo_t; + +// Telephony DTMF RETUEN INFO +/** + * @brief The structure type defining result data for the send DTMF proactive command. + * @since_tizen 2.3 + */ +typedef struct +{ + TelSatResultType_t resp; /**< Result response value */ +}TelSatDtmfRetInfo_t; + +// Telephony BROWSER RETURN INFO +/** + * @brief The structure type defining result data for the launch browser proactive command. + * @since_tizen 2.3 + */ +typedef struct +{ + TelSatResultType_t resp; /**< Result response value */ + TelSatLaunchBrowserProblemType_t browserProblem; /**< Specific browser problem */ +}TelSatBrowserRetInfo_t; + +// Telephony SETUP IDLE MODE TEXT RETURN INFO +/** + * @brief The structure type defining result data for the setup idle mode text proactive command. + * @since_tizen 2.3 + */ +typedef struct +{ + TelSatResultType_t resp; /**< Result response value */ +}TelSatIdleTextRetInfo_t; + +// Telephony PLAY TONE RETURN INFO +/** + * @brief The structure type defining result data for the Play Tone proactive command. + * @since_tizen 2.3 + */ +typedef struct +{ + TelSatResultType_t resp; /**< Result response value */ +}TelSatPlayToneRetInfo_t; + +// Telephony PROVIDE LOCAL INFO RETURN INFO +/** + * @brief The structure type defining result data for the setup idle mode text proactive command. + * @since_tizen 2.3 + */ +typedef struct +{ + TelSatResultType_t resp; /**< Result response value */ + int bOtherInfo; /**< Flag to check whether other information is required */ + TelSatCmdQualiProvideLocalInfo_t infoType; /**< Local info type - e.g. time zone, language info, and so on */ + union + { + TelSatDataTimeZoneInfo_t timeZoneInfo; /**< Current time zone info */ + TelSatLanguageInfo_t languageInfo; /**< Current ME language setting info */ + }u; /**< Union */ +}TelSatProvideLocalRetInfo_t; + +// Telephony LANGUAGE NOTI RETURN INFO +/** + * @brief The structure type defining result data for the setup idle mode text proactive command. + * @since_tizen 2.3 + */ +typedef struct + { + TelSatResultType_t resp; /**< Result response value */ + }TelSatLanguageNotiRetInfo_t; + +// Telephony DISPLAY TEXT RETURN INFO +/** + * @brief The structure type defining result data for the setup idle mode text proactive command. + * @since_tizen 2.3 + */ +typedef struct + { + TelSatResultType_t resp; /**< Result response value */ + TelSatMeProblemType_t meProblem; /**< ME Problem Type */ + }TelSatDiplayTextRetInfo_t; + +// Telephony APPLICATIONS RETURN DATA +/** + * @brief The structure type defining common result data for the applications proactive command. + * @since_tizen 2.3 + */ +typedef struct +{ + TelSatCommandType_t commandType; /**< Proactive Command type */ + int commandId; /**< Proactive Command Number sent by USIM */ + union + { + TelSatSetupMenuRetInfo_t setupMenu; /**< Result response value to setup menu */ + TelSatRefreshRetInfo_t refresh; /**< Result response value to refresh */ + TelSatCallRetInfo_t setupCall; /**< Result response value to setup call */ + TelSatSsRetInfo_t sendSs; /**< Result response value to send SS */ + TelSatUssdRetInfo_t sendUssd; /**< Result response value to send USSD */ + TelSatSmsRetInfo_t sendSms; /**< Result response value to send SMS */ + TelSatDtmfRetInfo_t sendDtmf; /**< Result response value to send DTMF */ + TelSatBrowserRetInfo_t launchBrowser; /**< Result response value to launch the browser */ + TelSatIdleTextRetInfo_t setupIdleModeText; /**< Result response value to setup idle mode text */ + TelSatLanguageNotiRetInfo_t languageNoti; /**< Result response value for language notification */ + TelSatProvideLocalRetInfo_t provideLocalInfo; /**< Result response value to provide local info */ + TelSatDiplayTextRetInfo_t displayText; /**< Result response value to display text */ + TelSatPlayToneRetInfo_t playTone; /**< Result response value to play a tone */ + }appsRet; /**< Common union result value */ +}TelSatAppsRetInfo_t; + +// Telephony CALL CONTROL CONFIRM DATA FOR CALL +/** + * @brief The structure type defining call control confirm data for the call. + * @since_tizen 2.3 + */ +typedef struct +{ + TelSatTextInfo_t address; /**< Call destination address */ + TelSatTextInfo_t subAddress; /**< Call SUB address */ + TelSatBcRepeatIndicatorType_t bcRepeatIndicator; /**< BC repeat indicator */ + TelSatTextInfo_t ccp1; /**< Configuration Capability Parameter 1 */ + TelSatTextInfo_t ccp2; /**< Configuration Capability Parameter 2 */ +} TelSatCallCtrlIndCallData_t; + +// Telephony CALL CONTROL CONFIRM DATA FOR SS +/** + * @brief The structure type defining call control confirm data for SS. + * @since_tizen 2.3 + */ +typedef struct +{ + TelSatTextInfo_t ssString; /**< SS destination address */ + TelSatTextInfo_t subAddress; /**< Call SUB address */ + TelSatBcRepeatIndicatorType_t bcRepeatIndicator; /**< BC repeat indicator */ + TelSatTextInfo_t ccp1; /**< Configuration Capability Parameter 1 */ + TelSatTextInfo_t ccp2; /**< Configuration Capability Parameter 2 */ +} TelSatCallCtrlIndSsData_t; + +// Telephony CALL CONTROL CONFIRM DATA FOR USSD +/** + * @brief The structure type defining call control confirm data for USSD. + * @since_tizen 2.3 + */ +typedef struct +{ + TelSatTextInfo_t ussdString; /**< USSD destination address */ +} TelSatCallCtrlIndUssdData_t; + +// Telephony READ FILE REQUEST DATA +/** + * @brief The structure type defining common call control confirm data. + * @since_tizen 2.3 + */ +typedef struct +{ + TelSatCallType_t callCtrlCnfType; /**< Call control confirm type - call, SS, or USSD */ + TelSatCallCtrlResultType_t callCtrlResult; /**< Call control result */ + TelSatTextInfo_t dispData; /**< Call control display data */ + int bIsUserInfoDisplayEnabled; /**< Flag for checking existence of call control display */ + + union + { + TelSatCallCtrlIndCallData_t callCtrlCnfCallData; /**< Call control call address */ + TelSatCallCtrlIndSsData_t callCtrlCnfSsData; /**< Call control SS string */ + TelSatCallCtrlIndUssdData_t callCtrlCnfUssdData; /**< Call control USSD string */ + }u; /**< Union */ +} TelSatCallCtrlIndData_t; + +// Telephony MO SMS CONTROL CONFIRMATION DATA +/** + * @brief The structure type defining MO SMS control confirm data. + * @since_tizen 2.3 + */ +typedef struct +{ + TelSatCallCtrlResultType_t moSmsCtrlResult; /**< Envelope result */ + int bIsUserInfoDisplayEnabled; /**< Display present flag */ + TelSatTextTypeInfo_t dispData; /**< Display data for sending SMS */ + TelSatTextTypeInfo_t rpDestAddr; /**< The RP_Destination_Address of the Service Center */ + TelSatTextTypeInfo_t tpDestAddr; /**< The TP_Destination_Address */ +} TelSatMoSmCtrlIndData_t; + +// Telephony EVENT LIST INFO +/** + * @brief The structure type defining Event List Info. + * @since_tizen 2.3 + */ +typedef struct +{ + int bIsEventDownloadActive; /**< Is Event Download Active */ + int bIsMtCallEvent; /**< Is Mt Call Event */ + int bIsCallConnected; /**< Is Call Connected */ + int bIsCallDisconnected; /**< Is Call Disconnected */ + int bIsLocationStatus; /**< Is Location Status */ + int bIsUserActivity; /**< Is User Activity */ + int bIsIdleScreenAvailable; /**< Is Idle Screen Available */ + int bIsCardReaderStatus; /**< Is Card Reader Status */ + int bIsLanguageSelection; /**< Is Language Selection */ + int bIsBrowserTermination; /**< Is Browser Termination */ + int bIsDataAvailable; /**< Is Data Available */ + int bIsChannelStatus; /**< Is Channel Status */ +} TelSatEventListData_t; + +/** + * @brief The structure type containing the data structures to be used to send any envelope/event download data. + * + * @details This structure type is used by the Application to send envelope/event download data. + * @since_tizen 2.3 + */ +typedef struct +{ + TelSatEventDownloadType_t eventDownloadType; /**< Event Download Type */ + + union + { + int bIdleScreenAvailable; /**< Flag to specify whether Idle Screen is Available */ + TelSatLanguageSelectionEventReqInfo_t languageSelectionEventReqInfo; /**< Selected Language Information */ + TelSatBrowserTerminationEventReqInfo_t browserTerminationEventReqInfo; /**< Browser Termination Event Information */ + TelSatDataAvailableEventReqInfo_t dataAvailableEventReqInfo; /**< dataAvailableEventReqInfo */ + TelSatChannelStatusEventReqInfo_t channelStatusEventReqInfo; /**< channelStatusEventReqInfo */ + } u; /**< Union */ +} TelSatEventDownloadReqInfo_t; + +#ifdef __cplusplus +} +#endif + +#endif /* _TEL_SAT_H_ */ + +/** +* @} +*/ diff --git a/include/TelSatEnvelope.h b/include/TelSatEnvelope.h new file mode 100644 index 0000000..24dc535 --- /dev/null +++ b/include/TelSatEnvelope.h @@ -0,0 +1,235 @@ +/* + * libslp-tapi + * + * Copyright (c) 2014 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Ja-young Gu + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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 TelSatEnvelope.h + */ + +/** + * @internal + * @addtogroup CAPI_TELEPHONY_SERVICE_SAT + * @{ + */ + +#ifndef _TEL_SAT_ENVELOPE_H_ +#define _TEL_SAT_ENVELOPE_H_ + +#include + +#ifdef __cplusplus +extern "C" +{ +#endif + +/** + * @brief Enumeration for the SAT call type. + * @since_tizen 2.3 + */ +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; + +/** + * @brief Enumeration for the result of call control by SIM. + * @since_tizen 2.3 + */ +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; + +/** + * @brief Enumeration for the general result of sending an envelope command to the USIM. + * @since_tizen 2.3 + */ +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; + +// 8. MENU SELECTION +/** + * @brief The structure type containing data objects for the MENU SELECTION envelope. + * @since_tizen 2.3 + */ +typedef struct +{ + unsigned char itemIdentifier; /**< Menu selection item identifier */ + int bIsHelpRequested; /**< Flag to check whether help information is required */ +} TelSatMenuSelectionReqInfo_t; + +// 9.1 CALL CONTROL BY SIM +/** + * @brief Structure type containing data objects for Call Control result data sent by the USIM. + * @since_tizen 2.3 + */ +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 parameter 1 */ + TelSatCapaConfigParamInfo_t ccp2; /**< Capability configuration parameter 2 */ +}TelSatVoiceCallCtrlIndInfo_t; + +/** + * @brief The structure type containing SAT SS control result data sent by the USIM. + * @since_tizen 2.3 + */ +typedef struct +{ + TelSatSsStringInfo_t ssString; /**< SS number */ + TelSatSubAddressInfo_t subAddress; /**< SS sub address */ + TelSatBcRepeatIndicatorType_t bcRepeatIndicator; /**< BC repeat indicator */ + TelSatCapaConfigParamInfo_t ccp1; /**< Capability configuration parameter 1 */ + TelSatCapaConfigParamInfo_t ccp2; /**< Capability configuration parameter 2 */ +}TelSatSsCtrlIndInfo_t; + +/** + * @brief The structure type containing SAT MO SMS control configuration data. + * @since_tizen 2.3 + */ +typedef struct +{ + TelSatAddressInfo_t rpDestAddress; /**< SMS control RP destination address */ + TelSatAddressInfo_t tpDestAddress; /**< SMS control TP destination address */ +} TelSatMoSmsCtrlIndInfo_t; + +/** + * @brief The structure type containing SAT call control configuration data. + * @since_tizen 2.3 + */ +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 +/** + * @brief The structure type containing SAT MO SS control request data. + * @since_tizen 2.3 + */ + 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 +/** + * @brief The structure type containing SAT user activity event request data. + * @since_tizen 2.3 + */ +typedef struct +{ + TelSatEventListInfo_t eventList; /**< Event List */ + TelSatDeviceIdentitiesInfo_t deviceIdentities; /**< Device identities info */ + +} TelSatUserActivityEventReqInfo_t; + +// 11.6 EVENT DOWNLOAD - IDLE SCREEN AVAILABLE EVENT +/** + * @brief The structure type containing the data objects for the IDLE SCREEN AVAILABLE event download. + * @since_tizen 2.3 + */ +typedef struct +{ + TelSatEventDownloadType_t eventData; /**< Event type */ +} TelSatIdleScreenAvailableEventReqInfo_t; + +// 11.8 EVENT DOWNLOAD - LANGUAGE SELECTION EVENT +/** + * @brief The structure type containing the data objects for the LANGUAGE SELECTION event download. + * @since_tizen 2.3 + */ +typedef struct +{ + TelSatLanguageType_t language; /**< Selected language info */ +} TelSatLanguageSelectionEventReqInfo_t; + +// 11.9 EVENT DOWNLOAD - BROWSER TERMINATION EVENT +/** + * @brief The structure type containing the data objects for the BROWSER TERMINATION event download. + * @since_tizen 2.3 + */ +typedef struct +{ + TelSatBrowserTerminationCauseType_t browserTerminationCause; /**< Browser Termination Cause */ +} TelSatBrowserTerminationEventReqInfo_t; + +// 11.10 EVENT DOWNLOAD - DATA AVAILABLE EVENT +/** + * @brief The structure type containing SAT data available event request data. + * @since_tizen 2.3 + */ +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 +/** + * @brief The structure type containing SAT channel status even request data. + * @since_tizen 2.3 + */ +typedef struct +{ + TelSatEventListInfo_t eventList; /**< Event list */ + TelSatDeviceIdentitiesInfo_t deviceIdentities; /**< Device identities info */ + TelSatChannelStatusInfo_t channelStatus; /**< Channel Status */ +} TelSatChannelStatusEventReqInfo_t; + +#ifdef __cplusplus +} +#endif + +#endif /* _TEL_SAT_ENVELOPE_H_ */ + +/** + * @} + */ diff --git a/include/TelSatObj.h b/include/TelSatObj.h new file mode 100644 index 0000000..9de199a --- /dev/null +++ b/include/TelSatObj.h @@ -0,0 +1,1678 @@ +/* + * libslp-tapi + * + * Copyright (c) 2014 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Ja-young Gu + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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 TelSatObj.h + */ + +/** + * @internal + * @addtogroup CAPI_TELEPHONY_SERVICE_SAT + * @{ + */ + +#ifndef _TEL_SAT_OBJ_H_ +#define _TEL_SAT_OBJ_H_ + +#include + +#ifdef __cplusplus +extern "C" +{ +#endif + +#define EXTENDED_ASCII 1 + +/** + * @brief Definition for the maximum length of the dialing number. + * @since_tizen 2.3 + */ +#define TAPI_SAT_DIALLING_NUMBER_LEN_MAX 200 + +/** + * @brief Definition for the maximum length of the alpha identifier. + * @since_tizen 2.3 + */ +#define TAPI_SAT_ALPHA_ID_LEN_MAX 255 + +/** + * @brief Definition for the maximum length of the text string. + * @details When the string data is in the 7bit packed format, this length is not enough to support the maximum size so the value should be increased to a value > 275. + * @since_tizen 2.3 + */ +#define TAPI_SAT_TEXT_STRING_LEN_MAX 500 + +/** + * @brief Definition for the maximum length of a sub address. + * @since_tizen 2.3 + */ +#define TAPI_SAT_SUB_ADDR_LEN_MAX 30 + +/** + * @brief Definition for the maximum length of CCP data. + * @since_tizen 2.3 + */ +#define TAPI_SAT_CCP_DATA_LEN_MAX 30 + +/** + * @brief Definition for the maximum length of the item text. + * @since_tizen 2.3 + */ +#define TAPI_SAT_ITEM_TEXT_LEN_MAX 255 + +/** + * @brief Definition for the maximum length of SMS TPDU data. + * @since_tizen 2.3 + */ +#define TAPI_SAT_SMS_TPDU_SMS_DATA_LEN_MAX 175 + +/** + * @brief Definition for the maximum length of the SS string. + * @since_tizen 2.3 + */ +#define TAPI_SAT_SS_STRING_LEN_MAX 160 + +/** + * @brief Definition for the maximum length of the USSD string. + * @since_tizen 2.3 + */ +#define TAPI_SAT_USSD_STRING_LEN_MAX 255 + +/** + * @brief Definition for the maximum count of the file ID list. + * @since_tizen 2.3 + */ +#define TAPI_SAT_FILE_ID_LIST_MAX_COUNT 255 + +/** + * @brief Definition for the maximum count of the items next action indication list. + * @since_tizen 2.3 + */ +#define TAPI_SAT_ITEMS_NEXT_ACTION_INDI_LIST_MAX_COUNT 50 + +/** + * @brief Definition for the maximum count of the sat event list. + * @since_tizen 2.3 + */ +#define TAPI_SAT_EVENT_LIST_MAX_COUNT 17 + +/** + * @brief Definition for the maximum length of image instant raw data. + * @since_tizen 2.3 + */ +#define TAPI_SAT_IMG_INSTANT_RAW_DATA_LEN_MAX 256 + +/** + * @brief Definition for the maximum length of clut data. + * @since_tizen 2.3 + */ +#define TAPI_SAT_CLUT_DATA_LEN_MAX 256 + +/** + * @brief Definition for the maximum length of the image data file name (icon, clut). + * @since_tizen 2.3 + */ +#define TAPI_SAT_IMG_DATA_FILE_PATH_LEN_MAX 50 + +/** + * @brief Definition for the maximum count of the icon list. + * @since_tizen 2.3 + */ +#define TAPI_SAT_ICON_LIST_MAX_COUNT 50 + +/** + * @brief Definition for the maximum length of the DTMF string. + * @since_tizen 2.3 + */ +#define TAPI_SAT_DTMF_STRING_LEN_MAX 30 + +/** + * @brief Definition for the maximum length of date time and time zone. + * @since_tizen 2.3 + */ +#define TAPI_SAT_DATE_TIME_AND_TIME_ZONE_LEN 7 + +/** + * @brief Definition for the maximum length of the URL. + * @since_tizen 2.3 + */ +#define TAPI_SAT_URL_LEN_MAX 129 + +/** + * @brief Definition for the maximum count of the bearer list. + * @since_tizen 2.3 + */ +#define TAPI_SAT_BEARER_LIST_MAX_COUNT 50 + +/** + * @brief Definition for the maximum length of the provisioning file path. + * @since_tizen 2.3 + */ +#define TAPI_SAT_PROVISIONING_FILE_PATH_LEN_MAX 50 + +/** + * @brief Definition for the maximum length of the bearer parameters. + * @since_tizen 2.3 + */ +#define TAPI_SAT_BEARER_PARAMS_LEN_MAX 10 + +/** + * @brief Definition for the maximum length of the channel data string. + * @since_tizen 2.3 + */ +#define TAPI_SAT_CHANNEL_DATA_STRING_LEN_MAX 255 + +/** + * @brief Definition for the maximum length of the channel status. + * @since_tizen 2.3 + */ +#define TAPI_SAT_CHANNEL_STATUS_LEN 2 + +/** + * @brief Definition for the maximum length of the channel ID. + * @since_tizen 2.3 + */ +#define TAPI_SAT_CHANNEL_ID_LEN 3 + +/** + * @brief Definition for the maximum length of other addresses. + * @since_tizen 2.3 + */ +#define TAPI_SAT_OTHER_ADDR_LEN_MAX 30 + +/** + * @brief Definition for the maximum length of the port number. + * @since_tizen 2.3 + */ +#define TAPI_SAT_PORT_NUMBER_LEN 2 + +/** + * @brief Definition for the maximum length of the net account name. + * @since_tizen 2.3 + */ +#define TAPI_SAT_NET_ACC_NAM_LEN_MAX 30 + +/** + * @brief Definition for the maximum length of the aid. + * @since_tizen 2.3 + */ +#define TAPI_SAT_AID_LEN_MAX 128 + +/** + * @brief Definition for the maximum length of the remote entity address. + * @since_tizen 2.3 + */ +#define TAPI_SAT_REMOTE_ENTITY_ADDR_LEN_MAX 50 + +/** + * @brief Definition for the maximum count of the item text attributes list. + * @since_tizen 2.3 + */ +#define TAPI_SAT_ITEM_TEXT_ATTRIBUTES_LIST_MAX_COUNT 50 + +/** + * @brief Definition for the maximum length of MCC. + * @since_tizen 2.3 + */ +#define TAPI_SAT_MCC_CODE_LEN 3 + +/** + * @brief Definition for the maximum length of MNC. + * @since_tizen 2.3 + */ +#define TAPI_SAT_MNC_CODE_LEN 3 + +/** + * @brief Definition for the maximum length of LAC. + * @since_tizen 2.3 + */ +#define TAPI_SAT_LAC_CODE_LEN 2 + +/** + * @brief Definition for the maximum length of the cell ID. + * @since_tizen 2.3 + */ +#define TAPI_SAT_CELL_ID_LEN 2 + +/** + * @brief Enumeration for alphabet format. + * @since_tizen 2.3 + */ +typedef enum { + TAPI_SAT_ALPHABET_FORMAT_SMS_DEFAULT = 0x00, /**< ALPHABET FORMAT SMS DEFAULT */ + TAPI_SAT_ALPHABET_FORMAT_8BIT_DATA = 0x01, /**< ALPHABET FORMAT 8BIT DATA */ + TAPI_SAT_ALPHABET_FORMAT_UCS2 = 0x02, /**< ALPHABET FORMAT UCS2 */ + TAPI_SAT_ALPHABET_FORMAT_RESERVED = 0x03 /**< ALPHABET FORMAT RESERVED */ +} TelSatAlphabetFormatType_t; + +/** + * @brief Enumeration for the message class. + * @since_tizen 2.3 + */ +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; + +/** + * @brief Enumeration for the type of command and the next action indicator. + * @since_tizen 2.3 + */ +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; + +/** + * @brief Enumeration for the command qualifier values of the refresh command. + * @since_tizen 2.3 + */ +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; + +/** + * @brief Enumeration for the command qualifier values of the setup call command. + * @since_tizen 2.3 + */ +typedef enum { + TAPI_SAT_SETUP_CALL_IF_ANOTHER_CALL_NOT_BUSY = 0x00, /**< command qualifier for SETUP CALL IF ANOTHER CALL IS NOT BUSY */ + TAPI_SAT_SETUP_CALL_IF_ANOTHER_CALL_NOT_BUSY_WITH_REDIAL = 0x01, /**< command qualifier for SETUP CALL IF ANOTHER CALL IS 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; + +/** + * @brief Enumeration for the message priority. + * + * @details This is associated with the command qualifier of display text. + * @since_tizen 2.3 + */ +typedef enum { + TAPI_SAT_MSG_PRIORITY_NORMAL = 0, /**< MSG PRIORITY NORMAL */ + TAPI_SAT_MSG_PRIORITY_HIGH = 1 /**< MSG PRIORITY HIGH */ +} TelSatDisplayTextPriorityType_t; + +/** + * @brief Enumeration for the message clear type. + * + * @details This is associated with the command qualifier of display text. + * @since_tizen 2.3 + */ +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; + +/** + * @brief Enumeration for the inkey type. + * + * @details This is associated with the command qualifier of get inkey. + * @since_tizen 2.3 + */ +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; + +/** + * @brief Enumeration for the user input type. + * + * @details This is associated with the command qualifier of get input. + * @since_tizen 2.3 + */ +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; + +/** + * @brief Enumeration for the vibrate alert type. + * + * @details This is associated with the command qualifier of the play tone command. + * @since_tizen 2.3 + */ +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; + +/** + * @brief Enumeration for the presentation type. + * + * @details This is associated with the command qualifier of the select item command. + * @since_tizen 2.3 + */ +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; + +/** + * @brief Enumeration for the selection preference. + * + * @details This is associated with the command qualifier of the select item command. + * @since_tizen 2.3 + */ +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; + +/** + * @brief Enumeration for the local info type. + * + * @details This enum defines the command qualifier values of the local info command. + * @since_tizen 2.3 + */ +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; + +/** + * @brief Enumeration for the browser launching mode. + * + * @details This enum defines the command qualifier values of the launch browser command. + * @since_tizen 2.3 + */ +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; + +/** + * @brief Enumeration for the device ID type. + * + * @details This enum lists the device identity tag value IDs. + * @since_tizen 2.3 + */ +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; + +/** + * @brief Enumeration for the time unit type. + * + * @details This enum lists the time units for the duration data object. + * @since_tizen 2.3 + */ +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; + +/** + * @brief Enumeration for the command execution result type. + * + * @details This enum lists the values for the RESULT data object - General Response. + * @since_tizen 2.3 + */ +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 the 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 the 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 the command */ + TAPI_SAT_R_NETWORK_UNABLE_TO_PROCESS_COMMAND = 0x21, /**< Network currently unable to process the command */ + TAPI_SAT_R_USER_DID_NOT_ACCEPT_CALL_SETUP_REQ = 0x22, /**< User did not accept the call setup request */ + TAPI_SAT_R_USER_CLEAR_DOWN_CALL_BEFORE_CONN = 0x23, /**< User cleared down the call before connection or released the network */ + + 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; + +/** + * @brief Enumeration for the ME problem type. + * + * @details This enum lists the values for the additional response of the RESULT object and specifies a particular ME PROBLEM. + * @since_tizen 2.3 + */ +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; + +/** + * @brief Enumeration for the network problem type. + * + * @details This enum lists the values for the additional response of the RESULT object and specifies a particular network PROBLEM. + * @since_tizen 2.3 + */ +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; + +/** + * @brief Enumeration for the SS problem type. + * + * @details This enum lists the values for the additional response of the RESULT object related to SEND SS. + * @since_tizen 2.3 + */ +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; + +/** + * @brief Enumeration for the SMS problem type. + * + * @details This enum lists the values for the additional response of the RESULT object related to SEND SMS. + * @since_tizen 2.3 + */ +typedef enum { + TAPI_SAT_SMS_PROBLEM_NO_SPECIFIC_CAUSE = 0 /**< SMS problem with no specific cause */ +} TelSatSmsProblemType_t; + +/** + * @brief Enumeration for the USSD problem type. + * + * @details This enum lists the values for the additional response of the RESULT object related to SEND USSD STRING. + * @since_tizen 2.3 + */ +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; + +/** + * @brief Enumeration for the CC problem type. + * + * @details This enum lists the values for the additional response of the RESULT object related to CALL CONTROL or MO SMS CONTROL. + * @since_tizen 2.3 + */ +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 in which request type has changed */ +} TelSatCallCtrlProblemType_t; + +/** + * @brief Enumeration for the browser problem type. + * + * @details This enum lists the values for the additional response of the RESULT object related to LAUNCH BROWSER PROBLEM. + * @since_tizen 2.3 + */ +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; + +/** + * @brief Enumeration for the #TelSatBipProblemType_t enum. + * + * @details This enum lists the values for the additional response of the RESULT object. + * Permanent Problems ::: 12.12.11 ADDITIONAL INFORMATION : BEARER INDEPENDENT PROTOCOL. + * @since_tizen 2.3 + */ +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; + +/** + * @brief Enumeration for the SMS TPDU type. + * @since_tizen 2.3 + */ +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; + +/** + * @brief Enumeration for the tone type. + * @since_tizen 2.3 + */ +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; + +/** + * @brief Enumeration for the event types required by ME to monitor and report to the SIM. + * @since_tizen 2.3 + */ +typedef enum { + TAPI_EVENT_SAT_DW_TYPE_MT_CALL = 0, /**< TBD */ + TAPI_EVENT_SAT_DW_TYPE_CALL_CONNECTED = 1, /**< TBD */ + TAPI_EVENT_SAT_DW_TYPE_CALL_DISCONNECTED = 2, /**< TBD */ + TAPI_EVENT_SAT_DW_TYPE_LOCATION_STATUS = 3, /**< TBD */ + 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, /**< TBD */ + 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, /**< TBD */ + TAPI_EVENT_SAT_DW_TYPE_DISPLAY_PARAMETERS_CHANGED = 0x0C, /**< TBD */ + TAPI_EVENT_SAT_DW_TYPE_LOCAL_CONNECTION = 0x0D, /**< TBD */ + TAPI_EVENT_SAT_DW_TYPE_NW_SEARCH_MODE_CHANGED = 0X0E, /**< TBD */ + TAPI_EVENT_SAT_DW_TYPE_BROWSING_STATUS = 0X0F, /**< TBD */ + TAPI_EVENT_SAT_DW_TYPE_FRAMES_INFORMATION_CHANGED = 0X10, /**< TBD */ + TAPI_EVENT_SAT_DW_TYPE_RESERVED_FOR_3GPP = 0X11, /**< TBD */ + TAPI_EVENT_SAT_DW_TYPE_UNKNOWN = 0xFF /**< data download type - unknown */ +} TelSatEventDownloadType_t; + +/** + * @brief Enumeration for the SIM image coding scheme type. + * + * @details This enum lists image coding scheme types required by ME to show. + * @since_tizen 2.3 + */ +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; + +/** + * @brief Enumeration for the icon qualifier. + * @since_tizen 2.3 + */ +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; + +/** + * @brief Enumeration for the SIM ATK BC repeat indicator type. + * @since_tizen 2.3 + */ +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; + +/** + * @brief Enumeration for the call control string type. + * @since_tizen 2.3 + */ +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; + +/** + * @brief Enumeration for the supported language values. + * @since_tizen 2.3 + */ +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; + +/** + * @brief Enumeration for the SAT browser identity type. + * @since_tizen 2.3 + */ +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; + +/** + * @brief Enumeration for the SAT bearer type. + * @since_tizen 2.3 + */ +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; + +/** + * @brief Enumeration for the SAT browser termination cause type. + * @since_tizen 2.3 + */ +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; + +/** + * @brief Enumeration for the SAT bearer destination type. + * @since_tizen 2.3 + */ +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; + +/** + * @brief Enumeration for the SAT bearer CSD data rate. + * + * @details Refer TS 27.007. + * @since_tizen 2.3 + */ +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; + +/** + * @brief Enumeration for the CSD bearer service type. + * @since_tizen 2.3 + */ +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; + +/** + * @brief Enumeration for the SAT bearer CSD connection element. + * @since_tizen 2.3 + */ +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; + +/** + * @brief Enumeration for the SAT bearer GPRS precedence class. + * + * @details Refer TS 23.107. + * @since_tizen 2.3 + */ +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; + +/** + * @brief Enumeration for the SAT bearer GPRS delay class. + * @since_tizen 2.3 + */ +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; + +/** + * @brief Enumeration for the SAT bearer GPRS Reliability class. + * @since_tizen 2.3 + */ +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; + +/** + * @brief Enumeration for the SAT bearer GPRS peak throughput class. + * @since_tizen 2.3 + */ +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; + +/** + * @brief Enumeration for the SAT bearer GPRS mean throughput class. + * @since_tizen 2.3 + */ +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; + +/** + * @brief Enumeration for the SAT bearer GPRS PDP type. + * @since_tizen 2.3 + */ +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; + +/** + * @brief Enumeration for the SAT bearer local links service identity. + * @since_tizen 2.3 + */ +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; + +/** + * @brief Enumeration for the SAT channel status type. + * @since_tizen 2.3 + */ +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; + +/** + * @brief Enumeration for the SAT channel status info type. + * @since_tizen 2.3 + */ +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; + +/** + * @brief Enumeration for the SAT address type. + * @since_tizen 2.3 + */ +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; + +/** + * @brief Enumeration for the SAT transport protocol type. + * @since_tizen 2.3 + */ +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; + +/** + * @brief Enumeration for the SAT remote entity address coding type. + * @since_tizen 2.3 + */ +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; + +/** + * @brief The structure type defining the address data object. + * @since_tizen 2.3 + */ +typedef struct { + TelSimTypeOfNum_t ton; /**< Type of number */ + TelSimNumberingPlanIdentity_t npi; /**< Number plan identity */ + unsigned char diallingNumberLen; /**< Dialing the number length */ + char diallingNumber[TAPI_SAT_DIALLING_NUMBER_LEN_MAX]; /**< Dialing the number */ +} TelSatAddressInfo_t; + +/** + * @brief The structure type defining the data coding scheme object. + * @since_tizen 2.3 + */ +typedef struct { + int bIsCompressedFormat; /**< Flag to verify the compressed format */ + TelSatAlphabetFormatType_t alphabetFormat; /**< Alphabet format type */ + TelSatMsgClassType_t msgClass; /**< Type of message class */ + unsigned char rawDcs; /**< Raw DCS info */ +} TelSatDataCodingSchemeInfo_t; + +/** + * @brief The structure type defining the Alpha ID data object. + * @since_tizen 2.3 + */ +typedef struct { + int bIsPresent; /**< Flag for checking the existence of the 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; + +/** + * @brief The structure type defining the Sub Address data object. + * @since_tizen 2.3 + */ +typedef struct { + unsigned char subAddressLen; /**< Sub address length */ + char subAddress[TAPI_SAT_SUB_ADDR_LEN_MAX]; /**< Sub address */ +} TelSatSubAddressInfo_t; + +/** + * @brief The structure type defining the Capability Configuration Parameters data object. + * @since_tizen 2.3 + */ +typedef struct { + unsigned char dataLen; /**< Capability configuration parameter length */ + char data[TAPI_SAT_CCP_DATA_LEN_MAX]; /**< Capability configuration parameter */ +} TelSatCapaConfigParamInfo_t; + +/** + * @brief The structure type defining command qualifier values for the send SMS command. + * @since_tizen 2.3 + */ +typedef struct { + int bIsPackingByMeRequired; /**< Flag to verify packing requirement, if FALSE packing by ME is not required */ +} TelSatCmdQualiSendSms_t; + +/** + * @brief The structure type defining command qualifier values for the display text command. + * @since_tizen 2.3 + */ +typedef struct { + TelSatDisplayTextPriorityType_t msgPriority; /**< Message priority */ + TelSatDisplayTextMsgClearType_t msgClear; /**< Message clear type */ +} TelSatCmdQualiDisplayText_t; + +/** + * @brief The structure type defining command qualifier values for the get inkey command. + * @since_tizen 2.3 + */ +typedef struct { + TelSatInkeyType_t inkeyType; /**< Inkey type */ + int bIsUsingAlphabetSet; /**< Flag for checking whether alphabet set is being used. If FALSE, digits(0-9,*,and+) only */ + TelSatUseInputAlphabetType_t alphabetType; /**< Alphabet type */ + int bIsImmediateResponseRequired;/**< Flag for checking whether immediate response is required */ + int bIsHelpInfoAvailable; /**< Flag for checking whether help info is available. If FALSE, no help information is available */ +} TelSatCmdQualiGetInkey_t; + +/** + * @brief The structure type defining command qualifier values for the get input command. + * @since_tizen 2.3 + */ +typedef struct { + int bIsUsingAlphabetSet; /**< Flag for checking whether alphabet set is being used. 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. If FALSE, user input is in the SMS packed format */ + int bIsHelpInfoAvailable; /**< Flag to verify if help info is available. If FALSE, no help information is available */ +} TelSatCmdQualiGetInput_t; + +/** + * @brief The structure type defining command qualifier values for the play tone command. + * @since_tizen 2.3 + */ +typedef struct { + TelSatDisplayVibrateAlertType_t vibrateAlert; /**< Type of vibrate alert */ +} TelSatCmdQualiPlayTone_t; + +/** + * @brief The structure type defining command qualifier values for the select item command. + * @since_tizen 2.3 + */ +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 is available. If FALSE, no help information is available */ +} TelSatCmdQualiSelectItem_t; + +/** + * @brief The structure type defining command qualifier values for the setup menu command. + * @since_tizen 2.3 + */ +typedef struct { + TelSatSelectionPreferenceType_t selectionPreference; /**< Type of selection preference */ + int bIsHelpInfoAvailable; /**< Flag to verify whether help info is available. If FALSE, no help information is available */ +} TelSatCmdQualiSetupMenu_t; + +/** + * @brief The structure type defining command qualifier values for the language notification command. + * @since_tizen 2.3 + */ +typedef struct { + int bSpecificLanguageNotification; /**< Flag for a specific language notification. If FALSE, it is a non-specific language notification */ +} TelSatCmdQualiLanguageNotification_t; + +/** + * @brief The structure type defining the SAT command qualifier open channel. + * @since_tizen 2.3 + */ +typedef struct { + int bIsEstablishImmediateLink; /**< Flag to verify whether immediate link is establishing. If FALSE, link establishment on demand */ + int bIsAutomaticReconnection; /**< Flag to verify whether automatic reconnection is establishing. If FALSE, no automatic reconnection */ + int bIsModeBackground; /**< Flag to verify whether background mode is activated */ +} TelSatCmdQualiOpenChannel_t; + +/** + * @brief The structure type containing SAT command qualifier send data. + * @since_tizen 2.3 + */ +typedef struct { + int bIsSendDataImmediately; /**< Flag to verify whether to send data immediately. If FALSE, store data in the Tx buffer */ +} TelSatCmdQualiSendData_t; + +/** + * @brief The structure type containing the command number, type, and the qualifier objects of a SATK command. + * @since_tizen 2.3 + */ +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; + +/** + * @brief The structure type defining device identity values. + * @since_tizen 2.3 + */ +typedef struct { + TelSatDeviceIdentitiesTagType_t source; /**< Device identity tag for source */ + TelSatDeviceIdentitiesTagType_t destination; /**< Device identity tag for destination */ +} TelSatDeviceIdentitiesInfo_t; + +/** + * @brief The structure type defining the duration data object. + * @since_tizen 2.3 + */ +typedef struct { + TelSatTimeUnitType_t timeUnit; /**< Time units for the duration data */ + unsigned char timeInterval; /**< Time interval */ +} TelSatDurationInfo_t; + +/** + * @brief The structure type defining the menu item data object. + * @since_tizen 2.3 + */ +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; + +/** + * @brief The structure type defining the item identifier object. + * @since_tizen 2.3 + */ +typedef struct { + unsigned char selectedItemIdentifier; /**< Selected item identifier */ +} TelSatItemIdentifierInfo_t; + +/** + * @brief The structure type defining expected user response length. + * @since_tizen 2.3 + */ +typedef struct { + unsigned char min; /**< User response length's minimum value */ + unsigned char max; /**< User response length's maximum value */ +} TelSatRespLenInfo_t; + +/** + * @brief The structure type defining the result data object. + * @since_tizen 2.3 + */ +typedef struct { + TelSatResultType_t generalResult; /**< General result */ + TelSatMeProblemType_t meProblem; /**< Additional information on the general result */ +} TelSatResultInfo_t; + +/** + * @brief The structure type defining the RESULT data object. + * @since_tizen 2.3 + */ +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; + +/** + * @brief The structure type defining the SS STRING data object. + * @since_tizen 2.3 + */ +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; + +/** + * @brief The structure type defining the TEXT STRING data object. + * @since_tizen 2.3 + */ +typedef struct { + int bIsDigitOnly; /**< Flag for checking whether only digits are used */ + TelSatDataCodingSchemeInfo_t dcs; /**< Data coding scheme */ + unsigned short stringLen; /**< Text length */ + char string[TAPI_SAT_TEXT_STRING_LEN_MAX + 1]; /**< Text string */ +} TelSatTextTypeInfo_t; + +/** + * @brief The structure type defining the menu item text object. + * @since_tizen 2.3 + */ +typedef struct { + int bIsDigitOnly; /**< Flag for checking whether only digits are used */ + TelSatDataCodingSchemeInfo_t dcs; /**< Data coding scheme */ + unsigned char stringLen; /**< Menu item string length */ + char* pString; /**< Menu item string */ +} TelSatMenuItemTextInfo_t; + +/** + * @brief The structure type defining the tone object. + * @since_tizen 2.3 + */ +typedef struct { + TelSatToneType_t type; /**< Tone type */ +} TelSatToneInfo_t; + +/** + * @brief The structure type defining the USSD string data object. + * @since_tizen 2.3 + */ +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; + +/** + * @brief The structure type defining the file list data object. + * @since_tizen 2.3 + */ +typedef struct { + unsigned char fileCount; /**< File count */ +// TelSimFileName_t fileId[TAPI_SAT_FILE_ID_LIST_MAX_COUNT]; /**< File identifier */ +} TelSatFileListInfo_t; + +/** + * @brief The structure type defining the default text data object. + * @since_tizen 2.3 + */ +typedef struct { + int bIsPresent; /**< Flag for checking whether default text exists */ + int bIsDigitOnly; /**< Flag for checking whether only digits are used */ + 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; + +/** + * @brief The structure type defining the Next Action Indicator List data object. + * @since_tizen 2.3 + */ +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; + +/** + * @brief The structure type defining the event list data object. + * @since_tizen 2.3 + */ +typedef struct { + unsigned char eventListCount; /**< Event list count */ + TelSatEventDownloadType_t list[TAPI_SAT_EVENT_LIST_MAX_COUNT]; /**< Event list */ +} TelSatEventListInfo_t; + +/** + * @brief The structure type defining the icon info object. + * @since_tizen 2.3 + */ +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]; /**< TBD */ + char clutFile[TAPI_SAT_IMG_DATA_FILE_PATH_LEN_MAX]; /**< TBD */ +} TelSatIconInfo_t; + +/** + * @brief The structure type defining the icon data object. + * @since_tizen 2.3 + */ +typedef struct { + int bIsPresent; /**< Flag for checking whether the icon identifier exists */ + TelSatIconQualifierType_t iconQualifier; /**< Icon qualifier type */ + unsigned char iconIdentifier; /**< Icon identifier */ + TelSatIconInfo_t iconInfo; /**< Icon info */ +} TelSatIconIdentifierInfo_t; + +/** + * @brief The structure type defining the icon identifier data object. + * @since_tizen 2.3 + */ +typedef struct { + int bIsPresent; /**< Flag for checking whether the icon identifier exists */ + 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; + +/** + * @brief The structure type defining SAT BC repeat indicator info. + * @since_tizen 2.3 + */ +typedef struct { + TelSatBcRepeatIndicatorType_t indType; /**< BC repeat indicator type */ +} TelSatBcRepeatIndicatorInfo_t; + +/** + * @brief The structure type defining call control strings. + * @since_tizen 2.3 + */ +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; + +/** + * @brief The structure type defining action requested call control data. + * @since_tizen 2.3 + */ +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; + +/** + * @brief The structure type defining the DTMF string data object. + * @since_tizen 2.3 + */ +typedef struct { + unsigned char stringLen; /**< DTMF string length */ + char dtmfTone[TAPI_SAT_DTMF_STRING_LEN_MAX]; /**< DTMF tone data */ +} TelSatDtmfStringInfo_t; + +/** + * @brief The structure type defining the language data object. + * @since_tizen 2.3 + */ +typedef struct { + TelSatLanguageType_t language; /**< Language type */ +} TelSatLanguageInfo_t; + +/** + * @brief The structure type defining the date time and time zone data object. + * @since_tizen 2.3 + */ +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; + +/** + * @brief The structure type defining SAT browser identities. + * @since_tizen 2.3 + */ +typedef struct { + TelSatBrowserIdentityType_t browserIdentity; /**< Browser identity */ +} TelSatBrowserIdentitiesInfo_t; + +/** + * @brief The structure type defining the SAT browser URL data object. + * @since_tizen 2.3 + */ +typedef struct { + char string[TAPI_SAT_URL_LEN_MAX + 1]; /**< URL string */ +} TelSatUrlInfo_t; + +/** + * @brief The structure type defining the SAT bearer type. + * @since_tizen 2.3 + */ +typedef struct { + unsigned char listLen; /**< Bearer list length */ + TelSatBearerType_t bearerList[TAPI_SAT_BEARER_LIST_MAX_COUNT]; /**< Bearer list */ +} TelSatBearerInfo_t; + +/** + * @brief The structure type defining the SAT provisioning reference. + * @since_tizen 2.3 + */ +typedef struct { + char provisioningFilePath[TAPI_SAT_PROVISIONING_FILE_PATH_LEN_MAX]; /**< Provisioning file path */ +} TelSatProvisioningRefInfo_t; + +/** + * @brief The structure type defining the SAT browser termination cause. + * @since_tizen 2.3 + */ +typedef struct { + TelSatBrowserTerminationCauseType_t cause; /**< Browser termination cause */ +} TelSatBrowserTerminationCauseInfo_t; + +/** + * @brief The structure type defining SAT CSD bearer parameters. + * @since_tizen 2.3 + */ +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; + +/** + * @brief The structure type defining SAT GPRS bearer parameters. + * @since_tizen 2.3 + */ +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 peak throughput */ + TelSatBearerParamGprsMeanThroughputClassType_t meanThroughputClass;/**< Bearer GPRS mean throughput */ + TelSatBearerParamGprsPdpType_t pdpType; /**< bearer gprs pdp type */ +} TelSatBearerParametersGprsInfo_t; + +/** + * @brief The structure type defining SAT local links bearer parameters. + * @since_tizen 2.3 + */ +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; + +/** + * @brief The structure type defining the SAT bearer description. + * @since_tizen 2.3 + */ +typedef struct { + TelSatBearerDescType_t bearerType; /**< Bearer type */ + union { + TelSatBearerParametersCsdInfo_t bearerParamsCsd; /**< CSD */ + TelSatBearerParametersGprsInfo_t bearerParamsGprs; /**< GPRS */ + TelSatBearerParametersLocalLinksInfo_t bearerParamsLocalLinks; /**< Local link */ + } bearer_params; /**< Union */ +} TelSatBearerDescriptionInfo_t; + +/** + * @brief The structure type defining SAT channel data. + * @since_tizen 2.3 + */ +typedef struct { + unsigned char channelDataStringLen; /**< Channel data length */ + char channelDataString[TAPI_SAT_CHANNEL_DATA_STRING_LEN_MAX]; /**< Channel data */ +} TelSatChannelDataInfo_t; + +/** + * @brief The structure type defining the SAT channel data length. + * @since_tizen 2.3 + */ +typedef struct { + unsigned char channelDataLen; /**< Channel data length */ +} TelSatChannelDataLengthInfo_t; + +/** + * @brief The structure type defining the SAT buffer size. + * @since_tizen 2.3 + */ +typedef struct { + unsigned char bufferSize[2]; /**< Channel data buffer size */ +} TelSatBufferSizeInfo_t; + +/** + * @brief The structure type defining the SAT channel status. + * @since_tizen 2.3 + */ +typedef struct { + unsigned char channelId; /**< Channel ID */ + TelSatChannelStatusType_t status; /**< Channel status */ + TelSatChannelStatusInfoType_t channelInfo; /**< Channel status info */ +} TelSatChannelStatusInfo_t; + +/** + * @brief The structure type defining another SAT address. + * @since_tizen 2.3 + */ +typedef struct { + TelSatAddressType_t addressType; /**< Channel address type */ + unsigned char addressLen; /**< Channel address length */ + char address[TAPI_SAT_OTHER_ADDR_LEN_MAX]; /**< Channel address */ +} TelSatOtherAddressInfo_t; + +/** + * @brief The structure type defining the SIM ME interface transport level. + * @since_tizen 2.3 + */ +typedef struct { + TelSatTransportProtocolType_t transportProtocolType; /**< Transport protocol type */ + unsigned short portNumber; /**< Port number */ +} TelSatSimMeInterfaceTransportLevelInfo_t; + +/** + * @brief The structure type defining the SAT network access name. + * @since_tizen 2.3 + */ +typedef struct { + unsigned char length; /**< Network access name length */ + unsigned char netAccName[TAPI_SAT_NET_ACC_NAM_LEN_MAX]; /**< Network access name */ +} TelSatnetworkAccessNameInfo_t; + +/** + * @brief The structure type defining the SAT aid. + * @since_tizen 2.3 + */ +typedef struct { + char aid[TAPI_SAT_AID_LEN_MAX]; /**< Application ID */ +} TelSatAidInfo_t; + +/** + * @brief The structure type defining the SAT remote entity address. + * @since_tizen 2.3 + */ +typedef struct { + TelSatRemoteEntityAddrCodingType_t codingType; /**< Remote entity address coding type */ + unsigned short length; /**< Remote entity address length */ + unsigned char remoteEntityAddress[TAPI_SAT_REMOTE_ENTITY_ADDR_LEN_MAX]; /**< Remote entity address data */ +} TelSatRemoteEntityAddressInfo_t; + +/** + * @brief The structure type defining the SAT text attribute. + * @since_tizen 2.3 + */ +typedef struct { + unsigned char textFormatting[4]; /**< Text attribute - e.g. bold, center align, and so on */ +} TelSatTextAttributeInfo_t; + +/** + * @brief The structure type defining the SAT text attribute list. + * @since_tizen 2.3 + */ +typedef struct { + unsigned int listCount; /**< Text attribute list count */ + TelSatTextAttributeInfo_t list[TAPI_SAT_ITEM_TEXT_ATTRIBUTES_LIST_MAX_COUNT]; /**< Text attribute list info */ +} TelSatTextAttributeListInfo_t; + +#ifdef __cplusplus +} +#endif + +#endif /* _TEL_SAT_OBJ_H_ */ + +/** + * @} + */ diff --git a/include/TelSatProactvCmd.h b/include/TelSatProactvCmd.h new file mode 100644 index 0000000..722fcb0 --- /dev/null +++ b/include/TelSatProactvCmd.h @@ -0,0 +1,764 @@ +/* + * libslp-tapi + * + * Copyright (c) 2014 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Ja-young Gu + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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 TelSatProactvCmd.h + */ + +/** + * @internal + * @addtogroup CAPI_TELEPHONY_SERVICE_SAT + * @{ + */ + +#ifndef _TEL_SAT_PROACTV_CMD_H_ +#define _TEL_SAT_PROACTV_CMD_H_ + +#include + +#ifdef __cplusplus +extern "C" +{ +#endif + +/** + * @brief Definition for the max count of SAT menu items. + * @since_tizen 2.3 + */ +#define TAPI_SAT_MENU_ITEM_COUNT_MAX 40 +/** + * @brief Definition for the max count of SAT provisioning reference. + * @since_tizen 2.3 + */ +#define TAPI_SAT_PROVISIONING_REF_MAX_COUNT 10 + +/** + * @brief The structure type containing the data objects for DISPLAY TEXT proactive command indication. + * @since_tizen 2.3 + */ +typedef struct { + TelSatCommandDetailInfo_t commandDetail; /**< Command detail info. It includes command number, type, and qualifier */ + TelSatDeviceIdentitiesInfo_t deviceIdentities; /**< Device identities info. It includes source and destination devices */ +} TelSatMoreTimeIndInfo_t; + +/** + * @brief The structure type containing the data objects for DISPLAY TEXT proactive command indication. + * @since_tizen 2.3 + */ +typedef struct { + TelSatCommandDetailInfo_t commandDetail; /**< Command detail info. It includes command number, type, and qualifier */ + TelSatDeviceIdentitiesInfo_t deviceIdentities; /**< Device identities info. It 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 is required */ + TelSatDurationInfo_t duration; /**< Duration for which text should be displayed */ + TelSatTextAttributeInfo_t textAttribute; /**< Text attribute info - e.g. bold, center align, and so on */ +} TelSatDisplayTextIndInfo_t; + +/** + * @brief The structure type containing the data objects for GET INKEY proactive command indication. + * @since_tizen 2.3 + */ +typedef struct { + TelSatCommandDetailInfo_t commandDetail; /**< Command detail info. It includes command number, type, and qualifier */ + TelSatDeviceIdentitiesInfo_t deviceIdentities; /**< Device identities info. It 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; + +/** + * @brief The structure type containing the data objects for GET INPUT proactive command indication. + * @since_tizen 2.3 + */ +typedef struct { + TelSatCommandDetailInfo_t commandDetail; /**< Command detail info. It includes command number, type, and qualifier */ + TelSatDeviceIdentitiesInfo_t deviceIdentities; /**< Device identities info. It 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; + +/** + * @brief The structure type containing the data objects for PLAY TONE proactive command indication. + * @since_tizen 2.3 + */ +typedef struct { + TelSatCommandDetailInfo_t commandDetail; /**< Command detail info. It includes command number, type, and qualifier */ + TelSatDeviceIdentitiesInfo_t deviceIdentities; /**< Device identities info. It 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; + +/** + * @brief The structure type containing the data objects for SETUP MENU proactive command indication. + * @since_tizen 2.3 + */ +typedef struct { + TelSatCommandDetailInfo_t commandDetail; /**< Command detail info. It includes command number, type, and qualifier */ + TelSatDeviceIdentitiesInfo_t deviceIdentities; /**< Device identities info. It 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; + +/** + * @brief The structure type containing the data objects for SELECT ITEM proactive command indication data. + * @since_tizen 2.3 + */ +typedef struct { + TelSatCommandDetailInfo_t commandDetail; /**< Command detail info. It includes command number, type, and qualifier */ + TelSatDeviceIdentitiesInfo_t deviceIdentities; /**< Device identities info. It 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; + +/** + * @brief The structure type containing the data objects for SEND SHORT MESSAGE proactive command indication. + * @since_tizen 2.3 + */ +typedef struct { + TelSatCommandDetailInfo_t commandDetail; /**< Command detail info. It includes command number, type, and qualifier */ + TelSatDeviceIdentitiesInfo_t deviceIdentities; /**< Device identities info. It 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; + +/** + * @brief The structure type containing the data objects for SEND SS proactive command indication. + * @since_tizen 2.3 + */ +typedef struct { + TelSatCommandDetailInfo_t commandDetail; /**< Command detail info. It includes command number, type, and qualifier */ + TelSatDeviceIdentitiesInfo_t deviceIdentities; /**< Device identities info. It 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; + +/** + * @brief The structure type containing the data objects for SEND USSD proactive command indication. + * @since_tizen 2.3 + */ +typedef struct { + TelSatCommandDetailInfo_t commandDetail; /**< Command detail info. It includes command number, type, and qualifier */ + TelSatDeviceIdentitiesInfo_t deviceIdentities; /**< Device identities info. It 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; + +/** + * @brief The structure type containing the data objects for SETUP CALL proactive command indication. + * @since_tizen 2.3 + */ +typedef struct { + TelSatCommandDetailInfo_t commandDetail; /**< Command detail info. It includes command number, type, and qualifier */ + TelSatDeviceIdentitiesInfo_t deviceIdentities; /**< Device identities info. It 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 Alpha ID */ + TelSatAlphaIdentifierInfo_t callSetupPhaseAlphaId; /**< Call Setup Phase Alpha ID */ + TelSatIconIdentifierInfo_t userConfirmPhaseIconId; /**< User Confirmation Phase Icon ID */ + TelSatIconIdentifierInfo_t callSetupPhaseIconId; /**< Call Setup Phase Icon ID */ + TelSatTextAttributeInfo_t userConfirmPhaseTextAttribute; /**< User Confirmation Phase Text Attribute */ + TelSatTextAttributeInfo_t callSetupPhaseTextAttribute; /**< Call Setup Phase Text Attribute */ +} TelSatSetupCallIndInfo_t; + +/** + * @brief The structure type containing the data objects for REFRESH proactive command indication. + * @since_tizen 2.3 + */ +typedef struct { + TelSatCommandDetailInfo_t commandDetail; /**< Command detail info. It includes command number, type, and qualifier */ + TelSatDeviceIdentitiesInfo_t deviceIdentities; /**< Device identities info. It includes source and destination devices */ + TelSatFileListInfo_t fileList; /**< File list for refresh */ + TelSatAidInfo_t aid; /**< Application ID */ +} TelSatRefreshIndInfo_t; + +/** + * @brief The structure type containing the data objects for PROVIDE LOCAL INFO proactive command indication. + * @since_tizen 2.3 + */ +typedef struct { + TelSatCommandDetailInfo_t commandDetail; /**< Command detail info. It includes command number, type, and qualifier */ + TelSatDeviceIdentitiesInfo_t deviceIdentities; /**< Device identities info. It includes source and destination devices */ + +} TelSatProvideLocalInfoIndInfo_t; + +/** + * @brief The structure type containing the data objects for SETUP EVENT LIST proactive command indication data. + * @since_tizen 2.3 + */ +typedef struct { + TelSatCommandDetailInfo_t commandDetail; /**< Command detail info. It includes command number, type, and qualifier */ + TelSatDeviceIdentitiesInfo_t deviceIdentities; /**< Device identities info. It includes source and destination devices */ + TelSatEventListInfo_t eventList; /**< Event list structure type containing events which are required by the USIM application */ + +} TelSatSetupEventListIndInfo_t; + +/** + * @brief The structure type containing the data objects for SETUP IDLE MODE TEXT proactive command indication. + * @since_tizen 2.3 + */ +typedef struct { + TelSatCommandDetailInfo_t commandDetail; /**< Command detail info. It includes command number, type, and qualifier */ + TelSatDeviceIdentitiesInfo_t deviceIdentities; /**< Device identities info. It includes source and destination devices */ + TelSatTextTypeInfo_t text; /**< Text to be shown on an idle screen */ + TelSatIconIdentifierInfo_t iconId; /**< Icon identifier info */ + TelSatTextAttributeInfo_t textAttribute; /**< Text attribute info - e.g. bold, center align */ +} TelSatSetupIdleModeTextIndInfo_t; + +/** + * @brief The structure type containing the data objects for SEND DTMF COMMAND proactive command indication. + * @since_tizen 2.3 + */ +typedef struct { + TelSatCommandDetailInfo_t commandDetail; /**< Command detail info. It includes command number, type, and qualifier */ + TelSatDeviceIdentitiesInfo_t deviceIdentities; /**< Device identities info. It 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; + +/** + * @brief The structure type containing the data objects for LANGUAGE NOTIFICATION proactive command indication. + * @since_tizen 2.3 + */ +typedef struct { + TelSatCommandDetailInfo_t commandDetail; /**< Command detail info. It includes command number, type, and qualifier */ + TelSatDeviceIdentitiesInfo_t deviceIdentities; /**< Device identities info. It includes source and destination devices */ + TelSatLanguageInfo_t language; /**< Language info from the USIM application */ +} TelSatLanguageNotificationIndInfo_t; + +/** + * @brief The structure type containing the data objects for LAUNCH BROWSER proactive command indication. + * @since_tizen 2.3 + */ +typedef struct { + TelSatCommandDetailInfo_t commandDetail; /**< Command detail info. it includes command number, type, and qualifier */ + TelSatDeviceIdentitiesInfo_t deviceIdentities; /**< Device identities info. It includes source and destination devices */ + TelSatBrowserIdentitiesInfo_t browserId; /**< Browser identity */ + TelSatUrlInfo_t url; /**< URL */ + TelSatBearerInfo_t bearer; /**< Bearer which is used by the 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; + +/** + * @brief The structure type containing the data objects for OPEN CHANNEL CSB proactive command indication data. + * @since_tizen 2.3 + */ +typedef struct { + TelSatAddressInfo_t address; /**< Channel address */ + TelSatSubAddressInfo_t subAddress; /**< Channel sub address */ + TelSatDurationInfo_t duration1; /**< Connection require time */ + TelSatDurationInfo_t duration2; /**< Connection require time 2 */ + TelSatBearerParametersCsdInfo_t bearerParamsCsd; /**< CSD info */ + TelSatBufferSizeInfo_t bufferSize; /**< Buffer size */ + TelSatOtherAddressInfo_t otherAddress; /**< Other address */ + TelSatTextTypeInfo_t userLogin; /**< User login */ + TelSatTextTypeInfo_t userPassword; /**< User password */ + TelSatSimMeInterfaceTransportLevelInfo_t simMeInterfaceTransportLevel; /**< SIM ME interface transport level */ + TelSatOtherAddressInfo_t dataDestinationAddress; /**< Data destination address */ +} TelSatOpenChannelCsbInfo_t; + +/** + * @brief The structure type containing the data objects for OPEN CHANNEL (packet) proactive command indication data. + * @since_tizen 2.3 + */ +typedef struct { + TelSatBearerParametersGprsInfo_t bearerParamsGprs; /**< GPRS info */ + TelSatBufferSizeInfo_t bufferSize; /**< Buffer size */ + TelSatnetworkAccessNameInfo_t networkAccessName; /**< Network access name */ + TelSatOtherAddressInfo_t otherAddress; /**< Other address */ + TelSatTextTypeInfo_t userLogin; /**< User login */ + TelSatTextTypeInfo_t userPassword; /**< User password */ + TelSatSimMeInterfaceTransportLevelInfo_t simMeInterfaceTransportLevel; /**< SIM ME interface transport level */ + TelSatOtherAddressInfo_t dataDestinationAddress; /**< Data destination address */ + TelSatTextAttributeInfo_t textAttribute; /**< Text attribute info - e.g. bold, center align */ +} TelSatOpenChannelpdbInfo_t; + +/** + * @brief The structure type containing the data objects for OPEN CHANNEL LOCAL LINK proactive command indication data. + * @since_tizen 2.3 + */ +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; /**< Buffer size */ + TelSatTextTypeInfo_t userPassword; /**< User password */ + TelSatSimMeInterfaceTransportLevelInfo_t simMeInterfaceTransportLevel; /**< SIM ME interface transport level */ + TelSatOtherAddressInfo_t dataDestinationAddress; /**< Data destination address */ + TelSatRemoteEntityAddressInfo_t remoteEntityAddress; /**< Remote entity address */ + TelSatTextAttributeInfo_t textAttribute; /**< Text attribute info - e.g. bold, center align */ +} TelSatOpenChannelLocalBearerInfo_t; + +/** + * @brief The structure type containing the data objects for OPEN CHANNEL (DEFAULT BEARER) proactive command indication data. + * @since_tizen 2.3 + */ +typedef struct { + TelSatBufferSizeInfo_t bufferSize; /**< Buffer size */ + TelSatOtherAddressInfo_t otherAddress; /**< Other address */ + TelSatTextTypeInfo_t userLogin; /**< User login */ + TelSatTextTypeInfo_t userPassword; /**< User password */ + TelSatSimMeInterfaceTransportLevelInfo_t simMeInterfaceTransportLevel;/**< SIM ME interface transport level */ + TelSatOtherAddressInfo_t dataDestinationAddress; /**< Data destination address */ +} TelSatOpenChannelDefaultBearerInfo_t; + +/** + * @brief The structure type containing the data objects for OPEN CHANNEL (UICC Server Mode) proactive command indication data. + * @since_tizen 2.3 + */ +typedef struct { + TelSatBufferSizeInfo_t bufferSize; /**< Buffer size */ + TelSatSimMeInterfaceTransportLevelInfo_t simMeInterfaceTransportLevel; /**< SIM ME interface transport level */ +} TelSatOpenChannelUiccServerModeInfo_t; + +/** + * @brief The structure type containing the data objects for OPEN CHANNEL proactive command indication data. + * @since_tizen 2.3 + */ +typedef struct { + TelSatCommandDetailInfo_t commandDetail; /**< Command detail info. It includes command number, type, and qualifier */ + TelSatDeviceIdentitiesInfo_t deviceIdentities; /**< Device identities info. It includes source and destination devices */ + int bIsUiccServerMode; /**< Flag that indicates whether UICC server mode is active */ + 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; /**< Default bearer */ + TelSatOpenChannelUiccServerModeInfo_t uiccServerMode; /**< UICC server mode */ + } details; /**< Open Channel Details */ +} TelSatOpenChannelIndInfo_t; + +/** + * @brief The structure type containing the data objects for CLOSE CHANNEL proactive command indication data. + * @since_tizen 2.3 + */ +typedef struct { + TelSatCommandDetailInfo_t commandDetail; /**< Command detail info. It includes command number, type, and qualifier */ + TelSatDeviceIdentitiesInfo_t deviceIdentities; /**< Device identities info. It 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; + +/** + * @brief The structure type containing the data objects for RECEIVE DATA proactive command indication data. + * @since_tizen 2.3 + */ +typedef struct { + TelSatCommandDetailInfo_t commandDetail; /**< Command detail info. It includes command number, type, and qualifier */ + TelSatDeviceIdentitiesInfo_t deviceIdentities; /**< Device identities info. It 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; + +/** + * @brief The structure type containing the data objects for SEND DATA proactive command indication data. + * @since_tizen 2.3 + */ +typedef struct { + TelSatCommandDetailInfo_t commandDetail; /**< Command detail info. It includes command number, type, and qualifier */ + TelSatDeviceIdentitiesInfo_t deviceIdentities; /**< Device identities info. It 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; + +/** + * @brief The structure type containing the data objects for GET CHANNEL STATUS proactive command indication data. + * @since_tizen 2.3 + */ +typedef struct { + TelSatCommandDetailInfo_t commandDetail; /**< Command detail info. It includes command number, type, and qualifier */ + TelSatDeviceIdentitiesInfo_t deviceIdentities; /**< Device identities info. It includes source and destination devices */ +} TelSatGetChannelStatusIndInfo_t; + +/** + * @brief The structure type containing the data object for END PROACTIVE SESSION command indication. + * @since_tizen 2.3 + */ +typedef struct { + TelSatCommandType_t commandType; /**< proactive command type */ +} TelSatEndProactiveSessionIndInfo_t; + +/** + * @brief The structure type containing the data objects for PROACTIVE command indication union data. + * @since_tizen 2.3 + */ +typedef struct { + union { + TelSatMoreTimeIndInfo_t moreTime; /**< TBD */ + 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; + +/** + * @brief The structure type containing the data objects for the Terminal Response of the DISPLAY TEXT proactive command. + * @since_tizen 2.3 + */ +typedef struct { + TelSatResultInfo_t result; /**< Result that indicates whether the current proactive command request is executed successfully */ +} TelSatDisplayTextRespInfo_t; + +/** + * @brief The structure type containing the data objects for the Terminal Response of the GET INKEY proactive command. + * @since_tizen 2.3 + */ +typedef struct { + TelSatResultInfo_t result; /**< Result that indicates whether the current proactive command request is executed successfully */ + TelSatTextTypeInfo_t text; /**< Inserted key info */ + TelSatDurationInfo_t duration; /**< TBD */ +} TelSatGetInkeyRespInfo_t; + +/** + * @brief The structure type containing the data objects for the Terminal Response of the PLAY TONE proactive command. + * @since_tizen 2.3 + */ +typedef struct { + TelSatResultInfo_t result; /**< Result that indicates whether the current proactive command request is executed successfully */ +} TelSatPlayToneRespInfo_t; + +/** + * @brief The structure type containing the data objects for the Terminal Response of the MORE TIME proactive command. + * @since_tizen 2.3 + */ +typedef struct { + TelSatResultInfo_t result; /**< Result that whether the current proactive command request is executed successfully */ +} TelSatMoreTimeRespInfo_t; + +/** + * @brief The structure type containing the data objects for the Terminal Response of the SETUP MENU proactive command. + * @since_tizen 2.3 + */ +typedef struct { + TelSatResultInfo_t result; /**< Result that indicates whether the current proactive command request is executed successfully */ +} TelSatSetupMenuRespInfo_t; + +/** + * @brief The structure type containing the data objects for the Terminal Response of the GET INPUT proactive command. + * @since_tizen 2.3 + */ +typedef struct { + TelSatResultInfo_t result; /**< Result that indicates whether the current proactive command request is executed successfully */ + TelSatTextTypeInfo_t text; /**< Inserted string info */ +} TelSatGetInputRespInfo_t; + +/** + * @brief The structure type containing the data objects for the Terminal Response of the SELECT ITEM proactive command. + * @since_tizen 2.3 + */ +typedef struct { + TelSatResultInfo_t result; /**< Result that indicates whether the current proactive command request is executed successfully */ + int bOtherInfo; /**< Flag to check whether other information is required */ + unsigned char itemIdentifier; /**< Item identifier */ +} TelSatSelectItemRespInfo_t; + +/** + * @brief The structure type containing the data objects for the Terminal Response of the PROVIDE LOCAL INFORMATION proactive command. + * @since_tizen 2.3 + */ +typedef struct { + TelSatResultInfo_t result; /**< Result that indicates whether the current proactive command request is executed successfully */ + int bOtherInfo; /**< Flag to check whether other information is required */ + TelSatCmdQualiProvideLocalInfo_t infoType; /**< Local info type - e.g. time zone or language info, and so on */ + union { + TelSatDataTimeZoneInfo_t timeZoneInfo; /**< Current time zone info */ + TelSatLanguageInfo_t languageInfo; /**< Current ME language setting info */ + } u; /**< Union */ +} TelSatProvideLocalInfoRespInfo_t; + +/** + * @brief The structure type containing the data objects for the Terminal Response of the SETUP EVENT LIST proactive command. + * @since_tizen 2.3 + */ +typedef struct { + TelSatResultInfo_t result; /**< Result that indicates whether the current proactive command request is executed successfully */ +} TelSatSetupEventListRespInfo_t; + +/** + * @brief The structure type containing the data objects for the Terminal Response of the SEND SMS proactive command. + * @since_tizen 2.3 + */ +typedef struct { + TelSatResultInfo_t result; /**< Result that indicates whether the current proactive command request is executed successfully */ + TelSatCallCtrlProblemType_t additionalCallCtrlProblemInfo; /**< Call control problem */ +} TelSatSendSmsRespInfo_t; + +/** + * @brief The structure type containing the data objects for the Terminal Response of the SET UP CALL proactive command. + * @since_tizen 2.3 + */ +typedef struct { + TelSatResultInfo_t result; /**< Result that indicates whether the current proactive command request is executed successfully */ + int bOtherInfo; /**< Flag to check whether other information is required */ + 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 causes problems */ + unsigned long tapiCause; /**< Tapi call level cause */ + unsigned long tapiSsCause; /**< Tapi SS level cause */ +} TelSatSetupCallRespInfo_t; + +/** + * @brief The structure type containing the data objects for the Terminal Response of the SEND SS proactive command. + * @since_tizen 2.3 + */ +typedef struct { + TelSatResultInfo_t result; /**< Result that indicates whether the current proactive command request is executed successfully */ + int bOtherInfo; /**< Flag to check whether other information is required */ + 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; + +/** + * @brief The structure type containing the data objects for the Terminal Response of the SEND USSD proactive command. + * @since_tizen 2.3 + */ +typedef struct { + TelSatResultInfo_t result; /**< Result that indicates whether the current proactive command request is executed successfully */ + int bOtherInfo; /**< Flag to check whether other information is required */ + 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; + +/** + * @brief The structure type containing the data objects for the Terminal Response of the REFRESH proactive command. + * @since_tizen 2.3 + */ +typedef struct { + TelSatResultInfo_t result; /**< Result that indicates whether the current proactive command request is executed successfully */ +} TelSatRefreshRespInfo_t; + +/** + * @brief The structure type containing the data objects for the Terminal Response of the GET CHANNEL STATUS proactive command. + * @since_tizen 2.3 + */ +typedef struct { + TelSatResultInfo_t result; /**< Result that indicates whether the current proactive command request is executed successfully */ + int bOtherInfo; /**< Flag to check whether other information is required */ + TelSatBipProblemType_t additionalProblemInfo; /**< BIP specific problem info */ + TelSatChannelStatusInfo_t channelStatus; /**< Channel Status */ +} TelSatGetChannelStatusRespInfo_t; + +/** + * @brief The structure type containing the data objects for the Terminal Response of the CLOSE CHANNEL proactive command. + * @since_tizen 2.3 + */ +typedef struct { + TelSatResultInfo_t result; /**< Result that indicates whether the current proactive command request is executed successfully */ + TelSatBipProblemType_t additionalProblemInfo; /**< BIP specific problem info */ +} TelSatCloseChannelRespInfo_t; + +/** + * @brief The structure type containing the data objects for the Terminal Response of the OPEN CHANNEL proactive command. + * @since_tizen 2.3 + */ +typedef struct { + TelSatResultInfo_t result; /**< Result that indicates whether the current proactive command request is executed successfully */ + int bOtherInfo; /**< Flag to check whether other information is required */ + TelSatBearerDescriptionInfo_t bearerDescription; /**< Bearer description */ + TelSatBipProblemType_t additionalProblemInfo; /**< BIP specific problem info */ + TelSatChannelStatusInfo_t channelStatus; /**< Channel status */ + TelSatBufferSizeInfo_t bufferSize; /**< Buffer size */ +} TelSatOpenChannelRespInfo_t; + +/** + * @brief The structure type containing the data objects for the Terminal Response of the LANGAUGE NOTIFICATION proactive command. + * @since_tizen 2.3 + */ +typedef struct { + TelSatResultInfo_t result; /**< Result that indicates whether the current proactive command request is executed successfully */ +} TelSatLanguageNotificationRespInfo_t; + +/** + * @brief The structure type containing the data objects for the Terminal Response of the LAUNCH BROWSER proactive command. + * @since_tizen 2.3 + */ +typedef struct { + TelSatResultInfo_t result; /**< Result that indicates whether the current proactive command request is executed successfully */ + TelSatLaunchBrowserProblemType_t additionalProblemInfo; /**< Browser specific problem info */ +} TelSatLaunchBrowserRespInfo_t; + +/** + * @brief The structure type containing the data objects for the Terminal Response of the RECEIVE DATA proactive command. + * @since_tizen 2.3 + */ +typedef struct { + TelSatResultInfo_t result; /**< Result that indicates whether the current proactive command request is executed successfully */ + TelSatBipProblemType_t additionalProblemInfo; /**< BIP specific problem info */ + int bOtherInfo; /**< Flag to check whether other information is required */ + TelSatChannelDataInfo_t channel_data; /**< Channel data */ + unsigned char channelDataLen; /**< Channel data length */ +} TelSatReceiveDataRespInfo_t; + +/** + * @brief The structure type containing the data objects for the Terminal Response of the SEND DATA proactive command. + * @since_tizen 2.3 + */ +typedef struct { + TelSatResultInfo_t result; /**< Result that indicates whether the current proactive command request is executed successfully */ + TelSatBipProblemType_t additionalProblemInfo; /**< BIP specific problem info */ + unsigned char channelDataLen; /**< Channel data length */ +} TelSatSendDataRespInfo_t; + +/** + * @brief The structure type containing the data objects for the Terminal Response of the SETUP IDLE MODE TEXT proactive command. + * @since_tizen 2.3 + */ +typedef struct { + TelSatResultInfo_t result; /**< Result that indicates whether the current proactive command request is executed successfully */ +} TelSatSetupIdlemodeTextRespInfo_t; + +/** + * @brief The structure type containing the data objects for the Terminal Response of the SEND DTMF proactive command. + * @since_tizen 2.3 + */ +typedef struct { + TelSatResultInfo_t result; /**< Result that indicates whether the current proactive command request is executed successfully */ +} TelSatSendDtmfRespInfo_t; + +/** + * @brief The structure type containing the data structures to be used to send the proactive command response. + * @since_tizen 2.3 + */ +typedef struct { + unsigned char commandNumber; /**< Proactive command number */ + TelSatCommandType_t commandType; /**< Proactive command type */ + union { + TelSatMoreTimeRespInfo_t moreTime; /**< TBD */ + TelSatDisplayTextRespInfo_t displayText; /**< Terminal response info from the displayText proactive command */ + TelSatGetInkeyRespInfo_t getInkey; /**< Terminal response info from the getInkey proactive command */ + TelSatGetInputRespInfo_t getInput; /**< Terminal response info from the getInput proactive command */ + TelSatPlayToneRespInfo_t playTone; /**< Terminal response info from the playTone proactive command */ + TelSatSetupMenuRespInfo_t setupMenu; /**< Terminal response info from the setupMenu proactive command */ + TelSatSelectItemRespInfo_t selectItem; /**< Terminal response info from the selectItem proactive command */ + TelSatSendSmsRespInfo_t sendSms; /**< Terminal response info from the sendSms proactive command */ + TelSatSendSsRespInfo_t sendSs; /**< Terminal response info from the sendSs proactive command */ + TelSatSendUssdRespInfo_t sendUssd; /**< Terminal response info from the sendUssd proactive command */ + TelSatSetupCallRespInfo_t setupCall; /**< Terminal response info from the setupCall proactive command */ + TelSatRefreshRespInfo_t refresh; /**< Terminal response info from the refresh proactive command */ + TelSatProvideLocalInfoRespInfo_t provideLocInfo; /**< Terminal response info from the provide Local Info proactive command */ + TelSatLaunchBrowserRespInfo_t launchBrowser; /**< Terminal response info from the launch Browser proactive command */ + TelSatSetupIdlemodeTextRespInfo_t idleText; /**< Terminal response info from the setup idle mode text proactive command */ + TelSatSendDtmfRespInfo_t sendDtmf; /**< Terminal response info from the send DTMF proactive command */ + TelSatLanguageNotificationRespInfo_t languageNotification; /**< Terminal response info from the language Notification proactive command */ + TelSatSetupEventListRespInfo_t setupEventList; /**< Terminal response info from the setup Event List proactive command */ + TelSatOpenChannelRespInfo_t openChannel; /**< Terminal response info from the openChannel proactive command */ + } terminalRespInfo; /**< Union */ +} TelSatRespInfo_t; + +/* + * SAT Icon Data + */ + +typedef struct { + unsigned char iconId; /**< TBD */ + unsigned char imgType; /**< TBD */ + unsigned char imgLen; /**< TBD */ + unsigned char imgData[256]; /**< TBD */ +} TelSatIconDataResp_t; + +typedef struct { + unsigned char iconId; /**< TBD */ + unsigned char imgType; /**< TBD */ + unsigned char fileId[2]; /**< TBD */ + unsigned char reqDataLen[2]; /**< TBD */ + unsigned char offset[2]; /**< TBD */ +} TelsatIconDataGet_t; + +#ifdef __cplusplus +} +#endif + +#endif /* _TEL_SAT_PROACTV_CMD_H_ */ + +/** + * @} + */ diff --git a/include/TelSim.h b/include/TelSim.h new file mode 100644 index 0000000..2f89f8f --- /dev/null +++ b/include/TelSim.h @@ -0,0 +1,1628 @@ +/* + * libslp-tapi + * + * Copyright (c) 2014 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Ja-young Gu + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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 TelSim.h + */ + +/** + * @internal + * @addtogroup CAPI_TELEPHONY_SERVICE_SIM + * @{ + */ + +#ifndef _TELSIM_H_ +#define _TELSIM_H_ + +#ifdef __cplusplus +extern "C" +{ +#endif + +/** + * @brief Definition for the maximum length of ICCID. + * @since_tizen 2.3 + */ +#define TAPI_SIM_ICCID_LEN_MAX 20 + +/** + * @brief Definition for the maximum length of the alpha ID. + * @since_tizen 2.3 + */ +#define TAPI_SIM_XDN_ALPHA_ID_MAX_LEN 30 + +/** + * @brief Definition for the maximum length of the dialing number. + * @since_tizen 2.3 + */ +#define TAPI_SIM_XDN_DIALING_NUMBER_LEN 20 + +/** + * @brief Definition for the maximum length of the MSISDN number. + * @since_tizen 2.3 + */ +#define TAPI_SIM_MSISDN_DIALING_NUMBER_LEN 26 + +/** + * @brief Definition for the maximum length of the CSP profile entry count. + * @since_tizen 2.3 + */ +#define TAPI_SIM_CPHS_CUSTOMER_SERVICE_PROFILE_ENTRY_COUNT_MAX 11 + +/** + * @brief Definition for the maximum length of the authentication code. + * @since_tizen 2.3 + */ +#define TAPI_SIM_AUTH_MAX_REQ_DATA_LEN 256 + +/** + * @brief Definition for the maximum length of authentication response data. + * @since_tizen 2.3 + */ +#define TAPI_SIM_AUTH_MAX_RESP_DATA_LEN 128 + +/** + * @brief Definition for the maximum length of SAP APDU. + * @details 2048 is for QMI definition. (1024 : general length, 1024 : extra length for additional response). + * @since_tizen 2.3 + */ +#define TAPI_SIM_APDU_MAX_LEN 2048 + +/** + * @brief Definition for the maximum length of the SIM 3G Phone book EF. + * @since_tizen 2.3 + */ +#define TAPI_SIM_PB_3G_FILE_MAX_COUNT 13 + +/** + * @brief Definition for the maximum length of the SIM Phone book Record name. + * @since_tizen 2.3 + */ +#define TAPI_SIM_PB_RECORD_NAME_MAX_LEN 255 + +/** + * @brief Definition for the maximum length of the SIM Phone book Record number. + * @since_tizen 2.3 + */ +#define TAPI_SIM_PB_RECORD_NUMBER_MAX_LEN 255 + +/** + * @brief Definition for the maximum length of the SIM Phone book Record email. + * @since_tizen 2.3 + */ +#define TAPI_SIM_PB_RECORD_EMAIL_MAX_LEN 255 + +/** + * @brief Definition for the maximum length of the SAP answer to reset data. + * @since_tizen 2.3 + */ +#define TAPI_SIM_SAP_ATR_DATA 256 + +#define TAPI_SIM_NET_FULL_NAME_MAX_LEN 40 + +#define TAPI_SIM_NET_SHORT_NAME_MAX_LEN 10 + +#define TAPI_SIM_MSP_CNT_MAX 2 + +#define TAPI_SIM_OPERATION_TIMEOUT 1234 + +#define TAPI_SIM_SST_SERVICE_CNT_MAX 56 + +#define TAPI_SIM_UST_SERVICE_CNT_MAX 64 + +#define TAPI_SIM_CDMA_ST_SERVICE_CNT_MAX 47 + +#define TAPI_SIM_CSIM_ST_SERVICE_CNT_MAX 41 + +#define TAPI_SIM_GROUP_IDENTIFIER_LEN_MAX 10 + +#define TAPI_SIM_OPLMNWACT_LEN_MAX 100 + +/** + * @brief Enumeration for the card type. + * @since_tizen 2.3 + */ +typedef enum { + TAPI_SIM_CARD_TYPE_UNKNOWN, /**< Unknown card */ + TAPI_SIM_CARD_TYPE_GSM, /**< SIM(GSM) card */ + TAPI_SIM_CARD_TYPE_USIM, /**< USIM card */ + TAPI_SIM_CARD_TYPE_RUIM, /**< CDMA card */ + TAPI_SIM_CARD_TYPE_NVSIM, /**< CDMA NV SIM */ + TAPI_SIM_CARD_TYPE_IMS, /**< will be deprecated */ +} TelSimCardType_t; + +/** + * @brief Enumeration for the file ID. + * @since_tizen 2.3 + */ +typedef enum { + TAPI_SIM_EF_DIR = 0x2F00, /**< Root Directory for the USIM */ + TAPI_SIM_EF_ICCID = 0x2FE2, /**< The ICC Identification file */ + TAPI_SIM_EF_IMSI = 0x6F07, /**< The IMSI file */ + TAPI_SIM_EF_SST = 0x6F38, /**< The SIM Service Table file */ + TAPI_SIM_EF_EST = 0x6F56, /**< The Enabled Service Table file */ + TAPI_SIM_EF_OPLMN_ACT = 0x6F61, /**< The OPLMN List file */ + TAPI_SIM_EF_GID1 = 0x6F3E, /**< The Group Identifier Level 1 */ + TAPI_SIM_EF_GID2 = 0x6F3F, /**< The Group Identifier Level 2 */ + + TAPI_SIM_EF_ELP = 0x2F05, /**< The Extended Language Preference file */ + TAPI_SIM_EF_LP = 0x6F05, /**< SIM: Language preference */ + TAPI_SIM_EF_ECC = 0x6FB7, /**< The Emergency Call Codes */ + TAPI_SIM_EF_SPN = 0x6F46, /**< The Service Provider Name */ + TAPI_SIM_EF_SPDI = 0x6FCD, /**< The Service provider display information */ + TAPI_SIM_EF_PNN = 0x6FC5, /**< The PLMN Network Name File */ + TAPI_SIM_EF_OPL = 0x6FC6, /**< The Operator PLMN List File */ + TAPI_SIM_EF_MSISDN = 0x6F40, /**< MSISDN */ + + TAPI_SIM_EF_SMS = 0x6F3C, /**< Short Messages file */ + TAPI_SIM_EF_SMSP = 0x6F42, /**< SMS Parameter */ + TAPI_SIM_EF_SMSS = 0x6F43, /**< SMS Status */ + TAPI_SIM_EF_CBMI = 0x6F45, /**< Cell Broadcast Message Identifier */ + TAPI_SIM_EF_MBDN = 0x6FC7, /**< SIM Mail Box Dialing Number file */ + + TAPI_SIM_EF_USIM_MBI = 0x6FC9, /**< Mailbox Identifier - linear fixed */ + TAPI_SIM_EF_USIM_MWIS = 0x6FCA, /**< Message Waiting Indication Status - linear fixed */ + TAPI_SIM_EF_USIM_CFIS = 0x6FCB, /**< Call forward indication status - linear fixed */ + + /* CPHS FILE ID */ + TAPI_SIM_EF_CPHS_VOICE_MSG_WAITING = 0x6F11, /**< CPHS voice MSG waiting indication */ + TAPI_SIM_EF_CPHS_SERVICE_STRING_TABLE = 0x6F12, /**< CPHS service string table */ + TAPI_SIM_EF_CPHS_CALL_FORWARD_FLAGS = 0x6F13, /**< CPHS call forward flags */ + TAPI_SIM_EF_CPHS_OPERATOR_NAME_STRING = 0x6F14, /**< CPHS operator name string */ + TAPI_SIM_EF_CPHS_CUSTOMER_SERVICE_PROFILE = 0x6F15, /**< CPHS customer service profile */ + TAPI_SIM_EF_CPHS_CPHS_INFO = 0x6F16, /**< CPHS information */ + TAPI_SIM_EF_CPHS_MAILBOX_NUMBERS = 0x6F17, /**< CPHS mail box numbers */ + TAPI_SIM_EF_CPHS_OPERATOR_NAME_SHORT_FORM_STRING = 0x6F18, /**< CPHS operator name short form string */ + TAPI_SIM_EF_CPHS_INFORMATION_NUMBERS = 0x6F19, /**< CPHS information numbers */ + /* CPHS ALS FILE ID */ + TAPI_SIM_EF_CPHS_DYNAMICFLAGS = 0x6F9F, /**< CPHS Dynamics flags */ + TAPI_SIM_EF_CPHS_DYNAMIC2FLAG = 0x6F92, /**< CPHS Dynamics2 flags */ + TAPI_SIM_EF_CPHS_CUSTOMER_SERVICE_PROFILE_LINE2 = 0x6F98, /**< CPHS CSP2 */ + + /* Invalid File ID, All the file IDs are less than this Value */ + TAPI_SIM_EF_INVALID = 0xFFFF, /**< Invalid file */ + TAPI_SIM_EF_OTHERS, /**< Element to indicate an unknown file */ +}TelSimFileID_t; + +/** + * @brief Enumeration for the PIN status. + * @since_tizen 2.3 + */ +typedef enum { + TAPI_SIM_FACILITY_DISABLED = 0x00, /**< TBD */ + TAPI_SIM_FACILITY_ENABLED = 0x01, /**< TBD */ + TAPI_SIM_FACILITY_UNKNOWN = 0xFF /**< TBD */ +} TelSimFacilityStatus_t; + +/** + * @brief Enumeration for the PIN operation result from the lower layers. + * @since_tizen 2.3 + */ +typedef enum { + TAPI_SIM_PIN_OPERATION_SUCCESS, /**< Operation involving PIN (verification/change/enable/disable, and so on) is successful */ + TAPI_SIM_BUSY, /**< SIM is busy */ + TAPI_SIM_CARD_ERROR, /**< SIM card error - General errors */ + TAPI_SIM_INCOMPATIBLE_PIN_OPERATION, /**< SIM Incompatible PIN operation when an invalid SIM command is given or incorrect parameters are supplied to the SIM */ + TAPI_SIM_PIN_INCORRECT_PASSWORD, /**< SIM PIN incorrect password */ + TAPI_SIM_PUK_INCORRECT_PASSWORD, /**< SIM PUK incorrect password */ + TAPI_SIM_PUK_REQUIRED, /**< PUK Required */ + TAPI_SIM_PIN_REQUIRED, /**< PIN Required */ + TAPI_SIM_NCK_REQUIRED, /**< Network Control Key Required */ + TAPI_SIM_NSCK_REQUIRED, /**< Network Subset Control Key Required */ + TAPI_SIM_SPCK_REQUIRED, /**< Service Provider Control Key Required */ + TAPI_SIM_CCK_REQUIRED, /**< Corporate Control Key Required */ + TAPI_SIM_LOCK_REQUIRED, /**< PH-SIM (phone-SIM) locked state */ + TAPI_SIM_PERM_BLOCKED /**< Permanently Blocked */ +} TelSimPinOperationResult_t; + +/** + * @brief Enumeration for the SIM access result from the lower layers. + * @since_tizen 2.3 + */ +typedef enum { + TAPI_SIM_ACCESS_SUCCESS, /**< Access to file is successful */ + TAPI_SIM_ACCESS_CARD_ERROR, /**< SIM card error */ + TAPI_SIM_ACCESS_FILE_NOT_FOUND, /**< File not found */ + TAPI_SIM_ACCESS_ACCESS_CONDITION_NOT_SATISFIED, /**< Access condition is not fulfilled */ + TAPI_SIM_ACCESS_FAILED, /**< Access failed */ +} TelSimAccessResult_t; + +/** + * @brief Enumeration for the SIM power set result from the lower layers. + * @since_tizen 2.3 + */ +typedef enum { + TAPI_SIM_POWER_SET_SUCCESS, /**< Power Set is successful */ + TAPI_SIM_POWER_SET_FAILURE /**< Power Set failure */ +} TelSimPowerSetResult_t; + +/** + * @brief Enumeration for the PIN type. + * @since_tizen 2.3 + */ +typedef enum { + TAPI_SIM_PTYPE_PIN1 = 0x00, /**< PIN 1 code */ + TAPI_SIM_PTYPE_PIN2 = 0x01, /**< PIN 2 code */ + TAPI_SIM_PTYPE_PUK1 = 0x02, /**< PUK 1 code */ + TAPI_SIM_PTYPE_PUK2 = 0x03, /**< PUK 2 code */ + TAPI_SIM_PTYPE_UPIN = 0x04, /**< Universal PIN - Unused now */ + TAPI_SIM_PTYPE_ADM = 0x05, /**< Administrator - Unused now */ + TAPI_SIM_PTYPE_SIM = 0x06 /**< SIM Lock code */ +} TelSimPinType_t; + +/** + * @brief Enumeration for the number type. + * @since_tizen 2.3 + */ +typedef enum { + TAPI_SIM_TON_UNKNOWN = 0, /**< Unknown */ + TAPI_SIM_TON_INTERNATIONAL = 1, /**< International number */ + TAPI_SIM_TON_NATIONAL = 2, /**< National number */ + TAPI_SIM_TON_NETWORK_SPECIFIC = 3, /**< Network specific number */ + TAPI_SIM_TON_DEDICATED_ACCESS = 4, /**< Subscriber number */ + TAPI_SIM_TON_ALPHA_NUMERIC = 5, /**< Alphanumeric, GSM 7-bit default alphabet */ + TAPI_SIM_TON_ABBREVIATED_NUMBER = 6, /**< Abbreviated number */ + TAPI_SIM_TON_RESERVED_FOR_EXT = 7 /**< Reserved for extension */ +} TelSimTypeOfNum_t; + +/** + * @brief Enumeration for the text encryption type. + * @since_tizen 2.3 + */ +typedef enum { + TAPI_SIM_TEXT_ENC_ASCII, /**< ASCII Encoding */ + TAPI_SIM_TEXT_ENC_GSM7BIT, /**< GSM 7 Bit Encoding */ + TAPI_SIM_TEXT_ENC_UCS2, /**< UCS2 Encoding */ + TAPI_SIM_TEXT_ENC_HEX, /**< HEX Encoding */ +} TelSimTextEncrypt_t; + +/** + * @brief Enumeration for the numbering plan identifier. + * @since_tizen 2.3 + */ +typedef enum { + TAPI_SIM_NPI_UNKNOWN = 0, /**< Unknown */ + TAPI_SIM_NPI_ISDN_TEL = 1, /**< ISDN/Telephone numbering plan */ + TAPI_SIM_NPI_DATA_NUMBERING_PLAN = 3, /**< Data numbering plan */ + TAPI_SIM_NPI_TELEX = 4, /**< Telex numbering plan */ + TAPI_SIM_NPI_SVC_CNTR_SPECIFIC_PLAN = 5, /**< Service Center Specific plan */ + TAPI_SIM_NPI_SVC_CNTR_SPECIFIC_PLAN2 = 6, /**< Service Center Specific plan */ + TAPI_SIM_NPI_NATIONAL = 8, /**< National numbering plan */ + TAPI_SIM_NPI_PRIVATE = 9, /**< Private numbering plan */ + TAPI_SIM_NPI_ERMES_NUMBERING_PLAN = 10, /**< ERMES numbering plan */ + TAPI_SIM_NPI_RESERVED_FOR_EXT = 0xF /**< Reserved for extension */ +} TelSimNumberingPlanIdentity_t; + +/** + * @brief Enumeration for the emergency service type. + * @since_tizen 2.3 + */ +typedef enum { + TAPI_SIM_ECC_ESC_POLICE = 0x01, /**< Police */ + TAPI_SIM_ECC_ESC_AMBULANCE = 0x02, /**< Ambulance */ + TAPI_SIM_ECC_ESC_FIREBRIGADE = 0x04, /**< Fire brigade */ + TAPI_SIM_ECC_ESC_MARAINEGUARD = 0x08, /**< Marine guard */ + TAPI_SIM_ECC_ESC_MOUTAINRESCUE = 0x10, /**< Mountain rescue */ + TAPI_SIM_ECC_ESC_SPARE = 0x00 /**< Spare */ +} TelSimEccEmergencyServiceInfo_t; + +/** + * @brief Enumeration for the language preference code. + * @since_tizen 2.3 + */ +typedef enum { + TAPI_SIM_LP_GERMAN = 0x00, /**< German */ + TAPI_SIM_LP_ENGLISH = 0x01, /**< English */ + TAPI_SIM_LP_ITALIAN = 0x02, /**< Italian */ + TAPI_SIM_LP_FRENCH = 0x03, /**< French */ + TAPI_SIM_LP_SPANISH = 0x04, /**< Spanish */ + TAPI_SIM_LP_DUTCH = 0x05, /**< Dutch */ + TAPI_SIM_LP_SWEDISH = 0x06, /**< Swedish */ + TAPI_SIM_LP_DANISH = 0x07, /**< Danish */ + TAPI_SIM_LP_PORTUGUESE = 0x08, /**< Portuguese */ + TAPI_SIM_LP_FINNISH = 0x09, /**< Finnish */ + TAPI_SIM_LP_NORWEGIAN = 0x0A, /**< Norwegian */ + TAPI_SIM_LP_GREEK = 0x0B, /**< Greek */ + TAPI_SIM_LP_TURKISH = 0x0C, /**< Turkish */ + TAPI_SIM_LP_HUNGARIAN = 0x0D, /**< Hungarian */ + TAPI_SIM_LP_POLISH = 0x0E, /**< Polish */ + TAPI_SIM_LP_KOREAN = 0x0F, /**< Korean */ + TAPI_SIM_LP_CHINESE = 0x10, /**< Chinese */ + TAPI_SIM_LP_RUSSIAN = 0x11, /**< Russian */ + TAPI_SIM_LP_JAPANESE = 0x12, /**< Japanese */ + TAPI_SIM_LP_LANG_UNSPECIFIED = 0xFF /**< Unspecified */ +} TelSimLanguagePreferenceCode_t; + +/** + * @brief Enumeration for the SIM card status. + * @since_tizen 2.3 + */ +typedef enum { + TAPI_SIM_STATUS_CARD_ERROR = 0x00, /**< Bad card / On the fly SIM gone bad */ + TAPI_SIM_STATUS_CARD_NOT_PRESENT = 0x01, /**< Card not present */ + TAPI_SIM_STATUS_SIM_INITIALIZING = 0x02, /**< SIM is in the Initializing state */ + TAPI_SIM_STATUS_SIM_INIT_COMPLETED = 0x03, /**< SIM Initialization ok */ + TAPI_SIM_STATUS_SIM_PIN_REQUIRED = 0x04, /**< PIN required state */ + TAPI_SIM_STATUS_SIM_PUK_REQUIRED = 0x05, /**< PUK required state */ + TAPI_SIM_STATUS_CARD_BLOCKED = 0x06, /**< PIN/PUK blocked(permanently blocked- All the attempts for PIN/PUK failed) */ + TAPI_SIM_STATUS_SIM_NCK_REQUIRED = 0x07, /**< Network Control Key required state */ + TAPI_SIM_STATUS_SIM_NSCK_REQUIRED = 0x08, /**< Network Subset Control Key required state */ + TAPI_SIM_STATUS_SIM_SPCK_REQUIRED = 0x09, /**< Service Provider Control Key required state */ + TAPI_SIM_STATUS_SIM_CCK_REQUIRED = 0x0a, /**< Corporate Control Key required state */ + TAPI_SIM_STATUS_CARD_REMOVED = 0x0b, /**< Card removed */ + TAPI_SIM_STATUS_SIM_LOCK_REQUIRED = 0x0c, /**< PH-SIM (phone-SIM) locked state */ + TAPI_SIM_STATUS_CARD_CRASHED = 0x0d, /**< Runtime SIM card error */ + TAPI_SIM_STATUS_CARD_POWEROFF = 0x0e, /**< SIM card Powered OFF */ + TAPI_SIM_STATUS_UNKNOWN = 0xff /**< Unknown status. It can be the initial status */ +} TelSimCardStatus_t; + +/** + * @brief The structure type for the SIM card status. + * @details This structure has information on the card_status and whether it is changed. + * @since_tizen 2.3 + */ +typedef struct { + TelSimCardStatus_t card_status; /**< TBD */ + unsigned char b_is_changed; /**< TBD */ +} TelSimInitInfo_t; + +/** + * @brief Enumeration for the current CPHS phase of the SIM card. + * @since_tizen 2.3 + */ +typedef enum { + TAPI_SIM_CPHS_PHASE1 = 0x01, /**< Phase 1 */ + TAPI_SIM_CPHS_PHASE2 = 0x02, /**< Phase 2 */ + TAPI_SIM_CPHS_PHASE_RFU = 0xff /**< RFU */ +} TelSimCphsPhaseType_t; + +/** + * @brief The structure type for the CPHS index level indication. + * @since_tizen 2.3 + */ +typedef enum { + TAPI_SIM_CPHS_INDEX_LEVEL_ONE = 0x01, /**< SIM CPHS index level one */ + TAPI_SIM_CPHS_INDEX_LEVEL_TWO = 0x02, /**< SIM CPHS index level two */ + TAPI_SIM_CPHS_INDEX_LEVEL_THREE = 0x03, /**< SIM CPHS index level three */ + TAPI_SIM_CPHS_INDEX_LEVEL_RFU = 0xff /**< SIM CPHS index level RFU */ +} TelSimCphsIndexLevelIndicator_t; + +/** + * @brief The structure type for CPHS group service type information. + * @since_tizen 2.3 + */ +typedef enum { + TAPI_SIM_CPHS_CSP_SERVICE_GROUP_CALL_OFFERING = 0x01, /**< Group CSP offering */ + TAPI_SIM_CPHS_CSP_SERVICE_GROUP_CALL_RESTRICTION = 0x02, /**< Group CSP restriction */ + TAPI_SIM_CPHS_CSP_SERVICE_GROUP_OTHER_SUPP_SERVICES = 0x03, /**< Group CSP supplementary services */ + TAPI_SIM_CPHS_CSP_SERVICE_GROUP_CALL_COMPLETION = 0x04, /**< Group CSP completion */ + TAPI_SIM_CPHS_CSP_SERVICE_GROUP_TELESERVICES = 0x05, /**< Group CSP teleservices */ + TAPI_SIM_CPHS_CSP_SERVICE_GROUP_CPHS_TELESERVICES = 0x06, /**< Group CSP CPHS teleservices */ + TAPI_SIM_CPHS_CSP_SERVICE_GROUP_CPHS_FEATURES = 0x07, /**< Group CSP CPHS features */ + TAPI_SIM_CPHS_CSP_SERVICE_GROUP_NUMBER_IDENTIFIERS = 0x08, /**< Group CSP number identifiers */ + TAPI_SIM_CPHS_CSP_SERVICE_GROUP_PHASE_SERVICES = 0x09, /**< Group CSP phase services */ + TAPI_SIM_CPHS_CSP_SERVICE_GROUP_VALUE_ADDED_SERVICES = 0xC0, /**< Group CSP value added services */ + TAPI_SIM_CPHS_CSP_SERVICE_GROUP_INFORMATION_NUMBERS = 0xD5 /**< Group CSP information numbers */ +} TelSimCphsCustomerServiceGroup_t; + +/** + * @brief Enumeration for the mailbox type. + * @since_tizen 2.3 + */ +typedef enum { + TAPI_SIM_MAILBOX_VOICE = 0x01, /**< Voicemail */ + TAPI_SIM_MAILBOX_FAX = 0x02, /**< Fax */ + TAPI_SIM_MAILBOX_EMAIL = 0x03, /**< Email */ + TAPI_SIM_MAILBOX_OTHER = 0x04, /**< Other */ + TAPI_SIM_MAILBOX_VIDEO = 0x05, /**< Videomail */ + TAPI_SIM_MAILBOX_DATA = 0x06, /**< Data */ +} TelSimMailboxType_t; + +/** + * @brief Enumeration for the dynamics flag selected line information. + * @since_tizen 2.3 + */ +typedef enum { + TAPI_SIM_DYNAMIC_FLAGS_LINE1 = 0x01, /**< line 1 */ + TAPI_SIM_DYNAMIC_FLAGS_LINE2 = 0x00, /**< line 2 */ + TAPI_SIM_DYNAMIC_FLAGS_RFU = 0xff /**< RFU */ +} TelSimDynamicFlagsSelectedLineId_t; + +/** + * @brief Enumeration for the dynamics2 flag selected line information. + * @since_tizen 2.3 + */ +typedef enum { + TAPI_SIM_PIN2_ACCESSIBLE_FLAGS_LOCKED = 0x01, /**< Dynamic flags locked */ + TAPI_SIM_PIN2_ACCESSIBLE_FLAGS_UNLOCKED = 0x00, /**< Dynamic flags unlocked */ + TAPI_SIM_PIN2_ACCESSIBLE_FLAGS_RFU = 0xff /**< RFU */ +} TelSimDynamic2FlagAlsStatus_t; + + +/** + * @brief Enumeration for the SIM Authentication type. + * @details This is used in the SIM-based Authentication Procedure. + * @since_tizen 2.3 + */ +typedef enum { + TAPI_SIM_AUTH_TYPE_IMS = 0x00, /**< IMS Authentication */ + TAPI_SIM_AUTH_TYPE_GSM, /**< GSM Authentication */ + TAPI_SIM_AUTH_TYPE_3G, /**< 3G Authentication */ + TAPI_SIM_AUTH_RUIM_CAVE, /**< CDMA CAVE Authentication */ + TAPI_SIM_AUTH_RUIM_CHAP, /**< CDMA CHAP Authentication */ + TAPI_SIM_AUTH_RUIM_MNHA, /**< CDMA MNHA Authentication */ + TAPI_SIM_AUTH_RUIM_MIPRRQ, /**< CDMA MIPRRQ Authentication */ + TAPI_SIM_AUTH_RUIM_MNAAA, /**< CDMA MNAAA Authentication */ + TAPI_SIM_AUTH_RUIM_HRPD, /**< CDMA HRPD Authentication */ + TAPI_SIM_AUTH_TYPE_MAX /**< TBD */ +} TelSimAuthenticationType_t; + +/** + * @brief Enumeration for the SIM Authentication result. + * @details This is used for the Authentication Procedure. + * @since_tizen 2.3 + */ +typedef enum { + TAPI_SIM_AUTH_NO_ERROR = 0x00, /**< ISIM no error */ + TAPI_SIM_AUTH_CANNOT_PERFORM, /**< Status - can't perform authentication */ + TAPI_SIM_AUTH_SKIP_RESPONSE, /**< Status - skip authentication response */ + TAPI_SIM_AUTH_MAK_CODE_FAILURE, /**< Status - MAK(Multiple Activation Key) code failure */ + TAPI_SIM_AUTH_SQN_FAILURE, /**< Status - SQN(SeQuenceNumber) failure */ + TAPI_SIM_AUTH_SYNCH_FAILURE, /**< Status - synch failure */ + TAPI_SIM_AUTH_UNSUPPORTED_CONTEXT, /**< Status - unsupported context */ + TAPI_SIM_AUTH_MAX /**< TBD */ +} TelSimAuthenticationResult_t; + +/** + * @brief Enumeration for the security lock type. + * @since_tizen 2.3 + */ +typedef enum { + TAPI_SIM_LOCK_PS = 0x01, /**< PH-SIM (phone-SIM) locked. Lock Phone to SIM/UICC card + * (MT asks for the password when a SIM/UICC card other than current SIM/UICC card is inserted; + * MT may remember a certain amount of previously used cards thus not + * requiring the password when they are inserted + */ + TAPI_SIM_LOCK_PF, /**< PH-FSIM (phone-first-SIM) Lock Phone to the very + * First inserted SIM/UICC card(MT asks for the password when a SIM/UICC card other than the first SIM/UICC + * card is inserted + */ + TAPI_SIM_LOCK_SC, /**< SIM Lock (PIN, PIN2, PUK, PUK2) Lock SIM/UICC card ( SIM asks for the 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, /**< Corporate Personalization */ +} TelSimLockType_t; + +/** + * @brief Enumeration for the security lock key information. + * @since_tizen 2.3 + */ +typedef enum { + TAPI_SIM_LOCK_KEY_NOT_NEED = 0x00, /**< Key not needed */ + TAPI_SIM_LOCK_KEY_PIN = 0x01, /**< PIN required */ + TAPI_SIM_LOCK_KEY_PUK = 0x02, /**< PUK required */ + TAPI_SIM_LOCK_KEY_PIN2 = 0x03, /**< PIN2 required */ + TAPI_SIM_LOCK_KEY_PUK2 = 0x04, /**< PUK2 required */ + TAPI_SIM_LOCK_PERM_BLOCKED = 0x05, /**< Permanent block SIM */ +} TelSimLockStatus_t; + +/** + * @brief Enumeration for the SAP message IDs between the SAP client and SAP server. + * @since_tizen 2.3 + */ +typedef enum { + TAPI_SIM_SAP_POWER_SIM_ON_REQ, /**< SAP Client request about power SIM on in the Server */ + TAPI_SIM_SAP_POWER_SIM_OFF_REQ, /**< SAP Client request about power SIM off in the Server */ + TAPI_SIM_SAP_RESET_SIM_REQ, /**< SAP Client request about SIM reset in the Server */ +} TelSimSapPowerMode_t; + +/** + * @brief Enumeration for the SAP connection status information. + * @since_tizen 2.3 + */ +typedef enum { + TAPI_SIM_SAP_CONNECTION_STATUS_OK = 0x00, /**< Connected successfully */ + TAPI_SIM_SAP_CONNECTION_STATUS_UNABLE_TO_ESTABLISH, /**< Unable to establish connection */ + TAPI_SIM_SAP_CONNECTION_STATUS_NOT_SUPPORT_MAX_SIZE, /**< When server does not support the message length of the message that the client wants to send */ + TAPI_SIM_SAP_CONNECTION_STATUS_TOO_SMALL_MAX_SIZE /**< When client wants to connect with a very small message length that is not supported by the Server */ +} TelSimSapConnectionStatus_t; + +/** + * @brief Enumeration for the SAP disconnect type information. + * @since_tizen 2.3 + */ +typedef enum { + TAPI_SIM_SAP_DISCONNECT_TYPE_GRACEFUL = 0x00, /**< Disconnection procedure ends after finishing the current work */ + TAPI_SIM_SAP_DISCONNECT_TYPE_IMMEDIATE /**< Disconnection procedure ends immediately */ +} TelSimSapDissconnectType_t; + +/** + * @brief Enumeration for the SAP current connection status information. + * @since_tizen 2.3 + */ +typedef enum { + TAPI_SIM_SAP_STATUS_UNKNOWN = 0x00, /**< SAP server connection status - unknown */ + TAPI_SIM_SAP_STATUS_NO_SIM, /**< SAP server connection status - no SIM */ + TAPI_SIM_SAP_STATUS_NOT_READY, /**< SAP server connection status - not ready */ + TAPI_SIM_SAP_STATUS_READY, /**< SAP server connection status - ready */ + TAPI_SIM_SAP_STATUS_CONNECTED /**< SAP server connection status - connected */ +} TelSimSapStatusInfo_t; + +/** + * @brief Enumeration for the SIM card status if the server's status about connection with subscription module has changed. + * @since_tizen 2.3 + */ +typedef enum { + TAPI_SIM_SAP_CARD_STATUS_UNKNOWN = 0x00, /**< SAP server status(card reader status) - unknown */ + TAPI_SIM_SAP_CARD_STATUS_RESET, /**< SAP server status(card reader status) - reset */ + TAPI_SIM_SAP_CARD_STATUS_NOT_ACCESSIBLE, /**< SAP server status(card reader status) - not accessible */ + TAPI_SIM_SAP_CARD_STATUS_REMOVED, /**< SAP server status(card reader status) - removed */ + TAPI_SIM_SAP_CARD_STATUS_INSERTED, /**< SAP server status(card reader status) - inserted */ + TAPI_SIM_SAP_CARD_STATUS_RECOVERED /**< SAP server status(card reader status) - recovered */ +} TelSimSapCardStatus_t; + +/** + * @brief Enumeration for the SAP result information. + * @since_tizen 2.3 + */ +typedef enum { + TAPI_SIM_SAP_RESULT_CODE_OK = 0x00, /**< SAP operation result - ok */ + TAPI_SIM_SAP_RESULT_CODE_NO_REASON, /**< SAP operation result - no reason */ + TAPI_SIM_SAP_RESULT_CODE_CARD_NOT_ACCESSIBLE, /**< SAP operation result - not accessible */ + TAPI_SIM_SAP_RESULT_CODE_CARD_ALREADY_POWER_OFF, /**< SAP operation result - card already powered off */ + TAPI_SIM_SAP_RESULT_CODE_CARD_REMOVED, /**< SAP operation result - card removed */ + TAPI_SIM_SAP_RESULT_CODE_CARD_ALREADY_POWER_ON, /**< SAP operation result - card already powered on */ + TAPI_SIM_SAP_RESULT_CODE_DATA_NOT_AVAILABLE, /**< SAP operation result - data not available */ + TAPI_SIM_SAP_RESULT_CODE_NOT_SUPPORT /**< SAP operation result - not supported */ +} TelSimSapResultCode_t; + +/** + * @brief Enumeration for the SAP transport protocol type. + * @since_tizen 2.3 + */ +typedef enum { + TAPI_SIM_SAP_PROTOCOL_T0, /**< T = 0, character */ + TAPI_SIM_SAP_PROTOCOL_T1 /**< T = 1, block */ +} TelSimSapProtocol_t; + +/** + * @brief Enumeration for the phonebook access result. + * @since_tizen 2.3 + */ +typedef enum { + TAPI_SIM_PB_SUCCESS, /**< SIM phonebook operation successful */ + TAPI_SIM_PB_FAIL, /**< SIM phonebook operation failure */ + TAPI_SIM_PB_INVALID_INDEX, /**< The index passed is not a valid index */ + TAPI_SIM_PB_INVALID_NUMBER_LENGTH, /**< The number length exceeds the max length allowed (or 0) */ + TAPI_SIM_PB_INVALID_NAME_LENGTH, /**< The name length exceeds the max length allowed (or 0) */ + TAPI_SIM_PB_ACCESS_CONDITION_NOT_SATISFIED, /**< Access condition for PB file is not satisfied */ +} TelSimPbAccessResult_t; + +/** + * @brief Enumeration for the storage types to be selected in the SIM or USIM. + * @since_tizen 2.3 + */ +typedef enum { + TAPI_SIM_PB_FDN, /**< Fixed Dialing Number */ + TAPI_SIM_PB_ADN, /**< SIM - ADN */ + TAPI_SIM_PB_SDN, /**< Service Dialing Number */ + TAPI_SIM_PB_3GSIM, /**< USIM - 3G phone book */ + TAPI_SIM_PB_AAS, /**< Additional number Alpha String */ + TAPI_SIM_PB_GAS, /**< Grouping identifier Alpha String */ + TAPI_SIM_PB_UNKNOWNN = 0xFF, /**< Unknown file type */ +} TelSimPbType_t; + +/** + * @brief Enumeration for the storage field types in the 3G Phone book. + * @since_tizen 2.3 + */ +typedef enum { + /* for 3G phone storage field type */ + TAPI_PB_3G_NAME = 0x01, /**< Name */ + TAPI_PB_3G_NUMBER, /**< Number */ + TAPI_PB_3G_ANR1, /**< First Another number */ + TAPI_PB_3G_ANR2, /**< Second Another number */ + TAPI_PB_3G_ANR3, /**< Third Another number */ + TAPI_PB_3G_EMAIL1, /**< First Email */ + TAPI_PB_3G_EMAIL2, /**< Second Email */ + TAPI_PB_3G_EMAIL3, /**< Third Email */ + TAPI_PB_3G_EMAIL4, /**< Fourth Email */ + TAPI_PB_3G_SNE, /**< Second name entry of the main name */ + TAPI_PB_3G_GRP, /**< Group */ + TAPI_PB_3G_PBC, /**< 1 byte control info and 1 byte hidden info */ +} TelSimPb3GFileType_t; + +/** + * @brief Enumeration for the list of SST services in the SIM Service Table (GSM). + * @since_tizen 2.3 + */ +typedef enum { + // service 1 ~ 8 + TAPI_SIM_SST_CHV1_DISABLE_FUNC = 0, /**< CHV1 disable function */ + TAPI_SIM_SST_ADN, /**< Abbreviated Dialing number */ + TAPI_SIM_SST_FDN, /**< Fixed Dialing number */ + TAPI_SIM_SST_SMS, /**< Short message storage */ + TAPI_SIM_SST_AOC, /**< Advice of charge */ + TAPI_SIM_SST_CCP, /**< Capability configuration parameters */ + TAPI_SIM_SST_PLMN_SELECTOR, /**< PLMN selector */ + TAPI_SIM_SST_RFU1, /**< RFU */ + + // service 9 ~ 16 + TAPI_SIM_SST_MSISDN = 8, /**< MSISDN */ + TAPI_SIM_SST_EXT1, /**< Extension 1 */ + TAPI_SIM_SST_EXT2, /**< Extension 2 */ + TAPI_SIM_SST_SMS_PARAMS, /**< SMS parameters */ + TAPI_SIM_SST_LND, /**< Last number dialed */ + TAPI_SIM_SST_CELL_BROADCAST_MSG_ID, /**< Cell broadcast message identifier */ + TAPI_SIM_SST_GID_LV1, /**< Group identifier level 1 */ + TAPI_SIM_SST_GID_LV2, /**< Group identifier level 2 */ + + // service 17 ~ 24 + TAPI_SIM_SST_SPN = 16, /**< Service provider name */ + TAPI_SIM_SST_SDN, /**< Service Dialing number */ + TAPI_SIM_SST_EXT3, /**< Extension3 */ + TAPI_SIM_SST_RFU2, /**< RFU */ + TAPI_SIM_SST_VGCS_GID_LIST, /**< VGCS group identifier (EF-VGCS, EF-VGCSS) */ + TAPI_SIM_SST_VBS_GID_LIST, /**< VBS group identifier (EF-VBS, EF-VBSS) */ + TAPI_SIM_SST_ENHANCED_MULTI_LV_PRECEDENCE_PREEMPTION_SRVC, /**< Enhanced multi-level precedence and pre-emption service */ + TAPI_SIM_SST_AUTO_ANSWER_FOR_EMLPP, /**< Automatic answer for EMLPP */ + + // service 25 ~ 32, + TAPI_SIM_SST_DATA_DOWNLOAD_VIA_SMS_CB = 24, /**< Data download via SMS-CB */ + TAPI_SIM_SST_DATA_DOWNLOAD_VIA_SMS_PP, /**< Data download via SMS-PP */ + TAPI_SIM_SST_MENU_SELECTION, /**< Menu selection */ + TAPI_SIM_SST_CALL_CTRL, /**< Call control */ + TAPI_SIM_SST_PROACTIVE_SIM, /**< Proactive SIM command */ + TAPI_SIM_SST_CELL_BROADCAST_MSG_ID_RANGES, /**< Cell broadcast message identifier ranges */ + TAPI_SIM_SST_BDN, /**< Barred Dialing numbers */ + TAPI_SIM_SST_EXT4, /**< Extension 4 */ + + // service 33 ~ 40 + TAPI_SIM_SST_DEPERSONALIZATION_CTRL_KEYS = 32, /**< De-personalization control keys */ + TAPI_SIM_SST_COOPERATIVE_NETWORK_LIST, /**< Co-operative network list */ + TAPI_SIM_SST_SMS_STATUS_REPORTS, /**< Short message status reports */ + TAPI_SIM_SST_NIA, /**< Network's indication of alerting in the MS (NIA) */ + TAPI_SIM_SST_MO_SMS_CTRL_BY_SIM, /**< Mobile-originated short message control by SIM */ + TAPI_SIM_SST_GPRS, /**< GPRS */ + TAPI_SIM_SST_IMG, /**< Image */ + TAPI_SIM_SST_SOLSA, /**< Support of local service area */ + + // service 41 ~ 48 + TAPI_SIM_SST_USSD_STR_DATA_OBJECT_SUPPORTED_IN_CALL_CTRL = 40, /**< USSD string data object supported in call control */ + TAPI_SIM_SST_RUN_AT_CMD_CMD, /**< RUN AT COMMAND command */ + TAPI_SIM_SST_USER_CTRLED_PLMN_SELECTOR_WACT, /**< User controlled PLMN selector with Access technology */ + TAPI_SIM_SST_OPERATOR_CTRLED_PLMN_SELECTOR_WACT, /**< Operator controlled PLMN selector with Access technology */ + TAPI_SIM_SST_HPLMN_SELECTOR_WACT, /**< HPLMN selector with access technology */ + TAPI_SIM_SST_CPBCCH_INFO, /**< CPBCCH information */ + TAPI_SIM_SST_INVESTIGATION_SCAN, /**< Investigation scan */ + TAPI_SIM_SST_EXTENDED_CAPA_CONF_PARAMS, /**< Extended capability configuration parameters */ + + // service 49 ~ 56 + TAPI_SIM_SST_MEXE = 48, /**< MExE */ + TAPI_SIM_SST_RPLMN_LAST_USED_ACCESS_TECH, /**< RPLMN last used access technology */ + TAPI_SIM_SST_PLMN_NETWORK_NAME, /**< PLMN Network Name */ + TAPI_SIM_SST_OPERATOR_PLMN_LIST, /**< Operator PLMN List */ + TAPI_SIM_SST_MBDN, /**< Mailbox Dialling Numbers */ + TAPI_SIM_SST_MWIS, /**< Message Waiting Indication Status */ + TAPI_SIM_SST_CFIS, /**< Call Forwarding Indication Status */ + TAPI_SIM_SST_SPDI, /**< Service Provider Display Information */ +} TelSimSSTService_t; + +/** + * @brief Enumeration for the list of UST services in the SIM Service Table (USIM). + * @since_tizen 2.3 + */ +typedef enum { + // service 1 ~ 8 + TAPI_SIM_UST_LOCAL_PB = 0, /**< Local phone book */ + TAPI_SIM_UST_FDN, /**< Fixed Dialing number */ + TAPI_SIM_UST_EXT2, /**< Extension 2 */ + TAPI_SIM_UST_SDN, /**< Service Dialing number */ + TAPI_SIM_UST_EXT3, /**< Extension 3 */ + TAPI_SIM_UST_BDN, /**< Barred Dialing numbers */ + TAPI_SIM_UST_EXT4, /**< Extension 4 */ + TAPI_SIM_UST_OUTGOING_CALL_INFO, /**< Outgoing call information */ + + // service 9 ~ 16 + TAPI_SIM_UST_INCOMING_CALL_INFO = 8, /**< Incoming call information */ + TAPI_SIM_UST_SMS, /**< Short message storage */ + TAPI_SIM_UST_SMS_STATUS_REPORTS, /**< Short message status reports */ + TAPI_SIM_UST_SMS_PARAMS, /**< SMS parameters */ + TAPI_SIM_UST_AOC, /**< Advice of charge */ + TAPI_SIM_UST_CCP, /**< Capability configuration parameters */ + TAPI_SIM_UST_CELL_BROADCAST_MSG_ID, /**< Cell broadcast message identifier */ + TAPI_SIM_UST_CELL_BROADCAST_MSG_ID_RANGES, /**< Cell broadcast message identifier ranges */ + + // service 17 ~ 24 + TAPI_SIM_UST_GID_LV1 = 16, /**< Group identifier level 1 */ + TAPI_SIM_UST_GID_LV2, /**< Group identifier level 2 */ + TAPI_SIM_UST_SPN, /**< Service provider name */ + TAPI_SIM_UST_USER_CTRLED_PLMN_SELECTOR_WACT, /**< User controlled PLMN selector with Access technology */ + TAPI_SIM_UST_MSISDN, /**< MSISDN */ + TAPI_SIM_UST_IMG, /**< Image */ + TAPI_SIM_UST_SOLSA, /**< Support of local service area */ + TAPI_SIM_UST_ENHANCED_MULTI_LV_PRECEDENCE_PREEMPTION_SRVC, /**< Enhanced multi-level precedence and pre-emption service */ + + // service 25 ~ 32 + TAPI_SIM_UST_AUTO_ANSWER_FOR_EMLPP = 24, /**< Automatic answer for EMLPP */ + TAPI_SIM_UST_RFU1, /**< RFU */ + TAPI_SIM_UST_GSM_ACCESS, /**< GSM access */ + TAPI_SIM_UST_DATA_DOWNLOAD_VIA_SMS_PP, /**< Data download via SMS-PP */ + TAPI_SIM_UST_DATA_DOWNLOAD_VIA_SMS_CB, /**< Data download via SMS-CB */ + TAPI_SIM_UST_CALL_CTRL, /**< Call control by USIM */ + TAPI_SIM_UST_MO_SMS_CTRL, /**< Mobile-originated short message control by USIM */ + TAPI_SIM_UST_RUN_AT_CMD_CMD, /**< RUN AT COMMAND command */ + + // service 33 ~ 40 + TAPI_SIM_UST_SHALL_BE_SET_TO_ONE = 32, /**< Shall be set to 1 */ + TAPI_SIM_UST_ENABLED_SRVC_TABLE, /**< Enabled service table */ + TAPI_SIM_UST_ACL, /**< APN control list */ + TAPI_SIM_UST_DEPERSONALIZATION_CTRL_KEYS, /**< De-personalization control keys */ + TAPI_SIM_UST_COOPERATIVE_NETWORK_LIST, /**< Co-operative network list */ + TAPI_SIM_UST_GSM_SEC_CONTEXT, /**< GSM security context */ + TAPI_SIM_UST_CPBCCH_INFO, /**< CPBCCH information */ + TAPI_SIM_UST_INVESTIGATION_SCAN, /**< Investigation scan */ + + // service 41 ~ 48 + TAPI_SIM_UST_MEXE = 40, /**< MExE */ + TAPI_SIM_UST_OPERATOR_CTRLED_PLMN_SELECTOR_WACT, /**< Operator controlled PLMN selector with Access technology */ + TAPI_SIM_UST_HPLMN_SELECTOR_WACT, /**< HPLMN selector with access technology */ + TAPI_SIM_UST_EXT5, /**< Extension 5 */ + TAPI_SIM_UST_PLMN_NETWORK_NAME, /**< PLMN Network Name */ + TAPI_SIM_UST_OPERATOR_PLMN_LIST, /**< Operator PLMN List */ + TAPI_SIM_UST_MBDN, /**< Mailbox Dialling Numbers */ + TAPI_SIM_UST_MWIS, /**< Message Waiting Indication Status */ + + // service 49 ~ 56 + TAPI_SIM_UST_CFIS = 48, /**< Call Forwarding Indication Status */ + TAPI_SIM_UST_RPLMN_LAST_USED_ACCESS_TECH, /**< RPLMN last used access technology */ + TAPI_SIM_UST_SPDI, /**< Service Provider Display Information */ + TAPI_SIM_UST_MMS, /**< Multi media messaging service */ + TAPI_SIM_UST_EXT8, /**< Extension 8 */ + TAPI_SIM_UST_CALL_CTRL_ON_GPRS, /**< Call control on GPRS by USIM */ + TAPI_SIM_UST_MMS_USER_CONNECTIVITY_PARAMS, /**< MMS user connectivity parameters */ + TAPI_SIM_UST_NIA, /**< Network's indication of alerting in the MS (NIA) */ + + // service 57 ~ 64 + TAPI_SIM_UST_VGCS_GID_LIST = 56, /**< VGCS group identifier List (EF-VGCS, EF-VGCSS) */ + TAPI_SIM_UST_VBS_GID_LIST, /**< VBS group identifier List (EF-VBS, EF-VBSS) */ + TAPI_SIM_UST_PSEUDONYM, + TAPI_SIM_UST_USER_CTRLED_PLMN_SELECTOR_IWLAN, /**< User controlled PLMN selector for I-WLAN access */ + TAPI_SIM_UST_OPERATOR_CTRLED_PLMN_SELECTOR_IWLAN, /**< Operator controlled PLMN selector for I-WLAN access */ + TAPI_SIM_UST_USER_CTRLED_WSID_LIST, + TAPI_SIM_UST_OPERATOR_CTRLED_WSID_LIST, + TAPI_SIM_UST_VGCS_SEC, +} TelSimUSTService_t; + +/** + * @brief Enumeration for the list of CST services in the CDMA Service Table. + * @since_tizen 2.3 + */ +typedef enum { + // service 1 ~ 8 + TAPI_SIM_CDMA_ST_CHV_DISABLE = 0, /**< CHV Disable Option */ + TAPI_SIM_CDMA_ST_ADN, /**< Abbreviated Dialing number */ + TAPI_SIM_CDMA_ST_FDN, /**< Fixed Dialing number */ + TAPI_SIM_CDMA_ST_SMS, /**< Short message storage */ + TAPI_SIM_CDMA_ST_HRPD, /**< HRPD */ + TAPI_SIM_CDMA_ST_EPB, /**< Enhanced Phone Book */ + TAPI_SIM_CDMA_ST_MMD, /**< Multimedia domain */ + TAPI_SIM_CDMA_ST_EUIMID, /**< SF_EUIMID- based EUIMID */ + + // service 9 ~ 16 + TAPI_SIM_CDMA_ST_MEID = 8, /**< MEID */ + TAPI_SIM_CDMA_ST_EXT1, /**< Extension 1 */ + TAPI_SIM_CDMA_ST_EXT2, /**< Extension 2 */ + TAPI_SIM_CDMA_ST_SMSP, /**< SMS parameters */ + TAPI_SIM_CDMA_ST_LND, /**< Last number dialled */ + TAPI_SIM_CDMA_ST_SCP, /**< Service Category Program for BC-SMS */ + TAPI_SIM_CDMA_ST_RFU1, /**< RFU */ + TAPI_SIM_CDMA_ST_RFU2, /**< RFU */ + + // service 17 ~ 24 + TAPI_SIM_CDMA_ST_HSPN = 16, /**< CDMA Home Service Provider Name */ + TAPI_SIM_CDMA_ST_SDN, /**< Service Dialing number */ + TAPI_SIM_CDMA_ST_EXT3, /**< Extension 3 */ + TAPI_SIM_CDMA_ST_3GPDSIP, /**< 3GPD-SIP */ + TAPI_SIM_CDMA_ST_RFU3, /**< RFU */ + TAPI_SIM_CDMA_ST_RFU4, /**< RFU */ + TAPI_SIM_CDMA_ST_RFU5, /**< RFU */ + TAPI_SIM_CDMA_ST_RFU6, /**< RFU */ + + // service 25 ~ 32 + TAPI_SIM_CDMA_ST_DDSMSB = 24, /**< Data download by SMS broadcast */ + TAPI_SIM_CDMA_ST_DDSMSPP, /**< Data download by SMS PP */ + TAPI_SIM_CDMA_ST_MENU, /**< Menu Selection */ + TAPI_SIM_CDMA_ST_CALLC, /**< Call Control */ + TAPI_SIM_CDMA_ST_PROACTIVE, /**< Proactive RUIM */ + TAPI_SIM_CDMA_ST_AKA, /**< AKA */ + TAPI_SIM_CDMA_ST_RFU7, /**< RFU */ + TAPI_SIM_CDMA_ST_RFU8, /**< RFU */ + + // service 33 ~ 40 + TAPI_SIM_CDMA_ST_RFU9 = 32, /**< RFU */ + TAPI_SIM_CDMA_ST_RFU10, /**< RFU */ + TAPI_SIM_CDMA_ST_RFU11, /**< RFU */ + TAPI_SIM_CDMA_ST_RFU12, /**< RFU */ + TAPI_SIM_CDMA_ST_RFU13, /**< RFU */ + TAPI_SIM_CDMA_ST_3GPDMIP, /**< 3GPD- MIP */ + TAPI_SIM_CDMA_ST_BCMCS, /**< BCMCS */ + TAPI_SIM_CDMA_ST_MMS, /**< Multimedia messaging service */ + + // service 41 ~ 48 + TAPI_SIM_CDMA_ST_EXT8 = 40, /**< Extension 8 */ + TAPI_SIM_CDMA_ST_MMSUCP, /**< MMS User Connectivity Parameters */ + TAPI_SIM_CDMA_ST_AA, /**< Application Authentication */ + TAPI_SIM_CDMA_ST_GIL1, /**< Group Identifier Level 1 */ + TAPI_SIM_CDMA_ST_GIL2, /**< Group Identifier Level 2 */ + TAPI_SIM_CDMA_ST_DEPERSO, /**< Depersonalisation control keys */ + TAPI_SIM_CDMA_ST_CNL /**< Co-operative Network List */ +} TelSimCdmaService_t; + +/** + * @brief Enumeration for the list of CST services in the CSIM Service Table. (CSIM) + * @since_tizen 2.3 + */ +typedef enum { + // service 1 ~ 8 + TAPI_SIM_CSIM_ST_LOCAL_PHONEBOOK = 0, /**< Local Phone book */ + TAPI_SIM_CSIM_ST_FDN, /**< Fixed Dialing Numbers (FDN) */ + TAPI_SIM_CSIM_ST_EXT2, /**< Extension 2 */ + TAPI_SIM_CSIM_ST_SDN, /**< Service Dialing Numbers (SDN) */ + TAPI_SIM_CSIM_ST_EXT3, /**< Extension 3 */ + TAPI_SIM_CSIM_ST_SMS, /**< Short Message Storage (SMS) */ + TAPI_SIM_CSIM_ST_SMSP, /**< Short Message Parameters */ + TAPI_SIM_CSIM_ST_HRPD, /**< HRPD */ + + // service 9 ~ 16 + TAPI_SIM_CSIM_ST_SCP = 8, /**< Service Category Program for BC-SMS */ + TAPI_SIM_CSIM_ST_HSPN, /**< CDMA Home Service Provider Name */ + TAPI_SIM_CSIM_ST_DDSMSB, /**< Data Download via SMS Broadcast */ + TAPI_SIM_CSIM_ST_DDSMSPP, /**< Data Download via SMS-PP */ + TAPI_SIM_CSIM_ST_CALLC, /**< Call Control */ + TAPI_SIM_CSIM_ST_3GPDSIP, /**< 3GPD-SIP */ + TAPI_SIM_CSIM_ST_3GPDMIP, /**< 3GPD-MIP */ + TAPI_SIM_CSIM_ST_AKA, /**< AKA */ + + // service 17 ~ 24 + TAPI_SIM_CSIM_ST_IP_LCS = 16, /**< IP-based Location Services (LCS) */ + TAPI_SIM_CSIM_ST_BCMCS, /**< BCMCS */ + TAPI_SIM_CSIM_ST_MMS, /**< Multimedia Messaging Service (MMS) */ + TAPI_SIM_CSIM_ST_EXT8, /**< Extension 8 */ + TAPI_SIM_CSIM_ST_MMSUCP, /**< MMS User Connectivity Parameters */ + TAPI_SIM_CSIM_ST_AA, /**< Application Authentication */ + TAPI_SIM_CSIM_ST_GIL1, /**< Group Identifier Level 1 */ + TAPI_SIM_CSIM_ST_GIL2, /**< Group Identifier Level 2 */ + + // service 25 ~ 32 + TAPI_SIM_CSIM_ST_DEPERSO = 24, /**< De-Personalization Control Keys */ + TAPI_SIM_CSIM_ST_CNL, /**< Cooperative Network List */ + TAPI_SIM_CSIM_ST_OCI, /**< Outgoing Call Information (OCI) */ + TAPI_SIM_CSIM_ST_ICI, /**< Incoming Call Information (ICI) */ + TAPI_SIM_CSIM_ST_EXT5, /**< Extension 5 */ + TAPI_SIM_CSIM_ST_MM_STORAGE, /**< Multimedia Storage */ + TAPI_SIM_CSIM_ST_IMG, /**< Image (EFIMG) */ + TAPI_SIM_CSIM_ST_EST, /**< Enabled Services Table */ + + // service 33 ~ 41 + TAPI_SIM_CSIM_ST_CCP = 32, /**< Capability Configuration Parameters (CCP) */ + TAPI_SIM_CSIM_ST_EUIMIDl, /**< SF_EUIMID-based EUIMID */ + TAPI_SIM_CSIM_ST_3GPD_EXT, /**< Messaging and 3GPD Extensions */ + TAPI_SIM_CSIM_ST_ROOT_CERTI, /**< Root Certificates */ + TAPI_SIM_CSIM_ST_WAP, /**< WAP Browser */ + TAPI_SIM_CSIM_ST_JAVA, /**< Java */ + TAPI_SIM_CSIM_ST_RSVD_CDG1, /**< Reserved for CDG */ + TAPI_SIM_CSIM_ST_RSVD_CDG2, /**< Reserved for CDG */ + TAPI_SIM_CSIM_ST_IPV6 = 40, /**< IPv6 */ +} TelSimCsimService_t; + +typedef enum { + TAPI_SIM_CDMA_SVC_TABLE = 0, + TAPI_SIM_CSIM_SVC_TABLE, + TAPI_SIM_MAX_SVC_TABLE +} TelSimCdmaSvcTable_t; + +typedef struct { + char service[TAPI_SIM_SST_SERVICE_CNT_MAX]; /**< TBD */ // should access with 'enum TelSimSSTService_t' as index +} TelSimSST_t; + +typedef struct { + char service[TAPI_SIM_UST_SERVICE_CNT_MAX]; /**< TBD */ // should access with 'enum TelSimUSTService_t' as index +} TelSimUST_t; + +typedef struct { + TelSimCdmaSvcTable_t cdma_svc_table; /* Member of service union is accessed based on the corresponding value of TelSimCdmaSvcTable_t */ + union { + char cdma_service[TAPI_SIM_CDMA_ST_SERVICE_CNT_MAX]; // should access with 'enum TelSimCdmaService_t' as index + char csim_service[TAPI_SIM_CSIM_ST_SERVICE_CNT_MAX]; // should access with 'enum TelSimCsimService_t' as index + } service; +} TelSimCST_t; + +typedef struct { + TelSimCardType_t sim_type; /**< TBD */ + union { + TelSimSST_t sst; /**< TBD */ + TelSimUST_t ust; /**< TBD */ + TelSimCST_t cst; + } table; /**< TBD */ +} TelSimServiceTable_t; + +/** + * @brief The structure type defining data for IMSI information. + * @since_tizen 2.3 + */ +typedef struct { + char szMcc[3 + 1]; /**< Mobile country code */ + char szMnc[3 + 1]; /**< Mobile network code */ + char szMsin[10 + 1]; /**< Mobile station identification number */ +} TelSimImsiInfo_t; + +/** + * @brief The structure type defining data for ECC information of the GSM/USIM/CDMA SIM. + * @since_tizen 2.3 + */ +typedef struct { + char name[30+1]; /**< Applicable only for USIM(3G) SIM */ + char number[6+1]; + TelSimEccEmergencyServiceInfo_t category;/**< Applicable only for USIM(3G) SIM */ +}TelSimEcc_t; + +typedef struct { + int ecc_count; /**< TBD */ + TelSimEcc_t list[15]; /**< TBD */ +}TelSimEccList_t; + +typedef struct { + int icc_length; /**< Integrated Circuit Card number length */ + char icc_num[TAPI_SIM_ICCID_LEN_MAX]; /**< Integrated Circuit Card number */ +} TelSimIccIdInfo_t; + +typedef struct { + int b_cphs; /**< TBD */ + int rec_index; /**< Index which stands for the location where the record is saved in SIM */ + int profile_num; /**< SIM profile index */ + TelSimMailboxType_t mb_type; /**< TBD */ + int alpha_id_max_len; /**< Alpha max length in SIM - READ ONLY */ + char alpha_id[TAPI_SIM_XDN_ALPHA_ID_MAX_LEN + 1]; /**< Alpha Identifier */ + TelSimTypeOfNum_t ton; /**< Type Of Number */ + TelSimNumberingPlanIdentity_t npi; /**< Number Plan Identity */ + char num[TAPI_SIM_XDN_DIALING_NUMBER_LEN + 1]; /**< Dialing Number/SSC String */ + unsigned char cc_id; /**< Capability/Configuration Identifier */ + unsigned char ext1_id; /**< Extension 1 Record Identifier */ +}TelSimMailBoxNumber_t; + +typedef struct { + int count; /**< TBD */ + TelSimMailBoxNumber_t list[TAPI_SIM_MSP_CNT_MAX*5]; /**< TBD */ //max is 10 +}TelSimMailboxList_t; + +typedef struct { + int rec_index; /**< TBD */ + unsigned char msp_num; /**< MSP number*/ + unsigned char cfu_status; /**< Call forwarding unconditional indication status */ + TelSimTypeOfNum_t ton; /**< TON */ + TelSimNumberingPlanIdentity_t npi; /**< NPI */ + char cfu_num[TAPI_SIM_XDN_DIALING_NUMBER_LEN + 1];/**< Dialing Number/SSC String */ + unsigned char cc2_id; /**< Capability/Configuration 2 Record Identifier */ + unsigned char ext7_id; /**< Extension 7 Record Identifier */ +}TelSimCfis_t; + +typedef struct { + int profile_count; /**< TBD */ + TelSimCfis_t cf[TAPI_SIM_MSP_CNT_MAX]; /**< TBD */ +}TelSimCfisList_t; + +typedef struct { + int b_line1; /**< CallForwardUnconditionalLine 1 */ + int b_line2; /**< CallForwardUnconditionalLine 2 */ + int b_fax; /**< CallForwardUnconditional FAX */ + int b_data; /**< CallForwardUnconditional data */ +}TelSimCphsCf_t; + +typedef struct { + int b_cphs; /**< TBD */ + TelSimCfisList_t cf_list; /**< TBD */ + TelSimCphsCf_t cphs_cf; /**< TBD */ +}TelSimCallForwardingResp_t; + +typedef struct { + int b_cphs; /**< TBD */ + union { + TelSimCfis_t cf; /**< TBD */ + TelSimCphsCf_t cphs_cf; /**< TBD */ + } cf_data_u; /**< TBD */ +}TelSimCallForwardingReq_t; + +typedef struct { + int rec_index; /**< TBD */ + unsigned char indicator_status; /**< Indicator Type */ + int voice_count; /**< VoiceMail Count */ + int fax_count; /**< FAX Count */ + int email_count; /**< Email Count */ + int other_count; /**< Other Count */ + int video_count; /**< VideoMail Count */ +}TelSimMwis_t; + +typedef struct { + int profile_count; /**< TBD */ + TelSimMwis_t mw[TAPI_SIM_MSP_CNT_MAX]; /**< TBD */ +}TelSimMwisList_t; + +typedef struct { + int b_voice1; /**< VoiceMsgLine1 message waiting flag */ + int b_voice2; /**< VoiceMsgLine2 message waiting flag */ + int b_fax; /**< FAX message waiting flag */ + int b_data; /**< Data message waiting flag */ +}TelSimCphsMw_t; + +typedef struct { + int b_cphs; /**< TBD */ + TelSimMwisList_t mw_list; /**< TBD */ + TelSimCphsMw_t cphs_mw; /**< TBD */ +}TelSimMessageWaitingResp_t; + +typedef struct { + int b_cphs; /**< TBD */ + union { + TelSimMwis_t mw; /**< TBD */ + TelSimCphsMw_t cphs_mw; /**< TBD */ + } mw_data_u; /**< TBD */ +}TelSimMessageWaitingReq_t; + +/** + * @brief The structure type for MSISDN information of the GSM/CDMA SIM. + * @since_tizen 2.3 + */ +typedef struct { + char num[TAPI_SIM_MSISDN_DIALING_NUMBER_LEN + 1]; /**< MSISDN number. If it does not exist, a null string will be returned */ + char name[TAPI_SIM_XDN_ALPHA_ID_MAX_LEN + 1]; /**< MSISDN name. If it does not exist, a null string will be returned. Not applicable for CDMA */ +} TelSimSubscriberInfo_t; + +typedef struct { + int count; /**< TBD */ + TelSimSubscriberInfo_t list[3]; /**< TBD */ //max is 3 +}TelSimMsisdnList_t; + +typedef struct { + char plmn[6+1]; /**< TBD */ + int b_umts; /**< TBD */ + int b_gsm; /**< TBD */ +}TelSimOplmnwact_t; + +typedef struct { + int count; /**< TBD */ + TelSimOplmnwact_t list[TAPI_SIM_OPLMNWACT_LEN_MAX]; /**< TBD */ //max is 100 +}TelSimOplmnwactList_t; + +typedef struct { + unsigned char display_condition; /**< Display condition (1 byte) */ + unsigned char spn[TAPI_SIM_NET_FULL_NAME_MAX_LEN + 1]; /**< SPN */ +}TelSimSpn_t; + +typedef struct { + unsigned char full_name[TAPI_SIM_NET_FULL_NAME_MAX_LEN + 1]; /**< TBD */ + unsigned char short_name[TAPI_SIM_NET_SHORT_NAME_MAX_LEN + 1]; /**< TBD */ +}TelSimCphsNetName_t; + +typedef struct { + int GroupIdentifierLen; /**< Group identifier length */ + unsigned char szGroupIdentifier[TAPI_SIM_GROUP_IDENTIFIER_LEN_MAX]; /**< Group identifier */ +}TelSimGid_t; + +/** + * @details The structure type for authentication request data. + * @since_tizen 2.3 + */ +typedef struct { + TelSimAuthenticationType_t auth_type; /**< Authentication type */ + int rand_length; /**< The length of RAND */ + int autn_length; /**< The length of AUTN. It is not used in case of GSM AUTH */ + char rand_data[TAPI_SIM_AUTH_MAX_REQ_DATA_LEN]; /**< RAND data */ + char autn_data[TAPI_SIM_AUTH_MAX_REQ_DATA_LEN]; /**< AUTN data. It is not used in case of GSM AUTH */ +} TelSimAuthenticationData_t; + +/** + * @details The structure type for authentication result data. + * @since_tizen 2.3 + */ +typedef struct { + TelSimAuthenticationType_t auth_type; /**< Authentication type */ + TelSimAuthenticationResult_t auth_result; /**< Authentication result */ + int resp_length; /**< Response length. IMS and 3G case, it stands for RES_AUTS. GSM case, it stands for SRES */ + char resp_data[TAPI_SIM_AUTH_MAX_RESP_DATA_LEN]; /**< Response data. IMS and 3G case, it stands for RES_AUTS. GSM case, it stands for SRES */ + int authentication_key_length; /**< The length of the authentication key, Kc */ + char authentication_key[TAPI_SIM_AUTH_MAX_RESP_DATA_LEN]; /**< The data of the authentication key, Kc */ + int cipher_length; /**< The length of the cipher key */ + char cipher_data[TAPI_SIM_AUTH_MAX_RESP_DATA_LEN]; /**< Cipher key */ + int integrity_length; /**< The length of the integrity key */ + char integrity_data[TAPI_SIM_AUTH_MAX_RESP_DATA_LEN]; /**< Integrity key */ +} TelSimAuthenticationResponse_t; + + +/** + * @brief The structure type for information about PIN data. + * @details The SIM PIN data. For PIN handling (Change, UnBlock) & for Type of PIN information. + */ +typedef struct { + TelSimPinType_t type; /**< PIN type */ + unsigned char* pw; /**< PIN code */ + unsigned int pw_len; /**< PIN code length */ +} TelSimSecPw_t; + +/** + * @brief The structure type for PIN information. + * @since_tizen 2.3 + */ +typedef struct { + TelSimPinType_t type; /**< Specifies the PIN or PUK type */ + int retry_count; /**< Number of attempts remaining for PIN/PUK verification */ +} TelSimSecResult_t; + +/** + * @details The structure type used to enable/disable facility. + * @since_tizen 2.3 + */ +typedef struct { + TelSimLockType_t lock_type; /**< Facility type */ + unsigned char *pw; /**< Password */ + int pw_len; /**< Password length */ +} TelSimFacilityPw_t; + +typedef struct { + TelSimLockType_t type; /**< Specifies the PIN or PUK type */ + int retry_count; /**< Number of attempts remaining for PIN/PUK verification */ +} TelSimFacilityResult_t; + +typedef struct { + TelSimLockType_t type; /**< TBD */ + TelSimFacilityStatus_t f_status; /**< TBD */ +}TelSimFacilityInfo_t; + +/** + * @details The structure type for information about LOCK_TYPE. + * @since_tizen 2.3 + */ +typedef struct { + TelSimLockType_t lock_type; /**< Lock type */ + TelSimLockStatus_t lock_status; /**< Lock key */ + int retry_count; /**< Retry counts */ +} TelSimLockInfo_t; + +/** + * @brief The structure type for APDU. + * @since_tizen 2.3 + */ +typedef struct { + unsigned short apdu_len; /**< TBD */ + unsigned char* apdu; /**< TBD */ +} TelSimApdu_t; + +/** + * @brief The structure type for the response of sending APDU. + * @since_tizen 2.3 + */ +typedef struct { + unsigned short apdu_resp_len; /**< TBD */ + unsigned char apdu_resp[TAPI_SIM_APDU_MAX_LEN]; /**< TBD */ +} TelSimApduResp_t; + +/** + * @brief The structure type for the response of sending APDU. + * @since_tizen 2.3 + */ +typedef struct { + unsigned short atr_resp_len; /**< TBD */ + unsigned char atr_resp[TAPI_SIM_APDU_MAX_LEN]; /**< TBD */ +} TelSimAtrResp_t; + +/** + * @brief The structure type for available optional CPHS SIM files. + * @since_tizen 2.3 + */ +typedef struct { + /* Byte 2 - bit1 & 2*/ + int bCustomerServiceProfile; /**< Customer Service Profile (CSP) */ + /* Byte 2 - bit3 & 4*/ + int bServiceStringTable; /**< Service String Table (SST) */ + /* Byte 2 - bit5 & 6*/ + int bMailBoxNumbers; /**< MailBoxNumbers */ + /* Byte 2 - bit7 & 8*/ + int bOperatorNameShortForm; /**< Short form of operator name */ + /* Byte 3 - bit1 & 2*/ + int bInformationNumbers; /**< Information numbers */ +} TelSimCphsServiceTable_t; + +/* + These requirements are additional to the GSM 900 and DCS1800 recommendations. + They apply to all products which are to be compliant with the CPHS specification. + + In addition to those SIM storage fields previously defined in DCS1800 to support + existing MS features and services, the Association has defined the following fields :- + + 1) Call Forwarding flag (mandatory) + 2) Voice message waiting flag (mandatory) + 3) PLMN operator name (mandatory) + 4) Customer Service Profile (CSP) (optional) + 5) CPHS Information (mandatory) + 6) Mailbox Numbers (optional) + 7) Information Numbers (optional) + + */ + +/* + DATA FIELD - 6F 16: CPHS INFORMATION + Access Conditions: + READ CHV1 + UPDATE ADM + */ +/** + * @brief The structure type for CPHS information data. + * @since_tizen 2.3 + */ +typedef struct { + TelSimCphsPhaseType_t CphsPhase; /**< CPHS phase type */ + TelSimCphsServiceTable_t CphsServiceTable; /**< CPHS service table */ +} TelSimCphsInfo_t; + +/* + DATA FIELD -6F 19: Information Numbers + Access Conditions: + READ CHV1 + UPDATE CHV1 + */ +/** + * @brief The structure type for CPHS information numbers data. + * @since_tizen 2.3 + */ +typedef struct { + int bUsed; /**< SIM CPHS index level one */ + unsigned char AlphaIdLength; /**< Length of alpha identifier */ + + TelSimCphsIndexLevelIndicator_t IndexLevelIndicator; /**< SIM CPHS index level one */ + int PremiumServiceIndicator; /**< SIM CPHS index level one */ + int NetworkSpecificIndicator; /**< SIM CPHS index level one */ + unsigned char Alpha_id[TAPI_SIM_XDN_ALPHA_ID_MAX_LEN + 1]; /**< Alpha Identifier */ + + unsigned long DiallingnumLength; /**< Length of BCD number/SSC contents */ + TelSimTypeOfNum_t TypeOfNumber; /**< TON */ + TelSimNumberingPlanIdentity_t NumberingPlanIdentity; /**< NPI */ + char DiallingNum[TAPI_SIM_XDN_DIALING_NUMBER_LEN + 1]; /**< Dialing Number/SSC String */ + unsigned char Ext1RecordId; /**< Extension 1 Record Identifier */ +} TelSimCphsInformationNum_t; + +/* + DATA FIELD- 6F 15: Customer Service Profile (Storing a list of service options which are relevant to that specific customer) + Access Conditions: + READ CHV1 + UPDATE CHV1 + */ +/** + * @brief The structure type for CPHS service call offering information. + * @since_tizen 2.3 + */ +typedef struct { + int bCallForwardingUnconditional; /**< CallForwarding Unconditional */ + int bCallForwardingOnUserBusy; /**< CallForwarding On UserBusy */ + int bCallForwardingOnNoReply; /**< CallForwarding On NoReply */ + int bCallForwardingOnUserNotReachable; /**< CallForwarding On User Not Reachable */ + int bCallTransfer; /**< Call Transfer */ +} TelSimCphsServiceCallOffering_t; + +/** + * @brief The structure type for CPHS service call restriction information. + * @since_tizen 2.3 + */ +typedef struct { + int bBarringOfAllOutgoingCalls; /**< Barring Of All Outgoing Calls */ + int bBarringOfOutgoingInternationalCalls; /**< Barring Of Outgoing International Calls */ + int bBarringOfOutgoingInternationalCallsExceptHplmn; /**< Barring Of Outgoing International Calls Except HPLMN */ + int bBarringOfAllIncomingCallsRoamingOutsideHplmn; /**< Barring Of All Incoming Calls Roaming Outside HPLMN */ + int bBarringOfIncomingCallsWhenRoaming; /**< Barring Of Incoming Calls When Roaming */ +} TelSimCphsServiceCallRestriction_t; + +/** + * @brief The structure type for CPHS service SS information. + * @since_tizen 2.3 + */ +typedef struct { + int bMultiPartyService; /**< MultiPartyService */ + int bClosedUserGroup; /**< ClosedUserGroup */ + int bAdviceOfCharge; /**< AdviceOfCharge */ + int bPreferentialClosedUserGroup; /**< PreferentialClosedUserGroup*/ + int bClosedUserGroupOutgoingAccess; /**< ClosedUserGroupOutgoingAccess */ +} TelSimCphsServiceOtherSupplimentaryService_t; + +/** + * @brief The structure type for CPHS service call complete information. + * @since_tizen 2.3 + */ +typedef struct { + int bCallHold; /**< Call Hold */ + int bCallWaiting; /**< Call Waiting */ + int bCompletionOfCallToBusySubscriber; /**< Completion Of Call To Busy Subscriber */ + int bUserUserSignalling; /**< User User Signaling */ +} TelSimCphsServiceCallComplete_t; + +/** + * @brief The structure type for CPHS service teleservices information. + * @since_tizen 2.3 + */ +typedef struct { + int bShortMessageMobileOriginated; /**< Short Message Mobile Originated */ + int bShortMessageMobileTerminated; /**< Short Message Mobile Terminated */ + int bShortMessageCellBroadcast; /**< Short Message Cell Broadcast */ + int bShortMessageReplyPath; /**< Short Message Reply Path */ + int bShortMessageDeliveryConf; /**< Short Message Delivery Conf */ + int bShortMessageProtocolIdentifier; /**< Short Message Protocol Identifier */ + int bShortMessageValidityPeriod; /**< Short Message Validity Period */ +} TelSimCphsServiceTeleservices_t; + +/** + * @brief The structure type for CPHS alternative line service information. + * @since_tizen 2.3 + */ +typedef struct { + int bAlternativeLineService; /**< Alternative Line Service */ +} TelSimCphsServiceCphsTeleservices_t; + +/** + * @brief The structure type for CPHS string service table information. + * @since_tizen 2.3 + */ +typedef struct { + int bStringServiceTable; /**< String Service Table */ +} TelSimCphsServiceCphsFeatures_t; + +/** + * @brief The structure type for CPHS service number identifier information. + * @since_tizen 2.3 + */ +typedef struct { + int bCallingLineIdentificationPresent; /**< Calling Line Identification Present */ + int bConnectedLineIdentificationRestrict; /**< Connected Line Identification Restrict */ + int bConnectedLineIdentificationPresent; /**< Connected Line Identification Present */ + int bMaliciousCallIdentifier; /**< Malicious Call Identifier */ + int bCallingLineIdentificationSend; /**< Calling Line Identification Send */ + int bCallingLineIdentificationBlock; /**< Calling Line Identification Block */ +} TelSimCphsServiceNumberIdentifier_t; + +/** + * @brief The structure type for CPHS service phase services information. + * @since_tizen 2.3 + */ +typedef struct { + int bMenuForGprs; /**< Menu For GPRS */ + int bMenuForHighSpeedCsd; /**< Menu For HighSpeedCsd */ + int bMenuForVoiceGroupCall; /**< Menu For VoiceGroupCall */ + int bMenuForVoiceBroadcastService; /**< Menu For VoiceBroadcastService */ + int bMenuForMultipleSubscriberProfile; /**< Menu For MultipleSubscriberProfile */ + int bMenuForMultipleBand; /**< Menu For MultipleBand */ +} TelSimCphsServicePhaseServices_t; + +/** + * @brief The structure type for CPHS value added service information. + * @since_tizen 2.3 + */ +typedef struct { + int bRestrictMenuForManualSelection; /**< RestrictMenu For ManualSelection */ + int bRestrictMenuForVoiceMail; /**< RestrictMenu For VoiceMail */ + int bRestrictMenuForMoSmsAndPaging; /**< RestrictMenu For MoSmsAndPaging */ + int bRestrictMenuForMoSmsWithEmialType; /**< RestrictMenu For MoSmsWithEmailType */ + int bRestrictMenuForFaxCalls; /**< RestrictMenu For FaxCalls */ + int bRestrictMenuForDataCalls; /**< RestrictMenu For DataCalls */ + int bRestrictMenuForChangeLanguage; /**< RestrictMenu For ChangeLanguage */ +} TelSimCphsServiceValueAddedServices_t; + +/** + * @brief The structure type for CPHS service information number data. + * @since_tizen 2.3 + */ +typedef struct { + int bInformationNumbers; /**< Information Numbers */ +} TelSimCphsServiceInformationNumbers_t; + +/** + * @brief The structure type for CPHS service profile entry information. + * @since_tizen 2.3 + */ +typedef struct { + TelSimCphsCustomerServiceGroup_t CustomerServiceGroup; /**< Customer service group */ + union { + TelSimCphsServiceCallOffering_t CallOffering; /**< Call offering */ + TelSimCphsServiceCallRestriction_t CallRestriction; /**< Call restriction */ + TelSimCphsServiceOtherSupplimentaryService_t OtherSuppServices; /**< Other SS services */ + TelSimCphsServiceCallComplete_t CallComplete; /**< Call complete */ + TelSimCphsServiceTeleservices_t Teleservices; /**< Teleservices */ + TelSimCphsServiceCphsTeleservices_t CphsTeleservices; /**< CPHS teleservices */ + TelSimCphsServiceCphsTeleservices_t CphsFeatures; /**< CPHS features */ + TelSimCphsServiceNumberIdentifier_t NumberIdentifiers; /**< Number identifiers */ + TelSimCphsServicePhaseServices_t PhaseServices; /**< Phase services */ + TelSimCphsServiceValueAddedServices_t ValueAddedServices; /**< Value added services */ + TelSimCphsServiceInformationNumbers_t InformationNumbers; /**< Information numbers */ + } u; +} TelSimCphsCustomerServiceProfileEntry_t; + +/** + * @brief The structure type for CPHS service profile information. + * @since_tizen 2.3 + */ +typedef struct { + TelSimCphsCustomerServiceProfileEntry_t ServiceProfileEntry[TAPI_SIM_CPHS_CUSTOMER_SERVICE_PROFILE_ENTRY_COUNT_MAX]; /**< Service profile entry */ +} TelSimCphsCustomerServiceProfileInfo_t; + +/** + * @brief The structure type for dynamic flag selected line information. + * @since_tizen 2.3 + */ +typedef struct { + TelSimDynamicFlagsSelectedLineId_t DynamicFlags; /**< Dynamic flags information */ +} TelSimDynamicFlagsInfo_t; + +/** + * @brief The structure type for dynamic flag selected line information. + * @since_tizen 2.3 + */ +typedef struct { + TelSimDynamic2FlagAlsStatus_t Dynamic2Flag; /**< Dynamic flags status */ +} TelSimDynamic2FlagsInfo_t; + +/** + * @brief The structure type for phone book availability of the current SIM. + * @since_tizen 2.3 + */ +typedef struct { + int b_fdn; /**< Fixed Dialing Number */ + int b_adn; /**< SIM - ADN(2G phonebook, Under DF phonebook */ + int b_sdn; /**< Service Dialing Number */ + int b_3g; /**< USIM - 3G phonebook */ + int b_aas; /**< Additional number Alpha String phonebook */ + int b_gas; /**< Grouping information Alpha String phonebook */ +} TelSimPbList_t; + +/** + * @brief The structure type for phone book status of the current SIM. + * @since_tizen 2.3 + */ +typedef struct { + int init_completed; /**< TBD */ + TelSimPbList_t pb_list; /**< TBD */ +} TelSimPbStatus_t; + +typedef struct { + TelSimPbType_t phonebook_type; /**< TBD */ + unsigned short index; /**< TBD */ + unsigned short next_index; /**< TBD */ //this field is not used in the add/update case + + unsigned char name[TAPI_SIM_PB_RECORD_NAME_MAX_LEN+1]; /**< TBD */ + TelSimTextEncrypt_t dcs; /**< TBD */ + + unsigned char number[TAPI_SIM_PB_RECORD_NUMBER_MAX_LEN+1]; /**< TBD */ + TelSimTypeOfNum_t ton; /**< TBD */ + + /* following field is valid in only USIM*/ + unsigned char sne[TAPI_SIM_PB_RECORD_NAME_MAX_LEN+1]; /**< TBD */ + TelSimTextEncrypt_t sne_dcs; /**< TBD */ + unsigned char anr1[TAPI_SIM_PB_RECORD_NUMBER_MAX_LEN+1]; /**< TBD */ + TelSimTypeOfNum_t anr1_ton; /**< TBD */ + unsigned char anr2[TAPI_SIM_PB_RECORD_NUMBER_MAX_LEN+1]; /**< TBD */ + TelSimTypeOfNum_t anr2_ton; /**< TBD */ + unsigned char anr3[TAPI_SIM_PB_RECORD_NUMBER_MAX_LEN+1]; /**< TBD */ + TelSimTypeOfNum_t anr3_ton; /**< TBD */ + + unsigned char email1[TAPI_SIM_PB_RECORD_EMAIL_MAX_LEN+1]; /**< TBD */ + unsigned char email2[TAPI_SIM_PB_RECORD_EMAIL_MAX_LEN+1]; /**< TBD */ + unsigned char email3[TAPI_SIM_PB_RECORD_EMAIL_MAX_LEN+1]; /**< TBD */ + unsigned char email4[TAPI_SIM_PB_RECORD_EMAIL_MAX_LEN+1]; /**< TBD */ + + unsigned short group_index; /**< TBD */ //GRP + unsigned short pb_control; /**< TBD */ //PBC +} TelSimPbRecord_t; + +/** + * @brief The structure type for phone book storage count information. + * @since_tizen 2.3 + */ +typedef struct { + TelSimPbType_t StorageFileType; /**< Storage file type */ + unsigned short TotalRecordCount; /**< Total record count */ + unsigned short UsedRecordCount; /**< Used record count */ +} TelSimPbStorageInfo_t; + +/** + * @brief The structure type for phone book entry information. + * @since_tizen 2.3 + */ +typedef struct { + TelSimPbType_t StorageFileType; /**< Storage file type */ + unsigned short PbIndexMin; /**< Phone book minimum index */ + unsigned short PbIndexMax; /**< Phone book maximum index */ + unsigned short PbNumLenMax; /**< Phone number's maximum length */ + unsigned short PbTextLenMax; /**< Text's maximum length */ + unsigned short PbUsedCount; /**< Phone book used record count */ +} TelSimPbEntryInfo_t; + +/** + * @brief The structure type for 3G phone book capability information. + * @since_tizen 2.3 + */ +typedef struct { + TelSimPb3GFileType_t field_type; /**< 3G phonebook file type */ + unsigned short index_max; /**< Max index */ + unsigned short text_max; /**< Max text length */ + unsigned short used_count; /**< Used record count */ +} TelSimPb3GFileTypeCapabiltyInfo_t; + +/** + * @brief The structure type for SIM PHONEBOOK & ITS CAPABILITIES information. + * @details It refers to EF_PBR. + * @since_tizen 2.3 + */ +typedef struct { + unsigned short FileTypeCount; /**< Phonebook file type count */ + TelSimPb3GFileTypeCapabiltyInfo_t FileTypeInfo[TAPI_SIM_PB_3G_FILE_MAX_COUNT]; /**< Phonebook file type information */ +} TelSimPbCapabilityInfo_t; + + + +/* SAP (SIM Access Profile) related interface structures and enum */ +/** + * @brief The structure type for SAP ATR response data information. + * @since_tizen 2.3 + */ +typedef struct { + int atr_len; /**< SAP ATR response data length */ + unsigned char atr_data[TAPI_SIM_SAP_ATR_DATA]; /**< SAP ATR response data */ +} TelSapAtrInfo_t; + +/* SAP transfer APDU request */ + +/** + * @brief The structure type for SAP APDU data information. + * @since_tizen 2.3 + */ +typedef struct { + int apdu_len; /**< SAP APDU length */ + unsigned char apdu_data[TAPI_SIM_APDU_MAX_LEN]; /**< SAP APDU data */ +} TelSapApduData_t; + +/** + * @brief Enumeration for TelSimPowerState_t. + * @details This enumeration defines the power state of the SIM. + * @since_tizen 2.3 + */ +typedef enum { + TAPI_SIM_POWER_OFF = 0x00, /**< OFF */ + TAPI_SIM_POWER_ON = 0x01, /**< ON */ + TAPI_SIM_POWER_UNSPECIFIED = 0xFF /**< Unspecified */ +} TelSimPowerState_t; + +#ifdef __cplusplus +} +#endif + +#endif // _TELSIM_H_ +/** + * @} + */ diff --git a/include/TelSms.h b/include/TelSms.h new file mode 100644 index 0000000..819be58 --- /dev/null +++ b/include/TelSms.h @@ -0,0 +1,426 @@ +/* + * libslp-tapi + * + * Copyright (c) 2014 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Ja-young Gu + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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 TelSms.h + */ + +/** + * @internal + * @addtogroup CAPI_TELEPHONY_SERVICE_SMS + * @{ + */ + +#ifndef _TEL_NETTEXT_H_ +#define _TEL_NETTEXT_H_ + +#include + +#ifdef __cplusplus +extern "C" +{ +#endif + +/* NetText */ + +/** + * @brief Definition for the EF-SMSP digit length. + * @since_tizen 2.3 + */ +#define TAPI_SIM_SMSP_ADDRESS_LEN 20 + +/** + * @brief Definition for the EF-SMSP alpha ID length. + * @since_tizen 2.3 + */ +#define TAPI_SIM_SMSP_ALPHA_ID_LEN_MAX 128 + +/** + * @brief Definition for the maximum message size. + * @since_tizen 2.3 + */ +#define TAPI_NETTEXT_MSG_SIZE_MAX 918 + +/** + * @brief Definition for the maximum CB message size. + * @since_tizen 2.3 + */ +#define TAPI_NETTEXT_CB_SIZE_MAX 1252 + +/** + * @brief Definition for the maximum ETWS message size. + * @since_tizen 2.3 + */ +#define TAPI_NETTEXT_ETWS_SIZE_MAX 1252 + +/** + * @brief Definition for the nettext address length. + * @since_tizen 2.3 + */ +#define TAPI_NETTEXT_ADDRESS_LEN_MAX 20 + +/** + * @brief Definition for the SC address length. + * @since_tizen 2.3 + */ +#define TAPI_NETTEXT_SCADDRESS_LEN_MAX 18 + +/** + * @brief Definition for the CB maximum page size. + * @since_tizen 2.3 + */ +#define TAPI_NETTEXT_CB_PAGE_SIZE_MAX 9 + +/** + * @brief Definition for the maximum GSM SMS message number. + * @since_tizen 2.3 + */ +#define TAPI_NETTEXT_SMS_MSG_NUM_MAX 255 /**< Maximum SMS message number*/ + +/** + * @brief Definition for the maximum GSM SMS CBMI list size. + * @since_tizen 2.3 + */ +#define TAPI_NETTEXT_SMS_CBMI_LIST_SIZE_MAX 50 /**< Maximum SMS CBMI list size*/ + +/** + * @brief Definition for the maximum SMS data size that can be stored. + * @since_tizen 2.3 + */ +#define TAPI_NETTEXT_SMDATA_SIZE_MAX 255 /**< Maximum SMS data size that can be stored*/ + +/** + * @brief Definition for the maximum SMS service center address. + * @since_tizen 2.3 + */ +#define TAPI_NETTEXT_MAX_SMS_SERVICE_CENTER_ADDR 12 + +/** + * @brief Definition for the maximum index value of the SMS. + * @since_tizen 2.3 + */ +#define TAPI_NETTEXT_MAX_INDEX 255 + +#define TAPI_NETTEXT_SMSP_PARAMS_MAX_LEN 28 + +/** + * @brief Enumeration for network text status type. + * @since_tizen 2.3 + */ +typedef enum +{ + TAPI_NETTEXT_STATUS_READ, /**< MT message, stored and read */ + TAPI_NETTEXT_STATUS_UNREAD, /**< MT message, stored and unread */ + TAPI_NETTEXT_STATUS_SENT, /**< MO message, stored and sent */ + TAPI_NETTEXT_STATUS_UNSENT, /**< MO message, stored but not sent */ + TAPI_NETTEXT_STATUS_DELIVERED, /**< Delivered destination */ + TAPI_NETTEXT_STATUS_DELIVERY_UNCONFIRMED, /**< Service centre forwarded message but is unable to confirm delivery */ + TAPI_NETTEXT_STATUS_MESSAGE_REPLACED, /**< Message has been replaced */ + TAPI_NETTEXT_STATUS_RESERVED /**< Reserved for future use */ +} TelSmsMsgStatus_t; + +/** + * @brief Enumeration for memory status type. + * @since_tizen 2.3 + */ +typedef enum +{ + TAPI_NETTEXT_PDA_MEMORY_STATUS_AVAILABLE = 0x01, /**< PDA memory is available */ + TAPI_NETTEXT_PDA_MEMORY_STATUS_FULL = 0x02, /**< PDA memory is full */ + TAPI_NETTEXT_PHONE_MEMORY_STATUS_AVAILABLE = 0x03, /**< Phone memory is available */ + TAPI_NETTEXT_PHONE_MEMORY_STATUS_FULL = 0x04, /**< Phone memory is full */ +}TelSmsMemStatusType; + +/** + * @brief Enumeration for different CB message types. + * @since_tizen 2.3 + */ +typedef enum +{ + TAPI_NETTEXT_CB_MSG_GSM = 1, /**< GSM Cell broadcast message */ + TAPI_NETTEXT_CB_MSG_UMTS, /**< UMTSCell broadcast message */ + TAPI_NETTEXT_CB_MSG_CDMA /**< CDMA broadcast message */ +} TelSmsCbMsgType_t; + +/** + * @brief Enumeration for different ETWS message types. + * @since_tizen 2.3 + */ +typedef enum +{ + TAPI_NETTEXT_ETWS_PRIMARY = 0, /**< Primary ETWS message */ + TAPI_NETTEXT_ETWS_SECONDARY_GSM, /**< GSM Secondary ETWS message */ + TAPI_NETTEXT_ETWS_SECONDARY_UMTS, /**< UMTS Secondary ETWS message */ + TAPI_NETTEXT_ETWS_SECONDARY_CDMA /*TODO:Will be supported*/ +} TelSmsEtwsMsgType_t; + +/** + * @brief Enumeration for different response types that come in the + * sent status acknowledgement/notification after sending a message to the network. + * @since_tizen 2.3 + */ +typedef enum +{ + TAPI_NETTEXT_SENDSMS_SUCCESS = 0x00, /**< Message sent successfully */ + TAPI_NETTEXT_ROUTING_NOT_AVAILABLE, /**< Message routing not available */ + TAPI_NETTEXT_INVALID_PARAMETER, /**< Invalid parameter present in TPDU */ + TAPI_NETTEXT_DEVICE_FAILURE, /**< Device failure */ + TAPI_NETTEXT_SERVICE_RESERVED, /**< Reserved Service */ + TAPI_NETTEXT_INVALID_LOCATION, /**< Invalid location */ + TAPI_NETTEXT_NO_SIM, /**< No SIM error */ + TAPI_NETTEXT_SIM_NOT_READY, /**< SIM not ready error */ + TAPI_NETTEXT_NO_NETWORK_RESP, /**< No response from network */ + TAPI_NETTEXT_DEST_ADDRESS_FDN_RESTRICTED,/**< Destination address restricted */ + TAPI_NETTEXT_SCADDRESS_FDN_RESTRICTED, /**< Service center address restricted */ + TAPI_NETTEXT_RESEND_ALREADY_DONE, /**< Resend an already done operation */ + TAPI_NETTEXT_SCADDRESS_NOT_AVAILABLE, /**< SCA address not available */ + TAPI_NETTEXT_UNASSIGNED_NUMBER = 0x8001, /**< Unassigned number */ + TAPI_NETTEXT_OPERATOR_DETERMINED_BARRING = 0x8008,/**< Operator determined barring */ + TAPI_NETTEXT_CALL_BARRED = 0x800A, /**< Call barred */ + TAPI_NETTEXT_MESSAGE_TRANSFER_REJECTED = 0x8015, /**< Message transfer rejected */ + TAPI_NETTEXT_MEMORY_CAPACITY_EXCEEDED = 0x8016, /**< Memory capacity exceeded/memory full */ + TAPI_NETTEXT_DESTINAITION_OUTOFSERVICE = 0x801B, /**< Destination number/address out of service */ + TAPI_NETTEXT_UNSPECIFIED_SUBSCRIBER = 0x801C, /**< Unspecified subscriber */ + TAPI_NETTEXT_FACILITY_REJECTED = 0x801D, /**< Facility rejected */ + TAPI_NETTEXT_UNKNOWN_SUBSCRIBER = 0x801E, /**< Unknown subscriber */ + TAPI_NETTEXT_NETWORK_OUTOFORDER = 0x8026, /**< Network out of order */ + TAPI_NETTEXT_TEMPORARY_FAILURE = 0x8029, /**< Temporary failure */ + TAPI_NETTEXT_CONGESTION = 0x802A, /**< Congestion occurred */ + TAPI_NETTEXT_RESOURCES_UNAVAILABLE = 0x802F, /**< Resource unavailable */ + TAPI_NETTEXT_FACILITY_NOT_SUBSCRIBED = 0x8032, /**< Facility not subscribed by the user */ + TAPI_NETTEXT_FACILITY_NOT_IMPLEMENTED = 0x8045, /**< Facility not implemented */ + TAPI_NETTEXT_INVALID_REF_VALUE = 0x8051, /**< Invalid reference value */ + TAPI_NETTEXT_INVALID_MSG = 0x805F, /**< Invalid message */ + TAPI_NETTEXT_INVALID_MANDATORY_INFO = 0x8060, /**< Invalid Mandatory information */ + TAPI_NETTEXT_MESSAGE_TYPE_NOT_IMPLEMENTED = 0x8061,/**< Message type not implemented */ + TAPI_NETTEXT_MESSAGE_NOT_COMPAT_PROTOCOL = 0x8062, /**< Message not compact protocol */ + TAPI_NETTEXT_IE_NOT_IMPLEMENTED = 0x8063, /**< Information element not implemented */ + TAPI_NETTEXT_PROTOCOL_ERROR = 0x806F, /**< Protocol error */ + TAPI_NETTEXT_INTERWORKING = 0x807F, /**< Networking error */ + TAPI_NETTEXT_ME_FULL = 0x8080, /**< SMS ME FULL */ + TAPI_NETTEXT_SIM_FULL = 0x8081, /**< SMS SIM FULL */ + TAPI_NETTEXT_TIMEOUT /**< Timeout error */ +}TelSmsResponse_t; + +/** + * @brief Enumeration for different cause types that come in the + * sent status acknowledgement/notification after sending a message to the network. + * @since_tizen 2.3 + */ +typedef enum +{ + + TAPI_NETTEXT_SUCCESS, /**< SMS operation successful */ + TAPI_NETTEXT_INVALID_PARAMETER_FORMAT, /**< Invalid format for some parameters passed in Data package information(TPDU) */ + TAPI_NETTEXT_PHONE_FAILURE, /**< SMS operation failed due to Modem failure */ + TAPI_NETTEXT_SIM_BUSY, /**< SMS SIM operation cannot be performed as the SIM is busy with some other operation */ + TAPI_NETTEXT_SIM_FAILURE, /**< SMS SIM operation cannot be performed due to SIM failure */ + TAPI_NETTEXT_UNKNOWN, /**< Unknown error */ + TAPI_NETTEXT_MEMORY_FAILURE, /**< Error while accessing memory or allocating memory for SMS operation */ + TAPI_NETTEXT_OPERATION_NOT_SUPPORTED /**< Operation not allowed/supported */ +} TelSmsCause_t; + +/** + * @brief Enumeration for response values. + * @since_tizen 2.3 + */ +typedef enum +{ + TAPI_NETTEXT_CBSETCONFIG_RSP, /**< Cell broadcast config response */ + TAPI_NETTEXT_SETPREFERREDBEARER_RSP, /**< Set preferred bearer response */ + TAPI_NETTEXT_SETPARAMETERS_RSP, /**< Set parameter response */ + TAPI_NETTEXT_SETMEMORYSTATUS_RSP, /**< Set memory status response */ + TAPI_NETTEXT_SETMESSAGESTATUS_RSP, /**< Set message status response */ + TAPI_NETTEXT_SETDEVICESTATUS_RSP, /**< Set device status response */ + TAPI_NETTEXT_SETSCADDR_RSP, /**< Set SCA address response */ + TAPI_NETTEXT_SET_RSP_MAX /**< Maximum limit */ +}TelSmsSetResponse; + +/** + * @brief Enumeration for the type of Network + * @since_tizen 2.3 + */ +typedef enum { + TAPI_NETTEXT_NETTYPE_3GPP = 0x01, /**< 3gpp type */ + TAPI_NETTEXT_NETTYPE_3GPP2 = 0x02, /**< 3gpp2 type (CDMA) */ +} TelSmsNetType_t; + +/** + * @brief Enumeration for the sms ready status type. + * @since_tizen 2.3 + */ +typedef enum { + TAPI_NETTEXT_READY_STATUS_NONE = 0x00, + TAPI_NETTEXT_READY_STATUS_3GPP = 0x01, + TAPI_NETTEXT_READY_STATUS_3GPP2 = 0x02, + TAPI_NETTEXT_READY_STATUS_3GPP_AND_3GPP2 = 0x03, +}TelSmsReadyStatus_t; + +/** + * @brief The structure type for different parameters of the CB configuration. + * @since_tizen 2.3 + */ +typedef struct { + unsigned short FromMsgId; /**< Starting point of the range of the CBS message ID */ + unsigned short ToMsgId; /**< Ending point of the range of the CBS message ID */ + unsigned char Selected; /**< 0x00 . Not selected. 0x01 . Selected */ +} TelSmsCbMsgInfo3gpp_t; + +typedef struct { + unsigned short CBCategory; /**< CB Service category */ + unsigned short CBLanguage; /**< Language indicator value + . 0x00 . LANGUAGE_UNKNOWN . Unknown or Unspecified + . 0x01 . LANGUAGE_ENGLISH . English + . 0x02 . LANGUAGE_FRENCH . French + . 0x03 . LANGUAGE_SPANISH . Spanish + . 0x04 . LANGUAGE_JAPANESE . Japanese + . 0x05 . LANGUAGE_KOREAN . Korean + . 0x06 . LANGUAGE_CHINESE . Chinese + . 0x07 . LANGUAGE_HEBREW . Hebrew */ + unsigned char Selected; /**< 0x00 . Not selected. 0x01 . Selected */ +} TelSmsCbMsgInfo3gpp2_t; + +typedef union { + TelSmsCbMsgInfo3gpp_t Net3gpp; /**< 3GPP Broadcast Configuration Information */ + TelSmsCbMsgInfo3gpp2_t Net3gpp2; /**< 3GPP2 Broadcast Configuration Information, CDMA */ +} TelSmsCbMsgInfo_t; + +typedef struct { + int Net3gppType; /**< Type of 3GPP, 0x01 . 3gpp. 0x02 . 3gpp2(CDMA) */ + int CBEnabled; /**< CB service state. If @a CBEnabled is @c true then the cell broadcast service will be enabled and the underlying modem will enable the CB Channel to receive CB messages. Otherwise the CB service will be disabled and the underlying modem will deactivate the CB channel. (enabled/disabled) */ + unsigned char MsgIdMaxCount; /**< CB Channel List Max Count For Response */ + int MsgIdRangeCount; /**< Range of CB message ID count */ + TelSmsCbMsgInfo_t MsgIDs[TAPI_NETTEXT_SMS_CBMI_LIST_SIZE_MAX]; /**< Range of CB message ID information */ +} TelSmsCbConfig_t; + +/** + * @brief The structure type for properties of a dialing number. + * @details Those properties are: type of the number, numbering plan indicator, length, and the actual number. + * @since_tizen 2.3 + */ +typedef struct { + unsigned int DialNumLen; /**< Length of the address. If the Service center address is not set, then this will be zero */ + TelSimTypeOfNum_t Ton; /**< Type of number */ + TelSimNumberingPlanIdentity_t Npi; /**< Numbering plan identification */ + unsigned char szDiallingNum[TAPI_SIM_SMSP_ADDRESS_LEN + 1]; /**< Destination address. If the address is not set, then it is set to 0xFF */ +} TelSmsAddressInfo_t; + +/** + * @brief The structure type for different fields involved in setting the parameters of a particular SMS in EFsmsp. + * @since_tizen 2.3 + */ +typedef struct { + + unsigned char RecordIndex; /**< Index */ + unsigned char RecordLen; /**< SMS Parameter Record length */ + unsigned long AlphaIdLen; /**< Alpha ID length */ + char szAlphaId[TAPI_SIM_SMSP_ALPHA_ID_LEN_MAX + 1]; /**< Alpha ID. It is a unique identifier for each row/record in EFsmsp */ + unsigned char ParamIndicator; /**< SMS parameter indicator is a 1 byte value. Each bit in this value indicates the presence/absence of the SMS header parameters. If the parameter is present the corresponding bit value is set to @c 0. If the parameter is absent then it is set as @c 1. Refer 3GPP TS 31.02 :4.4.23 */ + TelSmsAddressInfo_t TpDestAddr; /**< TP-destination address (TP-DA) */ + TelSmsAddressInfo_t TpSvcCntrAddr; /**< TP-service center address */ + unsigned short TpProtocolId; /**< TP-protocol ID */ + unsigned short TpDataCodingScheme; /**< TP-data coding scheme */ + unsigned short TpValidityPeriod; /**< TP-validity period */ +} TelSmsParams_t; + +/** + * @brief The structure type for the fields related to an SMS like format(3GPP/3GPP2), TPDU and length + * @details + * SCA will be filled by MSG_SERVICE for GSM/UMTS technology only.\n + * For CDMA SCA need not be filled by MSG_SERVICE. + * @since_tizen 2.3 + */ +typedef struct { + unsigned char Sca[TAPI_SIM_SMSP_ADDRESS_LEN]; /**< Service Centre address - an optional parameter. If this parameter is not present, then this field will be Null.If present, the valid service centre address information is filled as per 3GPP TS23.040 9.1.2.5 Address fields */ + int MsgLength; /**< Size of array szData (which is actual TPDU message) */ + unsigned char szData[TAPI_NETTEXT_SMDATA_SIZE_MAX + 1]; /** + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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 TelSs.h + */ + +/** + * @internal + * @addtogroup CAPI_TELEPHONY_SERVICE_SS + * @{ + */ + +#ifndef _TEL_SS_H_ +#define _TEL_SS_H_ + +#ifdef __cplusplus +extern "C" +{ +#endif + +/** + * @brief Definition for the maximum length of the barring password. + * @since_tizen 2.3 + */ +#define TAPI_SS_GSM_BARR_PW_LEN_MAX 4 + +/** + * @brief Definition for the maximum length of the dial digit. + * @since_tizen 2.3 + */ +#define TAPI_CALL_DIALDIGIT_LEN_MAX 82 + +/** + * @brief Definition for the maximum size of user-to-user data. + * @since_tizen 2.3 + */ +#define TAPI_SS_USSD_DATA_SIZE_MAX 208 + +/** + * @brief Definition for the maximum size of the SS record. + * @since_tizen 2.3 + */ +#define TAPI_SS_RECORD_NUM_MAX 5 + +/* Supplementary Svc */ +#define TAPI_SS_ADDRESS_LEN_MAX 40 +#define TAPI_SS_CCBS_SIZE_MAX 5 +#define TAPI_SS_TELECOMM_SERVCE_SIZE_MAX 13 +#define TAPI_SS_PHONE_NUM_LEN_MAX 33 +#define TAPI_SS_MMISTRING_LEN_MAX 33 +#define TAPI_SS_PWD_LEN_MAX 5 +#define TAPI_MAX_RELEASE_COMPLETE_DATA_LEN 260 +#define TAPI_MAX_ULONG 0xffffffff + +/** + * @brief Enumeration for the call forwarding condition. + * @since_tizen 2.3 + */ +typedef enum { + TAPI_SS_CF_WHEN_CFU = 0x01, /**< 0x01 : Call Forwarding Unconditional */ + TAPI_SS_CF_WHEN_CFB, /**< 0x02 : Call Forwarding Mobile Busy */ + TAPI_SS_CF_WHEN_CFNRy, /**< 0x03 : Call Forwarding No Reply */ + TAPI_SS_CF_WHEN_CFNRc, /**< 0x04 : Call Forwarding Not Reachable */ + TAPI_SS_CF_WHEN_CF_ALL, /**< 0x05 : All Call Forwarding */ + TAPI_SS_CF_WHEN_CFC, /**< 0x06 : All Conditional Call Forwarding */ + TAPI_SS_CF_WHEN_MAX /**< 0x07 : Max */ +} TelSsForwardWhen_t; + +typedef enum { + TAPI_SS_CF_TON_UNKNOWN = 0, /**< Unknown */ + TAPI_SS_CF_TON_INTERNATIONAL = 1, /**< International number */ + TAPI_SS_CF_TON_NATIONAL = 2, /**< National number */ + TAPI_SS_CF_TON_NETWORK_SPECIFIC = 3, /**< Network specific number */ + TAPI_SS_CF_TON_DEDICATED_ACCESS = 4, /**< Subscriber number */ + TAPI_SS_CF_TON_ALPHA_NUMERIC = 5, /**< Alphanumeric, GSM 7-bit default alphabet) */ + TAPI_SS_CF_TON_ABBREVIATED_NUMBER = 6, /**< Abbreviated number */ + TAPI_SS_CF_TON_RESERVED_FOR_EXT = 7 /**< Reserved for extension */ +} TelSsForwardTypeOfNum_t; + +typedef enum { + TAPI_SS_CF_NPI_UNKNOWN = 0, /**< Unknown */ + TAPI_SS_CF_NPI_ISDN_TEL = 1, /**< ISDN/Telephone numbering plan */ + TAPI_SS_CF_NPI_DATA_NUMBERING_PLAN = 3, /**< Data numbering plan */ + TAPI_SS_CF_NPI_TELEX = 4, /**< Telex numbering plan */ + TAPI_SS_CF_NPI_SVC_CNTR_SPECIFIC_PLAN = 5, /**< Service Center Specific plan */ + TAPI_SS_CF_NPI_SVC_CNTR_SPECIFIC_PLAN2 = 6, /**< Service Center Specific plan */ + TAPI_SS_CF_NPI_NATIONAL = 8, /**< National numbering plan */ + TAPI_SS_CF_NPI_PRIVATE = 9, /**< Private numbering plan */ + TAPI_SS_CF_NPI_ERMES_NUMBERING_PLAN = 10, /**< ERMES numbering plan */ + TAPI_SS_CF_NPI_RESERVED_FOR_EXT = 0xF /**< Reserved for extension */ +} TelSsForwardNumberingPlanIdentity_t; + +/** + * @brief Enumeration for various types of call barring. + * @details Note, only one type of incoming barring and only one type of outgoing barring may be active at any time. + * @since_tizen 2.3 + */ +typedef enum { + TAPI_SS_CB_TYPE_BAOC = 0x01, /**< 0x01 : Barring All Outgoing Calls */ + TAPI_SS_CB_TYPE_BOIC, /**< 0x02 : Barring Outgoing International Calls */ + TAPI_SS_CB_TYPE_BOIC_NOT_HC, /**< 0x03 : Barring Outgoing International Calls + except to Home Country */ + TAPI_SS_CB_TYPE_BAIC, /**< 0x04 : Barring All Incoming Calls */ + TAPI_SS_CB_TYPE_BIC_ROAM, /**< 0x05 : Barring Incoming Calls when roaming + outside the Home Country */ + TAPI_SS_CB_TYPE_AB, /**< 0x06 : All Barring Services */ + TAPI_SS_CB_TYPE_AOB, /**< 0x07 : All Outgoing Barring Services */ + TAPI_SS_CB_TYPE_AIB, /**< 0x08 : All Incoming Barring Services */ + TAPI_SS_CB_TYPE_BIC_NOT_SIM, /**< 0x09 : Barring Incoming Calls which is + not stored in the SIM memory */ + TAPI_SS_CB_TYPE_MAX +} TelSsBarringType_t; + +/** + * @brief Enumeration for the USSD indication type. Applicable to 3GPP(GSM/UMTS/LTE) only. + * @since_tizen 2.3 + */ +typedef enum { + TAPI_SS_USSD_STATUS_NOTIFY = 0x00, /**< Notify : to display USSD data to the user */ + TAPI_SS_USSD_STATUS_NO_ACTION_REQUIRE = 0x01, /**< No further user action required */ + TAPI_SS_USSD_STATUS_ACTION_REQUIRE = 0x02, /**< Further user action required */ + TAPI_SS_USSD_STATUS_TERMINATED_BY_NET = 0x03, /**< 0x03 : USSD terminated by the network */ + TAPI_SS_USSD_STATUS_OTHER_CLIENT = 0x04, /**< 0x04 : Other local client has responded */ + TAPI_SS_USSD_STATUS_NOT_SUPPORT = 0x05, /**< 0x05 : Operation not supported */ + TAPI_SS_USSD_STATUS_TIME_OUT = 0x06 /**< 0x06 : Time out when there is no response from the network */ +} TelSsUssdStatus_t; + +/** + * @brief Enumeration for the USSD type. Applicable to 3GPP(GSM/UMTS/LTE) only. + * @since_tizen 2.3 + */ +typedef enum { + TAPI_SS_USSD_TYPE_USER_INIT = 0x01, /**< USSD request type - User Initiated */ + TAPI_SS_USSD_TYPE_USER_RSP, /**< USSD request type - User Response */ + TAPI_SS_USSD_TYPE_USER_REL /**< USSD request type - User Release */ +} TelSsUssdType_t; + +/** + * @brief Enumeration for the call barring operation mode. + * @since_tizen 2.3 + */ +typedef enum { + TAPI_SS_CB_MODE_ACTIVATE, /**< Activate call barring */ + TAPI_SS_CB_MODE_DEACTIVATE, /**< Deactivate call barring */ +} TelSsBarringMode_t; + +/** + * @brief Enumeration for the call barring operation mode. + * @since_tizen 2.3 + */ +typedef enum { + TAPI_SS_CW_MODE_ACTIVATE, /**< Activate call barring */ + TAPI_SS_CW_MODE_DEACTIVATE, /**< Deactivate call barring */ +} TelSsCallWaitingMode_t; + +/** + * @brief Enumeration for the call type. + * @since_tizen 2.3 + */ +typedef enum { + /* TELESERVICE */ + TAPI_SS_CLASS_ALL_TELE=0x10, /**< 0x10 : All Teleservices */ + TAPI_SS_CLASS_VOICE=0x11, /**< 0x11 : Voice ( telephony ) */ + TAPI_SS_CLASS_ALL_DATA_TELE=0x12, /**< 0x12 : All Data Teleservices */ + TAPI_SS_CLASS_FAX=0x13, /**< 0x13 : Fax Service */ + TAPI_SS_CLASS_SMS=0x16, /**< 0x16 : SMS service */ + TAPI_SS_CLASS_VGCS=0x17, /**< 0x17 : Voice Group Call Service */ + TAPI_SS_CLASS_VBS=0x18, /**< 0x18 : Voice Broadcast */ + TAPI_SS_CLASS_ALL_TELE_EXPT_SMS=0x19, /**< 0x19 : All teleservices except SMS */ + + /* BEARER SERVICE */ + TAPI_SS_CLASS_ALL_BEARER=0x20, /**< 0X20 : All Bearer services */ + TAPI_SS_CLASS_ALL_ASYNC=0x21, /**< 0x21 : All Async services */ + TAPI_SS_CLASS_ALL_SYNC=0x22, /**< 0x22 : All Sync services */ + TAPI_SS_CLASS_ALL_CS_SYNC=0x24, /**< 0x24 : All Circuit switched sync */ + TAPI_SS_CLASS_ALL_CS_ASYNC=0x25, /**< 0x25 : All Circuit switched async */ + TAPI_SS_CLASS_ALL_DEDI_PS=0x26, /**< 0x26 : All Dedicated packet Access */ + TAPI_SS_CLASS_ALL_DEDI_PAD=0x27, /**< 0x27 : All Dedicated PAD Access */ + TAPI_SS_CLASS_ALL_DATA_CDA=0x28, /**< 0x28 : All Data CDA */ + + /* PLMN SPECIFIC TELESERVICE */ + TAPI_SS_CLASS_PLMN_TELE_ALL = 0x50, /**< 0x50 : PLMN specific teleservices */ + TAPI_SS_CLASS_PLMN_TELE_1 = 0x51, /**< 0x51 : PLMN specific teleservice 1 */ + TAPI_SS_CLASS_PLMN_TELE_2 = 0x52, /**< 0x52 : PLMN specific teleservice 2 */ + TAPI_SS_CLASS_PLMN_TELE_3 = 0x53, /**< 0x53 : PLMN specific teleservice 3 */ + TAPI_SS_CLASS_PLMN_TELE_4 = 0x54, /**< 0x54 : PLMN specific teleservice 4 */ + TAPI_SS_CLASS_PLMN_TELE_5 = 0x55, /**< 0x55 : PLMN specific teleservice 5 */ + TAPI_SS_CLASS_PLMN_TELE_6 = 0x56, /**< 0x56 : PLMN specific teleservice 6 */ + TAPI_SS_CLASS_PLMN_TELE_7 = 0x57, /**< 0x57 : PLMN specific teleservice 7 */ + TAPI_SS_CLASS_PLMN_TELE_8 = 0x58, /**< 0x58 : PLMN specific teleservice 8 */ + TAPI_SS_CLASS_PLMN_TELE_9 = 0x59, /**< 0x59 : PLMN specific teleservice 9 */ + TAPI_SS_CLASS_PLMN_TELE_A = 0x60, /**< 0x60 : PLMN specific teleservice 10 */ + TAPI_SS_CLASS_PLMN_TELE_B = 0x61, /**< 0x61 : PLMN specific teleservice 11 */ + TAPI_SS_CLASS_PLMN_TELE_C = 0x62, /**< 0x62 : PLMN specific teleservice 12 */ + TAPI_SS_CLASS_PLMN_TELE_D = 0x63, /**< 0x63 : PLMN specific teleservice 13 */ + TAPI_SS_CLASS_PLMN_TELE_E = 0x64, /**< 0x64 : PLMN specific teleservice 14 */ + TAPI_SS_CLASS_PLMN_TELE_F = 0x65, /**< 0x65 : PLMN specific teleservice 15 */ + + /* PLMN SPECIFIC BEARER SERVICE */ + TAPI_SS_CLASS_PLMN_BEAR_ALL = 0x70, /**< 0x70 : All PLMN specific bearer services */ + TAPI_SS_CLASS_PLMN_BEAR_1 = 0x71, /**< 0x71 : PLMN specific bearer service 1 */ + TAPI_SS_CLASS_PLMN_BEAR_2 = 0x72, /**< 0x72 : PLMN specific bearer service 2 */ + TAPI_SS_CLASS_PLMN_BEAR_3 = 0x73, /**< 0x73 : PLMN specific bearer service 3 */ + TAPI_SS_CLASS_PLMN_BEAR_4 = 0x74, /**< 0x74 : PLMN specific bearer service 4 */ + TAPI_SS_CLASS_PLMN_BEAR_5 = 0x75, /**< 0x75 : PLMN specific bearer service 5 */ + TAPI_SS_CLASS_PLMN_BEAR_6 = 0x76, /**< 0x76 : PLMN specific bearer service 6 */ + TAPI_SS_CLASS_PLMN_BEAR_7 = 0x77, /**< 0x77 : PLMN specific bearer service 7 */ + TAPI_SS_CLASS_PLMN_BEAR_8 = 0x78, /**< 0x78 : PLMN specific bearer service 8 */ + TAPI_SS_CLASS_PLMN_BEAR_9 = 0x79, /**< 0x79 : PLMN specific bearer service 9 */ + TAPI_SS_CLASS_PLMN_BEAR_A = 0x80, /**< 0x80 : PLMN specific bearer service 10 */ + TAPI_SS_CLASS_PLMN_BEAR_B = 0x81, /**< 0x81 : PLMN specific bearer service 11 */ + TAPI_SS_CLASS_PLMN_BEAR_C = 0x82, /**< 0x82 : PLMN specific bearer service 12 */ + TAPI_SS_CLASS_PLMN_BEAR_D = 0x83, /**< 0x83 : PLMN specific bearer service 13 */ + TAPI_SS_CLASS_PLMN_BEAR_E = 0x84, /**< 0x84 : PLMN specific bearer service 14 */ + TAPI_SS_CLASS_PLMN_BEAR_F = 0x85, /**< 0x85 : PLMN specific bearer service 15 */ + + /* CPHS - AUXILIARY SERVICE */ + TAPI_SS_CLASS_AUX_VOICE = 0x89, /**< 0x89 : Auxiliary Voice ( Auxiliary telephony ) */ + + TAPI_SS_CLASS_ALL_GPRS_BEARER=0x99, /**< 0x99 : All GPRS bearer services */ + TAPI_SS_CLASS_ALL_TELE_BEARER=0xFF, /**< 0xFF : All tele and bearer services */ +} TelSsClass_t; + +/** + * @brief Enumeration for the forward mode. + * @since_tizen 2.3 + */ +typedef enum { + TAPI_SS_CF_MODE_DISABLE_EV, /**< Deactivate call forwarding */ + TAPI_SS_CF_MODE_ENABLE_EV, /**< Activate call forwarding */ + TAPI_SS_CF_MODE_REGISTRATION_EV, /**< Register call forwarding */ + TAPI_SS_CF_MODE_ERASURE_EV, /**< Deregister call forwarding */ +} TelSsForwardMode_t; + +/** + * @brief Enumeration for no-reply time. + * @since_tizen 2.3 + * @remarks Applicable to 3GPP(GSM/UMTS/LTE) only. + */ +typedef enum { + TAPI_SS_CF_NO_REPLY_TIME_5_SECS = 5, /**< Timer value set to 5secs */ + TAPI_SS_CF_NO_REPLY_TIME_10_SECS = 10, /**< Timer value set to 10secs */ + TAPI_SS_CF_NO_REPLY_TIME_15_SECS = 15, /**< Timer value set to 15secs */ + TAPI_SS_CF_NO_REPLY_TIME_20_SECS = 20, /**< Timer value set to 20secs */ + TAPI_SS_CF_NO_REPLY_TIME_25_SECS = 25, /**< Timer value set to 25secs */ + TAPI_SS_CF_NO_REPLY_TIME_30_SECS = 30, /**< Timer value set to 30secs */ +} TelSsNoReplyTime_t; + +/** + * @brief Enumeration for the supplementary service request results. + * @since_tizen 2.3 + */ +typedef enum { + TAPI_SS_SUCCESS=0x0, /**< SS operation is successful */ + + TAPI_SS_UNKNOWNSUBSCRIBER= 0x01, /**< SS error indicating unknown/illegal subscriber */ + TAPI_SS_ILLEGALSUBSCRIBER= 0x09, /**< This error is returned when illegality of the access has been @n + established by use of an authentication procedure */ + + TAPI_SS_BEARERSERVICENOTPROVISIONED= 0x0a, /**< The network returns this error when it is requested to @n + perform an operation on a supplementary service */ + TAPI_SS_TELESERVICENOTPROVISIONED= 0x0b, /**< The network returns this error when it is requested to perform @n + an operation on a supplementary service */ + TAPI_SS_ILLEGALEQUIPMENT= 0x0c, /**< This error is returned when the IMEI check procedure has shown that @n + the IMEI is blacklisted or it is not whitelisted */ + TAPI_SS_CALLBARRED= 0x0d, /**< This error is returned by the network to the MS when call independent subscriber control procedures are barred by the operator */ + TAPI_SS_ILLEGALSSOPERATION=0x10, /**< This error is returned by the network when it is requested to perform an illegal operation @n + which is defined as not applicable for the relevant supplementary service */ + TAPI_SS_ERRORSTATUS= 0x11, /**< This error is returned by the network when it is requested to perform an operation @n + which is not compatible with the current status of the relevant supplementary service */ + TAPI_SS_NOTAVAILABLE= 0x12, /**< SS not available in the network */ + TAPI_SS_SUBSCRIPTIONVIOLATION= 0x13, /**< SS service subscription violation */ + TAPI_SS_INCOMPATIBILITY= 0x14, /**< This error is returned by the network when it is requested for a supplementary service operation that is incompatible with the @n + status of another supplementary service or with the teleservice or bearer service for which the operation is requested */ + TAPI_SS_FACILITYNOTSUPPORTED= 0x15, /**< SS service facility not supported */ + TAPI_SS_ABSENTSUBSCRIBER= 0x1b, /**< This error is returned when the subscriber has activated the detach service or the system detects the absence condition */ + + TAPI_SS_SYSTEMFAILURE= 0x22, /**< This error is returned by the network, when it cannot perform an operation because of a failure in the network */ + TAPI_SS_DATAMISSING= 0x23, /**< This error is returned by the network when an optional parameter is missing in an invoke component @n + or an inner data structure, while it is required by the context of the request */ + TAPI_SS_UNEXPECTEDDATAVALUE= 0x24, /**< SS error indicating an unexpected data value on the network side *//**< SS operation barred */ + TAPI_SS_PWREGISTRATIONFAILURE= 0x25, /**< SS error indicating a change password failure */ + TAPI_SS_NEGATIVEPWCHECK= 0x26, /**< SS error indicating a negative password check */ + TAPI_SS_NUMBEROFPWATTEMPTSVIOLATION= 0x2b, /**< SS error indicating violation in barring password attempts */ + + TAPI_SS_UNKNOWNALPHABET= 0x47, /**< SS error indicating unknown SS data coding of an alphabet */ + TAPI_SS_USSDBUSY= 0x48, /**< SS error indicating USSD Busy(Already SS / USSD is ongoing) */ + + TAPI_SS_FIXED_DIALING_NUMBER_ONLY = 0x5F, /**< SS error indicating Dialing number is not FDN */ + + TAPI_SS_REJECTEDBYUSER= 0x79, /**< SS operation rejected by the user */ + TAPI_SS_REJECTEDBYNETWORK=0x7a, /**< SS operation rejected by the network */ + TAPI_SS_DEFLECTIONTOSERVEDSUBSCRIBER= 0x7b, /**< This error is returned if a diversion to the served @n + subscriber's number is requested */ + TAPI_SS_SPECIALSERVICECODE= 0x7c, /**< This error is returned if a diversion to a special service code is requested */ + TAPI_SS_INVALIDDEFLECTEDTONUMBER= 0x7d, /**< SS error indicating invalid deflected to a number */ + TAPI_SS_MAXNOMPTYEXCEEDED= 0x7e, /**< SS error indicating Maximum MPTY is reached */ + TAPI_SS_RESOURCESNOTAVAILABLE= 0x7f, /**< SS error indicating resources not available in the network */ + TAPI_SS_REJECTEDBYCALLCONTROL= 0x80, /**< SS error indicating resources not available in the network */ + + TAPI_SS_TIMEREXPIRE, /**< SS operation timer expired on the network */ + TAPI_SS_NET_NOT_ALLOWED_EMERGENCY_CALLS_ONLY, /**< SS operation is not allowed by the network */ + TAPI_SS_UNKNOWNERROR, /**< SS error indicating an unknown error */ + TAPI_SS_OEM_NOT_SUPPORTED /**< If OEM does not support any SS requests, then this error will be returned */ +} TelSsCause_t; + +/** + * @brief Enumeration for the status of a supplementary service feature (e.g. call forwarding or call barring). + * @details These enumerated values should be used as masks. + * @since_tizen 2.3 + */ +typedef enum { + TAPI_SS_STATUS_REGISTERED = 0x01, /**< Provisioned & registered (but not active/active-quiescent */ + TAPI_SS_STATUS_PROVISIONED, /** + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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_COMMON_H_ +#define _TAPI_COMMON_H_ + +/** + * @file tapi_common.h + */ + +/** + * @internal + * @addtogroup CAPI_TELEPHONY_SERVICE + * @{ + */ + +#include +#include + +#include +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @brief Fetches a list of available CPs. + * + * @details Sync (or) Async: Synchronous API. + * + * @since_tizen 2.3 + * + * @return The list of available CPs on SUCCESS, + * otherwise @c NULL on FAILURE + */ +char **tel_get_cp_name_list(void); + +/** + * @brief Acquires a TAPI Handle for the specified CP name. + * + * @details Sync (or) Async: Synchronous API. + * + * @since_tizen 2.3 + * + * @param[in] cp_name The CP Name against which a TAPI handle is required (A NULL CP Name will return a #TapiHandle bound to the first CP in the list of available CPs) + * + * @return #TapiHandle on SUCCESS, + * otherwise @c NULL on FAILURE + * @see tel_deinit() + */ +TapiHandle *tel_init(const char *cp_name); + +/** + * @brief Deinitializes the TAPI Handle. + * @details Sync (or) Async: Synchronous API. + * + * @since_tizen 2.3 + * + * @param[in] handle The #TapiHandle obtained from tel_init() + * + * @return #TapiResult_t + * @see tel_init() + */ +int tel_deinit(TapiHandle *handle); + +/** + * @brief Registers a notification callback for events on the DBus interface. + * + * @details + * Sync (or) Async: Synchronous API. + * + * @since_tizen 2.3 + * @privlevel public + * @privilege %http://tizen.org/privilege/telephony + * + * @param[in] handle The #TapiHandle obtained from tel_init() + * + * @param[in] noti_id The notification ID for which a callback has to be registered + * + * @param[in] callback #tapi_notification_cb - The notification callback that will be invoked on the event + * + * @param user_data The user data + * + * @return #TapiResult_t + */ +int tel_register_noti_event(TapiHandle *handle, const char *noti_id, tapi_notification_cb callback, void *user_data); + +/** + * @brief Deregisters a notification callback for events on the DBus interface. + * + * @details Sync (or) Async: Synchronous API. + * + * @since_tizen 2.3 + * @privlevel public + * @privilege %http://tizen.org/privilege/telephony + * + * @param[in] handle The #TapiHandle obtained from tel_init() + * + * @param[in] noti_id The notification ID for which a callback has to be de-registered + * + * @return #TapiResult_t + */ +int tel_deregister_noti_event(TapiHandle *handle, const char *noti_id); + +/** + * @brief Gets the property value in an integer format for the given property. + * + * @details Sync (or) Async: Synchronous API. + * + * @since_tizen 2.3 + * @privlevel public + * @privilege %http://tizen.org/privilege/telephony + * + * @param[in] handle The #TapiHandle obtained from tel_init() + * + * @param[in] property The property to be retrieved from Dbus + * + * @param[out] result The property value in integer format + * + * @return #TapiResult_t + */ +int tel_get_property_int(TapiHandle *handle, const char *property, int *result); + +/** + * @brief Gets the property value in a string format for the given property. + * + * @details Sync (or) Async: Synchronous API. + * + * @since_tizen 2.3 + * @privlevel public + * @privilege %http://tizen.org/privilege/telephony + * + * @param[in] handle The #TapiHandle obtained from tel_init() + * + * @param[in] property The property to be retrieved from Dbus + * + * @param[out] result The property value in string format + * + * @return #TapiResult_t + */ +int tel_get_property_string(TapiHandle *handle, const char *property, char **result); + +#ifdef __cplusplus +} +#endif + +#endif /* _TAPI_COMMON_H_ */ + +/** + * @} + */ diff --git a/wearable/include/tapi_event.h b/include/tapi_event.h old mode 100755 new mode 100644 similarity index 84% rename from wearable/include/tapi_event.h rename to include/tapi_event.h index 550b1d9..68f9e79 --- a/wearable/include/tapi_event.h +++ b/include/tapi_event.h @@ -1,7 +1,7 @@ /* * libslp-tapi * - * Copyright (c) 2012 Samsung Electronics Co., Ltd. All rights reserved. + * Copyright (c) 2014 Samsung Electronics Co., Ltd. All rights reserved. * * Contact: Ja-young Gu * @@ -25,6 +25,19 @@ __BEGIN_DECLS +/** + * @file tapi_event.h + */ + +/** + * @internal + * @addtogroup CAPI_TELEPHONY_SERVICE + * @{ + */ + +/** + * @brief (Needs to be updated). + */ #define DBUS_TELEPHONY_CALL_INTERFACE DBUS_TELEPHONY_SERVICE".Call" #define TAPI_NOTI_VOICE_CALL_STATUS_IDLE DBUS_TELEPHONY_CALL_INTERFACE":VoiceCallStatusIdle" @@ -64,6 +77,11 @@ __BEGIN_DECLS #define TAPI_NOTI_CALL_INFO_TRANSFER_ALERT DBUS_TELEPHONY_CALL_INTERFACE":TransferAlert" #define TAPI_NOTI_CALL_INFO_TRANSFERED DBUS_TELEPHONY_CALL_INTERFACE":Transfered" #define TAPI_NOTI_CALL_INFO_CF_CHECK_MESSAGE DBUS_TELEPHONY_CALL_INTERFACE":CfCheckMessage" +#define TAPI_NOTI_CALL_INFO_REC DBUS_TELEPHONY_CALL_INTERFACE":CallInfoRec" +#define TAPI_NOTI_CALL_PRIVACY_MODE DBUS_TELEPHONY_CALL_INTERFACE":CallPrivacyMode" +#define TAPI_NOTI_CALL_OTASP_STATUS DBUS_TELEPHONY_CALL_INTERFACE":CallOtaspStatus" +#define TAPI_NOTI_CALL_OTAPA_STATUS DBUS_TELEPHONY_CALL_INTERFACE":CallOtapaStatus" +#define TAPI_NOTI_CALL_SIGNAL_INFO DBUS_TELEPHONY_CALL_INTERFACE":CallSignalInfo" #define TAPI_NOTI_CALL_SOUND_PATH DBUS_TELEPHONY_CALL_INTERFACE":CallSoundPath" #define TAPI_NOTI_CALL_SOUND_RINGBACK_TONE DBUS_TELEPHONY_CALL_INTERFACE":CallSoundRingbackTone" @@ -71,18 +89,18 @@ __BEGIN_DECLS #define TAPI_NOTI_CALL_SOUND_EQUALIZATION DBUS_TELEPHONY_CALL_INTERFACE":CallSoundEqualiztion" #define TAPI_NOTI_CALL_SOUND_NOISE_REDUCTION DBUS_TELEPHONY_CALL_INTERFACE":CallSoundNoiseReduction" #define TAPI_NOTI_CALL_SOUND_CLOCK_STATUS DBUS_TELEPHONY_CALL_INTERFACE":CallSoundClockStatus" +#define TAPI_NOTI_CALL_PREFERRED_VOICE_SUBSCRIPTION DBUS_TELEPHONY_CALL_INTERFACE":CallPreferredVoiceSubscription" #define DBUS_TELEPHONY_MODEM_INTERFACE DBUS_TELEPHONY_SERVICE".Modem" #define TAPI_NOTI_MODEM_POWER DBUS_TELEPHONY_MODEM_INTERFACE":Power" -#define TAPI_NOTI_MODEM_DUN_PIN_CTRL DBUS_TELEPHONY_MODEM_INTERFACE":DunPinCtrl" -#define TAPI_NOTI_MODEM_DUN_EXTERNAL_CALL DBUS_TELEPHONY_MODEM_INTERFACE":DunExternalCall" #define TAPI_PROP_MODEM_POWER DBUS_TELEPHONY_MODEM_INTERFACE":power" // SIM #define DBUS_TELEPHONY_SIM_INTERFACE DBUS_TELEPHONY_SERVICE".Sim" #define TAPI_NOTI_SIM_STATUS DBUS_TELEPHONY_SIM_INTERFACE":Status" #define TAPI_NOTI_SIM_REFRESHED DBUS_TELEPHONY_SIM_INTERFACE":Refreshed" +#define TAPI_PROP_SIM_CALL_FORWARD_STATE DBUS_TELEPHONY_SIM_INTERFACE":cf_state" #define DBUS_TELEPHONY_SAP_INTERFACE DBUS_TELEPHONY_SERVICE".Sap" #define TAPI_NOTI_SAP_STATUS DBUS_TELEPHONY_SAP_INTERFACE":Status" @@ -114,6 +132,9 @@ __BEGIN_DECLS #define TAPI_NOTI_NETWORK_TIMEINFO DBUS_TELEPHONY_NETWORK_INTERFACE":TimeInfo" #define TAPI_NOTI_NETWORK_IDENTITY DBUS_TELEPHONY_NETWORK_INTERFACE":Identity" #define TAPI_NOTI_NETWORK_SIGNALSTRENGTH DBUS_TELEPHONY_NETWORK_INTERFACE":SignalStrength" +#define TAPI_NOTI_NETWORK_EMERGENCY_CALLBACK_MODE DBUS_TELEPHONY_NETWORK_INTERFACE":EmergencyCallbackMode" +#define TAPI_NOTI_NETWORK_DEFAULT_DATA_SUBSCRIPTION DBUS_TELEPHONY_NETWORK_INTERFACE":DefaultDataSubscription" +#define TAPI_NOTI_NETWORK_DEFAULT_SUBSCRIPTION DBUS_TELEPHONY_NETWORK_INTERFACE":DefaultSubscription" #define TAPI_PROP_NETWORK_LAC DBUS_TELEPHONY_NETWORK_INTERFACE":lac" #define TAPI_PROP_NETWORK_PLMN DBUS_TELEPHONY_NETWORK_INTERFACE":plmn" #define TAPI_PROP_NETWORK_CELLID DBUS_TELEPHONY_NETWORK_INTERFACE":cell_id" @@ -131,37 +152,55 @@ __BEGIN_DECLS // SS #define DBUS_TELEPHONY_SS_INTERFACE DBUS_TELEPHONY_SERVICE".Ss" -#define TAPI_NOTI_SS_USSD DBUS_TELEPHONY_SS_INTERFACE":NotifyUSSD" +#define TAPI_NOTI_SS_USSD DBUS_TELEPHONY_SS_INTERFACE":NotifyUSSD" #define TAPI_NOTI_SS_RELEASE_COMPLETE DBUS_TELEPHONY_SS_INTERFACE":ReleaseComplete" #define TAPI_NOTI_SS_FORWARD_STATUS DBUS_TELEPHONY_SS_INTERFACE":NotifyForwarding" #define TAPI_NOTI_SS_BARRING_STATUS DBUS_TELEPHONY_SS_INTERFACE":NotifyBarring" #define TAPI_NOTI_SS_WAITING_STATUS DBUS_TELEPHONY_SS_INTERFACE":NotifyWaiting" #define TAPI_NOTI_SS_INFO DBUS_TELEPHONY_SS_INTERFACE":NotifySsInfo" -// PS -#define TAPI_NOTI_PS_DUN_PIN_CONTROL "org.tizen.telephony.Ps.PinCtrl" - // SMS #define DBUS_TELEPHONY_SMS_INTERFACE DBUS_TELEPHONY_SERVICE".sms" -#define TAPI_NOTI_SMS_INCOM_MSG DBUS_TELEPHONY_SMS_INTERFACE":IncommingMsg" /* This is an unsolicited Incoming SMS Event*/ -#define TAPI_NOTI_SMS_CB_INCOM_MSG DBUS_TELEPHONY_SMS_INTERFACE":IncommingCbMsg" /* This is an unsolicited Incoming cell broadcast message*/ -#define TAPI_NOTI_SMS_ETWS_INCOM_MSG DBUS_TELEPHONY_SMS_INTERFACE":IncommingEtwsMsg" /* This is an unsolicited Incoming cell broadcast message*/ -#if 0 -#define TAPI_NOTI_SMS_INCOM_EX_MSG "org.tizen.telephony. " /* This is an extended unsolicited Incoming SMS Event*/ -#define TAPI_NOTI_SMS_CB_INCOM_EX_MSG "org.tizen.telephony. " /* This is an extended unsolicited Incoming cell broadcast message*/ -#endif -#define TAPI_NOTI_SMS_MEMORY_STATUS DBUS_TELEPHONY_SMS_INTERFACE":MemoryStatus" /* This event is an unsolicited event indicating SIM memory status */ -#define TAPI_NOTI_SMS_DEVICE_READY DBUS_TELEPHONY_SMS_INTERFACE":SmsReady" /* Device Ready indication */ + +/** + * @brief Definition for the unsolicited incoming SMS Event. + */ +#define TAPI_NOTI_SMS_INCOM_MSG DBUS_TELEPHONY_SMS_INTERFACE":IncommingMsg" + +/** + * @brief Definition for the unsolicited incoming cell broadcast message. + */ +#define TAPI_NOTI_SMS_CB_INCOM_MSG DBUS_TELEPHONY_SMS_INTERFACE":IncommingCbMsg" + +/** + * @brief Definition for the unsolicited incoming cell broadcast message. + */ +#define TAPI_NOTI_SMS_ETWS_INCOM_MSG DBUS_TELEPHONY_SMS_INTERFACE":IncommingEtwsMsg" + +/** + * @brief Definition for the unsolicited event indicating SIM memory status. + */ +#define TAPI_NOTI_SMS_MEMORY_STATUS DBUS_TELEPHONY_SMS_INTERFACE":MemoryStatus" + +/** + * @brief Definition for the device ready indication. + */ +#define TAPI_NOTI_SMS_DEVICE_READY DBUS_TELEPHONY_SMS_INTERFACE":SmsReady" // Gps #define DBUS_TELEPHONY_GPS_INTERFACE DBUS_TELEPHONY_SERVICE".Gps" #define TAPI_NOTI_GPS_ASSIST_DATA DBUS_TELEPHONY_GPS_INTERFACE":AssistData" -#define TAPI_IND_GPS_MEASURE_POSITION DBUS_TELEPHONY_GPS_INTERFACE":MeasurePosition" #define TAPI_NOTI_GPS_RESET_ASSIST_DATA DBUS_TELEPHONY_GPS_INTERFACE":ResetAssistData" -#define TAPI_NOTI_GPS_FREQUENCY_AIDING DBUS_TELEPHONY_GPS_INTERFACE":FrequencyAiding" #define TAPI_NOTI_SMART_ASSISTANT_AREA_STATUS DBUS_TELEPHONY_GPS_INTERFACE":AreaStatus" #define TAPI_NOTI_SMART_ASSISTANT_SYNC_STATUS DBUS_TELEPHONY_GPS_INTERFACE":SyncStatus" +#define DBUS_TELEPHONY_OEM_INTERFACE DBUS_TELEPHONY_SERVICE".OEM" +#define TAPI_NOTI_OEM_DATA DBUS_TELEPHONY_OEM_INTERFACE":OemData" + +/** + * @} + */ + __END_DECLS #endif /* __TAPI_EVENT_H__ */ diff --git a/wearable/include/tapi_type.h b/include/tapi_type.h similarity index 57% rename from wearable/include/tapi_type.h rename to include/tapi_type.h index c8ff1c1..7983e44 100644 --- a/wearable/include/tapi_type.h +++ b/include/tapi_type.h @@ -1,7 +1,7 @@ /* * libslp-tapi * - * Copyright (c) 2012 Samsung Electronics Co., Ltd. All rights reserved. + * Copyright (c) 2014 Samsung Electronics Co., Ltd. All rights reserved. * * Contact: Ja-young Gu * @@ -22,43 +22,49 @@ #define __TAPI_TYPE_H__ /** -* @addtogroup TAPI_COMMON -* @{ -* -* @file tapi_type.h -* @brief TAPI type -*/ + * @file tapi_type.h + */ + +/** + * @internal + * @addtogroup CAPI_TELEPHONY_SERVICE + * @{ + */ #ifdef __cplusplus extern "C" { #endif -/** Telephony service name */ +/** + * @brief Definition for the telephony service name. + */ #define DBUS_TELEPHONY_SERVICE "org.tizen.telephony" -/** Telephony object path */ +/** + * @brief Definition for the telephony object path. + */ #define DBUS_TELEPHONY_DEFAULT_PATH "/org/tizen/telephony" /** - * TAPI Handle + * @brief The structure type containing the TAPI handle. */ typedef struct tapi_handle TapiHandle; /** - * TAPI Notification Callback Type - * @param handle #TapiHandle obtained from tel_init() - * @param noti_id Notification ID for which this callback has to be invoked - * @param data Notification Data - * @param user_data User Data + * @brief Called for the TAPI notification. + * @param[in] handle The #TapiHandle obtained from tel_init() + * @param[in] noti_id The notification ID for a callback has to be invoked + * @param[in] data The notification data + * @param[in] user_data The user data */ typedef void (*tapi_notification_cb)(TapiHandle *handle, const char *noti_id, void *data, void *user_data); /** - * TAPI Response Callback Type - * @param handle #TapiHandle obtained from tel_init() - * @param result Result of operation - * @param data Response Data from operation - * @param user_data User Data + * @brief Called for the TAPI response. + * @param[in] handle The #TapiHandle obtained from tel_init() + * @param[in] result The result of the operation + * @param[in] data The response data from the operation + * @param[in] user_data The user data */ typedef void (*tapi_response_cb)(TapiHandle *handle, int result, void *data, void *user_data); @@ -66,6 +72,8 @@ typedef void (*tapi_response_cb)(TapiHandle *handle, int result, void *data, voi } #endif -/** @}*/ +/** + * @} + */ #endif /* __TAPI_TYPE_H__ */ diff --git a/libslp-tapi.manifest b/libslp-tapi.manifest new file mode 100644 index 0000000..be0fa76 --- /dev/null +++ b/libslp-tapi.manifest @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/mobile/AUTHORS b/mobile/AUTHORS deleted file mode 100644 index b9eed62..0000000 --- a/mobile/AUTHORS +++ /dev/null @@ -1,5 +0,0 @@ -Jongman Park -Danny Jeongseok Seo -Kyeongchul Kim -Youngman Park -Inho Oh diff --git a/mobile/CMakeLists.txt b/mobile/CMakeLists.txt deleted file mode 100644 index 9d25414..0000000 --- a/mobile/CMakeLists.txt +++ /dev/null @@ -1,58 +0,0 @@ -CMAKE_MINIMUM_REQUIRED(VERSION 2.6) -PROJECT(SLP-tapi C) - -SET(PREFIX ${CMAKE_INSTALL_PREFIX}) -SET(EXEC_PREFIX "\${prefix}") -SET(LIBDIR "\${prefix}/lib") -SET(INCLUDEDIR "\${prefix}/include") - -# Set required packages -INCLUDE(FindPkgConfig) -pkg_check_modules(pkgs REQUIRED glib-2.0 gio-2.0 gthread-2.0 dlog security-server) - -FOREACH(flag ${pkgs_CFLAGS}) - SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}") -ENDFOREACH(flag) - -SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} -Wl,-zdefs -fvisibility=hidden ") -SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS} -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wmissing-declarations -Wredundant-decls -Wcast-align") -#SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS}") -SET(CMAKE_EXE_LINKER_FLAGS "-Wl,--as-needed") - -INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include ${CMAKE_SOURCE_DIR}/src) - -ADD_DEFINITIONS("-DFEATURE_DLOG_DEBUG") -ADD_DEFINITIONS("-DTAPI_LOG_TAG=\"TAPI\"") -ADD_DEFINITIONS("-DPREFIX=\"${CMAKE_INSTALL_PREFIX}\"") -ADD_DEFINITIONS(" -DEXPORT_API=\"__attribute__((visibility(\\\"default\\\")))\" ") - -MESSAGE(${CMAKE_C_FLAGS}) -MESSAGE(${CMAKE_EXE_LINKER_FLAGS}) - -### Build ### -SET(SRCS - src/tapi_common.c - src/tapi_network.c - src/tapi_sim.c - src/tapi_phonebook.c - src/tapi_sap.c - src/tapi_call.c - src/tapi_ss.c - src/tapi_sms.c - src/tapi_sat.c - src/tapi_modem.c - src/tapi_gps.c - ) - -ADD_LIBRARY(SLP-tapi SHARED ${SRCS}) -TARGET_LINK_LIBRARIES(SLP-tapi ${pkgs_LDFLAGS}) -SET_TARGET_PROPERTIES(SLP-tapi PROPERTIES VERSION 0.0.0 SOVERSION 0 OUTPUT_NAME SLP-tapi) - -# pkgconfig file -SET(PREFIX ${CMAKE_INSTALL_PREFIX}) -CONFIGURE_FILE(tapi.pc.in tapi.pc @ONLY) - -INSTALL(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/include/ DESTINATION include/telephony-client) -INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/tapi.pc DESTINATION ${LIB_INSTALL_DIR}/pkgconfig) -INSTALL(TARGETS SLP-tapi DESTINATION ${LIB_INSTALL_DIR} COMPONENT Runtime) -INSTALL(FILES ${CMAKE_SOURCE_DIR}/LICENSE DESTINATION /usr/share/license RENAME libslp-tapi) diff --git a/mobile/LICENSE b/mobile/LICENSE deleted file mode 100644 index 9c13a9b..0000000 --- a/mobile/LICENSE +++ /dev/null @@ -1,204 +0,0 @@ -Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved. - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - diff --git a/mobile/debian/changelog b/mobile/debian/changelog deleted file mode 100644 index 4a51001..0000000 --- a/mobile/debian/changelog +++ /dev/null @@ -1,1812 +0,0 @@ -libslp-tapi (0.5.89) unstable; urgency=low - - * Sync Version with OBS - * Git: slp/pkgs/l/libslp-tapi - * Tag: libslp-tapi_0.5.89 - - -- Youngman Park Fri, 25 May 2012 14:40:21 +0900 - -libslp-tapi (0.5.88) unstable; urgency=low - - * Sync Header File with Public GIT - * Git: slp/pkgs/l/libslp-tapi - * Tag: libslp-tapi_0.5.88 - - -- Youngman Park Thu, 24 May 2012 22:30:21 +0900 - -libslp-tapi (0.5.87) unstable; urgency=low - - * add new feature for call, factory & phonebook select function - * Git: slp/pkgs/l/libslp-tapi - * Tag: libslp-tapi_0.5.87 - - -- Youngman Park Mon, 21 May 2012 17:50:21 +0900 - -libslp-tapi (0.5.86) unstable; urgency=low - - * add sim api - get lock info and update phonebook data - * Git: slp/pkgs/l/libslp-tapi - * Tag: libslp-tapi_0.5.86 - - -- Kyeongchul Kim Thu, 17 May 2012 17:32:21 +0900 - -libslp-tapi (0.5.86) unstable; urgency=low - - * add sim api - get lock info and update phonebook data - * Git: slp/pkgs/l/libslp-tapi - * Tag: libslp-tapi_0.5.86 - - -- Kyeongchul Kim Thu, 17 May 2012 17:32:21 +0900 - -libslp-tapi (0.5.85) unstable; urgency=low - - * glib include into Sound Header to use gboolean type - * Git: slp/pkgs/l/libslp-tapi - * Tag: libslp-tapi_0.5.85 - - -- Youngman Park Tue, 08 May 2012 14:20:33 +0900 - -libslp-tapi (0.5.84) unstable; urgency=low - - * Add Call New API ( call custom service ) - * Git: slp/pkgs/l/libslp-tapi - * Tag: libslp-tapi_0.5.84 - - -- Youngman Park Mon, 07 May 2012 16:05:33 +0900 - -libslp-tapi (0.5.83) unstable; urgency=low - - * Fix dbus bug - * Git: slp/pkgs/l/libslp-tapi - * Tag: libslp-tapi_0.5.83 - - -- DongHoo Park Tue, 10 Apr 2012 15:13:33 +0900 - -libslp-tapi (0.5.82) unstable; urgency=low - - * version up for code sync with public binary - * Git: slp/pkgs/l/libslp-tapi - * Tag: libslp-tapi_0.5.82 - - -- Kyeongchul Kim Mon, 02 Apr 2012 12:00:29 +0900 - -libslp-tapi (0.5.81) unstable; urgency=low - - * add defence code in case of api return error - * Git: slp/pkgs/l/libslp-tapi - * Tag: libslp-tapi_0.5.81 - - -- Kyeongchul Kim Wed, 21 Mar 2012 21:52:04 +0900 - -libslp-tapi (0.5.80) unstable; urgency=low - - * Update phonebook record struct - * Git: slp/pkgs/l/libslp-tapi - * Tag: libslp-tapi_0.5.80 - - -- Kyeongchul Kim Mon, 19 Mar 2012 22:54:30 +0900 - -libslp-tapi (0.5.79) unstable; urgency=low - - * disable SAT functionality temporary - * Git: slp/pkgs/l/libslp-tapi - * Tag: libslp-tapi_0.5.79 - - -- Kyeongchul Kim Mon, 19 Mar 2012 14:52:45 +0900 - -libslp-tapi (0.5.78) unstable; urgency=low - - * code clean up - * Git: slp/pkgs/l/libslp-tapi - * Tag: libslp-tapi_0.5.78 - - -- Kyeongchul Kim Thu, 16 Feb 2012 21:00:36 +0900 - -libslp-tapi (0.5.77) unstable; urgency=low - - * SIM auth API and Doxygen comments are updated - * Git: slp/pkgs/l/libslp-tapi - * Tag: libslp-tapi_0.5.77 - - -- Kyeongchul Kim Wed, 01 Feb 2012 16:51:05 +0900 - -libslp-tapi (0.5.76) unstable; urgency=low - - * Factory Omission Avoidance Bug Fix ( Confirm Message Broadcasting Problem ) - * Git: slp/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: slp/pkgs/l/libslp-tapi - * Tag: libslp-tapi_0.5.75 - - -- Kyeongchul Kim Wed, 07 Dec 2011 20:19:47 +0900 - -libslp-tapi (0.5.74) unstable; urgency=low - - * Modify Code for Factory Sound Loopback - * Git: slp/pkgs/l/libslp-tapi - * Tag: libslp-tapi_0.5.74 - - -- Youngman Park Wed, 23 Nov 2011 19:41:55 +0900 - -libslp-tapi (0.5.73) unstable; urgency=low - - * remove duplicated api with capi - * Git: slp/pkgs/l/libslp-tapi - * Tag: libslp-tapi_0.5.73 - - -- Kyeongchul Kim Tue, 08 Nov 2011 21:12:55 +0900 - -libslp-tapi (0.5.72) unstable; urgency=low - - * add sync APIs to get vconf values(network, sim) - * Git: slp/pkgs/l/libslp-tapi - * Tag: libslp-tapi_0.5.72 - - -- Kyeongchul Kim Tue, 08 Nov 2011 09:40:55 +0900 - -libslp-tapi (0.5.71) unstable; urgency=low - - * add emergency mode feature(MDM requirement) - * Git: slp/pkgs/l/libslp-tapi - * Tag: libslp-tapi_0.5.71 - - -- Kyeongchul Kim Fri, 04 Nov 2011 16:56:43 +0900 - -libslp-tapi (0.5.70) unstable; urgency=low - - * clean up TC code - * Git: slp/pkgs/l/libslp-tapi - * Tag: libslp-tapi_0.5.70 - - -- Kyeongchul Kim Thu, 06 Oct 2011 18:02:49 +0900 - -libslp-tapi (0.5.69) unstable; urgency=low - - * Merged with tapi-priv - * Git: slp/pkgs/l/libslp-tapi - * Tag: libslp-tapi_0.5.69 - - -- Inho Oh Thu, 29 Sep 2011 14:53:38 +0900 - -libslp-tapi (0.5.68) unstable; urgency=low - - * Added msisdn api, extended language enum, fixed TC issue. - * Git: slp/pkgs/l/libslp-tapi - * Tag: libslp-tapi_0.5.68 - - -- Kyeongchul Kim Wed, 21 Sep 2011 13:52:47 +0900 - -libslp-tapi (0.5.67) unstable; urgency=low - - * Removed unused API and added new APIs(cf,mw,cphs) - * Git: slp/pkgs/l/libslp-tapi - * Tag: libslp-tapi_0.5.67 - - -- Kyeongchul Kim Wed, 31 Aug 2011 16:09:35 +0900 - -libslp-tapi (0.5.66) unstable; urgency=low - - * Fixed boilerplate, AUTHORS and COPYING. SAT-setup menu seq change - * Git: slp/pkgs/l/libslp-tapi - * Tag: libslp-tapi_0.5.66 - - -- Kyeongchul Kim Sat, 23 Jul 2011 13:34:56 +0900 - -libslp-tapi (0.5.65) unstable; urgency=low - - * Add feature for getting ICCID and prevent bug fix - * Git: slp/pkgs/l/libslp-tapi - * Tag: libslp-tapi_0.5.65 - - -- Kyeongchul Kim Thu, 26 May 2011 20:22:27 +0900 - -libslp-tapi (0.5.64) unstable; urgency=low - - * Factory code is added & SS CQ is fixed - * Git: slp/pkgs/l/libslp-tapi - * Tag: libslp-tapi_0.5.64 - - -- Youngman Park Wed, 16 Mar 2011 10:53:49 +0900 - -libslp-tapi (0.5.63) unstable; urgency=low - - * Fixed prevent bugs - * Git: slp/pkgs/l/libslp-tapi - * Tag: libslp-tapi_0.5.63 - - -- Inho Oh Thu, 17 Feb 2011 13:53:49 +0900 - -libslp-tapi (0.5.62) unstable; urgency=low - - * TC code clean - * Git: slp/pkgs/l/libslp-tapi - * Tag: libslp-tapi_0.5.62 - - -- Youngman Park Wen, 9 Feb 2011 20:50:12 +0900 - -libslp-tapi (0.5.61) unstable; urgency=low - - * fix TC & add SAT event - * Git: slp/pkgs/l/libslp-tapi - * Tag: libslp-tapi_0.5.61 - - -- Kyeongchul Kim Mon, 31 Jan 2011 20:57:12 +0900 - -libslp-tapi (0.5.60) unstable; urgency=low - - * The parameter in S.S ussd tapi is changed. - * Git: slp/pkgs/l/libslp-tapi - * Tag: libslp-tapi_0.5.60 - - -- Youngman Park Fri, 14 Jan 2011 21:18:21 +0900 - -libslp-tapi (0.5.59) unstable; urgency=low - - * Dbus output param sync with telephony server - * Git: slp/pkgs/l/libslp-tapi - * Tag: libslp-tapi_0.5.59 - - -- Kyeongchul Kim Mon, 10 Jan 2011 21:03:21 +0900 - -libslp-tapi (0.5.58) unstable; urgency=low - - * Added security cookie feature - * Git: slp/pkgs/l/libslp-tapi - * Tag: libslp-tapi_0.5.58 - - -- Inho Oh Thu, 06 Jan 2011 12:31:04 +0900 - -libslp-tapi (0.5.57) unstable; urgency=low - - * Add SIM, ME SMS memory full enum - * Git: slp/pkgs/l/libslp-tapi - * Tag: libslp-tapi_0.5.57 - - -- Sunghyuk Lee Mon, 06 Dec 2010 15:02:03 +0900 - -libslp-tapi (0.5.56) unstable; urgency=low - - * Fix the wrong event data length bug - * Git: slp/pkgs/libslp-tapi - * Tag: libslp-tapi_0.5.56 - - -- Sunghyuk Lee Wed, 24 Nov 2010 18:42:10 +0900 - -libslp-tapi (0.5.55) unstable; urgency=low - - * package name is changed com.samsung... -> deb.com.samsung... - * Git: slp/pkgs/libslp-tapi - * Tag: libslp-tapi_0.5.55 - - -- Youngman Park Mon, 22 Nov 2010 16:31:28 +0900 - -libslp-tapi (0.5.54) unstable; urgency=low - - * Add TAPI_EVENT_SS_USSD_RSP_CNF and re-define TAPI_CS_SS_USSDRSP - * Git: slp/pkgs/libslp-tapi - * Tag: libslp-tapi_0.5.54 - - -- Sunghyuk Leee Fri, 12 Nov 2010 18:28:28 +0900 - -libslp-tapi (0.5.53) unstable; urgency=low - - * add image file - * Git: slp/pkgs/libslp-tapi - * Tag: libslp-tapi_0.5.53 - - -- Kyeongchul Kim Mon, 08 Nov 2010 14:32:31 +0900 - -libslp-tapi (0.5.52) unstable; urgency=low - - * add la file - * Git: slp/pkgs/libslp-tapi - * Tag: libslp-tapi_0.5.52 - - -- Kyeongchul Kim Wed, 03 Nov 2010 19:16:31 +0900 - -libslp-tapi (0.5.51) unstable; urgency=low - - * version update - * Git: slp/pkgs/libslp-tapi - * Tag: libslp-tapi_0.5.51 - - -- Youngman Park Tue, 02 Nov 2010 20:00:35 +0900 - -libslp-tapi (0.5.50) unstable; urgency=low - - * Removed libSLP-tapi.la - * Git: slp/pkgs/libslp-tapi - * Tag: libslp-tapi_0.5.50 - - -- Inho Oh Tue, 02 Nov 2010 15:30:35 +0900 - -libslp-tapi (0.5.49) unstable; urgency=low - - * separated source repository - * Git: slp/pkgs/libslp-tapi - * Tag: libslp-tapi_0.5.49 - - -- Inho Oh Tue, 2 Nov 2010 11:09:15 +0900 - -telephony-fwk (0.5.48) unstable; urgency=low - - * Update PG and sim,gprs code - * Git: slp/pkgs/telephony-fwk - * Tag: telephony-fwk_0.5.48 - - -- Kyeongchul Kim Sun, 31 Oct 2010 16:50:12 +0900 - -telephony-fwk (0.5.47) unstable; urgency=low - - * GPS TIS work - * Git: slp/pkgs/telephony-fwk - * Tag: telephony-fwk_0.5.47 - - -- Youngman Park Tue, 19 Oct 2010 19:43:44 +0900 - -telephony-fwk (0.5.46) unstable; urgency=low - - * Launch voicecall ui with AUL upon SAT SETUP CALL IND - * Git: slp/pkgs/telephony-fwk - * Tag: telephony-fwk_0.5.46 - - -- Sunghyuk Lee Mon, 18 Oct 2010 20:54:44 +0900 - -telephony-fwk (0.5.45) unstable; urgency=low - - * Fixed GPRS requestid mismatch problem - * Removed wrong binary file (TC file) - * Git: slp/pkgs/telephony-fwk - * Tag: telephony-fwk_0.5.45 - - -- Inho Oh Mon, 18 Oct 2010 20:03:18 +0900 - -telephony-fwk (0.5.44) unstable; urgency=low - - * Telephony SAT sends the SAT USSD message by itself - * Git: slp/pkgs/telephony-fwk - * Tag: telephony-fwk_0.5.44 - - -- Sunghyuk Lee Mon, 18 Oct 2010 18:28:17 +0900 - -telephony-fwk (0.5.43) unstable; urgency=low - - * wrong code is fixed in debian/rules - * Git: slp/pkgs/telephony-fwk - * Tag: telephony-fwk_0.5.43 - - -- Youngman Park Tue, 12 Oct 2010 20:10:33 +0900 - -telephony-fwk (0.5.42) unstable; urgency=low - - * debian/rule script is changed for hib - * Git: slp/pkgs/telephony-fwk - * Tag: telephony-fwk_0.5.42 - - -- Youngman Park Tue, 12 Oct 2010 19:43:33 +0900 - -telephony-fwk (0.5.41) unstable; urgency=low - - * Add Device Node for DFT Rev0.9 - * Git: slp/pkgs/telephony-fwk - * Tag: telephony-fwk_0.5.41 - - -- Youngman Park Tue, 12 Oct 2010 11:10:33 +0900 - -telephony-fwk (0.5.40) unstable; urgency=low - - * HIB path is changed - * Git: slp/pkgs/telephony-fwk - * Tag: telephony-fwk_0.5.40 - - -- Youngman Park Mon, 11 Oct 2010 13:33:33 +0900 - -telephony-fwk (0.5.39) unstable; urgency=low - - * Do not launch CISS upon SAT event - * Git: slp/pkgs/telephony-fwk - * Tag: telephony-fwk_0.5.39 - - -- Sunghyuk Lee Mon, 11 Oct 2010 10:33:33 +0900 - -telephony-fwk (0.5.38) unstable; urgency=low - - * Add nvdata file create code - * Git: slp/pkgs/telephony-fwk - * Tag: telephony-fwk_0.5.38 - - -- Youngman Park Fri, 01 Oct 2010 21:58:01 +0900 - -telephony-fwk (0.5.37) unstable; urgency=low - - * Inform flightmode state to kernel - * Git: slp/pkgs/telephony-fwk - * Tag: telephony-fwk_0.5.37 - - -- Sunghyuk Lee Fri, 01 Oct 2010 21:07:40 +0900 - -telephony-fwk (0.5.36) unstable; urgency=low - - * telephony PG is added - * Git: slp/pkgs/telephony-fwk - * Tag: telephony-fwk_0.5.36 - - -- Youngman Park Fri, 01 Oct 2010 19:40:01 +0900 - -telephony-fwk (0.5.35) unstable; urgency=low - - * Add code to creat NV Data file (oem_init) - * Git: slp/pkgs/telephony-fwk - * Tag: telephony-fwk_0.5.35 - - -- Youngman Park Fri, 01 Oct 2010 14:56:01 +0900 - -telephony-fwk (0.5.34) unstable; urgency=low - - * Stop launching CISS-MMI upon USSD CNF - * Remove binary files which were gernerated by TET-WARE - * Git: slp/pkgs/telephony-fwk - * Tag: telephony-fwk_0.5.34 - - -- Sunghyuk Lee Fri, 01 Oct 2010 14:20:01 +0900 - -telephony-fwk (0.5.33) unstable; urgency=low - - * Change a dependat svn package name - * Git: slp/pkgs/telephony-fwk - * Tag: telephony-fwk_0.5.33 - - -- Sunghyuk Lee Thu, 30 Sep 2010 19:16:19 +0900 - -telephony-fwk (0.5.32) unstable; urgency=low - - * Modify the Misc IPC header file - * Git: slp/pkgs/telephony-fwk - * Tag: telephony-fwk_0.5.32 - - -- Sunghyuk Lee Mon, 27 Sep 2010 15:53:15 +0900 - -telephony-fwk (0.5.31) unstable; urgency=low - - * Remove GPL licensed codes - * Git: slp/pkgs/telephony-fwk - * Tag: telephony-fwk_0.5.31 - - -- Sunghyuk Lee Mon, 27 Sep 2010 10:09:37 +0900 - -telephony-fwk (0.5.30) unstable; urgency=low - - * Add tet_scen and tslist.txt for SE team - * Git: slp/pkgs/telephony-fwk - * Tag: telephony-fwk_0.5.30 - - -- Sunghyuk Lee Mon, 27 Sep 2010 09:54:42 +0900 - -telephony-fwk (0.5.29) unstable; urgency=low - - * Update the telephony test cases - * Fix some tapi proxy errors - * Git: slp/pkgs/telephony-fwk - * Tag: telephony-fwk_0.5.29 - - -- Sunghyuk Lee Mon, 20 Sep 2010 18:38:11 +0900 - -telephony-fwk (0.5.28) unstable; urgency=low - - * Add Uploader - * Git: slp/pkgs/telephony-fwk - * Tag: telephony-fwk_0.5.28 - - -- Youngman Park Fri, 17 Sep 2010 11:38:12 +0900 - -telephony-fwk (0.5.27) unstable; urgency=low - - * Modify Time value for Power OFF ( 30Sec -> 10Sec) - * Git: slp/pkgs/telephony-fwk - * Tag: telephony-fwk_0.5.27 - - -- Youngman Park Thu, 16 Sep 2010 21:52:42 +0900 - -telephony-fwk (0.5.26) unstable; urgency=low - - * Fix the SIM Tapi returning value garray index mismatch - * Git: slp/pkgs/telephony-fwk - * Tag: telephony-fwk_0.5.26 - - -- Sunghyuk Lee Thu, 16 Sep 2010 13:16:12 +0900 - -telephony-fwk (0.5.25) unstable; urgency=low - - * Add AUL interface for incoming call event - * Git: slp/pkgs/telephony-fwk - * Tag: telephony-fwk_0.5.25 - - -- Sunghyuk Lee Wed, 15 Sep 2010 09:14:27 +0900 - -telephony-fwk (0.5.24) unstable; urgency=low - - * Make the test apps compilable and upload test cases - * Git: slp/pkgs/telephony-fwk - * Tag: telephony-fwk_0.5.24 - - -- Sunghyuk Mon, 13 Sep 2010 15:16:36 +0900 - -telephony-fwk (0.5.23) unstable; urgency=low - - * repackaging for EFL upgrade - * Git: slp/pkgs/telephony-fwk - * Tag: telephony-fwk_0.5.23 - - -- Hyeongbae Park Fri, 10 Sep 2010 21:58:32 +0900 - -telephony-fwk (0.5.22) unstable; urgency=low - - * Fix the pdp deactivating signal - * Git: slp/pkgs/telephony-fwk - * Tag: telephony-fwk_0.5.22 - - -- Sunghyuk Lee Thu, 09 Sep 2010 22:34:32 +0900 - -telephony-fwk (0.5.21) unstable; urgency=low - - * Deny the pdp request if the dpd status is wrong - * Git: slp/pkgs/telephony-fwk - * Tag: telephony-fwk_0.5.21 - - -- Sunghyuk Lee Thu, 09 Sep 2010 15:05:01 +0900 - -telephony-fwk (0.5.20) unstable; urgency=low - - * Fix typo of pdp deactivating path - * Git: slp/pkgs/telephony-fwk - * Tag: telephony-fwk_0.5.20 - - -- Sunghyuk Lee Thu, 09 Sep 2010 13:47:12 +0900 - -telephony-fwk (0.5.19) unstable; urgency=low - - * remove system power off command - * Git: slp/pkgs/telephony-fwk - * Tag: telephony-fwk_0.5.19 - - -- Hyeongbae Park Wed, 08 Sep 2010 14:12:43 +0900 - -telephony-fwk (0.5.18) unstable; urgency=low - - * bug fix - * Git: slp/pkgs/telephony-fwk - * Tag: telephony-fwk_0.5.18 - - -- Hyeongbae Park Mon, 06 Sep 2010 10:59:43 +0900 - -telephony-fwk (0.5.17) unstable; urgency=low - - * add Tunnel API and fix bug in gprs suspend/resume - * Git: slp/pkgs/telephony-fwk - * Tag: telephony-fwk_0.5.17 - - -- Hyeongbae Park Fri, 03 Sep 2010 21:24:43 +0900 - -telephony-fwk (0.5.16) unstable; urgency=low - - * Exclude TelUtility_ext.h from dev installation - * Git: slp/pkgs/telephony-fwk - * Tag: telephony-fwk_0.5.16 - - -- Sunghyuk Lee Fri, 03 Sep 2010 09:52:43 +0900 - -telephony-fwk (0.5.15) unstable; urgency=low - - * Rename the SAT server function - * Git: slp/pkgs/telephony-fwk - * Tag: telephony-fwk_0.5.15 - - -- Sunghyuk Lee Wed, 01 Sep 2010 16:31:00 +0900 - -telephony-fwk (0.5.14) unstable; urgency=low - - * Revise TapiCommon.h doxygen comments - * Git: slp/pkgs/telephony-fwk - * Tag: telephony-fwk_0.5.14 - - -- Sunghyuk Lee Tue, 31 Aug 2010 10:56:26 +0900 - -telephony-fwk (0.5.13) unstable; urgency=low - - * Revise TAPI doxygen - * Git: slp/pkgs/telephony-fwk - * Tag: telephony-fwk_0.5.13 - - -- Sunghyuk Lee Mon, 30 Aug 2010 21:27:03 +0900 - -telephony-fwk (0.5.12) unstable; urgency=low - - * Fix dlog string error in oem_init - * Git: slp/pkgs/telephony-fwk - * Tag: telephony-fwk_0.5.12 - - -- Sunghyuk Lee Fri, 27 Aug 2010 17:41:04 +0900 - -telephony-fwk (0.5.11) unstable; urgency=low - - * Kernel boots the CP instead of Telephony Server - * Git: slp/pkgs/telephony-fwk - * Tag: telephony-fwk_0.5.11 - - -- Sunghyuk Lee Thu, 26 Aug 2010 13:01:12 +0900 - -telephony-fwk (0.5.10) unstable; urgency=low - - * Add images and PG doxygen - * Git: slp/pkgs/telephony-fwk - * Tag: telephony-fwk_0.5.10 - - -- Hyeongbae Park Thu, 26 Aug 2010 11:10:28 +0900 - -telephony-fwk (0.5.9) unstable; urgency=low - - * add sleep during modem bootin - * Git: slp/pkgs/telephony-fwk - * Tag: telephony-fwk_0.5.9 - - -- Hyeongbae Park Wed, 25 Aug 2010 11:58:10 +0900 - -elephony-fwk (0.5.8) unstable; urgency=low - - * Change the swap confirmation to fix timeout issue at call swap - * Git: slp/pkgs/telephony-fwk - * Tag: telephony-fwk_0.5.8 - - -- Sunghyuk Lee Tue, 24 Aug 2010 19:35:10 +0900 - -telephony-fwk (0.5.7) unstable; urgency=low - - * Publish SAT event with Dbus - * Git: slp/pkgs/telephony-fwk - * Tag: telephony-fwk_0.5.7 - - -- Sunghyuk Lee Fri, 20 Aug 2010 21:58:36 +0900 - -telephony-fwk (0.5.6) unstable; urgency=low - - * Fix CiSS AUL key string - * Git: slp/pkgs/telephony-fwk - * Tag: telephony-fwk_0.5.6 - - -- Sunghyuk Lee Fri, 20 Aug 2010 14:47:21 +0900 - -telephony-fwk (0.5.5) unstable; urgency=low - - * Fix timing issue with nitz_updater on booting time - * Git: slp/pkgs/telephony-fwk - * Tag: telephony-fwk_0.5.5 - - -- Sunghyuk Lee Wed, 18 Aug 2010 17:13:09 +0900 - -telephony-fwk (0.5.4) unstable; urgency=low - - * Fix a bug regarding response upon SAT envelope commands - * Git: slp/pkgs/telephony-fwk - * Tag: telephony-fwk_0.5.4 - - -- Sunghyuk Lee Fri, 13 Aug 2010 22:26:59 +0900 - -telephony-fwk (0.5.3) unstable; urgency=low - - * Fix the memory corruption issue at OEM request list operation - * Git: slp/pkgs/telephony-fwk - * Tag: telephony-fwk_0.5.3 - - -- Sunghyuk Lee Wed, 11 Aug 2010 10:52:02 +0900 - -telephony-fwk (0.5.2) unstable; urgency=low - - * Disable event downloading feature temporarily - * Git: slp/pkgs/telephony-fwk - * Tag: telephony-fwk_0.5.2 - - -- Sunghyuk Lee Mon, 09 Aug 2010 11:06:44 +0900 - -telephony-fwk (0.5.1) unstable; urgency=low - - * Log to dlog - * Git: slp/pkgs/telephony-fwk - * Tag: telephony-fwk_0.5.1 - - -- Sunghyuk Lee Mon, 09 Aug 2010 09:16:57 +0900 - -telephony-fwk (0.5.0) unstable; urgency=low - - * Apply phonet socket interface - * Change OEM callback scheme - * Imporve GPRS OEM interface - * Git: slp/pkgs/telephony-fwk - * Tag: telephony-fwk_0.5.0 - - -- Sunghyuk Lee Fri, 06 Aug 2010 17:04:27 +0900 - -telephony-fwk (0.4.22) unstable; urgency=low - - * Disable the modem boot option - * Git: slp/pkgs/telephony-fwk - * Tag: telephony-fwk_0.4.22 - - -- Sunghyuk Lee Fri, 06 Aug 2010 09:27:34 +0900 - -telephony-fwk (0.4.21) unstable; urgency=low - - * Config git user setting - * Git: slp/pkgs/telephony-fwk - * Tag: telephony-fwk_0.4.21 - - -- Sunghyuk Lee Thu, 05 Aug 2010 21:09:25 +0900 - -telephony-fwk (0.4.20) unstable; urgency=low - - * Apply new AUL api - * Git: slp/pkgs/telephony-fwk - * Tag: telephony-fwk_0.4.20 - - -- Sunghyuk Lee Thu, 05 Aug 2010 20:01:08 +0900 - -telephony-fwk (0.4.19) unstable; urgency=low - - * bug fix in factory - * Git: slp/pkgs/telephony-fwk - * Tag: telephony-fwk_0.4.19 - - -- Hyeongbae Park Thu, 29 Jul 2010 16:51:04 +0900 - -telephony-fwk (0.4.18) unstable; urgency=low - - * Add g_type_init - * Git: slp/pkgs/telephony-fwk - * Tag: telephony-fwk_0.4.18 - - -- Hyeongbae Park Wed, 28 Jul 2010 20:33:04 +0900 - -telephony-fwk (0.4.17) unstable; urgency=low - - * Move the TelPower.h and TelDisplay.h to internal common header folder - * Git: slp/pkgs/telephony-fwk - * Tag: telephony-fwk_0.4.17 - - -- Sunghyuk Lee Wed, 21 Jul 2010 13:47:04 +0900 - -telephony-fwk (0.4.16) unstable; urgency=low - - * Modify doxygen tag of misc, event_internal - * Git: slp/pkgs/telephony-fwk - * Tag: telephony-fwk_0.4.16 - - -- Sunghyuk Lee Tue, 20 Jul 2010 19:16:15 +0900 - -telephony-fwk (0.4.15) unstable; urgency=low - - * Modify doxygen tag of display, power headers - * Git: slp/pkgs/telephony-fwk - * Tag: telephony-fwk_0.4.15 - - -- Sunghyuk Lee Tue, 20 Jul 2010 19:05:09 +0900 - -telephony-fwk (0.4.14) unstable; urgency=low - - * Fix the VT event mismatch issue - * Git: slp/pkgs/telephony-fwk - * Tag: telephony-fwk_0.4.14 - - -- Sunghyuk Lee Tue, 20 Jul 2010 16:09:26 +0900 - -telephony-fwk (0.4.13) unstable; urgency=low - - * Fix some doxygen warnings and missing symbol issues - * Git: slp/pkgs/telephony-fwk - * Tag: telephony-fwk_0.4.13 - - -- Sunghyuk Lee Mon, 19 Jul 2010 18:04:41 +0900 - -telephony-fwk (0.4.12) unstable; urgency=low - - * Fix the event string for ts_delivery_initcomplete_event - * Git: slp/pkgs/telephony-fwk - * Tag: telephony-fwk_0.4.12 - - -- Sunghyuk Lee Mon, 19 Jul 2010 08:44:16 +0900 - -telephony-fwk (0.4.11) unstable; urgency=low - - * Add the debug package rule - * Git: slp/pkgs/telephony-fwk - * Tag: telephony-fwk_0.4.11 - - -- Sunghyuk Lee Fri, 16 Jul 2010 11:50:31 +0900 - -telephony-fwk (0.4.10) unstable; urgency=low - - * Correct some doxygen typo and missing symbol problem - * Git: slp/pkgs/telephony-fwk - * Tag: telephony-fwk_0.4.10 - - -- Sunghyuk Lee Thu, 15 Jul 2010 20:49:34 +0900 - -telephony-fwk (0.4.9) unstable; urgency=low - - * Fix the internal function which determine whether the request is - synchronous or not - * Git: slp/pkgs/telephony-fwk - * Tag: telephony-fwk_0.4.9 - - -- Sunghyuk Lee Thu, 15 Jul 2010 11:57:01 +0900 - -telephony-fwk (0.4.8) unstable; urgency=low - - * Add io channel watch to g_main_loop for User actvity event - * Remove g_source which g_io_channel_watch has added - * Git: slp2.0/slp2.0-pkgs/telephony-0 - * Tag: telephony-fwk_0.4.8 - - -- Sunghyuk Lee Sat, 10 Jul 2010 15:06:49 +0900 - -telephony-fwk (0.4.7) unstable; urgency=low - - * Hide unwanted functions from being visible in the library - * Generate the debug packages - * Git: slp2.0/slp2.0-pkgs/telephony-0 - * Tag: telephony-fwk_0.4.7 - - -- Sunghyuk Lee Fri, 09 Jul 2010 20:57:23 +0900 - -telephony-fwk (0.4.6) unstable; urgency=low - - * Serarate telephony server main loop and rfs loop - * Git: slp2.0/slp2.0-pkgs/telephony-0 - * Tag: telephony-fwk_0.4.6 - - -- Sunghyuk Lee Fri, 09 Jul 2010 11:54:48 +0900 - -telephony-fwk (0.4.5) unstable; urgency=low - - * Separate internal server features from the telephony server - * Git: slp2.0/slp2.0-pkgs/telephony-0 - * Tag: telephony-fwk_0.4.5 - - -- Sunghyuk Lee Thu, 08 Jul 2010 17:26:15 +0900 - -telephony-fwk (0.4.4) unstable; urgency=low - - * Update the boiler plate - * Remove 'LIMO' from some definitions - * Git: slp2.0/slp2.0-pkgs/telephony-0 - * Tag: telephony-fwk_0.4.4 - - -- Sunghyuk Lee Wed, 07 Jul 2010 10:11:58 +0900 - -telephony-fwk (0.4.3) unstable; urgency=low - - * Fix SAT bug which was caused by garray index mismatch of the userdata - * Git: slp2.0/slp2.0-pkgs/telephony-0 - * Tag: telephony-fwk_0.4.3 - - -- Sunghyuk Lee Tue, 06 Jul 2010 21:10:57 +0900 - -telephony-fwk (0.4.2) unstable; urgency=low - - * Change to Single Thread - * Fix a bug on the simulator - * Add doxygen flag which exclude the private package from the document - * Git: slp2.0/slp2.0-pkgs/telephony-0 - * Tag: telephony-fwk_0.4.2 - - -- Sunghyuk Lee Mon, 05 Jul 2010 13:37:36 +0900 - -telephony-fwk (0.4.1) unstable; urgency=low - - * Fix the event string mismatch bug for power, svcmode, display - * Git: slp2.0/slp2.0-pkgs/telephony-0 - * Tag: telephony-fwk_0.4.1 - - -- Sunghyuk Lee Thu, 01 Jul 2010 20:35:13 +0900 - -telephony-fwk (0.4.0) unstable; urgency=low - - * Change the telephony event definition - * Point-to-point event delivery - * Add a user data parameter at the tel_register_event API - * Git: slp2.0/slp2.0-pkgs/telephony-0 - * Tag: telephony-fwk_0.4.0 - - -- Sunghyuk Lee Thu, 01 Jul 2010 14:03:57 +0900 - -telephony-fwk (0.3.17) unstable; urgency=low - - * request id modification - * Git: slp2.0/slp2.0-pkgs/telephony-0 - * Tag: telephony-fwk_0.3.17 - - -- SungEun Lee Fri, 25 Jun 2010 14:01:25 +0900 - -telephony-fwk (0.3.16) unstable; urgency=low - - * dlog modification - * Git: slp2.0/slp2.0-pkgs/telephony-0 - * Tag: telephony-fwk_0.3.16 - - -- SungEun Lee Thu, 17 Jun 2010 11:01:25 +0900 - -telephony-fwk (0.3.15) unstable; urgency=low - - * dlog modification - * Git: slp2.0/slp2.0-pkgs/telephony-0 - * Tag: telephony-fwk_0.3.15 - - -- SungEun Lee Wed, 16 Jun 2010 09:27:25 +0900 - -telephony-fwk (0.3.14) unstable; urgency=low - - * version up for EFL upgrade - * Git: slp2.0/slp2.0-pkgs/telephony-0 - * Tag: telephony-fwk_0.3.14 - - -- Kyeongchul Kim Fri, 11 Jun 2010 11:14:25 +0900 - -telephony-fwk (0.3.13) unstable; urgency=low - - * noti modification for vt - * Git: slp2.0/slp2.0-pkgs/telephony-0 - * Tag: telephony-fwk_0.3.13 - - -- SungEun Lee Wend, 08 Jun 2010 23:15:01 +0900 - -telephony-fwk (0.3.12) unstable; urgency=low - - * noti modification - * Git: slp2.0/slp2.0-pkgs/telephony-0 - * Tag: telephony-fwk_0.3.12 - - -- SungEun Lee Wend, 08 Jun 2010 17:25:01 +0900 - -telephony-fwk (0.3.11) unstable; urgency=low - - * gprs modification for dormant - * Git: slp2.0/slp2.0-pkgs/telephony-0 - * Tag: telephony-fwk_0.3.11 - - -- SungEun Lee Mon, 07 Jun 2010 17:25:01 +0900 - -telephony-fwk (0.3.10) unstable; urgency=low - - * Support the AUL for SAT and CiSS - * Git: slp2.0/slp2.0-pkgs/telephony-0 - * Tag: telephony-fwk_0.3.10 - - -- Sunghyuk Lee Mon, 07 Jun 2010 10:53:01 +0900 - -telephony-fwk (0.3.9) unstable; urgency=low - - * resolve build break due to utilcore dependency - * Git: slp2.0/slp2.0-pkgs/telephony-0 - * Tag: telephony-fwk_0.3.9 - - -- Hyeongbae Park Fri, 04 Jun 2010 15:55:28 +0900 - -telephony-fwk (0.3.8) unstable; urgency=low - - * fixed rsim access operation - * Git: slp2.0/slp2.0-pkgs/telephony-0 - * Tag: telephony-fwk_0.3.8 - - -- Kyeongchul Kim Thu, 03 Jun 2010 22:01:28 +0900 - -telephony-fwk (0.3.7) unstable; urgency=low - - * the old API is removed - * Git: slp2.0/slp2.0-pkgs/telephony-0 - * Tag: telephony-fwk_0.3.7 - -- selee Thu, 03 Jun 2010 13:50:01 +0900 - -telephony-fwk (0.3.6) unstable; urgency=low - - * bug fix in sms read message and change bs, vt launch ways - * Git: slp2.0/slp2.0-pkgs/telephony-0 - * Tag: telephony-fwk_0.3.6 - - -- hyeongbae park Tue, 1 Jun 2010 17:00:34 +0900 - -telephony-fwk (0.3.5) unstable; urgency=low - - * rollback previous work(aul) - * Git: slp2.0/slp2.0-pkgs/telephony-0 - * Tag: telephony-fwk_0.3.5 - - -- sungeun lee Sun, 30 May 2010 16:30:34 +0900 - -telephony-fwk (0.3.4) unstable; urgency=low - - * change vt launching method from fork to aul - * Git: slp2.0/slp2.0-pkgs/telephony-0 - * Tag: telephony-fwk_0.3.4 - - -- sungeun lee Sun, 30 May 2010 15:12:34 +0900 - -telephony-fwk (0.3.3) unstable; urgency=low - - * Fix pin check procedure for getting valid retry count - * Git: slp2.0/slp2.0-pkgs/telephony-0 - * Tag: telephony-fwk_0.3.3 - - -- kyeongchul kim Sun, 30 May 2010 13:37:34 +0900 - -telephony-fwk (0.3.2) unstable; urgency=low - - * Fix debug print statement in tel_get_sim_init_info - * Git: slp2.0/slp2.0-pkgs/telephony-0 - * Tag: telephony-fwk_0.3.2 - - -- kyeongchul kim Sat, 29 May 2010 17:30:12 +0900 - -telephony-fwk (0.3.1) unstable; urgency=low - - * Fix the typo, tel_prcoess_power_command - * Git: slp2.0/slp2.0-pkgs/telephony-0 - * Tag: telephony-fwk_0.3.1 - - -- Sunghyuk Lee Sat, 29 May 2010 13:58:59 +0900 - -telephony-fwk (0.3.0) unstable; urgency=low - - * Telephony API Enhancement - * Git: slp2.0/slp2.0-pkgs/telephony-0 - * Tag: telephony-fwk_0.3.0 - - -- Sunghyuk Lee Sat, 29 May 2010 13:28:50 +0900 - -telephony-fwk (0.2.27) unstable; urgency=low - - * Disable dbus auto-activation according to the DAC policy - * Git: slp2.0/slp2.0-pkgs/telephony-0 - * Tag: telephony-fwk_0.2.27 - - -- Sunghyuk Lee Fri, 28 May 2010 16:23:04 +0900 - -telephony-fwk (0.2.26) unstable; urgency=low - - * Change the package maintainer - * Git: slp2.0/slp2.0-pkgs/telephony-0 - * Tag: telephony-fwk_0.2.26 - - -- Sunghyuk Lee Mon, 24 May 2010 09:37:01 +0900 - -telephony-fwk (0.2.25) unstable; urgency=low - - * Change boot script for hibernation capturing - * Git: slp2.0/slp2.0-pkgs/telephony-0 - * Tag: telephony-fwk_0.2.25 - - -- Hyeongbae Park Mon, 17 May 2010 11:29:15 +0900 - -telephony-fwk (0.2.24) unstable; urgency=low - - * Change the file permission and owner according to the new security - * Git: slp2.0/slp2.0-pkgs/telephony-0 - * Tag: telephony-fwk_0.2.24 - - -- Sunghyuk Lee Fri, 14 May 2010 14:31:15 - -telephony-fwk (0.2.23) unstable; urgency=low - - * [Build] Remove Dependency Problem of util-core - * Git: slp2.0/slp2.0-pkgs/telephony-0 - * Tag: telephony-fwk_0.2.23 - - -- Youngman Park Wen, 12 May 2010 13:00:56 - -telephony-fwk (0.2.22) unstable; urgency=low - - * [MISC] Fix the OEM callback fucntion upon the version info response - * Git: slp2.0/slp2.0-pkgs/telephony-0 - * Tag: telephony-fwk_0.2.22 - - -- Sunghyuk Lee Tue, 04 May 2010 16:59:56 - -telephony-fwk (0.2.21) unstable; urgency=low - - * fix the idle text function's parameter data type to support long text - string - * Git: slp2.0/slp2.0-pkgs/telephony-0 - * Tag: telephony-fwk_0.2.21 - - -- Sunghyuk Lee Mon, 26 Apr 2010 19:54:35 - -telephony-fwk (0.2.20) unstable; urgency=low - - * Add option for fastboot - * Git: slp2.0/slp2.0-pkgs/telephony-0 - * Tag: telephony-fwk_0.2.20 - - -- Hyeongbae Park Mon, 26 Apr 2010 17:39:54 +0900 - -telephony-fwk (0.2.19) unstable; urgency=low - - * Support the long SAT text - * Git: slp2.0/slp2.0-pkgs/telephony-0 - * Tag: telephony-fwk_0.2.19 - - -- Sunghyuk Lee Fri, 23 Apr 2010 20:11:54 +0900 - -telephony-fwk (0.2.18) unstable; urgency=low - - * Fix a bug (Add the event string of SimReadFileRaw) - * Git: slp2.0/slp2.0-pkgs/telephony-0 - * Tag: telephony-fwk_0.2.18 - - -- Sunghyuk Lee Fri, 23 Apr 2010 11:59:58 +0900 - -telephony-fwk (0.2.17) unstable; urgency=low - - * Adjust timeout value for SMS API related to SIM - * Git: slp2.0/slp2.0-pkgs/telephony-0 - * Tag: telephony-fwk_0.2.17 - - -- Hyeongbae Park Thu, 22 Apr 2010 22:08:57 +0900 - -telephony-fwk (0.2.16) unstable; urgency=low - - * Fix a raw RSIM bug - * Git: slp2.0/slp2.0-pkgs/telephony-0 - * Tag: telephony-fwk_0.2.16 - - -- Sunghyuk Lee Wed, 21 Apr 2010 20:34:57 +0900 - -telephony-fwk (0.2.15) unstable; urgency=low - - * Change condition check routine for getting security state - * Git: slp2.0/slp2.0-pkgs/telephony-0 - * Tag: telephony-fwk_0.2.15 - - -- Kyeongchul Kim Tue, 20 Apr 2010 22:41:12 +0900 - -telephony-fwk (0.2.14) unstable; urgency=low - - * Add postinst for security - * Git: slp2.0/slp2.0-pkgs/telephony-0 - * Tag: telephony-fwk_0.2.14 - - -- Sunghyuk Lee Mon, 19 Apr 2010 17:59:26 +0900 - -telephony-fwk (0.2.13) unstable; urgency=low - - * Fix the SAT command queuing problem - - -- Sunghyuk Lee Mon, 19 Apr 2010 17:35:47 +0900 - -telephony-fwk (0.2.12) unstable; urgency=low - - * change internal gconf key to vconf value - * Git: slp2.0/slp2.0-pkgs/telephony-0 - * Tag: telephony-fwk_0.2.12 - - -- Kyeongchul Kim Fri, 16 Apr 2010 23:17:30 +0900 - -telephony-fwk (0.2.11) unstable; urgency=low - - * Change SIM Ecc Value - - -- Youngman Park Fri, 09 Apr 2010 15:44:44 +0900 - -telephony-fwk (0.2.10) unstable; urgency=low - - * add audio loobpack and rc.d - - -- Hyeongbae Park Thu, 08 Apr 2010 19:10:53 +0900 - -telephony-fwk (0.2.9) unstable; urgency=low - - * Fix a bug to print out all debug message upon publishing dbus events - - -- Sunghyuk Lee Thu, 08 Apr 2010 16:45:53 +0900 - -telephony-fwk (0.2.8) unstable; urgency=low - - * File format chagne DOS -> UNIX - - -- youngman park Tue, 8 Apr 2010 13:31:14 +0900 - -telephony-fwk (0.2.7) unstable; urgency=low - - * Add ecc category for emergency call - - -- youngman park Mon, 5 Apr 2010 21:12:14 +0900 - -telephony-fwk (0.2.6) unstable; urgency=low - - * Adjust ramdump for test mode - - -- hyeongbae park Tue, 1 Apr 2010 11:20:54 +0900 - -telephony-fwk (0.2.5) unstable; urgency=low - - * Add timeprint to check main() timing issue - - -- Sunghyuk Lee Wed, 31 Mar 2010 18:03:54 +0900 - -telephony-fwk (0.2.4) unstable; urgency=low - - * Apply network band value re-arrangement from modem - - -- Kyeongchul Kim Wed, 31 Mar 2010 17:30:38 +0900 - - -telephony-fwk (0.2.4) unstable; urgency=low - - * Apply network band value re-arrangement from modem - - -- Kyeongchul Kim Wed, 31 Mar 2010 17:30:38 +0900 - -telephony-fwk (0.2.3) unstable; urgency=low - - * re-arrange telephony headers - - -- Kyeongchul Kim Tue, 30 Mar 2010 19:31:19 +0900 - -telephony-fwk (0.2.2) unstable; urgency=low - - * Add Emergency Call Event - - -- Youngman Park Fri, 26 Mar 2010 16:44:22 +0900 - -telephony-fwk (0.2.1) unstable; urgency=low - - * Bug Fix E911 Call - - -- Youngman Park Thu, 25 Mar 2010 21:25:22 +0900 - -telephony-fwk (0.2.0) unstable; urgency=low - - * Reupload dpkg upon request from SCM (toolchain upgrade) - - -- Sunghyuk Lee Thu, 25 Mar 2010 13:58:42 +0900 - -telephony-fwk (0.1.63) unstable; urgency=low - - * [SAT] Seperate the autoactivating sat event from normal event - - -- Sunghyuk Lee Wed, 24 Mar 2010 17:09:22 +0900 - -telephony-fwk (0.1.62) unstable; urgency=low - - * Fix E911 Call Bug - - -- youngman.park Wed, 24 Mar 2010 10:19:34 +0900 - -telephony-fwk (0.1.61) unstable; urgency=low - - * Fix DFT KeySend Bug - - -- youngman.park Tues, 23 Mar 2010 19:17:14 +0900 - -telephony-fwk (0.1.60) unstable; urgency=low - - * Change debug level from LEVEL_EMERG to LEVEL_DEBUG - - -- sungeun.lee Tues, 23 Mar 2010 09:20:41 +0900 - -telephony-fwk (0.1.59) unstable; urgency=low - - * Fix bug : bIsMainMenuPresent flag issue - - -- sunghyuk.lee Mon, 22 Mar 2010 21:51:41 +0900 - -telephony-fwk (0.1.58) unstable; urgency=low - - * Change KeyCode Data in Factory DFT - - -- youngman.park Mon, 22 Mar 2010 17:37:33 +0900 - -telephony-fwk (0.1.57) unstable; urgency=low - - * Bug Fix for Factory DFT - - -- youngman.park Thu, 19 Mar 2010 23:23:11 +0900 - -telephony-fwk (0.1.56) unstable; urgency=low - - * add clock ipc at sound module - - -- hyeongbae.park Thu, 17 Mar 2010 20:23:31 +0900 - -telephony-fwk (0.1.55) unstable; urgency=low - - * [SAT] Fix a bug. Stop to activate satui upon - Telephony.Sat.EventDownloadCnf event - - -- sunghyuk.lee Tue, 16 Mar 2010 16:17:19 +0900 - -telephony-fwk (0.1.54) unstable; urgency=low - - * [SAT] Fix a bug. It has made the satui activated abnormally - - -- sunghyuk.lee Tue, 16 Mar 2010 15:11:31 +0900 - -telephony-fwk (0.1.53) unstable; urgency=low - - * change CP RAMDUMP size from 36M to 37M due to Onedram partition - - -- hyeongbae.park Mon, 15 Mar 2010 16:40:33 +0900 - -telephony-fwk (0.1.52) unstable; urgency=low - - * [SAT] Support USER_ACTIVITY event downloading feature - - -- sunghyuk.lee Fri, 12 Mar 2010 22:25:33 +0900 - -telephony-fwk (0.1.51) unstable; urgency=low - - * replace sync into close in RFS - Fix C++ guard and empty parameter problem upon SDK request - - -- hyeongbae.park Fri, 12 Mar 2010 16:05:44 +0900 - -telephony-fwk (0.1.50) unstable; urgency=low - - * remove phone off and increase timeout for PSI CRC checking - - -- hyeongbae.park Thu, 11 Mar 2010 23:20:44 +0900 - -telephony-fwk (0.1.49) unstable; urgency=low - - * comment dlog_init and dlog_deinit for child process - - -- hyeongbae.park Wed, 10 Mar 2010 19:50:44 +0900 - -telephony-fwk (0.1.48) unstable; urgency=low - - * Remove sleep(1) from TelServerSatProactiveSelectItemInd - - -- sunghyuk.lee Wed, 10 Mar 2010 16:04:44 +0900 - -telephony-fwk (0.1.47) unstable; urgency=low - - * Do not activate the sat-ui automatically upon TAPI_EVENT_SAT_PROVIDE_LOCAL_INFO_IND event - - -- sunghyuk.lee Wed, 10 Mar 2010 10:42:44 +0900 - -telephony-fwk (0.1.46) unstable; urgency=low - - * change psi download sequnce and adjust modem partition from raw to mtd/ubi - - -- hyeongbae.park Mon, 08 Mar 2010 17:05:00 +0900 - -telephony-fwk (0.1.45) unstable; urgency=low - - * [SAT] Define BROWSER_DBUS_CONN_NAME to launch browser automatically upon SAT event - - -- sunghyuk.lee Fri, 05 Mar 2010 10:32:00 +0900 - -telephony-fwk (0.1.44) unstable; urgency=low - - * Define CISS_DBUS_CONN_NAME to launch ciss automatically upon SAT events - - -- sunghyuk.lee Tue, 02 Mar 2010 19:27:09 +0900 - -telephony-fwk (0.1.43) unstable; urgency=low - - * [SAT] Fix bugs to send dbus signals to other modules normally - - -- sunghyuk.lee Fri, 26 Feb 2010 10:11:30 +0900 - -telephony-fwk (0.1.42) unstable; urgency=low - - * Add new RFS & common boot - - -- hyeongbae.park Thu, 25 Feb 2010 21:00:01 +0900 - -telephony-fwk (0.1.41) unstable; urgency=low - - * ADD FACTORT DFT CODE (KEY, TOUCH) - - -- youngman.park Thu, 25 Feb 2010 17:00:01 +0900 - -telephony-fwk (0.1.40) unstable; urgency=low - - * ADD FACTORT DFT HEADER - - -- youngman.park Tue, 23 Feb 2010 23:10:04 +0900 - -telephony-fwk (0.1.39) unstable; urgency=low - - * FIX GPRS SIGSEGV ERROR by Wrong IPC Message (IPC_GPRS_CALL_STATUS) - - -- youngman.park Tue, 23 Feb 2010 23:00:10 +0900 - -telephony-fwk (0.1.38) unstable; urgency=low - - * FIX GPRS PORT LIST ERROR - - -- youngman.park Tue, 23 Feb 2010 22:55:12 +0900 - -telephony-fwk (0.1.37) unstable; urgency=low - - * modify tapi_misc_timezone_setinfo()'s doxygen tag - - -- sungeun.lee Tue, 23 Feb 2010 13:21:30 +0900 - -telephony-fwk (0.1.36) unstable; urgency=low - - * change CS/PS vconf init value OFF to UNKNOWN, add plmn handling code in - NITZ noti case - - -- kyeongchul.kim Mon, 22 Feb 2010 15:32:19 +0900 - -telephony-fwk (0.1.35) unstable; urgency=low - - * Add vconf key, VCONFKEY_TELEPHONY_SAT_STATE on request from VoiceCall app - - -- sunghyuk.lee Sat, 20 Feb 2010 11:35:30 +0900 - -telephony-fwk (0.1.34) unstable; urgency=low - - * [SAT] Support large icons and color icons (with -DLARGE_ICON option) - - -- sunghyuk.lee Fri, 19 Feb 2010 17:33:57 +0900 - -telephony-fwk (0.1.33) unstable; urgency=low - - * add noti publish code when card type is changed on boot time - - -- kyeongchul.kim Thu, 18 Feb 2010 16:53:46 +0900 - -telephony-fwk (0.1.32) unstable; urgency=low - - * Modify factory module for MM - -- youngman.park Wed, 10 Feb 2010 11:18:23 +0900 - -telephony-fwk (0.1.31) unstable; urgency=low - - * re-arrange internal header including,apply network ipc change, separate oem - callback function description from OemTapiCommon.h to OemTapiCommon_ext.h - - -- kyeongchul.kim Wed, 10 Feb 2010 22:17:38 +0900 - -telephony-fwk (0.1.30) unstable; urgency=low - - * psi size from 15K to 20K - - -- hyoengbae.park Wed, 10 Feb 2010 11:50:00 +0900 - -telephony-fwk (0.1.29) unstable; urgency=low - - * error handling for NV processing - - -- hyoengbae.park Tue, 9 Feb 2010 14:07:00 +0900 - -telephony-fwk (0.1.28) unstable; urgency=low - - * Add ramdump and fatal error - - -- hyoengbae.park Tue, 9 Feb 2010 00:10:00 +0900 - -telephony-fwk (0.1.27) unstable; urgency=low - - * Fix gprs port list Error - - -- youngman.park Mon, 8 Feb 2010 21:25:48 +0900 - -telephony-fwk (0.1.26) unstable; urgency=low - - * Add gprs port list - - -- youngman.park Mon, 8 Feb 2010 17:14:48 +0900 - -telephony-fwk (0.1.25) unstable; urgency=low - - * block RAMDUMP temporarily - - -- hyeongbae.park Fri, 5 Feb 2010 12:21:28 +0900 - -telephony-fwk (0.1.24) unstable; urgency=low - - * bug fix at RAMDUMP and add sim init crash case for SMC lab requirement - - -- kyeongchul.kim Wed, 3 Feb 2010 23:07:28 +0900 - -telephony-fwk (0.1.23) unstable; urgency=low - - * change modem device from mtd3 to mtd6 - - -- hyeongbae.park Tue, 2 Feb 2010 21:31:28 +0900 - -telephony-fwk (0.1.22) unstable; urgency=low - - * add SIM exception handling code and fixed Doxygen tag(COMMON part) - - -- kyeongchul.kim Tue, 2 Feb 2010 20:56:28 +0900 - -telephony-fwk (0.1.21) unstable; urgency=low - - * changed pb last index recognization(0x00 to 0xFFFF), PLMN handling code for - Infineon(6 digit to 5 digit) - - -- kyeongchul.kim Mon, 1 Feb 2010 20:11:29 +0900 - -telephony-fwk (0.1.20) unstable; urgency=low - - * fixed Doxygen tag and move TelSatUtil.h to server layer - - -- kyeongchul.kim Fri, 29 Jan 2010 19:40:41 +0900 - -telephony-fwk (0.1.19) unstable; urgency=low - - * remove doxygen comment in 'tapi-lib-common.h' and add vconf value(MSISDN) - - -- kyeongchul.kim Thu, 28 Jan 2010 22:34:27 +0900 - -telephony-fwk (0.1.18) unstable; urgency=low - - * remove status lib dependency in case of telephony v2.0 - - -- kyeongchul.kim Wed, 27 Jan 2010 22:53:14 +0900 - -telephony-fwk (0.1.17) unstable; urgency=low - - * change SLP prefix - - -- kyeongchul.kim Tue, 26 Jan 2010 18:49:09 +0900 - -telephony-fwk (0.1.16) unstable; urgency=low - - * change Doxygen comment and sim test app - - -- kyeongchul.kim Sat, 23 Jan 2010 19:30:12 +0900 - -telephony-fwk (0.1.15) unstable; urgency=low - - * tempraty time updated code deleted - - -- jooseok.park Thu, 21 Jan 2010 21:20:03 +0900 - -telephony-fwk (0.1.14) unstable; urgency=low - - * Fix 3G PB field length check process and add network init in modem reset - func - - -- kyeongchul.kim Wed, 20 Jan 2010 22:36:02 +0900 - -telephony-fwk (0.1.13) unstable; urgency=low - - * Bug fix in deleting SMS in the SIM - - -- hyeongbae.park Mon, 18 Jan 2010 17:00:00 +0900 - -telephony-fwk (0.1.12) unstable; urgency=low - - * Change FDN en/disable procedure in OEM layer - - -- kyeongchul.kim Thu, 14 Jan 2010 21:22:16 +0900 - -telephony-fwk (0.1.11) unstable; urgency=low - - * add reset, shutdown and sms save handling - - -- hyeongbae.park Wed, 14 Jan 2010 13:00:03 +0900 - -telephony-fwk (0.1.10) unstable; urgency=low - - * video call release all cnf event string added - - -- jooseok.park Wed, 13 Jan 2010 21:21:03 +0900 - -telephony-fwk (0.1.9) unstable; urgency=low - - * change Flight Mode value in the slp-setting - - -- hyeongbae.park The, 12 JAN 2010 23:56:06 +0900 - -telephony-fwk (0.1.8) unstable; urgency=low - - * change NV offset - - -- hyeongbae.park The, 12 JAN 2010 23:55:06 +0900 - -telephony-fwk (0.1.7) unstable; urgency=low - - * Bug fix in the deleting the sms in the sim - - -- hyeongbae.park The, 12 JAN 2010 20:10:06 +0900 - -telephony-fwk (0.1.6) unstable; urgency=low - - * Add SLP_SETTING_TELEPHONY_SIM_SLOT init process in boot time - - -- kyeongchul.kim The, 12 JAN 2010 19:10:06 +0900 - -telephony-fwk (0.1.5) unstable; urgency=low - - * SIM ipc data packed, fixed SLP-setting return check statement, NV EFS PATH - - -- kyeongchul.kim Thu, 7 JAN 2010 18:24:10 +0900 - -telephony-fwk (0.1.4) unstable; urgency=low - - * Enabling dlog messages, adding 2 TAPI for SAT - - -- sunghyuk.lee Wed, 6 JAN 2010 23:04:10 +0900 - -telephony-fwk (0.1.3) unstable; urgency=low - - * SIM,NETWORK - Code enhancement,Remove status lib usage,etc - - -- kyeongchul.kim Tue, 5 JAN 2010 18:02:10 +0900 - -telephony-fwk (0.1.2) unstable; urgency=low - - * fixed SLP-setting check condition in tapi_common_check_status() - - -- kyeongchul.kim Mon, 28 Dec 2009 17:12:20 +0900 - -telephony-fwk (0.1.1) unstable; urgency=low - - * [SAT] Stop checking the alarm boot feature which is no longer available - - -- sunghyuk.lee Mon, 28 Dec 2009 14:21:46 +0900 - -telephony-fwk (0.1.0-24) unstable; urgency=low - - * change parameter position of general response - - -- kyeongchul.kim Thu, 24 Dec 2009 19:22:24 +0900 - -telephony-fwk (0.1.0-23) unstable; urgency=low - - * support SLP-setting; - - -- kyeongchul.kim Wed, 23 Dec 2009 14:56:46 +0900 - -telephony-fwk (0.1.0-22msm6290) unstable; urgency=low - - * support UBI, RFS for qualcomm; - - -- hyeongbae.park Tue, 22 Dec 2009 22:27:46 +0900 - -telephony-fwk (0.1.0-22) unstable; urgency=low - - * support UBI, RFS for infineon modem: - - -- hyeongbae.park Tue, 22 Dec 2009 11:34:24 +0900 - -telephony-fwk (0.1.0-21) unstable; urgency=low - - * change nv,efs directory from /root to /csa - - -- hyeongbae.park Sat, 19 Dec 2009 16:02:48 +0900 - -telephony-fwk (0.1.0-21msm6290) unstable; urgency=low - - * change nv,efs directory from /root to /csa - - -- hyeongbae.park Sat, 19 Dec 2009 15:39:53 +0900 - -telephony-fwk (0.1.0-20) unstable; urgency=low - - * telephony dynamic logging adopted - - -- jooseok.park Fri, 18 Dec 2009 10:04:20 +0900 - -telephony-fwk (0.1.0-19msm6290) unstable; urgency=low - - * release for msm6290 oem. same bin with 0.1.0-18 - * i - - -- kyeongchul.kim Fri, 18 Dec 2009 10:04:00 +0900 - -telephony-fwk (0.1.0-19) unstable; urgency=low - - * Recovering the broken i386 packages - - -- sunghyuk.lee Thu, 17 Dec 2009 12:14:30 +0900 - -telephony-fwk (0.1.0-18) unstable; urgency=low - - * Dpkg 0.1.0-17 has been failed to be imported. So upload the packages again - - -- sunghyuk.lee Thu, 17 Dec 2009 12:04:30 +0900 - -telephony-fwk (0.1.0-17) unstable; urgency=low - - * fixed uncorrect debian package(0.1.0-16-msm6290) - - -- kyeongchul.kim Wed, 16 Dec 2009 21:30:30 +0900 -telephony-fwk (0.1.0-16) unstable; urgency=low - - * i686 telephony-fwk dpkg release - - -- sunghyuk.lee Tue, 15 Dec 2009 17:11:28 +0900 - -telephony-fwk (0.1.0-15) unstable; urgency=low - - * gps update - - -- soyoun2.kim Mon, 14 Dec 2009 12:45:28 +0900 - -telephony-fwk (0.1.0-14) unstable; urgency=low - - * Support RFS Filesystem - - -- hyeongbae.park Mon, 14 Dec 2009 12:12:03 +0900 - -telephony-fwk (0.1.0-13) unstable; urgency=low - - * Add Telepony.Servie.Ready Event - - -- youngman.park Sat, 12 Dec 2009 15:14:44 +0900 - -telephony-fwk (0.1.0-12) unstable; urgency=low - - * oem callback and SLP1.0 feature adopted - - -- jooseok.park Thu, 10 Dec 2009 17:32:15 +0900 - -telephony-fwk (0.1.0-11) unstable; urgency=low - - * add null check statement in TelOemNwGetNetworkInfo() - - -- kyeongchul.kim Tue, 01 Dec 2009 19:25:02 +0900 - -telephony-fwk (0.1.0-10) unstable; urgency=low - - * slp2.0 code merge - - -- jooseok.park Mon, 30 Nov 2009 17:53:50 +0900 - -telephony-fwk (0.1.0-9) unstable; urgency=low - - * Stop to remove NV binary. - - -- wonguk.jeong Wed, 25 Nov 2009 17:12:00 +0900 - -telephony-fwk (0.1.0-8) unstable; urgency=low - - * remove unnecessary files - - -- wonguk.jeong Fri, 20 Nov 2009 17:19:20 +0900 - -telephony-fwk (0.1.0-6) unstable; urgency=low - - * library prefix changed (X1 --> SLP) - - -- wonguk.jeong Fri, 20 Nov 2009 16:04:50 +0900 - -telephony-fwk (0.1.0-5) unstable; urgency=low - - * copyright added, as-needed option enabled - - -- wonguk.jeong Fri, 20 Nov 2009 10:38:45 +0900 - -telephony-fwk (0.1.0-4) unstable; urgency=low - - * remove debug message - - -- wonguk.jeong Thu, 19 Nov 2009 15:43:08 +0900 - -telephony-fwk (0.1.0-3) unstable; urgency=low - - * add arch environment variable - - -- wonguk.jeong Thu, 19 Nov 2009 15:30:39 +0900 - -telephony-fwk (0.1.0-2) unstable; urgency=low - - * add dependencies of telephony-server (temporary) - - -- wonguk.jeong Mon, 16 Nov 2009 11:23:43 +0900 - -telephony-fwk (0.1.0-1) unstable; urgency=low - - * Initial Release. (SLP source + SLP-lite patch) - - -- wonguk.jeong Sun, 15 Nov 2009 00:42:02 +0900 diff --git a/mobile/debian/compat b/mobile/debian/compat deleted file mode 100644 index 7ed6ff8..0000000 --- a/mobile/debian/compat +++ /dev/null @@ -1 +0,0 @@ -5 diff --git a/mobile/debian/control b/mobile/debian/control deleted file mode 100644 index 0cdd735..0000000 --- a/mobile/debian/control +++ /dev/null @@ -1,28 +0,0 @@ -Source: libslp-tapi -Section: libs -Priority: extra -Maintainer: Ja-young Gu -Uploaders: Ja-young Gu , kyeongchul.kim , Youngman Park , Inho Oh , DongHoo Park -Build-Depends: debhelper (>= 5), - libglib2.0-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, 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/mobile/debian/dirs b/mobile/debian/dirs deleted file mode 100644 index ca882bb..0000000 --- a/mobile/debian/dirs +++ /dev/null @@ -1,2 +0,0 @@ -usr/bin -usr/sbin diff --git a/mobile/debian/docs b/mobile/debian/docs deleted file mode 100644 index e69de29..0000000 diff --git a/mobile/debian/libslp-tapi-0.install.in b/mobile/debian/libslp-tapi-0.install.in deleted file mode 100644 index c3f5486..0000000 --- a/mobile/debian/libslp-tapi-0.install.in +++ /dev/null @@ -1 +0,0 @@ -@PREFIX@/lib/lib* diff --git a/mobile/debian/libslp-tapi-dev.install.in b/mobile/debian/libslp-tapi-dev.install.in deleted file mode 100644 index 61f30f2..0000000 --- a/mobile/debian/libslp-tapi-dev.install.in +++ /dev/null @@ -1,2 +0,0 @@ -@PREFIX@/include/telephony-client/* -@PREFIX@/lib/pkgconfig/tapi-lib.pc diff --git a/mobile/debian/rules b/mobile/debian/rules deleted file mode 100755 index 0ca9918..0000000 --- a/mobile/debian/rules +++ /dev/null @@ -1,117 +0,0 @@ -#!/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/mobile/image/SLP_TelephonyFW_PG_image001.png b/mobile/image/SLP_TelephonyFW_PG_image001.png deleted file mode 100644 index af8da9e..0000000 Binary files a/mobile/image/SLP_TelephonyFW_PG_image001.png and /dev/null differ diff --git a/mobile/image/SLP_TelephonyFW_PG_image002.png b/mobile/image/SLP_TelephonyFW_PG_image002.png deleted file mode 100644 index fa22ee2..0000000 Binary files a/mobile/image/SLP_TelephonyFW_PG_image002.png and /dev/null differ diff --git a/mobile/image/SLP_TelephonyFW_PG_image003.png b/mobile/image/SLP_TelephonyFW_PG_image003.png deleted file mode 100644 index c518ec7..0000000 Binary files a/mobile/image/SLP_TelephonyFW_PG_image003.png and /dev/null differ diff --git a/mobile/image/SLP_TelephonyFW_PG_image004.png b/mobile/image/SLP_TelephonyFW_PG_image004.png deleted file mode 100644 index 96f5184..0000000 Binary files a/mobile/image/SLP_TelephonyFW_PG_image004.png and /dev/null differ diff --git a/mobile/include/ITapiCall.h b/mobile/include/ITapiCall.h deleted file mode 100644 index 701e4cb..0000000 --- a/mobile/include/ITapiCall.h +++ /dev/null @@ -1,2256 +0,0 @@ -/* - * libslp-tapi - * - * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. - * - * Contact: Ja-young Gu - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT 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 ITapiCall.h - * - * Call APIs allow an application to accomplish the following services: @n - * - Make a mobile originated Emergency call, Voice call, or Video call. @n - * - Accept or Reject incoming calls. @n - * - Release Calls. @n - * - Call dependent supplementary services such as call hold, retrieve, DTMF. @n - * - Multi -party call management, setup conference call, split conference call. @n - * - Call information such as get call information, get line identification number. @n - * - To verify whether a call (TapiHandle *handle, voice / video ) is possible at any given time. @n - */ - -#ifndef _ITAPI_CALL_H_ -#define _ITAPI_CALL_H_ - -#include -#include -#include - -#ifdef __cplusplus -extern "C" -{ -#endif - - /** - * @brief This function originates MO call setup. This is an asynchronous function. The function completes immediately and - * call setup proceeds in background. - * - * This API makes Dbus method call to Telephony Sever and gets immediate feedback. - * However it just means that the API request has been transfered to the CP successfully. - * The actual operation result is being delivered in the corresponding event asynchronously. - * - * @par Sync (TapiHandle *handle, or) Async: - * This is an Asynchronous API. - * - * @par Important Notes: - * - If call to tel_exe_call_mo(TapiHandle *handle, ) is successful, call handle and request ID are assigned by Telephony Server - * and returned to client by given Call Handle and Request Id parameters. MO call setup continues in - * background. There are multiple states involved in the call setup procedure. Upon request completion - * successful or not, various event notifications are sent to client along with data associated with event - * (TapiHandle *handle, Successful data or error information) based on the indication or response received at the Telephony Server. - * - Setting up Emergency call - * - when #TelCallType_t is voice_call, voice call is setup unless dial_number parameter is an - * emergency number known to telephony FW (TapiHandle *handle, like 112 for all 2G and above, other numbers may operator - * specific or device configuration specific, so Telephony FW will read relevant SIM files and refer to internal - * configuration records). If an emergency number is passed and #TelCallType_t is voice_call, Telephony - * FW shall setup emergency phone call. - * - When #TelCallType_t is emergency call, emergency call is always set up. - * - * @warning - * Do not use this function. This function is dedicated to the embedded call application only. - * Please use its AUL interface - * - * - * @param [in] handle - * - handle from tel_init() - * - * @param[in] pParams - * - #TelCallSetupParams_t contains the CallType(TapiHandle *handle, whether it is a voice call or data call etc) and number. - * - * @param[out] pCallHandle - * - Unique handle for referring the call - * - * @param [in] callback - * - To register callback function for result of this function. - * - * @param [in] user_data - * - user data for user specification - * - * @par Async Response Message: - * TAPI_EVENT_CALL_SETUP_CNF is sent to the application when the lower layers get the call originate response. - * Asynchronous return status is indicated by #TelCallCause_t and call handle is sent in the event data. - * Various asynchronous indications are described in the unsolicited notifications section . [Refer, \ref page8] - * - * @pre - * - Initialize Dbus connection with #tel_init - * - Register caller's application name with #tel_register_app_name - * - Register telephony events to listen - * - A event loop is running to listen events - * - * @post - * - None. - * - * @return Return Type (TapiHandle *handle, int) \n - * - 0 - indicating that the operation has completed successfully. \n - * - Else it will return failure and error code (TapiHandle *handle, Refer Doxygen doc or #TapiResult_t) - * - * @par Prospective Clients: - * Embedded call application - * - * @see tel_exe_call_mo tel_answer_call tel_release_call - * \image html CallSetup.jpg - * \image latex CallSetup.jpg - * - * @code - * #include - * - * int ret_status =0; - * unsigned int pCallHandle; - * int pRequestID=0; - * TelCallSetupParams_t pParams; - * - * char normal[16] = "1234";//Called party number - * memset(TapiHandle *handle, &pParams, 0, sizeof(TapiHandle *handle, TelCallSetupParams_t), tapi_response_cb callback, void *user_data); - * pParams.CallType = TAPI_CALL_TYPE_VOICE; - * strcpy(TapiHandle *handle, pParams.szNumber,normal, tapi_response_cb callback, void *user_data); - * - * ret_status = tel_exe_call_mo (TapiHandle *handle, &pParams,&pCallHandle,&pRequestID, tapi_response_cb callback, void *user_data); // outgoing call - * @endcode - * - * @remarks - * - None - * - * - */ -int tel_dial_call(TapiHandle *handle, const TelCallDial_t *pParams, tapi_response_cb callback, void *user_data); - - /** - * @brief This function is used to answer the incoming call by accepting or rejecting the call. - * - * This API makes Dbus method call to Telephony Sever and gets immediate feedback. - * However it just means that the API request has been transfered to the CP successfully. - * The actual operation result is being delivered in the corresponding event asynchronously. - * - * @par Sync (TapiHandle *handle, or) Async: - * This is an Asynchronous API. - * - * @par Important Notes: - * - None. - * - * @warning - * Do not use this function. This function is dedicated to the embedded call application only. - * Please use its AUL interface - * - * - * @param [in] handle - * - handle from tel_init() - * - * @param[in] CallHandle - * - This is the unique handle for referring the call. This call handle is available to Application through incoming call - * (TapiHandle *handle, TAPI_EVENT_CALL_INCOM_IND) event. - * - * @param[in] AnsType - * - Answer type - accept / reject / replace / hold and accept. but, for CDMA, only accept is allowed. - * - * @param [in] callback - * - To register callback function for result of this function. - * - * @param [in] user_data - * - user data for user specification - * - * @par Async Response Message: - * - The event associated with this request is TAPI_EVENT_CALL_ANSWER_CNF. Asynchronous return status is - * indicated by #TelCallCause_t and call handle is sent in the event data. - * - TAPI_EVENT_CALL_CONNECTED_IND / TAPI_EVENT_CALL_END_IND event will be notified in case of call is accepted/rejected. - * - * @pre - * - Initialize Dbus connection with #tel_init - * - Register caller's application name with #tel_register_app_name - * - Register telephony events to listen - * - A event loop is running to listen events - * - Call associated with call handle should be TAPI_CALL_STATE_INCOM state otherwise the API fails and there can be a - * maximum of 1 existing call. - * - * @post - * - None. - * - * @return Return Type (TapiHandle *handle, int) \n - * - 0 - indicating that the operation has completed successfully. \n - * - Else it will return failure and error code (TapiHandle *handle, Refer Doxygen doc or #TapiResult_t) - * - * @par Prospective Clients: - * Embedded call application - * - * @see tel_exe_call_mo tel_release_call - * - * \image html CallIncoming.jpg - * \image latex CallIncoming.jpg - * - * @code - * #include - * - * int ret_status ; - * unsigned int pCallHandle; - * int pRequestID=0; - * - * ret_status = tel_answer_call (TapiHandle *handle, pCallHandle,&pRequestID, tapi_response_cb callback, void *user_data); // call answer - * @endcode - * - * @remarks - * - None - * - * - * @remarks - * - None - * - * - */ -int tel_answer_call(TapiHandle *handle, unsigned int CallHandle, TelCallAnswerType_t AnsType, tapi_response_cb callback, void *user_data); - - /** - * - * @brief This function releases the call identified by Call Handle irrespective of call is hold or active state. - * It is used when releasing specific active call in multiparty call. - * - * This API makes Dbus method call to Telephony Sever and gets immediate feedback. - * However it just means that the API request has been transfered to the CP successfully. - * The actual operation result is being delivered in the corresponding event asynchronously. - * - * - * @par Sync (TapiHandle *handle, or) Async: - * This is an Asynchronous API. - * - * @par Important Notes: - * - In case of MPTY Call handle, Call end event is returned for each call in MPTY. - * - * @warning - * Do not use this function. This function is dedicated to the embedded call application only. - * Please use its AUL interface - * - * - * @param [in] handle - * - handle from tel_init() - * - * @param[in] CallHandle - * - Unique handle for referring the call. - * - * @param [in] callback - * - To register callback function for result of this function. - * - * @param [in] user_data - * - user data for user specification - * - * @par Async Response Message: - * - The event associated with this request is TAPI_EVENT_CALL_RELEASE_CNF and Asynchronous return status - * is indicated by #TelCallCause_t and call handle for the released call is sent in the event data.. - * - * - The event TAPI_EVENT_CALL_END_IND_IND is received as final asynchronous response and the associated data is #TelCallEndInfo_t. - * Asynchronous return status is indicated by #TelCallCause_t. - * - * @pre - * - Initialize Dbus connection with #tel_init - * - Register caller's application name with #tel_register_app_name - * - Register telephony events to listen - * - A event loop is running to listen events - * - Call handle should be valid and there should be an existing call in Active/hold state. - * - * @post - * - None. - * - * @return Return Type (TapiHandle *handle, int) \n - * - 0 - indicating that the operation has completed successfully. \n - * - Else it will return failure and error code (TapiHandle *handle, Refer Doxygen doc or #TapiResult_t) - * - * @par Prospective Clients: - * Embedded call application - * - * @see tel_exe_call_mo tel_answer_call tel_release_call_all tel_release_call_all_active - * - * @code - * #include - * - * int ret_status ; - * unsigned int pCallHandle; - * int pRequestID=0; - * - * ret_status = tel_release_call(TapiHandle *handle, pCallHandle,&pRequestID, tapi_response_cb callback, void *user_data); // call release - * @endcode - * - * - * @remarks - * - None - * - * - */ -int tel_end_call(TapiHandle *handle, unsigned int CallHandle, TelCallEndType_t EndType, tapi_response_cb callback, void *user_data); - - - /** - * - * @brief This function puts the given call on hold. The call identified by Call Handle should be in active state. - * - * This API makes Dbus method call to Telephony Sever and gets immediate feedback. - * However it just means that the API request has been transfered to the CP successfully. - * The actual operation result is being delivered in the corresponding event asynchronously. - * - * - * @par Sync (TapiHandle *handle, or) Async: - * This is an Asynchronous API. - * - * @par Important Notes: - * - Call duration for the call will be calculated from the time call has been connected until call is released, - * i.e. Time duration during the call on hold will also be counted. - * - * @warning - * Do not use this function. This function is dedicated to the embedded call application only. - * Please use its AUL interface instead of this. - * - * - * @param [in] handle - * - handle from tel_init() - * - * @param[in] CallHandle - * - Unique handle for referring the call. - * - * @param [in] callback - * - To register callback function for result of this function. - * - * @param [in] user_data - * - user data for user specification - * - * @par Async Response Message: - * - The event associated with this request is TAPI_EVENT_CALL_HOLD_CNF. Asynchronous return status is - * indicated by #TelCallCause_t and call handle is sent in the event data. - * - * @pre - * - Initialize Dbus connection with #tel_init - * - Register caller's application name with #tel_register_app_name - * - Register telephony events to listen - * - A event loop is running to listen events - * - The call identified by the Call Handle should be in active state. - * - * @post - * - None. - * - * @return Return Type (TapiHandle *handle, int) \n - * - 0 - indicating that the operation has completed successfully. \n - * - Else it will return failure and error code (TapiHandle *handle, Refer Doxygen doc or #TapiResult_t) - * - * @par Prospective Clients: - * Embedded call application - * - * @code - * #include - * - * int ret_status ; - * unsigned int pCallHandle;//HANDLE OF AN ACTIVE CALL - * int pRequestID=0; - * - * ret_status = tel_hold_call(TapiHandle *handle, pCallHandle,&pRequestID, tapi_response_cb callback, void *user_data); // hold call - * @endcode - * - * - * @see tel_retrieve_call - * - * @remarks - * - None - * - * - */ - int tel_hold_call(TapiHandle *handle, unsigned int CallHandle, tapi_response_cb callback, void *user_data); - - /** - * - * @brief This function retrieves the held call. The call identified by Call Handle must be in held state. - * - * This API makes Dbus method call to Telephony Sever and gets immediate feedback. - * However it just means that the API request has been transfered to the CP successfully. - * The actual operation result is being delivered in the corresponding event asynchronously. - * - * - * @par Sync (TapiHandle *handle, or) Async: - * This is an Asynchronous API. - * - * @par Important Notes: - * - Call duration for the call will be calculated from the moment call has been connected until call is released. - * - * @warning - * Do not use this function. This function is dedicated to the embedded call application only. - * Please use its AUL interface instead of this. - * - None. - * - * - * @param [in] handle - * - handle from tel_init() - * - * @param[in] CallHandle - * - Unique handle for referring the call. - * - * @param [in] callback - * - To register callback function for result of this function. - * - * @param [in] user_data - * - user data for user specification - * - * @par Async Response Message: - * - The event associated with this request is TAPI_EVENT_CALL_RETRIEVE_CNF. Asynchronous return status is indicated - * by #TelCallCause_t and call handle is sent in the event data. - * - * @pre - * - Initialize Dbus connection with #tel_init - * - Register caller's application name with #tel_register_app_name - * - Register telephony events to listen - * - A event loop is running to listen events - * - Call should be in held state in order to retrieve into active state and no active call present. - * - * @post - * - None. - * - * @return Return Type (TapiHandle *handle, int) \n - * - 0 - indicating that the operation has completed successfully. \n - * - Else it will return failure and error code (TapiHandle *handle, Refer Doxygen doc or #TapiResult_t) - * - * @par Prospective Clients: - * Embedded call application - * - * @see tel_retrieve_call - * - * @code - * #include - * - * int ret_status ; - * unsigned int pCallHandle;//held call handle - * int pRequestID=0; - * - * ret_status = tel_retrieve_call(TapiHandle *handle, pCallHandle,&pRequestID, tapi_response_cb callback, void *user_data); // retrieve call - * @endcode - * - * @remarks - * - None - * - * - */ -int tel_active_call(TapiHandle *handle, unsigned int CallHandle, tapi_response_cb callback, void *user_data); - - /** - * - * @brief Swap calls. This is only for calls you dialed or answered with Telephony. - * Swap is only available for the voice calls. - * - * This API makes Dbus method call to Telephony Sever and gets immediate feedback. - * However it just means that the API request has been transfered to the CP successfully. - * The actual operation result is being delivered in the corresponding event asynchronously. - * - * @par Notes: - * During a call, user can place all active calls and accepts the other held call with this function. - * If the terminal is not within a call, it will fail. - * - * - * @par Sync (TapiHandle *handle, or) Async: - * This is an Asynchronous API. - * - * @par Important Notes: - * - None. - * - * @warning - * Do not use this function. This function is dedicated to the embedded call application only. - * Please use its AUL interface instead of this. - * - * - * @param [in] handle - * - handle from tel_init() - * - * @param[in] CallHandle1 - * - This is active call - * - * @param[in] CallHandle2 - * - This is Held call - * - * @param [in] callback - * - To register callback function for result of this function. - * - * @param [in] user_data - * - user data for user specification - * - * @par Async Response Message: - * - - * - * @pre - * - Initialize Dbus connection with #tel_init - * - Register caller's application name with #tel_register_app_name - * - Register telephony events to listen - * - A event loop is running to listen events - * - None. - * - * @post - * - None. - * - * @return Return Type (TapiHandle *handle, int) \n - * - 0 - indicating that the operation has completed successfully. \n - * - Else it will return failure and error code (TapiHandle *handle, Refer Doxygen doc or #TapiResult_t) - * - * @par Prospective Clients: - * Embedded call application - * - * @code - * #include - * - * int ret_status ; - * unsigned int pCallHandle1; - * unsigned int pCallHandle2; - * int pRequestID=0; - * - * ret_status = tel_swap_call(TapiHandle *handle, pCallHandle1, pCallHandle2,&pRequestID, tapi_response_cb callback, void *user_data); // swap call - * @endcode - * - * @see None. - * - * @remarks - * - None - * - * - */ - int tel_swap_call(TapiHandle *handle, unsigned int CallHandle1, unsigned int CallHandle2, tapi_response_cb callback, void *user_data); - - /** - * - * @brief This function sends one or more DTMF digits during the call. - * - * @par Notes: - * DTMF is abbreviation of Dual-tone-multi-frequency. It is used for telecommunication signaling - * over telephone lines in the voice-frequency band between UE and other communications devices. - * For example UE send DTMF tone to a server to choose options which the server provides. - * If the UE is not within a call, this function will fail with error code. * - * - * This function makes Dbus method call to Telephony Sever and gets immediate feedback. - * However it just means that the API request has been transfered to the CP successfully. - * The actual operation result is being delivered in the corresponding event asynchronously. - * - * @par Sync (TapiHandle *handle, or) Async: - * This is an Asynchronous API. - * - * @par Important Notes: - * -There will be a single asynchronous notification for all the DTMF digits sent. If the users of this API need an asynchronous - * response for each DTMF digit then User has to call this API multiple times passing each single DTMF digit in pDtmfString. - * - * @warning - * Do not use this function. This function is dedicated to the embedded call application only. - * Please use its AUL interface instead of this. - * - * - * @param [in] handle - * - handle from tel_init() - * - * @param[in] pDtmfString - * - A Null terminated DTMF string to be sent from MS. - * - * @param [in] callback - * - To register callback function for result of this function. - * - * @param [in] user_data - * - user data for user specification - * - * @par Async Response Message: - * - The event associated with this request is TAPI_EVENT_CALL_SEND_DTMF_CNF. Asynchronous return status - * is indicated by #TelCallCause_t and call handle is sent in the event data. - * - * @pre - * - Initialize Dbus connection with #tel_init - * - Register caller's application name with #tel_register_app_name - * - Register telephony events to listen - * - A event loop is running to listen events - * - Active call should be present. - * - * @post - * - None. - * - * @return Return Type (TapiHandle *handle, int) \n - * - 0 - indicating that the operation has completed successfully. \n - * - Else it will return failure and error code (TapiHandle *handle, Refer Doxygen doc or #TapiResult_t) - * - * @par Prospective Clients: - * Embedded call application - * - * - * \image html CallDtmf.jpg - * \image latex CallDtmf.jpg - * - * @code - * #include - * - * int ret_status ; - * unsigned int pCallHandle; - * int pRequestID=0; - * char DtmfString[10] = {0, }; - * strcpy(TapiHandle *handle, DtmfString, "123456789", tapi_response_cb callback, void *user_data);//Sample DTMF digits that need to be sent - * ret_status= tel_send_call_dtmf(TapiHandle *handle, DtmfString,&pRequestID, tapi_response_cb callback, void *user_data); - * @endcode - * - * - * @see None. - * - * @remarks - * - None - * - * - */ - int tel_call_dtmf(TapiHandle *handle, const char *pDtmfString, tapi_response_cb callback, void *user_data); - - /** - * - * @brief This function joins the given two calls (TapiHandle *handle, one call in active conversation state and other call in held state) into conference. - * - * This function makes Dbus method call to Telephony Sever and gets immediate feedback. - * However it just means that the API request has been transfered to the CP successfully. - * The actual operation result is being delivered in the corresponding event asynchronously. - * - * - * @par Sync (TapiHandle *handle, or) Async: - * This is an Asynchronous API. - * - * @par Important Notes: - * - Call handle of an active call or held call will be made as MPTY-id, and the other call handle will join in a conference). - * - * @warning - * Do not use this function. This function is dedicated to the embedded call application only. - * Please use its AUL interface instead of this. - * - * - * @param [in] handle - * - handle from tel_init() - * - * @param[in] CallHandle1 - * - The unique handle can be either an active call or held call. - * - * @param[in] CallHandle2 - * - Unique call handle. - * - * @param [in] callback - * - To register callback function for result of this function. - * - * @param [in] user_data - * - user data for user specification - * - * @par Async Response Message: - * - The event associated with this request is TAPI_EVENT_CALL_SETUPCONFERENCE_CNF. Asynchronous return - * status is indicated by #TelCallCause_t and call handle of the MPTY call is sent in the event data. - * - * @pre - * - Initialize Dbus connection with #tel_init - * - Register caller's application name with #tel_register_app_name - * - Register telephony events to listen - * - A event loop is running to listen events - * - 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. - * - * @post - * - None. - * - * @return Return Type (TapiHandle *handle, int) \n - * - 0 - indicating that the operation has completed successfully. \n - * - Else it will return failure and error code (TapiHandle *handle, Refer Doxygen doc or #TapiResult_t) - * - * @par Prospective Clients: - * Embedded call application - * - * @see tel_split_call - * - * @code - * #include - * - * int ret_status ; - * unsigned int pCallHandle1; - * unsigned int pCallHandle2; - * int pRequestID=0; - * - * ret_status= tel_join_call(TapiHandle *handle, pCallHandle1, pCallHandle2,&pRequestID, tapi_response_cb callback, void *user_data); // call join - * @endcode - * - * @remarks - * - None - * - * - * - * - */ - int tel_join_call(TapiHandle *handle, unsigned int CallHandle1, unsigned int CallHandle2, tapi_response_cb callback, void *user_data); - - /** - * - * @brief This function triggers to splits a private call from multiparty call. This API allows creating a private communication - * with one of remote parties in a multiparty session. TAPI client application has to pass the call handle which needs - * to split from the multiparty call. - * - * This function makes Dbus method call to Telephony Sever and gets immediate feedback. - * However it just means that the API request has been transfered to the CP successfully. - * The actual operation result is being delivered in the corresponding event asynchronously. - * - * - * @par Sync (TapiHandle *handle, or) Async: - * This is an Asynchronous API. - * - * @par Important Notes: - * - The list of call handles present in the conference call is retrieved using #tel_get_call_conf_list API - * - * @warning - * Do not use this function. This function is dedicated to the embedded call application only. - * Please use its AUL interface instead of this. - * - * - * @param [in] handle - * - handle from tel_init() - * - * @param[in] CallHandle - * - Handle of call to be made private. Call handle referring to the call that is to be split from the conference - * (TapiHandle *handle, call to be made private). - * - * @param [in] callback - * - To register callback function for result of this function. - * - * @param [in] user_data - * - user data for user specification - * - * @par Async Response Message: - * - The event associated with this request is TAPI_EVENT_CALL_SPLITCONFERENCE_CNF. Asynchronous return status - * is indicated by #TelCallCause_t and call handle for the split call is sent in the event data. - * - * @pre - * - Initialize Dbus connection with #tel_init - * - Register caller's application name with #tel_register_app_name - * - Register telephony events to listen - * - A event loop is running to listen events - * - Call should be in multiparty conference call. - * - * @post - * - Split call will be the active call and the conference will be held call. - * - * @return Return Type (TapiHandle *handle, int) \n - * - 0 - indicating that the operation has completed successfully. \n - * - Else it will return failure and error code (TapiHandle *handle, Refer Doxygen doc or #TapiResult_t) - * - * @par Prospective Clients: - * Embedded call application - * - * @see tel_join _call - * - * @code - * #include - * - * int ret_status ; - * unsigned int pCallHandle; - * int pRequestID=0; - * - * ret_status= tel_split_call(TapiHandle *handle, pCallHandle,&pRequestID, tapi_response_cb callback, void *user_data); // call split - * @endcode - * - * @remarks - * - None - * - * - * - * - */ - int tel_split_call(TapiHandle *handle, unsigned int CallHandle, tapi_response_cb callback, void *user_data); - - /** - * - * @brief Get the current calling line identification number. - * - * This function makes Dbus method call to Telephony Sever and gets immediate feedback. - * However it just means that the API request has been transfered to the CP successfully. - * The actual operation result is being delivered in the corresponding event asynchronously. - * - * @par Notes: - * If the USIM card has multiple number, an user can choose which number he use. - * For example, a line is for private, the other line is for business. - * Using this function, user can get information about which line is currently active. - * - * This API makes Dbus method call to Telephony Sever and gets immediate feedback. - * However it just means that the API request has been transfered to the CP successfully. - * The actual operation result is being delivered in the corresponding event asynchronously. - * - * @par Sync (TapiHandle *handle, or) Async: - * This is an Asynchronous API. - * - * @par Important Notes: - * NONE - * - * @warning - * Do not use this function. This function is dedicated to the embedded call application only. - * Please use its AUL interface instead of this. - * - * @param [out] ptr_active_line - * current active line id. - * - * - * @param [in] handle - * - handle from tel_init() - * - * @param [in] callback - * - To register callback function for result of this function. - * - * @param [in] user_data - * - user data for user specification - * - * @pre - * - Initialize Dbus connection with #tel_init - * - Register caller's application name with #tel_register_app_name - * - Register telephony events to listen - * - A event loop is running to listen events - * - * @post - * - None. - * - * @return Return Type (TapiHandle *handle, int) \n - * - 0 - indicating that the operation has completed successfully. \n - * - Else it will return failure and error code (TapiHandle *handle, Refer Doxygen doc or #TapiResult_t) - * - * @par Prospective Clients: - * Embedded call application - * - * @see tel_set_call_act_line - * - * @code - * #include - * - * int pRequestID=0; - * ret_status= tel_get_call_act_line(TapiHandle *handle, &pRequestID, tapi_response_cb callback, void *user_data); // get call active line - * @endcode - * - * @remarks - * - None - * - * - */ - int tel_get_call_act_line(TapiHandle *handle, tapi_response_cb callback, void *user_data); - - /** - * - * @brief Set the current calling line identification number. - * - * This function makes Dbus method call to Telephony Sever and gets immediate feedback. - * However it just means that the API request has been transfered to the CP successfully. - * The actual operation result is being delivered in the corresponding event asynchronously. - * - * - * @par Sync (TapiHandle *handle, or) Async: - * This is an Asynchronous API. - * - * @par Important Notes: - * NONE - * - * @warning - * Do not use this function. This function is dedicated to the embedded call application only. - * Please use its AUL interface instead of this. - * - * - * @param [in] handle - * - handle from tel_init() - * - * @param[in] active_line - * - calling line identification - * - * @param [in] callback - * - To register callback function for result of this function. - * - * @param [in] user_data - * - user data for user specification - * - * @pre - * - Initialize Dbus connection with #tel_init - * - Register caller's application name with #tel_register_app_name - * - Register telephony events to listen - * - A event loop is running to listen events - * - * @post - * - None. - * - * @return Return Type (TapiHandle *handle, int) \n - * - 0 - indicating that the operation has completed successfully. \n - * - Else it will return failure and error code (TapiHandle *handle, Refer Doxygen doc or #TapiResult_t) - * - * @par Prospective Clients: - * Embedded call application - * - * @see tel_get_call_act_line - * - * @code - * #include - * - * int ret_status ; - * TelCallActiveLine_t g_curLine =TAPI_CALL_ACTIVE_LINE1; - * TelCallActiveLine_t active_line ; - * int pRequestID=0; - * - * ret_status = tel_set_call_act_line (TapiHandle *handle, g_curLine,&pRequestID, tapi_response_cb callback, void *user_data); // set call active line - * @endcode - * - * @remarks - * - None - * - * - */ - int tel_set_call_act_line(TapiHandle *handle, TelCallActiveLine_t active_line, tapi_response_cb callback, void *user_data); - - /** - * - * @brief This function triggers to do an explicit call transfer by connecting the two parties where in one party being - * active (TapiHandle *handle, active state) and another party being held (TapiHandle *handle, held state). - * - * This function makes Dbus method call to Telephony Sever and gets immediate feedback. - * However it just means that the API request has been transfered to the CP successfully. - * The actual operation result is being delivered in the corresponding event asynchronously. - * - * @par Notes: - * The ECT supplementary service enables the served mobile subscriber (TapiHandle *handle, subscriber A) who has two calls, - * each of which can be an incoming or outgoing call, to connect the other parties in the two calls - * and release the served mobile subscribers own connection. - * Prior to transfer, the connection shall have been established on the call - * between subscriber A and subscriber B. On the call between subscriber A and subscriber C, - * either the connection shall have been established prior to transfer, or, as a network option, - * transfer can occur while subscriber C is being informed of the call - * (TapiHandle *handle, i.e. the connection has not yet been established.) - * - * - * @par Sync (TapiHandle *handle, or) Async: - * This is an Asynchronous API. - * - * @par Important Notes: - * - None. - * - * @warning - * Do not use this function. This function is dedicated to the embedded call application only. - * Please use its AUL interface instead of this. - * - * - * @param [in] handle - * - handle from tel_init() - * - * @param[in] CallHandle - * - Call handle of an active call. - * - * @param [in] callback - * - To register callback function for result of this function. - * - * @param [in] user_data - * - user data for user specification - * - * @par Async Response Message: - * - The event associated with this request is TAPI_EVENT_CALL_TRANSFER_CNF. Asynchronous return status is - * indicated by #TelCallCause_t and call handle is sent in the event data. Call handle in event data is active - * call handle which is used in the #tel_exe_call_explicit_transfer request. - * - * @pre - * - In order to call transfer, Served mobile subscriber should have 2 calls in one in active state and another one Call - * in Held state. - * - * @post - * - When the request has been completed successfully, Call end indication will be sent to both the calls (TapiHandle *handle, active and held). - * - * @return Return Type (TapiHandle *handle, int) \n - * - 0 - indicating that the operation has completed successfully. \n - * - Else it will return failure and error code (TapiHandle *handle, Refer Doxygen doc or #TapiResult_t) - * - * @par Prospective Clients: - * Embedded call application - * - * @see None. - * - * @code - * #include - * - * int ret_status ; - * unsigned int pCallHandle;//active call - * int pRequestID=0; - * - * ret_status= tel_exe_call_explicit_transfer (TapiHandle *handle, pCallHandle,&pRequestID, tapi_response_cb callback, void *user_data); // explicit transfer - * @endcode - * - * @remarks - * -None - * - * - */ - int tel_transfer_call(TapiHandle *handle, unsigned int CallHandle, tapi_response_cb callback, void *user_data); - - -/** - * - * @brief This function gets status for the current call identified by Call Handle whenever application wants the call status. Call handle must be valid. - * - * This function makes Dbus method call to Telephony Sever and gets immediate feedback. - * However it just means that the API request has been transfered to the CP successfully. - * The actual operation result is being delivered in the corresponding event asynchronously. - * - * - * @par Sync (TapiHandle *handle, or) Async: - * This is a Synchronous API. - * - * @par Important Notes: - * - None. - * - * @warning - * Do not use this function. This function is dedicated to the embedded call application only. - * Please use its AUL interface instead of this. - * - * - * @param [in] handle - * - handle from tel_init() - * - * @param[in] CallHandle - * - Unique handle for referring the call. - * - * @param [out] pCallStatus - * - Call status information like destination number, call direction (TapiHandle *handle, MO or MT), call type (TapiHandle *handle, voice or data etc), whether - * the call is in conference state or not, present call state etc are returned through this parameter. - * - * @par Async Response Message: - * - None. - * - * @pre - * - Initialize Dbus connection with #tel_init - * - Register caller's application name with #tel_register_app_name - * - Register telephony events to listen - * - A event loop is running to listen events - * - * @post - * - None. - * - * @return Return Type (TapiHandle *handle, int) \n - * - 0 - indicating that the operation has completed successfully. \n - * - Else it will return failure and error code (TapiHandle *handle, Refer Doxygen doc or #TapiResult_t) - * - * @par Prospective Clients: - * Embedded call application - * - * - * - * - * @code - * #include - * - * int ret_status ; - * unsigned int CallHandle; - * TelCallStatus_t callStatus; - * - * ret_status= tel_get_call_status(TapiHandle *handle, CallHandle,&callStatus, tapi_response_cb callback, void *user_data); // get call status info - * @endcode - * - * - * @see None. - * - * @remarks - * - None - * - * - */ -int tel_get_call_status(TapiHandle *handle, int call_id, TelCallStatus_t *out ); - - -int tel_get_call_status_all(TapiHandle *handle, TelCallStatusCallback cb, void *user_data) ; - - - /** - * - * @brief This function gets duration of the given call. This is a synchronous function. Duration is accounted from the moment - * the connection is established, i.e. call goes into active state for first time. - * - * This function makes Dbus method call to Telephony Sever and gets immediate feedback. - * However it just means that the API request has been transfered to the CP successfully. - * The actual operation result is being delivered in the corresponding event asynchronously. - * - * - * @par Sync (TapiHandle *handle, or) Async: - * This is a Synchronous API. - * - * @par Important Notes: - * - None. - * - * @warning - * Do not use this function. This function is dedicated to the embedded call application only. - * Please use its AUL interface instead of this. - * - * - * @param [in] handle - * - handle from tel_init() - * - * @param[in] CallHandle - * - Unique handle for referring the call. - * - * @param [out] pDurationInSecs - * - The total call duration in seconds from the call connecting time to the present time is returned through this parameter. - * - * @par Async Response Message: - * - None. - * - * @pre - * - Initialize Dbus connection with #tel_init - * - Register caller's application name with #tel_register_app_name - * - Register telephony events to listen - * - A event loop is running to listen events - * - * @post - * - None. - * - * @return Return Type (TapiHandle *handle, int) \n - * - TAPI_API_SUCCESS - indicating that the operation has completed successfully. \n - * - Else it will return failure and error code (TapiHandle *handle, Refer #TapiResult_t) - * - * @par Prospective Clients: - * Embedded call application - * - * - * @code - * #include - * - * int ret_status ; - * unsigned int CallHandle; - * unsigned int duration; - * - * ret_status= tel_get_call_duration(TapiHandle *handle, CallHandle,&duration, tapi_response_cb callback, void *user_data); // get call duration - * @endcode - * - * - * @see None. - * - * @remarks - * - None - * - * - */ - int tel_get_call_duration(TapiHandle *handle, unsigned int CallHandle, unsigned int * pDurationInSecs) ; - - /** - *@brief Deflect the incoming call to other subscriber - * - * If informed about an incoming call this call may be redirected to an another destination by - * entering the destination Number. The cleint spcifies the dstiantion number to which the current - * incoming call needs to be redirected is specifed via info argument. - * - * - * @par Sync (TapiHandle *handle, or) Async: - * This is an Asynchronous API. - * - * @par Important Notes: - * - None. - * - * @warning - * Do not use this function. This function is dedicated to the embedded call application only. - * Please use its AUL interface instead of this. - * - * - * @param [in] handle - * - handle from tel_init() - * - * @param[in] CallHandle - * - This is incoming call handle - * - * @param[out] deflect_info - * - Destination Number - * - * @param [in] callback - * - To register callback function for result of this function. - * - * @param [in] user_data - * - user data for user specification - * - * @par Async Response Message: - * - - * - * @pre - * - Initialize Dbus connection with #tel_init - * - Register caller's application name with #tel_register_app_name - * - Register telephony events to listen - * - A event loop is running to listen events - * - * @post - * - None. - * - * @return Return Type (TapiHandle *handle, int) \n - * - 0 indicating that the operation has completed successfully. \n - * - Else it will return failure and error code (TapiHandle *handle, Refer Doxygen doc or #TapiResult_t) - * - * @par Prospective Clients: - * Embedded call application - * - * @remarks - * - None - * - * @code - * #include - * #include - * - * unsigned int call_handle; - * TelCallDeflectDstInfo_t deflect_info; - * int req_id; - * - * tel_deflect_call(TapiHandle *handle, call_handel, &deflect_info, req_id, tapi_response_cb callback, void *user_data); // call deflect - * - * @endcode - * - * @see None. - * - * @remarks - * - None - * - */ - int tel_deflect_call(TapiHandle *handle, unsigned int CallHandle, const TelCallDeflectDstInfo_t *deflect_info, tapi_response_cb callback, void *user_data); - - - /** - * - * @brief Activate Call Completion to a Busy Subscriber. - * - * @par Notes: - * When subscriber A encounters a Network Determined User Busy (TapiHandle *handle, NDUB) destination B, - * subscriber A can request the CCBS supplementary service (TapiHandle *handle, i.e. activate a CCBS Request against destination B). - * The network will then monitor the wanted destination B for becoming idle. - * When the wanted destination B becomes idle, then the network will wait a short time - * in order to allow destination B to make an outgoing call. - * If destination B does not make any outgoing call within this time, - * then the network shall automatically recall subscriber A. - * When subscriber A accepts the CCBS recall, within a defined time, then the network will automatically - * generate a CCBS call to destination B. - * - * This function makes Dbus method call to Telephony Sever and gets immediate feedback. - * However it just means that the API request has been transfered to the CP successfully. - * The actual operation result is being delivered in the corresponding event asynchronously. - * - * @par Sync (TapiHandle *handle, or) Async: - * This is an Asynchronous API. - * - * @par Important Notes: - * - None. - * - * @warning - * Do not use this function. This function is dedicated to the embedded call application only. - * Please use its AUL interface instead of this. - * - * - * @param [in] handle - * - handle from tel_init() - * - * @param [in] CallHandle - * - Handle of the call. - * - * @param [in] callback - * - To register callback function for result of this function. - * - * @param [in] user_data - * - user data for user specification - * - * @par Async Response Message: - * - - * - * @pre - * - Initialize Dbus connection with #tel_init - * - Register caller's application name with #tel_register_app_name - * - Register telephony events to listen - * - A event loop is running to listen events - * - * @post - * - None. - * - * @return Return Type (TapiHandle *handle, int) \n - * - 0 - indicating that the operation has completed successfully. \n - * - Else it will return failure and error code (TapiHandle *handle, Refer Doxygen doc or #TapiResult_t) - * - * @par Prospective Clients: - * Embedded call application - * - * @code - * #include - * - * int ret; - * unsigned int call_handle; - * int req_id; - * - * ret = tel_activate_call_ccbs(TapiHandle *handle, call_handle, &req_id, tapi_response_cb callback, void *user_data); // ccbs activate - * @endcode - * - * - * @see None. - * - * @remarks - * - None - * - */ - int tel_activate_call_ccbs(TapiHandle *handle, unsigned int CallHandle, tapi_response_cb callback, void *user_data); - - - /** - * @brief This is a synchronous function returns all call handles within the given conference call. - * - * This function makes Dbus method call to Telephony Sever and gets immediate feedback. - * However it just means that the API request has been transfered to the CP successfully. - * The actual operation result is being delivered in the corresponding event asynchronously. - * - * @par Sync (TapiHandle *handle, or) Async: - * This is a Synchronous API. - * - * @par Important Notes: - * - Call should be a Multi-party conference call in order to return actual no of calls and call handles in the conference calls. - * - * @warning - * Do not use this function. This function is dedicated to the embedded call application only. - * Please use its AUL interface instead of this. - * - * - * @param [in] handle - * - handle from tel_init() - * - * @param[in] CallHandle - * - Handle of call which is associated with the conference. - * - * @param [out] pCallList - * - list of call joined in the conference call. In case there is no active conference. The list will be zero and - * number of calls parameter value will also be zero. Maximum number of calls in a conference can be up to 5 - * (TapiHandle *handle, Based on 3GPP TS 22.084). Memory allocation for call list is integer array of size 5. - * - * @param [out] pNoOfCalls - * - Number of the calls present in conference. - * - * @par Async Response Message: - * -None. - * - * @pre - * - Initialize Dbus connection with #tel_init - * - Register caller's application name with #tel_register_app_name - * - Register telephony events to listen - * - A event loop is running to listen events - * - * @post - * -None. - * - * @return Return Type (TapiHandle *handle, int) \n - * - 0 - indicating that the operation has completed successfully. \n - * - Else it will return failure and error code (TapiHandle *handle, Refer Doxygen doc or #TapiResult_t) - * - * @par Prospective Clients: - * Embedded call application - * - * @code - * #include - * - * int ret_status ; - * unsigned int CallHandle; - * unsigned int callList[5]; - * int noOfCalls; - * - * ret_status= tel_get_call_conf_list(TapiHandle *handle, CallHandle, callList, &noOfCalls, tapi_response_cb callback, void *user_data); // get conference call list - * @endcode - * - * @see tel_join_call - * - * @remarks - * - None - * - * - */ -int tel_get_call_conf_list(TapiHandle *handle, unsigned int CallHandle, unsigned int *pCallList, int *pNoOfCalls); - - - /** - * - * @brief This function gets voice privacy option mode in phone(TapiHandle *handle, CDMA only). - * - * This function makes Dbus method call to Telephony Sever and gets immediate feedback. - * However it just means that the API request has been transfered to the CP successfully. - * The actual operation result is being delivered in the corresponding event asynchronously. - * - * @par Sync (TapiHandle *handle, or) Async: - * This is a Asynchronous API. - * - * @par Important Notes: - * - None. - * - * @warning - * Do not use this function. This function is dedicated to the embedded call application only. - * Please use its AUL interface instead of this. - * - * - * @param [in] handle - * - handle from tel_init() - * - * @param[in] PrivacyType - * - Privacy Type. - * - * @param [in] callback - * - To register callback function for result of this function. - * - * @param [in] user_data - * - user data for user specification - * - * @par Async Response Message: - * - The event associated with this request is TAPI_EVENT_CALL_GET_PRIVACYMODE_CNF. Asynchronous return status - * is indicated by #TelCallCause_t. #TelCallPrivacyMode_t is included in this event. - * - * - * @pre - * - Initialize Dbus connection with #tel_init - * - Register caller's application name with #tel_register_app_name - * - Register telephony events to listen - * - A event loop is running to listen events - * - * @post - * - None. - * - * @return Return Type (TapiHandle *handle, int) \n - * - 0 - indicating that the operation has completed successfully. \n - * - Else it will return failure and error code (TapiHandle *handle, Refer Doxygen doc or #TapiResult_t) - * - * @par Prospective Clients: - * Embedded call application - * - * - * - * @code - * #include - * - * 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 (TapiHandle *handle, privacyType,&req_id, tapi_response_cb callback, void *user_data); // get call privacy_mode - * @endcode - * - * - * @see None. - * - * @remarks - * - None - * - * - */ - int tel_get_call_privacy_mode(TapiHandle *handle, TelCallPrivacyType_t PrivacyType, tapi_response_cb callback, void *user_data); - - - /** - * - * @brief This function sets voice privacy option mode in phone. It is available only where call exists(TapiHandle *handle, CDMA only). - * - * - * This function makes Dbus method call to Telephony Sever and gets immediate feedback. - * However it just means that the API request has been transfered to the CP successfully. - * The actual operation result is being delivered in the corresponding event asynchronously. - * - * @par Sync (TapiHandle *handle, or) Async: - * This is a Asynchronous API. - * - * @par Important Notes: - * - None. - * - * @warning - * Do not use this function. This function is dedicated to the embedded call application only. - * Please use its AUL interface instead of this. - * - * - * @param [in] handle - * - handle from tel_init() - * - * @param[in] PrivacyInfo - * - voice privacy option mode(TapiHandle *handle, ENHANCED or STANDARD) - * - * @param [in] callback - * - To register callback function for result of this function. - * - * @param [in] user_data - * - user data for user specification - * - * @par Async Response Message: - * - The event associated with this request is TAPI_EVENT_CALL_SET_PRIVACYMODE_CNF. Asynchronous return status - * is indicated by #TelCallCause_t. - * - * - * @pre - * - Initialize Dbus connection with #tel_init - * - Register caller's application name with #tel_register_app_name - * - Register telephony events to listen - * - A event loop is running to listen events - * - * @post - * - None. - * - * @return Return Type (TapiHandle *handle, int) \n - * - 0 - indicating that the operation has completed successfully. \n - * - Else it will return failure and error code (TapiHandle *handle, Refer Doxygen doc or #TapiResult_t) - * - * @par Prospective Clients: - * Embedded call application - * - * - * - * @code - * #include - * - * int ReqId=-1; - * int ret_status = -1; - * int api_err; - * TelCallPrivacyMode_t pPrivacyMode_info={0,}; - * pPrivacyMode_info = TAPI_CALL_PRIVACY_MODE_STANDARD; - * - * ret_status = tel_set_call_privacy_mode (TapiHandle *handle, pPrivacyMode_info,&reqId, tapi_response_cb callback, void *user_data); // set call privacy mode - * @endcode - * - * @see None. - * - * @remarks - * - None - * - * - */ - int tel_set_call_privacy_mode(TapiHandle *handle, TelCallVoicePrivacyInfo_t PrivacyInfo, tapi_response_cb callback, void *user_data); - - -/** - * - * @brief This function requests to send a Flash with Information Message(TapiHandle *handle, CDMA only). - * - * This function makes Dbus method call to Telephony Sever and gets immediate feedback. - * However it just means that the API request has been transfered to the CP successfully. - * The actual operation result is being delivered in the corresponding event asynchronously. - * - * - * @par Sync (TapiHandle *handle, or) Async: - * This is a Asynchronous API. - * - * @par Important Notes: - * - None. - * - * @warning - * Do not use this function. This function is dedicated to the embedded call application only. - * Please use its AUL interface instead of this. - * - * - * @param [in] handle - * - handle from tel_init() - * - * @param[in] pDialNumber - * - this is the calling number for 3 way call. But in the call waiting, this param should be NULL. - * - * @param [in] callback - * - To register callback function for result of this function. - * - * @param [in] user_data - * - user data for user specification - * - * @par Async Response Message: - * - The event associated with this request is TAPI_EVENT_CALL_FLASHINFO_CNF. Asynchronous return status - * is indicated by #TelCallCause_t. - * - * - * @pre - * - None. - * - * @post - * - None. - * - * @return Return Type (TapiHandle *handle, int) \n - * - 0 - indicating that the operation has completed successfully. \n - * - Else it will return failure and error code (TapiHandle *handle, Refer Doxygen doc or #TapiResult_t) - * - * @par Prospective Clients: - * Embedded call application - * - * @code - * #include - * - * int ret_status = -1; - * int api_err; - * char const * const pDialNumber = "9999900000"; - * ret_status = tel_exe_call_flash_info(TapiHandle *handle, pDialNumber,&reqId, tapi_response_cb callback, void *user_data); // call flash info - * @endcode - * - * @see None. - * - * @remarks - * - None - * - * - */ - int tel_exe_call_flash_info(TapiHandle *handle, const char *pDialNumber, tapi_response_cb callback, void *user_data); - - -/** - * - * @brief This function requests to exit emergency call mode(TapiHandle *handle, CDMA only). - * - * This function makes Dbus method call to Telephony Sever and gets immediate feedback. - * However it just means that the API request has been transfered to the CP successfully. - * The actual operation result is being delivered in the corresponding event asynchronously. - * - * @par Sync (TapiHandle *handle, or) Async: - * This is a Asynchronous API. - * - * @par Important Notes: - * - None. - * - * @warning - * Do not use this function. This function is dedicated to the embedded call application only. - * Please use its AUL interface instead of this. - * - * - * @param [in] handle - * - handle from tel_init() - * - * @param [in] callback - * - To register callback function for result of this function. - * - * @param [in] user_data - * - user data for user specification - * - * @par Async Response Message: - * - The event associated with this request is TAPI_EVENT_CALL_EXIT_EMERGENCYMODE_CNF. Asynchronous return status - * is indicated by #TelCallCause_t. - * - * @pre - * - current state is emergency callback mode. - * - * @post - * - None. - * - * @return Return Type (TapiHandle *handle, int) \n - * - 0 - indicating that the operation has completed successfully. \n - * - Else it will return failure and error code (TapiHandle *handle, Refer Doxygen doc or #TapiResult_t) - * - * @par Prospective Clients: - * Embedded call application - * - * @code - * #include - * - * int req_id; - * int ret; - * - * ret = tel_exit_call_emergency_mode (TapiHandle *handle, &req_id, tapi_response_cb callback, void *user_data); // emergency call - * - * @endcode - * - * @see None. - * - * @remarks - * - None - * - * - */ - int tel_exit_call_emergency_mode(TapiHandle *handle, tapi_response_cb callback, void *user_data); - - -/** - * - * @brief This function is used for querying the information about a call time and call count. - * - * This function makes Dbus method call to Telephony Sever and returns immediate value. - * However it just means that the API request has been transfered to the CP successfully. - * The actual operation result is being delivered in the corresponding event asynchronously. - * - * @par Sync (TapiHandle *handle, or) Async: - * This is a Asynchronous API. - * - * @par Important Notes: - * - None. - * - * @warning - * Do not use this function. This function is dedicated to the embedded call application only. - * Please use its AUL interface instead of this. - * - * - * @param [in] handle - * - handle from tel_init() - * - * @param[in] req_mask - * - call time request type mask. - * - * @param [in] callback - * - To register callback function for result of this function. - * - * @param [in] user_data - * - user data for user specification - * - * - * @par Async Response Message: - * - The event associated with this request is TAPI_EVENT_CALL_GET_CALL_TIME_CNF. Asynchronous return status - * is indicated by #TelCallCause_t. - * - * - * @pre - * - None. - * - * @post - * - None. - * - * @return Return Type (TapiHandle *handle, int) \n - * - 0 - indicating that the operation has completed successfully. \n - * - Else it will return failure and error code (TapiHandle *handle, Refer Doxygen doc or #TapiResult_t) - * - * @par Prospective Clients: - * Embedded call application - * - * @code - * #include - * - * int ret_status = -1; - * int api_err; - * TelCallTimeMaskType_t mask_byte1 = {0,}; - * TelCallTimeMaskType_t mask_byte2 = {0,}; - * unsigned short mask_type; - * mask_byte1 = TAPI_CALL_TIME_TYPE_TOTAL_CALL_CNT; //masking call type - * mask_byte2 = TAPI_CALL_TIME_TYPE_TOTAL_CALL_TIME; - * - * mask_type = mask_byte1; - * mask_type << 8; - * mask_type = mask_byte2; - * - * ret_status = tel_get_call_time(TapiHandle *handle, mask_type,&reqId, tapi_response_cb callback, void *user_data); - * - * @endcode - * - * @see None. - * - * @remarks - * - None - * - * - */ - int tel_get_call_time(TapiHandle *handle, unsigned short req_mask, tapi_response_cb callback, void *user_data); - - /** - * - * @brief This function is to get call volume. - * - * This function makes Dbus method call to Telephony Sever and returns immediate value. - * However it just means that the API request has been transfered to the CP successfully. - * The actual operation result is being delivered in the corresponding event asynchronously. - * - * @par Sync (TapiHandle *handle, or) Async: - * This is a Asynchronous API. - * - * @par Important Notes: - * - None. - * - * @warning - * - * - * - * @param [in] handle - * - handle from tel_init() - * - * @param [in] device - * - sound device - * - * @param [in] type - * - sound type - * - * @param [in] callback - * - To register callback function for result of this function. - * - * @param [in] user_data - * - user data for user specification - * - * @par Async Response Message: - * - TelCallGetVolumeInfoResp_t - * - * @pre - * - None. - * - * @post - * - None. - * - * @return Return Type (TapiHandle *handle, int) \n - * - 0 - indicating that the operation has completed successfully. \n - * - Else it will return failure and error code (TapiHandle *handle, Refer Doxygen doc or #TapiResult_t) - * - * @par Prospective Clients: - * Embedded call application - * - * @see None. - * - * @remarks - * - None - * - * - */ - - int tel_get_call_volume_info(TapiHandle *handle, TelSoundDevice_t device, TelSoundType_t type, tapi_response_cb callback, void *user_data ); - -/** - * - * @brief This function is to set call volume. - * - * This function makes Dbus method call to Telephony Sever and returns immediate value. - * However it just means that the API request has been transfered to the CP successfully. - * The actual operation result is being delivered in the corresponding event asynchronously. - * - * @par Sync (TapiHandle *handle, or) Async: - * This is a Asynchronous API. - * - * @par Important Notes: - * - None. - * - * @warning - * - * - * - * @param [in] handle - * - handle from tel_init() - * - * @param [in] path - * - call volume information - * - * @param [in] callback - * - To register callback function for result of this function. - * - * @param [in] user_data - * - user data for user specification - * - * @par Async Response Message: - * - None. - * - * @pre - * - None. - * - * @post - * - None. - * - * @return Return Type (TapiHandle *handle, int) \n - * - 0 - indicating that the operation has completed successfully. \n - * - Else it will return failure and error code (TapiHandle *handle, Refer Doxygen doc or #TapiResult_t) - * - * @par Prospective Clients: - * Embedded call application - * - * @see None. - * - * @remarks - * - None - * - * - */ - -int tel_set_call_volume_info(TapiHandle *handle, TelCallVolumeInfo_t *info, tapi_response_cb callback, void *user_data ); - -/** - * - * @brief This function is to set call sound path. - * - * This function makes Dbus method call to Telephony Sever and returns immediate value. - * However it just means that the API request has been transfered to the CP successfully. - * The actual operation result is being delivered in the corresponding event asynchronously. - * - * @par Sync (TapiHandle *handle, or) Async: - * This is a Asynchronous API. - * - * @par Important Notes: - * - None. - * - * @warning - * - * - * - * @param [in] handle - * - handle from tel_init() - * - * @param [in] path - * - call sound path information - * - * @param [in] callback - * - To register callback function for result of this function. - * - * @param [in] user_data - * - user data for user specification - * - * @par Async Response Message: - * - None. - * - * @pre - * - None. - * - * @post - * - None. - * - * @return Return Type (TapiHandle *handle, int) \n - * - 0 - indicating that the operation has completed successfully. \n - * - Else it will return failure and error code (TapiHandle *handle, Refer Doxygen doc or #TapiResult_t) - * - * @par Prospective Clients: - * Embedded call application - * - * @see None. - * - * @remarks - * - None - * - * - */ - -int tel_set_call_sound_path(TapiHandle *handle, TelCallSoundPathInfo_t *path, tapi_response_cb callback, void *user_data ); - -/** - * - * @brief This function is to set call mute state - * - * This function makes Dbus method call to Telephony Sever and returns immediate value. - * However it just means that the API request has been transfered to the CP successfully. - * The actual operation result is being delivered in the corresponding event asynchronously. - * - * @par Sync (TapiHandle *handle, or) Async: - * This is a Asynchronous API. - * - * @par Important Notes: - * - None. - * - * @warning - * - * - * - * @param [in] handle - * - handle from tel_init() - * - * @param [in] mute - * - Sound Mute Status - * - * @param [in] callback - * - To register callback function for result of this function. - * - * @param [in] user_data - * - user data for user specification - * - * @par Async Response Message: - * - None. - * - * @pre - * - None. - * - * @post - * - None. - * - * @return Return Type (TapiHandle *handle, int) \n - * - 0 - indicating that the operation has completed successfully. \n - * - Else it will return failure and error code (TapiHandle *handle, Refer Doxygen doc or #TapiResult_t) - * - * @par Prospective Clients: - * Embedded call application - * - * @see None. - * - * @remarks - * - None - * - * - */ - -int tel_set_call_mute_status(TapiHandle *handle, TelSoundMuteStatus_t mute, tapi_response_cb callback, void *user_data ); - -/** - * - * @brief This function is to get call mute state - * - * This function makes Dbus method call to Telephony Sever and returns immediate value. - * However it just means that the API request has been transfered to the CP successfully. - * The actual operation result is being delivered in the corresponding event asynchronously. - * - * @par Sync (TapiHandle *handle, or) Async: - * This is a Asynchronous API. - * - * @par Important Notes: - * - None. - * - * @warning - * - * - * - * @param [in] handle - * - handle from tel_init() - * - * @param [in] callback - * - To register callback function for result of this function. - * - * @param [in] user_data - * - user data for user specification - * - * @par Async Response Message: - * - TelCallGetMuteStatusResp_t - * - * @pre - * - None. - * - * @post - * - None. - * - * @return Return Type (TapiHandle *handle, int) \n - * - 0 - indicating that the operation has completed successfully. \n - * - Else it will return failure and error code (TapiHandle *handle, Refer Doxygen doc or #TapiResult_t) - * - * @par Prospective Clients: - * Embedded call application - * - * @see None. - * - * @remarks - * - None - * - * - */ - -int tel_get_call_mute_status(TapiHandle *handle, tapi_response_cb callback, void *user_data ); - -/** - * - * @brief This function is to set call sound recording - * - * This function makes Dbus method call to Telephony Sever and returns immediate value. - * However it just means that the API request has been transfered to the CP successfully. - * The actual operation result is being delivered in the corresponding event asynchronously. - * - * @par Sync (TapiHandle *handle, or) Async: - * This is a Asynchronous API. - * - * @par Important Notes: - * - None. - * - * @warning - * - * - * @param [in] handle - * - handle from tel_init() - * - * @param [in] on - * - Sound recording on / off - * - * @param [in] callback - * - To register callback function for result of this function. - * - * @param [in] user_data - * - user data for user specification - * - * @par Async Response Message: - * - None. - * - * @pre - * - None. - * - * @post - * - None. - * - * @return Return Type (TapiHandle *handle, int) \n - * - 0 - indicating that the operation has completed successfully. \n - * - Else it will return failure and error code (TapiHandle *handle, Refer Doxygen doc or #TapiResult_t) - * - * @par Prospective Clients: - * Embedded call application - * - * @see None. - * - * @remarks - * - None - * - * - */ - -int tel_set_call_sound_recording(TapiHandle *handle, TelSoundRecording_t *on, tapi_response_cb callback, void *user_data); - -/** - * - * @brief This function is to set call sound equalization. - * - * This function makes Dbus method call to Telephony Sever and returns immediate value. - * However it just means that the API request has been transfered to the CP successfully. - * The actual operation result is being delivered in the corresponding event asynchronously. - * - * @par Sync (TapiHandle *handle, or) Async: - * This is a Asynchronous API. - * - * @par Important Notes: - * - None. - * - * @warning - * - * - * @param [in] handle - * - handle from tel_init() - * - * @param [in] eq - * - call sound equalization information - * - * @param [in] callback - * - To register callback function for result of this function. - * - * @param [in] user_data - * - user data for user specification - * - * @par Async Response Message: - * - None. - * - * @pre - * - None. - * - * @post - * - None. - * - * @return Return Type (TapiHandle *handle, int) \n - * - 0 - indicating that the operation has completed successfully. \n - * - Else it will return failure and error code (TapiHandle *handle, Refer Doxygen doc or #TapiResult_t) - * - * @par Prospective Clients: - * Embedded call application - * - * @see None. - * - * @remarks - * - None - * - * - */ - -int tel_set_call_sound_equalization(TapiHandle *handle, TelCallSoundEqualization_t *eq, tapi_response_cb callback, void *user_data); - - /** - * - * @brief This function is used for querying the set call sound reduction. - * - * This function makes Dbus method call to Telephony Sever and returns immediate value. - * However it just means that the API request has been transfered to the CP successfully. - * The actual operation result is being delivered in the corresponding event asynchronously. - * - * @par Sync (TapiHandle *handle, or) Async: - * This is a Asynchronous API. - * - * @par Important Notes: - * - None. - * - * @warning - * - * - * - * @param [in] handle - * - handle from tel_init() - * - * @param [in] noise - * - - * - * @param [in] callback - * - To register callback function for result of this function. - * - * @param [in] user_data - * - user data for user specification - * - * - * @par Async Response Message: - * - None. - * - * @pre - * - None. - * - * @post - * - None. - * - * @return Return Type (TapiHandle *handle, int) \n - * - 0 - indicating that the operation has completed successfully. \n - * - Else it will return failure and error code (TapiHandle *handle, Refer Doxygen doc or #TapiResult_t) - * - * @par Prospective Clients: - * Embedded call application - * - * @code - * - * @endcode - * - * @see None. - * - * @remarks - * - None - * - * - */ - - int tel_set_call_sound_noise_reduction(TapiHandle *handle, TelSoundNoiseReduction_t noise, tapi_response_cb callback, void *user_data); - - /** - * - * @brief This function is used to set call sound clock status - * - * This function makes Dbus method call to Telephony Sever and returns immediate value. - * However it just means that the API request has been transfered to the CP successfully. - * The actual operation result is being delivered in the corresponding event asynchronously. - * - * @par Sync (TapiHandle *handle, or) Async: - * This is a Asynchronous API. - * - * @par Important Notes: - * - None. - * - * @warning - * - * - * - * @param [in] handle - * - handle from tel_init() - * - * @param [in] enable - * - sound clock status ( TRUE : enable, FALSE : disable ) - * - * @param [in] callback - * - To register callback function for result of this function. - * - * @param [in] user_data - * - user data for user specification - * - * - * @par Async Response Message: - * - None. - * - * @pre - * - None. - * - * @post - * - None. - * - * @return Return Type (TapiHandle *handle, int) \n - * - 0 - indicating that the operation has completed successfully. \n - * - Else it will return failure and error code (TapiHandle *handle, Refer Doxygen doc or #TapiResult_t) - * - * @par Prospective Clients: - * Embedded call application - * - * @code - * - * @endcode - * - * @see None. - * - * @remarks - * - None - * - * - */ - - int tel_set_call_sound_clock_status(TapiHandle *handle, gboolean status, tapi_response_cb callback, void *user_data ); - - -#ifdef __cplusplus -} -#endif - -#endif /* _ITAPI_CALL_H_ */ - - /** -* @} -*/ diff --git a/mobile/include/ITapiGps.h b/mobile/include/ITapiGps.h deleted file mode 100644 index f78f228..0000000 --- a/mobile/include/ITapiGps.h +++ /dev/null @@ -1,170 +0,0 @@ -/* - * libslp-tapi - * - * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. - * - * Contact: Ja-young Gu - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT 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 GPS_TAPI GPS - * @{ - * - * @file ITapiGps.h - - @brief This file serves as a "C" header file defines functions for Tapi GPS\n - It contains a sample set of function prototypes that would be required by applications. - * GPS APIs allow an application to accomplish the following services: @n - * - Confirm gps measure position information. @n - */ - - -#ifndef _ITAPI_GPS_H_ -#define _ITAPI_GPS_H_ - -#include -#include -#include - -#ifdef __cplusplus -extern "C" -{ -#endif - -/** - * @brief This function sends the confirmation data for measure position message. - * - * @par Sync (or) Async: - * This is an Synchronous API. - * - * @par Important Notes: - * - None. - * - * @warning - * - None. - * - * @param [in] handle - * - handle from tel_init(). - * - * @param [in] data - * -#user confirmation data for each vender. - * - * @param [in] data_len - * - data length - * - * @pre - * - TAPI_EVENT_GPS_MEASURE_POSITION_IND should be sent to application by Telephony Server. - * - * @post - * - * @return Return Type (int) \n - * - TAPI_API_SUCCESS - indicating that the operation has completed successfully. \n - * - Refer #TapiResult_t for failure and error code - * - * @par Prospective Clients: - * GPS Deamon - * - * - * @code - * - * int result; - * gps_measure_position_confirm_t data; - * result = tel_confirm_gps_measure_pos(handle, (unsigned char *)&data, sizeof(gps_measure_position_confirm_t)); - * - * - */ -/*================================================================================================*/ -int tel_confirm_gps_measure_pos(TapiHandle *handle, unsigned char *data, unsigned int data_len); - -/** - * @brief This function is invoked to set the gps frequency aiding and allows the underlying OEM provider to scan the set band. - * - * This function makes Dbus method call to Telephony Sever and returns immediate value. - * However it just means that the API request has been transfered to the CP successfully. - * The actual operation result is being delivered in the corresponding event asynchronously. - * - * @par Sync (or) Async: - * This is an Asynchronous API. - * - * @par Important Notes: - * - None. - * - * @warning - * - None. - * - * @param [in] handle - * - handle from tel_init(). - * - * @param [in] state - * - enable / disable state. - * - * @param [in] data_len - * - data length - - * @param [in] callback - * - To register callback function for result. - * - * @param [in] user_data - * - user_data for user specification. - * - * @par Async Response Message: - * The event associated is TAPI_EVENT_GPS_FREQ_AIDING_SET_RESP and there is no event data associated with this event and asynchronous. - * - * @pre - * - None. - * - * @post - * - None. - * - * @return Return Type (int) \n - * - TAPI_API_SUCCESS - indicating that the operation has completed successfully. \n - * - Refer #TapiResult_t for failure and error code - * - * @par Prospective Clients: - * GPS daemon. - * - * @code - * - * unsigned char state = true; - * - * result = tel_set_gps_frequency_aiding(handle, state, on_gps_set_frequency_aiding, NULL); - * - * @endcode - * - * @see - * - None. - * - * @remarks - * - None. - * - * - * - */ -/*================================================================================================*/ - -int tel_set_gps_frequency_aiding(TapiHandle *handle, unsigned char state, tapi_response_cb callback, void *user_data); - - -#ifdef __cplusplus -} -#endif - -#endif /* _ITAPI_GPS_H_ */ - -/** - * @} - */ diff --git a/mobile/include/ITapiModem.h b/mobile/include/ITapiModem.h deleted file mode 100644 index 226b6c3..0000000 --- a/mobile/include/ITapiModem.h +++ /dev/null @@ -1,500 +0,0 @@ -/* - * libslp-tapi - * - * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. - * - * Contact: Ja-young Gu - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT 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 MODEM_TAPI POWER - * @{ - * - * These APIs allow an application to accomplish the following services: @n - * - Process power command @n - * - Reset the phone power (on / off), @n - * - Process airplane mode @n - */ - -#ifndef _ITAPI_MODEM_H_ -#define _ITAPI_MODEM_H_ - -#include -#include -#include -#include -#include "ITapiPS.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * - * @brief This API is used to turn power off or on the modem. - * - * @par Sync (or) Async: - * This is a Synchronous API. - * - * @par Important Notes: - * -NONE - * - * @warning - * - None. - * - * - * @param [in] handle - * - handle from tel_init() - * - * @param [in] cmd - * - This index value is the power command as #tapi_power_phone_cmd_t. - * - * @param [in] callback - * - To register callback function for result of this function. - * - * @param [in] user_data - * - user data for user specification - * - * @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 - * - Otherwise it provides an error code (Refer #TapiResult_t) - * - * @par Prospective Clients: - * External Apps. - * - * - */ -int tel_process_power_command(TapiHandle *handle, tapi_power_phone_cmd_t cmd, tapi_response_cb callback, void *user_data); - -/** - * - * @brief This API is used to enter or leave airplane mode - * - * @par Sync (or) Async: - * This is a Asynchronous API. - * - * @par Important Notes: - * -NONE - * - * @warning - * - None. - * - * - * @param [in] handle - * - handle from tel_init() - * - * @param [in] mode - * - This mode value is the flight flag #tapi_power_flight_mode_type_t. - * - * @param [in] callback - * - To register callback function for result of this function. - * - * @param [in] user_data - * - user data for user specification - * - * @par Async Response Message: - * The event associated is TAPI_EVENT_MODEM_FLIGHT_MODE_RESP and the event data is #tapi_power_flight_mode_resp_type_t. - * Asynchronous return status is always TAPI_API_SUCCESS. - * - * @pre - * - None. - * - * @post - * - None. - * - * @return Return Type (int) \n - * - TAPI_API_SUCCESS - indicating that the operation has completed successfully. \n - * - Otherwise it provides an error code (Refer #TapiResult_t) - * - * @par Prospective Clients: - * External Apps. - * - * - */ -int tel_set_flight_mode(TapiHandle *handle, tapi_power_flight_mode_type_t mode, tapi_response_cb callback, void *user_data); - -int tel_get_flight_mode(TapiHandle *handle, tapi_response_cb callback, void *user_data); - -/** - * - * @brief This function is invoked to Get ME version information. - * - * @par Sync (or) Async: - * This is a synchronous API. - * - * @par Important Notes: - * - None. - * - * @warning - * - None. - * - * @param [in] handle - * - handle from tel_init() - * - * @param [in] callback - * - To register callback function for result of this function. - * - * @param [in] user_data - * - user data for user specification - * - * @par Async Response Message: - * - NA - * - * @pre - * - None. - * - * @post - * - None. - * - * @return Return Type (int) \n - * - Integer '0' ( same with TAPI_API_SUCCESS ) - indicating that the operation has completed successfully. \n - * - Negative integer : it provides an error code (Refer #TapiResult_t) - * - * @par Prospective Clients: - * External Apps. - * - */ -int tel_get_misc_me_version(TapiHandle *handle, tapi_response_cb callback, void *user_data); - -/** - * - * @brief This function is to get misc me version - * - * @par Sync (or) Async: - * This is a Synchronous API. - * - * @par Important Notes: - * - None. - * - * @warning - * - None. - * - * @param [in] handle - * - handle from tel_init() - * - * @par Async Response Message: - * - Na - * - * @pre - * - None. - * - * @post - * - None. - * - * @return Return Type ( TelMiscVersionInformation * ) \n - * - Misc Version Information - * - * @par Prospective Clients: - * External Apps. - * - */ - - -TelMiscVersionInformation *tel_get_misc_me_version_sync(TapiHandle *handle); - - -/** - * - * @brief This function is invoked to Get ME IMEI/ESN/MEID for each phone type. - * - * @par Sync (or) Async: - * This is a synchronous API. - * - * @par Important Notes: - * - None. - * - * @warning - * - None. - * - * @param [in] handle - * - handle from tel_init() - * - * @param [in] callback - * - To register callback function for result of this function. - * - * @param [in] user_data - * - user data for user specification - * - * @par Async Response Message: - * - NA - * - * @pre - * - None. - * - * @post - * - None. - * - * @return Return Type (int) \n - * - Integer '0' ( same with TAPI_API_SUCCESS ) - indicating that the operation has completed successfully. \n - * - Negative integer : it provides an error code (Refer #TapiResult_t) - * - * @par Prospective Clients: - * External Apps. - * - */ -int tel_get_misc_me_sn(TapiHandle *handle, tapi_response_cb callback, void *user_data); - -/** - * - * @brief This function is to get misc me Sereal Number - * - * This function makes Dbus method call to Telephony Sever and returns immediate value. - * However it just means that the API request has been transfered to the CP successfully. - * The actual operation result is being delivered in the corresponding event asynchronously. - * - * @par Sync (TapiHandle *handle, or) Async: - * This is a Synchronous API. - * - * @par Important Notes: - * - None. - * - * @warning - * - * - * @param [in] handle - * - handle from tel_init() - * - * @pre - * - None. - * - * @post - * - None. - * - * @return Return Type (char*) \n - * - Sereal Number string - * - * @par Prospective Clients: - * Embedded call application - * - * @see None. - * - * @remarks - * - None - * - * - */ - -char *tel_get_misc_me_sn_sync(TapiHandle *handle); - -/** - * - * @brief This function is to get misc me imei - * - * @par Sync (or) Async: - * This is a Asynchronous API. - * - * @par Important Notes: - * - None. - * - * @warning - * - None. - * - * @param [in] handle - * - handle from tel_init() - * - * @param [in] callback - * - To register callback function for result of this function. - * - * @param [in] user_data - * - user data for user specification - * - * @par Async Response Message: - * - IMEI - * - * @pre - * - None. - * - * @post - * - None. - * - * @return Return Type (int) \n - * - Integer '0' ( same with TAPI_API_SUCCESS ) - indicating that the operation has completed successfully. \n - * - Negative integer : it provides an error code (Refer #TapiResult_t) - * - * @par Prospective Clients: - * External Apps. - * - */ - -int tel_get_misc_me_imei(TapiHandle *handle, tapi_response_cb callback, void *user_data); - -/** - * - * @brief This function is to get misc me imei - * - * This function makes Dbus method call to Telephony Sever and returns immediate value. - * However it just means that the API request has been transfered to the CP successfully. - * The actual operation result is being delivered in the corresponding event asynchronously. - * - * @par Sync (TapiHandle *handle, or) Async: - * This is a Synchronous API. - * - * @par Important Notes: - * - None. - * - * @warning - * - * - * @param [in] handle - * - handle from tel_init() - * - * - * @pre - * - None. - * - * @post - * - None. - * - * @return Return Type (char*) \n - * - IMEI string - * - * @par Prospective Clients: - * Embedded call application - * - * @see None. - * - * @remarks - * - None - * - * - */ - -char *tel_get_misc_me_imei_sync(TapiHandle *handle); - -/** - * - * @brief This function is to check modem power status - * - * This function makes Dbus method call to Telephony Sever and returns immediate value. - * However it just means that the API request has been transfered to the CP successfully. - * The actual operation result is being delivered in the corresponding event asynchronously. - * - * @par Sync (TapiHandle *handle, or) Async: - * This is a Asynchronous API. - * - * @par Important Notes: - * - None. - * - * @warning - * - * - * @param [in] handle - * - handle from tel_init() - * - * @param [out] result - * - result of checking modem power status. - * - * @par Async Response Message: - * - - * - * @pre - * - None. - * - * @post - * - None. - * - * @return Return Type (TapiHandle *handle, int) \n - * - 0 - indicating that the operation has completed successfully. \n - * - Else it will return failure and error code (TapiHandle *handle, Refer Doxygen doc or #TapiResult_t) - * - * @par Prospective Clients: - * Embedded call application - * - * @see None. - * - * @remarks - * - None - * - * - */ - -int tel_check_modem_power_status(TapiHandle *handle, int *result); - -/** - * - * @brief This function is to control modem dun pin - * - * This function makes Dbus method call to Telephony Sever and returns immediate value. - * However it just means that the API request has been transfered to the CP successfully. - * The actual operation result is being delivered in the corresponding event asynchronously. - * - * @par Sync (TapiHandle *handle, or) Async: - * This is a Asynchronous API. - * - * @par Important Notes: - * - None. - * - * @warning - * - * - * @param [in] handle - * - handle from tel_init() - * - * @param [in] pincontrol - * - pin control inforamation - * - * @param [in] callback - * - To register callback function for result of this function. - * - * @param [in] user_data - * - user data for user specification - * - * @par Async Response Message: - * - None. - * - * @pre - * - None. - * - * @post - * - None. - * - * @return Return Type (TapiHandle *handle, int) \n - * - 0 - indicating that the operation has completed successfully. \n - * - Else it will return failure and error code (TapiHandle *handle, Refer Doxygen doc or #TapiResult_t) - * - * @par Prospective Clients: - * Embedded call application - * - * @see None. - * - * @remarks - * - None - * - * - */ - -int tel_control_modem_dun_pin_ctrl(TapiHandle *handle, tapi_ps_btdun_pincontrol *pincontrol, tapi_response_cb callback, void *user_data); - -#ifdef __cplusplus -} -#endif - -#endif /* _ITAPI_MODEM_H_ */ - -/** - * @} - */ diff --git a/mobile/include/ITapiNetText.h b/mobile/include/ITapiNetText.h deleted file mode 100644 index 059454c..0000000 --- a/mobile/include/ITapiNetText.h +++ /dev/null @@ -1,1360 +0,0 @@ -/* - * libslp-tapi - * - * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. - * - * Contact: Ja-young Gu - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT 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 ITapiNettext.h - - @brief This file serves as a "C" header file defines functions for Tapi Nettext\n - It contains a sample set of function prototypes that would be required by applications. - - */ - -#ifndef _ITAPI_NETTEXT_H_ -#define _ITAPI_NETTEXT_H_ - -#include -#include -#include - -#ifdef __cplusplus -extern "C" -{ -#endif - - /** - * @brief This API is used to send an SMS message to the network. This API interface allows transmitting SMS PDU as defined by - * 3GPP TS 23.040 (SMS-SUBMIT, SMS-COMMAND) to lower layers. This API allows keeping the dedicated link at lower layers - * by passing information as more messages to send in parameters. This will enable not to release if a dedicated connection is - * used for transmission. Access to this API is limited to in-house application and we recommend you use Message Framework API(MAPI). - * - * @par Sync (or) Async: - * This is an Asynchronous API. - * - * @par Important Notes: - * - None. - * - * @warning - * - None. - * - * - * @param [in] handle - * - handle from tel_init() - * - * @param [in] pDataPackage - * - Contains SMS-SUBMIT TPDU - * - * @param [in] bMoreMsgToSend - * - will be set to TRUE when there are more than one message to be send or Multiple segmented concatenated - * message to be send, otherwise FALSE. This flag indicates OEM that more messages to send. - * - * @param [in] callback - * - To register callback function for result of this function. - * - * @param [in] user_data - * - user data for user specification - * - * @par Async Response Message: - * SMS sent status is returned in this event TAPI_EVENT_NETTEXT_SENTSTATUS_CNF and the event data associated with this event - * is #TelSmsDatapackageInfo_t that has SMS PDU as defined by 3GPP TS 23.040(SMS-SUBMIT-REPORT). Asynchronous return status is indicated by #TelSmsResponse_t. - * - * @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 - * - * TelSmsDatapackageInfo_t *pDataPackage; - * int ret_status; - * int RequestId = 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, &RequestId); - * @endcode - * - * @see - * - None. - * - * @remarks - * - None. - * - * - */ -/*================================================================================================*/ -int tel_send_sms(TapiHandle *handle, const TelSmsDatapackageInfo_t *pDataPackage, int bMoreMsgToSend, tapi_response_cb callback, void* user_data); - - /** - * @brief This API is used to send an SMS message to the network. This API interface allows transmitting SMS PDU as defined by - * 3GPP2 C.S0015 (SMS-SUBMIT, SMS-ACK, SMS-CANCEL) to lower layers. This API allows keeping the dedicated link at lower layers - * by passing information as more messages to send in parameters. This will enable not to release if a dedicated connection is - * used for transmission. Access to this API is limited to in-house application and we recommend you use Message Framework API(MAPI). - * - * @par Sync (or) Async: - * This is an Asynchronous API. - * - * @par Important Notes: - * - None. - * - * @warning - * - None. - * - * - * @param [in] pSmsMsgInfo - * - Contains parameter mask, message type and data. - * - * @param [in] MoreMsgToSend - * - will be set to TRUE when there are more than one message to be send or Multiple segmented concatenated - * message to be send, otherwise FALSE. This flag indicates OEM that more messages to send. - * - * @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: - * SMS sent status is returned in this event TAPI_EVENT_NETTEXT_SENTSTATUS_EX_CNF and the event data associated with this event - * is #TelSmsIs637CauseCode_t. Asynchronous return status is indicated by #TelSmsResponse_t. - * - * @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 ret_status = TAPI_API_SUCCESS; - * int requestId = 0; - * TelSmsMsgInfo_t pMsgInfo={0,}; - * char* diallingNum; - * int dialNumLen; - * TelSmsMsgInfo_t *pDataPackage = malloc(sizeof(TelSmsMsgInfo_t)); - * - * memset(pDataPackage, 0, sizeof(TelSmsMsgInfo_t)); - * pDataPackage->MsgType = TAPI_NETTEXT_MESSAGETYPE_SUBMIT; //fill structure appropriately - * pDataPackage->ParamMask |= TAPI_NETTEXT_PARAM_TELESERVICE_MASK; - * - * ret_status = tel_send_sms_msg(pDataPackage, 0 ,&requestId); - * - * @endcode - * - * @see - * - None. - * - * @remarks - * - None. - * - * - */ -/*================================================================================================*/ -//int tel_send_sms_msg(const TelSmsMsgInfo_t *pSmsMsgInfo, int MoreMsgToSend, int *pRequestId); - - /** - * @brief This function reads a message from SIM card storage. SIM index (index used when storing the SMS) number to be passed to in order - * to read particular SMS message. Total number of messages can be retrieved by #TelTapiSmsGetCount function. - * Access to this API is limited to in-house application and we recommend you use Message Framework API(MAPI). - * - * @par Sync (or) Async: - * This is an Asynchronous API. - * - * @par Important Notes: - * - None. - * - * @warning - * - None. - * - * - * @param [in] handle - * - handle from tel_init() - * - * @param [in] index - * - Index number of the message to be read - * - * @param [in] callback - * - To register callback function for result of this function. - * - * @param [in] user_data - * - user data for user specification - * - * @par Async Response Message: - * The event associated is TAPI_EVENT_NETTEXT_READ_SMS_CNF and the event data is #TelSmsData_t. Asynchronous return status is indicated - * by #TelSmsCause_t. - * - * @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 ret_status = TAPI_API_SUCCESS; - * int RequestId = 0; - * - * ret_status = tel_read_sms_in_sim(0, &RequestId); //index value which is located in SIM - * - * @endcode - * - * @see - * - None. - * - * @remarks - * - None. - * - * - */ -/*================================================================================================*/ - int tel_read_sms_in_sim(TapiHandle *handle, int index, tapi_response_cb callback, void* user_data); - - /** - * @brief This function writes a message to SIM storage area. - * Access to this API is limited to in-house application and we recommend you use Message Framework API(MAPI). - * - * @par Sync (or) Async: - * This is an Asynchronous API. - * - * @par Important Notes: - * - None. - * - * @warning - * - None. - * - * - * @param [in] handle - * - handle from tel_init() - * - * @param [in] pWriteData - * - SMS message structure. - * - * @param [in] callback - * - To register callback function for result of this function. - * - * @param [in] user_data - * - user data for user specification - * - * @par Async Response Message: - * TAPI library will send TAPI_EVENT_NETTEXT_SAVE_STATUS_CNF asynchronous event for this request when received from TS. - * The associated data is SIM Index in which the message stored. Asynchronous return status is indicated by #TelSmsCause_t. - * - * @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 ret_status = TAPI_API_SUCCESS; - * int RequestId = 0; - * TelSmsData_t *pWriteData; - * char *msg = "This is an Test SMS"; - * char *SCA = "821091"; - * - * pWriteData = malloc(sizeof(TelSmsData_t)); - * - * conv_service_center_address(pWriteData->SmsData.Sca, SCA); //convert service center address - * conv_msg_into_tpdu(pWriteData->SmsData.szData, pWriteData->SmsData.MsgLength, msg); // convert message into TPDU - * pWrite->MsgStatus = TAPI_NETTEXT_STATUS_READ; - * pWrite->SimIndex = -1; - * - * ret_status = tel_write_sms_in_sim (pWriteData, &RequestId); - * @endcode - * - * @see - * - None. - * - * @remarks - * - None. - * - * - */ -/*================================================================================================*/ -int tel_write_sms_in_sim(TapiHandle *handle, const TelSmsData_t *pWriteData, tapi_response_cb callback, void* user_data); - - /** - * @brief This function deletes a message specified by index (SIM index used when storing the SMS) - * number from the SIM storage area. Access to this API is limited to in-house application and we recommend you use Message Framework API(MAPI). - * - * @par Sync (or) Async: - * This is an Asynchronous API. - * - * @par Important Notes: - * - None. - * - * @warning - * - None. - * - * - * @param [in] handle - * - handle from tel_init() - * - * @param [in] Index - * - Message index to delete. - * - * @param [in] callback - * - To register callback function for result of this function. - * - * @param [in] user_data - * - user data for user specification - * - * @par Async Response Message: - * The asynchronous event associated is TAPI_EVENT_NETTEXT_DELETE_STATUS_CNF and the event data is SIM index from which - * the message has been deleted. Asynchronous return status is indicated by #TelSmsCause_t. - * - * @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).\n - * @par Prospective Clients: - * External Apps. - * - * @code - * #include - * - * int ret_status = TAPI_API_SUCCESS; - * int RequestId = 0; - * - * ret_status = tel_delete_sms_in_sim(1, &RequestId); //index which is located in SIM - * - * @endcode - * - * @see - * - None. - * - * @remarks - * - None. - * - * - */ -/*================================================================================================*/ -int tel_delete_sms_in_sim(TapiHandle *handle, int index, tapi_response_cb callback, void* user_data); - - /** - * @brief This function is used to retrieve message count information like Total record count, - * used record count and the indices list for SIM Storage. This is an asynchronous function and - * the response will be sent back by event notification. Access to this API is limited, we recommend you use Message Framework API(MAPI) besides. - * Access to this API is limited to in-house application. - * - * @par Sync (or) Async: - * This is an Asynchronous API. - * - * @par Important Notes: - * - None. - * - * @warning - * - None. - * - * - * @param [in] handle - * - handle from tel_init() - * - * @param [in] callback - * - To register callback function for result of this function. - * - * @param [in] user_data - * - user data for user specification - - * - * @par Async Response Message: - * The event associated is TAPI_EVENT_NETTEXT_GET_COUNT_CNF and the event data is #TelSmsStoredMsgCountInfo_t. - * Asynchronous return status is indicated by #TelSmsCause_t. - * - * @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.\n - * - * @code - * #include - * - * int ret_status = TAPI_API_SUCCESS; - * int RequestId = 0; - * - * ret_status = tel_get_sms_count (&RequestId); //get sms count in SIM - * @endcode - * - * @see - * - None. - * - * @remarks - * - None. - * - * - */ -/*================================================================================================*/ -int tel_get_sms_count(TapiHandle *handle, tapi_response_cb callback, void* user_data); - - /** - * @brief This function is used to set SMS CB Message Identifiers in the appropriate EF-CBMI/EF-CBMIR file in (U)SIM. - * This function also indicates underlying provider to enable or disable CB Channel on which CB messages are received. - * Access to this API is limited to in-house application and we recommend you use Message Framework API(MAPI) besides. - * - * @par Sync (or) Async: - * This is an Asynchronous API. - * - * @par Important Notes: - * - None. - * - * @warning - * - None. - * - * - * @param [in] handle - * - handle from tel_init() - * - * @param [in] pCBConfig - * - This structure contains parameters to set SMS CB configuration \n - * (i) Cell broadcast service state. (Enabled/disabled.) \n - * (ii) Cell broadcast message identifier, which denotes whether all cell broadcast message identifiers are selected or only - * some of those.\n - * (iii) The list count of message identifiers to be set.\n - * (iv) The actual list of message identifiers to be set. Each identifier occupies 2 bytes. And the list ranges from 0x00 to 0xff. \n - * These message identifiers denote the source and type of the CB message. Based on the message identifiers set in the SIM, - * the ME receives CB messages with selected message identifiers. - * - * @param [in] callback - * - To register callback function for result of this function. - * - * @param [in] user_data - * - user data for user specification - * - * @par Async Response Message: - * The event associated is TAPI_EVENT_NETTEXT_SET_REQUEST_CNF and there is no data associated with this event. - * Asynchronous return status is indicated by #TelSmsCause_t. - * - * @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.\n - * - * @code - * #include - * - * int ret_status = TAPI_API_SUCCESS; - * int RequestId = 0; - * TelSmsCbConfig_t *pCBConfig = NULL; - * - * pCBConfig = (TelSmsCbConfig_t *)malloc(sizeof(TelSmsCbConfig_t)); - * pCBConfig->bCBEnabled = 1; //fill structure appropriately - * 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, &RequestId); - * - * @endcode - * - * @see - * - None. - * - * @remarks - * - None. - * - * - */ -/*================================================================================================*/ -int tel_set_sms_cb_config(TapiHandle *handle, const TelSmsCbConfig_t *pCBConfig, tapi_response_cb callback, void* user_data); - - /** - * @brief This function is used to retrieve SMS CB configuration options from EFcbmi file in the SIM. - * Access to this API is limited to in-house application and we recommend you use Message Framework API(MAPI). - * - * @par Sync (or) Async: - * This is an Asynchronous API. - * - * @par Important Notes: - * - None. - * - * @warning - * - None. - * - * - * @param [in] handle - * - handle from tel_init() - * - * @param [in] callback - * - To register callback function for result of this function. - * - * @param [in] user_data - * - user data for user specification - * - * @par Async Response Message: - * The event associated is TAPI_EVENT_NETTEXT_GET_CB_CONFIG_CNF and the event data is #TelSmsCbConfig_t. - * Asynchronous return status is indicated by #TelSmsCause_t. - * - * @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.\n - * - * @code - * #include - * - * int ret_status = TAPI_API_SUCCESS; - * int RequestId = 0; - * - * ret_status = tel_get_sms_cb_config (&RequestId); //result will come with async response - * @endcode - * - * @see - * - None. - * - * @remarks - * - None. - * - * - */ -/*================================================================================================*/ -int tel_get_sms_cb_config(TapiHandle *handle, tapi_response_cb callback, void* user_data); - - - /** - * @brief This function is used to set SMS preferred bearer on which SMS has to be transmitted. - * Access to this API is limited to in-house application and we recommend you use Message Framework API(MAPI). - * - * @par Sync (or) Async: - * This is an Asynchronous API. - * - * @par Important Notes: - * - None. - * - * @warning - * - None. - * - * - * @param [in] handle - * - handle from tel_init() - * - * @param [in] BearerType - * - Specifies the bearer type. - * - * @param [in] callback - * - To register callback function for result of this function. - * - * @param [in] user_data - * - user data for user specification - * - * @par Async Response Message: - * The event associated is TAPI_EVENT_NETTEXT_SET_REQUEST_CNF and there is no data associated with this event. - * Asynchronous return status is indicated by #TelSmsCause_t - * - * @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 ret_status = TAPI_API_SUCCESS; - * int RequestId = 0; - * TelSmsBearerType_t BearerType = TAPI_NETTEXT_BEARER_PS_ONLY; - * - * ret_status = tel_set_sms_preferred_bearer(BearerType, &RequestId); //result will come with async response - * - * @endcode - * - * @see - * - None. - * - * @remarks - * - None. - * - * - */ -/*================================================================================================*/ -int tel_set_sms_preferred_bearer(TapiHandle *handle, TelSmsBearerType_t BearerType, tapi_response_cb callback, void* user_data); - - /** - * @brief This function is used to get SMS preferred bearer on which SMS has to be transmitted. - * This is an asynchronous function. Access to this API is limited to in-house application and , we recommend you use Message Framework API(MAPI). - * - * @par Sync (or) Async: - * This is an Asynchronous API. - * - * @par Important Notes: - * - None. - * - * @warning - * - None. - * - * - * @param [in] handle - * - handle from tel_init() - * - * @param [in] callback - * - To register callback function for result of this function. - * - * @param [in] user_data - * - user data for user specification - * - * @par Async Response Message: - * The event associated is TAPI_EVENT_NETTEXT_GET_SMSBEARER_CNF and the associated event data is #TelSmsBearerType_t. - * Asynchronous return status is indicated by #TelSmsCause_t. - * - * @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 ret_status = TAPI_API_SUCCESS; - * int RequestId = 0; - * - * ret_status = tel_get_sms_preferred_bearer(&RequestId); //result will come with async response - * - * @endcode - * - * @see - * - None. - * - * @remarks - * - None. - * - * - */ -/*================================================================================================*/ -int tel_get_sms_preferred_bearer(TapiHandle *handle, tapi_response_cb callback, void* user_data); - - /** - * @brief This function is used to get the SMS parameters for a particular SMS (sent/received) - * based on the SIM index where it is stored. This is an asynchronous function. Access to this API is limited to in-house application and we recommend you use Message Framework API(MAPI). - * - * @par Sync (or) Async: - * This is an Asynchronous API. - * - * @par Important Notes: - * - None. - * - * @warning - * - None. - * - * - * @param [in] handle - * - handle from tel_init() - * - * @param [in] index - * - SIM index where the SMS is stored - * - * @param [in] callback - * - To register callback function for result of this function. - * - * @param [in] user_data - * - user data for user specification - * - * @par Async Response Message: - * The event associated is TAPI_EVENT_NETTEXT_GET_PARAM_CNF and the event data is #TelSmsParams_t. Asynchronous return status - * is indicated by #TelSmsCause_t - * - * @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 ret_status = TAPI_API_SUCCESS; - * int RequestId = 0; - * - * ret_status = tel_get_sms_parameters(1, &RequestId); //result will come with async response - * - * @endcode - * - * @see - * - None. - * - * @remarks - * - None. - * - * - */ -/*================================================================================================*/ -int tel_get_sms_parameters(TapiHandle *handle, int index, tapi_response_cb callback, void* user_data); - - /** - * @brief This function is used to set the short message service header parameters which are - * used in the origination of MO messages. Access to this API is limited to in-house application and we recommend you use Message Framework API(MAPI). - * - * @par Sync (or) Async: - * This is an Asynchronous API. - * - * @par Important Notes: - * - This API updates/sets SMS Parameters in EFsmsp file in the SIM storage - * - * @warning - * - None. - * - * - * @param [in] handle - * - handle from tel_init() - * - * @param [in] pSmsSetParameters - * - Contains SMS header Parameter information like service center address, destination address, validity period, protocol identifier, - * data coding scheme. - * - * @param [in] callback - * - To register callback function for result of this function. - * - * @param [in] user_data - * - user data for user specification - * - * @par Async Response Message: - * The event associated is TAPI_EVENT_NETTEXT_SET_REQUEST_CNF and there is no data associated with this event. Asynchronous - * return status is indicated by #TelSmsCause_t - * - * @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 ret_status = TAPI_API_SUCCESS; - * int RequestId = 0; - * TelSmsParams_t SmsSetParameters = {0,}; - * - * 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, &RequestId); //result will come with async response - * - * @endcode - * - * @see - * - None. - * - * @remarks - * - None. - * - * - */ -/*================================================================================================*/ -int tel_set_sms_parameters(TapiHandle *handle, const TelSmsParams_t *pSmsSetParameters, tapi_response_cb callback, void* user_data); - - /** - * @brief This function is used to send a delivery report for the received incoming SMS to the network. - * Access to this API is limited to in-house application. - * - * @par Sync (or) Async: - * This is a Asynchronous API. - * - * @par Important Notes: - * - None. - * - * @warning - * - None. - * - * - * @param [in] handle - * - handle from tel_init() - * - * @param [in] pDataPackage - * - Contains SMS Data package.. - * - * @param [in] RPCause - * - Indicates the reason for SMS-DELIVER failure - * - * @param [in] callback - * - To register callback function for result of this function. - * - * @param [in] user_data - * - user data for user specification - * - * @par Async Response Message: - * The event associated is TAPI_EVENT_NETTEXT_DELIVERY_REPORT_CNF and there is no associated event data. Asynchronous return status - * is indicated by #TelSmsResponse_t - * - * @pre - * - SMS-DELIVER-REPORT message structure should be in TPDU format as specified by 3GPP TS 23.040 SMS TPDU. - * - * @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 ret_status = 0; - * Int requestId = -1; - * TelSmsResponse_t RPCause; - * 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); - * - * @endcode - * - * @see - * - None. - * - * @remarks - * - None. - * - * - */ -/*================================================================================================*/ -int tel_send_sms_deliver_report(TapiHandle *handle, const TelSmsDatapackageInfo_t *pDataPackage, TelSmsResponse_t RPCause, tapi_response_cb callback, void* user_data); - - /** - * @brief This function is used to set SMS Service Centre Address information in order to send the SMS. - * Access to this API is limited to in-house application and we recommend you use Message Framework API(MAPI). - * - * @par Sync (or) Async: - * This is an Asynchronous API. - * - * @par Important Notes: - * - This API updates/sets service center address in EFsmsp file in the SIM storage. - * - * @warning - * - None. - * - * @param [in] handle - * - handle from tel_init() - * - * @param [in] pSCA - * - Contains the service centre address informations. - * - * @param [in] Index - * - Contains the record index of the Service center address information in the EF. - * - * @param [in] callback - * - To register callback function for result of this function. - * - * @param [in] user_data - * - user data for user specification - * - * @par Async Response Message: - * The event associated is TAPI_EVENT_NETTEXT_SET_REQUEST_CNF and there is no data associated with this event. - * Asynchronous return status is indicated by #TelSmsResponse_t. - * - * @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 ret_status; - * int RequestId = 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; - * - * //idx = SmsUtilEncodeAddrField(packet, scaNum, scaNum_len, 0x01, 0x01); - * //get idx - * sc_addr->DialNumLen = idx ; - * memcpy(sc_addr->szDiallingNum, packet, (unsigned int)idx); - * ret_status = tel_set_sms_sca(sc_addr, 0, &RequestId); //result will come with async response - * - * @endcode - * - * @see - * - None. - * - * @remarks - * - None. - * - * - */ -/*================================================================================================*/ -int tel_set_sms_sca(TapiHandle *handle, const TelSmsAddressInfo_t *pSCA, int index, tapi_response_cb callback, void* user_data); - - /** - * @brief This function is used to get current SMS Service Centre Address information. - * Access to this API is limited to in-house application and we recommend you use Message Framework API(MAPI). - * - * @par Sync (or) Async: - * This is a Asynchronous API. - * - * @par Important Notes: - * - None. - * - * @warning - * - None. - * - * - * @param [in] handle - * - handle from tel_init() - * - * @param [in] Index - * - Contains the record index of the Service center address information in the EF. - * - * @param [in] callback - * - To register callback function for result of this function. - * - * @param [in] user_data - * - user data for user specification - * - * @par Async Response Message: - * The event associated is TAPI_EVENT_NETTEXT_GET_SCA_CNF and there is no data associated with this event. - * Asynchronous return status is indicated by #TelSmsResponse_t. - * - * @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 ret_status = TAPI_API_SUCCESS; - * int RequestId = 0; - * - * ret_status = tel_get_sms_sca(0, &RequestId); //result will come with async response - * - * @endcode - * - * @see - * - None. - * - * @remarks - * - None. - * - * - */ -/*================================================================================================*/ -int tel_get_sms_sca(TapiHandle *handle, int index, tapi_response_cb callback, void* user_data); - - /** - * @brief This function is used by the applications to inform modem about the memory status of PDA (whether FULL or AVAILABLE) so that modem can inform network . - * Access to this API is limited to in-house application. - * - * @par Sync (or) Async: - * This is a Asynchronous API. - * - * @par Important Notes: - * - None. - * - * @warning - * - None. - * - * - * @param [in] handle - * - handle from tel_init() - * - * @param [in] memoryStatus - * - Contains Memory Status - * - * @param [in] callback - * - To register callback function for result of this function. - * - * @param [in] user_data - * - user data for user specification - * - * @par Async Response Message: - * The event associated is TAPI_EVENT_NETTEXT_SET_REQUEST_CNF and there is no associated event data. Asynchronous return status - * is indicated by #TelSmsResponse_t - * - * @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 ret_status = TAPI_API_SUCCESS; - * int RequestId = 0; - * int MemoryStatus = TAPI_NETTEXT_PDA_MEMORY_STATUS_AVAILABLE; - * - * ret_status = tel_set_sms_memory_status(MemoryStatus, &RequestId); //result will come with async response - * - * @endcode - * - * @see - * - None. - * - * @remarks - * - None. - * - * - */ -/*================================================================================================*/ -int tel_set_sms_memory_status(TapiHandle *handle, int memoryStatus, tapi_response_cb callback, void* user_data); - - /** - * @brief This function is used by the applications to set the message status in the SIM EF. - * Access to this API is limited to in-house application and we recommend you use Message Framework API(MAPI). - * - * @par Sync (or) Async: - * This is a Asynchronous API. - * - * @par Important Notes: - * - None. - * - * @warning - * - None. - * - * - * @param [in] handle - * - handle from tel_init() - * - * @param [in] Index - * - Index of the message whose status has to be set. - * - * @param [in] msgStatus - * - Status of the message to be set. - * - * @param [in] callback - * - To register callback function for result of this function. - * - * @param [in] user_data - * - user data for user specification - * - * @par Async Response Message: - * The event associated is TAPI_EVENT_NETTEXT_SET_REQUEST_CNF and there is no associated event data. Asynchronous return status - * is indicated by #TelSmsResponse_t - * - * @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 ret_status = TAPI_API_SUCCESS; - * int RequestId = 0; - * int index = 1; - * int MemoryStatus = TAPI_NETTEXT_PDA_MEMORY_STATUS_AVAILABLE; - * - * ret_status = tel_set_sms_memory_status(index, MemoryStatus, &RequestId); //result will come with async response - * - * @endcode - * - * @see - * - None. - * - * @remarks - * - None. - * - * - */ -/*================================================================================================*/ -int tel_set_sms_message_status(TapiHandle *handle, int index, TelSmsMsgStatus_t msgStatus, tapi_response_cb callback, void* user_data); - - /** - * @brief This function is used by the applications to get the count of SMS parameter records stored in SIM EF. - * Access to this API is limited to in-house application. - * - * @par Sync (or) Async: - * This is a Asynchronous API. - * - * @par Important Notes: - * - None. - * - * @warning - * - None. - * - * - * @param [in] handle - * - handle from tel_init() - * - * @param [in] callback - * - To register callback function for result of this function. - * - * @param [in] user_data - * - user data for user specification - * - * @par Async Response Message: - * The event associated is TAPI_EVENT_NETTEXT_PARAM_COUNT_IND and there is no associated event data. Asynchronous return status - * is indicated by #TelSmsResponse_t - * - * @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 ret_status = TAPI_API_SUCCESS; - * int RequestId = 0; - * - * ret_status = tel_get_sms_parameter_count (&RequestId); //result will come with async response - * @endcode - * - * @see - * - None. - * - * @remarks - * - None. - * - * - */ -/*================================================================================================*/ -int tel_get_sms_parameter_count(TapiHandle *handle, tapi_response_cb callback, void* user_data); - - -/** - * @brief This function is used by the applications check the sms ready status (whether ready or not) . - * - * @par Sync (or) Async: - * This is a Synchronous API. - * - * @par Important Notes: - * - None. - * - * @warning - * - None. - * - * - * @param [in] handle - * - handle from tel_init() - * - * @param [out] pReadyStatus - * - Contains Ready Status - * - * @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. - * - */ -int tel_check_sms_device_status(TapiHandle *handle, int *pReadyStatus); - -/** - * @brief This function is used by the applications to inform modem about the PDA status(whether PDA is ready to - * recieve messages from network or not). - * - * - * @par Sync (or) Async: - * This is a Asynchronous API. - * - * @par Important Notes: - * - None. - * - * @warning - * - None. - * - * - * @param [in] - * - None - * - * @param [out] - * - None - * - * @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. - * - */ -int tel_set_sms_device_status(void); - -#ifdef __cplusplus -} -#endif - -#endif /* _ITAPI_NETTEXT_H_ */ - -/** -* @} -*/ diff --git a/mobile/include/ITapiNetwork.h b/mobile/include/ITapiNetwork.h deleted file mode 100644 index 4fad975..0000000 --- a/mobile/include/ITapiNetwork.h +++ /dev/null @@ -1,973 +0,0 @@ -/* - * libslp-tapi - * - * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. - * - * Contact: Ja-young Gu - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT 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 ITapiNetwork.h - - @brief This file serves as a "C" header file defines functions for Tapi Network\n - It contains a sample set of function prototypes that would be required by applications. - */ - -#ifndef _ITAPI_NETWORK_H_ -#define _ITAPI_NETWORK_H_ - -#include -#include -#include -#include - -#ifdef __cplusplus -extern "C" -{ -#endif - -/** - * @brief This function requests the lower layers to select the network automatically - * - * @par Sync (or) Async: - * This is an Asynchronous API. - * - * This function makes Dbus method call to Telephony Sever and returns immediate value. - * However it just means that the API request has been transfered to the CP successfully. - * The actual operation result is being delivered in the corresponding event asynchronously. - * - * @par Important Notes: - * - This function passes the - * - * @warning - * - None. - * - * @param [in] handle - * - handle from tel_init(). - * - * @param [in] callback - * - To register callback function for result. - * - * @param [in] user_data - * - user_data for user specification. - * - * @par Async Response Message: - * The event associated is TAPI_EVENT_NETWORK_SELECT_CNF and there is no data associated with this event. Asynchronous return status - * is indicated by #TelNetworkOperationCause_t. - * - * @pre - * - A dbus connection is established with #tel_init - * - The application name is registered with #tel_register_app_name - * - The application is registered events to listen asynchronous response with #tel_register_event - * - A event loop is running to listen events - * - * @post - * - None. - * - * @return Return Type (int) \n - * - TAPI_API_SUCCESS - indicating that the operation has completed successfully. \n - * - Refer #TapiResult_t for failure and error code - * - * @par Prospective Clients: - * External Apps. - * - * @code - * #include - * - * int ret_status; - * int RequestID; - * - * // AUTOMATIC MODE - * ret_status = tel_select_network_automatic(&RequestId); - * @endcode - * - * @see - * - None. - * - * @remarks - * - None. - * - * - */ -/*================================================================================================*/ -int tel_select_network_automatic(TapiHandle *handle, tapi_response_cb callback, void *user_data); - -/** - * @brief This function requests the lower layers to select the network (PLMN) which has been selected by the user from the Network List - * displayed to the User. - * - * @par Sync (or) Async: - * This is an Asynchronous API. - * - * This function makes Dbus method call to Telephony Sever and returns immediate value. - * However it just means that the API request has been transfered to the CP successfully. - * The actual operation result is being delivered in the corresponding event asynchronously. - * - * @par Important Notes: - * - This function passes the . - * - * @warning - * - None. - * - * @param [in] handle - * - handle from tel_init(). - * - * @param[in] plmn - * - * @param [in] act - * - * @param [in] callback - * - To register callback function for result. - * - * @param [in] user_data - * - user_data for user specification. - * - * @par Async Response Message: - * The event associated is TAPI_EVENT_NETWORK_SELECT_CNF and there is no data associated with this event. Asynchronous return status - * is indicated by #TelNetworkOperationCause_t. - * - * @pre - * - A dbus connection is established with #tel_init - * - The application name is registered with #tel_register_app_name - * - The application is registered events to listen asynchronous response with #tel_register_event - * - A event loop is running to listen events - * - * @post - * - None. - * - * @return Return Type (int) \n - * - TAPI_API_SUCCESS - indicating that the operation has completed successfully. \n - * - Refer #TapiResult_t for failure and error code - * @par Prospective Clients: - * External Apps. - * - * @code - * #include - * - * int ret_status; - * int RequestID; - * unsigned int plmn = 0; - * - * // MANUAL MODE - * plmn = 45454; - * ret_status = tel_select_network_manual(Plmn, &RequestId); - * @endcode - * - * @see - * - None. - * - * @remarks - * - None. - * - * - */ -/*================================================================================================*/ -int tel_select_network_manual(TapiHandle *handle, const char *plmn, int act, tapi_response_cb callback, void *user_data); - -/** - * @brief This function sends a request to do manual network selection to search for the available networks and provide the - * Network List to the User/Application. - * - * @par Sync (or) Async: - * This is an Asynchronous API. - * - * This function makes Dbus method call to Telephony Sever and returns immediate value. - * However it just means that the API request has been transfered to the CP successfully. - * The actual operation result is being delivered in the corresponding event asynchronously. - * - * @par Important Notes: - * - None. - * - * @warning - * - None. - * - * @param [in] handle - * - handle from tel_init(). - * - * @param [in] callback - * - To register callback function for result. - * - * @param [in] user_data - * - user_data for user specification. - * - * @par Async Response Message: - * The event associated is TAPI_EVENT_NETWORK_SEARCH_CNF and the event data is #TelNetworkPlmnList_t. - * Asynchronous return status is indicated by #TelNetworkOperationCause_t. - * - * @pre - * - A dbus connection is established with #tel_init - * - The application name is registered with #tel_register_app_name - * - The application is registered events to listen asynchronous response with #tel_register_event - * - A event loop is running to listen events - * - * @post - * - In the available network list, user can select one of the networks successfully. - * - * @return Return Type (int) \n - * - TAPI_API_SUCCESS - indicating that the operation has completed successfully. \n - * - Refer #TapiResult_t for failure and error code - * @par Prospective Clients: - * External Apps. - * - * @code - * #include - * - * int ret_status; - * int RequestID; - * - * // NETWORK SEARCH - * ret_status = tel_search_network(&RequestId); - * @endcode - * - * @see - * - None. - * - * @remarks - * - None. - * - * - */ -/*================================================================================================*/ -int tel_search_network(TapiHandle *handle, tapi_response_cb callback, void *user_data); - -/** - * @brief This function requests for the present network selection mode i.e. automatic or manual. - * - * @par Sync (or) Async: - * This is an Asynchronous API. - * - * This function makes Dbus method call to Telephony Sever and returns immediate value. - * However it just means that the API request has been transfered to the CP successfully. - * The actual operation result is being delivered in the corresponding event asynchronously. - * - * @par Important Notes: - * - None. - * - * @warning - * - None. - * - * @param [in] handle - * - handle from tel_init(). - * - * @param [in] callback - * - To register callback function for result. - * - * @param [in] user_data - * - user_data for user specification. - * - * @par Async Response Message: - * The event associated is TAPI_EVENT_NETWORK_GETSELECTIONMODE_CNF and the event data is #TelNetworkSelectionMode_t. - * Asynchronous return status is indicated by #TelNetworkOperationCause_t. - * - * @pre - * - A dbus connection is established with #tel_init - * - The application name is registered with #tel_register_app_name - * - The application is registered events to listen asynchronous response with #tel_register_event - * - A event loop is running to listen events - * - * @post - * - None. - * - * @return Return Type (int) \n - * - TAPI_API_SUCCESS - indicating that the operation has completed successfully. \n - * - Refer #TapiResult_t for failure and error code - * @par Prospective Clients: - * External Apps. - * - * @code - * #include - * - * int ret_status; - * int RequestId; - * - * // GET THE SELECTION MODE - * ret_status = tel_get_network_selection_mode (&RequestId); - * @endcode - * - * @see - * - None. - * - * @remarks - * - None. - * - * - * - */ -/*================================================================================================*/ -int tel_get_network_selection_mode(struct tapi_handle *handle, tapi_response_cb callback, void *user_data); - -/** - * @brief This function is called when User/application wants to configure the service domain to only CS or Only PS or Both. - * This API triggers the underlying protocol stack to do register with Network for only CS services or only PS services - * or both based on the option set using this API. - * - * @par Sync (or) Async: - * This is an Asynchronous API. - * - * This function makes Dbus method call to Telephony Sever and returns immediate value. - * However it just means that the API request has been transfered to the CP successfully. - * The actual operation result is being delivered in the corresponding event asynchronously. - * - * @par Important Notes: - * - None. - * - * @warning - * - None. - * - * - * @param [in] handle - * - handle from tel_init(). - * - * @param[in] ServiceDomain - * - Specifies the type of Service domain (Packet switch, circuit switch,etc) - * - * @param [in] callback - * - To register callback function for result. - * - * @param [in] user_data - * - user_data for user specification. - * - * @par Async Response Message: - * The event associated is TAPI_EVENT_NETWORK_SET_SVC_DOMAIN_CNF and there is no event data associated with this event - * and asynchronous return status is indicated by #TelNetworkOperationCause_t. - * - * @pre - * - A dbus connection is established with #tel_init - * - The application name is registered with #tel_register_app_name - * - The application is registered events to listen asynchronous response with #tel_register_event - * - A event loop is running to listen events - * - * @post - * - None. - * - * @return Return Type (int) \n - * - TAPI_API_SUCCESS - indicating that the operation has completed successfully. \n - * - Refer #TapiResult_t for failure and error code - * - * @par Prospective Clients: - * External Apps. - * - * @code - * #include - * - * int ret_status; - * int RequestId; - * - * // SET NETWORK SERVICE DOMAIN - * TelNetworkServiceDomain_t ServiceDomain = TAPI_NETWORK_SERVICE_DOMAIN_AUTOMATIC; - * - * ret_status = tel_set_network_service_domain (ServiceDomain, &RequestId); - * @endcode - * - * @see - * - None. - * - * @remarks - * - None. - * - * - */ -/*================================================================================================*/ -int tel_set_network_service_domain(TapiHandle *handle, TelNetworkServiceDomain_t domain, - tapi_response_cb callback, void *user_data); - -/** - * @brief This function requests for the present network service domain i.e. CS or PS or both or automatic. - * - * @par Sync (or) Async: - * This is an Asynchronous API. - * - * This function makes Dbus method call to Telephony Sever and returns immediate value. - * However it just means that the API request has been transfered to the CP successfully. - * The actual operation result is being delivered in the corresponding event asynchronously. - * - * @par Important Notes: - * - None. - * - * @warning - * - None. - * - * @param [in] handle - * - handle from tel_init(). - * - * @param [in] callback - * - To register callback function for result. - * - * @param [in] user_data - * - user_data for user specification. - * - * @par Async Response Message: - * The event associated is TAPI_EVENT_NETWORK_GET_SVC_DOMAIN_CNF and the event data is #TelNetworkServiceDomain_t. - * Asynchronous return status is indicated by #TelNetworkOperationCause_t. - * - * @pre - * - A dbus connection is established with #tel_init - * - The application name is registered with #tel_register_app_name - * - The application is registered events to listen asynchronous response with #tel_register_event - * - A event loop is running to listen events - * - * @post - * - None. - * - * @return Return Type (int) \n - * - TAPI_API_SUCCESS - indicating that the operation has completed successfully. \n - * - Refer #TapiResult_t for failure and error code - * @par Prospective Clients: - * External Apps. - * - * @code - * #include - * - * int ret_status; - * int RequestId; - * - * // GET NETWORK SERVICE DOMAIN - * ret_status = tel_get_network_service_domain (&RequestId); - * - * @endcode - * - * @see - * - None. - * - * @remarks - * - None. - * - * - */ -/*================================================================================================*/ -int tel_get_network_service_domain(TapiHandle *handle, tapi_response_cb callback, void *user_data); - - -/** - * @brief This function is invoked to set the network band and allows the underlying OEM provider to scan the set band. - * - * This function makes Dbus method call to Telephony Sever and returns immediate value. - * However it just means that the API request has been transfered to the CP successfully. - * The actual operation result is being delivered in the corresponding event asynchronously. - * - * @par Sync (or) Async: - * This is an Asynchronous API. - * - * @par Important Notes: - * - None. - * - * @warning - * - None. - * - * - * @param [in] handle - * - handle from tel_init(). - * - * @param[in] mode - * - Band preference indicates the band provide to be preferred or select the band. - * - * @param[in] band - * - This enumeration defines different network Bands that user can choose. - * - * @param [in] callback - * - To register callback function for result. - * - * @param [in] user_data - * - user_data for user specification. - * - * @par Async Response Message: - * The event associated is TAPI_EVENT_NETWORK_SETNWBAND_CNF and there is no event data associated with this event and asynchronous - * return status is indicated by #TelNetworkOperationCause_t. - * - * @pre - * - A dbus connection is established with #tel_init - * - The application name is registered with #tel_register_app_name - * - The application is registered events to listen asynchronous response with #tel_register_event - * - A event loop is running to listen events - * - * @post - * - None. - * - * @return Return Type (int) \n - * - TAPI_API_SUCCESS - indicating that the operation has completed successfully. \n - * - Refer #TapiResult_t for failure and error code - * @par Prospective Clients: - * External Apps. - * - * @code - * #include - * - * int ret_status; - * int RequestId; - * - * TelNetworkBandPreferred_t BandMode = TAPI_NETWORK_BAND_MODE_PREFERRED; - * TelNetworkBand_t Band = TAPI_NETWORK_BAND_TYPE_GSM_900_1800; - * - * // SET NETWORK BAND - * ret_status = tel_set_network_band (BandMode, Band, &RequestId); - * - * @endcode - * - * @see - * - None. - * - * @remarks - * - None. - * - * - * - */ -/*================================================================================================*/ -int tel_set_network_band(TapiHandle *handle, TelNetworkBandPreferred_t mode, - TelNetworkBand_t band, tapi_response_cb callback, void *user_data); - -/** - * @brief This function requests for the present network band. - * - * This function makes Dbus method call to Telephony Sever and returns immediate value. - * However it just means that the API request has been transfered to the CP successfully. - * The actual operation result is being delivered in the corresponding event asynchronously. - * - * @par Sync (or) Async: - * This is an Asynchronous API. - * - * @par Important Notes: - * - None. - * - * @warning - * - None. - * - * - * @param [in] handle - * - handle from tel_init(). - * - * @param [in] callback - * - To register callback function for result. - * - * @param [in] user_data - * - user_data for user specification. - * - * @par Async Response Message: - * The event associated is TAPI_EVENT_NETWORK_GETNWBAND_CNF and the event data is #TelNetworkBand_t. - * Asynchronous return status is indicated by #TelNetworkOperationCause_t. - * - * @pre - * - A dbus connection is established with #tel_init - * - The application name is registered with #tel_register_app_name - * - The application is registered events to listen asynchronous response with #tel_register_event - * - A event loop is running to listen events - * - * @post - * - None. - * - * @return Return Type (int) \n - * - TAPI_API_SUCCESS - indicating that the operation has completed successfully. \n - * - Refer #TapiResult_t for failure and error code - * @par Prospective Clients: - * External Apps. - * - * @code - * #include - * - * int ret_status; - * int RequestId; - * - * // GET NETWORK BAND - * ret_status = tel_get_network_band(&RequestId); - * - * @endcode - * - * @see - * - None. - * - * @remarks - * - None. - * - * - * - */ -/*================================================================================================*/ -int tel_get_network_band(TapiHandle *handle, tapi_response_cb callback, void *user_data); - -/** - * @brief This function is invoked to set the network preferred plmn - * - * This function makes Dbus method call to Telephony Sever and returns immediate value. - * However it just means that the API request has been transfered to the CP successfully. - * The actual operation result is being delivered in the corresponding event asynchronously. - * - * @par Sync (or) Async: - * This is an Asynchronous API. - * - * @par Important Notes: - * - None. - * - * @warning - * - None. - * - * - * @param [in] handle - * - handle from tel_init(). - * - * @param[in] operation - * - Operation indicates the operation to be done on preferred plmn . - * - * @param[in] info - * - This gives the plmn Info. - * - * @param [in] callback - * - To register callback function for result. - * - * @param [in] user_data - * - user_data for user specification. - * - * @par Async Response Message: - * The event associated is TAPI_EVENT_NETWORK_SETPREFFPLMN_CNF and there is no event data associated with this event and asynchronous - * return status is indicated by #TelNetworkOperationCause_t. - * - * @pre - * - A dbus connection is established with #tel_init - * - The application name is registered with #tel_register_app_name - * - The application is registered events to listen asynchronous response with #tel_register_event - * - A event loop is running to listen events - * - * @post - * - None. - * - * @return Return Type (int) \n - * - TAPI_API_SUCCESS - indicating that the operation has completed successfully. \n - * - Refer #TapiResult_t for failure and error code - * @par Prospective Clients: - * External Apps. - * - * @code - * #include - * - * int ret_status; - * int RequestId; - * - * TelNetworkPreferredPlmnOp_t Operation = TAPI_NETWORK_PREF_PLMN_ADD; - * TelNetworkPreferredPlmnInfo_t PrefPlmnInfo; - * - * memset(&PrefPlmnInfo, 0, sizeof(TelNetworkPreferredPlmnInfo_t)); - * PrefPlmnInfo.Index = 0; - * PrefPlmnInfo.SystemType = TAPI_NETWORK_SYSTEM_GSM; - * unsigned char *plmn = "45454"; - * memcpy(PrefPlmnInfo.Plmn, plmn, strlen(plmn)); - * - * // SET PREFERRED PLMN - * ret_status = tel_set_network_preferred_plmn(Operation, PrefPlmnInfo, &RequestId); - * - * @endcode - * - * @see - * - None. - * - * @remarks - * - None. - * - * - * - */ -/*================================================================================================*/ -int tel_set_network_preferred_plmn(TapiHandle *handle, TelNetworkPreferredPlmnOp_t operation, - TelNetworkPreferredPlmnInfo_t *info, tapi_response_cb callback, void *user_data); - -/** - * @brief This function is invoked to get the preferred plmn list - * - * This function makes Dbus method call to Telephony Sever and returns immediate value. - * However it just means that the API request has been transfered to the CP successfully. - * The actual operation result is being delivered in the corresponding event asynchronously. - * - * @par Sync (or) Async: - * This is an Asynchronous API. - * - * @par Important Notes: - * - None. - * - * @warning - * - None. - * - * @param [in] handle - * - handle from tel_init(). - * - * @param [in] callback - * - To register callback function for result. - * - * @param [in] user_data - * - user_data for user specification. - * - * - * @par Async Response Message: - * The event associated is TAPI_EVENT_NETWORK_GETPREFFPLMN_CNF and event data associated with this event is #TelNetworkPreferredPlmnList_t - * and asynchronous return status is indicated by #TelNetworkOperationCause_t. - * - * @pre - * - A dbus connection is established with #tel_init - * - The application name is registered with #tel_register_app_name - * - The application is registered events to listen asynchronous response with #tel_register_event - * - A event loop is running to listen events - * - * @post - * - None. - * - * @return Return Type (int) \n - * - TAPI_API_SUCCESS - indicating that the operation has completed successfully. \n - * - Refer #TapiResult_t for failure and error code - * @par Prospective Clients: - * External Apps. - * - * @code - * #include - * - * int ret_status; - * int RequestId; - * - * // GET NETWORK PREFERRED PLMN - * ret_status = tel_get_network_preferred_plmn(&RequestId); - * - * @endcode - * - * @see - * - None. - * - * @remarks - * - None. - * - * - * - */ -/*================================================================================================*/ -int tel_get_network_preferred_plmn(TapiHandle *handle, tapi_response_cb callback, void *user_data); - - -/** - * @brief This function is called to cancel the triggered manual network search. - * - * @par Sync (or) Async: - * This is an Asynchronous API. - * - * @par Important Notes: - * - None. - * - * @warning - * - None. - * - * @param [in] handle - * - handle from tel_init(). - * - * @param [in] callback - * - To register callback function for result. - * - * @param [in] user_data - * - user_data for user specification. - * - * @par Async Response Message: - * The event associated is TAPI_EVENT_NETWORK_CANCELMANUALSEARCH_CNF and there is no event data associated with this event - * and asynchronous return status is indicated by #TelNetworkOperationCause_t. - * - * @pre - * - Manual network search is already triggered. - * - * @post - * - None. - * - * @return Return Type (int) \n - * - TAPI_API_SUCCESS - indicating that the operation has completed successfully. \n - * - Refer #TapiResult_t for failure and error code - * - * @par Prospective Clients: - * External Apps. - * - * - */ -/*================================================================================================*/ -int tel_cancel_network_manual_search(TapiHandle *handle, tapi_response_cb callback, void *user_data); - -/** - * @brief This function is called to get network serving. - * - * @par Sync (or) Async: - * This is an Asynchronous API. - * - * @par Important Notes: - * - None. - * - * @warning - * - None. - * - * @param [in] handle - * - handle from tel_init(). - * - * @param [in] callback - * - To register callback function for result. - * - * @param [in] user_data - * - user_data for user specification. - * - * @par Async Response Message: - * The event associated is TAPI_EVENT_NETWORK_CANCELMANUALSEARCH_CNF and there is no event data associated with this event - * and asynchronous return status is indicated by #TelNetworkOperationCause_t. - * - * @pre - * - * @post - * - None. - * - * @return Return Type (int) \n - * - TAPI_API_SUCCESS - indicating that the operation has completed successfully. \n - * - Refer #TapiResult_t for failure and error code - * - * @par Prospective Clients: - * External Apps. - * - */ -/*================================================================================================*/ -int tel_get_network_serving(TapiHandle *handle, tapi_response_cb callback, void *user_data); - -/** - * @brief This function is called to set network mode. - * - * @par Sync (or) Async: - * This is an Asynchronous API. - * - * @par Important Notes: - * - None. - * - * @warning - * - None. - * - * @param [in] handle - * - handle from tel_init(). - * - * @param [in] mode - * - * @param [in] callback - * - To register callback function for result. - * - * @param [in] user_data - * - user_data for user specification. - * - * @par Async Response Message: - * The event associated is TAPI_EVENT_NETWORK_CANCELMANUALSEARCH_CNF and there is no event data associated with this event - * and asynchronous return status is indicated by #TelNetworkOperationCause_t. - * - * @pre - * - * @post - * - None. - * - * @return Return Type (int) \n - * - TAPI_API_SUCCESS - indicating that the operation has completed successfully. \n - * - Refer #TapiResult_t for failure and error code - * - * @par Prospective Clients: - * External Apps. - * - */ -/*================================================================================================*/ -int tel_set_network_mode(TapiHandle *handle, int mode, tapi_response_cb callback, void *user_data); - -/** - * @brief This function is called to get network mode. - * - * @par Sync (or) Async: - * This is an Asynchronous API. - * - * @par Important Notes: - * - None. - * - * @warning - * - None. - * - * @param [in] handle - * - handle from tel_init(). - * - * @param [in] callback - * - To register callback function for result. - * - * @param [in] user_data - * - user_data for user specification. - * - * @par Async Response Message: - * The event associated is TAPI_EVENT_NETWORK_CANCELMANUALSEARCH_CNF and there is no event data associated with this event - * and asynchronous return status is indicated by #TelNetworkOperationCause_t. - * - * @pre - * - * @post - * - None. - * - * @return Return Type (int) \n - * - TAPI_API_SUCCESS - indicating that the operation has completed successfully. \n - * - Refer #TapiResult_t for failure and error code - * - * @par Prospective Clients: - * External Apps. - * - */ -/*================================================================================================*/ -int tel_get_network_mode(TapiHandle *handle, tapi_response_cb callback, void *user_data); - -/** - * @brief This function is called to get neighboring cell info. - * - * @par Sync (or) Async: - * This is an Asynchronous API. - * - * @par Important Notes: - * - None. - * - * @warning - * - None. - * - * @param [in] handle - * - handle from tel_init(). - * - * @param [in] callback - * - To register callback function for result. - * - * @param [in] user_data - * - user_data for user specification. - * - * @par Async Response Message: - * - The event data is #TelNetworkNeighboringCellInfo_t. - * - * @pre - * - * @post - * - None. - * - * @return Return Type (int) \n - * - TAPI_API_SUCCESS - indicating that the operation has completed successfully. \n - * - Refer #TapiResult_t for failure and error code - * - * @par Prospective Clients: - * External Apps. - * - */ -/*================================================================================================*/ -int tel_get_network_neighboring_cell_info(TapiHandle *handle, tapi_response_cb callback, void *user_data); - -#ifdef __cplusplus -} -#endif - -#endif /* _ITAPI_NETWORK_H_ */ - -/** - * @} - */ diff --git a/mobile/include/ITapiPS.h b/mobile/include/ITapiPS.h deleted file mode 100644 index 4edae8c..0000000 --- a/mobile/include/ITapiPS.h +++ /dev/null @@ -1,764 +0,0 @@ -/* - * libslp-tapi - * - * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. - * - * Contact: Ja-young Gu - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT 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 GPRS_TAPI GPRS - * @{ - * - * GPRS APIs allow an application to accomplish the following services: @n - * - activate , deactivate PDP service @n - * - */ - -#ifndef _ITAPI_PS_H_ -#define _ITAPI_PS_H_ - -#include -#include -#include -#include - -#ifdef __cplusplus -extern "C" -{ -#endif - -/* Defining macros for PSMAN profiles */ -#define TAPI_PDP_ADDR_LEN_MAX 20 -#define TAPI_PDP_APN_LEN_MAX 101 -#define TAPI_PDP_NAME_LEN_MAX 16 -#define TAPI_PDP_MAX_USERNAME_LEN 32 -#define TAPI_PDP_MAX_PASSWORD_LEN 32 -#define TAPI_PDP_MAX_DNS_LEN 16 -#define MAX_PDP_CONTEXTS_ALLOWED 3 -#define MAX_GPRS_PORT_LIST 200 - -typedef enum { - TAPI_GPRS_DEFINE_PDP_CONTEXT=0x01, /* 0x01 : Define PDP Context */ - TAPI_GSM_GPRS_QOS, /* 0x02 : Quality of Service Profile */ - TAPI_GSM_GPRS_PS, /* 0x03 : PS attach or detach */ - TAPI_GSM_GPRS_PDP_CONTEXT, /* 0x04 : PDP context activate or deactivate */ - TAPI_GSM_GPRS_ENTER_DATA, /* 0x05 : Enter data */ - TAPI_GSM_GPRS_SHOW_PDP_ADDR, /* 0x06 : Show PDP address*/ - TAPI_GSM_GPRS_MS_CLASS, /* 0x07 : GPRS mobile station class*/ - TAPI_GSM_GPRS_3G_QUAL_SRVC_PROFILE, /* 0x08 : 3G Quality of service profile */ - TAPI_GSM_GPRS_IP_CONFIGURATION, /* 0x09 : Multiple PDP context IP configuration */ - TAPI_GSM_GPRS_DEFINE_SEC_PDP_CONTEXT, /* 0X0A : AT+CGDSCONT 05.10.07 ky.doo EDIT */ - TAPI_GSM_GPRS_TFT, /* 0X0B : AT+CGTFT 05.10.07 ky.doo EDIT */ - TAPI_GSM_GPRS_HSDPA_STATUS, /* 0x0C : HSDPA status */ - TAPI_GSM_GPRS_CURRENT_SESSION_DATA_COUNTER,/* 0x0D : Current data session tx/rx total bytes */ - TAPI_GSM_GPRS_DATA_DORMANT, /* 0x0E : Force to set Dormant */ - TAPI_GSM_GPRS_DUN_PIN_CTRL , /* 0x0F : Dial up Networking Pin Control Message */ - TAPI_GSM_GPRS_CALL_STATUS, /* 0x10 : DS TE2 Data Call result(Multiple PDP) */ - TAPI_GSM_GPRS_PORT_SEL, /* 0x11 : PORT SEL */ - TAPI_GSM_GPRS_MAX -} tapi_gprs_type_t; - -typedef enum{ - TAPI_PDP_MODE_ADD = 0x01, /*ADD*/ - TAPI_PDP_MODE_DEL = 0x02 /*Delete*/ -} tapi_pdp_mode_type_t; - -typedef enum{ - TAPI_PDP_AUTH_NONE = 0x0, /* No authentication */ - TAPI_PDP_AUTH_PAP = 0x1, /* PAP authentication */ - TAPI_PDP_AUTH_CHAP = 0x2, /* CHAP authentication */ - TAPI_PDP_AUTH_MAX = 0xff - -} tapi_pdp_auth_type_t; - -typedef enum { - GPRS_PDP_TYPE_UNKNOWN = 0x00, - GPRS_PDP_TYPE_X25 = 0x01, - GPRS_PDP_TYPE_IP = 0x02, - GPRS_PDP_TYPE_IHOSP = 0x03, - GPRS_PDP_TYPE_PPP = 0x04, - GPRS_PDP_TYPE_IPV6 = 0x05, -} tapi_pdp_type_t; - -/* HSDPA Status Variable */ -typedef enum { - HSDPA_INACTIVE, - HSDPA_ACTIVE -} tapi_hspda_status_type; - -typedef enum { - GPRS_SIGNAL_DCD = 0x01, - GPRS_DATA_SIGNAL_DTR = 0x04, - GPRS_DATA_SIGNAL_DSR = 0x06, - GPRS_DATA_SIGNAL_RTS = 0x07, - GPRS_DATA_SIGNAL_CTS = 0x08, - GPRS_DATA_SIGNAL_RI = 0x09, -} tapi_ps_btdun_pincontrol_signal; - -typedef enum { - GPRS_SIGNAL_STATUS_OFF = 0x00, - GPRS_SIGNAL_STATUS_ON = 0x01, -} tapi_ps_btdun_pincontrol_status; - -typedef enum { - TAPI_GPRS_PS_STATUS_DETACH = 0x00, - TAPI_GPRS_PS_STATUS_ATTACH = 0x01, - TAPI_GPRS_PS_STATUS_MAX -} tapi_gprs_pdp_status; - -typedef enum { - TAPI_GPRS_MO_SMS_SVC_CIRCUIT = 0x00, - TAPI_GPRS_MO_SMS_SVC_GPRS = 0x01, - TAPI_GPRS_MO_SMS_SVC_CIRCUITPREFERRED = 0x02, - TAPI_GPRS_MO_SMS_SVC_GPRSPREFERRED = 0x03, -} tapi_gprs_pdp_mo_sms_service; - -typedef enum { - TAPI_GPRS_3G_QOS_TYPE_REQUEST = 0x01, - TAPI_GPRS_3G_QOS_TYPE_MIN_ACCEPT = 0x02, - TAPI_GPRS_3G_QOS_TYPE_NEGOTIATE = 0x03, -} tapi_gprs_pdp_3g_qos_type; - -typedef enum { - TAPI_GPRS_3G_QOS_DELI_ORDER_NO = 0x00, - TAPI_GPRS_3G_QOS_DELI_ORDER_YES = 0x01, - TAPI_GPRS_3G_QOS_DELI_ORDER_SUBSCRIBE = 0x02, -} tapi_gprs_pdp_3g_qos_deli_order; - -typedef enum { - DSTATE_OK = 0x00, - DSTATE_CONNECT, - DSTATE_RING, - DSTATE_NO_CARRIER, - DSTATE_ERROR, - DSTATE_NO_DIALTONE, - DSTATE_BUSY, - DSTATE_NO_ANSWER, - DSTATE_RESULT_FDN, - DSTATE_MAX, -} tapi_gprs_data_status; - -typedef enum { - PDP_ACT_FAILURE_CAUSE_NORMAL = 0x00, // 0x00 : Normal Process ( no problem ) - PDP_ACT_FAILURE_CAUSE_REL_BY_USER = 0x01, // Call Released by User - PDP_ACT_FAILURE_CAUSE_REGULAR_DEACTIVATION = 0x02, // Regular deactivation - PDP_ACT_FAILURE_CAUSE_LLC_SNDCP = 0x03, // LLC SNDCP failure - PDP_ACT_FAILURE_CAUSE_INSUFFICIENT_RESOURCE = 0x04, // Insufficient resources - PDP_ACT_FAILURE_CAUSE_UNKNOWN_APN = 0x05, // Missing or unknown apn - PDP_ACT_FAILURE_CAUSE_UNKNOWN_PDP_ADDRESS = 0x06, // Unknown PDP address or type - PDP_ACT_FAILURE_CAUSE_USER_AUTH_FAILED = 0x07, // Unknown PDP address or type - PDP_ACT_FAILURE_CAUSE_ACT_REJ_GGSN = 0x08, // Unknown PDP address or type - PDP_ACT_FAILURE_CAUSE_ACT_REJ_UNSPECIFIED = 0x09, // Unknown PDP address or type - PDP_ACT_FAILURE_CAUSE_SVC_OPTION_NOT_SUPPORTED = 0x0A, // Service option not supported - PDP_ACT_FAILURE_CAUSE_SVC_NOT_SUBSCRIBED = 0x0B, // Requested service option not subscribed - PDP_ACT_FAILURE_CAUSE_SVC_OPT_OUT_ORDER = 0x0C, // Service out of order - PDP_ACT_FAILURE_CAUSE_NSAPI_USED = 0x0D, // NSAPI already used - PDP_ACT_FAILURE_CAUSE_QOS_NOT_ACCEPTED = 0x0E, // QoS not accepted - PDP_ACT_FAILURE_CAUSE_NETWORK_FAILURE = 0x0F, // Network Failure - PDP_ACT_FAILURE_CAUSE_REACT_REQUIRED = 0x10, // Reactivation Required - PDP_ACT_FAILURE_CAUSE_REATURE_NOT_SUPPORTED = 0x11, // Feature not supported - PDP_ACT_FAILURE_CAUSE_TFT_FILTER_ERROR = 0x12, // TFT or filter error - PDP_ACT_FAILURE_CAUSE_UNKOWN_PDP_CONTEXT = 0x13, // Unknown PDP context - PDP_ACT_FAILURE_CAUSE_INVALID_MSG = 0x14, // Invalid MSG - PDP_ACT_FAILURE_CAUSE_PROTOCOL_ERROR = 0x15, // Protocol error - PDP_ACT_FAILURE_CAUSE_MOBILE_FAILURE_ERROR = 0x16, // Mobile failure error - PDP_ACT_FAILURE_CAUSE_TIMEOUT_ERROR = 0x17, // Timeout error - PDP_ACT_FAILURE_CAUSE_UNKNOWN_ERROR = 0x18, // Unknown error - PDP_ACT_FAILURE_CAUSE_MAX , -} tapi_gprs_ds_status_reason; - -typedef enum { - INTERNAL_PS_CALL = 0x00, - EXTERNAL_PS_CALL = 0x01 -} tapi_gprs_external_status; - -typedef enum { - PDP_DEVICE_INFO_GET = 0x00, - PDP_DEVICE_INFO_SET = 0x01 -} tapi_gprs_device_info; - -typedef enum{ - TAPI_GPRS_PORT_LIST_NOT_USE, // 0x00 - TAPI_GPRS_PORT_LIST_WHITE, // 0x01 - TAPI_GPRS_PORT_LIST_BLACK, // 0x02 -} tapi_gprs_port_list_type; - -typedef enum { - TAPI_PDP_STATE_NONE, /* 0x00 Default state for a given PDP context*/ - TAPI_PDP_STATE_ACTIVATING, /* 0x01 TS will be in this state when there is a START PDP Request until it is activated by modem - This state PDP is not yet UP*/ - TAPI_PDP_STATE_ACTIVE, /* 0x02 After PDP activation is completed by modem and sent to PDA - This state PDP is fully UP*/ - TAPI_PDP_STATE_MODIFYING, /* 0x03 This state is reserved for future use - When TS support modifying existing PDP*/ - TAPI_PDP_STATE_DEACTIVATING, /* 0x04 TS will be in this state when there is STOP PDP request from App until it is deactivated by modem */ -} tapi_gprs_state; - -typedef enum { - TAPI_PDP_DATA_DORMANCY_SUCCESS, - TAPI_PDP_DATA_DORMANCY_FAILED -} TelTapiGprsDataDormancy_t; - -/* Suspend Reason Type */ -typedef enum { - TAPI_PDP_SUSPEND_NO_SVC = 0x01, - TAPI_PDP_SUSPEND_RAT_CHANGE = 0x02, - TAPI_PDP_SUSPEND_GPRS_HOLD = 0x03, - TAPI_PDP_SUSPEND_FLOW_CONTROL = 0x04, - TAPI_PDP_SUSPEND_GPRS_SUSPEND = 0x05, - TAPI_PDP_SUSPEND_RAU = 0x06, - TAPI_PDP_SUSPEND_LU = 0x07, - TAPI_PDP_TRANSFER_STATUS_MAX -} tapi_gprs_suspend_type; - -typedef struct { - tapi_gprs_type_t type; - tapi_phone_err_t cause; -} tapi_gprs_error_info_t; - -typedef struct { - int cont_id; - tapi_pdp_err_t err; -} tapi_ps_pdp_info_t; - -typedef struct { - int cont_id; - tapi_pdp_err_t err; -} tapi_ps_net_stop_rsp_t; - -typedef struct { - int cont_id; - tapi_pdp_err_t err; -} tapi_ps_net_activation_rsp_t; - -typedef struct { - int cont_id; - tapi_pdp_err_t err; -} tapi_ps_net_stop_ind_t; - -/* ps attach response */ -typedef struct { - int state; - int transfer_status; -} tapi_ps_attach_response_t; - -/* ps call statistics */ -typedef struct { - unsigned char cid; // call id . for proper bit alignment prefer int than short - unsigned long int rx; // total number of bytes received for this cid - unsigned long int tx; // total number of bytes transmitted for this cid -} tapi_ps_call_statistics_t; - -typedef struct { - tapi_ps_btdun_pincontrol_signal signal; - tapi_ps_btdun_pincontrol_status status; -} tapi_ps_btdun_pincontrol; - -/** - * This structure defines PDP information. - * @see ps_net_info_t - */ -typedef struct { - unsigned short is_primary_cont; /*Primary or secondary*/ - int primary_cont; /*Primary context id, if the is the context is secondary*/ - char apn[TAPI_PDP_APN_LEN_MAX]; - unsigned char pdp_address[TAPI_PDP_ADDR_LEN_MAX]; - unsigned char username[TAPI_PDP_MAX_USERNAME_LEN ]; - unsigned char password[TAPI_PDP_MAX_PASSWORD_LEN ]; - unsigned char dns1[TAPI_PDP_MAX_DNS_LEN ]; // @field Context activation DNS1 - unsigned char dns2[TAPI_PDP_MAX_DNS_LEN ]; // @field Context activation DNS2 - tapi_pdp_auth_type_t auth_type; - tapi_pdp_type_t pdp_type; -} tapi_pdp_info_t; - -typedef struct { - int cont_id; - tapi_pdp_info_t pdp_info; -} tapi_ps_net_start_req_t; - -typedef struct { - unsigned short is_primary_cont; /*Primary or secondary*/ - unsigned char username[TAPI_PDP_MAX_USERNAME_LEN ]; - unsigned char password[TAPI_PDP_MAX_PASSWORD_LEN ]; - unsigned char dns1[TAPI_PDP_MAX_DNS_LEN ]; // @field Context activation DNS1 - unsigned char dns2[TAPI_PDP_MAX_DNS_LEN ]; // @field Context activation DNS2 - tapi_pdp_auth_type_t auth_type; -} tapi_pdpdeact_info_t; - -typedef struct { - int cont_id; - tapi_pdpdeact_info_t pdp_info; -} tapi_ps_net_stop_req_t; - -typedef struct { - unsigned char field_flag; - unsigned char ip_address[4]; - unsigned char primary_dns[4]; - unsigned char secondary_dns[4]; - unsigned char gateway[4]; - unsigned char subnet_mask[4]; -} tapi_pdp_resp_info_t; - -typedef struct { - int cont_id; - tapi_pdp_err_t err; - tapi_pdp_resp_info_t pdp_info; - char devname[TAPI_PDP_NAME_LEN_MAX]; -} tapi_ps_net_start_rsp_t; - -typedef struct tagSetPDPActDeact { - int cid; - unsigned char username[TAPI_PDP_MAX_USERNAME_LEN ]; // @field Context activation user name - unsigned char passwd[TAPI_PDP_MAX_PASSWORD_LEN ]; // @field Context activation password - unsigned char dns1[TAPI_PDP_MAX_DNS_LEN ]; // @field Context activation DNS1 - unsigned char dns2[TAPI_PDP_MAX_DNS_LEN ]; // @field Context activation DNS2 - tapi_pdp_auth_type_t auth; -} tapi_gprs_pdp_act_deact_set; - -typedef struct { - char cid; - tapi_gprs_pdp_status state; -} tapi_gprs_pdp_status_info; - -typedef struct { - char num_act; - tapi_gprs_pdp_status_info info[3]; -} tapi_gprs_pdp_status_res; - -typedef struct { - char cid; - char address[20]; -} tapi_gprs_pdp_address_res; - -typedef struct { - unsigned char cid; - tapi_gprs_data_status status; - tapi_gprs_ds_status_reason reason; - unsigned char external; -} tapi_gprs_pdp_status_reason_info; - -typedef struct { - tapi_gprs_port_list_type type; - unsigned char len; - unsigned short list[MAX_GPRS_PORT_LIST]; -} tapi_gprs_port_list; - -typedef struct { - tapi_gprs_port_list tcp_list; - tapi_gprs_port_list udp_list; -} tapi_gprs_pdp_port_list_setting_info_t; - -/** - * @brief This API is used to request to Telephony Server to set PDP context define info, PDP activation. - * Access to this API is limited, we recommend you use Data Network API - * - * This function makes Dbus method call to Telephony Sever and returns immediate value. - * However it just means that the API request has been transfered to the CP successfully. - * The actual operation result is being delivered in the corresponding event asynchronously. - * - * @par Sync (or) Async: - * This is an Asynchronous API. - * - * @par Important Notes: - * -NONE - * - * @warning - * - None. - * - * @param[in] pNet_start_req_info - * - This input has the PDP context define info, PDP activation info #tapi_ps_net_start_req_t - * - * @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_PS_PDP_ACT_RSP and the event data is #tapi_ps_pdp_info_t. - * - * - * @pre - * - A dbus connection is established with #tel_init - * - The application name is registered with #tel_register_app_name - * - The application is registered events to listen asynchronous response with #tel_register_event - * - A event loop is running to listen events - * - * @post - * - None. - * - * @return Return Type (int) \n - * - Integer '0' - indicating that the operation has completed successfully. \n - * - Negative integer : it provides an error code (Refer #TapiResult_t) - * - * @par Prospective Clients: - * External Apps. - * - * @code - * #include - * - * int ret_status; - * int request_id = 0; - * tapi_ps_net_start_req_t start_req; - * - * start_req.cont_id = CONTEXT_ID; //use proper id regarding upper layer usage - * strcpy(start_req.pdp_info.apn, APN_ADDRESS); - * - * ret_status = tel_activate_gprs_pdp (&start_req, &request_id); - * @endcode - * - * @see - * - None. - * - * @remarks - * - None. - */ -/*================================================================================================*/ -int tel_activate_gprs_pdp(const tapi_ps_net_start_req_t *pNet_start_req_info, int *pRequestID); - -/** - * @brief This API is used to request to Telephony Server to deactivate PDP service - * Access to this API is limited, we recommend you use Data Network API - * - * This function makes Dbus method call to Telephony Sever and returns immediate value. - * However it just means that the API request has been transfered to the CP successfully. - * The actual operation result is being delivered in the corresponding event asynchronously. - * - * @par Sync (or) Async: - * This is an Asynchronous API. - * - * @par Important Notes: - * -NONE - * - * @warning - * - None. - * - * @param[in] net_stop_req_info - * - This input has the PDP context define info, PDP activation info #tapi_ps_net_start_req_t - * - * @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_PS_PDP_DEACT_RSP and the event data is #tapi_ps_pdp_info_t. - * - * - * @pre - * - A dbus connection is established with #tel_init - * - The application name is registered with #tel_register_app_name - * - The application is registered events to listen asynchronous response with #tel_register_event - * - A event loop is running to listen events - * - * @post - * - None. - * - * @return Return Type (int) \n - * - Integer '0' - indicating that the operation has completed successfully. \n - * - Negative integer : it provides an error code (Refer #TapiResult_t) - * - * @par Prospective Clients: - * External Apps. - * - * @code - * #include - * - * int ret_status; - * int request_id = 0; - * tapi_ps_net_stop_req_t end_req; - * - * 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); //use context id which is used in activate time - * @endcode - * - * @see - * - None. - * - * @remarks - * - None. - */ -/*================================================================================================*/ -int tel_deactivate_gprs_pdp(const tapi_ps_net_stop_req_t *net_stop_req_info, int *pRequestID); - -/** - * @brief This API is used to send modem data channels to dormant state for power saving when there is no data flowing for certain time - * Access to this API is limited, we recommend you use Data Network API - * - * This function makes Dbus method call to Telephony Sever and returns immediate value. - * However it just means that the API request has been transfered to the CP successfully. - * The actual operation result is being delivered in the corresponding event asynchronously. - * - * @par Sync (or) Async: - * This is an Asynchronous API. - * - * @par Important Notes: - * -NONE - * - * @warning - * - 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_PS_DATA_DORMANT_RESP and the event data is #TelTapiGprsDataDormancy_t. - * - * @pre - * - A dbus connection is established with #tel_init - * - The application name is registered with #tel_register_app_name - * - The application is registered events to listen asynchronous response with #tel_register_event - * - A event loop is running to listen events - * - * @post - * - None. - * - * @return Return Type (int) \n - * - Integer '0' - indicating that the operation has completed successfully. \n - * - Negative integer : it provides an error code (Refer #TapiResult_t) - * - * @par Prospective Clients: - * External Apps. - * - * @code - * #include - * - * int ret_status; - * int request_id = 0; - * - * ret_status = tel_set_gprs_dormant(&request_id); //if user want to dormant state - * @endcode - * - * @see - * - None. - * - * @remarks - * - None. - */ -/*================================================================================================*/ -int tel_set_gprs_dormant(int *pRequestID); - -/** - * @brief This API is used to get port list - * Access to this API is limited, we recommend you use Data Network API - * - * This function makes Dbus method call to Telephony Sever and returns immediate value. - * However it just means that the API request has been transfered to the CP successfully. - * The actual operation result is being delivered in the corresponding event asynchronously. - * - * @par Sync (or) Async: - * This is an Asynchronous API. - * - * @par Important Notes: - * -NONE - * - * @warning - * - 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_PS_PDP_GET_PORTLIST_RSP and the event data is #tapi_gprs_pdp_port_list_setting_info_t. - * - * @pre - * - A dbus connection is established with #tel_init - * - The application name is registered with #tel_register_app_name - * - The application is registered events to listen asynchronous response with #tel_register_event - * - A event loop is running to listen events - * - * @post - * - None. - * - * @return Return Type (int) \n - * - Integer '0' - indicating that the operation has completed successfully. \n - * - Negative integer : it provides an error code (Refer #TapiResult_t) - * - * @par Prospective Clients: - * External Apps. - * - * @code - * #include - * - * int ret_val; - * int requestId = 0; - * - * ret_val = tel_get_gprs_port_list(&requestId); //get port list with async response. current return value means whether request send low layer properly or not - * @endcode - * - * @see - * - None. - * - * @remarks - * - None. - */ -/*================================================================================================*/ -int tel_get_gprs_port_list(int *pRequestID); - -/** - * @brief This API is used to set port list - * Access to this API is limited, we recommend you use Data Network API - * - * This function makes Dbus method call to Telephony Sever and returns immediate value. - * However it just means that the API request has been transfered to the CP successfully. - * The actual operation result is being delivered in the corresponding event asynchronously. - * - * @par Sync (or) Async: - * This is an Asynchronous API. - * - * @par Important Notes: - * -NONE - * - * @warning - * - None. - * - * @param[in] info - * - This input has the TCP/UDP port list information info #tapi_gprs_pdp_port_list_setting_info_t - * - * @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: - * -None - * - * @pre - * - A dbus connection is established with #tel_init - * - The application name is registered with #tel_register_app_name - * - The application is registered events to listen asynchronous response with #tel_register_event - * - A event loop is running to listen events - * - * @post - * - None. - * - * @return Return Type (int) \n - * - Integer '0' - indicating that the operation has completed successfully. \n - * - Negative integer : it provides an error code (Refer #TapiResult_t) - * - * @par Prospective Clients: - * External Apps. - * - * @code - * #include - * - * int ret_val; - * int requestId = 0; - * tapi_gprs_pdp_port_list_setting_info_t test; - * - * memset(&test, 0, sizeof(tapi_gprs_pdp_port_list_setting_info_t)); - * test.tcp_list.type = TAPI_GPRS_PORT_LIST_NOT_USE; - * test.tcp_list.len = 1; - * test.tcp_list.list[0] = 1004; - * test.udp_list.type = TAPI_GPRS_PORT_LIST_NOT_USE; - * test.udp_list.len = 1; - * test.udp_list.list[i] = 1111; - * - * ret_val = tel_set_gprs_port_list(&test, &requestId); //get operation result with async response. current return value means whether request send low layer properly or not - * - * @endcode - * - * @see - * - None. - * - * @remarks - * - None. - */ -/*================================================================================================*/ -int tel_set_gprs_port_list(tapi_gprs_pdp_port_list_setting_info_t *info, int *pRequestID); - - -/** - * @brief This API is used to request BT Dun enable or disable - * Access to this API is limited, we recommend you use Data Network API - * - * This function makes Dbus method call to Telephony Sever and returns immediate value. - * However it just means that the API request has been transfered to the CP successfully. - * The actual operation result is being delivered in the corresponding event asynchronously. - * - * @par Sync (or) Async: - * This is an Asynchronous API. - * - * @par Important Notes: - * -NONE - * - * @warning - * - None. - * - * @param[in] pincontrol - * - This input has the BT Dun pin control information #tapi_ps_btdun_pincontrol - * - * @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_PS_BTDUN_PINCONTROL_NOTI or TAPI_EVENT_PS_ERROR_IND. - * -In success, the event associated is TAPI_EVENT_PS_BTDUN_PINCONTROL_NOTI and the event data is #tapi_ps_btdun_pincontrol. - * In fail, the event associated is TAPI_EVENT_PS_ERROR_IND and the event data is #tapi_gprs_error_info_t. - * - * @pre - * - A dbus connection is established with #tel_init - * - The application name is registered with #tel_register_app_name - * - The application is registered events to listen asynchronous response with #tel_register_event - * - A event loop is running to listen events - * - * @post - * - None. - * - * @return Return Type (int) \n - * - Integer '0' - indicating that the operation has completed successfully. \n - * - Negative integer : it provides an error code (Refer #TapiResult_t) - * - * @par Prospective Clients: - * External Apps. - * - * @code - * #include - * - * 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); //get control result with async response. current return value means whether request send low layer properly or not - * @endcode - * - * @see - * - None. - * - * @remarks - * - None. - */ -/*================================================================================================*/ - -#ifdef __cplusplus -} -#endif - -#endif //_ITAPI_PS_H_ - -/** - * @} - */ diff --git a/mobile/include/ITapiPhonebook.h b/mobile/include/ITapiPhonebook.h deleted file mode 100644 index 935971a..0000000 --- a/mobile/include/ITapiPhonebook.h +++ /dev/null @@ -1,535 +0,0 @@ -/* - * libslp-tapi - * - * Copyright (c) 2012 Samsung Electronics Co., Ltd. All rights reserved. - * - * Contact: Ja-young Gu - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT 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 PHONEBOOK_TAPI PHONEBOOK -* @{ -* -* @file ITapiPhonebook.h - - @brief This file serves as a "C" header file defines functions for Tapi SIM phonebook Services.\n - It contains a sample set of function prototypes that would be required by applications. - -*/ - -#ifndef _ITAPI_PHONEBOOK_H_ -#define _ITAPI_PHONEBOOK_H_ - -#include -#include -#include -#include - -#ifdef __cplusplus -extern "C" -{ -#endif - -/** - * @brief This function is used to get current inserted SIM phonebook init status, available phonebook list and first valid index in case of FDN, ADN, 3G phonebook. - * Access to this API is limited to in-house application and we recommend you use phonebook-engine APIs. - * - * @par Sync (or) Async: - * This is an synchronous API. - * - * @par Important Notes: - * - We recommend to use phonebook-engine APIs for handling phonebook(including SIM phonebook). - * If user uses SIM phonebook related APIs directly, it can break device phonebook consistency because all phonebook information managed in phonebook-engine. - * pb_list and first_index value are available at init_completed status is '1' only. - * - * @warning - * - None. - * - * @param [in] handle - * - handle from tel_init(). - * - * @param [out] init_completed - * - phonebook init status. '0' is not init, '1' is init complete to use. - * - * @param [out] pb_list - * - available SIM phonebook list. This value is valid in phonebook init complete case. - * - * @par Async Response Message: - * - None. - * - * @pre - * - None. - * - * @post - * - None. - * - * @return Return Type (int) \n - * - Integer '0' ( same with TAPI_API_SUCCESS ) - indicating that the operation has completed successfully. \n - * - Negative integer : it provides an error code (Refer #TapiResult_t) - * - * @par Prospective Clients: - * External Apps. - * - * @see None - * - * @code - * #include - * int err_code = 0; - * int valid_index = 0; // usim or sim adn first valid index - * TelSimPbList_t pb_list = {0,}; - * int pPbInitCompleted = 0; // init or not - * - * // GET SIM PHONEBOOK INIT INFORMATION - * err_code = tel_get_sim_pb_init_info(&pPbInitCompleted, &pb_list, &valid_index); - * @endcode - * - * @remarks None - * - */ -/*================================================================================================*/ -int tel_get_sim_pb_init_info(TapiHandle *handle, int *init_completed, TelSimPbList_t *pb_list); - - -/** - * @brief This API is used to get number of used records and total records in specific SIM phonebook type. - * Access to this API is limited to in-house application and we recommend you use phonebook-engine APIs. - * - * This function makes Dbus method call to Telephony Sever and returns immediate value. - * However it just means that the API request has been transfered to the CP successfully. - * The actual operation result is being delivered in the corresponding event asynchronously. - * - * @par Sync (or) Async: - * This is an Asynchronous API. - * - * @par Important Notes: - * - We recommend to use phonebook-engine APIs for handling phonebook(including SIM phonebook). - * If user uses SIM phonebook related APIs directly, it can break device phonebook consistency because all phonebook information managed in phonebook-engine. - * - * @warning - * - None. - * - * - * @param [in] handle - * - handle from tel_init(). - * - * @param[in] pb_type - * -Different storage types to be selected in SIM. #TelSimPbType_t - * - * @param [in] callback - * - To register callback function for result. - * - * @param [in] user_data - * - user_data for user specification. - * - * @par Async Response Message: - * The event associated is TAPI_EVENT_SIM_PB_STORAGE_COUNT_CNF and the event data is #TelSimPbStorageInfo_t. - * Asynchronous return status is indicated by #TelSimPbAccessResult_t. - * - * @pre - * - A dbus connection is established with #tel_init - * - The application name is registered with #tel_register_app_name - * - The application is registered events to listen asynchronous response with #tel_register_event - * - A event loop is running to listen events - * - * @post - * - None. - * - * @return Return Type (int) \n - * - Integer '0' ( same with TAPI_API_SUCCESS ) - indicating that the operation has completed successfully. \n - * - Negative integer : it provides an error code (Refer #TapiResult_t) - * - * @par Prospective Clients: - * External Apps. - * - * @see None - * - * @code - * #include - * int err_code = 0; - * int request_id = 0; - * TelSimPbType_t storage_type = 0x00; - * storage_type = TAPI_SIM_PB_3GSIM; // usim phonebook - * err_code = tel_get_sim_pb_count(storage_type, &request_id); - * @endcode - * - * @remarks None - * - */ -/*================================================================================================*/ -int tel_get_sim_pb_count(TapiHandle *handle, TelSimPbType_t pb_type, tapi_response_cb callback, void *user_data); - - -/** - * @brief This API is used to get max text length and max number length supported by SIM phone book elementary file. - * Access to this API is limited to in-house application and we recommend you use phonebook-engine APIs. - * - * This function makes Dbus method call to Telephony Sever and returns immediate value. - * However it just means that the API request has been transfered to the CP successfully. - * The actual operation result is being delivered in the corresponding event asynchronously. - * - * @par Sync (or) Async: - * This is an Asynchronous API. - * - * @par Important Notes: - * - The max number length includes the storage space provided by the corresponding EXT file for a given Dialling Number file. - * - We recommend to use phonebook-engine APIs for handling phonebook(including SIM phonebook). - * If user uses SIM phonebook related APIs directly, it can break device phonebook consistency because all phonebook information managed in phonebook-engine. - * - * @warning - * - None. - * - * @param [in] handle - * - handle from tel_init(). - * - * @param[in] pb_type - * -Different storage types to be selected in SIM. #TelSimPbType_t - * - * @param [in] callback - * - To register callback function for result. - * - * @param [in] user_data - * - user_data for user specification. - * - * @par Async Response Message: - * The event associated is TAPI_EVENT_SIM_PB_ENTRY_INFO_CNF and the event data is #TelSimPbEntryInfo_t. - * Asynchronous return status is indicated by #TelSimPbAccessResult_t. - * - * @pre - * - A dbus connection is established with #tel_init - * - The application name is registered with #tel_register_app_name - * - The application is registered events to listen asynchronous response with #tel_register_event - * - A event loop is running to listen events - * - * @post - * - None. - * - * @return Return Type (int) \n - * - Integer '0' ( same with TAPI_API_SUCCESS ) - indicating that the operation has completed successfully. \n - * - Negative integer : it provides an error code (Refer #TapiResult_t) - * - * @par Prospective Clients: - * External Apps. - * - * @see None - * - * @code - * #include - * int err_code = 0; - * int request_id = 0; - * TelSimPbType_t storage_type = 0x00; - * storage_type = TAPI_SIM_PB_3GSIM; // usim phonebook - * err_code = tel_get_sim_pb_meta_info(storage_type, &request_id); - * @endcode - * - * @remarks None - * - */ -/*================================================================================================*/ -int tel_get_sim_pb_meta_info(TapiHandle *handle, TelSimPbType_t pb_type, tapi_response_cb callback, void *user_data); - - -/** - * @brief This API is used to get SIM 3G phonebook supported EFs like ANR, SNE, GRP, EMAIL etc and corresponding EFs max text length, number length and size. - * Access to this API is limited to in-house application and we recommend you use phonebook-engine APIs. - * - * This function makes Dbus method call to Telephony Sever and returns immediate value. - * However it just means that the API request has been transfered to the CP successfully. - * The actual operation result is being delivered in the corresponding event asynchronously. - * - * @par Sync (or) Async: - * This is an Asynchronous API. - * - * @par Important Notes: - * - We recommend to use phonebook-engine APIs for handling phonebook(including SIM phonebook). - * If user uses SIM phonebook related APIs directly, it can break device phonebook consistency because all phonebook information managed in phonebook-engine. - * - * @warning - * - None. - * - * @param [in] handle - * - handle from tel_init(). - * - * @param [in] callback - * - To register callback function for result. - * - * @param [in] user_data - * - user_data for user specification. - * - * @par Async Response Message: - * - The event associated is TAPI_SIM_EVENT_PB_3G_CAPABILITY_INFO_CNF and the event data is #TelSimPbCapabilityInfo_t. - * Asynchronous return status is indicated by #TelSimPbAccessResult_t. - * - * @pre - * - A dbus connection is established with #tel_init - * - The application name is registered with #tel_register_app_name - * - The application is registered events to listen asynchronous response with #tel_register_event - * - A event loop is running to listen events - * - * @post - * - None. - * - * @return Return Type (int) \n - * - Integer '0' ( same with TAPI_API_SUCCESS ) - indicating that the operation has completed successfully. \n - * - Negative integer : it provides an error code (Refer #TapiResult_t) - * - * @par Prospective Clients: - * External Apps. - * - * @see None - * - * @code - * #include - * int err_code = 0; - * int request_id = 0; - * err_code = tel_get_sim_pb_3g_meta_info(&request_id); // you can find result by receiving asynch event response - * @endcode - * - * @remarks None - * - */ -/*================================================================================================*/ -int tel_get_sim_pb_usim_meta_info(TapiHandle *handle, tapi_response_cb callback, void *user_data); - - -/** - * @brief This API is used to read SIM phone book entry information from given storage type. - * Access to this API is limited to in-house application and we recommend you use phonebook-engine APIs. - * - * This function makes Dbus method call to Telephony Sever and returns immediate value. - * However it just means that the API request has been transfered to the CP successfully. - * The actual operation result is being delivered in the corresponding event asynchronously. - * - * @par Sync (or) Async: - * This is an Asynchronous API. - * - * @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. - * - We recommend to use phonebook-engine APIs for handling phonebook(including SIM phonebook). - * If user uses SIM phonebook related APIs directly, it can break device phonebook consistency because all phonebook information managed in phonebook-engine. - * - * @warning - * - None. - * - * @param [in] handle - * - handle from tel_init(). - * - * @param[in] pb_type - * -Different storage types to be selected in SIM. #TelSimPbType_t - * - * @param[in] index - * -Index for accessing the SIM data. - * - * @param [in] callback - * - To register callback function for result. - * - * @param [in] user_data - * - user_data for user specification. - * - * @par Async Response Message: - * The event associated is TAPI_EVENT_SIM_PB_ACCESS_READ_CNF and the event data is #TelSimPbRecordData_t. - * Asynchronous return status is indicated by #TelSimPbAccessResult_t. - * - * @pre - * - A dbus connection is established with #tel_init - * - The application name is registered with #tel_register_app_name - * - The application is registered events to listen asynchronous response with #tel_register_event - * - A event loop is running to listen events - * - * @post - * - None. - * - * @return Return Type (int) \n - * - Integer '0' ( same with TAPI_API_SUCCESS ) - indicating that the operation has completed successfully. \n - * - Negative integer : it provides an error code (Refer #TapiResult_t) - * - * @par Prospective Clients: - * External Apps. - * - * @see None - * - * @code - * #include - * int err_code = 0; - * int request_id = 0; - * unsigned short index = 1; - * TelSimPbType_t storage_type = 0x00; - * storage_type = TAPI_SIM_PB_3GSIM; // usim phonebook - * err_code = tel_read_sim_pb_record(storage_type, index, &request_id); - * @endcode - * - * @remarks None - * - */ -/*================================================================================================*/ -int tel_read_sim_pb_record(TapiHandle *handle, TelSimPbType_t pb_type, unsigned short index, tapi_response_cb callback, void *user_data); - - -/** - * @brief This API is used to add or edit SIM phone book record entry information. - * Access to this API is limited to in-house application and we recommend you use phonebook-engine APIs. - * - * This function makes Dbus method call to Telephony Sever and returns immediate value. - * However it just means that the API request has been transfered to the CP successfully. - * The actual operation result is being delivered in the corresponding event asynchronously. - * - * @par Sync (or) Async: - * This is an Asynchronous API. - * - * @par Important Notes: - * - We recommend to use phonebook-engine APIs for handling phonebook(including SIM phonebook). - * If user uses SIM phonebook related APIs directly, it can break device phonebook consistency because all phonebook information managed in phonebook-engine. - * - * @warning - * - None. - * - * - * @param [in] handle - * - handle from tel_init(). - * - * @param[in] req_data - * -phonebook data which will be updated or added. #TelSimPbRecordData_t - * - * @param [in] callback - * - To register callback function for result. - * - * @param [in] user_data - * - user_data for user specification. - * - * @par Async Response Message: - * The event associated is TAPI_EVENT_SIM_PB_UPDATE_CNF and the event data is #TelSimPbUpdateResp_t. - * Asynchronous return status is indicated by #TelSimPbAccessResult_t. - * - * @pre - * - A dbus connection is established with #tel_init - * - The application name is registered with #tel_register_app_name - * - The application is registered events to listen asynchronous response with #tel_register_event - * - A event loop is running to listen events - * - * @post - * - None. - * - * @return Return Type (int) \n - * - Integer '0' ( same with TAPI_API_SUCCESS ) - indicating that the operation has completed successfully. \n - * - Negative integer : it provides an error code (Refer #TapiResult_t) - * - * @par Prospective Clients: - * External Apps. - * - * @see None - * - * @code - * #include - * int err_code = 0; - * int request_id = 0; - * unsigned short index = 1; - * TelSimPbRecordData_t data; - * data.StorageFileType = TAPI_SIM_PB_3GSIM; // usim phonebook - * data.Index = 1; // index which will be updated - * data.NextIndex = 0; - * //data.ContactInfo will be added - * err_code = tel_update_sim_pb_record(&data, &request_id); - * @endcode - * - * @remarks None - * - */ -/*================================================================================================*/ -int tel_update_sim_pb_record(TapiHandle *handle, const TelSimPbRecord_t *req_data, tapi_response_cb callback, void *user_data); - - -/** - * @brief This API is used to delete a SIM phonebook record. - * Access to this API is limited to in-house application and we recommend you use phonebook-engine APIs. - * - * This function makes Dbus method call to Telephony Sever and returns immediate value. - * However it just means that the API request has been transfered to the CP successfully. - * The actual operation result is being delivered in the corresponding event asynchronously. - * - * @par Sync (or) Async: - * This is an Asynchronous API. - * - * @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. - * - We recommend to use phonebook-engine APIs for handling phonebook(including SIM phonebook). - * If user uses SIM phonebook related APIs directly, it can break device phonebook consistency because all phonebook information managed in phonebook-engine. - * - * @warning - * - None. - * - * - * @param [in] handle - * - handle from tel_init(). - * - * @param[in] pb_type - * -Different storage types to be selected in SIM. #TelSimPbType_t - * - * @param[in] index - * -Index of the record to be deleted. - * - * @param [in] callback - * - To register callback function for result. - * - * @param [in] user_data - * - user_data for user specification. - * - * @par Async Response Message: - * The event associated is TAPI_EVENT_SIM_PB_DELETE_CNF and the event data is #TelSimPbUpdateResp_t. - * Asynchronous return status is indicated by #TelSimPbAccessResult_t. - * - * @pre - * - A dbus connection is established with #tel_init - * - The application name is registered with #tel_register_app_name - * - The application is registered events to listen asynchronous response with #tel_register_event - * - A event loop is running to listen events - * - * @post - * - None. - * - * @return Return Type (int) \n - * - Integer '0' ( same with TAPI_API_SUCCESS ) - indicating that the operation has completed successfully. \n - * - Negative integer : it provides an error code (Refer #TapiResult_t) - * - * @par Prospective Clients: - * External Apps. - * - * @see None - * - * @code - * #include - * int err_code = 0; - * int request_id = 0; - * unsigned short index = 1; - * TelSimPbType_t storage_type = 0x00; - * storage_type = TAPI_SIM_PB_3GSIM; // usim phonebook - * err_code = tel_delete_sim_pb_record(storage_type, index, &request_id); - * @endcode - * - * @remarks None - * - */ -/*================================================================================================*/ -int tel_delete_sim_pb_record(TapiHandle *handle, TelSimPbType_t pb_type, unsigned short index, tapi_response_cb callback, void *user_data); - -#ifdef __cplusplus -} -#endif - -#endif /* _ITAPI_PHONEBOOK_H_ */ - -/** -* @} -*/ diff --git a/mobile/include/ITapiSap.h b/mobile/include/ITapiSap.h deleted file mode 100644 index c23bd37..0000000 --- a/mobile/include/ITapiSap.h +++ /dev/null @@ -1,433 +0,0 @@ -/* - * libslp-tapi - * - * Copyright (c) 2012 Samsung Electronics Co., Ltd. All rights reserved. - * - * Contact: Ja-young Gu - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT 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 SAP_TAPI SAP -* @{ -* -* @file ITapiSap.h - - @brief This file serves as a "C" header file defines functions for Tapi SAP Services.\n - It contains a sample set of function prototypes that would be required by applications. - -*/ - -#ifndef _ITAPI_SAP_H_ -#define _ITAPI_SAP_H_ - -#include -#include -#include -#include - -#ifdef __cplusplus -extern "C" -{ -#endif - -/** - * @brief This API is used to request to connect sap. - * - * @par Sync (or) Async: - * This is an Asynchronous API. - * - * @par Important Notes: - * - None - * - * @warning - * - None. - * - * @param [in] handle - * - handle from tel_init(). - * - * @param[in] max_msg_size - * - * @param [in] callback - * - To register callback function for result. - * - * @param [in] user_data - * - user_data for user specification. - * - * @par - * - * @pre - * - * @post - * - * @return Return Type (int) \n - * - Integer '0' ( same with TAPI_API_SUCCESS ) - indicating that the operation has completed successfully. \n - * - Negative integer : it provides an error code (Refer #TapiResult_t) - * - * @par Prospective Clients: - * External Apps. - * - * @see None - * - * @code - * - * @endcode - * - * @remarks None - * - */ -/*================================================================================================*/ -int tel_req_sap_connect(TapiHandle *handle, int max_msg_size, tapi_response_cb callback, void *user_data); - -/** - * @brief This API is used to request sap to disconnect sap. - * - * @par Sync (or) Async: - * This is an Asynchronous API. - * - * @par Important Notes: - * - None - * - * @warning - * - None. - * - * @param [in] handle - * - handle from tel_init(). - * - * @param [in] callback - * - To register callback function for result. - * - * @param [in] user_data - * - user_data for user specification. - * - * @par - * - * @pre - * - * @post - * - * @return Return Type (int) \n - * - Integer '0' ( same with TAPI_API_SUCCESS ) - indicating that the operation has completed successfully. \n - * - Negative integer : it provides an error code (Refer #TapiResult_t) - * - * @par Prospective Clients: - * External Apps. - * - * @see None - * - * @code - * - * @endcode - * - * @remarks None - * - */ -/*================================================================================================*/ -int tel_req_sap_disconnect(TapiHandle *handle, tapi_response_cb callback, void *user_data); - -/** - * @brief This API is used to request sap connection status. - * - * @par Sync (or) Async: - * This is an Asynchronous API. - * - * @par Important Notes: - * - None - * - * @warning - * - None. - * - * @param [in] handle - * - handle from tel_init(). - * - * @param [in] callback - * - To register callback function for result. - * - * @param [in] user_data - * - user_data for user specification. - * - * @par - * - * @pre - * - * @post - * - * @return Return Type (int) \n - * - Integer '0' ( same with TAPI_API_SUCCESS ) - indicating that the operation has completed successfully. \n - * - Negative integer : it provides an error code (Refer #TapiResult_t) - * - * @par Prospective Clients: - * External Apps. - * - * @see None - * - * @code - * - * @endcode - * - * @remarks None - * - */ -/*================================================================================================*/ -int tel_req_sap_connection_status(TapiHandle *handle, tapi_response_cb callback, void *user_data); - -/** - * @brief This API is used to request to get atr. - * - * @par Sync (or) Async: - * This is an Asynchronous API. - * - * @par Important Notes: - * - None - * - * @warning - * - None. - * - * @param [in] handle - * - handle from tel_init(). - * - * @param [in] callback - * - To register callback function for result. - * - * @param [in] user_data - * - user_data for user specification. - * - * @par - * - * @pre - * - * @post - * - * @return Return Type (int) \n - * - Integer '0' ( same with TAPI_API_SUCCESS ) - indicating that the operation has completed successfully. \n - * - Negative integer : it provides an error code (Refer #TapiResult_t) - * - * @par Prospective Clients: - * External Apps. - * - * @see None - * - * @code - * - * @endcode - * - * @remarks None - * - */ -/*================================================================================================*/ -int tel_req_sap_transfer_atr(TapiHandle *handle, tapi_response_cb callback, void *user_data); - -/** - * @brief This API is used to request to transfer apdu. - * - * @par Sync (or) Async: - * This is an Asynchronous API. - * - * @par Important Notes: - * - None - * - * @warning - * - None. - * - * @param [in] handle - * - handle from tel_init(). - * - * @param [in] apdu_data - * - * @param [in] callback - * - To register callback function for result. - * - * @param [in] user_data - * - user_data for user specification. - * - * @par - * - * @pre - * - * @post - * - * @return Return Type (int) \n - * - Integer '0' ( same with TAPI_API_SUCCESS ) - indicating that the operation has completed successfully. \n - * - Negative integer : it provides an error code (Refer #TapiResult_t) - * - * @par Prospective Clients: - * External Apps. - * - * @see None - * - * @code - * - * @endcode - * - * @remarks None - * - */ -/*================================================================================================*/ -int tel_req_sap_transfer_apdu(TapiHandle *handle, TelSapApduData_t *apdu_data, tapi_response_cb callback, void *user_data); - -/** - * @brief This API is used to request to transport protocol. - * - * @par Sync (or) Async: - * This is an Asynchronous API. - * - * @par Important Notes: - * - None - * - * @warning - * - None. - * - * @param [in] handle - * - handle from tel_init(). - * - * @param [in] protocol - * - SAP transport protocol type - * - * @param [in] callback - * - To register callback function for result. - * - * @param [in] user_data - * - user_data for user specification. - * - * @par - * - * @pre - * - * @post - * - * @return Return Type (int) \n - * - Integer '0' ( same with TAPI_API_SUCCESS ) - indicating that the operation has completed successfully. \n - * - Negative integer : it provides an error code (Refer #TapiResult_t) - * - * @par Prospective Clients: - * External Apps. - * - * @see None - * - * @code - * - * @endcode - * - * @remarks None - * - */ -/*================================================================================================*/ -int tel_req_sap_transport_protocol(TapiHandle *handle, TelSimSapProtocol_t protocol, tapi_response_cb callback, void *user_data); - -/** - * @brief This API is used to request to control power_mode. - * - * @par Sync (or) Async: - * This is an Asynchronous API. - * - * @par Important Notes: - * - None - * - * @warning - * - None. - * - * @param [in] handle - * - handle from tel_init(). - * - * @param [in] power_mode - * - enum data for controlling power mode of client - * - * @param [in] callback - * - To register callback function for result. - * - * @param [in] user_data - * - user_data for user specification. - * - * @par - * - * @pre - * - * @post - * - * @return Return Type (int) \n - * - Integer '0' ( same with TAPI_API_SUCCESS ) - indicating that the operation has completed successfully. \n - * - Negative integer : it provides an error code (Refer #TapiResult_t) - * - * @par Prospective Clients: - * External Apps. - * - * @see None - * - * @code - * - * @endcode - * - * @remarks None - * - */ -/*================================================================================================*/ -int tel_req_sap_power_operation(TapiHandle *handle, TelSimSapPowerMode_t power_mode, tapi_response_cb callback, void *user_data); - -/** - * @brief This API is used to request to get card_reader_status. - * - * @par Sync (or) Async: - * This is an Asynchronous API. - * - * @par Important Notes: - * - None - * - * @warning - * - None. - * - * @param [in] handle - * - handle from tel_init(). - * - * @param [in] callback - * - To register callback function for result. - * - * @param [in] user_data - * - user_data for user specification. - * - * @par - * - * @pre - * - * @post - * - * @return Return Type (int) \n - * - Integer '0' ( same with TAPI_API_SUCCESS ) - indicating that the operation has completed successfully. \n - * - Negative integer : it provides an error code (Refer #TapiResult_t) - * - * @par Prospective Clients: - * External Apps. - * - * @see None - * - * @code - * - * @endcode - * - * @remarks None - * - */ -/*================================================================================================*/ -int tel_req_sap_cardreader_status(TapiHandle *handle, tapi_response_cb callback, void *user_data); - -#ifdef __cplusplus -} -#endif - -#endif /* _ITAPI_SAP_H_ */ - -/** -* @} -*/ diff --git a/mobile/include/ITapiSat.h b/mobile/include/ITapiSat.h deleted file mode 100644 index 2c03a30..0000000 --- a/mobile/include/ITapiSat.h +++ /dev/null @@ -1,411 +0,0 @@ -/* - * libslp-tapi - * - * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. - * - * Contact: Ja-young Gu - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT 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 ITapiSat.h - - @brief This file serves as a "C" header file defines functions for Tapi Sat Services.\n - It contains a sample set of function prototypes that would be required by applications. - - Note: Telephony SAT functionality is message relaying from USIM application to SAT related applications. - */ - -#ifndef _ITAPI_SAT_H_ -#define _ITAPI_SAT_H_ - -#include -#include -#include - -#ifdef __cplusplus -extern "C" -{ -#endif - - /** - * @brief Sends the user choice of the main menu options to the USIM. - * - * @par Notes: - * A set of possible menu options is supplied by the USIM - * using the proactive command SET UP MENU. Telephony server receives the command - * and publishes this information.SAT UI application should list the menu when it initially launched. - * If the user subsequently chooses an option, then SAT UI application replies - * the command with user's choice using this API. - * - * This API makes Dbus method call to Telephony Sever and gets immediate feedback. - * However it just means that the API request has been transfered to the CP successfully. - * The actual operation result is delivered with the async response as below. - * - * @par Warning: - * Do not use this function. This function is dedicated to the SAT UI embedded application only. - * - * @par Sync (or) Async: - * This is an Asynchronous API. - * - * @param [in] handle - * - handle from tel_init(). - * - * @param [in] pMenuSelect - * - #TelSatMenuSelectionReqInfo_t contains information like which SAT menu item has been selected or whether Help is required. - * - * @param [in] callback - * - To register callback function for result. - * - * @param [in] user_data - * - user_data for user specification. - * - * @par Async Response Message: - * - The event associated is TAPI_EVENT_SAT_MENU_SELECTION_CNF and the Asynchronous return status is indicated by #TelSatEnvelopeResp_t. - * - * @pre - * - This function supposed to be called after getting TAPI_EVENT_SAT_SETUP_MENU_IND event from telephony server\n - * - * @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: - * SAT-UI - * - * @see tel_get_sat_main_menu_info - * - * @code - * #include - * int ret_status =0; - * int pRequestID=0; - * TelSatMenuSelectionReqInfo_t selected_menu; - * selected_menu.itemIdentifier = '1'; //selected menu num - * selected_menu.bIsHelpRequested = 0; - * ret_status = tel_select_sat_menu(&selected_menu, &pRequestId); - * @endcode - * - * @remarks None - * - * - */ -/*================================================================================================*/ -int tel_select_sat_menu(TapiHandle *handle, const TelSatMenuSelectionReqInfo_t* pMenuSelect, tapi_response_cb callback, void *user_data); - - /** - * @brief Download SAT events to USIM - * - * @par Notes: - * A set of events for the terminal to monitor can be supplied by the USIM using the proactive command SET UP EVENT - * LIST. If the USIM has sent this command, and an event which is part of the list subsequently occurs, the terminal - * informs the USIM using this function, relevant for that event. - * If USIM commands to monitor a browser termination event, the SAT-UI application has to call this function. - * - * This API makes Dbus method call to Telephony Sever and gets immediate feedback. - * However it just means that the API request has been transfered to the CP successfully. - * The actual operation result is delivered with the async response as below. - * - * @par Warning: - * Do not use this function. This function is dedicated to the SAT UI embedded application only. - * - * @par Sync (or) Async: - * This is an Asynchronous API. - * - * @param [in] handle - * - handle from tel_init(). - * - * @param [in] pEventData - * - #TelSatEventDownloadReqInfo_t contains the necessary parameters like event type and information associated with it. - * - * @param [in] callback - * - To register callback function for result. - * - * @param [in] user_data - * - user_data for user specification. - * - * @par Async Response Message: - * - The event associated is TAPI_EVENT_SAT_EVENT_DOWNLOAD_CNF and the Asynchronous return status is indicated by #TelSatEnvelopeResp_t. - * - * @pre - * - A SET UP EVENT LIST proactive command supplies a set of event to monitor. - * - * @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: - * SAT-UI - * - * @see None - * - * @code - * #include - * int ret_status =0; - * int pRequestID=0; - * TelSatEventDownloadReqInfo_t pEventData; - * pEventData.eventDownloadType = TAPI_EVENT_SAT_DW_TYPE_IDLE_SCREEN_AVAILABLE; - * pEventData.u.bIdleScreenAvailable = 1; //event occur or not - * ret_status = tel_download_sat_event(&pEventData, &pRequestId); - * @endcode - * - * @remarks None - * - * - */ -/*================================================================================================*/ -int tel_download_sat_event(TapiHandle *handle, const TelSatEventDownloadReqInfo_t* pEventData, tapi_response_cb callback, void *user_data); - - /** - * @brief Send the UI display status of the alpha identifier of a specific proactive command to Telephony Server. - * - * When SAT-UI receives a proactive command, SAT-UI should draw a UI for relevant command. - * As it completes , SAT-UI inform USIM with this function. Afterwards, USIM is getting ready to send another commands. - * - * This function makes Dbus method call to Telephony Sever and gets immediate feedback. - * - * @par Warning: - * Do not use this function. This function is dedicated to the SAT UI embedded application only. - * - * @par Sync (or) Async: - * This is a Synchronous API. - * - * @param [in] handle - * - handle from tel_init(). - * - * @param [in] commandId - * - Specific proactive command id from the Application - * - * @param [in] status - * - #TelSatUiDisplayStatusType_t contain display status(SUCCESS/FAIL). - * - * @par Async Response Message: - * - None. - * - * @pre - * - Display request for the alpha identifier of a Proactive Command should be sent by Telephony Server. - * - * @post - * - If the display status is SUCCESS Telephony Server sends a request to application for Proactive Command Execution. - * - If the display status is FAIL Telephony Server sends Terminal Response for the Proactive Command. - * - * @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: - * SAT-UI - * - * @see None - * - * @code - * #include - * int commandId = 1; //this value should be server given value - * ret_status = 0; - * ret_status = tel_send_ui_display_status(1, TAPI_SAT_DISPLAY_SUCCESS); - * @endcode - * - * @remarks None - * - * - */ -/*================================================================================================*/ -int tel_send_sat_ui_display_status(TapiHandle *handle, int commandId, TelSatUiDisplayStatusType_t status); - - /** - * @brief This function sends the UI User confirmation data for a specific Proactive Command to the Telephony Server. - * - * In case that the proactive commands need user response, SAT-UI can send it using this function. - * The response can be 'OK', 'Cancel', 'Move Back' and 'End Session'. Upon this response, USIM can send - * a proactive command subsequently to indicate next UI action. - * - * This function makes Dbus method call to Telephony Sever and gets immediate feedback. - * - * @par Warning: - * Do not use this function. This function is dedicated to the SAT UI embedded application only. - * - * @par Sync (or) Async: - * This is a synchronous API. - * - * @param [in] handle - * - handle from tel_init(). - * - *@param [in] pUserConfirmData - * -#TelSatUiUserConfirmInfo_t contains Specific user confirmation data. - * - * @par Async Response Message: - * - None - * - * @pre - * - User Confirmation request for a specific Proactive Command should be sent to application by Telephony Server. - * - * @post - * - If the User Confirmation is positive Telephony Server sends a request to application for Proactive Command Execution. - * - If the User Confirmation is negative Telephony Server sends Terminal Response for the Proactive Command. - * - * @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: - * SAT-UI - * - * @see None - * - * @code - * #include - * int ret_status =0; - * TelSatUiUserConfirmInfo_t cfm_data; - * cfm_data.commandId = '1'; //this value should be server given value - * cfm_data.commandType = TAPI_SAT_CMD_TYPE_SETUP_CALL; - * cfm_data.keyType = TAPI_SAT_USER_CONFIRM_YES; - * ret_status = tel_send_sat_ui_user_confirm(&cfm_data); - * @endcode - * - * @remarks None - * - * - */ -/*================================================================================================*/ -int tel_send_sat_ui_user_confirm(TapiHandle *handle, TelSatUiUserConfirmInfo_t *pUserConfirmData); - - /** - * @brief This function provides SAT(Sim Application toolkit) Main Menu information for SAT-UI. - * - * Once the USIM supplies the SET UP MENU proactivae command, telephony server not only publish - * TAPI_EVENT_SAT_SETUP_MENU_IND event but also caches the menu information. - * The SAT-UI applicatoin can get the menu list using this function. - * - * This function makes Dbus method call to Telephony Sever and gets immediate feedback. - * - * @par Warning: - * Do not use this function. This function is dedicated to the SAT UI embedded application only. - * - * @par Sync (or) Async: - * This is a Synchronous API. - * - * @param [in] handle - * - handle from tel_init(). - * - * @param [out] pMainMenu - * - #TelSatSetupMenuInfo_t contain all menu related information which are required like menu title, icon, item count, etc. - * - * @par Async Response Message: - * - None - * - * @pre - * - When SAT SIM is inserted. we can get meaningful data. without SAT SIM, Null is returned - * - * @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: - * SAT-UI - * - * @see tel_select_sat_menu - * - * @code - * #include - * int ret_status =0; - * TelSatSetupMenuInfo_t menu; //this struct will be pull up with SIM menu info - * ret_status = tel_get_sat_main_menu_info(&menu); - * @endcode - * - * @remarks None - * - * - */ -/*================================================================================================*/ -int tel_get_sat_main_menu_info(TapiHandle *handle, TelSatSetupMenuInfo_t *pMainMenu); - - /** - * @brief This API provides the Operation result(s) for the Proactive Command execution by the Application(s) to the Telephony Server. - * - * The USIM commands the terminal to do some predefined action, such as sending short message, - * making a voice call, launching an Internet browser and so on. Those actions are defined by 3GPP TS31.111. - * Once a application executes the requested action by USIM, it reports the operation result to USIM using this function. - * - * This function makes Dbus method call to Telephony Sever and gets immediate feedback. - * - * @par Warning: - * Do not use this function. This function is dedicated to the SAT UI embedded application only. - ** - * @par Sync (or) Async: - * This is a Synchronous API. - * - * @param [in] handle - * - handle from tel_init(). - * - * @param [out] pAppRetInfo - * - #TelSatAppsRetInfo_t contains execution result of a specific proactive command by application. - * - * @par Async Response Message: - * - None - * - * @pre - * - Proactive Command execution request should be sent by Telephony Server to SAT related applications. - * - * @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: - * Embeded applications which are predefined by 3GPP TS31.111 - * - * @see None - * - * @code - * #include - * int ret_status =0; - * TelSatAppsRetInfo_t app_ret; - * app_ret.commandType = TAPI_SAT_CMD_TYPE_SETUP_CALL; - * app_ret.commandId = 1; //this value should be server given value - * app_ret.appsRet.setupCall.resp = TAPI_SAT_R_SUCCESS; - * ret_status = tel_send_sat_app_exec_result(&app_ret); - * @endcode - * - * @remarks None - * - * - */ -/*================================================================================================*/ -int tel_send_sat_app_exec_result(TapiHandle *handle, TelSatAppsRetInfo_t *pAppRetInfo); - - -#ifdef __cplusplus -} -#endif - -#endif /* _ITAPI_SAT_H_ */ - -/** - * @} - */ diff --git a/mobile/include/ITapiSim.h b/mobile/include/ITapiSim.h deleted file mode 100644 index 95cb200..0000000 --- a/mobile/include/ITapiSim.h +++ /dev/null @@ -1,1611 +0,0 @@ -/* - * libslp-tapi - * - * Copyright (c) 2012 Samsung Electronics Co., Ltd. All rights reserved. - * - * Contact: Ja-young Gu - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT 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 ITapiSim.h - - @brief This file serves as a "C" header file defines functions for Tapi SIM Services.\n - It contains a sample set of function prototypes that would be required by applications. - -*/ - -#ifndef _ITAPI_SIM_H_ -#define _ITAPI_SIM_H_ - -#include -#include -#include -#include - -#ifdef __cplusplus -extern "C" -{ -#endif - -/** -* @brief This API is used to get SIM Card Initialization status and SIM Card Identification. -* Most of modules which require SIM data should check SIM status before using it definitely. - * -* @par Sync (or) Async: -* This is a Synchronous API. -* -* @par Important Notes: -* - Card Identification value is available in TAPI_SIM_STATUS_SIM_INIT_COMPLETED case only. -* -* @warning -* - None. -* - * @param [in] handle - * - handle from tel_init(). - * -* @param [out] sim_status -* - This parameter returns SIM initialization status from Telephony server boot up time. -* First, You can find sim existance if returned value are not in TAPI_SIM_STATUS_CARD_NOT_PRESENT and TAPI_SIM_STATUS_CARD_REMOVED. -* -* @param [out] card_changed -* - This parameter returns sim card identification value when sim_status is TAPI_SIM_STATUS_SIM_INIT_COMPLETED. -* - card_changed value just present whether current inserted SIM card differs with previous SIM or not. -* -* @par Async Response Message: -* - None -* -* @pre -* - None. -* -* @post -* - None. -* -* @return Return Type (int) -* - Integer '0' ( same with TAPI_API_SUCCESS ) - indicating that the operation has completed successfully. \n -* - Negative integer : it provides an error code (Refer #TapiResult_t) -* -* @par Prospective Clients: -* External Apps. -* -* @see None -* -* @code -* #include -* -* int err_code = TAPI_API_SUCCESS; -* TelSimCardStatus_t status = 0x00; -* int b_card_changed = 0; -* -* // GET SIM INIT INFORMATION -* err_code = tel_get_sim_init_info(&status, &b_card_changed); -* -* @endcode -* -* @remarks None -* -*/ -/*================================================================================================*/ -int tel_get_sim_init_info(TapiHandle *handle, TelSimCardStatus_t *sim_status, int *card_changed); - -/** - * @brief This function is a synchronous API which gets the Card Type whether Card is a SIM or a USIM. - * - * @par Sync (or) Async: - * This is a synchronous function. - * - * @par Important Notes: - * - None - * - * @warning - * - None. - * - * @param [in] handle - * - handle from tel_init(). - * - * @param [out] card_type - * 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 - * - None. - * - * @post - * - None. - * - * @return Return Type (int) \n - * - Integer '0' ( same with TAPI_API_SUCCESS ) - indicating that the operation has completed successfully. \n - * - Negative integer : it provides an error code (Refer #TapiResult_t) - * - * @par Prospective Clients: - * External Apps. - * - * @see None - * - * @code - * #include - * int err_code = 0; - * TelSimCardType_t cardInfo; //unkwon, sim(normally gsm), usim(normally umts) - * err_code = tel_get_sim_type(&cardInfo); - * - * @endcode - * - * @remarks None - * - */ -/*================================================================================================*/ -int tel_get_sim_type(TapiHandle *handle, TelSimCardType_t *card_type); - -/** - * @brief This function is a synchronous API gets the IMSI information. - * - * @par Sync (or) Async: - * This is a synchronous function. - * - * @par Important Notes: - * - IMSI value is the value that security needs. - * - * @warning - * - None. - * - * @param [in] handle - * - handle from tel_init(). - * - * @param [out] imsi - * This parameter returns the IMSI information. Refer #TelSimImsiInfo_t - * - * @par Async Response Message: - * - None - * - * @pre - * - User can get valid return value or make operations after SIM init complete(card status is TAPI_SIM_STATUS_SIM_INIT_COMPLETED). - * - None. - * - * @post - * - None. - * - * @return Return Type (int) \n - * - Integer '0' ( same with TAPI_API_SUCCESS ) - indicating that the operation has completed successfully. \n - * - Negative integer : it provides an error code (Refer #TapiResult_t) - * - * @par Prospective Clients: - * External Apps. - * - * @see None - * - * @code - * #include - * int err_code = 0; - * TelSimImsiInfo_t sim_imsi_info; // mcc, mnc, msisdn - * err_code = tel_get_sim_imsi(&sim_imsi_info); - * @endcode - * - * @remarks None - * - */ -/*================================================================================================*/ -int tel_get_sim_imsi(TapiHandle *handle, TelSimImsiInfo_t *imsi); - -/** - * @brief This function is a synchronous API used to get ECC(SIM) or UECC(USIM) data. - * - * @par Sync (or) Async: - * This is a synchronous function. - * - * @par Important Notes: - * - None - * - * @warning - * - None. - * - * @param [in] handle - * - handle from tel_init(). - * - * @param [out] ecc - * - This parameter returns - * the SIM emergency call code information like ecc length, service type etc - * and number of ECC records. - * - * @par Async Response Message: - * - None - * - * @pre - * - User can get valid return value or make operations after SIM init complete(card status is TAPI_SIM_STATUS_SIM_INIT_COMPLETED). - * - None. - * - * @post - * - None. - * - * @return Return Type (int) \n - * - Integer '0' ( same with TAPI_API_SUCCESS ) - indicating that the operation has completed successfully. \n - * - Negative integer : it provides an error code (Refer #TapiResult_t) - * - * @par Prospective Clients: - * External Apps. - * - * @see None - * - * @code - * #include - * int ecc_rec_count = 0; // count in sim card - * int err_code = 0; - * TelSimEccData_t ecc_info = {{{0,}}}; - * err_code = tel_get_sim_ecc(&ecc_info, &ecc_rec_count); - * @endcode - * - * @remarks None - * - */ -/*================================================================================================*/ -int tel_get_sim_ecc(TapiHandle *handle, TelSimEccList_t *ecc); - -/** - * @brief This function is a synchronous API gets a Unique identification number of the (U)ICC. - * ICC means Integrated Circuit Card. - * - * @par Sync (or) Async: - * This is a synchronous function. - * - * @par Important Notes: - * - IC Card number value is the value that security needs. - * - * @warning - * - None. - * - * @param [in] handle - * - handle from tel_init(). - * - * @param [in] callback - * - To register callback function for result. - * - * @param [in] user_data - * - user_data for user specification. - * - * @par Async Response Message: - * - None - * - * @pre - * - User can get valid return value or make operations after SIM init complete(card status is TAPI_SIM_STATUS_SIM_INIT_COMPLETED). - * - None. - * - * @post - * - None. - * - * @return Return Type (int) \n - * - Integer '0' ( same with TAPI_API_SUCCESS ) - indicating that the operation has completed successfully. \n - * - Negative integer : it provides an error code (Refer #TapiResult_t) - * - * @par Prospective Clients: - * External Apps. - * - * @see None - * - * @code - * #include - * int err_code = 0; - * TelSimIccIdInfo_t icc_data; // this struct consists of number length and number. - * err_code = tel_get_sim_iccid(&icc_data); - * @endcode - * - * @remarks None - * - */ -/*================================================================================================*/ -int tel_get_sim_iccid(TapiHandle *handle, tapi_response_cb callback, void *user_data); - -/** - * @brief This API is used to get the language preference(indication) information. - * - * @par Sync (or) Async: - * This is a synchronous function. - * - * @par Important Notes: - * - None - * - * @warning - * - None. - * - * @param [in] handle - * - handle from tel_init(). - * - * @param [in] callback - * - To register callback function for result. - * - * @param [in] user_data - * - user_data for user specification. - * - * @par Async Response Message: - * - None - * - * @pre - * - User can get valid return value or make operations after SIM init complete(card status is TAPI_SIM_STATUS_SIM_INIT_COMPLETED). - * - None. - * - * @post - * - None. - * - * @return Return Type (int) \n - * - Integer '0' ( same with TAPI_API_SUCCESS ) - indicating that the operation has completed successfully. \n - * - Negative integer : it provides an error code (Refer #TapiResult_t) - * - * @par Prospective Clients: - * External Apps. - * - * @see None - * - * @code - * #include - * int err_code = 0; - * TelSimLanguageInfo_t li_info = {0,}; - * err_code = tel_get_sim_language(&li_info); // you can find language info with li_info variable - * @endcode - * - * @remarks None - * - */ -/*================================================================================================*/ -int tel_get_sim_language(TapiHandle *handle, tapi_response_cb callback, void *user_data); - - -/** - * @brief This API is used to update the language preference information to SIM card. - * - * This function makes Dbus method call to Telephony Sever and returns immediate value. - * However it just means that the API request has been transfered to the CP successfully. - * The actual operation result is being delivered in the corresponding event asynchronously. - * - * @par Sync (or) Async: - * This is a Asynchronous function. - * - * @par Important Notes: - * - This function update SIM Language information directly and can effect device language setting. Use carefully. - * - * @warning - * - None. - * - * @param [in] handle - * - handle from tel_init(). - * - * @param [in] language - * This parameter returns the language preference information. - * - * @param [in] callback - * - To register callback function for result. - * - * @param [in] user_data - * - user_data for user specification. - * - * @par Async Response Message: - * The event associated is TAPI_EVENT_SIM_SET_LANGUAGE_CNF. - * Asynchronous return status is indicated by #TelSimAccessResult_t. - * - * @pre - * - A dbus connection is established with #tel_init - * - The application name is registered with #tel_register_app_name - * - The application is registered events to listen asynchronous response with #tel_register_event - * - A event loop is running to listen events - * - User can get valid return value or make operations after SIM init complete(card status is TAPI_SIM_STATUS_SIM_INIT_COMPLETED). - * - None. - * - * @post - * - None. - * - * @return Return Type (int) \n - * - Integer '0' ( same with TAPI_API_SUCCESS ) - indicating that the operation has completed successfully. \n - * - Negative integer : it provides an error code (Refer #TapiResult_t) - * - * @par Prospective Clients: - * External Apps. - * - * @see None - * - * @code - * #include - * int err_code = 0; - * int request_id = 0; - * TelSimLanguagePreferenceCode_t language = 0x00; //init - * language = TAPI_SIM_LP_ENGLISH; //language value - * err_code = tel_set_sim_language(language, &request_id); - * @endcode - * - * @remarks None - * - */ -/*================================================================================================*/ -int tel_set_sim_language(TapiHandle *handle, TelSimLanguagePreferenceCode_t language, tapi_response_cb callback, void *user_data); - -/** - * @brief This API is used to get the SIM Call forwarding indication related data(EF-CFIS and CPHS case). - * this data is required for Call forwarding related functionality in handset. - * - * @par Sync (or) Async: - * This is a synchronous function. - * - * @par Important Notes: - * - None - * - * @warning - * - None - * - * @param [in] handle - * - handle from tel_init(). - * - * @param [in] callback - * - To register callback function for result. - * - * @param [in] user_data - * - user_data for user specification. - * - * @par Async Response Message: - * - None - * - * @pre - * - User can get valid return value or make operations after SIM init complete(card status is TAPI_SIM_STATUS_SIM_INIT_COMPLETED). - * - None - * - * @post - * - None - * - * @return Return Type (int) \n - * - Integer '0' ( same with TAPI_API_SUCCESS ) - indicating that the operation has completed successfully. \n - * - Negative integer : it provides an error code (Refer #TapiResult_t) - * - * @par Prospective Clients: - * External Apps - * - * @see None - * - * @code - * #include - * TelSimCallForwarding_s cf_data; - * TapiResult_t err_code = 0; - * err_code = tel_get_sim_callforwarding_info(&cf_data); - * if(err_code == TAPI_API_SUCCESS) { - * if(cf_data.b_cphs) { //b_cphs means current SIM is for CPHS or not. - * printf("Current SIM is CPHS"); - * } else { - * printf("Current SIM is not CPHS but 3GPP"); - * } - * } else { - * printf("TAPI API FAIL: Error Code [0x%x]",err_code); - * } - * @endcode - * - * @remarks None - * - */ -/*================================================================================================*/ -int tel_get_sim_callforwarding_info(TapiHandle *handle, tapi_response_cb callback, void *user_data); - -int tel_set_sim_callforwarding_info(TapiHandle *handle, TelSimCallForwardingReq_t *req_cf, tapi_response_cb callback, void *user_data); - -/** - * @brief This API is used to get the SIM message waiting indication related data(EF-MWIS and CPHS case). - * this data is required for Message waiting related functionality in handset. - * - * @par Sync (or) Async: - * This is a synchronous function. - * - * @par Important Notes: - * - None - * - * @warning - * - None - * - * @param [in] handle - * - handle from tel_init(). - * - * @param [in] callback - * - To register callback function for result. - * - * @param [in] user_data - * - user_data for user specification. - * - * @par Async Response Message: - * - None - * - * @pre - * - User can get valid return value or make operations after SIM init complete(card status is TAPI_SIM_STATUS_SIM_INIT_COMPLETED). - * - None - * - * @post - * - None - * - * @return Return Type (int) \n - * - Integer '0' ( same with TAPI_API_SUCCESS ) - indicating that the operation has completed successfully. \n - * - Negative integer : it provides an error code (Refer #TapiResult_t) - * - * @par Prospective Clients: - * External Apps - * - * @see None - * - * @code - * #include - * TelSimMessageWaiting_s mw_data; - * TapiResult_t err_code = 0; - * err_code = tel_get_sim_messagewaiting_info(&mw_data); - * if(err_code == TAPI_API_SUCCESS) { - * if(mw_data.b_cphs) { //b_cphs means current SIM is for CPHS or not. - * printf("Current SIM is CPHS"); - * } else { - * printf("Current SIM is not CPHS but 3GPP"); - * } - * } else { - * printf("TAPI API FAIL: Error Code [0x%x]",err_code); - * } - * @endcode - * - * @remarks None - * - */ -/*================================================================================================*/ -int tel_get_sim_messagewaiting_info(TapiHandle *handle, tapi_response_cb callback, void *user_data); - -int tel_set_sim_messagewaiting_info(TapiHandle *handle, TelSimMessageWaitingReq_t *req_mw, tapi_response_cb callback, void *user_data); - -/** - * @brief This API is used to get the SIM mailbox related data(EF-MBDN, MBDI and CPHS case). - * this data is required for Mailbox related functionality in handset. - * - * @par Sync (or) Async: - * This is a synchronous function. - * - * @par Important Notes: - * - None - * - * @warning - * - None. - * - * @param [in] handle - * - handle from tel_init(). - * - * @param [in] callback - * - To register callback function for result. - * - * @param [in] user_data - * - user_data for user specification. - * - * @par Async Response Message: - * - None - * - * @pre - * - User can get valid return value or make operations after SIM init complete(card status is TAPI_SIM_STATUS_SIM_INIT_COMPLETED). - * - None. - * - * @post - * - None. - * - * @return Return Type (int) \n - * - Integer '0' ( same with TAPI_API_SUCCESS ) - indicating that the operation has completed successfully. \n - * - Negative integer : it provides an error code (Refer #TapiResult_t) - * - * @par Prospective Clients: - * External Apps. - * - * @see None - * - * @code - * #include - * TelSimMailboxNumbers_s mbox; - * TapiResult_t err_code = 0; - * err_code = tel_get_sim_mailbox_info(&mbox); - * if(err_code == TAPI_API_SUCCESS) { - * if(mbox.b_cphs) { //b_cphs means current SIM is for CPHS or not. - * printf("Current SIM is CPHS"); - * } else { - * printf("Current SIM is not CPHS but 3GPP"); - * } - * } else { - * printf("TAPI API FAIL: Error Code [0x%x]",err_code); - * } - * @endcode - * - * @remarks None - * - */ -/*================================================================================================*/ -int tel_get_sim_mailbox_info(TapiHandle *handle, tapi_response_cb callback, void *user_data); - -int tel_set_sim_mailbox_info(TapiHandle *handle, TelSimMailBoxNumber_t *req_mb, tapi_response_cb callback, void *user_data); - -/** - * @brief This API is used to get the SIM CPHS specific data. - * this data is required for CPHS related functionality in handset. - * - * @par Sync (or) Async: - * This is an Synchronous API. - * - * @par Important Notes: - * - None - * - * @warning - * - None - * - * @param [in] handle - * - handle from tel_init(). - * - * @param [in] callback - * - To register callback function for result. - * - * @param [in] user_data - * - user_data for user specification. - * - * @par Async Response Message: - * - None - * - * @pre - * - User can get valid return value or make operations after SIM init complete(card status is TAPI_SIM_STATUS_SIM_INIT_COMPLETED). - * - * @post - * - None - * - * @return Return Type (int) \n - * - Integer '0' ( same with TAPI_API_SUCCESS ) - indicating that the operation has completed successfully. \n - * - Negative integer : it provides an error code (Refer #TapiResult_t) - * - * @par Prospective Clients: - * External Apps - * - * @see None - * - * @code - * #include - * TelSimCphsLocalInfo_t cphs_data; - * TapiResult_t err_code = 0; - * err_code = tel_get_sim_cphs_info(&cphs_data); - * if(err_code == TAPI_API_SUCCESS) { - * if(cphs_data.b_used) { //b_used means current SIM is for CPHS or not. - * printf("Current SIM is CPHS"); - * } else { - * printf("Current SIM is not CPHS but 3GPP"); - * } - * } else { - * printf("TAPI API FAIL: Error Code [0x%x]",err_code); - * } - * @endcode - * - * @remarks None - * - */ -/*================================================================================================*/ -int tel_get_sim_cphs_info(TapiHandle *handle, tapi_response_cb callback, void *user_data); - -/** - * @brief This API is used to get the SIM MSISDN data. Regarding 3GPP specification, Current value is optional. - * - * @par Sync (or) Async: - * This is an Synchronous API. - * - * @par Important Notes: - * - None - * - * @warning - * - None - * - * @param [in] handle - * - handle from tel_init(). - * - * @param [in] callback - * - To register callback function for result. - * - * @param [in] user_data - * - user_data for user specification. - * - * @par Async Response Message: - * - None - * - * @pre - * - User can get valid return value or make operations after SIM init complete(card status is TAPI_SIM_STATUS_SIM_INIT_COMPLETED). - * - * @post - * - None - * - * @return Return Type (int) \n - * - Integer '0' ( same with TAPI_API_SUCCESS ) - indicating that the operation has completed successfully. \n - * - Negative integer : it provides an error code (Refer #TapiResult_t) - * - * @par Prospective Clients: - * External Apps - * - * @see None - * - * @code - * #include - * TelSimSubscriberInfo_t msisdn; - * TapiResult_t err_code = 0; - * err_code = tel_get_sim_msisdn(&msisdn); - * if(err_code == TAPI_API_SUCCESS) - * { - * printf(" ============================================"); - * printf("name[%s]",msisdn.name); - * printf("num[%s]",msisdn.num); - * if(msisdn.name == '\0';) //If current SIM does not have, Null string will be returned. - * printf("name is null string"); - * - * if(msisdn.num == '\0';) //If current SIM does not have, Null string will be returned. - * printf("number is null string"); - * } - * else - * { - * printf("TAPI API FAIL: Error Code [0x%x]",err_code); - * } - * - * @endcode - * - * @remarks None - * - */ -/*================================================================================================*/ -int tel_get_sim_msisdn(TapiHandle *handle, tapi_response_cb callback, void *user_data); - -/** - * @brief This API is used to get the SIM OPLMNWACT(Operator controlled PLMN Selector with Access Technology) data. Regarding 3GPP specification, Current value is optional. - * - * @par Sync (or) Async: - * This is an Synchronous API. - * - * @par Important Notes: - * - None - * - * @warning - * - None - * - * @param [in] handle - * - handle from tel_init(). - * - * @param [in] callback - * - To register callback function for result. - * - * @param [in] user_data - * - user_data for user specification. - * - * @par Async Response Message: - * - None - * - * @pre - * - User can get valid return value or make operations after SIM init complete(card status is TAPI_SIM_STATUS_SIM_INIT_COMPLETED). - * - * @post - * - None - * - * @return Return Type (int) \n - * - Integer '0' ( same with TAPI_API_SUCCESS ) - indicating that the operation has completed successfully. \n - * - Negative integer : it provides an error code (Refer #TapiResult_t) - * - * @par Prospective Clients: - * External Apps - * - * @see None - * - * @code - * - * @endcode - * - * @remarks None - * - */ -/*================================================================================================*/ -int tel_get_sim_oplmnwact(TapiHandle *handle, tapi_response_cb callback, void *user_data); - -/** - * @brief This API is used to get the SIM SPN data. Regarding 3GPP specification, Current value is optional. - * - * @par Sync (or) Async: - * This is an Synchronous API. - * - * @par Important Notes: - * - None - * - * @warning - * - None - * - * @param [in] handle - * - handle from tel_init(). - * - * @param [in] callback - * - To register callback function for result. - * - * @param [in] user_data - * - user_data for user specification. - * - * @par Async Response Message: - * - None - * - * @pre - * - User can get valid return value or make operations after SIM init complete(card status is TAPI_SIM_STATUS_SIM_INIT_COMPLETED). - * - * @post - * - None - * - * @return Return Type (int) \n - * - Integer '0' ( same with TAPI_API_SUCCESS ) - indicating that the operation has completed successfully. \n - * - Negative integer : it provides an error code (Refer #TapiResult_t) - * - * @par Prospective Clients: - * External Apps - * - * @see None - * - * @code - * - * @endcode - * - * @remarks None - * - */ -/*================================================================================================*/ -int tel_get_sim_spn(TapiHandle *handle, tapi_response_cb callback, void *user_data); - -/** - * @brief This API is used to get the SIM CPHS NETNAME data. - * - * @par Sync (or) Async: - * This is an Synchronous API. - * - * @par Important Notes: - * - None - * - * @warning - * - None - * - * @param [in] handle - * - handle from tel_init(). - * - * @param [in] callback - * - To register callback function for result. - * - * @param [in] user_data - * - user_data for user specification. - * - * @par Async Response Message: - * - None - * - * @pre - * - User can get valid return value or make operations after SIM init complete(card status is TAPI_SIM_STATUS_SIM_INIT_COMPLETED). - * - * @post - * - None - * - * @return Return Type (int) \n - * - Integer '0' ( same with TAPI_API_SUCCESS ) - indicating that the operation has completed successfully. \n - * - Negative integer : it provides an error code (Refer #TapiResult_t) - * - * @par Prospective Clients: - * External Apps - * - * @see None - * - * @code - * - * @endcode - * - * @remarks None - * - */ -/*================================================================================================*/ -int tel_get_sim_cphs_netname(TapiHandle *handle, tapi_response_cb callback, void *user_data); - -/** - * @brief This API is used to execute the authentication procedure by using SIM. - * - * This function makes Dbus method call to Telephony Sever and returns immediate value. - * However it just means that the API request has been transfered to the CP successfully. - * The actual operation result is being delivered in the corresponding event asynchronously. - * This function supports IMS, 3G and GSM authentication. - * - * @par Sync (or) Async: - * This is an Asynchronous API. - * - * @par Important Notes: - * -NONE - * - * @warning - * - None. - * - * @param [in] handle - * - handle from tel_init(). - * - * @param[in] authentication_data - * - This input has the authentication code to be validated by ISIM,3G and GSM application in the SIM card. #TelSimAuthenticationData_t - * - * @param [in] callback - * - To register callback function for result. - * - * @param [in] user_data - * - user_data for user specification. - * - * @par Async Response Message: - * -The event associated is TAPI_SIM_EVENT_AUTHENTICATION_CNF and the event data is #TelSimAuthenticationResponse_t. - * Asynchronous return status is indicated by #TelSimAccessResult_t. - * - * @pre - * - A dbus connection is established with #tel_init - * - The application name is registered with #tel_register_app_name - * - The application is registered events to listen asynchronous response with #tel_register_event - * - A event loop is running to listen events - * - * @post - * - None. - * - * @return Return Type (int) \n - * - Integer '0' ( same with TAPI_API_SUCCESS ) - indicating that the operation has completed successfully. \n - * - Negative integer : it provides an error code (Refer #TapiResult_t) - * - * @par Prospective Clients: - * External Apps. - * - * @see None - * - * @code - * #include - * int err_code = 0; - * int request_id = 0; - * TelSimAuthenticationData_t pAuthenticationData; - * strcpy((char*)pAuthenticationData.rand_data, "username@operator.com"); //access data - * pAuthenticationData.rand_length= strlen("username@operator.com"); - * strcpy((char*)pAuthenticationData.autn_data, "+1-212-555-12345"); // auth data - * pAuthenticationData.autn_length = strlen("+1-212-555-12345"); - * err_code = tel_req_sim_authentication(&pAuthenticationData,&request_id); - * @endcode - * - * @remarks None - * - */ -/*================================================================================================*/ -int tel_req_sim_authentication(TapiHandle *handle, TelSimAuthenticationData_t *authentication_data, tapi_response_cb callback, void *user_data); - - - -/** - * @brief This function performs PIN1/PIN2/SIM LOCK verification. This function performs PIN verification based on the pin type passed along with pin data. - * PIN1 code : The SIM card has its own password is to check access permissions - * SIM Lock code : Between Device and the SIM card using a SIM password is only available on certain handsets to be used to authorize. - * - * This function makes Dbus method call to Telephony Sever and returns immediate value. - * However it just means that the API request has been transfered to the CP successfully. - * The actual operation result is being delivered in the corresponding event asynchronously. - * - * @par Sync (or) Async: - * This is an Asynchronous API. - * - * @par Important Notes: - * - Based on Pin status (PIN/PUK/SIM LOCK) is blocked, an unsolicited event TAPI_EVENT_SIM_STATUS_IND is published to Applications on Device boot time. - * - if pin status is PUK, you should use #tel_verify_sim_puks instead of this API. - * - * @warning - * - None. - * - * @param [in] handle - * - handle from tel_init(). - * - * @param[in] pin_data - * -PIN code, entered by the user. you should make all parameters. - * - * @param [in] callback - * - To register callback function for result. - * - * @param [in] user_data - * - user_data for user specification. - * - * @par Async Response Message: - * The event associated is TAPI_EVENT_SIM_VERIFY_SEC_CNF and the event data is #TelSimSecResult_t. - * Asynchronous return status is indicated by #TelSimPinOperationResult_t. - * If returned status is TAPI_SIM_PIN_OPERATION_SUCCESS, Verification successes. - * If returned status is TAPI_SIM_PIN_INCORRECT_PASSWORD, Verification fails and you can check retry count by using event data #TelSimSecResult_t. - * - * @pre - * - Initialize Dbus connection with #tel_init - * - Register caller's application name with #tel_register_app_name - * - Register telephony events to listen - * - A event loop is running to listen events - * - This API is used when #TelSimCardStatus_t is TAPI_SIM_STATUS_SIM_PIN_REQUIRED or TAPI_SIM_STATUS_SIM_LOCK_REQUIRED on boot time. - * - Currently there`s no proper scenario for PIN2 verification by using this API. - * - * @post - * - None. - * - * @return Return Type (int) \n - * - Integer '0' ( same with TAPI_API_SUCCESS ) - indicating that the operation has completed successfully. \n - * - Negative integer : it provides an error code (Refer #TapiResult_t) - * - * @par Prospective Clients: - * External Apps. - * - * @see None - * - * @code - * #include - * - * int request_id = 0; - * err_code = TAPI_API_SUCCESS; // 0 - * int length = TAPI_SIM_PIN_LENGTH+1; - * char init_pin_val[length] ; - * - * strcpy(init_pin_val, PIN1_NORMAL); - * - * TelSimSecPw_t pin_data = {0,}; - * - * 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); - * - * @endcode - * - * @remarks None - * - */ -/*================================================================================================*/ -int tel_verifiy_sim_pins(TapiHandle *handle, const TelSimSecPw_t *pin_data, tapi_response_cb callback, void *user_data); - - -/** - * @brief This function performs unblock PIN1/PIN2 operation based on PUK information passed along with - * unblock information entered by the user. - * If you get sim card status(TAPI_SIM_STATUS_SIM_PUK_REQUIRED) by using #tel_get_sim_init_info on boot time - * or (TAPI_SIM_PIN_STATUS_BLOCKED) by using #tel_get_sim_security_status after normal initialization for specific operation, - * you may unblock PIN1/PIN2. - * - * This function makes Dbus method call to Telephony Sever and returns immediate value. - * However it just means that the API request has been transfered to the CP successfully. - * The actual operation result is being delivered in the corresponding event asynchronously. - * - * @par Sync (or) Async: - * This is an Asynchronous API. - * - * @par Important Notes: - * - Based on Pin status (PIN1/PIN2) is blocked, an unsolicited event TAPI_EVENT_SIM_STATUS_IND - * is published to Applications on boot time also. - * - * @warning - * - If you fail to unblock PIN til given retry count, Your SIM card be permanent block status. - * - * @param [in] handle - * - handle from tel_init(). - * - * @param[in] puk_data - * -Specifies unblocking PIN password #TelSimSecPw_t - * - * @param[in] new_pin_data - * -Specifies PIN password which you want to use after unblocking operation #TelSimSecPw_t - * - * @param [in] callback - * - To register callback function for result. - * - * @param [in] user_data - * - user_data for user specification. - * - * @par Async Response Message: - * The event associated is TAPI_EVENT_SIM_VERIFY_PUK_CNF and the event data is #TelSimSecResult_t. - * Asynchronous return status is indicated by #TelSimPinOperationResult_t. - * If returned status is TAPI_SIM_PIN_OPERATION_SUCCESS, Verification successes. - * If returned status is TAPI_SIM_PUK_INCORRECT_PASSWORD, Verification fails and you can check retry count by using event data #TelSimSecResult_t. - * - * @pre - * - Initialize Dbus connection with #tel_init - * - Register caller's application name with #tel_register_app_name - * - Register telephony events to listen - * - A event loop is running to listen events - * - PIN1 or PIN2 status should be TAPI_SIM_PIN_STATUS_BLOCKED and Card status should be TAPI_SIM_STATUS_SIM_PUK_REQUIRED on boot time. - * - * @post - * - After Success on unblocking for PIN1 or PIN2, each pin check facility is enabled even if previous facility is disabled. - * - * @return Return Type (int) \n - * - Integer '0' ( same with TAPI_API_SUCCESS ) - indicating that the operation has completed successfully. \n - * - Negative integer : it provides an error code (Refer #TapiResult_t) - * - * @par Prospective Clients: - * External Apps. - * - * @see None - * - * @code - * #include - * - * int request_id = 0; - * err_code = TAPI_API_SUCCESS; // 0 - * int length = TAPI_SIM_PIN_LENGTH+1; - * - * char init_pin_val[length]; - * char init_puk_val[length]; - * - * strcpy(init_pin_val, PIN1_NORMAL); - * strcpy(init_puk_val, PUK1_NORMAL); - * - * TelSimSecPw_t puk_data = {0,}; - * TelSimSecPw_t new_pin_data = {0,}; - * - * 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); - * - * @endcode - * - * @remarks None - * - */ -/*================================================================================================*/ -int tel_verify_sim_puks(TapiHandle *handle, const TelSimSecPw_t *puk_data, const TelSimSecPw_t *new_pin_data, tapi_response_cb callback, void *user_data); - - -/** - * @brief This function changes PIN1/PIN2 code based on the pin type passed along with old pin data and new pin data. - * - * This function makes Dbus method call to Telephony Sever and returns immediate value. - * However it just means that the API request has been transfered to the CP successfully. - * The actual operation result is being delivered in the corresponding event asynchronously. - * - * @par Sync (or) Async: - * This is an Asynchronous API. - * - * @par Important Notes: - * - User should fill up pin type equally both old_pin and new_pin. - * - * @warning - * - None. - * - * @param [in] handle - * - handle from tel_init(). - * - * @param[in] old_pin - * -Old pin code, entered by the user. #TelSimSecPw_t - * - * @param[in] new_pin - * -New pin code, entered by the user. #TelSimSecPw_t - * - * @param [in] callback - * - To register callback function for result. - * - * @param [in] user_data - * - user_data for user specification. - * - * @par Async Response Message: - * The event associated is TAPI_EVENT_SIM_CHANGE_PINS_CNF and the event data is #TelSimSecResult_t. - * Asynchronous return status is indicated by #TelSimPinOperationResult_t. - * If returned status is TAPI_SIM_PIN_OPERATION_SUCCESS, Change operation finish successfully. - * If returned status is TAPI_SIM_PIN_INCORRECT_PASSWORD, Change operation fails and you can check retry count by using event data #TelSimSecResult_t. - * - * @pre - * - Initialize Dbus connection with #tel_init - * - Register caller's application name with #tel_register_app_name - * - Register telephony events to listen - * - A event loop is running to listen events - * - User can get valid return value or make operations after SIM init complete(card status is TAPI_SIM_STATUS_SIM_INIT_COMPLETED). - * - PIN which user want to change check facility should be enabled. - * - * @post - * - None. - * - * @return Return Type (int) \n - * - Integer '0' ( same with TAPI_API_SUCCESS ) - indicating that the operation has completed successfully. \n - * - Negative integer : it provides an error code (Refer #TapiResult_t) - * - * @par Prospective Clients: - * External Apps. - * - * @see None - * - * @code - * #include - * - * int request_id = 0; - * err_code = TAPI_API_SUCCESS; // 0 - * int length = TAPI_SIM_PIN_LENGTH+1; - * char init_old_pin_val[length] ; - * char init_new_pin_val[length]; - * - * memset(&init_old_pin_val, 0 , length); - * memset(&init_new_pin_val, 0 , length); - * - * TelSimSecPw_t old_pin = {0,}; - * TelSimSecPw_t new_pin = {0,}; - * - * 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); - * - * @endcode - * - * @remarks None - * - */ -/*================================================================================================*/ -int tel_change_sim_pins(TapiHandle *handle, const TelSimSecPw_t *old_pin, const TelSimSecPw_t *new_pin, tapi_response_cb callback, void *user_data); - -/** - * @brief This API is used to disable the SIM facility. - * - * @par Sync (or) Async: - * This is an Asynchronous API. - * - * @par Important Notes: - * - None - * - * @warning - * - None. - * - * @param [in] handle - * - handle from tel_init(). - * - * @param[in] pw - * - a structure which contains facility type and password. - * - * @param [in] callback - * - To register callback function for result. - * - * @param [in] user_data - * - user_data for user specification. - * - * @par - * - * @pre - * - * @post - * - * @return Return Type (int) \n - * - Integer '0' ( same with TAPI_API_SUCCESS ) - indicating that the operation has completed successfully. \n - * - Negative integer : it provides an error code (Refer #TapiResult_t) - * - * @par Prospective Clients: - * External Apps. - * - * @see None - * - * @code - * - * @endcode - * - * @remarks None - * - */ -/*================================================================================================*/ -int tel_disable_sim_facility(TapiHandle *handle, TelSimFacilityPw_t *pw, tapi_response_cb callback, void *user_data); - -/** - * @brief This API is used to enable the SIM facility. - * - * @par Sync (or) Async: - * This is an Asynchronous API. - * - * @par Important Notes: - * - None - * - * @warning - * - None. - * - * @param [in] handle - * - handle from tel_init(). - * - * @param[in] pw - * - a structure which contains facility type and password. - * - * @param [in] callback - * - To register callback function for result. - * - * @param [in] user_data - * - user_data for user specification. - * - * @par - * - * @pre - * - * @post - * - * @return Return Type (int) \n - * - Integer '0' ( same with TAPI_API_SUCCESS ) - indicating that the operation has completed successfully. \n - * - Negative integer : it provides an error code (Refer #TapiResult_t) - * - * @par Prospective Clients: - * External Apps. - * - * @see None - * - * @code - * - * @endcode - * - * @remarks None - * - */ -/*================================================================================================*/ -int tel_enable_sim_facility(TapiHandle *handle, TelSimFacilityPw_t *pw, tapi_response_cb callback, void *user_data); - - -/** - * @brief This API is used to get the SIM facility. - * - * @par Sync (or) Async: - * This is an Asynchronous API. - * - * @par Important Notes: - * - None - * - * @warning - * - None. - * - * @param [in] handle - * - handle from tel_init(). - * - * @param[in] type - * - type of security lock type enum values. - * - * @param [in] callback - * - To register callback function for result. - * - * @param [in] user_data - * - user_data for user specification. - * - * @par - * - * @pre - * - * @post - * - * @return Return Type (int) \n - * - Integer '0' ( same with TAPI_API_SUCCESS ) - indicating that the operation has completed successfully. \n - * - Negative integer : it provides an error code (Refer #TapiResult_t) - * - * @par Prospective Clients: - * External Apps. - * - * @see None - * - * @code - * - * @endcode - * - * @remarks None - * - */ -/*================================================================================================*/ -int tel_get_sim_facility(TapiHandle *handle, TelSimLockType_t type, tapi_response_cb callback, void *user_data); - -/** - * @brief This API is used to get the SIM LOCK TYPE info. - * - * @par Sync (or) Async: - * This is an Asynchronous API. - * - * @par Important Notes: - * - None - * - * @warning - * - None. - * - * @param [in] handle - * - handle from tel_init(). - * - * @param[in] type - * - type of security lock type enum values. - * - * @param [in] callback - * - To register callback function for result. - * - * @param [in] user_data - * - user_data for user specification. - * - * @par - * - * @pre - * - * @post - * - * @return Return Type (int) \n - * - Integer '0' ( same with TAPI_API_SUCCESS ) - indicating that the operation has completed successfully. \n - * - Negative integer : it provides an error code (Refer #TapiResult_t) - * - * @par Prospective Clients: - * External Apps. - * - * @see None - * - * @code - * - * @endcode - * - * @remarks None - * - */ -/*================================================================================================*/ -int tel_get_sim_lock_info(TapiHandle *handle, TelSimLockType_t type, tapi_response_cb callback, void *user_data); - - -/** - * @brief This function provides common interface for accessing SIM data based on USIM generic command in ETSI TS 102 221 - * and 3GPP TS 31.102 Characteristics of the Universal Subscriber Identity Module (USIM) application. - * This API provides only interface to send APDU. User should know well APDU usage. - * - * This function makes Dbus method call to Telephony Sever and returns immediate value. - * However it just means that the API request has been transfered to the CP successfully. - * The actual operation result is being delivered in the corresponding event asynchronously. - * - * @par Sync (or) Async: - * This is an Asynchronous API. - * - * @par Important Notes: - * - None - * - * @warning - * - None. - * - * @param [in] handle - * - handle from tel_init(). - * - * @param[in] apdu_data - * - * @param [in] callback - * - To register callback function for result. - * - * @param [in] user_data - * - user_data for user specification. - * - * @par Async Response Message: - * The event associated is TAPI_EVENT_SIM_APDU_CNF and the event data is #TelSimApduResp_t. - * Asynchronous return status is indicated by #TelSimAccessResult_t. - * - * @pre - * - A dbus connection is established with #tel_init - * - The application name is registered with #tel_register_app_name - * - The application is registered events to listen asynchronous response with #tel_register_event - * - A event loop is running to listen events - * - User can get valid return value or make operations after SIM init complete(card status is TAPI_SIM_STATUS_SIM_INIT_COMPLETED). - * - None. - * - * @post - * - None. - * - * @return Return Type (int) \n - * - Integer '0' ( same with TAPI_API_SUCCESS ) - indicating that the operation has completed successfully. \n - * - Negative integer : it provides an error code (Refer #TapiResult_t) - * - * @par Prospective Clients: - * External Apps. - * - * @see None - * - * @code - * #include - * int err_code =0; - * int request_id = 0; - * TelSimApdu_t apdu = {0,}; - * int tmp_apdu[5] = {0xa,5,6,7,8}; - * apdu.apdu_len = 5; //user should check - * apdu.apdu = apdu; - * - * // REQUEST SIM ACCESS - * err_code = tel_req_sim_apdu((const TelSimRSimReq_t*)&rsim, &request_id); - * @endcode - * - * @remarks None - * - */ -/*================================================================================================*/ -int tel_req_sim_apdu(TapiHandle *handle, TelSimApdu_t* apdu_data, tapi_response_cb callback, void *user_data); - - -/** - * @brief This function provides common interface to get SIM ATR(Answer To Reset) value. - * - * This function makes Dbus method call to Telephony Sever and returns immediate value. - * However it just means that the API request has been transfered to the CP successfully. - * The actual operation result is being delivered in the corresponding event asynchronously. - * - * @par Sync (or) Async: - * This is an Asynchronous API. - * - * @par Important Notes: - * - None - * - * @warning - * - None. - * - * @param [in] handle - * - handle from tel_init(). - * - * @param [in] callback - * - To register callback function for result. - * - * @param [in] user_data - * - user_data for user specification. - * - * @par Async Response Message: - * The event associated is TAPI_EVENT_SIM_ATR_CNF and the event data is #TelSimAtrResp_t. - * Asynchronous return status is indicated by #TelSimAccessResult_t. - * - * @pre - * - A dbus connection is established with #tel_init - * - The application name is registered with #tel_register_app_name - * - The application is registered events to listen asynchronous response with #tel_register_event - * - A event loop is running to listen events - * - User can get valid return value or make operations after SIM init complete(card status is TAPI_SIM_STATUS_SIM_INIT_COMPLETED). - * - None. - * - * @post - * - None. - * - * @return Return Type (int) \n - * - Integer '0' ( same with TAPI_API_SUCCESS ) - indicating that the operation has completed successfully. \n - * - Negative integer : it provides an error code (Refer #TapiResult_t) - * - * @par Prospective Clients: - * External Apps. - * - * @see None - * - * @code - * #include - * int err_code =0; - * int request_id = 0; - * - * // REQUEST SIM ATR - * err_code = tel_req_sim_atr(&request_id); - * @endcode - * - * @remarks None - * - */ -/*================================================================================================*/ -int tel_req_sim_atr(TapiHandle *handle, tapi_response_cb callback, void *user_data); - -#ifdef __cplusplus -} -#endif - -#endif /* _ITAPI_SIM_H_ */ - -/** -* @} -*/ diff --git a/mobile/include/ITapiSs.h b/mobile/include/ITapiSs.h deleted file mode 100644 index bcd00c6..0000000 --- a/mobile/include/ITapiSs.h +++ /dev/null @@ -1,1002 +0,0 @@ -/* - * libslp-tapi - * - * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. - * - * Contact: Ja-young Gu - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT 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 SS_TAPI SS(Supplementary services) -* @{ -* -* @file ITapiSs.h - - @brief This file serves as a "C" header file defines functions for Tapi Supplementary services\n - It contains a sample set of function prototypes that would be required by applications. - */ - -#ifndef _ITAPI_SS_H_ -#define _ITAPI_SS_H_ - -#include -#include -#include - -#ifdef __cplusplus -extern "C" -{ -#endif - - /** - * @brief This function sends a request to activate/deactivate call barring. - * - * This service makes it possible for a mobile subscriber - * to activate barring of certain categories of outgoing or incoming calls according to a barring program which is selected from a set - * of one or more barring programs chosen at provision time and is valid for all outgoing or incoming calls, or just those associated - * with a specific basic service group. Also this API allows deactivating call barring based on categories set. - * If the user call this function with wrong password 3 times subsequently, the barring service can be blocked. - * If this function is called normally, the asynchronous response comes in a few second from network. The response indicates - * the service request has been granted or not. - * - * This API makes Dbus method call to Telephony Sever and gets immediate feedback. - * However it just means that the API request has been transfered to the CP successfully. - * The actual operation result is delivered with the async response as below. - * - * @par Sync (or) Async: - * This is an Asynchronous API. - * - * @par Important Notes: - * - None. - * - * @warning - * - None. - * - * @param [in] handle - * - handle from tel_init(). - * - * @param [in] info - * - Contains the information about call barring - * - * @param [in] callback - * - To register callback function for result. - * - * @param [in] user_data - * - user_data for user specification. - * - * @par Async Response Message: - * An asynchronous notification event is returned as a confirmation - * The event associated is TAPI_EVENT_SS_BARRING_CNF and asynchronous return status is indicated by #TelSsCause_t. - * The event data is #TelSsBarringStatusInfo_t. \n - * - * @pre - * - Initialize Dbus connection with #tel_init - * - Register caller's application name with #tel_register_app_name - * - Register telephony events to listen - * - A event loop is running to listen events - * - * @post - * - None. - * - * @return Return Type (int) \n - * - TAPI_API_SUCCESS - indicating that the operation has completed successfully. \n - * - Refer #TapiResult_t for failure and error code - * - * @par Prospective Clients: - * External Apps. - * - * \see tel_get_ss_barring_status, tel_change_ss_barring_password - * - * @code - * #include - * - * int ret_status = -1; - * TelSsCallBarringInfo_t pBarringInfo;// = {0,}; - * int pRequestId=0; - * char bar_pwd[5]="0000"; - * - * pBarringInfo.Mode = TAPI_SS_CALL_BAR_ACTIVATE; - * pBarringInfo.Type = TAPI_CALL_BARRING_ALL_OUTGOING_CALLS; - * pBarringInfo.CallType = TAPI_CALL_TYPE_VOICE_EV; - * strcpy(pBarringInfo.szPassword,bar_pwd); - * ret_status = tel_set_ss_barring (&pBarringInfo,&pRequestId); - * @endcode - * - * @remarks - * - None - * - * - */ - /*================================================================================================*/ -int tel_set_ss_barring(TapiHandle *handle, TelSsBarringInfo_t *info, tapi_response_cb callback, void *user_data); - -/** - * - * @brief This function gets call barring status. - * - * The mobile subscriber may determine by subscription of a set of one or more unique barring - * programs what kind of outgoing or incoming calls should be barred. - * If this function is called normally, the asynchronous response comes in a few second from network. - * The response indicates the service status. - * - * This API makes Dbus method call to Telephony Sever and gets immediate feedback. - * However it just means that the API request has been transfered to the CP successfully. - * The actual operation result is delivered with the async response as below. - * - * @par Sync (or) Async: - * This is an Asynchronous API. - * - * @par Important Notes: - * - None. - * - * @warning - * - None. - * - * @param [in] handle - * - handle from tel_init(). - * - * @param [in] ss_class - * - Specifies the type of call i.e. Voice call, Video Call etc. - * - * @param [in] type - * - Specifies barring type i.e. Outgoing international, outgoing all, Incoming all etc. - * - * @param [in] callback - * - To register callback function for result. - * - * @param [in] user_data - * - user_data for user specification. - * - * @par Async Response Message: - * The event associated is TAPI_EVENT_SS_BARRING_QUERYSTATUS_CNF and asynchronous return status is indicated by #TelSsCause_t. - * The event data is #TelSsBarringStatusInfo_t. - * - * @pre - * - Initialize Dbus connection with #tel_init - * - Register caller's application name with #tel_register_app_name - * - Register telephony events to listen - * - A event loop is running to listen events - * - * @post - * - None. - * - * @return Return Type (#TapiResult_t) \n - * - TAPI_API_SUCCESS - indicating that the operation has completed successfully. \n - * - Refer #TapiResult_t for failure and error code - * - * @par Prospective Clients: - * External Apps. - * - * \see tel_set_ss_barring, tel_change_ss_barring_password - * - * @code - * #include - * - * 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); // get barring status - * printf ("The return value is %d\n", ret_status); - * - * @endcode - * - * - * @remarks - * - None - * - * - */ -/*================================================================================================*/ -int tel_get_ss_barring_status(TapiHandle *handle, TelSsClass_t ss_class, TelSsBarringType_t type, tapi_response_cb callback, void *user_data); - - /** - * - * @brief This function allows changing of the barring password in Network. - * - * User can request network to change his own barring password. If the old password is not same with - * what network knows, it will be rejected by network. Also new password should be same with another new password - * which is to confirm user input. Otherwise the request must be rejected by Telephony Sever. - * If the user call this function with wrong old password 3 times subsequently, the barring service can be blocked. - * If this function is called normally, the asynchronous response comes in a few second from network. - * The response indicates the service request has been granted or not. - * - * This API makes Dbus method call to Telephony Sever and gets immediate feedback. - * However it just means that the API request has been transfered to the CP successfully. - * The actual operation result is delivered with the async response as below. - * - * - * @par Sync (or) Async: - * This is an Asynchronous API. - * - * @par Important Notes: - * - Based on 3GPP TS 22.030 section 6.5.4 Registration of New Password. Only one Change Barring Password request is allowed - * at a time and TS might return TAPI_API_REQUEST_MAX_IN_PROGRESS if another request is received. - * - * @warning - * - None. - * - * @param [in] handle - * - handle from tel_init(). - * - * @param [in] old_password - * - Old password set for Barring in Network. This is Null terminated string - * - * @param [in] new_password - * - New password for Barring to be set in Network. This is Null terminated string. - * - * @param [in] new_password_again - * - New password again. This is Null terminated string. - * - * @param [in] callback - * - To register callback function for result. - * - * @param [in] user_data - * - user_data for user specification. - * - * @par Async Response Message: - * The event associated is TAPI_EVENT_SS_BARRING_CHANGEPASS_CNF and asynchronous return status is indicated by #TelSsCause_t. - * There is no event data with this event. - * - * @pre - * - Initialize Dbus connection with #tel_init - * - Register caller's application name with #tel_register_app_name - * - Register telephony events to listen - * - A event loop is running to listen events - * - * @post - * - None. - * - * @return Return Type (int) \n - * - TAPI_API_SUCCESS - indicating that the operation has completed successfully. \n - * - Refer #TapiResult_t for failure and error code - * @par Prospective Clients: - * External Apps. - * - * @see - * - None - * - * @code - * #include - * - * int ret_status; - * int pRequestId=0; - * - * ret_status = tel_change_ss_barring_password ("0000","0000","0000",&pRequestId); // change barring password - * - * @endcode - * - * @remarks - * - None - * - * - */ -/*================================================================================================*/ -int tel_change_ss_barring_password(TapiHandle *handle, - const char *old_password, - const char *new_password, - const char *new_password_again, - tapi_response_cb callback, void *user_data); - - /** - * - * @brief This function allows to set (register/erase/activate/deactivate) call forwarding option at the Network. - * - * This enables to forward the 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, - * addressed to the called mobile subscriber's directory number and which meet - * various call FORWARD condition 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 under this call forward condition. - * Application has to call this API in order to explicitly register/erase/activate/deactivate - * the call forwarding. Request will be passed irrespective of whether already - * another SS call forward is ongoing. - * - * If this function is called normally, the asynchronous response comes in a few second from network. The response indicates - * the service request has been granted or not. - * - * This API makes Dbus method call to Telephony Sever and gets immediate feedback. - * However it just means that the API request has been transfered to the CP successfully. - * The actual operation result is delivered with the async response as below. - * - * - * @par Sync (or) Async: - * This is an Asynchronous API. - * - * @par Important Notes: - * - None. - * - * @warning - * - None. - * - * @param [in] handle - * - handle from tel_init(). - * - * @param [in] info - * - Contains the Call forward information like forward mode, forward type, etc. - * - * @param [in] callback - * - To register callback function for result. - * - * @param [in] user_data - * - user_data for user specification. - * - * @par Async Response Message: - * The event associated is TAPI_EVENT_SS_FORWARD_CNF and asynchronous return status is indicated by #TelSsCause_t. - * The event data will be #TelSsForwardingStatusInfo_t. - * - * @pre - * - Initialize Dbus connection with #tel_init - * - Register caller's application name with #tel_register_app_name - * - Register telephony events to listen - * - A event loop is running to listen events - * - * @post - * - None. - * - * @return Return Type (int) \n - * - TAPI_API_SUCCESS - indicating that the operation has completed successfully. \n - * - Refer #TapiResult_t for failure and error code - * @par Prospective Clients: - * External Apps. - * - * - * \image html CallForward.jpg - * \image latex CallForward.jpg - * - * \see tel_get_ss_forward_status - * - * @code - * #include - * - * 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[20]= {"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); - * - * @endcode - * @remarks - * - None - * - * - */ -/*================================================================================================*/ -int tel_set_ss_forward(TapiHandle *handle, const TelSsForwardInfo_t *info, tapi_response_cb callback, void *user_data); - - /** - * - * @brief This function provides option to get the call forwarding status of different calls from Network. - * - * The data request procedure enables the mobile subscriber to obtain information about the data stored in the PLMN. - * After having requested this procedure the network shall return the following information: - * - in response to a general data request the served mobile subscriber should be given a list of all Basic service groups - * to which call forwarding unconditional is registered, including information whether or not it is active and operative, - * and the associated forwarded-to numbers - * - in response to a specific request concerning one particular Basic service group, - * the served mobile subscriber should be informed whether or not call forwarding unconditional is registered, - * including information whether or not it is active and operative for that Basic service group. - * If CFU is registered, the associated forwarded-to number shall be given. - * - * If this function is called normally, the asynchronous response comes in a few second from network. - * The response indicates the service status. - * - * This API makes Dbus method call to Telephony Sever and gets immediate feedback. - * However it just means that the API request has been transfered to the CP successfully. - * The actual operation result is delivered with the async response as below. - * - * - * @par Sync (or) Async: - * This is an Asynchronous API. - * - * @par Important Notes: - * - None. - * - * @warning - * - None. - * - * @param [in] handle - * - handle from tel_init(). - * - * @param [in] ss_class - * - Specifying the Forward call type i.e. voice call, Video Call, Data Calls etc. - * - * @param [in] condition - * - Used to specify the forward condition i.e. unconditional, When no reply, when busy, when not reachable etc. - * - * @param [in] callback - * - To register callback function for result. - * - * @param [in] user_data - * - user_data for user specification. - * - * @par Async Response Message: - * The event associated is TAPI_EVENT_SS_FORWARD_QUERYSTATUS_CNF and asynchronous return status is indicated by #TelSsCause_t. - * The event data is #TelSsForwardingStatusInfo_t. - * - * @pre - * - Initialize Dbus connection with #tel_init - * - Register caller's application name with #tel_register_app_name - * - Register telephony events to listen - * - A event loop is running to listen events - * - * @post - * - None. - * - * @return Return Type (int) \n - * - TAPI_API_SUCCESS - indicating that the operation has completed successfully. \n - * - Refer #TapiResult_t for failure and error code - * - * @par Prospective Clients: - * External Apps. - * - * \see tel_set_ss_forward - * - * @code - * #include - * 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); // get forward status - * - * @endcode - * @remarks - * - None - * - * - */ -/*================================================================================================*/ -int tel_get_ss_forward_status(TapiHandle *handle, TelSsClass_t ss_class, TelSsForwardWhen_t condition, tapi_response_cb callback, void *user_data); - - /** - * - * @brief This function activates/deactivates the call waiting service. - * The call waiting service permits a mobile to be notified of an incoming - * call (as per basic call procedures) while the traffic channel (BM or LM) is not available for the incoming call and the mobile subscriber - * is engaged in an active or held call. Subsequently, the subscriber can accept, reject, or ignore the incoming call. - * If this function is called normally, the asynchronous response comes in a few second from network. The response indicates - * the service request has been granted or not. - * - * This API makes Dbus method call to Telephony Sever and gets immediate feedback. - * However it just means that the API request has been transfered to the CP successfully. - * The actual operation result is delivered with the async response as below. - * - * - * @par Sync (or) Async: - * This is an Asynchronous API. - * - * @par Important Notes: - * - None. - * - * @warning - * - None. - * - * - * @param [in] handle - * - handle from tel_init(). - * - * @param [in] info - * - Specifies the status of call-waiting service i.e. On (TRUE) or off (FALSE) - * - * @param [in] callback - * - To register callback function for result. - * - * @param [in] user_data - * - user_data for user specification. - * - * @par Async Response Message: - * The event associated is TAPI_EVENT_SS_WAITING_CNF and asynchronous return status is indicated by #TelSsCause_t. - * The event data is #TelSsWaitingStatusInfo_t. - * - * @pre - * - Initialize Dbus connection with #tel_init - * - Register caller's application name with #tel_register_app_name - * - Register telephony events to listen - * - A event loop is running to listen events - * - * @post - * - None. - * - * @return Return Type (int) \n - * - TAPI_API_SUCCESS - indicating that the operation has completed successfully. \n - * - Refer #TapiResult_t for failure and error code - * - * @par Prospective Clients: - * External Apps. - * - * \see tel_get_ss_waiting_status - * - * @code - * #include - * - * int ret_status; - * TelSsWaitingInfo_t waitInfo; - * waitInfo.Mode = TAPI_SS_CW_ACTIVATE; - * waitInfo.CallType =TAPI_CALL_TYPE_VOICE_EV; - * int RequestID; - * - * ret_status = tel_set_ss_waiting (&waitInfo,&RequestID); // set call waiting - * @endcode - * - * @remarks - * - None - * - * - */ -/*================================================================================================*/ -int tel_set_ss_waiting(TapiHandle *handle, const TelSsWaitingInfo_t *info, tapi_response_cb callback, void *user_data); - - /** - * - * @brief This function queries the status of call waiting service. - * - * @par Notes: - * The call waiting service permits a mobile to be notified of an incoming call - * (as per basic call procedures) while the traffic channel (BM or LM) is not available for the incoming call and the mobile subscriber - * is engaged in an active or held call. Subsequently, the subscriber can accept, reject, or ignore the incoming call. - * If this function is called normally, the asynchronous response comes in a few second from network. - * The response indicates the service status. - * - * This API makes Dbus method call to Telephony Sever and gets immediate feedback. - * However it just means that the API request has been transfered to the CP successfully. - * The actual operation result is delivered with the async response as below. - * - * - * @par Sync (or) Async: - * This is an Asynchronous API. - * - * @par Important Notes: - * - None. - * - * @warning - * - None. - * - * - * @param [in] handle - * - handle from tel_init(). - * - * @param [in] ss_class - * - enum data defines call type - * - * @param [in] callback - * - To register callback function for result. - * - * @param [in] user_data - * - user_data for user specification. - * - * @par Async Response Message: - * The event associated is TAPI_EVENT_SS_WAITING_QUERYSTATUS_CNF and asynchronous return status is indicated by #TelSsCause_t. - * The event data is #TelSsWaitingInfo_t. - * - * @pre - * - Initialize Dbus connection with #tel_init - * - Register caller's application name with #tel_register_app_name - * - Register telephony events to listen - * - A event loop is running to listen events - * - * @post - * - None. - * - * @return Return Type (int) \n - * - TAPI_API_SUCCESS - indicating that the operation has completed successfully. \n - * - Refer #TapiResult_t for failure and error code - * @par Prospective Clients: - * External Apps. - * - * \see tel_set_ss_waiting - * @code - * #include - * - * int ret_status; - * TelSsCallType_t CallType = TAPI_CALL_TYPE_VOICE_EV; - * int RequestID; - * - * ret_status = tel_get_ss_waiting_status ( CallType,&RequestID); // get call waiting info - * @endcode - * - * @remarks - * - None - * - * - */ -/*================================================================================================*/ -int tel_get_ss_waiting_status(TapiHandle *handle, const TelSsClass_t ss_class, tapi_response_cb callback, void *user_data); - - /** - * - * @brief This function queries the status of calling line identity service. - * - * @par Notes: - * The group of Line Identification Supplementary Services is divided into the following six Supplementary Services: - * CLIP - Calling line identification presentation - * This Supplementary Service provides for the ability to indicate the line identity of the calling party to the called party. - * The network shall deliver the calling line identity to the called party at call set-up time, - * regardless of the terminal capability to handle the information. - * CLIR - Calling line identification restriction - * the CLIR Supplementary Service is a Supplementary Service offered to the calling party - * to prevent presentation of the calling party's line identity, to the called party. - * COLP - Connected line identification presentation - * This Supplementary Service is not a dialing check but an indication to the calling subscriber - * of the connected line identity in a full ISDN/PLMN environment, - * the connected line identity shall include all the information necessary to unambiguously identify the connected party. - * The network shall deliver the connected line identity to the calling party - * regardless of the terminal capability to handle the information. - * COLR - Connected line identification restriction - * The COLR Supplementary Service is a Supplementary Service offered - * to the connected party to prevent presentation of the connected line identity, to the calling party. - * In the case where the calling party has an override category. - * CDIP - Called line identification presentation - * CNAP - Calling name presentation - * This function queries the service status with #TelSsCliType_t - * - * If this function is called normally, the asynchronous response comes in a few second from network. - * The response indicates the service status. - * - * This API makes Dbus method call to Telephony Sever and gets immediate feedback. - * However it just means that the API request has been transfered to the CP successfully. - * The actual operation result is delivered with the async response as below. - * - * - * @par Sync (or) Async: - * This is an Asynchronous API. - * - * @par Important Notes: - * - None. - * - * @warning - * - None. - * - * @param [in] handle - * - handle from tel_init(). - * - * @param [in] type - * - enum data defines Cli service type - * - * @param [in] callback - * - To register callback function for result. - * - * @param [in] user_data - * - user_data for user specification. - * - * @par Async Response Message: - * The event associated is TAPI_EVENT_SS_CLI_QUERYSTATUS_CNF and asynchronous return status is indicated by #TelSsCause_t. - * The event data is #TelCliStatusInfo_t. - * - * @pre - * - Initialize Dbus connection with #tel_init - * - Register caller's application name with #tel_register_app_name - * - Register telephony events to listen - * - A event loop is running to listen events - * - * @post - * - None. - * - * @return Return Type (int) \n - * - TAPI_API_SUCCESS - indicating that the operation has completed successfully. \n - * - Refer #TapiResult_t for failure and error code - * - * @par Prospective Clients: - * External Apps. - * - * @code - * #include - * - * int ret_status = 0; - * TelSsCliType_t CliType =TAPI_SS_CLI_CDIP; - * int pRequestId; - * - * ret_status = tel_get_ss_cli_status(CliType,&pRequestId); // get cli info - * @endcode - * - * @see - * - None - * - * @remarks - * - None - * - * - */ -/*================================================================================================*/ -int tel_get_ss_cli_status(TapiHandle *handle, TelSsCliType_t type, tapi_response_cb callback, void *user_data); - - /** - * - * @brief This function is used to send a USSD string or User response to the Network. - * - * The unstructured supplementary service data (USSD) mechanism allows the Mobile Station (MS) user and - * a PLMN operator defined application to communicate in a way which is transparent - * to the MS and to intermediate network entities. - * The mechanism allows development of PLMN specific supplementary services. - * USSD string is like *109, *109*72348937857623#. - * There are two modes of USSD: MMI-mode and application mode. - * MMI-mode USSD is for the transparent transport of MMI strings entered by the user to the network using this function - * and for the transparent transport of text strings from the network that are displayed - * by the mobile for user information. - * Application mode USSD is for the transparent transport of data between the network and the UE. - * Application mode USSD is intended to be used by applications in the network and their peer applications in the UE. - * The peer application in the UE send response with #tel_send_ss_ussd_response - * - * If this function is called normally, the asynchronous response comes in a few second from the telephony server. - * The response indicates whether the sending request is successfully delivered or not. - * - * This API makes Dbus method call to Telephony Sever and gets immediate feedback. - * However it just means that the API request has been transfered to the CP successfully. - * The actual operation result is delivered with the async response as below. - * @par Sync (or) Async: - * This is an Asynchronous API. - * - * @par Important Notes: - * - None. - * - * @warning - * - None. - * - * @param [in] handle - * - handle from tel_init(). - * - * @param [in] info - * - Data coding scheme used (GSM 7bit or 8bit default alphabet etc, defined as 3GPP TS 23.038) - * - USSD String data length - * - ANSI string passed by the client - * - * @param [in] callback - * - To register callback function for result. - * - * @param [in] user_data - * - user_data for user specification. - * - * @par Async Response Message: - * The event associated is TAPI_EVENT_SS_USSD_CNF and asynchronous return status is indicated by #TelSsCause_t. The event data - * is #TelSsUssdMsgInfo_t. - * - * @pre - * - Initialize Dbus connection with #tel_init - * - Register caller's application name with #tel_register_app_name - * - Register telephony events to listen - * - A event loop is running to listen events - * - 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) - * - * @post - * - None. - * - * @return Return Type (int) \n - * - TAPI_API_SUCCESS - indicating that the operation has completed successfully. \n - * - Refer #TapiResult_t for failure and error code - * - * @par Prospective Clients: - * External Apps. - * - * \see #tel_send_ss_ussd_response, #tel_send_ss_ussd_cancel - * - *\image html ussd.jpg - *\image latex ussd.jpg - * - * @code - * #include - * - * 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); // request ussd - * @endcode - * - * @remarks - * - None - * - * - */ -/*================================================================================================*/ -int tel_send_ss_ussd_request(TapiHandle *handle, const TelSsUssdMsgInfo_t *info, tapi_response_cb callback, void *user_data); - - /** - * - * @brief This function is used to Read AOC parameter values on the SIM. - * - * @par Notes - * This supplementary service provides the MS with the information to produce an estimate - * of the cost of the service used. Charges are indicated for the call(s) in progress - * when mobile originated or for the roaming leg only when mobile terminated. - * Any charges for non-call related transactions, and for certain supplementary services, - * such as Call Forwarding are not indicated. - * The MS will receive at the beginning of each call (and as necessary during the call) - * a message, the Charge Advice Information. This message contains the elements which together define - * the rate at which the call is to be charged, time dependence, - * data dependence and for unit increments - see TS 22.024 [3]. - * The MS shall still indicate appropriate charges even when roaming, based on Home PLMN units. - * Where applicable, the volume charge for Packet data service, - * in addition to the normal time dependent and incremental charges, shall be indicated. - * To indicate the charge per call the Mobile station shall display the units consumed - * so far during the present call(s) and maintain this value until the MS is switched off or a new call set-up is attempted. - * Where required to indicate the total accumulated charge, the MS shall be able to display, - * and the SIM/USIM shall store in the ACM, the running cumulative unit charge. - * This value must be stored securely, and all reasonable steps shall be taken to ensure that - * the written value cannot be interrupted, reset or corrupted (except resetting under control of the unblocking key). - * This function get the AOC configuration information from PLMN - * - * If this function is called normally, the asynchronous response comes in a few second from Telephony Server. - * The response indicates whether the query is delivered successfully to network or not. - * - * This API makes Dbus method call to Telephony Sever and gets immediate feedback. - * However it just means that the API request has been transfered to the CP successfully. - * The actual operation result is being delivered asynchronously. - * - * @par Sync (or) Async: - * This is an Asynchronous API. - * - * @par Important Notes: - * - None. - * - * @warning - * - None. - * - * - * @param [in] handle - * - handle from tel_init(). - * - * @param [in] AocType - * - Specifies which type of Advice of charge information to be read namely Maximum ACM, - * Price per unit currency, Current call meter and Accumulated call meter values. - * - * @param [in] callback - * - To register callback function for result. - * - * @param [in] user_data - * - user_data for user specification. - * - * @par Async Response Message: - * The event associated is TAPI_EVENT_SS_AOC_RSP and asynchronous return status is indicated by #TelSsCause_t. The event data - * is #TelCallAocInfo_t. - * - * @pre - * - Advice of charge depends on the SIM for setting or reading AOC parameters. - * - Setting of AOC needs PIN2 Verification - * - * @post - * - None. - * - * @return Return Type (int) \n - * - TAPI_API_SUCCESS - indicating that the operation has completed successfully. \n - * - Refer #TapiResult_t for failure and error code - * - * @par Prospective Clients: - * External Apps. - * - * \see tel_set_ss_aoc_info - * - *\image html ussd.jpg - *\image latex ussd.jpg - * @code - * #include - * - * TelSsAocType_t AocType = TAPI_SS_AOC_TYPE_ACM; - * ret_status = tel_get_ss_aoc_info (AocType,&pRequestId); // get AOC info - * @endcode - * - * @remarks - * - None - * - * - */ -/*================================================================================================*/ -int tel_get_ss_aoc_info(TapiHandle *handle, TelSsAocType_t AocType, tapi_response_cb callback, void *user_data); - - /** - * - * @brief This function is used to Read AOC parameter values on the SIM. - * - * @par Notes: - * Refer #tel_get_ss_aoc_info - * - * If this function is called normally, the asynchronous response comes in a few second from Telephony Server. - * The response indicates whether the query is delivered successfully to network or not. - * - * This API makes Dbus method call to Telephony Sever and gets immediate feedback. - * However it just means that the API request has been transfered to the CP successfully. - * The actual operation result is being delivered asynchronously. - * - * @par Sync (or) Async: - * This is an Asynchronous API. - * - * @par Important Notes: - * - None. - * - * @warning - * - None. - * - * - * @param [in] handle - * - handle from tel_init(). - * - * @param [in] AocSetInfo - * - Specifies which type of Advice of charge information to be set namely Maximum ACM, - * Price per unit currency, Current call meter and Accumulated call meter values. - * - * @param [in] callback - * - To register callback function for result. - * - * @param [in] user_data - * - user_data for user specification. - * - * @par Async Response Message: - * The event associated is TAPI_EVENT_SS_SET_AOC_CNF and asynchronous return status is indicated by #TelSsCause_t. The event data - * is #TelSsErrorInfo_t. - * - * @pre - * - Advice of charge depends on the SIM for setting or reading AOC parameters. - * - Setting of AOC needs PIN2 Verification - * - * @post - * - None. - * - * @return Return Type (int) \n - * - TAPI_API_SUCCESS - indicating that the operation has completed successfully. \n - * - Refer #TapiResult_t for failure and error code - * - * @par Prospective Clients: - * External Apps. - * - * \see tel_get_ss_aoc_info - * - *\image html ussd.jpg - *\image latex ussd.jpg - * @code - * #include - * - * TelCallAocInfo_t *pAocSetInfo; - * int request_id=0; - * pAocSetInfo = (TelCallAocInfo_t *)calloc(1,sizeof(TelCallAocInfo_t)); - * pAocSetInfo->AocType = TAPI_SS_AOC_TYPE_RESET; - * int ret_status =0; - * - * ret = tel_set_ss_aoc_info (pAocSetInfo,&request_id); // set aoc info - * @endcode - * - * - * @remarks - * - None - * - * - */ -/*================================================================================================*/ -int tel_set_ss_aoc_info(TapiHandle *handle, TelCallAocInfo_t *AocSetInfo, tapi_response_cb callback, void *user_data); - -#ifdef __cplusplus -} -#endif - -#endif /* _ITAPI_SS_H_ */ - -/** -* @} -*/ diff --git a/mobile/include/SLP_TelephonyFW_PG.h b/mobile/include/SLP_TelephonyFW_PG.h deleted file mode 100644 index 0d0ea5a..0000000 --- a/mobile/include/SLP_TelephonyFW_PG.h +++ /dev/null @@ -1,9600 +0,0 @@ -/* - * libslp-tapi - * - * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. - * - * Contact: Ja-young Gu - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT 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("com.samsung.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("com.samsung.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("com.samsung.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("com.samsung.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("com.samsung.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("com.samsung.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("com.samsung.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("com.samsung.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("com.samsung.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_authentication( TelSimAuthenticationData_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; - TelSimAuthenticationData_t authenticationData; - authenticationData.rand_length = 100; - authenticationData.rand_length = 100; - authenticationData.rand_data = "test data"; - authenticationData.autn_data = "test data"; - int pRequestId = 0; - - ret_status = tel_req_sim_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_AUTHENTICATION_CNF: - printf("TAPI_EVENT_SIM_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("com.samsung.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 - -This API is permitted for Samsung in-house applications only -@} -@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 - -This API is permitted for Samsung in-house applications only -@} -@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 - -This API is permitted for Samsung in-house applications only - -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("com.samsung.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. - -This API is permitted for Samsung in-house applications only - -@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) - -These APIs are permitted for Samsung in-house applications only - -@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. - -This API is permitted for Samsung in-house applications only - -@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 - -These APIs are permitted for Samsung in-house applications only - -@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("com.samsung.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 Use_Cases8_5 DataEnterDormantState -@ingroup Use_Cases8_GPRS -@{ - - -

DataEnterDormantState

-This API is used to set the modem’s data channels to the dormant state for power saving when there is no data flowing for certain time. - -Precondition: -@n GPRS session must be started before executing this API. - -@code -int tel_set_gprs_dormant (int * pRequestID); -@endcode - -This API is restricted for direct use. Use the Data Network API instead. - -SAMPLE CODE -@code -#include -#include -#include - -void enterdormantstate() -{ - int ret_status; - int request_id = 0; - - ret_status = TelTapiDataEnterDormantState(&request_id); - if (ret_status == TAPI_API_SUCCESS) - { - printf("/n/ Entered Dormant State successfully \\n"); - } - else - { - printf("/nerror:%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_DATA_DORMANT_RESP: - TelTapiGprsDataDormancy_t resp; - memcpy(&resp, psEvent->pData, sizeof(TelTapiGprsDataDormancy_t)); - printf("TAPI_EVENT_PS_DATA_DORMANT_RESP\n"); - break; - } - } -} -@endcode -@} -@defgroup Use_Cases8_6 SetPortlist -@ingroup Use_Cases8_GPRS -@{ - - -

SetPortlist

-This API is used to set white or black port list - -@code -int tel_set_gprs_port_list(int *pRequestID); -@endcode - -This API is restricted for direct use. Use the Data Network API instead. - -SAMPLE CODE -@code -#include -#include -#include - -void setportlist() -{ - int ret_val; - int requestId = 0; - tapi_gprs_pdp_port_list_setting_info_t test; - - memset(&test, 0, sizeof(tapi_gprs_pdp_port_list_setting_info_t)); - test.tcp_list.type = TAPI_GPRS_PORT_LIST_NOT_USE; - test.tcp_list.len = 1; - test.tcp_list.list[0] = 1004; - test.udp_list.type = TAPI_GPRS_PORT_LIST_NOT_USE; - test.udp_list.len = 1; - test.udp_list.list[i] = 1111; - - ret_val = tel_set_gprs_port_list(&test, &requestId); -} -//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_DATA_DORMANT_RESP: - printf("TAPI_EVENT_PS_DATA_DORMANT_RESP\n"); - break; - } - } -} -@endcode -@} -@defgroup Use_Cases8_7 GetPortlist -@ingroup Use_Cases8_GPRS -@{ - - -

GetPortlist

-This function is used to get white or black port list from modem - -@code -int tel_get_gprs_port_list(int *pRequestID); -@endcode - -This API is restricted for direct use. Use the Data Network API instead. - -SAMPLE CODE -@code -#include -#include -#include - -Void getportlist() -{ - int ret_val; - int requestId = 0; - ret_val = tel_get_gprs_port_list(&requestId); -} - -//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_DATA_DORMANT_RESP: - tapi_gprs_pdp_port_list_setting_info_t *info; - memcpy(info, psEvent->pData, sizeof(tapi_gprs_pdp_port_list_setting_info_t)); - printf("TAPI_EVENT_PS_DATA_DORMANT_RESP\n"); - 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/mobile/include/TapiUtility.h b/mobile/include/TapiUtility.h deleted file mode 100644 index c7227c5..0000000 --- a/mobile/include/TapiUtility.h +++ /dev/null @@ -1,272 +0,0 @@ -/* - * libslp-tapi - * - * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. - * - * Contact: Ja-young Gu - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT 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 TelUtility.h - - @brief This file serves as a "C" header file defines structures for Utility Services. \n - It contains a sample set of constants, enums, structs that would be required by applications. - */ - -#ifndef _TEL_UTILITY_H_ -#define _TEL_UTILITY_H_ - -__BEGIN_DECLS - -#define INVALID_REQUEST_ID -1 /**< Invalid RequestId Value */ -#define DBUS_DEFAULT_PATH "/org/tizen/telephony" - -/** - * @enum TapiResult_t - * Below enumerations are the return codes of TAPI API's - */ -typedef enum { - TAPI_API_SUCCESS = 0, /**= src_len) { \ - memcpy(dest, src, src_len); \ - } \ - else { \ - 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; \ - } \ -} - -__END_DECLS - -#endif //_TEL_UTILITY_H_ -/** - * @} - */ diff --git a/mobile/include/TelCall.h b/mobile/include/TelCall.h deleted file mode 100644 index f20f9b8..0000000 --- a/mobile/include/TelCall.h +++ /dev/null @@ -1,1015 +0,0 @@ -/* - * libslp-tapi - * - * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. - * - * Contact: Ja-young Gu - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT 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 -#include - -#ifdef __cplusplus -extern "C" { -#endif - -#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 -#define TAPI_CALL_CUSTOM_SERVICE_DATA_MAX 128 - -/** - * @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_FIXED_DIALING_NUMBER_ONLY, /**< Fixed Dialing Number Only */ - 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_ACTIVE, /**< Call is in connected and conversation state */ - TAPI_CALL_STATE_HELD, /**< Call is in held state */ - TAPI_CALL_STATE_DIALING, /**< Call is in dialing state */ - TAPI_CALL_STATE_ALERT, /**< Call is in alerting state */ - TAPI_CALL_STATE_INCOMING, /**< Call is in incoming state */ - TAPI_CALL_STATE_WAITING, /**< Call is in answered state, and waiting for connected indication event */ - TAPI_CALL_STATE_MAX -} 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 TelCallEndType_t - * End type used as in parameter in the end call API. - */ -typedef enum { - TAPI_CALL_END = 0, - TAPI_CALL_END_ALL, - TAPI_CALL_END_ACTIVE_ALL, - TAPI_CALL_END_HOLD_ALL, -} TelCallEndType_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; - -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.*/ -} TelCallDial_t; - -/** - * This structure contains information about call status. - */ -typedef struct { - int CallHandle; - 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 */ - int bConferenceState; /**< Whether Call is in Conference or not*/ -} TelCallStatus_t; - -typedef void (*TelCallStatusCallback)( TelCallStatus_t *out, void *user_data ); - - -/** - * 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; - -// New Struct for New API -typedef enum { - TAPI_SOUND_MUTE =0x00, /** - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT 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 - -/* 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; - -#ifdef __cplusplus -} -#endif - -#endif /* _TEL_DEFINES_H_ */ - -/** - * @} - */ diff --git a/mobile/include/TelDisplay.h b/mobile/include/TelDisplay.h deleted file mode 100644 index 82eeda1..0000000 --- a/mobile/include/TelDisplay.h +++ /dev/null @@ -1,200 +0,0 @@ -/* - * libslp-tapi - * - * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. - * - * Contact: Ja-young Gu - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT 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 -#include - -#ifdef __cplusplus -extern "C" { -#endif - -#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 */ - -/** - * 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; - -/** - * 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; - -#ifdef __cplusplus -} -#endif - -#endif /* _TEL_DISPLAY_H_ */ - -/** - * @} - */ diff --git a/mobile/include/TelErr.h b/mobile/include/TelErr.h deleted file mode 100644 index 0b25164..0000000 --- a/mobile/include/TelErr.h +++ /dev/null @@ -1,186 +0,0 @@ -/* - * libslp-tapi - * - * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. - * - * Contact: Ja-young Gu - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT 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_ - -#ifdef __cplusplus -extern "C" -{ -#endif - -/************************************************************ -** 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; - -#ifdef __cplusplus -} -#endif - -#endif // _TEL_ERR_H_ - -/** -* @} -*/ diff --git a/mobile/include/TelMisc.h b/mobile/include/TelMisc.h deleted file mode 100644 index 8e4a8c4..0000000 --- a/mobile/include/TelMisc.h +++ /dev/null @@ -1,349 +0,0 @@ -/* - * libslp-tapi - * - * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. - * - * Contact: Ja-young Gu - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT 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 -#include - -#ifdef __cplusplus -extern "C" { -#endif - -#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 - -/** - * @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; - -/** - * 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; - -#ifdef __cplusplus -} -#endif - -#endif // _TEL_MISC_H_ -/** - * @} - */ diff --git a/mobile/include/TelNetwork.h b/mobile/include/TelNetwork.h deleted file mode 100644 index d6b7f9c..0000000 --- a/mobile/include/TelNetwork.h +++ /dev/null @@ -1,516 +0,0 @@ -/* - * libslp-tapi - * - * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. - * - * Contact: Ja-young Gu - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT 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_ - -#ifdef __cplusplus -extern "C" -{ -#endif - -#define TAPI_NETWORK_ORDER_MAX 5 /**< Maximum network order */ -#define TAPI_NETWORK_LIST_MAX 15 /**< Maximum network list */ -#define TAPI_NETWORK_PLMN_LEN_MAX 6 /**< Maximum PLMN length*/ -#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 */ -#define TAPI_NETWORK_GERAN_NEIGHBORING_CELL_LIST_MAX 6 /**< Maximum GERAN neighboring cell list */ -#define TAPI_NETWORK_UMTS_NEIGHBORING_CELL_LIST_MAX 24 /**< Maximum UMTS neighboring cell list */ - -/* This value defines the network mode */ -#define TAPI_NETWORK_MODE_AUTO 0x00 /**< Set Network mode to AUTOMATIC */ -#define TAPI_NETWORK_MODE_GSM 0x01 /**< Set Network mode to GSM */ -#define TAPI_NETWORK_MODE_WCDMA 0x02 /**< Set Network mode to WCDMA */ -#define TAPI_NETWORK_MODE_CDMA 0x04 /**< Set Network mode to CDMA */ -#define TAPI_NETWORK_MODE_LTE 0x08 /**< Set Network mode to LTE */ - -/** - * @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 */ -} TelNetworkSelectionMode_t; - -/** - * @enum TelNetworkServiceDomain_t - * This enumeration defines the network service domains . - */ -typedef enum { - TAPI_NETWORK_SERVICE_DOMAIN_COMBINED, /**< This member sets the Circuit switch and Packet Switch domain */ - TAPI_NETWORK_SERVICE_DOMAIN_PS, /**< This member sets the Packet Switch service domain */ - TAPI_NETWORK_SERVICE_DOMAIN_CS, /**< This member sets the Circuit Switch service domain */ - TAPI_NETWORK_SERVICE_DOMAIN_AUTOMATIC /**< This member sets the service domain to Circuit Switch and Packet Switch or Circuit Switch or Packet Switch domain */ -} TelNetworkServiceDomain_t; - -/** - * @enum TelNetworkServiceLevel_t - * This enumeration defines the status of network service. - */ -typedef enum { - TAPI_NETWORK_SERVICE_LEVEL_NO, /**< No service available in the network ME is camped */ - TAPI_NETWORK_SERVICE_LEVEL_EMERGENCY, /**< Only emergency service available in the network ME is camped */ - TAPI_NETWORK_SERVICE_LEVEL_FULL, /**< FULL service available in the network ME is camped */ - TAPI_NETWORK_SERVICE_LEVEL_SEARCH /**< Searching for service */ -} TelNetworkServiceLevel_t; - -/** - * @enum TelNetworkServiceLevel_t - * This enumeration defines the service types of TAPI. - */ -typedef enum { - TAPI_NETWORK_SERVICE_TYPE_NO_SVE, /**< No service (This enumeration is not applicable for OEM_TAPI_NW_select_network_req API) */ - TAPI_NETWORK_SERVICE_TYPE_LIMITED, /**< Limited service available in the camped network (This enumeration is not applicable for OEM_TAPI_NW_select_network_req API) */ - TAPI_NETWORK_SERVICE_TYPE_CS, /**< CS service available in the camped network */ - TAPI_NETWORK_SERVICE_TYPE_PS, /**< PS service available in the camped network */ - TAPI_NETWORK_SERVICE_TYPE_COMBINED /**< Both CS and PS services available in the camped network */ -} TelNetworkServiceType_t; - -/** - * @enum TelNetworkSystemType_t - * This enumeration defines the system types of TAPI. - */ -typedef enum -{ - TAPI_NETWORK_SYSTEM_NO_SRV, /**< No Service available */ - TAPI_NETWORK_SYSTEM_GSM, /**< Available service is GSM */ - TAPI_NETWORK_SYSTEM_GPRS, /**< Available service is GPRS */ - TAPI_NETWORK_SYSTEM_EGPRS, /**< Available service is EGPRS */ - TAPI_NETWORK_SYSTEM_PCS1900, /**< Available service is PCS1900 band */ - TAPI_NETWORK_SYSTEM_UMTS, /**< Available service is UMTS */ - TAPI_NETWORK_SYSTEM_GSM_AND_UMTS, /**< Both GSM and UMTS systems available */ - TAPI_NETWORK_SYSTEM_HSDPA, /**< Available service is hsdpa */ - TAPI_NETWORK_SYSTEM_IS95A, /**< Available service is IS95A */ - TAPI_NETWORK_SYSTEM_IS95B, /**< Available service is IS95B */ - TAPI_NETWORK_SYSTEM_CDMA_1X, /**< Available service is CDMA 1X */ - TAPI_NETWORK_SYSTEM_EVDO_REV_0, /**< Available service is EV-DO rev0 */ - TAPI_NETWORK_SYSTEM_1X_EVDO_REV_0_HYBRID, /**< Available service is 1X and EV-DO rev0 */ - TAPI_NETWORK_SYSTEM_EVDO_REV_A, /**< Available service is EV-DO revA */ - TAPI_NETWORK_SYSTEM_1X_EVDO_REV_A_HYBRID, /**< Available service is 1X and EV-DO revA */ - TAPI_NETWORK_SYSTEM_EVDV, /**< Available service is EV-DV */ - TAPI_NETWORK_SYSTEM_LTE /**< Available service is LTE */ -} TelNetworkSystemType_t; - -/** - * @enum TelNetworkBandPreferred_t - * This enumeration defines the operations that can be done on network Band. - */ -typedef enum -{ - TAPI_NETWORK_BAND_MODE_PREFERRED = 0x01, /**< Preferred band. (If preferred Band is not available, then underlying modem can search on other bands) */ - TAPI_NETWORK_BAND_MODE_ONLY = 0x02, /**< This allows only particular band. */ -} TelNetworkBandPreferred_t; - -/** - * @enum TelNetworkBand_t - * This enumeration defines different network Bands. - */ -typedef enum -{ - TAPI_NETWORK_BAND_TYPE_ANY = 0x00, /**< All bands can be tried. */ - TAPI_NETWORK_BAND_TYPE_GSM850, /**< This member sets the band to GSM 850 */ - TAPI_NETWORK_BAND_TYPE_GSM_900_1800, /**< This member sets the band to GSM 900_1800 */ - TAPI_NETWORK_BAND_TYPE_GSM1900, /**< GSM 1900*/ - TAPI_NETWORK_BAND_TYPE_GSM, /**< This member sets all GSM bands */ - TAPI_NETWORK_BAND_TYPE_WCDMA, /**< This member sets all WCDMA bands */ - TAPI_NETWORK_BAND_TYPE_WCDMA850, /**< This member sets the band to WCDMA 850 */ - TAPI_NETWORK_BAND_TYPE_WCDMA1900, /**< This member sets the band to WCDMA 1900 */ - TAPI_NETWORK_BAND_TYPE_WCDMA2100, /**< This member sets the band to WCDMA 2100 */ - TAPI_NETWORK_BAND_TYPE_GSM900, /**< GSM 900*/ - TAPI_NETWORK_BAND_TYPE_GSM1800, /**< This member sets the band to GSM 1800 */ - TAPI_NETWORK_BAND_TYPE_GSM_850_1900, /**< This member sets the band to GSM 850_1900 */ - TAPI_NETWORK_BAND_TYPE_LTE_BAND_4, /**< This member sets the band to LTE BAND 4*/ - TAPI_NETWORK_BAND_TYPE_LTE_BAND_17 /**< This member sets the band to LTE BAND 17 */ -} TelNetworkBand_t; - -/** - * @enum TelNetworkOperationCause_t - * This enumeration defines different network operation cause. - */ -typedef enum -{ - TAPI_NETWORK_NO_ERR = 0x00, /**< There is no error for any network operation. */ - TAPI_NETWORK_OPERATION_FAILED, /**< There is an error for any network operation. */ - TAPI_NETWORK_PHONE_IN_USE_ERR, /**< This error will be returned when any network operation is tried while phone is in use(eg, Voice / Data call in progress due to which network operation failed) */ - TAPI_NETWORK_OFFLINE_ERR, /**< This error is sent when any network option is tried when phone is in offline mode */ - TAPI_NETWORK_CONFIG_SETTINGS_FAILURE_ERR, /**< This error is sent when modem is unable to process the config settings information. */ - TAPI_NETWORK_INTERNAL_FAILURE_ERR, /**< This error to indicate internal failure */ - TAPI_NETWORK_MEMORY_FULL_ERR /**< This error is caused by memory full */ -} TelNetworkOperationCause_t; - - -/** - * @enum TelNetworkPreferredPlmnOp_t - * This enumeration defines the operation that can be done on preferred PLMN. - */ -typedef enum -{ - TAPI_NETWORK_PREF_PLMN_ADD=0x01, /**< Addition to Network Preferred Plmn list*/ - TAPI_NETWORK_PREF_PLMN_EDIT, /**< Edit the network Preferred Plmn list */ - TAPI_NETWORK_PREF_PLMN_DELETE /**< Delete the entry to network Preferred Plmn list*/ -} TelNetworkPreferredPlmnOp_t; - -/** - * @enum TelNetworkPowerOnAttach_t - * This enumeration defines operation that can be done on power on attach. - * It is used on CDMA. - */ -typedef enum -{ - TAPI_NETWORK_SERVING_CARRIER_TEST = 0x00, /**< TestBed */ - TAPI_NETWORK_SERVING_CARRIER_SKT, /**< Korea SKT */ - TAPI_NETWORK_SERVING_CARRIER_KTF, /**< Korea KTF */ - TAPI_NETWORK_SERVING_CARRIER_LGT, /**< Korea LGT */ - TAPI_NETWORK_SERVING_CARRIER_VERIZON = 0x11, /**< US VERIZON */ - TAPI_NETWORK_SERVING_CARRIER_SPRINT, /**< US SPRINT */ - TAPI_NETWORK_SERVING_CARRIER_ALLTEL, /**< US ALLTEL */ - TAPI_NETWORK_SERVING_CARRIER_METRO_PCS, /**< US METRO_PCS */ - TAPI_NETWORK_SERVING_CARRIER_CELLULAR, /**< US CELLULAR */ - TAPI_NETWORK_SERVING_CARRIER_CRIKET, /**< US CRIKET */ - TAPI_NETWORK_SERVING_CARRIER_TELUS = 0x21, /**< CANADA TELUS */ - TAPI_NETWORK_SERVING_CARRIER_BMC, /**< CANADA BMC */ - TAPI_NETWORK_SERVING_CARRIER_BWA, /**< CANADA BWA */ - TAPI_NETWORK_SERVING_CARRIER_CTC = 0x31, /**< CHINA CTC */ - TAPI_NETWORK_SERVING_CARRIER_UNKNOWN = 0xFF /**< SERVING NETWORK UNKNOWN */ -} TelNetworkServCarrierType_t; - -/** - * @enum TelNetworkPlmnType_t - * This structure defines Network Plmn type. - */ -typedef enum -{ - TAPI_UNKNOWN_PLMN=0, /**< Network Plmn type Unknown */ - TAPI_HOME_PLMN , /**< Network Plmn type Home Plmn */ - TAPI_AVAILABLE_PLMN, /**< Network Plmn Available */ - TAPI_FORBIDDEN_PLMN, /**< Network Plmn Forbidden */ -}TelNetworkPlmnType_t; - -/** - * @enum TelNetworkHomeZoneCommand_t - * This enumeration defines network home zone command. - */ -typedef enum -{ - TAPI_NETWORK_ZONEINFO_NONE, /**< Network Zone info none */ - TAPI_NETWORK_ZONEINFO_IND, /**< Network Zone info indication */ - TAPI_NETWORK_ZONEINFO_CLEAR /**< Network Zone info clear */ -}TelNetworkHomeZoneCommand_t; - -/** - * @enum TelNetworkHomeZone_t - * This enumeration defines network home zone type. - */ -typedef enum -{ - TAPI_NETWORK_ZONE_NONE, /**< Network Zone Type none */ - TAPI_NETWORK_ZONETYPE_HOMEZONE, /**< Network Zone Type Home zone */ - TAPI_NETWORK_ZONETYPE_CITYZONE, /**< Network Zone Type City zone */ -}TelNetworkHomeZone_t; - -/** - * @enum TelNetworkNameDispCondition_t - * This enumeration defines network name display condition type. - */ -typedef enum -{ - TAPI_NETWORK_DISP_INVALID= 0x00, - TAPI_NETWORK_DISP_SPN = 0x01, - TAPI_NETWORK_DISP_PLMN = 0x02, - TAPI_NETWORK_DISP_SPN_PLMN = 0x03, -}TelNetworkNameDispCondition_t; - -/** - * @enum TelNetworkPrefNetType_t - * This enumeration defines CDMA Preferred Network Type(CDMA only). - */ -typedef enum -{ - TAPI_NETWORK_PREF_NET_TYPE_AUTOMATIC = 0x01, /**< 0x01 : AUTOMATIC */ - TAPI_NETWORK_PREF_NET_TYPE_AUTOMATIC_A, /**< 0x02 : AUTOMATIC A */ - TAPI_NETWORK_PREF_NET_TYPE_AUTOMATIC_B, /**< 0x03 : AUTOMATIC B */ - TAPI_NETWORK_PREF_NET_TYPE_HOME_ONLY, /**< 0x04 : HOME ONLY */ - TAPI_NETWORK_PREF_NET_TYPE_ROAM_ONLY, /**< 0x05 : ROAM ONLY */ -} TelNetworkPrefNetType_t; - -/** - * @enum TelNetworkPrlPrefOnly_t - * This enumeration defines CDMA PRL Preferred Only field stored in the PRL(CDMA only). - */ -typedef enum -{ - TAPI_NETWORK_PRL_PREF_ONLY_OFF, /**< Preferred Only is FALSE */ - TAPI_NETWORK_PRL_PREF_ONLY_ON, /**< Preferred Only is TRUE */ - TAPI_NETWORK_PRL_PREF_ONLY_NONE /**< There isn't Preferred Only Option */ -} TelNetworkPrlPrefOnly_t; - -/** - * @enum TelNetworkCDMAHybridMode_t - * This enumeration defines CDMA Hybrid Mode State(CDMA only). - */ -typedef enum -{ - TAPI_NETWORK_CDMA_HYBRID = 0x01, /**< 0x01 : HYBRID(1X + EVDO) */ - TAPI_NETWORK_CDMA_1X_ONLY, /**< 0x02 : 1X ONLY */ - TAPI_NETWORK_CDMA_EVDO_ONLY, /**< 0x03 : EVDO ONLY */ -}TelNetworkCDMAHybridMode_t; - - -/** - * This structure has information related to cdma system. - */ -typedef struct { - TelNetworkServCarrierType_t carrier; /**< for CDMA, Optional */ - unsigned short system_id; /**< for CDMA, Mandatory */ - unsigned short network_id; /**< for CDMA, Mandatory */ - unsigned short base_station_id; /**< for CDMA, Mandatory */ - unsigned short base_station_latitude; /**< for CDMA, Mandatory */ - unsigned short base_station_longitude; /**< for CDMA, Mandatory */ - unsigned short registration_zone; /**< for CDMA, Optional */ - unsigned short pilot_offset; /**< for CDMA, Optional */ -} TelNetworkCDMASysInfo_t; - -/** - * - * This structure defines the preferred plmn information. - */ -typedef struct { - unsigned char Index; /**< Network Preferred Plmn list index */ - char Plmn[TAPI_NETWORK_PLMN_LEN_MAX + 1]; /**< Network Preferred Plmn */ - char network_name[TAPI_NETWORK_NAME_LEN_MAX + 1]; /**< Network Name */ - char service_provider_name[TAPI_NETWORK_NAME_LEN_MAX + 1]; /**< Service provider name */ - TelNetworkSystemType_t SystemType; /**< Network system type */ -} TelNetworkPreferredPlmnInfo_t; - -/** - * - * This structure defines the preferred plmn list. - */ -typedef struct { - unsigned int NumOfPrefPlmns; /**< Number of preferred plmns in the list */ - TelNetworkPreferredPlmnInfo_t PrefPlmnRecord[TAPI_PREFERRED_PLMN_RECORDS_MAX]; /**< preferred plmns list */ -} TelNetworkPreferredPlmnList_t; - -/** - * - * This structure defines the location area code and cell id. - */ -typedef struct { - unsigned short LocationAreaCode; /**< Network Location area code */ - unsigned long CellId; /**< Network Cell Id */ -} TelNetworkLocationCellInfo_t; - -/** - * - * This structure defines the network status . - */ -typedef struct { - unsigned char svctype; /**< Network svc type */ - unsigned char roaming; /**< Network roaming */ -} TelNetworkStatus_t; - -/** - * - * This structure defines the network Cs,Ps status. - */ -typedef struct { - unsigned char cstype; /**< Network Cs type */ - unsigned char pstype; /**< Network Ps type */ -} TelNetworkCsPsStatus_t; - -/** - * TelNetworkIdentity_t - * This structure defines the network identity. - */ -typedef struct { - char network_name[TAPI_NETWORK_NAME_LEN_MAX + 1]; /**< Network Name */ - char service_provider_name[TAPI_NETWORK_NAME_LEN_MAX + 1]; /**< Service provider name */ - unsigned int plmn_id; /**< PLMN ID */ - char plmn[TAPI_NETWORK_PLMN_LEN_MAX + 1]; /**< PLMN ID */ - TelNetworkPlmnType_t type_of_plmn; /**< PLMN type */ - TelNetworkSystemType_t access_technology; /**< Access technology */ -} TelNetworkIdentity_t; - -/** - * - * This structure defines the network Plmn list. - */ -typedef struct { - char networks_count; /**< Network Plmn count */ - TelNetworkIdentity_t network_list[TAPI_NETWORK_LIST_MAX]; /**< Network list */ -} TelNetworkPlmnList_t; - -/** - * - * This structure defines the network display info. - */ -typedef struct { - int DisplayInfo[TAPI_NETWORK_DISPLAY_INFO_ELEMENTS]; /**< Network display info */ -} TelNetworkDisplayInfo_t; - -typedef struct { - TelNetworkNameDispCondition_t DispCondition; /*Display condition of SPN & PLMN*/ - unsigned char Spn[TAPI_NETWORK_SPN_LEN_MAX + 1]; /*Spn value*/ - unsigned char Plmn[TAPI_NETWORK_NAME_LEN_MAX + 1]; /*PLMN value, In 2G case if DispPlmn is true and the PLMN value is null then Network module has to display registered PLMN*/ -} TelNetworkSpnPlmnDisplayInfo_t; - -/** - * * @struct TelNetworkSpnMccMncInfo_t - * This structure defines the network Spn, Mcc and Mnc info. - */ -typedef struct { - int mcc; /**< Network mcc */ - int mnc; /**< Network Mnc */ - char bDispCondition; /** - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT 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 -#include -#include -#include -#include -#include -#include - -#ifdef __cplusplus -extern "C" -{ -#endif - -#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 - -// 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 - -#ifdef __cplusplus -extern "C" -{ -#endif - -/** - * @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; - -// 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; - -#ifdef __cplusplus -} -#endif - -#endif /* _TEL_SAT_ENVELOPE_H_ */ - -/** - * @} - */ diff --git a/mobile/include/TelSatObj.h b/mobile/include/TelSatObj.h deleted file mode 100644 index 7c75233..0000000 --- a/mobile/include/TelSatObj.h +++ /dev/null @@ -1,1399 +0,0 @@ -/* - * libslp-tapi - * - * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. - * - * Contact: Ja-young Gu - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT 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 -#include - -#ifdef __cplusplus -extern "C" -{ -#endif - -#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 */ - -/** - * @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; - -/** - * 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 - -#ifdef __cplusplus -extern "C" -{ -#endif - -#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 */ - -/** - * 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; - -#ifdef __cplusplus -} -#endif - -#endif /* _TEL_SAT_PROACTV_CMD_H_ */ - -/** - * @} - */ diff --git a/mobile/include/TelSim.h b/mobile/include/TelSim.h deleted file mode 100644 index 69284ed..0000000 --- a/mobile/include/TelSim.h +++ /dev/null @@ -1,1177 +0,0 @@ -/* - * libslp-tapi - * - * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. - * - * Contact: Ja-young Gu - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT 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 - -#ifdef __cplusplus -extern "C" -{ -#endif - -/** Maximum ICCID Length */ -#define TAPI_SIM_ICCID_LEN_MAX 20 - -/** 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 - -/** Authentication code max length */ -#define TAPI_SIM_AUTH_MAX_REQ_DATA_LEN 16 - -/** Authentication response data max length */ -#define TAPI_SIM_AUTH_MAX_RESP_DATA_LEN 16 - -/** 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 - -/** SIM 3G Phone book EF Max count */ -#define TAPI_SIM_PB_3G_FILE_MAX_COUNT 13 - -/** SAP Answer to Reset data max length */ -#define TAPI_SIM_SAP_ATR_DATA 256 - -#define TAPI_SIM_NET_FULL_NAME_MAX_LEN 40 - -#define TAPI_SIM_NET_SHORT_NAME_MAX_LEN 10 - -#define TAPI_SIM_MSP_CNT_MAX 2 - -#define TAPI_SIM_OPERATION_TIMEOUT 1234 - -/** - * @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 */ - TAPI_SIM_CARD_TYPE_RUIM, - TAPI_SIM_CARD_TYPE_IMS, -} TelSimCardType_t; - -/** - * @enum TelSimFileID_t - * This enumeration defines the card type. - */ -typedef enum { - TAPI_SIM_EF_DIR = 0x2F00, /**< Root Directory for the USIM */ - TAPI_SIM_EF_ICCID = 0x2FE2, /**< the ICC Identification file */ - TAPI_SIM_EF_IMSI = 0x6F07, /**< the IMSI file */ - TAPI_SIM_EF_SST = 0x6F38, /**< the SIM Service Table file */ - TAPI_SIM_EF_EST = 0x6F56, /**< the Enabled Service Table file */ - TAPI_SIM_EF_OPLMN_ACT = 0x6F61, /**< the OPLMN List file*/ - TAPI_SIM_EF_GID1 = 0x6F3E, /**< the Group Identifier Level 1 */ - TAPI_SIM_EF_GID2 = 0x6F3F, /**< the Group Identifier Level 2 */ - - TAPI_SIM_EF_ELP = 0x2F05, /**< the Extended Language Preference file */ - TAPI_SIM_EF_LP = 0x6F05, /**< SIM: Language preference */ - TAPI_SIM_EF_ECC = 0x6FB7, /**< the Emergency Call Codes */ - TAPI_SIM_EF_SPN = 0x6F46, /**< the Service Provider Name */ - TAPI_SIM_EF_SPDI = 0x6FCD, /**< the Service provider display information*/ - TAPI_SIM_EF_PNN = 0x6FC5, /**< the PLMN Network Name File*/ - TAPI_SIM_EF_OPL = 0x6FC6, /**< the Operator PLMN List File*/ - TAPI_SIM_EF_MSISDN = 0x6F40, /**< MSISDN */ - - TAPI_SIM_EF_SMS = 0x6F3C, /** < Short Messages file */ - TAPI_SIM_EF_SMSP = 0x6F42, /** < SMS Parameter */ - TAPI_SIM_EF_SMSS = 0x6F43, /** < SMS Status */ - TAPI_SIM_EF_CBMI = 0x6F45, /** < Cell Broadcast Message Identifier */ - TAPI_SIM_EF_MBDN = 0x6FC7, /** < SIM Mail Box Dialing Number file */ - - TAPI_SIM_EF_USIM_MBI = 0x6FC9, /** < Mailbox Identifier -linear fixed*/ - TAPI_SIM_EF_USIM_MWIS = 0x6FCA, /** < Message Waiting Indication Status -linear fixed*/ - TAPI_SIM_EF_USIM_CFIS = 0x6FCB, /** < Call forward indication status -linear fixed*/ - - /* CPHS FILE ID */ - TAPI_SIM_EF_CPHS_VOICE_MSG_WAITING = 0x6F11, /** < CPHS voice MSG waiting indication */ - TAPI_SIM_EF_CPHS_SERVICE_STRING_TABLE = 0x6F12, /** < CPHS service string table */ - TAPI_SIM_EF_CPHS_CALL_FORWARD_FLAGS = 0x6F13, /** < CPHS call forward flags */ - TAPI_SIM_EF_CPHS_OPERATOR_NAME_STRING = 0x6F14, /** < CPHS operator name string */ - TAPI_SIM_EF_CPHS_CUSTOMER_SERVICE_PROFILE = 0x6F15, /** < CPHS customer service profile */ - TAPI_SIM_EF_CPHS_CPHS_INFO = 0x6F16, /** < CPHS information */ - TAPI_SIM_EF_CPHS_MAILBOX_NUMBERS = 0x6F17, /** < CPHS mail box numbers */ - TAPI_SIM_EF_CPHS_OPERATOR_NAME_SHORT_FORM_STRING = 0x6F18, /** < CPHS operator name short form string */ - TAPI_SIM_EF_CPHS_INFORMATION_NUMBERS = 0x6F19, /** < CPHS information numbers */ - /* CPHS ALS FILE ID */ - TAPI_SIM_EF_CPHS_DYNAMICFLAGS = 0x6F9F, /** < CPHS Dynamics flags */ - TAPI_SIM_EF_CPHS_DYNAMIC2FLAG = 0x6F92, /** < CPHS Dynamics2 flags */ - TAPI_SIM_EF_CPHS_CUSTOMER_SERVICE_PROFILE_LINE2 = 0x6F98, /** < CPHS CSP2 */ - - /* Invalid File ID, All the file ID are less than this Value*/ - TAPI_SIM_EF_INVALID = 0xFFFF, /**< Invalid file.*/ - TAPI_SIM_EF_OTHERS, /**< Element to indicate an unknown file.*/ -}TelSimFileID_t; - -/** - * @enum TelSimFacilityStatus_t - * This enumeration defines the pin status. - */ -typedef enum { - TAPI_SIM_FACILITY_DISABLED = 0x00, - TAPI_SIM_FACILITY_ENABLED = 0x01, - TAPI_SIM_FACILITY_UNKNOWN = 0xFF -} TelSimFacilityStatus_t; - -/** - * @enum TelSimPinOperationResult_t - * This enumeration defines the pin operation result from the lower layers. - */ -typedef enum { - TAPI_SIM_PIN_OPERATION_SUCCESS, /**< Operation involving PIN (verification/change/enable/disable, etc) is successful. */ - TAPI_SIM_BUSY, /**< SIM is busy */ - TAPI_SIM_CARD_ERROR, /**< SIM card error - Permanently blocked and general errors */ - TAPI_SIM_INCOMPATIBLE_PIN_OPERATION, /**< SIM Incompatible pin operation that is in case when invalid SIM command is given or incorrect parameters are supplied to the SIM. */ - TAPI_SIM_PIN_INCORRECT_PASSWORD, /**< SIM PIN Incorrect password */ - TAPI_SIM_PUK_INCORRECT_PASSWORD, /**< SIM PUK Incorrect Password */ - TAPI_SIM_PUK_REQUIRED, /**< PUK Required */ - TAPI_SIM_PIN_REQUIRED, /**< PIN Required */ - TAPI_SIM_NCK_REQUIRED, /**< Network Control Key Required */ - TAPI_SIM_NSCK_REQUIRED, /**< Network Subset Control Key Required */ - TAPI_SIM_SPCK_REQUIRED, /**< Service Provider Control Key Required */ - TAPI_SIM_CCK_REQUIRED, /**< Corporate Control Key Required */ - TAPI_SIM_LOCK_REQUIRED, /**< PH-SIM (phone-SIM) locked state **/ -} TelSimPinOperationResult_t; - -/** - * @enum TelSimAccessResult_t - * This enumeration defines the SIM access result from the lower layers. - */ -typedef enum { - TAPI_SIM_ACCESS_SUCCESS, /**< Access to file successful. */ - TAPI_SIM_ACCESS_CARD_ERROR, /**< SIM card error */ - TAPI_SIM_ACCESS_FILE_NOT_FOUND, /**< File not found */ - TAPI_SIM_ACCESS_ACCESS_CONDITION_NOT_SATISFIED, /**< Access condition is not fulfilled */ - TAPI_SIM_ACCESS_FAILED, /**< Access failed. */ -} TelSimAccessResult_t; - -/** - * @enum TelSimPinType_t - * This enumeration defines the pin type. - */ -typedef enum { - TAPI_SIM_PTYPE_PIN1 = 0x00, /**< PIN 1 code */ - TAPI_SIM_PTYPE_PIN2 = 0x01, /**< PIN 2 code */ - TAPI_SIM_PTYPE_PUK1 = 0x02, /**< PUK 1 code */ - TAPI_SIM_PTYPE_PUK2 = 0x03, /**< PUK 2 code */ - TAPI_SIM_PTYPE_UPIN = 0x04, /**< Universal PIN - Unused now */ - TAPI_SIM_PTYPE_ADM = 0x05, /**< Administrator - Unused now */ - TAPI_SIM_PTYPE_SIM = 0x06 /**< SIM Lock code */ -} TelSimPinType_t; - -/** - * @enum TelSimTypeOfNum_t - * This enumeration defines the type of number. - */ -typedef enum { - TAPI_SIM_TON_UNKNOWN = 0, /**< unknown */ - TAPI_SIM_TON_INTERNATIONAL = 1, /**< international number */ - TAPI_SIM_TON_NATIONAL = 2, /**< national number */ - TAPI_SIM_TON_NETWORK_SPECIFIC = 3, /**< network specific number */ - TAPI_SIM_TON_DEDICATED_ACCESS = 4, /**< subscriber number */ - TAPI_SIM_TON_ALPHA_NUMERIC = 5, /**< alphanumeric, GSM 7-bit default alphabet) */ - TAPI_SIM_TON_ABBREVIATED_NUMBER = 6, /**< abbreviated number */ - TAPI_SIM_TON_RESERVED_FOR_EXT = 7 /**< reserved for extension */ -} TelSimTypeOfNum_t; - -/** - * @enum TelSimTextEncrypt_t - * This enumeration defines the text encryption types - */ -typedef enum { - TAPI_SIM_TEXT_ENC_ASCII, /**< ASCII Encoding */ - TAPI_SIM_TEXT_ENC_GSM7BIT, /**< GSM 7 Bit Encoding */ - TAPI_SIM_TEXT_ENC_UCS2, /**< UCS2 Encoding */ - TAPI_SIM_TEXT_ENC_HEX, /**< HEX Encoding */ -} TelSimTextEncrypt_t; - -/** - * @enum TelSimNumberingPlanIdentity_t - * This enumeration defines the numbering plan identifier. - */ -typedef enum { - TAPI_SIM_NPI_UNKNOWN = 0, /**< Unknown */ - TAPI_SIM_NPI_ISDN_TEL = 1, /**< ISDN/Telephone numbering plan */ - TAPI_SIM_NPI_DATA_NUMBERING_PLAN = 3, /**< Data numbering plan */ - TAPI_SIM_NPI_TELEX = 4, /**< Telex numbering plan */ - TAPI_SIM_NPI_SVC_CNTR_SPECIFIC_PLAN = 5, /**< Service Center Specific plan */ - TAPI_SIM_NPI_SVC_CNTR_SPECIFIC_PLAN2 = 6, /**< Service Center Specific plan */ - TAPI_SIM_NPI_NATIONAL = 8, /**< National numbering plan */ - TAPI_SIM_NPI_PRIVATE = 9, /**< Private numbering plan */ - TAPI_SIM_NPI_ERMES_NUMBERING_PLAN = 10, /**< ERMES numbering plan */ - TAPI_SIM_NPI_RESERVED_FOR_EXT = 0xF /**< Reserved for extension */ -} TelSimNumberingPlanIdentity_t; - -/** - * @enum TelSimEccEmergencyServiceInfo_t - * This enumeration defines the emergency service type. - */ -typedef enum { - TAPI_SIM_ECC_ESC_POLICE = 0x01, /**< Police */ - TAPI_SIM_ECC_ESC_AMBULANCE = 0x02, /**< Ambulance */ - TAPI_SIM_ECC_ESC_FIREBRIGADE = 0x04, /**< Fire brigade */ - TAPI_SIM_ECC_ESC_MARAINEGUARD = 0x08, /**< Marine guard */ - TAPI_SIM_ECC_ESC_MOUTAINRESCUE = 0x10, /**< Mountain rescue */ - TAPI_SIM_ECC_ESC_SPARE = 0x00 /**< Spare */ -} TelSimEccEmergencyServiceInfo_t; - -/** - * @enum TelSimLanguagePreferenceCode_t - * This enumeration defines the language indication code. - */ -typedef enum { - TAPI_SIM_LP_GERMAN = 0x00, /**< German */ - TAPI_SIM_LP_ENGLISH = 0x01, /**< English */ - TAPI_SIM_LP_ITALIAN = 0x02, /**< Italian */ - TAPI_SIM_LP_FRENCH = 0x03, /**< French */ - TAPI_SIM_LP_SPANISH = 0x04, /**< Spanish */ - TAPI_SIM_LP_DUTCH = 0x05, /**< Dutch */ - TAPI_SIM_LP_SWEDISH = 0x06, /**< Swedish */ - TAPI_SIM_LP_DANISH = 0x07, /**< Danish */ - TAPI_SIM_LP_PORTUGUESE = 0x08, /**< Portuguese */ - TAPI_SIM_LP_FINNISH = 0x09, /**< Finnish */ - TAPI_SIM_LP_NORWEGIAN = 0x0A, /**< Norwegian */ - TAPI_SIM_LP_GREEK = 0x0B, /**< Greek */ - TAPI_SIM_LP_TURKISH = 0x0C, /**< Turkish */ - TAPI_SIM_LP_HUNGARIAN = 0x0D, /**< Hungarian */ - TAPI_SIM_LP_POLISH = 0x0E, /**< Polish */ - TAPI_SIM_LP_KOREAN = 0x0F, /**< Korean */ - TAPI_SIM_LP_CHINESE = 0x10, /**< Chinese */ - TAPI_SIM_LP_RUSSIAN = 0x11, /**< Russian */ - TAPI_SIM_LP_JAPANESE = 0x12, /**< Japanese */ - TAPI_SIM_LP_LANG_UNSPECIFIED = 0xFF /**< Unspecified */ -} TelSimLanguagePreferenceCode_t; - -/** - * @enum TelSimCardStatus_t - * This enumeration defines the SIM card status - */ -typedef enum { - TAPI_SIM_STATUS_CARD_ERROR = 0x00, /**< Bad card / On the fly SIM gone bad **/ - TAPI_SIM_STATUS_CARD_NOT_PRESENT = 0x01, /**< Card not present **/ - TAPI_SIM_STATUS_SIM_INITIALIZING = 0x02, /**< SIM is Initializing state **/ - TAPI_SIM_STATUS_SIM_INIT_COMPLETED = 0x03, /**< SIM Initialization ok **/ - TAPI_SIM_STATUS_SIM_PIN_REQUIRED = 0x04, /**< PIN required state **/ - TAPI_SIM_STATUS_SIM_PUK_REQUIRED = 0x05, /**< PUK required state **/ - TAPI_SIM_STATUS_CARD_BLOCKED = 0x06, /**< PIN/PUK blocked(permanently blocked- All the attempts for PIN/PUK failed) **/ - TAPI_SIM_STATUS_SIM_NCK_REQUIRED = 0x07, /**< Network Control Key required state **/ - TAPI_SIM_STATUS_SIM_NSCK_REQUIRED = 0x08, /**< Network Subset Control Key required state **/ - TAPI_SIM_STATUS_SIM_SPCK_REQUIRED = 0x09, /**< Service Provider Control Key required state **/ - TAPI_SIM_STATUS_SIM_CCK_REQUIRED = 0x0a, /**< Corporate Control Key required state **/ - TAPI_SIM_STATUS_CARD_REMOVED = 0x0b, /**< Card removed **/ - TAPI_SIM_STATUS_SIM_LOCK_REQUIRED = 0x0c, /**< PH-SIM (phone-SIM) locked state **/ - TAPI_SIM_STATUS_UNKNOWN = 0xff /**< Unknown status. It can be initial status **/ -} TelSimCardStatus_t; - -/** - * @enum TelSimCphsPhaseType_t - * This enum gives the current CPHS phase of SIM card. - */ -typedef enum { - TAPI_SIM_CPHS_PHASE1 = 0x01, /**< phase1 */ - TAPI_SIM_CPHS_PHASE2 = 0x02, /**< phase2 */ - TAPI_SIM_CPHS_PHASE_RFU = 0xff /**< RFU */ -} TelSimCphsPhaseType_t; - -/** - * @enum TelSimCphsIndexLevelIndicator_t - * This struct gives CPHS index level indication. - */ -typedef enum { - TAPI_SIM_CPHS_INDEX_LEVEL_ONE = 0x01, /**< SIM cphs index level one */ - TAPI_SIM_CPHS_INDEX_LEVEL_TWO = 0x02, /**< SIM cphs index level two */ - TAPI_SIM_CPHS_INDEX_LEVEL_THREE = 0x03, /**< SIM cphs index level three */ - TAPI_SIM_CPHS_INDEX_LEVEL_RFU = 0xff /**< SIM cphs index level rfu */ -} TelSimCphsIndexLevelIndicator_t; - -/** - * @enum TelSimCphsCustomerServiceGroup_t - * This struct gives CPHS group service type information . - */ -typedef enum { - TAPI_SIM_CPHS_CSP_SERVICE_GROUP_CALL_OFFERING = 0x01, /**< Group csp offering*/ - TAPI_SIM_CPHS_CSP_SERVICE_GROUP_CALL_RESTRICTION = 0x02, /**< Group csp restriction*/ - TAPI_SIM_CPHS_CSP_SERVICE_GROUP_OTHER_SUPP_SERVICES = 0x03, /**< Group csp supplementary services*/ - TAPI_SIM_CPHS_CSP_SERVICE_GROUP_CALL_COMPLETION = 0x04, /**< Group csp completion*/ - TAPI_SIM_CPHS_CSP_SERVICE_GROUP_TELESERVICES = 0x05, /**< Group csp teleservices*/ - TAPI_SIM_CPHS_CSP_SERVICE_GROUP_CPHS_TELESERVICES = 0x06, /**< Group csp cphs teleservies*/ - TAPI_SIM_CPHS_CSP_SERVICE_GROUP_CPHS_FEATURES = 0x07, /**< Group csp cphs features*/ - TAPI_SIM_CPHS_CSP_SERVICE_GROUP_NUMBER_IDENTIFIERS = 0x08, /**< Group csp number identifiers*/ - TAPI_SIM_CPHS_CSP_SERVICE_GROUP_PHASE_SERVICES = 0x09, /**< Group csp phase services*/ - TAPI_SIM_CPHS_CSP_SERVICE_GROUP_VALUE_ADDED_SERVICES = 0xC0, /**< Group csp value added services*/ - TAPI_SIM_CPHS_CSP_SERVICE_GROUP_INFORMATION_NUMBERS = 0xD5 /**< Group csp information numbers*/ -} TelSimCphsCustomerServiceGroup_t; - -/** - * @enum TelSimMailboxType_t - * This enum gives mailbox type. - */ -typedef enum { - TAPI_SIM_MAILBOX_VOICE = 0x01, /**< CFIS voice*/ - TAPI_SIM_MAILBOX_FAX = 0x03, /**< CFIS fax*/ - TAPI_SIM_MAILBOX_DATA = 0x04, /**< CFIS data*/ - TAPI_SIM_MAILBOX_EMAIL = 0x05, /**< CFIS email*/ - TAPI_SIM_MAILBOX_OTHER = 0x06, /**< CFIS other*/ -} TelSimMailboxType_t; - -/** - * @enum TelSimDynamicFlagsSelectedLineId_t - * This enum gives dynamics flag selected line information. - */ -typedef enum { - TAPI_SIM_DYNAMIC_FLAGS_LINE1 = 0x01, /**< line 1 */ - TAPI_SIM_DYNAMIC_FLAGS_LINE2 = 0x00, /**< line 2*/ - TAPI_SIM_DYNAMIC_FLAGS_RFU = 0xff /**< rfu*/ -} TelSimDynamicFlagsSelectedLineId_t; - -/** - * @enum tapi_sim_dynamic2_flag_als_status_t - * This enum gives dynamics2 flag selected line information. - */ -typedef enum { - TAPI_SIM_PIN2_ACCESSIBLE_FLAGS_LOCKED = 0x01, /**< Dynamic flags locked */ - TAPI_SIM_PIN2_ACCESSIBLE_FLAGS_UNLOCKED = 0x00, /**< Dynamic flags unlocked */ - TAPI_SIM_PIN2_ACCESSIBLE_FLAGS_RFU = 0xff /**< rfu */ -} TelSimDynamic2FlagAlsStatus_t; - - -/** - * @enum TelSimAuthenticationType_t - * This is used for Authentication Procedure by using SIM. - */ -typedef enum { - TAPI_SIM_AUTH_TYPE_IMS = 0x00, /**< IMS Authentication */ - TAPI_SIM_AUTH_TYPE_GSM, /**< GSM Authentication */ - TAPI_SIM_AUTH_TYPE_3G, /**< 3G Authentication */ - TAPI_SIM_AUTH_TYPE_MAX /**< TBD */ -} TelSimAuthenticationType_t; - -/** - * @enum TelSimAuthenticationResult_t - * This is used for Authentication Procedure. - */ -typedef enum { - TAPI_SIM_AUTH_NO_ERROR = 0x00, /**< ISIM no error */ - TAPI_SIM_AUTH_CANNOT_PERFORM, /**< status - can't perform authentication */ - TAPI_SIM_AUTH_SKIP_RESPONSE, /**< status - skip authentication response */ - TAPI_SIM_AUTH_MAK_CODE_FAILURE, /**< status - MAK(Multiple Activation Key) code failure */ - TAPI_SIM_AUTH_SQN_FAILURE, /**< status - SQN(SeQuenceNumber) failure */ - TAPI_SIM_AUTH_SYNCH_FAILURE, /**< status - synch failure */ - TAPI_SIM_AUTH_UNSUPPORTED_CONTEXT, /**< status - unsupported context */ - TAPI_SIM_AUTH_MAX /**< TBD */ -} TelSimAuthenticationResult_t; - -/** - * @enum TelSimLockType_t - * This structure gives security lock type enum values - */ -typedef enum { - TAPI_SIM_LOCK_PS = 0x01, /** < 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 - */ - 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 - */ - 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, /** < Corporate Personalization */ -} TelSimLockType_t; - -/** - * @enum TelSimLockKey_t - * This structure gives security lock key information enum values - */ -typedef enum { - TAPI_SIM_LOCK_KEY_NOT_NEED = 0x00, /**< key not need */ - TAPI_SIM_LOCK_KEY_PIN = 0x01, /**< PIN required */ - TAPI_SIM_LOCK_KEY_PUK = 0x02, /**< PUK required */ - TAPI_SIM_LOCK_KEY_PIN2 = 0x03, /**< PIN2 required */ - TAPI_SIM_LOCK_KEY_PUK2 = 0x04, /**< PUK2 required */ - TAPI_SIM_LOCK_PERM_BLOCKED = 0x05, /**< Permanent block SIM */ -} TelSimLockStatus_t; - -/** - * @enum TelSimSapPowerMode_t - * This enum gives the SAP message Ids between SAP client and SAP server. - */ -typedef enum { - TAPI_SIM_SAP_POWER_SIM_ON_REQ, /**< SAP Client request about power SIM on in Server */ - TAPI_SIM_SAP_POWER_SIM_OFF_REQ, /**< SAP Client request about power SIM off in Server */ - TAPI_SIM_SAP_RESET_SIM_REQ, /**< SAP Client request about SIM reset in Server */ -} TelSimSapPowerMode_t; - -/** - * @enum TelSimSapConnectionStatus_t - * This enum gives the SAP connection status information . - */ -typedef enum { - TAPI_SIM_SAP_CONNECTION_STATUS_OK = 0x00, /**< connect successfully */ - TAPI_SIM_SAP_CONNECTION_STATUS_UNABLE_TO_ESTABLISH, /**< unable to establish connection */ - TAPI_SIM_SAP_CONNECTION_STATUS_NOT_SUPPORT_MAX_SIZE, /**< when server does not support message length that client want send */ - TAPI_SIM_SAP_CONNECTION_STATUS_TOO_SMALL_MAX_SIZE /**< when client want to connect with very small message length which is not supported by Server */ -} TelSimSapConnectionStatus_t; - -/** - * @enum TelSimSapDissconnectType_t - * This enum gives the SAP disconnect type information. - */ -typedef enum { - TAPI_SIM_SAP_DISCONNECT_TYPE_GRACEFUL = 0x00, /**< disconnection procedure ends after finishing current work */ - TAPI_SIM_SAP_DISCONNECT_TYPE_IMMEDIATE /**< disconnection procedure ends immediately*/ -} TelSimSapDissconnectType_t; - -/** - * @enum TelSimSapStatusInfo_t - * This enum gives the SAP current connection status information - */ -typedef enum { - TAPI_SIM_SAP_STATUS_UNKNOWN = 0x00, /**< SAP server connection status - unknown*/ - TAPI_SIM_SAP_STATUS_NO_SIM, /**< SAP server connection status - no SIM*/ - TAPI_SIM_SAP_STATUS_NOT_READY, /**< SAP server connection status - not ready*/ - TAPI_SIM_SAP_STATUS_READY, /**< SAP server connection status - ready*/ - TAPI_SIM_SAP_STATUS_CONNECTED /**< SAP server connection status - connected*/ -} TelSimSapStatusInfo_t; - -/** - * @enum TelSimSapCardStatus_t - * This enum gives the SIM card status if server`s status changed about connection with subscription module - */ -typedef enum { - TAPI_SIM_SAP_CARD_STATUS_UNKNOWN = 0x00, /**< SAP server status(card reader status) - unknown*/ - TAPI_SIM_SAP_CARD_STATUS_RESET, /**< SAP server status(card reader status) - reset*/ - TAPI_SIM_SAP_CARD_STATUS_NOT_ACCESSIBLE, /**< SAP server status(card reader status) - not accessible*/ - TAPI_SIM_SAP_CARD_STATUS_REMOVED, /**< SAP server status(card reader status) - removed*/ - TAPI_SIM_SAP_CARD_STATUS_INSERTED, /**< SAP server status(card reader status) - inserted*/ - TAPI_SIM_SAP_CARD_STATUS_RECOVERED /**< SAP server status(card reader status) - recovered*/ -} TelSimSapCardStatus_t; - -/** - * @enum TelSimSapResultCode_t - * This enum gives the SAP result information. - */ -typedef enum { - TAPI_SIM_SAP_RESULT_CODE_OK = 0x00, /**< SAP operation result - ok*/ - TAPI_SIM_SAP_RESULT_CODE_NO_REASON, /**< SAP operation result - no reason*/ - TAPI_SIM_SAP_RESULT_CODE_CARD_NOT_ACCESSIBLE, /**< SAP operation result - not accessible*/ - TAPI_SIM_SAP_RESULT_CODE_CARD_ALREADY_POWER_OFF, /**< SAP operation result - card already power off*/ - TAPI_SIM_SAP_RESULT_CODE_CARD_REMOVED, /**< SAP operation result - card removed*/ - TAPI_SIM_SAP_RESULT_CODE_CARD_ALREADY_POWER_ON, /**< SAP operation result - card already power on*/ - TAPI_SIM_SAP_RESULT_CODE_DATA_NOT_AVAILABLE, /**< SAP operation result - data not available*/ - TAPI_SIM_SAP_RESULT_CODE_NOT_SUPPORT /**< SAP operation result - not support*/ -} TelSimSapResultCode_t; - -/** - * @enum TelSimSapProtocol_t - * This enum gives SAP transport protocol type - */ -typedef enum { - TAPI_SIM_SAP_PROTOCOL_T0, /**< T = 0, character*/ - TAPI_SIM_SAP_PROTOCOL_T1 /**< T = 1, block*/ -} TelSimSapProtocol_t; - -/** - * @enum TelSimPbAccessResult_t - * This enumeration defines the Phone book access result - */ -typedef enum { - TAPI_SIM_PB_SUCCESS, /**< SIM phonebook operation successful. */ - TAPI_SIM_PB_FAIL, /**< SIM phonebook operation failure. */ - TAPI_SIM_PB_INVALID_INDEX, /**< The index passed was not a valid index. */ - TAPI_SIM_PB_INVALID_NUMBER_LENGTH, /**< The number length is exceeds the max length allowed (or 0). */ - TAPI_SIM_PB_INVALID_NAME_LENGTH, /**< The name length is exceeds the max length allowed (or 0). */ - TAPI_SIM_PB_ACCESS_CONDITION_NOT_SATISFIED, /**< Access condition for PB file is not satisfied. */ -} TelSimPbAccessResult_t; - -/** - * @enum TelSimPbFileType_t - * This enumeration defines different storage types to be selected in SIM or USIM - */ -typedef enum { - TAPI_SIM_PB_FDN, /**< Fixed Dialing Number */ - TAPI_SIM_PB_ADN, /**< SIM - ADN */ - TAPI_SIM_PB_SDN, /**< Service Dialing Number */ - TAPI_SIM_PB_3GSIM, /**< USIM - 3G phone book */ - TAPI_SIM_PB_AAS, /**< Additional number Alpha String */ - TAPI_SIM_PB_GAS, /**< Grouping identifier Alpha String */ - TAPI_SIM_PB_UNKNOWNN = 0xFF, /**< Unknown file type */ -} TelSimPbType_t; - -/** - * @enum TelSimPb3GFileType_t - * This enumeration defines the different storage field types in 3G Phone book. - */ -typedef enum { - /* for 3G phone storage field type */ - TAPI_PB_3G_NAME = 0x01, /**< Name */ - TAPI_PB_3G_NUMBER, /**< Number */ - TAPI_PB_3G_ANR1, /**< First Another number*/ - TAPI_PB_3G_ANR2, /**< Second Another number */ - TAPI_PB_3G_ANR3, /**< Third Another number */ - TAPI_PB_3G_EMAIL1, /**< First Email */ - TAPI_PB_3G_EMAIL2, /**< Second Email */ - TAPI_PB_3G_EMAIL3, /**< Third Email */ - TAPI_PB_3G_EMAIL4, /**< Fourth Email */ - TAPI_PB_3G_SNE, /**< Second name entry of main name*/ - TAPI_PB_3G_GRP, /**< Group */ - TAPI_PB_3G_PBC, /** <1 byte control info and 1 byte hidden info*/ -} TelSimPb3GFileType_t; - -/** - * This data structure defines the data for the Imsi information. - */ -typedef struct { - char szMcc[3 + 1]; /**< mobile country code */ - char szMnc[3 + 1]; /**< mobile network code */ - char szMsin[10 + 1]; /**< mobile station identification number */ -} TelSimImsiInfo_t; - -typedef struct { - char name[30+1]; - char number[6+1]; - TelSimEccEmergencyServiceInfo_t category; -}TelSimEcc_t; - -typedef struct { - int ecc_count; - TelSimEcc_t list[15]; -}TelSimEccList_t; - -typedef struct { - int icc_length; /**< Integrated Circuit Card number length */ - char icc_num[TAPI_SIM_ICCID_LEN_MAX]; /**< Integrated Circuit Card number */ -} TelSimIccIdInfo_t; - -typedef struct { - int b_cphs; - int rec_index; /**< index which stands for the location where record is saved in SIM*/ - int profile_num; /**< SIM profile index*/ - TelSimMailboxType_t mb_type; - int alpha_id_max_len; /**< alpha max length in SIM - READ ONLY*/ - char alpha_id[TAPI_SIM_XDN_ALPHA_ID_MAX_LEN + 1]; /**< Alpha Identifier */ - TelSimTypeOfNum_t ton; /**< Type Of Number */ - TelSimNumberingPlanIdentity_t npi; /**< Number Plan Identity */ - char num[TAPI_SIM_XDN_DIALING_NUMBER_LEN + 1]; /**< Dialing Number/SSC String */ - unsigned char cc_id; /**< Capability/Configuration Identifier */ - unsigned char ext1_id; /**< Extensiion1 Record Identifier */ -}TelSimMailBoxNumber_t; - -typedef struct { - int count; - TelSimMailBoxNumber_t list[TAPI_SIM_MSP_CNT_MAX*5]; //max is 10 -}TelSimMailboxList_t; - -typedef struct { - int rec_index; - unsigned char msp_num; /**< MSP number*/ - unsigned char cfu_status; /**< call forwarding unconditional indication status*/ - TelSimTypeOfNum_t ton; /**< TON*/ - TelSimNumberingPlanIdentity_t npi; /**< NPI*/ - char cfu_num[TAPI_SIM_XDN_DIALING_NUMBER_LEN + 1];/**< Dialing Number/SSC String*/ - unsigned char cc2_id; /**< Capability/Configuration2 Record Identifier */ - unsigned char ext7_id; /**< Extension 7 Record Identifier */ -}TelSimCfis_t; - -typedef struct { - int profile_count; - TelSimCfis_t cf[TAPI_SIM_MSP_CNT_MAX]; -}TelSimCfisList_t; - -typedef struct { - int b_line1; /**< CallForwardUnconditionalLine 1 */ - int b_line2; /**< CallForwardUnconditionalLine 2 */ - int b_fax; /**< CallForwardUnconditional FAX */ - int b_data; /** - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT 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 - -#ifdef __cplusplus -extern "C" -{ -#endif - -/* NetText */ -#define TAPI_SMS_ENCODED_SCA_LEN_MAX 12 /** Encoded SCA is 12 bytes long maximum */ -#define TAPI_SIM_SMSP_ADDRESS_LEN 20 /** EF-SMSP digit length */ -#define TAPI_SIM_SMSP_ALPHA_ID_LEN_MAX 128 /** EF-SMSP alpha id length */ - -#define TAPI_NETTEXT_MSG_SIZE_MAX 918 /** Maximum Message Size */ -#define TAPI_NETTEXT_CB_SIZE_MAX 93 /** Maximum CB Message Size */ -#define TAPI_NETTEXT_ETWS_SIZE_MAX 56 /** Maximum ETWS 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 9 /** CB maximum page size*/ -#define TAPI_NETTEXT_GSM_SMS_MSG_NUM_MAX 255 /** 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 164 /** Maximum SMS data size that can be stored*/ -#define TAPI_NETTEXT_MAX_SMS_SERVICE_CENTER_ADDR 12 /** Maximum SMS service center address*/ -#define TAPI_NETTEXT_MAX_INDEX 255 /** Maximum index value for SMS */ - -#define TAPI_NETTEXT_SMSP_PARAMS_MAX_LEN 28 - -// ************************ CDMA Features **************************// -#define TAPI_NETTEXT_PARAM_TELESERVICE_MASK 1 << 0 /**< Teleservice parameter bit position */ -#define TAPI_NETTEXT_PARAM_SERVICE_CATEGORY_MASK 1 << 1 /**< Service Category parameter bit position */ -#define TAPI_NETTEXT_PARAM_ADDRESS_MASK 1 << 2 /**< Address parameter bit position */ -#define TAPI_NETTEXT_PARAM_SUBADDRESS_MASK 1 << 3 /**< Subaddress parameter bit position */ -#define TAPI_NETTEXT_PARAM_BEARER_REPLY_MASK 1 << 4 /**< Bearer reply parameter bit position */ -#define TAPI_NETTEXT_PARAM_CAUSE_CODES_MASK 1 << 5 /**< Cause Code parameter bit position */ -#define TAPI_NETTEXT_PARAM_MESSAGE_ID_MASK 1 << 6 /**< Message ID parameter bit position */ -#define TAPI_NETTEXT_PARAM_USER_DATA_MASK 1 << 7 /**< User Data parameter bit position */ -#define TAPI_NETTEXT_PARAM_USER_RESPONSE_CODE_MASK 1 << 8 /**< User Response Code parameter bit position */ -#define TAPI_NETTEXT_PARAM_MC_TIME_STAMP_MASK 1 << 9 /**< Message Center Timestamp parameter bit position */ -#define TAPI_NETTEXT_PARAM_VALIDITY_PERIOD_ABS_MASK 1 << 10 /**< Valid period Absolute parameter bit position */ -#define TAPI_NETTEXT_PARAM_VALIDITY_PERIOD_REL_MASK 1 << 11 /**< Valid period Relative parameter bit position */ -#define TAPI_NETTEXT_PARAM_DEFERRED_DELIVERY_ABS_MASK 1 << 12 /**< Deferred delivery absolute parameter bit position */ -#define TAPI_NETTEXT_PARAM_DEFERRED_DELIVERY_REL_MASK 1 << 13 /**< Deferred delivery relative parameter bit position */ -#define TAPI_NETTEXT_PARAM_PRIORITY_MASK 1 << 14 /**< Priority parameter bit position */ -#define TAPI_NETTEXT_PARAM_PRIVACY_MASK 1 << 15 /**< Privacy parameter bit position */ -#define TAPI_NETTEXT_PARAM_REPLY_OPTION_MASK 1 << 16 /**< Reply Option parameter bit position */ -#define TAPI_NETTEXT_PARAM_NUMBER_OF_MESSAGE_MASK 1 << 17 /**< Number of message parameter bit position */ -#define TAPI_NETTEXT_PARAM_ALERT_ON_DELIVERY_MASK 1 << 18 /**< Alert on delivery parameter bit position */ -#define TAPI_NETTEXT_PARAM_LANGUAGE_MASK 1 << 19 /**< Language parameter bit position */ -#define TAPI_NETTEXT_PARAM_CALLBACK_MASK 1 << 20 /**< Callback Number parameter bit position */ -#define TAPI_NETTEXT_PARAM_DISPLAY_MODE_MASK 1 << 21 /**< Display mode parameter bit position */ -#define TAPI_NETTEXT_PARAM_MULTI_ENCODING_USER_DATA_MASK 1 << 22 /**< Multi Encoding user data parameter bit position */ - -#define TAPI_NETTEXT_MAXLENGTH_SMS_MT_USER_DATA 160 /**< Maximum MT user data size*/ -#define TAPI_NETTEXT_MAXLENGTH_SMS_MO_USER_DATA 160 /**< Maximum MO user data size*/ - -#define TAPI_NETTEXT_MAXLENGTH_SMS_ADDRESS 32 /**< MAX sms destination(or origination ) address /call back number */ - -#define TAPI_NETTEXT_ERR_CLASS0_STATUS_SEND_OK 0 /**< send success */ -#define TAPI_NETTEXT_ERR_CLASS23_ADDRESS_VACANT 0 /**< address vacant */ -#define TAPI_NETTEXT_ERR_CLASS23_ADDRESS_TRANSLATION_FAILURE 1 /**< address translation failure */ -#define TAPI_NETTEXT_ERR_CLASS23_NETWORK_RESOURCE_SHORTAGE 2 /**< network resource shortage */ -#define TAPI_NETTEXT_ERR_CLASS23_NETWORK_FAILURE 3 /**< network failure */ -#define TAPI_NETTEXT_ERR_CLASS23_INVALID_TELESERVICE_ID 4 /**< invalid teleservice id */ -#define TAPI_NETTEXT_ERR_CLASS23_OTHER_NETWORK_PROBLEM 5 /**< other network problem */ -#define TAPI_NETTEXT_ERR_CLASS23_OTHER_NETWORK_PROBLEM_MORE_FIRST 6 /**< other network problem more first */ -#define TAPI_NETTEXT_ERR_CLASS23_OTHER_NETWORK_PROBLEM_MORE_LAST 31 /**< other network problem more last */ -#define TAPI_NETTEXT_ERR_CLASS23_NO_PAGE_RESPONSE 32 /**< no page response */ -#define TAPI_NETTEXT_ERR_CLASS23_DESTINATION_BUSY 33 /**< destination busy */ -#define TAPI_NETTEXT_ERR_CLASS23_NO_ACK 34 /**< no ack */ -#define TAPI_NETTEXT_ERR_CLASS23_DESTINATION_RESOURCE_SHORTAGE 35 /**< destination resource shortage */ -#define TAPI_NETTEXT_ERR_CLASS23_SMS_DELIVERY_POSTPONED 36 /**< sms delivery postponed */ -#define TAPI_NETTEXT_ERR_CLASS23_DESTINATION_OUT_OF_SERVICE 37 /**< destination out of service */ -#define TAPI_NETTEXT_ERR_CLASS23_DESTINATION_NO_LONGER_AT_THIS_ADDRESS 38 /**< destination no longer at this address */ -#define TAPI_NETTEXT_ERR_CLASS23_OTHER_TERMINAL_PROBLEM 39 /**< other terminal problem */ -#define TAPI_NETTEXT_ERR_CLASS23_OTHER_TERMINAL_PROBLEM_MORE_FIRST 40 /**< other terminal problem more first */ -#define TAPI_NETTEXT_ERR_CLASS23_OTHER_TERMINAL_PROBLEM_MORE_LAST 47 /**< other terminal problem more last */ -#define TAPI_NETTEXT_ERR_CLASS23_SMS_DELIVERY_POSTPONED_MORE_FIRST 48 /**< sms delivery postpone more first */ -#define TAPI_NETTEXT_ERR_CLASS23_SMS_DELIVERY_POSTPONED_MORE_LAST 63 /**< sms delivery postpone more last */ -#define TAPI_NETTEXT_ERR_CLASS23_RADIO_IF_RESOURCE_SHORTAGE 64 /**< radio interface resource shortage */ -#define TAPI_NETTEXT_ERR_CLASS23_RADIO_IF_INCOMPATIBLE 65 /**< radio interface incompatible */ -#define TAPI_NETTEXT_ERR_CLASS23_OTHER_RADIO_IF_PROBLEM 66 /**< other radio interface problem */ -#define TAPI_NETTEXT_ERR_CLASS23_OTHER_RADIO_IF_PROBLEM_MORE_FIRST 67 /**< other radio interface problem more first */ -#define TAPI_NETTEXT_ERR_CLASS23_OTHER_RADIO_IF_PROBLEM_MORE_LAST 95 /**< other radio interface problem more last */ -#define TAPI_NETTEXT_ERR_CLASS23_UNEXPECTED_PARM_SIZE 96 /**< unexpected parameter size */ -#define TAPI_NETTEXT_ERR_CLASS23_SMS_ORIGINATION_DENIED 97 /**< sms origination denied */ -#define TAPI_NETTEXT_ERR_CLASS23_SMS_TERMINATION_DENIED 98 /**< sms termination denied */ -#define TAPI_NETTEXT_ERR_CLASS23_SUPPL_SERVICE_NOT_SUPPORTED 99 /**< supplementary service not supported */ -#define TAPI_NETTEXT_ERR_CLASS23_SMS_NOT_SUPPORTED 100 /**< sms not supported */ -#define TAPI_NETTEXT_ERR_CLASS23_RESERVED_101 101 /**< reserved 101 */ -#define TAPI_NETTEXT_ERR_CLASS23_MISSING_EXPECTED_PARM 102 /**< missing expected parameter */ -#define TAPI_NETTEXT_ERR_CLASS23_MISSING_MANDATORY_PARM 103 /**< missing mandatory parameter value */ -#define TAPI_NETTEXT_ERR_CLASS23_UNRECOGNIZED_PARM_VALUE 104 /**< unrecognized parameter value */ -#define TAPI_NETTEXT_ERR_CLASS23_UNEXPECTED_PARM_VALUE 105 /**< unexpected parameter value */ -#define TAPI_NETTEXT_ERR_CLASS23_USER_DATA_SIZE_ERROR 106 /**< user data size error */ -#define TAPI_NETTEXT_ERR_CLASS23_OTHER_GENERAL_PROBLEMS 107 /**< other general problem */ -#define TAPI_NETTEXT_ERR_CLASS23_OTHER_GENERAL_PROBLEMS_MORE_FIRST 108 /**< other general problem first */ -#define TAPI_NETTEXT_ERR_CLASS23_OTHER_GENERAL_PROBLEMS_MORE_LAST 255 /**< other general problem last */ - -#define TAPI_NETTEXT_ERR_CLASS4_WAITING_FOR_TL_ACK 1 /**< waiting for transport ack */ -#define TAPI_NETTEXT_ERR_CLASS4_OUT_OF_RESOURCES 2 /**< out of resource */ -#define TAPI_NETTEXT_ERR_CLASS4_ACCESS_TOO_LARGE 3 /**< access to large */ -#define TAPI_NETTEXT_ERR_CLASS4_DTC_TOO_LARGE 4 /**< DTC too large */ -#define TAPI_NETTEXT_ERR_CLASS4_DTC_CONNECTED 5 /**< DTC connected */ -#define TAPI_NETTEXT_ERR_CLASS4_NETWORK_NOT_READY 6 /**< network not ready */ -#define TAPI_NETTEXT_ERR_CLASS4_NO_SVC 7 /**< no service */ -#define TAPI_NETTEXT_ERR_CLASS4_PHONE_NOT_READY 8 /**< phone not ready */ -#define TAPI_NETTEXT_ERR_CLASS4_NOT_ALLOWED_IN_AMPS 9 /**< fail to allowed in amps */ -#define TAPI_NETTEXT_ERR_CLASS4_CANNOT_SEND_BROADCAST 10 /**< fail to send broadcast */ -#define TAPI_NETTEXT_ERR_CLASS4_INVALID_TRANSACTION_ID -// ********************************************************************// - -/** - * @enum TelSmsMsgStatus_t - * This enumeration defines the network text status type. - */ -typedef enum -{ - TAPI_NETTEXT_STATUS_READ, /**< MT message, stored and read */ - TAPI_NETTEXT_STATUS_UNREAD, /**< MT message, stored and unread */ - TAPI_NETTEXT_STATUS_SENT, /**< MO message, stored and sent */ - TAPI_NETTEXT_STATUS_UNSENT, /**< MO message, stored but not sent */ - TAPI_NETTEXT_STATUS_DELIVERED, /**< delivered destination */ - TAPI_NETTEXT_STATUS_DELIVERY_UNCONFIRMED, /**< Service centre forwarded message but is unable to confirm delivery*/ - TAPI_NETTEXT_STATUS_MESSAGE_REPLACED, /**< Message has been replaced*/ - TAPI_NETTEXT_STATUS_RESERVED /**< Reserved for future use*/ -} TelSmsMsgStatus_t; - -/** - * @enum TelSmsMemStatusType - * This enumeration defines the memory status type. - */ -typedef enum -{ - TAPI_NETTEXT_PDA_MEMORY_STATUS_AVAILABLE = 0x01, /**< PDA Memory Available */ - TAPI_NETTEXT_PDA_MEMORY_STATUS_FULL = 0x02, /**< PDAMemory is Full */ - TAPI_NETTEXT_PHONE_MEMORY_STATUS_AVAILABLE = 0x03, /**< Phone memory Available */ - TAPI_NETTEXT_PHONE_MEMORY_STATUS_FULL = 0x04, /**< phone memory is full */ -}TelSmsMemStatusType; - -/** - * @enum TelSmsBearerType_t - * This enum defines the different bearer types - */ -typedef enum -{ - TAPI_NETTEXT_BEARER_PS_ONLY = 0x01, /**< Send SMS only on PS Bearer */ - TAPI_NETTEXT_BEARER_CS_ONLY, /**< Send SMS only on CS Bearer */ - TAPI_NETTEXT_BEARER_PS_PREFERRED, /** - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT 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 SS_TAPI SS(Supplementary services) - * @{ - * - * @file TelSs.h - - @brief This file serves as a "C" header file and defines structures for Tapi Supplementary Services\n - It contains a sample set of constants, enums, structs that would be required by applications. - */ - -#ifndef _TEL_SS_H_ -#define _TEL_SS_H_ - -#include -#include - -#ifdef __cplusplus -extern "C" -{ -#endif - -/** maximum length of barring password */ -#define TAPI_SS_GSM_BARR_PW_LEN_MAX 4 /** - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT 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_COMMON_H_ -#define _TAPI_COMMON_H_ - -#include -#include - -#include -#include - -__BEGIN_DECLS - - -char** tel_get_cp_name_list(void); - -TapiHandle* tel_init(const char *cp_name); -int tel_deinit(TapiHandle *handle); - -int tel_register_noti_event(TapiHandle *handle, const char *noti_id, - tapi_notification_cb callback, void *user_data); -int tel_deregister_noti_event(TapiHandle *handle, const char *noti_id); - -int tel_get_property_int(TapiHandle *h, const char *property, int *result); - -__END_DECLS - -#endif /* _TAPI_COMMON_H_ */ - -/** - * @} - */ diff --git a/mobile/include/tapi_event.h b/mobile/include/tapi_event.h deleted file mode 100644 index 5510fb3..0000000 --- a/mobile/include/tapi_event.h +++ /dev/null @@ -1,143 +0,0 @@ -/* - * libslp-tapi - * - * Copyright (c) 2012 Samsung Electronics Co., Ltd. All rights reserved. - * - * Contact: Ja-young Gu - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT 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_EVENT_H__ -#define __TAPI_EVENT_H__ - -#include - -__BEGIN_DECLS - -#define DBUS_TELEPHONY_CALL_INTERFACE DBUS_TELEPHONY_SERVICE".Call" - -#define TAPI_NOTI_VOICE_CALL_STATUS_IDLE DBUS_TELEPHONY_CALL_INTERFACE":VoiceCallStatusIdle" -#define TAPI_NOTI_VOICE_CALL_STATUS_ACTIVE DBUS_TELEPHONY_CALL_INTERFACE":VoiceCallStatusActive" -#define TAPI_NOTI_VOICE_CALL_STATUS_HELD DBUS_TELEPHONY_CALL_INTERFACE":VoiceCallStatusHeld" -#define TAPI_NOTI_VOICE_CALL_STATUS_DIALING DBUS_TELEPHONY_CALL_INTERFACE":VoiceCallStatusDialing" -#define TAPI_NOTI_VOICE_CALL_STATUS_ALERT DBUS_TELEPHONY_CALL_INTERFACE":VoiceCallStatusAlert" -#define TAPI_NOTI_VOICE_CALL_STATUS_INCOMING DBUS_TELEPHONY_CALL_INTERFACE":VoiceCallStatusIncoming" -#define TAPI_NOTI_VOICE_CALL_STATUS_WAITING DBUS_TELEPHONY_CALL_INTERFACE":VoiceCallStatusWaiting" - -#define TAPI_NOTI_VIDEO_CALL_STATUS_IDLE DBUS_TELEPHONY_CALL_INTERFACE":VideoCallStatusIdle" -#define TAPI_NOTI_VIDEO_CALL_STATUS_ACTIVE DBUS_TELEPHONY_CALL_INTERFACE":VideoCallStatusActive" -#define TAPI_NOTI_VIDEO_CALL_STATUS_DIALING DBUS_TELEPHONY_CALL_INTERFACE":VideoCallStatusDialing" -#define TAPI_NOTI_VIDEO_CALL_STATUS_ALERT DBUS_TELEPHONY_CALL_INTERFACE":VideoCallStatusAlert" -#define TAPI_NOTI_VIDEO_CALL_STATUS_INCOMING DBUS_TELEPHONY_CALL_INTERFACE":VideoCallStatusIncoming" - -#define TAPI_NOTI_CALL_INFO_CALL_CONNECTED_LINE DBUS_TELEPHONY_CALL_INTERFACE":CallConnectedLine" -#define TAPI_NOTI_CALL_INFO_WAITING DBUS_TELEPHONY_CALL_INTERFACE":Waiting" -#define TAPI_NOTI_CALL_INFO_CUG DBUS_TELEPHONY_CALL_INTERFACE":Cug" -#define TAPI_NOTI_CALL_INFO_FORWARDED DBUS_TELEPHONY_CALL_INTERFACE":Forwarded" -#define TAPI_NOTI_CALL_INFO_BARRED_INCOMING DBUS_TELEPHONY_CALL_INTERFACE":BarredIncoming" -#define TAPI_NOTI_CALL_INFO_BARRED_OUTGOING DBUS_TELEPHONY_CALL_INTERFACE":BarredOutgoing" -#define TAPI_NOTI_CALL_INFO_DEFLECTED DBUS_TELEPHONY_CALL_INTERFACE":Deflected" -#define TAPI_NOTI_CALL_INFO_CLIR_SUPPRESSION_REJECT DBUS_TELEPHONY_CALL_INTERFACE":ClirSuppressionReject" -#define TAPI_NOTI_CALL_INFO_FORWARD_UNCONDITIONAL DBUS_TELEPHONY_CALL_INTERFACE":ForwardUnconditional" -#define TAPI_NOTI_CALL_INFO_FORWARD_CONDITIONAL DBUS_TELEPHONY_CALL_INTERFACE":ForwardConditional" -#define TAPI_NOTI_CALL_INFO_CALL_LINE_IDENTITY DBUS_TELEPHONY_CALL_INTERFACE":CallLineIdentity" -#define TAPI_NOTI_CALL_INFO_CALL_NAME_INFORMATION DBUS_TELEPHONY_CALL_INTERFACE":CallNameInformation" -#define TAPI_NOTI_CALL_INFO_FORWARDED_CALL DBUS_TELEPHONY_CALL_INTERFACE":ForwardedCall" -#define TAPI_NOTI_CALL_INFO_CUG_CALL DBUS_TELEPHONY_CALL_INTERFACE":CugCall" -#define TAPI_NOTI_CALL_INFO_DEFLECTED_CALL DBUS_TELEPHONY_CALL_INTERFACE":DeflectedCall" -#define TAPI_NOTI_CALL_INFO_TRANSFERED_CALL DBUS_TELEPHONY_CALL_INTERFACE":TransferedCall" -#define TAPI_NOTI_CALL_INFO_HELD DBUS_TELEPHONY_CALL_INTERFACE":CallHeld" -#define TAPI_NOTI_CALL_INFO_ACTIVE DBUS_TELEPHONY_CALL_INTERFACE":CallActive" -#define TAPI_NOTI_CALL_INFO_JOINED DBUS_TELEPHONY_CALL_INTERFACE":CallJoined" -#define TAPI_NOTI_CALL_INFO_RELEASED_ON_HOLD DBUS_TELEPHONY_CALL_INTERFACE":ReleaseOnHold" -#define TAPI_NOTI_CALL_INFO_TRANSFER_ALERT DBUS_TELEPHONY_CALL_INTERFACE":TransferAlert" -#define TAPI_NOTI_CALL_INFO_TRANSFERED DBUS_TELEPHONY_CALL_INTERFACE":Transfered" -#define TAPI_NOTI_CALL_INFO_CF_CHECK_MESSAGE DBUS_TELEPHONY_CALL_INTERFACE":CfCheckMessage" - -#define TAPI_NOTI_CALL_SOUND_PATH DBUS_TELEPHONY_CALL_INTERFACE":CallSoundPath" -#define TAPI_NOTI_CALL_SOUND_RINGBACK_TONE DBUS_TELEPHONY_CALL_INTERFACE":CallSoundRingbackToneControl" -#define TAPI_NOTI_CALL_SOUND_WBAMR DBUS_TELEPHONY_CALL_INTERFACE":CallSoundWbamr" -#define TAPI_NOTI_CALL_SOUND_EQUALIZATION DBUS_TELEPHONY_CALL_INTERFACE":CallSoundEqualiztion" -#define TAPI_NOTI_CALL_SOUND_NOISE_REDUCTION DBUS_TELEPHONY_CALL_INTERFACE":CallSoundNoiseReduction" -#define TAPI_NOTI_CALL_SOUND_CLOCK_STATUS DBUS_TELEPHONY_CALL_INTERFACE":CallSoundClockStatus" - - -#define DBUS_TELEPHONY_MODEM_INTERFACE DBUS_TELEPHONY_SERVICE".Modem" -#define TAPI_NOTI_MODEM_POWER DBUS_TELEPHONY_MODEM_INTERFACE":Power" -#define TAPI_NOTI_MODEM_DUN_PIN_CTRL DBUS_TELEPHONY_MODEM_INTERFACE":DunPinCtrl" -#define TAPI_NOTI_MODEM_DUN_EXTERNAL_CALL DBUS_TELEPHONY_MODEM_INTERFACE":DunExternalCall" -#define TAPI_PROP_MODEM_POWER DBUS_TELEPHONY_MODEM_INTERFACE":power" - -#define DBUS_TELEPHONY_SIM_INTERFACE DBUS_TELEPHONY_SERVICE".Sim" -#define TAPI_NOTI_SIM_STATUS DBUS_TELEPHONY_SIM_INTERFACE":Status" - -#define DBUS_TELEPHONY_SAP_INTERFACE DBUS_TELEPHONY_SERVICE".Sap" -#define TAPI_NOTI_SAP_STATUS DBUS_TELEPHONY_SAP_INTERFACE":Status" -#define TAPI_NOTI_SAP_DISCONNECT DBUS_TELEPHONY_SAP_INTERFACE":Disconnect" - -#define DBUS_TELEPHONY_SAT_INTERFACE DBUS_TELEPHONY_SERVICE".SAT" -#define TAPI_NOTI_SAT_SETUP_MENU DBUS_TELEPHONY_SAT_INTERFACE":SetupMenu" -#define TAPI_NOTI_SAT_DISPLAY_TEXT DBUS_TELEPHONY_SAT_INTERFACE":DisplayText" -#define TAPI_NOTI_SAT_SELECT_ITEM DBUS_TELEPHONY_SAT_INTERFACE":SelectItem" -#define TAPI_NOTI_SAT_GET_INKEY DBUS_TELEPHONY_SAT_INTERFACE":GetInkey" -#define TAPI_NOTI_SAT_GET_INPUT DBUS_TELEPHONY_SAT_INTERFACE":GetInput" -#define TAPI_NOTI_SAT_REFRESH DBUS_TELEPHONY_SAT_INTERFACE":Refresh" -#define TAPI_NOTI_SAT_SEND_SMS DBUS_TELEPHONY_SAT_INTERFACE":SendSMS" -#define TAPI_NOTI_SAT_SETUP_EVENT_LIST DBUS_TELEPHONY_SAT_INTERFACE":SetupEventList" -#define TAPI_NOTI_SAT_SEND_DTMF DBUS_TELEPHONY_SAT_INTERFACE":SendDtmf" -#define TAPI_NOTI_SAT_SESSION_END_EVENT DBUS_TELEPHONY_SAT_INTERFACE":EndProactiveSession" -#define TAPI_NOTI_SAT_MO_SMS_CTRL DBUS_TELEPHONY_SAT_INTERFACE":MoSmsCtrl" - -#define DBUS_TELEPHONY_PB_INTERFACE DBUS_TELEPHONY_SERVICE".Phonebook" -#define TAPI_NOTI_PB_STATUS DBUS_TELEPHONY_PB_INTERFACE":Status" - -// Network -#define DBUS_TELEPHONY_NETWORK_INTERFACE DBUS_TELEPHONY_SERVICE".Network" -#define TAPI_NOTI_NETWORK_REGISTRATION_STATUS DBUS_TELEPHONY_NETWORK_INTERFACE":RegistrationStatus" -#define TAPI_NOTI_NETWORK_CELLINFO DBUS_TELEPHONY_NETWORK_INTERFACE":CellInfo" -#define TAPI_NOTI_NETWORK_INFO DBUS_TELEPHONY_NETWORK_INTERFACE":Info" -#define TAPI_NOTI_NETWORK_CHANGE DBUS_TELEPHONY_NETWORK_INTERFACE":Change" -#define TAPI_NOTI_NETWORK_TIMEINFO DBUS_TELEPHONY_NETWORK_INTERFACE":TimeInfo" -#define TAPI_NOTI_NETWORK_IDENTITY DBUS_TELEPHONY_NETWORK_INTERFACE":Identity" - -// SS -#define DBUS_TELEPHONY_SS_INTERFACE DBUS_TELEPHONY_SERVICE".Ss" -#define TAPI_NOTI_SS_USSD DBUS_TELEPHONY_SS_INTERFACE":NotifyUSSD" -#define TAPI_NOTI_SS_RELEASE_COMPLETE DBUS_TELEPHONY_SS_INTERFACE":ReleaseComplete" - -// PS -#define TAPI_NOTI_PS_DUN_PIN_CONTROL "org.tizen.telephony.Ps.PinCtrl" - -// SMS -#define DBUS_TELEPHONY_SMS_INTERFACE DBUS_TELEPHONY_SERVICE".sms" -#define TAPI_NOTI_SMS_INCOM_MSG DBUS_TELEPHONY_SMS_INTERFACE":IncommingMsg" /* This is an unsolicited Incoming SMS Event*/ -#define TAPI_NOTI_SMS_CB_INCOM_MSG DBUS_TELEPHONY_SMS_INTERFACE":IncommingCbMsg" /* This is an unsolicited Incoming cell broadcast message*/ -#define TAPI_NOTI_SMS_ETWS_INCOM_MSG DBUS_TELEPHONY_SMS_INTERFACE":IncommingEtwsMsg" /* This is an unsolicited Incoming cell broadcast message*/ -#if 0 -#define TAPI_NOTI_SMS_INCOM_EX_MSG "org.tizen.telephony. " /* This is an extended unsolicited Incoming SMS Event*/ -#define TAPI_NOTI_SMS_CB_INCOM_EX_MSG "org.tizen.telephony. " /* This is an extended unsolicited Incoming cell broadcast message*/ -#endif -#define TAPI_NOTI_SMS_MEMORY_STATUS DBUS_TELEPHONY_SMS_INTERFACE":MemoryStatus" /* This event is an unsolicited event indicating SIM memory status */ -#define TAPI_NOTI_SMS_DEVICE_READY DBUS_TELEPHONY_SMS_INTERFACE":SmsReady" /* Device Ready indication */ - -// Gps -#define DBUS_TELEPHONY_GPS_INTERFACE DBUS_TELEPHONY_SERVICE".Gps" -#define TAPI_NOTI_GPS_ASSIST_DATA DBUS_TELEPHONY_GPS_INTERFACE":AssistData" -#define TAPI_IND_GPS_MEASURE_POSITION DBUS_TELEPHONY_GPS_INTERFACE":MeasurePosition" -#define TAPI_NOTI_GPS_RESET_ASSIST_DATA DBUS_TELEPHONY_GPS_INTERFACE":ResetAssistData" -#define TAPI_NOTI_GPS_FREQUENCY_AIDING DBUS_TELEPHONY_GPS_INTERFACE":FrequencyAiding" - -__END_DECLS - -#endif /* __TAPI_EVENT_H__ */ diff --git a/mobile/include/tapi_sat.h b/mobile/include/tapi_sat.h deleted file mode 100644 index a34832c..0000000 --- a/mobile/include/tapi_sat.h +++ /dev/null @@ -1,38 +0,0 @@ -/* - * libslp-tapi - * - * Copyright (c) 2012 Samsung Electronics Co., Ltd. All rights reserved. - * - * Contact: Ja-young Gu - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT 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_SAT_H_ -#define _TAPI_SAT_H_ - -#include - -__BEGIN_DECLS - -int tapi_get_sat_main_menu_info(TapiHandle *handle, TelSatSetupMenuInfo_t* pMainMenu); -int tapi_send_ui_display_status(TapiHandle *handle, int command_id, TelSatUiDisplayStatusType_t status); -int tapi_send_sat_ui_user_confirm(TapiHandle *handle, TelSatUiUserConfirmInfo_t * pUserConfirmData); -int tapi_send_sat_app_exec_result(TapiHandle handle, TelSatAppsRetInfo_t* pAppRetInfo); - -int tapi_sat_req_menu_selection(TapiHandle *handle, const TelSatMenuSelectionReqInfo_t *menu_select_data, tapi_response_cb callback, void *user_data); -int tapi_download_sat_event(TapiHandle *handle, const TelSatEventDownloadReqInfo_t *event_data, tapi_response_cb callback, void *user_data); - -__END_DECLS - -#endif /* _TAPI_SAT_H_ */ diff --git a/mobile/include/tapi_type.h b/mobile/include/tapi_type.h deleted file mode 100644 index 866c6b4..0000000 --- a/mobile/include/tapi_type.h +++ /dev/null @@ -1,36 +0,0 @@ -/* - * libslp-tapi - * - * Copyright (c) 2012 Samsung Electronics Co., Ltd. All rights reserved. - * - * Contact: Ja-young Gu - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT 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_TYPE_H__ -#define __TAPI_TYPE_H__ - -__BEGIN_DECLS - -#define DBUS_TELEPHONY_SERVICE "org.tizen.telephony" -#define DBUS_TELEPHONY_DEFAULT_PATH "/org/tizen/telephony" - -typedef struct tapi_handle TapiHandle; - -typedef void (*tapi_notification_cb)(TapiHandle *handle, const char *noti_id, void *data, void *user_data); -typedef void (*tapi_response_cb)(TapiHandle *handle, int result, void *data, void *user_data); - -__END_DECLS - -#endif /* __TAPI_TYPE_H__ */ diff --git a/mobile/libslp-tapi.manifest b/mobile/libslp-tapi.manifest deleted file mode 100644 index 573257c..0000000 --- a/mobile/libslp-tapi.manifest +++ /dev/null @@ -1,5 +0,0 @@ - - - - - diff --git a/mobile/src/common.h b/mobile/src/common.h deleted file mode 100644 index 61bb97c..0000000 --- a/mobile/src/common.h +++ /dev/null @@ -1,77 +0,0 @@ -/* - * libslp-tapi - * - * Copyright (c) 2012 Samsung Electronics Co., Ltd. All rights reserved. - * - * Contact: Ja-young Gu - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT 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 _COMMON_H_ -#define _COMMON_H_ - -#include -#include -#include -#include - -__BEGIN_DECLS - -#define MAKE_RESP_CB_DATA(data,handle,cb,user_data) \ - if (!handle) { return TAPI_API_INVALID_INPUT; } \ - data = g_new0(struct tapi_resp_data, 1); \ - data->handle = handle; \ - data->cb_fn = cb; \ - data->user_data = user_data - -#define CHECK_DEINIT(error) \ - if (error) { \ - dbg("dbus error = %d (%s)", error->code, error->message); \ - if (error->code == G_IO_ERROR_CANCELLED \ - && error->domain == G_IO_ERROR) { \ - g_error_free(error); \ - free(evt_cb_data); \ - return; \ - } \ - } - -struct tapi_handle { - gpointer dbus_connection; - char *path; - char *cp_name; - GHashTable *evt_list; - char cookie[20]; - GCancellable *ca; -}; - -struct tapi_resp_data { - tapi_response_cb cb_fn; - void* user_data; - struct tapi_handle *handle; -}; - -struct tapi_evt_cb { - int evt_id; - tapi_notification_cb cb_fn; - void* user_data; - struct tapi_handle *handle; -}; - -__END_DECLS - -#endif /* _TAPI_COMMON_H_ */ - -/** - * @} - */ diff --git a/mobile/src/tapi_call.c b/mobile/src/tapi_call.c deleted file mode 100644 index d4ba04a..0000000 --- a/mobile/src/tapi_call.c +++ /dev/null @@ -1,1033 +0,0 @@ -/* - * libslp-tapi - * - * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. - * - * Contact: Ja-young Gu - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT 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 "TelCall.h" -#include "tapi_common.h" -#include "TapiUtility.h" - -#include "common.h" -#include "tapi_log.h" -#include "ITapiCall.h" - -static void on_response_call_dial(GObject *source_object, GAsyncResult *res, gpointer user_data) -{ - GError *error = 0; - GDBusConnection *conn = 0; - struct tapi_resp_data *evt_cb_data = user_data; - int result = -1; - - GVariant *dbus_result; - - dbg("Func Entrance"); - - conn = G_DBUS_CONNECTION (source_object); - dbus_result = g_dbus_connection_call_finish(conn, res, &error); - - g_variant_get (dbus_result, "(i)", &result); - if (result != TAPI_CAUSE_SUCCESS) - dbg("Modem dialing failed"); - - if (evt_cb_data->cb_fn) { - evt_cb_data->cb_fn(evt_cb_data->handle, result, 0, evt_cb_data->user_data); - } - dbg("Exit"); -} - -static void on_response_call_answer(GObject *source_object, GAsyncResult *res, gpointer user_data) -{ - GError *error = 0; - GDBusConnection *conn = 0; - struct tapi_resp_data *evt_cb_data = user_data; - int result = -1; - TelCallAnswerCnf_t data; - - GVariant *dbus_result; - - conn = G_DBUS_CONNECTION (source_object); - dbus_result = g_dbus_connection_call_finish(conn, res, &error); - - g_variant_get (dbus_result, "(ii)", &result, &data.id); - - if (evt_cb_data->cb_fn) { - evt_cb_data->cb_fn(evt_cb_data->handle, result, &data, evt_cb_data->user_data); - } -} - -static void on_response_call_end(GObject *source_object, GAsyncResult *res, gpointer user_data) -{ - GError *error = 0; - GDBusConnection *conn = 0; - struct tapi_resp_data *evt_cb_data = user_data; - int result = -1; - TelCallEndCnf_t data; - - GVariant *dbus_result; - - conn = G_DBUS_CONNECTION (source_object); - dbus_result = g_dbus_connection_call_finish(conn, res, &error); - - g_variant_get (dbus_result, "(iii)", &result, &data.id, &data.type); - - if (evt_cb_data->cb_fn) { - evt_cb_data->cb_fn(evt_cb_data->handle, result, &data, evt_cb_data->user_data); - } -} - -static void on_response_call_hold(GObject *source_object, GAsyncResult *res, gpointer user_data) -{ - GError *error = 0; - GDBusConnection *conn = 0; - struct tapi_resp_data *evt_cb_data = user_data; - int result = -1; - TelCallHoldCnf_t data; - - GVariant *dbus_result; - - conn = G_DBUS_CONNECTION (source_object); - dbus_result = g_dbus_connection_call_finish(conn, res, &error); - - g_variant_get (dbus_result, "(ii)", &result, &data.id); - - if (evt_cb_data->cb_fn) { - evt_cb_data->cb_fn(evt_cb_data->handle, result, &data, evt_cb_data->user_data); - } - -} - -static void on_response_call_active(GObject *source_object, GAsyncResult *res, gpointer user_data) -{ - GError *error = 0; - GDBusConnection *conn = 0; - struct tapi_resp_data *evt_cb_data = user_data; - int result = -1; - TelCallActiveCnf_t data; - - GVariant *dbus_result; - - conn = G_DBUS_CONNECTION (source_object); - dbus_result = g_dbus_connection_call_finish(conn, res, &error); - - g_variant_get (dbus_result, "(ii)", &result, &data.id); - - if (evt_cb_data->cb_fn) { - evt_cb_data->cb_fn(evt_cb_data->handle, result, &data, evt_cb_data->user_data); - } - - -} - -static void on_response_call_swap(GObject *source_object, GAsyncResult *res, gpointer user_data) -{ - GError *error = 0; - GDBusConnection *conn = 0; - struct tapi_resp_data *evt_cb_data = user_data; - int result = -1; - TelCallSwapCnf_t data; - - GVariant *dbus_result; - - conn = G_DBUS_CONNECTION (source_object); - dbus_result = g_dbus_connection_call_finish(conn, res, &error); - - g_variant_get (dbus_result, "(ii)", &result, &data.id); - - if (evt_cb_data->cb_fn) { - evt_cb_data->cb_fn(evt_cb_data->handle, result, &data, evt_cb_data->user_data); - } -} - -static void on_response_call_join(GObject *source_object, GAsyncResult *res, gpointer user_data) -{ - GError *error = 0; - GDBusConnection *conn = 0; - struct tapi_resp_data *evt_cb_data = user_data; - int result = -1; - TelCallJoinCnf_t data; - - GVariant *dbus_result; - - conn = G_DBUS_CONNECTION (source_object); - dbus_result = g_dbus_connection_call_finish(conn, res, &error); - - g_variant_get (dbus_result, "(ii)", &result, &data.id); - - if (evt_cb_data->cb_fn) { - evt_cb_data->cb_fn(evt_cb_data->handle, result, &data, evt_cb_data->user_data); - } -} - -static void on_response_call_split(GObject *source_object, GAsyncResult *res, gpointer user_data) -{ - GError *error = 0; - GDBusConnection *conn = 0; - struct tapi_resp_data *evt_cb_data = user_data; - int result = -1; - TelCallSplitCnf_t data; - - GVariant *dbus_result; - - conn = G_DBUS_CONNECTION (source_object); - dbus_result = g_dbus_connection_call_finish(conn, res, &error); - - g_variant_get (dbus_result, "(ii)", &result, &data.id); - - if (evt_cb_data->cb_fn) { - evt_cb_data->cb_fn(evt_cb_data->handle, result, &data, evt_cb_data->user_data); - } -} - -static void on_response_call_transfer(GObject *source_object, GAsyncResult *res, gpointer user_data) -{ - GError *error = 0; - GDBusConnection *conn = 0; - struct tapi_resp_data *evt_cb_data = user_data; - int result = -1; - TelCallTransferCnf_t data; - - GVariant *dbus_result; - - conn = G_DBUS_CONNECTION (source_object); - dbus_result = g_dbus_connection_call_finish(conn, res, &error); - - g_variant_get (dbus_result, "(ii)", &result, &data.id); - - if (evt_cb_data->cb_fn) { - evt_cb_data->cb_fn(evt_cb_data->handle, result, &data, evt_cb_data->user_data); - } -} - -static void on_response_call_dtmf(GObject *source_object, GAsyncResult *res, gpointer user_data) -{ - GError *error = 0; - GDBusConnection *conn = 0; - struct tapi_resp_data *evt_cb_data = user_data; - int result = -1; - - GVariant *dbus_result; - - conn = G_DBUS_CONNECTION (source_object); - dbus_result = g_dbus_connection_call_finish(conn, res, &error); - - g_variant_get (dbus_result, "(i)", &result); - - if (evt_cb_data->cb_fn) { - evt_cb_data->cb_fn(evt_cb_data->handle, result, 0, evt_cb_data->user_data); - } -} - -static void on_response_call_deflect(GObject *source_object, GAsyncResult *res, gpointer user_data) -{ - GError *error = 0; - GDBusConnection *conn = 0; - struct tapi_resp_data *evt_cb_data = user_data; - int result = -1; - - GVariant *dbus_result; - - conn = G_DBUS_CONNECTION (source_object); - dbus_result = g_dbus_connection_call_finish(conn, res, &error); - - g_variant_get (dbus_result, "(i)", &result); - - if (evt_cb_data->cb_fn) { - evt_cb_data->cb_fn(evt_cb_data->handle, result, 0, evt_cb_data->user_data); - } -} - -static void on_response_get_call_volume_info(GObject *source_object, GAsyncResult *res, gpointer user_data) -{ - GError *error = 0; - GDBusConnection *conn = 0; - struct tapi_resp_data *evt_cb_data = user_data; - int result = -1, i = 0; - TelCallGetVolumeInfoResp_t resp; - - GVariant *dbus_result = 0, *value = 0; - GVariantIter *iter = 0; - GVariantIter *iter_row = 0; - const gchar *key = 0; - - - memset(&resp, '\0', sizeof(TelCallGetVolumeInfoResp_t)); - - conn = G_DBUS_CONNECTION (source_object); - dbus_result = g_dbus_connection_call_finish(conn, res, &error); - - g_variant_get (dbus_result, "(aa{sv}i)", &iter, &result); - - resp.record_num = g_variant_iter_n_children(iter); - - while ( g_variant_iter_next(iter, "a{sv}", &iter_row ) ) { - while ( g_variant_iter_loop( iter_row, "{sv}", &key, &value ) ) { - - if ( !g_strcmp0(key, "type") ) { - int type = g_variant_get_int32(value); - - resp.record[i].device = (type & 0xf0); - resp.record[i].type = (type & 0x0f); - } - - if ( !g_strcmp0(key, "level") ) { - resp.record[i].volume = g_variant_get_int32(value); - } - } - i++; - g_variant_iter_free(iter_row); - } - g_variant_iter_free(iter); - - if (evt_cb_data->cb_fn) { - evt_cb_data->cb_fn(evt_cb_data->handle, result, &resp, evt_cb_data->user_data); - } -} - -static void on_response_set_call_volume_info(GObject *source_object, GAsyncResult *res, gpointer user_data) -{ - GError *error = 0; - GDBusConnection *conn = 0; - struct tapi_resp_data *evt_cb_data = user_data; - int result = -1; - - GVariant *dbus_result; - - conn = G_DBUS_CONNECTION (source_object); - dbus_result = g_dbus_connection_call_finish(conn, res, &error); - - g_variant_get (dbus_result, "(i)", &result); - - if (evt_cb_data->cb_fn) { - evt_cb_data->cb_fn(evt_cb_data->handle, result, 0, evt_cb_data->user_data); - } -} - -static void on_response_set_call_sound_path(GObject *source_object, GAsyncResult *res, gpointer user_data) -{ - GError *error = 0; - GDBusConnection *conn = 0; - struct tapi_resp_data *evt_cb_data = user_data; - int result = -1; - - GVariant *dbus_result; - - conn = G_DBUS_CONNECTION (source_object); - dbus_result = g_dbus_connection_call_finish(conn, res, &error); - - g_variant_get (dbus_result, "(i)", &result); - - if (evt_cb_data->cb_fn) { - evt_cb_data->cb_fn(evt_cb_data->handle, result, 0, evt_cb_data->user_data); - } -} - -static void on_response_set_call_mute_status(GObject *source_object, GAsyncResult *res, gpointer user_data) -{ - GError *error = 0; - GDBusConnection *conn = 0; - struct tapi_resp_data *evt_cb_data = user_data; - int result = -1; - - GVariant *dbus_result; - - conn = G_DBUS_CONNECTION (source_object); - dbus_result = g_dbus_connection_call_finish(conn, res, &error); - - g_variant_get (dbus_result, "(i)", &result); - - if (evt_cb_data->cb_fn) { - evt_cb_data->cb_fn(evt_cb_data->handle, result, 0, evt_cb_data->user_data); - } -} - -static void on_response_get_call_mute_status(GObject *source_object, GAsyncResult *res, gpointer user_data) -{ - GError *error = 0; - GDBusConnection *conn = 0; - struct tapi_resp_data *evt_cb_data = user_data; - int result = -1, status = 0; - TelCallGetMuteStatusResp_t resp; - - GVariant *dbus_result; - - conn = G_DBUS_CONNECTION (source_object); - dbus_result = g_dbus_connection_call_finish(conn, res, &error); - - g_variant_get (dbus_result, "(ii)", &result, &resp.status); - - if (evt_cb_data->cb_fn) { - evt_cb_data->cb_fn(evt_cb_data->handle, result, &status, evt_cb_data->user_data); - } -} - -static void on_response_set_call_sound_recording(GObject *source_object, GAsyncResult *res, gpointer user_data) -{ - GError *error = 0; - GDBusConnection *conn = 0; - struct tapi_resp_data *evt_cb_data = user_data; - int result = -1; - - GVariant *dbus_result; - - conn = G_DBUS_CONNECTION (source_object); - dbus_result = g_dbus_connection_call_finish(conn, res, &error); - - g_variant_get (dbus_result, "(i)", &result); - - if (evt_cb_data->cb_fn) { - evt_cb_data->cb_fn(evt_cb_data->handle, result, 0, evt_cb_data->user_data); - } -} - -static void on_response_set_call_sound_equalization(GObject *source_object, GAsyncResult *res, gpointer user_data) -{ - GError *error = 0; - GDBusConnection *conn = 0; - struct tapi_resp_data *evt_cb_data = user_data; - int result = -1; - - GVariant *dbus_result; - - conn = G_DBUS_CONNECTION (source_object); - dbus_result = g_dbus_connection_call_finish(conn, res, &error); - - g_variant_get (dbus_result, "(i)", &result); - - if (evt_cb_data->cb_fn) { - evt_cb_data->cb_fn(evt_cb_data->handle, result, 0, evt_cb_data->user_data); - } -} - -static void on_response_set_call_sound_noise_reduction(GObject *source_object, GAsyncResult *res, gpointer user_data) -{ - GError *error = 0; - GDBusConnection *conn = 0; - struct tapi_resp_data *evt_cb_data = user_data; - int result = -1; - - GVariant *dbus_result; - - conn = G_DBUS_CONNECTION (source_object); - dbus_result = g_dbus_connection_call_finish(conn, res, &error); - - g_variant_get (dbus_result, "(i)", &result); - - if (evt_cb_data->cb_fn) { - evt_cb_data->cb_fn(evt_cb_data->handle, result, 0, evt_cb_data->user_data); - } -} - -static void on_response_set_call_sound_clock_status(GObject *source_object, GAsyncResult *res, gpointer user_data) -{ - GError *error = 0; - GDBusConnection *conn = 0; - struct tapi_resp_data *evt_cb_data = user_data; - int result = -1; - - GVariant *dbus_result; - - conn = G_DBUS_CONNECTION (source_object); - dbus_result = g_dbus_connection_call_finish(conn, res, &error); - - g_variant_get (dbus_result, "(i)", &result); - - if (evt_cb_data->cb_fn) { - evt_cb_data->cb_fn(evt_cb_data->handle, result, 0, evt_cb_data->user_data); - } -} - - -EXPORT_API int tel_dial_call(TapiHandle *handle, const TelCallDial_t *pParams, tapi_response_cb callback, void *user_data) -{ - struct tapi_resp_data *evt_cb_data = 0; - GVariant *param = 0; - - dbg("Func Entrance"); - if (!pParams) - return TAPI_API_INVALID_INPUT; - - dbg("Destination Number : %s", pParams->szNumber); - - MAKE_RESP_CB_DATA(evt_cb_data, handle, callback, user_data); - - param = g_variant_new("(is)", pParams->CallType, pParams->szNumber); - - g_dbus_connection_call(handle->dbus_connection, - DBUS_TELEPHONY_SERVICE, handle->path, DBUS_TELEPHONY_CALL_INTERFACE, - "Dial", param, 0, - G_DBUS_CALL_FLAGS_NONE, -1, 0, - on_response_call_dial, evt_cb_data ); - dbg("Exit"); - return TAPI_API_SUCCESS; -} - - -EXPORT_API int tel_answer_call(TapiHandle *handle, unsigned int CallHandle, TelCallAnswerType_t AnsType, tapi_response_cb callback, void *user_data ) -{ - struct tapi_resp_data *evt_cb_data = 0; - GVariant *param = 0; - - dbg("Func Entrance "); - - MAKE_RESP_CB_DATA(evt_cb_data, handle, callback, user_data); - - param = g_variant_new("(ii)", CallHandle, AnsType); - - g_dbus_connection_call(handle->dbus_connection, - DBUS_TELEPHONY_SERVICE, handle->path, DBUS_TELEPHONY_CALL_INTERFACE, - "Answer", param, 0, - G_DBUS_CALL_FLAGS_NONE, -1, 0, - on_response_call_answer, evt_cb_data ); - - return TAPI_API_SUCCESS; -} - -EXPORT_API int tel_end_call(TapiHandle *handle, unsigned int CallHandle, TelCallEndType_t EndType, tapi_response_cb callback, void *user_data) -{ - struct tapi_resp_data *evt_cb_data = 0; - GVariant *param = 0; - - dbg("Func Entrance "); - - MAKE_RESP_CB_DATA(evt_cb_data, handle, callback, user_data); - - param = g_variant_new("(ii)", CallHandle, EndType); - - g_dbus_connection_call(handle->dbus_connection, - DBUS_TELEPHONY_SERVICE, handle->path, DBUS_TELEPHONY_CALL_INTERFACE, - "End", param, 0, - G_DBUS_CALL_FLAGS_NONE, -1, 0, - on_response_call_end, evt_cb_data ); - - return TAPI_API_SUCCESS; -} - -EXPORT_API int tel_hold_call(TapiHandle *handle, unsigned int CallHandle, tapi_response_cb callback, void *user_data ) -{ - struct tapi_resp_data *evt_cb_data = 0; - GVariant *param = 0; - - dbg("Func Entrance "); - - MAKE_RESP_CB_DATA(evt_cb_data, handle, callback, user_data); - - param = g_variant_new("(i)", CallHandle); - - g_dbus_connection_call(handle->dbus_connection, - DBUS_TELEPHONY_SERVICE, handle->path, DBUS_TELEPHONY_CALL_INTERFACE, - "Hold", param, 0, - G_DBUS_CALL_FLAGS_NONE, -1, 0, - on_response_call_hold, evt_cb_data ); - - return TAPI_API_SUCCESS; -} - -EXPORT_API int tel_active_call(TapiHandle *handle, unsigned int CallHandle, tapi_response_cb callback, void *user_data ) -{ - struct tapi_resp_data *evt_cb_data = 0; - GVariant *param = 0; - - dbg("Func Entrance "); - - MAKE_RESP_CB_DATA(evt_cb_data, handle, callback, user_data); - - param = g_variant_new("(i)", CallHandle); - - g_dbus_connection_call(handle->dbus_connection, - DBUS_TELEPHONY_SERVICE, handle->path, DBUS_TELEPHONY_CALL_INTERFACE, - "Active", param, 0, - G_DBUS_CALL_FLAGS_NONE, -1, 0, - on_response_call_active, evt_cb_data ); - - return TAPI_API_SUCCESS; -} - -EXPORT_API int tel_swap_call(TapiHandle *handle, unsigned int CallHandle1, unsigned int CallHandle2, tapi_response_cb callback, void *user_data ) -{ - struct tapi_resp_data *evt_cb_data = 0; - GVariant *param = 0; - - dbg("Func Entrance "); - - MAKE_RESP_CB_DATA(evt_cb_data, handle, callback, user_data); - - param = g_variant_new("(i)", CallHandle1, CallHandle2); - - g_dbus_connection_call(handle->dbus_connection, - DBUS_TELEPHONY_SERVICE, handle->path, DBUS_TELEPHONY_CALL_INTERFACE, - "Swap", param, 0, - G_DBUS_CALL_FLAGS_NONE, -1, 0, - on_response_call_swap, evt_cb_data ); - - return TAPI_API_SUCCESS; -} - -EXPORT_API int tel_join_call(TapiHandle *handle, unsigned int CallHandle1, unsigned int CallHandle2, tapi_response_cb callback, void *user_data ) -{ - struct tapi_resp_data *evt_cb_data = 0; - GVariant *param = 0; - - dbg("Func Entrance "); - - MAKE_RESP_CB_DATA(evt_cb_data, handle, callback, user_data); - - param = g_variant_new("(i)", CallHandle1, CallHandle2); - - g_dbus_connection_call(handle->dbus_connection, - DBUS_TELEPHONY_SERVICE, handle->path, DBUS_TELEPHONY_CALL_INTERFACE, - "Join", param, 0, - G_DBUS_CALL_FLAGS_NONE, -1, 0, - on_response_call_join, evt_cb_data ); - - return TAPI_API_SUCCESS; -} - -EXPORT_API int tel_split_call(TapiHandle *handle, unsigned int CallHandle, tapi_response_cb callback, void *user_data ) -{ - struct tapi_resp_data *evt_cb_data = 0; - GVariant *param = 0; - - dbg("Func Entrance "); - - MAKE_RESP_CB_DATA(evt_cb_data, handle, callback, user_data); - - param = g_variant_new("(i)", CallHandle); - - g_dbus_connection_call(handle->dbus_connection, - DBUS_TELEPHONY_SERVICE, handle->path, DBUS_TELEPHONY_CALL_INTERFACE, - "Split", param, 0, - G_DBUS_CALL_FLAGS_NONE, -1, 0, - on_response_call_split, evt_cb_data ); - - return TAPI_API_SUCCESS; -} - -EXPORT_API int tel_transfer_call(TapiHandle *handle, unsigned int CallHandle, tapi_response_cb callback, void *user_data ) -{ - struct tapi_resp_data *evt_cb_data = 0; - GVariant *param = 0; - - dbg("Func Entrance "); - - MAKE_RESP_CB_DATA(evt_cb_data, handle, callback, user_data); - - param = g_variant_new("(i)", CallHandle); - - g_dbus_connection_call(handle->dbus_connection, - DBUS_TELEPHONY_SERVICE, handle->path, DBUS_TELEPHONY_CALL_INTERFACE, - "Transfer", param, 0, - G_DBUS_CALL_FLAGS_NONE, -1, 0, - on_response_call_transfer, evt_cb_data ); - - return TAPI_API_SUCCESS; -} - -EXPORT_API int tel_activate_call_ccbs(TapiHandle *handle, unsigned int CallHandle, tapi_response_cb callback, void *user_data ) -{ - return TAPI_API_SUCCESS; -} - -EXPORT_API int tel_call_dtmf(TapiHandle *handle, const char *pDtmfString, tapi_response_cb callback, void *user_data ) -{ - struct tapi_resp_data *evt_cb_data = 0; - GVariant *param = 0; - - dbg("Func Entrance "); - - MAKE_RESP_CB_DATA(evt_cb_data, handle, callback, user_data); - - param = g_variant_new("(s)", pDtmfString); - - g_dbus_connection_call(handle->dbus_connection, - DBUS_TELEPHONY_SERVICE, handle->path, DBUS_TELEPHONY_CALL_INTERFACE, - "Dtmf", param, 0, - G_DBUS_CALL_FLAGS_NONE, -1, 0, - on_response_call_dtmf, evt_cb_data ); - - return TAPI_API_SUCCESS; -} - -EXPORT_API int tel_deflect_call(TapiHandle *handle, unsigned int CallHandle, const TelCallDeflectDstInfo_t *pInfo, tapi_response_cb callback, void *user_data ) -{ - struct tapi_resp_data *evt_cb_data = 0; - GVariant *param = 0; - - dbg("Func Entrance "); - - MAKE_RESP_CB_DATA(evt_cb_data, handle, callback, user_data); - - param = g_variant_new("(is)", CallHandle, pInfo->number); - - g_dbus_connection_call(handle->dbus_connection, - DBUS_TELEPHONY_SERVICE, handle->path, DBUS_TELEPHONY_CALL_INTERFACE, - "Deflect", param, 0, - G_DBUS_CALL_FLAGS_NONE, -1, 0, - on_response_call_deflect, evt_cb_data ); - - return TAPI_API_SUCCESS; -} - -EXPORT_API int tel_get_call_status(TapiHandle *handle, int call_id, TelCallStatus_t *out ) -{ - GVariant *gv = 0; - GVariant *param = 0; - - GError *gerr = 0; - - gchar *call_number; - gint call_type = 0; - gboolean call_direction = FALSE; - gint call_state = 0; - gboolean call_multiparty_state = FALSE; - - if ( !out ) { - dbg("[ error ] out : 0 "); - return TAPI_API_INVALID_INPUT; - } - - param = g_variant_new("(i)", call_id); - - gv = g_dbus_connection_call_sync(handle->dbus_connection, - DBUS_TELEPHONY_SERVICE , handle->path, DBUS_TELEPHONY_CALL_INTERFACE, - "GetStatus", param, 0, G_DBUS_CALL_FLAGS_NONE, -1, 0, &gerr); - - if ( gv ) { - g_variant_get(gv, "(isibib)", &call_id, &call_number, &call_type, &call_direction, &call_state, &call_multiparty_state); - - out->CallHandle = (int)call_id; - out->bMoCall = (int)call_direction; - strncpy( out->pNumber, call_number, TAPI_CALL_DIALDIGIT_LEN_MAX ); - - dbg("[ check ] call_number : %s", call_number); - dbg("[ check ] out->pNumber : %s", out->pNumber); - - out->CallType = (TelCallType_t)call_type; - out->CallState = (TelCallStates_t)call_state; - out->bConferenceState = (int)call_multiparty_state; - - g_free( call_number ); - - } else { - - dbg("[ error ] fail to get call status : (0x%x)", call_id); - return TAPI_API_OPERATION_FAILED; - } - - return TAPI_API_SUCCESS; -} - -EXPORT_API int tel_get_call_status_all( TapiHandle *handle, TelCallStatusCallback cb, void *user_data ) -{ - GVariant *gv = 0; - GVariantIter *iter = 0, *iter_row = 0; - GError *gerr = 0; - - if ( !cb ) { - dbg("[ error ] out : 0 "); - return TAPI_API_INVALID_INPUT; - } - - gv = g_dbus_connection_call_sync(handle->dbus_connection, - DBUS_TELEPHONY_SERVICE , handle->path, DBUS_TELEPHONY_CALL_INTERFACE, - "GetStatusAll", 0, 0, G_DBUS_CALL_FLAGS_NONE, -1, 0, &gerr); - - if ( gv ) { - - TelCallStatus_t data; - gchar *key = 0; - GVariant *value = 0; - - g_variant_get(gv, "(aa{sv})", &iter); - - while (g_variant_iter_next(iter, "a{sv}", &iter_row)) { - - while (g_variant_iter_loop(iter_row, "{sv}", &key, &value)) { - - if (!g_strcmp0(key, "call_id")) { - data.CallHandle = g_variant_get_int32(value); - } - if (!g_strcmp0(key, "call_number")) { - strncpy(data.pNumber, g_variant_get_string(value, 0), TAPI_CALL_DIALDIGIT_LEN_MAX); - } - if (!g_strcmp0(key, "call_type")) { - data.CallType = (int)g_variant_get_int32(value); - } - if (!g_strcmp0(key, "call_direction")) { - data.bMoCall = (int)g_variant_get_boolean(value); - } - if (!g_strcmp0(key, "call_state")) { - data.CallState = (int)g_variant_get_int32(value); - } - if (!g_strcmp0(key, "call_multiparty_state")) { - data.bConferenceState = (int)g_variant_get_boolean(value); - } - - } - - g_variant_iter_free(iter_row); - - cb( &data, user_data ); - } - g_variant_iter_free(iter); - } else { - - dbg("[ error ] fail to get call status"); - return TAPI_API_OPERATION_FAILED; - - } - - return TAPI_API_SUCCESS; -} - -EXPORT_API int tel_get_call_act_line(TapiHandle *handle, tapi_response_cb callback, void *user_data ) -{ - return TAPI_API_SUCCESS; -} - -EXPORT_API int tel_set_call_act_line(TapiHandle *handle, TelCallActiveLine_t active_line, tapi_response_cb callback, void *user_data ) -{ - return TAPI_API_SUCCESS; -} - -/*================================================================================================*/ - -EXPORT_API int tel_get_call_duration(TapiHandle *handle, unsigned int CallHandle, unsigned int *pDurationInSecs) -{ - return TAPI_API_SUCCESS; -} - -EXPORT_API int tel_get_call_conf_list(TapiHandle *handle, unsigned int CallHandle, unsigned int *pCallList, int *pNoOfCalls) -{ - return TAPI_API_SUCCESS; -} - -EXPORT_API int tel_get_call_privacy_mode(TapiHandle *handle, TelCallPrivacyType_t PrivacyType, tapi_response_cb callback, void *user_data ) -{ - return TAPI_API_SUCCESS; -} - -EXPORT_API int tel_set_call_privacy_mode(TapiHandle *handle, TelCallVoicePrivacyInfo_t PrivacyInfo, tapi_response_cb callback, void *user_data ) -{ - return TAPI_API_SUCCESS; -} - -EXPORT_API int tel_exe_call_flash_info(TapiHandle *handle, const char *pDialNumber, tapi_response_cb callback, void *user_data ) -{ - return TAPI_API_SUCCESS; -} - -EXPORT_API int tel_exit_call_emergency_mode(TapiHandle *handle, tapi_response_cb callback, void *user_data ) -{ - return TAPI_API_SUCCESS; -} - -EXPORT_API int tel_get_call_time(TapiHandle *handle, unsigned short req_mask, tapi_response_cb callback, void *user_data ) -{ - return TAPI_API_SUCCESS; -} - -EXPORT_API int tel_get_call_volume_info(TapiHandle *handle, TelSoundDevice_t device, TelSoundType_t type, tapi_response_cb callback, void *user_data ) -{ - struct tapi_resp_data *evt_cb_data = 0; - GVariant *param = 0; - - dbg("Func Entrance "); - - MAKE_RESP_CB_DATA(evt_cb_data, handle, callback, user_data); - - param = g_variant_new("(ii)", device, type); - - g_dbus_connection_call(handle->dbus_connection, - DBUS_TELEPHONY_SERVICE, handle->path, DBUS_TELEPHONY_CALL_INTERFACE, - "GetVolume", param, 0, - G_DBUS_CALL_FLAGS_NONE, -1, 0, - on_response_get_call_volume_info, evt_cb_data ); - - return TAPI_API_SUCCESS; -} - -EXPORT_API int tel_set_call_volume_info(TapiHandle *handle, TelCallVolumeInfo_t *info, tapi_response_cb callback, void *user_data ) -{ - struct tapi_resp_data *evt_cb_data = 0; - GVariant *param = 0; - - dbg("Func Entrance "); - - MAKE_RESP_CB_DATA(evt_cb_data, handle, callback, user_data); - - param = g_variant_new("(iii)", info->device, info->type, info->volume); - - g_dbus_connection_call(handle->dbus_connection, - DBUS_TELEPHONY_SERVICE, handle->path, DBUS_TELEPHONY_CALL_INTERFACE, - "SetVolume", param, 0, - G_DBUS_CALL_FLAGS_NONE, -1, 0, - on_response_set_call_volume_info, evt_cb_data ); - - return TAPI_API_SUCCESS; -} - -EXPORT_API int tel_set_call_sound_path(TapiHandle *handle, TelCallSoundPathInfo_t *info, tapi_response_cb callback, void *user_data ) -{ - struct tapi_resp_data *evt_cb_data = 0; - GVariant *param = 0; - - dbg("Func Entrance "); - - MAKE_RESP_CB_DATA(evt_cb_data, handle, callback, user_data); - - param = g_variant_new("(ib)", info->path, info->ex_volume); - - g_dbus_connection_call(handle->dbus_connection, - DBUS_TELEPHONY_SERVICE, handle->path, DBUS_TELEPHONY_CALL_INTERFACE, - "SetSoundPath", param, 0, - G_DBUS_CALL_FLAGS_NONE, -1, 0, - on_response_set_call_sound_path, evt_cb_data ); - - return TAPI_API_SUCCESS; -} - -EXPORT_API int tel_set_call_mute_status(TapiHandle *handle, TelSoundMuteStatus_t mute, tapi_response_cb callback, void *user_data ) -{ - struct tapi_resp_data *evt_cb_data = 0; - char *method = 0; - - dbg("Func Entrance "); - - MAKE_RESP_CB_DATA(evt_cb_data, handle, callback, user_data); - - if ( mute == TAPI_SOUND_MUTE_STATUS_ON ) - method = "Mute"; - else - method = "Unmute"; - - g_dbus_connection_call(handle->dbus_connection, - DBUS_TELEPHONY_SERVICE, handle->path, DBUS_TELEPHONY_CALL_INTERFACE, - method, 0, 0, - G_DBUS_CALL_FLAGS_NONE, -1, 0, - on_response_set_call_mute_status, evt_cb_data ); - - return TAPI_API_SUCCESS; -} - -EXPORT_API int tel_get_call_mute_status(TapiHandle *handle, tapi_response_cb callback, void *user_data ) -{ - struct tapi_resp_data *evt_cb_data = 0; - - dbg("Func Entrance "); - - MAKE_RESP_CB_DATA(evt_cb_data, handle, callback, user_data); - - g_dbus_connection_call(handle->dbus_connection, - DBUS_TELEPHONY_SERVICE, handle->path, DBUS_TELEPHONY_CALL_INTERFACE, - "GetMuteStatus", 0, 0, - G_DBUS_CALL_FLAGS_NONE, -1, 0, - on_response_get_call_mute_status, evt_cb_data ); - - return TAPI_API_SUCCESS; -} - -EXPORT_API int tel_set_call_sound_recording(TapiHandle *handle, TelSoundRecording_t *on, tapi_response_cb callback, void *user_data) -{ - struct tapi_resp_data *evt_cb_data = 0; - GVariant *param = 0; - - dbg("Func Entrance "); - - param = g_variant_new("(i)", on); - - MAKE_RESP_CB_DATA(evt_cb_data, handle, callback, user_data); - - g_dbus_connection_call(handle->dbus_connection, - DBUS_TELEPHONY_SERVICE, handle->path, DBUS_TELEPHONY_CALL_INTERFACE, - "SetSoundRecording", param, 0, - G_DBUS_CALL_FLAGS_NONE, -1, 0, - on_response_set_call_sound_recording, evt_cb_data ); - - return TAPI_API_SUCCESS; -} - -EXPORT_API int tel_set_call_sound_equalization(TapiHandle *handle, TelCallSoundEqualization_t *eq, tapi_response_cb callback, void *user_data) -{ - struct tapi_resp_data *evt_cb_data = 0; - GVariant *param = 0; - char *eq_param = 0; - - dbg("Func Entrance "); - - eq_param = (char*)eq->parameter; - - param = g_variant_new("(iis)", eq->mode, eq->direction, eq_param); - - MAKE_RESP_CB_DATA(evt_cb_data, handle, callback, user_data); - - g_dbus_connection_call(handle->dbus_connection, - DBUS_TELEPHONY_SERVICE, handle->path, DBUS_TELEPHONY_CALL_INTERFACE, - "SetSoundEqualization", param, 0, - G_DBUS_CALL_FLAGS_NONE, -1, 0, - on_response_set_call_sound_equalization, evt_cb_data ); - - return TAPI_API_SUCCESS; -} - -EXPORT_API int tel_set_call_sound_noise_reduction(TapiHandle *handle, TelSoundNoiseReduction_t noise, tapi_response_cb callback, void *user_data) -{ - struct tapi_resp_data *evt_cb_data = 0; - GVariant *param = 0; - - dbg("Func Entrance "); - - param = g_variant_new("(i)", noise); - - MAKE_RESP_CB_DATA(evt_cb_data, handle, callback, user_data); - - g_dbus_connection_call(handle->dbus_connection, - DBUS_TELEPHONY_SERVICE, handle->path, DBUS_TELEPHONY_CALL_INTERFACE, - "SetSoundNoiseReduction", param, 0, - G_DBUS_CALL_FLAGS_NONE, -1, 0, - on_response_set_call_sound_noise_reduction, evt_cb_data ); - - return TAPI_API_SUCCESS; -} - -EXPORT_API int tel_set_call_sound_clock_status(TapiHandle *handle, gboolean status, tapi_response_cb callback, void *user_data ) -{ - struct tapi_resp_data *evt_cb_data = 0; - GVariant *param = 0; - - dbg("Func Entrance"); - - MAKE_RESP_CB_DATA(evt_cb_data, handle, callback, user_data); - - param = g_variant_new("(b)", status); - - g_dbus_connection_call(handle->dbus_connection, - DBUS_TELEPHONY_SERVICE, handle->path, DBUS_TELEPHONY_CALL_INTERFACE, - "SetSoundClockStatus", param, 0, - G_DBUS_CALL_FLAGS_NONE, -1, 0, - on_response_set_call_sound_clock_status, evt_cb_data ); - - return TAPI_API_SUCCESS; -} - - -/* EOF */ - diff --git a/mobile/src/tapi_common.c b/mobile/src/tapi_common.c deleted file mode 100644 index 282a013..0000000 --- a/mobile/src/tapi_common.c +++ /dev/null @@ -1,1415 +0,0 @@ -/* - * libslp-tapi - * - * Copyright (c) 2012 Samsung Electronics Co., Ltd. All rights reserved. - * - * Contact: Ja-young Gu - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#define _GNU_SOURCE -#include -#include -#include -#include - -#include -#include -#include - -#include "tapi_common.h" -#include "TapiUtility.h" - -// -#include "ITapiPS.h" -#include "TelNetwork.h" -#include "TelSms.h" -#include "TelSat.h" -#include "TelSs.h" -#include "TelCall.h" - -// -#include "common.h" -#include "tapi_log.h" - -#define CALLBACK_CALL(data) \ - if (evt_cb_data->cb_fn) { \ - evt_cb_data->cb_fn(handle, noti_id, (data), evt_cb_data->user_data); \ - } \ - -extern char *g_cookie_name; -extern int g_cookie_size; - -TelSatEventDownloadType_t g_event_list[TAPI_SAT_EVENT_LIST_MAX_COUNT] = {-1}; - -/*static void _cookie_deinit(void) -{ - if (g_cookie_name) - free(g_cookie_name); - - g_cookie_name = NULL; - g_cookie_size = 0; -}*/ - -static void _process_network_event(const gchar *sig, GVariant *param, - TapiHandle *handle, char *noti_id, struct tapi_evt_cb *evt_cb_data) -{ - if (!evt_cb_data) - return; - - if (!g_strcmp0(sig, "RegistrationStatus")) { - struct tel_noti_network_registration_status noti; - - g_variant_get(param, "(iiib)", ¬i.cs, ¬i.ps, ¬i.type, ¬i.is_roaming); - - CALLBACK_CALL(¬i); - } - else if (!g_strcmp0(sig, "Info")) { - struct tel_noti_network_info noti; - - memset(¬i, 0, sizeof(struct tel_noti_network_info)); - g_variant_get(param, "(ii)", ¬i.rssi, ¬i.battery); - - CALLBACK_CALL(¬i); - } - else if (!g_strcmp0(sig, "CellInfo")) { - struct tel_noti_network_cell_info noti; - - memset(¬i, 0, sizeof(struct tel_noti_network_cell_info)); - g_variant_get(param, "(ii)", ¬i.lac, ¬i.cell_id); - - CALLBACK_CALL(¬i); - } - else if (!g_strcmp0(sig, "Change")) { - struct tel_noti_network_change noti; - char *plmn = NULL; - int act; - memset(¬i, 0, sizeof(struct tel_noti_network_change)); - - g_variant_get(param, "(isi)", &act, &plmn, ¬i.lac); - - switch (act) { - case 0x1: - noti.act = TAPI_NETWORK_SYSTEM_GSM; - break; - case 0x2: - noti.act = TAPI_NETWORK_SYSTEM_GPRS; - break; - case 0x3: - noti.act = TAPI_NETWORK_SYSTEM_EGPRS; - break; - case 0x4: - noti.act = TAPI_NETWORK_SYSTEM_UMTS; - break; - case 0x5: - noti.act = TAPI_NETWORK_SYSTEM_GSM_AND_UMTS; - break; - case 0x11: - noti.act = TAPI_NETWORK_SYSTEM_IS95A; - break; - case 0x12: - noti.act = TAPI_NETWORK_SYSTEM_IS95B; - break; - case 0x13: - noti.act = TAPI_NETWORK_SYSTEM_CDMA_1X; - break; - case 0x14: - noti.act = TAPI_NETWORK_SYSTEM_EVDO_REV_0; - break; - case 0x15: - noti.act = TAPI_NETWORK_SYSTEM_1X_EVDO_REV_0_HYBRID; - break; - case 0x16: - noti.act = TAPI_NETWORK_SYSTEM_EVDO_REV_A; - break; - case 0x17: - noti.act = TAPI_NETWORK_SYSTEM_1X_EVDO_REV_A_HYBRID; - break; - case 0x18: - noti.act = TAPI_NETWORK_SYSTEM_EVDV; - break; - case 0x21: - noti.act = TAPI_NETWORK_SYSTEM_LTE; - break; - default: - noti.act = TAPI_NETWORK_SYSTEM_NO_SRV; - break; - } - - if (plmn) { - snprintf(noti.plmn, 7, "%s", plmn); - } - - CALLBACK_CALL(¬i); - } - else if (!g_strcmp0(sig, "TimeInfo")) { - struct tel_noti_network_time_info noti; - char *plmn = NULL; - - memset(¬i, 0, sizeof(struct tel_noti_network_time_info)); - g_variant_get(param, "(iiiiiiiiibs)", ¬i.year, ¬i.month, ¬i.day, - ¬i.hour, ¬i.minute, ¬i.second, - ¬i.wday, ¬i.gmtoff, ¬i.dstoff, ¬i.isdst, - &plmn); - - if (plmn) { - snprintf(noti.plmn, 7, "%s", plmn); - } - - CALLBACK_CALL(¬i); - } - else if (!g_strcmp0(sig, "Identity")) { - struct tel_noti_network_identity noti; - char *plmn = NULL, *s_name = NULL, *f_name = NULL; - - memset(¬i, 0, sizeof(struct tel_noti_network_identity)); - - g_variant_get(param, "(sss)", &plmn, &s_name, &f_name); - - if (plmn) { - snprintf(noti.plmn, 7, "%s", plmn); - } - if (s_name) { - snprintf(noti.short_name, 17, "%s", s_name); - } - if (f_name) { - snprintf(noti.full_name, 33, "%s", f_name); - } - - CALLBACK_CALL(¬i); - } - else { - dbg("not handled Network noti[%s]", sig); - } -} - -static void _process_sms_event(const gchar *sig, GVariant *param, - TapiHandle *handle, char *noti_id, struct tapi_evt_cb *evt_cb_data) -{ - if (!evt_cb_data) - return; - - if (!g_strcmp0(sig, "IncommingMsg")) { - struct tel_noti_sms_incomming_msg noti; - - const char *sca = NULL; - const char *tpdu = NULL; - gsize length; - guchar *decoded_sca = NULL; - guchar *decoded_tpdu = NULL; - - memset(¬i, 0, sizeof(struct tel_noti_sms_incomming_msg)); - - g_variant_get(param, "(sis)", &sca, ¬i.MsgLength, &tpdu); - - decoded_sca = g_base64_decode(sca, &length); - if (decoded_sca) { - memcpy(&(noti.Sca[0]), decoded_sca, TAPI_SMS_ENCODED_SCA_LEN_MAX); - g_free(decoded_sca); - } - - decoded_tpdu = g_base64_decode(tpdu, &length); - if (decoded_tpdu) { - memcpy(&(noti.szData[0]), decoded_tpdu, TAPI_NETTEXT_SMDATA_SIZE_MAX + 1); - g_free(decoded_tpdu); - } - - CALLBACK_CALL(¬i); - } - else if (!g_strcmp0(sig, "IncommingCbMsg")) { - struct tel_noti_sms_incomming_cb_msg noti; - - const char *cbMsg = NULL; - gsize length; - guchar *decoded_cbMsg = NULL; - - memset(¬i, 0, sizeof(struct tel_noti_sms_incomming_cb_msg)); - g_variant_get(param, "(iis)", ¬i.CbMsgType, ¬i.Length, &cbMsg); - - decoded_cbMsg = g_base64_decode(cbMsg, &length); - if (decoded_cbMsg) { - memcpy(&(noti.szMsgData[0]), decoded_cbMsg, TAPI_NETTEXT_CB_SIZE_MAX + 1); - g_free(decoded_cbMsg); - } - - CALLBACK_CALL(¬i); - } - else if (!g_strcmp0(sig, "IncommingEtwsMsg")) { - struct tel_noti_sms_incomming_etws_msg noti; - - const char *etwsMsg = NULL; - gsize length; - guchar *decoded_etwsMsg = NULL; - - memset(¬i, 0, sizeof(struct tel_noti_sms_incomming_etws_msg)); - g_variant_get(param, "(iis)", ¬i.EtwsMsgType, ¬i.Length, &etwsMsg); - - decoded_etwsMsg = g_base64_decode(etwsMsg, &length); - if (decoded_etwsMsg) { - memcpy(&(noti.szMsgData[0]), decoded_etwsMsg, TAPI_NETTEXT_ETWS_SIZE_MAX + 1); - g_free(decoded_etwsMsg); - } - - CALLBACK_CALL(¬i); - } - else if (!g_strcmp0(sig, "MemoryStatus")) { - int noti = 0; - - g_variant_get(param, "(i)", ¬i); - CALLBACK_CALL(¬i); - } - else if (!g_strcmp0(sig, "SmsReady")) { - gboolean noti = 0; - - g_variant_get(param, "(b)", ¬i); - CALLBACK_CALL(¬i); - } - else { - dbg("not handled Sms noti[%s]", sig); - } -} - -static void _process_call_event(const gchar *sig, GVariant *param, - TapiHandle *handle, char *noti_id, struct tapi_evt_cb *evt_cb_data) -{ - if (!evt_cb_data) - return; - - if (!g_strcmp0(sig, "VoiceCallStatusIdle") || !g_strcmp0(sig, "VideoCallStatusIdle") ) { - TelCallStatusIdleNoti_t data; - int start_time = 0, end_time = 0; - g_variant_get(param, "(iiii)", &data.id, &data.cause, &start_time, &end_time); - dbg("[ check ] %s : call_id(%d), end_cause(0x%x)", "Status Idle noti", data.id, data.cause); - CALLBACK_CALL(&data); - } - else if (!g_strcmp0(sig, "VoiceCallStatusDialing") || !g_strcmp0(sig, "VideoCallStatusDialing")) { - TelCallStatusDialingNoti_t data; - g_variant_get(param, "(i)", &data.id); - dbg("[ check ] %s : call_id(%d)", "Status Dialing noti", data.id); - CALLBACK_CALL(&data); - } - else if (!g_strcmp0(sig, "VoiceCallStatusAlert") || !g_strcmp0(sig, "VideoCallStatusAlert")) { - TelCallStatusAlertNoti_t data; - g_variant_get(param, "(i)", &data.id); - dbg("[ check ] %s : call_id(%d)", "Status Alert noti", data.id); - CALLBACK_CALL(&data); - } - else if (!g_strcmp0(sig, "VoiceCallStatusActive") || !g_strcmp0(sig, "VideoCallStatusActive")) { - TelCallStatusActiveNoti_t data; - g_variant_get(param, "(i)", &data.id); - dbg("[ check ] %s : call_id(%d)", "Status Active noti", data.id); - CALLBACK_CALL(&data); - } - else if (!g_strcmp0(sig, "VoiceCallStatusHeld") ) { - TelCallStatusHeldNoti_t data; - g_variant_get(param, "(i)", &data.id); - dbg("[ check ] %s : call_id(%d)", "Status Held noti", data.id); - CALLBACK_CALL(&data); - } - else if (!g_strcmp0(sig, "VoiceCallStatusIncoming") || !g_strcmp0(sig, "VideoCallStatusIncoming")) { - TelCallStatusIncomingNoti_t data; - g_variant_get(param, "(i)", &data.id); - dbg("[ check ] %s : call_id(%d)", "Status Incoming noti", data.id); - CALLBACK_CALL(&data); - } - else if (!g_strcmp0(sig, "Waiting")) { - TelCallInfoWaitingNoti_t data; - g_variant_get(param, "(i)", &data.id); - dbg("[ check ] %s : data.id(%d)", "Call Info Waiting noti", data.id); - CALLBACK_CALL(&data.id); - } - else if (!g_strcmp0(sig, "Forwarded")) { - TelCallInfoForwardedNoti_t data; - g_variant_get(param, "(i)", &data.id); - dbg("[ check ] %s : data.id(%d)", "Call Info Forwarded noti", data.id); - CALLBACK_CALL(&data.id); - } - else if (!g_strcmp0(sig, "BarredIncoming")) { - TelCallInfoBarredIncomingNoti_t data; - g_variant_get(param, "(i)", &data.id); - dbg("[ check ] %s : data.id(%d)", "Call Info Barred Incoming noti", data.id); - CALLBACK_CALL(&data.id); - } - else if (!g_strcmp0(sig, "BarredOutgoing")) { - TelCallInfoBarredOutgoingNoti_t data; - g_variant_get(param, "(i)", &data.id); - dbg("[ check ] %s : data.id(%d)", "Call Info Barred Outgoing noti", data.id); - CALLBACK_CALL(&data.id); - } - else if (!g_strcmp0(sig, "ForwardConditional")) { - TelCallInfoForwardConditionalNoti_t data; - g_variant_get(param, "(i)", &data.id); - dbg("[ check ] %s : data.id(%d)", "Call Info Forward Conditional noti", data.id); - CALLBACK_CALL(&data.id); - } - else if (!g_strcmp0(sig, "ForwardUnconditional")) { - TelCallInfoForwardUnconditionalNoti_t data; - g_variant_get(param, "(i)", &data.id); - dbg("[ check ] %s : data.id(%d)", "Call Info Forward Unconditional noti", data.id); - CALLBACK_CALL(&data.id); - } - else if (!g_strcmp0(sig, "CallActive")) { - TelCallInfoActiveNoti_t data; - g_variant_get(param, "(i)", &data.id); - dbg("[ check ] %s : data.id(%d)", "Call Info Call Active noti", data.id); - CALLBACK_CALL(&data.id); - } - else if (!g_strcmp0(sig, "CallHeld")) { - TelCallInfoHeldNoti_t data; - g_variant_get(param, "(i)", &data.id); - dbg("[ check ] %s : data.id(%d)", "Call Info Call Held noti", data.id); - CALLBACK_CALL(&data.id); - } - else if (!g_strcmp0(sig, "CallJoined")) { - TelCallInfoJoinedNoti_t data; - g_variant_get(param, "(i)", &data.id); - dbg("[ check ] %s : data.id(%d)", "Call Info Call Joined noti", data.id); - CALLBACK_CALL(&data.id); - } - else if (!g_strcmp0(sig, "CallSoundPath")) { - TelCallSoundPathNoti_t data; - g_variant_get(param, "(i)", &data.path); - dbg("[ check ] %s : path(%d)", "Call Sound Path noti", data.path); - CALLBACK_CALL(&data); - } - else if (!g_strcmp0(sig, "CallSoundRingbackTone")) { - TelCallSoundRingbackToneNoti_t status; - g_variant_get(param, "(i)", &status); - dbg("[ check ] %s : status(%d)", "Call Sound Ringbacktone noti", status); - CALLBACK_CALL(&status); - } - else if (!g_strcmp0(sig, "CallSoundWbamr")) { - TelCallSoundWbamrNoti_t status; - g_variant_get(param, "(i)", &status); - dbg("[ check ] %s : status(%d)", "Call Sound Wbamr noti", status); - CALLBACK_CALL(&status); - } - else if (!g_strcmp0(sig, "CallSoundEqualization")) { - TelCallSoundEqualizationNoti_t data; - g_variant_get(param, "(ii)", &data.mode, &data.direction); - dbg("[ check ] %s : mode(%d), direction(%d)", "Call Sound Equalization noti", data.mode, data.direction); - CALLBACK_CALL(&data); - } - else if (!g_strcmp0(sig, "CallSoundNoiseReduction")) { - TelCallSoundNoiseReductionNoti_t data; - g_variant_get(param, "(i)", &data.status); - dbg("[ check ] %s : status(%d)", "Call Sound Noise Reduction noti", data.status); - CALLBACK_CALL(&data); - } - else if (!g_strcmp0(sig, "CallSoundClockStatus")) { - gboolean data; - g_variant_get(param, "(b)", &data); - dbg("[ check ] %s : status(%d)", "Call Sound Clock Status noti", data); - CALLBACK_CALL(&data); - } - else { - dbg("not handled Call noti[%s]", sig); - } -} - -static void _process_sat_event(const gchar *sig, GVariant *param, - TapiHandle *handle, char *noti_id, struct tapi_evt_cb *evt_cb_data) -{ - if (!evt_cb_data) - return; - - if (!g_strcmp0(sig, "SetupMenu")) { - TelSatSetupMenuInfo_t setup_menu; - - gchar *title; - gint command_id, item_cnt; - gboolean b_present, b_helpinfo, b_updated; - GVariant *items = NULL; - - memset(&setup_menu, 0, sizeof(TelSatSetupMenuInfo_t)); - - g_variant_get(param, "(ibs@vibb)", &command_id, &b_present, &title, &items, &item_cnt, - &b_helpinfo, &b_updated); - - setup_menu.commandId = command_id; - setup_menu.bIsMainMenuPresent = (b_present ? 1 : 0); - memcpy(setup_menu.satMainTitle, title, TAPI_SAT_DEF_TITLE_LEN_MAX+1); - setup_menu.satMainMenuNum = item_cnt; - if(items && item_cnt > 0){ - int index = 0; - GVariant *unbox; - GVariantIter *iter; - - gchar *item_str; - gint item_id; - unbox = g_variant_get_variant(items); - dbg("items(%p) items type_format(%s)", items, g_variant_get_type_string(unbox)); - - g_variant_get(unbox, "a(si)", &iter); - while(g_variant_iter_loop(iter,"(si)",&item_str, &item_id)){ - setup_menu.satMainMenuItem[index].itemId = item_id; - memcpy(setup_menu.satMainMenuItem[index].itemString, item_str, TAPI_SAT_DEF_ITEM_STR_LEN_MAX + 6); - dbg("item index(%d) id(%d) str(%s)",index, setup_menu.satMainMenuItem[index].itemId, setup_menu.satMainMenuItem[index].itemString); - //dbg("item index(%d) id(%d) str(%s)",index, item_id, item_str); - index++; - } - g_variant_iter_free(iter); - } - setup_menu.bIsSatMainMenuHelpInfo = (b_helpinfo ? 1 : 0); - setup_menu.bIsUpdatedSatMainMenu = (b_updated ? 1 : 0); - - dbg("command id (%d)", setup_menu.commandId); - dbg("menu present (%d)", setup_menu.bIsMainMenuPresent); - dbg("menu title (%s)", setup_menu.satMainTitle); - dbg("item cnt (%d)", setup_menu.satMainMenuNum); - dbg("menu help info (%d)", setup_menu.bIsSatMainMenuHelpInfo); - dbg("menu updated (%d)", setup_menu.bIsUpdatedSatMainMenu); - - CALLBACK_CALL(&setup_menu); - } - else if (!g_strcmp0(sig, "DisplayText")) { - TelSatDisplayTextInd_t display_text; - - gchar* text; - gint command_id, text_len, duration; - gboolean high_priority, user_rsp_required, immediately_rsp; - - memset(&display_text, 0, sizeof(TelSatDisplayTextInd_t)); - - g_variant_get(param, "(isiibbb)", &command_id, &text, &text_len, &duration, - &high_priority, &user_rsp_required, &immediately_rsp); - - display_text.commandId = command_id; - memcpy(display_text.text.string, text, TAPI_SAT_DEF_TEXT_STRING_LEN_MAX+1); - display_text.text.stringLen = text_len; - display_text.duration = duration; - display_text.bIsPriorityHigh = (high_priority ? 1 : 0); - display_text.bIsUserRespRequired = (user_rsp_required ? 1 : 0); - display_text.b_immediately_resp = (immediately_rsp ? 1 : 0); - - dbg("command id (%d)", display_text.commandId); - dbg("display text (%s)", display_text.text.string); - dbg("string len(%d)", display_text.text.stringLen); - dbg("duration (%d)", display_text.duration); - dbg("high priority (%d)", display_text.bIsPriorityHigh); - dbg("user response required(%d)", display_text.bIsUserRespRequired); - dbg("immediately response (%d)", display_text.b_immediately_resp); - - CALLBACK_CALL(&display_text); - } - else if (!g_strcmp0(sig, "SelectItem")) { - TelSatSelectItemInd_t select_item; - - gboolean help_info ; - gchar *selected_text; - gint command_id, default_item_id, menu_cnt, text_len =0; - GVariant *menu_items; - - memset(&select_item, 0, sizeof(TelSatSelectItemInd_t)); - - g_variant_get(param, "(ibsiii@v)", &command_id, &help_info, &selected_text, - &text_len, &default_item_id, &menu_cnt, &menu_items); - - select_item.commandId = command_id; - select_item.bIsHelpInfoAvailable = (help_info ? 1 : 0); - memcpy(select_item.text.string, selected_text, TAPI_SAT_DEF_TITLE_LEN_MAX+1); - select_item.text.stringLen = text_len; - select_item.defaultItemIndex = default_item_id; - select_item.menuItemCount = menu_cnt; - if(menu_items && menu_cnt > 0){ - int index = 0; - GVariant *unbox; - GVariantIter *iter; - - gchar *item_str; - gint item_id, item_len; - unbox = g_variant_get_variant(menu_items); - dbg("items(%p) items type_format(%s)", menu_items, g_variant_get_type_string(unbox)); - - g_variant_get(unbox, "a(iis)", &iter); - while(g_variant_iter_loop(iter,"(iis)",&item_id, &item_len, &item_str)){ - select_item.menuItem[index].itemId = item_id; - select_item.menuItem[index].textLen = item_len; - memcpy(select_item.menuItem[index].text, item_str, TAPI_SAT_ITEM_TEXT_LEN_MAX + 1); - dbg("item index(%d) id(%d) len(%d) str(%s)", index, - select_item.menuItem[index].itemId, select_item.menuItem[index].textLen, select_item.menuItem[index].text); - index++; - } - g_variant_iter_free(iter); - } - - dbg("command id (%d)", select_item.commandId); - dbg("help info(%d)", select_item.bIsHelpInfoAvailable); - dbg("selected item string(%s)", select_item.text.string); - dbg("string len(%d)", select_item.text.stringLen); - dbg("default item index(%d)", select_item.defaultItemIndex); - dbg("item count(%d)", select_item.menuItemCount); - - CALLBACK_CALL(&select_item); - } - else if (!g_strcmp0(sig, "GetInkey")) { - TelSatGetInkeyInd_t get_inkey; - - gint command_id, key_type, input_character_mode; - gint text_len, duration; - gboolean b_numeric, b_help_info; - gchar *text; - - memset(&get_inkey, 0, sizeof(TelSatGetInkeyInd_t)); - - g_variant_get(param, "(iiibbsii)", &command_id, &key_type, &input_character_mode, - &b_numeric,&b_help_info, &text, &text_len, &duration); - - get_inkey.commandId = command_id; - get_inkey.keyType = key_type; - get_inkey.inputCharMode = input_character_mode; - get_inkey.bIsNumeric = (b_numeric ? 1 : 0); - get_inkey.bIsHelpInfoAvailable = (b_help_info ? 1 : 0); - memcpy(get_inkey.text.string, text, TAPI_SAT_DEF_TEXT_STRING_LEN_MAX+1); - get_inkey.text.stringLen = text_len; - get_inkey.duration = duration; - - dbg("command id(%d)", get_inkey.commandId); - dbg("key type(%d)", get_inkey.keyType); - dbg("input character mode(%d)", get_inkey.inputCharMode); - dbg("numeric(%d)", get_inkey.bIsNumeric); - dbg("help info available(%d)", get_inkey.bIsHelpInfoAvailable); - dbg("text (%s)", get_inkey.text.string); - dbg("text length", get_inkey.text.stringLen); - dbg("duration", get_inkey.duration); - - CALLBACK_CALL(&get_inkey); - } - else if (!g_strcmp0(sig, "GetInput")) { - TelSatGetInputInd_t get_input; - - gint command_id, input_character_mode; - gint text_len, def_text_len, rsp_len_min, rsp_len_max; - gboolean b_numeric, b_help_info, b_echo_input; - gchar *text, *def_text; - - memset(&get_input, 0, sizeof(TelSatGetInputInd_t)); - - g_variant_get(param, "(iibbbsiiisi)", &command_id, &input_character_mode, &b_numeric, &b_help_info, &b_echo_input, - &text, &text_len, &rsp_len_max, &rsp_len_min, &def_text, &def_text_len); - - get_input.commandId = command_id; - get_input.inputCharMode = input_character_mode; - get_input.bIsNumeric = (b_numeric ? 1 : 0); - get_input.bIsHelpInfoAvailable = (b_help_info ? 1 : 0); - get_input.bIsEchoInput = (b_echo_input ? 1 : 0); - memcpy(get_input.text.string, text, TAPI_SAT_DEF_TEXT_STRING_LEN_MAX+1); - get_input.text.stringLen = text_len; - get_input.respLen.max = rsp_len_max; - get_input.respLen.min = rsp_len_min; - memcpy(get_input.defaultText.string, def_text, TAPI_SAT_DEF_TEXT_STRING_LEN_MAX+1); - get_input.defaultText.stringLen = def_text_len; - - dbg("command id(%d)", get_input.commandId); - dbg("input character mode(%d)", get_input.inputCharMode); - dbg("numeric(%d)", get_input.bIsNumeric); - dbg("help info avaiable(%d)", get_input.bIsHelpInfoAvailable); - dbg("echo input(%d)", get_input.bIsEchoInput); - dbg("text(%s)", get_input.text.string); - dbg("text length(%d)", get_input.text.stringLen); - dbg("response length max(%d)", get_input.respLen.max); - dbg("response length min(%d)", get_input.respLen.min); - dbg("default text(%s)", get_input.defaultText.string); - dbg("default text length(%d)", get_input.defaultText.stringLen); - - CALLBACK_CALL(&get_input); - } - else if (!g_strcmp0(sig, "SendSMS")) { - TelSatSendSmsIndSmsData_t send_sms; - - gint command_id, ton, npi, tpdu_type; - gboolean b_packing_required; - gint text_len, number_len, tpdu_data_len; - gchar* text, *dialling_number; - GVariant *tpdu_data; - - memset(&send_sms, 0, sizeof(TelSatSendSmsIndSmsData_t)); - - g_variant_get(param, "(isibiisii@vi)", &command_id, &text, &text_len, &b_packing_required, &ton, &npi, - &dialling_number, &number_len, &tpdu_type, &tpdu_data, &tpdu_data_len); - - send_sms.commandId = command_id; - send_sms.bIsPackingRequired = (b_packing_required ? 1 : 0); - - send_sms.address.ton = ton; - send_sms.address.npi = npi; - send_sms.address.diallingNumberLen = number_len; - memcpy(send_sms.address.diallingNumber, dialling_number, TAPI_SAT_DIALLING_NUMBER_LEN_MAX); - - send_sms.smsTpdu.tpduType = tpdu_type; - send_sms.smsTpdu.dataLen = tpdu_data_len; - - if(tpdu_data){ - int index = 0; - guchar data; - GVariantIter *iter = NULL; - GVariant *inner_gv = NULL; - - inner_gv = g_variant_get_variant(tpdu_data); - dbg("tpdu data exist type_format(%s)", g_variant_get_type_string(inner_gv)); - - g_variant_get(inner_gv, "ay", &iter); - while( g_variant_iter_loop (iter, "y", &data)){ - dbg("index(%d) data(%c)", index, data); - send_sms.smsTpdu.data[index] = data; - index++; - } - g_variant_iter_free(iter); - g_variant_unref(inner_gv); - } - - dbg("command id(%d)", send_sms.commandId); - dbg("packing required(%d)", send_sms.bIsPackingRequired); - dbg("address ton(%d)", send_sms.address.ton); - dbg("address npi(%d)", send_sms.address.npi); - dbg("address dialing number (%s)", send_sms.address.diallingNumber); - dbg("address number length (%d)", send_sms.address.diallingNumberLen); - dbg("tpdu type (%d)", send_sms.smsTpdu.tpduType); - dbg("tpdu length (%d)", send_sms.smsTpdu.dataLen); - - CALLBACK_CALL(&send_sms); - } - else if (!g_strcmp0(sig, "SetupEventList")) { - int g_index = 0; - gint event_cnt; - GVariant *evt_list; - TelSatEventListData_t event_list; - - memset(&event_list, 0, sizeof(TelSatEventListData_t)); - - g_variant_get(param, "(i@v)", &event_cnt, &evt_list); - - if(evt_list){ - guchar data; - GVariantIter *iter = NULL; - GVariant *inner_gv = NULL; - - inner_gv = g_variant_get_variant(evt_list); - dbg("event list exist type_format(%s)", g_variant_get_type_string(inner_gv)); - - g_variant_get(inner_gv, "ai", &iter); - while( g_variant_iter_loop (iter, "i", &data)){ - dbg("g_index(%d) event(%d)", g_index, data); - g_event_list[g_index] = data; - - if(data == TAPI_EVENT_SAT_DW_TYPE_IDLE_SCREEN_AVAILABLE){ - event_list.bIsIdleScreenAvailable = 1; - } - else if(data == TAPI_EVENT_SAT_DW_TYPE_LANGUAGE_SELECTION){ - event_list.bIsLanguageSelection = 1; - } - else if(data == TAPI_EVENT_SAT_DW_TYPE_BROWSER_TERMINATION){ - event_list.bIsBrowserTermination = 1; - } - else if(data == TAPI_EVENT_SAT_DW_TYPE_DATA_AVAILABLE){ - event_list.bIsDataAvailable = 1; - } - else if(data == TAPI_EVENT_SAT_DW_TYPE_CHANNEL_STATUS){ - event_list.bIsChannelStatus = 1; - } - - g_index++; - } - //while end - g_variant_iter_free(iter); - g_variant_unref(inner_gv); - } - - dbg("event list cnt(%d)", event_cnt); - - CALLBACK_CALL(&event_list); - } - else if (!g_strcmp0(sig, "Refresh")) { - TelSatRefreshInd_t refresh_info; - - gint command_id = 0; - gint refresh_type =0; - gint file_cnt = 0; - GVariant *file_list = NULL; - - memset(&refresh_info, 0, sizeof(TelSatRefreshInd_t)); - - g_variant_get(param, "(ii@v)", &command_id, &refresh_type, &file_list); - - refresh_info.commandId = command_id; - refresh_info.refreshMode = refresh_type; - - if(file_list){ - int g_index = 0; - guchar data; - GVariantIter *iter = NULL; - GVariant *inner_gv = NULL; - - inner_gv = g_variant_get_variant(file_list); - dbg("file list exist type_format(%s)", g_variant_get_type_string(inner_gv)); - - g_variant_get(inner_gv, "ai", &iter); - while( g_variant_iter_loop (iter, "i", &data)){ - dbg("g_index(%d) file id(%d)", g_index, data); - refresh_info.fileId[g_index] = data; - g_index++; - } - file_cnt = g_index; - - //while end - g_variant_iter_free(iter); - g_variant_unref(inner_gv); - } - refresh_info.fileCount = file_cnt; - - dbg("refresh event/file cnt(%d)", refresh_info.fileCount); - - CALLBACK_CALL(&refresh_info); - } - else if (!g_strcmp0(sig, "SendDtmf")) { - TelSatSendDtmfIndDtmfData_t send_dtmf; - - gint command_id = 0; - gint text_len = 0, dtmf_str_len = 0; - gchar *text = NULL; - gchar *dtmf_str = NULL; - - memset(&send_dtmf, 0, sizeof(TelSatSendDtmfIndDtmfData_t)); - - g_variant_get(param, "(isisi)", &command_id, &text, &text_len, &dtmf_str, &dtmf_str_len); - - send_dtmf.commandId = command_id; - if(text_len <= 0 || g_strcmp0(text,"") == 0 ){ - send_dtmf.bIsHiddenMode = 1; - } - - send_dtmf.dtmfString.stringLen = dtmf_str_len; - memcpy(send_dtmf.dtmfString.string, dtmf_str, TAPI_SAT_DEF_TEXT_STRING_LEN_MAX+1); - - dbg("dtmf event command id(%d)", send_dtmf.commandId); - dbg("dtmf event dtmf(%s)", send_dtmf.dtmfString.string); - - CALLBACK_CALL(&send_dtmf); - } - else if (!g_strcmp0(sig, "EndProactiveSession")) { - int command_type = 0; - - g_variant_get(param, "(i)", &command_type); - dbg("end session evt : command type(%d)", command_type); - CALLBACK_CALL(&command_type); - } - else { - dbg("not handled Sat noti[%s]", sig); - } -} - -static void _process_sim_event(const gchar *sig, GVariant *param, - TapiHandle *handle, char *noti_id, struct tapi_evt_cb *evt_cb_data) -{ - if (!evt_cb_data) - return; - - if (!g_strcmp0(sig, "Status")) { - int noti = 0; - g_variant_get(param, "(i)", ¬i); - CALLBACK_CALL(¬i); - } else { - dbg("not handled SIM noti[%s]",sig ); - } -} - -static void _process_pb_event(const gchar *sig, GVariant *param, - TapiHandle *handle, char *noti_id, struct tapi_evt_cb *evt_cb_data) -{ - if (!evt_cb_data) - return; - - if (!g_strcmp0(sig, "Status")) { - int noti = 0; - g_variant_get(param, "(i)", ¬i); - CALLBACK_CALL(¬i); - } else { - dbg("not handled Phonebook noti[%s]",sig ); - } -} - -static void _process_sap_event(const gchar *sig, GVariant *param, - TapiHandle *handle, char *noti_id, struct tapi_evt_cb *evt_cb_data) -{ - if (!evt_cb_data) - return; - - if (!g_strcmp0(sig, "Status")) { - int noti = 0; - g_variant_get(param, "(i)", ¬i); - CALLBACK_CALL(¬i); - } else if (!g_strcmp0(sig, "Disconnect")) { - int disconnect = 0; - g_variant_get(param, "(i)", &disconnect); - CALLBACK_CALL(&disconnect); - } else { - dbg("not handled SAP noti[%s]",sig ); - } -} - -static void _process_modem_event(const gchar *sig, GVariant *param, - TapiHandle *handle, char *noti_id, struct tapi_evt_cb *evt_cb_data) -{ - if (!evt_cb_data) - return; - - if (!g_strcmp0(sig, "Power")) { - int noti = 0; - - g_variant_get(param, "(i)", ¬i); - - CALLBACK_CALL(¬i); - } - else if (!g_strcmp0(sig, "DunPinCtrl")) { - tapi_ps_btdun_pincontrol pin_ctrl; - int signal = 0, status = 0; - - memset(&pin_ctrl, 0, sizeof(tapi_ps_btdun_pincontrol)); - g_variant_get(param, "(ib)", &signal, &status); - pin_ctrl.signal = signal; - pin_ctrl.status = status; - - CALLBACK_CALL(&pin_ctrl); - } - else if (!g_strcmp0(sig, "DunExternalCall")) { - gboolean external_call; - - g_variant_get(param, "(b)", &external_call); - - CALLBACK_CALL(&external_call); - } - else { - dbg("not handled Modem noti[%s]", sig); - } - - return; -} - -static void _process_ss_event(const gchar *sig, GVariant *param, - TapiHandle *handle, char *noti_id, struct tapi_evt_cb *evt_cb_data) -{ - if (!evt_cb_data) - return; - - if (!g_strcmp0(sig, "NotifyUSSD")) { - TelSsUssdMsgInfo_t noti; - char *str = NULL; - memset(¬i, 0, sizeof(TelSsUssdMsgInfo_t)); - - g_variant_get(param, "(iis)", ¬i.Type, ¬i.Length, &str); - - if (str) { - g_strlcpy(noti.szString, str, TAPI_SS_USSD_DATA_SIZE_MAX); - g_free(str); - } - - CALLBACK_CALL(¬i); - - } else if (!g_strcmp0(sig, "ReleaseComplete")) { - TelSsRelCompMsgInfo_t noti; - GVariant *msg = 0; - int len = 0; - - memset ( ¬i, 0, sizeof( TelSsRelCompMsgInfo_t )); - - g_variant_get(param, "(i@v)", &len, &msg); - - noti.RelCompMsgLen = (unsigned char)len; - - if(msg){ - int i = 0; - guchar data; - GVariantIter *iter = NULL; - GVariant *inner_gv = NULL; - - inner_gv = g_variant_get_variant(msg); - dbg("[ check ] data exist type_format(%s)", g_variant_get_type_string(inner_gv)); - - g_variant_get(inner_gv, "ay", &iter); - while( g_variant_iter_loop (iter, "y", &data)){ - dbg("index(%d) data(%c)", index, data); - noti.szRelCompMsg[i] = data; - i++; - } - g_variant_iter_free(iter); - g_variant_unref(inner_gv); - } - - CALLBACK_CALL(¬i); - - } else { - dbg("not handled SS noti[%s]", sig); - } - - return; -} - -static void _process_gps_event(const gchar *sig, GVariant *param, - TapiHandle *handle, char *noti_id, struct tapi_evt_cb *evt_cb_data) -{ - gboolean b_decode_data = FALSE; - guchar *decoded_data = NULL; - - if (!evt_cb_data) - return; - - if (!g_strcmp0(sig, "AssistData")) { - b_decode_data = TRUE; - } - else if (!g_strcmp0(sig, "MeasurePosition")) { - b_decode_data = TRUE; - } - else if (!g_strcmp0(sig, "ResetAssistData")) { - /* noting to decode */ - } - else if (!g_strcmp0(sig, "FrequencyAiding")) { - b_decode_data = TRUE; - } - else { - dbg("not handled Gps noti[%s]", sig); - } - - /* decoding data */ - if(b_decode_data) { - gchar *data = NULL; - gsize length; - dbg("[%s] decoding start", sig); - - g_variant_get(param, "(s)", &data); - decoded_data = g_base64_decode((const gchar *)data, &length); - if (decoded_data) { - CALLBACK_CALL(decoded_data); - } - - dbg("length=%d", length); - } - - if (decoded_data) - g_free(decoded_data); -} - -static void on_signal_callback(GDBusConnection *conn, const gchar *name, const gchar *path, const gchar *interface, - const gchar *sig, GVariant *param, gpointer user_data) -{ - TapiHandle *handle = user_data; - struct tapi_evt_cb *evt_cb_data = NULL; - char *noti_id; - - if (!handle) { - dbg("handle is NULL"); - return; - } - - noti_id = g_strdup_printf("%s:%s", interface, sig); - - evt_cb_data = g_hash_table_lookup(handle->evt_list, noti_id); - if (!evt_cb_data) { - dbg("can't find noti_id(%s) callback info", noti_id); - g_free(noti_id); - return; - } - - if (!g_strcmp0(interface, DBUS_TELEPHONY_NETWORK_INTERFACE)) { - _process_network_event(sig, param, handle, noti_id, evt_cb_data); - } - else if (!g_strcmp0(interface, DBUS_TELEPHONY_SMS_INTERFACE)) { - _process_sms_event(sig, param, handle, noti_id, evt_cb_data); - } - else if (!g_strcmp0(interface, DBUS_TELEPHONY_CALL_INTERFACE)) { - _process_call_event(sig, param, handle, noti_id, evt_cb_data); - } - else if (!g_strcmp0(interface, DBUS_TELEPHONY_SAT_INTERFACE)) { - _process_sat_event(sig, param, handle, noti_id, evt_cb_data); - } - else if (!g_strcmp0(interface, DBUS_TELEPHONY_SIM_INTERFACE)) { - _process_sim_event(sig, param, handle, noti_id, evt_cb_data); - } - else if (!g_strcmp0(interface, DBUS_TELEPHONY_PB_INTERFACE)) { - _process_pb_event(sig, param, handle, noti_id, evt_cb_data); - } - else if (!g_strcmp0(interface, DBUS_TELEPHONY_SAP_INTERFACE)) { - _process_sap_event(sig, param, handle, noti_id, evt_cb_data); - } - else if (!g_strcmp0(interface, DBUS_TELEPHONY_MODEM_INTERFACE)) { - _process_modem_event(sig, param, handle, noti_id, evt_cb_data); - } - else if (!g_strcmp0(interface, DBUS_TELEPHONY_SS_INTERFACE)) { - _process_ss_event(sig, param, handle, noti_id, evt_cb_data); - } - else if (!g_strcmp0(interface, DBUS_TELEPHONY_GPS_INTERFACE)) { - _process_gps_event(sig, param, handle, noti_id, evt_cb_data); - } - else { - dbg("can't find interface(%s)", interface); - } - g_free(noti_id); -} - -EXPORT_API char** tel_get_cp_name_list(void) -{ - GError *error = NULL; - GDBusProxy *proxy = NULL; - - GVariantIter *iter = NULL; - GVariant *rst = NULL; - - gchar *modem_path = NULL; - GSList *list = NULL; - GSList *l = NULL; - - int i = 0, element_cnt = 0; - gchar **cp_list = NULL; - - proxy = g_dbus_proxy_new_for_bus_sync (G_BUS_TYPE_SYSTEM, G_DBUS_PROXY_FLAGS_NONE, NULL, - "org.tizen.telephony", "/org/tizen/telephony", "org.tizen.telephony.Manager", - NULL, &error); - if (!proxy) { - dbg("g_dbus_proxy_new_for_bus_sycn() failed. (%s)", error->message); - g_error_free (error); - return NULL; - } - - rst = g_dbus_proxy_call_sync (proxy, "GetModems", NULL, G_DBUS_CALL_FLAGS_NONE, -1, NULL, &error); - if (!rst) { - dbg( "GetModems() failed. (%s)", error->message); - g_error_free (error); - goto OUT; - } - - g_variant_get (rst, "(as)", &iter); - while (g_variant_iter_next(iter, "s", &modem_path)) - list = g_slist_append(list, modem_path); - - g_variant_iter_free(iter); - g_variant_unref(rst); - - if (!list) { - dbg( "No CP name"); - goto OUT; - } - - element_cnt = g_slist_length(list); - cp_list = g_new0(char*, element_cnt + 1); - if (!cp_list) { - goto OUT; - } - - for (l = list; l; l = l->next, i++) { - cp_list[i] = g_strdup(l->data); - dbg("cp name[%d] = %s", i, cp_list[i]); - } - cp_list[element_cnt] = NULL; - -OUT: - g_slist_free_full(list, g_free); - g_object_unref(proxy); - - return cp_list; -} - -EXPORT_API int tel_get_property_int(TapiHandle *handle, const char *property, int *result) -{ - char **dbus_info; - GDBusProxy *proxy = NULL; - GVariant *value = NULL; - GError *error = NULL; - int ret = TAPI_API_SUCCESS; - - if (!handle || !property) - return TAPI_API_INVALID_INPUT; - - dbus_info = g_strsplit(property, ":", 2); - if (!dbus_info) { - dbg("invalid property"); - return TAPI_API_INVALID_INPUT; - } - - if (!dbus_info[0] || !dbus_info[1]) { - dbg("invalid property"); - ret = TAPI_API_INVALID_INPUT; - goto OUT; - } - - proxy = g_dbus_proxy_new_for_bus_sync (G_BUS_TYPE_SYSTEM, G_DBUS_PROXY_FLAGS_NONE, NULL, - DBUS_TELEPHONY_SERVICE, handle->path, dbus_info[0], - NULL, &error); - if (!proxy) { - dbg("g_dbus_proxy_new_for_bus_sycn() failed. (%s)", error->message); - g_error_free (error); - ret = TAPI_API_OPERATION_FAILED; - goto OUT; - } - - value = g_dbus_proxy_get_cached_property(proxy, dbus_info[1]); - if (!value) { - dbg("g_dbus_proxy_get_cached_property('power') failed."); - ret = TAPI_API_OPERATION_FAILED; - goto OUT; - } - - g_variant_get(value, "i", result); - g_variant_unref(value); - -OUT: - if (proxy) - g_object_unref(proxy); - - g_strfreev(dbus_info); - - return ret; -} - -EXPORT_API TapiHandle* tel_init(const char *cp_name) -{ - GError *error = NULL; - struct tapi_handle *handle = NULL; - gchar *addr; -#if !GLIB_CHECK_VERSION (2, 35, 3) - g_type_init(); -#endif - - dbg("process info: env: [%s] invocation: [%s]", - getenv("_"), program_invocation_name); - - /* Get System BUS */ - addr = g_dbus_address_get_for_bus_sync(G_BUS_TYPE_SYSTEM, - NULL, - &error); - if (addr == NULL) { - err("Error get dbus: [%s]", error->message); - goto ERROR; - } - - /* Allocate new Handle */ - handle = g_try_new0(struct tapi_handle, 1); - if (handle == NULL) { - err("Failed to allocate handle"); - goto ERROR; - } - - /* Create DBUS connection */ - handle->dbus_connection = g_dbus_connection_new_for_address_sync(addr, - (G_DBUS_CONNECTION_FLAGS_AUTHENTICATION_CLIENT | - G_DBUS_CONNECTION_FLAGS_MESSAGE_BUS_CONNECTION), - NULL, - NULL, - &error); - if (handle->dbus_connection == NULL) { - err("Error creating DBUS connection: [%s]", error->message); - goto ERROR; - } - - handle->ca = g_cancellable_new(); - if (handle->ca == NULL) { - err("Error allocating cancellable object"); - goto ERROR; - } - - /* Get CP name */ - if (cp_name != NULL) - handle->cp_name = g_strdup(cp_name); - else { - char **list = NULL; - int i = 0; - - /* Get CP Name list */ - list = tel_get_cp_name_list(); - if ((list == NULL) || (list[0] == NULL)) { - err("Get CP name list failed"); - - g_free(list); - goto ERROR; - } - - /* - * Presently, we would only be providing the 'default' CP name, - * it is the first CP name in the obtained list of CP names. - * - * We would evolve this logic in due course. - */ - dbg("Use 'default' Plug-in: [%s]", list[0]); - handle->cp_name = g_strdup(list[0]); - - /* Free CP name list */ - while (list[i] != NULL) - g_free(list[i++]); - - g_free(list); - } - - /* Create Event list Hash Table */ - handle->evt_list = g_hash_table_new_full(g_str_hash, - g_str_equal, - g_free, - g_free); - - /* Set Path */ - handle->path = g_strdup_printf("%s/%s", - DBUS_TELEPHONY_DEFAULT_PATH, handle->cp_name); - dbg("handle: [0x%x] Path: [%s]", handle, handle->path); - - g_free(addr); - return handle; - -ERROR: - /* Free all resources */ - g_free(addr); - g_error_free (error); - - if (handle != NULL) { - g_cancellable_cancel(handle->ca); - g_object_unref(handle->ca); - - if (g_dbus_connection_close_sync(handle->dbus_connection, - NULL, - NULL) == FALSE) { - err("Failed to close connection"); - } - g_object_unref(handle->dbus_connection); - g_free(handle); - } - - return NULL; -} - -static gboolean _unregister_noti(gpointer key, gpointer value, gpointer user_data) -{ - struct tapi_evt_cb *evt_cb_data = value; - TapiHandle *handle = user_data; - - if (handle == NULL) - return TRUE; - - g_dbus_connection_signal_unsubscribe(handle->dbus_connection, evt_cb_data->evt_id); - - return TRUE; -} - -EXPORT_API int tel_deinit(TapiHandle *handle) -{ - if (handle == NULL) - return TAPI_API_INVALID_INPUT; - - g_free(handle->cp_name); - g_free(handle->path); - - dbg("Remove all signals"); - g_hash_table_foreach_remove(handle->evt_list, _unregister_noti, handle); - g_hash_table_destroy(handle->evt_list); - - g_cancellable_cancel(handle->ca); - g_object_unref(handle->ca); - - dbg("Close DBUS connection"); - if (g_dbus_connection_close_sync(handle->dbus_connection, - NULL, NULL) == FALSE) { - err("Failed to close DBUS connection"); - } - g_object_unref(handle->dbus_connection); - g_free(handle); - - dbg("deinit complete"); - return TAPI_API_SUCCESS; -} - -EXPORT_API int tel_register_noti_event(TapiHandle *handle, const char *noti_id, - tapi_notification_cb callback, void *user_data) -{ - gchar **dbus_str = NULL; - gpointer tmp = NULL; - struct tapi_evt_cb *evt_cb_data = NULL; - - if ((handle == NULL) || (handle->dbus_connection == NULL) - || (callback == NULL) || (noti_id == NULL)) { - err("Invalid input parameters"); - return TAPI_API_INVALID_INPUT; - } - - tmp = g_hash_table_lookup(handle->evt_list, noti_id); - if (tmp != NULL) { - dbg("noti_id(%s) is already registered", noti_id); - return TAPI_API_INVALID_INPUT; - } - - dbus_str = g_strsplit(noti_id, ":", 2); - if (!dbus_str) { - dbg("invalid noti_id"); - return TAPI_API_INVALID_INPUT; - } - - if (!dbus_str[0] || !dbus_str[1]) { - g_strfreev(dbus_str); - dbg("invalid noti_id"); - return TAPI_API_INVALID_INPUT; - } - - evt_cb_data = g_try_new0(struct tapi_evt_cb, 1); - if (evt_cb_data == NULL) { - err("Failed to allocate memory"); - g_strfreev(dbus_str); - return TAPI_API_SYSTEM_OUT_OF_MEM; - } - - /* Assign callback and user_data */ - evt_cb_data->cb_fn = callback; - evt_cb_data->user_data = user_data; - evt_cb_data->handle = handle; - - dbg("path(%s) interface (%s) signal (%s)", handle->path, dbus_str[0], dbus_str[1]); - - evt_cb_data->evt_id = g_dbus_connection_signal_subscribe(handle->dbus_connection, - DBUS_TELEPHONY_SERVICE, /* Sender */ - dbus_str[0], /* Interface */ - dbus_str[1], /* Member */ - handle->path, /* Object path */ - NULL, /* arg0 */ - G_DBUS_SIGNAL_FLAGS_NONE, - on_signal_callback, handle, - NULL); - - g_hash_table_insert(handle->evt_list, g_strdup(noti_id), evt_cb_data); - - g_strfreev(dbus_str); - - return TAPI_API_SUCCESS; -} - -EXPORT_API int tel_deregister_noti_event(TapiHandle *handle, const char *noti_id) -{ - struct tapi_evt_cb *evt_cb_data = NULL; - gboolean rv = FALSE; - - if (!handle || !handle->dbus_connection){ - dbg("invalid parameter"); - return TAPI_API_INVALID_INPUT; - } - - evt_cb_data = g_hash_table_lookup(handle->evt_list, noti_id); - - if(!evt_cb_data){ - dbg("event does not registered"); - return TAPI_API_INVALID_INPUT; - } - - g_dbus_connection_signal_unsubscribe(handle->dbus_connection, evt_cb_data->evt_id); - - rv = g_hash_table_remove(handle->evt_list, noti_id); - if(!rv){ - dbg("fail to deregister noti event(%s)", noti_id); - return TAPI_API_OPERATION_FAILED; - } - - return TAPI_API_SUCCESS; -} -/* EOF */ diff --git a/mobile/src/tapi_gps.c b/mobile/src/tapi_gps.c deleted file mode 100644 index 1520ddd..0000000 --- a/mobile/src/tapi_gps.c +++ /dev/null @@ -1,125 +0,0 @@ -/* - * libslp-tapi - * - * Copyright (c) 2012 Samsung Electronics Co., Ltd. All rights reserved. - * - * Contact: Ja-young Gu - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT 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 "TapiUtility.h" - -#include "common.h" -#include "tapi_log.h" -#include "ITapiGps.h" - -static void on_response_default_set(GObject *source_object, GAsyncResult *res, gpointer user_data) -{ - GError *error = NULL; - GDBusConnection *conn = NULL; - struct tapi_resp_data *evt_cb_data = user_data; - int result = -1; - - GVariant *dbus_result; - - conn = G_DBUS_CONNECTION (source_object); - dbus_result = g_dbus_connection_call_finish(conn, res, &error); - CHECK_DEINIT(error); - - if (!dbus_result) { - if (evt_cb_data->cb_fn) { - evt_cb_data->cb_fn(evt_cb_data->handle, -1, NULL, evt_cb_data->user_data); - } - - if (error) - g_error_free(error); - - free(evt_cb_data); - return; - } - - - g_variant_get (dbus_result, "(i)", &result); - - if (evt_cb_data->cb_fn) { - evt_cb_data->cb_fn(evt_cb_data->handle, result, NULL, evt_cb_data->user_data); - } - - free(evt_cb_data); -} - - -EXPORT_API int tel_set_gps_frequency_aiding(TapiHandle *handle, unsigned char state, tapi_response_cb callback, void *user_data) -{ - struct tapi_resp_data *evt_cb_data = NULL; - GVariant *param; - - dbg("Func Entrance"); - - MAKE_RESP_CB_DATA(evt_cb_data, handle, callback, user_data); - - param = g_variant_new("(y)", state); - - g_dbus_connection_call(handle->dbus_connection, - DBUS_TELEPHONY_SERVICE , handle->path, DBUS_TELEPHONY_GPS_INTERFACE, - "SetFrequencyAiding", param, NULL, - G_DBUS_CALL_FLAGS_NONE, -1, handle->ca, - on_response_default_set, evt_cb_data); - - return TAPI_API_SUCCESS; -} - -EXPORT_API int tel_confirm_gps_measure_pos(TapiHandle *handle, unsigned char *data, unsigned int data_len) -{ - GVariant *param = NULL; - GVariant *rst = NULL; - GError *gerr = 0; - gchar *encoded_data = NULL; - gint result; - - dbg("Func Entrance"); - - if (!handle || !handle->dbus_connection || !data){ - dbg("invalid parameter"); - return TAPI_API_INVALID_INPUT; - } - - msg("call tel_confirm_gps_measure_pos(). data_len=%d", data_len); - encoded_data = g_base64_encode((const guchar*)data, data_len); - - param = g_variant_new("(s)", encoded_data); - - rst = g_dbus_connection_call_sync(handle->dbus_connection, DBUS_TELEPHONY_SERVICE , handle->path, - DBUS_TELEPHONY_GPS_INTERFACE, "ConfirmMeasurePos", param, NULL, G_DBUS_CALL_FLAGS_NONE, -1, 0, &gerr); - - g_free(encoded_data); - - if(!rst){ - dbg( "error to gps measure pos confirm(%s)", gerr->message); - g_error_free (gerr); - return TAPI_API_OPERATION_FAILED; - } - dbg("send gps user confirm format(%s)", g_variant_get_type_string(rst)); - - g_variant_get(rst, "(i)", &result); - dbg("result (%d)", result); - - return TAPI_API_SUCCESS; -} - diff --git a/mobile/src/tapi_log.h b/mobile/src/tapi_log.h deleted file mode 100644 index e26216b..0000000 --- a/mobile/src/tapi_log.h +++ /dev/null @@ -1,50 +0,0 @@ -/* - * libslp-tapi - * - * Copyright (c) 2012 Samsung Electronics Co., Ltd. All rights reserved. - * - * Contact: Ja-young Gu - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT 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_LOG_H__ -#define __TAPI_LOG_H__ - -__BEGIN_DECLS - -#ifdef FEATURE_DLOG_DEBUG - -#include - -#ifndef TAPI_LOG_TAG -#define TAPI_LOG_TAG "LIBTAPI" -#endif - -#define msg(fmt,args...) { RLOG(LOG_INFO, TAPI_LOG_TAG, fmt "\n", ##args); } -#define dbg(fmt,args...) { RLOG(LOG_DEBUG, TAPI_LOG_TAG, "<%s:%d> " fmt "\n", __func__, __LINE__, ##args); } -#define warn(fmt,args...) { RLOG(LOG_WARN, TAPI_LOG_TAG, "<%s:%d> " fmt "\n", __func__, __LINE__, ##args); } -#define err(fmt,args...) { RLOG(LOG_FATAL, TAPI_LOG_TAG, "<%s:%d> " fmt "\n", __func__, __LINE__, ##args); } - -#else - -#define msg(fmt,args...) -#define dbg(fmt,args...) -#define warn(fmt,args...) -#define err(fmt,args...) - -#endif - -__END_DECLS - -#endif diff --git a/mobile/src/tapi_modem.c b/mobile/src/tapi_modem.c deleted file mode 100644 index 1b291c3..0000000 --- a/mobile/src/tapi_modem.c +++ /dev/null @@ -1,504 +0,0 @@ -/* - * libslp-tapi - * - * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. - * - * Contact: Ja-young Gu - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT 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 "TapiUtility.h" - -#include "TelMisc.h" -#include "TelPower.h" -#include "ITapiModem.h" -#include "ITapiPS.h" - -#include "common.h" -#include "tapi_log.h" - -static void on_response_default_set(GObject *source_object, GAsyncResult *res, gpointer user_data) -{ - GError *error = NULL; - GDBusConnection *conn = NULL; - struct tapi_resp_data *evt_cb_data = user_data; - int result = -1; - - GVariant *dbus_result; - - conn = G_DBUS_CONNECTION (source_object); - dbus_result = g_dbus_connection_call_finish(conn, res, &error); - CHECK_DEINIT(error); - - if (!dbus_result) { - if (evt_cb_data->cb_fn) { - evt_cb_data->cb_fn(evt_cb_data->handle, -1, NULL, evt_cb_data->user_data); - } - - if (error) - g_error_free(error); - - free(evt_cb_data); - return; - } - - g_variant_get (dbus_result, "(i)", &result); - - if (evt_cb_data->cb_fn) { - evt_cb_data->cb_fn(evt_cb_data->handle, result, NULL, evt_cb_data->user_data); - } - - free(evt_cb_data); -} - -static void on_response_get_version(GObject *source_object, GAsyncResult *res, gpointer user_data) -{ - GError *error = NULL; - GDBusConnection *conn = NULL; - struct tapi_resp_data *evt_cb_data = user_data; - int result = -1; - TelMiscVersionInformation data; - char *sw = NULL, *hw = NULL, *rf = NULL, *product = NULL; - - GVariant *dbus_result; - - memset(&data, 0, sizeof(TelMiscVersionInformation)); - - conn = G_DBUS_CONNECTION (source_object); - dbus_result = g_dbus_connection_call_finish(conn, res, &error); - CHECK_DEINIT(error); - - if (!dbus_result) { - if (evt_cb_data->cb_fn) { - evt_cb_data->cb_fn(evt_cb_data->handle, -1, NULL, evt_cb_data->user_data); - } - - if (error) - g_error_free(error); - - free(evt_cb_data); - return; - } - - g_variant_get (dbus_result, "(issss)", &result, - &sw, &hw, &rf, &product); - - dbg("product code [%s]", product); - - g_strlcpy((gchar *)data.szSwVersion, sw, MAX_VERSION_LEN); - g_strlcpy((gchar *)data.szHwVersion, hw, MAX_VERSION_LEN); - g_strlcpy((gchar *)data.szRfCalDate, rf, MAX_VERSION_LEN); - g_strlcpy((gchar *)data.szProductCode, product, TAPI_MISC_PRODUCT_CODE_LEN_MAX); - - if (evt_cb_data->cb_fn) { - evt_cb_data->cb_fn(evt_cb_data->handle, result, &data, evt_cb_data->user_data); - } - - free(evt_cb_data); -} - -static void on_response_get_serial_number(GObject *source_object, GAsyncResult *res, gpointer user_data) -{ - GError *error = NULL; - GDBusConnection *conn = NULL; - struct tapi_resp_data *evt_cb_data = user_data; - int result = -1; - char *sn = NULL; - - GVariant *dbus_result; - - conn = G_DBUS_CONNECTION (source_object); - dbus_result = g_dbus_connection_call_finish(conn, res, &error); - CHECK_DEINIT(error); - - if (!dbus_result) { - if (evt_cb_data->cb_fn) { - evt_cb_data->cb_fn(evt_cb_data->handle, -1, NULL, evt_cb_data->user_data); - } - - if (error) - g_error_free(error); - - free(evt_cb_data); - return; - } - - g_variant_get (dbus_result, "(is)", &result, &sn); - - if (evt_cb_data->cb_fn) { - evt_cb_data->cb_fn(evt_cb_data->handle, result, sn, evt_cb_data->user_data); - } - - free(evt_cb_data); -} - -static void on_response_get_imei(GObject *source_object, GAsyncResult *res, gpointer user_data) -{ - GError *error = NULL; - GDBusConnection *conn = NULL; - struct tapi_resp_data *evt_cb_data = user_data; - int result = -1; - char *imei = NULL; - - GVariant *dbus_result; - - conn = G_DBUS_CONNECTION (source_object); - dbus_result = g_dbus_connection_call_finish(conn, res, &error); - CHECK_DEINIT(error); - - if (!dbus_result) { - if (evt_cb_data->cb_fn) { - evt_cb_data->cb_fn(evt_cb_data->handle, -1, NULL, evt_cb_data->user_data); - } - - if (error) - g_error_free(error); - - free(evt_cb_data); - return; - } - - g_variant_get (dbus_result, "(is)", &result, &imei); - - if (evt_cb_data->cb_fn) { - evt_cb_data->cb_fn(evt_cb_data->handle, result, imei, evt_cb_data->user_data); - } - - free(evt_cb_data); -} - -static void on_response_set_dun_pin_ctrl(GObject *source_object, GAsyncResult *res, gpointer user_data) -{ - GError *error = NULL; - GDBusConnection *conn = NULL; - struct tapi_resp_data *evt_cb_data = user_data; - int result = -1; - - GVariant *dbus_result; - - conn = G_DBUS_CONNECTION (source_object); - dbus_result = g_dbus_connection_call_finish(conn, res, &error); - CHECK_DEINIT(error); - - if (!dbus_result) { - if (evt_cb_data->cb_fn) { - evt_cb_data->cb_fn(evt_cb_data->handle, -1, NULL, evt_cb_data->user_data); - } - - if (error) - g_error_free(error); - - free(evt_cb_data); - return; - } - - g_variant_get (dbus_result, "(i)", &result); - dbg("dun pin ctrl result(%d)", result); - - if (evt_cb_data->cb_fn) { - evt_cb_data->cb_fn(evt_cb_data->handle, result, 0, evt_cb_data->user_data); - } - - free(evt_cb_data); -} - -static void on_response_get_flight_mode(GObject *source_object, GAsyncResult *res, gpointer user_data) -{ - GError *error = NULL; - GDBusConnection *conn = NULL; - struct tapi_resp_data *evt_cb_data = user_data; - int result = -1; - gboolean mode = FALSE; - - GVariant *dbus_result; - - conn = G_DBUS_CONNECTION (source_object); - dbus_result = g_dbus_connection_call_finish(conn, res, &error); - CHECK_DEINIT(error); - - if (!dbus_result) { - if (evt_cb_data->cb_fn) { - evt_cb_data->cb_fn(evt_cb_data->handle, -1, NULL, evt_cb_data->user_data); - } - - if (error) - g_error_free(error); - - free(evt_cb_data); - return; - } - - g_variant_get (dbus_result, "(bi)", &mode, &result); - - if (evt_cb_data->cb_fn) { - evt_cb_data->cb_fn(evt_cb_data->handle, result, &mode, evt_cb_data->user_data); - } - - free(evt_cb_data); -} - -/** - * - * Turn Off or Turn On the Modem. - * - * @param[in] tapi_power_phone_cmd_t Turn ON or OFF. - * @param[out] NONE - * @return TapiResult_t API result code. Either Success or some Error Code. - * @exception In case of exceptions return value contains appropriate error code. - * @remarks None. - * @see tapi_power_phone_cmd_t, TapiResult_t. - */ -EXPORT_API int tel_process_power_command(TapiHandle *handle, tapi_power_phone_cmd_t cmd, tapi_response_cb callback, void *user_data) -{ - struct tapi_resp_data *evt_cb_data = NULL; - GVariant *param; - - dbg("Func Entrance"); - - if (cmd > TAPI_PHONE_POWER_RESET) - return TAPI_API_INVALID_INPUT; - - MAKE_RESP_CB_DATA(evt_cb_data, handle, callback, user_data); - - param = g_variant_new("(i)", cmd); - - g_dbus_connection_call(handle->dbus_connection, - DBUS_TELEPHONY_SERVICE , handle->path, DBUS_TELEPHONY_MODEM_INTERFACE, - "SetPower", param, NULL, - G_DBUS_CALL_FLAGS_NONE, -1, handle->ca, - on_response_default_set, evt_cb_data); - - return TAPI_API_SUCCESS; -} - -/** - * - * Enter in to or Leave from Flight Mode. - * - * @param[in] Enable (if 1, Enable and if 0, Disable) - * @param[out] NONE - * @return TapiResult_t API result code. Either Success or some Error Code. - * @exception In case of exceptions return value contains appropriate error code. - * @remarks None - * @see None. - */ -EXPORT_API int tel_set_flight_mode(TapiHandle *handle, tapi_power_flight_mode_type_t mode, tapi_response_cb callback, void *user_data) -{ - struct tapi_resp_data *evt_cb_data = NULL; - GVariant *param; - gboolean b_mode; - - dbg("Func Entrance"); - - if (mode == TAPI_POWER_FLIGHT_MODE_ENTER) { - b_mode = TRUE; - } - else if (mode == TAPI_POWER_FLIGHT_MODE_LEAVE) { - b_mode = FALSE; - } - else { - return TAPI_API_INVALID_INPUT; - }; - - MAKE_RESP_CB_DATA(evt_cb_data, handle, callback, user_data); - - param = g_variant_new("(b)", b_mode); - - g_dbus_connection_call(handle->dbus_connection, - DBUS_TELEPHONY_SERVICE , handle->path, DBUS_TELEPHONY_MODEM_INTERFACE, - "SetFlightMode", param, NULL, - G_DBUS_CALL_FLAGS_NONE, -1, handle->ca, - on_response_default_set, evt_cb_data); - - return TAPI_API_SUCCESS; -} - -EXPORT_API int tel_get_flight_mode(TapiHandle *handle, tapi_response_cb callback, void *user_data) -{ - struct tapi_resp_data *evt_cb_data = NULL; - - dbg("Func Entrance"); - - MAKE_RESP_CB_DATA(evt_cb_data, handle, callback, user_data); - - g_dbus_connection_call(handle->dbus_connection, - DBUS_TELEPHONY_SERVICE , handle->path, DBUS_TELEPHONY_MODEM_INTERFACE, - "GetFlightMode", NULL, NULL, - G_DBUS_CALL_FLAGS_NONE, -1, handle->ca, - on_response_get_flight_mode, evt_cb_data); - - return TAPI_API_SUCCESS; -} - -EXPORT_API int tel_get_misc_me_version(TapiHandle *handle, tapi_response_cb callback, void *user_data) -{ - struct tapi_resp_data *evt_cb_data = NULL; - - dbg("Func Entrance"); - - MAKE_RESP_CB_DATA(evt_cb_data, handle, callback, user_data); - - g_dbus_connection_call(handle->dbus_connection, - DBUS_TELEPHONY_SERVICE , handle->path, DBUS_TELEPHONY_MODEM_INTERFACE, - "GetVersion", NULL, NULL, - G_DBUS_CALL_FLAGS_NONE, -1, handle->ca, - on_response_get_version, evt_cb_data); - - return TAPI_API_SUCCESS; -} - -EXPORT_API TelMiscVersionInformation *tel_get_misc_me_version_sync(TapiHandle *handle) -{ - GVariant *dbus_result; - int result = -1; - TelMiscVersionInformation *data = NULL; - char *sw = NULL, *hw = NULL, *rf = NULL, *product = NULL; - - dbg("Func Entrance"); - - if (!handle) - return NULL; - - dbus_result = g_dbus_connection_call_sync(handle->dbus_connection, - DBUS_TELEPHONY_SERVICE , handle->path, DBUS_TELEPHONY_MODEM_INTERFACE, - "GetVersion", NULL, NULL, - G_DBUS_CALL_FLAGS_NONE, -1, NULL, NULL); - - g_variant_get (dbus_result, "(issss)", &result, - &sw, &hw, &rf, &product); - - dbg("product code[%s]", product); - - data = calloc(sizeof(TelMiscVersionInformation), 1); - if (!data) - return NULL; - - g_strlcpy((gchar *)data->szSwVersion, sw, MAX_VERSION_LEN); - g_strlcpy((gchar *)data->szHwVersion, hw, MAX_VERSION_LEN); - g_strlcpy((gchar *)data->szRfCalDate, rf, MAX_VERSION_LEN); - g_strlcpy((gchar *)data->szProductCode, product, TAPI_MISC_PRODUCT_CODE_LEN_MAX); - - return data; -} - -EXPORT_API int tel_get_misc_me_imei(TapiHandle *handle, tapi_response_cb callback, void *user_data) -{ - struct tapi_resp_data *evt_cb_data = NULL; - - dbg("Func Entrance"); - - MAKE_RESP_CB_DATA(evt_cb_data, handle, callback, user_data); - - g_dbus_connection_call(handle->dbus_connection, - DBUS_TELEPHONY_SERVICE , handle->path, DBUS_TELEPHONY_MODEM_INTERFACE, - "GetIMEI", NULL, NULL, - G_DBUS_CALL_FLAGS_NONE, -1, handle->ca, - on_response_get_imei, evt_cb_data); - - return TAPI_API_SUCCESS; -} - -EXPORT_API char *tel_get_misc_me_imei_sync(TapiHandle *handle) -{ - GVariant *dbus_result; - char *imei = NULL; - int result = 0; - - dbg("Func Entrance"); - - if (!handle) - return NULL; - - dbus_result = g_dbus_connection_call_sync(handle->dbus_connection, - DBUS_TELEPHONY_SERVICE , handle->path, DBUS_TELEPHONY_MODEM_INTERFACE, - "GetIMEI", NULL, NULL, - G_DBUS_CALL_FLAGS_NONE, -1, NULL, NULL); - - g_variant_get (dbus_result, "(is)", &result, &imei); - - return imei; -} - -EXPORT_API int tel_get_misc_me_sn(TapiHandle *handle, tapi_response_cb callback, void *user_data) -{ - struct tapi_resp_data *evt_cb_data = NULL; - - dbg("Func Entrance"); - - MAKE_RESP_CB_DATA(evt_cb_data, handle, callback, user_data); - - g_dbus_connection_call(handle->dbus_connection, - DBUS_TELEPHONY_SERVICE , handle->path, DBUS_TELEPHONY_MODEM_INTERFACE, - "GetSerialNumber", NULL, NULL, - G_DBUS_CALL_FLAGS_NONE, -1, handle->ca, - on_response_get_serial_number, evt_cb_data); - - return TAPI_API_SUCCESS; -} - -EXPORT_API char *tel_get_misc_me_sn_sync(TapiHandle *handle) -{ - GVariant *dbus_result; - char *sn = NULL; - int result = 0; - - dbg("Func Entrance"); - - if (!handle) - return NULL; - - dbus_result = g_dbus_connection_call_sync(handle->dbus_connection, - DBUS_TELEPHONY_SERVICE , handle->path, DBUS_TELEPHONY_MODEM_INTERFACE, - "GetSerialNumber", NULL, NULL, - G_DBUS_CALL_FLAGS_NONE, -1, NULL, NULL); - - g_variant_get (dbus_result, "(is)", &result, &sn); - - return sn; -} - -EXPORT_API int tel_check_modem_power_status(TapiHandle *handle, int *result) -{ - return tel_get_property_int(handle, TAPI_PROP_MODEM_POWER, result); -} - -EXPORT_API int tel_control_modem_dun_pin_ctrl(TapiHandle *handle, tapi_ps_btdun_pincontrol *pincontrol, tapi_response_cb callback, void *user_data) -{ - struct tapi_resp_data *evt_cb_data = NULL; - GVariant *param; - - dbg("Func Entrance "); - - if (!handle || !handle->dbus_connection || !pincontrol){ - dbg("invalid parameter"); - return TAPI_API_INVALID_INPUT; - } - - MAKE_RESP_CB_DATA(evt_cb_data, handle, callback, user_data); - - param = g_variant_new("(ib)", pincontrol->signal, pincontrol->status); - - g_dbus_connection_call(handle->dbus_connection, - DBUS_TELEPHONY_SERVICE , handle->path, DBUS_TELEPHONY_MODEM_INTERFACE, - "SetDunPinCtrl", param, NULL, - G_DBUS_CALL_FLAGS_NONE, -1, handle->ca, - on_response_set_dun_pin_ctrl, evt_cb_data); - - return TAPI_API_SUCCESS; -} diff --git a/mobile/src/tapi_network.c b/mobile/src/tapi_network.c deleted file mode 100644 index 4367534..0000000 --- a/mobile/src/tapi_network.c +++ /dev/null @@ -1,927 +0,0 @@ -/* - * libslp-tapi - * - * Copyright (c) 2012 Samsung Electronics Co., Ltd. All rights reserved. - * - * Contact: Ja-young Gu - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT 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 "TapiUtility.h" -#include "TelNetwork.h" - -#include "common.h" -#include "tapi_log.h" -#include "ITapiNetwork.h" - -static int _convert_systemtype_to_act(int type) -{ - switch (type) { - case TAPI_NETWORK_SYSTEM_GSM: - return 0x1; - break; - - case TAPI_NETWORK_SYSTEM_GPRS: - return 0x2; - break; - - case TAPI_NETWORK_SYSTEM_EGPRS: - return 0x3; - break; - - case TAPI_NETWORK_SYSTEM_PCS1900: - break; - - case TAPI_NETWORK_SYSTEM_UMTS: - return 0x4; - break; - - case TAPI_NETWORK_SYSTEM_GSM_AND_UMTS: - return 0x5; - break; - - case TAPI_NETWORK_SYSTEM_IS95A: - return 0x11; - break; - - case TAPI_NETWORK_SYSTEM_IS95B: - return 0x12; - break; - - case TAPI_NETWORK_SYSTEM_CDMA_1X: - return 0x13; - break; - - case TAPI_NETWORK_SYSTEM_EVDO_REV_0: - return 0x14; - break; - - case TAPI_NETWORK_SYSTEM_1X_EVDO_REV_0_HYBRID: - return 0x15; - break; - - case TAPI_NETWORK_SYSTEM_EVDO_REV_A: - return 0x16; - break; - - case TAPI_NETWORK_SYSTEM_1X_EVDO_REV_A_HYBRID: - return 0x17; - break; - - case TAPI_NETWORK_SYSTEM_EVDV: - return 0x18; - break; - - case TAPI_NETWORK_SYSTEM_LTE: - return 0x21; - break; - - default: - break; - } - - return 0xFF; -} - -static int _convert_act_to_systemtype(int act) -{ - switch (act) { - case 0x1: - return TAPI_NETWORK_SYSTEM_GSM; - break; - - case 0x2: - return TAPI_NETWORK_SYSTEM_GPRS; - break; - - case 0x3: - return TAPI_NETWORK_SYSTEM_EGPRS; - break; - - case 0x4: - return TAPI_NETWORK_SYSTEM_UMTS; - break; - - case 0x5: - return TAPI_NETWORK_SYSTEM_GSM_AND_UMTS; - break; - - case 0x11: - return TAPI_NETWORK_SYSTEM_IS95A; - break; - - case 0x12: - return TAPI_NETWORK_SYSTEM_IS95B; - break; - - case 0x13: - return TAPI_NETWORK_SYSTEM_CDMA_1X; - break; - - case 0x14: - return TAPI_NETWORK_SYSTEM_EVDO_REV_0; - break; - - case 0x15: - return TAPI_NETWORK_SYSTEM_1X_EVDO_REV_0_HYBRID; - break; - - case 0x16: - return TAPI_NETWORK_SYSTEM_EVDO_REV_A; - break; - - case 0x17: - return TAPI_NETWORK_SYSTEM_1X_EVDO_REV_A_HYBRID; - break; - - case 0x18: - return TAPI_NETWORK_SYSTEM_EVDV; - break; - - case 0x21: - return TAPI_NETWORK_SYSTEM_LTE; - break; - - default: - break; - } - - return TAPI_NETWORK_SYSTEM_NO_SRV; -} - -static void on_response_search_network(GObject *source_object, GAsyncResult *res, gpointer user_data) -{ - GError *error = NULL; - GDBusConnection *conn = NULL; - struct tapi_resp_data *evt_cb_data = user_data; - int result = -1; - int i; - - TelNetworkPlmnList_t list; - - GVariant *dbus_result = NULL; - GVariant *value = NULL; - GVariantIter *iter = NULL; - GVariantIter *iter_row = NULL; - const gchar *key = NULL; - - memset(&list, 0, sizeof(TelNetworkPlmnList_t)); - - conn = G_DBUS_CONNECTION (source_object); - - dbus_result = g_dbus_connection_call_finish(conn, res, &error); - CHECK_DEINIT(error); - - if (!dbus_result) { - if (evt_cb_data->cb_fn) { - evt_cb_data->cb_fn(evt_cb_data->handle, -1, NULL, evt_cb_data->user_data); - } - - if (error) - g_error_free(error); - - free(evt_cb_data); - return; - } - - g_variant_get (dbus_result, "(aa{sv}i)", &iter, &result); - - list.networks_count = g_variant_iter_n_children(iter); - - i = 0; - while (g_variant_iter_next(iter, "a{sv}", &iter_row)) { - while (g_variant_iter_loop(iter_row, "{sv}", &key, &value)) { - if (!g_strcmp0(key, "plmn")) { - list.network_list[i].plmn_id = atoi(g_variant_get_string(value, NULL)); - strncpy(list.network_list[i].plmn, g_variant_get_string(value, NULL), TAPI_NETWORK_PLMN_LEN_MAX); - } - if (!g_strcmp0(key, "act")) { - list.network_list[i].access_technology = _convert_act_to_systemtype(g_variant_get_int32(value)); - } - if (!g_strcmp0(key, "type")) { - list.network_list[i].type_of_plmn = g_variant_get_int32(value); - } - if (!g_strcmp0(key, "name")) { - strncpy(list.network_list[i].network_name, g_variant_get_string(value, NULL), 40); - } - } - i++; - g_variant_iter_free(iter_row); - } - g_variant_iter_free(iter); - - if (evt_cb_data->cb_fn) { - evt_cb_data->cb_fn(evt_cb_data->handle, result, &list, evt_cb_data->user_data); - } - - free(evt_cb_data); -} - -static void on_response_get_network_selection_mode(GObject *source_object, GAsyncResult *res, gpointer user_data) -{ - GError *error = NULL; - GDBusConnection *conn = NULL; - struct tapi_resp_data *evt_cb_data = user_data; - int result = -1; - - GVariant *dbus_result; - int mode = 0; - - conn = G_DBUS_CONNECTION (source_object); - dbus_result = g_dbus_connection_call_finish(conn, res, &error); - CHECK_DEINIT(error); - - if (!dbus_result) { - if (evt_cb_data->cb_fn) { - evt_cb_data->cb_fn(evt_cb_data->handle, -1, NULL, evt_cb_data->user_data); - } - - if (error) - g_error_free(error); - - free(evt_cb_data); - return; - } - - g_variant_get (dbus_result, "(ii)", &mode, &result); - - if (evt_cb_data->cb_fn) { - evt_cb_data->cb_fn(evt_cb_data->handle, result, &mode, evt_cb_data->user_data); - } - - free(evt_cb_data); -} - -static void on_response_default_set(GObject *source_object, GAsyncResult *res, gpointer user_data) -{ - GError *error = NULL; - GDBusConnection *conn = NULL; - struct tapi_resp_data *evt_cb_data = user_data; - int result = -1; - - GVariant *dbus_result; - - conn = G_DBUS_CONNECTION (source_object); - dbus_result = g_dbus_connection_call_finish(conn, res, &error); - CHECK_DEINIT(error); - - if (!dbus_result) { - if (evt_cb_data->cb_fn) { - evt_cb_data->cb_fn(evt_cb_data->handle, -1, NULL, evt_cb_data->user_data); - } - - if (error) - g_error_free(error); - - free(evt_cb_data); - return; - } - - - g_variant_get (dbus_result, "(i)", &result); - - if (evt_cb_data->cb_fn) { - evt_cb_data->cb_fn(evt_cb_data->handle, result, NULL, evt_cb_data->user_data); - } - - free(evt_cb_data); -} - -static void on_response_get_network_preferred_plmn(GDBusConnection *conn, GAsyncResult *res, gpointer user_data) -{ - GError *error = NULL; - struct tapi_resp_data *evt_cb_data = user_data; - int result = -1; - int i; - - TelNetworkPreferredPlmnList_t list; - - GVariant *dbus_result = NULL; - GVariant *value = NULL; - GVariantIter *iter = NULL; - GVariantIter *iter_row = NULL; - const gchar *key = NULL; - - memset(&list, 0, sizeof(TelNetworkPreferredPlmnList_t)); - - dbus_result = g_dbus_connection_call_finish(conn, res, &error); - CHECK_DEINIT(error); - - if (!dbus_result) { - if (evt_cb_data->cb_fn) { - evt_cb_data->cb_fn(evt_cb_data->handle, -1, &list, evt_cb_data->user_data); - } - - if (error) - g_error_free(error); - - free(evt_cb_data); - return; - } - - g_variant_get (dbus_result, "(aa{sv}i)", &iter, &result); - - list.NumOfPrefPlmns = g_variant_iter_n_children(iter); - - if (list.NumOfPrefPlmns == 0) { - dbg("num_of_.. = 0"); - if (evt_cb_data->cb_fn) { - evt_cb_data->cb_fn(evt_cb_data->handle, result, &list, evt_cb_data->user_data); - } - - free(evt_cb_data); - return; - } - - i = 0; - while (g_variant_iter_next(iter, "a{sv}", &iter_row)) { - while (g_variant_iter_loop(iter_row, "{sv}", &key, &value)) { - if (!g_strcmp0(key, "plmn")) { - strncpy(list.PrefPlmnRecord[i].Plmn, g_variant_get_string(value, NULL), 6); - } - if (!g_strcmp0(key, "act")) { - list.PrefPlmnRecord[i].SystemType = _convert_act_to_systemtype(g_variant_get_int32(value)); - } - if (!g_strcmp0(key, "index")) { - list.PrefPlmnRecord[i].Index = g_variant_get_int32(value); - } - if (!g_strcmp0(key, "name")) { - strncpy(list.PrefPlmnRecord[i].network_name, g_variant_get_string(value, NULL), 40); - } - } - i++; - g_variant_iter_free(iter_row); - } - g_variant_iter_free(iter); - - if (evt_cb_data->cb_fn) { - evt_cb_data->cb_fn(evt_cb_data->handle, result, &list, evt_cb_data->user_data); - } - - free(evt_cb_data); -} - -static void on_response_get_network_band(GObject *source_object, GAsyncResult *res, gpointer user_data) -{ - GError *error = NULL; - GDBusConnection *conn = NULL; - struct tapi_resp_data *evt_cb_data = user_data; - int result = -1; - - GVariant *dbus_result; - int band = 0; - int mode = 0; - - conn = G_DBUS_CONNECTION (source_object); - dbus_result = g_dbus_connection_call_finish(conn, res, &error); - CHECK_DEINIT(error); - - if (!dbus_result) { - if (evt_cb_data->cb_fn) { - evt_cb_data->cb_fn(evt_cb_data->handle, -1, NULL, evt_cb_data->user_data); - } - - if (error) - g_error_free(error); - - free(evt_cb_data); - return; - } - - g_variant_get (dbus_result, "(iii)", &band, &mode, &result); - - if (evt_cb_data->cb_fn) { - evt_cb_data->cb_fn(evt_cb_data->handle, result, &band, evt_cb_data->user_data); - } - - free(evt_cb_data); -} - -static void on_response_get_network_mode(GObject *source_object, GAsyncResult *res, gpointer user_data) -{ - GError *error = NULL; - GDBusConnection *conn = NULL; - struct tapi_resp_data *evt_cb_data = user_data; - int result = -1; - - GVariant *dbus_result; - int mode = 0; - - conn = G_DBUS_CONNECTION (source_object); - dbus_result = g_dbus_connection_call_finish(conn, res, &error); - CHECK_DEINIT(error); - - if (!dbus_result) { - if (evt_cb_data->cb_fn) { - evt_cb_data->cb_fn(evt_cb_data->handle, -1, NULL, evt_cb_data->user_data); - } - - if (error) - g_error_free(error); - - free(evt_cb_data); - return; - } - - g_variant_get (dbus_result, "(ii)", &mode, &result); - - if (evt_cb_data->cb_fn) { - evt_cb_data->cb_fn(evt_cb_data->handle, result, &mode, evt_cb_data->user_data); - } - - free(evt_cb_data); -} - -static void on_response_get_network_service_domain(GObject *source_object, GAsyncResult *res, gpointer user_data) -{ - GError *error = NULL; - GDBusConnection *conn = NULL; - struct tapi_resp_data *evt_cb_data = user_data; - int result = -1; - - GVariant *dbus_result; - int domain = 0; - - conn = G_DBUS_CONNECTION (source_object); - dbus_result = g_dbus_connection_call_finish(conn, res, &error); - CHECK_DEINIT(error); - - if (!dbus_result) { - if (evt_cb_data->cb_fn) { - evt_cb_data->cb_fn(evt_cb_data->handle, -1, NULL, evt_cb_data->user_data); - } - - if (error) - g_error_free(error); - - free(evt_cb_data); - return; - } - - g_variant_get (dbus_result, "(ii)", &domain, &result); - - if (evt_cb_data->cb_fn) { - evt_cb_data->cb_fn(evt_cb_data->handle, result, &domain, evt_cb_data->user_data); - } - - free(evt_cb_data); -} - -static void on_response_get_network_serving(GObject *source_object, GAsyncResult *res, gpointer user_data) -{ - GError *error = NULL; - GDBusConnection *conn = NULL; - struct tapi_resp_data *evt_cb_data = user_data; - int result = -1; - - TelNetworkServing_t data; - - GVariant *dbus_result; - char *plmn; - - memset(&data, 0, sizeof(TelNetworkServing_t)); - - conn = G_DBUS_CONNECTION (source_object); - dbus_result = g_dbus_connection_call_finish(conn, res, &error); - CHECK_DEINIT(error); - - if (!dbus_result) { - if (evt_cb_data->cb_fn) { - evt_cb_data->cb_fn(evt_cb_data->handle, -1, NULL, evt_cb_data->user_data); - } - - if (error) - g_error_free(error); - - free(evt_cb_data); - return; - } - - g_variant_get (dbus_result, "(isii)", - &data.act, - &plmn, - &data.lac, - &result); - - data.act = _convert_act_to_systemtype(data.act); - - if (plmn) { - snprintf(data.plmn, 7, "%s", plmn); - free(plmn); - } - - if (evt_cb_data->cb_fn) { - evt_cb_data->cb_fn(evt_cb_data->handle, result, &data, evt_cb_data->user_data); - } - - free(evt_cb_data); -} - -static void on_response_get_neighboring_cell_info(GObject *source_object, GAsyncResult *res, gpointer user_data) -{ - GError *error = NULL; - GDBusConnection *conn = NULL; - struct tapi_resp_data *evt_cb_data = user_data; - int result = -1; - int geran_index=0, umts_index=0; - - TelNetworkNeighboringCellInfo_t list; - - GVariant *dbus_result = NULL; - GVariant *value = NULL; - GVariantIter *iter = NULL; - GVariantIter *iter_row = NULL; - const gchar *key = NULL; - gint v0, v1,v2,v3,v4; - - memset(&list, 0, sizeof(TelNetworkNeighboringCellInfo_t)); - - dbg("enter"); - conn = G_DBUS_CONNECTION (source_object); - - dbus_result = g_dbus_connection_call_finish(conn, res, &error); - CHECK_DEINIT(error); - - if (!dbus_result) { - if (evt_cb_data->cb_fn) { - evt_cb_data->cb_fn(evt_cb_data->handle, -1, NULL, evt_cb_data->user_data); - } - - if (error) - g_error_free(error); - - free(evt_cb_data); - return; - } - - g_variant_get (dbus_result, "(aa{sv}i)", &iter, &result); - - while (g_variant_iter_next(iter, "a{sv}", &iter_row)) { - while (g_variant_iter_loop(iter_row, "{sv}", &key, &value)) { - g_variant_get(value, "(iiiii)", &v0,&v1,&v2,&v3,&v4); - if (!g_strcmp0(key, "geran")) { - list.geran_list[geran_index].cell_id = v0; - list.geran_list[geran_index].lac = v1; - list.geran_list[geran_index].bcch = v2; - list.geran_list[geran_index].bsic = v3; - list.geran_list[geran_index].rxlev = v4; - geran_index++; - } - else if (!g_strcmp0(key, "umts")) { - list.umts_list[umts_index].cell_id = v0; - list.umts_list[umts_index].lac = v1; - list.umts_list[umts_index].arfcn = v2; - list.umts_list[umts_index].psc = v3; - list.umts_list[umts_index].rscp = v4; - umts_index++; - } - } - g_variant_iter_free(iter_row); - } - g_variant_iter_free(iter); - - list.geran_list_count = geran_index; - list.umts_list_count = umts_index; - dbg("geran_list_count=%d, umts_list_count=%d", geran_index, umts_index); - - if (evt_cb_data->cb_fn) { - evt_cb_data->cb_fn(evt_cb_data->handle, result, &list, evt_cb_data->user_data); - } - - free(evt_cb_data); -} - -EXPORT_API int tel_search_network(TapiHandle *handle, tapi_response_cb callback, void *user_data) -{ - struct tapi_resp_data *evt_cb_data = NULL; - - dbg("Func Entrance"); - - MAKE_RESP_CB_DATA(evt_cb_data, handle, callback, user_data); - - g_dbus_connection_call(handle->dbus_connection, - DBUS_TELEPHONY_SERVICE , handle->path, DBUS_TELEPHONY_NETWORK_INTERFACE, - "Search", NULL, NULL, - G_DBUS_CALL_FLAGS_NONE, 180000, handle->ca, - on_response_search_network, evt_cb_data); - - return TAPI_API_SUCCESS; -} - -EXPORT_API int tel_get_network_selection_mode(struct tapi_handle *handle, tapi_response_cb callback, void *user_data) -{ - struct tapi_resp_data *evt_cb_data = NULL; - - dbg("Func Entrance"); - - MAKE_RESP_CB_DATA(evt_cb_data, handle, callback, user_data); - - g_dbus_connection_call(handle->dbus_connection, - DBUS_TELEPHONY_SERVICE , handle->path, DBUS_TELEPHONY_NETWORK_INTERFACE, - "GetSelectionMode", NULL, NULL, - G_DBUS_CALL_FLAGS_NONE, -1, handle->ca, - on_response_get_network_selection_mode, evt_cb_data); - - return TAPI_API_SUCCESS; -} - -EXPORT_API int tel_select_network_automatic(struct tapi_handle *handle, tapi_response_cb callback, void *user_data) -{ - struct tapi_resp_data *evt_cb_data = NULL; - GVariant *param; - - dbg("Func Entrance"); - - MAKE_RESP_CB_DATA(evt_cb_data, handle, callback, user_data); - - param = g_variant_new("(isi)", - 0, /* Automatic */ - "", - 0); - - g_dbus_connection_call(handle->dbus_connection, - DBUS_TELEPHONY_SERVICE , handle->path, DBUS_TELEPHONY_NETWORK_INTERFACE, - "SetSelectionMode", param, NULL, - G_DBUS_CALL_FLAGS_NONE, 180000, handle->ca, - on_response_default_set, evt_cb_data); - - return TAPI_API_SUCCESS; -} - -EXPORT_API int tel_select_network_manual(struct tapi_handle *handle, const char *plmn, int type, tapi_response_cb callback, void *user_data) -{ - struct tapi_resp_data *evt_cb_data = NULL; - GVariant *param; - - dbg("Func Entrance"); - - MAKE_RESP_CB_DATA(evt_cb_data, handle, callback, user_data); - - param = g_variant_new("(isi)", - 1, /* Manual */ - plmn, - _convert_systemtype_to_act(type)); - - g_dbus_connection_call(handle->dbus_connection, - DBUS_TELEPHONY_SERVICE , handle->path, DBUS_TELEPHONY_NETWORK_INTERFACE, - "SetSelectionMode", param, NULL, - G_DBUS_CALL_FLAGS_NONE, 180000, handle->ca, - on_response_default_set, evt_cb_data); - - return TAPI_API_SUCCESS; -} - -EXPORT_API int tel_set_network_preferred_plmn( - TapiHandle *handle, - TelNetworkPreferredPlmnOp_t operation, - TelNetworkPreferredPlmnInfo_t *info, - tapi_response_cb callback, - void *user_data) -{ - struct tapi_resp_data *evt_cb_data = NULL; - GVariant *param; - int act = 0; - - dbg("Func Entrance"); - - MAKE_RESP_CB_DATA(evt_cb_data, handle, callback, user_data); - - switch (info->SystemType) { - case TAPI_NETWORK_SYSTEM_GSM: - act = 1; - break; - - case TAPI_NETWORK_SYSTEM_UMTS: - act = 4; - break; - - case TAPI_NETWORK_SYSTEM_GPRS: - act = 2; - break; - - case TAPI_NETWORK_SYSTEM_EGPRS: - act = 3; - break; - - case TAPI_NETWORK_SYSTEM_GSM_AND_UMTS: - act = 4; - break; - - default: - act = 4; - break; - } - - param = g_variant_new("(iiis)", - operation, - info->Index, - act, - info->Plmn); - - g_dbus_connection_call(handle->dbus_connection, - DBUS_TELEPHONY_SERVICE , handle->path, DBUS_TELEPHONY_NETWORK_INTERFACE, - "SetPreferredPlmn", param, NULL, - G_DBUS_CALL_FLAGS_NONE, -1, handle->ca, - on_response_default_set, evt_cb_data); - - return TAPI_API_SUCCESS; -} - -EXPORT_API int tel_get_network_preferred_plmn(TapiHandle *handle, tapi_response_cb callback, void *user_data) -{ - struct tapi_resp_data *evt_cb_data = NULL; - - dbg("Func Entrance"); - - MAKE_RESP_CB_DATA(evt_cb_data, handle, callback, user_data); - - g_dbus_connection_call(handle->dbus_connection, - DBUS_TELEPHONY_SERVICE , handle->path, DBUS_TELEPHONY_NETWORK_INTERFACE, - "GetPreferredPlmn", NULL, NULL, - G_DBUS_CALL_FLAGS_NONE, -1, handle->ca, - (GAsyncReadyCallback) on_response_get_network_preferred_plmn, evt_cb_data); - - return TAPI_API_SUCCESS; -} - -EXPORT_API int tel_set_network_band(TapiHandle *handle, TelNetworkBandPreferred_t mode, TelNetworkBand_t band, tapi_response_cb callback, void *user_data) -{ - struct tapi_resp_data *evt_cb_data = NULL; - GVariant *param; - - dbg("Func Entrance"); - - MAKE_RESP_CB_DATA(evt_cb_data, handle, callback, user_data); - - param = g_variant_new("(ii)", - band, - mode); - - g_dbus_connection_call(handle->dbus_connection, - DBUS_TELEPHONY_SERVICE , handle->path, DBUS_TELEPHONY_NETWORK_INTERFACE, - "SetBand", param, NULL, - G_DBUS_CALL_FLAGS_NONE, -1, handle->ca, - on_response_default_set, evt_cb_data); - - return TAPI_API_SUCCESS; -} - -EXPORT_API int tel_get_network_band(TapiHandle *handle, tapi_response_cb callback, void *user_data) -{ - struct tapi_resp_data *evt_cb_data = NULL; - - dbg("Func Entrance"); - - MAKE_RESP_CB_DATA(evt_cb_data, handle, callback, user_data); - - g_dbus_connection_call(handle->dbus_connection, - DBUS_TELEPHONY_SERVICE , handle->path, DBUS_TELEPHONY_NETWORK_INTERFACE, - "GetBand", NULL, NULL, - G_DBUS_CALL_FLAGS_NONE, -1, handle->ca, - on_response_get_network_band, evt_cb_data); - - return TAPI_API_SUCCESS; -} - -EXPORT_API int tel_set_network_mode(TapiHandle *handle, int mode, tapi_response_cb callback, void *user_data) -{ - struct tapi_resp_data *evt_cb_data = NULL; - GVariant *param; - - dbg("Func Entrance"); - - MAKE_RESP_CB_DATA(evt_cb_data, handle, callback, user_data); - - param = g_variant_new("(i)", - mode); - - g_dbus_connection_call(handle->dbus_connection, - DBUS_TELEPHONY_SERVICE , handle->path, DBUS_TELEPHONY_NETWORK_INTERFACE, - "SetMode", param, NULL, - G_DBUS_CALL_FLAGS_NONE, -1, handle->ca, - on_response_default_set, evt_cb_data); - - return TAPI_API_SUCCESS; -} - -EXPORT_API int tel_get_network_mode(TapiHandle *handle, tapi_response_cb callback, void *user_data) -{ - struct tapi_resp_data *evt_cb_data = NULL; - - dbg("Func Entrance"); - - MAKE_RESP_CB_DATA(evt_cb_data, handle, callback, user_data); - - g_dbus_connection_call(handle->dbus_connection, - DBUS_TELEPHONY_SERVICE , handle->path, DBUS_TELEPHONY_NETWORK_INTERFACE, - "GetMode", NULL, NULL, - G_DBUS_CALL_FLAGS_NONE, -1, handle->ca, - on_response_get_network_mode, evt_cb_data); - - return TAPI_API_SUCCESS; -} - -EXPORT_API int tel_set_network_service_domain(TapiHandle *handle, TelNetworkServiceDomain_t domain, tapi_response_cb callback, void *user_data) -{ - struct tapi_resp_data *evt_cb_data = NULL; - GVariant *param; - - dbg("Func Entrance"); - - MAKE_RESP_CB_DATA(evt_cb_data, handle, callback, user_data); - - param = g_variant_new("(i)", domain); - - g_dbus_connection_call(handle->dbus_connection, - DBUS_TELEPHONY_SERVICE , handle->path, DBUS_TELEPHONY_NETWORK_INTERFACE, - "SetServiceDomain", param, NULL, - G_DBUS_CALL_FLAGS_NONE, -1, handle->ca, - on_response_default_set, evt_cb_data); - - return TAPI_API_SUCCESS; -} - -EXPORT_API int tel_get_network_service_domain(TapiHandle *handle, tapi_response_cb callback, void *user_data) -{ - struct tapi_resp_data *evt_cb_data = NULL; - - dbg("Func Entrance"); - - MAKE_RESP_CB_DATA(evt_cb_data, handle, callback, user_data); - - g_dbus_connection_call(handle->dbus_connection, - DBUS_TELEPHONY_SERVICE , handle->path, DBUS_TELEPHONY_NETWORK_INTERFACE, - "GetServiceDomain", NULL, NULL, - G_DBUS_CALL_FLAGS_NONE, -1, handle->ca, - on_response_get_network_service_domain, evt_cb_data); - - return TAPI_API_SUCCESS; -} - -EXPORT_API int tel_cancel_network_manual_search(TapiHandle *handle, tapi_response_cb callback, void *user_data) -{ - struct tapi_resp_data *evt_cb_data = NULL; - - dbg("Func Entrance"); - - MAKE_RESP_CB_DATA(evt_cb_data, handle, callback, user_data); - - g_dbus_connection_call(handle->dbus_connection, - DBUS_TELEPHONY_SERVICE , handle->path, DBUS_TELEPHONY_NETWORK_INTERFACE, - "SearchCancel", NULL, NULL, - G_DBUS_CALL_FLAGS_NONE, -1, handle->ca, - on_response_default_set, evt_cb_data); - - return TAPI_API_SUCCESS; -} - -EXPORT_API int tel_get_network_serving(TapiHandle *handle, tapi_response_cb callback, void *user_data) -{ - struct tapi_resp_data *evt_cb_data = NULL; - - dbg("Func Entrance"); - - MAKE_RESP_CB_DATA(evt_cb_data, handle, callback, user_data); - - g_dbus_connection_call(handle->dbus_connection, - DBUS_TELEPHONY_SERVICE , handle->path, DBUS_TELEPHONY_NETWORK_INTERFACE, - "GetServingNetwork", NULL, NULL, - G_DBUS_CALL_FLAGS_NONE, -1, handle->ca, - on_response_get_network_serving, evt_cb_data); - - return TAPI_API_SUCCESS; -} - -EXPORT_API int tel_get_network_neighboring_cell_info(TapiHandle *handle, tapi_response_cb callback, void *user_data) -{ - struct tapi_resp_data *evt_cb_data = NULL; - - dbg("Func Entrance"); - - MAKE_RESP_CB_DATA(evt_cb_data, handle, callback, user_data); - - g_dbus_connection_call(handle->dbus_connection, - DBUS_TELEPHONY_SERVICE , handle->path, DBUS_TELEPHONY_NETWORK_INTERFACE, - "GetNgbrCellInfo", NULL, NULL, - G_DBUS_CALL_FLAGS_NONE, -1, handle->ca, - on_response_get_neighboring_cell_info, evt_cb_data); - - return TAPI_API_SUCCESS; -} - diff --git a/mobile/src/tapi_phonebook.c b/mobile/src/tapi_phonebook.c deleted file mode 100644 index 4f95971..0000000 --- a/mobile/src/tapi_phonebook.c +++ /dev/null @@ -1,679 +0,0 @@ -/* - * libslp-tapi - * - * Copyright (c) 2012 Samsung Electronics Co., Ltd. All rights reserved. - * - * Contact: Ja-young Gu - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT 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 "TapiUtility.h" -#include "TelSim.h" - -#include "common.h" -#include "tapi_log.h" -#include "ITapiPhonebook.h" - -static int _tel_check_pb_state(TapiHandle *handle) -{ - GError *gerr = NULL; - GVariant *sync_gv = NULL; - int api_err = TAPI_API_SUCCESS; - TelSimPbList_t pb_list; - int init_status = 0; - - sync_gv = g_dbus_connection_call_sync(handle->dbus_connection, DBUS_TELEPHONY_SERVICE, - handle->path, DBUS_TELEPHONY_PB_INTERFACE, "GetInitStatus", NULL, NULL, - G_DBUS_CALL_FLAGS_NONE, -1, NULL, &gerr); - - if (sync_gv) { - g_variant_get(sync_gv, "(ibbbbbb)", - &init_status, - &pb_list.b_fdn, - &pb_list.b_adn, - &pb_list.b_sdn, - &pb_list.b_3g, - &pb_list.b_aas, - &pb_list.b_gas); - - if(init_status == 1) - api_err = TAPI_API_SUCCESS; - else - api_err = TAPI_API_INVALID_OPERATION; - - } else { - dbg( "g_dbus_conn failed in _tel_check_pb_state. error (%s)", gerr->message); - g_error_free(gerr); - return TAPI_API_OPERATION_FAILED; - } - - return api_err; -} - -static void on_response_get_sim_pb_count(GObject *source_object, GAsyncResult *res, gpointer user_data) -{ - GError *error = NULL; - GDBusConnection *conn = NULL; - GVariant *dbus_result; - - struct tapi_resp_data *evt_cb_data = user_data; - TelSimPbAccessResult_t result = TAPI_SIM_PB_SUCCESS; - TelSimPbStorageInfo_t pb_cnt ; - gint used = 0, total = 0; - - memset(&pb_cnt, 0, sizeof(TelSimPbStorageInfo_t)); - - conn = G_DBUS_CONNECTION (source_object); - dbus_result = g_dbus_connection_call_finish(conn, res, &error); - CHECK_DEINIT(error); - - if (!dbus_result) { - if (evt_cb_data->cb_fn) { - evt_cb_data->cb_fn(evt_cb_data->handle, -1, NULL, evt_cb_data->user_data); - } - - if (error) - g_error_free(error); - - free(evt_cb_data); - return; - } - - g_variant_get (dbus_result, "(iiii)", - &result, - &pb_cnt.StorageFileType, - &used, - &total); - - pb_cnt.UsedRecordCount = used; - pb_cnt.TotalRecordCount = total; - - if (evt_cb_data->cb_fn) { - evt_cb_data->cb_fn(evt_cb_data->handle, result, &pb_cnt, evt_cb_data->user_data); - } - - free(evt_cb_data); -} - -static void on_response_get_sim_pb_meta_info(GObject *source_object, GAsyncResult *res, gpointer user_data) -{ - GError *error = NULL; - GDBusConnection *conn = NULL; - GVariant *dbus_result; - - struct tapi_resp_data *evt_cb_data = user_data; - TelSimPbAccessResult_t result = TAPI_SIM_PB_SUCCESS; - TelSimPbEntryInfo_t pb_entry ; - - gint imin = 0, imax = 0, nmax = 0, tmax = 0; - - memset(&pb_entry, 0, sizeof(TelSimPbEntryInfo_t)); - - conn = G_DBUS_CONNECTION (source_object); - dbus_result = g_dbus_connection_call_finish(conn, res, &error); - CHECK_DEINIT(error); - - if (!dbus_result) { - if (evt_cb_data->cb_fn) { - evt_cb_data->cb_fn(evt_cb_data->handle, -1, NULL, evt_cb_data->user_data); - } - - if (error) - g_error_free(error); - - free(evt_cb_data); - return; - } - - g_variant_get (dbus_result, "(iiiiii)", - &result, - &pb_entry.StorageFileType, - &imin, - &imax, - &nmax, - &tmax); - - pb_entry.PbIndexMin = imin; - pb_entry.PbIndexMax = imax; - pb_entry.PbNumLenMax =nmax; - pb_entry.PbTextLenMax = tmax; - - if (evt_cb_data->cb_fn) { - evt_cb_data->cb_fn(evt_cb_data->handle, result, &pb_entry, evt_cb_data->user_data); - } - - free(evt_cb_data); -} - -static void on_response_get_sim_pb_usim_meta_info(GObject *source_object, GAsyncResult *res, gpointer user_data) -{ - GError *error = NULL; - GDBusConnection *conn = NULL; - GVariant *dbus_result; - GVariant *value = NULL; - GVariantIter *iter = NULL; - GVariantIter *iter_row = NULL; - const gchar *key = NULL; - struct tapi_resp_data *evt_cb_data = user_data; - TelSimPbAccessResult_t result = TAPI_SIM_PB_SUCCESS; - TelSimPbCapabilityInfo_t list ; - int i = 0; - - dbg("Func Entrance"); - memset(&list, 0, sizeof(TelSimPbCapabilityInfo_t)); - - conn = G_DBUS_CONNECTION (source_object); - dbus_result = g_dbus_connection_call_finish(conn, res, &error); - CHECK_DEINIT(error); - - if (!dbus_result) { - if (evt_cb_data->cb_fn) { - evt_cb_data->cb_fn(evt_cb_data->handle, -1, NULL, evt_cb_data->user_data); - } - - if (error) - g_error_free(error); - - free(evt_cb_data); - return; - } - - g_variant_get(dbus_result, "(iaa{sv})", &result, &iter); - list.FileTypeCount = g_variant_iter_n_children(iter); - - i = 0; - while (g_variant_iter_next(iter, "a{sv}", &iter_row)) { - while (g_variant_iter_loop(iter_row, "{sv}", &key, &value)) { - if (!g_strcmp0(key, "field_type")) { - list.FileTypeInfo[i].field_type = g_variant_get_int32(value); - } - if (!g_strcmp0(key, "index_max")) { - list.FileTypeInfo[i].index_max = g_variant_get_int32(value); - } - if (!g_strcmp0(key, "text_max")) { - list.FileTypeInfo[i].text_max = g_variant_get_int32(value); - } - if (!g_strcmp0(key, "used_count")) { - list.FileTypeInfo[i].used_count = g_variant_get_int32(value); - } - } - i++; - g_variant_iter_free(iter_row); - } - g_variant_iter_free(iter); - - if (evt_cb_data->cb_fn) { - evt_cb_data->cb_fn(evt_cb_data->handle, result, &list, evt_cb_data->user_data); - } - - free(evt_cb_data); -} - -static void on_response_read_sim_pb_record(GObject *source_object, GAsyncResult *res, gpointer user_data) -{ - GError *error = NULL; - GDBusConnection *conn = NULL; - GVariant *dbus_result; - - struct tapi_resp_data *evt_cb_data = user_data; - TelSimPbAccessResult_t result = TAPI_SIM_PB_SUCCESS; - TelSimPbRecord_t pb_rec ; - - gint i = 0, ni = 0; - gchar *name = NULL; - gchar *number = NULL; - gchar *sne = NULL; - gchar *anr1 = NULL; - gchar *anr2 = NULL; - gchar *anr3 = NULL; - gchar *email1 = NULL; - gchar *email2 = NULL; - gchar *email3 = NULL; - gchar *email4 = NULL; - - memset(&pb_rec, 0, sizeof(TelSimPbRecord_t)); - - conn = G_DBUS_CONNECTION (source_object); - dbus_result = g_dbus_connection_call_finish(conn, res, &error); - CHECK_DEINIT(error); - - if (!dbus_result) { - if (evt_cb_data->cb_fn) { - evt_cb_data->cb_fn(evt_cb_data->handle, -1, NULL, evt_cb_data->user_data); - } - - if (error) - g_error_free(error); - - free(evt_cb_data); - return; - } - - g_variant_get (dbus_result, "(iiiisisisisisisissssi)", - &result, - &pb_rec.phonebook_type, - &i, - &ni, - &name, - &pb_rec.dcs, - &number, - &pb_rec.ton, - &sne, - &pb_rec.sne_dcs, - &anr1, - &pb_rec.anr1_ton, - &anr2, - &pb_rec.anr2_ton, - &anr3, - &pb_rec.anr3_ton, - &email1, - &email2, - &email3, - &email4, - &pb_rec.group_index); - - pb_rec.index = i; - pb_rec.next_index = ni; - - if(strlen(name)) - snprintf((char*)pb_rec.name, strlen(name) + 1, "%s", name); - - if(strlen(number)) - snprintf((char*)pb_rec.number, strlen(number) + 1, "%s", number); - - if(strlen(sne)) - snprintf((char*)pb_rec.sne, strlen(sne) + 1, "%s", sne); - - if(strlen(anr1)) - snprintf((char*)pb_rec.anr1, strlen(anr1) + 1, "%s", anr1); - - if(strlen(anr2)) - snprintf((char*)pb_rec.anr2, strlen(anr2) + 1, "%s", anr2); - - if(strlen(anr3)) - snprintf((char*)pb_rec.anr3, strlen(anr3) + 1, "%s", anr3); - - if(strlen(email1)) - snprintf((char*)pb_rec.email1, strlen(email1) + 1, "%s", email1); - - if(strlen(email2)) - snprintf((char*)pb_rec.email2, strlen(email2) + 1, "%s", email2); - - if(strlen(email3)) - snprintf((char*)pb_rec.email3, strlen(email3) + 1, "%s", email3); - - dbg("pb_rec.phonebook_type[%d]",pb_rec.phonebook_type ); - dbg("pb_rec.index[%d]",pb_rec.index ); - dbg("pb_rec.next_index[%d]",pb_rec.next_index ); - dbg("pb_rec.name[%s]",pb_rec.name ); - dbg("pb_rec.dcs[%d]",pb_rec.dcs ); - dbg("pb_rec.number[%s]",pb_rec.number ); - dbg("pb_rec.ton[%d]",pb_rec.ton ); - - if(pb_rec.phonebook_type==TAPI_SIM_PB_3GSIM) { - dbg("pb_rec.sne[%s]",pb_rec.sne ); - dbg("pb_rec.sne_dcs[%d]",pb_rec.sne_dcs ); - dbg("pb_rec.anr1[%s]",pb_rec.anr1 ); - dbg("pb_rec.anr1_ton[%d]",pb_rec.anr1_ton ); - dbg("pb_rec.anr2[%s]",pb_rec.anr2 ); - dbg("pb_rec.anr2_ton[%d]",pb_rec.anr2_ton ); - dbg("pb_rec.anr3[%s]",pb_rec.anr3 ); - dbg("pb_rec.anr3_ton[%d]",pb_rec.anr3_ton ); - dbg("pb_rec.email1[%s]",pb_rec.email1 ); - dbg("pb_rec.email2[%s]",pb_rec.email2 ); - dbg("pb_rec.email3[%s]",pb_rec.email3 ); - dbg("pb_rec.email4[%s]",pb_rec.email4 ); - dbg("pb_rec.group_index[%d]",pb_rec.group_index ); - dbg("pb_rec.pb_control[%d]",pb_rec.pb_control ); - } - - if (evt_cb_data->cb_fn) { - evt_cb_data->cb_fn(evt_cb_data->handle, result, &pb_rec, evt_cb_data->user_data); - } - - free(evt_cb_data); -} - -static void on_response_update_sim_pb_record(GObject *source_object, GAsyncResult *res, gpointer user_data) -{ - GError *error = NULL; - GDBusConnection *conn = NULL; - GVariant *dbus_result; - - struct tapi_resp_data *evt_cb_data = user_data; - TelSimPbAccessResult_t result = TAPI_SIM_PB_SUCCESS; - - conn = G_DBUS_CONNECTION (source_object); - dbus_result = g_dbus_connection_call_finish(conn, res, &error); - CHECK_DEINIT(error); - - if (!dbus_result) { - if (evt_cb_data->cb_fn) { - evt_cb_data->cb_fn(evt_cb_data->handle, -1, NULL, evt_cb_data->user_data); - } - - if (error) - g_error_free(error); - - free(evt_cb_data); - return; - } - - g_variant_get (dbus_result, "(i)", &result); - - if (evt_cb_data->cb_fn) { - evt_cb_data->cb_fn(evt_cb_data->handle, result, NULL, evt_cb_data->user_data); - } - - free(evt_cb_data); -} - -static void on_response_delete_sim_pb_record(GObject *source_object, GAsyncResult *res, gpointer user_data) -{ - GError *error = NULL; - GDBusConnection *conn = NULL; - GVariant *dbus_result; - - struct tapi_resp_data *evt_cb_data = user_data; - TelSimPbAccessResult_t result = TAPI_SIM_PB_SUCCESS; - - conn = G_DBUS_CONNECTION (source_object); - dbus_result = g_dbus_connection_call_finish(conn, res, &error); - CHECK_DEINIT(error); - - if (!dbus_result) { - if (evt_cb_data->cb_fn) { - evt_cb_data->cb_fn(evt_cb_data->handle, -1, NULL, evt_cb_data->user_data); - } - - if (error) - g_error_free(error); - - free(evt_cb_data); - return; - } - - g_variant_get (dbus_result, "(i)", &result); - - if (evt_cb_data->cb_fn) { - evt_cb_data->cb_fn(evt_cb_data->handle, result, NULL, evt_cb_data->user_data); - } - - free(evt_cb_data); -} - -EXPORT_API int tel_get_sim_pb_init_info(TapiHandle *handle, int *init_completed, TelSimPbList_t *pb_list) -{ - GError *gerr = NULL; - GVariant *sync_gv = NULL; - int api_err = TAPI_API_SUCCESS; - int init_status = 0; - - dbg("Func Entrance"); - - TAPI_RETURN_VAL_IF_FAIL(init_completed, TAPI_API_INVALID_PTR); - TAPI_RETURN_VAL_IF_FAIL(pb_list, TAPI_API_INVALID_PTR); - - sync_gv = g_dbus_connection_call_sync(handle->dbus_connection, DBUS_TELEPHONY_SERVICE, - handle->path, DBUS_TELEPHONY_PB_INTERFACE, "GetInitStatus", NULL, NULL, - G_DBUS_CALL_FLAGS_NONE, -1, NULL, &gerr); - - if (sync_gv) { - g_variant_get(sync_gv, "(ibbbbbb)", - &init_status, - &pb_list->b_fdn, - &pb_list->b_adn, - &pb_list->b_sdn, - &pb_list->b_3g, - &pb_list->b_aas, - &pb_list->b_gas); - *init_completed = init_status; - } - - dbg("pb_list->b_fdn[%d]", pb_list->b_fdn) - dbg("pb_list->b_adn[%d]", pb_list->b_adn) - dbg("pb_list->b_sdn[%d]", pb_list->b_sdn) - dbg("pb_list->b_3g[%d]", pb_list->b_3g) - dbg("pb_list->b_aas[%d]", pb_list->b_aas) - dbg("pb_list->b_gas[%d]", pb_list->b_gas) - - return api_err; -} - -EXPORT_API int tel_get_sim_pb_count(TapiHandle *handle, TelSimPbType_t pb_type, tapi_response_cb callback, void *user_data) -{ - struct tapi_resp_data *evt_cb_data = NULL; - GVariant *param = NULL; - int pb_ready = 0; - - dbg("Func Entrance"); - pb_ready = _tel_check_pb_state(handle); - if(pb_ready != 0) - return pb_ready; - - if ( (pb_type != TAPI_SIM_PB_FDN) && (pb_type != TAPI_SIM_PB_ADN) && (pb_type != TAPI_SIM_PB_SDN) - && (pb_type != TAPI_SIM_PB_3GSIM) && (pb_type != TAPI_SIM_PB_AAS) && (pb_type != TAPI_SIM_PB_GAS)) - return TAPI_API_INVALID_INPUT; - - MAKE_RESP_CB_DATA(evt_cb_data, handle, callback, user_data); - - param = g_variant_new("(i)", pb_type); - - g_dbus_connection_call(handle->dbus_connection, - DBUS_TELEPHONY_SERVICE , handle->path, DBUS_TELEPHONY_PB_INTERFACE, - "GetCount", param, NULL, - G_DBUS_CALL_FLAGS_NONE, -1, handle->ca, - on_response_get_sim_pb_count, evt_cb_data); - - return TAPI_API_SUCCESS; -} - -EXPORT_API int tel_get_sim_pb_meta_info(TapiHandle *handle, TelSimPbType_t pb_type, tapi_response_cb callback, void *user_data) -{ - struct tapi_resp_data *evt_cb_data = NULL; - GVariant *param = NULL; - int pb_ready = 0; - - dbg("Func Entrance"); - pb_ready = _tel_check_pb_state(handle); - if(pb_ready != 0) - return pb_ready; - - if ( (pb_type != TAPI_SIM_PB_FDN) && (pb_type != TAPI_SIM_PB_ADN) && (pb_type != TAPI_SIM_PB_SDN) - && (pb_type != TAPI_SIM_PB_3GSIM) && (pb_type != TAPI_SIM_PB_AAS) && (pb_type != TAPI_SIM_PB_GAS)) - return TAPI_API_INVALID_INPUT; - - MAKE_RESP_CB_DATA(evt_cb_data, handle, callback, user_data); - - param = g_variant_new("(i)", pb_type); - - g_dbus_connection_call(handle->dbus_connection, - DBUS_TELEPHONY_SERVICE , handle->path, DBUS_TELEPHONY_PB_INTERFACE, - "GetInfo", param, NULL, - G_DBUS_CALL_FLAGS_NONE, -1, handle->ca, - on_response_get_sim_pb_meta_info, evt_cb_data); - - return TAPI_API_SUCCESS; -} - -EXPORT_API int tel_get_sim_pb_usim_meta_info(TapiHandle *handle, tapi_response_cb callback, void *user_data) -{ - struct tapi_resp_data *evt_cb_data = NULL; - GVariant *param = NULL; - int pb_ready = 0; - - dbg("Func Entrance"); - pb_ready = _tel_check_pb_state(handle); - if(pb_ready != 0) - return pb_ready; - - MAKE_RESP_CB_DATA(evt_cb_data, handle, callback, user_data); - - g_dbus_connection_call(handle->dbus_connection, - DBUS_TELEPHONY_SERVICE , handle->path, DBUS_TELEPHONY_PB_INTERFACE, - "GetUsimMetaInfo", param, NULL, - G_DBUS_CALL_FLAGS_NONE, -1, handle->ca, - on_response_get_sim_pb_usim_meta_info, evt_cb_data); - - return TAPI_API_SUCCESS; -} - -EXPORT_API int tel_read_sim_pb_record(TapiHandle *handle, TelSimPbType_t pb_type, unsigned short index, tapi_response_cb callback, void *user_data) -{ - struct tapi_resp_data *evt_cb_data = NULL; - GVariant *param = NULL; - int pb_ready = 0; - - dbg("Func Entrance"); - pb_ready = _tel_check_pb_state(handle); - if(pb_ready != 0) - return pb_ready; - - if (index == 0) - return TAPI_API_INVALID_INPUT; - - if ( (pb_type != TAPI_SIM_PB_FDN) && (pb_type != TAPI_SIM_PB_ADN) && (pb_type != TAPI_SIM_PB_SDN) - && (pb_type != TAPI_SIM_PB_3GSIM) && (pb_type != TAPI_SIM_PB_AAS) && (pb_type != TAPI_SIM_PB_GAS)) - return TAPI_API_INVALID_INPUT; - - MAKE_RESP_CB_DATA(evt_cb_data, handle, callback, user_data); - - param = g_variant_new("(ii)", pb_type, index); - - g_dbus_connection_call(handle->dbus_connection, - DBUS_TELEPHONY_SERVICE , handle->path, DBUS_TELEPHONY_PB_INTERFACE, - "ReadRecord", param, NULL, - G_DBUS_CALL_FLAGS_NONE, -1, handle->ca, - on_response_read_sim_pb_record, evt_cb_data); - - return TAPI_API_SUCCESS; -} - -EXPORT_API int tel_update_sim_pb_record(TapiHandle *handle, const TelSimPbRecord_t *req_data, tapi_response_cb callback, void *user_data) -{ - struct tapi_resp_data *evt_cb_data = NULL; - GVariant *param = NULL; - int pb_ready = 0; - - dbg("Func Entrance"); - pb_ready = _tel_check_pb_state(handle); - if(pb_ready != 0) - return pb_ready; - - TAPI_RETURN_VAL_IF_FAIL((req_data != NULL) , TAPI_API_INVALID_PTR); - - if (req_data->index == 0) { - return TAPI_API_INVALID_INPUT; - } - - if ((req_data->phonebook_type != TAPI_SIM_PB_FDN) - && (req_data->phonebook_type != TAPI_SIM_PB_ADN) && (req_data->phonebook_type != TAPI_SIM_PB_SDN) - && (req_data->phonebook_type != TAPI_SIM_PB_3GSIM) && (req_data->phonebook_type != TAPI_SIM_PB_AAS) - && (req_data->phonebook_type != TAPI_SIM_PB_GAS)) { - return TAPI_API_INVALID_INPUT; - } - - MAKE_RESP_CB_DATA(evt_cb_data, handle, callback, user_data); - - dbg("req_data->phonebook_type[%d]",req_data->phonebook_type ); - dbg("req_data->index[%d]",req_data->index ); - dbg("req_data->name[%s]",req_data->name ); - dbg("req_data->dcs[%d]",req_data->dcs ); - dbg("req_data->number[%s]",req_data->number ); - dbg("req_data->ton[%d]",req_data->ton ); - - if(req_data->phonebook_type == TAPI_SIM_PB_3GSIM) { - dbg("req_data->sne[%s]",req_data->sne ); - dbg("req_data->sne_dcs[%d]",req_data->sne_dcs ); - dbg("req_data->anr1[%s]",req_data->anr1 ); - dbg("req_data->anr1_ton[%d]",req_data->anr1_ton ); - dbg("req_data->anr2[%s]",req_data->anr2 ); - dbg("req_data->anr2_ton[%d]",req_data->anr2_ton ); - dbg("req_data->anr3[%s]",req_data->anr3 ); - dbg("req_data->anr3_ton[%d]",req_data->anr3_ton ); - dbg("req_data->email1[%s]",req_data->email1 ); - dbg("req_data->email2[%s]",req_data->email2 ); - dbg("req_data->email3[%s]",req_data->email3 ); - dbg("req_data->email4[%s]",req_data->email4 ); - dbg("req_data->group_index[%d]",req_data->group_index ); - dbg("req_data->pb_control[%d]",req_data->pb_control ); - } - - param = g_variant_new("(iisisisisisisissssi)", - req_data->phonebook_type, - req_data->index, - req_data->name, - req_data->dcs, - req_data->number, - req_data->ton, - req_data->sne, - req_data->sne_dcs, - req_data->anr1, - req_data->anr1_ton, - req_data->anr2, - req_data->anr2_ton, - req_data->anr3, - req_data->anr3_ton, - req_data->email1, - req_data->email2, - req_data->email3, - req_data->email4, - req_data->group_index); - - g_dbus_connection_call(handle->dbus_connection, - DBUS_TELEPHONY_SERVICE , handle->path, DBUS_TELEPHONY_PB_INTERFACE, - "UpdateRecord", param, NULL, - G_DBUS_CALL_FLAGS_NONE, -1, handle->ca, - on_response_update_sim_pb_record, evt_cb_data); - - return TAPI_API_SUCCESS; - -} - -EXPORT_API int tel_delete_sim_pb_record(TapiHandle *handle, TelSimPbType_t pb_type, unsigned short index, tapi_response_cb callback, void *user_data) -{ - struct tapi_resp_data *evt_cb_data = NULL; - GVariant *param = NULL; - int pb_ready = 0; - - dbg("Func Entrance"); - pb_ready = _tel_check_pb_state(handle); - if(pb_ready != 0) - return pb_ready; - - if (index == 0) - return TAPI_API_INVALID_INPUT; - - if ( (pb_type != TAPI_SIM_PB_FDN) && (pb_type != TAPI_SIM_PB_ADN) && (pb_type != TAPI_SIM_PB_SDN) - && (pb_type != TAPI_SIM_PB_3GSIM) && (pb_type != TAPI_SIM_PB_AAS) && (pb_type != TAPI_SIM_PB_GAS)) - return TAPI_API_INVALID_INPUT; - - MAKE_RESP_CB_DATA(evt_cb_data, handle, callback, user_data); - - param = g_variant_new("(ii)", pb_type, index); - - g_dbus_connection_call(handle->dbus_connection, - DBUS_TELEPHONY_SERVICE , handle->path, DBUS_TELEPHONY_PB_INTERFACE, - "DeleteRecord", param, NULL, - G_DBUS_CALL_FLAGS_NONE, -1, handle->ca, - on_response_delete_sim_pb_record, evt_cb_data); - - return TAPI_API_SUCCESS; -} diff --git a/mobile/src/tapi_sap.c b/mobile/src/tapi_sap.c deleted file mode 100644 index eede90d..0000000 --- a/mobile/src/tapi_sap.c +++ /dev/null @@ -1,521 +0,0 @@ -/* - * libslp-tapi - * - * Copyright (c) 2012 Samsung Electronics Co., Ltd. All rights reserved. - * - * Contact: Ja-young Gu - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT 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 "TapiUtility.h" -#include "TelSim.h" - -#include "common.h" -#include "tapi_log.h" -#include "ITapiSap.h" - -static void on_response_sap_connect(GObject *source_object, GAsyncResult *res, gpointer user_data) -{ - GError *error = NULL; - GDBusConnection *conn = NULL; - GVariant *dbus_result; - - struct tapi_resp_data *evt_cb_data = user_data; - TelSimSapConnectionStatus_t result = TAPI_SIM_SAP_CONNECTION_STATUS_OK; - gint max_msg_size = 0; - - dbg("Func Entrance"); - - conn = G_DBUS_CONNECTION (source_object); - dbus_result = g_dbus_connection_call_finish(conn, res, &error); - CHECK_DEINIT(error); - - if (!dbus_result) { - if (evt_cb_data->cb_fn) { - evt_cb_data->cb_fn(evt_cb_data->handle, -1, NULL, evt_cb_data->user_data); - } - - if (error) - g_error_free(error); - - free(evt_cb_data); - return; - } - - g_variant_get(dbus_result, "(ii)", &result, &max_msg_size); - - if (evt_cb_data->cb_fn) { - evt_cb_data->cb_fn(evt_cb_data->handle, result, (void*)&max_msg_size, evt_cb_data->user_data); - } - - free(evt_cb_data); -} - -EXPORT_API int tel_req_sap_connect(TapiHandle *handle, int max_msg_size, tapi_response_cb callback, void *user_data) -{ - struct tapi_resp_data *evt_cb_data = NULL; - GVariant *param = NULL; - - dbg("Func Entrance w/ max_msg_size[%d]",max_msg_size); - - MAKE_RESP_CB_DATA(evt_cb_data, handle, callback, user_data); - - param = g_variant_new("(i)", max_msg_size); - g_dbus_connection_call(handle->dbus_connection, DBUS_TELEPHONY_SERVICE, handle->path, - DBUS_TELEPHONY_SAP_INTERFACE, "Connect", param, NULL, G_DBUS_CALL_FLAGS_NONE, -1, - handle->ca, on_response_sap_connect, evt_cb_data); - - return TAPI_API_SUCCESS; -} - -static void on_response_sap_disconnect(GObject *source_object, GAsyncResult *res, gpointer user_data) -{ - GError *error = NULL; - GDBusConnection *conn = NULL; - GVariant *dbus_result; - - struct tapi_resp_data *evt_cb_data = user_data; - TelSimSapResultCode_t result = TAPI_SIM_SAP_RESULT_CODE_OK; - - dbg("Func Entrance"); - - conn = G_DBUS_CONNECTION (source_object); - dbus_result = g_dbus_connection_call_finish(conn, res, &error); - CHECK_DEINIT(error); - - if (!dbus_result) { - if (evt_cb_data->cb_fn) { - evt_cb_data->cb_fn(evt_cb_data->handle, -1, NULL, evt_cb_data->user_data); - } - - if (error) - g_error_free(error); - - free(evt_cb_data); - return; - } - - g_variant_get(dbus_result, "(i)", &result); - - if (evt_cb_data->cb_fn) { - evt_cb_data->cb_fn(evt_cb_data->handle, result, NULL, evt_cb_data->user_data); - } - - free(evt_cb_data); -} - -EXPORT_API int tel_req_sap_disconnect(TapiHandle *handle, tapi_response_cb callback, void *user_data) -{ - struct tapi_resp_data *evt_cb_data = NULL; - - dbg("Func Entrance "); - - MAKE_RESP_CB_DATA(evt_cb_data, handle, callback, user_data); - - g_dbus_connection_call(handle->dbus_connection, DBUS_TELEPHONY_SERVICE, handle->path, - DBUS_TELEPHONY_SAP_INTERFACE, "Disconnect", NULL, NULL, G_DBUS_CALL_FLAGS_NONE, -1, - handle->ca, on_response_sap_disconnect, evt_cb_data); - - return TAPI_API_SUCCESS; -} - -static void on_response_sap_connection_status(GObject *source_object, GAsyncResult *res, gpointer user_data) -{ - GError *error = NULL; - GDBusConnection *conn = NULL; - GVariant *dbus_result; - - struct tapi_resp_data *evt_cb_data = user_data; - TelSimSapStatusInfo_t result = TAPI_SIM_SAP_STATUS_UNKNOWN; - - dbg("Func Entrance"); - - conn = G_DBUS_CONNECTION (source_object); - dbus_result = g_dbus_connection_call_finish(conn, res, &error); - CHECK_DEINIT(error); - - if (!dbus_result) { - if (evt_cb_data->cb_fn) { - evt_cb_data->cb_fn(evt_cb_data->handle, -1, NULL, evt_cb_data->user_data); - } - - if (error) - g_error_free(error); - - free(evt_cb_data); - return; - } - - g_variant_get(dbus_result, "(i)", &result); - - if (evt_cb_data->cb_fn) { - evt_cb_data->cb_fn(evt_cb_data->handle, result, NULL, evt_cb_data->user_data); - } - - free(evt_cb_data); -} - -EXPORT_API int tel_req_sap_connection_status(TapiHandle *handle, tapi_response_cb callback, void *user_data) -{ - struct tapi_resp_data *evt_cb_data = NULL; - - dbg("Func Entrance"); - - MAKE_RESP_CB_DATA(evt_cb_data, handle, callback, user_data); - - g_dbus_connection_call(handle->dbus_connection, DBUS_TELEPHONY_SERVICE, handle->path, - DBUS_TELEPHONY_SAP_INTERFACE, "GetStatus", NULL, NULL, G_DBUS_CALL_FLAGS_NONE, -1, - handle->ca, on_response_sap_connection_status, evt_cb_data); - - return TAPI_API_SUCCESS; -} - -static void on_response_sap_transfer_atr(GObject *source_object, GAsyncResult *res, gpointer user_data) -{ - GError *error = NULL; - GDBusConnection *conn = NULL; - GVariant *dbus_result; - - GVariantIter *iter = NULL; - GVariant *param_gv = NULL; - GVariant *inner_gv = NULL; - guchar rt_i; - int i = 0; - - struct tapi_resp_data *evt_cb_data = user_data; - TelSimSapResultCode_t result = TAPI_SIM_SAP_RESULT_CODE_OK; - TelSapAtrInfo_t r_atr; - - dbg("Func Entrance"); - memset(&r_atr, 0, sizeof(TelSapAtrInfo_t)); - - conn = G_DBUS_CONNECTION (source_object); - dbus_result = g_dbus_connection_call_finish(conn, res, &error); - CHECK_DEINIT(error); - - if (!dbus_result) { - if (evt_cb_data->cb_fn) { - evt_cb_data->cb_fn(evt_cb_data->handle, -1, NULL, evt_cb_data->user_data); - } - - if (error) - g_error_free(error); - - free(evt_cb_data); - return; - } - - /* dbg("dbus_result type_format(%s)", g_variant_get_type_string(dbus_result));*/ - g_variant_get(dbus_result, "(i@v)", &result, ¶m_gv); - inner_gv = g_variant_get_variant(param_gv); - - g_variant_get(inner_gv, "ay", &iter); - while (g_variant_iter_loop(iter, "y", &rt_i)) { - r_atr.atr_data[i] = rt_i; - i++; - } - r_atr.atr_len = (int) i; - g_variant_iter_free(iter); - g_variant_unref(inner_gv); - g_variant_unref(param_gv); - /* for(i=0; i < (int)r_atr.atr_len; i++) - dbg("r_atr[%d][0x%02x]",i, r_atr.atr_data[i]);*/ - - if (evt_cb_data->cb_fn) { - evt_cb_data->cb_fn(evt_cb_data->handle, result, (void*)&r_atr, evt_cb_data->user_data); - } - - free(evt_cb_data); -} - -EXPORT_API int tel_req_sap_transfer_atr(TapiHandle *handle, tapi_response_cb callback, void *user_data) -{ - struct tapi_resp_data *evt_cb_data = NULL; - - dbg("Func Entrance"); - - MAKE_RESP_CB_DATA(evt_cb_data, handle, callback, user_data); - - g_dbus_connection_call(handle->dbus_connection, DBUS_TELEPHONY_SERVICE, handle->path, - DBUS_TELEPHONY_SAP_INTERFACE, "GetATR", NULL, NULL, G_DBUS_CALL_FLAGS_NONE, -1, - handle->ca, on_response_sap_transfer_atr, evt_cb_data); - - return TAPI_API_SUCCESS; -} - -static void on_response_sap_transfer_apdu(GObject *source_object, GAsyncResult *res, gpointer user_data) -{ - GError *error = NULL; - GDBusConnection *conn = NULL; - GVariant *dbus_result; - - GVariantIter *iter = NULL; - GVariant *param_gv = NULL; - GVariant *inner_gv = NULL; - guchar rt_i; - int i = 0; - - struct tapi_resp_data *evt_cb_data = user_data; - TelSimSapResultCode_t result = TAPI_SIM_SAP_RESULT_CODE_OK; - TelSapApduData_t r_apdu; - - dbg("Func Entrance"); - memset(&r_apdu, 0, sizeof(TelSapApduData_t)); - - conn = G_DBUS_CONNECTION (source_object); - dbus_result = g_dbus_connection_call_finish(conn, res, &error); - CHECK_DEINIT(error); - - if (!dbus_result) { - if (evt_cb_data->cb_fn) { - evt_cb_data->cb_fn(evt_cb_data->handle, -1, NULL, evt_cb_data->user_data); - } - - if (error) - g_error_free(error); - - free(evt_cb_data); - return; - } - - /* dbg("dbus_result type_format(%s)", g_variant_get_type_string(dbus_result));*/ - g_variant_get(dbus_result, "(i@v)", &result, ¶m_gv); - inner_gv = g_variant_get_variant(param_gv); - - g_variant_get(inner_gv, "ay", &iter); - while (g_variant_iter_loop(iter, "y", &rt_i)) { - r_apdu.apdu_data[i] = rt_i; - i++; - } - r_apdu.apdu_len = (int) i; - g_variant_iter_free(iter); - g_variant_unref(inner_gv); - g_variant_unref(param_gv); - /* for(i=0; i < (int)r_apdu.apdu_len; i++) - dbg("apdu[%d][0x%02x]",i, r_apdu.apdu_data[i]);*/ - - if (evt_cb_data->cb_fn) { - evt_cb_data->cb_fn(evt_cb_data->handle, result, (void*)&r_apdu, evt_cb_data->user_data); - } - - free(evt_cb_data); -} - -EXPORT_API int tel_req_sap_transfer_apdu(TapiHandle *handle, TelSapApduData_t *apdu_data, tapi_response_cb callback, void *user_data) -{ - struct tapi_resp_data *evt_cb_data = NULL; - GVariantBuilder *builder = NULL; - GVariant *param = NULL; - GVariant *inner_gv = NULL; - int i = 0; - - dbg("Func Entrance"); - TAPI_RETURN_VAL_IF_FAIL(apdu_data, TAPI_API_INVALID_PTR); - - MAKE_RESP_CB_DATA(evt_cb_data, handle, callback, user_data); - - builder = g_variant_builder_new(G_VARIANT_TYPE ("ay")); - for (i = 0; i < apdu_data->apdu_len; i++) { - dbg("apdu_data->apdu_data[%d][0x%02x]", i,apdu_data->apdu_data[i]); - g_variant_builder_add(builder, "y", apdu_data->apdu_data[i]); - } - inner_gv = g_variant_builder_end(builder); - param = g_variant_new("(v)", inner_gv); - /*g_variant_builder_unref (builder);*/ - - g_dbus_connection_call(handle->dbus_connection, DBUS_TELEPHONY_SERVICE, handle->path, - DBUS_TELEPHONY_SAP_INTERFACE, "TransferAPDU", param, NULL, G_DBUS_CALL_FLAGS_NONE, -1, - handle->ca, on_response_sap_transfer_apdu, evt_cb_data); - - return TAPI_API_SUCCESS; -} - -static void on_response_sap_transport_protocol(GObject *source_object, GAsyncResult *res, gpointer user_data) -{ - GError *error = NULL; - GDBusConnection *conn = NULL; - GVariant *dbus_result; - - struct tapi_resp_data *evt_cb_data = user_data; - TelSimSapResultCode_t result = TAPI_SIM_SAP_RESULT_CODE_OK; - - dbg("Func Entrance"); - - conn = G_DBUS_CONNECTION (source_object); - dbus_result = g_dbus_connection_call_finish(conn, res, &error); - CHECK_DEINIT(error); - - if (!dbus_result) { - if (evt_cb_data->cb_fn) { - evt_cb_data->cb_fn(evt_cb_data->handle, -1, NULL, evt_cb_data->user_data); - } - - if (error) - g_error_free(error); - - free(evt_cb_data); - return; - } - - g_variant_get(dbus_result, "(i)", &result); - - if (evt_cb_data->cb_fn) { - evt_cb_data->cb_fn(evt_cb_data->handle, result, NULL, evt_cb_data->user_data); - } - - free(evt_cb_data); -} - -EXPORT_API int tel_req_sap_transport_protocol(TapiHandle *handle, TelSimSapProtocol_t protocol, tapi_response_cb callback, void *user_data) -{ - struct tapi_resp_data *evt_cb_data = NULL; - GVariant *param = NULL; - - dbg("Func Entrance w/ protocol[%d]", protocol); - - MAKE_RESP_CB_DATA(evt_cb_data, handle, callback, user_data); - - param = g_variant_new("(i)", protocol); - g_dbus_connection_call(handle->dbus_connection, DBUS_TELEPHONY_SERVICE, handle->path, - DBUS_TELEPHONY_SAP_INTERFACE, "SetProtocol", param, NULL, G_DBUS_CALL_FLAGS_NONE, -1, - handle->ca, on_response_sap_transport_protocol, evt_cb_data); - - return TAPI_API_SUCCESS; -} - -static void on_response_sap_power_operation(GObject *source_object, GAsyncResult *res, gpointer user_data) -{ - GError *error = NULL; - GDBusConnection *conn = NULL; - GVariant *dbus_result; - - struct tapi_resp_data *evt_cb_data = user_data; - TelSimSapResultCode_t result = TAPI_SIM_SAP_RESULT_CODE_OK; - - dbg("Func Entrance"); - - conn = G_DBUS_CONNECTION (source_object); - dbus_result = g_dbus_connection_call_finish(conn, res, &error); - CHECK_DEINIT(error); - - if (!dbus_result) { - if (evt_cb_data->cb_fn) { - evt_cb_data->cb_fn(evt_cb_data->handle, -1, NULL, evt_cb_data->user_data); - } - - if (error) - g_error_free(error); - - free(evt_cb_data); - return; - } - - g_variant_get(dbus_result, "(i)", &result); - - if (evt_cb_data->cb_fn) { - evt_cb_data->cb_fn(evt_cb_data->handle, result, NULL, evt_cb_data->user_data); - } - - free(evt_cb_data); -} - -EXPORT_API int tel_req_sap_power_operation(TapiHandle *handle, TelSimSapPowerMode_t power_mode, tapi_response_cb callback, void *user_data) -{ - struct tapi_resp_data *evt_cb_data = NULL; - GVariant *param = NULL; - gint mode = 0; - dbg("Func Entrance w/ power_mode[%d]", power_mode); - - MAKE_RESP_CB_DATA(evt_cb_data, handle, callback, user_data); - - switch (power_mode) { - case TAPI_SIM_SAP_POWER_SIM_ON_REQ: - mode = 0; - break; - case TAPI_SIM_SAP_POWER_SIM_OFF_REQ: - mode =1; - break; - case TAPI_SIM_SAP_RESET_SIM_REQ: - mode = 2; - break; - default: - dbg("not handed value[%d]", power_mode); - break; - } - - param = g_variant_new("(i)", mode); - g_dbus_connection_call(handle->dbus_connection, DBUS_TELEPHONY_SERVICE, handle->path, - DBUS_TELEPHONY_SAP_INTERFACE, "SetPower", param, NULL, G_DBUS_CALL_FLAGS_NONE, -1, - handle->ca, on_response_sap_power_operation, evt_cb_data); - - return TAPI_API_SUCCESS; -} - -static void on_response_sap_cardreader_status(GObject *source_object, GAsyncResult *res, gpointer user_data) -{ - GError *error = NULL; - GDBusConnection *conn = NULL; - GVariant *dbus_result; - - struct tapi_resp_data *evt_cb_data = user_data; - TelSimSapResultCode_t result = TAPI_SIM_SAP_RESULT_CODE_OK; - TelSimSapCardStatus_t reader_status = TAPI_SIM_SAP_CARD_STATUS_UNKNOWN; - - dbg("Func Entrance"); - - conn = G_DBUS_CONNECTION (source_object); - dbus_result = g_dbus_connection_call_finish(conn, res, &error); - CHECK_DEINIT(error); - - if (!dbus_result) { - if (evt_cb_data->cb_fn) { - evt_cb_data->cb_fn(evt_cb_data->handle, -1, NULL, evt_cb_data->user_data); - } - - if (error) - g_error_free(error); - - free(evt_cb_data); - return; - } - - g_variant_get(dbus_result, "(ii)", &result, &reader_status); - - if (evt_cb_data->cb_fn) { - evt_cb_data->cb_fn(evt_cb_data->handle, result, (void*)&reader_status, evt_cb_data->user_data); - } - - free(evt_cb_data); -} - -EXPORT_API int tel_req_sap_cardreader_status(TapiHandle *handle, tapi_response_cb callback, void *user_data) -{ - struct tapi_resp_data *evt_cb_data = NULL; - - dbg("Func Entrance "); - - MAKE_RESP_CB_DATA(evt_cb_data, handle, callback, user_data); - - g_dbus_connection_call(handle->dbus_connection, DBUS_TELEPHONY_SERVICE, handle->path, - DBUS_TELEPHONY_SAP_INTERFACE, "GetCardReaderStatus", NULL, NULL, G_DBUS_CALL_FLAGS_NONE, -1, - handle->ca, on_response_sap_cardreader_status, evt_cb_data); - - return TAPI_API_SUCCESS; -} diff --git a/mobile/src/tapi_sat.c b/mobile/src/tapi_sat.c deleted file mode 100644 index 19a387b..0000000 --- a/mobile/src/tapi_sat.c +++ /dev/null @@ -1,639 +0,0 @@ -/* - * libslp-tapi - * - * Copyright (c) 2012 Samsung Electronics Co., Ltd. All rights reserved. - * - * Contact: Ja-young Gu - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT 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 "TapiUtility.h" -#include "TelSat.h" - -#include "common.h" -#include "tapi_log.h" -#include "ITapiSat.h" - -extern TelSatEventDownloadType_t g_event_list[TAPI_SAT_EVENT_LIST_MAX_COUNT]; - -static GVariant* _tapi_sat_gen_app_exec_result_data(TelSatAppsRetInfo_t *result_info) -{ - GVariant *result = NULL; - - switch(result_info->commandType) - { - case TAPI_SAT_CMD_TYPE_SETUP_MENU:{ - gint exec_result; - dbg("setup menu : result format (i)"); - - exec_result = result_info->appsRet.setupMenu.resp; - result = g_variant_new("(i)", exec_result); - } break; - case TAPI_SAT_CMD_TYPE_REFRESH:{ - gint app_type, exec_result; - dbg("refresh : result format (ii)"); - - app_type = result_info->appsRet.refresh.appType; - exec_result = result_info->appsRet.refresh.resp; - result = g_variant_new("(ii)", app_type, exec_result); - } break; - case TAPI_SAT_CMD_TYPE_SETUP_CALL:{ - gint exec_result, me_problem, call_ctrl_problem, call_cause; - dbg("setup call : result format (iiii)"); - - exec_result = result_info->appsRet.setupCall.resp; - me_problem = result_info->appsRet.setupCall.meProblem; - call_ctrl_problem = result_info->appsRet.setupCall.permanentCallCtrlProblem; - call_cause = result_info->appsRet.setupCall.tapiCause; - result = g_variant_new("(iiii)", exec_result, me_problem, call_ctrl_problem, call_cause); - } break; - case TAPI_SAT_CMD_TYPE_SEND_SS:{ - gint exec_result, me_problem, ss_cause, call_ctrl_problem, ss_str_len; - gchar *ss_string = NULL; - dbg("send ss : result format (iiisii)"); - - exec_result = result_info->appsRet.sendSs.resp; - me_problem = result_info->appsRet.sendSs.meProblem; - ss_cause = result_info->appsRet.sendSs.ssCause; - call_ctrl_problem = result_info->appsRet.sendSs.additionalCallCtrlProblemInfo; - ss_str_len = result_info->appsRet.sendSs.ssString.stringLen; - ss_string = g_strdup((gchar*)result_info->appsRet.sendSs.ssString.string); - - result = g_variant_new("(iiisii)", exec_result, me_problem, ss_cause, ss_string, ss_str_len, call_ctrl_problem); - } break; - case TAPI_SAT_CMD_TYPE_SEND_USSD:{ - int index; - gint exec_result, me_problem, ss_cause, ussd_str_len; - GVariantBuilder *builder = NULL; - GVariant *ussd_str = NULL; - - dbg("send ussd : result format (iiivi)"); - - exec_result = result_info->appsRet.sendUssd.resp; - me_problem = result_info->appsRet.sendUssd.meProblem; - ss_cause = result_info->appsRet.sendUssd.ssCause; - ussd_str_len = result_info->appsRet.sendUssd.ussdString.stringLen; - - builder = g_variant_builder_new(G_VARIANT_TYPE ("ay")); - for (index = 0; index < ussd_str_len; index++) { - dbg("index(%d) data(%d)", index, result_info->appsRet.sendUssd.ussdString.string[index]); - g_variant_builder_add(builder, "y", result_info->appsRet.sendUssd.ussdString.string[index]); - } - ussd_str = g_variant_builder_end(builder); - - result = g_variant_new("(iiivi)", exec_result, me_problem, ss_cause, ussd_str, ussd_str_len); - } break; - case TAPI_SAT_CMD_TYPE_SEND_SMS:{ - gint exec_result; - dbg("send sms: result format (i)"); - - exec_result = result_info->appsRet.sendSms.resp; - result = g_variant_new("(i)", exec_result); - } break; - case TAPI_SAT_CMD_TYPE_SEND_DTMF:{ - gint exec_result; - dbg("send DTMF: result format (i)"); - - exec_result = result_info->appsRet.sendDtmf.resp; - result = g_variant_new("(i)", exec_result); - } break; - case TAPI_SAT_CMD_TYPE_LAUNCH_BROWSER:{ - gint exec_result, browser_problem; - dbg("launch browser: result format (ii)"); - - exec_result = result_info->appsRet.launchBrowser.resp; - browser_problem = result_info->appsRet.launchBrowser.browserProblem; - result = g_variant_new("(ii)", exec_result, browser_problem); - } break; - case TAPI_SAT_CMD_TYPE_SETUP_IDLE_MODE_TEXT:{ - gint exec_result; - dbg("setup idle mode text: result format (i)"); - - exec_result = result_info->appsRet.setupIdleModeText.resp; - result = g_variant_new("(i)", exec_result); - } break; - case TAPI_SAT_CMD_TYPE_LANGUAGE_NOTIFICATION:{ - gint exec_result; - dbg("language notification: result format (i)"); - - exec_result = result_info->appsRet.languageNoti.resp; - result = g_variant_new("(i)", exec_result); - } break; - case TAPI_SAT_CMD_TYPE_PROVIDE_LOCAL_INFO:{ - gint exec_result; - dbg("provide local info: result format (i)"); - - exec_result = result_info->appsRet.provideLocalInfo.resp; - result = g_variant_new("(i)", exec_result); - } break; - case TAPI_SAT_CMD_TYPE_PLAY_TONE:{ - gint exec_result; - dbg("play tone: result format (i)"); - - exec_result = result_info->appsRet.playTone.resp; - result = g_variant_new("(i)", exec_result); - } break; - case TAPI_SAT_CMD_TYPE_DISPLAY_TEXT:{ - gint exec_result, me_problem; - dbg("display text: result format (ii)"); - - exec_result = result_info->appsRet.displayText.resp; - me_problem = result_info->appsRet.displayText.meProblem; - result = g_variant_new("(ii)", exec_result, me_problem); - } break; - default: - dbg("unhandled command type(0x%x", result_info->commandType); - break; - } - - return result; -} - -static GVariant* _tapi_sat_gen_event_download_data(const TelSatEventDownloadReqInfo_t *pEventData) -{ - GVariant *result = NULL; - - switch(pEventData->eventDownloadType) - { - case TAPI_EVENT_SAT_DW_TYPE_IDLE_SCREEN_AVAILABLE:{ - gboolean idle_screen; - dbg("idle screen available (%d)", pEventData->u.bIdleScreenAvailable); - - idle_screen = pEventData->u.bIdleScreenAvailable; - result = g_variant_new("(b)", idle_screen); - } break; - case TAPI_EVENT_SAT_DW_TYPE_LANGUAGE_SELECTION:{ - gint selected_language; - dbg("selected language (%d)", pEventData->u.languageSelectionEventReqInfo.language); - - selected_language = pEventData->u.languageSelectionEventReqInfo.language; - result = g_variant_new("(i)", selected_language); - } break; - case TAPI_EVENT_SAT_DW_TYPE_BROWSER_TERMINATION:{ - gint browser_termination_cause; - dbg("Cause of browser termination (%d)", pEventData->u.browserTerminationEventReqInfo.browserTerminationCause); - - browser_termination_cause = pEventData->u.browserTerminationEventReqInfo.browserTerminationCause; - result = g_variant_new("(i)", browser_termination_cause); - } break; - case TAPI_EVENT_SAT_DW_TYPE_DATA_AVAILABLE: - case TAPI_EVENT_SAT_DW_TYPE_CHANNEL_STATUS: - default : - dbg("not support download event (%d)", pEventData->eventDownloadType); - break; - } - - return result; -} - -static void on_response_menu_selection_envelop(GObject *source_object, GAsyncResult *res, gpointer user_data) -{ - GError *error = NULL; - GDBusConnection *conn = NULL; - - GVariant *rst; - struct tapi_resp_data *evt_cb_data = user_data; - - int result = -1; - int envelop_rsp = 0; - - conn = G_DBUS_CONNECTION (source_object); - rst = g_dbus_connection_call_finish(conn, res, &error); - CHECK_DEINIT(error); - - if(!rst){ - evt_cb_data->cb_fn(evt_cb_data->handle, result, &envelop_rsp, evt_cb_data->user_data); - - g_error_free (error); - g_free(evt_cb_data); - return; - } - - g_variant_get (rst, "(ii)", &result, &envelop_rsp); - dbg("menu selection envelop result(%d) envelop response(%d)", result, envelop_rsp); - - if (evt_cb_data->cb_fn) { - evt_cb_data->cb_fn(evt_cb_data->handle, result, &envelop_rsp, evt_cb_data->user_data); - } - - g_variant_unref(rst); - g_free(evt_cb_data); -} - -static void on_response_download_event_envelop(GObject *source_object, GAsyncResult *res, gpointer user_data) -{ - GError *error = NULL; - GDBusConnection *conn = NULL; - - GVariant *rst; - struct tapi_resp_data *evt_cb_data = user_data; - - int result = -1; - int envelop_rsp = 0; - - conn = G_DBUS_CONNECTION (source_object); - rst = g_dbus_connection_call_finish(conn, res, &error); - CHECK_DEINIT(error); - - if(!rst){ - evt_cb_data->cb_fn(evt_cb_data->handle, result, &envelop_rsp, evt_cb_data->user_data); - - g_error_free (error); - g_free(evt_cb_data); - return; - } - - g_variant_get (rst, "(ii)", &result, &envelop_rsp); - dbg("download event envelop result(%d) envelop response(%d)", result, envelop_rsp); - - if (evt_cb_data->cb_fn) { - evt_cb_data->cb_fn(evt_cb_data->handle, result, &envelop_rsp, evt_cb_data->user_data); - } - - g_variant_unref(rst); - g_free(evt_cb_data); -} - -/** - * - * To send envelope command (MENU SELECTION) to USIM. - * - * @return values in enum TapiResult_t. - * @param[in] TelSatMenuSelectionReqInfo_t menu selection evelope data. - * @Interface Asynchronous. - * @remark - * @Refer TelSatMenuSelectionReqInfo_t - */ - -EXPORT_API int tel_select_sat_menu(TapiHandle *handle, const TelSatMenuSelectionReqInfo_t *pMenuSelect, tapi_response_cb callback, void *user_data) -{ - gint item_id; - gboolean help_req; - GVariant *inparam = NULL; - struct tapi_resp_data *evt_cb_data = NULL; - - dbg("Func Entrance "); - - if (!handle || !handle->dbus_connection || !pMenuSelect){ - dbg("invalid parameter"); - return TAPI_API_INVALID_INPUT; - } - - MAKE_RESP_CB_DATA(evt_cb_data, handle, callback, user_data); - - item_id = pMenuSelect->itemIdentifier; - help_req = ( (pMenuSelect->bIsHelpRequested != 0) ? TRUE : FALSE); - dbg("item id(%d) help request(%d)", item_id, help_req); - inparam = g_variant_new("(ib)", item_id, help_req); - - g_dbus_connection_call(handle->dbus_connection, DBUS_TELEPHONY_SERVICE, handle->path, - DBUS_TELEPHONY_SAT_INTERFACE, "SelectMenu", inparam, NULL, G_DBUS_CALL_FLAGS_NONE, -1, - handle->ca, on_response_menu_selection_envelop, evt_cb_data); - - g_variant_unref(inparam); - - return TAPI_API_SUCCESS; -} - -/** - * - * API to send event download to SIM. - * - * @return values in enum TapiResult_t. - * @param[in] TelSatEventDownloadReqInfo_t event download data. - * @Interface Asynchronous. - * @remark - * @Refer TelSatEventDownloadReqInfo_t - */ -EXPORT_API int tel_download_sat_event(TapiHandle *handle, const TelSatEventDownloadReqInfo_t *pEventData, tapi_response_cb callback, void *user_data) -{ - gboolean evt_check = FALSE; - int g_index = 0; - gint event_download_type, src_dev, dest_dev; - GVariant *download_data = NULL; - - GVariant *inparam = NULL; - struct tapi_resp_data *evt_cb_data = NULL; - - dbg("Func Entrance "); - - if (!handle || !handle->dbus_connection || !pEventData){ - dbg("invalid parameter"); - return TAPI_API_INVALID_INPUT; - } - - for(g_index = 0; g_event_list[g_index] > 0; g_index++){ - if(g_event_list[g_index] == pEventData->eventDownloadType ){ - dbg("event (%d) shoud be passed to sim"); - evt_check = TRUE; - } - } - - if(!evt_check){ - dbg("sim does not request event(%d)", pEventData->eventDownloadType); - return TAPI_API_SAT_EVENT_NOT_REQUIRED_BY_USIM; - } - - MAKE_RESP_CB_DATA(evt_cb_data, handle, callback, user_data); - - event_download_type = pEventData->eventDownloadType; - src_dev = TAPI_SAT_DEVICE_ID_ME; - dest_dev = TAPI_SAT_DEVICE_ID_SIM; - download_data = _tapi_sat_gen_event_download_data(pEventData); - dbg("event type(%d)", event_download_type); - inparam = g_variant_new("(iiiv)", event_download_type, src_dev, dest_dev, download_data); - - g_dbus_connection_call(handle->dbus_connection, DBUS_TELEPHONY_SERVICE, handle->path, - DBUS_TELEPHONY_SAT_INTERFACE, "DownloadEvent", inparam, NULL, G_DBUS_CALL_FLAGS_NONE, -1, - handle->ca, on_response_download_event_envelop, evt_cb_data); - - g_variant_unref(inparam); - - return TAPI_API_SUCCESS; -} - -/** - * - * API to get main menu information. - * - * @return values in enum TapiResult_t. - * @param[out] TelSatSetupMenuInfo_t main menu data. - * @Interface Synchronous. - * @remark - * @Refer TelSatSetupMenuInfo_t - */ -EXPORT_API int tel_get_sat_main_menu_info(TapiHandle *handle, TelSatSetupMenuInfo_t *pMainMenu) -{ - GError *error; - GVariant *rst = NULL; - - gchar *title; - gint result, command_id, item_cnt; - gboolean b_present, b_helpinfo, b_updated; - GVariant *items = NULL; - - dbg("Func Entrance "); - - if (!handle || !handle->dbus_connection || !pMainMenu){ - dbg("invalid parameter"); - return TAPI_API_INVALID_INPUT; - } - - memset(pMainMenu, 0, sizeof(TelSatSetupMenuInfo_t)); - - error = NULL; - rst = g_dbus_connection_call_sync(handle->dbus_connection, DBUS_TELEPHONY_SERVICE , handle->path, - DBUS_TELEPHONY_SAT_INTERFACE, "GetMainMenuInfo", NULL, NULL, G_DBUS_CALL_FLAGS_NONE, -1, NULL, &error); - - if(!rst){ - dbg( "error to get main menu(%s)", error->message); - g_error_free (error); - return TAPI_API_OPERATION_FAILED; - } - - dbg("menu_info type_format(%s)", g_variant_get_type_string(rst)); - - g_variant_get(rst, "(iibs@vibb)", &result, &command_id, &b_present, &title, &items, &item_cnt, - &b_helpinfo, &b_updated); - - pMainMenu->commandId = command_id; - pMainMenu->bIsMainMenuPresent = (b_present ? 1 : 0); - memcpy(pMainMenu->satMainTitle, title, TAPI_SAT_DEF_TITLE_LEN_MAX+1); - pMainMenu->satMainMenuNum = item_cnt; - if(items && item_cnt > 0){ - int index = 0; - GVariant *unbox; - GVariantIter *iter; - - gchar *item_str; - gint item_id; - unbox = g_variant_get_variant(items); - dbg("items(%p) items type_format(%s)", items, g_variant_get_type_string(unbox)); - - g_variant_get(unbox, "a(si)", &iter); - while(g_variant_iter_loop(iter,"(si)",&item_str, &item_id)){ - pMainMenu->satMainMenuItem[index].itemId = item_id; - memcpy(pMainMenu->satMainMenuItem[index].itemString, item_str, TAPI_SAT_DEF_ITEM_STR_LEN_MAX + 6); - dbg("item index(%d) id(%d) str(%s)",index, pMainMenu->satMainMenuItem[index].itemId, pMainMenu->satMainMenuItem[index].itemString); - //dbg("item index(%d) id(%d) str(%s)",index, item_id, item_str); - index++; - } - g_variant_iter_free(iter); - } - pMainMenu->bIsSatMainMenuHelpInfo = (b_helpinfo ? 1 : 0); - pMainMenu->bIsUpdatedSatMainMenu = (b_updated ? 1 : 0); - - dbg("result (%d)", result); - dbg("command id (%d)", pMainMenu->commandId); - dbg("menu present (%d)", pMainMenu->bIsMainMenuPresent); - dbg("menu title (%s)", pMainMenu->satMainTitle); - dbg("item cnt (%d)", pMainMenu->satMainMenuNum); - dbg("menu help info (%d)", pMainMenu->bIsSatMainMenuHelpInfo); - dbg("menu updated (%d)", pMainMenu->bIsUpdatedSatMainMenu); - - return TAPI_API_SUCCESS; -} - -/** - * - * API to send UI display status. - * - * @return values in enum TapiResult_t. - * @param[in] TelSatUiDisplayStatusType_t display status data. - command_id command identifier - * @Interface Asynchronous. - * @remark - * @Refer TelSatUiDisplayStatusType_t - */ -EXPORT_API int tel_send_sat_ui_display_status(TapiHandle *handle, int commandId, TelSatUiDisplayStatusType_t status) -{ - GError *error; - GVariant *rst = NULL; - - gint result, command_id; - gboolean display_status; - GVariant *inparam = NULL; - - dbg("Func Entrance "); - - if (!handle || !handle->dbus_connection){ - dbg("invalid parameter"); - return TAPI_API_INVALID_INPUT; - } - - command_id = commandId; - display_status = ( (status == TAPI_SAT_DISPLAY_SUCCESS) ? TRUE : FALSE); - dbg("command id(%d) display status(%d)", command_id, display_status); - inparam = g_variant_new("(ib)", command_id, display_status); - - error = NULL; - rst = g_dbus_connection_call_sync(handle->dbus_connection, DBUS_TELEPHONY_SERVICE , handle->path, - DBUS_TELEPHONY_SAT_INTERFACE, "SendUiDisplayStatus", inparam, NULL, G_DBUS_CALL_FLAGS_NONE, -1, NULL, &error); - - if(!rst){ - dbg( "error to send ui display status(%s)", error->message); - g_error_free (error); - return TAPI_API_OPERATION_FAILED; - } - - dbg("send ui display status format(%s)", g_variant_get_type_string(rst)); - - g_variant_get(rst, "(i)", &result); - if(result){ - result = TAPI_API_SUCCESS; - } - else{ - result = TAPI_API_OPERATION_FAILED; - } - dbg("result (%d)", result); - - return result; -} - -/** - * - * API to send UI user confirmation data. - * - * @return values in enum TapiResult_t. - * @param[in] command_id command identifier - command_type command type - key_type user confirmation value - addtional_data addtional data - data_len data length - * @Interface Asynchronous. - * @remark - * @Refer - */ -EXPORT_API int tel_send_sat_ui_user_confirm(TapiHandle *handle, TelSatUiUserConfirmInfo_t *pUserConfirmData) -{ - GError *error; - GVariant *rst = NULL; - GVariantBuilder *builder = NULL; - GVariant *inner_gv = NULL; - - int index = 0; - gchar *data; - gint result, command_id, command_type, key_type, data_len; - GVariant *inparam = NULL; - - dbg("Func Entrance "); - - if (!handle || !handle->dbus_connection || !pUserConfirmData){ - dbg("invalid parameter"); - return TAPI_API_INVALID_INPUT; - } - - command_id = pUserConfirmData->commandId; - command_type = pUserConfirmData->commandType; - key_type = pUserConfirmData->keyType; - data = (gchar *)pUserConfirmData->pAdditionalData; - data_len = pUserConfirmData->dataLen; - - builder = g_variant_builder_new(G_VARIANT_TYPE ("ay")); - for (index = 0; index < data_len; index++) { - dbg("index(%d) data(%d)", index, data[index]); - g_variant_builder_add(builder, "y", data[index]); - } - inner_gv = g_variant_builder_end(builder); - - dbg("command id(%d) command type(%d) key type(%d) data len(%d)", - command_id, command_type, key_type, data_len); - inparam = g_variant_new("(iiiv)", command_id, command_type, key_type, inner_gv); - - error = NULL; - rst = g_dbus_connection_call_sync(handle->dbus_connection, DBUS_TELEPHONY_SERVICE , handle->path, - DBUS_TELEPHONY_SAT_INTERFACE, "SendUserConfirm", inparam, NULL, G_DBUS_CALL_FLAGS_NONE, -1, NULL, &error); - - if(!rst){ - dbg( "error to send ui user confirm(%s)", error->message); - g_error_free (error); - return TAPI_API_OPERATION_FAILED; - } - - dbg("send ui user confirm format(%s)", g_variant_get_type_string(rst)); - - g_variant_get(rst, "(i)", &result); - if(result){ - result = TAPI_API_SUCCESS; - } - else{ - result = TAPI_API_OPERATION_FAILED; - } - dbg("result (%d)", result); - - return result; -} - -/** - * - * API to send application excution result. - * - * @return values in enum TapiResult_t. - * @param[in] TelSatAppsRetInfo_t application result information data. - * @Interface Asynchronous. - * @remark - * @Refer TelSatAppsRetInfo_t - */ -EXPORT_API int tel_send_sat_app_exec_result(TapiHandle *handle, TelSatAppsRetInfo_t *pAppRetInfo) -{ - GError *error; - GVariant *rst = NULL; - - gint result, command_id, command_type; - GVariant *app_exec_result = NULL; - GVariant *inparam = NULL; - - dbg("Func Entrance "); - - if (!handle || !handle->dbus_connection || !pAppRetInfo){ - dbg("invalid parameter"); - return TAPI_API_INVALID_INPUT; - } - - command_id = pAppRetInfo->commandId; - command_type = pAppRetInfo->commandType; - app_exec_result = _tapi_sat_gen_app_exec_result_data(pAppRetInfo); - - dbg("command id(%d) command type(%d) exec_result(%s)", command_id, command_type, g_variant_get_type_string(app_exec_result)); - inparam = g_variant_new("(iiv)", command_id, command_type, app_exec_result); - - error = NULL; - dbg("test (%s)", g_variant_get_type_string(inparam)); - rst = g_dbus_connection_call_sync(handle->dbus_connection, DBUS_TELEPHONY_SERVICE , handle->path, - DBUS_TELEPHONY_SAT_INTERFACE, "SendAppExecResult", inparam, NULL, G_DBUS_CALL_FLAGS_NONE, -1, NULL, &error); - - if(!rst){ - dbg( "error to send app execution result(%s)", error->message); - g_error_free (error); - return TAPI_API_OPERATION_FAILED; - } - - dbg("send app execution result format(%s)", g_variant_get_type_string(rst)); - - g_variant_get(rst, "(i)", &result); - if(result){ - result = TAPI_API_SUCCESS; - } - else{ - result = TAPI_API_OPERATION_FAILED; - } - dbg("result (%d)", result); - - return result; -} diff --git a/mobile/src/tapi_sim.c b/mobile/src/tapi_sim.c deleted file mode 100644 index be5f693..0000000 --- a/mobile/src/tapi_sim.c +++ /dev/null @@ -1,2473 +0,0 @@ -/* - * libslp-tapi - * - * Copyright (c) 2012 Samsung Electronics Co., Ltd. All rights reserved. - * - * Contact: Ja-young Gu - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT 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 "TapiUtility.h" -#include "TelSim.h" - -#include "common.h" -#include "tapi_log.h" -#include "ITapiSim.h" - -static int _tel_check_tapi_state() -{ - return 0; -} - -static int _tel_check_sim_state(TapiHandle *handle) -{ - GError *gerr = NULL; - GVariant *sync_gv = NULL; - int api_err = TAPI_API_SUCCESS; - TelSimCardStatus_t init_status = 0; - int changed = FALSE; - - sync_gv = g_dbus_connection_call_sync(handle->dbus_connection, DBUS_TELEPHONY_SERVICE, - handle->path, DBUS_TELEPHONY_SIM_INTERFACE, "GetInitStatus", NULL, NULL, - G_DBUS_CALL_FLAGS_NONE, -1, NULL, &gerr); - - if (sync_gv) { - g_variant_get(sync_gv, "(ib)", &init_status, &changed); - dbg("init_status[%d]",init_status); - - switch(init_status){ - case TAPI_SIM_STATUS_CARD_NOT_PRESENT : - case TAPI_SIM_STATUS_CARD_REMOVED : - api_err = TAPI_API_SIM_NOT_FOUND; - break; - case TAPI_SIM_STATUS_CARD_BLOCKED : - case TAPI_SIM_STATUS_CARD_ERROR : - api_err = TAPI_API_SIM_CARD_ERROR; - break; - case TAPI_SIM_STATUS_SIM_INITIALIZING : - api_err = TAPI_API_SIM_NOT_INITIALIZED; - break; - case TAPI_SIM_STATUS_SIM_INIT_COMPLETED : - api_err = TAPI_API_SUCCESS; - break; - case TAPI_SIM_STATUS_SIM_PIN_REQUIRED : - case TAPI_SIM_STATUS_SIM_PUK_REQUIRED : - case TAPI_SIM_STATUS_SIM_NCK_REQUIRED : - case TAPI_SIM_STATUS_SIM_NSCK_REQUIRED : - case TAPI_SIM_STATUS_SIM_SPCK_REQUIRED : - case TAPI_SIM_STATUS_SIM_CCK_REQUIRED : - case TAPI_SIM_STATUS_SIM_LOCK_REQUIRED : - api_err = TAPI_API_SIM_LOCKED; - break; - case TAPI_SIM_STATUS_UNKNOWN: - api_err = TAPI_API_SERVICE_NOT_READY; - break; - default: - dbg("not handled status[%d] in here",init_status); - break; - } - } else { - dbg( "g_dbus_conn failed in _tel_check_sim_state. error (%s)", gerr->message); - g_error_free(gerr); - return TAPI_API_OPERATION_FAILED; - } - dbg("api_err[%d]", api_err); - return api_err; -} - -static void on_response_get_sim_iccid(GObject *source_object, GAsyncResult *res, gpointer user_data) -{ - GError *error = NULL; - GDBusConnection *conn = NULL; - GVariant *dbus_result; - - struct tapi_resp_data *evt_cb_data = user_data; - TelSimAccessResult_t result = TAPI_SIM_ACCESS_SUCCESS; - TelSimIccIdInfo_t iccid_info; - gchar *iccid = NULL; - - dbg("Func Entrance"); - memset(&iccid_info, 0, sizeof(TelSimIccIdInfo_t)); - - conn = G_DBUS_CONNECTION (source_object); - dbus_result = g_dbus_connection_call_finish(conn, res, &error); - - CHECK_DEINIT(error); - - if (!dbus_result) { - if (evt_cb_data->cb_fn) { - evt_cb_data->cb_fn(evt_cb_data->handle, -1, NULL, evt_cb_data->user_data); - } - - if (error) - g_error_free(error); - - free(evt_cb_data); - return; - } - - g_variant_get(dbus_result, "(is)", &result, &iccid); - iccid_info.icc_length = strlen((const char*)iccid); - if(iccid_info.icc_length > TAPI_SIM_ICCID_LEN_MAX){ - dbg("current tapi support 20 byte but received length[%d] so changed"); - iccid_info.icc_length = TAPI_SIM_ICCID_LEN_MAX; - } - memcpy(iccid_info.icc_num, iccid, iccid_info.icc_length); - - if (evt_cb_data->cb_fn) { - evt_cb_data->cb_fn(evt_cb_data->handle, result, &iccid_info, evt_cb_data->user_data); - } - - free(evt_cb_data); -} - -static void on_response_get_sim_language(GObject *source_object, GAsyncResult *res, - gpointer user_data) -{ - GError *error = NULL; - GDBusConnection *conn = NULL; - GVariant *dbus_result; - - struct tapi_resp_data *evt_cb_data = user_data; - TelSimLanguagePreferenceCode_t lang = TAPI_SIM_LP_LANG_UNSPECIFIED; - TelSimAccessResult_t result = TAPI_SIM_ACCESS_SUCCESS; - - dbg("Func Entrance"); - conn = G_DBUS_CONNECTION (source_object); - dbus_result = g_dbus_connection_call_finish(conn, res, &error); - CHECK_DEINIT(error); - - if (!dbus_result) { - if (evt_cb_data->cb_fn) { - evt_cb_data->cb_fn(evt_cb_data->handle, -1, NULL, evt_cb_data->user_data); - } - - if (error) - g_error_free(error); - - free(evt_cb_data); - return; - } - - g_variant_get(dbus_result, "(ii)", &result, &lang); - - if (evt_cb_data->cb_fn) { - evt_cb_data->cb_fn(evt_cb_data->handle, result, &lang, evt_cb_data->user_data); - } - - free(evt_cb_data); -} - -static void on_response_set_sim_language(GObject *source_object, GAsyncResult *res, - gpointer user_data) -{ - GError *error = NULL; - GDBusConnection *conn = NULL; - GVariant *dbus_result; - - struct tapi_resp_data *evt_cb_data = user_data; - TelSimAccessResult_t result = TAPI_SIM_ACCESS_SUCCESS; - - dbg("Func Entrance"); - conn = G_DBUS_CONNECTION (source_object); - dbus_result = g_dbus_connection_call_finish(conn, res, &error); - CHECK_DEINIT(error); - - if (!dbus_result) { - if (evt_cb_data->cb_fn) { - evt_cb_data->cb_fn(evt_cb_data->handle, -1, NULL, evt_cb_data->user_data); - } - - if (error) - g_error_free(error); - - free(evt_cb_data); - return; - } - - g_variant_get(dbus_result, "(i)", &result); - - if (evt_cb_data->cb_fn) { - evt_cb_data->cb_fn(evt_cb_data->handle, result, NULL, evt_cb_data->user_data); - } - - free(evt_cb_data); -} - -static void on_response_get_sim_callforwarding_info(GObject *source_object, GAsyncResult *res, - gpointer user_data) -{ - GError *error = NULL; - GDBusConnection *conn = NULL; - GVariant *dbus_result; - GVariant *value = NULL; - GVariantIter *cphs_iter = NULL; - GVariantIter *iter = NULL; - GVariantIter *iter_row = NULL; - const gchar *key = NULL; - const gchar *str_value = NULL; - struct tapi_resp_data *evt_cb_data = user_data; - TelSimAccessResult_t result = TAPI_SIM_ACCESS_SUCCESS; - TelSimCallForwardingResp_t cf; - int i =0; - - memset(&cf, 0, sizeof(TelSimCallForwardingResp_t)); - - dbg("Func Entrance"); - conn = G_DBUS_CONNECTION (source_object); - dbus_result = g_dbus_connection_call_finish(conn, res, &error); - CHECK_DEINIT(error); - - if (!dbus_result) { - if (evt_cb_data->cb_fn) { - evt_cb_data->cb_fn(evt_cb_data->handle, -1, NULL, evt_cb_data->user_data); - } - - if (error) - g_error_free(error); - - free(evt_cb_data); - return; - } - dbg("dbus_result format(%s)", g_variant_get_type_string(dbus_result)); - g_variant_get(dbus_result, "(ibaa{sv}a{sv})", &result, &cf.b_cphs, &iter, &cphs_iter); - - if( cf.b_cphs ) { - while (g_variant_iter_loop(cphs_iter, "{sv}", &key, &value)) { - if (!g_strcmp0(key, "b_line1")) { - cf.cphs_cf.b_line1 = g_variant_get_boolean(value); - } - if (!g_strcmp0(key, "b_line2")) { - cf.cphs_cf.b_line2 = g_variant_get_boolean(value); - } - if (!g_strcmp0(key, "b_fax")) { - cf.cphs_cf.b_fax = g_variant_get_boolean(value); - } - if (!g_strcmp0(key, "b_data")) { - cf.cphs_cf.b_data = g_variant_get_boolean(value); - } - } - } else { - cf.cf_list.profile_count = g_variant_iter_n_children(iter); - - while (g_variant_iter_next(iter, "a{sv}", &iter_row)) { - while (g_variant_iter_loop(iter_row, "{sv}", &key, &value)) { - if (!g_strcmp0(key, "rec_index")) { - cf.cf_list.cf[i].rec_index = g_variant_get_int32(value); - } - if (!g_strcmp0(key, "msp_num")) { - cf.cf_list.cf[i].msp_num = g_variant_get_byte(value); - } - if (!g_strcmp0(key, "cfu_status")) { - cf.cf_list.cf[i].cfu_status = g_variant_get_byte(value); - } - if (!g_strcmp0(key, "cfu_num")) { - str_value = g_variant_get_string(value, NULL); - snprintf(cf.cf_list.cf[i].cfu_num, strlen((const char*) str_value) + 1, "%s", str_value); - } - if (!g_strcmp0(key, "ton")) { - cf.cf_list.cf[i].ton = g_variant_get_int32(value); - } - if (!g_strcmp0(key, "npi")) { - cf.cf_list.cf[i].npi = g_variant_get_int32(value); - } - if (!g_strcmp0(key, "cc2_id")) { - cf.cf_list.cf[i].cc2_id = g_variant_get_byte(value); - } - if (!g_strcmp0(key, "ext7_id")) { - cf.cf_list.cf[i].ext7_id = g_variant_get_byte(value); - } - } - i++; - g_variant_iter_free(iter_row); - } - g_variant_iter_free(iter); - } - - if (evt_cb_data->cb_fn) { - evt_cb_data->cb_fn(evt_cb_data->handle, result, &cf, evt_cb_data->user_data); - } - - free(evt_cb_data); -} - -static void on_response_set_sim_callforwarding_info(GObject *source_object, GAsyncResult *res, - gpointer user_data) -{ - GError *error = NULL; - GDBusConnection *conn = NULL; - GVariant *dbus_result; - - struct tapi_resp_data *evt_cb_data = user_data; - TelSimAccessResult_t result = TAPI_SIM_ACCESS_SUCCESS; - - dbg("Func Entrance"); - conn = G_DBUS_CONNECTION (source_object); - dbus_result = g_dbus_connection_call_finish(conn, res, &error); - CHECK_DEINIT(error); - - if (!dbus_result) { - if (evt_cb_data->cb_fn) { - evt_cb_data->cb_fn(evt_cb_data->handle, -1, NULL, evt_cb_data->user_data); - } - - if (error) - g_error_free(error); - - free(evt_cb_data); - return; - } - - g_variant_get(dbus_result, "(i)", &result); - - if (evt_cb_data->cb_fn) { - evt_cb_data->cb_fn(evt_cb_data->handle, result, NULL, evt_cb_data->user_data); - } - - free(evt_cb_data); -} - - -static void on_response_get_sim_messagewaiting_info(GObject *source_object, GAsyncResult *res, - gpointer user_data) -{ - GError *error = NULL; - GDBusConnection *conn = NULL; - GVariant *dbus_result; - GVariant *value = NULL; - GVariantIter *cphs_iter = NULL; - GVariantIter *iter = NULL; - GVariantIter *iter_row = NULL; - const gchar *key = NULL; - struct tapi_resp_data *evt_cb_data = user_data; - TelSimAccessResult_t result = TAPI_SIM_ACCESS_SUCCESS; - TelSimMessageWaitingResp_t mw; - int i =0; - - dbg("Func Entrance"); - memset(&mw, 0, sizeof(TelSimMessageWaitingResp_t)); - - conn = G_DBUS_CONNECTION (source_object); - dbus_result = g_dbus_connection_call_finish(conn, res, &error); - CHECK_DEINIT(error); - - if (!dbus_result) { - if (evt_cb_data->cb_fn) { - evt_cb_data->cb_fn(evt_cb_data->handle, -1, NULL, evt_cb_data->user_data); - } - - if (error) - g_error_free(error); - - free(evt_cb_data); - return; - } - - dbg("dbus_result format(%s)", g_variant_get_type_string(dbus_result)); - g_variant_get(dbus_result, "(ibaa{sv}a{sv})", &result, &mw.b_cphs, &iter, &cphs_iter); - - if( mw.b_cphs ) { - while (g_variant_iter_loop(cphs_iter, "{sv}", &key, &value)) { - if (!g_strcmp0(key, "b_voice1")) { - mw.cphs_mw.b_voice1 = g_variant_get_boolean(value); - } - if (!g_strcmp0(key, "b_voice2")) { - mw.cphs_mw.b_voice2 = g_variant_get_boolean(value); - } - if (!g_strcmp0(key, "b_fax")) { - mw.cphs_mw.b_fax = g_variant_get_boolean(value); - } - if (!g_strcmp0(key, "b_data")) { - mw.cphs_mw.b_data = g_variant_get_boolean(value); - } - } - - } else { - mw.mw_list.profile_count = g_variant_iter_n_children(iter); - - while (g_variant_iter_next(iter, "a{sv}", &iter_row)) { - while (g_variant_iter_loop(iter_row, "{sv}", &key, &value)) { - if (!g_strcmp0(key, "rec_index")) { - mw.mw_list.mw[i].rec_index = g_variant_get_int32(value); - } - if (!g_strcmp0(key, "indicator_status")) { - mw.mw_list.mw[i].indicator_status = g_variant_get_byte(value); - } - if (!g_strcmp0(key, "voice_count")) { - mw.mw_list.mw[i].voice_count = g_variant_get_int32(value); - } - if (!g_strcmp0(key, "fax_count")) { - mw.mw_list.mw[i].fax_count = g_variant_get_int32(value); - } - if (!g_strcmp0(key, "email_count")) { - mw.mw_list.mw[i].email_count = g_variant_get_int32(value); - } - if (!g_strcmp0(key, "other_count")) { - mw.mw_list.mw[i].other_count = g_variant_get_int32(value); - } - if (!g_strcmp0(key, "video_count")) { - mw.mw_list.mw[i].video_count = g_variant_get_int32(value); - } - } - i++; - g_variant_iter_free(iter_row); - } - g_variant_iter_free(iter); - } - - if (evt_cb_data->cb_fn) { - evt_cb_data->cb_fn(evt_cb_data->handle, result, &mw, evt_cb_data->user_data); - } - - free(evt_cb_data); -} - -static void on_response_set_sim_messagewaiting_info(GObject *source_object, GAsyncResult *res, - gpointer user_data) -{ - GError *error = NULL; - GDBusConnection *conn = NULL; - GVariant *dbus_result; - - struct tapi_resp_data *evt_cb_data = user_data; - TelSimAccessResult_t result = TAPI_SIM_ACCESS_SUCCESS; - - dbg("Func Entrance"); - conn = G_DBUS_CONNECTION (source_object); - dbus_result = g_dbus_connection_call_finish(conn, res, &error); - CHECK_DEINIT(error); - - if (!dbus_result) { - if (evt_cb_data->cb_fn) { - evt_cb_data->cb_fn(evt_cb_data->handle, -1, NULL, evt_cb_data->user_data); - } - - if (error) - g_error_free(error); - - free(evt_cb_data); - return; - } - - g_variant_get(dbus_result, "(i)", &result); - - if (evt_cb_data->cb_fn) { - evt_cb_data->cb_fn(evt_cb_data->handle, result, NULL, evt_cb_data->user_data); - } - - free(evt_cb_data); -} - -static void on_response_get_sim_mailbox_info(GObject *source_object, GAsyncResult *res, - gpointer user_data) -{ - GError *error = NULL; - GDBusConnection *conn = NULL; - GVariant *dbus_result; - GVariant *value = NULL; - GVariantIter *iter = NULL; - GVariantIter *iter_row = NULL; - const gchar *key = NULL; - const gchar *str_value = NULL; - struct tapi_resp_data *evt_cb_data = user_data; - TelSimAccessResult_t result = TAPI_SIM_ACCESS_SUCCESS; - TelSimMailboxList_t list; - int i = 0; - gboolean b_cphs = 0; - - dbg("Func Entrance"); - memset(&list, 0, sizeof(TelSimMailboxList_t)); - - conn = G_DBUS_CONNECTION (source_object); - dbus_result = g_dbus_connection_call_finish(conn, res, &error); - CHECK_DEINIT(error); - - if (!dbus_result) { - if (evt_cb_data->cb_fn) { - evt_cb_data->cb_fn(evt_cb_data->handle, -1, NULL, evt_cb_data->user_data); - } - - if (error) - g_error_free(error); - - free(evt_cb_data); - return; - } - - g_variant_get(dbus_result, "(ibaa{sv})", &result, &b_cphs, &iter); - list.count = g_variant_iter_n_children(iter); - - i = 0; - while (g_variant_iter_next(iter, "a{sv}", &iter_row)) { - while (g_variant_iter_loop(iter_row, "{sv}", &key, &value)) { - list.list[i].b_cphs = b_cphs; - - if (!g_strcmp0(key, "rec_index")) { - list.list[i].rec_index = g_variant_get_int32(value); - } - if (!g_strcmp0(key, "profile_num")) { - list.list[i].profile_num = g_variant_get_int32(value); - } - if (!g_strcmp0(key, "mb_type")) { - list.list[i].mb_type = g_variant_get_int32(value); - } - if (!g_strcmp0(key, "alpha_id_max_len")) { - list.list[i].alpha_id_max_len = g_variant_get_int32(value); - } - if (!g_strcmp0(key, "alpha_id")) { - str_value = g_variant_get_string(value, NULL); - snprintf(list.list[i].alpha_id, strlen((const char*)str_value) + 1, "%s", str_value); - } - if (!g_strcmp0(key, "ton")) { - list.list[i].ton = g_variant_get_int32(value); - } - if (!g_strcmp0(key, "npi")) { - list.list[i].npi = g_variant_get_int32(value); - } - if (!g_strcmp0(key, "num")) { - str_value = g_variant_get_string(value, NULL); - snprintf(list.list[i].num, strlen((const char*)str_value) + 1, "%s", str_value); - } - if (!g_strcmp0(key, "cc_id")) { - list.list[i].cc_id = g_variant_get_byte(value); - } - if (!g_strcmp0(key, "ext1_id")) { - list.list[i].ext1_id = g_variant_get_byte(value); - } - } - i++; - g_variant_iter_free(iter_row); - } - g_variant_iter_free(iter); - - if (evt_cb_data->cb_fn) { - evt_cb_data->cb_fn(evt_cb_data->handle, result, &list, evt_cb_data->user_data); - } - - free(evt_cb_data); -} - -static void on_response_set_sim_mailbox_info(GObject *source_object, GAsyncResult *res, - gpointer user_data) -{ - GError *error = NULL; - GDBusConnection *conn = NULL; - GVariant *dbus_result; - - struct tapi_resp_data *evt_cb_data = user_data; - TelSimAccessResult_t result = TAPI_SIM_ACCESS_SUCCESS; - - dbg("Func Entrance"); - conn = G_DBUS_CONNECTION (source_object); - dbus_result = g_dbus_connection_call_finish(conn, res, &error); - CHECK_DEINIT(error); - - if (!dbus_result) { - if (evt_cb_data->cb_fn) { - evt_cb_data->cb_fn(evt_cb_data->handle, -1, NULL, evt_cb_data->user_data); - } - - if (error) - g_error_free(error); - - free(evt_cb_data); - return; - } - - g_variant_get(dbus_result, "(i)", &result); - - if (evt_cb_data->cb_fn) { - evt_cb_data->cb_fn(evt_cb_data->handle, result, NULL, evt_cb_data->user_data); - } - - free(evt_cb_data); -} - -static void on_response_get_sim_cphs_info(GObject *source_object, GAsyncResult *res, - gpointer user_data) -{ - GError *error = NULL; - GDBusConnection *conn = NULL; - GVariant *dbus_result; - - struct tapi_resp_data *evt_cb_data = user_data; - TelSimAccessResult_t result = TAPI_SIM_ACCESS_SUCCESS; - TelSimCphsInfo_t cphs; - - dbg("Func Entrance"); - memset(&cphs, 0, sizeof(TelSimCphsInfo_t)); - - conn = G_DBUS_CONNECTION (source_object); - dbus_result = g_dbus_connection_call_finish(conn, res, &error); - CHECK_DEINIT(error); - - if (!dbus_result) { - if (evt_cb_data->cb_fn) { - evt_cb_data->cb_fn(evt_cb_data->handle, -1, NULL, evt_cb_data->user_data); - } - - if (error) - g_error_free(error); - - free(evt_cb_data); - return; - } - - g_variant_get(dbus_result, "(iibbbbb)", &result, &cphs.CphsPhase, - &cphs.CphsServiceTable.bOperatorNameShortForm, &cphs.CphsServiceTable.bMailBoxNumbers, - &cphs.CphsServiceTable.bServiceStringTable, - &cphs.CphsServiceTable.bCustomerServiceProfile, - &cphs.CphsServiceTable.bInformationNumbers); - - if (evt_cb_data->cb_fn) { - evt_cb_data->cb_fn(evt_cb_data->handle, result, &cphs, evt_cb_data->user_data); - } - - free(evt_cb_data); -} - -static void on_response_get_sim_msisdn(GObject *source_object, GAsyncResult *res, - gpointer user_data) -{ - GError *error = NULL; - GDBusConnection *conn = NULL; - GVariant *dbus_result; - GVariant *value = NULL; - GVariantIter *iter = NULL; - GVariantIter *iter_row = NULL; - const gchar *key = NULL; - const gchar *str_value = NULL; - struct tapi_resp_data *evt_cb_data = user_data; - TelSimAccessResult_t result = TAPI_SIM_ACCESS_SUCCESS; - TelSimMsisdnList_t list; - int i = 0; - - dbg("Func Entrance"); - memset(&list, 0, sizeof(TelSimMsisdnList_t)); - - conn = G_DBUS_CONNECTION (source_object); - dbus_result = g_dbus_connection_call_finish(conn, res, &error); - CHECK_DEINIT(error); - - if (!dbus_result) { - if (evt_cb_data->cb_fn) { - evt_cb_data->cb_fn(evt_cb_data->handle, -1, NULL, evt_cb_data->user_data); - } - - if (error) - g_error_free(error); - - free(evt_cb_data); - return; - } - - g_variant_get(dbus_result, "(iaa{sv})", &result, &iter); - list.count = g_variant_iter_n_children(iter); - - /*this can be changed regarding concept*/ - if(list.count > 3){ - dbg("current list.count[%d] but we fixed maximum with 3", list.count); - list.count = 3; - } - /*this can be changed regarding concept*/ - - i = 0; - while (g_variant_iter_next(iter, "a{sv}", &iter_row)) { - while (g_variant_iter_loop(iter_row, "{sv}", &key, &value)) { - if (!g_strcmp0(key, "name")) { - str_value = g_variant_get_string(value, NULL); - snprintf(list.list[i].name, strlen((const char*)str_value) + 1, "%s", str_value); - } - if (!g_strcmp0(key, "number")) { - str_value = g_variant_get_string(value, NULL); - snprintf(list.list[i].num, strlen((const char*)str_value) + 1, "%s", str_value); - } - } - i++; - g_variant_iter_free(iter_row); - /*this can be changed regarding concept*/ - if (i == 3) - break; - /*this can be changed regarding concept*/ - } - g_variant_iter_free(iter); - - dbg("msisdn count[%d]", list.count); - for(i =0; i < list.count; i++){ - dbg("msisdn[%d]-name[%s]number[%s]",i,list.list[i].name, list.list[i].num); - } - - if (evt_cb_data->cb_fn) { - evt_cb_data->cb_fn(evt_cb_data->handle, result, &list, evt_cb_data->user_data); - } - - free(evt_cb_data); -} - -static void on_response_get_sim_oplmnwact(GObject *source_object, GAsyncResult *res, - gpointer user_data) -{ - GError *error = NULL; - GDBusConnection *conn = NULL; - GVariant *dbus_result; - GVariant *value = NULL; - GVariantIter *iter = NULL; - GVariantIter *iter_row = NULL; - const gchar *key = NULL; - const gchar *str_value = NULL; - struct tapi_resp_data *evt_cb_data = user_data; - TelSimAccessResult_t result = TAPI_SIM_ACCESS_SUCCESS; - TelSimOplmnwactList_t list; - int i = 0; - - dbg("Func Entrance"); - memset(&list, 0, sizeof(TelSimOplmnwactList_t)); - - conn = G_DBUS_CONNECTION (source_object); - dbus_result = g_dbus_connection_call_finish(conn, res, &error); - CHECK_DEINIT(error); - - if (!dbus_result) { - if (evt_cb_data->cb_fn) { - evt_cb_data->cb_fn(evt_cb_data->handle, -1, NULL, evt_cb_data->user_data); - } - - if (error) - g_error_free(error); - - free(evt_cb_data); - return; - } - - g_variant_get(dbus_result, "(iaa{sv})", &result, &iter); - list.count = g_variant_iter_n_children(iter); - - i = 0; - while (g_variant_iter_next(iter, "a{sv}", &iter_row)) { - while (g_variant_iter_loop(iter_row, "{sv}", &key, &value)) { - if (!g_strcmp0(key, "plmn")) { - str_value = g_variant_get_string(value, NULL); - snprintf(list.list[i].plmn, strlen((const char*)str_value) + 1, "%s", str_value); - } - if (!g_strcmp0(key, "b_umst")) { - list.list[i].b_umts = g_variant_get_boolean(value); - } - if (!g_strcmp0(key, "b_gsm")) { - list.list[i].b_gsm = g_variant_get_boolean(value); - } - } - i++; - g_variant_iter_free(iter_row); - } - g_variant_iter_free(iter); - - if (evt_cb_data->cb_fn) { - evt_cb_data->cb_fn(evt_cb_data->handle, result, &list, evt_cb_data->user_data); - } - - free(evt_cb_data); -} - -static void on_response_get_sim_spn(GObject *source_object, GAsyncResult *res, - gpointer user_data) -{ - GError *error = NULL; - GDBusConnection *conn = NULL; - GVariant *dbus_result; - - struct tapi_resp_data *evt_cb_data = user_data; - TelSimAccessResult_t result = TAPI_SIM_ACCESS_SUCCESS; - TelSimSpn_t spn_info; - gchar *spn = NULL; - guchar dc = 0; - - memset(&spn_info, 0, sizeof(TelSimSpn_t)); - - dbg("Func Entrance"); - conn = G_DBUS_CONNECTION (source_object); - dbus_result = g_dbus_connection_call_finish(conn, res, &error); - CHECK_DEINIT(error); - - if (!dbus_result) { - if (evt_cb_data->cb_fn) { - evt_cb_data->cb_fn(evt_cb_data->handle, -1, NULL, evt_cb_data->user_data); - } - - if (error) - g_error_free(error); - - free(evt_cb_data); - return; - } - - g_variant_get(dbus_result, "(iys)", &result, &dc, &spn); - - dbg("result[%d]", result); - if ( result == TAPI_SIM_ACCESS_SUCCESS) { - dbg("spn[%s], display condition[0x%x]", spn, dc); - spn_info.display_condition = dc; - snprintf((char *)spn_info.spn, strlen((const char*)spn)+1, "%s", spn); - } - - if (evt_cb_data->cb_fn) { - evt_cb_data->cb_fn(evt_cb_data->handle, result, &spn_info, evt_cb_data->user_data); - } - - free(evt_cb_data); -} - -static void on_response_get_sim_cphs_netname(GObject *source_object, GAsyncResult *res, - gpointer user_data) -{ - GError *error = NULL; - GDBusConnection *conn = NULL; - GVariant *dbus_result; - - struct tapi_resp_data *evt_cb_data = user_data; - TelSimAccessResult_t result = TAPI_SIM_ACCESS_SUCCESS; - TelSimCphsNetName_t cphs_net; - gchar *full_name = NULL; - gchar *short_name = NULL; - - memset(&cphs_net, 0, sizeof(TelSimCphsNetName_t)); - - dbg("Func Entrance"); - conn = G_DBUS_CONNECTION (source_object); - dbus_result = g_dbus_connection_call_finish(conn, res, &error); - CHECK_DEINIT(error); - - if (!dbus_result) { - if (evt_cb_data->cb_fn) { - evt_cb_data->cb_fn(evt_cb_data->handle, -1, NULL, evt_cb_data->user_data); - } - - if (error) - g_error_free(error); - - free(evt_cb_data); - return; - } - - g_variant_get(dbus_result, "(iss)", &result, &full_name, &short_name); - - dbg("result[%d]", result); - if ( result == TAPI_SIM_ACCESS_SUCCESS) { - dbg("full name[%s], short name[%s]", full_name, short_name); - snprintf((char *)cphs_net.full_name, strlen((const char*)full_name)+1, "%s", full_name); - snprintf((char *)cphs_net.short_name, strlen((const char*)short_name)+1, "%s", short_name); - } - - if (evt_cb_data->cb_fn) { - evt_cb_data->cb_fn(evt_cb_data->handle, result, &cphs_net, evt_cb_data->user_data); - } - - free(evt_cb_data); -} - -static void on_response_req_sim_authentication(GObject *source_object, GAsyncResult *res, - gpointer user_data) -{ - GError *error = NULL; - GDBusConnection *conn = NULL; - GVariant *dbus_result; - - GVariantIter *iter = NULL; - GVariant *ak_gv = NULL; - GVariant *cp_gv = NULL; - GVariant *it_gv = NULL; - GVariant *resp_gv = NULL; - GVariant *ak = NULL; - GVariant *cp = NULL; - GVariant *it = NULL; - GVariant *resp = NULL; - guchar rt_i; - int i = 0; - - struct tapi_resp_data *evt_cb_data = user_data; - TelSimAccessResult_t result = TAPI_SIM_ACCESS_SUCCESS; - TelSimAuthenticationResponse_t auth_resp; - - dbg("Func Entrance"); - memset(&auth_resp, 0, sizeof(TelSimAuthenticationResponse_t)); - - conn = G_DBUS_CONNECTION (source_object); - dbus_result = g_dbus_connection_call_finish(conn, res, &error); - CHECK_DEINIT(error); - - if (!dbus_result) { - if (evt_cb_data->cb_fn) { - evt_cb_data->cb_fn(evt_cb_data->handle, -1, NULL, evt_cb_data->user_data); - } - - if (error) - g_error_free(error); - - free(evt_cb_data); - return; - } - - dbg("dbus_result type_format(%s)", g_variant_get_type_string(dbus_result)); - g_variant_get(dbus_result, "(iii@v@v@v@v)", &result, &auth_resp.auth_type, - &auth_resp.auth_result, &ak_gv, &cp_gv, &it_gv, &resp_gv); - - ak = g_variant_get_variant(ak_gv); - g_variant_get(ak, "ay", &iter); - while (g_variant_iter_loop(iter, "y", &rt_i)) { - auth_resp.authentication_key[i] = rt_i; - dbg("auth_resp.authentication_key[%d]=[0x%02x]", i, auth_resp.authentication_key[i]); - i++; - } - auth_resp.authentication_key_length = i; - g_variant_iter_free(iter); - i = 0; - - cp = g_variant_get_variant(cp_gv); - g_variant_get(cp, "ay", &iter); - while (g_variant_iter_loop(iter, "y", &rt_i)) { - auth_resp.cipher_data[i] = rt_i; - dbg("auth_resp.cipher_data[%d]=[0x%02x]", i, auth_resp.cipher_data[i]); - i++; - } - auth_resp.cipher_length = i; - g_variant_iter_free(iter); - i = 0; - - it = g_variant_get_variant(it_gv); - g_variant_get(it, "ay", &iter); - while (g_variant_iter_loop(iter, "y", &rt_i)) { - auth_resp.integrity_data[i] = rt_i; - dbg("auth_resp.integrity_data[%d]=[0x%02x]", i, auth_resp.integrity_data[i]); - i++; - } - auth_resp.integrity_length = i; - g_variant_iter_free(iter); - i = 0; - - resp = g_variant_get_variant(resp_gv); - g_variant_get(resp, "ay", &iter); - while (g_variant_iter_loop(iter, "y", &rt_i)) { - auth_resp.resp_data[i] = rt_i; - dbg("auth_resp.resp_data[%d]=[0x%02x]", i, auth_resp.resp_data[i]); - i++; - } - auth_resp.resp_length = i; - g_variant_iter_free(iter); - i = 0; - - if (evt_cb_data->cb_fn) { - evt_cb_data->cb_fn(evt_cb_data->handle, result, &auth_resp, evt_cb_data->user_data); - } - - free(evt_cb_data); -} - -static void on_response_verify_sim_pins(GObject *source_object, GAsyncResult *res, - gpointer user_data) -{ - GError *error = NULL; - GDBusConnection *conn = NULL; - GVariant *dbus_result; - - struct tapi_resp_data *evt_cb_data = user_data; - TelSimPinOperationResult_t result = TAPI_SIM_PIN_OPERATION_SUCCESS; - TelSimSecResult_t sec_rt; - - dbg("Func Entrance"); - memset(&sec_rt, 0, sizeof(TelSimSecResult_t)); - - conn = G_DBUS_CONNECTION (source_object); - dbus_result = g_dbus_connection_call_finish(conn, res, &error); - CHECK_DEINIT(error); - - if (!dbus_result) { - if (evt_cb_data->cb_fn) { - evt_cb_data->cb_fn(evt_cb_data->handle, -1, NULL, evt_cb_data->user_data); - } - - if (error) - g_error_free(error); - - free(evt_cb_data); - return; - } - - g_variant_get(dbus_result, "(iii)", &result, &sec_rt.type, &sec_rt.retry_count); - - if (evt_cb_data->cb_fn) { - evt_cb_data->cb_fn(evt_cb_data->handle, result, &sec_rt, evt_cb_data->user_data); - } - - free(evt_cb_data); -} - -static void on_response_verify_sim_puks(GObject *source_object, GAsyncResult *res, - gpointer user_data) -{ - GError *error = NULL; - GDBusConnection *conn = NULL; - GVariant *dbus_result; - - struct tapi_resp_data *evt_cb_data = user_data; - TelSimPinOperationResult_t result = TAPI_SIM_PIN_OPERATION_SUCCESS; - TelSimSecResult_t sec_rt; - - dbg("Func Entrance"); - memset(&sec_rt, 0, sizeof(TelSimSecResult_t)); - - conn = G_DBUS_CONNECTION (source_object); - dbus_result = g_dbus_connection_call_finish(conn, res, &error); - CHECK_DEINIT(error); - - if (!dbus_result) { - if (evt_cb_data->cb_fn) { - evt_cb_data->cb_fn(evt_cb_data->handle, -1, NULL, evt_cb_data->user_data); - } - - if (error) - g_error_free(error); - - free(evt_cb_data); - return; - } - - g_variant_get(dbus_result, "(iii)", &result, &sec_rt.type, &sec_rt.retry_count); - - if (evt_cb_data->cb_fn) { - evt_cb_data->cb_fn(evt_cb_data->handle, result, &sec_rt, evt_cb_data->user_data); - } - - free(evt_cb_data); -} - -static void on_response_change_sim_pins(GObject *source_object, GAsyncResult *res, - gpointer user_data) -{ - GError *error = NULL; - GDBusConnection *conn = NULL; - GVariant *dbus_result; - - struct tapi_resp_data *evt_cb_data = user_data; - TelSimPinOperationResult_t result = TAPI_SIM_PIN_OPERATION_SUCCESS; - TelSimSecResult_t sec_rt; - - dbg("Func Entrance"); - memset(&sec_rt, 0, sizeof(TelSimSecResult_t)); - - conn = G_DBUS_CONNECTION (source_object); - dbus_result = g_dbus_connection_call_finish(conn, res, &error); - CHECK_DEINIT(error); - - if (!dbus_result) { - if (evt_cb_data->cb_fn) { - evt_cb_data->cb_fn(evt_cb_data->handle, -1, NULL, evt_cb_data->user_data); - } - - if (error) - g_error_free(error); - - free(evt_cb_data); - return; - } - - g_variant_get(dbus_result, "(iii)", &result, &sec_rt.type, &sec_rt.retry_count); - - if (evt_cb_data->cb_fn) { - evt_cb_data->cb_fn(evt_cb_data->handle, result, &sec_rt, evt_cb_data->user_data); - } - - free(evt_cb_data); -} - -static void on_response_disable_sim_facility(GObject *source_object, GAsyncResult *res, - gpointer user_data) -{ - GError *error = NULL; - GDBusConnection *conn = NULL; - GVariant *dbus_result; - - struct tapi_resp_data *evt_cb_data = user_data; - TelSimPinOperationResult_t result = TAPI_SIM_PIN_OPERATION_SUCCESS; - TelSimFacilityResult_t f_rt; - - dbg("Func Entrance"); - memset(&f_rt, 0, sizeof(TelSimFacilityResult_t)); - - conn = G_DBUS_CONNECTION (source_object); - dbus_result = g_dbus_connection_call_finish(conn, res, &error); - CHECK_DEINIT(error); - - if (!dbus_result) { - if (evt_cb_data->cb_fn) { - evt_cb_data->cb_fn(evt_cb_data->handle, -1, NULL, evt_cb_data->user_data); - } - - if (error) - g_error_free(error); - - free(evt_cb_data); - return; - } - - g_variant_get(dbus_result, "(iii)", &result, &f_rt.type, &f_rt.retry_count); - - if (evt_cb_data->cb_fn) { - evt_cb_data->cb_fn(evt_cb_data->handle, result, &f_rt, evt_cb_data->user_data); - } - - free(evt_cb_data); -} - -static void on_response_enable_sim_facility(GObject *source_object, GAsyncResult *res, - gpointer user_data) -{ - GError *error = NULL; - GDBusConnection *conn = NULL; - GVariant *dbus_result; - - struct tapi_resp_data *evt_cb_data = user_data; - TelSimPinOperationResult_t result = TAPI_SIM_PIN_OPERATION_SUCCESS; - TelSimFacilityResult_t f_rt; - - dbg("Func Entrance"); - memset(&f_rt, 0, sizeof(TelSimFacilityResult_t)); - - conn = G_DBUS_CONNECTION (source_object); - dbus_result = g_dbus_connection_call_finish(conn, res, &error); - CHECK_DEINIT(error); - - if (!dbus_result) { - if (evt_cb_data->cb_fn) { - evt_cb_data->cb_fn(evt_cb_data->handle, -1, NULL, evt_cb_data->user_data); - } - - if (error) - g_error_free(error); - - free(evt_cb_data); - return; - } - - g_variant_get(dbus_result, "(iii)", &result, &f_rt.type, &f_rt.retry_count); - - if (evt_cb_data->cb_fn) { - evt_cb_data->cb_fn(evt_cb_data->handle, result, &f_rt, evt_cb_data->user_data); - } - - free(evt_cb_data); -} - -static void on_response_get_sim_facility(GObject *source_object, GAsyncResult *res, - gpointer user_data) -{ - GError *error = NULL; - GDBusConnection *conn = NULL; - GVariant *dbus_result; - - struct tapi_resp_data *evt_cb_data = user_data; - TelSimPinOperationResult_t result = TAPI_SIM_PIN_OPERATION_SUCCESS; - TelSimFacilityInfo_t fi; - - dbg("Func Entrance"); - memset(&fi, 0, sizeof(TelSimFacilityInfo_t)); - - conn = G_DBUS_CONNECTION (source_object); - dbus_result = g_dbus_connection_call_finish(conn, res, &error); - CHECK_DEINIT(error); - - if (!dbus_result) { - if (evt_cb_data->cb_fn) { - evt_cb_data->cb_fn(evt_cb_data->handle, -1, NULL, evt_cb_data->user_data); - } - - if (error) - g_error_free(error); - - free(evt_cb_data); - return; - } - - g_variant_get(dbus_result, "(iii)", &result, &fi.type, &fi.f_status); - - if (evt_cb_data->cb_fn) { - evt_cb_data->cb_fn(evt_cb_data->handle, result, &fi, evt_cb_data->user_data); - } - - free(evt_cb_data); -} - -static void on_response_get_sim_lock_info(GObject *source_object, GAsyncResult *res, - gpointer user_data) -{ - GError *error = NULL; - GDBusConnection *conn = NULL; - GVariant *dbus_result; - - struct tapi_resp_data *evt_cb_data = user_data; - TelSimPinOperationResult_t result = TAPI_SIM_PIN_OPERATION_SUCCESS; - TelSimLockInfo_t lock; - - dbg("Func Entrance"); - memset(&lock, 0, sizeof(TelSimLockInfo_t)); - - conn = G_DBUS_CONNECTION (source_object); - dbus_result = g_dbus_connection_call_finish(conn, res, &error); - CHECK_DEINIT(error); - - if (!dbus_result) { - if (evt_cb_data->cb_fn) { - evt_cb_data->cb_fn(evt_cb_data->handle, -1, NULL, evt_cb_data->user_data); - } - - if (error) - g_error_free(error); - - free(evt_cb_data); - return; - } - - g_variant_get(dbus_result, "(iiii)", &result, &lock.lock_type, &lock.lock_status, - &lock.retry_count); - - if (evt_cb_data->cb_fn) { - evt_cb_data->cb_fn(evt_cb_data->handle, result, &lock, evt_cb_data->user_data); - } - - free(evt_cb_data); -} - -static void on_response_req_sim_apdu(GObject *source_object, GAsyncResult *res, gpointer user_data) -{ - GError *error = NULL; - GDBusConnection *conn = NULL; - GVariant *dbus_result; - - GVariantIter *iter = NULL; - GVariant *param_gv = NULL; - GVariant *inner_gv = NULL; - guchar rt_i; - unsigned short i = 0; - - struct tapi_resp_data *evt_cb_data = user_data; - TelSimAccessResult_t result = TAPI_SIM_ACCESS_SUCCESS; - TelSimApduResp_t r_apdu; - - dbg("Func Entrance"); - memset(&r_apdu, 0, sizeof(TelSimApduResp_t)); - - conn = G_DBUS_CONNECTION (source_object); - dbus_result = g_dbus_connection_call_finish(conn, res, &error); - CHECK_DEINIT(error); - - if (!dbus_result) { - if (evt_cb_data->cb_fn) { - evt_cb_data->cb_fn(evt_cb_data->handle, -1, NULL, evt_cb_data->user_data); - } - - if (error) - g_error_free(error); - - free(evt_cb_data); - return; - } - - /* dbg("dbus_result type_format(%s)", g_variant_get_type_string(dbus_result));*/ - g_variant_get(dbus_result, "(i@v)", &result, ¶m_gv); - inner_gv = g_variant_get_variant(param_gv); - - g_variant_get(inner_gv, "ay", &iter); - while (g_variant_iter_loop(iter, "y", &rt_i)) { - r_apdu.apdu_resp[i] = rt_i; - i++; - } - r_apdu.apdu_resp_len = i; - dbg("r_apdu.apdu_resp_len=[%d]", r_apdu.apdu_resp_len); - g_variant_iter_free(iter); - g_variant_unref(inner_gv); - g_variant_unref(param_gv); - - if (evt_cb_data->cb_fn) { - evt_cb_data->cb_fn(evt_cb_data->handle, result, &r_apdu, evt_cb_data->user_data); - } - - free(evt_cb_data); -} - -static void on_response_req_sim_atr(GObject *source_object, GAsyncResult *res, gpointer user_data) -{ - GError *error = NULL; - GDBusConnection *conn = NULL; - GVariant *dbus_result; - - GVariantIter *iter = NULL; - GVariant *param_gv = NULL; - GVariant *inner_gv = NULL; - guchar rt_i; - unsigned short i = 0; - - struct tapi_resp_data *evt_cb_data = user_data; - TelSimAccessResult_t result = TAPI_SIM_ACCESS_SUCCESS; - TelSimAtrResp_t r_atr; - - dbg("Func Entrance"); - memset(&r_atr, 0, sizeof(TelSimAtrResp_t)); - - conn = G_DBUS_CONNECTION (source_object); - dbus_result = g_dbus_connection_call_finish(conn, res, &error); - CHECK_DEINIT(error); - - if (!dbus_result) { - if (evt_cb_data->cb_fn) { - evt_cb_data->cb_fn(evt_cb_data->handle, -1, NULL, evt_cb_data->user_data); - } - - if (error) - g_error_free(error); - - free(evt_cb_data); - return; - } - - dbg("dbus_result type_format(%s)", g_variant_get_type_string(dbus_result)); - g_variant_get(dbus_result, "(i@v)", &result, ¶m_gv); - inner_gv = g_variant_get_variant(param_gv); - - g_variant_get(inner_gv, "ay", &iter); - while (g_variant_iter_loop(iter, "y", &rt_i)) { - r_atr.atr_resp[i] = rt_i; - i++; - } - r_atr.atr_resp_len = i; - dbg("r_atr.atr_resp_len=[%d]", r_atr.atr_resp_len); - g_variant_iter_free(iter); - g_variant_unref(inner_gv); - g_variant_unref(param_gv); - - if (evt_cb_data->cb_fn) { - evt_cb_data->cb_fn(evt_cb_data->handle, result, &r_atr, evt_cb_data->user_data); - } - - free(evt_cb_data); -} - -EXPORT_API int tel_get_sim_init_info(TapiHandle *handle, TelSimCardStatus_t *sim_status, - int *card_changed) -{ - GError *gerr = NULL; - GVariant *sync_gv = NULL; - int api_err = TAPI_API_SUCCESS; - TelSimCardStatus_t init_status = 0; - int changed = FALSE; - - dbg("Func Entrance"); - if (_tel_check_tapi_state() != 0) - return TAPI_API_SERVICE_NOT_READY; - - TAPI_RETURN_VAL_IF_FAIL(handle, TAPI_API_INVALID_PTR); - TAPI_RETURN_VAL_IF_FAIL(sim_status, TAPI_API_INVALID_PTR); - TAPI_RETURN_VAL_IF_FAIL(card_changed, TAPI_API_INVALID_PTR); - - sync_gv = g_dbus_connection_call_sync(handle->dbus_connection, DBUS_TELEPHONY_SERVICE, - handle->path, DBUS_TELEPHONY_SIM_INTERFACE, "GetInitStatus", NULL, NULL, - G_DBUS_CALL_FLAGS_NONE, -1, NULL, &gerr); - - if (sync_gv) { - g_variant_get(sync_gv, "(ib)", &init_status, &changed); - *sim_status = init_status; - *card_changed = changed; - dbg("init_status[%d]",init_status); - dbg("changed[%d]",changed); - } else { - dbg( "g_dbus_conn failed. error (%s)", gerr->message); - g_error_free(gerr); - return TAPI_API_OPERATION_FAILED; - } - g_variant_unref(sync_gv); - return api_err; -} - -EXPORT_API int tel_get_sim_type(TapiHandle *handle, TelSimCardType_t *card_type) -{ - GError *gerr = NULL; - GVariant *sync_gv = NULL; - int sim_ret =0; - - dbg("Func Entrance"); - - TAPI_RETURN_VAL_IF_FAIL(handle, TAPI_API_INVALID_PTR); - TAPI_RETURN_VAL_IF_FAIL(card_type, TAPI_API_INVALID_PTR); - - if (_tel_check_tapi_state() != 0) - return TAPI_API_SERVICE_NOT_READY; - - sim_ret = _tel_check_sim_state(handle); - if (sim_ret == TAPI_API_SIM_CARD_ERROR || sim_ret == TAPI_API_SIM_NOT_FOUND) - return sim_ret; - - sync_gv = g_dbus_connection_call_sync(handle->dbus_connection, DBUS_TELEPHONY_SERVICE, - handle->path, DBUS_TELEPHONY_SIM_INTERFACE, "GetCardType", NULL, NULL, - G_DBUS_CALL_FLAGS_NONE, -1, NULL, &gerr); - - if (sync_gv) { - g_variant_get(sync_gv, "(i)", card_type); - } else { - dbg( "g_dbus_conn failed. error (%s)", gerr->message); - g_error_free(gerr); - return TAPI_API_OPERATION_FAILED; - } - g_variant_unref(sync_gv); - return TAPI_API_SUCCESS; -} - -EXPORT_API int tel_get_sim_imsi(TapiHandle *handle, TelSimImsiInfo_t *imsi) -{ - GError *gerr = NULL; - GVariant *sync_gv = NULL; - gchar *gplmn = NULL; - gchar *gmsin = NULL; - int sim_ret = 0; - - TAPI_RETURN_VAL_IF_FAIL(handle, TAPI_API_INVALID_PTR); - - dbg("Func Entrance"); - if (_tel_check_tapi_state() != 0) - return TAPI_API_SERVICE_NOT_READY; - - sim_ret =_tel_check_sim_state(handle); - if (sim_ret != TAPI_API_SUCCESS) - return sim_ret; - - TAPI_RETURN_VAL_IF_FAIL(imsi, TAPI_API_INVALID_PTR); - - sync_gv = g_dbus_connection_call_sync(handle->dbus_connection, DBUS_TELEPHONY_SERVICE, - handle->path, DBUS_TELEPHONY_SIM_INTERFACE, "GetIMSI", NULL, NULL, - G_DBUS_CALL_FLAGS_NONE, -1, NULL, &gerr); - - if (sync_gv) { - dbg("imsi type_format(%s)", g_variant_get_type_string(sync_gv)); - g_variant_get(sync_gv, "(ss)", &gplmn, &gmsin); - - dbg("gplmn[%s],gmsin[%s]",gplmn,gmsin); - snprintf(imsi->szMcc, 3 + 1, "%s", gplmn); - snprintf(imsi->szMnc, strlen((const char*)gplmn) - 3 + 1, "%s", &gplmn[3]); - snprintf(imsi->szMsin, strlen((const char*)gmsin) + 1, "%s", gmsin); - - dbg("imsi->szMnc[%s]", imsi->szMnc); - dbg("imsi->szMcc[%s]", imsi->szMcc); - g_free(gplmn); - g_free(gmsin); - } else { - dbg( "g_dbus_conn failed. error (%s)", gerr->message); - g_error_free(gerr); - return TAPI_API_OPERATION_FAILED; - } - g_variant_unref(sync_gv); - return TAPI_API_SUCCESS; -} - -EXPORT_API int tel_get_sim_ecc(TapiHandle *handle, TelSimEccList_t *ecc) -{ - GError *gerr = NULL; - GVariant *sync_gv; - GVariant *value = NULL; - GVariantIter *iter = NULL; - GVariantIter *iter_row = NULL; - const gchar *key = NULL; - const gchar *str_value = NULL; - int i = 0; - int sim_ret = 0; - - dbg("Func Entrance"); - memset(ecc, 0, sizeof(TelSimEccList_t)); - TAPI_RETURN_VAL_IF_FAIL(handle, TAPI_API_INVALID_PTR); - TAPI_RETURN_VAL_IF_FAIL(ecc, TAPI_API_INVALID_PTR); - - sim_ret =_tel_check_sim_state(handle); - if (sim_ret == TAPI_API_SIM_CARD_ERROR || sim_ret == TAPI_API_SIM_NOT_FOUND) - return sim_ret; - - sync_gv = g_dbus_connection_call_sync(handle->dbus_connection, DBUS_TELEPHONY_SERVICE, - handle->path, DBUS_TELEPHONY_SIM_INTERFACE, "GetECC", NULL, NULL, - G_DBUS_CALL_FLAGS_NONE, -1, NULL, &gerr); - - if (sync_gv) { -/* dbg("ecc type_format(%s)", g_variant_get_type_string(sync_gv));*/ - g_variant_get(sync_gv, "(aa{sv})", &iter); - ecc->ecc_count = g_variant_iter_n_children(iter); - dbg("ecc->ecc_count[%d]",ecc->ecc_count); - i = 0; - while (g_variant_iter_next(iter, "a{sv}", &iter_row)) { - while (g_variant_iter_loop(iter_row, "{sv}", &key, &value)) { - if (!g_strcmp0(key, "name")) { - str_value = g_variant_get_string(value, NULL); - snprintf(ecc->list[i].name, strlen((const char*)str_value) + 1, "%s", str_value); - } - if (!g_strcmp0(key, "number")) { - str_value = g_variant_get_string(value, NULL); - snprintf(ecc->list[i].number, strlen((const char*)str_value) + 1, "%s", str_value); - } - if (!g_strcmp0(key, "category")) { - ecc->list[i].category = g_variant_get_int32(value); - } - } - i++; - g_variant_iter_free(iter_row); - } - g_variant_iter_free(iter); - } else { - dbg( "g_dbus_conn failed. error (%s)", gerr->message); - g_error_free(gerr); - return TAPI_API_OPERATION_FAILED; - } - return TAPI_API_SUCCESS; -} - -EXPORT_API int tel_get_sim_iccid(TapiHandle *handle, tapi_response_cb callback, void *user_data) -{ - struct tapi_resp_data *evt_cb_data = NULL; - int sim_ret = 0; - - dbg("Func Entrance "); - if (_tel_check_tapi_state() != 0) - return TAPI_API_SERVICE_NOT_READY; - - TAPI_RETURN_VAL_IF_FAIL(handle, TAPI_API_INVALID_PTR); - - sim_ret =_tel_check_sim_state(handle); - if (sim_ret == TAPI_API_SIM_CARD_ERROR || sim_ret == TAPI_API_SIM_NOT_FOUND) - return sim_ret; - - MAKE_RESP_CB_DATA(evt_cb_data, handle, callback, user_data); - - g_dbus_connection_call(handle->dbus_connection, DBUS_TELEPHONY_SERVICE, handle->path, - DBUS_TELEPHONY_SIM_INTERFACE, "GetICCID", NULL, NULL, G_DBUS_CALL_FLAGS_NONE, -1, handle->ca, - on_response_get_sim_iccid, evt_cb_data); - - return TAPI_API_SUCCESS; -} - -EXPORT_API int tel_get_sim_language(TapiHandle *handle, tapi_response_cb callback, void *user_data) -{ - struct tapi_resp_data *evt_cb_data = NULL; - int sim_ret = 0; - - dbg("Func Entrance "); - if (_tel_check_tapi_state() != 0) - return TAPI_API_SERVICE_NOT_READY; - - TAPI_RETURN_VAL_IF_FAIL(handle, TAPI_API_INVALID_PTR); - - sim_ret =_tel_check_sim_state(handle); - if (sim_ret == TAPI_API_SIM_CARD_ERROR || sim_ret == TAPI_API_SIM_NOT_FOUND) - return sim_ret; - - MAKE_RESP_CB_DATA(evt_cb_data, handle, callback, user_data); - - g_dbus_connection_call(handle->dbus_connection, DBUS_TELEPHONY_SERVICE, handle->path, - DBUS_TELEPHONY_SIM_INTERFACE, "GetLanguage", NULL, NULL, G_DBUS_CALL_FLAGS_NONE, -1, - handle->ca, on_response_get_sim_language, evt_cb_data); - - return TAPI_API_SUCCESS; -} - -EXPORT_API int tel_set_sim_language(TapiHandle *handle, TelSimLanguagePreferenceCode_t language, - tapi_response_cb callback, void *user_data) -{ - struct tapi_resp_data *evt_cb_data = NULL; - GVariant *param = NULL; - int sim_ret = 0; - - dbg("Func Entrance w/ lang[%d]",language); - if (_tel_check_tapi_state() != 0) - return TAPI_API_SERVICE_NOT_READY; - - TAPI_RETURN_VAL_IF_FAIL(handle, TAPI_API_INVALID_PTR); - - sim_ret =_tel_check_sim_state(handle); - if (sim_ret != TAPI_API_SUCCESS) - return sim_ret; - - MAKE_RESP_CB_DATA(evt_cb_data, handle, callback, user_data); - - param = g_variant_new("(i)", language); - - g_dbus_connection_call(handle->dbus_connection, DBUS_TELEPHONY_SERVICE, handle->path, - DBUS_TELEPHONY_SIM_INTERFACE, "SetLanguage", param, NULL, G_DBUS_CALL_FLAGS_NONE, -1, - handle->ca, on_response_set_sim_language, evt_cb_data); - - return TAPI_API_SUCCESS; -} - -EXPORT_API int tel_get_sim_callforwarding_info(TapiHandle *handle, tapi_response_cb callback, - void *user_data) -{ - struct tapi_resp_data *evt_cb_data = NULL; - int sim_ret = 0; - - dbg("Func Entrance "); - if (_tel_check_tapi_state() != 0) - return TAPI_API_SERVICE_NOT_READY; - - TAPI_RETURN_VAL_IF_FAIL(handle, TAPI_API_INVALID_PTR); - - sim_ret =_tel_check_sim_state(handle); - if (sim_ret != TAPI_API_SUCCESS) - return sim_ret; - - MAKE_RESP_CB_DATA(evt_cb_data, handle, callback, user_data); - - g_dbus_connection_call(handle->dbus_connection, DBUS_TELEPHONY_SERVICE, handle->path, - DBUS_TELEPHONY_SIM_INTERFACE, "GetCallForwarding", NULL, NULL, G_DBUS_CALL_FLAGS_NONE, - -1, handle->ca, on_response_get_sim_callforwarding_info, evt_cb_data); - - return TAPI_API_SUCCESS; -} - -EXPORT_API int tel_set_sim_callforwarding_info(TapiHandle *handle, TelSimCallForwardingReq_t *req_cf, - tapi_response_cb callback, void *user_data) -{ - struct tapi_resp_data *evt_cb_data = NULL; - GVariant *param = NULL; - int sim_ret = 0; - gchar *g_number = NULL; - - if (_tel_check_tapi_state() != 0) - return TAPI_API_SERVICE_NOT_READY; - - TAPI_RETURN_VAL_IF_FAIL(handle, TAPI_API_INVALID_PTR); - - sim_ret =_tel_check_sim_state(handle); - if (sim_ret != TAPI_API_SUCCESS) - return sim_ret; - - MAKE_RESP_CB_DATA(evt_cb_data, handle, callback, user_data); - - g_number = calloc(strlen((const char*)&req_cf->cf_data_u.cf.cfu_num)+1, 1); - if (!g_number) { - g_free(evt_cb_data); - return TAPI_API_SYSTEM_OUT_OF_MEM; - } - - memcpy((void*)g_number, (const void*)&req_cf->cf_data_u.cf.cfu_num, strlen((const char*)&req_cf->cf_data_u.cf.cfu_num)); - - param = g_variant_new("(biiyiisiibbbb)", - req_cf->b_cphs, - req_cf->cf_data_u.cf.rec_index, - req_cf->cf_data_u.cf.msp_num, - req_cf->cf_data_u.cf.cfu_status, - req_cf->cf_data_u.cf.ton, - req_cf->cf_data_u.cf.npi, - g_number, - req_cf->cf_data_u.cf.cc2_id, - req_cf->cf_data_u.cf.ext7_id, - req_cf->cf_data_u.cphs_cf.b_line1, - req_cf->cf_data_u.cphs_cf.b_line2, - req_cf->cf_data_u.cphs_cf.b_fax, - req_cf->cf_data_u.cphs_cf.b_data); - - g_dbus_connection_call(handle->dbus_connection, DBUS_TELEPHONY_SERVICE, handle->path, - DBUS_TELEPHONY_SIM_INTERFACE, "SetCallForwarding", param, NULL, G_DBUS_CALL_FLAGS_NONE, -1, - handle->ca, on_response_set_sim_callforwarding_info, evt_cb_data); - - if (g_number) - free(g_number); - - return TAPI_API_SUCCESS; -} - -EXPORT_API int tel_get_sim_messagewaiting_info(TapiHandle *handle, tapi_response_cb callback, - void *user_data) -{ - struct tapi_resp_data *evt_cb_data = NULL; - int sim_ret = 0; - - dbg("Func Entrance "); - if (_tel_check_tapi_state() != 0) - return TAPI_API_SERVICE_NOT_READY; - - TAPI_RETURN_VAL_IF_FAIL(handle, TAPI_API_INVALID_PTR); - - sim_ret =_tel_check_sim_state(handle); - if (sim_ret != TAPI_API_SUCCESS) - return sim_ret; - - MAKE_RESP_CB_DATA(evt_cb_data, handle, callback, user_data); - - g_dbus_connection_call(handle->dbus_connection, DBUS_TELEPHONY_SERVICE, handle->path, - DBUS_TELEPHONY_SIM_INTERFACE, "GetMessageWaiting", NULL, NULL, G_DBUS_CALL_FLAGS_NONE, - -1, handle->ca, on_response_get_sim_messagewaiting_info, evt_cb_data); - - return TAPI_API_SUCCESS; -} - -EXPORT_API int tel_set_sim_messagewaiting_info(TapiHandle *handle, TelSimMessageWaitingReq_t *req_mw, - tapi_response_cb callback, void *user_data) -{ - struct tapi_resp_data *evt_cb_data = NULL; - GVariant *param = NULL; - int sim_ret = 0; - - if (_tel_check_tapi_state() != 0) - return TAPI_API_SERVICE_NOT_READY; - - TAPI_RETURN_VAL_IF_FAIL(handle, TAPI_API_INVALID_PTR); - - sim_ret =_tel_check_sim_state(handle); - if (sim_ret != TAPI_API_SUCCESS) - return sim_ret; - - MAKE_RESP_CB_DATA(evt_cb_data, handle, callback, user_data); - - dbg("b_cphs[%d], rec_index[%d], indicator_status[0x%x], voice_count[%d], fax_count[%d], email_count[%d], other_count[%d], video_count[%d], b_voice1[%d],b_voice2[%d],b_fax[%d], b_data[%d]", - req_mw->b_cphs, - req_mw->mw_data_u.mw.rec_index, - req_mw->mw_data_u.mw.indicator_status, - req_mw->mw_data_u.mw.voice_count, - req_mw->mw_data_u.mw.fax_count, - req_mw->mw_data_u.mw.email_count, - req_mw->mw_data_u.mw.other_count, - req_mw->mw_data_u.mw.video_count, - req_mw->mw_data_u.cphs_mw.b_voice1, - req_mw->mw_data_u.cphs_mw.b_voice2, - req_mw->mw_data_u.cphs_mw.b_fax, - req_mw->mw_data_u.cphs_mw.b_data); - - param = g_variant_new("(biyiiiiibbbb)", - req_mw->b_cphs, - req_mw->mw_data_u.mw.rec_index, - req_mw->mw_data_u.mw.indicator_status, - req_mw->mw_data_u.mw.voice_count, - req_mw->mw_data_u.mw.fax_count, - req_mw->mw_data_u.mw.email_count, - req_mw->mw_data_u.mw.other_count, - req_mw->mw_data_u.mw.video_count, - req_mw->mw_data_u.cphs_mw.b_voice1, - req_mw->mw_data_u.cphs_mw.b_voice2, - req_mw->mw_data_u.cphs_mw.b_fax, - req_mw->mw_data_u.cphs_mw.b_data); - - g_dbus_connection_call(handle->dbus_connection, DBUS_TELEPHONY_SERVICE, handle->path, - DBUS_TELEPHONY_SIM_INTERFACE, "SetMessageWaiting", param, NULL, G_DBUS_CALL_FLAGS_NONE, -1, - handle->ca, on_response_set_sim_messagewaiting_info, evt_cb_data); - - return TAPI_API_SUCCESS; -} - -EXPORT_API int tel_get_sim_mailbox_info(TapiHandle *handle, tapi_response_cb callback, - void *user_data) -{ - struct tapi_resp_data *evt_cb_data = NULL; - int sim_ret = 0; - - dbg("Func Entrance "); - if (_tel_check_tapi_state() != 0) - return TAPI_API_SERVICE_NOT_READY; - - TAPI_RETURN_VAL_IF_FAIL(handle, TAPI_API_INVALID_PTR); - - sim_ret =_tel_check_sim_state(handle); - if (sim_ret != TAPI_API_SUCCESS) - return sim_ret; - - MAKE_RESP_CB_DATA(evt_cb_data, handle, callback, user_data); - - g_dbus_connection_call(handle->dbus_connection, DBUS_TELEPHONY_SERVICE, handle->path, - DBUS_TELEPHONY_SIM_INTERFACE, "GetMailbox", NULL, NULL, G_DBUS_CALL_FLAGS_NONE, -1, - handle->ca, on_response_get_sim_mailbox_info, evt_cb_data); - - return TAPI_API_SUCCESS; -} - -EXPORT_API int tel_set_sim_mailbox_info(TapiHandle *handle, TelSimMailBoxNumber_t *req_mb, - tapi_response_cb callback, void *user_data) -{ - struct tapi_resp_data *evt_cb_data = NULL; - GVariant *param = NULL; - int sim_ret = 0; - gchar *g_alpha = NULL; - gchar *g_number = NULL; - - if (_tel_check_tapi_state() != 0) - return TAPI_API_SERVICE_NOT_READY; - - TAPI_RETURN_VAL_IF_FAIL(handle, TAPI_API_INVALID_PTR); - - sim_ret =_tel_check_sim_state(handle); - if (sim_ret != TAPI_API_SUCCESS) - return sim_ret; - - MAKE_RESP_CB_DATA(evt_cb_data, handle, callback, user_data); - - g_alpha = calloc(strlen((const char*)&req_mb->alpha_id)+1, 1); - if (!g_alpha) { - g_free(evt_cb_data); - return TAPI_API_SYSTEM_OUT_OF_MEM; - } - - memcpy((void*)g_alpha, (const void*)&req_mb->alpha_id, strlen((const char*)&req_mb->alpha_id)); - - g_number = calloc(strlen((const char*)&req_mb->num)+1, 1); - if (!g_number) { - free(g_alpha); - g_free(evt_cb_data); - return TAPI_API_SYSTEM_OUT_OF_MEM; - } - - memcpy((void*)g_number, (const void*)&req_mb->num, strlen((const char*)&req_mb->num)); - - dbg("req_mb->b_cphs[%d], req_mb->rec_index[%d], req_mb->profile_num[%d], req_mb->mb_type[%d], req_mb->alpha_id_max_len[%d],req_mb->alpha_id[%s]", - req_mb->b_cphs, - req_mb->rec_index, - req_mb->profile_num, - req_mb->mb_type, - req_mb->alpha_id_max_len, - g_alpha); - - dbg("req_mb->ton[%d],req_mb->npi[%d],g_number[%s],req_mb->cc_id[%d],req_mb->ext1_id[%d]", - req_mb->ton, - req_mb->npi, - g_number, - req_mb->cc_id, - req_mb->ext1_id); - - param = g_variant_new("(biiiisiisii)", - req_mb->b_cphs, - req_mb->mb_type, - req_mb->rec_index, - req_mb->profile_num, - req_mb->alpha_id_max_len, - g_alpha, - req_mb->ton, - req_mb->npi, - g_number, - req_mb->cc_id, - req_mb->ext1_id); - - g_dbus_connection_call(handle->dbus_connection, DBUS_TELEPHONY_SERVICE, handle->path, - DBUS_TELEPHONY_SIM_INTERFACE, "SetMailbox", param, NULL, G_DBUS_CALL_FLAGS_NONE, -1, - handle->ca, on_response_set_sim_mailbox_info, evt_cb_data); - - if (g_alpha) - free(g_alpha); - - if (g_number) - free(g_number); - - return TAPI_API_SUCCESS; -} - -EXPORT_API int tel_get_sim_cphs_info(TapiHandle *handle, tapi_response_cb callback, - void *user_data) -{ - struct tapi_resp_data *evt_cb_data = NULL; - int sim_ret = 0; - - dbg("Func Entrance "); - if (_tel_check_tapi_state() != 0) - return TAPI_API_SERVICE_NOT_READY; - - TAPI_RETURN_VAL_IF_FAIL(handle, TAPI_API_INVALID_PTR); - - sim_ret =_tel_check_sim_state(handle); - if (sim_ret == TAPI_API_SIM_CARD_ERROR || sim_ret == TAPI_API_SIM_NOT_FOUND) - return sim_ret; - - MAKE_RESP_CB_DATA(evt_cb_data, handle, callback, user_data); - - g_dbus_connection_call(handle->dbus_connection, DBUS_TELEPHONY_SERVICE, handle->path, - DBUS_TELEPHONY_SIM_INTERFACE, "GetCPHSInfo", NULL, NULL, G_DBUS_CALL_FLAGS_NONE, -1, handle->ca, - on_response_get_sim_cphs_info, evt_cb_data); - - return TAPI_API_SUCCESS; -} - -EXPORT_API int tel_get_sim_msisdn(TapiHandle *handle, tapi_response_cb callback, void *user_data) -{ - struct tapi_resp_data *evt_cb_data = NULL; - int sim_ret = 0; - - dbg("Func Entrance "); - if (_tel_check_tapi_state() != 0) - return TAPI_API_SERVICE_NOT_READY; - - TAPI_RETURN_VAL_IF_FAIL(handle, TAPI_API_INVALID_PTR); - - sim_ret =_tel_check_sim_state(handle); - if (sim_ret != TAPI_API_SUCCESS) - return sim_ret;; - - MAKE_RESP_CB_DATA(evt_cb_data, handle, callback, user_data); - - g_dbus_connection_call(handle->dbus_connection, DBUS_TELEPHONY_SERVICE, handle->path, - DBUS_TELEPHONY_SIM_INTERFACE, "GetMSISDN", NULL, NULL, G_DBUS_CALL_FLAGS_NONE, -1, handle->ca, - on_response_get_sim_msisdn, evt_cb_data); - - return TAPI_API_SUCCESS; -} - -EXPORT_API int tel_get_sim_oplmnwact(TapiHandle *handle, tapi_response_cb callback, - void *user_data) -{ - struct tapi_resp_data *evt_cb_data = NULL; - int sim_ret = 0; - - dbg("Func Entrance "); - if (_tel_check_tapi_state() != 0) - return TAPI_API_SERVICE_NOT_READY; - - TAPI_RETURN_VAL_IF_FAIL(handle, TAPI_API_INVALID_PTR); - - sim_ret =_tel_check_sim_state(handle); - if (sim_ret != TAPI_API_SUCCESS) - return sim_ret; - - MAKE_RESP_CB_DATA(evt_cb_data, handle, callback, user_data); - - g_dbus_connection_call(handle->dbus_connection, DBUS_TELEPHONY_SERVICE, handle->path, - DBUS_TELEPHONY_SIM_INTERFACE, "GetOplmnwact", NULL, NULL, G_DBUS_CALL_FLAGS_NONE, -1, - handle->ca, on_response_get_sim_oplmnwact, evt_cb_data); - - return TAPI_API_SUCCESS; -} - -EXPORT_API int tel_get_sim_spn(TapiHandle *handle, tapi_response_cb callback, - void *user_data) -{ - struct tapi_resp_data *evt_cb_data = NULL; - int sim_ret = 0; - - dbg("Func Entrance "); - if (_tel_check_tapi_state() != 0) - return TAPI_API_SERVICE_NOT_READY; - - TAPI_RETURN_VAL_IF_FAIL(handle, TAPI_API_INVALID_PTR); - - sim_ret =_tel_check_sim_state(handle); - if (sim_ret == TAPI_API_SIM_CARD_ERROR || sim_ret == TAPI_API_SIM_NOT_FOUND) - return sim_ret; - - MAKE_RESP_CB_DATA(evt_cb_data, handle, callback, user_data); - - g_dbus_connection_call(handle->dbus_connection, DBUS_TELEPHONY_SERVICE, handle->path, - DBUS_TELEPHONY_SIM_INTERFACE, "GetSpn", NULL, NULL, G_DBUS_CALL_FLAGS_NONE, -1, - handle->ca, on_response_get_sim_spn, evt_cb_data); - - return TAPI_API_SUCCESS; -} - -EXPORT_API int tel_get_sim_cphs_netname(TapiHandle *handle, tapi_response_cb callback, - void *user_data) -{ - struct tapi_resp_data *evt_cb_data = NULL; - int sim_ret = 0; - - dbg("Func Entrance "); - if (_tel_check_tapi_state() != 0) - return TAPI_API_SERVICE_NOT_READY; - - TAPI_RETURN_VAL_IF_FAIL(handle, TAPI_API_INVALID_PTR); - - sim_ret =_tel_check_sim_state(handle); - if (sim_ret != TAPI_API_SUCCESS) - return sim_ret; - - MAKE_RESP_CB_DATA(evt_cb_data, handle, callback, user_data); - - g_dbus_connection_call(handle->dbus_connection, DBUS_TELEPHONY_SERVICE, handle->path, - DBUS_TELEPHONY_SIM_INTERFACE, "GetCphsNetName", NULL, NULL, G_DBUS_CALL_FLAGS_NONE, -1, - handle->ca, on_response_get_sim_cphs_netname, evt_cb_data); - - return TAPI_API_SUCCESS; -} - -EXPORT_API int tel_req_sim_authentication(TapiHandle *handle, - TelSimAuthenticationData_t *authentication_data, tapi_response_cb callback, void *user_data) -{ - struct tapi_resp_data *evt_cb_data = NULL; - GVariantBuilder *builder = NULL; - GVariant *param = NULL; - GVariant *rand_gv = NULL; - GVariant *autn_gv = NULL; - int i =0; - int sim_ret = 0; - - dbg("Func Entrance "); - if (_tel_check_tapi_state() != 0) - return TAPI_API_SERVICE_NOT_READY; - - TAPI_RETURN_VAL_IF_FAIL(handle, TAPI_API_INVALID_PTR); - - sim_ret =_tel_check_sim_state(handle); - if (sim_ret == TAPI_API_SIM_CARD_ERROR || sim_ret == TAPI_API_SIM_NOT_FOUND) - return sim_ret; - - TAPI_RETURN_VAL_IF_FAIL(authentication_data, TAPI_API_INVALID_PTR); - - if (authentication_data->auth_type > TAPI_SIM_AUTH_TYPE_3G) - return TAPI_API_INVALID_INPUT; - - if (authentication_data->rand_length == 0) - return TAPI_API_INVALID_INPUT; - - if (authentication_data->auth_type != TAPI_SIM_AUTH_TYPE_GSM - && authentication_data->autn_length == 0) - return TAPI_API_INVALID_INPUT; - - MAKE_RESP_CB_DATA(evt_cb_data, handle, callback, user_data); - - builder = g_variant_builder_new(G_VARIANT_TYPE ("ay")); - for (i = 0; i < authentication_data->rand_length; i++) { - dbg("authentication_data->rand_data[%d][0x%02x]", i,authentication_data->rand_data[i]); - g_variant_builder_add(builder, "y", authentication_data->rand_data[i]); - } - rand_gv = g_variant_builder_end(builder); - - builder = g_variant_builder_new(G_VARIANT_TYPE ("ay")); - for (i = 0; i < authentication_data->autn_length; i++) { - dbg("authentication_data->autn_data[%d][0x%02x]", i,authentication_data->autn_data[i]); - g_variant_builder_add(builder, "y", authentication_data->autn_data[i]); - } - autn_gv = g_variant_builder_end(builder); - - param = g_variant_new("(ivv)", authentication_data->auth_type, rand_gv, autn_gv); - /*g_variant_builder_unref (builder);*/ - - g_dbus_connection_call(handle->dbus_connection, DBUS_TELEPHONY_SERVICE, handle->path, - DBUS_TELEPHONY_SIM_INTERFACE, "Authentication", param, NULL, G_DBUS_CALL_FLAGS_NONE, -1, - handle->ca, on_response_req_sim_authentication, evt_cb_data); - - return TAPI_API_SUCCESS; -} - -EXPORT_API int tel_verifiy_sim_pins(TapiHandle *handle, const TelSimSecPw_t *pin_data, - tapi_response_cb callback, void *user_data) -{ - struct tapi_resp_data *evt_cb_data = NULL; - GVariant *param = NULL; - gchar *gpw = NULL; - int sim_ret = 0; - - dbg("Func Entrance"); - if (_tel_check_tapi_state() != 0) - return TAPI_API_SERVICE_NOT_READY; - - TAPI_RETURN_VAL_IF_FAIL(handle, TAPI_API_INVALID_PTR); - - sim_ret =_tel_check_sim_state(handle); - if (sim_ret == TAPI_API_SIM_CARD_ERROR || sim_ret == TAPI_API_SIM_NOT_FOUND) - return sim_ret; - - TAPI_RETURN_VAL_IF_FAIL(pin_data, TAPI_API_INVALID_PTR); - TAPI_RETURN_VAL_IF_FAIL(pin_data->pw, TAPI_API_INVALID_PTR); - - dbg("pin type[%d]", pin_data->type); - if (pin_data->type != TAPI_SIM_PTYPE_PIN1 && pin_data->type != TAPI_SIM_PTYPE_PIN2 - && pin_data->type != TAPI_SIM_PTYPE_SIM) - return TAPI_API_INVALID_INPUT; - - if ((pin_data->pw_len < 4) || (pin_data->pw_len > 8)) - return TAPI_API_INVALID_INPUT; - - MAKE_RESP_CB_DATA(evt_cb_data, handle, callback, user_data); - - gpw = calloc(pin_data->pw_len+1, 1); - if (!gpw) { - g_free(evt_cb_data); - return TAPI_API_SYSTEM_OUT_OF_MEM; - } - - memcpy((void*)gpw, (const void*)pin_data->pw, pin_data->pw_len); - - param = g_variant_new("(is)", pin_data->type, gpw); - - g_dbus_connection_call(handle->dbus_connection, DBUS_TELEPHONY_SERVICE, handle->path, - DBUS_TELEPHONY_SIM_INTERFACE, "VerifySec", param, NULL, G_DBUS_CALL_FLAGS_NONE, -1, - handle->ca, on_response_verify_sim_pins, evt_cb_data); - - if (gpw) - free(gpw); - - return TAPI_API_SUCCESS; -} - -EXPORT_API int tel_verify_sim_puks(TapiHandle *handle, const TelSimSecPw_t *puk_data, - const TelSimSecPw_t *new_pin_data, tapi_response_cb callback, void *user_data) -{ - struct tapi_resp_data *evt_cb_data = NULL; - GVariant *param = NULL; - gchar *gpin = NULL; - gchar *gpuk = NULL; - int sim_ret = 0; - - dbg("Func Entrance"); - if (_tel_check_tapi_state() != 0) - return TAPI_API_SERVICE_NOT_READY; - - TAPI_RETURN_VAL_IF_FAIL(handle, TAPI_API_INVALID_PTR); - - sim_ret =_tel_check_sim_state(handle); - if (sim_ret == TAPI_API_SIM_CARD_ERROR || sim_ret == TAPI_API_SIM_NOT_FOUND) - return sim_ret; - - TAPI_RETURN_VAL_IF_FAIL((puk_data != NULL && new_pin_data != NULL), TAPI_API_INVALID_PTR); - TAPI_RETURN_VAL_IF_FAIL((puk_data->pw != NULL && new_pin_data->pw != NULL), TAPI_API_INVALID_PTR); - - dbg("puk type[%d] pin type[%d]", puk_data->type, new_pin_data->type); - if ((puk_data->type != TAPI_SIM_PTYPE_PUK1 && puk_data->type != TAPI_SIM_PTYPE_PUK2) - || (new_pin_data->type != TAPI_SIM_PTYPE_PIN1 && new_pin_data->type != TAPI_SIM_PTYPE_PIN2)) - return TAPI_API_INVALID_INPUT; - - if ((puk_data->type != TAPI_SIM_PTYPE_PUK1 || new_pin_data->type != TAPI_SIM_PTYPE_PIN1) - && (puk_data->type != TAPI_SIM_PTYPE_PUK2 || new_pin_data->type != TAPI_SIM_PTYPE_PIN2)) - return TAPI_API_INVALID_INPUT; - - if ((puk_data->pw_len < 4) || (puk_data->pw_len > 8) || (new_pin_data->pw_len < 4) - || (new_pin_data->pw_len > 8)) - return TAPI_API_INVALID_INPUT; - - MAKE_RESP_CB_DATA(evt_cb_data, handle, callback, user_data); - - gpin = calloc(new_pin_data->pw_len+1, 1); - if (!gpin) { - g_free(evt_cb_data); - return TAPI_API_SYSTEM_OUT_OF_MEM; - } - - gpuk = calloc(puk_data->pw_len+1, 1); - if (!gpuk) { - g_free(evt_cb_data); - free(gpin); - return TAPI_API_SYSTEM_OUT_OF_MEM; - } - - memcpy((void*)gpin, (const void*)new_pin_data->pw, new_pin_data->pw_len); - memcpy((void*)gpuk, (const void*)puk_data->pw, puk_data->pw_len); - - param = g_variant_new("(iss)", puk_data->type, gpuk, gpin); - - g_dbus_connection_call(handle->dbus_connection, DBUS_TELEPHONY_SERVICE, handle->path, - DBUS_TELEPHONY_SIM_INTERFACE, "VerifyPUK", param, NULL, G_DBUS_CALL_FLAGS_NONE, -1, - handle->ca, on_response_verify_sim_puks, evt_cb_data); - - if (gpin) - free(gpin); - - if (gpuk) - free(gpuk); - - return TAPI_API_SUCCESS; -} - -EXPORT_API int tel_change_sim_pins(TapiHandle *handle, const TelSimSecPw_t *old_pin, - const TelSimSecPw_t *new_pin, tapi_response_cb callback, void *user_data) -{ - struct tapi_resp_data *evt_cb_data = NULL; - GVariant *param = NULL; - gchar *gpin_o = NULL; - gchar *gpin_n = NULL; - int sim_ret = 0; - - dbg("Func Entrance"); - if (_tel_check_tapi_state() != 0) - return TAPI_API_SERVICE_NOT_READY; - - TAPI_RETURN_VAL_IF_FAIL(handle, TAPI_API_INVALID_PTR); - - sim_ret =_tel_check_sim_state(handle); - if (sim_ret != TAPI_API_SUCCESS) - return sim_ret; - - TAPI_RETURN_VAL_IF_FAIL((old_pin != NULL && new_pin != NULL), TAPI_API_INVALID_PTR); - TAPI_RETURN_VAL_IF_FAIL((old_pin->pw != NULL && new_pin->pw != NULL), TAPI_API_INVALID_PTR); - - dbg("old_pin type[%d],new_pin type[%d]", old_pin->type, new_pin->type); - if ((old_pin->type != TAPI_SIM_PTYPE_PIN1) && (old_pin->type != TAPI_SIM_PTYPE_PIN2) - && (new_pin->type != TAPI_SIM_PTYPE_PIN1) && (new_pin->type != TAPI_SIM_PTYPE_PIN2)) - return TAPI_API_INVALID_INPUT; - - if (old_pin->type != new_pin->type) - return TAPI_API_INVALID_INPUT; - - if ((old_pin->pw_len < 4) || (old_pin->pw_len > 8)) - return TAPI_API_INVALID_INPUT; - - if ((new_pin->pw_len < 4) || (new_pin->pw_len > 8)) - return TAPI_API_INVALID_INPUT; - - MAKE_RESP_CB_DATA(evt_cb_data, handle, callback, user_data); - - gpin_o = calloc(old_pin->pw_len+1, 1); - if (!gpin_o) { - g_free(evt_cb_data); - return TAPI_API_SYSTEM_OUT_OF_MEM; - } - - gpin_n = calloc(new_pin->pw_len+1, 1); - if (!gpin_n) { - free(gpin_o); - g_free(evt_cb_data); - return TAPI_API_SYSTEM_OUT_OF_MEM; - } - - memcpy((void*)gpin_o, (const void*)old_pin->pw, old_pin->pw_len); - memcpy((void*)gpin_n, (const void*)new_pin->pw, new_pin->pw_len); - - param = g_variant_new("(iss)", old_pin->type, gpin_o, gpin_n); - dbg("old_pin len[%d],new_pin len[%d]", old_pin->pw_len, new_pin->pw_len); - - g_dbus_connection_call(handle->dbus_connection, DBUS_TELEPHONY_SERVICE, handle->path, - DBUS_TELEPHONY_SIM_INTERFACE, "ChangePIN", param, NULL, G_DBUS_CALL_FLAGS_NONE, -1, - handle->ca, on_response_change_sim_pins, evt_cb_data); - - if (gpin_o) - free(gpin_o); - - if (gpin_n) - free(gpin_n); - - return TAPI_API_SUCCESS; -} - -EXPORT_API int tel_disable_sim_facility(TapiHandle *handle, TelSimFacilityPw_t *pw, - tapi_response_cb callback, void *user_data) -{ - struct tapi_resp_data *evt_cb_data = NULL; - GVariant *param = NULL; - gchar *gpw = NULL; - int sim_ret = 0; - - dbg("Func Entrance"); - if (_tel_check_tapi_state() != 0) - return TAPI_API_SERVICE_NOT_READY; - - TAPI_RETURN_VAL_IF_FAIL(handle, TAPI_API_INVALID_PTR); - - sim_ret =_tel_check_sim_state(handle); - if (sim_ret != TAPI_API_SUCCESS) - return sim_ret; - - TAPI_RETURN_VAL_IF_FAIL(pw, TAPI_API_INVALID_PTR); - TAPI_RETURN_VAL_IF_FAIL(pw->pw, TAPI_API_INVALID_PTR); - - dbg("facility type[%d]", pw->lock_type); - if(pw->lock_type < TAPI_SIM_LOCK_PS || pw->lock_type >TAPI_SIM_LOCK_PC) - return TAPI_API_INVALID_INPUT; - if ((pw->lock_type < TAPI_SIM_LOCK_PN) && ((pw->pw_len < 4) || (pw->pw_len > 8)) ) - return TAPI_API_INVALID_INPUT; - if ((pw->lock_type > TAPI_SIM_LOCK_FD) && (pw->pw_len < 6) ) - return TAPI_API_INVALID_INPUT; - - MAKE_RESP_CB_DATA(evt_cb_data, handle, callback, user_data); - - gpw = calloc(pw->pw_len+1, 1); - if (!gpw) { - g_free(evt_cb_data); - return TAPI_API_SYSTEM_OUT_OF_MEM; - } - - memcpy((void*)gpw, (const void*)pw->pw, pw->pw_len); - - param = g_variant_new("(is)", pw->lock_type, gpw); - - g_dbus_connection_call(handle->dbus_connection, DBUS_TELEPHONY_SERVICE, handle->path, - DBUS_TELEPHONY_SIM_INTERFACE, "DisableFacility", param, NULL, G_DBUS_CALL_FLAGS_NONE, - -1, handle->ca, on_response_disable_sim_facility, evt_cb_data); - - if (gpw) - free(gpw); - - return TAPI_API_SUCCESS; -} - -EXPORT_API int tel_enable_sim_facility(TapiHandle *handle, TelSimFacilityPw_t *pw, - tapi_response_cb callback, void *user_data) -{ - struct tapi_resp_data *evt_cb_data = NULL; - GVariant *param = NULL; - gchar *gpw = NULL; - int sim_ret = 0; - - dbg("Func Entrance"); - if (_tel_check_tapi_state() != 0) - return TAPI_API_SERVICE_NOT_READY; - - TAPI_RETURN_VAL_IF_FAIL(handle, TAPI_API_INVALID_PTR); - - sim_ret =_tel_check_sim_state(handle); - if (sim_ret != TAPI_API_SUCCESS) - return sim_ret; - - TAPI_RETURN_VAL_IF_FAIL(pw, TAPI_API_INVALID_PTR); - TAPI_RETURN_VAL_IF_FAIL(pw->pw, TAPI_API_INVALID_PTR); - - dbg("facility type[%d]", pw->lock_type); - if(pw->lock_type < TAPI_SIM_LOCK_PS || pw->lock_type >TAPI_SIM_LOCK_PC) - return TAPI_API_INVALID_INPUT; - if ((pw->lock_type < TAPI_SIM_LOCK_PN) && ((pw->pw_len < 4) || (pw->pw_len > 8)) ) - return TAPI_API_INVALID_INPUT; - if ((pw->lock_type > TAPI_SIM_LOCK_FD) && (pw->pw_len < 6) ) - return TAPI_API_INVALID_INPUT; - - MAKE_RESP_CB_DATA(evt_cb_data, handle, callback, user_data); - - gpw = calloc(pw->pw_len+1, 1); - if (!gpw) { - g_free(evt_cb_data); - return TAPI_API_SYSTEM_OUT_OF_MEM; - } - - memcpy((void*)gpw, (const void*)pw->pw, pw->pw_len); - - param = g_variant_new("(is)", pw->lock_type, gpw); - - g_dbus_connection_call(handle->dbus_connection, DBUS_TELEPHONY_SERVICE, handle->path, - DBUS_TELEPHONY_SIM_INTERFACE, "EnableFacility", param, NULL, G_DBUS_CALL_FLAGS_NONE, -1, - handle->ca, on_response_enable_sim_facility, evt_cb_data); - - if (gpw) - free(gpw); - - return TAPI_API_SUCCESS; -} - -EXPORT_API int tel_get_sim_facility(TapiHandle *handle, TelSimLockType_t type, - tapi_response_cb callback, void *user_data) -{ - struct tapi_resp_data *evt_cb_data = NULL; - GVariant *param = NULL; - int sim_ret = 0; - - dbg("Func Entrance"); - if (_tel_check_tapi_state() != 0) - return TAPI_API_SERVICE_NOT_READY; - - TAPI_RETURN_VAL_IF_FAIL(handle, TAPI_API_INVALID_PTR); - - sim_ret =_tel_check_sim_state(handle); - if (sim_ret != TAPI_API_SUCCESS) - return sim_ret; - - dbg("facility type[%d]", type); - if(type < TAPI_SIM_LOCK_PS || type >TAPI_SIM_LOCK_PC) - return TAPI_API_INVALID_INPUT; - - MAKE_RESP_CB_DATA(evt_cb_data, handle, callback, user_data); - - param = g_variant_new("(i)", type); - - g_dbus_connection_call(handle->dbus_connection, DBUS_TELEPHONY_SERVICE, handle->path, - DBUS_TELEPHONY_SIM_INTERFACE, "GetFacility", param, NULL, G_DBUS_CALL_FLAGS_NONE, -1, - handle->ca, on_response_get_sim_facility, evt_cb_data); - - return TAPI_API_SUCCESS; -} - -EXPORT_API int tel_get_sim_lock_info(TapiHandle *handle, TelSimLockType_t type, - tapi_response_cb callback, void *user_data) -{ - struct tapi_resp_data *evt_cb_data = NULL; - GVariant *param = NULL; - int sim_ret = 0; - - dbg("Func Entrance"); - if (_tel_check_tapi_state() != 0) - return TAPI_API_SERVICE_NOT_READY; - - TAPI_RETURN_VAL_IF_FAIL(handle, TAPI_API_INVALID_PTR); - - sim_ret =_tel_check_sim_state(handle); - if (sim_ret != TAPI_API_SUCCESS && sim_ret != TAPI_API_SIM_LOCKED) - return sim_ret; - - dbg("lock type[%d]", type); - if(type < TAPI_SIM_LOCK_PS || type >TAPI_SIM_LOCK_PC) - return TAPI_API_INVALID_INPUT; - - MAKE_RESP_CB_DATA(evt_cb_data, handle, callback, user_data); - - param = g_variant_new("(i)", type); - - g_dbus_connection_call(handle->dbus_connection, DBUS_TELEPHONY_SERVICE, handle->path, - DBUS_TELEPHONY_SIM_INTERFACE, "GetLockInfo", param, NULL, G_DBUS_CALL_FLAGS_NONE, -1, - handle->ca, on_response_get_sim_lock_info, evt_cb_data); - - return TAPI_API_SUCCESS; -} - -EXPORT_API int tel_req_sim_apdu(TapiHandle *handle, TelSimApdu_t* apdu_data, - tapi_response_cb callback, void *user_data) -{ - struct tapi_resp_data *evt_cb_data = NULL; - GVariantBuilder *builder = NULL; - GVariant *param = NULL; - GVariant *inner_gv = NULL; - int i = 0; - int sim_ret = 0; - - dbg("Func Entrance"); - if (_tel_check_tapi_state() != 0) - return TAPI_API_SERVICE_NOT_READY; - - TAPI_RETURN_VAL_IF_FAIL(handle, TAPI_API_INVALID_PTR); - - sim_ret =_tel_check_sim_state(handle); - if (sim_ret == TAPI_API_SIM_CARD_ERROR || sim_ret == TAPI_API_SIM_NOT_FOUND) - return sim_ret; - - TAPI_RETURN_VAL_IF_FAIL(apdu_data, TAPI_API_INVALID_PTR); - MAKE_RESP_CB_DATA(evt_cb_data, handle, callback, user_data); - - builder = g_variant_builder_new(G_VARIANT_TYPE ("ay")); - for (i = 0; i < apdu_data->apdu_len; i++) { - dbg("apdu_data->apdu[%d][0x%02x]", i,apdu_data->apdu[i]); - g_variant_builder_add(builder, "y", apdu_data->apdu[i]); - } - inner_gv = g_variant_builder_end(builder); - param = g_variant_new("(v)", inner_gv); - /*g_variant_builder_unref (builder);*/ - - g_dbus_connection_call(handle->dbus_connection, DBUS_TELEPHONY_SERVICE, handle->path, - DBUS_TELEPHONY_SIM_INTERFACE, "TransferAPDU", param, NULL, G_DBUS_CALL_FLAGS_NONE, -1, - handle->ca, on_response_req_sim_apdu, evt_cb_data); - - return TAPI_API_SUCCESS; -} - -EXPORT_API int tel_req_sim_atr(TapiHandle *handle, tapi_response_cb callback, void *user_data) -{ - struct tapi_resp_data *evt_cb_data = NULL; - int sim_ret = 0; - - dbg("Func Entrance"); - if (_tel_check_tapi_state() != 0) - return TAPI_API_SERVICE_NOT_READY; - - TAPI_RETURN_VAL_IF_FAIL(handle, TAPI_API_INVALID_PTR); - - sim_ret =_tel_check_sim_state(handle); - if (sim_ret == TAPI_API_SIM_CARD_ERROR || sim_ret == TAPI_API_SIM_NOT_FOUND) - return sim_ret; - - MAKE_RESP_CB_DATA(evt_cb_data, handle, callback, user_data); - - g_dbus_connection_call(handle->dbus_connection, DBUS_TELEPHONY_SERVICE, handle->path, - DBUS_TELEPHONY_SIM_INTERFACE, "GetATR", NULL, NULL, G_DBUS_CALL_FLAGS_NONE, -1, handle->ca, - on_response_req_sim_atr, evt_cb_data); - - return TAPI_API_SUCCESS; -} diff --git a/mobile/src/tapi_sms.c b/mobile/src/tapi_sms.c deleted file mode 100644 index e4f6bfa..0000000 --- a/mobile/src/tapi_sms.c +++ /dev/null @@ -1,1513 +0,0 @@ -/* - * libslp-tapi - * - * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. - * - * Contact: Ja-young Gu - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT 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 TAPI - * @defgroup SMS - * @{ - * - * SMS APIs allow a client to accomplish the following features: @n - * - Send, Recieve, Save, Delete, Read short messages @n - * - Set and Get information like Service Center Address, Cell Broadcast configuration,Preferred Bearer, SMS parameters @n - * - Retrieve information like Current Memory selected, NetTextCount related to the messages @n - * - Set delivery report @n - */ - -#include -#include -#include - -#include "tapi_common.h" -#include "TapiUtility.h" -#include "TelSms.h" - -#include "common.h" -#include "tapi_log.h" -#include "ITapiNetText.h" - -static void on_response_default(GObject *source_object, GAsyncResult *res, gpointer user_data) -{ - GError *error = NULL; - GDBusConnection *conn = NULL; - struct tapi_resp_data *evt_cb_data = user_data; - int result = -1; - - GVariant *dbus_result = NULL; - int data = 0; - - conn = G_DBUS_CONNECTION (source_object); - dbus_result = g_dbus_connection_call_finish(conn, res, &error); - - CHECK_DEINIT(error); - - if (!dbus_result) { - if (evt_cb_data) { - if (evt_cb_data->cb_fn) { - evt_cb_data->cb_fn(evt_cb_data->handle, -1, NULL, evt_cb_data->user_data); - } - - free(evt_cb_data); - } - - if (error) - g_error_free(error); - - return; - } - - dbg("on_response_default type_format(%s)", g_variant_get_type_string(dbus_result)); - - g_variant_get (dbus_result, "(i)", &result); - - if (evt_cb_data) { - if (evt_cb_data->cb_fn) { - evt_cb_data->cb_fn(evt_cb_data->handle, result, &data, evt_cb_data->user_data); - } - - free(evt_cb_data); - } -} - -static void on_response_read_msg(GObject *source_object, GAsyncResult *res, gpointer user_data) -{ - GError *error = NULL; - GDBusConnection *conn = NULL; - struct tapi_resp_data *evt_cb_data = user_data; - int result = -1; - - TelSmsData_t readMsg = {0,}; - - GVariant *dbus_result = NULL; - const char *sca = NULL; - const char *tpdu = NULL; - gsize length; - guchar *decoded_sca = NULL; - guchar *decoded_tpdu = NULL; - - conn = G_DBUS_CONNECTION (source_object); - dbus_result = g_dbus_connection_call_finish(conn, res, &error); - CHECK_DEINIT(error); - - if (!dbus_result) { - if (evt_cb_data) { - if (evt_cb_data->cb_fn) { - evt_cb_data->cb_fn(evt_cb_data->handle, -1, NULL, evt_cb_data->user_data); - } - - free(evt_cb_data); - } - - if (error) - g_error_free(error); - - return; - } - - dbg("on_response_read_msg type_format(%s)", g_variant_get_type_string(dbus_result)); - -// readMsg.SimIndex = 0xFFFFFFFF; - g_variant_get (dbus_result, "(iiisis)", &result, - &readMsg.SimIndex, - &readMsg.MsgStatus, - &sca, - &readMsg.SmsData.MsgLength, - &tpdu); - - decoded_sca = g_base64_decode(sca, &length); - if (decoded_sca) { - memcpy(&(readMsg.SmsData.Sca[0]), decoded_sca, TAPI_SMS_ENCODED_SCA_LEN_MAX); - g_free(decoded_sca); - } - - decoded_tpdu = g_base64_decode(tpdu, &length); - if (decoded_tpdu) { - memcpy(&(readMsg.SmsData.szData[0]), decoded_tpdu, TAPI_NETTEXT_SMDATA_SIZE_MAX + 1); - g_free(decoded_tpdu); - } - - if (evt_cb_data) { - if (evt_cb_data->cb_fn) { - evt_cb_data->cb_fn(evt_cb_data->handle, result, &readMsg, evt_cb_data->user_data); - } - - free(evt_cb_data); - } -} - -static void on_response_write_msg(GObject *source_object, GAsyncResult *res, gpointer user_data) -{ - GError *error = NULL; - GDBusConnection *conn = NULL; - struct tapi_resp_data *evt_cb_data = user_data; - int result = -1; - int index = 0; - - GVariant *dbus_result = NULL; - - conn = G_DBUS_CONNECTION (source_object); - dbus_result = g_dbus_connection_call_finish(conn, res, &error); - CHECK_DEINIT(error); - - if (!dbus_result) { - if (evt_cb_data) { - if (evt_cb_data->cb_fn) { - evt_cb_data->cb_fn(evt_cb_data->handle, -1, NULL, evt_cb_data->user_data); - } - - free(evt_cb_data); - } - - if (error) - g_error_free(error); - - return; - } - - dbg("on_response_write_msg type_format(%s)", g_variant_get_type_string(dbus_result)); - - g_variant_get (dbus_result, "(ii)", &result, &index); - - if (evt_cb_data) { - if (evt_cb_data->cb_fn) { - evt_cb_data->cb_fn(evt_cb_data->handle, result, &index, evt_cb_data->user_data); - } - - free(evt_cb_data); - } -} - -static void on_response_delete_msg(GObject *source_object, GAsyncResult *res, gpointer user_data) -{ - GError *error = NULL; - GDBusConnection *conn = NULL; - struct tapi_resp_data *evt_cb_data = user_data; - int result = -1; - int index = -1; - - GVariant *dbus_result = NULL; - - conn = G_DBUS_CONNECTION (source_object); - dbus_result = g_dbus_connection_call_finish(conn, res, &error); - CHECK_DEINIT(error); - - if (!dbus_result) { - if (evt_cb_data) { - if (evt_cb_data->cb_fn) { - evt_cb_data->cb_fn(evt_cb_data->handle, -1, NULL, evt_cb_data->user_data); - } - - free(evt_cb_data); - } - - if (error) - g_error_free(error); - - return; - } - - dbg("on_response_delete_msg type_format(%s)", g_variant_get_type_string(dbus_result)); - - g_variant_get (dbus_result, "(ii)", &result, &index); - - if (evt_cb_data) { - if (evt_cb_data->cb_fn) { - evt_cb_data->cb_fn(evt_cb_data->handle, result, &index, evt_cb_data->user_data); - } - - free(evt_cb_data); - } -} - -static void on_response_get_msg_count(GObject *source_object, GAsyncResult *res, gpointer user_data) -{ - GError *error = NULL; - GDBusConnection *conn = NULL; - struct tapi_resp_data *evt_cb_data = user_data; - int result = -1; - TelSmsStoredMsgCountInfo_t storedMsgCnt = {0,}; - - GVariant *dbus_result = NULL; - const char *indexList = NULL; - gsize length; - guchar *decoded_indexList = NULL; - - conn = G_DBUS_CONNECTION (source_object); - dbus_result = g_dbus_connection_call_finish(conn, res, &error); - CHECK_DEINIT(error); - - if (!dbus_result) { - if (evt_cb_data) { - if (evt_cb_data->cb_fn) { - evt_cb_data->cb_fn(evt_cb_data->handle, -1, NULL, evt_cb_data->user_data); - } - - free(evt_cb_data); - } - - if (error) - g_error_free(error); - - return; - } - - dbg("on_response_get_msg_count type_format(%s)", g_variant_get_type_string(dbus_result)); - - g_variant_get (dbus_result, "(iiis)", &result, - &storedMsgCnt.TotalCount, - &storedMsgCnt.UsedCount, - &indexList); - - decoded_indexList = g_base64_decode(indexList, &length); - if (decoded_indexList) { - memcpy(&(storedMsgCnt.IndexList[0]), decoded_indexList, TAPI_NETTEXT_GSM_SMS_MSG_NUM_MAX); - g_free(decoded_indexList); - } - - if (evt_cb_data) { - if (evt_cb_data->cb_fn) { - evt_cb_data->cb_fn(evt_cb_data->handle, result, &storedMsgCnt, evt_cb_data->user_data); - } - - free(evt_cb_data); - } - -} - -static void on_response_get_sca(GObject *source_object, GAsyncResult *res, gpointer user_data) -{ - GError *error = NULL; - GDBusConnection *conn = NULL; - struct tapi_resp_data *evt_cb_data = user_data; - int result = -1; - TelSmsAddressInfo_t scaInfo = {0,}; - - GVariant *dbus_result = NULL; - const char *sca = NULL; - gsize length; - guchar *decoded_sca = NULL; - - conn = G_DBUS_CONNECTION (source_object); - dbus_result = g_dbus_connection_call_finish(conn, res, &error); - CHECK_DEINIT(error); - - if (!dbus_result) { - if (evt_cb_data) { - if (evt_cb_data->cb_fn) { - evt_cb_data->cb_fn(evt_cb_data->handle, -1, NULL, evt_cb_data->user_data); - } - - free(evt_cb_data); - } - - if (error) - g_error_free(error); - - return; - } - - dbg("on_response_get_sca type_format(%s)", g_variant_get_type_string(dbus_result)); - - g_variant_get (dbus_result, "(iiiis)", &result, - &scaInfo.Ton, - &scaInfo.Npi, - &scaInfo.DialNumLen, - &sca); - - decoded_sca = g_base64_decode(sca, &length); - if (decoded_sca) { - memcpy(&(scaInfo.szDiallingNum[0]), decoded_sca, TAPI_SIM_SMSP_ADDRESS_LEN + 1); - g_free(decoded_sca); - } - - if (evt_cb_data) { - if (evt_cb_data->cb_fn) { - evt_cb_data->cb_fn(evt_cb_data->handle, result, &scaInfo, evt_cb_data->user_data); - } - - free(evt_cb_data); - } -} - -static void on_response_get_cb_config(GObject *source_object, GAsyncResult *res, gpointer user_data) -{ - GError *error = NULL; - GDBusConnection *conn = NULL; - struct tapi_resp_data *evt_cb_data = user_data; - int result = -1; - int i; - TelSmsCbConfig_t cbConfig = {0,}; - - GVariant *dbus_result = NULL; - GVariant *value = NULL; - GVariantIter *iter = NULL; - GVariantIter *iter_row = NULL; - const gchar *key = NULL; - - conn = G_DBUS_CONNECTION (source_object); - dbus_result = g_dbus_connection_call_finish(conn, res, &error); - CHECK_DEINIT(error); - - if (!dbus_result) { - if (evt_cb_data) { - if (evt_cb_data->cb_fn) { - evt_cb_data->cb_fn(evt_cb_data->handle, -1, NULL, evt_cb_data->user_data); - } - - free(evt_cb_data); - } - - if (error) - g_error_free(error); - - return; - } - - dbg("on_response_get_cb_config type_format(%s)", g_variant_get_type_string(dbus_result)); - - g_variant_get (dbus_result, "(iiiiiaa{sv})", &result, - &cbConfig.Net3gppType, - &cbConfig.CBEnabled, - &cbConfig.MsgIdMaxCount, - &cbConfig.MsgIdRangeCount, - &iter); - - i = 0; - while (g_variant_iter_next(iter, "a{sv}", &iter_row)) { - while (g_variant_iter_loop(iter_row, "{sv}", &key, &value)) { - if (!g_strcmp0(key, "FromMsgId")) { - cbConfig.MsgIDs[i].Net3gpp.FromMsgId = g_variant_get_uint16(value); - } - if (!g_strcmp0(key, "ToMsgId")) { - cbConfig.MsgIDs[i].Net3gpp.ToMsgId = g_variant_get_uint16(value); - } - if (!g_strcmp0(key, "CBCategory")) { - cbConfig.MsgIDs[i].Net3gpp2.CBCategory = g_variant_get_uint16(value); - } - if (!g_strcmp0(key, "CBLanguage")) { - cbConfig.MsgIDs[i].Net3gpp2.CBLanguage = g_variant_get_uint16(value); - } - if (!g_strcmp0(key, "Selected")) { - cbConfig.MsgIDs[i].Net3gpp.Selected = g_variant_get_byte(value); - } - } - i++; - g_variant_iter_free(iter_row); - } - g_variant_iter_free(iter); - - if (evt_cb_data) { - if (evt_cb_data->cb_fn) { - evt_cb_data->cb_fn(evt_cb_data->handle, result, &cbConfig, evt_cb_data->user_data); - } - - free(evt_cb_data); - } -} - -static void on_response_get_sms_params(GObject *source_object, GAsyncResult *res, gpointer user_data) -{ - GError *error = NULL; - GDBusConnection *conn = NULL; - struct tapi_resp_data *evt_cb_data = user_data; - int result = -1; - TelSmsParams_t paramInfo = {0,}; - - GVariant *dbus_result = NULL; - const char *alphaId = NULL; - const char *destDialNum = NULL; - const char *scaDialNum = NULL; - gsize length; - guchar *decoded_alphaId = NULL; - guchar *decoded_destDialNum = NULL; - guchar *decoded_scaDialNum = NULL; - - conn = G_DBUS_CONNECTION (source_object); - dbus_result = g_dbus_connection_call_finish(conn, res, &error); - CHECK_DEINIT(error); - - if (!dbus_result) { - if (evt_cb_data) { - if (evt_cb_data->cb_fn) { - evt_cb_data->cb_fn(evt_cb_data->handle, -1, NULL, evt_cb_data->user_data); - } - - free(evt_cb_data); - } - - if (error) - g_error_free(error); - - return; - } - - dbg("on_response_get_sms_params type_format(%s)", g_variant_get_type_string(dbus_result)); - - g_variant_get (dbus_result, "(iiiisiiiisiiisiii)", &result, - ¶mInfo.RecordIndex, - ¶mInfo.RecordLen, - ¶mInfo.AlphaIdLen, - &alphaId, - ¶mInfo.ParamIndicator, - ¶mInfo.TpDestAddr.DialNumLen, - ¶mInfo.TpDestAddr.Ton, - ¶mInfo.TpDestAddr.Npi, - &destDialNum, - ¶mInfo.TpSvcCntrAddr.DialNumLen, - ¶mInfo.TpSvcCntrAddr.Ton, - ¶mInfo.TpSvcCntrAddr.Npi, - &scaDialNum, - ¶mInfo.TpProtocolId, - ¶mInfo.TpDataCodingScheme, - ¶mInfo.TpValidityPeriod); - - decoded_alphaId = g_base64_decode(alphaId, &length); - if (decoded_alphaId) { - memcpy(&(paramInfo.szAlphaId[0]), decoded_alphaId, TAPI_SIM_SMSP_ALPHA_ID_LEN_MAX + 1); - g_free(decoded_alphaId); - } - - decoded_destDialNum = g_base64_decode(destDialNum, &length); - if (decoded_destDialNum) { - memcpy(&(paramInfo.TpDestAddr.szDiallingNum[0]), decoded_destDialNum, TAPI_SIM_SMSP_ADDRESS_LEN + 1); - g_free(decoded_destDialNum); - } - - decoded_scaDialNum = g_base64_decode(scaDialNum, &length); - if (decoded_scaDialNum) { - memcpy(&(paramInfo.TpSvcCntrAddr.szDiallingNum[0]), decoded_scaDialNum, TAPI_SIM_SMSP_ADDRESS_LEN + 1); - g_free(decoded_scaDialNum); - } - - if (evt_cb_data) { - if (evt_cb_data->cb_fn) { - evt_cb_data->cb_fn(evt_cb_data->handle, result, ¶mInfo, evt_cb_data->user_data); - } - - free(evt_cb_data); - } - -} - -static void on_response_get_sms_param_cnt(GObject *source_object, GAsyncResult *res, gpointer user_data) -{ - GError *error = NULL; - GDBusConnection *conn = NULL; - struct tapi_resp_data *evt_cb_data = user_data; - int result = -1; - int recordCount = 0; - - GVariant *dbus_result = NULL; - - conn = G_DBUS_CONNECTION (source_object); - dbus_result = g_dbus_connection_call_finish(conn, res, &error); - CHECK_DEINIT(error); - - if (!dbus_result) { - if (evt_cb_data) { - if (evt_cb_data->cb_fn) { - evt_cb_data->cb_fn(evt_cb_data->handle, -1, NULL, evt_cb_data->user_data); - } - - free(evt_cb_data); - } - - if (error) - g_error_free(error); - - return; - } - - dbg("on_response_get_sms_param_cnt type_format(%s)", g_variant_get_type_string(dbus_result)); - - g_variant_get (dbus_result, "(ii)", &result, - &recordCount); - - if (evt_cb_data) { - if (evt_cb_data->cb_fn) { - evt_cb_data->cb_fn(evt_cb_data->handle, result, &recordCount, evt_cb_data->user_data); - } - - free(evt_cb_data); - } -} - -/** - * - * This function enables the applications to send SMS to the network. - * - * @return Returns appropriate error code. Refer TapiResult_t . - * @param[in] pDataPackage - SMS-SUBMIT TPDU or SMS-COMMAND, and its length have to be passed in this structure. - * tapi_sms_more_to_send_t parameter denotes whether the sms is short or concatenated. - * - * @param[out] RequestId-Unique identifier for a particular request - * Its 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 - * @Interface Asynchronous. - * @remark - * @Refer tapi_sms_datapackage, tapi_sms_more_to_send_t. - */ -EXPORT_API int tel_send_sms(struct tapi_handle *handle, - const TelSmsDatapackageInfo_t *pDataPackage, - int bMoreMsgToSend, - tapi_response_cb callback, void* user_data) -{ - struct tapi_resp_data *evt_cb_data = NULL; - GVariant *param; - gchar *encoded_sca = NULL; - gchar *encoded_tpdu = NULL; - - dbg("Func Entrance "); - - TAPI_RET_ERR_NUM_IF_FAIL(pDataPackage ,TAPI_API_INVALID_PTR); - - if ((pDataPackage->Sca[0] > TAPI_SIM_SMSP_ADDRESS_LEN) - || (pDataPackage->MsgLength > TAPI_NETTEXT_SMDATA_SIZE_MAX)) - return TAPI_API_INVALID_INPUT; - - MAKE_RESP_CB_DATA(evt_cb_data, handle, callback, user_data); - - encoded_sca = g_base64_encode(&(pDataPackage->Sca[0]), TAPI_SMS_ENCODED_SCA_LEN_MAX); - if (encoded_sca == NULL) { - dbg("g_base64_encode: Failed to Enocde the SCA"); - return TAPI_API_OPERATION_FAILED; - } - - encoded_tpdu = g_base64_encode(&(pDataPackage->szData[0]), pDataPackage->MsgLength); - if (encoded_tpdu == NULL) { - dbg("g_base64_encode: Failed to Enocde the TPDU"); - return TAPI_API_OPERATION_FAILED; - } - - param = g_variant_new("(sisi)", encoded_sca, - pDataPackage->MsgLength, - encoded_tpdu, - bMoreMsgToSend); - - g_dbus_connection_call(handle->dbus_connection, - DBUS_TELEPHONY_SERVICE , handle->path, DBUS_TELEPHONY_SMS_INTERFACE, - "SendMsg", param, NULL, - G_DBUS_CALL_FLAGS_NONE, 120000, handle->ca, - on_response_default, evt_cb_data); - - g_free(encoded_sca); - g_free(encoded_tpdu); - - return TAPI_API_SUCCESS; -} - - -/** - * - * This function enables the applications to read sms from the preferred storage. - * - * @return Returns appropriate error code. Refer TapiResult_t . - * @param[in] index - the message to be read - * - * @param[out] RequestId-Unique identifier for a particular request - * Its 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 - * @Interface Asynchronous. - * @remark tapi_sms_selmem_set is to be called always to select the - * preferred memory before calling this api. - * @Refer - */ -EXPORT_API int tel_read_sms_in_sim(struct tapi_handle *handle, int index, tapi_response_cb callback, void* user_data) -{ - struct tapi_resp_data *evt_cb_data = NULL; - GVariant *param; - - dbg("Func Entrance "); - - if( (index < 0) || (index > TAPI_NETTEXT_MAX_INDEX) ) { - err("Invalid Input -Read SMS %d",index); - - return TAPI_API_INVALID_INPUT; - } - - TAPI_RET_ERR_NUM_IF_FAIL(callback ,TAPI_API_INVALID_PTR); - - MAKE_RESP_CB_DATA(evt_cb_data, handle, callback, user_data); - - param = g_variant_new("(i)", index); - - g_dbus_connection_call(handle->dbus_connection, - DBUS_TELEPHONY_SERVICE , handle->path, DBUS_TELEPHONY_SMS_INTERFACE, - "ReadMsg", param, NULL, - G_DBUS_CALL_FLAGS_NONE, -1, handle->ca, - on_response_read_msg, evt_cb_data); - - return TAPI_API_SUCCESS; -} - - -/** - * - * This function enables the applications to write/save sms to the preferred storage. - * - * @return Returns appropriate error code. Refer TapiResult_t . - * @param[in] index - the message to be saved, msg_status will denote the status - * of the message whether Sent, Unsent, Read, Unread, Unknown. - * pDataPackage- the SMS-SUBMIT PDU or SMS-DELIVER,SMS-STATUSREPORT - * being passed to be saved in memory. - * - * @param[out] RequestId-Unique identifier for a particular request - * Its 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 - * @Interface Asynchronous. - * @Refer tapi_sms_datapackage, tapi_sms_status_type. - */ -EXPORT_API int tel_write_sms_in_sim(struct tapi_handle *handle, const TelSmsData_t *pWriteData, tapi_response_cb callback, void* user_data) -{ - struct tapi_resp_data *evt_cb_data = NULL; - GVariant *param; - gchar *encoded_sca = NULL; - gchar *encoded_tpdu = NULL; - - dbg("Func Entrance "); - - TAPI_RET_ERR_NUM_IF_FAIL(pWriteData ,TAPI_API_INVALID_PTR); - - MAKE_RESP_CB_DATA(evt_cb_data, handle, callback, user_data); - - encoded_sca = g_base64_encode(&(pWriteData->SmsData.Sca[0]), TAPI_SMS_ENCODED_SCA_LEN_MAX); - if (encoded_sca == NULL) { - dbg("g_base64_encode: Failed to Enocde the SCA"); - return TAPI_API_OPERATION_FAILED; - } - - encoded_tpdu = g_base64_encode(&(pWriteData->SmsData.szData[0]), TAPI_NETTEXT_SMDATA_SIZE_MAX + 1); - if (encoded_tpdu == NULL) { - dbg("g_base64_encode: Failed to Enocde the TPDU"); - return TAPI_API_OPERATION_FAILED; - } - - param = g_variant_new("(isis)", pWriteData->MsgStatus, - encoded_sca, - pWriteData->SmsData.MsgLength, - encoded_tpdu); - - g_dbus_connection_call(handle->dbus_connection, - DBUS_TELEPHONY_SERVICE , handle->path, DBUS_TELEPHONY_SMS_INTERFACE, - "SaveMsg", param, NULL, - G_DBUS_CALL_FLAGS_NONE, -1, handle->ca, - on_response_write_msg, evt_cb_data); - - g_free(encoded_sca); - g_free(encoded_tpdu); - - return TAPI_API_SUCCESS; -} - - -/** - * - * This function enables the applications to delete sms to the preferred storage. - * - * @return Returns appropriate error code. Refer TapiResult_t . - * @param[in] index - the message to be deleted. if index is -1, all sms in the sim are deleted. - * - * @param[out] RequestId-Unique identifier for a particular request - * Its 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 - * @Interface Asynchronous. - * @remark tapi_sms_selmem_set has to be called always before calling this API - * @Refer - */ -EXPORT_API int tel_delete_sms_in_sim(struct tapi_handle *handle, int index, tapi_response_cb callback, void* user_data) -{ - struct tapi_resp_data *evt_cb_data = NULL; - GVariant *param; - - dbg("Func Entrance "); - - if ((index < -1) || (index > TAPI_NETTEXT_MAX_INDEX)) { - err("Invalid Index Input"); - return TAPI_API_INVALID_INPUT; - } - - MAKE_RESP_CB_DATA(evt_cb_data, handle, callback, user_data); - - param = g_variant_new("(i)", index); - - g_dbus_connection_call(handle->dbus_connection, - DBUS_TELEPHONY_SERVICE , handle->path, DBUS_TELEPHONY_SMS_INTERFACE, - "DeleteMsg", param, NULL, - G_DBUS_CALL_FLAGS_NONE, -1, handle->ca, - on_response_delete_msg, evt_cb_data); - - return TAPI_API_SUCCESS; -} - - -/** - * - * This function enables the applications to get the count of the messages stored in the memory - * - * @return Returns appropriate error code. Refer TapiResult_t . - * @param[in] None - * - * @param[out] RequestId-Unique identifier for a particular request - * Its 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 - * @Interface Asynchronous - * @remark The requested memory details come in response API - * @Refer None - */ -EXPORT_API int tel_get_sms_count(struct tapi_handle *handle, tapi_response_cb callback, void* user_data) -{ - struct tapi_resp_data *evt_cb_data = NULL; - - dbg("Func Entrance "); - - TAPI_RET_ERR_NUM_IF_FAIL(callback ,TAPI_API_INVALID_PTR); - - MAKE_RESP_CB_DATA(evt_cb_data, handle, callback, user_data); - - g_dbus_connection_call(handle->dbus_connection, - DBUS_TELEPHONY_SERVICE , handle->path, DBUS_TELEPHONY_SMS_INTERFACE, - "GetMsgCount", NULL, NULL, - G_DBUS_CALL_FLAGS_NONE, -1, handle->ca, - on_response_get_msg_count, evt_cb_data); - - return TAPI_API_SUCCESS; -} - - -/** - * - * This function enables the applications to get the service center address from the SIM storage - * - * @return Returns appropriate error code. Refer TapiResult_t . - * @param[in] pSCA - the service center address that is to be set in the SIM storage - * refer to 3GPP TS 23.040:9.1.2.5 Address fields - * index - the index that is to be set in the SIM storage - * - * @param[out] RequestId-Unique identifier for a particular request - * Its 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 - * @Interface Asynchronous. - * @remark - * @Refer tapi_sms_sms_addr_info - */ -EXPORT_API int tel_get_sms_sca(struct tapi_handle *handle, int index, tapi_response_cb callback, void* user_data) -{ - struct tapi_resp_data *evt_cb_data = NULL; - GVariant *param; - - dbg("Func Entrance "); - - TAPI_RET_ERR_NUM_IF_FAIL(callback ,TAPI_API_INVALID_PTR); - - if ((index < 0) || (index > TAPI_NETTEXT_MAX_INDEX)) { - err("Invalid Index Input"); - return TAPI_API_INVALID_INPUT; - } - - MAKE_RESP_CB_DATA(evt_cb_data, handle, callback, user_data); - - param = g_variant_new("(i)", index); - - g_dbus_connection_call(handle->dbus_connection, - DBUS_TELEPHONY_SERVICE , handle->path, DBUS_TELEPHONY_SMS_INTERFACE, - "GetSca", param, NULL, - G_DBUS_CALL_FLAGS_NONE, -1, handle->ca, - on_response_get_sca, evt_cb_data); - - return TAPI_API_SUCCESS; -} - - -/** - * - * This function enables the applications to set the service center address in the SIM storage - * - * @return Returns appropriate error code. Refer TapiResult_t . - * @param[in] pSCA - the service center address that is to be set in the SIM storage - * refer to 3GPP TS 23.040:9.1.2.5 Address fields - * index - the index that is to be set in the SIM storage - * - * @param[out] RequestId-Unique identifier for a particular request - * Its 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 - * @Interface ASynchronous. - * @remark - * @Refer tapi_sms_sms_addr_info - */ -EXPORT_API int tel_set_sms_sca(struct tapi_handle *handle, const TelSmsAddressInfo_t *pSCA, int index, tapi_response_cb callback, void* user_data) -{ - struct tapi_resp_data *evt_cb_data = NULL; - GVariant *param; - gchar *encoded_sca = NULL; - - dbg("Func Entrance "); - - TAPI_RET_ERR_NUM_IF_FAIL(pSCA ,TAPI_API_INVALID_PTR); - - if ((index < 0) || (index > TAPI_NETTEXT_MAX_INDEX)) { - err("Invalid Index Input"); - return TAPI_API_INVALID_INPUT; - } - - MAKE_RESP_CB_DATA(evt_cb_data, handle, callback, user_data); - - encoded_sca = g_base64_encode(&(pSCA->szDiallingNum[0]), TAPI_SIM_SMSP_ADDRESS_LEN); - if (encoded_sca == NULL) { - dbg("g_base64_encode: Failed to Enocde the SCA"); - return TAPI_API_OPERATION_FAILED; - } - - param = g_variant_new("(iiiis)", index, - pSCA->Ton, - pSCA->Npi, - pSCA->DialNumLen, - encoded_sca); - - g_dbus_connection_call(handle->dbus_connection, - DBUS_TELEPHONY_SERVICE , handle->path, DBUS_TELEPHONY_SMS_INTERFACE, - "SetSca", param, NULL, - G_DBUS_CALL_FLAGS_NONE, -1, handle->ca, - on_response_default, evt_cb_data); - - g_free(encoded_sca); - - - return TAPI_API_SUCCESS; -} - - -/** - * - * This function enables the applications to set the configuration for cell broadcast messages - * - * @return Returns appropriate error code. Refer TapiResult_t . - * @param[in] None - * - * @param[out] RequestId-Unique identifier for a particular request - * Its 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 - * @Interface Asynchronous. - * @remark - * @Refer None - */ -EXPORT_API int tel_get_sms_cb_config(struct tapi_handle *handle, tapi_response_cb callback, void* user_data) -{ - struct tapi_resp_data *evt_cb_data = NULL; - - dbg("Func Entrance "); - - TAPI_RET_ERR_NUM_IF_FAIL(callback ,TAPI_API_INVALID_PTR); - - MAKE_RESP_CB_DATA(evt_cb_data, handle, callback, user_data); - - g_dbus_connection_call(handle->dbus_connection, - DBUS_TELEPHONY_SERVICE , handle->path, DBUS_TELEPHONY_SMS_INTERFACE, - "GetCbConfig", NULL, NULL, - G_DBUS_CALL_FLAGS_NONE, -1, handle->ca, - on_response_get_cb_config, evt_cb_data); - - return TAPI_API_SUCCESS; -} - -/** - * - * This function enables the applications to set the configuration for cell broadcast messages - * - * @return Returns appropriate error code. Refer TapiResult_t . - * @param[in] tapi_sms_cb_config the configuration details to be set - * - * @param[out] RequestId-Unique identifier for a particular request - * Its 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 - * @Interface Asynchronous. - * @remark - * @Refer tapi_sms_cb_config - */ -EXPORT_API int tel_set_sms_cb_config(struct tapi_handle *handle, const TelSmsCbConfig_t *pCBConfig, tapi_response_cb callback, void* user_data) -{ - struct tapi_resp_data *evt_cb_data = NULL; - GVariant *param; - gchar *encoded_cbConfig = NULL; - - dbg("Func Entrance "); - - TAPI_RET_ERR_NUM_IF_FAIL(pCBConfig ,TAPI_API_INVALID_PTR); - - if ((pCBConfig->Net3gppType > 2) || (pCBConfig->MsgIdRangeCount < 0)) { - err("Invalid Input -3gppType(%d)",pCBConfig->Net3gppType); - err("Invalid Input -MsgIdRangeCount(%d)",pCBConfig->MsgIdRangeCount); - - return TAPI_API_INVALID_INPUT; - } - - MAKE_RESP_CB_DATA(evt_cb_data, handle, callback, user_data); - - encoded_cbConfig = g_base64_encode((const guchar *)&(pCBConfig->MsgIDs[0]), TAPI_NETTEXT_GSM_SMS_CBMI_LIST_SIZE_MAX*5); - if (encoded_cbConfig == NULL) { - dbg("g_base64_encode: Failed to Enocde the CB Config"); - return TAPI_API_OPERATION_FAILED; - } - - param = g_variant_new("(iiiis)", pCBConfig->Net3gppType, - pCBConfig->CBEnabled, - pCBConfig->MsgIdMaxCount, - pCBConfig->MsgIdRangeCount, - encoded_cbConfig); - - g_dbus_connection_call(handle->dbus_connection, - DBUS_TELEPHONY_SERVICE , handle->path, DBUS_TELEPHONY_SMS_INTERFACE, - "SetCbConfig", param, NULL, - G_DBUS_CALL_FLAGS_NONE, -1, handle->ca, - on_response_default, evt_cb_data); - - g_free(encoded_cbConfig); - - return TAPI_API_SUCCESS; -} - -/** - * - * This function enables the applications to set the phone memory status whether full or available - * - * @return Returns appropriate error code. Refer TapiResult_t . - * @param[in] memory_status whether full or available - * - * @param[out] RequestId-Unique identifier for a particular request - * Its 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 - * @Interface Asynchronous. - * @remark - * @Refer tapi_sms_memstatus_type - */ -EXPORT_API int tel_set_sms_memory_status(struct tapi_handle *handle, int memoryStatus, tapi_response_cb callback, void* user_data) -{ - struct tapi_resp_data *evt_cb_data = NULL; - GVariant *param; - - dbg("Func Entrance "); - - if ((memoryStatus < TAPI_NETTEXT_PDA_MEMORY_STATUS_AVAILABLE) || (memoryStatus > TAPI_NETTEXT_PDA_MEMORY_STATUS_FULL)) { - err("Invalid Input -MemoryStatus Nettext"); - return TAPI_API_INVALID_INPUT; - } - - MAKE_RESP_CB_DATA(evt_cb_data, handle, callback, user_data); - - param = g_variant_new("(i)", memoryStatus); - - g_dbus_connection_call(handle->dbus_connection, - DBUS_TELEPHONY_SERVICE , handle->path, DBUS_TELEPHONY_SMS_INTERFACE, - "SetMemStatus", param, NULL, - G_DBUS_CALL_FLAGS_NONE, -1, handle->ca, - on_response_default, evt_cb_data); - - return TAPI_API_SUCCESS; -} - -/** - * - * This function is used to get SMS preferred bearer on which SMS has to be transmitted. This is a synchronous function - * - * @return TRUE in case of success and FALSE in case of error . - * @param[in] None - * - * @param[out] requestId-Unique identifier for a particular request - * Its 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 - * @Interface Asynchronous. - * @remark - * @Refer - */ -EXPORT_API int tel_get_sms_preferred_bearer(struct tapi_handle *handle, tapi_response_cb callback, void* user_data) -{ - struct tapi_resp_data *evt_cb_data = NULL; - - dbg("Func Entrance "); - - TAPI_RET_ERR_NUM_IF_FAIL(callback ,TAPI_API_INVALID_PTR); - - MAKE_RESP_CB_DATA(evt_cb_data, handle, callback, user_data); - - g_dbus_connection_call(handle->dbus_connection, - DBUS_TELEPHONY_SERVICE , handle->path, DBUS_TELEPHONY_SMS_INTERFACE, - "GetPrefBearer", NULL, NULL, - G_DBUS_CALL_FLAGS_NONE, -1, handle->ca, - on_response_default, evt_cb_data); - - return TAPI_API_SUCCESS; -} - -/** - * - * This function enables the applications to set the preferred bearer - * - * @return Returns appropriate error code. Refer TapiResult_t . - * @param[in] service option ie the bearer type to be set - * - * @param[out] RequestId-Unique identifier for a particular request - * Its 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 - * @Interface Asynchronous. - * @remark - * @Refer tapi_sms_bearer_type - */ -EXPORT_API int tel_set_sms_preferred_bearer(struct tapi_handle *handle, TelSmsBearerType_t BearerType, tapi_response_cb callback, void* user_data) -{ - struct tapi_resp_data *evt_cb_data = NULL; - GVariant *param; - - dbg("Func Entrance "); - - if ((TAPI_NETTEXT_BEARER_PS_ONLY > BearerType) || (TAPI_NETTEXT_NO_PREFERRED_BEARER < BearerType)) { - err("Invalid Input -PrefBearer Set Nettext"); - return TAPI_API_INVALID_INPUT; - } - - MAKE_RESP_CB_DATA(evt_cb_data, handle, callback, user_data); - - param = g_variant_new("(i)", BearerType); - - g_dbus_connection_call(handle->dbus_connection, - DBUS_TELEPHONY_SERVICE , handle->path, DBUS_TELEPHONY_SMS_INTERFACE, - "SetPrefBearer", param, NULL, - G_DBUS_CALL_FLAGS_NONE, -1, handle->ca, - on_response_default, evt_cb_data); - - return TAPI_API_SUCCESS; -} - -/** - * - * This function enables the applications to set the deliver report for an incoming message(MT). - * - * @return Returns appropriate error code. Refer TapiResult_t . - * @param[in] pDataPackage - SMS-DELIVER-REPORT, and its length have to be passed in this structure. - * @param[in] RPCause - the result cause - * - * @param[out] RequestId-Unique identifier for a particular request - * Its 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 - * @Interface Synchronous. - * @remark - * @Refer tapi_sms_deliver_report - */ -EXPORT_API int tel_send_sms_deliver_report(struct tapi_handle *handle, - const TelSmsDatapackageInfo_t *pDataPackage, - TelSmsResponse_t RPCause, - tapi_response_cb callback, void* user_data) -{ - struct tapi_resp_data *evt_cb_data = NULL; - GVariant *param; - gchar *encoded_sca = NULL; - gchar *encoded_tpdu = NULL; - - dbg("Func Entrance "); - - TAPI_RET_ERR_NUM_IF_FAIL(pDataPackage ,TAPI_API_INVALID_PTR); - - MAKE_RESP_CB_DATA(evt_cb_data, handle, callback, user_data); - - encoded_sca = g_base64_encode(&(pDataPackage->Sca[0]), TAPI_SMS_ENCODED_SCA_LEN_MAX); - if (encoded_sca == NULL) { - dbg("g_base64_encode: Failed to Enocde the SCA"); - return TAPI_API_OPERATION_FAILED; - } - - encoded_tpdu = g_base64_encode(&(pDataPackage->szData[0]), TAPI_NETTEXT_SMDATA_SIZE_MAX + 1); - if (encoded_tpdu == NULL) { - dbg("g_base64_encode: Failed to Enocde the TPDU"); - return TAPI_API_OPERATION_FAILED; - } - - param = g_variant_new("(sisi)", encoded_sca, - pDataPackage->MsgLength, - encoded_tpdu, - RPCause); - - g_dbus_connection_call(handle->dbus_connection, - DBUS_TELEPHONY_SERVICE , handle->path, DBUS_TELEPHONY_SMS_INTERFACE, - "SetDeliveryReport", param, NULL, - G_DBUS_CALL_FLAGS_NONE, -1, handle->ca, - on_response_default, evt_cb_data); - - g_free(encoded_sca); - g_free(encoded_tpdu); - - return TAPI_API_SUCCESS; -} - -/** - * - * This function enables the application to set the status of a message - * - * @return Returns appropriate error code. Refer TapiResult_t . - * @param[in] index - the message to be changed - * msgStatus -SMS message status - * - * @param[out] RequestId-Unique identifier for a particular request - * Its 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 - * @Interface Asynchronous. - * @remark - * @Refer tapi_sms_memory_type,tapi_sms_status_type - */ -EXPORT_API int tel_set_sms_message_status(struct tapi_handle *handle, int index, TelSmsMsgStatus_t msgStatus, tapi_response_cb callback, void* user_data) -{ - struct tapi_resp_data *evt_cb_data = NULL; - GVariant *param; - - dbg("Func Entrance "); - - if ((index < 0) || (index > TAPI_NETTEXT_MAX_INDEX) || - (msgStatus > TAPI_NETTEXT_STATUS_RESERVED)) { - err("Invalid Input -MsgStatus Set Nettext"); - return TAPI_API_INVALID_INPUT; - } - - MAKE_RESP_CB_DATA(evt_cb_data, handle, callback, user_data); - - param = g_variant_new("(ii)", index, msgStatus); - - g_dbus_connection_call(handle->dbus_connection, - DBUS_TELEPHONY_SERVICE , handle->path, DBUS_TELEPHONY_SMS_INTERFACE, - "SetMsgStatus", param, NULL, - G_DBUS_CALL_FLAGS_NONE, -1, handle->ca, - on_response_default, evt_cb_data); - - return TAPI_API_SUCCESS; -} - -/** - * - * This function enables to application to get the sms parameters - * - * @return Returns appropriate error code. Refer TapiResult_t . - * @param[in] record index of the record in which the sms parameters are stored in the EFsmsp file - * - * @param[out] RequestId-Unique identifier for a particular request - * Its 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 - * @Interface ASynchronous. - * @remark Requested details come in response API - * @Refer - */ -EXPORT_API int tel_get_sms_parameters(struct tapi_handle *handle, int index, tapi_response_cb callback, void* user_data) -{ - struct tapi_resp_data *evt_cb_data = NULL; - GVariant *param; - - dbg("Func Entrance "); - - TAPI_RET_ERR_NUM_IF_FAIL(callback ,TAPI_API_INVALID_PTR); - - if ((index < 0) || (index > TAPI_NETTEXT_MAX_INDEX)) { - err("Invalid Input -SMS Param Get Nettext"); - return TAPI_API_INVALID_INPUT; - } - - MAKE_RESP_CB_DATA(evt_cb_data, handle, callback, user_data); - - param = g_variant_new("(i)", index); - - g_dbus_connection_call(handle->dbus_connection, - DBUS_TELEPHONY_SERVICE , handle->path, DBUS_TELEPHONY_SMS_INTERFACE, - "GetSmsParams", param, NULL, - G_DBUS_CALL_FLAGS_NONE, -1, handle->ca, - on_response_get_sms_params, evt_cb_data); - - return TAPI_API_SUCCESS; -} - -/** - * - * This function enables to application to get the sms parameters - * - * @return Returns appropriate error code. Refer TapiResult_t . - * @param[in] tapi_smsp_set_param_t sms parameters to be set in the EFsmsp file - * - * @param[out] RequestId-Unique identifier for a particular request - * Its 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 - * @Interface ASynchronous. - * @remark - * @Refer tapi_smsp_set_param_t - */ -EXPORT_API int tel_set_sms_parameters(struct tapi_handle *handle, const TelSmsParams_t *pSmsSetParameters, tapi_response_cb callback, void* user_data) -{ - struct tapi_resp_data *evt_cb_data = NULL; - GVariant *param; - gchar *encoded_alphaId = NULL; - gchar *encoded_destDialNum = NULL; - gchar *encoded_scaDialNum = NULL; - - dbg("Func Entrance "); - - TAPI_RET_ERR_NUM_IF_FAIL(pSmsSetParameters ,TAPI_API_INVALID_PTR); - - MAKE_RESP_CB_DATA(evt_cb_data, handle, callback, user_data); - - encoded_alphaId = g_base64_encode((guchar *)&(pSmsSetParameters->szAlphaId[0]), TAPI_SIM_SMSP_ALPHA_ID_LEN_MAX + 1); - if (encoded_alphaId == NULL) { - dbg("g_base64_encode: Failed to Enocde the AlphaId"); - return TAPI_API_OPERATION_FAILED; - } - - encoded_destDialNum = g_base64_encode(&(pSmsSetParameters->TpDestAddr.szDiallingNum[0]), TAPI_SIM_SMSP_ADDRESS_LEN + 1); - if (encoded_destDialNum == NULL) { - dbg("g_base64_encode: Failed to Enocde the DestAddr.DiallingNum"); - return TAPI_API_OPERATION_FAILED; - } - - encoded_scaDialNum = g_base64_encode(&(pSmsSetParameters->TpSvcCntrAddr.szDiallingNum[0]), TAPI_SIM_SMSP_ADDRESS_LEN + 1); - if (encoded_scaDialNum == NULL) { - dbg("g_base64_encode: Failed to Enocde the ScaAddr.DiallingNum"); - return TAPI_API_OPERATION_FAILED; - } - - param = g_variant_new("(iiisiiiisiiisiii)", pSmsSetParameters->RecordIndex, - pSmsSetParameters->RecordLen, - pSmsSetParameters->AlphaIdLen, - encoded_alphaId, - pSmsSetParameters->ParamIndicator, - pSmsSetParameters->TpDestAddr.DialNumLen, - pSmsSetParameters->TpDestAddr.Ton, - pSmsSetParameters->TpDestAddr.Npi, - encoded_destDialNum, - pSmsSetParameters->TpSvcCntrAddr.DialNumLen, - pSmsSetParameters->TpSvcCntrAddr.Ton, - pSmsSetParameters->TpSvcCntrAddr.Npi, - encoded_scaDialNum, - pSmsSetParameters->TpProtocolId, - pSmsSetParameters->TpDataCodingScheme, - pSmsSetParameters->TpValidityPeriod); - - g_dbus_connection_call(handle->dbus_connection, - DBUS_TELEPHONY_SERVICE , handle->path, DBUS_TELEPHONY_SMS_INTERFACE, - "SetSmsParams", param, NULL, - G_DBUS_CALL_FLAGS_NONE, -1, handle->ca, - on_response_default, evt_cb_data); - - g_free(encoded_alphaId); - g_free(encoded_destDialNum); - g_free(encoded_scaDialNum); - - return TAPI_API_SUCCESS; -} - -/** - * - * This function enables to application to get the sms parameter count from the EFsmsp file. - * - * @return Returns appropriate error code. Refer TapiResult_t . - * @param[in] None - * - * @param[out] RequestId-Unique identifier for a particular request - * Its 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 - * @Interface ASynchronous. - * @remark Requested details come in response API - * @Refer - */ -EXPORT_API int tel_get_sms_parameter_count(struct tapi_handle *handle, tapi_response_cb callback, void* user_data) -{ - struct tapi_resp_data *evt_cb_data = NULL; - - dbg("Func Entrance "); - - TAPI_RET_ERR_NUM_IF_FAIL(callback ,TAPI_API_INVALID_PTR); - - MAKE_RESP_CB_DATA(evt_cb_data, handle, callback, user_data); - - g_dbus_connection_call(handle->dbus_connection, - DBUS_TELEPHONY_SERVICE , handle->path, DBUS_TELEPHONY_SMS_INTERFACE, - "GetSmsParamCnt", NULL, NULL, - G_DBUS_CALL_FLAGS_NONE, -1, handle->ca, - on_response_get_sms_param_cnt, evt_cb_data); - - return TAPI_API_SUCCESS; -} - -#if 0 -/** - * - * This API is used to send an SMS message to the network. This API allows keeping - * the dedicated link at lower layers by passing information as more messages to send in parameters. - * This will enable not to release if a dedicated connection is used for transmission. - * - * @return TRUE in case of success and FALSE in case of error . - * @param[in] TelSmsMsgInfo_t - SMS_SUBMIT/ACK/CANCEL and its length have to be passed in this structure. - * - * unsigned int MoreMsgToSend will be set to TRUE when there are more than one message to be - * send or Multiple segmented concatenated message to be send, otherwise FALSE. This flag - * indicates OEM that more messages to send. - * - * @param[out] RequestId-Unique identifier for a particular request - * Its 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 - * - * @Interface Asynchronous. - * @remark - * @Refer TelSmsMsgInfo_t. - */ -EXPORT_API int tel_send_sms_msg(struct tapi_handle *handle, const TelSmsMsgInfo_t *pSmsMsgInfo, unsigned int MoreMsgToSend, tapi_response_cb callback, void* user_data) -{ - struct tapi_resp_data *evt_cb_data = NULL; - GVariant *param; - - dbg("Func Entrance "); - - MAKE_RESP_CB_DATA(evt_cb_data, handle, callback, user_data); - TS_BOOL ret = FALSE; - int api_err = TAPI_API_SUCCESS; - int emergency_mode = 0; - - if (vconf_get_int("db/telephony/emergency", &emergency_mode) != 0) { - TAPI_LIB_DEBUG(LEVEL_ERR, "[FAIL]GET db/telephony/emergency"); - return TAPI_API_OPERATION_FAILED; - } - if (emergency_mode) { - TAPI_LIB_DEBUG(LEVEL_DEBUG, "emergency mode on"); - return TAPI_API_OPERATION_FAILED; - } - - TAPI_RET_ERR_NUM_IF_FAIL(pSmsMsgInfo ,TAPI_API_INVALID_PTR); - - if (conn_name.length_of_name == 0) { - TAPI_LIB_DEBUG(LEVEL_ERR, "No dbus connection name"); - return TAPI_API_OPERATION_FAILED; - } - - TAPI_RET_ERR_NUM_IF_FAIL(tapi_check_dbus_status(), TAPI_API_SYSTEM_RPC_LINK_NOT_EST); - TAPI_GLIB_INIT_PARAMS(); - - TAPI_GLIB_ALLOC_PARAMS(in_param1,in_param2,in_param3,in_param4, - out_param1,out_param2,out_param3,out_param4); - - g_array_append_vals(in_param1, pSmsMsgInfo, sizeof(TelSmsMsgInfo_t)); - g_array_append_vals(in_param2, &MoreMsgToSend, sizeof(unsigned int)); - g_array_append_vals(in_param4, &conn_name, sizeof(tapi_dbus_connection_name)); - - ret = tapi_send_request(TAPI_CS_SERVICE_NETTEXT, TAPI_CS_NETTEXT_SEND_EX, in_param1, in_param2, in_param3, - in_param4, &out_param1, &out_param2, &out_param3, &out_param4); - - if (ret) { - api_err = g_array_index(out_param1, int, 0); - } - else { - api_err = TAPI_API_SYSTEM_RPC_LINK_DOWN; - } - - TAPI_GLIB_FREE_PARAMS(in_param1,in_param2,in_param3,in_param4, - out_param1,out_param2,out_param3,out_param4); - - return api_err; -} -#endif - -/** - * - * This function enables the applications to check the device status - * - * @return Returns appropriate error code. Refer TapiResult_t . - * @param[in] None - * - * - * @param[out] Device status whether Ready or Not Ready - * @Interface Synchronous. - * @remark - * @Refer - */ -EXPORT_API int tel_check_sms_device_status(struct tapi_handle *handle, int *pReadyStatus) -{ - GError *error; - GVariant *smsReady = NULL; - - dbg("Func Entrance "); - - TAPI_RET_ERR_NUM_IF_FAIL(handle, TAPI_API_INVALID_PTR); - TAPI_RET_ERR_NUM_IF_FAIL(pReadyStatus, TAPI_API_INVALID_PTR); - - memset(pReadyStatus, 0, sizeof(int)); - - error = NULL; - smsReady = g_dbus_connection_call_sync(handle->dbus_connection, DBUS_TELEPHONY_SERVICE , handle->path, - DBUS_TELEPHONY_SMS_INTERFACE, "GetSmsReadyStatus", NULL, NULL, G_DBUS_CALL_FLAGS_NONE, -1, NULL, &error); - - if(!smsReady){ - dbg( "error to get SMS ready_status(%s)", error->message); - g_error_free (error); - return TAPI_API_OPERATION_FAILED; - } - - dbg("get SMS ready_status type_format(%s)", g_variant_get_type_string(smsReady)); - - g_variant_get(smsReady, "(b)", pReadyStatus); - - dbg("************SMS_device_status (%d)", *pReadyStatus); - - return TAPI_API_SUCCESS; -} - -#if 0 -/** - * - * This function enables to application to set that the device is ready to recieve messages from network. - * - * @return Returns appropriate error code. Refer TapiResult_t . - * @param[in] None - * - * @param[out] None - * @Interface Synchronous. - * @remark - * @Refer - */ -EXPORT_API int tel_set_sms_device_status(struct tapi_handle *handle) -{ - struct tapi_resp_data *evt_cb_data = NULL; - GVariant *param; - - dbg("Func Entrance "); - - MAKE_RESP_CB_DATA(evt_cb_data, handle, callback, user_data); - - TS_BOOL ret = FALSE; - int api_err = TAPI_API_SUCCESS; - - TAPI_RET_ERR_NUM_IF_FAIL(tapi_check_dbus_status_internal(), TAPI_API_SYSTEM_RPC_LINK_NOT_EST); - TAPI_GLIB_INIT_PARAMS(); - TAPI_GLIB_ALLOC_PARAMS(in_param1, in_param2, in_param3, in_param4, out_param1, out_param2, out_param3, out_param4); - - ret = tapi_send_request_internal(TAPI_CS_SERVICE_NETTEXT, TAPI_CS_NETTEXT_DEVICEREADY, - in_param1, in_param2, in_param3, in_param4, - &out_param1, &out_param2, &out_param3, &out_param4); - - if (ret) { - api_err = g_array_index(out_param1, int, 0); - } - else { - api_err = TAPI_API_SYSTEM_RPC_LINK_DOWN; - } - - TAPI_GLIB_FREE_PARAMS(in_param1, in_param2, in_param3, in_param4, out_param1, out_param2, out_param3, out_param4); - - return api_err; -} -#endif -//eof diff --git a/mobile/src/tapi_ss.c b/mobile/src/tapi_ss.c deleted file mode 100644 index 3e9d174..0000000 --- a/mobile/src/tapi_ss.c +++ /dev/null @@ -1,676 +0,0 @@ -/* - * libslp-tapi - * - * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. - * - * Contact: Ja-young Gu - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT 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 "TapiUtility.h" -#include "TelSs.h" - -#include "common.h" -#include "tapi_log.h" -#include "ITapiSs.h" - -static void on_response_get_ss_barring_status(GObject *source_object, GAsyncResult *res, gpointer user_data) -{ - GError *error = 0; - GDBusConnection *conn = 0; - struct tapi_resp_data *evt_cb_data = user_data; - int result = -1, i = 0; - TelSsBarringResp_t resp; - - GVariant *dbus_result = 0, *value = 0; - GVariantIter *iter = 0; - GVariantIter *iter_row = 0; - const gchar *key = 0; - - memset(&resp, '\0', sizeof(TelSsBarringResp_t)); - - conn = G_DBUS_CONNECTION (source_object); - dbus_result = g_dbus_connection_call_finish(conn, res, &error); - CHECK_DEINIT(error); - - if (!dbus_result) { - if (evt_cb_data->cb_fn) { - evt_cb_data->cb_fn(evt_cb_data->handle, -1, NULL, evt_cb_data->user_data); - } - - if (error) - g_error_free(error); - - free(evt_cb_data); - return; - } - - g_variant_get (dbus_result, "(aa{sv}i)", &iter, &result); - - resp.record_num = g_variant_iter_n_children(iter); - - while ( g_variant_iter_next(iter, "a{sv}", &iter_row ) ) { - while ( g_variant_iter_loop( iter_row, "{sv}", &key, &value ) ) { - - if ( !g_strcmp0(key, "ss_class") ) { - resp.record[i].Class = g_variant_get_int32(value); - } - - if ( !g_strcmp0(key, "ss_status") ) { - resp.record[i].Status = g_variant_get_int32(value); - } - - if ( !g_strcmp0(key, "barring_mode") ) { - resp.record[i].Flavour = g_variant_get_int32(value); - } - - } - i++; - g_variant_iter_free(iter_row); - } - g_variant_iter_free(iter); - - if (evt_cb_data->cb_fn) { - evt_cb_data->cb_fn(evt_cb_data->handle, result, &resp, evt_cb_data->user_data); - } - - free(evt_cb_data); -} - -static void on_response_change_ss_barring_password(GObject *source_object, GAsyncResult *res, gpointer user_data) -{ - GError *error = 0; - GDBusConnection *conn = 0; - struct tapi_resp_data *evt_cb_data = user_data; - int result = -1; - - GVariant *dbus_result = 0; - - conn = G_DBUS_CONNECTION (source_object); - dbus_result = g_dbus_connection_call_finish(conn, res, &error); - CHECK_DEINIT(error); - - if (!dbus_result) { - if (evt_cb_data->cb_fn) { - evt_cb_data->cb_fn(evt_cb_data->handle, -1, NULL, evt_cb_data->user_data); - } - - if (error) - g_error_free(error); - - free(evt_cb_data); - return; - } - - g_variant_get (dbus_result, "(i)", &result); - - if (evt_cb_data->cb_fn) { - evt_cb_data->cb_fn(evt_cb_data->handle, result, NULL, evt_cb_data->user_data); - } - - free(evt_cb_data); -} - -static void on_response_get_ss_forward_status(GObject *source_object, GAsyncResult *res, gpointer user_data) -{ - GError *error = 0; - GDBusConnection *conn = 0; - struct tapi_resp_data *evt_cb_data = user_data; - int result = -1, i = 0; - TelSsForwardResp_t resp; - - GVariant *dbus_result = 0, *value = 0; - GVariantIter *iter = 0; - GVariantIter *iter_row = 0; - const gchar *key = 0; - - - memset(&resp, '\0', sizeof(TelSsForwardResp_t)); - - conn = G_DBUS_CONNECTION (source_object); - dbus_result = g_dbus_connection_call_finish(conn, res, &error); - CHECK_DEINIT(error); - - if (!dbus_result) { - if (evt_cb_data->cb_fn) { - evt_cb_data->cb_fn(evt_cb_data->handle, -1, NULL, evt_cb_data->user_data); - } - - if (error) - g_error_free(error); - - free(evt_cb_data); - return; - } - - g_variant_get (dbus_result, "(aa{sv}i)", &iter, &result); - - resp.record_num = g_variant_iter_n_children(iter); - - while ( g_variant_iter_next(iter, "a{sv}", &iter_row ) ) { - while ( g_variant_iter_loop( iter_row, "{sv}", &key, &value ) ) { - - if ( !g_strcmp0(key, "ss_class") ) { - resp.record[i].Class = g_variant_get_int32(value); - } - - if ( !g_strcmp0(key, "ss_status") ) { - resp.record[i].Status = g_variant_get_int32(value); - } - - if ( !g_strcmp0(key, "forwarding_mode") ) { - resp.record[i].ForwardCondition = g_variant_get_int32(value); - } - - if ( !g_strcmp0(key, "no_reply_time") ) { - resp.record[i].NoReplyWaitTime = g_variant_get_int32(value); - } - - if ( !g_strcmp0(key, "number_present") ) { - resp.record[i].bCallForwardingNumberPresent = g_variant_get_int32(value); - } - - if ( !g_strcmp0(key, "forwarding_number") ) { - strncpy((char *)resp.record[i].szCallForwardingNumber, g_variant_get_string(value, 0), TAPI_CALL_DIALDIGIT_LEN_MAX ); - } - - } - i++; - g_variant_iter_free(iter_row); - } - g_variant_iter_free(iter); - - if (evt_cb_data->cb_fn) { - evt_cb_data->cb_fn(evt_cb_data->handle, result, &resp, evt_cb_data->user_data); - } - - free(evt_cb_data); -} - -static void on_response_get_ss_waiting_status(GObject *source_object, GAsyncResult *res, gpointer user_data) -{ - GError *error = 0; - GDBusConnection *conn = 0; - struct tapi_resp_data *evt_cb_data = user_data; - int result = -1, i = 0; - TelSsWaitingResp_t resp; - - GVariant *dbus_result = 0, *value = 0; - GVariantIter *iter = 0; - GVariantIter *iter_row = 0; - const gchar *key = 0; - - - memset(&resp, '\0', sizeof(TelSsWaitingResp_t)); - - conn = G_DBUS_CONNECTION (source_object); - dbus_result = g_dbus_connection_call_finish(conn, res, &error); - CHECK_DEINIT(error); - - if (!dbus_result) { - if (evt_cb_data->cb_fn) { - evt_cb_data->cb_fn(evt_cb_data->handle, -1, NULL, evt_cb_data->user_data); - } - - if (error) - g_error_free(error); - - free(evt_cb_data); - return; - } - - g_variant_get (dbus_result, "(aa{sv}i)", &iter, &result); - - resp.record_num = g_variant_iter_n_children(iter); - - while ( g_variant_iter_next(iter, "a{sv}", &iter_row ) ) { - while ( g_variant_iter_loop( iter_row, "{sv}", &key, &value ) ) { - - if ( !g_strcmp0(key, "ss_class") ) { - resp.record[i].Class = g_variant_get_int32(value); - } - - if ( !g_strcmp0(key, "ss_status") ) { - resp.record[i].Status = g_variant_get_int32(value); - } - } - i++; - g_variant_iter_free(iter_row); - } - g_variant_iter_free(iter); - - if (evt_cb_data->cb_fn) { - evt_cb_data->cb_fn(evt_cb_data->handle, result, &resp, evt_cb_data->user_data); - } - - free(evt_cb_data); -} - - -static void on_response_get_ss_cli_status(GObject *source_object, GAsyncResult *res, gpointer user_data) -{ - GError *error = 0; - GDBusConnection *conn = 0; - struct tapi_resp_data *evt_cb_data = user_data; - int result = -1; - TelSsCliResp_t resp; - - GVariant *dbus_result = 0; - - memset(&resp, '\0', sizeof(TelSsCliResp_t)); - - conn = G_DBUS_CONNECTION (source_object); - dbus_result = g_dbus_connection_call_finish(conn, res, &error); - CHECK_DEINIT(error); - - if (!dbus_result) { - if (evt_cb_data->cb_fn) { - evt_cb_data->cb_fn(evt_cb_data->handle, -1, NULL, evt_cb_data->user_data); - } - - if (error) - g_error_free(error); - - free(evt_cb_data); - return; - } - - g_variant_get (dbus_result, "(iii)", &result, &resp.Type, &resp.Status); - - if (evt_cb_data->cb_fn) { - evt_cb_data->cb_fn(evt_cb_data->handle, result, &resp, evt_cb_data->user_data); - } - - free(evt_cb_data); -} - -static void on_response_send_ss_ussd_request(GObject *source_object, GAsyncResult *res, gpointer user_data) -{ - GError *error = 0; - GDBusConnection *conn = 0; - struct tapi_resp_data *evt_cb_data = user_data; - int result = -1; - char *tmp_str = 0; - TelSsUssdResp_t resp; - - GVariant *dbus_result = 0; - - memset(&resp, '\0', sizeof(TelSsUssdResp_t)); - - conn = G_DBUS_CONNECTION (source_object); - dbus_result = g_dbus_connection_call_finish(conn, res, &error); - CHECK_DEINIT(error); - - if (!dbus_result) { - if (evt_cb_data->cb_fn) { - evt_cb_data->cb_fn(evt_cb_data->handle, -1, NULL, evt_cb_data->user_data); - } - - if (error) - g_error_free(error); - - free(evt_cb_data); - return; - } - - g_variant_get (dbus_result, "(iiiis)", &result, &resp.Type, &resp.Status, &resp.Length, &tmp_str); - - if (!result) { - memcpy( resp.szString, tmp_str, resp.Length ); - g_free(tmp_str); - } - - if (evt_cb_data->cb_fn) { - evt_cb_data->cb_fn(evt_cb_data->handle, result, &resp, evt_cb_data->user_data); - } - - free(evt_cb_data); -} - -EXPORT_API int tel_set_ss_barring(TapiHandle *handle, TelSsBarringInfo_t *info, tapi_response_cb callback, void *user_data) -{ - struct tapi_resp_data *evt_cb_data = 0; - GVariant *param = 0; - gchar *method = 0; - - dbg("Func Entrance "); - - MAKE_RESP_CB_DATA(evt_cb_data, handle, callback, user_data); - - param = g_variant_new("(iis)", info->Class, info->Type, info->szPassword); - - if ( info->Mode == TAPI_SS_CB_MODE_ACTIVATE ) { - dbg("[ check ] barring activate"); - method = "ActivateBarring"; - - } else { - dbg("[ check ] barring deactivate"); - method = "DeactivateBarring"; - - } - - g_dbus_connection_call(handle->dbus_connection, - DBUS_TELEPHONY_SERVICE, handle->path, DBUS_TELEPHONY_SS_INTERFACE, - method, param, 0, - G_DBUS_CALL_FLAGS_NONE, -1, handle->ca, - on_response_get_ss_barring_status, evt_cb_data ); - - return TAPI_API_SUCCESS; -} - -EXPORT_API int tel_get_ss_barring_status(TapiHandle *handle, TelSsClass_t class, TelSsBarringType_t type, tapi_response_cb callback, void *user_data) -{ - struct tapi_resp_data *evt_cb_data = 0; - GVariant *param = 0; - - dbg("Func Entrance "); - - MAKE_RESP_CB_DATA(evt_cb_data, handle, callback, user_data); - - param = g_variant_new("(ii)", class, type); - - g_dbus_connection_call(handle->dbus_connection, - DBUS_TELEPHONY_SERVICE, handle->path, DBUS_TELEPHONY_SS_INTERFACE, - "GetBarringStatus", param, 0, - G_DBUS_CALL_FLAGS_NONE, -1, handle->ca, - on_response_get_ss_barring_status, evt_cb_data ); - - return TAPI_API_SUCCESS; -} - -/********************************************************************************************** - * - * This function is used to change call barring password. - * - * @param pOldPassword[IN] of type char* Specifies the Old Call Barring Password. - * @param pNewPassword[IN] of type char* Specifies the New Call Barring Password. - * @param pNewPasswordAgain[IN] of type char* Specifies the New Call Barring Password for Confirm. - * @return enum type TapiResult_t Specifies the API's Return result. - * @remark - * - ***********************************************************************************************/ -EXPORT_API int tel_change_ss_barring_password(TapiHandle *handle, - const char *old_password, - const char *new_password, - const char *new_password_again, - tapi_response_cb callback, void *user_data) -{ - struct tapi_resp_data *evt_cb_data = 0; - GVariant *param = 0; - - dbg("Func Entrance "); - - MAKE_RESP_CB_DATA(evt_cb_data, handle, callback, user_data); - - param = g_variant_new("(sss)", old_password, new_password, new_password_again); - - g_dbus_connection_call(handle->dbus_connection, - DBUS_TELEPHONY_SERVICE, handle->path, DBUS_TELEPHONY_SS_INTERFACE, - "ChangeBarringPassword", param, 0, - G_DBUS_CALL_FLAGS_NONE, -1, handle->ca, - on_response_change_ss_barring_password, evt_cb_data ); - - return TAPI_API_SUCCESS; -} - -/********************************************************************************************** - * - * This function is used to Activate or Deactivate the call forwarding feature. - * - * @param forwardInfo[IN] of type TelSsForwardInfo_t which specifies the Teleservice and CF flavour, Forwarded to number. - * @return enum type TapiResult_t Specifies the API's Return result. - * @remark - * - ***********************************************************************************************/ -EXPORT_API int tel_set_ss_forward(TapiHandle *handle, const TelSsForwardInfo_t *info, tapi_response_cb callback, void *user_data) -{ - struct tapi_resp_data *evt_cb_data = 0; - GVariant *param = 0; - gchar *method = 0; - - dbg("Func Entrance "); - - MAKE_RESP_CB_DATA(evt_cb_data, handle, callback, user_data); - - param = g_variant_new("(iiis)", info->Class, info->Condition, info->NoReplyConditionTimer, info->szPhoneNumber); - - switch ( info->Mode ) { - case TAPI_SS_CF_MODE_DISABLE_EV: { - dbg("[ check ] forwarding deactivate"); - method = "DeactivateForwarding"; - } break; - - case TAPI_SS_CF_MODE_ENABLE_EV: { - dbg("[ check ] forwarding activate"); - method = "ActivateForwarding"; - } break; - - case TAPI_SS_CF_MODE_REGISTRATION_EV: { - dbg("[ check ] forwarding registration"); - method = "RegisterForwarding"; - } break; - - case TAPI_SS_CF_MODE_ERASURE_EV: { - dbg("[ check ] forwarding deregistration"); - method = "DeregisterForwarding"; - } break; - - default: - dbg("[ error ] invalid input : (0x%x)", info->Mode); - return TAPI_API_INVALID_INPUT; - } - - g_dbus_connection_call(handle->dbus_connection, - DBUS_TELEPHONY_SERVICE, handle->path, DBUS_TELEPHONY_SS_INTERFACE, - method, param, 0, - G_DBUS_CALL_FLAGS_NONE, -1, handle->ca, - on_response_get_ss_forward_status, evt_cb_data ); - - return TAPI_API_SUCCESS; -} - -/********************************************************************************************** - * - * This function is used to interrogate the status of call forwarding feature. - * - * @param forwardType[IN] of type TelSsForwardType_t which specifies the telecommunication service. - * @param condition[IN] is of type TelSsForwardWhen_t specified the CF flavour - * @return enum type TapiResult_t Specifies the API's Return result. - * @remark - * - ***********************************************************************************************/ -EXPORT_API int tel_get_ss_forward_status(TapiHandle *handle, TelSsClass_t class, TelSsForwardWhen_t condition, tapi_response_cb callback, void *user_data) -{ - struct tapi_resp_data *evt_cb_data = 0; - GVariant *param = 0; - - dbg("Func Entrance "); - - MAKE_RESP_CB_DATA(evt_cb_data, handle, callback, user_data); - - param = g_variant_new("(ii)", class, condition); - - g_dbus_connection_call(handle->dbus_connection, - DBUS_TELEPHONY_SERVICE, handle->path, DBUS_TELEPHONY_SS_INTERFACE, - "GetForwardingStatus", param, 0, - G_DBUS_CALL_FLAGS_NONE, -1, handle->ca, - on_response_get_ss_forward_status, evt_cb_data ); - - return TAPI_API_SUCCESS; -} - -/********************************************************************************************** - * - * This function is used to Activate or dectivate call waiting feature. - * - * @param waitInfo[IN] of type TelSsWaitingInfo_t which specifies the telecommunication service and mode. - * @return enum type TapiResult_t Specifies the API's Return result. - * @remark - * - ***********************************************************************************************/ -EXPORT_API int tel_set_ss_waiting(TapiHandle *handle, const TelSsWaitingInfo_t *info, tapi_response_cb callback, void *user_data) -{ - struct tapi_resp_data *evt_cb_data = 0; - GVariant *param = 0; - gchar *method = 0; - - dbg("Func Entrance "); - - MAKE_RESP_CB_DATA(evt_cb_data, handle, callback, user_data); - - param = g_variant_new("(i)", info->Class); - - if ( info->Mode == TAPI_SS_CW_MODE_ACTIVATE ) { - dbg("[ check ] waiting activate"); - method = "ActivateWaiting"; - - } else { - dbg("[ check ] waiting deactivate"); - method = "DeactivateWaiting"; - - } - - g_dbus_connection_call(handle->dbus_connection, - DBUS_TELEPHONY_SERVICE, handle->path, DBUS_TELEPHONY_SS_INTERFACE, - method, param, 0, - G_DBUS_CALL_FLAGS_NONE, -1, handle->ca, - on_response_get_ss_waiting_status, evt_cb_data ); - - return TAPI_API_SUCCESS; -} - -/********************************************************************************************** - * - * This function is used to interrogate the status of call waiting feature. - * - * @param CallType[IN] of type TelSsCallType_t which specifies the telecommunication service . - * @return enum type TapiResult_t Specifies the API's Return result. - * @remark - * - ***********************************************************************************************/ - -EXPORT_API int tel_get_ss_waiting_status(TapiHandle *handle, const TelSsClass_t class, tapi_response_cb callback, void *user_data) -{ - struct tapi_resp_data *evt_cb_data = 0; - GVariant *param = 0; - - dbg("Func Entrance "); - - MAKE_RESP_CB_DATA(evt_cb_data, handle, callback, user_data); - - param = g_variant_new("(i)", class); - - g_dbus_connection_call(handle->dbus_connection, - DBUS_TELEPHONY_SERVICE, handle->path, DBUS_TELEPHONY_SS_INTERFACE, - "GetWaitingStatus", param, 0, - G_DBUS_CALL_FLAGS_NONE, -1, handle->ca, - on_response_get_ss_waiting_status, evt_cb_data ); - - return TAPI_API_SUCCESS; -} - -/********************************************************************************************** - * - * This function is used to interrogate the status of CLI services feature. - * - * @param CliType[IN] of type TelSsCliType_t which specifies the CLI service . - * @return enum type TapiResult_t Specifies the API's Return result. - * @remark - * - ***********************************************************************************************/ -EXPORT_API int tel_get_ss_cli_status(TapiHandle *handle, TelSsCliType_t type, tapi_response_cb callback, void *user_data) -{ - struct tapi_resp_data *evt_cb_data = 0; - GVariant *param = 0; - - dbg("Func Entrance "); - - MAKE_RESP_CB_DATA(evt_cb_data, handle, callback, user_data); - - param = g_variant_new("(i)", type); - - g_dbus_connection_call(handle->dbus_connection, - DBUS_TELEPHONY_SERVICE, handle->path, DBUS_TELEPHONY_SS_INTERFACE, - "GetCLIStatus", param, 0, - G_DBUS_CALL_FLAGS_NONE, -1, handle->ca, - on_response_get_ss_cli_status, evt_cb_data ); - - return TAPI_API_SUCCESS; -} - -/********************************************************************************************** - * - * This function is used to send a USSD string and also the User response for a NW intiated USSD. - * - * @param pAppMsg[IN] of type TelSsUssdMsgInfo_t which specifies the USSD String,length of the string, format of the string. - * @return enum type TapiResult_t Specifies the API's Return result. - * @remark TelSsUssdMsgInfo_t ->IndType is not used while calling this function, This is used for sending the response. - * Limo standard defines only one structure for Request and response. - * - ***********************************************************************************************/ -EXPORT_API int tel_send_ss_ussd_request(TapiHandle *handle, const TelSsUssdMsgInfo_t *info, tapi_response_cb callback, void *user_data) -{ - struct tapi_resp_data *evt_cb_data = 0; - GVariant *param = 0; - - dbg("Func Entrance "); - - MAKE_RESP_CB_DATA(evt_cb_data, handle, callback, user_data); - - param = g_variant_new("(iis)", info->Type, info->Length, info->szString); - - g_dbus_connection_call(handle->dbus_connection, - DBUS_TELEPHONY_SERVICE, handle->path, DBUS_TELEPHONY_SS_INTERFACE, - "SendUSSD", param, 0, - G_DBUS_CALL_FLAGS_NONE, -1, handle->ca, - on_response_send_ss_ussd_request, evt_cb_data ); - - return TAPI_API_SUCCESS; -} - -/********************************************************************************************** - * - * This function is used to Sets AOC information. - * - * @param AocType[IN] of type TelSsAocType_t which specifies the which AOC type to read. - * @return enum type TapiResult_t Specifies the API's Return result. - * @remark - * - ***********************************************************************************************/ -EXPORT_API int tel_get_ss_aoc_info(TapiHandle *handle, TelSsAocType_t AocType, tapi_response_cb callback, void *user_data) -{ - return 0; -} - -/********************************************************************************************** - * - * This function is used to Sets AOC information. - * - * @param AocSetInfo[IN] of type TelCallAocInfo_t which specifies the AOC info parameters . - * @return enum type TapiResult_t Specifies the API's Return result. - * @remark - * - ***********************************************************************************************/ -EXPORT_API int tel_set_ss_aoc_info(TapiHandle *handle, TelCallAocInfo_t *AocSetInfo, tapi_response_cb callback, void *user_data) -{ - return 0; -} - -/* EOF */ diff --git a/mobile/tapi.pc.in b/mobile/tapi.pc.in deleted file mode 100644 index e580a0f..0000000 --- a/mobile/tapi.pc.in +++ /dev/null @@ -1,11 +0,0 @@ -prefix=@PREFIX@ -exec_prefix=${prefix} -libdir=@LIB_INSTALL_DIR@ -includedir=${prefix}/include - -Name: TAPI Library -Description: Telephony DBUS Client -Requires: glib-2.0 gobject-2.0 -Version: 0.1 -Libs: -L${libdir} -lSLP-tapi -Cflags: -I${includedir}/telephony-client diff --git a/packaging/libslp-tapi.spec b/packaging/libslp-tapi.spec index efa0df8..aba4885 100644 --- a/packaging/libslp-tapi.spec +++ b/packaging/libslp-tapi.spec @@ -1,10 +1,10 @@ %define major 0 -%define minor 6 -%define patchlevel 70 +%define minor 7 +%define patchlevel 78 Name: libslp-tapi Version: %{major}.%{minor}.%{patchlevel} -Release: 2 +Release: 3 License: Apache Summary: Telephony dbus client library Group: System/Libraries @@ -12,9 +12,6 @@ Source0: libslp-tapi-%{version}.tar.gz BuildRequires: cmake BuildRequires: pkgconfig(dlog) BuildRequires: pkgconfig(glib-2.0) -%if %{_repository}=="mobile" -BuildRequires: pkgconfig(gobject-2.0) -%endif BuildRequires: pkgconfig(security-server) Requires(post): /sbin/ldconfig Requires(postun): /sbin/ldconfig @@ -34,46 +31,27 @@ Telephony client API library (devel) %setup -q %build -%if %{_repository}=="mobile" -cd mobile -%cmake . -make %{?jobs:-j%jobs} -%elseif %{_repository}=="wearable" export LDFLAGS+=" -Wl,-z,nodelete " -%if 0%{?tizen_build_binary_release_type_eng} export CFLAGS="$CFLAGS -DTIZEN_ENGINEER_MODE" export CXXFLAGS="$CXXFLAGS -DTIZEN_ENGINEER_MODE" export FFLAGS="$FFLAGS -DTIZEN_ENGINEER_MODE" -%endif -%if 0%{?sec_build_binary_debug_enable} + export CFLAGS="$CFLAGS -DTIZEN_DEBUG_ENABLE" export CXXFLAGS="$CXXFLAGS -DTIZEN_DEBUG_ENABLE" export FFLAGS="$FFLAGS -DTIZEN_DEBUG_ENABLE" -%endif -cd wearable + + cmake . -DCMAKE_INSTALL_PREFIX=%{_prefix} \ -%if 0%{?tizen_build_binary_release_type_eng} -DTIZEN_ENGINEER_MODE=1 \ -%endif make %{?_smp_mflags} -%endif %install -rm -rf %{buildroot} -%if %{_repository}=="wearable" -cd wearable -%elseif %{_repository}=="mobile" -cd mobile -%endif %make_install rm -rf %{buildroot}%{_includedir}/telephony/tapi/.gitignore mkdir -p %{buildroot}%{_datadir}/license -%if %{_repository}=="mobile" -cp LICENSE %{buildroot}/usr/share/license/%{name} -%endif %post -p /sbin/ldconfig @@ -81,21 +59,12 @@ cp LICENSE %{buildroot}/usr/share/license/%{name} %files -%if %{_repository}=="wearable" -%manifest wearable/libslp-tapi.manifest -%elseif %{_repository}=="mobile" -%manifest mobile/libslp-tapi.manifest -%endif +%manifest libslp-tapi.manifest %defattr(-,root,root,-) +#%doc COPYING %{_libdir}/*.so.* -%if %{_repository}=="wearable" -%if 0%{?tizen_build_binary_release_type_eng} %{_bindir}/tapitest -%endif %{_datadir}/license/libslp-tapi -%elseif %{_repository}=="mobile" -/usr/share/license/%{name} -%endif %files devel %defattr(-,root,root,-) diff --git a/wearable/src/common.h b/src/common.h similarity index 67% rename from wearable/src/common.h rename to src/common.h index 2ed2033..d105a77 100644 --- a/wearable/src/common.h +++ b/src/common.h @@ -1,7 +1,7 @@ /* * libslp-tapi * - * Copyright (c) 2012 Samsung Electronics Co., Ltd. All rights reserved. + * Copyright (c) 2014 Samsung Electronics Co., Ltd. All rights reserved. * * Contact: Ja-young Gu * @@ -27,6 +27,7 @@ __BEGIN_DECLS +#define TAPI_SHORT_TIMEOUT (5 * 1000) /* Unlimit: G_MAXINT */ #define TAPI_DEFAULT_TIMEOUT (60 * 1000) /* Unlimit: G_MAXINT */ #define TAPI_UNRESTRICTED_TIMEOUT (180 * 1000) @@ -37,14 +38,27 @@ __BEGIN_DECLS data->cb_fn = cb; \ data->user_data = user_data -#define CHECK_DEINIT(error) \ +#define CHECK_ERROR(error) \ if (error) { \ warn("dbus error = %d (%s)", error->code, error->message); \ - if (error->code == G_IO_ERROR_CANCELLED) { \ - g_error_free(error); \ - g_free(evt_cb_data); \ - return; \ + if (error->code == G_IO_ERROR_CANCELLED \ + && error->domain == G_IO_ERROR) { \ + /* Do not invoke callback in case of deinit TapiHandle */ \ + } else if (strstr(error->message, "No access rights")) { \ + err("Access denied"); \ + if (evt_cb_data->cb_fn) \ + evt_cb_data->cb_fn(evt_cb_data->handle, TAPI_ERROR_ACCESS_DENIED, NULL, evt_cb_data->user_data); \ + } else if (strstr(error->message, "Operation not supported")) { \ + err("Operation not supported"); \ + if (evt_cb_data->cb_fn) \ + evt_cb_data->cb_fn(evt_cb_data->handle, TAPI_ERROR_OPERATION_NOT_SUPPORTED, NULL, evt_cb_data->user_data); \ + } else { \ + if (evt_cb_data->cb_fn) \ + evt_cb_data->cb_fn(evt_cb_data->handle, TAPI_ERROR_OPERATION_FAILED, NULL, evt_cb_data->user_data); \ } \ + g_error_free(error); \ + g_free(evt_cb_data); \ + return; \ } #define CALLBACK_CALL(data) \ diff --git a/wearable/src/tapi_call.c b/src/tapi_call.c similarity index 73% rename from wearable/src/tapi_call.c rename to src/tapi_call.c index 3a3fec0..9ff8f9b 100644 --- a/wearable/src/tapi_call.c +++ b/src/tapi_call.c @@ -1,7 +1,7 @@ /* * libslp-tapi * - * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * Copyright (c) 2014 Samsung Electronics Co., Ltd. All rights reserved. * * Contact: Ja-young Gu * @@ -41,18 +41,7 @@ static void on_response_call_dial(GObject *source_object, GAsyncResult *res, gpo conn = G_DBUS_CONNECTION (source_object); dbus_result = g_dbus_connection_call_finish(conn, res, &error); - CHECK_DEINIT(error); - - if (!dbus_result) { - if (evt_cb_data->cb_fn) - evt_cb_data->cb_fn(evt_cb_data->handle, -1, NULL, evt_cb_data->user_data); - - if (error) - g_error_free(error); - - g_free(evt_cb_data); - return; - } + CHECK_ERROR(error); g_variant_get (dbus_result, "(i)", &result); @@ -60,6 +49,7 @@ static void on_response_call_dial(GObject *source_object, GAsyncResult *res, gpo evt_cb_data->cb_fn(evt_cb_data->handle, result, 0, evt_cb_data->user_data); g_free(evt_cb_data); + g_variant_unref(dbus_result); } static void on_response_call_answer(GObject *source_object, GAsyncResult *res, gpointer user_data) @@ -74,18 +64,7 @@ static void on_response_call_answer(GObject *source_object, GAsyncResult *res, g conn = G_DBUS_CONNECTION (source_object); dbus_result = g_dbus_connection_call_finish(conn, res, &error); - CHECK_DEINIT(error); - - if (!dbus_result) { - if (evt_cb_data->cb_fn) - evt_cb_data->cb_fn(evt_cb_data->handle, -1, NULL, evt_cb_data->user_data); - - if (error) - g_error_free(error); - - g_free(evt_cb_data); - return; - } + CHECK_ERROR(error); g_variant_get (dbus_result, "(ii)", &result, &data.id); @@ -93,6 +72,7 @@ static void on_response_call_answer(GObject *source_object, GAsyncResult *res, g evt_cb_data->cb_fn(evt_cb_data->handle, result, &data, evt_cb_data->user_data); g_free(evt_cb_data); + g_variant_unref(dbus_result); } static void on_response_call_end(GObject *source_object, GAsyncResult *res, gpointer user_data) @@ -107,18 +87,7 @@ static void on_response_call_end(GObject *source_object, GAsyncResult *res, gpoi conn = G_DBUS_CONNECTION (source_object); dbus_result = g_dbus_connection_call_finish(conn, res, &error); - CHECK_DEINIT(error); - - if (!dbus_result) { - if (evt_cb_data->cb_fn) - evt_cb_data->cb_fn(evt_cb_data->handle, -1, NULL, evt_cb_data->user_data); - - if (error) - g_error_free(error); - - g_free(evt_cb_data); - return; - } + CHECK_ERROR(error); g_variant_get (dbus_result, "(iii)", &result, &data.id, &data.type); @@ -126,6 +95,7 @@ static void on_response_call_end(GObject *source_object, GAsyncResult *res, gpoi evt_cb_data->cb_fn(evt_cb_data->handle, result, &data, evt_cb_data->user_data); g_free(evt_cb_data); + g_variant_unref(dbus_result); } static void on_response_call_hold(GObject *source_object, GAsyncResult *res, gpointer user_data) @@ -140,18 +110,7 @@ static void on_response_call_hold(GObject *source_object, GAsyncResult *res, gpo conn = G_DBUS_CONNECTION (source_object); dbus_result = g_dbus_connection_call_finish(conn, res, &error); - CHECK_DEINIT(error); - - if (!dbus_result) { - if (evt_cb_data->cb_fn) - evt_cb_data->cb_fn(evt_cb_data->handle, -1, NULL, evt_cb_data->user_data); - - if (error) - g_error_free(error); - - g_free(evt_cb_data); - return; - } + CHECK_ERROR(error); g_variant_get (dbus_result, "(ii)", &result, &data.id); @@ -159,6 +118,7 @@ static void on_response_call_hold(GObject *source_object, GAsyncResult *res, gpo evt_cb_data->cb_fn(evt_cb_data->handle, result, &data, evt_cb_data->user_data); g_free(evt_cb_data); + g_variant_unref(dbus_result); } static void on_response_call_active(GObject *source_object, GAsyncResult *res, gpointer user_data) @@ -173,18 +133,7 @@ static void on_response_call_active(GObject *source_object, GAsyncResult *res, g conn = G_DBUS_CONNECTION (source_object); dbus_result = g_dbus_connection_call_finish(conn, res, &error); - CHECK_DEINIT(error); - - if (!dbus_result) { - if (evt_cb_data->cb_fn) - evt_cb_data->cb_fn(evt_cb_data->handle, -1, NULL, evt_cb_data->user_data); - - if (error) - g_error_free(error); - - g_free(evt_cb_data); - return; - } + CHECK_ERROR(error); g_variant_get (dbus_result, "(ii)", &result, &data.id); @@ -192,6 +141,7 @@ static void on_response_call_active(GObject *source_object, GAsyncResult *res, g evt_cb_data->cb_fn(evt_cb_data->handle, result, &data, evt_cb_data->user_data); g_free(evt_cb_data); + g_variant_unref(dbus_result); } static void on_response_call_swap(GObject *source_object, GAsyncResult *res, gpointer user_data) @@ -206,18 +156,7 @@ static void on_response_call_swap(GObject *source_object, GAsyncResult *res, gpo conn = G_DBUS_CONNECTION (source_object); dbus_result = g_dbus_connection_call_finish(conn, res, &error); - CHECK_DEINIT(error); - - if (!dbus_result) { - if (evt_cb_data->cb_fn) - evt_cb_data->cb_fn(evt_cb_data->handle, -1, NULL, evt_cb_data->user_data); - - if (error) - g_error_free(error); - - g_free(evt_cb_data); - return; - } + CHECK_ERROR(error); g_variant_get (dbus_result, "(ii)", &result, &data.id); @@ -225,6 +164,7 @@ static void on_response_call_swap(GObject *source_object, GAsyncResult *res, gpo evt_cb_data->cb_fn(evt_cb_data->handle, result, &data, evt_cb_data->user_data); g_free(evt_cb_data); + g_variant_unref(dbus_result); } static void on_response_call_join(GObject *source_object, GAsyncResult *res, gpointer user_data) @@ -239,18 +179,7 @@ static void on_response_call_join(GObject *source_object, GAsyncResult *res, gpo conn = G_DBUS_CONNECTION (source_object); dbus_result = g_dbus_connection_call_finish(conn, res, &error); - CHECK_DEINIT(error); - - if (!dbus_result) { - if (evt_cb_data->cb_fn) - evt_cb_data->cb_fn(evt_cb_data->handle, -1, NULL, evt_cb_data->user_data); - - if (error) - g_error_free(error); - - g_free(evt_cb_data); - return; - } + CHECK_ERROR(error); g_variant_get (dbus_result, "(ii)", &result, &data.id); @@ -258,6 +187,7 @@ static void on_response_call_join(GObject *source_object, GAsyncResult *res, gpo evt_cb_data->cb_fn(evt_cb_data->handle, result, &data, evt_cb_data->user_data); g_free(evt_cb_data); + g_variant_unref(dbus_result); } static void on_response_call_split(GObject *source_object, GAsyncResult *res, gpointer user_data) @@ -272,18 +202,7 @@ static void on_response_call_split(GObject *source_object, GAsyncResult *res, gp conn = G_DBUS_CONNECTION (source_object); dbus_result = g_dbus_connection_call_finish(conn, res, &error); - CHECK_DEINIT(error); - - if (!dbus_result) { - if (evt_cb_data->cb_fn) - evt_cb_data->cb_fn(evt_cb_data->handle, -1, NULL, evt_cb_data->user_data); - - if (error) - g_error_free(error); - - g_free(evt_cb_data); - return; - } + CHECK_ERROR(error); g_variant_get (dbus_result, "(ii)", &result, &data.id); @@ -291,6 +210,7 @@ static void on_response_call_split(GObject *source_object, GAsyncResult *res, gp evt_cb_data->cb_fn(evt_cb_data->handle, result, &data, evt_cb_data->user_data); g_free(evt_cb_data); + g_variant_unref(dbus_result); } static void on_response_call_transfer(GObject *source_object, GAsyncResult *res, gpointer user_data) @@ -305,18 +225,7 @@ static void on_response_call_transfer(GObject *source_object, GAsyncResult *res, conn = G_DBUS_CONNECTION (source_object); dbus_result = g_dbus_connection_call_finish(conn, res, &error); - CHECK_DEINIT(error); - - if (!dbus_result) { - if (evt_cb_data->cb_fn) - evt_cb_data->cb_fn(evt_cb_data->handle, -1, NULL, evt_cb_data->user_data); - - if (error) - g_error_free(error); - - g_free(evt_cb_data); - return; - } + CHECK_ERROR(error); g_variant_get (dbus_result, "(ii)", &result, &data.id); @@ -324,6 +233,7 @@ static void on_response_call_transfer(GObject *source_object, GAsyncResult *res, evt_cb_data->cb_fn(evt_cb_data->handle, result, &data, evt_cb_data->user_data); g_free(evt_cb_data); + g_variant_unref(dbus_result); } static void on_response_call_dtmf(GObject *source_object, GAsyncResult *res, gpointer user_data) @@ -337,18 +247,29 @@ static void on_response_call_dtmf(GObject *source_object, GAsyncResult *res, gpo conn = G_DBUS_CONNECTION (source_object); dbus_result = g_dbus_connection_call_finish(conn, res, &error); - CHECK_DEINIT(error); + CHECK_ERROR(error); - if (!dbus_result) { - if (evt_cb_data->cb_fn) - evt_cb_data->cb_fn(evt_cb_data->handle, -1, NULL, evt_cb_data->user_data); + g_variant_get (dbus_result, "(i)", &result); - if (error) - g_error_free(error); + if (evt_cb_data->cb_fn) + evt_cb_data->cb_fn(evt_cb_data->handle, result, 0, evt_cb_data->user_data); - g_free(evt_cb_data); - return; - } + g_free(evt_cb_data); + g_variant_unref(dbus_result); +} + +static void on_response_call_deflect(GObject *source_object, GAsyncResult *res, gpointer user_data) +{ + GError *error = 0; + GDBusConnection *conn = 0; + struct tapi_resp_data *evt_cb_data = user_data; + int result = -1; + + GVariant *dbus_result; + + conn = G_DBUS_CONNECTION (source_object); + dbus_result = g_dbus_connection_call_finish(conn, res, &error); + CHECK_ERROR(error); g_variant_get (dbus_result, "(i)", &result); @@ -356,31 +277,44 @@ static void on_response_call_dtmf(GObject *source_object, GAsyncResult *res, gpo evt_cb_data->cb_fn(evt_cb_data->handle, result, 0, evt_cb_data->user_data); g_free(evt_cb_data); + g_variant_unref(dbus_result); } -static void on_response_call_deflect(GObject *source_object, GAsyncResult *res, gpointer user_data) +static void on_response_get_call_privacy_mode(GObject *source_object, GAsyncResult *res, gpointer user_data) { GError *error = 0; GDBusConnection *conn = 0; struct tapi_resp_data *evt_cb_data = user_data; int result = -1; + TelCallGetPrivacyModeResp_t data; GVariant *dbus_result; conn = G_DBUS_CONNECTION (source_object); dbus_result = g_dbus_connection_call_finish(conn, res, &error); - CHECK_DEINIT(error); + CHECK_ERROR(error); - if (!dbus_result) { - if (evt_cb_data->cb_fn) - evt_cb_data->cb_fn(evt_cb_data->handle, -1, NULL, evt_cb_data->user_data); + g_variant_get (dbus_result, "(ii)", &result,&data.mode); - if (error) - g_error_free(error); + if (evt_cb_data->cb_fn) + evt_cb_data->cb_fn(evt_cb_data->handle, result, &data, evt_cb_data->user_data); - g_free(evt_cb_data); - return; - } + g_free(evt_cb_data); + g_variant_unref(dbus_result); +} + +static void on_response_set_call_privacy_mode(GObject *source_object, GAsyncResult *res, gpointer user_data) +{ + GError *error = 0; + GDBusConnection *conn = 0; + struct tapi_resp_data *evt_cb_data = user_data; + int result = -1; + + GVariant *dbus_result; + + conn = G_DBUS_CONNECTION (source_object); + dbus_result = g_dbus_connection_call_finish(conn, res, &error); + CHECK_ERROR(error); g_variant_get (dbus_result, "(i)", &result); @@ -388,6 +322,7 @@ static void on_response_call_deflect(GObject *source_object, GAsyncResult *res, evt_cb_data->cb_fn(evt_cb_data->handle, result, 0, evt_cb_data->user_data); g_free(evt_cb_data); + g_variant_unref(dbus_result); } static void on_response_get_call_volume_info(GObject *source_object, GAsyncResult *res, gpointer user_data) @@ -407,18 +342,7 @@ static void on_response_get_call_volume_info(GObject *source_object, GAsyncResul conn = G_DBUS_CONNECTION (source_object); dbus_result = g_dbus_connection_call_finish(conn, res, &error); - CHECK_DEINIT(error); - - if (!dbus_result) { - if (evt_cb_data->cb_fn) - evt_cb_data->cb_fn(evt_cb_data->handle, -1, NULL, evt_cb_data->user_data); - - if (error) - g_error_free(error); - - g_free(evt_cb_data); - return; - } + CHECK_ERROR(error); g_variant_get (dbus_result, "(aa{sv}i)", &iter, &result); @@ -433,13 +357,12 @@ static void on_response_get_call_volume_info(GObject *source_object, GAsyncResul resp.record[i].device = (type & 0xf0); resp.record[i].type = (type & 0x0f); } - - if ( !g_strcmp0(key, "level") ) { + else if ( !g_strcmp0(key, "level") ) { resp.record[i].volume = g_variant_get_int32(value); } } - i++; g_variant_iter_free(iter_row); + i++; } g_variant_iter_free(iter); @@ -447,6 +370,7 @@ static void on_response_get_call_volume_info(GObject *source_object, GAsyncResul evt_cb_data->cb_fn(evt_cb_data->handle, result, &resp, evt_cb_data->user_data); g_free(evt_cb_data); + g_variant_unref(dbus_result); } static void on_response_set_call_volume_info(GObject *source_object, GAsyncResult *res, gpointer user_data) @@ -460,18 +384,7 @@ static void on_response_set_call_volume_info(GObject *source_object, GAsyncResul conn = G_DBUS_CONNECTION (source_object); dbus_result = g_dbus_connection_call_finish(conn, res, &error); - CHECK_DEINIT(error); - - if (!dbus_result) { - if (evt_cb_data->cb_fn) - evt_cb_data->cb_fn(evt_cb_data->handle, -1, NULL, evt_cb_data->user_data); - - if (error) - g_error_free(error); - - g_free(evt_cb_data); - return; - } + CHECK_ERROR(error); g_variant_get (dbus_result, "(i)", &result); @@ -479,6 +392,7 @@ static void on_response_set_call_volume_info(GObject *source_object, GAsyncResul evt_cb_data->cb_fn(evt_cb_data->handle, result, 0, evt_cb_data->user_data); g_free(evt_cb_data); + g_variant_unref(dbus_result); } static void on_response_set_call_sound_path(GObject *source_object, GAsyncResult *res, gpointer user_data) @@ -492,18 +406,7 @@ static void on_response_set_call_sound_path(GObject *source_object, GAsyncResult conn = G_DBUS_CONNECTION (source_object); dbus_result = g_dbus_connection_call_finish(conn, res, &error); - CHECK_DEINIT(error); - - if (!dbus_result) { - if (evt_cb_data->cb_fn) - evt_cb_data->cb_fn(evt_cb_data->handle, -1, NULL, evt_cb_data->user_data); - - if (error) - g_error_free(error); - - g_free(evt_cb_data); - return; - } + CHECK_ERROR(error); g_variant_get (dbus_result, "(i)", &result); @@ -511,6 +414,7 @@ static void on_response_set_call_sound_path(GObject *source_object, GAsyncResult evt_cb_data->cb_fn(evt_cb_data->handle, result, 0, evt_cb_data->user_data); g_free(evt_cb_data); + g_variant_unref(dbus_result); } static void on_response_set_call_mute_status(GObject *source_object, GAsyncResult *res, gpointer user_data) @@ -524,18 +428,7 @@ static void on_response_set_call_mute_status(GObject *source_object, GAsyncResul conn = G_DBUS_CONNECTION (source_object); dbus_result = g_dbus_connection_call_finish(conn, res, &error); - CHECK_DEINIT(error); - - if (!dbus_result) { - if (evt_cb_data->cb_fn) - evt_cb_data->cb_fn(evt_cb_data->handle, -1, NULL, evt_cb_data->user_data); - - if (error) - g_error_free(error); - - g_free(evt_cb_data); - return; - } + CHECK_ERROR(error); g_variant_get (dbus_result, "(i)", &result); @@ -543,6 +436,7 @@ static void on_response_set_call_mute_status(GObject *source_object, GAsyncResul evt_cb_data->cb_fn(evt_cb_data->handle, result, 0, evt_cb_data->user_data); g_free(evt_cb_data); + g_variant_unref(dbus_result); } static void on_response_get_call_mute_status(GObject *source_object, GAsyncResult *res, gpointer user_data) @@ -557,18 +451,7 @@ static void on_response_get_call_mute_status(GObject *source_object, GAsyncResul conn = G_DBUS_CONNECTION (source_object); dbus_result = g_dbus_connection_call_finish(conn, res, &error); - CHECK_DEINIT(error); - - if (!dbus_result) { - if (evt_cb_data->cb_fn) - evt_cb_data->cb_fn(evt_cb_data->handle, -1, NULL, evt_cb_data->user_data); - - if (error) - g_error_free(error); - - g_free(evt_cb_data); - return; - } + CHECK_ERROR(error); g_variant_get (dbus_result, "(iii)", &result, &resp.path, &resp.status); @@ -576,105 +459,10 @@ static void on_response_get_call_mute_status(GObject *source_object, GAsyncResul evt_cb_data->cb_fn(evt_cb_data->handle, result, &resp, evt_cb_data->user_data); g_free(evt_cb_data); + g_variant_unref(dbus_result); } -static void on_response_set_call_sound_recording(GObject *source_object, GAsyncResult *res, gpointer user_data) -{ - GError *error = 0; - GDBusConnection *conn = 0; - struct tapi_resp_data *evt_cb_data = user_data; - int result = -1; - - GVariant *dbus_result; - - conn = G_DBUS_CONNECTION (source_object); - dbus_result = g_dbus_connection_call_finish(conn, res, &error); - CHECK_DEINIT(error); - - if (!dbus_result) { - if (evt_cb_data->cb_fn) - evt_cb_data->cb_fn(evt_cb_data->handle, -1, NULL, evt_cb_data->user_data); - - if (error) - g_error_free(error); - - g_free(evt_cb_data); - return; - } - - g_variant_get (dbus_result, "(i)", &result); - - if (evt_cb_data->cb_fn) - evt_cb_data->cb_fn(evt_cb_data->handle, result, 0, evt_cb_data->user_data); - - g_free(evt_cb_data); -} - -static void on_response_set_call_sound_equalization(GObject *source_object, GAsyncResult *res, gpointer user_data) -{ - GError *error = 0; - GDBusConnection *conn = 0; - struct tapi_resp_data *evt_cb_data = user_data; - int result = -1; - - GVariant *dbus_result; - - conn = G_DBUS_CONNECTION (source_object); - dbus_result = g_dbus_connection_call_finish(conn, res, &error); - CHECK_DEINIT(error); - - if (!dbus_result) { - if (evt_cb_data->cb_fn) - evt_cb_data->cb_fn(evt_cb_data->handle, -1, NULL, evt_cb_data->user_data); - - if (error) - g_error_free(error); - - g_free(evt_cb_data); - return; - } - - g_variant_get (dbus_result, "(i)", &result); - - if (evt_cb_data->cb_fn) - evt_cb_data->cb_fn(evt_cb_data->handle, result, 0, evt_cb_data->user_data); - - g_free(evt_cb_data); -} - -static void on_response_set_call_sound_noise_reduction(GObject *source_object, GAsyncResult *res, gpointer user_data) -{ - GError *error = 0; - GDBusConnection *conn = 0; - struct tapi_resp_data *evt_cb_data = user_data; - int result = -1; - - GVariant *dbus_result; - - conn = G_DBUS_CONNECTION (source_object); - dbus_result = g_dbus_connection_call_finish(conn, res, &error); - CHECK_DEINIT(error); - - if (!dbus_result) { - if (evt_cb_data->cb_fn) - evt_cb_data->cb_fn(evt_cb_data->handle, -1, NULL, evt_cb_data->user_data); - - if (error) - g_error_free(error); - - g_free(evt_cb_data); - return; - } - - g_variant_get (dbus_result, "(i)", &result); - - if (evt_cb_data->cb_fn) - evt_cb_data->cb_fn(evt_cb_data->handle, result, 0, evt_cb_data->user_data); - - g_free(evt_cb_data); -} - -static void on_response_set_call_sound_clock_status(GObject *source_object, GAsyncResult *res, gpointer user_data) +static void on_response_set_preferred_voice_subscription(GObject *source_object, GAsyncResult *res, gpointer user_data) { GError *error = 0; GDBusConnection *conn = 0; @@ -685,18 +473,7 @@ static void on_response_set_call_sound_clock_status(GObject *source_object, GAsy conn = G_DBUS_CONNECTION (source_object); dbus_result = g_dbus_connection_call_finish(conn, res, &error); - CHECK_DEINIT(error); - - if (!dbus_result) { - if (evt_cb_data->cb_fn) - evt_cb_data->cb_fn(evt_cb_data->handle, -1, NULL, evt_cb_data->user_data); - - if (error) - g_error_free(error); - - g_free(evt_cb_data); - return; - } + CHECK_ERROR(error); g_variant_get (dbus_result, "(i)", &result); @@ -704,6 +481,7 @@ static void on_response_set_call_sound_clock_status(GObject *source_object, GAsy evt_cb_data->cb_fn(evt_cb_data->handle, result, 0, evt_cb_data->user_data); g_free(evt_cb_data); + g_variant_unref(dbus_result); } @@ -712,8 +490,6 @@ EXPORT_API int tel_dial_call(TapiHandle *handle, const TelCallDial_t *pParams, t struct tapi_resp_data *evt_cb_data = 0; GVariant *param = 0; - dbg("Func Entrance "); - TAPI_RET_ERR_NUM_IF_FAIL(handle, TAPI_API_INVALID_PTR); TAPI_RET_ERR_NUM_IF_FAIL(pParams, TAPI_API_INVALID_PTR); @@ -721,6 +497,8 @@ EXPORT_API int tel_dial_call(TapiHandle *handle, const TelCallDial_t *pParams, t param = g_variant_new("(iis)", pParams->CallType, pParams->Ecc, pParams->szNumber); + msg("[%s] Request Dial. type:[%d]", handle->cp_name, pParams->CallType); + g_dbus_connection_call(handle->dbus_connection, DBUS_TELEPHONY_SERVICE, handle->path, DBUS_TELEPHONY_CALL_INTERFACE, "Dial", param, 0, @@ -736,8 +514,6 @@ EXPORT_API int tel_answer_call(TapiHandle *handle, unsigned int CallHandle, TelC struct tapi_resp_data *evt_cb_data = 0; GVariant *param = 0; - dbg("Func Entrance "); - TAPI_RET_ERR_NUM_IF_FAIL(handle, TAPI_API_INVALID_PTR); if (AnsType > TAPI_CALL_ANSWER_HOLD_AND_ACCEPT) @@ -747,6 +523,8 @@ EXPORT_API int tel_answer_call(TapiHandle *handle, unsigned int CallHandle, TelC param = g_variant_new("(ii)", CallHandle, AnsType); + msg("[%s] Request Answer. id:[%d], type:[%d]", handle->cp_name, CallHandle, AnsType); + g_dbus_connection_call(handle->dbus_connection, DBUS_TELEPHONY_SERVICE, handle->path, DBUS_TELEPHONY_CALL_INTERFACE, "Answer", param, 0, @@ -761,8 +539,6 @@ EXPORT_API int tel_end_call(TapiHandle *handle, unsigned int CallHandle, TelCall struct tapi_resp_data *evt_cb_data = 0; GVariant *param = 0; - dbg("Func Entrance "); - TAPI_RET_ERR_NUM_IF_FAIL(handle, TAPI_API_INVALID_PTR); if (EndType > TAPI_CALL_END_HOLD_ALL) @@ -772,6 +548,8 @@ EXPORT_API int tel_end_call(TapiHandle *handle, unsigned int CallHandle, TelCall param = g_variant_new("(ii)", CallHandle, EndType); + msg("[%s] Request End. id:[%d], type:[%d]", handle->cp_name, CallHandle, EndType); + g_dbus_connection_call(handle->dbus_connection, DBUS_TELEPHONY_SERVICE, handle->path, DBUS_TELEPHONY_CALL_INTERFACE, "End", param, 0, @@ -786,14 +564,14 @@ EXPORT_API int tel_hold_call(TapiHandle *handle, unsigned int CallHandle, tapi_r struct tapi_resp_data *evt_cb_data = 0; GVariant *param = 0; - dbg("Func Entrance "); - TAPI_RET_ERR_NUM_IF_FAIL(handle, TAPI_API_INVALID_PTR); MAKE_RESP_CB_DATA(evt_cb_data, handle, callback, user_data); param = g_variant_new("(i)", CallHandle); + msg("[%s] Request Hold. id:[%d]", handle->cp_name, CallHandle); + g_dbus_connection_call(handle->dbus_connection, DBUS_TELEPHONY_SERVICE, handle->path, DBUS_TELEPHONY_CALL_INTERFACE, "Hold", param, 0, @@ -808,14 +586,14 @@ EXPORT_API int tel_active_call(TapiHandle *handle, unsigned int CallHandle, tapi struct tapi_resp_data *evt_cb_data = 0; GVariant *param = 0; - dbg("Func Entrance "); - TAPI_RET_ERR_NUM_IF_FAIL(handle, TAPI_API_INVALID_PTR); MAKE_RESP_CB_DATA(evt_cb_data, handle, callback, user_data); param = g_variant_new("(i)", CallHandle); + msg("[%s] Request Active. id:[%d]", handle->cp_name, CallHandle); + g_dbus_connection_call(handle->dbus_connection, DBUS_TELEPHONY_SERVICE, handle->path, DBUS_TELEPHONY_CALL_INTERFACE, "Active", param, 0, @@ -830,14 +608,14 @@ EXPORT_API int tel_swap_call(TapiHandle *handle, unsigned int CallHandle1, unsig struct tapi_resp_data *evt_cb_data = 0; GVariant *param = 0; - dbg("Func Entrance "); - TAPI_RET_ERR_NUM_IF_FAIL(handle, TAPI_API_INVALID_PTR); MAKE_RESP_CB_DATA(evt_cb_data, handle, callback, user_data); param = g_variant_new("(i)", CallHandle1); + msg("[%s] Request Swap. id:[%d][%d]", handle->cp_name, CallHandle1, CallHandle2); + g_dbus_connection_call(handle->dbus_connection, DBUS_TELEPHONY_SERVICE, handle->path, DBUS_TELEPHONY_CALL_INTERFACE, "Swap", param, 0, @@ -852,14 +630,14 @@ EXPORT_API int tel_join_call(TapiHandle *handle, unsigned int CallHandle1, unsig struct tapi_resp_data *evt_cb_data = 0; GVariant *param = 0; - dbg("Func Entrance "); - TAPI_RET_ERR_NUM_IF_FAIL(handle, TAPI_API_INVALID_PTR); MAKE_RESP_CB_DATA(evt_cb_data, handle, callback, user_data); param = g_variant_new("(i)", CallHandle1); + msg("[%s] Request Join", handle->cp_name); + g_dbus_connection_call(handle->dbus_connection, DBUS_TELEPHONY_SERVICE, handle->path, DBUS_TELEPHONY_CALL_INTERFACE, "Join", param, 0, @@ -874,14 +652,14 @@ EXPORT_API int tel_split_call(TapiHandle *handle, unsigned int CallHandle, tapi_ struct tapi_resp_data *evt_cb_data = 0; GVariant *param = 0; - dbg("Func Entrance "); - TAPI_RET_ERR_NUM_IF_FAIL(handle, TAPI_API_INVALID_PTR); MAKE_RESP_CB_DATA(evt_cb_data, handle, callback, user_data); param = g_variant_new("(i)", CallHandle); + msg("[%s] Request Split. id:[%d]", handle->cp_name, CallHandle); + g_dbus_connection_call(handle->dbus_connection, DBUS_TELEPHONY_SERVICE, handle->path, DBUS_TELEPHONY_CALL_INTERFACE, "Split", param, 0, @@ -896,14 +674,14 @@ EXPORT_API int tel_transfer_call(TapiHandle *handle, unsigned int CallHandle, ta struct tapi_resp_data *evt_cb_data = 0; GVariant *param = 0; - dbg("Func Entrance "); - TAPI_RET_ERR_NUM_IF_FAIL(handle, TAPI_API_INVALID_PTR); MAKE_RESP_CB_DATA(evt_cb_data, handle, callback, user_data); param = g_variant_new("(i)", CallHandle); + msg("[%s] Request Transfer. id:[%d]", handle->cp_name, CallHandle); + g_dbus_connection_call(handle->dbus_connection, DBUS_TELEPHONY_SERVICE, handle->path, DBUS_TELEPHONY_CALL_INTERFACE, "Transfer", param, 0, @@ -913,28 +691,64 @@ EXPORT_API int tel_transfer_call(TapiHandle *handle, unsigned int CallHandle, ta return TAPI_API_SUCCESS; } -EXPORT_API int tel_activate_call_ccbs(TapiHandle *handle, unsigned int CallHandle, tapi_response_cb callback, void *user_data ) +EXPORT_API int tel_start_call_cont_dtmf(TapiHandle *handle, unsigned char dtmf_digit, tapi_response_cb callback, void *user_data ) { + struct tapi_resp_data *evt_cb_data = 0; + GVariant *param = 0; + + TAPI_RET_ERR_NUM_IF_FAIL(handle, TAPI_API_INVALID_PTR); + + MAKE_RESP_CB_DATA(evt_cb_data, handle, callback, user_data); + + param = g_variant_new("(y)", dtmf_digit); + + msg("[%s] Request cont DTMF", handle->cp_name); + + g_dbus_connection_call(handle->dbus_connection, + DBUS_TELEPHONY_SERVICE, handle->path, DBUS_TELEPHONY_CALL_INTERFACE, + "StartContDtmf", param, 0, + G_DBUS_CALL_FLAGS_NONE, G_MAXINT, handle->ca, + on_response_call_dtmf, evt_cb_data ); + return TAPI_API_SUCCESS; } -EXPORT_API int tel_call_dtmf(TapiHandle *handle, const char *pDtmfString, tapi_response_cb callback, void *user_data ) +EXPORT_API int tel_stop_call_cont_dtmf(TapiHandle *handle, tapi_response_cb callback, void *user_data ) { struct tapi_resp_data *evt_cb_data = 0; - GVariant *param = 0; - dbg("Func Entrance "); + TAPI_RET_ERR_NUM_IF_FAIL(handle, TAPI_API_INVALID_PTR); + + MAKE_RESP_CB_DATA(evt_cb_data, handle, callback, user_data); + + msg("[%s] Stop cont DTMF", handle->cp_name); + + g_dbus_connection_call(handle->dbus_connection, + DBUS_TELEPHONY_SERVICE, handle->path, DBUS_TELEPHONY_CALL_INTERFACE, + "StopContDtmf", NULL, 0, + G_DBUS_CALL_FLAGS_NONE, G_MAXINT, handle->ca, + on_response_call_dtmf, evt_cb_data ); + + return TAPI_API_SUCCESS; +} + +EXPORT_API int tel_send_call_burst_dtmf(TapiHandle *handle, const TelCallBurstDtmf_t *info, tapi_response_cb callback, void *user_data ) +{ + struct tapi_resp_data *evt_cb_data = 0; + GVariant *param = 0; TAPI_RET_ERR_NUM_IF_FAIL(handle, TAPI_API_INVALID_PTR); - TAPI_RET_ERR_NUM_IF_FAIL(pDtmfString, TAPI_API_INVALID_PTR); + TAPI_RET_ERR_NUM_IF_FAIL(info, TAPI_API_INVALID_PTR); MAKE_RESP_CB_DATA(evt_cb_data, handle, callback, user_data); - param = g_variant_new("(s)", pDtmfString); + param = g_variant_new("(sii)", info->dtmf_string, info->pulse_width, info->inter_digit_interval); + + msg("[%s] Send burst DTMF", handle->cp_name); g_dbus_connection_call(handle->dbus_connection, DBUS_TELEPHONY_SERVICE, handle->path, DBUS_TELEPHONY_CALL_INTERFACE, - "Dtmf", param, 0, + "SendBurstDtmf", param, 0, G_DBUS_CALL_FLAGS_NONE, G_MAXINT, handle->ca, on_response_call_dtmf, evt_cb_data ); @@ -946,8 +760,6 @@ EXPORT_API int tel_deflect_call(TapiHandle *handle, unsigned int CallHandle, con struct tapi_resp_data *evt_cb_data = 0; GVariant *param = 0; - dbg("Func Entrance "); - TAPI_RET_ERR_NUM_IF_FAIL(handle, TAPI_API_INVALID_PTR); TAPI_RET_ERR_NUM_IF_FAIL(pInfo, TAPI_API_INVALID_PTR); @@ -955,6 +767,8 @@ EXPORT_API int tel_deflect_call(TapiHandle *handle, unsigned int CallHandle, con param = g_variant_new("(is)", CallHandle, pInfo->number); + msg("[%s] deflect", handle->cp_name); + g_dbus_connection_call(handle->dbus_connection, DBUS_TELEPHONY_SERVICE, handle->path, DBUS_TELEPHONY_CALL_INTERFACE, "Deflect", param, 0, @@ -977,13 +791,13 @@ EXPORT_API int tel_get_call_status(TapiHandle *handle, int call_id, TelCallStatu gint call_state = 0; gboolean call_multiparty_state = FALSE; - dbg("Func Entrance "); - TAPI_RET_ERR_NUM_IF_FAIL(handle, TAPI_API_INVALID_PTR); TAPI_RET_ERR_NUM_IF_FAIL(out, TAPI_API_INVALID_PTR); param = g_variant_new("(i)", call_id); + dbg("[%s] Func Entrance ", handle->cp_name); + gv = g_dbus_connection_call_sync(handle->dbus_connection, DBUS_TELEPHONY_SERVICE , handle->path, DBUS_TELEPHONY_CALL_INTERFACE, "GetStatus", param, 0, G_DBUS_CALL_FLAGS_NONE, TAPI_DEFAULT_TIMEOUT, handle->ca, &gerr); @@ -995,15 +809,16 @@ EXPORT_API int tel_get_call_status(TapiHandle *handle, int call_id, TelCallStatu out->bMoCall = (int)call_direction; strncpy( out->pNumber, call_number, TAPI_CALL_DIALDIGIT_LEN_MAX ); - dbg("[ check ] call_number : %s", call_number); - dbg("[ check ] out->pNumber : %s", out->pNumber); + dbg("[ check ] call_number : [%s] out->pNumber : [%s]", call_number, out->pNumber); out->CallType = (TelCallType_t)call_type; out->CallState = (TelCallStates_t)call_state; out->bConferenceState = (int)call_multiparty_state; g_free( call_number ); - + g_variant_unref (gv); + if (gerr) + g_error_free (gerr); } else { dbg("[ error ] fail to get call status : (0x%x)", call_id); g_error_free(gerr); @@ -1019,11 +834,11 @@ EXPORT_API int tel_get_call_status_all( TapiHandle *handle, TelCallStatusCallbac GVariantIter *iter = 0, *iter_row = 0; GError *gerr = 0; - dbg("Func Entrance "); - TAPI_RET_ERR_NUM_IF_FAIL(handle, TAPI_API_INVALID_PTR); TAPI_RET_ERR_NUM_IF_FAIL(cb, TAPI_API_INVALID_PTR); + dbg("[%s] Func Entrance ", handle->cp_name); + gv = g_dbus_connection_call_sync(handle->dbus_connection, DBUS_TELEPHONY_SERVICE , handle->path, DBUS_TELEPHONY_CALL_INTERFACE, "GetStatusAll", 0, 0, G_DBUS_CALL_FLAGS_NONE, TAPI_DEFAULT_TIMEOUT, handle->ca, &gerr); @@ -1043,83 +858,81 @@ EXPORT_API int tel_get_call_status_all( TapiHandle *handle, TelCallStatusCallbac if (!g_strcmp0(key, "call_id")) { data.CallHandle = g_variant_get_int32(value); } - if (!g_strcmp0(key, "call_number")) { + else if (!g_strcmp0(key, "call_number")) { strncpy(data.pNumber, g_variant_get_string(value, 0), TAPI_CALL_DIALDIGIT_LEN_MAX); } - if (!g_strcmp0(key, "call_type")) { + else if (!g_strcmp0(key, "call_type")) { data.CallType = (int)g_variant_get_int32(value); } - if (!g_strcmp0(key, "call_direction")) { + else if (!g_strcmp0(key, "call_direction")) { data.bMoCall = (int)g_variant_get_boolean(value); } - if (!g_strcmp0(key, "call_state")) { + else if (!g_strcmp0(key, "call_state")) { data.CallState = (int)g_variant_get_int32(value); } - if (!g_strcmp0(key, "call_multiparty_state")) { + else if (!g_strcmp0(key, "call_multiparty_state")) { data.bConferenceState = (int)g_variant_get_boolean(value); } - } - g_variant_iter_free(iter_row); cb( &data, user_data ); } g_variant_iter_free(iter); + g_variant_unref (gv); + if (gerr) + g_error_free (gerr); } else { - - dbg("[ error ] fail to get call status"); - return TAPI_API_OPERATION_FAILED; - + if (strstr(gerr->message, "No access rights")) { + err("Permission denied"); + return TAPI_API_ACCESS_DENIED; + } else { + err("[error] fail to get call status (%s)", gerr->message); + return TAPI_API_OPERATION_FAILED; + } } return TAPI_API_SUCCESS; } -EXPORT_API int tel_get_call_act_line(TapiHandle *handle, tapi_response_cb callback, void *user_data ) +EXPORT_API int tel_get_call_privacy_mode(TapiHandle *handle, tapi_response_cb callback, void *user_data ) { - return TAPI_API_SUCCESS; -} + struct tapi_resp_data *evt_cb_data = 0; -EXPORT_API int tel_set_call_act_line(TapiHandle *handle, TelCallActiveLine_t active_line, tapi_response_cb callback, void *user_data ) -{ - return TAPI_API_SUCCESS; -} + TAPI_RET_ERR_NUM_IF_FAIL(handle, TAPI_API_INVALID_PTR); -/*================================================================================================*/ + MAKE_RESP_CB_DATA(evt_cb_data, handle, callback, user_data); -EXPORT_API int tel_get_call_duration(TapiHandle *handle, unsigned int CallHandle, unsigned int *pDurationInSecs) -{ - return TAPI_API_SUCCESS; -} + dbg("[%s] Func Entrance ", handle->cp_name); -EXPORT_API int tel_get_call_conf_list(TapiHandle *handle, unsigned int CallHandle, unsigned int *pCallList, int *pNoOfCalls) -{ - return TAPI_API_SUCCESS; -} + g_dbus_connection_call(handle->dbus_connection, + DBUS_TELEPHONY_SERVICE, handle->path, DBUS_TELEPHONY_CALL_INTERFACE, + "GetPrivacyMode", 0, 0, + G_DBUS_CALL_FLAGS_NONE, TAPI_DEFAULT_TIMEOUT, handle->ca, + on_response_get_call_privacy_mode, evt_cb_data ); -EXPORT_API int tel_get_call_privacy_mode(TapiHandle *handle, TelCallPrivacyType_t PrivacyType, tapi_response_cb callback, void *user_data ) -{ return TAPI_API_SUCCESS; } -EXPORT_API int tel_set_call_privacy_mode(TapiHandle *handle, TelCallVoicePrivacyInfo_t PrivacyInfo, tapi_response_cb callback, void *user_data ) +EXPORT_API int tel_set_call_privacy_mode(TapiHandle *handle, TelCallPrivacyMode_t privacy_mode, tapi_response_cb callback, void *user_data ) { - return TAPI_API_SUCCESS; -} + struct tapi_resp_data *evt_cb_data = 0; + GVariant *pParam = 0; -EXPORT_API int tel_exe_call_flash_info(TapiHandle *handle, const char *pDialNumber, tapi_response_cb callback, void *user_data ) -{ - return TAPI_API_SUCCESS; -} + TAPI_RET_ERR_NUM_IF_FAIL(handle, TAPI_API_INVALID_PTR); -EXPORT_API int tel_exit_call_emergency_mode(TapiHandle *handle, tapi_response_cb callback, void *user_data ) -{ - return TAPI_API_SUCCESS; -} + MAKE_RESP_CB_DATA(evt_cb_data, handle, callback, user_data); + + pParam = g_variant_new("(i)", privacy_mode); + + msg("[%s] Set Privacy. mode:[%d]", handle->cp_name, privacy_mode); + + g_dbus_connection_call(handle->dbus_connection, + DBUS_TELEPHONY_SERVICE, handle->path, DBUS_TELEPHONY_CALL_INTERFACE, + "SetPrivacyMode", pParam, 0, + G_DBUS_CALL_FLAGS_NONE, TAPI_DEFAULT_TIMEOUT, handle->ca, + on_response_set_call_privacy_mode, evt_cb_data ); -EXPORT_API int tel_get_call_time(TapiHandle *handle, unsigned short req_mask, tapi_response_cb callback, void *user_data ) -{ return TAPI_API_SUCCESS; } @@ -1128,14 +941,14 @@ EXPORT_API int tel_get_call_volume_info(TapiHandle *handle, TelSoundDevice_t dev struct tapi_resp_data *evt_cb_data = 0; GVariant *param = 0; - dbg("Func Entrance "); - TAPI_RET_ERR_NUM_IF_FAIL(handle, TAPI_API_INVALID_PTR); MAKE_RESP_CB_DATA(evt_cb_data, handle, callback, user_data); param = g_variant_new("(ii)", device, type); + dbg("[%s] Get Volume Info. device:[%d] type:[%d] ", handle->cp_name, device, type); + g_dbus_connection_call(handle->dbus_connection, DBUS_TELEPHONY_SERVICE, handle->path, DBUS_TELEPHONY_CALL_INTERFACE, "GetSoundVolumeLevel", param, 0, @@ -1150,8 +963,6 @@ EXPORT_API int tel_set_call_volume_info(TapiHandle *handle, TelCallVolumeInfo_t struct tapi_resp_data *evt_cb_data = 0; GVariant *param = 0; - dbg("Func Entrance "); - TAPI_RET_ERR_NUM_IF_FAIL(handle, TAPI_API_INVALID_PTR); TAPI_RET_ERR_NUM_IF_FAIL(info, TAPI_API_INVALID_PTR); @@ -1159,6 +970,9 @@ EXPORT_API int tel_set_call_volume_info(TapiHandle *handle, TelCallVolumeInfo_t param = g_variant_new("(iii)", info->device, info->type, info->volume); + dbg("[%s] Set Volume Info. device:[%d] type:[%d] volume:[%d] ", + handle->cp_name, info->device, info->type, info->volume); + g_dbus_connection_call(handle->dbus_connection, DBUS_TELEPHONY_SERVICE, handle->path, DBUS_TELEPHONY_CALL_INTERFACE, "SetSoundVolumeLevel", param, 0, @@ -1173,8 +987,6 @@ EXPORT_API int tel_set_call_sound_path(TapiHandle *handle, TelCallSoundPathInfo_ struct tapi_resp_data *evt_cb_data = 0; GVariant *param = 0; - dbg("Func Entrance "); - TAPI_RET_ERR_NUM_IF_FAIL(handle, TAPI_API_INVALID_PTR); TAPI_RET_ERR_NUM_IF_FAIL(info, TAPI_API_INVALID_PTR); @@ -1182,6 +994,8 @@ EXPORT_API int tel_set_call_sound_path(TapiHandle *handle, TelCallSoundPathInfo_ param = g_variant_new("(ib)", info->path, info->ex_volume); + dbg("[%s] Set Sound Path. path:[%d] ex_volume:[%d]", handle->cp_name, info->path, info->ex_volume); + g_dbus_connection_call(handle->dbus_connection, DBUS_TELEPHONY_SERVICE, handle->path, DBUS_TELEPHONY_CALL_INTERFACE, "SetSoundPath", param, 0, @@ -1196,14 +1010,14 @@ EXPORT_API int tel_set_call_mute_status(TapiHandle *handle, TelSoundMuteStatus_t struct tapi_resp_data *evt_cb_data = 0; GVariant *param = 0; - dbg("Func Entrance "); - TAPI_RET_ERR_NUM_IF_FAIL(handle, TAPI_API_INVALID_PTR); MAKE_RESP_CB_DATA(evt_cb_data, handle, callback, user_data); param = g_variant_new("(ii)", mute, path); + dbg("[%s] Set Mute. mute:[%d] path:[%d] ", handle->cp_name, mute, path); + g_dbus_connection_call(handle->dbus_connection, DBUS_TELEPHONY_SERVICE, handle->path, DBUS_TELEPHONY_CALL_INTERFACE, "SetSoundMuteStatus", param, 0, @@ -1217,13 +1031,13 @@ EXPORT_API int tel_get_call_mute_status(TapiHandle *handle, tapi_response_cb cal { struct tapi_resp_data *evt_cb_data = 0; - dbg("Func Entrance "); - TAPI_RET_ERR_NUM_IF_FAIL(handle, TAPI_API_INVALID_PTR); TAPI_RET_ERR_NUM_IF_FAIL(callback, TAPI_API_INVALID_PTR); MAKE_RESP_CB_DATA(evt_cb_data, handle, callback, user_data); + dbg("[%s] Func Entrance ", handle->cp_name); + g_dbus_connection_call(handle->dbus_connection, DBUS_TELEPHONY_SERVICE, handle->path, DBUS_TELEPHONY_CALL_INTERFACE, "GetSoundMuteStatus", 0, 0, @@ -1233,96 +1047,62 @@ EXPORT_API int tel_get_call_mute_status(TapiHandle *handle, tapi_response_cb cal return TAPI_API_SUCCESS; } -EXPORT_API int tel_set_call_sound_recording(TapiHandle *handle, TelSoundRecording_t *on, tapi_response_cb callback, void *user_data) +EXPORT_API int tel_set_call_preferred_voice_subscription(TapiHandle *handle, TelCallPreferredVoiceSubs_t preferred_subscription, + tapi_response_cb callback, void *user_data) { - struct tapi_resp_data *evt_cb_data = 0; - GVariant *param = 0; - - dbg("Func Entrance "); + struct tapi_resp_data *evt_cb_data = NULL; + GVariant *param = NULL; TAPI_RET_ERR_NUM_IF_FAIL(handle, TAPI_API_INVALID_PTR); - - param = g_variant_new("(i)", *on); + TAPI_RET_ERR_NUM_IF_FAIL(callback, TAPI_API_INVALID_PTR); MAKE_RESP_CB_DATA(evt_cb_data, handle, callback, user_data); - g_dbus_connection_call(handle->dbus_connection, - DBUS_TELEPHONY_SERVICE, handle->path, DBUS_TELEPHONY_CALL_INTERFACE, - "SetSoundRecording", param, 0, - G_DBUS_CALL_FLAGS_NONE, TAPI_DEFAULT_TIMEOUT, handle->ca, - on_response_set_call_sound_recording, evt_cb_data ); + param = g_variant_new("(i)", preferred_subscription); - return TAPI_API_SUCCESS; -} - -EXPORT_API int tel_set_call_sound_equalization(TapiHandle *handle, TelCallSoundEqualization_t *eq, tapi_response_cb callback, void *user_data) -{ - struct tapi_resp_data *evt_cb_data = 0; - GVariant *param = 0; - char *eq_param = 0; - - dbg("Func Entrance "); - - TAPI_RET_ERR_NUM_IF_FAIL(handle, TAPI_API_INVALID_PTR); - TAPI_RET_ERR_NUM_IF_FAIL(eq, TAPI_API_INVALID_PTR); - - eq_param = (char*)eq->parameter; - - param = g_variant_new("(iis)", eq->mode, eq->direction, eq_param); - - MAKE_RESP_CB_DATA(evt_cb_data, handle, callback, user_data); + dbg("[%s] Set Preferred Voice. subs:[%d]", handle->cp_name, preferred_subscription); + /* DBUS call */ g_dbus_connection_call(handle->dbus_connection, - DBUS_TELEPHONY_SERVICE, handle->path, DBUS_TELEPHONY_CALL_INTERFACE, - "SetSoundEqualization", param, 0, + DBUS_TELEPHONY_SERVICE , handle->path, DBUS_TELEPHONY_CALL_INTERFACE, + "SetPreferredVoiceSubscription", param, NULL, G_DBUS_CALL_FLAGS_NONE, TAPI_DEFAULT_TIMEOUT, handle->ca, - on_response_set_call_sound_equalization, evt_cb_data ); + on_response_set_preferred_voice_subscription, evt_cb_data); return TAPI_API_SUCCESS; } -EXPORT_API int tel_set_call_sound_noise_reduction(TapiHandle *handle, TelSoundNoiseReduction_t noise, tapi_response_cb callback, void *user_data) +EXPORT_API int tel_get_call_preferred_voice_subscription(TapiHandle *handle, TelCallPreferredVoiceSubs_t *preferred_subscription) { - struct tapi_resp_data *evt_cb_data = 0; - GVariant *param = 0; - - dbg("Func Entrance "); + GError *gerr = NULL; + GVariant *sync_gv = NULL; + int subs = 0; + int result = 0; + TapiResult_t ret = TAPI_API_OPERATION_FAILED; TAPI_RET_ERR_NUM_IF_FAIL(handle, TAPI_API_INVALID_PTR); + TAPI_RET_ERR_NUM_IF_FAIL(preferred_subscription, TAPI_API_INVALID_PTR); - param = g_variant_new("(i)", noise); - - MAKE_RESP_CB_DATA(evt_cb_data, handle, callback, user_data); - - g_dbus_connection_call(handle->dbus_connection, + sync_gv = g_dbus_connection_call_sync(handle->dbus_connection, DBUS_TELEPHONY_SERVICE, handle->path, DBUS_TELEPHONY_CALL_INTERFACE, - "SetSoundNoiseReduction", param, 0, + "GetPreferredVoiceSubscription", NULL, NULL, G_DBUS_CALL_FLAGS_NONE, TAPI_DEFAULT_TIMEOUT, handle->ca, - on_response_set_call_sound_noise_reduction, evt_cb_data ); - - return TAPI_API_SUCCESS; -} - -EXPORT_API int tel_set_call_sound_clock_status(TapiHandle *handle, gboolean status, tapi_response_cb callback, void *user_data ) -{ - struct tapi_resp_data *evt_cb_data = 0; - GVariant *param = 0; - - dbg("Func Entrance"); - - TAPI_RET_ERR_NUM_IF_FAIL(handle, TAPI_API_INVALID_PTR); - - MAKE_RESP_CB_DATA(evt_cb_data, handle, callback, user_data); + &gerr); + if (sync_gv) { + g_variant_get(sync_gv, "(ii)", &subs, &result); - param = g_variant_new("(b)", status); + if (result == 0) + *preferred_subscription = subs; + else + *preferred_subscription = TAPI_CALL_PREFERRED_VOICE_SUBS_UNKNOWN; + dbg("'preferred' Voice Subscription: [%d]", subs); - g_dbus_connection_call(handle->dbus_connection, - DBUS_TELEPHONY_SERVICE, handle->path, DBUS_TELEPHONY_CALL_INTERFACE, - "SetSoundClockStatus", param, 0, - G_DBUS_CALL_FLAGS_NONE, TAPI_DEFAULT_TIMEOUT, handle->ca, - on_response_set_call_sound_clock_status, evt_cb_data ); + ret = TAPI_API_SUCCESS; + } else { + err("Get 'preferred' Voice Subscription failed: [%s]", gerr->message); + g_error_free(gerr); + } - return TAPI_API_SUCCESS; + return ret; } -/* EOF */ diff --git a/wearable/src/tapi_common.c b/src/tapi_common.c similarity index 87% rename from wearable/src/tapi_common.c rename to src/tapi_common.c index 4012706..31afabb 100644 --- a/wearable/src/tapi_common.c +++ b/src/tapi_common.c @@ -1,7 +1,7 @@ /* * libslp-tapi * - * Copyright (c) 2012 Samsung Electronics Co., Ltd. All rights reserved. + * Copyright (c) 2014 Samsung Electronics Co., Ltd. All rights reserved. * * Contact: Ja-young Gu * @@ -30,16 +30,12 @@ #include "tapi_common.h" #include "TapiUtility.h" -// -#include "ITapiPS.h" #include "TelNetwork.h" #include "TelSms.h" #include "TelSat.h" #include "TelSs.h" #include "TelCall.h" -#include "TelGps.h" -// #include "common.h" #include "tapi_log.h" @@ -48,15 +44,6 @@ extern int g_cookie_size; TelSatEventDownloadType_t g_event_list[TAPI_SAT_EVENT_LIST_MAX_COUNT] = {-1}; -/*static void _cookie_deinit(void) -{ - if (g_cookie_name) - free(g_cookie_name); - - g_cookie_name = NULL; - g_cookie_size = 0; -}*/ - static void _process_sms_event(const gchar *sig, GVariant *param, TapiHandle *handle, char *noti_id, struct tapi_evt_cb *evt_cb_data) { @@ -93,6 +80,8 @@ static void _process_sms_event(const gchar *sig, GVariant *param, g_variant_iter_free(iter); g_variant_unref(inner_gv); + noti.format = TAPI_NETTEXT_NETTYPE_3GPP; + CALLBACK_CALL(¬i); } else if (!g_strcmp0(sig, "IncommingCbMsg")) { @@ -110,7 +99,7 @@ static void _process_sms_event(const gchar *sig, GVariant *param, g_variant_get(inner_gv, "ay", &iter); while( g_variant_iter_loop( iter, "y", ¬i.szMsgData[i] ) ) { i++; - if( i >= TAPI_NETTEXT_CB_SIZE_MAX + 1 ) + if( i >= noti.Length + 1 ) break; } g_variant_iter_free(iter); @@ -168,127 +157,133 @@ static void _process_call_event(const gchar *sig, GVariant *param, TelCallStatusIdleNoti_t data; int start_time = 0, end_time = 0; g_variant_get(param, "(iiii)", &data.id, &data.cause, &start_time, &end_time); - dbg("[ check ] %s : call_id(%d), end_cause(0x%x)", "Status Idle noti", data.id, data.cause); + msg("[ check ] (%s) %s : call_id(%d), end_cause(0x%x)", handle->cp_name, "Status Idle noti", data.id, data.cause); CALLBACK_CALL(&data); } else if (!g_strcmp0(sig, "VoiceCallStatusDialing") || !g_strcmp0(sig, "VideoCallStatusDialing")) { TelCallStatusDialingNoti_t data; g_variant_get(param, "(i)", &data.id); - dbg("[ check ] %s : call_id(%d)", "Status Dialing noti", data.id); + msg("[ check ] (%s) %s : call_id(%d)", handle->cp_name, "Status Dialing noti", data.id); CALLBACK_CALL(&data); } else if (!g_strcmp0(sig, "VoiceCallStatusAlert") || !g_strcmp0(sig, "VideoCallStatusAlert")) { TelCallStatusAlertNoti_t data; g_variant_get(param, "(i)", &data.id); - dbg("[ check ] %s : call_id(%d)", "Status Alert noti", data.id); + msg("[ check ] (%s) %s : call_id(%d)", handle->cp_name, "Status Alert noti", data.id); CALLBACK_CALL(&data); } else if (!g_strcmp0(sig, "VoiceCallStatusActive") || !g_strcmp0(sig, "VideoCallStatusActive")) { TelCallStatusActiveNoti_t data; g_variant_get(param, "(i)", &data.id); - dbg("[ check ] %s : call_id(%d)", "Status Active noti", data.id); + msg("[ check ] (%s) %s : call_id(%d)", handle->cp_name, "Status Active noti", data.id); CALLBACK_CALL(&data); } else if (!g_strcmp0(sig, "VoiceCallStatusHeld") ) { TelCallStatusHeldNoti_t data; g_variant_get(param, "(i)", &data.id); - dbg("[ check ] %s : call_id(%d)", "Status Held noti", data.id); + msg("[ check ] (%s) %s : call_id(%d)", handle->cp_name, "Status Held noti", data.id); CALLBACK_CALL(&data); } else if (!g_strcmp0(sig, "VoiceCallStatusIncoming") || !g_strcmp0(sig, "VideoCallStatusIncoming")) { TelCallStatusIncomingNoti_t data; g_variant_get(param, "(i)", &data.id); - dbg("[ check ] %s : call_id(%d)", "Status Incoming noti", data.id); + msg("[ check ] (%s) %s : call_id(%d)", handle->cp_name, "Status Incoming noti", data.id); CALLBACK_CALL(&data); } else if (!g_strcmp0(sig, "Waiting")) { TelCallInfoWaitingNoti_t data; g_variant_get(param, "(i)", &data.id); - dbg("[ check ] %s : data.id(%d)", "Call Info Waiting noti", data.id); + msg("[ check ] (%s) %s : data.id(%d)", handle->cp_name, "Call Info Waiting noti", data.id); CALLBACK_CALL(&data.id); } else if (!g_strcmp0(sig, "Forwarded")) { TelCallInfoForwardedNoti_t data; g_variant_get(param, "(i)", &data.id); - dbg("[ check ] %s : data.id(%d)", "Call Info Forwarded noti", data.id); + msg("[ check ] (%s) %s : data.id(%d)", handle->cp_name, "Call Info Forwarded noti", data.id); + CALLBACK_CALL(&data.id); + } + else if (!g_strcmp0(sig, "ForwardedCall")) { + TelCallInfoForwardedCallNoti_t data; + g_variant_get(param, "(i)", &data.id); + dbg("[ check ] (%s) %s : data.id(%d)", handle->cp_name, "Call Info Forwarded Call noti", data.id); CALLBACK_CALL(&data.id); } else if (!g_strcmp0(sig, "BarredIncoming")) { TelCallInfoBarredIncomingNoti_t data; g_variant_get(param, "(i)", &data.id); - dbg("[ check ] %s : data.id(%d)", "Call Info Barred Incoming noti", data.id); + msg("[ check ] (%s) %s : data.id(%d)", handle->cp_name, "Call Info Barred Incoming noti", data.id); CALLBACK_CALL(&data.id); } else if (!g_strcmp0(sig, "BarredOutgoing")) { TelCallInfoBarredOutgoingNoti_t data; g_variant_get(param, "(i)", &data.id); - dbg("[ check ] %s : data.id(%d)", "Call Info Barred Outgoing noti", data.id); + msg("[ check ] (%s) %s : data.id(%d)", handle->cp_name, "Call Info Barred Outgoing noti", data.id); CALLBACK_CALL(&data.id); } else if (!g_strcmp0(sig, "ForwardConditional")) { TelCallInfoForwardConditionalNoti_t data; g_variant_get(param, "(i)", &data.id); - dbg("[ check ] %s : data.id(%d)", "Call Info Forward Conditional noti", data.id); + msg("[ check ] (%s) %s : data.id(%d)", handle->cp_name, "Call Info Forward Conditional noti", data.id); CALLBACK_CALL(&data.id); } else if (!g_strcmp0(sig, "ForwardUnconditional")) { TelCallInfoForwardUnconditionalNoti_t data; g_variant_get(param, "(i)", &data.id); - dbg("[ check ] %s : data.id(%d)", "Call Info Forward Unconditional noti", data.id); + msg("[ check ] (%s) %s : data.id(%d)", handle->cp_name, "Call Info Forward Unconditional noti", data.id); CALLBACK_CALL(&data.id); } else if (!g_strcmp0(sig, "CallActive")) { TelCallInfoActiveNoti_t data; g_variant_get(param, "(i)", &data.id); - dbg("[ check ] %s : data.id(%d)", "Call Info Call Active noti", data.id); + msg("[ check ] (%s) %s : data.id(%d)", handle->cp_name, "Call Info Call Active noti", data.id); CALLBACK_CALL(&data.id); } else if (!g_strcmp0(sig, "CallHeld")) { TelCallInfoHeldNoti_t data; g_variant_get(param, "(i)", &data.id); - dbg("[ check ] %s : data.id(%d)", "Call Info Call Held noti", data.id); + msg("[ check ] (%s) %s : data.id(%d)", handle->cp_name, "Call Info Call Held noti", data.id); CALLBACK_CALL(&data.id); } else if (!g_strcmp0(sig, "CallJoined")) { TelCallInfoJoinedNoti_t data; g_variant_get(param, "(i)", &data.id); - dbg("[ check ] %s : data.id(%d)", "Call Info Call Joined noti", data.id); + msg("[ check ] (%s) %s : data.id(%d)", handle->cp_name, "Call Info Call Joined noti", data.id); CALLBACK_CALL(&data.id); } else if (!g_strcmp0(sig, "CallSoundPath")) { TelCallSoundPathNoti_t data; g_variant_get(param, "(i)", &data.path); - dbg("[ check ] %s : path(%d)", "Call Sound Path noti", data.path); + msg("[ check ] (%s) %s : path(%d)", handle->cp_name, "Call Sound Path noti", data.path); CALLBACK_CALL(&data); } else if (!g_strcmp0(sig, "CallSoundRingbackTone")) { TelCallSoundRingbackToneNoti_t status; g_variant_get(param, "(i)", &status); - dbg("[ check ] %s : status(%d)", "Call Sound Ringbacktone noti", status); + msg("[ check ] (%s) %s : status(%d)", handle->cp_name, "Call Sound Ringbacktone noti", status); CALLBACK_CALL(&status); } else if (!g_strcmp0(sig, "CallSoundWbamr")) { TelCallSoundWbamrNoti_t status; g_variant_get(param, "(i)", &status); - dbg("[ check ] %s : status(%d)", "Call Sound Wbamr noti", status); + msg("[ check ] (%s) %s : status(%d)", handle->cp_name, "Call Sound Wbamr noti", status); CALLBACK_CALL(&status); } - else if (!g_strcmp0(sig, "CallSoundEqualization")) { - TelCallSoundEqualizationNoti_t data; - g_variant_get(param, "(ii)", &data.mode, &data.direction); - dbg("[ check ] %s : mode(%d), direction(%d)", "Call Sound Equalization noti", data.mode, data.direction); - CALLBACK_CALL(&data); - } else if (!g_strcmp0(sig, "CallSoundNoiseReduction")) { TelCallSoundNoiseReductionNoti_t data; g_variant_get(param, "(i)", &data.status); - dbg("[ check ] %s : status(%d)", "Call Sound Noise Reduction noti", data.status); + msg("[ check ] (%s) %s : status(%d)", handle->cp_name, "Call Sound Noise Reduction noti", data.status); CALLBACK_CALL(&data); } else if (!g_strcmp0(sig, "CallSoundClockStatus")) { gboolean data; g_variant_get(param, "(b)", &data); - dbg("[ check ] %s : status(%d)", "Call Sound Clock Status noti", data); + msg("[ check ] (%s) %s : status(%d)", handle->cp_name, "Call Sound Clock Status noti", data); + CALLBACK_CALL(&data); + } + else if (!g_strcmp0(sig, "CallPreferredVoiceSubscription")) { + TelCallPreferredVoiceSubsNoti_t data; + g_variant_get(param, "(i)", &data.preferred_subs); + dbg("[ check ] %s : Voice preferred_subs(%d)", "Call Preferred Voice Subscription noti", data.preferred_subs); CALLBACK_CALL(&data); } else { @@ -304,7 +299,7 @@ static void _process_sat_event(const gchar *sig, GVariant *param, if (!g_strcmp0(sig, "SetupMenu")) { TelSatSetupMenuInfo_t setup_menu; - gchar *title; + gchar *title = NULL; gint command_id, item_cnt; gboolean b_present, b_helpinfo, b_updated; GVariant *items = NULL; @@ -312,7 +307,7 @@ static void _process_sat_event(const gchar *sig, GVariant *param, #if defined(TIZEN_SUPPORT_SAT_ICON) GVariant *icon_id = NULL; GVariant *icon_list = NULL; - int index = 0, icon_index = 0; + int sat_index = 0, icon_index = 0; GVariantIter *iter, *iter2; GVariant *unbox = NULL; /* Used to get icon data */ @@ -326,7 +321,7 @@ static void _process_sat_event(const gchar *sig, GVariant *param, gint icon_list_quali, list_cnt, icon_list_identifier, list_width, list_height, list_ics, icon_list_data_len; gchar *icon_list_data = NULL; #else - int index = 0; + int sat_index = 0; GVariant *unbox; GVariantIter *iter; #endif @@ -343,6 +338,7 @@ static void _process_sat_event(const gchar *sig, GVariant *param, setup_menu.commandId = command_id; setup_menu.bIsMainMenuPresent = (b_present ? 1 : 0); memcpy(setup_menu.satMainTitle, title, TAPI_SAT_DEF_TITLE_LEN_MAX+1); + g_free(title); setup_menu.satMainMenuNum = item_cnt; if(items && item_cnt > 0){ gchar *item_str; @@ -352,11 +348,11 @@ static void _process_sat_event(const gchar *sig, GVariant *param, g_variant_get(unbox, "a(si)", &iter); while(g_variant_iter_loop(iter,"(si)",&item_str, &item_id)){ - setup_menu.satMainMenuItem[index].itemId = item_id; - memcpy(setup_menu.satMainMenuItem[index].itemString, item_str, TAPI_SAT_DEF_ITEM_STR_LEN_MAX + 6); - dbg("item index(%d) id(%d) str(%s)",index, setup_menu.satMainMenuItem[index].itemId, setup_menu.satMainMenuItem[index].itemString); + setup_menu.satMainMenuItem[sat_index].itemId = item_id; + memcpy(setup_menu.satMainMenuItem[sat_index].itemString, item_str, TAPI_SAT_DEF_ITEM_STR_LEN_MAX + 6); + dbg("item index(%d) id(%d) str(%s)",sat_index, setup_menu.satMainMenuItem[sat_index].itemId, setup_menu.satMainMenuItem[sat_index].itemString); //dbg("item index(%d) id(%d) str(%s)",index, item_id, item_str); - index++; + sat_index++; } g_variant_iter_free(iter); } @@ -454,6 +450,7 @@ static void _process_sat_event(const gchar *sig, GVariant *param, #endif display_text.commandId = command_id; memcpy(display_text.text.string, text, TAPI_SAT_DEF_TEXT_STRING_LEN_MAX+1); + g_free(text); display_text.text.stringLen = text_len; display_text.duration = duration; display_text.bIsPriorityHigh = (high_priority ? 1 : 0); @@ -509,7 +506,7 @@ static void _process_sat_event(const gchar *sig, GVariant *param, gchar *icon_data = NULL; GVariant *icon_id = NULL; GVariant *icon_list = NULL; - int index = 0, icon_index = 0; + int select_item_index = 0, icon_index = 0; /* Used to get icon list data */ GVariant *unbox_list, *unbox_list_info ; GVariant *icon_list_info; @@ -517,7 +514,7 @@ static void _process_sat_event(const gchar *sig, GVariant *param, gint icon_list_quali, list_cnt, icon_list_identifier, list_width, list_height, list_ics, icon_list_data_len; gchar *icon_list_data = NULL; #else - int index = 0; + int select_item_index = 0; GVariant *unbox; GVariantIter *iter; #endif @@ -533,6 +530,7 @@ static void _process_sat_event(const gchar *sig, GVariant *param, select_item.commandId = command_id; select_item.bIsHelpInfoAvailable = (help_info ? 1 : 0); memcpy(select_item.text.string, selected_text, TAPI_SAT_DEF_TITLE_LEN_MAX+1); + g_free(selected_text); select_item.text.stringLen = text_len; select_item.defaultItemIndex = default_item_id; select_item.menuItemCount = menu_cnt; @@ -544,12 +542,12 @@ static void _process_sat_event(const gchar *sig, GVariant *param, g_variant_get(unbox, "a(iis)", &iter); while(g_variant_iter_loop(iter,"(iis)",&item_id, &item_len, &item_str)){ - select_item.menuItem[index].itemId = item_id; - select_item.menuItem[index].textLen = item_len; - memcpy(select_item.menuItem[index].text, item_str, TAPI_SAT_ITEM_TEXT_LEN_MAX + 1); - dbg("item index(%d) id(%d) len(%d) str(%s)", index, - select_item.menuItem[index].itemId, select_item.menuItem[index].textLen, select_item.menuItem[index].text); - index++; + select_item.menuItem[select_item_index].itemId = item_id; + select_item.menuItem[select_item_index].textLen = item_len; + memcpy(select_item.menuItem[select_item_index].text, item_str, TAPI_SAT_ITEM_TEXT_LEN_MAX + 1); + dbg("item index(%d) id(%d) len(%d) str(%s)", select_item_index, + select_item.menuItem[select_item_index].itemId, select_item.menuItem[select_item_index].textLen, select_item.menuItem[select_item_index].text); + select_item_index++; } g_variant_iter_free(iter); } @@ -623,7 +621,7 @@ static void _process_sat_event(const gchar *sig, GVariant *param, gint command_id, key_type, input_character_mode; gint text_len, duration; gboolean b_numeric, b_help_info; - gchar *text; + gchar *text = NULL; #if defined(TIZEN_SUPPORT_SAT_ICON) GVariant *unbox = NULL; gboolean is_exist; @@ -647,6 +645,7 @@ static void _process_sat_event(const gchar *sig, GVariant *param, get_inkey.bIsNumeric = (b_numeric ? 1 : 0); get_inkey.bIsHelpInfoAvailable = (b_help_info ? 1 : 0); memcpy(get_inkey.text.string, text, TAPI_SAT_DEF_TEXT_STRING_LEN_MAX+1); + g_free(text); get_inkey.text.stringLen = text_len; get_inkey.duration = duration; @@ -691,7 +690,7 @@ static void _process_sat_event(const gchar *sig, GVariant *param, gint command_id, input_character_mode; gint text_len, def_text_len, rsp_len_min, rsp_len_max; gboolean b_numeric, b_help_info, b_echo_input; - gchar *text, *def_text; + gchar *text = NULL, *def_text = NULL; #if defined(TIZEN_SUPPORT_SAT_ICON) GVariant *unbox = NULL; gboolean is_exist; @@ -715,10 +714,12 @@ static void _process_sat_event(const gchar *sig, GVariant *param, get_input.bIsHelpInfoAvailable = (b_help_info ? 1 : 0); get_input.bIsEchoInput = (b_echo_input ? 1 : 0); memcpy(get_input.text.string, text, TAPI_SAT_DEF_TEXT_STRING_LEN_MAX+1); + g_free(text); get_input.text.stringLen = text_len; get_input.respLen.max = rsp_len_max; get_input.respLen.min = rsp_len_min; memcpy(get_input.defaultText.string, def_text, TAPI_SAT_DEF_TEXT_STRING_LEN_MAX+1); + g_free(def_text); get_input.defaultText.stringLen = def_text_len; #if defined(TIZEN_SUPPORT_SAT_ICON) @@ -765,7 +766,7 @@ static void _process_sat_event(const gchar *sig, GVariant *param, gint command_id, ton, npi, tpdu_type; gboolean b_packing_required; gint text_len, number_len, tpdu_data_len; - gchar* text, *dialling_number; + gchar* text = NULL, *dialling_number = NULL; GVariant *tpdu_data; memset(&send_sms, 0, sizeof(TelSatSendSmsIndSmsData_t)); @@ -780,12 +781,14 @@ static void _process_sat_event(const gchar *sig, GVariant *param, send_sms.address.npi = npi; send_sms.address.diallingNumberLen = number_len; memcpy(send_sms.address.diallingNumber, dialling_number, TAPI_SAT_DIALLING_NUMBER_LEN_MAX); + g_free(dialling_number); + g_free(text); send_sms.smsTpdu.tpduType = tpdu_type; send_sms.smsTpdu.dataLen = tpdu_data_len; if(tpdu_data){ - int index = 0; + int send_sms_index = 0; guchar data; GVariantIter *iter = NULL; GVariant *inner_gv = NULL; @@ -795,9 +798,9 @@ static void _process_sat_event(const gchar *sig, GVariant *param, g_variant_get(inner_gv, "ay", &iter); while( g_variant_iter_loop (iter, "y", &data)){ - dbg("index(%d) data(%c)", index, data); - send_sms.smsTpdu.data[index] = data; - index++; + dbg("index(%d) data(%c)", send_sms_index, data); + send_sms.smsTpdu.data[send_sms_index] = data; + send_sms_index++; } g_variant_iter_free(iter); g_variant_unref(inner_gv); @@ -923,6 +926,8 @@ static void _process_sat_event(const gchar *sig, GVariant *param, send_dtmf.dtmfString.stringLen = dtmf_str_len; memcpy(send_dtmf.dtmfString.string, dtmf_str, TAPI_SAT_DEF_TEXT_STRING_LEN_MAX+1); + g_free(dtmf_str); + g_free(text); dbg("dtmf event command id(%d)", send_dtmf.commandId); dbg("dtmf event dtmf(%s)", send_dtmf.dtmfString.string); @@ -954,6 +959,7 @@ static void _process_sat_event(const gchar *sig, GVariant *param, memcpy(&call_ctrl_result_ind.dispData.string, text, disp_len); call_ctrl_result_ind.bIsUserInfoDisplayEnabled = 1; } + g_free(text); if(strlen(call_num) > 1 && (g_strcmp0(call_num,"") != 0) ){ call_ctrl_result_ind.callCtrlCnfType = TAPI_SAT_CALL_TYPE_MO_VOICE; @@ -981,10 +987,17 @@ static void _process_sat_event(const gchar *sig, GVariant *param, }//ss string exist else{ dbg("not matched call control"); - return; + goto EXIT; } CALLBACK_CALL(&call_ctrl_result_ind); + +EXIT: + g_free(call_num); + g_free(sub_addr); + g_free(ccp1); + g_free(ccp2); + g_free(ss_string); } else if (!g_strcmp0(sig, "MoSmControlResult")) { TelSatMoSmCtrlIndData_t mo_sm_ctrl_result_ind; @@ -1018,6 +1031,9 @@ static void _process_sat_event(const gchar *sig, GVariant *param, else{ dbg("Any destination address are not provided, use default one."); } + g_free(text); + g_free(rp_dst_call_num); + g_free(tp_dst_call_num); CALLBACK_CALL(&mo_sm_ctrl_result_ind); } @@ -1060,8 +1076,8 @@ static void _process_pb_event(const gchar *sig, GVariant *param, &status.pb_list.b_aas, &status.pb_list.b_gas); - dbg("init[%d] fdn[%d] adn[%d] sdn[%d] usim[%d] aas[%d] gas[%d]", - status.init_completed, status.pb_list.b_fdn,status.pb_list.b_adn,status.pb_list.b_sdn,status.pb_list.b_3g,status.pb_list.b_aas,status.pb_list.b_gas); + msg("(%s) init[%d] fdn[%d] adn[%d] sdn[%d] usim[%d] aas[%d] gas[%d]", + handle->cp_name, status.init_completed, status.pb_list.b_fdn,status.pb_list.b_adn,status.pb_list.b_sdn,status.pb_list.b_3g,status.pb_list.b_aas,status.pb_list.b_gas); CALLBACK_CALL(&status); } else { dbg("not handled Phonebook noti[%s]",sig ); @@ -1098,24 +1114,6 @@ static void _process_modem_event(const gchar *sig, GVariant *param, CALLBACK_CALL(¬i); } - else if (!g_strcmp0(sig, "DunPinCtrl")) { - tapi_ps_btdun_pincontrol pin_ctrl; - int signal = 0, status = 0; - - memset(&pin_ctrl, 0, sizeof(tapi_ps_btdun_pincontrol)); - g_variant_get(param, "(ib)", &signal, &status); - pin_ctrl.signal = signal; - pin_ctrl.status = status; - - CALLBACK_CALL(&pin_ctrl); - } - else if (!g_strcmp0(sig, "DunExternalCall")) { - gboolean external_call; - - g_variant_get(param, "(b)", &external_call); - - CALLBACK_CALL(&external_call); - } else { dbg("not handled Modem noti[%s]", sig); } @@ -1147,16 +1145,15 @@ static void _process_ss_event(const gchar *sig, GVariant *param, } CALLBACK_CALL(¬i); + } + else if (!g_strcmp0(sig, "NotifySsInfo")) { + TelSsInfo_t noti; + memset(¬i, 0, sizeof(TelSsInfo_t)); - } else if (!g_strcmp0(sig, "NotifySsInfo")) { - TelSsInfo_t noti; - memset(¬i, 0, sizeof(TelSsInfo_t)); - - g_variant_get(param, "(ii)", ¬i.Cause, ¬i.SsType); + g_variant_get(param, "(ii)", ¬i.Cause, ¬i.SsType); - CALLBACK_CALL(¬i); + CALLBACK_CALL(¬i); } - else if (!g_strcmp0(sig, "ReleaseComplete")) { TelSsRelCompMsgInfo_t noti; GVariant *msg = 0; @@ -1169,21 +1166,21 @@ static void _process_ss_event(const gchar *sig, GVariant *param, noti.RelCompMsgLen = (unsigned char)len; if(msg){ - int i = 0; + int count = 0; guchar data; - GVariantIter *iter = NULL; + GVariantIter *msg_iter = NULL; GVariant *inner_gv = NULL; inner_gv = g_variant_get_variant(msg); - dbg("[ check ] data exist type_format(%s)", g_variant_get_type_string(inner_gv)); + msg("[ check ] data exist type_format(%s)", g_variant_get_type_string(inner_gv)); - g_variant_get(inner_gv, "ay", &iter); - while( g_variant_iter_loop (iter, "y", &data)){ - dbg("index(%d) data(%c)", index, data); - noti.szRelCompMsg[i] = data; - i++; + g_variant_get(inner_gv, "ay", &msg_iter); + while( g_variant_iter_loop (msg_iter, "y", &data)){ + msg("index(%d) data(%c)", count, data); + noti.szRelCompMsg[count] = data; + count++; } - g_variant_iter_free(iter); + g_variant_iter_free(msg_iter); g_variant_unref(inner_gv); } @@ -1198,7 +1195,11 @@ static void _process_ss_event(const gchar *sig, GVariant *param, noti.record_num = g_variant_iter_n_children(iter); - while ( g_variant_iter_next(iter, "a{sv}", &iter_row ) ) { + if (TAPI_SS_RECORD_NUM_MAX < noti.record_num) { + noti.record_num = TAPI_SS_RECORD_NUM_MAX; + } + + while ( g_variant_iter_next(iter, "a{sv}", &iter_row ) && (i < noti.record_num)) { while ( g_variant_iter_loop( iter_row, "{sv}", &key, &value ) ) { if ( !g_strcmp0(key, "ss_class") ) { @@ -1225,7 +1226,7 @@ static void _process_ss_event(const gchar *sig, GVariant *param, noti.record[i].Ton = g_variant_get_int32(value); } - if ( !g_strcmp0(key, "number_plan_identity") ) { + if ( !g_strcmp0(key, "numbering_plan_identity") ) { noti.record[i].Npi = g_variant_get_int32(value); } @@ -1250,7 +1251,11 @@ static void _process_ss_event(const gchar *sig, GVariant *param, noti.record_num = g_variant_iter_n_children(iter); - while ( g_variant_iter_next(iter, "a{sv}", &iter_row ) ) { + if (TAPI_SS_RECORD_NUM_MAX < noti.record_num) { + noti.record_num = TAPI_SS_RECORD_NUM_MAX; + } + + while ( g_variant_iter_next(iter, "a{sv}", &iter_row ) && (i < noti.record_num)) { while ( g_variant_iter_loop( iter_row, "{sv}", &key, &value ) ) { if ( !g_strcmp0(key, "ss_class") ) { @@ -1277,8 +1282,12 @@ static void _process_ss_event(const gchar *sig, GVariant *param, noti.record_num = g_variant_iter_n_children(iter); + if (TAPI_SS_RECORD_NUM_MAX < noti.record_num) { + noti.record_num = TAPI_SS_RECORD_NUM_MAX; + } + while ( g_variant_iter_next(iter, "a{sv}", &iter_row ) ) { - while ( g_variant_iter_loop( iter_row, "{sv}", &key, &value ) ) { + while ( g_variant_iter_loop( iter_row, "{sv}", &key, &value ) && (i < noti.record_num)) { if ( !g_strcmp0(key, "ss_class") ) { noti.record[i].Class = g_variant_get_int32(value); @@ -1327,28 +1336,6 @@ static void _process_gps_event(const gchar *sig, GVariant *param, else if (!g_strcmp0(sig, "FrequencyAiding")) { b_decode_data = TRUE; } - else if (!g_strcmp0(sig, "AreaStatus")) { - struct tel_noti_smart_assistant_area_status noti; - int area_status = 0, index = 0; - - memset(¬i, 0, sizeof(struct tel_noti_smart_assistant_area_status)); - g_variant_get(param, "(ii)", &area_status, &index); - noti.area_status = area_status; - noti.index = index; - - CALLBACK_CALL(¬i); - } - else if (!g_strcmp0(sig, "SyncStatus")) { - struct tel_noti_smart_assistant_sync_status noti; - int init_status = 0, init_fail_cause = 0; - - memset(¬i, 0, sizeof(struct tel_noti_smart_assistant_sync_status)); - g_variant_get(param, "(ii)", &init_status, &init_fail_cause); - noti.init_status = init_status; - noti.init_fail_cause = init_fail_cause; - - CALLBACK_CALL(¬i); - } else { dbg("not handled Gps noti[%s]", sig); } @@ -1364,7 +1351,7 @@ static void _process_gps_event(const gchar *sig, GVariant *param, if (decoded_data) { CALLBACK_CALL(decoded_data); } - + g_free(data); dbg("length=%d", length); } @@ -1372,7 +1359,6 @@ static void _process_gps_event(const gchar *sig, GVariant *param, g_free(decoded_data); } - static void on_prop_callback(GDBusConnection *conn, const gchar *name, const gchar *path, const gchar *interface, const gchar *sig, GVariant *param, gpointer user_data) { @@ -1405,11 +1391,24 @@ static void on_prop_callback(GDBusConnection *conn, const gchar *name, const gch g_variant_iter_init (&iter, changed_properties); while (g_variant_iter_next (&iter, "{sv}", &key, &value)) { + + memset(noti_id, 0, 256); + snprintf (noti_id, 255, "%s:%s", interface_name_for_signal, key); + + evt_cb_data = g_hash_table_lookup (handle->evt_list, noti_id); + if (!evt_cb_data) { + g_variant_unref (value); + g_free((gchar *)key); + /* ignore un-registered property change callback */ + continue; + + } if (g_variant_is_of_type (value, G_VARIANT_TYPE_STRING )) { data = g_try_malloc0 (g_variant_get_size (value) + 3); if (!data) { warn ("g_try_malloc0 failed"); g_variant_unref (value); + g_free((gchar *)key); continue; } data[0] = 's'; @@ -1425,26 +1424,17 @@ static void on_prop_callback(GDBusConnection *conn, const gchar *name, const gch data = g_strdup_printf ("i:%d", *(int *) g_variant_get_data (value)); } - g_variant_unref (value); - - memset(noti_id, 0, 256); - snprintf (noti_id, 255, "%s:%s", interface_name_for_signal, key); - - evt_cb_data = g_hash_table_lookup (handle->evt_list, noti_id); - if (!evt_cb_data) { - /* ignore un-registered property change callback */ - continue; - } - prev_value = g_hash_table_lookup (handle->cache_property, noti_id); if (prev_value) { if (g_strcmp0 (data, prev_value) == 0) { g_free (data); + g_variant_unref (value); + g_free((gchar *)key); continue; } } - dbg("save prop: [%s] - [%s]", noti_id, data); + msg("[%s] save prop: [%s] - [%s]", handle->cp_name, noti_id, data); g_hash_table_replace (handle->cache_property, g_strdup(noti_id), data); { @@ -1457,6 +1447,8 @@ static void on_prop_callback(GDBusConnection *conn, const gchar *name, const gch CALLBACK_CALL((void * )¶m_i); } } + g_variant_unref (value); + g_free((gchar *)key); } if (changed_properties != NULL ) @@ -1522,19 +1514,15 @@ static void on_signal_callback(GDBusConnection *conn, const gchar *name, const g EXPORT_API char** tel_get_cp_name_list(void) { + GDBusObjectManager *obj_manager = NULL; gpointer d_conn = NULL; + GList *objects = NULL; + unsigned int cp_count = 0; + char **cp_list = NULL; + GList *iter = NULL; + unsigned int index = 0; GError *error = NULL; - GVariantIter *iter = NULL; - GVariant *rst = NULL; - - gchar *modem_path = NULL; - GSList *list = NULL; - GSList *l = NULL; - - int i = 0, element_cnt = 0; - gchar **cp_list = NULL; - d_conn = g_bus_get_sync(G_BUS_TYPE_SYSTEM, NULL, &error); if (!d_conn) { err("Error creating dbus connection: %s\n", error->message); @@ -1542,49 +1530,42 @@ EXPORT_API char** tel_get_cp_name_list(void) return NULL; } - rst = g_dbus_connection_call_sync(d_conn, DBUS_TELEPHONY_SERVICE , "/org/tizen/telephony", - "org.tizen.telephony.Manager", "GetModems", NULL, NULL, - G_DBUS_CALL_FLAGS_NONE, TAPI_DEFAULT_TIMEOUT, NULL, &error); - - if (!rst) { - dbg( "GetModems() failed. (%s)", error->message); + obj_manager = g_dbus_object_manager_client_new_sync(d_conn, + G_DBUS_OBJECT_MANAGER_CLIENT_FLAGS_NONE, + DBUS_TELEPHONY_SERVICE, /* "org.tizen.telephony" */ + DBUS_TELEPHONY_DEFAULT_PATH, /* "/org/tizen/telephony" */ + NULL, NULL, NULL, + NULL, &error); + if (error) { + err("Error getting object manager client: %s", error->message); g_error_free (error); - goto OUT; - } - - g_variant_get (rst, "(as)", &iter); - while (g_variant_iter_next(iter, "s", &modem_path)){ - list = g_slist_append(list, modem_path); + g_object_unref(d_conn); + return NULL; } - g_variant_iter_free (iter); - if (!list) { - dbg( "No CP name"); - goto OUT; - } + objects = g_dbus_object_manager_get_objects(obj_manager); + cp_count = g_list_length(objects); - element_cnt = g_slist_length(list); - cp_list = g_new0(char*, element_cnt + 1); - if (!cp_list) { + if (cp_count == 0) { + warn("cp count is 0"); goto OUT; } - - for (l = list; l; l = l->next, i++) { - cp_list[i] = g_strdup(l->data); - g_free (l->data); - - dbg("cp name[%d] = %s", i, cp_list[i]); + /* This will be freed by caller. +1 for NULL str at the end */ + cp_list = g_new0(char*, cp_count + 1); + for (iter = objects, index = 0; iter != NULL; iter = iter->next, index++) { + gpointer *object = iter->data; + const gchar *object_path = g_dbus_object_get_object_path(G_DBUS_OBJECT(object)); + if (object_path) { + /* CP list Will be freed up caller */ + (cp_list)[index] = g_path_get_basename(object_path); + dbg("CP Name[%d/%d]: [%s]", index, cp_count-1, cp_list[index]); + } } - cp_list[element_cnt] = NULL; - - g_slist_free(list); OUT: - if(d_conn) - g_object_unref(d_conn); - - if (rst) - g_variant_unref(rst); + g_object_unref(d_conn); + g_list_free_full(objects, g_object_unref); + g_object_unref (obj_manager); return cp_list; } @@ -1617,14 +1598,19 @@ static char *get_property (TapiHandle *handle, const char *property, TAPI_DEFAULT_TIMEOUT, handle->ca, &error); if (error) { - warn("dbus error = %d (%s)", error->code, error->message); - g_error_free (error); + if (error->code == G_DBUS_ERROR_ACCESS_DENIED) { + warn("Access Denied"); + g_error_free(error); + return g_strdup("No access rights"); + } else { + warn("dbus error = %d (%s)", error->code, error->message); + g_error_free (error); + } } if (!value_container) return NULL ; - dbg("%s - type:[%s]", property, g_variant_get_type_string(value_container)); g_variant_get (value_container, "(v)", &value); g_variant_unref (value_container); @@ -1643,6 +1629,7 @@ static char *get_property (TapiHandle *handle, const char *property, else { data = g_strdup_printf ("%d", *(int *) g_variant_get_data (value)); } + msg("prop:[%s][%s] - [%s]", handle->cp_name, dbus_info[1], data); g_variant_unref (value); @@ -1662,8 +1649,11 @@ EXPORT_API int tel_get_property_int (TapiHandle *handle, TAPI_RET_ERR_NUM_IF_FAIL(result, TAPI_API_INVALID_INPUT); data = get_property (handle, property, G_VARIANT_TYPE_INT32); - if (!data) + if (!data) { return TAPI_API_OPERATION_FAILED; + } else if (!g_strcmp0(data, "No access rights")) { + return TAPI_API_ACCESS_DENIED; + } *result = atoi(data); @@ -1681,8 +1671,11 @@ EXPORT_API int tel_get_property_string(TapiHandle *handle, const char *property, TAPI_RET_ERR_NUM_IF_FAIL(result, TAPI_API_INVALID_INPUT); data = get_property (handle, property, G_VARIANT_TYPE_STRING); - if (!data) + if (!data) { return TAPI_API_OPERATION_FAILED; + } else if (!g_strcmp0(data, "No access rights")) { + return TAPI_API_ACCESS_DENIED; + } *result = data; @@ -1694,7 +1687,9 @@ EXPORT_API TapiHandle* tel_init(const char *cp_name) GError *error = NULL; struct tapi_handle *handle; +#if !GLIB_CHECK_VERSION(2, 35, 0) g_type_init(); +#endif handle = g_new0(struct tapi_handle, 1); if (!handle) { @@ -1709,8 +1704,8 @@ EXPORT_API TapiHandle* tel_init(const char *cp_name) return NULL; } - dbg("unique_name:[%s] invocation:[%s]", g_dbus_connection_get_unique_name( - handle->dbus_connection), program_invocation_name); + msg("tel_init: [%s]:[%s]:[%s]", g_dbus_connection_get_unique_name( + handle->dbus_connection), program_invocation_name, cp_name?cp_name:"Null"); handle->ca = g_cancellable_new(); @@ -1725,7 +1720,7 @@ EXPORT_API TapiHandle* tel_init(const char *cp_name) if (!list) { g_cancellable_cancel(handle->ca); g_object_unref(handle->ca); - + g_object_unref(handle->dbus_connection); g_free(handle); return NULL; } @@ -1733,7 +1728,7 @@ EXPORT_API TapiHandle* tel_init(const char *cp_name) if (!list[0]) { g_cancellable_cancel(handle->ca); g_object_unref(handle->ca); - + g_object_unref(handle->dbus_connection); g_free(handle); g_free (list); return NULL; @@ -1791,7 +1786,7 @@ EXPORT_API int tel_deinit(TapiHandle* handle) memset(handle, 0, sizeof(struct tapi_handle)); g_free(handle); - dbg("done"); + msg("tel_deinit done"); return TAPI_API_SUCCESS; } @@ -1830,7 +1825,7 @@ EXPORT_API int tel_register_noti_event (TapiHandle *handle, const char *noti_id, evt_cb_data->cb_fn = callback; evt_cb_data->user_data = user_data; - dbg("path(%s) interface (%s) signal (%s)", handle->path, dbus_str[0], dbus_str[1]); + dbg("[%s] signal (%s)", handle->cp_name, dbus_str[1]); if (dbus_str[1][0] >= 'a' && dbus_str[1][0] <= 'z') { /* Property change callback - only one time */ diff --git a/wearable/src/tapi_log.h b/src/tapi_log.h similarity index 96% rename from wearable/src/tapi_log.h rename to src/tapi_log.h index ac55658..158d2ac 100644 --- a/wearable/src/tapi_log.h +++ b/src/tapi_log.h @@ -1,7 +1,7 @@ /* * libslp-tapi * - * Copyright (c) 2012 Samsung Electronics Co., Ltd. All rights reserved. + * Copyright (c) 2014 Samsung Electronics Co., Ltd. All rights reserved. * * Contact: Ja-young Gu * diff --git a/wearable/src/tapi_modem.c b/src/tapi_modem.c similarity index 75% rename from wearable/src/tapi_modem.c rename to src/tapi_modem.c index d67e21c..2c282f2 100644 --- a/wearable/src/tapi_modem.c +++ b/src/tapi_modem.c @@ -1,7 +1,7 @@ /* * libslp-tapi * - * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * Copyright (c) 2014 Samsung Electronics Co., Ltd. All rights reserved. * * Contact: Ja-young Gu * @@ -28,7 +28,6 @@ #include "TelMisc.h" #include "TelPower.h" #include "ITapiModem.h" -#include "ITapiPS.h" #include "common.h" #include "tapi_log.h" @@ -44,19 +43,7 @@ static void on_response_default_set(GObject *source_object, GAsyncResult *res, g conn = G_DBUS_CONNECTION (source_object); dbus_result = g_dbus_connection_call_finish(conn, res, &error); - CHECK_DEINIT(error); - - if (!dbus_result) { - if (evt_cb_data->cb_fn) { - evt_cb_data->cb_fn(evt_cb_data->handle, -1, NULL, evt_cb_data->user_data); - } - - if (error) - g_error_free(error); - - g_free(evt_cb_data); - return; - } + CHECK_ERROR(error); g_variant_get (dbus_result, "(i)", &result); @@ -65,6 +52,7 @@ static void on_response_default_set(GObject *source_object, GAsyncResult *res, g } g_free(evt_cb_data); + g_variant_unref(dbus_result); } static void on_response_get_version(GObject *source_object, GAsyncResult *res, gpointer user_data) @@ -82,19 +70,7 @@ static void on_response_get_version(GObject *source_object, GAsyncResult *res, g conn = G_DBUS_CONNECTION (source_object); dbus_result = g_dbus_connection_call_finish(conn, res, &error); - CHECK_DEINIT(error); - - if (!dbus_result) { - if (evt_cb_data->cb_fn) { - evt_cb_data->cb_fn(evt_cb_data->handle, -1, NULL, evt_cb_data->user_data); - } - - if (error) - g_error_free(error); - - g_free(evt_cb_data); - return; - } + CHECK_ERROR(error); g_variant_get (dbus_result, "(issss)", &result, &sw, &hw, &rf, &product); @@ -106,6 +82,11 @@ static void on_response_get_version(GObject *source_object, GAsyncResult *res, g g_strlcpy((gchar *)data.szRfCalDate, rf, MAX_VERSION_LEN); g_strlcpy((gchar *)data.szProductCode, product, TAPI_MISC_PRODUCT_CODE_LEN_MAX); + g_free(sw); + g_free(hw); + g_free(rf); + g_free(product); + if (evt_cb_data->cb_fn) { if (result != 0) evt_cb_data->cb_fn(evt_cb_data->handle, result, NULL, evt_cb_data->user_data); @@ -113,6 +94,7 @@ static void on_response_get_version(GObject *source_object, GAsyncResult *res, g evt_cb_data->cb_fn(evt_cb_data->handle, result, &data, evt_cb_data->user_data); } g_free(evt_cb_data); + g_variant_unref(dbus_result); } static void on_response_get_serial_number(GObject *source_object, GAsyncResult *res, gpointer user_data) @@ -121,36 +103,38 @@ static void on_response_get_serial_number(GObject *source_object, GAsyncResult * GDBusConnection *conn = NULL; struct tapi_resp_data *evt_cb_data = user_data; int result = -1; - char *sn = NULL; + TelMiscSNInformation data; + char *sn = NULL, *meid = NULL, *imei = NULL, *imeisv = NULL; GVariant *dbus_result; conn = G_DBUS_CONNECTION (source_object); dbus_result = g_dbus_connection_call_finish(conn, res, &error); - CHECK_DEINIT(error); + CHECK_ERROR(error); - if (!dbus_result) { - if (evt_cb_data->cb_fn) { - evt_cb_data->cb_fn(evt_cb_data->handle, -1, NULL, evt_cb_data->user_data); - } + g_variant_get (dbus_result, "(issss)", &result, + &sn, &meid, &imei, &imeisv); - if (error) - g_error_free(error); + g_strlcpy((gchar *)data.szEsn, sn, TAPI_MISC_ME_SN_LEN_MAX); + g_strlcpy((gchar *)data.szMeid, meid, TAPI_MISC_ME_SN_LEN_MAX); + g_strlcpy((gchar *)data.szImei, imei, TAPI_MISC_ME_SN_LEN_MAX); + g_strlcpy((gchar *)data.szImeiSv, imeisv, TAPI_MISC_ME_SN_LEN_MAX); - g_free(evt_cb_data); - return; - } - g_variant_get (dbus_result, "(is)", &result, &sn); + g_free(sn); + g_free(meid); + g_free(imei); + g_free(imeisv); if (evt_cb_data->cb_fn) { if (result != 0) evt_cb_data->cb_fn(evt_cb_data->handle, result, NULL, evt_cb_data->user_data); else - evt_cb_data->cb_fn(evt_cb_data->handle, result, sn, evt_cb_data->user_data); + evt_cb_data->cb_fn(evt_cb_data->handle, result, &data, evt_cb_data->user_data); } g_free(evt_cb_data); + g_variant_unref(dbus_result); } static void on_response_get_imei(GObject *source_object, GAsyncResult *res, gpointer user_data) @@ -165,19 +149,7 @@ static void on_response_get_imei(GObject *source_object, GAsyncResult *res, gpoi conn = G_DBUS_CONNECTION (source_object); dbus_result = g_dbus_connection_call_finish(conn, res, &error); - CHECK_DEINIT(error); - - if (!dbus_result) { - if (evt_cb_data->cb_fn) { - evt_cb_data->cb_fn(evt_cb_data->handle, -1, NULL, evt_cb_data->user_data); - } - - if (error) - g_error_free(error); - - g_free(evt_cb_data); - return; - } + CHECK_ERROR(error); g_variant_get (dbus_result, "(is)", &result, &imei); @@ -187,43 +159,10 @@ static void on_response_get_imei(GObject *source_object, GAsyncResult *res, gpoi else evt_cb_data->cb_fn(evt_cb_data->handle, result, imei, evt_cb_data->user_data); } + g_free(imei); g_free(evt_cb_data); -} - -static void on_response_set_dun_pin_ctrl(GObject *source_object, GAsyncResult *res, gpointer user_data) -{ - GError *error = NULL; - GDBusConnection *conn = NULL; - struct tapi_resp_data *evt_cb_data = user_data; - int result = -1; - - GVariant *dbus_result; - - conn = G_DBUS_CONNECTION (source_object); - dbus_result = g_dbus_connection_call_finish(conn, res, &error); - CHECK_DEINIT(error); - - if (!dbus_result) { - if (evt_cb_data->cb_fn) { - evt_cb_data->cb_fn(evt_cb_data->handle, -1, NULL, evt_cb_data->user_data); - } - - if (error) - g_error_free(error); - - g_free(evt_cb_data); - return; - } - - g_variant_get (dbus_result, "(i)", &result); - dbg("dun pin ctrl result(%d)", result); - - if (evt_cb_data->cb_fn) { - evt_cb_data->cb_fn(evt_cb_data->handle, result, 0, evt_cb_data->user_data); - } - - g_free(evt_cb_data); + g_variant_unref(dbus_result); } static void on_response_get_flight_mode(GObject *source_object, GAsyncResult *res, gpointer user_data) @@ -238,19 +177,7 @@ static void on_response_get_flight_mode(GObject *source_object, GAsyncResult *re conn = G_DBUS_CONNECTION (source_object); dbus_result = g_dbus_connection_call_finish(conn, res, &error); - CHECK_DEINIT(error); - - if (!dbus_result) { - if (evt_cb_data->cb_fn) { - evt_cb_data->cb_fn(evt_cb_data->handle, -1, NULL, evt_cb_data->user_data); - } - - if (error) - g_error_free(error); - - g_free(evt_cb_data); - return; - } + CHECK_ERROR(error); g_variant_get (dbus_result, "(bi)", &mode, &result); @@ -259,6 +186,7 @@ static void on_response_get_flight_mode(GObject *source_object, GAsyncResult *re } g_free(evt_cb_data); + g_variant_unref(dbus_result); } /** @@ -277,13 +205,12 @@ EXPORT_API int tel_process_power_command(TapiHandle *handle, tapi_power_phone_cm struct tapi_resp_data *evt_cb_data = NULL; GVariant *param; - dbg("Func Entrance"); - TAPI_RET_ERR_NUM_IF_FAIL(handle, TAPI_API_INVALID_PTR); - if (cmd > TAPI_PHONE_POWER_RESET) - return TAPI_API_INVALID_INPUT; + msg("[%s] tel_process_power_command:[%d] (0:ON,1:OFF,2:RST,3:LOW)", handle->cp_name, cmd); + if (cmd > TAPI_PHONE_POWER_MAX) + return TAPI_API_INVALID_INPUT; MAKE_RESP_CB_DATA(evt_cb_data, handle, callback, user_data); param = g_variant_new("(i)", cmd); @@ -314,10 +241,10 @@ EXPORT_API int tel_set_flight_mode(TapiHandle *handle, tapi_power_flight_mode_ty GVariant *param; gboolean b_mode; - dbg("Func Entrance"); - TAPI_RET_ERR_NUM_IF_FAIL(handle, TAPI_API_INVALID_PTR); + msg("[%s] requested flight mode:[%d] (1:enter, 2:leave)", handle->cp_name, mode); + if (mode == TAPI_POWER_FLIGHT_MODE_ENTER) { b_mode = TRUE; } @@ -396,7 +323,7 @@ EXPORT_API TelMiscVersionInformation *tel_get_misc_me_version_sync(TapiHandle *h dbus_result = g_dbus_connection_call_sync(handle->dbus_connection, DBUS_TELEPHONY_SERVICE , handle->path, DBUS_TELEPHONY_MODEM_INTERFACE, "GetVersion", NULL, NULL, - G_DBUS_CALL_FLAGS_NONE, TAPI_DEFAULT_TIMEOUT, handle->ca, &error); + G_DBUS_CALL_FLAGS_NONE, TAPI_SHORT_TIMEOUT, handle->ca, &error); if (error) { warn("dbus error = %d (%s)", error->code, error->message); @@ -408,20 +335,26 @@ EXPORT_API TelMiscVersionInformation *tel_get_misc_me_version_sync(TapiHandle *h g_variant_get (dbus_result, "(issss)", &result, &sw, &hw, &rf, &product); + g_variant_unref(dbus_result); if (result != 0) - return NULL; + goto OUT; dbg("product code[%s]", product); data = calloc(1, sizeof(TelMiscVersionInformation)); if (!data) - return NULL; + goto OUT; g_strlcpy((gchar *)data->szSwVersion, sw, MAX_VERSION_LEN); g_strlcpy((gchar *)data->szHwVersion, hw, MAX_VERSION_LEN); g_strlcpy((gchar *)data->szRfCalDate, rf, MAX_VERSION_LEN); g_strlcpy((gchar *)data->szProductCode, product, TAPI_MISC_PRODUCT_CODE_LEN_MAX); +OUT: + g_free(sw); + g_free(hw); + g_free(rf); + g_free(product); return data; } @@ -430,13 +363,13 @@ EXPORT_API int tel_get_misc_me_imei(TapiHandle *handle, tapi_response_cb callbac { struct tapi_resp_data *evt_cb_data = NULL; - sdbg("Func Entrance"); - TAPI_RET_ERR_NUM_IF_FAIL(handle, TAPI_API_INVALID_PTR); TAPI_RET_ERR_NUM_IF_FAIL(callback, TAPI_API_INVALID_PTR); MAKE_RESP_CB_DATA(evt_cb_data, handle, callback, user_data); + sdbg("[%s] Func Entrance", handle->cp_name); + g_dbus_connection_call(handle->dbus_connection, DBUS_TELEPHONY_SERVICE , handle->path, DBUS_TELEPHONY_MODEM_INTERFACE, "GetIMEI", NULL, NULL, @@ -453,14 +386,14 @@ EXPORT_API char *tel_get_misc_me_imei_sync(TapiHandle *handle) char *imei = NULL; int result = 0; - sdbg("Func Entrance"); - TAPI_RET_ERR_NUM_IF_FAIL(handle, NULL); + sdbg("[%s] Func Entrance", handle->cp_name); + dbus_result = g_dbus_connection_call_sync(handle->dbus_connection, DBUS_TELEPHONY_SERVICE , handle->path, DBUS_TELEPHONY_MODEM_INTERFACE, "GetIMEI", NULL, NULL, - G_DBUS_CALL_FLAGS_NONE, TAPI_DEFAULT_TIMEOUT, handle->ca, &error); + G_DBUS_CALL_FLAGS_NONE, TAPI_SHORT_TIMEOUT, handle->ca, &error); if (error) { warn("dbus error = %d (%s)", error->code, error->message); @@ -471,9 +404,12 @@ EXPORT_API char *tel_get_misc_me_imei_sync(TapiHandle *handle) return NULL; g_variant_get (dbus_result, "(is)", &result, &imei); + g_variant_unref(dbus_result); - if (result != 0) + if (result != 0) { + g_free(imei); return NULL; + } return imei; } @@ -482,13 +418,13 @@ EXPORT_API int tel_get_misc_me_sn(TapiHandle *handle, tapi_response_cb callback, { struct tapi_resp_data *evt_cb_data = NULL; - sdbg("Func Entrance"); - TAPI_RET_ERR_NUM_IF_FAIL(handle, TAPI_API_INVALID_PTR); TAPI_RET_ERR_NUM_IF_FAIL(callback, TAPI_API_INVALID_PTR); MAKE_RESP_CB_DATA(evt_cb_data, handle, callback, user_data); + sdbg("[%s] Func Entrance", handle->cp_name); + g_dbus_connection_call(handle->dbus_connection, DBUS_TELEPHONY_SERVICE , handle->path, DBUS_TELEPHONY_MODEM_INTERFACE, "GetSerialNumber", NULL, NULL, @@ -498,22 +434,22 @@ EXPORT_API int tel_get_misc_me_sn(TapiHandle *handle, tapi_response_cb callback, return TAPI_API_SUCCESS; } -EXPORT_API char *tel_get_misc_me_sn_sync(TapiHandle *handle) +EXPORT_API TelMiscSNInformation *tel_get_misc_me_sn_sync(TapiHandle *handle) { GVariant *dbus_result; GError *error = NULL; - char *sn = NULL; + char *sn = NULL, *meid = NULL,*imei = NULL, *imeisv = NULL; + TelMiscSNInformation *data = NULL; int result = 0; - sdbg("Func Entrance"); - TAPI_RET_ERR_NUM_IF_FAIL(handle, NULL); + sdbg("[%s] Func Entrance", handle->cp_name); + dbus_result = g_dbus_connection_call_sync(handle->dbus_connection, DBUS_TELEPHONY_SERVICE , handle->path, DBUS_TELEPHONY_MODEM_INTERFACE, "GetSerialNumber", NULL, NULL, - G_DBUS_CALL_FLAGS_NONE, TAPI_DEFAULT_TIMEOUT, handle->ca, &error); - + G_DBUS_CALL_FLAGS_NONE, TAPI_SHORT_TIMEOUT, handle->ca, &error); if (error) { warn("dbus error = %d (%s)", error->code, error->message); g_error_free(error); @@ -522,54 +458,47 @@ EXPORT_API char *tel_get_misc_me_sn_sync(TapiHandle *handle) if (!dbus_result) return NULL; - g_variant_get (dbus_result, "(is)", &result, &sn); + g_variant_get (dbus_result, "(issss)", &result, &sn, &meid, &imei, &imeisv); + g_variant_unref(dbus_result); if (result != 0) - return NULL; + goto OUT; + + data = calloc(1, sizeof(TelMiscSNInformation)); + if (!data) + goto OUT; + + g_strlcpy((gchar *)data->szEsn, sn, TAPI_MISC_ME_SN_LEN_MAX); + g_strlcpy((gchar *)data->szMeid, meid, TAPI_MISC_ME_SN_LEN_MAX); + g_strlcpy((gchar *)data->szImei, imei, TAPI_MISC_ME_SN_LEN_MAX); + g_strlcpy((gchar *)data->szImeiSv, imeisv, TAPI_MISC_ME_SN_LEN_MAX); - return sn; +OUT: + g_free(sn); + g_free(meid); + g_free(imei); + g_free(imeisv); + + return data; } EXPORT_API int tel_check_modem_power_status(TapiHandle *handle, int *result) { int ret = TAPI_API_SUCCESS; - dbg("Func Entrance"); - TAPI_RET_ERR_NUM_IF_FAIL(handle, TAPI_API_INVALID_PTR); TAPI_RET_ERR_NUM_IF_FAIL(result, TAPI_API_INVALID_PTR); ret = tel_get_property_int(handle, TAPI_PROP_MODEM_POWER, result); - if (ret != TAPI_API_SUCCESS) { - warn("failed. (ret=0x%x)", ret); + if (ret == TAPI_API_ACCESS_DENIED) { + err("Access denied"); + return ret; + } else if (ret != TAPI_API_SUCCESS) { + err("failed. (ret=%d)", ret); return ret; } - dbg("power status = %d (0=on,1=off,2=err)", *result); + msg("[%s] modem_power_status = %d (0=on,1=off,2=rst,3=low)", handle->cp_name, *result); return ret; } - -EXPORT_API int tel_control_modem_dun_pin_ctrl(TapiHandle *handle, tapi_ps_btdun_pincontrol *pincontrol, tapi_response_cb callback, void *user_data) -{ - struct tapi_resp_data *evt_cb_data = NULL; - GVariant *param; - - dbg("Func Entrance "); - - TAPI_RET_ERR_NUM_IF_FAIL(handle, TAPI_API_INVALID_PTR); - TAPI_RET_ERR_NUM_IF_FAIL(handle->dbus_connection, TAPI_API_INVALID_PTR); - TAPI_RET_ERR_NUM_IF_FAIL(pincontrol, TAPI_API_INVALID_PTR); - - MAKE_RESP_CB_DATA(evt_cb_data, handle, callback, user_data); - - param = g_variant_new("(ib)", pincontrol->signal, pincontrol->status); - - g_dbus_connection_call(handle->dbus_connection, - DBUS_TELEPHONY_SERVICE , handle->path, DBUS_TELEPHONY_MODEM_INTERFACE, - "SetDunPinCtrl", param, NULL, - G_DBUS_CALL_FLAGS_NONE, TAPI_DEFAULT_TIMEOUT, handle->ca, - on_response_set_dun_pin_ctrl, evt_cb_data); - - return TAPI_API_SUCCESS; -} diff --git a/wearable/src/tapi_network.c b/src/tapi_network.c similarity index 73% rename from wearable/src/tapi_network.c rename to src/tapi_network.c index 66cf63c..79f3830 100644 --- a/wearable/src/tapi_network.c +++ b/src/tapi_network.c @@ -1,7 +1,7 @@ /* * libslp-tapi * - * Copyright (c) 2012 Samsung Electronics Co., Ltd. All rights reserved. + * Copyright (c) 2014 Samsung Electronics Co., Ltd. All rights reserved. * * Contact: Ja-young Gu * @@ -35,62 +35,57 @@ static int _convert_systemtype_to_act(int type) switch (type) { case TAPI_NETWORK_SYSTEM_GSM: return 0x1; - break; case TAPI_NETWORK_SYSTEM_GPRS: return 0x2; - break; case TAPI_NETWORK_SYSTEM_EGPRS: return 0x3; - break; case TAPI_NETWORK_SYSTEM_PCS1900: break; case TAPI_NETWORK_SYSTEM_UMTS: return 0x4; - break; case TAPI_NETWORK_SYSTEM_GSM_AND_UMTS: return 0x5; - break; case TAPI_NETWORK_SYSTEM_IS95A: return 0x11; - break; case TAPI_NETWORK_SYSTEM_IS95B: return 0x12; - break; case TAPI_NETWORK_SYSTEM_CDMA_1X: return 0x13; - break; case TAPI_NETWORK_SYSTEM_EVDO_REV_0: return 0x14; - break; case TAPI_NETWORK_SYSTEM_1X_EVDO_REV_0_HYBRID: return 0x15; - break; case TAPI_NETWORK_SYSTEM_EVDO_REV_A: return 0x16; - break; case TAPI_NETWORK_SYSTEM_1X_EVDO_REV_A_HYBRID: return 0x17; - break; - case TAPI_NETWORK_SYSTEM_EVDV: + case TAPI_NETWORK_SYSTEM_EVDO_REV_B: return 0x18; - break; + + case TAPI_NETWORK_SYSTEM_1X_EVDO_REV_B_HYBRID: + return 0x19; + + case TAPI_NETWORK_SYSTEM_EVDV: + return 0x1A; + + case TAPI_NETWORK_SYSTEM_EHRPD: + return 0x1B; case TAPI_NETWORK_SYSTEM_LTE: return 0x21; - break; default: break; @@ -104,59 +99,54 @@ static int _convert_act_to_systemtype(int act) switch (act) { case 0x1: return TAPI_NETWORK_SYSTEM_GSM; - break; case 0x2: return TAPI_NETWORK_SYSTEM_GPRS; - break; case 0x3: return TAPI_NETWORK_SYSTEM_EGPRS; - break; case 0x4: return TAPI_NETWORK_SYSTEM_UMTS; - break; case 0x5: return TAPI_NETWORK_SYSTEM_GSM_AND_UMTS; - break; case 0x11: return TAPI_NETWORK_SYSTEM_IS95A; - break; case 0x12: return TAPI_NETWORK_SYSTEM_IS95B; - break; case 0x13: return TAPI_NETWORK_SYSTEM_CDMA_1X; - break; case 0x14: return TAPI_NETWORK_SYSTEM_EVDO_REV_0; - break; case 0x15: return TAPI_NETWORK_SYSTEM_1X_EVDO_REV_0_HYBRID; - break; case 0x16: return TAPI_NETWORK_SYSTEM_EVDO_REV_A; - break; case 0x17: return TAPI_NETWORK_SYSTEM_1X_EVDO_REV_A_HYBRID; - break; case 0x18: + return TAPI_NETWORK_SYSTEM_EVDO_REV_B; + + case 0x19: + return TAPI_NETWORK_SYSTEM_1X_EVDO_REV_B_HYBRID; + + case 0x1A: return TAPI_NETWORK_SYSTEM_EVDV; - break; + + case 0x1B: + return TAPI_NETWORK_SYSTEM_EHRPD; case 0x21: return TAPI_NETWORK_SYSTEM_LTE; - break; default: break; @@ -168,7 +158,7 @@ static int _convert_act_to_systemtype(int act) static void on_signal_registration_status (TapiHandle *handle, GVariant *param, char *noti_id, struct tapi_evt_cb *evt_cb_data) { - struct tel_noti_network_registration_status noti; + TelNetworkRegistrationStatus_t noti; g_variant_get(param, "(iiib)", ¬i.cs, ¬i.ps, ¬i.type, ¬i.is_roaming); @@ -204,58 +194,13 @@ static void on_signal_change (TapiHandle *handle, GVariant *param, int act; memset(¬i, 0, sizeof(struct tel_noti_network_change)); - g_variant_get(param, "(isi)", &act, &plmn, ¬i.lac); + g_variant_get(param, "(is)", &act, &plmn); - switch (act) { - case 0x1: - noti.act = TAPI_NETWORK_SYSTEM_GSM; - break; - case 0x2: - noti.act = TAPI_NETWORK_SYSTEM_GPRS; - break; - case 0x3: - noti.act = TAPI_NETWORK_SYSTEM_EGPRS; - break; - case 0x4: - noti.act = TAPI_NETWORK_SYSTEM_UMTS; - break; - case 0x5: - noti.act = TAPI_NETWORK_SYSTEM_GSM_AND_UMTS; - break; - case 0x11: - noti.act = TAPI_NETWORK_SYSTEM_IS95A; - break; - case 0x12: - noti.act = TAPI_NETWORK_SYSTEM_IS95B; - break; - case 0x13: - noti.act = TAPI_NETWORK_SYSTEM_CDMA_1X; - break; - case 0x14: - noti.act = TAPI_NETWORK_SYSTEM_EVDO_REV_0; - break; - case 0x15: - noti.act = TAPI_NETWORK_SYSTEM_1X_EVDO_REV_0_HYBRID; - break; - case 0x16: - noti.act = TAPI_NETWORK_SYSTEM_EVDO_REV_A; - break; - case 0x17: - noti.act = TAPI_NETWORK_SYSTEM_1X_EVDO_REV_A_HYBRID; - break; - case 0x18: - noti.act = TAPI_NETWORK_SYSTEM_EVDV; - break; - case 0x21: - noti.act = TAPI_NETWORK_SYSTEM_LTE; - break; - default: - noti.act = TAPI_NETWORK_SYSTEM_NO_SRV; - break; - } + noti.act = _convert_act_to_systemtype(act); if (plmn) { snprintf(noti.plmn, 7, "%s", plmn); + g_free(plmn); } CALLBACK_CALL(¬i); @@ -275,6 +220,7 @@ static void on_signal_time_info (TapiHandle *handle, GVariant *param, if (plmn) { snprintf(noti.plmn, 7, "%s", plmn); + g_free(plmn); } CALLBACK_CALL(¬i); @@ -292,17 +238,56 @@ static void on_signal_identity (TapiHandle *handle, GVariant *param, if (plmn) { snprintf(noti.plmn, 7, "%s", plmn); + g_free(plmn); } if (s_name) { snprintf(noti.short_name, 17, "%s", s_name); + g_free(s_name); } if (f_name) { snprintf(noti.full_name, 33, "%s", f_name); + g_free(f_name); } CALLBACK_CALL(¬i); } +static void on_emergency_callback_mode (TapiHandle *handle, GVariant *param, + char *noti_id, struct tapi_evt_cb *evt_cb_data) +{ + struct tel_noti_network_emergency_callback_mode noti; + + memset(¬i, 0, sizeof(struct tel_noti_network_emergency_callback_mode)); + + g_variant_get(param, "(i)", ¬i.mode); + + CALLBACK_CALL(¬i); +} + +static void on_signal_default_data_subscription (TapiHandle *handle, GVariant *param, + char *noti_id, struct tapi_evt_cb *evt_cb_data) +{ + struct tel_noti_network_default_data_subs noti; + + memset(¬i, 0, sizeof(struct tel_noti_network_default_data_subs)); + + g_variant_get(param, "(i)", ¬i.default_subs); + + CALLBACK_CALL(¬i); +} + +static void on_signal_default_subscription (TapiHandle *handle, GVariant *param, + char *noti_id, struct tapi_evt_cb *evt_cb_data) +{ + struct tel_noti_network_default_subs noti; + + memset(¬i, 0, sizeof(struct tel_noti_network_default_subs)); + + g_variant_get(param, "(i)", ¬i.default_subs); + + CALLBACK_CALL(¬i); +} + static struct signal_map signals[] = { { "RegistrationStatus", on_signal_registration_status }, { "SignalStrength", on_signal_strength }, @@ -310,6 +295,9 @@ static struct signal_map signals[] = { { "Change", on_signal_change }, { "TimeInfo", on_signal_time_info }, { "Identity", on_signal_identity }, + { "EmergencyCallbackMode", on_emergency_callback_mode }, + { "DefaultDataSubscription", on_signal_default_data_subscription }, + { "DefaultSubscription", on_signal_default_subscription }, }; void _process_network_event(const gchar *sig, GVariant *param, @@ -319,6 +307,7 @@ void _process_network_event(const gchar *sig, GVariant *param, TAPI_RETURN_IF_FAIL(evt_cb_data); for (i = 0; i < sizeof (signals) / sizeof (struct signal_map); i++) { + dbg("Received (%s)(%s) signal from telephony", handle->cp_name, sig); if (!g_strcmp0 (sig, signals[i].signal_name)) { signals[i].callback (handle, param, noti_id, evt_cb_data); return; @@ -353,6 +342,10 @@ static gboolean _check_operation(TelNetworkPreferredPlmnOp_t operation) case TAPI_NETWORK_PREF_PLMN_EDIT: case TAPI_NETWORK_PREF_PLMN_DELETE: return TRUE; + default: + /*Do Nothing*/ + err("Default Case executed. Unknown PLMN Op"); + break; } err("operation %d is not supported", operation); return FALSE; @@ -369,12 +362,15 @@ static gboolean _check_network_mode(int mode) if (mode & TAPI_NETWORK_MODE_WCDMA) { mode &= ~TAPI_NETWORK_MODE_WCDMA; } - if (mode & TAPI_NETWORK_MODE_CDMA) { - mode &= ~TAPI_NETWORK_MODE_CDMA; + if (mode & TAPI_NETWORK_MODE_1XRTT) { + mode &= ~TAPI_NETWORK_MODE_1XRTT; } if (mode & TAPI_NETWORK_MODE_LTE) { mode &= ~TAPI_NETWORK_MODE_LTE; } + if (mode & TAPI_NETWORK_MODE_EVDO) { + mode &= ~TAPI_NETWORK_MODE_EVDO; + } if (mode == 0) return TRUE; } @@ -382,50 +378,40 @@ static gboolean _check_network_mode(int mode) return FALSE; } -static gboolean _check_band_mode(TelNetworkBandPreferred_t band_mode) -{ - switch(band_mode) { - case TAPI_NETWORK_BAND_MODE_PREFERRED: - case TAPI_NETWORK_BAND_MODE_ONLY: - return TRUE; - } - err("band_mode %d is not supported", band_mode); - return FALSE; -} - -static gboolean _check_band(TelNetworkBand_t band) +static gboolean _check_emergency_callback_mode(TelNetworkEmergencyCallbackMode_t mode) { - switch(band) { - case TAPI_NETWORK_BAND_TYPE_ANY: - case TAPI_NETWORK_BAND_TYPE_GSM850: - case TAPI_NETWORK_BAND_TYPE_GSM_900_1800: - case TAPI_NETWORK_BAND_TYPE_GSM1900: - case TAPI_NETWORK_BAND_TYPE_GSM: - case TAPI_NETWORK_BAND_TYPE_WCDMA: - case TAPI_NETWORK_BAND_TYPE_WCDMA850: - case TAPI_NETWORK_BAND_TYPE_WCDMA1900: - case TAPI_NETWORK_BAND_TYPE_WCDMA2100: - case TAPI_NETWORK_BAND_TYPE_GSM900: - case TAPI_NETWORK_BAND_TYPE_GSM1800: - case TAPI_NETWORK_BAND_TYPE_GSM_850_1900: - case TAPI_NETWORK_BAND_TYPE_LTE_BAND_4: - case TAPI_NETWORK_BAND_TYPE_LTE_BAND_17: + switch(mode) { + case TAPI_NETWORK_EMERGENCY_CALLBACK_MODE_ENTER: + case TAPI_NETWORK_EMERGENCY_CALLBACK_MODE_EXIT: return TRUE; + default: + /*Do Nothing*/ + err("Default Case executed. Unknown Emergency callback mode"); + break; } - err("band %d is not supported", band); + err("emergency callback mode %d is not supported", mode); return FALSE; } -static gboolean _check_service_domain(TelNetworkServiceDomain_t service_domain) +static gboolean _check_roaming_preference(TelNetworkPrefNetType_t roam_pref) { - switch(service_domain) { - case TAPI_NETWORK_SERVICE_DOMAIN_COMBINED: - case TAPI_NETWORK_SERVICE_DOMAIN_PS: - case TAPI_NETWORK_SERVICE_DOMAIN_CS: - case TAPI_NETWORK_SERVICE_DOMAIN_AUTOMATIC: + switch(roam_pref) { + case TAPI_NETWORK_PREF_NET_TYPE_HOME_ONLY: + case TAPI_NETWORK_PREF_NET_TYPE_AFFILIATED: + case TAPI_NETWORK_PREF_NET_TYPE_AUTOMATIC: + case TAPI_NETWORK_PREF_NET_TYPE_AUTOMATIC_A: + case TAPI_NETWORK_PREF_NET_TYPE_AUTOMATIC_B: + case TAPI_NETWORK_PREF_NET_TYPE_ROAM_DOMESTIC: + case TAPI_NETWORK_PREF_NET_TYPE_ROAM_INTERNATIONAL: + case TAPI_NETWORK_PREF_NET_TYPE_ROAM_DUAL: + case TAPI_NETWORK_PREF_NET_TYPE_BLANK: return TRUE; + default: + /*Do Nothing*/ + err("Default Case executed. Unknown roaming preference"); + break; } - err("service_domain %d is not supported", service_domain); + err("roam_pref %d is not supported", roam_pref); return FALSE; } @@ -449,19 +435,7 @@ static void on_response_search_network (GObject *source_object, dbus_result = g_dbus_connection_call_finish ( G_DBUS_CONNECTION (source_object), res, &error); - CHECK_DEINIT(error); - - if (!dbus_result) { - if (evt_cb_data->cb_fn) { - evt_cb_data->cb_fn(evt_cb_data->handle, -1, NULL, evt_cb_data->user_data); - } - - if (error) - g_error_free(error); - - g_free(evt_cb_data); - return; - } + CHECK_ERROR(error); g_variant_get (dbus_result, "(aa{sv}i)", &iter, &result); @@ -494,6 +468,7 @@ static void on_response_search_network (GObject *source_object, } g_free(evt_cb_data); + g_variant_unref(dbus_result); } static void on_response_get_network_selection_mode (GObject *source_object, @@ -508,19 +483,7 @@ static void on_response_get_network_selection_mode (GObject *source_object, dbus_result = g_dbus_connection_call_finish ( G_DBUS_CONNECTION (source_object), res, &error); - CHECK_DEINIT(error); - - if (!dbus_result) { - if (evt_cb_data->cb_fn) { - evt_cb_data->cb_fn(evt_cb_data->handle, -1, NULL, evt_cb_data->user_data); - } - - if (error) - g_error_free(error); - - g_free(evt_cb_data); - return; - } + CHECK_ERROR(error); g_variant_get (dbus_result, "(ii)", &mode, &result); @@ -529,6 +492,7 @@ static void on_response_get_network_selection_mode (GObject *source_object, } g_free(evt_cb_data); + g_variant_unref(dbus_result); } static void on_response_default_set (GObject *source_object, GAsyncResult *res, @@ -542,20 +506,7 @@ static void on_response_default_set (GObject *source_object, GAsyncResult *res, dbus_result = g_dbus_connection_call_finish ( G_DBUS_CONNECTION (source_object), res, &error); - CHECK_DEINIT(error); - - if (!dbus_result) { - if (evt_cb_data->cb_fn) { - evt_cb_data->cb_fn(evt_cb_data->handle, -1, NULL, evt_cb_data->user_data); - } - - if (error) - g_error_free(error); - - g_free(evt_cb_data); - return; - } - + CHECK_ERROR(error); g_variant_get (dbus_result, "(i)", &result); @@ -564,6 +515,7 @@ static void on_response_default_set (GObject *source_object, GAsyncResult *res, } g_free(evt_cb_data); + g_variant_unref(dbus_result); } static void on_response_get_network_preferred_plmn (GObject *source_object, @@ -586,19 +538,7 @@ static void on_response_get_network_preferred_plmn (GObject *source_object, dbus_result = g_dbus_connection_call_finish ( G_DBUS_CONNECTION (source_object), res, &error); - CHECK_DEINIT(error); - - if (!dbus_result) { - if (evt_cb_data->cb_fn) { - evt_cb_data->cb_fn(evt_cb_data->handle, -1, &list, evt_cb_data->user_data); - } - - if (error) - g_error_free(error); - - g_free(evt_cb_data); - return; - } + CHECK_ERROR(error); g_variant_get (dbus_result, "(aa{sv}i)", &iter, &result); @@ -640,42 +580,7 @@ static void on_response_get_network_preferred_plmn (GObject *source_object, } g_free(evt_cb_data); -} - -static void on_response_get_network_band (GObject *source_object, - GAsyncResult *res, gpointer user_data) -{ - GError *error = NULL; - struct tapi_resp_data *evt_cb_data = user_data; - int result = -1; - - GVariant *dbus_result; - int band = 0; - int mode = 0; - - dbus_result = g_dbus_connection_call_finish ( - G_DBUS_CONNECTION (source_object), res, &error); - CHECK_DEINIT(error); - - if (!dbus_result) { - if (evt_cb_data->cb_fn) { - evt_cb_data->cb_fn(evt_cb_data->handle, -1, NULL, evt_cb_data->user_data); - } - - if (error) - g_error_free(error); - - g_free(evt_cb_data); - return; - } - - g_variant_get (dbus_result, "(iii)", &band, &mode, &result); - - if (evt_cb_data->cb_fn) { - evt_cb_data->cb_fn(evt_cb_data->handle, result, &band, evt_cb_data->user_data); - } - - g_free(evt_cb_data); + g_variant_unref(dbus_result); } static void on_response_get_network_mode (GObject *source_object, @@ -690,19 +595,7 @@ static void on_response_get_network_mode (GObject *source_object, dbus_result = g_dbus_connection_call_finish ( G_DBUS_CONNECTION (source_object), res, &error); - CHECK_DEINIT(error); - - if (!dbus_result) { - if (evt_cb_data->cb_fn) { - evt_cb_data->cb_fn(evt_cb_data->handle, -1, NULL, evt_cb_data->user_data); - } - - if (error) - g_error_free(error); - - g_free(evt_cb_data); - return; - } + CHECK_ERROR(error); g_variant_get (dbus_result, "(ii)", &mode, &result); @@ -711,41 +604,7 @@ static void on_response_get_network_mode (GObject *source_object, } g_free(evt_cb_data); -} - -static void on_response_get_network_service_domain (GObject *source_object, - GAsyncResult *res, gpointer user_data) -{ - GError *error = NULL; - struct tapi_resp_data *evt_cb_data = user_data; - int result = -1; - - GVariant *dbus_result; - int domain = 0; - - dbus_result = g_dbus_connection_call_finish ( - G_DBUS_CONNECTION (source_object), res, &error); - CHECK_DEINIT(error); - - if (!dbus_result) { - if (evt_cb_data->cb_fn) { - evt_cb_data->cb_fn(evt_cb_data->handle, -1, NULL, evt_cb_data->user_data); - } - - if (error) - g_error_free(error); - - g_free(evt_cb_data); - return; - } - - g_variant_get (dbus_result, "(ii)", &domain, &result); - - if (evt_cb_data->cb_fn) { - evt_cb_data->cb_fn(evt_cb_data->handle, result, &domain, evt_cb_data->user_data); - } - - g_free(evt_cb_data); + g_variant_unref(dbus_result); } static void on_response_get_network_serving (GObject *source_object, @@ -764,31 +623,19 @@ static void on_response_get_network_serving (GObject *source_object, dbus_result = g_dbus_connection_call_finish ( G_DBUS_CONNECTION (source_object), res, &error); - CHECK_DEINIT(error); - - if (!dbus_result) { - if (evt_cb_data->cb_fn) { - evt_cb_data->cb_fn(evt_cb_data->handle, -1, NULL, evt_cb_data->user_data); - } - - if (error) - g_error_free(error); - - g_free(evt_cb_data); - return; - } + CHECK_ERROR(error); g_variant_get (dbus_result, "(isii)", &data.act, &plmn, - &data.lac, + &data.info.lac, &result); data.act = _convert_act_to_systemtype(data.act); if (plmn) { snprintf(data.plmn, 7, "%s", plmn); - free(plmn); + g_free(plmn); } if (evt_cb_data->cb_fn) { @@ -796,6 +643,7 @@ static void on_response_get_network_serving (GObject *source_object, } g_free(evt_cb_data); + g_variant_unref(dbus_result); } static void on_response_get_neighboring_cell_info (GObject *source_object, @@ -819,19 +667,7 @@ static void on_response_get_neighboring_cell_info (GObject *source_object, dbus_result = g_dbus_connection_call_finish ( G_DBUS_CONNECTION (source_object), res, &error); - CHECK_DEINIT(error); - - if (!dbus_result) { - if (evt_cb_data->cb_fn) { - evt_cb_data->cb_fn(evt_cb_data->handle, -1, NULL, evt_cb_data->user_data); - } - - if (error) - g_error_free(error); - - g_free(evt_cb_data); - return; - } + CHECK_ERROR(error); g_variant_get (dbus_result, "(aa{sv}i)", &iter, &result); @@ -899,18 +735,78 @@ static void on_response_get_neighboring_cell_info (GObject *source_object, } g_free(evt_cb_data); + g_variant_unref(dbus_result); +} + +static void on_response_select_network (GObject *source_object, GAsyncResult *res, + gpointer user_data) +{ + GError *error = NULL; + struct tapi_resp_data *evt_cb_data = user_data; + int result = -1; + GVariant *dbus_result; + + dbus_result = g_dbus_connection_call_finish (G_DBUS_CONNECTION (source_object), res, &error); + CHECK_ERROR(error); + g_variant_get (dbus_result, "(i)", &result); + + /* Map result received from libtcore to TapiResult_t */ + if (result == 0) + result = TAPI_API_SUCCESS; + else { + switch (result) { + case 0x50000001: + result = TAPI_API_NETWORK_PLMN_NOT_ALLOWED; + break; + case 0x50000002: + result = TAPI_API_NETWORK_ROAMING_NOT_ALLOWED; + break; + default: + /*Do Nothing*/ + break; + } + } + if (evt_cb_data->cb_fn) { + evt_cb_data->cb_fn(evt_cb_data->handle, result, NULL, evt_cb_data->user_data); + } + g_free(evt_cb_data); + g_variant_unref(dbus_result); +} + +static void on_response_get_network_roaming_preference (GObject *source_object, + GAsyncResult *res, gpointer user_data) +{ + GError *error = NULL; + struct tapi_resp_data *evt_cb_data = user_data; + int result = -1; + + GVariant *dbus_result; + TelNetworkPrefNetType_t roam_pref; + + dbus_result = g_dbus_connection_call_finish ( + G_DBUS_CONNECTION (source_object), res, &error); + CHECK_ERROR(error); + + g_variant_get (dbus_result, "(ii)", &roam_pref, &result); + + if (evt_cb_data->cb_fn) { + evt_cb_data->cb_fn(evt_cb_data->handle, result, &roam_pref, evt_cb_data->user_data); + } + + g_free(evt_cb_data); + g_variant_unref(dbus_result); } EXPORT_API int tel_search_network(TapiHandle *handle, tapi_response_cb callback, void *user_data) { struct tapi_resp_data *evt_cb_data = NULL; - dbg("Func Entrance"); - TAPI_RET_ERR_NUM_IF_FAIL(handle != NULL && callback != NULL, TAPI_API_INVALID_PTR); MAKE_RESP_CB_DATA(evt_cb_data, handle, callback, user_data); + msg("[%s] network_search requested", handle->cp_name); + g_dbus_connection_call(handle->dbus_connection, DBUS_TELEPHONY_SERVICE , handle->path, DBUS_TELEPHONY_NETWORK_INTERFACE, "Search", NULL, NULL, @@ -944,8 +840,6 @@ EXPORT_API int tel_select_network_automatic(struct tapi_handle *handle, tapi_res struct tapi_resp_data *evt_cb_data = NULL; GVariant *param; - dbg("Func Entrance"); - TAPI_RET_ERR_NUM_IF_FAIL(handle != NULL, TAPI_API_INVALID_PTR); MAKE_RESP_CB_DATA(evt_cb_data, handle, callback, user_data); @@ -955,6 +849,8 @@ EXPORT_API int tel_select_network_automatic(struct tapi_handle *handle, tapi_res "", 0); + msg("[%s] automatic selection requested", handle->cp_name); + g_dbus_connection_call(handle->dbus_connection, DBUS_TELEPHONY_SERVICE , handle->path, DBUS_TELEPHONY_NETWORK_INTERFACE, "SetSelectionMode", param, NULL, @@ -969,8 +865,6 @@ EXPORT_API int tel_select_network_manual(struct tapi_handle *handle, const char struct tapi_resp_data *evt_cb_data = NULL; GVariant *param; - dbg("plmn:[%s] type:[%d]",plmn?plmn:"", type); - TAPI_RET_ERR_NUM_IF_FAIL(handle != NULL && _check_plmn(plmn), TAPI_API_INVALID_PTR); MAKE_RESP_CB_DATA(evt_cb_data, handle, callback, user_data); @@ -980,11 +874,13 @@ EXPORT_API int tel_select_network_manual(struct tapi_handle *handle, const char plmn, _convert_systemtype_to_act(type)); + msg("[%s] manual selection requested plmn:[%s] type:[%d]",handle->cp_name, plmn?plmn:"", type); + g_dbus_connection_call(handle->dbus_connection, DBUS_TELEPHONY_SERVICE , handle->path, DBUS_TELEPHONY_NETWORK_INTERFACE, "SetSelectionMode", param, NULL, G_DBUS_CALL_FLAGS_NONE, TAPI_UNRESTRICTED_TIMEOUT, handle->ca, - on_response_default_set, evt_cb_data); + on_response_select_network, evt_cb_data); return TAPI_API_SUCCESS; } @@ -1068,189 +964,282 @@ EXPORT_API int tel_get_network_preferred_plmn(TapiHandle *handle, tapi_response_ return TAPI_API_SUCCESS; } -EXPORT_API int tel_set_network_band(TapiHandle *handle, TelNetworkBandPreferred_t mode, TelNetworkBand_t band, tapi_response_cb callback, void *user_data) +EXPORT_API int tel_set_network_mode(TapiHandle *handle, int mode, tapi_response_cb callback, void *user_data) { struct tapi_resp_data *evt_cb_data = NULL; GVariant *param; - dbg("mode:[%d] band:[%d]",mode,band); - TAPI_RET_ERR_NUM_IF_FAIL(handle != NULL && - _check_band_mode(mode) && - _check_band(band), TAPI_API_INVALID_PTR); + _check_network_mode(mode), TAPI_API_INVALID_PTR); MAKE_RESP_CB_DATA(evt_cb_data, handle, callback, user_data); - param = g_variant_new("(ii)", - band, + param = g_variant_new("(i)", mode); + msg("[%s] requested mode:[0x%x]", handle->cp_name, mode); + g_dbus_connection_call(handle->dbus_connection, DBUS_TELEPHONY_SERVICE , handle->path, DBUS_TELEPHONY_NETWORK_INTERFACE, - "SetBand", param, NULL, - G_DBUS_CALL_FLAGS_NONE, TAPI_DEFAULT_TIMEOUT, handle->ca, + "SetMode", param, NULL, + G_DBUS_CALL_FLAGS_NONE, TAPI_UNRESTRICTED_TIMEOUT, handle->ca, on_response_default_set, evt_cb_data); return TAPI_API_SUCCESS; } -EXPORT_API int tel_get_network_band(TapiHandle *handle, tapi_response_cb callback, void *user_data) +EXPORT_API int tel_get_network_mode(TapiHandle *handle, tapi_response_cb callback, void *user_data) { struct tapi_resp_data *evt_cb_data = NULL; - dbg("Func Entrance"); - TAPI_RET_ERR_NUM_IF_FAIL(handle != NULL && callback != NULL, TAPI_API_INVALID_PTR); MAKE_RESP_CB_DATA(evt_cb_data, handle, callback, user_data); + dbg("[%s] Func Entrance", handle->cp_name); + g_dbus_connection_call(handle->dbus_connection, DBUS_TELEPHONY_SERVICE , handle->path, DBUS_TELEPHONY_NETWORK_INTERFACE, - "GetBand", NULL, NULL, + "GetMode", NULL, NULL, G_DBUS_CALL_FLAGS_NONE, TAPI_DEFAULT_TIMEOUT, handle->ca, - on_response_get_network_band, evt_cb_data); + on_response_get_network_mode, evt_cb_data); return TAPI_API_SUCCESS; } -EXPORT_API int tel_set_network_mode(TapiHandle *handle, int mode, tapi_response_cb callback, void *user_data) +EXPORT_API int tel_cancel_network_manual_search(TapiHandle *handle, tapi_response_cb callback, void *user_data) { struct tapi_resp_data *evt_cb_data = NULL; - GVariant *param; - - dbg("mode:[0x%x]", mode); - TAPI_RET_ERR_NUM_IF_FAIL(handle != NULL && - _check_network_mode(mode), TAPI_API_INVALID_PTR); + TAPI_RET_ERR_NUM_IF_FAIL(handle != NULL, TAPI_API_INVALID_PTR); MAKE_RESP_CB_DATA(evt_cb_data, handle, callback, user_data); - param = g_variant_new("(i)", - mode); + msg("[%s] network search cancel requested", handle->cp_name); g_dbus_connection_call(handle->dbus_connection, DBUS_TELEPHONY_SERVICE , handle->path, DBUS_TELEPHONY_NETWORK_INTERFACE, - "SetMode", param, NULL, - G_DBUS_CALL_FLAGS_NONE, TAPI_UNRESTRICTED_TIMEOUT, handle->ca, + "SearchCancel", NULL, NULL, + G_DBUS_CALL_FLAGS_NONE, TAPI_DEFAULT_TIMEOUT, handle->ca, on_response_default_set, evt_cb_data); return TAPI_API_SUCCESS; } -EXPORT_API int tel_get_network_mode(TapiHandle *handle, tapi_response_cb callback, void *user_data) +EXPORT_API int tel_get_network_serving(TapiHandle *handle, tapi_response_cb callback, void *user_data) { struct tapi_resp_data *evt_cb_data = NULL; - dbg("Func Entrance"); - TAPI_RET_ERR_NUM_IF_FAIL(handle != NULL && callback != NULL, TAPI_API_INVALID_PTR); MAKE_RESP_CB_DATA(evt_cb_data, handle, callback, user_data); + dbg("[%s] Func Entrance", handle->cp_name); + g_dbus_connection_call(handle->dbus_connection, DBUS_TELEPHONY_SERVICE , handle->path, DBUS_TELEPHONY_NETWORK_INTERFACE, - "GetMode", NULL, NULL, + "GetServingNetwork", NULL, NULL, G_DBUS_CALL_FLAGS_NONE, TAPI_DEFAULT_TIMEOUT, handle->ca, - on_response_get_network_mode, evt_cb_data); + on_response_get_network_serving, evt_cb_data); return TAPI_API_SUCCESS; } -EXPORT_API int tel_set_network_service_domain(TapiHandle *handle, TelNetworkServiceDomain_t domain, tapi_response_cb callback, void *user_data) +EXPORT_API int tel_get_network_neighboring_cell_info(TapiHandle *handle, tapi_response_cb callback, void *user_data) { struct tapi_resp_data *evt_cb_data = NULL; - GVariant *param; - dbg("domain:[%d]", domain); + TAPI_RET_ERR_NUM_IF_FAIL(handle != NULL && callback != NULL, TAPI_API_INVALID_PTR); - TAPI_RET_ERR_NUM_IF_FAIL(handle != NULL && - _check_service_domain(domain), TAPI_API_INVALID_PTR); + MAKE_RESP_CB_DATA(evt_cb_data, handle, callback, user_data); + + dbg("[%s] Func Entrance", handle->cp_name); + + g_dbus_connection_call(handle->dbus_connection, + DBUS_TELEPHONY_SERVICE , handle->path, DBUS_TELEPHONY_NETWORK_INTERFACE, + "GetNgbrCellInfo", NULL, NULL, + G_DBUS_CALL_FLAGS_NONE, TAPI_DEFAULT_TIMEOUT, handle->ca, + on_response_get_neighboring_cell_info, evt_cb_data); + + return TAPI_API_SUCCESS; +} + +EXPORT_API int tel_set_network_default_data_subscription(TapiHandle *handle, tapi_response_cb callback, void *user_data) +{ + struct tapi_resp_data *evt_cb_data = NULL; + + TAPI_RET_ERR_NUM_IF_FAIL(handle, TAPI_API_INVALID_PTR); + TAPI_RET_ERR_NUM_IF_FAIL(callback, TAPI_API_INVALID_PTR); MAKE_RESP_CB_DATA(evt_cb_data, handle, callback, user_data); - param = g_variant_new("(i)", domain); + msg("[%s] Func Entrance", handle->cp_name); + /* DBUS call */ g_dbus_connection_call(handle->dbus_connection, DBUS_TELEPHONY_SERVICE , handle->path, DBUS_TELEPHONY_NETWORK_INTERFACE, - "SetServiceDomain", param, NULL, + "SetDefaultDataSubscription", NULL, NULL, G_DBUS_CALL_FLAGS_NONE, TAPI_DEFAULT_TIMEOUT, handle->ca, on_response_default_set, evt_cb_data); return TAPI_API_SUCCESS; } -EXPORT_API int tel_get_network_service_domain(TapiHandle *handle, tapi_response_cb callback, void *user_data) +EXPORT_API int tel_set_network_emergency_callback_mode(TapiHandle *handle, TelNetworkEmergencyCallbackMode_t mode, tapi_response_cb callback, void *user_data) { struct tapi_resp_data *evt_cb_data = NULL; + GVariant *param; - dbg("Func Entrance"); - - TAPI_RET_ERR_NUM_IF_FAIL(handle != NULL && callback != NULL, TAPI_API_INVALID_PTR); + TAPI_RET_ERR_NUM_IF_FAIL(handle != NULL && + _check_emergency_callback_mode(mode), TAPI_API_INVALID_PTR); MAKE_RESP_CB_DATA(evt_cb_data, handle, callback, user_data); + param = g_variant_new("(i)", mode); + + msg("[%s] emergency callback mode :[%d]", handle->cp_name, mode); + g_dbus_connection_call(handle->dbus_connection, DBUS_TELEPHONY_SERVICE , handle->path, DBUS_TELEPHONY_NETWORK_INTERFACE, - "GetServiceDomain", NULL, NULL, + "SetEmergencyCallbackMode", param, NULL, G_DBUS_CALL_FLAGS_NONE, TAPI_DEFAULT_TIMEOUT, handle->ca, - on_response_get_network_service_domain, evt_cb_data); + on_response_default_set, evt_cb_data); return TAPI_API_SUCCESS; } -EXPORT_API int tel_cancel_network_manual_search(TapiHandle *handle, tapi_response_cb callback, void *user_data) +EXPORT_API int tel_set_network_roaming_preference(TapiHandle *handle, TelNetworkPrefNetType_t roam_pref, tapi_response_cb callback, void *user_data) { struct tapi_resp_data *evt_cb_data = NULL; + GVariant *param; - dbg("Func Entrance"); - - TAPI_RET_ERR_NUM_IF_FAIL(handle != NULL, TAPI_API_INVALID_PTR); + TAPI_RET_ERR_NUM_IF_FAIL(handle != NULL && + _check_roaming_preference(roam_pref), TAPI_API_INVALID_PTR); MAKE_RESP_CB_DATA(evt_cb_data, handle, callback, user_data); + param = g_variant_new("(i)", roam_pref); + + msg("[%s] roam_pref:[%d]", handle->cp_name, roam_pref); + g_dbus_connection_call(handle->dbus_connection, DBUS_TELEPHONY_SERVICE , handle->path, DBUS_TELEPHONY_NETWORK_INTERFACE, - "SearchCancel", NULL, NULL, + "SetRoamingPreference", param, NULL, G_DBUS_CALL_FLAGS_NONE, TAPI_DEFAULT_TIMEOUT, handle->ca, on_response_default_set, evt_cb_data); return TAPI_API_SUCCESS; + } -EXPORT_API int tel_get_network_serving(TapiHandle *handle, tapi_response_cb callback, void *user_data) +EXPORT_API int tel_get_network_roaming_preference(TapiHandle *handle, tapi_response_cb callback, void *user_data) { struct tapi_resp_data *evt_cb_data = NULL; - dbg("Func Entrance"); - TAPI_RET_ERR_NUM_IF_FAIL(handle != NULL && callback != NULL, TAPI_API_INVALID_PTR); MAKE_RESP_CB_DATA(evt_cb_data, handle, callback, user_data); + dbg("[%s] Func Entrance", handle->cp_name); + g_dbus_connection_call(handle->dbus_connection, DBUS_TELEPHONY_SERVICE , handle->path, DBUS_TELEPHONY_NETWORK_INTERFACE, - "GetServingNetwork", NULL, NULL, + "GetRoamingPreference", NULL, NULL, G_DBUS_CALL_FLAGS_NONE, TAPI_DEFAULT_TIMEOUT, handle->ca, - on_response_get_network_serving, evt_cb_data); + on_response_get_network_roaming_preference, evt_cb_data); return TAPI_API_SUCCESS; + } -EXPORT_API int tel_get_network_neighboring_cell_info(TapiHandle *handle, tapi_response_cb callback, void *user_data) +EXPORT_API int tel_get_network_default_data_subscription(TapiHandle *handle, TelNetworkDefaultDataSubs_t *default_subscription) { - struct tapi_resp_data *evt_cb_data = NULL; + GError *gerr = NULL; + GVariant *sync_gv = NULL; + int subs = 0; + int result = 0; + TapiResult_t ret = TAPI_API_OPERATION_FAILED; + + TAPI_RET_ERR_NUM_IF_FAIL(handle, TAPI_API_INVALID_PTR); + TAPI_RET_ERR_NUM_IF_FAIL(default_subscription, TAPI_API_INVALID_PTR); + + sync_gv = g_dbus_connection_call_sync(handle->dbus_connection, + DBUS_TELEPHONY_SERVICE, handle->path, DBUS_TELEPHONY_NETWORK_INTERFACE, + "GetDefaultDataSubscription", NULL, NULL, + G_DBUS_CALL_FLAGS_NONE, TAPI_DEFAULT_TIMEOUT, handle->ca, + &gerr); + if (sync_gv) { + g_variant_get(sync_gv, "(ii)", &subs, &result); - dbg("Func Entrance"); + if (result == 0) + *default_subscription = subs; + else + *default_subscription = TAPI_NETWORK_DEFAULT_DATA_SUBS_UNKNOWN; - TAPI_RET_ERR_NUM_IF_FAIL(handle != NULL && callback != NULL, TAPI_API_INVALID_PTR); + msg("'default' Data Subscription: [%d]", subs); + + g_variant_unref(sync_gv); + ret = TAPI_API_SUCCESS; + } else { + err("Get Data Subscription failed: [%s]", gerr->message); + g_error_free(gerr); + } + + return ret; +} + +EXPORT_API int tel_set_network_default_subscription(TapiHandle *handle, tapi_response_cb callback, void *user_data) +{ + struct tapi_resp_data *evt_cb_data = NULL; + + TAPI_RET_ERR_NUM_IF_FAIL(handle, TAPI_API_INVALID_PTR); + TAPI_RET_ERR_NUM_IF_FAIL(callback, TAPI_API_INVALID_PTR); MAKE_RESP_CB_DATA(evt_cb_data, handle, callback, user_data); + dbg("[%s] Set 'default' Subscription (for CS)", handle->cp_name); + + /* DBUS call */ g_dbus_connection_call(handle->dbus_connection, DBUS_TELEPHONY_SERVICE , handle->path, DBUS_TELEPHONY_NETWORK_INTERFACE, - "GetNgbrCellInfo", NULL, NULL, + "SetDefaultSubscription", NULL, NULL, G_DBUS_CALL_FLAGS_NONE, TAPI_DEFAULT_TIMEOUT, handle->ca, - on_response_get_neighboring_cell_info, evt_cb_data); + on_response_default_set, evt_cb_data); return TAPI_API_SUCCESS; } + +EXPORT_API int tel_get_network_default_subscription(TapiHandle *handle, TelNetworkDefaultSubs_t *default_subscription) +{ + GError *gerr = NULL; + GVariant *sync_gv = NULL; + int subs = 0; + int result = 0; + TapiResult_t ret = TAPI_API_OPERATION_FAILED; + + TAPI_RET_ERR_NUM_IF_FAIL(handle, TAPI_API_INVALID_PTR); + TAPI_RET_ERR_NUM_IF_FAIL(default_subscription, TAPI_API_INVALID_PTR); + + sync_gv = g_dbus_connection_call_sync(handle->dbus_connection, + DBUS_TELEPHONY_SERVICE, handle->path, DBUS_TELEPHONY_NETWORK_INTERFACE, + "GetDefaultSubscription", NULL, NULL, + G_DBUS_CALL_FLAGS_NONE, TAPI_DEFAULT_TIMEOUT, handle->ca, + &gerr); + if (sync_gv) { + g_variant_get(sync_gv, "(ii)", &subs, &result); + + if (result == 0) + *default_subscription = subs; + else + *default_subscription = TAPI_NETWORK_DEFAULT_SUBS_UNKNOWN; + dbg("'default' Subscription (for CS): [%d]", subs); + + g_variant_unref(sync_gv); + ret = TAPI_API_SUCCESS; + } else { + err("Get 'default' Subscription (for CS) failed: [%s]", gerr->message); + g_error_free(gerr); + } + + return ret; +} diff --git a/wearable/src/tapi_phonebook.c b/src/tapi_phonebook.c similarity index 89% rename from wearable/src/tapi_phonebook.c rename to src/tapi_phonebook.c index ede3242..ba22464 100644 --- a/wearable/src/tapi_phonebook.c +++ b/src/tapi_phonebook.c @@ -1,7 +1,7 @@ /* * libslp-tapi * - * Copyright (c) 2012 Samsung Electronics Co., Ltd. All rights reserved. + * Copyright (c) 2014 Samsung Electronics Co., Ltd. All rights reserved. * * Contact: Ja-young Gu * @@ -40,7 +40,6 @@ static void move_str (char *dest, unsigned int len, gchar *src) return; snprintf (dest, len, "%s", src); - g_free (src); } static void on_response_get_sim_pb_count(GObject *source_object, GAsyncResult *res, gpointer user_data) @@ -58,19 +57,7 @@ static void on_response_get_sim_pb_count(GObject *source_object, GAsyncResult *r conn = G_DBUS_CONNECTION (source_object); dbus_result = g_dbus_connection_call_finish(conn, res, &error); - CHECK_DEINIT(error); - - if (!dbus_result) { - if (evt_cb_data->cb_fn) { - evt_cb_data->cb_fn(evt_cb_data->handle, -1, NULL, evt_cb_data->user_data); - } - - if (error) - g_error_free(error); - - g_free(evt_cb_data); - return; - } + CHECK_ERROR(error); g_variant_get (dbus_result, "(iiii)", &result, @@ -86,6 +73,7 @@ static void on_response_get_sim_pb_count(GObject *source_object, GAsyncResult *r } g_free(evt_cb_data); + g_variant_unref(dbus_result); } static void on_response_get_sim_pb_meta_info(GObject *source_object, GAsyncResult *res, gpointer user_data) @@ -104,19 +92,7 @@ static void on_response_get_sim_pb_meta_info(GObject *source_object, GAsyncResul conn = G_DBUS_CONNECTION (source_object); dbus_result = g_dbus_connection_call_finish(conn, res, &error); - CHECK_DEINIT(error); - - if (!dbus_result) { - if (evt_cb_data->cb_fn) { - evt_cb_data->cb_fn(evt_cb_data->handle, -1, NULL, evt_cb_data->user_data); - } - - if (error) - g_error_free(error); - - g_free(evt_cb_data); - return; - } + CHECK_ERROR(error); g_variant_get (dbus_result, "(iiiiiii)", &result, @@ -138,6 +114,7 @@ static void on_response_get_sim_pb_meta_info(GObject *source_object, GAsyncResul } g_free(evt_cb_data); + g_variant_unref(dbus_result); } static void on_response_get_sim_pb_usim_meta_info(GObject *source_object, GAsyncResult *res, gpointer user_data) @@ -159,19 +136,7 @@ static void on_response_get_sim_pb_usim_meta_info(GObject *source_object, GAsync conn = G_DBUS_CONNECTION (source_object); dbus_result = g_dbus_connection_call_finish(conn, res, &error); - CHECK_DEINIT(error); - - if (!dbus_result) { - if (evt_cb_data->cb_fn) { - evt_cb_data->cb_fn(evt_cb_data->handle, -1, NULL, evt_cb_data->user_data); - } - - if (error) - g_error_free(error); - - g_free(evt_cb_data); - return; - } + CHECK_ERROR(error); g_variant_get(dbus_result, "(iaa{sv})", &result, &iter); list.FileTypeCount = g_variant_iter_n_children(iter); @@ -202,6 +167,7 @@ static void on_response_get_sim_pb_usim_meta_info(GObject *source_object, GAsync } g_free(evt_cb_data); + g_variant_unref(dbus_result); } static void on_response_read_sim_pb_record(GObject *source_object, GAsyncResult *res, gpointer user_data) @@ -230,19 +196,7 @@ static void on_response_read_sim_pb_record(GObject *source_object, GAsyncResult conn = G_DBUS_CONNECTION (source_object); dbus_result = g_dbus_connection_call_finish(conn, res, &error); - CHECK_DEINIT(error); - - if (!dbus_result) { - if (evt_cb_data->cb_fn) { - evt_cb_data->cb_fn(evt_cb_data->handle, -1, NULL, evt_cb_data->user_data); - } - - if (error) - g_error_free(error); - - g_free(evt_cb_data); - return; - } + CHECK_ERROR(error); g_variant_get (dbus_result, "(iiiisisisisisisissssi)", &result, @@ -280,7 +234,7 @@ static void on_response_read_sim_pb_record(GObject *source_object, GAsyncResult move_str ((char *)pb_rec.email2, TAPI_SIM_PB_RECORD_EMAIL_MAX_LEN, email2); move_str ((char *)pb_rec.email3, TAPI_SIM_PB_RECORD_EMAIL_MAX_LEN, email3); - dbg("type[%d], index[%d], next_index[%d]", pb_rec.phonebook_type, + msg("type[%d], index[%d], next_index[%d]", pb_rec.phonebook_type, pb_rec.index, pb_rec.next_index); dbg("name[%s], dcs[%d]", pb_rec.name, pb_rec.dcs); dbg("number[%s], ton[%d]", pb_rec.number, pb_rec.ton); @@ -300,7 +254,19 @@ static void on_response_read_sim_pb_record(GObject *source_object, GAsyncResult evt_cb_data->cb_fn(evt_cb_data->handle, result, &pb_rec, evt_cb_data->user_data); } + g_free(name); + g_free(number); + g_free(sne); + g_free(anr1); + g_free(anr2); + g_free(anr3); + g_free(email1); + g_free(email2); + g_free(email3); + g_free(email4); + g_free(evt_cb_data); + g_variant_unref(dbus_result); } static void on_response_update_sim_pb_record(GObject *source_object, GAsyncResult *res, gpointer user_data) @@ -314,19 +280,7 @@ static void on_response_update_sim_pb_record(GObject *source_object, GAsyncResul conn = G_DBUS_CONNECTION (source_object); dbus_result = g_dbus_connection_call_finish(conn, res, &error); - CHECK_DEINIT(error); - - if (!dbus_result) { - if (evt_cb_data->cb_fn) { - evt_cb_data->cb_fn(evt_cb_data->handle, -1, NULL, evt_cb_data->user_data); - } - - if (error) - g_error_free(error); - - g_free(evt_cb_data); - return; - } + CHECK_ERROR(error); g_variant_get (dbus_result, "(i)", &result); @@ -335,6 +289,7 @@ static void on_response_update_sim_pb_record(GObject *source_object, GAsyncResul } g_free(evt_cb_data); + g_variant_unref(dbus_result); } static void on_response_delete_sim_pb_record(GObject *source_object, GAsyncResult *res, gpointer user_data) @@ -348,19 +303,7 @@ static void on_response_delete_sim_pb_record(GObject *source_object, GAsyncResul conn = G_DBUS_CONNECTION (source_object); dbus_result = g_dbus_connection_call_finish(conn, res, &error); - CHECK_DEINIT(error); - - if (!dbus_result) { - if (evt_cb_data->cb_fn) { - evt_cb_data->cb_fn(evt_cb_data->handle, -1, NULL, evt_cb_data->user_data); - } - - if (error) - g_error_free(error); - - g_free(evt_cb_data); - return; - } + CHECK_ERROR(error); g_variant_get (dbus_result, "(i)", &result); @@ -369,6 +312,7 @@ static void on_response_delete_sim_pb_record(GObject *source_object, GAsyncResul } g_free(evt_cb_data); + g_variant_unref(dbus_result); } EXPORT_API int tel_get_sim_pb_init_info(TapiHandle *handle, int *init_completed, TelSimPbList_t *pb_list) @@ -395,6 +339,7 @@ EXPORT_API int tel_get_sim_pb_init_info(TapiHandle *handle, int *init_completed, &pb_list->b_aas, &pb_list->b_gas); *init_completed = init_status; + g_variant_unref(sync_gv); } else { err("Operation Failed - Error: (%s)", gerr->message); @@ -483,17 +428,17 @@ EXPORT_API int tel_get_sim_pb_usim_meta_info(TapiHandle *handle, tapi_response_c return TAPI_API_SUCCESS; } -EXPORT_API int tel_read_sim_pb_record(TapiHandle *handle, TelSimPbType_t pb_type, unsigned short index, tapi_response_cb callback, void *user_data) +EXPORT_API int tel_read_sim_pb_record(TapiHandle *handle, TelSimPbType_t pb_type, unsigned short pb_index, tapi_response_cb callback, void *user_data) { struct tapi_resp_data *evt_cb_data = NULL; GVariant *param = NULL; - dbg("Func Entrance"); + msg("read type:[%d] index:[%d]", pb_type, pb_index); TAPI_RET_ERR_NUM_IF_FAIL(handle, TAPI_API_INVALID_PTR); TAPI_RET_ERR_NUM_IF_FAIL(callback, TAPI_API_INVALID_PTR); - if (index == 0) + if (pb_index == 0) return TAPI_API_INVALID_INPUT; if ( (pb_type != TAPI_SIM_PB_FDN) && (pb_type != TAPI_SIM_PB_ADN) && (pb_type != TAPI_SIM_PB_SDN) @@ -502,7 +447,7 @@ EXPORT_API int tel_read_sim_pb_record(TapiHandle *handle, TelSimPbType_t pb_type MAKE_RESP_CB_DATA(evt_cb_data, handle, callback, user_data); - param = g_variant_new("(ii)", pb_type, index); + param = g_variant_new("(ii)", pb_type, pb_index); g_dbus_connection_call(handle->dbus_connection, DBUS_TELEPHONY_SERVICE , handle->path, DBUS_TELEPHONY_PB_INTERFACE, @@ -536,7 +481,7 @@ EXPORT_API int tel_update_sim_pb_record(TapiHandle *handle, const TelSimPbRecord MAKE_RESP_CB_DATA(evt_cb_data, handle, callback, user_data); - dbg("type[%d], index[%d], next_index[%d]",req_data->phonebook_type, req_data->index, req_data->next_index); + msg("type[%d], index[%d], next_index[%d]",req_data->phonebook_type, req_data->index, req_data->next_index); dbg("name[%s], dcs[%d]",req_data->name, req_data->dcs); dbg("number[%s], ton[%d]",req_data->number, req_data->ton); @@ -579,17 +524,17 @@ EXPORT_API int tel_update_sim_pb_record(TapiHandle *handle, const TelSimPbRecord } -EXPORT_API int tel_delete_sim_pb_record(TapiHandle *handle, TelSimPbType_t pb_type, unsigned short index, tapi_response_cb callback, void *user_data) +EXPORT_API int tel_delete_sim_pb_record(TapiHandle *handle, TelSimPbType_t pb_type, unsigned short pb_index, tapi_response_cb callback, void *user_data) { struct tapi_resp_data *evt_cb_data = NULL; GVariant *param = NULL; - dbg("Func Entrance"); + msg("delete type:[%d] index:[%d]", pb_type, pb_index); TAPI_RET_ERR_NUM_IF_FAIL(handle, TAPI_API_INVALID_PTR); - if (index == 0) + if (pb_index == 0) return TAPI_API_INVALID_INPUT; if ( (pb_type != TAPI_SIM_PB_FDN) && (pb_type != TAPI_SIM_PB_ADN) && (pb_type != TAPI_SIM_PB_SDN) @@ -598,7 +543,7 @@ EXPORT_API int tel_delete_sim_pb_record(TapiHandle *handle, TelSimPbType_t pb_ty MAKE_RESP_CB_DATA(evt_cb_data, handle, callback, user_data); - param = g_variant_new("(ii)", pb_type, index); + param = g_variant_new("(ii)", pb_type, pb_index); g_dbus_connection_call(handle->dbus_connection, DBUS_TELEPHONY_SERVICE , handle->path, DBUS_TELEPHONY_PB_INTERFACE, diff --git a/wearable/src/tapi_sap.c b/src/tapi_sap.c similarity index 86% rename from wearable/src/tapi_sap.c rename to src/tapi_sap.c index 87f5f87..657d8b5 100644 --- a/wearable/src/tapi_sap.c +++ b/src/tapi_sap.c @@ -1,7 +1,7 @@ /* * libslp-tapi * - * Copyright (c) 2012 Samsung Electronics Co., Ltd. All rights reserved. + * Copyright (c) 2014 Samsung Electronics Co., Ltd. All rights reserved. * * Contact: Ja-young Gu * @@ -45,19 +45,7 @@ static void on_response_sap_connect(GObject *source_object, GAsyncResult *res, g conn = G_DBUS_CONNECTION (source_object); dbus_result = g_dbus_connection_call_finish(conn, res, &error); - CHECK_DEINIT(error); - - if (!dbus_result) { - if (evt_cb_data->cb_fn) { - evt_cb_data->cb_fn(evt_cb_data->handle, -1, NULL, evt_cb_data->user_data); - } - - if (error) - g_error_free(error); - - g_free(evt_cb_data); - return; - } + CHECK_ERROR(error); g_variant_get(dbus_result, "(ii)", &result, &max_msg_size); @@ -66,6 +54,7 @@ static void on_response_sap_connect(GObject *source_object, GAsyncResult *res, g } g_free(evt_cb_data); + g_variant_unref(dbus_result); } EXPORT_API int tel_req_sap_connect(TapiHandle *handle, int max_msg_size, tapi_response_cb callback, void *user_data) @@ -100,19 +89,7 @@ static void on_response_sap_disconnect(GObject *source_object, GAsyncResult *res conn = G_DBUS_CONNECTION (source_object); dbus_result = g_dbus_connection_call_finish(conn, res, &error); - CHECK_DEINIT(error); - - if (!dbus_result) { - if (evt_cb_data->cb_fn) { - evt_cb_data->cb_fn(evt_cb_data->handle, -1, NULL, evt_cb_data->user_data); - } - - if (error) - g_error_free(error); - - g_free(evt_cb_data); - return; - } + CHECK_ERROR(error); g_variant_get(dbus_result, "(i)", &result); @@ -121,6 +98,7 @@ static void on_response_sap_disconnect(GObject *source_object, GAsyncResult *res } g_free(evt_cb_data); + g_variant_unref(dbus_result); } EXPORT_API int tel_req_sap_disconnect(TapiHandle *handle, tapi_response_cb callback, void *user_data) @@ -153,19 +131,7 @@ static void on_response_sap_connection_status(GObject *source_object, GAsyncResu conn = G_DBUS_CONNECTION (source_object); dbus_result = g_dbus_connection_call_finish(conn, res, &error); - CHECK_DEINIT(error); - - if (!dbus_result) { - if (evt_cb_data->cb_fn) { - evt_cb_data->cb_fn(evt_cb_data->handle, -1, NULL, evt_cb_data->user_data); - } - - if (error) - g_error_free(error); - - g_free(evt_cb_data); - return; - } + CHECK_ERROR(error); g_variant_get(dbus_result, "(i)", &result); @@ -174,6 +140,7 @@ static void on_response_sap_connection_status(GObject *source_object, GAsyncResu } g_free(evt_cb_data); + g_variant_unref(dbus_result); } EXPORT_API int tel_req_sap_connection_status(TapiHandle *handle, tapi_response_cb callback, void *user_data) @@ -214,19 +181,7 @@ static void on_response_sap_transfer_atr(GObject *source_object, GAsyncResult *r conn = G_DBUS_CONNECTION (source_object); dbus_result = g_dbus_connection_call_finish(conn, res, &error); - CHECK_DEINIT(error); - - if (!dbus_result) { - if (evt_cb_data->cb_fn) { - evt_cb_data->cb_fn(evt_cb_data->handle, -1, NULL, evt_cb_data->user_data); - } - - if (error) - g_error_free(error); - - g_free(evt_cb_data); - return; - } + CHECK_ERROR(error); /* dbg("dbus_result type_format(%s)", g_variant_get_type_string(dbus_result));*/ g_variant_get(dbus_result, "(i@v)", &result, ¶m_gv); @@ -249,6 +204,7 @@ static void on_response_sap_transfer_atr(GObject *source_object, GAsyncResult *r } g_free(evt_cb_data); + g_variant_unref(dbus_result); } EXPORT_API int tel_req_sap_transfer_atr(TapiHandle *handle, tapi_response_cb callback, void *user_data) @@ -289,19 +245,7 @@ static void on_response_sap_transfer_apdu(GObject *source_object, GAsyncResult * conn = G_DBUS_CONNECTION (source_object); dbus_result = g_dbus_connection_call_finish(conn, res, &error); - CHECK_DEINIT(error); - - if (!dbus_result) { - if (evt_cb_data->cb_fn) { - evt_cb_data->cb_fn(evt_cb_data->handle, -1, NULL, evt_cb_data->user_data); - } - - if (error) - g_error_free(error); - - g_free(evt_cb_data); - return; - } + CHECK_ERROR(error); /* dbg("dbus_result type_format(%s)", g_variant_get_type_string(dbus_result));*/ g_variant_get(dbus_result, "(i@v)", &result, ¶m_gv); @@ -324,12 +268,13 @@ static void on_response_sap_transfer_apdu(GObject *source_object, GAsyncResult * } g_free(evt_cb_data); + g_variant_unref(dbus_result); } EXPORT_API int tel_req_sap_transfer_apdu(TapiHandle *handle, TelSapApduData_t *apdu_data, tapi_response_cb callback, void *user_data) { struct tapi_resp_data *evt_cb_data = NULL; - GVariantBuilder *builder = NULL; + GVariantBuilder builder; GVariant *param = NULL; GVariant *inner_gv = NULL; int i = 0; @@ -341,12 +286,12 @@ EXPORT_API int tel_req_sap_transfer_apdu(TapiHandle *handle, TelSapApduData_t *a MAKE_RESP_CB_DATA(evt_cb_data, handle, callback, user_data); - builder = g_variant_builder_new(G_VARIANT_TYPE ("ay")); + g_variant_builder_init(&builder, G_VARIANT_TYPE ("ay")); for (i = 0; i < apdu_data->apdu_len; i++) { dbg("apdu_data->apdu_data[%d][0x%02x]", i,apdu_data->apdu_data[i]); - g_variant_builder_add(builder, "y", apdu_data->apdu_data[i]); + g_variant_builder_add(&builder, "y", apdu_data->apdu_data[i]); } - inner_gv = g_variant_builder_end(builder); + inner_gv = g_variant_builder_end(&builder); param = g_variant_new("(v)", inner_gv); /*g_variant_builder_unref (builder);*/ @@ -370,19 +315,7 @@ static void on_response_sap_transport_protocol(GObject *source_object, GAsyncRes conn = G_DBUS_CONNECTION (source_object); dbus_result = g_dbus_connection_call_finish(conn, res, &error); - CHECK_DEINIT(error); - - if (!dbus_result) { - if (evt_cb_data->cb_fn) { - evt_cb_data->cb_fn(evt_cb_data->handle, -1, NULL, evt_cb_data->user_data); - } - - if (error) - g_error_free(error); - - g_free(evt_cb_data); - return; - } + CHECK_ERROR(error); g_variant_get(dbus_result, "(i)", &result); @@ -391,6 +324,7 @@ static void on_response_sap_transport_protocol(GObject *source_object, GAsyncRes } g_free(evt_cb_data); + g_variant_unref(dbus_result); } EXPORT_API int tel_req_sap_transport_protocol(TapiHandle *handle, TelSimSapProtocol_t protocol, tapi_response_cb callback, void *user_data) @@ -425,19 +359,7 @@ static void on_response_sap_power_operation(GObject *source_object, GAsyncResult conn = G_DBUS_CONNECTION (source_object); dbus_result = g_dbus_connection_call_finish(conn, res, &error); - CHECK_DEINIT(error); - - if (!dbus_result) { - if (evt_cb_data->cb_fn) { - evt_cb_data->cb_fn(evt_cb_data->handle, -1, NULL, evt_cb_data->user_data); - } - - if (error) - g_error_free(error); - - g_free(evt_cb_data); - return; - } + CHECK_ERROR(error); g_variant_get(dbus_result, "(i)", &result); @@ -446,6 +368,7 @@ static void on_response_sap_power_operation(GObject *source_object, GAsyncResult } g_free(evt_cb_data); + g_variant_unref(dbus_result); } EXPORT_API int tel_req_sap_power_operation(TapiHandle *handle, TelSimSapPowerMode_t power_mode, tapi_response_cb callback, void *user_data) @@ -496,19 +419,7 @@ static void on_response_sap_cardreader_status(GObject *source_object, GAsyncResu conn = G_DBUS_CONNECTION (source_object); dbus_result = g_dbus_connection_call_finish(conn, res, &error); - CHECK_DEINIT(error); - - if (!dbus_result) { - if (evt_cb_data->cb_fn) { - evt_cb_data->cb_fn(evt_cb_data->handle, -1, NULL, evt_cb_data->user_data); - } - - if (error) - g_error_free(error); - - g_free(evt_cb_data); - return; - } + CHECK_ERROR(error); g_variant_get(dbus_result, "(ii)", &result, &reader_status); @@ -517,6 +428,7 @@ static void on_response_sap_cardreader_status(GObject *source_object, GAsyncResu } g_free(evt_cb_data); + g_variant_unref(dbus_result); } EXPORT_API int tel_req_sap_cardreader_status(TapiHandle *handle, tapi_response_cb callback, void *user_data) diff --git a/wearable/src/tapi_sat.c b/src/tapi_sat.c similarity index 90% rename from wearable/src/tapi_sat.c rename to src/tapi_sat.c index 4c45936..b15fce9 100644 --- a/wearable/src/tapi_sat.c +++ b/src/tapi_sat.c @@ -1,7 +1,7 @@ /* * libslp-tapi * - * Copyright (c) 2012 Samsung Electronics Co., Ltd. All rights reserved. + * Copyright (c) 2014 Samsung Electronics Co., Ltd. All rights reserved. * * Contact: Ja-young Gu * @@ -64,9 +64,9 @@ static GVariant* _tapi_sat_gen_app_exec_result_data(TelSatAppsRetInfo_t *result_ result = g_variant_new("(iiii)", exec_result, me_problem, call_ctrl_problem, call_cause); } break; case TAPI_SAT_CMD_TYPE_SEND_SS:{ - int index; + int ss_index; gint exec_result, me_problem, ss_cause, call_ctrl_problem, ss_str_len; - GVariantBuilder *builder = NULL; + GVariantBuilder builder; GVariant *ss_str = NULL; dbg("send ss : result format (iiivii)"); @@ -76,19 +76,19 @@ static GVariant* _tapi_sat_gen_app_exec_result_data(TelSatAppsRetInfo_t *result_ call_ctrl_problem = result_info->appsRet.sendSs.additionalCallCtrlProblemInfo; ss_str_len = result_info->appsRet.sendSs.ssString.stringLen; - builder = g_variant_builder_new(G_VARIANT_TYPE ("ay")); - for (index = 0; index < ss_str_len; index++) { - dbg("index(%d) data(%d)", index, result_info->appsRet.sendSs.ssString.string[index]); - g_variant_builder_add(builder, "y", result_info->appsRet.sendSs.ssString.string[index]); + g_variant_builder_init(&builder, G_VARIANT_TYPE ("ay")); + for (ss_index = 0; ss_index < ss_str_len; ss_index++) { + dbg("index(%d) data(%d)", ss_index, result_info->appsRet.sendSs.ssString.string[ss_index]); + g_variant_builder_add(&builder, "y", result_info->appsRet.sendSs.ssString.string[ss_index]); } - ss_str = g_variant_builder_end(builder); + ss_str = g_variant_builder_end(&builder); result = g_variant_new("(iiivii)", exec_result, me_problem, ss_cause, ss_str, ss_str_len, call_ctrl_problem); } break; case TAPI_SAT_CMD_TYPE_SEND_USSD:{ - int index; + int ussd_index; gint exec_result, me_problem, ss_cause, ussd_str_len; - GVariantBuilder *builder = NULL; + GVariantBuilder builder; GVariant *ussd_str = NULL; dbg("send ussd : result format (iiivi)"); @@ -98,12 +98,12 @@ static GVariant* _tapi_sat_gen_app_exec_result_data(TelSatAppsRetInfo_t *result_ ss_cause = result_info->appsRet.sendUssd.ssCause; ussd_str_len = result_info->appsRet.sendUssd.ussdString.stringLen; - builder = g_variant_builder_new(G_VARIANT_TYPE ("ay")); - for (index = 0; index < ussd_str_len; index++) { - dbg("index(%d) data(%d)", index, result_info->appsRet.sendUssd.ussdString.string[index]); - g_variant_builder_add(builder, "y", result_info->appsRet.sendUssd.ussdString.string[index]); + g_variant_builder_init(&builder, G_VARIANT_TYPE ("ay")); + for (ussd_index = 0; ussd_index < ussd_str_len; ussd_index++) { + dbg("index(%d) data(%d)", ussd_index, result_info->appsRet.sendUssd.ussdString.string[ussd_index]); + g_variant_builder_add(&builder, "y", result_info->appsRet.sendUssd.ussdString.string[ussd_index]); } - ussd_str = g_variant_builder_end(builder); + ussd_str = g_variant_builder_end(&builder); result = g_variant_new("(iiivi)", exec_result, me_problem, ss_cause, ussd_str, ussd_str_len); } break; @@ -217,32 +217,24 @@ static void on_response_menu_selection_envelop(GObject *source_object, GAsyncRes GError *error = NULL; GDBusConnection *conn = NULL; - GVariant *rst; + GVariant *dbus_result; struct tapi_resp_data *evt_cb_data = user_data; int result = -1; int envelop_rsp = 0; conn = G_DBUS_CONNECTION (source_object); - rst = g_dbus_connection_call_finish(conn, res, &error); - CHECK_DEINIT(error); + dbus_result = g_dbus_connection_call_finish(conn, res, &error); + CHECK_ERROR(error); - if(!rst){ - evt_cb_data->cb_fn(evt_cb_data->handle, result, &envelop_rsp, evt_cb_data->user_data); - - g_error_free (error); - g_free(evt_cb_data); - return; - } - - g_variant_get (rst, "(ii)", &result, &envelop_rsp); + g_variant_get (dbus_result, "(ii)", &result, &envelop_rsp); dbg("menu selection envelop result(%d) envelop response(%d)", result, envelop_rsp); if (evt_cb_data->cb_fn) { evt_cb_data->cb_fn(evt_cb_data->handle, result, &envelop_rsp, evt_cb_data->user_data); } - g_variant_unref(rst); + g_variant_unref(dbus_result); g_free(evt_cb_data); } @@ -251,32 +243,24 @@ static void on_response_download_event_envelop(GObject *source_object, GAsyncRes GError *error = NULL; GDBusConnection *conn = NULL; - GVariant *rst; + GVariant *dbus_result; struct tapi_resp_data *evt_cb_data = user_data; int result = -1; int envelop_rsp = 0; conn = G_DBUS_CONNECTION (source_object); - rst = g_dbus_connection_call_finish(conn, res, &error); - CHECK_DEINIT(error); - - if(!rst){ - evt_cb_data->cb_fn(evt_cb_data->handle, result, &envelop_rsp, evt_cb_data->user_data); + dbus_result = g_dbus_connection_call_finish(conn, res, &error); + CHECK_ERROR(error); - g_error_free (error); - g_free(evt_cb_data); - return; - } - - g_variant_get (rst, "(ii)", &result, &envelop_rsp); + g_variant_get (dbus_result, "(ii)", &result, &envelop_rsp); dbg("download event envelop result(%d) envelop response(%d)", result, envelop_rsp); if (evt_cb_data->cb_fn) { evt_cb_data->cb_fn(evt_cb_data->handle, result, &envelop_rsp, evt_cb_data->user_data); } - g_variant_unref(rst); + g_variant_unref(dbus_result); g_free(evt_cb_data); } @@ -400,7 +384,7 @@ EXPORT_API int tel_get_sat_main_menu_info(TapiHandle *handle, TelSatSetupMenuInf #if defined(TIZEN_SUPPORT_SAT_ICON) GVariant *icon_id = NULL; GVariant *icon_list = NULL; - int index = 0, icon_index = 0; + int sat_index = 0, icon_index = 0; /* Used to get icon data */ GVariant *unbox; gboolean is_exist; @@ -414,7 +398,7 @@ EXPORT_API int tel_get_sat_main_menu_info(TapiHandle *handle, TelSatSetupMenuInf gint icon_list_quali, list_cnt, icon_list_identifier, list_width, list_height, list_ics, icon_list_data_len; gchar *icon_list_data = NULL; #else - int index = 0; + int sat_index = 0; #endif dbg("Func Entrance "); @@ -443,6 +427,7 @@ EXPORT_API int tel_get_sat_main_menu_info(TapiHandle *handle, TelSatSetupMenuInf g_variant_get(rst, "(iibs@vibb)", &result, &command_id, &b_present, &title, &items, &item_cnt, &b_helpinfo, &b_updated); #endif + g_variant_unref(rst); pMainMenu->commandId = command_id; pMainMenu->bIsMainMenuPresent = (b_present ? 1 : 0); @@ -453,6 +438,7 @@ EXPORT_API int tel_get_sat_main_menu_info(TapiHandle *handle, TelSatSetupMenuInf else{ memcpy(pMainMenu->satMainTitle, title, strlen(title)); } + g_free(title); pMainMenu->satMainMenuNum = item_cnt; if(items && item_cnt > 0){ @@ -466,18 +452,18 @@ EXPORT_API int tel_get_sat_main_menu_info(TapiHandle *handle, TelSatSetupMenuInf g_variant_get(unbox, "a(si)", &iter); while(g_variant_iter_loop(iter,"(si)",&item_str, &item_id)){ - pMainMenu->satMainMenuItem[index].itemId = item_id; + pMainMenu->satMainMenuItem[sat_index].itemId = item_id; if(strlen(item_str) > TAPI_SAT_DEF_ITEM_STR_LEN_MAX + 6){ - memcpy(pMainMenu->satMainMenuItem[index].itemString, item_str, TAPI_SAT_DEF_ITEM_STR_LEN_MAX + 6); + memcpy(pMainMenu->satMainMenuItem[sat_index].itemString, item_str, TAPI_SAT_DEF_ITEM_STR_LEN_MAX + 6); } else{ - memcpy(pMainMenu->satMainMenuItem[index].itemString, item_str, strlen(item_str)); + memcpy(pMainMenu->satMainMenuItem[sat_index].itemString, item_str, strlen(item_str)); } - dbg("item index(%d) id(%d) str(%s)",index, pMainMenu->satMainMenuItem[index].itemId, pMainMenu->satMainMenuItem[index].itemString); + dbg("item index(%d) id(%d) str(%s)",sat_index, pMainMenu->satMainMenuItem[sat_index].itemId, pMainMenu->satMainMenuItem[sat_index].itemString); //dbg("item index(%d) id(%d) str(%s)",index, item_id, item_str); - index++; + sat_index++; } g_variant_iter_free(iter); } @@ -598,6 +584,7 @@ EXPORT_API int tel_send_sat_ui_display_status(TapiHandle *handle, int commandId, else{ result = TAPI_API_OPERATION_FAILED; } + g_variant_unref(rst); dbg("result (%d)", result); return result; @@ -621,10 +608,10 @@ EXPORT_API int tel_send_sat_ui_user_confirm(TapiHandle *handle, TelSatUiUserConf { GError *error; GVariant *rst = NULL; - GVariantBuilder *builder = NULL; + GVariantBuilder builder; GVariant *inner_gv = NULL; - int index = 0; + int sat_index = 0; gchar *data; gint result, command_id, command_type, key_type, data_len; GVariant *inparam = NULL; @@ -641,12 +628,12 @@ EXPORT_API int tel_send_sat_ui_user_confirm(TapiHandle *handle, TelSatUiUserConf data = (gchar *)pUserConfirmData->pAdditionalData; data_len = pUserConfirmData->dataLen; - builder = g_variant_builder_new(G_VARIANT_TYPE ("ay")); - for (index = 0; index < data_len; index++) { - dbg("index(%d) data(%d)", index, data[index]); - g_variant_builder_add(builder, "y", data[index]); + g_variant_builder_init(&builder, G_VARIANT_TYPE ("ay")); + for (sat_index = 0; sat_index < data_len; sat_index++) { + dbg("index(%d) data(%d)", sat_index, data[sat_index]); + g_variant_builder_add(&builder, "y", data[sat_index]); } - inner_gv = g_variant_builder_end(builder); + inner_gv = g_variant_builder_end(&builder); dbg("command id(%d) command type(%d) key type(%d) data len(%d)", command_id, command_type, key_type, data_len); @@ -671,6 +658,7 @@ EXPORT_API int tel_send_sat_ui_user_confirm(TapiHandle *handle, TelSatUiUserConf else{ result = TAPI_API_OPERATION_FAILED; } + g_variant_unref(rst); dbg("result (%d)", result); return result; @@ -729,6 +717,7 @@ EXPORT_API int tel_send_sat_app_exec_result(TapiHandle *handle, TelSatAppsRetInf else{ result = TAPI_API_OPERATION_FAILED; } + g_variant_unref(rst); dbg("result (%d)", result); return result; diff --git a/wearable/src/tapi_sim.c b/src/tapi_sim.c similarity index 80% rename from wearable/src/tapi_sim.c rename to src/tapi_sim.c index 15ac534..ccb8eb7 100644 --- a/wearable/src/tapi_sim.c +++ b/src/tapi_sim.c @@ -1,7 +1,7 @@ /* * libslp-tapi * - * Copyright (c) 2012 Samsung Electronics Co., Ltd. All rights reserved. + * Copyright (c) 2014 Samsung Electronics Co., Ltd. All rights reserved. * * Contact: Ja-young Gu * @@ -40,8 +40,21 @@ #define DBUS_SIM_NOT_READY "SIM NOT READY" #define DBUS_SIM_RESPONSE_DATA_ERROR "SIM RESPONSE DATA ERROR" #define DBUS_SIM_SERVICE_IS_DISABLED "SIM SERVICE IS DISABLED" +#define DBUS_SIM_ACCESS_DENIED "No access rights" -#define TAPI_SIM_CHECK_TAPI_STATE() {\ +#define TAPI_PIN_TIMEOUT (350 * 1000) /* Unlimit: G_MAXINT */ + +#define TAPI_SIM_FUNCTION_ENTER(handle) { \ + dbg("Func Enterance. cp_name[%s]", handle->cp_name); \ +} + +#define TAPI_SIM_RESP_CB_ENTER(evt_cb_data) { \ + if (evt_cb_data && evt_cb_data->handle) \ + dbg("Func Enterance. cp_name[%s]", evt_cb_data->handle->cp_name); \ +} + +#define TAPI_SIM_CHECK_TAPI_STATE() { \ + TAPI_SIM_FUNCTION_ENTER(handle); \ if (_tel_check_tapi_state() != 0) \ return TAPI_API_SERVICE_NOT_READY; \ } @@ -72,10 +85,31 @@ return; \ } -struct tapi_sim_resp_data { - struct tapi_resp_data tapi_resp; - TelSimTapiOperation_t op_type; -}; +#define SIM_CHECK_ERROR(error, evt_cb_data) \ + if (error) { \ + warn("(%s) dbus error = %d (%s)", evt_cb_data->handle->cp_name, error->code, error->message); \ + if (error->code == G_IO_ERROR_CANCELLED \ + && error->domain == G_IO_ERROR) { \ + /* Do not invoke callback in case of deinit TapiHandle */ \ + g_error_free(error); \ + g_free(evt_cb_data); \ + return; \ + } else if (strstr(error->message, "No access rights")) { \ + err("Access denied"); \ + if (evt_cb_data->cb_fn) \ + evt_cb_data->cb_fn(evt_cb_data->handle, TAPI_ERROR_ACCESS_DENIED, NULL, evt_cb_data->user_data); \ + g_error_free(error); \ + g_free(evt_cb_data); \ + return; \ + } else if (strstr(error->message, "Operation not supported")) { \ + err("Operation not supported"); \ + if (evt_cb_data->cb_fn) \ + evt_cb_data->cb_fn(evt_cb_data->handle, TAPI_ERROR_OPERATION_NOT_SUPPORTED, NULL, evt_cb_data->user_data); \ + g_error_free(error); \ + g_free(evt_cb_data); \ + return; \ + } \ + } static TapiResult_t __check_err_msg(gchar* err_msg) { @@ -103,6 +137,8 @@ static TapiResult_t __check_err_msg(gchar* err_msg) ret = TAPI_API_OPERATION_FAILED; } else if( strstr(err_msg, DBUS_SIM_SERVICE_IS_DISABLED) ) { ret = TAPI_API_SIM_SERVICE_IS_DISABLED; + } else if (strstr(err_msg, DBUS_SIM_ACCESS_DENIED)) { + ret = TAPI_API_ACCESS_DENIED; } else { ret = TAPI_API_OPERATION_FAILED; } @@ -110,329 +146,6 @@ static TapiResult_t __check_err_msg(gchar* err_msg) return ret; } -static const gchar* __get_dbus_method_name(TelSimTapiOperation_t op_type) -{ - switch(op_type) { - case TAPI_SIM_GET_INIT_STATUS: - return "GetInitStatus"; - break; - case TAPI_SIM_GET_CARD_TYPE: - return "GetCardType"; - break; - case TAPI_SIM_GET_IMSI: - return "GetIMSI"; - break; - case TAPI_SIM_GET_ECC: - return "GetECC"; - break; - case TAPI_SIM_GET_ICCID: - return "GetICCID"; - break; - case TAPI_SIM_GET_MSISDN: - return "GetMSISDN"; - break; - case TAPI_SIM_GET_SPN: - return "GetSpn"; - break; - case TAPI_SIM_GET_CPHS_NET_NAME: - return "GetCphsNetName"; - break; - case TAPI_SIM_TRANSFER_APDU: - return "TransferAPDU"; - break; - case TAPI_SIM_GET_ATR: - return "GetATR"; - break; - - // below are not supported. - case TAPI_SIM_GET_LANGUAGE: - case TAPI_SIM_SET_LANGUAGE: - case TAPI_SIM_GET_CALL_FORWARDING: - case TAPI_SIM_SET_CALL_FORWARDING: - case TAPI_SIM_GET_MESSAGE_WAITING: - case TAPI_SIM_SET_MESSAGE_WAITING: - case TAPI_SIM_GET_MAILBOX: - case TAPI_SIM_SET_MAILBOX: - case TAPI_SIM_GET_CPHS_INFO: - case TAPI_SIM_GET_SVCT: - case TAPI_SIM_GET_OPLMWACT: - case TAPI_SIM_AUTHENTICATION: - case TAPI_SIM_VERIFY_SEC: - case TAPI_SIM_VERIFY_PUK: - case TAPI_SIM_CHANGE_PIN: - case TAPI_SIM_DISABLE_FACILITY: - case TAPI_SIM_ENABLE_FACILITY: - case TAPI_SIM_GET_FACILITY: - case TAPI_SIM_GET_LOCK_INFO: - case TAPI_SIM_GET_FIELDS: - case TAPI_SIM_STATUS: - case TAPI_SIM_REFRESHED: - default: - return "NotSupported"; - break; - } -} - -static GVariant* __make_dbus_req_data(TelSimTapiOperation_t op_type, TelSimRequestData_t *inparam) -{ - GVariant *param = NULL; - switch(op_type) { - case TAPI_SIM_GET_IMSI: - case TAPI_SIM_GET_ICCID: - case TAPI_SIM_GET_INIT_STATUS: - case TAPI_SIM_GET_MSISDN: - case TAPI_SIM_GET_SPN: - case TAPI_SIM_GET_CPHS_NET_NAME: - break; - - case TAPI_SIM_TRANSFER_APDU: { - GVariantBuilder *builder = NULL; - GVariant *inner_gv = NULL; - int i = 0; - - builder = g_variant_builder_new(G_VARIANT_TYPE ("ay")); - dbg("inparam->apdu.apdu_len=[%d]", inparam->apdu.apdu_len); - for (i = 0; i < inparam->apdu.apdu_len; i++) { - g_variant_builder_add(builder, "y", inparam->apdu.apdu[i]); - } - inner_gv = g_variant_builder_end(builder); - param = g_variant_new("(v)", inner_gv); - } break; - case TAPI_SIM_GET_ATR: - break; - - //not supported - case TAPI_SIM_GET_CARD_TYPE: - case TAPI_SIM_GET_ECC: - case TAPI_SIM_GET_LANGUAGE: - case TAPI_SIM_SET_LANGUAGE: - case TAPI_SIM_GET_CALL_FORWARDING: - case TAPI_SIM_SET_CALL_FORWARDING: - case TAPI_SIM_GET_MESSAGE_WAITING: - case TAPI_SIM_SET_MESSAGE_WAITING: - case TAPI_SIM_GET_MAILBOX: - case TAPI_SIM_SET_MAILBOX: - case TAPI_SIM_GET_CPHS_INFO: - case TAPI_SIM_GET_SVCT: - case TAPI_SIM_GET_OPLMWACT: - case TAPI_SIM_AUTHENTICATION: - case TAPI_SIM_VERIFY_SEC: - case TAPI_SIM_VERIFY_PUK: - case TAPI_SIM_CHANGE_PIN: - case TAPI_SIM_DISABLE_FACILITY: - case TAPI_SIM_ENABLE_FACILITY: - case TAPI_SIM_GET_FACILITY: - case TAPI_SIM_GET_LOCK_INFO: - case TAPI_SIM_GET_FIELDS: - case TAPI_SIM_STATUS: - case TAPI_SIM_REFRESHED: - default: - break; - } - - return param; -} - -static TelSimAccessResult_t __get_dbus_resp_data(TelSimTapiOperation_t op_type, GVariant *sync_gv, TelSimResponseData_t *outparam) -{ - TelSimAccessResult_t result = TAPI_SIM_ACCESS_SUCCESS; - GVariant *param_gv = NULL; - GVariant *inner_gv = NULL; - guchar rt_i; - unsigned short i = 0; - - GVariant *value = NULL; - GVariantIter *iter = NULL; - GVariantIter *iter_row = NULL; - const gchar *key = NULL; - const gchar *str_value = NULL; - - switch(op_type) { - case TAPI_SIM_GET_INIT_STATUS: { - g_variant_get(sync_gv, "(ib)", &outparam->init_info.card_status, &outparam->init_info.b_is_changed); - dbg("init_status[%d], changed[%d]", outparam->init_info.card_status, outparam->init_info.b_is_changed); - } break; - case TAPI_SIM_GET_CARD_TYPE: { - g_variant_get(sync_gv, "(i)", &outparam->card_type); - } break; - case TAPI_SIM_GET_ECC: { - g_variant_get(sync_gv, "(aa{sv})", &iter); - outparam->ecc_list.ecc_count = g_variant_iter_n_children(iter); - dbg("ecc_count[%d]",outparam->ecc_list.ecc_count); - i = 0; - while (g_variant_iter_next(iter, "a{sv}", &iter_row)) { - while (g_variant_iter_loop(iter_row, "{sv}", &key, &value)) { - if (!g_strcmp0(key, "name")) { - str_value = g_variant_get_string(value, NULL); - snprintf(outparam->ecc_list.list[i].name, strlen((const char*)str_value) + 1, "%s", str_value); - } - if (!g_strcmp0(key, "number")) { - str_value = g_variant_get_string(value, NULL); - snprintf(outparam->ecc_list.list[i].number, strlen((const char*)str_value) + 1, "%s", str_value); - } - if (!g_strcmp0(key, "category")) { - outparam->ecc_list.list[i].category = g_variant_get_int32(value); - } - } - i++; - g_variant_iter_free(iter_row); - } - g_variant_iter_free(iter); - } break; - case TAPI_SIM_GET_IMSI: { - gchar *gplmn = NULL; - gchar *gmsin = NULL; - int gplmn_len = 0; - int gmsin_len = 0; - - g_variant_get(sync_gv, "(ss)", &gplmn, &gmsin); - - gplmn_len = strlen((const char*)gplmn); - gmsin_len = strlen((const char*)gmsin); - - if (gplmn_len >= 5 && gmsin_len >= 9) { - snprintf(outparam->imsi_info.szMcc, 3 + 1, "%s", gplmn); - snprintf(outparam->imsi_info.szMnc, gplmn_len - 3 + 1, "%s", &gplmn[3]); - snprintf(outparam->imsi_info.szMsin, gmsin_len + 1, "%s", gmsin); - } else { - memset(&outparam->imsi_info, 0, sizeof(TelSimImsiInfo_t)); - } - } break; - case TAPI_SIM_GET_ICCID: { - gchar *iccid = NULL; - - g_variant_get(sync_gv, "(is)", &result, &iccid); - outparam->iccid_info.icc_length = strlen((const char*)iccid); - if(outparam->iccid_info.icc_length > TAPI_SIM_ICCID_LEN_MAX){ - dbg("current tapi support 20 byte but received length[%d] so changed"); - outparam->iccid_info.icc_length = TAPI_SIM_ICCID_LEN_MAX; - } - memcpy(outparam->iccid_info.icc_num, iccid, outparam->iccid_info.icc_length); - } break; - case TAPI_SIM_GET_MSISDN: { - g_variant_get(sync_gv, "(iaa{sv})", &result, &iter); - outparam->msisdn_list.count = g_variant_iter_n_children(iter); - - /*this can be changed regarding concept*/ - if(outparam->msisdn_list.count > 3){ - dbg("current list.count[%d] but we fixed maximum with 3", outparam->msisdn_list.count); - outparam->msisdn_list.count = 3; - } - /*this can be changed regarding concept*/ - - i = 0; - while (g_variant_iter_next(iter, "a{sv}", &iter_row)) { - while (g_variant_iter_loop(iter_row, "{sv}", &key, &value)) { - if (!g_strcmp0(key, "name")) { - str_value = g_variant_get_string(value, NULL); - snprintf(outparam->msisdn_list.list[i].name, strlen((const char*)str_value) + 1, "%s", str_value); - } - if (!g_strcmp0(key, "number")) { - str_value = g_variant_get_string(value, NULL); - snprintf(outparam->msisdn_list.list[i].num, strlen((const char*)str_value) + 1, "%s", str_value); - } - } - i++; - g_variant_iter_free(iter_row); - /*this can be changed regarding concept*/ - if (i == 3) - break; - /*this can be changed regarding concept*/ - } - g_variant_iter_free(iter); - - dbg("msisdn count[%d]", outparam->msisdn_list.count); - for(i =0; i < outparam->msisdn_list.count; i++){ - dbg("msisdn[%d]-name[%s]number[%s]",i,outparam->msisdn_list.list[i].name, outparam->msisdn_list.list[i].num); - } - } break; - case TAPI_SIM_GET_SPN: { - gchar *spn = NULL; - guchar dc = 0; - - g_variant_get(sync_gv, "(iys)", &result, &dc, &spn); - dbg("result[%d]", result); - if ( result == TAPI_SIM_ACCESS_SUCCESS) { - dbg("spn[%s], display condition[0x%x]", spn, dc); - outparam->spn.display_condition = dc; - snprintf((char *)outparam->spn.spn, strlen((const char*)spn)+1, "%s", spn); - } - } break; - case TAPI_SIM_GET_CPHS_NET_NAME: { - gchar *full_name = NULL; - gchar *short_name = NULL; - - g_variant_get(sync_gv, "(iss)", &result, &full_name, &short_name); - - dbg("result[%d]", result); - if ( result == TAPI_SIM_ACCESS_SUCCESS) { - dbg("full name[%s], short name[%s]", full_name, short_name); - snprintf((char *)outparam->cphs_netname.full_name, strlen((const char*)full_name)+1, "%s", full_name); - snprintf((char *)outparam->cphs_netname.short_name, strlen((const char*)short_name)+1, "%s", short_name); - } - } break; - - case TAPI_SIM_TRANSFER_APDU: { - g_variant_get(sync_gv, "(i@v)", &result, ¶m_gv); - inner_gv = g_variant_get_variant(param_gv); - - g_variant_get(inner_gv, "ay", &iter); - while (g_variant_iter_loop(iter, "y", &rt_i)) { - outparam->apdu_resp.apdu_resp[i] = rt_i; - i++; - } - outparam->apdu_resp.apdu_resp_len = i; - dbg("r_apdu.apdu_resp_len=[%d]", outparam->apdu_resp.apdu_resp_len); - g_variant_iter_free(iter); - g_variant_unref(inner_gv); - g_variant_unref(param_gv); - } break; - case TAPI_SIM_GET_ATR: { - g_variant_get(sync_gv, "(i@v)", &result, ¶m_gv); - inner_gv = g_variant_get_variant(param_gv); - - g_variant_get(inner_gv, "ay", &iter); - while (g_variant_iter_loop(iter, "y", &rt_i)) { - outparam->atr_resp.atr_resp[i] = rt_i; - i++; - } - outparam->atr_resp.atr_resp_len = i; - dbg("r_atr.atr_resp_len=[%d]", outparam->atr_resp.atr_resp_len); - g_variant_iter_free(iter); - g_variant_unref(inner_gv); - g_variant_unref(param_gv); - } break; - - case TAPI_SIM_GET_LANGUAGE:break; - case TAPI_SIM_SET_LANGUAGE:break; - case TAPI_SIM_GET_CALL_FORWARDING:break; - case TAPI_SIM_SET_CALL_FORWARDING:break; - case TAPI_SIM_GET_MESSAGE_WAITING:break; - case TAPI_SIM_SET_MESSAGE_WAITING:break; - case TAPI_SIM_GET_MAILBOX:break; - case TAPI_SIM_SET_MAILBOX:break; - case TAPI_SIM_GET_CPHS_INFO:break; - case TAPI_SIM_GET_SVCT:break; - case TAPI_SIM_GET_OPLMWACT:break; - case TAPI_SIM_AUTHENTICATION:break; - case TAPI_SIM_VERIFY_SEC:break; - case TAPI_SIM_VERIFY_PUK:break; - case TAPI_SIM_CHANGE_PIN:break; - case TAPI_SIM_DISABLE_FACILITY:break; - case TAPI_SIM_ENABLE_FACILITY:break; - case TAPI_SIM_GET_FACILITY:break; - case TAPI_SIM_GET_LOCK_INFO:break; - case TAPI_SIM_GET_FIELDS:break; //for get various data at once - - //for notification - case TAPI_SIM_STATUS:break; - case TAPI_SIM_REFRESHED:break; - default:break; - } - - return result; -} - static int _tel_check_tapi_state() { return 0; @@ -449,12 +162,12 @@ static void on_response_get_sim_iccid(GObject *source_object, GAsyncResult *res, TelSimIccIdInfo_t iccid_info; gchar *iccid = NULL; - dbg("Func Entrance"); + TAPI_SIM_RESP_CB_ENTER(evt_cb_data); memset(&iccid_info, 0, sizeof(TelSimIccIdInfo_t)); conn = G_DBUS_CONNECTION (source_object); dbus_result = g_dbus_connection_call_finish(conn, res, &error); - CHECK_DEINIT(error); + SIM_CHECK_ERROR(error, evt_cb_data); if (!dbus_result) { TAPI_SIM_CHECK_ERR_MSG_AND_CALL_NULL_CBFUNC(error, evt_cb_data); @@ -467,9 +180,11 @@ static void on_response_get_sim_iccid(GObject *source_object, GAsyncResult *res, iccid_info.icc_length = TAPI_SIM_ICCID_LEN_MAX; } memcpy(iccid_info.icc_num, iccid, iccid_info.icc_length); + g_free(iccid); TAPI_SIM_CALL_CBFUNC(evt_cb_data, result, &iccid_info); g_free(evt_cb_data); + g_variant_unref(dbus_result); } static void on_response_get_sim_language(GObject *source_object, GAsyncResult *res, @@ -483,10 +198,10 @@ static void on_response_get_sim_language(GObject *source_object, GAsyncResult *r TelSimLanguagePreferenceCode_t lang = TAPI_SIM_LP_LANG_UNSPECIFIED; TelSimAccessResult_t result = TAPI_SIM_ACCESS_SUCCESS; - dbg("Func Entrance"); + TAPI_SIM_RESP_CB_ENTER(evt_cb_data); conn = G_DBUS_CONNECTION (source_object); dbus_result = g_dbus_connection_call_finish(conn, res, &error); - CHECK_DEINIT(error); + SIM_CHECK_ERROR(error, evt_cb_data); if (!dbus_result) { TAPI_SIM_CHECK_ERR_MSG_AND_CALL_NULL_CBFUNC(error, evt_cb_data); @@ -499,6 +214,7 @@ static void on_response_get_sim_language(GObject *source_object, GAsyncResult *r } g_free(evt_cb_data); + g_variant_unref(dbus_result); } static void on_response_set_sim_language(GObject *source_object, GAsyncResult *res, @@ -511,10 +227,10 @@ static void on_response_set_sim_language(GObject *source_object, GAsyncResult *r struct tapi_resp_data *evt_cb_data = user_data; TelSimAccessResult_t result = TAPI_SIM_ACCESS_SUCCESS; - dbg("Func Entrance"); + TAPI_SIM_RESP_CB_ENTER(evt_cb_data); conn = G_DBUS_CONNECTION (source_object); dbus_result = g_dbus_connection_call_finish(conn, res, &error); - CHECK_DEINIT(error); + SIM_CHECK_ERROR(error, evt_cb_data); if (!dbus_result) { TAPI_SIM_CHECK_ERR_MSG_AND_CALL_NULL_CBFUNC(error, evt_cb_data); @@ -527,6 +243,7 @@ static void on_response_set_sim_language(GObject *source_object, GAsyncResult *r } g_free(evt_cb_data); + g_variant_unref(dbus_result); } static void on_response_get_sim_callforwarding_info(GObject *source_object, GAsyncResult *res, @@ -546,12 +263,12 @@ static void on_response_get_sim_callforwarding_info(GObject *source_object, GAsy TelSimCallForwardingResp_t cf; int i =0; + TAPI_SIM_RESP_CB_ENTER(evt_cb_data); memset(&cf, 0, sizeof(TelSimCallForwardingResp_t)); - dbg("Func Entrance"); conn = G_DBUS_CONNECTION (source_object); dbus_result = g_dbus_connection_call_finish(conn, res, &error); - CHECK_DEINIT(error); + SIM_CHECK_ERROR(error, evt_cb_data); if (!dbus_result) { TAPI_SIM_CHECK_ERR_MSG_AND_CALL_NULL_CBFUNC(error, evt_cb_data); @@ -616,6 +333,7 @@ static void on_response_get_sim_callforwarding_info(GObject *source_object, GAsy } g_free(evt_cb_data); + g_variant_unref(dbus_result); } static void on_response_set_sim_callforwarding_info(GObject *source_object, GAsyncResult *res, @@ -628,10 +346,10 @@ static void on_response_set_sim_callforwarding_info(GObject *source_object, GAsy struct tapi_resp_data *evt_cb_data = user_data; TelSimAccessResult_t result = TAPI_SIM_ACCESS_SUCCESS; - dbg("Func Entrance"); + TAPI_SIM_RESP_CB_ENTER(evt_cb_data); conn = G_DBUS_CONNECTION (source_object); dbus_result = g_dbus_connection_call_finish(conn, res, &error); - CHECK_DEINIT(error); + SIM_CHECK_ERROR(error, evt_cb_data); if (!dbus_result) { TAPI_SIM_CHECK_ERR_MSG_AND_CALL_NULL_CBFUNC(error, evt_cb_data); @@ -644,6 +362,7 @@ static void on_response_set_sim_callforwarding_info(GObject *source_object, GAsy } g_free(evt_cb_data); + g_variant_unref(dbus_result); } @@ -663,12 +382,12 @@ static void on_response_get_sim_messagewaiting_info(GObject *source_object, GAsy TelSimMessageWaitingResp_t mw; int i =0; - dbg("Func Entrance"); + TAPI_SIM_RESP_CB_ENTER(evt_cb_data); memset(&mw, 0, sizeof(TelSimMessageWaitingResp_t)); conn = G_DBUS_CONNECTION (source_object); dbus_result = g_dbus_connection_call_finish(conn, res, &error); - CHECK_DEINIT(error); + SIM_CHECK_ERROR(error, evt_cb_data); if (!dbus_result) { TAPI_SIM_CHECK_ERR_MSG_AND_CALL_NULL_CBFUNC(error, evt_cb_data); @@ -694,8 +413,6 @@ static void on_response_get_sim_messagewaiting_info(GObject *source_object, GAsy } } else { - mw.mw_list.profile_count = g_variant_iter_n_children(iter); - while (g_variant_iter_next(iter, "a{sv}", &iter_row)) { while (g_variant_iter_loop(iter_row, "{sv}", &key, &value)) { if (!g_strcmp0(key, "rec_index")) { @@ -722,6 +439,11 @@ static void on_response_get_sim_messagewaiting_info(GObject *source_object, GAsy } i++; g_variant_iter_free(iter_row); + mw.mw_list.profile_count++; + + /* Max MSP record supported check */ + if (i == TAPI_SIM_MSP_CNT_MAX) + break; } g_variant_iter_free(iter); } @@ -731,6 +453,7 @@ static void on_response_get_sim_messagewaiting_info(GObject *source_object, GAsy } g_free(evt_cb_data); + g_variant_unref(dbus_result); } static void on_response_set_sim_messagewaiting_info(GObject *source_object, GAsyncResult *res, @@ -743,10 +466,10 @@ static void on_response_set_sim_messagewaiting_info(GObject *source_object, GAsy struct tapi_resp_data *evt_cb_data = user_data; TelSimAccessResult_t result = TAPI_SIM_ACCESS_SUCCESS; - dbg("Func Entrance"); + TAPI_SIM_RESP_CB_ENTER(evt_cb_data); conn = G_DBUS_CONNECTION (source_object); dbus_result = g_dbus_connection_call_finish(conn, res, &error); - CHECK_DEINIT(error); + SIM_CHECK_ERROR(error, evt_cb_data); if (!dbus_result) { TAPI_SIM_CHECK_ERR_MSG_AND_CALL_NULL_CBFUNC(error, evt_cb_data); @@ -759,6 +482,7 @@ static void on_response_set_sim_messagewaiting_info(GObject *source_object, GAsy } g_free(evt_cb_data); + g_variant_unref(dbus_result); } static void on_response_get_sim_mailbox_info(GObject *source_object, GAsyncResult *res, @@ -778,12 +502,12 @@ static void on_response_get_sim_mailbox_info(GObject *source_object, GAsyncResul int i = 0; gboolean b_cphs = 0; - dbg("Func Entrance"); + TAPI_SIM_RESP_CB_ENTER(evt_cb_data); memset(&list, 0, sizeof(TelSimMailboxList_t)); conn = G_DBUS_CONNECTION (source_object); dbus_result = g_dbus_connection_call_finish(conn, res, &error); - CHECK_DEINIT(error); + SIM_CHECK_ERROR(error, evt_cb_data); if (!dbus_result) { TAPI_SIM_CHECK_ERR_MSG_AND_CALL_NULL_CBFUNC(error, evt_cb_data); @@ -791,7 +515,7 @@ static void on_response_get_sim_mailbox_info(GObject *source_object, GAsyncResul g_variant_get(dbus_result, "(ibaa{sv})", &result, &b_cphs, &iter); list.count = g_variant_iter_n_children(iter); - dbg("list.count=[%d]", list.count); + msg("list.count=[%d]", list.count); i = 0; while (g_variant_iter_next(iter, "a{sv}", &iter_row)) { @@ -841,6 +565,7 @@ static void on_response_get_sim_mailbox_info(GObject *source_object, GAsyncResul } g_free(evt_cb_data); + g_variant_unref(dbus_result); } static void on_response_set_sim_mailbox_info(GObject *source_object, GAsyncResult *res, @@ -853,10 +578,10 @@ static void on_response_set_sim_mailbox_info(GObject *source_object, GAsyncResul struct tapi_resp_data *evt_cb_data = user_data; TelSimAccessResult_t result = TAPI_SIM_ACCESS_SUCCESS; - dbg("Func Entrance"); + TAPI_SIM_RESP_CB_ENTER(evt_cb_data); conn = G_DBUS_CONNECTION (source_object); dbus_result = g_dbus_connection_call_finish(conn, res, &error); - CHECK_DEINIT(error); + SIM_CHECK_ERROR(error, evt_cb_data); if (!dbus_result) { TAPI_SIM_CHECK_ERR_MSG_AND_CALL_NULL_CBFUNC(error, evt_cb_data); @@ -869,6 +594,7 @@ static void on_response_set_sim_mailbox_info(GObject *source_object, GAsyncResul } g_free(evt_cb_data); + g_variant_unref(dbus_result); } static void on_response_get_sim_cphs_info(GObject *source_object, GAsyncResult *res, @@ -882,12 +608,12 @@ static void on_response_get_sim_cphs_info(GObject *source_object, GAsyncResult * TelSimAccessResult_t result = TAPI_SIM_ACCESS_SUCCESS; TelSimCphsInfo_t cphs; - dbg("Func Entrance"); + TAPI_SIM_RESP_CB_ENTER(evt_cb_data); memset(&cphs, 0, sizeof(TelSimCphsInfo_t)); conn = G_DBUS_CONNECTION (source_object); dbus_result = g_dbus_connection_call_finish(conn, res, &error); - CHECK_DEINIT(error); + SIM_CHECK_ERROR(error, evt_cb_data); if (!dbus_result) { TAPI_SIM_CHECK_ERR_MSG_AND_CALL_NULL_CBFUNC(error, evt_cb_data); @@ -904,6 +630,7 @@ static void on_response_get_sim_cphs_info(GObject *source_object, GAsyncResult * } g_free(evt_cb_data); + g_variant_unref(dbus_result); } static void on_response_get_sim_service_table(GObject *source_object, GAsyncResult *res, @@ -923,12 +650,12 @@ static void on_response_get_sim_service_table(GObject *source_object, GAsyncResu TelSimAccessResult_t result = TAPI_SIM_ACCESS_SUCCESS; TelSimServiceTable_t svct; - dbg("Func Entrance"); + TAPI_SIM_RESP_CB_ENTER(evt_cb_data); memset(&svct, 0, sizeof(TelSimServiceTable_t)); conn = G_DBUS_CONNECTION (source_object); dbus_result = g_dbus_connection_call_finish(conn, res, &error); - CHECK_DEINIT(error); + SIM_CHECK_ERROR(error, evt_cb_data); if (!dbus_result) { TAPI_SIM_CHECK_ERR_MSG_AND_CALL_NULL_CBFUNC(error, evt_cb_data); @@ -938,10 +665,40 @@ static void on_response_get_sim_service_table(GObject *source_object, GAsyncResu inner_gv = g_variant_get_variant(param_gv); g_variant_get(inner_gv, "ay", &iter); - while (g_variant_iter_loop(iter, "y", &value)) { - svct.table.ust.service[i] = value; - i++; + + if (TAPI_SIM_CARD_TYPE_GSM == svct.sim_type) { + while (g_variant_iter_loop(iter, "y", &value)) { + svct.table.sst.service[i] = value; + i++; + } + } else if(TAPI_SIM_CARD_TYPE_USIM == svct.sim_type) { + while (g_variant_iter_loop(iter, "y", &value)) { + svct.table.ust.service[i] = value; + i++; + } + } else if(TAPI_SIM_CARD_TYPE_RUIM == svct.sim_type) { + g_variant_get(dbus_result, "(ii@v)", &result, &svct.table.cst.cdma_svc_table, ¶m_gv); + inner_gv = g_variant_get_variant(param_gv); + + g_variant_get(inner_gv, "ay", &iter); + + if(TAPI_SIM_CDMA_SVC_TABLE == svct.table.cst.cdma_svc_table) { + while (g_variant_iter_loop(iter, "y", &value)) { + svct.table.cst.service.cdma_service[i] = value; + i++; + } + } else if(TAPI_SIM_CSIM_SVC_TABLE == svct.table.cst.cdma_svc_table) { + while (g_variant_iter_loop(iter, "y", &value)) { + svct.table.cst.service.csim_service[i] = value; + i++; + } + } else { + err("Invalid cdma_svc_table:[%d]", svct.table.cst.cdma_svc_table); + } + } else { + err("Invalid sim_type:[%d]", svct.sim_type); } + g_variant_iter_free(iter); g_variant_unref(inner_gv); g_variant_unref(param_gv); @@ -951,6 +708,7 @@ static void on_response_get_sim_service_table(GObject *source_object, GAsyncResu } g_free(evt_cb_data); + g_variant_unref(dbus_result); } static void on_response_get_sim_msisdn(GObject *source_object, GAsyncResult *res, @@ -969,12 +727,12 @@ static void on_response_get_sim_msisdn(GObject *source_object, GAsyncResult *res TelSimMsisdnList_t list; int i = 0; - dbg("Func Entrance"); + TAPI_SIM_RESP_CB_ENTER(evt_cb_data); memset(&list, 0, sizeof(TelSimMsisdnList_t)); conn = G_DBUS_CONNECTION (source_object); dbus_result = g_dbus_connection_call_finish(conn, res, &error); - CHECK_DEINIT(error); + SIM_CHECK_ERROR(error, evt_cb_data); if (!dbus_result) { TAPI_SIM_CHECK_ERR_MSG_AND_CALL_NULL_CBFUNC(error, evt_cb_data); @@ -1011,13 +769,14 @@ static void on_response_get_sim_msisdn(GObject *source_object, GAsyncResult *res } g_variant_iter_free(iter); - dbg("msisdn count[%d]", list.count); + msg("msisdn count[%d]", list.count); for(i =0; i < list.count; i++){ dbg("msisdn[%d]-name[%s]number[%s]",i,list.list[i].name, list.list[i].num); } TAPI_SIM_CALL_CBFUNC(evt_cb_data, result, &list); g_free(evt_cb_data); + g_variant_unref(dbus_result); } static void on_response_get_sim_oplmnwact(GObject *source_object, GAsyncResult *res, @@ -1036,12 +795,12 @@ static void on_response_get_sim_oplmnwact(GObject *source_object, GAsyncResult * TelSimOplmnwactList_t list; int i = 0; - dbg("Func Entrance"); + TAPI_SIM_RESP_CB_ENTER(evt_cb_data); memset(&list, 0, sizeof(TelSimOplmnwactList_t)); conn = G_DBUS_CONNECTION (source_object); dbus_result = g_dbus_connection_call_finish(conn, res, &error); - CHECK_DEINIT(error); + SIM_CHECK_ERROR(error, evt_cb_data); if (!dbus_result) { TAPI_SIM_CHECK_ERR_MSG_AND_CALL_NULL_CBFUNC(error, evt_cb_data); @@ -1074,6 +833,7 @@ static void on_response_get_sim_oplmnwact(GObject *source_object, GAsyncResult * } g_free(evt_cb_data); + g_variant_unref(dbus_result); } static void on_response_get_sim_spn(GObject *source_object, GAsyncResult *res, @@ -1089,12 +849,12 @@ static void on_response_get_sim_spn(GObject *source_object, GAsyncResult *res, gchar *spn = NULL; guchar dc = 0; + TAPI_SIM_RESP_CB_ENTER(evt_cb_data); memset(&spn_info, 0, sizeof(TelSimSpn_t)); - dbg("Func Entrance"); conn = G_DBUS_CONNECTION (source_object); dbus_result = g_dbus_connection_call_finish(conn, res, &error); - CHECK_DEINIT(error); + SIM_CHECK_ERROR(error, evt_cb_data); if (!dbus_result) { TAPI_SIM_CHECK_ERR_MSG_AND_CALL_NULL_CBFUNC(error, evt_cb_data); @@ -1104,13 +864,15 @@ static void on_response_get_sim_spn(GObject *source_object, GAsyncResult *res, dbg("result[%d]", result); if ( result == TAPI_SIM_ACCESS_SUCCESS) { - dbg("spn[%s], display condition[0x%x]", spn, dc); + msg("spn[%s], display condition[0x%x]", spn, dc); spn_info.display_condition = dc; snprintf((char *)spn_info.spn, strlen((const char*)spn)+1, "%s", spn); } + g_free(spn); TAPI_SIM_CALL_CBFUNC(evt_cb_data, result, &spn_info); g_free(evt_cb_data); + g_variant_unref(dbus_result); } static void on_response_get_sim_cphs_netname(GObject *source_object, GAsyncResult *res, @@ -1126,12 +888,12 @@ static void on_response_get_sim_cphs_netname(GObject *source_object, GAsyncResul gchar *full_name = NULL; gchar *short_name = NULL; + TAPI_SIM_RESP_CB_ENTER(evt_cb_data); memset(&cphs_net, 0, sizeof(TelSimCphsNetName_t)); - dbg("Func Entrance"); conn = G_DBUS_CONNECTION (source_object); dbus_result = g_dbus_connection_call_finish(conn, res, &error); - CHECK_DEINIT(error); + SIM_CHECK_ERROR(error, evt_cb_data); if (!dbus_result) { TAPI_SIM_CHECK_ERR_MSG_AND_CALL_NULL_CBFUNC(error, evt_cb_data); @@ -1141,16 +903,19 @@ static void on_response_get_sim_cphs_netname(GObject *source_object, GAsyncResul dbg("result[%d]", result); if ( result == TAPI_SIM_ACCESS_SUCCESS) { - dbg("full name[%s], short name[%s]", full_name, short_name); + msg("full name[%s], short name[%s]", full_name, short_name); snprintf((char *)cphs_net.full_name, strlen((const char*)full_name)+1, "%s", full_name); snprintf((char *)cphs_net.short_name, strlen((const char*)short_name)+1, "%s", short_name); } + g_free(full_name); + g_free(short_name); if (evt_cb_data->cb_fn) { evt_cb_data->cb_fn(evt_cb_data->handle, result, &cphs_net, evt_cb_data->user_data); } g_free(evt_cb_data); + g_variant_unref(dbus_result); } static void on_response_req_sim_authentication(GObject *source_object, GAsyncResult *res, @@ -1176,12 +941,12 @@ static void on_response_req_sim_authentication(GObject *source_object, GAsyncRes TelSimAccessResult_t result = TAPI_SIM_ACCESS_SUCCESS; TelSimAuthenticationResponse_t auth_resp; - dbg("Func Entrance"); + TAPI_SIM_RESP_CB_ENTER(evt_cb_data); memset(&auth_resp, 0, sizeof(TelSimAuthenticationResponse_t)); conn = G_DBUS_CONNECTION (source_object); dbus_result = g_dbus_connection_call_finish(conn, res, &error); - CHECK_DEINIT(error); + SIM_CHECK_ERROR(error, evt_cb_data); if (!dbus_result) { TAPI_SIM_CHECK_ERR_MSG_AND_CALL_NULL_CBFUNC(error, evt_cb_data); @@ -1236,6 +1001,7 @@ static void on_response_req_sim_authentication(GObject *source_object, GAsyncRes } g_free(evt_cb_data); + g_variant_unref(dbus_result); } static void on_response_verify_sim_pins(GObject *source_object, GAsyncResult *res, @@ -1249,12 +1015,12 @@ static void on_response_verify_sim_pins(GObject *source_object, GAsyncResult *re TelSimPinOperationResult_t result = TAPI_SIM_PIN_OPERATION_SUCCESS; TelSimSecResult_t sec_rt; - dbg("Func Entrance"); + TAPI_SIM_RESP_CB_ENTER(evt_cb_data); memset(&sec_rt, 0, sizeof(TelSimSecResult_t)); conn = G_DBUS_CONNECTION (source_object); dbus_result = g_dbus_connection_call_finish(conn, res, &error); - CHECK_DEINIT(error); + SIM_CHECK_ERROR(error, evt_cb_data); if (!dbus_result) { TAPI_SIM_CHECK_ERR_MSG_AND_CALL_NULL_CBFUNC(error, evt_cb_data); @@ -1267,6 +1033,7 @@ static void on_response_verify_sim_pins(GObject *source_object, GAsyncResult *re } g_free(evt_cb_data); + g_variant_unref(dbus_result); } static void on_response_verify_sim_puks(GObject *source_object, GAsyncResult *res, @@ -1280,12 +1047,12 @@ static void on_response_verify_sim_puks(GObject *source_object, GAsyncResult *re TelSimPinOperationResult_t result = TAPI_SIM_PIN_OPERATION_SUCCESS; TelSimSecResult_t sec_rt; - dbg("Func Entrance"); + TAPI_SIM_RESP_CB_ENTER(evt_cb_data); memset(&sec_rt, 0, sizeof(TelSimSecResult_t)); conn = G_DBUS_CONNECTION (source_object); dbus_result = g_dbus_connection_call_finish(conn, res, &error); - CHECK_DEINIT(error); + SIM_CHECK_ERROR(error, evt_cb_data); if (!dbus_result) { TAPI_SIM_CHECK_ERR_MSG_AND_CALL_NULL_CBFUNC(error, evt_cb_data); @@ -1298,6 +1065,7 @@ static void on_response_verify_sim_puks(GObject *source_object, GAsyncResult *re } g_free(evt_cb_data); + g_variant_unref(dbus_result); } static void on_response_change_sim_pins(GObject *source_object, GAsyncResult *res, @@ -1311,12 +1079,12 @@ static void on_response_change_sim_pins(GObject *source_object, GAsyncResult *re TelSimPinOperationResult_t result = TAPI_SIM_PIN_OPERATION_SUCCESS; TelSimSecResult_t sec_rt; - dbg("Func Entrance"); + TAPI_SIM_RESP_CB_ENTER(evt_cb_data); memset(&sec_rt, 0, sizeof(TelSimSecResult_t)); conn = G_DBUS_CONNECTION (source_object); dbus_result = g_dbus_connection_call_finish(conn, res, &error); - CHECK_DEINIT(error); + SIM_CHECK_ERROR(error, evt_cb_data); if (!dbus_result) { TAPI_SIM_CHECK_ERR_MSG_AND_CALL_NULL_CBFUNC(error, evt_cb_data); @@ -1329,6 +1097,7 @@ static void on_response_change_sim_pins(GObject *source_object, GAsyncResult *re } g_free(evt_cb_data); + g_variant_unref(dbus_result); } static void on_response_disable_sim_facility(GObject *source_object, GAsyncResult *res, @@ -1342,12 +1111,12 @@ static void on_response_disable_sim_facility(GObject *source_object, GAsyncResul TelSimPinOperationResult_t result = TAPI_SIM_PIN_OPERATION_SUCCESS; TelSimFacilityResult_t f_rt; - dbg("Func Entrance"); + TAPI_SIM_RESP_CB_ENTER(evt_cb_data); memset(&f_rt, 0, sizeof(TelSimFacilityResult_t)); conn = G_DBUS_CONNECTION (source_object); dbus_result = g_dbus_connection_call_finish(conn, res, &error); - CHECK_DEINIT(error); + SIM_CHECK_ERROR(error, evt_cb_data); if (!dbus_result) { TAPI_SIM_CHECK_ERR_MSG_AND_CALL_NULL_CBFUNC(error, evt_cb_data); @@ -1357,6 +1126,7 @@ static void on_response_disable_sim_facility(GObject *source_object, GAsyncResul TAPI_SIM_CALL_CBFUNC(evt_cb_data, result, &f_rt); g_free(evt_cb_data); + g_variant_unref(dbus_result); } static void on_response_enable_sim_facility(GObject *source_object, GAsyncResult *res, @@ -1370,12 +1140,12 @@ static void on_response_enable_sim_facility(GObject *source_object, GAsyncResult TelSimPinOperationResult_t result = TAPI_SIM_PIN_OPERATION_SUCCESS; TelSimFacilityResult_t f_rt; - dbg("Func Entrance"); + TAPI_SIM_RESP_CB_ENTER(evt_cb_data); memset(&f_rt, 0, sizeof(TelSimFacilityResult_t)); conn = G_DBUS_CONNECTION (source_object); dbus_result = g_dbus_connection_call_finish(conn, res, &error); - CHECK_DEINIT(error); + SIM_CHECK_ERROR(error, evt_cb_data); if (!dbus_result) { TAPI_SIM_CHECK_ERR_MSG_AND_CALL_NULL_CBFUNC(error, evt_cb_data); @@ -1385,6 +1155,7 @@ static void on_response_enable_sim_facility(GObject *source_object, GAsyncResult TAPI_SIM_CALL_CBFUNC(evt_cb_data, result, &f_rt); g_free(evt_cb_data); + g_variant_unref(dbus_result); } static void on_response_get_sim_facility(GObject *source_object, GAsyncResult *res, @@ -1398,12 +1169,12 @@ static void on_response_get_sim_facility(GObject *source_object, GAsyncResult *r TelSimPinOperationResult_t result = TAPI_SIM_PIN_OPERATION_SUCCESS; TelSimFacilityInfo_t fi; - dbg("Func Entrance"); + TAPI_SIM_RESP_CB_ENTER(evt_cb_data); memset(&fi, 0, sizeof(TelSimFacilityInfo_t)); conn = G_DBUS_CONNECTION (source_object); dbus_result = g_dbus_connection_call_finish(conn, res, &error); - CHECK_DEINIT(error); + SIM_CHECK_ERROR(error, evt_cb_data); if (!dbus_result) { TAPI_SIM_CHECK_ERR_MSG_AND_CALL_NULL_CBFUNC(error, evt_cb_data); @@ -1413,6 +1184,7 @@ static void on_response_get_sim_facility(GObject *source_object, GAsyncResult *r TAPI_SIM_CALL_CBFUNC(evt_cb_data, result, &fi); g_free(evt_cb_data); + g_variant_unref(dbus_result); } static void on_response_get_sim_lock_info(GObject *source_object, GAsyncResult *res, @@ -1426,12 +1198,12 @@ static void on_response_get_sim_lock_info(GObject *source_object, GAsyncResult * TelSimPinOperationResult_t result = TAPI_SIM_PIN_OPERATION_SUCCESS; TelSimLockInfo_t lock; - dbg("Func Entrance"); + TAPI_SIM_RESP_CB_ENTER(evt_cb_data); memset(&lock, 0, sizeof(TelSimLockInfo_t)); conn = G_DBUS_CONNECTION (source_object); dbus_result = g_dbus_connection_call_finish(conn, res, &error); - CHECK_DEINIT(error); + SIM_CHECK_ERROR(error, evt_cb_data); if (!dbus_result) { TAPI_SIM_CHECK_ERR_MSG_AND_CALL_NULL_CBFUNC(error, evt_cb_data); @@ -1445,6 +1217,7 @@ static void on_response_get_sim_lock_info(GObject *source_object, GAsyncResult * } g_free(evt_cb_data); + g_variant_unref(dbus_result); } static void on_response_req_sim_apdu(GObject *source_object, GAsyncResult *res, gpointer user_data) @@ -1463,12 +1236,12 @@ static void on_response_req_sim_apdu(GObject *source_object, GAsyncResult *res, TelSimAccessResult_t result = TAPI_SIM_ACCESS_SUCCESS; TelSimApduResp_t r_apdu; - dbg("Func Entrance"); + TAPI_SIM_RESP_CB_ENTER(evt_cb_data); memset(&r_apdu, 0, sizeof(TelSimApduResp_t)); conn = G_DBUS_CONNECTION (source_object); dbus_result = g_dbus_connection_call_finish(conn, res, &error); - CHECK_DEINIT(error); + SIM_CHECK_ERROR(error, evt_cb_data); if (!dbus_result) { TAPI_SIM_CHECK_ERR_MSG_AND_CALL_NULL_CBFUNC(error, evt_cb_data); @@ -1496,6 +1269,7 @@ static void on_response_req_sim_apdu(GObject *source_object, GAsyncResult *res, } g_free(evt_cb_data); + g_variant_unref(dbus_result); } static void on_response_req_sim_atr(GObject *source_object, GAsyncResult *res, gpointer user_data) @@ -1514,12 +1288,12 @@ static void on_response_req_sim_atr(GObject *source_object, GAsyncResult *res, g TelSimAccessResult_t result = TAPI_SIM_ACCESS_SUCCESS; TelSimAtrResp_t r_atr; - dbg("Func Entrance"); + TAPI_SIM_RESP_CB_ENTER(evt_cb_data); memset(&r_atr, 0, sizeof(TelSimAtrResp_t)); conn = G_DBUS_CONNECTION (source_object); dbus_result = g_dbus_connection_call_finish(conn, res, &error); - CHECK_DEINIT(error); + SIM_CHECK_ERROR(error, evt_cb_data); if (!dbus_result) { TAPI_SIM_CHECK_ERR_MSG_AND_CALL_NULL_CBFUNC(error, evt_cb_data); @@ -1545,38 +1319,39 @@ static void on_response_req_sim_atr(GObject *source_object, GAsyncResult *res, g } g_free(evt_cb_data); + g_variant_unref(dbus_result); } -static void on_response_call_sim_async(GObject *source_object, GAsyncResult *res, +static void on_response_set_sim_power_state(GObject *source_object, GAsyncResult *res, gpointer user_data) { GError *error = NULL; GDBusConnection *conn = NULL; GVariant *dbus_result; - struct tapi_sim_resp_data *evt_cb_data = user_data; - TelSimAccessResult_t result = TAPI_SIM_ACCESS_SUCCESS; - TelSimResponseData_t resp; - - memset(&resp, 0, sizeof(TelSimResponseData_t)); + struct tapi_resp_data *evt_cb_data = user_data; + TelSimPowerSetResult_t result = TAPI_SIM_POWER_SET_SUCCESS; - dbg("Func Entrance"); + TAPI_SIM_RESP_CB_ENTER(evt_cb_data); conn = G_DBUS_CONNECTION (source_object); dbus_result = g_dbus_connection_call_finish(conn, res, &error); - CHECK_DEINIT(error); + SIM_CHECK_ERROR(error, evt_cb_data); if (!dbus_result) { - TAPI_SIM_CHECK_ERR_MSG_AND_CALL_NULL_CBFUNC(error, (&evt_cb_data->tapi_resp)); + TAPI_SIM_CHECK_ERR_MSG_AND_CALL_NULL_CBFUNC(error, evt_cb_data); } - result = __get_dbus_resp_data(evt_cb_data->op_type, dbus_result, &resp); + g_variant_get(dbus_result, "(i)", &result); - dbg("result[%d]", result); + if (evt_cb_data->cb_fn) { + evt_cb_data->cb_fn(evt_cb_data->handle, result, NULL, evt_cb_data->user_data); + } - TAPI_SIM_CALL_CBFUNC((&evt_cb_data->tapi_resp), result, &resp); g_free(evt_cb_data); + g_variant_unref(dbus_result); } + EXPORT_API int tel_get_sim_init_info(TapiHandle *handle, TelSimCardStatus_t *sim_status, int *card_changed) { @@ -1599,7 +1374,9 @@ EXPORT_API int tel_get_sim_init_info(TapiHandle *handle, TelSimCardStatus_t *sim g_variant_get(sync_gv, "(ib)", &init_status, &changed); *sim_status = init_status; *card_changed = changed; - dbg("init_status[%d] changed[%d]",init_status, changed); + msg("[%s] sim_init_status[%d] changed[%d]", handle->cp_name, init_status, changed); + + g_variant_unref(sync_gv); } else { TAPI_SIM_CHECK_ERR_MSG(gerr); } @@ -1620,9 +1397,10 @@ EXPORT_API int tel_get_sim_type(TapiHandle *handle, TelSimCardType_t *card_type) sync_gv = g_dbus_connection_call_sync(handle->dbus_connection, DBUS_TELEPHONY_SERVICE, handle->path, DBUS_TELEPHONY_SIM_INTERFACE, "GetCardType", NULL, NULL, G_DBUS_CALL_FLAGS_NONE, TAPI_DEFAULT_TIMEOUT, handle->ca, &gerr); - if (sync_gv) { g_variant_get(sync_gv, "(i)", card_type); + + g_variant_unref(sync_gv); } else { TAPI_SIM_CHECK_ERR_MSG(gerr); } @@ -1634,8 +1412,6 @@ EXPORT_API int tel_get_sim_imsi(TapiHandle *handle, TelSimImsiInfo_t *imsi) GError *gerr = NULL; GVariant *sync_gv = NULL; - dbg("Func Entrance"); - TAPI_RET_ERR_NUM_IF_FAIL(handle, TAPI_API_INVALID_PTR); TAPI_RET_ERR_NUM_IF_FAIL(imsi, TAPI_API_INVALID_PTR); @@ -1644,7 +1420,6 @@ EXPORT_API int tel_get_sim_imsi(TapiHandle *handle, TelSimImsiInfo_t *imsi) sync_gv = g_dbus_connection_call_sync(handle->dbus_connection, DBUS_TELEPHONY_SERVICE, handle->path, DBUS_TELEPHONY_SIM_INTERFACE, "GetIMSI", NULL, NULL, G_DBUS_CALL_FLAGS_NONE, TAPI_DEFAULT_TIMEOUT, handle->ca, &gerr); - if (sync_gv) { gchar *gplmn = NULL; gchar *gmsin = NULL; @@ -1661,9 +1436,13 @@ EXPORT_API int tel_get_sim_imsi(TapiHandle *handle, TelSimImsiInfo_t *imsi) snprintf(imsi->szMnc, gplmn_len - 3 + 1, "%s", &gplmn[3]); snprintf(imsi->szMsin, gmsin_len + 1, "%s", gmsin); } else { - dbg("invalid length.(plmn_len=%d, msin_len=%d)", gplmn_len,gmsin_len); + msg("invalid length.(plmn_len=%d, msin_len=%d)", gplmn_len,gmsin_len); memset(imsi, 0, sizeof(TelSimImsiInfo_t)); } + g_free(gplmn); + g_free(gmsin); + + g_variant_unref(sync_gv); } else { TAPI_SIM_CHECK_ERR_MSG(gerr); } @@ -1682,11 +1461,11 @@ EXPORT_API int tel_get_sim_ecc(TapiHandle *handle, TelSimEccList_t *ecc) const gchar *str_value = NULL; int i = 0; - dbg("Func Entrance"); - TAPI_RET_ERR_NUM_IF_FAIL(handle, TAPI_API_INVALID_PTR); TAPI_RET_ERR_NUM_IF_FAIL(ecc, TAPI_API_INVALID_PTR); + TAPI_SIM_CHECK_TAPI_STATE(); + memset(ecc, 0, sizeof(TelSimEccList_t)); sync_gv = g_dbus_connection_call_sync(handle->dbus_connection, DBUS_TELEPHONY_SERVICE, @@ -1697,7 +1476,7 @@ EXPORT_API int tel_get_sim_ecc(TapiHandle *handle, TelSimEccList_t *ecc) /* dbg("ecc type_format(%s)", g_variant_get_type_string(sync_gv));*/ g_variant_get(sync_gv, "(aa{sv})", &iter); ecc->ecc_count = g_variant_iter_n_children(iter); - dbg("ecc->ecc_count[%d]",ecc->ecc_count); + msg("ecc->ecc_count[%d]",ecc->ecc_count); i = 0; while (g_variant_iter_next(iter, "a{sv}", &iter_row)) { while (g_variant_iter_loop(iter_row, "{sv}", &key, &value)) { @@ -1717,7 +1496,10 @@ EXPORT_API int tel_get_sim_ecc(TapiHandle *handle, TelSimEccList_t *ecc) g_variant_iter_free(iter_row); } g_variant_iter_free(iter); - } else { + + g_variant_unref(sync_gv); + } + else { TAPI_SIM_CHECK_ERR_MSG(gerr); } return TAPI_API_SUCCESS; @@ -1727,8 +1509,6 @@ EXPORT_API int tel_get_sim_iccid(TapiHandle *handle, tapi_response_cb callback, { struct tapi_resp_data *evt_cb_data = NULL; - dbg("Func Entrance "); - TAPI_RET_ERR_NUM_IF_FAIL(handle, TAPI_API_INVALID_PTR); TAPI_SIM_CHECK_TAPI_STATE(); @@ -1746,8 +1526,6 @@ EXPORT_API int tel_get_sim_language(TapiHandle *handle, tapi_response_cb callbac { struct tapi_resp_data *evt_cb_data = NULL; - dbg("Func Entrance "); - TAPI_RET_ERR_NUM_IF_FAIL(handle, TAPI_API_INVALID_PTR); TAPI_SIM_CHECK_TAPI_STATE(); @@ -1767,8 +1545,6 @@ EXPORT_API int tel_set_sim_language(TapiHandle *handle, TelSimLanguagePreference struct tapi_resp_data *evt_cb_data = NULL; GVariant *param = NULL; - dbg("Func Entrance w/ lang[%d]",language); - TAPI_RET_ERR_NUM_IF_FAIL(handle, TAPI_API_INVALID_PTR); TAPI_SIM_CHECK_TAPI_STATE(); @@ -1789,8 +1565,6 @@ EXPORT_API int tel_get_sim_callforwarding_info(TapiHandle *handle, tapi_response { struct tapi_resp_data *evt_cb_data = NULL; - dbg("Func Entrance "); - TAPI_RET_ERR_NUM_IF_FAIL(handle, TAPI_API_INVALID_PTR); TAPI_SIM_CHECK_TAPI_STATE(); @@ -1811,9 +1585,8 @@ EXPORT_API int tel_set_sim_callforwarding_info(TapiHandle *handle, TelSimCallFor GVariant *param = NULL; gchar *g_number = NULL; - dbg("Func Entrance "); - TAPI_RET_ERR_NUM_IF_FAIL(handle, TAPI_API_INVALID_PTR); + TAPI_RET_ERR_NUM_IF_FAIL(req_cf, TAPI_API_INVALID_PTR); TAPI_SIM_CHECK_TAPI_STATE(); @@ -1857,8 +1630,6 @@ EXPORT_API int tel_get_sim_messagewaiting_info(TapiHandle *handle, tapi_response { struct tapi_resp_data *evt_cb_data = NULL; - dbg("Func Entrance "); - TAPI_RET_ERR_NUM_IF_FAIL(handle, TAPI_API_INVALID_PTR); TAPI_SIM_CHECK_TAPI_STATE(); @@ -1878,9 +1649,8 @@ EXPORT_API int tel_set_sim_messagewaiting_info(TapiHandle *handle, TelSimMessage struct tapi_resp_data *evt_cb_data = NULL; GVariant *param = NULL; - dbg("Func Entrance "); - TAPI_RET_ERR_NUM_IF_FAIL(handle, TAPI_API_INVALID_PTR); + TAPI_RET_ERR_NUM_IF_FAIL(req_mw, TAPI_API_INVALID_PTR); TAPI_SIM_CHECK_TAPI_STATE(); @@ -1926,8 +1696,6 @@ EXPORT_API int tel_get_sim_mailbox_info(TapiHandle *handle, tapi_response_cb cal { struct tapi_resp_data *evt_cb_data = NULL; - dbg("Func Entrance "); - TAPI_RET_ERR_NUM_IF_FAIL(handle, TAPI_API_INVALID_PTR); TAPI_SIM_CHECK_TAPI_STATE(); @@ -1949,9 +1717,8 @@ EXPORT_API int tel_set_sim_mailbox_info(TapiHandle *handle, TelSimMailBoxNumber_ gchar *g_alpha = NULL; gchar *g_number = NULL; - dbg("Func Entrance "); - TAPI_RET_ERR_NUM_IF_FAIL(handle, TAPI_API_INVALID_PTR); + TAPI_RET_ERR_NUM_IF_FAIL(req_mb, TAPI_API_INVALID_PTR); TAPI_SIM_CHECK_TAPI_STATE(); @@ -2020,8 +1787,6 @@ EXPORT_API int tel_get_sim_cphs_info(TapiHandle *handle, tapi_response_cb callba { struct tapi_resp_data *evt_cb_data = NULL; - dbg("Func Entrance "); - TAPI_RET_ERR_NUM_IF_FAIL(handle, TAPI_API_INVALID_PTR); TAPI_SIM_CHECK_TAPI_STATE(); @@ -2040,8 +1805,6 @@ EXPORT_API int tel_get_sim_service_table(TapiHandle *handle, tapi_response_cb ca { struct tapi_resp_data *evt_cb_data = NULL; - dbg("Func Entrance "); - TAPI_RET_ERR_NUM_IF_FAIL(handle, TAPI_API_INVALID_PTR); TAPI_SIM_CHECK_TAPI_STATE(); @@ -2059,8 +1822,6 @@ EXPORT_API int tel_get_sim_msisdn(TapiHandle *handle, tapi_response_cb callback, { struct tapi_resp_data *evt_cb_data = NULL; - dbg("Func Entrance "); - TAPI_RET_ERR_NUM_IF_FAIL(handle, TAPI_API_INVALID_PTR); TAPI_SIM_CHECK_TAPI_STATE(); @@ -2079,8 +1840,6 @@ EXPORT_API int tel_get_sim_oplmnwact(TapiHandle *handle, tapi_response_cb callba { struct tapi_resp_data *evt_cb_data = NULL; - dbg("Func Entrance "); - TAPI_RET_ERR_NUM_IF_FAIL(handle, TAPI_API_INVALID_PTR); TAPI_SIM_CHECK_TAPI_STATE(); @@ -2099,8 +1858,6 @@ EXPORT_API int tel_get_sim_spn(TapiHandle *handle, tapi_response_cb callback, { struct tapi_resp_data *evt_cb_data = NULL; - dbg("Func Entrance "); - TAPI_RET_ERR_NUM_IF_FAIL(handle, TAPI_API_INVALID_PTR); TAPI_SIM_CHECK_TAPI_STATE(); @@ -2119,8 +1876,6 @@ EXPORT_API int tel_get_sim_cphs_netname(TapiHandle *handle, tapi_response_cb cal { struct tapi_resp_data *evt_cb_data = NULL; - dbg("Func Entrance "); - TAPI_RET_ERR_NUM_IF_FAIL(handle, TAPI_API_INVALID_PTR); TAPI_SIM_CHECK_TAPI_STATE(); @@ -2138,14 +1893,12 @@ EXPORT_API int tel_req_sim_authentication(TapiHandle *handle, TelSimAuthenticationData_t *authentication_data, tapi_response_cb callback, void *user_data) { struct tapi_resp_data *evt_cb_data = NULL; - GVariantBuilder *builder = NULL; + GVariantBuilder builder; GVariant *param = NULL; GVariant *rand_gv = NULL; GVariant *autn_gv = NULL; int i =0; - dbg("Func Entrance "); - TAPI_RET_ERR_NUM_IF_FAIL(handle, TAPI_API_INVALID_PTR); TAPI_RET_ERR_NUM_IF_FAIL(authentication_data, TAPI_API_INVALID_PTR); @@ -2163,22 +1916,19 @@ EXPORT_API int tel_req_sim_authentication(TapiHandle *handle, MAKE_RESP_CB_DATA(evt_cb_data, handle, callback, user_data); - builder = g_variant_builder_new(G_VARIANT_TYPE ("ay")); + g_variant_builder_init(&builder, G_VARIANT_TYPE ("ay")); for (i = 0; i < authentication_data->rand_length; i++) { - dbg("authentication_data->rand_data[%d][0x%02x]", i,authentication_data->rand_data[i]); - g_variant_builder_add(builder, "y", authentication_data->rand_data[i]); + g_variant_builder_add(&builder, "y", authentication_data->rand_data[i]); } - rand_gv = g_variant_builder_end(builder); + rand_gv = g_variant_builder_end(&builder); - builder = g_variant_builder_new(G_VARIANT_TYPE ("ay")); + g_variant_builder_init(&builder, G_VARIANT_TYPE ("ay")); for (i = 0; i < authentication_data->autn_length; i++) { - dbg("authentication_data->autn_data[%d][0x%02x]", i,authentication_data->autn_data[i]); - g_variant_builder_add(builder, "y", authentication_data->autn_data[i]); + g_variant_builder_add(&builder, "y", authentication_data->autn_data[i]); } - autn_gv = g_variant_builder_end(builder); + autn_gv = g_variant_builder_end(&builder); param = g_variant_new("(ivv)", authentication_data->auth_type, rand_gv, autn_gv); - /*g_variant_builder_unref (builder);*/ g_dbus_connection_call(handle->dbus_connection, DBUS_TELEPHONY_SERVICE, handle->path, DBUS_TELEPHONY_SIM_INTERFACE, "Authentication", param, NULL, G_DBUS_CALL_FLAGS_NONE, TAPI_DEFAULT_TIMEOUT, @@ -2194,15 +1944,13 @@ EXPORT_API int tel_verifiy_sim_pins(TapiHandle *handle, const TelSimSecPw_t *pin GVariant *param = NULL; gchar *gpw = NULL; - dbg("Func Entrance"); - TAPI_RET_ERR_NUM_IF_FAIL(handle, TAPI_API_INVALID_PTR); TAPI_RET_ERR_NUM_IF_FAIL(pin_data, TAPI_API_INVALID_PTR); TAPI_RET_ERR_NUM_IF_FAIL(pin_data->pw, TAPI_API_INVALID_PTR); TAPI_SIM_CHECK_TAPI_STATE(); - dbg("pin type[%d]", pin_data->type); + msg("pin type[%d]", pin_data->type); if (pin_data->type != TAPI_SIM_PTYPE_PIN1 && pin_data->type != TAPI_SIM_PTYPE_PIN2 && pin_data->type != TAPI_SIM_PTYPE_SIM) return TAPI_API_INVALID_INPUT; @@ -2223,7 +1971,7 @@ EXPORT_API int tel_verifiy_sim_pins(TapiHandle *handle, const TelSimSecPw_t *pin param = g_variant_new("(is)", pin_data->type, gpw); g_dbus_connection_call(handle->dbus_connection, DBUS_TELEPHONY_SERVICE, handle->path, - DBUS_TELEPHONY_SIM_INTERFACE, "VerifySec", param, NULL, G_DBUS_CALL_FLAGS_NONE, TAPI_DEFAULT_TIMEOUT, + DBUS_TELEPHONY_SIM_INTERFACE, "VerifySec", param, NULL, G_DBUS_CALL_FLAGS_NONE, TAPI_PIN_TIMEOUT, handle->ca, on_response_verify_sim_pins, evt_cb_data); if (gpw) @@ -2240,15 +1988,13 @@ EXPORT_API int tel_verify_sim_puks(TapiHandle *handle, const TelSimSecPw_t *puk_ gchar *gpin = NULL; gchar *gpuk = NULL; - dbg("Func Entrance"); - TAPI_RET_ERR_NUM_IF_FAIL(handle, TAPI_API_INVALID_PTR); TAPI_RET_ERR_NUM_IF_FAIL((puk_data != NULL && new_pin_data != NULL), TAPI_API_INVALID_PTR); TAPI_RET_ERR_NUM_IF_FAIL((puk_data->pw != NULL && new_pin_data->pw != NULL), TAPI_API_INVALID_PTR); TAPI_SIM_CHECK_TAPI_STATE(); - dbg("puk type[%d] pin type[%d]", puk_data->type, new_pin_data->type); + msg("puk type[%d] pin type[%d]", puk_data->type, new_pin_data->type); if ((puk_data->type != TAPI_SIM_PTYPE_PUK1 && puk_data->type != TAPI_SIM_PTYPE_PUK2) || (new_pin_data->type != TAPI_SIM_PTYPE_PIN1 && new_pin_data->type != TAPI_SIM_PTYPE_PIN2)) return TAPI_API_INVALID_INPUT; @@ -2282,7 +2028,7 @@ EXPORT_API int tel_verify_sim_puks(TapiHandle *handle, const TelSimSecPw_t *puk_ param = g_variant_new("(iss)", puk_data->type, gpuk, gpin); g_dbus_connection_call(handle->dbus_connection, DBUS_TELEPHONY_SERVICE, handle->path, - DBUS_TELEPHONY_SIM_INTERFACE, "VerifyPUK", param, NULL, G_DBUS_CALL_FLAGS_NONE, TAPI_DEFAULT_TIMEOUT, + DBUS_TELEPHONY_SIM_INTERFACE, "VerifyPUK", param, NULL, G_DBUS_CALL_FLAGS_NONE, TAPI_PIN_TIMEOUT, handle->ca, on_response_verify_sim_puks, evt_cb_data); if (gpin) @@ -2302,15 +2048,13 @@ EXPORT_API int tel_change_sim_pins(TapiHandle *handle, const TelSimSecPw_t *old_ gchar *gpin_o = NULL; gchar *gpin_n = NULL; - dbg("Func Entrance"); - TAPI_RET_ERR_NUM_IF_FAIL(handle, TAPI_API_INVALID_PTR); TAPI_RET_ERR_NUM_IF_FAIL((old_pin != NULL && new_pin != NULL), TAPI_API_INVALID_PTR); TAPI_RET_ERR_NUM_IF_FAIL((old_pin->pw != NULL && new_pin->pw != NULL), TAPI_API_INVALID_PTR); TAPI_SIM_CHECK_TAPI_STATE(); - dbg("old_pin type[%d],new_pin type[%d]", old_pin->type, new_pin->type); + msg("old_pin type[%d],new_pin type[%d]", old_pin->type, new_pin->type); if ((old_pin->type != TAPI_SIM_PTYPE_PIN1) && (old_pin->type != TAPI_SIM_PTYPE_PIN2) && (new_pin->type != TAPI_SIM_PTYPE_PIN1) && (new_pin->type != TAPI_SIM_PTYPE_PIN2)) return TAPI_API_INVALID_INPUT; @@ -2343,7 +2087,7 @@ EXPORT_API int tel_change_sim_pins(TapiHandle *handle, const TelSimSecPw_t *old_ memcpy((void*)gpin_n, (const void*)new_pin->pw, new_pin->pw_len); param = g_variant_new("(iss)", old_pin->type, gpin_o, gpin_n); - dbg("old_pin len[%d],new_pin len[%d]", old_pin->pw_len, new_pin->pw_len); + msg("old_pin len[%d],new_pin len[%d]", old_pin->pw_len, new_pin->pw_len); g_dbus_connection_call(handle->dbus_connection, DBUS_TELEPHONY_SERVICE, handle->path, DBUS_TELEPHONY_SIM_INTERFACE, "ChangePIN", param, NULL, G_DBUS_CALL_FLAGS_NONE, TAPI_DEFAULT_TIMEOUT, @@ -2365,8 +2109,6 @@ EXPORT_API int tel_disable_sim_facility(TapiHandle *handle, TelSimFacilityPw_t * GVariant *param = NULL; gchar *gpw = NULL; - dbg("Func Entrance"); - TAPI_RET_ERR_NUM_IF_FAIL(handle, TAPI_API_INVALID_PTR); TAPI_RET_ERR_NUM_IF_FAIL(pw, TAPI_API_INVALID_PTR); TAPI_RET_ERR_NUM_IF_FAIL(pw->pw, TAPI_API_INVALID_PTR); @@ -2410,15 +2152,13 @@ EXPORT_API int tel_enable_sim_facility(TapiHandle *handle, TelSimFacilityPw_t *p GVariant *param = NULL; gchar *gpw = NULL; - dbg("Func Entrance"); - TAPI_RET_ERR_NUM_IF_FAIL(handle, TAPI_API_INVALID_PTR); TAPI_RET_ERR_NUM_IF_FAIL(pw, TAPI_API_INVALID_PTR); TAPI_RET_ERR_NUM_IF_FAIL(pw->pw, TAPI_API_INVALID_PTR); TAPI_SIM_CHECK_TAPI_STATE(); - dbg("facility type[%d]", pw->lock_type); + msg("facility type[%d]", pw->lock_type); if(pw->lock_type < TAPI_SIM_LOCK_PS || pw->lock_type >TAPI_SIM_LOCK_PC) return TAPI_API_INVALID_INPUT; if ((pw->lock_type < TAPI_SIM_LOCK_PN) && ((pw->pw_len < 4) || (pw->pw_len > 8)) ) @@ -2454,13 +2194,11 @@ EXPORT_API int tel_get_sim_facility(TapiHandle *handle, TelSimLockType_t type, struct tapi_resp_data *evt_cb_data = NULL; GVariant *param = NULL; - dbg("Func Entrance"); - TAPI_RET_ERR_NUM_IF_FAIL(handle, TAPI_API_INVALID_PTR); TAPI_SIM_CHECK_TAPI_STATE(); - dbg("facility type[%d]", type); + msg("facility type[%d]", type); if(type < TAPI_SIM_LOCK_PS || type >TAPI_SIM_LOCK_PC) return TAPI_API_INVALID_INPUT; @@ -2481,13 +2219,11 @@ EXPORT_API int tel_get_sim_lock_info(TapiHandle *handle, TelSimLockType_t type, struct tapi_resp_data *evt_cb_data = NULL; GVariant *param = NULL; - dbg("Func Entrance"); - TAPI_RET_ERR_NUM_IF_FAIL(handle, TAPI_API_INVALID_PTR); TAPI_SIM_CHECK_TAPI_STATE(); - dbg("lock type[%d]", type); + msg("lock type[%d]", type); if(type < TAPI_SIM_LOCK_PS || type >TAPI_SIM_LOCK_PC) return TAPI_API_INVALID_INPUT; @@ -2502,17 +2238,42 @@ EXPORT_API int tel_get_sim_lock_info(TapiHandle *handle, TelSimLockType_t type, return TAPI_API_SUCCESS; } +EXPORT_API int tel_set_sim_power_state(TapiHandle *handle, TelSimPowerState_t state, + tapi_response_cb callback, void *user_data) +{ + struct tapi_resp_data *evt_cb_data = NULL; + GVariant *param = NULL; + + TAPI_RET_ERR_NUM_IF_FAIL(handle, TAPI_API_INVALID_PTR); + + dbg("Func Enterance. cp_name[%s], state[%d]", handle->cp_name, state); + //TAPI_SIM_CHECK_TAPI_STATE(); -- TO be decided later + + if (state >= TAPI_SIM_POWER_UNSPECIFIED){ + return TAPI_API_INVALID_INPUT; + } + + MAKE_RESP_CB_DATA(evt_cb_data, handle, callback, user_data); + + param = g_variant_new("(i)", state); + + g_dbus_connection_call(handle->dbus_connection, DBUS_TELEPHONY_SERVICE, handle->path, + DBUS_TELEPHONY_SIM_INTERFACE, "SetPowerstate", param, NULL, G_DBUS_CALL_FLAGS_NONE, TAPI_DEFAULT_TIMEOUT, + handle->ca, on_response_set_sim_power_state, evt_cb_data); + + return TAPI_API_SUCCESS; +} + + EXPORT_API int tel_req_sim_apdu(TapiHandle *handle, TelSimApdu_t* apdu_data, tapi_response_cb callback, void *user_data) { struct tapi_resp_data *evt_cb_data = NULL; - GVariantBuilder *builder = NULL; + GVariantBuilder builder; GVariant *param = NULL; GVariant *inner_gv = NULL; int i = 0; - dbg("Func Entrance"); - TAPI_RET_ERR_NUM_IF_FAIL(handle, TAPI_API_INVALID_PTR); TAPI_RET_ERR_NUM_IF_FAIL(apdu_data, TAPI_API_INVALID_PTR); @@ -2520,13 +2281,12 @@ EXPORT_API int tel_req_sim_apdu(TapiHandle *handle, TelSimApdu_t* apdu_data, MAKE_RESP_CB_DATA(evt_cb_data, handle, callback, user_data); - builder = g_variant_builder_new(G_VARIANT_TYPE ("ay")); + g_variant_builder_init(&builder, G_VARIANT_TYPE ("ay")); for (i = 0; i < apdu_data->apdu_len; i++) { - g_variant_builder_add(builder, "y", apdu_data->apdu[i]); + g_variant_builder_add(&builder, "y", apdu_data->apdu[i]); } - inner_gv = g_variant_builder_end(builder); + inner_gv = g_variant_builder_end(&builder); param = g_variant_new("(v)", inner_gv); - /*g_variant_builder_unref (builder);*/ g_dbus_connection_call(handle->dbus_connection, DBUS_TELEPHONY_SERVICE, handle->path, DBUS_TELEPHONY_SIM_INTERFACE, "TransferAPDU", param, NULL, G_DBUS_CALL_FLAGS_NONE, TAPI_DEFAULT_TIMEOUT, @@ -2539,8 +2299,6 @@ EXPORT_API int tel_req_sim_atr(TapiHandle *handle, tapi_response_cb callback, vo { struct tapi_resp_data *evt_cb_data = NULL; - dbg("Func Entrance"); - TAPI_RET_ERR_NUM_IF_FAIL(handle, TAPI_API_INVALID_PTR); TAPI_SIM_CHECK_TAPI_STATE(); @@ -2553,56 +2311,3 @@ EXPORT_API int tel_req_sim_atr(TapiHandle *handle, tapi_response_cb callback, vo return TAPI_API_SUCCESS; } - -EXPORT_API int tel_request_sim_sync(TapiHandle *handle, TelSimTapiOperation_t op_type, TelSimRequestData_t *inparam, TelSimResponseData_t *outparam) -{ - GVariant *sync_gv = NULL; - GVariant *param = NULL; - GError *gerr = NULL; - int ret = TAPI_API_SUCCESS; - - TAPI_RET_ERR_NUM_IF_FAIL(handle, TAPI_API_INVALID_PTR); - TAPI_RET_ERR_NUM_IF_FAIL(outparam, TAPI_API_INVALID_PTR); - - TAPI_SIM_CHECK_TAPI_STATE(); - - dbg("op_type = [%d]", op_type); - - param = __make_dbus_req_data(op_type, inparam); - - sync_gv = g_dbus_connection_call_sync(handle->dbus_connection, DBUS_TELEPHONY_SERVICE, - handle->path, DBUS_TELEPHONY_SIM_INTERFACE, __get_dbus_method_name(op_type), param, NULL, - G_DBUS_CALL_FLAGS_NONE, TAPI_DEFAULT_TIMEOUT, handle->ca, &gerr); - - if (sync_gv) { - ret = __get_dbus_resp_data(op_type, sync_gv, outparam); - } else { - TAPI_SIM_CHECK_ERR_MSG(gerr); - } - - return ret; -} - -EXPORT_API int tel_request_sim_async(TapiHandle *handle, TelSimTapiOperation_t op_type, TelSimRequestData_t *inparam, tapi_response_cb callback, void *user_data) -{ - GVariant *param = NULL; - struct tapi_sim_resp_data *evt_cb_data = NULL; - - TAPI_RET_ERR_NUM_IF_FAIL(handle, TAPI_API_INVALID_PTR); - - TAPI_SIM_CHECK_TAPI_STATE(); - - evt_cb_data = g_new0(struct tapi_sim_resp_data, 1); - evt_cb_data->tapi_resp.handle = handle; - evt_cb_data->tapi_resp.cb_fn = callback; - evt_cb_data->tapi_resp.user_data = user_data; - evt_cb_data->op_type = op_type; - - param = __make_dbus_req_data(op_type, inparam); - - g_dbus_connection_call(handle->dbus_connection, DBUS_TELEPHONY_SERVICE, handle->path, - DBUS_TELEPHONY_SIM_INTERFACE, __get_dbus_method_name(op_type), param, NULL, G_DBUS_CALL_FLAGS_NONE, TAPI_DEFAULT_TIMEOUT, handle->ca, - on_response_call_sim_async, evt_cb_data); - - return TAPI_API_SUCCESS; -} diff --git a/wearable/src/tapi_sms.c b/src/tapi_sms.c similarity index 69% rename from wearable/src/tapi_sms.c rename to src/tapi_sms.c index 29148a6..07b78f7 100644 --- a/wearable/src/tapi_sms.c +++ b/src/tapi_sms.c @@ -1,7 +1,7 @@ /* * libslp-tapi * - * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * Copyright (c) 2014 Samsung Electronics Co., Ltd. All rights reserved. * * Contact: Ja-young Gu * @@ -42,23 +42,7 @@ static void on_response_default(GObject *source_object, GAsyncResult *res, gpoin conn = G_DBUS_CONNECTION (source_object); dbus_result = g_dbus_connection_call_finish(conn, res, &error); - - CHECK_DEINIT(error); - - if (!dbus_result) { - if (evt_cb_data) { - if (evt_cb_data->cb_fn) { - evt_cb_data->cb_fn(evt_cb_data->handle, -1, NULL, evt_cb_data->user_data); - } - - g_free(evt_cb_data); - } - - if (error) - g_error_free(error); - - return; - } + CHECK_ERROR(error); dbg("on_response_default type_format(%s)", g_variant_get_type_string(dbus_result)); @@ -71,6 +55,7 @@ static void on_response_default(GObject *source_object, GAsyncResult *res, gpoin g_free(evt_cb_data); } + g_variant_unref(dbus_result); } static void on_response_read_msg(GObject *source_object, GAsyncResult *res, gpointer user_data) @@ -90,22 +75,7 @@ static void on_response_read_msg(GObject *source_object, GAsyncResult *res, gpoi conn = G_DBUS_CONNECTION (source_object); dbus_result = g_dbus_connection_call_finish(conn, res, &error); - CHECK_DEINIT(error); - - if (!dbus_result) { - if (evt_cb_data) { - if (evt_cb_data->cb_fn) { - evt_cb_data->cb_fn(evt_cb_data->handle, -1, NULL, evt_cb_data->user_data); - } - - g_free(evt_cb_data); - } - - if (error) - g_error_free(error); - - return; - } + CHECK_ERROR(error); dbg("on_response_read_msg type_format(%s)", g_variant_get_type_string(dbus_result)); @@ -143,6 +113,7 @@ static void on_response_read_msg(GObject *source_object, GAsyncResult *res, gpoi g_free(evt_cb_data); } + g_variant_unref(dbus_result); } static void on_response_write_msg(GObject *source_object, GAsyncResult *res, gpointer user_data) @@ -151,40 +122,26 @@ static void on_response_write_msg(GObject *source_object, GAsyncResult *res, gpo GDBusConnection *conn = NULL; struct tapi_resp_data *evt_cb_data = user_data; int result = -1; - int index = 0; + int sms_index = 0; GVariant *dbus_result = NULL; conn = G_DBUS_CONNECTION (source_object); dbus_result = g_dbus_connection_call_finish(conn, res, &error); - CHECK_DEINIT(error); - - if (!dbus_result) { - if (evt_cb_data) { - if (evt_cb_data->cb_fn) { - evt_cb_data->cb_fn(evt_cb_data->handle, -1, NULL, evt_cb_data->user_data); - } - - g_free(evt_cb_data); - } - - if (error) - g_error_free(error); - - return; - } + CHECK_ERROR(error); dbg("on_response_write_msg type_format(%s)", g_variant_get_type_string(dbus_result)); - g_variant_get (dbus_result, "(ii)", &result, &index); + g_variant_get (dbus_result, "(ii)", &result, &sms_index); if (evt_cb_data) { if (evt_cb_data->cb_fn) { - evt_cb_data->cb_fn(evt_cb_data->handle, result, &index, evt_cb_data->user_data); + evt_cb_data->cb_fn(evt_cb_data->handle, result, &sms_index, evt_cb_data->user_data); } g_free(evt_cb_data); } + g_variant_unref(dbus_result); } static void on_response_delete_msg(GObject *source_object, GAsyncResult *res, gpointer user_data) @@ -193,40 +150,26 @@ static void on_response_delete_msg(GObject *source_object, GAsyncResult *res, gp GDBusConnection *conn = NULL; struct tapi_resp_data *evt_cb_data = user_data; int result = -1; - int index = -1; + int del_index = -1; GVariant *dbus_result = NULL; conn = G_DBUS_CONNECTION (source_object); dbus_result = g_dbus_connection_call_finish(conn, res, &error); - CHECK_DEINIT(error); - - if (!dbus_result) { - if (evt_cb_data) { - if (evt_cb_data->cb_fn) { - evt_cb_data->cb_fn(evt_cb_data->handle, -1, NULL, evt_cb_data->user_data); - } - - g_free(evt_cb_data); - } - - if (error) - g_error_free(error); - - return; - } + CHECK_ERROR(error); dbg("on_response_delete_msg type_format(%s)", g_variant_get_type_string(dbus_result)); - g_variant_get (dbus_result, "(ii)", &result, &index); + g_variant_get (dbus_result, "(ii)", &result, &del_index); if (evt_cb_data) { if (evt_cb_data->cb_fn) { - evt_cb_data->cb_fn(evt_cb_data->handle, result, &index, evt_cb_data->user_data); + evt_cb_data->cb_fn(evt_cb_data->handle, result, &del_index, evt_cb_data->user_data); } g_free(evt_cb_data); } + g_variant_unref(dbus_result); } static void on_response_get_msg_count(GObject *source_object, GAsyncResult *res, gpointer user_data) @@ -244,22 +187,7 @@ static void on_response_get_msg_count(GObject *source_object, GAsyncResult *res, conn = G_DBUS_CONNECTION (source_object); dbus_result = g_dbus_connection_call_finish(conn, res, &error); - CHECK_DEINIT(error); - - if (!dbus_result) { - if (evt_cb_data) { - if (evt_cb_data->cb_fn) { - evt_cb_data->cb_fn(evt_cb_data->handle, -1, NULL, evt_cb_data->user_data); - } - - g_free(evt_cb_data); - } - - if (error) - g_error_free(error); - - return; - } + CHECK_ERROR(error); dbg("on_response_get_msg_count type_format(%s)", g_variant_get_type_string(dbus_result)); @@ -272,7 +200,7 @@ static void on_response_get_msg_count(GObject *source_object, GAsyncResult *res, while (g_variant_iter_loop(iter, "i", &idx)) { storedMsgCnt.IndexList[i] = idx; i++; - if (i >= TAPI_NETTEXT_GSM_SMS_MSG_NUM_MAX) + if (i >= TAPI_NETTEXT_SMS_MSG_NUM_MAX) break; } @@ -283,7 +211,7 @@ static void on_response_get_msg_count(GObject *source_object, GAsyncResult *res, g_free(evt_cb_data); } - + g_variant_unref(dbus_result); } static void on_response_get_sca(GObject *source_object, GAsyncResult *res, gpointer user_data) @@ -304,22 +232,7 @@ static void on_response_get_sca(GObject *source_object, GAsyncResult *res, gpoin conn = G_DBUS_CONNECTION (source_object); dbus_result = g_dbus_connection_call_finish(conn, res, &error); - CHECK_DEINIT(error); - - if (!dbus_result) { - if (evt_cb_data) { - if (evt_cb_data->cb_fn) { - evt_cb_data->cb_fn(evt_cb_data->handle, -1, NULL, evt_cb_data->user_data); - } - - g_free(evt_cb_data); - } - - if (error) - g_error_free(error); - - return; - } + CHECK_ERROR(error); dbg("on_response_get_sca type_format(%s)", g_variant_get_type_string(dbus_result)); @@ -346,6 +259,7 @@ static void on_response_get_sca(GObject *source_object, GAsyncResult *res, gpoin g_free(evt_cb_data); } + g_variant_unref(dbus_result); } static void on_response_get_cb_config(GObject *source_object, GAsyncResult *res, gpointer user_data) @@ -365,22 +279,7 @@ static void on_response_get_cb_config(GObject *source_object, GAsyncResult *res, conn = G_DBUS_CONNECTION (source_object); dbus_result = g_dbus_connection_call_finish(conn, res, &error); - CHECK_DEINIT(error); - - if (!dbus_result) { - if (evt_cb_data) { - if (evt_cb_data->cb_fn) { - evt_cb_data->cb_fn(evt_cb_data->handle, -1, NULL, evt_cb_data->user_data); - } - - g_free(evt_cb_data); - } - - if (error) - g_error_free(error); - - return; - } + CHECK_ERROR(error); dbg("on_response_get_cb_config type_format(%s)", g_variant_get_type_string(dbus_result)); @@ -422,6 +321,7 @@ static void on_response_get_cb_config(GObject *source_object, GAsyncResult *res, g_free(evt_cb_data); } + g_variant_unref(dbus_result); } static void on_response_get_sms_params(GObject *source_object, GAsyncResult *res, gpointer user_data) @@ -441,22 +341,7 @@ static void on_response_get_sms_params(GObject *source_object, GAsyncResult *res conn = G_DBUS_CONNECTION (source_object); dbus_result = g_dbus_connection_call_finish(conn, res, &error); - CHECK_DEINIT(error); - - if (!dbus_result) { - if (evt_cb_data) { - if (evt_cb_data->cb_fn) { - evt_cb_data->cb_fn(evt_cb_data->handle, -1, NULL, evt_cb_data->user_data); - } - - g_free(evt_cb_data); - } - - if (error) - g_error_free(error); - - return; - } + CHECK_ERROR(error); dbg("on_response_get_sms_params type_format(%s)", g_variant_get_type_string(dbus_result)); @@ -514,7 +399,7 @@ static void on_response_get_sms_params(GObject *source_object, GAsyncResult *res g_free(evt_cb_data); } - + g_variant_unref(dbus_result); } static void on_response_get_sms_param_cnt(GObject *source_object, GAsyncResult *res, gpointer user_data) @@ -529,22 +414,7 @@ static void on_response_get_sms_param_cnt(GObject *source_object, GAsyncResult * conn = G_DBUS_CONNECTION (source_object); dbus_result = g_dbus_connection_call_finish(conn, res, &error); - CHECK_DEINIT(error); - - if (!dbus_result) { - if (evt_cb_data) { - if (evt_cb_data->cb_fn) { - evt_cb_data->cb_fn(evt_cb_data->handle, -1, NULL, evt_cb_data->user_data); - } - - g_free(evt_cb_data); - } - - if (error) - g_error_free(error); - - return; - } + CHECK_ERROR(error); dbg("on_response_get_sms_param_cnt type_format(%s)", g_variant_get_type_string(dbus_result)); @@ -558,6 +428,7 @@ static void on_response_get_sms_param_cnt(GObject *source_object, GAsyncResult * g_free(evt_cb_data); } + g_variant_unref(dbus_result); } EXPORT_API int tel_send_sms(struct tapi_handle *handle, @@ -569,41 +440,34 @@ EXPORT_API int tel_send_sms(struct tapi_handle *handle, GVariant *param; GVariant *sca = 0, *packet_sca = 0; GVariant *tpdu = 0, *packet_tpdu = 0; - GVariantBuilder *b = 0; + GVariantBuilder b; int i; - int emergency_mode = 0; dbg("Func Entrance "); TAPI_RET_ERR_NUM_IF_FAIL(handle, TAPI_API_INVALID_PTR); TAPI_RET_ERR_NUM_IF_FAIL(callback, TAPI_API_INVALID_PTR); TAPI_RET_ERR_NUM_IF_FAIL(pDataPackage, TAPI_API_INVALID_PTR); -#if 0 - if (vconf_get_int("db/telephony/emergency", &emergency_mode) != 0) { - err("[FAIL]GET db/telephony/emergency"); - return TAPI_API_OPERATION_FAILED; - } -#endif - if (emergency_mode) { - dbg("emergency mode on"); - return TAPI_API_OPERATION_FAILED; + if (pDataPackage->Sca[0] > TAPI_SIM_SMSP_ADDRESS_LEN) { + err("Invalid SCA length:[%d]", pDataPackage->Sca[0]); + return TAPI_API_INVALID_INPUT; } MAKE_RESP_CB_DATA(evt_cb_data, handle, callback, user_data); - b = g_variant_builder_new(G_VARIANT_TYPE ("ay")); + g_variant_builder_init(&b, G_VARIANT_TYPE("ay") ); for( i=0; iSca[i] ); + g_variant_builder_add(&b, "y", pDataPackage->Sca[i] ); } - sca = g_variant_builder_end(b); + sca = g_variant_builder_end(&b); packet_sca = g_variant_new("v", sca); - b = g_variant_builder_new(G_VARIANT_TYPE ("ay")); + g_variant_builder_init(&b, G_VARIANT_TYPE("ay") ); for( i=0; iszData[i] ); + g_variant_builder_add(&b, "y", pDataPackage->szData[i] ); } - tpdu = g_variant_builder_end(b); + tpdu = g_variant_builder_end(&b); packet_tpdu = g_variant_new("v", tpdu); param = g_variant_new("(@vi@vi)", packet_sca, @@ -620,7 +484,7 @@ EXPORT_API int tel_send_sms(struct tapi_handle *handle, return TAPI_API_SUCCESS; } -EXPORT_API int tel_read_sms_in_sim(struct tapi_handle *handle, int index, tapi_response_cb callback, void* user_data) +EXPORT_API int tel_read_sms_in_sim(struct tapi_handle *handle, int read_index, tapi_response_cb callback, void* user_data) { struct tapi_resp_data *evt_cb_data = NULL; GVariant *param; @@ -630,15 +494,15 @@ EXPORT_API int tel_read_sms_in_sim(struct tapi_handle *handle, int index, tapi_r TAPI_RET_ERR_NUM_IF_FAIL(handle, TAPI_API_INVALID_PTR); TAPI_RET_ERR_NUM_IF_FAIL(callback, TAPI_API_INVALID_PTR); - if( (index < 0) || (index > TAPI_NETTEXT_MAX_INDEX) ) { - err("Invalid Input -Read SMS %d",index); + if( (read_index < 0) || (read_index > TAPI_NETTEXT_MAX_INDEX) ) { + err("Invalid Input -Read SMS %d",read_index); return TAPI_API_INVALID_INPUT; } MAKE_RESP_CB_DATA(evt_cb_data, handle, callback, user_data); - param = g_variant_new("(i)", index); + param = g_variant_new("(i)", read_index); g_dbus_connection_call(handle->dbus_connection, DBUS_TELEPHONY_SERVICE , handle->path, DBUS_TELEPHONY_SMS_INTERFACE, @@ -655,7 +519,7 @@ EXPORT_API int tel_write_sms_in_sim(struct tapi_handle *handle, const TelSmsData GVariant *param; GVariant *sca = 0, *packet_sca = 0; GVariant *tpdu = 0, *packet_tpdu = 0; - GVariantBuilder *b = 0; + GVariantBuilder b; int i; dbg("Func Entrance "); @@ -666,18 +530,18 @@ EXPORT_API int tel_write_sms_in_sim(struct tapi_handle *handle, const TelSmsData MAKE_RESP_CB_DATA(evt_cb_data, handle, callback, user_data); - b = g_variant_builder_new(G_VARIANT_TYPE ("ay")); + g_variant_builder_init(&b, G_VARIANT_TYPE("ay") ); for( i=0; iSmsData.Sca[i] ); + g_variant_builder_add(&b, "y", pWriteData->SmsData.Sca[i] ); } - sca = g_variant_builder_end(b); + sca = g_variant_builder_end(&b); packet_sca = g_variant_new("v", sca); - b = g_variant_builder_new(G_VARIANT_TYPE ("ay")); + g_variant_builder_init(&b, G_VARIANT_TYPE("ay") ); for( i=0; iSmsData.szData[i] ); + g_variant_builder_add(&b, "y", pWriteData->SmsData.szData[i] ); } - tpdu = g_variant_builder_end(b); + tpdu = g_variant_builder_end(&b); packet_tpdu = g_variant_new("v", tpdu); param = g_variant_new("(i@vi@v)", pWriteData->MsgStatus, @@ -694,7 +558,7 @@ EXPORT_API int tel_write_sms_in_sim(struct tapi_handle *handle, const TelSmsData return TAPI_API_SUCCESS; } -EXPORT_API int tel_delete_sms_in_sim(struct tapi_handle *handle, int index, tapi_response_cb callback, void* user_data) +EXPORT_API int tel_delete_sms_in_sim(struct tapi_handle *handle, int del_index, tapi_response_cb callback, void* user_data) { struct tapi_resp_data *evt_cb_data = NULL; GVariant *param; @@ -704,14 +568,14 @@ EXPORT_API int tel_delete_sms_in_sim(struct tapi_handle *handle, int index, tapi TAPI_RET_ERR_NUM_IF_FAIL(handle, TAPI_API_INVALID_PTR); TAPI_RET_ERR_NUM_IF_FAIL(callback, TAPI_API_INVALID_PTR); - if ((index < -1) || (index > TAPI_NETTEXT_MAX_INDEX)) { + if ((del_index < -1) || (del_index > TAPI_NETTEXT_MAX_INDEX)) { err("Invalid Index Input"); return TAPI_API_INVALID_INPUT; } MAKE_RESP_CB_DATA(evt_cb_data, handle, callback, user_data); - param = g_variant_new("(i)", index); + param = g_variant_new("(i)", del_index); g_dbus_connection_call(handle->dbus_connection, DBUS_TELEPHONY_SERVICE , handle->path, DBUS_TELEPHONY_SMS_INTERFACE, @@ -742,7 +606,7 @@ EXPORT_API int tel_get_sms_count(struct tapi_handle *handle, tapi_response_cb ca return TAPI_API_SUCCESS; } -EXPORT_API int tel_get_sms_sca(struct tapi_handle *handle, int index, tapi_response_cb callback, void* user_data) +EXPORT_API int tel_get_sms_sca(struct tapi_handle *handle, int sca_index, tapi_response_cb callback, void* user_data) { struct tapi_resp_data *evt_cb_data = NULL; GVariant *param; @@ -752,14 +616,14 @@ EXPORT_API int tel_get_sms_sca(struct tapi_handle *handle, int index, tapi_respo TAPI_RET_ERR_NUM_IF_FAIL(handle, TAPI_API_INVALID_PTR); TAPI_RET_ERR_NUM_IF_FAIL(callback, TAPI_API_INVALID_PTR); - if ((index < 0) || (index > TAPI_NETTEXT_MAX_INDEX)) { + if ((sca_index < 0) || (sca_index > TAPI_NETTEXT_MAX_INDEX)) { err("Invalid Index Input"); return TAPI_API_INVALID_INPUT; } MAKE_RESP_CB_DATA(evt_cb_data, handle, callback, user_data); - param = g_variant_new("(i)", index); + param = g_variant_new("(i)", sca_index); g_dbus_connection_call(handle->dbus_connection, DBUS_TELEPHONY_SERVICE , handle->path, DBUS_TELEPHONY_SMS_INTERFACE, @@ -770,12 +634,12 @@ EXPORT_API int tel_get_sms_sca(struct tapi_handle *handle, int index, tapi_respo return TAPI_API_SUCCESS; } -EXPORT_API int tel_set_sms_sca(struct tapi_handle *handle, const TelSmsAddressInfo_t *pSCA, int index, tapi_response_cb callback, void* user_data) +EXPORT_API int tel_set_sms_sca(struct tapi_handle *handle, const TelSmsAddressInfo_t *pSCA, int sca_index, tapi_response_cb callback, void* user_data) { struct tapi_resp_data *evt_cb_data = NULL; GVariant *param; GVariant *sca = 0, *packet_sca = 0; - GVariantBuilder *b = 0; + GVariantBuilder b; int i; dbg("Func Entrance "); @@ -783,21 +647,21 @@ EXPORT_API int tel_set_sms_sca(struct tapi_handle *handle, const TelSmsAddressIn TAPI_RET_ERR_NUM_IF_FAIL(handle, TAPI_API_INVALID_PTR); TAPI_RET_ERR_NUM_IF_FAIL(pSCA, TAPI_API_INVALID_PTR); - if ((index < 0) || (index > TAPI_NETTEXT_MAX_INDEX)) { + if ((sca_index < 0) || (sca_index > TAPI_NETTEXT_MAX_INDEX)) { err("Invalid Index Input"); return TAPI_API_INVALID_INPUT; } MAKE_RESP_CB_DATA(evt_cb_data, handle, callback, user_data); - b = g_variant_builder_new(G_VARIANT_TYPE ("ay")); + g_variant_builder_init(&b, G_VARIANT_TYPE("ay") ); for( i=0; iszDiallingNum[i] ); + g_variant_builder_add(&b, "y", pSCA->szDiallingNum[i] ); } - sca = g_variant_builder_end(b); + sca = g_variant_builder_end(&b); packet_sca = g_variant_new("v", sca); - param = g_variant_new("(iiii@v)", index, + param = g_variant_new("(iiii@v)", sca_index, pSCA->Ton, pSCA->Npi, pSCA->DialNumLen, @@ -917,53 +781,6 @@ EXPORT_API int tel_set_sms_memory_status(struct tapi_handle *handle, int memoryS return TAPI_API_SUCCESS; } -EXPORT_API int tel_get_sms_preferred_bearer(struct tapi_handle *handle, tapi_response_cb callback, void* user_data) -{ - struct tapi_resp_data *evt_cb_data = NULL; - - dbg("Func Entrance "); - - TAPI_RET_ERR_NUM_IF_FAIL(handle, TAPI_API_INVALID_PTR); - TAPI_RET_ERR_NUM_IF_FAIL(callback, TAPI_API_INVALID_PTR); - - MAKE_RESP_CB_DATA(evt_cb_data, handle, callback, user_data); - - g_dbus_connection_call(handle->dbus_connection, - DBUS_TELEPHONY_SERVICE , handle->path, DBUS_TELEPHONY_SMS_INTERFACE, - "GetPrefBearer", NULL, NULL, - G_DBUS_CALL_FLAGS_NONE, TAPI_DEFAULT_TIMEOUT, handle->ca, - on_response_default, evt_cb_data); - - return TAPI_API_SUCCESS; -} - -EXPORT_API int tel_set_sms_preferred_bearer(struct tapi_handle *handle, TelSmsBearerType_t BearerType, tapi_response_cb callback, void* user_data) -{ - struct tapi_resp_data *evt_cb_data = NULL; - GVariant *param; - - dbg("Func Entrance "); - - TAPI_RET_ERR_NUM_IF_FAIL(handle, TAPI_API_INVALID_PTR); - - if ((TAPI_NETTEXT_BEARER_PS_ONLY > BearerType) || (TAPI_NETTEXT_NO_PREFERRED_BEARER < BearerType)) { - err("Invalid Input -PrefBearer Set Nettext"); - return TAPI_API_INVALID_INPUT; - } - - MAKE_RESP_CB_DATA(evt_cb_data, handle, callback, user_data); - - param = g_variant_new("(i)", BearerType); - - g_dbus_connection_call(handle->dbus_connection, - DBUS_TELEPHONY_SERVICE , handle->path, DBUS_TELEPHONY_SMS_INTERFACE, - "SetPrefBearer", param, NULL, - G_DBUS_CALL_FLAGS_NONE, TAPI_DEFAULT_TIMEOUT, handle->ca, - on_response_default, evt_cb_data); - - return TAPI_API_SUCCESS; -} - EXPORT_API int tel_send_sms_deliver_report(struct tapi_handle *handle, const TelSmsDatapackageInfo_t *pDataPackage, TelSmsResponse_t RPCause, @@ -973,7 +790,7 @@ EXPORT_API int tel_send_sms_deliver_report(struct tapi_handle *handle, GVariant *param; GVariant *sca = 0, *packet_sca = 0; GVariant *tpdu = 0, *packet_tpdu = 0; - GVariantBuilder *b = 0; + GVariantBuilder b; int i; dbg("Func Entrance "); @@ -984,18 +801,18 @@ EXPORT_API int tel_send_sms_deliver_report(struct tapi_handle *handle, MAKE_RESP_CB_DATA(evt_cb_data, handle, callback, user_data); - b = g_variant_builder_new(G_VARIANT_TYPE ("ay")); + g_variant_builder_init(&b, G_VARIANT_TYPE("ay") ); for( i=0; iSca[i] ); + g_variant_builder_add(&b, "y", pDataPackage->Sca[i] ); } - sca = g_variant_builder_end(b); + sca = g_variant_builder_end(&b); packet_sca = g_variant_new("v", sca); - b = g_variant_builder_new(G_VARIANT_TYPE ("ay")); + g_variant_builder_init(&b, G_VARIANT_TYPE("ay") ); for( i=0; iszData[i] ); + g_variant_builder_add(&b, "y", pDataPackage->szData[i] ); } - tpdu = g_variant_builder_end(b); + tpdu = g_variant_builder_end(&b); packet_tpdu = g_variant_new("v", tpdu); param = g_variant_new("(@vi@vi)", packet_sca, @@ -1012,7 +829,7 @@ EXPORT_API int tel_send_sms_deliver_report(struct tapi_handle *handle, return TAPI_API_SUCCESS; } -EXPORT_API int tel_set_sms_message_status(struct tapi_handle *handle, int index, TelSmsMsgStatus_t msgStatus, tapi_response_cb callback, void* user_data) +EXPORT_API int tel_set_sms_message_status(struct tapi_handle *handle, int set_index, TelSmsMsgStatus_t msgStatus, tapi_response_cb callback, void* user_data) { struct tapi_resp_data *evt_cb_data = NULL; GVariant *param; @@ -1021,7 +838,7 @@ EXPORT_API int tel_set_sms_message_status(struct tapi_handle *handle, int index, TAPI_RET_ERR_NUM_IF_FAIL(handle, TAPI_API_INVALID_PTR); - if ((index < 0) || (index > TAPI_NETTEXT_MAX_INDEX) || + if ((set_index < 0) || (set_index > TAPI_NETTEXT_MAX_INDEX) || (msgStatus > TAPI_NETTEXT_STATUS_RESERVED)) { err("Invalid Input -MsgStatus Set Nettext"); return TAPI_API_INVALID_INPUT; @@ -1029,7 +846,7 @@ EXPORT_API int tel_set_sms_message_status(struct tapi_handle *handle, int index, MAKE_RESP_CB_DATA(evt_cb_data, handle, callback, user_data); - param = g_variant_new("(ii)", index, msgStatus); + param = g_variant_new("(ii)", set_index, msgStatus); g_dbus_connection_call(handle->dbus_connection, DBUS_TELEPHONY_SERVICE , handle->path, DBUS_TELEPHONY_SMS_INTERFACE, @@ -1040,7 +857,7 @@ EXPORT_API int tel_set_sms_message_status(struct tapi_handle *handle, int index, return TAPI_API_SUCCESS; } -EXPORT_API int tel_get_sms_parameters(struct tapi_handle *handle, int index, tapi_response_cb callback, void* user_data) +EXPORT_API int tel_get_sms_parameters(struct tapi_handle *handle, int get_index, tapi_response_cb callback, void* user_data) { struct tapi_resp_data *evt_cb_data = NULL; GVariant *param; @@ -1050,14 +867,14 @@ EXPORT_API int tel_get_sms_parameters(struct tapi_handle *handle, int index, tap TAPI_RET_ERR_NUM_IF_FAIL(handle, TAPI_API_INVALID_PTR); TAPI_RET_ERR_NUM_IF_FAIL(callback, TAPI_API_INVALID_PTR); - if ((index < 0) || (index > TAPI_NETTEXT_MAX_INDEX)) { + if ((get_index < 0) || (get_index > TAPI_NETTEXT_MAX_INDEX)) { err("Invalid Input -SMS Param Get Nettext"); return TAPI_API_INVALID_INPUT; } MAKE_RESP_CB_DATA(evt_cb_data, handle, callback, user_data); - param = g_variant_new("(i)", index); + param = g_variant_new("(i)", get_index); g_dbus_connection_call(handle->dbus_connection, DBUS_TELEPHONY_SERVICE , handle->path, DBUS_TELEPHONY_SMS_INTERFACE, @@ -1075,7 +892,7 @@ EXPORT_API int tel_set_sms_parameters(struct tapi_handle *handle, const TelSmsPa GVariant *alphaId = 0, *packet_alphaId = 0; GVariant *destDialNum = 0, *packet_destDialNum = 0; GVariant *scaDialNum = 0, *packet_scaDialNum = 0; - GVariantBuilder *b = 0; + GVariantBuilder b; int i; dbg("Func Entrance "); @@ -1085,25 +902,25 @@ EXPORT_API int tel_set_sms_parameters(struct tapi_handle *handle, const TelSmsPa MAKE_RESP_CB_DATA(evt_cb_data, handle, callback, user_data); - b = g_variant_builder_new(G_VARIANT_TYPE ("ay")); + g_variant_builder_init(&b, G_VARIANT_TYPE("ay") ); for( i=0; iszAlphaId[i] ); + g_variant_builder_add(&b, "y", pSmsSetParameters->szAlphaId[i] ); } - alphaId = g_variant_builder_end(b); + alphaId = g_variant_builder_end(&b); packet_alphaId = g_variant_new("v", alphaId); - b = g_variant_builder_new(G_VARIANT_TYPE ("ay")); + g_variant_builder_init(&b, G_VARIANT_TYPE("ay") ); for( i=0; iTpDestAddr.szDiallingNum[i] ); + g_variant_builder_add(&b, "y", pSmsSetParameters->TpDestAddr.szDiallingNum[i] ); } - destDialNum = g_variant_builder_end(b); + destDialNum = g_variant_builder_end(&b); packet_destDialNum = g_variant_new("v", destDialNum); - b = g_variant_builder_new(G_VARIANT_TYPE ("ay")); + g_variant_builder_init(&b, G_VARIANT_TYPE("ay") ); for( i=0; iTpSvcCntrAddr.szDiallingNum[i] ); + g_variant_builder_add(&b, "y", pSmsSetParameters->TpSvcCntrAddr.szDiallingNum[i] ); } - scaDialNum = g_variant_builder_end(b); + scaDialNum = g_variant_builder_end(&b); packet_scaDialNum = g_variant_new("v", scaDialNum); param = g_variant_new("(iii@viiii@viii@viii)", pSmsSetParameters->RecordIndex, @@ -1152,83 +969,6 @@ EXPORT_API int tel_get_sms_parameter_count(struct tapi_handle *handle, tapi_resp return TAPI_API_SUCCESS; } -#if 0 -/** - * - * This API is used to send an SMS message to the network. This API allows keeping - * the dedicated link at lower layers by passing information as more messages to send in parameters. - * This will enable not to release if a dedicated connection is used for transmission. - * - * @return TRUE in case of success and FALSE in case of error . - * @param[in] TelSmsMsgInfo_t - SMS_SUBMIT/ACK/CANCEL and its length have to be passed in this structure. - * - * unsigned int MoreMsgToSend will be set to TRUE when there are more than one message to be - * send or Multiple segmented concatenated message to be send, otherwise FALSE. This flag - * indicates OEM that more messages to send. - * - * @param[out] RequestId-Unique identifier for a particular request - * Its 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 - * - * @Interface Asynchronous. - * @remark - * @Refer TelSmsMsgInfo_t. - */ -EXPORT_API int tel_send_sms_msg(struct tapi_handle *handle, const TelSmsMsgInfo_t *pSmsMsgInfo, unsigned int MoreMsgToSend, tapi_response_cb callback, void* user_data) -{ - struct tapi_resp_data *evt_cb_data = NULL; - GVariant *param; - - dbg("Func Entrance "); - - MAKE_RESP_CB_DATA(evt_cb_data, handle, callback, user_data); - TS_BOOL ret = FALSE; - int api_err = TAPI_API_SUCCESS; - int emergency_mode = 0; - - if (vconf_get_int("db/telephony/emergency", &emergency_mode) != 0) { - TAPI_LIB_DEBUG(LEVEL_ERR, "[FAIL]GET db/telephony/emergency"); - return TAPI_API_OPERATION_FAILED; - } - if (emergency_mode) { - TAPI_LIB_DEBUG(LEVEL_DEBUG, "emergency mode on"); - return TAPI_API_OPERATION_FAILED; - } - - TAPI_RET_ERR_NUM_IF_FAIL(pSmsMsgInfo ,TAPI_API_INVALID_PTR); - - if (conn_name.length_of_name == 0) { - TAPI_LIB_DEBUG(LEVEL_ERR, "No dbus connection name"); - return TAPI_API_OPERATION_FAILED; - } - - TAPI_RET_ERR_NUM_IF_FAIL(tapi_check_dbus_status(), TAPI_API_SYSTEM_RPC_LINK_NOT_EST); - TAPI_GLIB_INIT_PARAMS(); - - TAPI_GLIB_ALLOC_PARAMS(in_param1,in_param2,in_param3,in_param4, - out_param1,out_param2,out_param3,out_param4); - - g_array_append_vals(in_param1, pSmsMsgInfo, sizeof(TelSmsMsgInfo_t)); - g_array_append_vals(in_param2, &MoreMsgToSend, sizeof(unsigned int)); - g_array_append_vals(in_param4, &conn_name, sizeof(tapi_dbus_connection_name)); - - ret = tapi_send_request(TAPI_CS_SERVICE_NETTEXT, TAPI_CS_NETTEXT_SEND_EX, in_param1, in_param2, in_param3, - in_param4, &out_param1, &out_param2, &out_param3, &out_param4); - - if (ret) { - api_err = g_array_index(out_param1, int, 0); - } - else { - api_err = TAPI_API_SYSTEM_RPC_LINK_DOWN; - } - - TAPI_GLIB_FREE_PARAMS(in_param1,in_param2,in_param3,in_param4, - out_param1,out_param2,out_param3,out_param4); - - return api_err; -} -#endif - EXPORT_API int tel_check_sms_device_status(struct tapi_handle *handle, int *pReadyStatus) { GError *error; @@ -1242,9 +982,10 @@ EXPORT_API int tel_check_sms_device_status(struct tapi_handle *handle, int *pRea memset(pReadyStatus, 0, sizeof(int)); error = NULL; - smsReady = g_dbus_connection_call_sync(handle->dbus_connection, DBUS_TELEPHONY_SERVICE , handle->path, - DBUS_TELEPHONY_SMS_INTERFACE, "GetSmsReadyStatus", NULL, NULL, G_DBUS_CALL_FLAGS_NONE, TAPI_DEFAULT_TIMEOUT, NULL, &error); - + smsReady = g_dbus_connection_call_sync(handle->dbus_connection, DBUS_TELEPHONY_SERVICE, + handle->path, DBUS_TELEPHONY_SMS_INTERFACE, + "GetSmsReadyStatus", NULL, NULL, G_DBUS_CALL_FLAGS_NONE, + TAPI_DEFAULT_TIMEOUT, NULL, &error); if(!smsReady){ dbg( "error to get SMS ready_status(%s)", error->message); g_error_free (error); @@ -1254,55 +995,9 @@ EXPORT_API int tel_check_sms_device_status(struct tapi_handle *handle, int *pRea dbg("get SMS ready_status type_format(%s)", g_variant_get_type_string(smsReady)); g_variant_get(smsReady, "(b)", pReadyStatus); + g_variant_unref(smsReady); - dbg("************SMS_device_status (%d)", *pReadyStatus); + msg("************SMS_device_status (%d)", *pReadyStatus); return TAPI_API_SUCCESS; } - -#if 0 -/** - * - * This function enables to application to set that the device is ready to recieve messages from network. - * - * @return Returns appropriate error code. Refer TapiResult_t . - * @param[in] None - * - * @param[out] None - * @Interface Synchronous. - * @remark - * @Refer - */ -EXPORT_API int tel_set_sms_device_status(struct tapi_handle *handle) -{ - struct tapi_resp_data *evt_cb_data = NULL; - GVariant *param; - - dbg("Func Entrance "); - - MAKE_RESP_CB_DATA(evt_cb_data, handle, callback, user_data); - - TS_BOOL ret = FALSE; - int api_err = TAPI_API_SUCCESS; - - TAPI_RET_ERR_NUM_IF_FAIL(tapi_check_dbus_status_internal(), TAPI_API_SYSTEM_RPC_LINK_NOT_EST); - TAPI_GLIB_INIT_PARAMS(); - TAPI_GLIB_ALLOC_PARAMS(in_param1, in_param2, in_param3, in_param4, out_param1, out_param2, out_param3, out_param4); - - ret = tapi_send_request_internal(TAPI_CS_SERVICE_NETTEXT, TAPI_CS_NETTEXT_DEVICEREADY, - in_param1, in_param2, in_param3, in_param4, - &out_param1, &out_param2, &out_param3, &out_param4); - - if (ret) { - api_err = g_array_index(out_param1, int, 0); - } - else { - api_err = TAPI_API_SYSTEM_RPC_LINK_DOWN; - } - - TAPI_GLIB_FREE_PARAMS(in_param1, in_param2, in_param3, in_param4, out_param1, out_param2, out_param3, out_param4); - - return api_err; -} -#endif -//eof \ No newline at end of file diff --git a/wearable/src/tapi_ss.c b/src/tapi_ss.c similarity index 85% rename from wearable/src/tapi_ss.c rename to src/tapi_ss.c index 75e2370..e40519c 100644 --- a/wearable/src/tapi_ss.c +++ b/src/tapi_ss.c @@ -1,7 +1,7 @@ /* * libslp-tapi * - * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * Copyright (c) 2014 Samsung Electronics Co., Ltd. All rights reserved. * * Contact: Ja-young Gu * @@ -48,25 +48,17 @@ static void on_response_get_ss_barring_status(GObject *source_object, GAsyncResu conn = G_DBUS_CONNECTION (source_object); dbus_result = g_dbus_connection_call_finish(conn, res, &error); - CHECK_DEINIT(error); - - if (!dbus_result) { - if (evt_cb_data->cb_fn) { - evt_cb_data->cb_fn(evt_cb_data->handle, -1, NULL, evt_cb_data->user_data); - } - - if (error) - g_error_free(error); - - g_free(evt_cb_data); - return; - } + CHECK_ERROR(error); g_variant_get (dbus_result, "(aa{sv}i)", &iter, &result); resp.record_num = g_variant_iter_n_children(iter); - while ( g_variant_iter_next(iter, "a{sv}", &iter_row ) ) { + if (TAPI_SS_RECORD_NUM_MAX < resp.record_num) { + resp.record_num = TAPI_SS_RECORD_NUM_MAX; + } + + while ( g_variant_iter_next(iter, "a{sv}", &iter_row ) && (i < resp.record_num)) { while ( g_variant_iter_loop( iter_row, "{sv}", &key, &value ) ) { if ( !g_strcmp0(key, "ss_class") ) { @@ -92,6 +84,7 @@ static void on_response_get_ss_barring_status(GObject *source_object, GAsyncResu } g_free(evt_cb_data); + g_variant_unref(dbus_result); } static void on_response_change_ss_barring_password(GObject *source_object, GAsyncResult *res, gpointer user_data) @@ -105,19 +98,7 @@ static void on_response_change_ss_barring_password(GObject *source_object, GAsyn conn = G_DBUS_CONNECTION (source_object); dbus_result = g_dbus_connection_call_finish(conn, res, &error); - CHECK_DEINIT(error); - - if (!dbus_result) { - if (evt_cb_data->cb_fn) { - evt_cb_data->cb_fn(evt_cb_data->handle, -1, NULL, evt_cb_data->user_data); - } - - if (error) - g_error_free(error); - - g_free(evt_cb_data); - return; - } + CHECK_ERROR(error); g_variant_get (dbus_result, "(i)", &result); @@ -126,6 +107,7 @@ static void on_response_change_ss_barring_password(GObject *source_object, GAsyn } g_free(evt_cb_data); + g_variant_unref(dbus_result); } static void on_response_get_ss_forward_status(GObject *source_object, GAsyncResult *res, gpointer user_data) @@ -146,25 +128,17 @@ static void on_response_get_ss_forward_status(GObject *source_object, GAsyncResu conn = G_DBUS_CONNECTION (source_object); dbus_result = g_dbus_connection_call_finish(conn, res, &error); - CHECK_DEINIT(error); - - if (!dbus_result) { - if (evt_cb_data->cb_fn) { - evt_cb_data->cb_fn(evt_cb_data->handle, -1, NULL, evt_cb_data->user_data); - } - - if (error) - g_error_free(error); - - g_free(evt_cb_data); - return; - } + CHECK_ERROR(error); g_variant_get (dbus_result, "(aa{sv}i)", &iter, &result); resp.record_num = g_variant_iter_n_children(iter); - while ( g_variant_iter_next(iter, "a{sv}", &iter_row ) ) { + if (TAPI_SS_RECORD_NUM_MAX < resp.record_num) { + resp.record_num = TAPI_SS_RECORD_NUM_MAX; + } + + while ( g_variant_iter_next(iter, "a{sv}", &iter_row ) && (i < resp.record_num)) { while ( g_variant_iter_loop( iter_row, "{sv}", &key, &value ) ) { if ( !g_strcmp0(key, "ss_class") ) { @@ -210,6 +184,7 @@ static void on_response_get_ss_forward_status(GObject *source_object, GAsyncResu } g_free(evt_cb_data); + g_variant_unref(dbus_result); } static void on_response_get_ss_waiting_status(GObject *source_object, GAsyncResult *res, gpointer user_data) @@ -230,25 +205,17 @@ static void on_response_get_ss_waiting_status(GObject *source_object, GAsyncResu conn = G_DBUS_CONNECTION (source_object); dbus_result = g_dbus_connection_call_finish(conn, res, &error); - CHECK_DEINIT(error); - - if (!dbus_result) { - if (evt_cb_data->cb_fn) { - evt_cb_data->cb_fn(evt_cb_data->handle, -1, NULL, evt_cb_data->user_data); - } - - if (error) - g_error_free(error); - - g_free(evt_cb_data); - return; - } + CHECK_ERROR(error); g_variant_get (dbus_result, "(aa{sv}i)", &iter, &result); resp.record_num = g_variant_iter_n_children(iter); - while ( g_variant_iter_next(iter, "a{sv}", &iter_row ) ) { + if (TAPI_SS_RECORD_NUM_MAX < resp.record_num) { + resp.record_num = TAPI_SS_RECORD_NUM_MAX; + } + + while ( g_variant_iter_next(iter, "a{sv}", &iter_row ) && (i < resp.record_num) ) { while ( g_variant_iter_loop( iter_row, "{sv}", &key, &value ) ) { if ( !g_strcmp0(key, "ss_class") ) { @@ -269,6 +236,7 @@ static void on_response_get_ss_waiting_status(GObject *source_object, GAsyncResu } g_free(evt_cb_data); + g_variant_unref(dbus_result); } static void on_response_set_ss_cli_status(GObject *source_object, GAsyncResult *res, gpointer user_data) @@ -283,19 +251,7 @@ static void on_response_set_ss_cli_status(GObject *source_object, GAsyncResult * conn = G_DBUS_CONNECTION (source_object); dbus_result = g_dbus_connection_call_finish(conn, res, &error); - CHECK_DEINIT(error); - - if (!dbus_result) { - if (evt_cb_data->cb_fn) { - evt_cb_data->cb_fn(evt_cb_data->handle, -1, NULL, evt_cb_data->user_data); - } - - if (error) - g_error_free(error); - - g_free(evt_cb_data); - return; - } + CHECK_ERROR(error); g_variant_get (dbus_result, "(i)", &result); @@ -304,6 +260,7 @@ static void on_response_set_ss_cli_status(GObject *source_object, GAsyncResult * } g_free(evt_cb_data); + g_variant_unref(dbus_result); } static void on_response_get_ss_cli_status(GObject *source_object, GAsyncResult *res, gpointer user_data) @@ -320,28 +277,17 @@ static void on_response_get_ss_cli_status(GObject *source_object, GAsyncResult * conn = G_DBUS_CONNECTION (source_object); dbus_result = g_dbus_connection_call_finish(conn, res, &error); - CHECK_DEINIT(error); - - if (!dbus_result) { - if (evt_cb_data->cb_fn) { - evt_cb_data->cb_fn(evt_cb_data->handle, -1, NULL, evt_cb_data->user_data); - } - - if (error) - g_error_free(error); - - g_free(evt_cb_data); - return; - } + CHECK_ERROR(error); g_variant_get (dbus_result, "(iii)", &result, &resp.Type, &resp.Status); - dbg("Type(%d), Status(%d)", resp.Type, resp.Status); + msg("Type(%d), Status(%d)", resp.Type, resp.Status); if (evt_cb_data->cb_fn) { evt_cb_data->cb_fn(evt_cb_data->handle, result, &resp, evt_cb_data->user_data); } g_free(evt_cb_data); + g_variant_unref(dbus_result); } static void on_response_send_ss_ussd_request(GObject *source_object, GAsyncResult *res, gpointer user_data) @@ -359,19 +305,7 @@ static void on_response_send_ss_ussd_request(GObject *source_object, GAsyncResul conn = G_DBUS_CONNECTION (source_object); dbus_result = g_dbus_connection_call_finish(conn, res, &error); - CHECK_DEINIT(error); - - if (!dbus_result) { - if (evt_cb_data->cb_fn) { - evt_cb_data->cb_fn(evt_cb_data->handle, -1, NULL, evt_cb_data->user_data); - } - - if (error) - g_error_free(error); - - g_free(evt_cb_data); - return; - } + CHECK_ERROR(error); g_variant_get (dbus_result, "(iiiiis)", &result, &resp.Type, &resp.Status, &resp.Dcs, &resp.Length, &tmp_str); @@ -385,13 +319,14 @@ static void on_response_send_ss_ussd_request(GObject *source_object, GAsyncResul } g_free(evt_cb_data); + g_variant_unref(dbus_result); } EXPORT_API int tel_set_ss_barring(TapiHandle *handle, TelSsBarringInfo_t *info, tapi_response_cb callback, void *user_data) { struct tapi_resp_data *evt_cb_data = 0; GVariant *param = 0; - gchar *method = 0; + const gchar *method = NULL; dbg("Func Entrance "); @@ -403,11 +338,11 @@ EXPORT_API int tel_set_ss_barring(TapiHandle *handle, TelSsBarringInfo_t *info, param = g_variant_new("(iis)", info->Class, info->Type, info->szPassword); if ( info->Mode == TAPI_SS_CB_MODE_ACTIVATE ) { - dbg("[ check ] barring activate"); + msg("[ check ] barring activate"); method = "ActivateBarring"; } else { - dbg("[ check ] barring deactivate"); + msg("[ check ] barring deactivate"); method = "DeactivateBarring"; } @@ -464,7 +399,7 @@ EXPORT_API int tel_change_ss_barring_password(TapiHandle *handle, struct tapi_resp_data *evt_cb_data = 0; GVariant *param = 0; - dbg("Func Entrance "); + msg("barring_password change request"); TAPI_RET_ERR_NUM_IF_FAIL(handle, TAPI_API_INVALID_PTR); TAPI_RET_ERR_NUM_IF_FAIL(old_password, TAPI_API_INVALID_PTR); @@ -497,7 +432,7 @@ EXPORT_API int tel_set_ss_forward(TapiHandle *handle, const TelSsForwardInfo_t * { struct tapi_resp_data *evt_cb_data = 0; GVariant *param = 0; - gchar *method = 0; + const gchar *method = 0; dbg("Func Entrance "); @@ -511,27 +446,27 @@ EXPORT_API int tel_set_ss_forward(TapiHandle *handle, const TelSsForwardInfo_t * switch ( info->Mode ) { case TAPI_SS_CF_MODE_DISABLE_EV: { - dbg("[ check ] forwarding deactivate"); + msg("[ check ] forwarding deactivate"); method = "DeactivateForwarding"; } break; case TAPI_SS_CF_MODE_ENABLE_EV: { - dbg("[ check ] forwarding activate"); + msg("[ check ] forwarding activate"); method = "ActivateForwarding"; } break; case TAPI_SS_CF_MODE_REGISTRATION_EV: { - dbg("[ check ] forwarding registration"); + msg("[ check ] forwarding registration"); method = "RegisterForwarding"; } break; case TAPI_SS_CF_MODE_ERASURE_EV: { - dbg("[ check ] forwarding deregistration"); + msg("[ check ] forwarding deregistration"); method = "DeregisterForwarding"; } break; default: - dbg("[ error ] invalid input : (0x%x)", info->Mode); + err("[ error ] invalid input : (0x%x)", info->Mode); return TAPI_API_INVALID_INPUT; } @@ -590,7 +525,7 @@ EXPORT_API int tel_set_ss_waiting(TapiHandle *handle, const TelSsWaitingInfo_t * { struct tapi_resp_data *evt_cb_data = 0; GVariant *param = 0; - gchar *method = 0; + const gchar *method = 0; dbg("Func Entrance "); @@ -602,10 +537,10 @@ EXPORT_API int tel_set_ss_waiting(TapiHandle *handle, const TelSsWaitingInfo_t * param = g_variant_new("(i)", info->Class); if ( info->Mode == TAPI_SS_CW_MODE_ACTIVATE ) { - dbg("[ check ] waiting activate"); + msg("[ check ] waiting activate"); method = "ActivateWaiting"; } else { - dbg("[ check ] waiting deactivate"); + msg("[ check ] waiting deactivate"); method = "DeactivateWaiting"; } @@ -665,7 +600,7 @@ EXPORT_API int tel_set_ss_cli_status(TapiHandle *handle, TelSsCliType_t type, Te struct tapi_resp_data *evt_cb_data = 0; GVariant *param = 0; - dbg("Func Entrance "); + msg("set cli type:[%d] status:[%d]", type, status); TAPI_RET_ERR_NUM_IF_FAIL(handle, TAPI_API_INVALID_PTR); TAPI_RET_ERR_NUM_IF_FAIL(callback, TAPI_API_INVALID_PTR); @@ -730,15 +665,13 @@ EXPORT_API int tel_send_ss_ussd_request(TapiHandle *handle, const TelSsUssdMsgIn struct tapi_resp_data *evt_cb_data = 0; GVariant *param = 0; - dbg("Func Entrance "); - TAPI_RET_ERR_NUM_IF_FAIL(handle, TAPI_API_INVALID_PTR); TAPI_RET_ERR_NUM_IF_FAIL(info, TAPI_API_INVALID_PTR); MAKE_RESP_CB_DATA(evt_cb_data, handle, callback, user_data); param = g_variant_new("(iiis)", info->Type, info->Dcs, info->Length, info->szString); - + msg("ussd type:[%d] length:[%d]", info->Type, info->Length); g_dbus_connection_call(handle->dbus_connection, DBUS_TELEPHONY_SERVICE, handle->path, DBUS_TELEPHONY_SS_INTERFACE, "SendUSSD", param, 0, @@ -747,33 +680,3 @@ EXPORT_API int tel_send_ss_ussd_request(TapiHandle *handle, const TelSsUssdMsgIn return TAPI_API_SUCCESS; } - -/********************************************************************************************** - * - * This function is used to Sets AOC information. - * - * @param AocType[IN] of type TelSsAocType_t which specifies the which AOC type to read. - * @return enum type TapiResult_t Specifies the API's Return result. - * @remark - * - ***********************************************************************************************/ -EXPORT_API int tel_get_ss_aoc_info(TapiHandle *handle, TelSsAocType_t AocType, tapi_response_cb callback, void *user_data) -{ - return 0; -} - -/********************************************************************************************** - * - * This function is used to Sets AOC information. - * - * @param AocSetInfo[IN] of type TelCallAocInfo_t which specifies the AOC info parameters . - * @return enum type TapiResult_t Specifies the API's Return result. - * @remark - * - ***********************************************************************************************/ -EXPORT_API int tel_set_ss_aoc_info(TapiHandle *handle, TelCallAocInfo_t *AocSetInfo, tapi_response_cb callback, void *user_data) -{ - return 0; -} - -/* EOF */ diff --git a/wearable/tapi.pc.in b/tapi.pc.in similarity index 100% rename from wearable/tapi.pc.in rename to tapi.pc.in diff --git a/wearable/test_src/CMakeLists.txt b/test_src/CMakeLists.txt similarity index 98% rename from wearable/test_src/CMakeLists.txt rename to test_src/CMakeLists.txt index 0fd49a2..83d1058 100644 --- a/wearable/test_src/CMakeLists.txt +++ b/test_src/CMakeLists.txt @@ -13,7 +13,6 @@ SET(tapitest modem.c ss.c call.c - gps.c ) ADD_EXECUTABLE(tapitest ${tapitest}) diff --git a/wearable/test_src/call.c b/test_src/call.c old mode 100755 new mode 100644 similarity index 78% rename from wearable/test_src/call.c rename to test_src/call.c index c7c9b3f..fe41bd7 --- a/wearable/test_src/call.c +++ b/test_src/call.c @@ -1,7 +1,7 @@ /* - * Telephony test application + * libslp-tapi * - * Copyright (c) 2012 Samsung Electronics Co., Ltd. All rights reserved. + * Copyright (c) 2014 Samsung Electronics Co., Ltd. All rights reserved. * * Contact: Ja-young Gu * @@ -36,11 +36,13 @@ static char data_call_id[MENU_DATA_SIZE + 1] = "1"; static char data_call_id2[MENU_DATA_SIZE + 1] = "2"; static char data_call_type[MENU_DATA_SIZE + 1] = "0"; -static char data_dtmf_string[MENU_DATA_SIZE + 1] = "1"; +static char data_dtmf_digit[MENU_DATA_SIZE + 1] = "1"; +static char data_dtmf_string[MENU_DATA_SIZE + 1] = "12345"; +static char data_dtmf_pulse_width[MENU_DATA_SIZE + 1] = "1"; +static char data_dtmf_inter_digit_interval[MENU_DATA_SIZE + 1] = "1"; static char data_call_number[MENU_DATA_SIZE + 1] = "+821099777347"; static char data_answer_type[MENU_DATA_SIZE + 1] = "1"; static char data_end_type[MENU_DATA_SIZE + 1] = "1"; -static char data_clock_status[MENU_DATA_SIZE + 1] = "1"; static char data_mute_path[MENU_DATA_SIZE + 1] = "0"; static char data_mute_status[MENU_DATA_SIZE + 1] = "0"; static char data_vol_device[MENU_DATA_SIZE + 1] = "0"; @@ -48,10 +50,7 @@ static char data_vol_type[MENU_DATA_SIZE + 1] = "1"; static char data_vol_level[MENU_DATA_SIZE + 1] = "1"; static char data_sound_path[MENU_DATA_SIZE + 1] = "1"; static char data_extra_volume_status[MENU_DATA_SIZE + 1] = "0"; -static char data_sound_recording[MENU_DATA_SIZE + 1] = "0"; -static char data_sound_equalization_mode[MENU_DATA_SIZE + 1] = "0"; -static char data_sound_direction[MENU_DATA_SIZE + 1] = "0"; -static char data_sound_noise_reduction[MENU_DATA_SIZE + 1] = "0"; +static char data_preferred_voice_subscription[MENU_DATA_SIZE + 1] = "0"; static void on_noti_call_status_idle(TapiHandle *handle, const char *noti_id, void *data, void *user_data) { @@ -132,19 +131,6 @@ static void on_noti_call_status_incoming(TapiHandle *handle, const char *noti_id msg(" - id = %d", noti_data->id); } -static void on_noti_call_sound_clock_status(TapiHandle *handle, const char *noti_id, void *data, void *user_data) -{ - gboolean *noti_data = (gboolean*)data; - - msg(""); - msgb("event(%s) receive !!", TAPI_NOTI_CALL_SOUND_CLOCK_STATUS); - - if (!noti_data) - return; - - msg(" - status = 0x%x", *noti_data); -} - static void on_noti_call_sound_ringback_tone(TapiHandle *handle, const char *noti_id, void *data, void *user_data) { TelCallSoundRingbackToneNoti_t *noti_data = (TelCallSoundRingbackToneNoti_t*)data; @@ -171,30 +157,17 @@ static void on_noti_call_sound_wbamr(TapiHandle *handle, const char *noti_id, vo msg(" - status = 0x%x", *noti_data); } -static void on_noti_call_sound_noise_reduction(TapiHandle *handle, const char *noti_id, void *data, void *user_data) -{ - gboolean *noti_data = (gboolean*)data; - - msg(""); - msgb("event(%s) receive !!", TAPI_NOTI_CALL_SOUND_NOISE_REDUCTION); - - if (!noti_data) - return; - - msg(" - status = 0x%x", *noti_data); -} - -static void on_noti_call_sound_equalization(TapiHandle *handle, const char *noti_id, void *data, void *user_data) +static void on_noti_call_preferred_voice_subscription(TapiHandle *handle, const char *noti_id, void *data, void *user_data) { - TelCallSoundEqualizationNoti_t *noti_data = (TelCallSoundEqualizationNoti_t *)data; + TelCallPreferredVoiceSubsNoti_t *noti_data = (TelCallPreferredVoiceSubsNoti_t *)data; msg(""); - msgb("event(%s) receive !!", TAPI_NOTI_CALL_SOUND_EQUALIZATION); + msgb("event(%s) receive !!", TAPI_NOTI_CALL_PREFERRED_VOICE_SUBSCRIPTION); if (!noti_data) return; - msg(" - Mode = 0x%x Direction = 0x%x", noti_data->mode, noti_data->direction); + msg(" - preferred_subscription = 0x%x", noti_data->preferred_subs); } static void on_noti_call_sound_path(TapiHandle *handle, const char *noti_id, void *data, void *user_data) @@ -311,15 +284,19 @@ static void on_transfer_call(TapiHandle *handle, int result, void *data, void *u msg("on_transfer_call() - cnf_data->id : %d result : 0x%x", cnf_data->id, result); } -static void on_dtmf_call(TapiHandle *handle, int result, void *data, void *user_data) +static void on_start_cont_dtmf_call(TapiHandle *handle, int result, void *data, void *user_data) { - msg("on_dtmf_call() result : 0x%x", result); + msg("on_start_cont_dtmf_call() result : 0x%x", result); } +static void on_stop_cont_dtmf_call(TapiHandle *handle, int result, void *data, void *user_data) +{ + msg("on_stop_cont_dtmf_call() result : 0x%x", result); +} -static void on_call_sound_clock_status(TapiHandle *handle, int result, void *data, void *user_data) +static void on_send_burst_dtmf_call(TapiHandle *handle, int result, void *data, void *user_data) { - msg("on_call_sound_clock_status() - result : 0x%x", result); + msg("on_send_burst_dtmf_call() result : 0x%x", result); } static void on_call_set_mute_status(TapiHandle *handle, int result, void *data, void *user_data) @@ -362,19 +339,9 @@ static void on_call_set_sound_path(TapiHandle *handle, int result, void *data, v msg("on_call_set_sound_path() - result : 0x%x", result); } -static void on_call_set_sound_recording(TapiHandle *handle, int result, void *data, void *user_data) +static void on_call_set_preferred_voice_subscription(TapiHandle *handle, int result, void *data, void *user_data) { - msg("on_call_set_sound_recording() - result : 0x%x", result); -} - -static void on_call_set_sound_equalization(TapiHandle *handle, int result, void *data, void *user_data) -{ - msg("on_call_set_sound_equalization() - result : 0x%x", result); -} - -static void on_call_set_sound_noise_reduction(TapiHandle *handle, int result, void *data, void *user_data) -{ - msg("on_call_set_sound_noise_reduction() - result : 0x%x", result); + msg("on_call_set_preferred_voice_subscription() - result : 0x%x", result); } static int run_call_dial(MManager *mm, struct menu_data *menu) @@ -558,14 +525,29 @@ static int run_call_transfer(MManager *mm, struct menu_data *menu) return result; } -static int run_call_dtmf(MManager *mm, struct menu_data *menu) +static int run_call_start_cont_dtmf(MManager *mm, struct menu_data *menu) +{ + TapiHandle *handle = menu_manager_ref_user_data(mm); + int result; + + msg("call tel_start_call_cont_dtmf()"); + + result = tel_start_call_cont_dtmf(handle, data_dtmf_digit[0], on_start_cont_dtmf_call, NULL); + if (result != TAPI_API_SUCCESS) { + msg("failed. (result = %d)", result); + } + + return result; +} + +static int run_call_stop_cont_dtmf(MManager *mm, struct menu_data *menu) { TapiHandle *handle = menu_manager_ref_user_data(mm); int result; - msg("call tel_dtmf_call()"); + msg("call tel_stop_call_cont_dtmf()"); - result = tel_call_dtmf(handle, data_dtmf_string, on_dtmf_call, NULL); + result = tel_stop_call_cont_dtmf(handle, on_stop_cont_dtmf_call, NULL); if (result != TAPI_API_SUCCESS) { msg("failed. (result = %d)", result); } @@ -573,6 +555,27 @@ static int run_call_dtmf(MManager *mm, struct menu_data *menu) return result; } +static int run_call_send_burst_dtmf(MManager *mm, struct menu_data *menu) +{ + TapiHandle *handle = menu_manager_ref_user_data(mm); + int result; + TelCallBurstDtmf_t info; + memset(&info, 0x0, sizeof(info)); + g_strlcpy(info.dtmf_string, data_dtmf_string, TAPI_CALL_BURST_DTMF_STRING_MAX + 1); + info.pulse_width = data_dtmf_pulse_width[0]; + info.inter_digit_interval = data_dtmf_inter_digit_interval[0]; + + msg("call tel_send_call_burst_dtmf()"); + + result = tel_send_call_burst_dtmf(handle, &info,on_send_burst_dtmf_call, NULL); + if (result != TAPI_API_SUCCESS) { + msg("failed. (result = %d)", result); + } + + return result; +} + + static void call_status_callback( TelCallStatus_t *status, void *user_data ) { @@ -627,26 +630,6 @@ static int run_call_get_status_all(MManager *mm, struct menu_data *menu) return result; } -static int run_call_set_sound_clock_status(MManager *mm, struct menu_data *menu) -{ - TapiHandle *handle = menu_manager_ref_user_data(mm); - int result = 0; - int status = 0; - - msg("call tel_set_call_sound_clock_status()"); - - status = atoi(data_clock_status); - - msg("status : (%d)", status); - - result = tel_set_call_sound_clock_status(handle, (gboolean)status, on_call_sound_clock_status, NULL); - if (result != TAPI_API_SUCCESS) { - msg("failed. (result = %d)", result); - } - - return result; -} - static int run_call_set_mute_status(MManager *mm, struct menu_data *menu) { TapiHandle *handle = menu_manager_ref_user_data(mm); @@ -754,19 +737,19 @@ static int run_call_set_sound_path(MManager *mm, struct menu_data *menu) return result; } -static int run_call_set_sound_recording(MManager *mm, struct menu_data *menu) +static int run_call_set_preferred_voice_subscription(MManager *mm, struct menu_data *menu) { TapiHandle *handle = menu_manager_ref_user_data(mm); int result = 0; - TelSoundRecording_t sound_recording ; + TelCallPreferredVoiceSubs_t preferred_subscription; - msg("call tel_set_sound_recording()"); + msg("call run_call_set_preferred_voice_subscription()"); - sound_recording = (TelSoundRecording_t)atoi(data_sound_recording); + preferred_subscription = (TelCallPreferredVoiceSubs_t)atoi(data_preferred_voice_subscription); - msg("sound_recording : (0x%x)", sound_recording); + msg("preferred_subscription : (%d)", preferred_subscription); - result = tel_set_call_sound_recording(handle, &sound_recording, on_call_set_sound_recording, NULL); + result = tel_set_call_preferred_voice_subscription(handle, preferred_subscription, on_call_set_preferred_voice_subscription, NULL); if (result != TAPI_API_SUCCESS) { msg("failed. (result = %d)", result); } @@ -774,52 +757,25 @@ static int run_call_set_sound_recording(MManager *mm, struct menu_data *menu) return result; } -static int run_call_set_sound_equalization(MManager *mm, struct menu_data *menu) +static int run_call_get_preferred_voice_subscription(MManager *mm, struct menu_data *menu) { TapiHandle *handle = menu_manager_ref_user_data(mm); int result = 0; - TelCallSoundEqualization_t sound_equalization ; - - msg("call tel_set_sound_equalization()"); - memset(&sound_equalization,0,sizeof(sound_equalization)); + TelCallPreferredVoiceSubs_t preferred_subscription = TAPI_CALL_PREFERRED_VOICE_SUBS_UNKNOWN; - sound_equalization.mode = (TelSoundEqualizationMode_t)atoi(data_sound_equalization_mode); - sound_equalization.direction = (TelSoundDirection_t)atoi(data_sound_direction); + msg("call tel_get_call_preferred_voice_subscription()"); - msg("sound_equalization.mode: (0x%x)", sound_equalization.mode); - msg("sound_equalization.direction: (0x%x)", sound_equalization.direction); - - result = tel_set_call_sound_equalization(handle, &sound_equalization, on_call_set_sound_equalization, NULL); + result = tel_get_call_preferred_voice_subscription(handle, &preferred_subscription); if (result != TAPI_API_SUCCESS) { msg("failed. (result = %d)", result); } - - return result; -} - -static int run_call_set_sound_noise_reduction(MManager *mm, struct menu_data *menu) -{ - TapiHandle *handle = menu_manager_ref_user_data(mm); - int result = 0; - TelSoundNoiseReduction_t sound_noise_reduction ; - - msg("call tel_set_sound_noise_reduction()"); - - sound_noise_reduction = (TelSoundNoiseReduction_t)atoi(data_sound_noise_reduction); - - msg("sound_noise_reduction : (0x%x)", sound_noise_reduction); - - result = tel_set_call_sound_noise_reduction(handle, sound_noise_reduction, on_call_set_sound_noise_reduction, NULL); - if (result != TAPI_API_SUCCESS) { - msg("failed. (result = %d)", result); + else { + msg("'preferred' Voice call subscription = (%d)", preferred_subscription); } return result; } - - - static struct menu_data menu_call_dial[] = { { "1", "type (0=VOICE, 1=VIDEO, 2=Emergency)", 0, 0, data_call_type}, { "2", "number", 0, 0, data_call_number}, @@ -877,12 +833,26 @@ static struct menu_data menu_call_transfer[] = { { 0, 0, }, }; -static struct menu_data menu_call_dtmf[] = { - { "1", "Dtmf Charater(0-9, A-D, ' * ' and ' # ') one character at a time ", 0, 0, data_dtmf_string}, - { "2", "run", 0, run_call_dtmf, 0}, - { 0, 0, }, +static struct menu_data menu_call_start_cont_dtmf[] = { + { "1", "Dtmf Charater(0-9, A-D, ' * ' and ' # ') one character at a time ", NULL, NULL, data_dtmf_digit}, + { "2", "run", NULL, run_call_start_cont_dtmf, NULL}, + { NULL, NULL, }, }; +static struct menu_data menu_call_stop_cont_dtmf[] = { + { "1", "run", NULL, run_call_stop_cont_dtmf, NULL}, + { NULL, NULL, }, +}; + +static struct menu_data menu_call_send_burst_dtmf[] = { + { "1", "Dtmf String(0-9, A-D, ' * ' and ' # ') one character or a string of characters ", NULL, NULL, data_dtmf_string}, + { "2", "DTMF pulse width (ONLENGTH_95MS=0x0, ONLENGTH_150MS=0x1, ONLENGTH_200MS=0x2, ONLENGTH_250MS=0x3, ONLENGTH_300MS=0x4, ONLENGTH_350MS=0x5, ONLENGTH_SMS=0x6)", NULL, NULL, data_dtmf_pulse_width}, + { "3", "DTMF inter digit interval (OFFLENGTH_60MS=0x0, OFFLENGTH_100MS=0x1, OFFLENGTH_150MS=0x2, OFFLENGTH_200MS=0x3)", NULL, NULL, data_dtmf_inter_digit_interval}, + { "4", "run", NULL, run_call_send_burst_dtmf, NULL}, + { NULL, NULL, }, +}; + + static struct menu_data menu_call_get_status[] = { { "1", "id", 0, 0, data_call_id}, { "2", "run", 0, run_call_get_status, 0}, @@ -895,12 +865,6 @@ static struct menu_data menu_call_get_status_all[] = { { 0, 0, }, }; -static struct menu_data menu_call_set_sound_clock_status[] = { - { "1", "status", 0, 0, data_clock_status}, - { "2", "run", 0, run_call_set_sound_clock_status, 0}, - { 0, 0, }, -}; - static struct menu_data menu_call_set_mute_status[] = { { "1", "status", 0, 0, data_mute_status}, { "2", "path", 0, 0, data_mute_path}, @@ -935,26 +899,17 @@ static struct menu_data menu_call_set_sound_path[] = { { 0, 0, }, }; -static struct menu_data menu_call_set_sound_recording[] = { - { "1", "Sound Recording(0=OFF, 1=ON) ", 0, 0, data_sound_recording}, - { "2", "run", 0, run_call_set_sound_recording, 0}, - { 0, 0, }, -}; - -static struct menu_data menu_call_set_sound_equalization[] = { - { "1", "Sound Equalization Mode (0=OFF, 1=ON, 2=FLAG_OFF, 3=FLAG_ON, 4=SOFT1, 5=SOFT2)", 0, 0, data_sound_equalization_mode}, - { "2", "Sound direction (0=LEFT, 1=RIGHT)", 0, 0, data_sound_direction}, - { "3", "run", 0, run_call_set_sound_equalization, 0}, +static struct menu_data menu_call_set_preferred_voice_subscription[] = { + { "1", "Preferred Voice call Subcription (0=Current network, 1=ASK Always, 2=SIM 1, 3=SIM 2)", 0, 0, data_preferred_voice_subscription}, + { "2", "run", 0, run_call_set_preferred_voice_subscription, 0}, { 0, 0, }, }; -static struct menu_data menu_call_set_sound_noise_reduction[] = { - { "1", "Sound Noise reduction (0=OFF, 1=ON)", 0, 0, data_sound_noise_reduction}, - { "2", "run", 0, run_call_set_sound_noise_reduction, 0}, +static struct menu_data menu_call_get_preferred_voice_subscription[] = { + { "1", "run", 0, run_call_get_preferred_voice_subscription, 0}, { 0, 0, }, }; - struct menu_data menu_call[] = { { "1", "tel_dial_call", menu_call_dial, 0, 0}, { "2", "tel_answer_call", menu_call_answer, 0, 0}, @@ -965,18 +920,18 @@ struct menu_data menu_call[] = { { "7", "tel_join_call", menu_call_join, 0, 0}, { "8", "tel_split_call", menu_call_split, 0, 0}, { "9", "tel_transfer_call", menu_call_transfer, 0, 0}, - { "10", "tel_dtmf_call", menu_call_dtmf, 0, 0}, - { "11", "tel_get_call_status", menu_call_get_status, 0, 0}, - { "12", "tel_get_call_status_all", menu_call_get_status_all, 0, 0}, - { "13", "tel_set_call_sound_clock_status", menu_call_set_sound_clock_status, 0, 0}, - { "14", "tel_set_call_mute_status", menu_call_set_mute_status, 0, 0}, - { "15", "tel_get_call_mute_status", menu_call_get_mute_status, 0, 0}, - { "16", "tel_set_call_volume_info", menu_call_set_volume_info, 0, 0}, - { "17", "tel_get_call_volume_info", menu_call_get_volume_info, 0, 0}, - { "18", "tel_set_call_sound_path", menu_call_set_sound_path, 0, 0}, - { "19", "tel_set_call_sound_recording", menu_call_set_sound_recording, 0, 0}, - { "20", "tel_set_call_sound_equalization", menu_call_set_sound_equalization, 0, 0}, - { "21", "tel_set_call_sound_noise_reduction", menu_call_set_sound_noise_reduction, 0, 0}, + { "10", "tel_start_call_cont_dtmf_call", menu_call_start_cont_dtmf, NULL, NULL}, + { "11", "tel_stop_call_cont_dtmf_call", menu_call_stop_cont_dtmf, NULL, NULL}, + { "12", "tel_send_call_burst_dtmf", menu_call_send_burst_dtmf, NULL, NULL}, + { "13", "tel_get_call_status", menu_call_get_status, NULL, NULL}, + { "14", "tel_get_call_status_all", menu_call_get_status_all, NULL, NULL}, + { "15", "tel_set_call_mute_status", menu_call_set_mute_status, NULL, NULL}, + { "16", "tel_get_call_mute_status", menu_call_get_mute_status, NULL, NULL}, + { "17", "tel_set_call_volume_info", menu_call_set_volume_info, NULL, NULL}, + { "18", "tel_get_call_volume_info", menu_call_get_volume_info, NULL, NULL}, + { "19", "tel_set_call_sound_path", menu_call_set_sound_path, NULL, NULL}, + { "20", "tel_set_call_preferred_voice_subscription", menu_call_set_preferred_voice_subscription, 0, 0}, + { "21", "tel_get_call_preferred_voice_subscription", menu_call_get_preferred_voice_subscription, 0, 0}, { 0, 0, }, }; @@ -1014,11 +969,6 @@ void register_call_event(TapiHandle *handle) msg("event register failed(%d)", ret); } - ret = tel_register_noti_event(handle, TAPI_NOTI_CALL_SOUND_CLOCK_STATUS, on_noti_call_sound_clock_status, 0); - if (ret != TAPI_API_SUCCESS) { - msg("event register failed(%d)", ret); - } - ret = tel_register_noti_event(handle, TAPI_NOTI_CALL_INFO_HELD, on_noti_call_on_hold, 0); if (ret != TAPI_API_SUCCESS) { msg("event register failed(%d)", ret); @@ -1044,17 +994,12 @@ void register_call_event(TapiHandle *handle) msg("event register failed(%d)", ret); } - ret = tel_register_noti_event(handle, TAPI_NOTI_CALL_SOUND_EQUALIZATION, on_noti_call_sound_equalization, 0); - if (ret != TAPI_API_SUCCESS) { - msg("event register failed(%d)", ret); - } - ret = tel_register_noti_event(handle, TAPI_NOTI_CALL_SOUND_PATH, on_noti_call_sound_path, 0); if (ret != TAPI_API_SUCCESS) { msg("event register failed(%d)", ret); } - ret = tel_register_noti_event(handle, TAPI_NOTI_CALL_SOUND_NOISE_REDUCTION, on_noti_call_sound_noise_reduction, 0); + ret = tel_register_noti_event(handle, TAPI_NOTI_CALL_PREFERRED_VOICE_SUBSCRIPTION, on_noti_call_preferred_voice_subscription, 0); if (ret != TAPI_API_SUCCESS) { msg("event register failed(%d)", ret); } diff --git a/wearable/test_src/call.h b/test_src/call.h similarity index 88% rename from wearable/test_src/call.h rename to test_src/call.h index 5ae91be..56561ff 100644 --- a/wearable/test_src/call.h +++ b/test_src/call.h @@ -1,7 +1,7 @@ /* - * Telephony test application + * libslp-tapi * - * Copyright (c) 2012 Samsung Electronics Co., Ltd. All rights reserved. + * Copyright (c) 2014 Samsung Electronics Co., Ltd. All rights reserved. * * Contact: Ja-young Gu * diff --git a/wearable/test_src/main.c b/test_src/main.c similarity index 50% rename from wearable/test_src/main.c rename to test_src/main.c index 2cff5a9..41695b7 100644 --- a/wearable/test_src/main.c +++ b/test_src/main.c @@ -1,7 +1,7 @@ /* - * Telephony test application + * libslp-tapi * - * Copyright (c) 2012 Samsung Electronics Co., Ltd. All rights reserved. + * Copyright (c) 2014 Samsung Electronics Co., Ltd. All rights reserved. * * Contact: Ja-young Gu * @@ -38,8 +38,8 @@ #include "modem.h" #include "call.h" #include "ss.h" -#include "gps.h" +#define SIM_SEL_MENU_KEY_COUNT 2 extern struct menu_data menu_modem[]; extern struct menu_data menu_sat[]; @@ -49,51 +49,41 @@ extern struct menu_data menu_sim[]; extern struct menu_data menu_phonebook[]; extern struct menu_data menu_ss[]; extern struct menu_data menu_call[]; -extern struct menu_data menu_gps[]; TapiHandle *handle = NULL; +char **cp_list = NULL; +int cp_count = 0; -static char data_modem_name[MENU_DATA_SIZE + 1] = ""; +static char data_subscription_type[MENU_DATA_SIZE + 1] = ""; static char data_property_int[MENU_DATA_SIZE + 1] = "org.tizen.telephony.Modem:power"; static char data_property_string[MENU_DATA_SIZE + 1] = "org.tizen.telephony.Network:network_name"; +static char data_convert_string[MENU_DATA_SIZE + 1] = ""; +static char data_convert_dcs[MENU_DATA_SIZE + 1] = "1"; static int get_modem_info(MManager *mm, struct menu_data *menu) { - char **cp_list = NULL; int i = 0; - cp_list = tel_get_cp_name_list(); - if (!cp_list) { - msg("failed."); - return 0; - } - while (cp_list[i]) { msg("[%02d] strlen(%d), '%s'", i, strlen(cp_list[i]), cp_list[i]); i++; } - free(cp_list); - return 0; } static int init(MManager *mm, struct menu_data *menu) { + int subs_type = atoi(data_subscription_type); + if (handle) { msg("already handle exist"); return 0; } - - if (strlen(data_modem_name) < 1) { - msg("call tel_init(NULL)"); - handle = tel_init(NULL); - } - else { - msg("call tel_init(\"%s\")", data_modem_name); - handle = tel_init(data_modem_name); + if (cp_list[subs_type-1]) { + msg("call tel_init(%s)", cp_list[subs_type-1]); + handle = tel_init(cp_list[subs_type-1]); } - if (!handle) msg("handle is null"); @@ -120,13 +110,13 @@ static int deinit(MManager *mm, struct menu_data *menu) static int get_property_int(MManager *mm, struct menu_data *menu) { - TapiHandle *handle = menu_manager_ref_user_data(mm); + TapiHandle *local_handle = menu_manager_ref_user_data(mm); int result_int = -1; int ret; msg("call tel_get_property_int()"); - ret = tel_get_property_int(handle, data_property_int, &result_int); + ret = tel_get_property_int(local_handle, data_property_int, &result_int); if (ret != TAPI_API_SUCCESS) { msg("failed. (return = %d)", ret); } @@ -138,13 +128,34 @@ static int get_property_int(MManager *mm, struct menu_data *menu) static int get_property_string(MManager *mm, struct menu_data *menu) { - TapiHandle *handle = menu_manager_ref_user_data(mm); + TapiHandle *local_handle = menu_manager_ref_user_data(mm); char *result_str = NULL; int ret; msg("call tel_get_property_string()"); - ret = tel_get_property_string (handle, data_property_string, &result_str); + ret = tel_get_property_string (local_handle, data_property_string, &result_str); + if (ret != TAPI_API_SUCCESS) { + msg("failed. (return = %d)", ret); + } + + msg(" - result = %s", result_str); + + if (result_str) + free (result_str); + + return 0; +} + +static int convert_string(MManager *mm, struct menu_data *menu) +{ + TapiHandle *local_handle = menu_manager_ref_user_data(mm); + char *result_str = NULL; + int ret; + + msg("call tel_get_property_string()"); + + ret = tel_get_property_string (local_handle, data_property_string, &result_str); if (ret != TAPI_API_SUCCESS) { msg("failed. (return = %d)", ret); } @@ -160,12 +171,14 @@ static int get_property_string(MManager *mm, struct menu_data *menu) static struct menu_data menu_common[] = { { "1", "tel_get_modem_info", NULL, get_modem_info, NULL}, { "2", "tel_init", NULL, init, NULL}, - { "2s", " - modem_name", NULL, NULL, data_modem_name}, { "3", "tel_deinit", NULL, deinit, NULL}, { "4", "tel_get_property_int", NULL, get_property_int, NULL}, { "4s", " - property", NULL, NULL, data_property_int}, { "5", "tel_get_property_string", NULL, get_property_string, NULL}, { "5s", " - property", NULL, NULL, data_property_string}, + { "6", "tcore_util_convert_string_to_utf8", NULL, convert_string, NULL}, + { "6d", " - dcs", NULL, NULL, data_convert_dcs}, + { "6s", " - string", NULL, NULL, data_convert_string}, { NULL, NULL, }, }; @@ -179,40 +192,35 @@ static struct menu_data menu_main[] = { { "7", "SS", menu_ss, NULL, NULL}, { "8", "SAT", menu_sat, NULL, NULL}, { "9", "Call", menu_call, NULL, NULL}, - { "a", "Gps", menu_gps, NULL, NULL}, { NULL, NULL, }, }; -int main(int arg, char **argv) +static int __select_handle_register_event (MManager *mm, struct menu_data *menu) { - GMainLoop *mainloop; - GIOChannel *channel = g_io_channel_unix_new(STDIN_FILENO); - MManager *manager; + int subs_type = atoi(data_subscription_type); - g_type_init(); - mainloop = g_main_loop_new(NULL, FALSE); + if (subs_type < 1 || subs_type > cp_count) { + msg("Please select an existing CP Name"); + return RET_FAILURE; + } - msg(""); - msg("* Telephony Test application "); - msg("* Build On: %s %s", __DATE__, __TIME__); + if (handle) { + tel_deinit(handle); + handle = NULL; + } + + handle = tel_init(cp_list[subs_type-1]); - manager = menu_manager_new(menu_main, mainloop); -#if 1 - if (strlen(data_modem_name) < 1) - handle = tel_init(NULL); - else - handle = tel_init(data_modem_name); -#endif msg(""); if (!handle) { - msg("tel_init(%s) failed.", data_modem_name); - } - else { - msg("tel_init(%s) success.", data_modem_name); + msg("[SIM%d] tel_init(%s) - FAILED!!!.", subs_type, cp_list[subs_type-1]); + return RET_FAILURE; + } else { + msg("[SIM%d] tel_init(%s) - SUCCESS!!!.", subs_type, cp_list[subs_type-1]); } - menu_manager_set_user_data(manager, handle); + menu_manager_set_user_data(mm, handle); register_network_event(handle); register_modem_event(handle); @@ -222,15 +230,107 @@ int main(int arg, char **argv) register_sms_event(handle); register_call_event(handle); register_ss_event(handle); - register_gps_event(handle); + return RET_SUCCESS; +} + +static gboolean __create_sim_selection_menu(struct menu_data sim_selection_menu[SIM_SEL_MENU_KEY_COUNT+1]) +{ + unsigned int total_cp_len = 0; + unsigned int title_len = 0; + unsigned int index_count = 0; + unsigned int i = 0; + + cp_list = tel_get_cp_name_list(); + if (!cp_list) { + msg("cp_list is null"); + return FALSE; + } + + while (cp_list[i]) { + total_cp_len += strlen(cp_list[i]); + cp_count++; + i++; + } + + /** + * Available CPs are displayed as below (in UI) - + * Modems(1=Modem0,2=Modem1,3=Modem2) + * + * Title length is calculated as, + * title_len = total_cp_len + (2*cp_count) + (cp_count-1) + 8 + 1; + * where, + * total_cp_len = strlen(Modem0)+strlen(Modem1)+ strlen(Modem2) + * (2*cp_count) = To print "1=" "2=" "3=" + * cp_count-1 = Number of commas + * 8 = Modems() + * 1 = NULL termination + */ + title_len = total_cp_len + (2*cp_count) + (cp_count-1) + 8 + 1; + sim_selection_menu[0].title = (char *)g_try_malloc0(title_len); + index_count += sprintf((char *)&sim_selection_menu[0].title[index_count], "Modems("); + + i=0; + while (cp_list[i]) { + if (i != 0) +// sim_selection_menu[0].title[index_count++] = ','; + strncat((char *)&sim_selection_menu[0].title[index_count++], ",", sizeof(char)); + + + index_count += sprintf((char *)&sim_selection_menu[0].title[index_count], "%d=", (i+1)); + index_count += sprintf((char *)&sim_selection_menu[0].title[index_count], "%s", cp_list[i]); + i++; + } + + if (index_count <= title_len - 2) { + strncat((char *)&sim_selection_menu[0].title[index_count++], ")", sizeof(char)); + } else { + msg("Invalid count"); + return FALSE; + } + + sim_selection_menu[0].key = "1"; + sim_selection_menu[0].sub_menu = NULL; + sim_selection_menu[0].callback = NULL; + sim_selection_menu[0].data = data_subscription_type; + + sim_selection_menu[1].key = "2"; + sim_selection_menu[1].title = "run"; + sim_selection_menu[1].sub_menu = menu_main; + sim_selection_menu[1].callback = __select_handle_register_event; + sim_selection_menu[1].data = NULL; + + return TRUE; +} + +int main(int arg, char **argv) +{ + GMainLoop *mainloop; + GIOChannel *channel = g_io_channel_unix_new(STDIN_FILENO); + MManager *manager; + struct menu_data sim_selection_menu[SIM_SEL_MENU_KEY_COUNT+1] = { {NULL, NULL, }, }; + + g_type_init(); + mainloop = g_main_loop_new(NULL, FALSE); + + msg(""); + msg("* Telephony Test application "); + msg("* Build On: %s %s", __DATE__, __TIME__); + + if (__create_sim_selection_menu(sim_selection_menu) == FALSE) + goto OUT; + + manager = menu_manager_new(sim_selection_menu, mainloop); menu_manager_run(manager); g_io_add_watch(channel, (G_IO_IN | G_IO_ERR | G_IO_HUP | G_IO_NVAL), - on_menu_manager_keyboard, manager); - + on_menu_manager_keyboard, manager); g_main_loop_run(mainloop); +OUT: + g_strfreev(cp_list); + g_free((gpointer *)sim_selection_menu[0].title); + g_main_loop_unref(mainloop); msg("******* Bye bye *******"); return 0; diff --git a/wearable/test_src/menu.c b/test_src/menu.c similarity index 82% rename from wearable/test_src/menu.c rename to test_src/menu.c index f47a0fc..ef058d6 100644 --- a/wearable/test_src/menu.c +++ b/test_src/menu.c @@ -1,7 +1,7 @@ /* - * Telephony test application + * libslp-tapi * - * Copyright (c) 2012 Samsung Electronics Co., Ltd. All rights reserved. + * Copyright (c) 2014 Samsung Electronics Co., Ltd. All rights reserved. * * Contact: Ja-young Gu * @@ -35,7 +35,6 @@ #define DEFAULT_MENU_QUIT "q" #define DEFAULT_MENU_NONE "-" - struct menu_manager { GQueue *stack; GQueue *title_stack; @@ -209,28 +208,31 @@ static void _move_menu (MManager *mm, struct menu_data menu[], char *key) } while (1) { + int ret = RET_SUCCESS; item = menu + i; if (item->key == NULL) break; if (!g_strcmp0 (item->key, key)) { - if (item->sub_menu) { - g_queue_push_tail (mm->stack, mm->menu); - g_queue_push_tail (mm->title_stack, item->title); - - mm->menu = item->sub_menu; - _show_menu (mm, mm->menu); - mm->buf = key_buffer; - } - if (item->callback) { - item->callback (mm, item); + ret = item->callback (mm, item); _show_prompt(); } - if (item->data) { - _show_item_data_input_msg (item); - mm->buf = item->data; + if(RET_SUCCESS == ret) { + if (item->sub_menu) { + g_queue_push_tail (mm->stack, mm->menu); + g_queue_push_tail (mm->title_stack, (gpointer *)item->title); + + mm->menu = item->sub_menu; + _show_menu (mm, mm->menu); + mm->buf = key_buffer; + } + + if (item->data) { + _show_item_data_input_msg (item); + mm->buf = item->data; + } } return; @@ -314,7 +316,7 @@ gboolean on_menu_manager_keyboard (GIOChannel *src, GIOCondition con, _show_input_ok(); } mm->buf = key_buffer; - _move_menu (mm, mm->menu, DEFAULT_MENU_MENU); + _move_menu (mm, mm->menu, (char *)DEFAULT_MENU_MENU); } return TRUE; @@ -339,3 +341,49 @@ int is_pid_show () { return flag_pid_display; } + +static void _hex_dump(const char *pad, int size, const void *data) +{ + char buf[255] = {0, }; + char hex[4] = {0, }; + int i; + unsigned char *p; + + if (size <= 0) { + msg("%sno data", pad); + return; + } + p = (unsigned char *)data; + + snprintf(buf, 255, "%s%04X: ", pad, 0); + for (i = 0; i * @@ -77,28 +77,7 @@ __BEGIN_DECLS #define MENU_DATA_SIZE 255 -#if 0 -/* - * Horizontal Line - width: 44 - * .12345678901234567890123456789012345678901234. - */ -#define HR_SINGLE "--------------------------------------------" -#define HR_DOUBLE "============================================" -#define HR_SINGLE2 " ------------------------------------------ " -#endif -#if 0 -/* - * Horizontal Line - width: 55 - * .12345678901234567890123456789012345678901234567890. - */ -#define HR_SINGLE "----------------------------------------" \ - "---------------" -#define HR_DOUBLE "========================================" \ - "===============" -#define HR_SINGLE2 " ---------------------------------------" \ - "-------------- " -#endif /* * Horizontal Line - width: 65 @@ -114,12 +93,14 @@ __BEGIN_DECLS #define MAX_WIDTH strlen (HR_SINGLE) #define MAX_TITLE ((MAX_WIDTH) - 10) #define POS_MORE ((MAX_WIDTH) - 3) +#define RET_SUCCESS 0 +#define RET_FAILURE -1 typedef struct menu_manager MManager; struct menu_data { - char *key; - char *title; + const char *key; + const char *title; struct menu_data *sub_menu; int (*callback)(MManager *mm, struct menu_data *menu); char *data; @@ -137,6 +118,7 @@ pid_t get_tid (); void hide_pid (); void show_pid (); int is_pid_show (); +void menu_print_dump(int data_len, void *data); __END_DECLS diff --git a/wearable/test_src/modem.c b/test_src/modem.c similarity index 94% rename from wearable/test_src/modem.c rename to test_src/modem.c index 1ddc6fd..aeee6d4 100644 --- a/wearable/test_src/modem.c +++ b/test_src/modem.c @@ -1,7 +1,7 @@ /* - * Telephony test application + * libslp-tapi * - * Copyright (c) 2012 Samsung Electronics Co., Ltd. All rights reserved. + * Copyright (c) 2014 Samsung Electronics Co., Ltd. All rights reserved. * * Contact: Ja-young Gu * @@ -68,7 +68,7 @@ static void on_modem_get_version(TapiHandle *handle, int result, void *data, voi static void on_modem_get_serial_number(TapiHandle *handle, int result, void *data, void *user_data) { - char *sn = data; + TelMiscSNInformation *sn = data; msg(""); msgb("tel_get_misc_me_sn() response receive"); @@ -77,7 +77,9 @@ static void on_modem_get_serial_number(TapiHandle *handle, int result, void *dat if (!sn) return; - msg(" - serial number = %s", sn); + msg(" - esn number = %s", sn->szEsn); + msg(" - meid number = %s", sn->szMeid); + } static void on_modem_get_imei(TapiHandle *handle, int result, void *data, void *user_data) @@ -110,7 +112,7 @@ static void on_modem_set_flight_mode(TapiHandle *handle, int result, void *data, { msg(""); msgb("tel_set_flight_mode() response receive"); - msg(" - result = 0x%x", result); + msg(" - result = %s", (result == 1) ? "ON" : (result == 2) ? "OFF" : "FAIL" ); } static void on_modem_set_power(TapiHandle *handle, int result, void *data, void *user_data) @@ -177,7 +179,7 @@ static int run_modem_get_serial_number(MManager *mm, struct menu_data *menu) static int run_modem_get_serial_number_sync(MManager *mm, struct menu_data *menu) { TapiHandle *handle = menu_manager_ref_user_data(mm); - char *sn; + TelMiscSNInformation *sn; msg("call tel_get_misc_me_sn_sync()"); @@ -187,7 +189,8 @@ static int run_modem_get_serial_number_sync(MManager *mm, struct menu_data *menu return 0; } - msg(" - serial number = [%s]", sn); + msg(" - esn number = [%s]", sn->szEsn); + msg(" - meid number = [%s]", sn->szMeid); free(sn); @@ -341,14 +344,14 @@ static struct menu_data menu_modem_set_flight_mode[] = { }; static struct menu_data menu_modem_set_power[] = { - { "1", "mode (0=OFF, 1=ON, 2=RESET)", NULL, NULL, data_modem_set_power_mode}, + { "1", "mode (0=ON, 1=OFF, 2=RESET, 3=LOW)", NULL, NULL, data_modem_set_power_mode}, { "2", "run", NULL, run_modem_set_power, NULL}, { NULL, NULL, }, }; static struct menu_data menu_modem_check_power[] = { { "1", "run (sync api)", NULL, run_modem_check_power, NULL}, - { "-", "(0 = online, 1 = offline, 2 = error)", NULL, NULL, NULL}, + { "-", "(-1=unknown, 0=on, 1=off, 2=rst, 3=low, 4=err)", NULL, NULL, NULL}, { NULL, NULL, }, }; diff --git a/wearable/test_src/modem.h b/test_src/modem.h similarity index 88% rename from wearable/test_src/modem.h rename to test_src/modem.h index 78ddcf3..155d97f 100644 --- a/wearable/test_src/modem.h +++ b/test_src/modem.h @@ -1,7 +1,7 @@ /* - * Telephony test application + * libslp-tapi * - * Copyright (c) 2012 Samsung Electronics Co., Ltd. All rights reserved. + * Copyright (c) 2014 Samsung Electronics Co., Ltd. All rights reserved. * * Contact: Ja-young Gu * diff --git a/wearable/test_src/network.c b/test_src/network.c similarity index 84% rename from wearable/test_src/network.c rename to test_src/network.c index 0253d4e..3f5106f 100644 --- a/wearable/test_src/network.c +++ b/test_src/network.c @@ -1,7 +1,7 @@ /* - * Telephony test application + * libslp-tapi * - * Copyright (c) 2012 Samsung Electronics Co., Ltd. All rights reserved. + * Copyright (c) 2014 Samsung Electronics Co., Ltd. All rights reserved. * * Contact: Ja-young Gu * @@ -34,12 +34,6 @@ static char data_net_set_plmn_mode_manual_act[MENU_DATA_SIZE + 1] = "4"; static char data_net_set_plmn_mode_manual_plmn[MENU_DATA_SIZE + 1] = "45001"; - -static char data_net_set_service_domain_domain[MENU_DATA_SIZE + 1] = "1"; - -static char data_net_set_band_mode[MENU_DATA_SIZE + 1] = "1"; -static char data_net_set_band_band[MENU_DATA_SIZE + 1] = "5"; - static char data_net_set_preferred_plmn_mode[MENU_DATA_SIZE + 1] = "1"; static char data_net_set_preferred_plmn_plmn[MENU_DATA_SIZE + 1] = "45001"; static char data_net_set_preferred_plmn_type[MENU_DATA_SIZE + 1] = "4"; @@ -157,12 +151,12 @@ static void on_prop_roaming_status (TapiHandle *handle, const char *noti_id, voi static void on_prop_name_option (TapiHandle *handle, const char *noti_id, void *data, void *user_data) { - char *option = data; + int *option = data; msg (""); msgp ("property(%s) receive !!", TAPI_PROP_NETWORK_NAME_OPTION); - msg (" - name_option = %s", option); + msg (" - name_option = %d", *option); } static void on_prop_network_name (TapiHandle *handle, const char *noti_id, void *data, void *user_data) @@ -183,7 +177,7 @@ static void on_prop_spn_name (TapiHandle *handle, const char *noti_id, void *dat static void on_noti_registration_status(TapiHandle *handle, const char *noti_id, void *data, void *user_data) { - struct tel_noti_network_registration_status *noti = data; + TelNetworkRegistrationStatus_t *noti = data; msg (""); msgb ("event(%s) receive !!", TAPI_NOTI_NETWORK_REGISTRATION_STATUS); @@ -214,7 +208,6 @@ static void on_noti_change(TapiHandle *handle, const char *noti_id, void *data, msg (" - plmn = %s", noti->plmn); msg (" - act = %d", noti->act); - msg (" - lac = %d", noti->lac); } static void on_noti_time_info(TapiHandle *handle, const char *noti_id, void *data, void *user_data) @@ -259,6 +252,34 @@ static void on_noti_signal_strength(TapiHandle *handle, const char *noti_id, voi msg (" - dbm = %d", noti->dbm); } +static void on_noti_default_data_subs(TapiHandle *handle, const char *noti_id, void *data, void *user_data) +{ + struct tel_noti_network_default_data_subs *noti = data; + + msg (""); + msgb ("event(%s) receive !!", TAPI_NOTI_NETWORK_DEFAULT_DATA_SUBSCRIPTION); + + if (noti) + msg (" - 'default' Data Subscription = %s", + ((noti->default_subs == TAPI_NETWORK_DEFAULT_DATA_SUBS_SIM1) ? "SIM 1" + : ((noti->default_subs == TAPI_NETWORK_DEFAULT_DATA_SUBS_SIM2) ? "SIM 2" + : "Unknown"))); +} + +static void on_noti_default_subs(TapiHandle *handle, const char *noti_id, void *data, void *user_data) +{ + struct tel_noti_network_default_subs *noti = data; + + msg (""); + msgb ("event(%s) receive !!", TAPI_NOTI_NETWORK_DEFAULT_SUBSCRIPTION); + + if (noti) + msg (" - 'default' Subscription = %s", + ((noti->default_subs == TAPI_NETWORK_DEFAULT_SUBS_SIM1) ? "SIM 1" + : ((noti->default_subs == TAPI_NETWORK_DEFAULT_SUBS_SIM2) ? "SIM 2" + : "Unknown"))); +} + static void on_net_search(TapiHandle *handle, int result, void *data, void *user_data) { TelNetworkPlmnList_t *list = data; @@ -311,44 +332,6 @@ static void on_net_get_plmn_mode(TapiHandle *handle, int result, void *data, voi msg (" - mode = %d", *mode); } -static void on_net_set_service_domain(TapiHandle *handle, int result, void *data, void *user_data) -{ - msg (""); - msgb ("tel_set_network_service_domain() response receive"); - msg (" - result = 0x%x", result); -} - -static void on_net_get_service_domain(TapiHandle *handle, int result, void *data, void *user_data) -{ - int *domain = data; - - msg (""); - msgb ("tel_get_network_service_domain() response receive"); - msg (" - result = 0x%x", result); - - if (data) - msg (" - domain = %d", *domain); -} - -static void on_net_set_band(TapiHandle *handle, int result, void *data, void *user_data) -{ - msg (""); - msgb ("tel_set_network_band() response receive"); - msg (" - result = 0x%x", result); -} - -static void on_net_get_band(TapiHandle *handle, int result, void *data, void *user_data) -{ - int *band = data; - - msg (""); - msgb ("tel_get_network_band() response receive"); - msg (" - result = 0x%x", result); - - if (data) - msg (" - band = %d", *band); -} - static void on_net_set_preferred_plmn(TapiHandle *handle, int result, void *data, void *user_data) { msg (""); @@ -404,7 +387,7 @@ static void on_net_get_serving_network(TapiHandle *handle, int result, void *dat msg (" - plmn = %s", info->plmn); msg (" - access technology = %d", info->act); - msg (" - lac = %d", info->lac); + msg (" - lac = %d", info->info.lac); } static void on_net_set_mode(TapiHandle *handle, int result, void *data, void *user_data) @@ -480,6 +463,18 @@ static void on_net_get_neighboring_cell_info(TapiHandle *handle, int result, voi } } +static void on_net_set_default_data_subscription(TapiHandle *handle, int result, void *data, void *user_data) +{ + msg (""); + msgb ("tel_set_network_default_data_subscription() response receive"); + msg (" - result = 0x%x", result); +} + +static void on_net_set_default_subscription(TapiHandle *handle, int result, void *data, void *user_data) +{ + msg("on_net_set_default_subscription() - result : 0x%x", result); +} + static int run_net_search (MManager *mm, struct menu_data *menu) { TapiHandle *handle = menu_manager_ref_user_data(mm); @@ -545,17 +540,23 @@ static int run_net_get_plmn_mode (MManager *mm, struct menu_data *menu) return 0; } -static int run_net_set_service_domain (MManager *mm, struct menu_data *menu) +static int run_net_set_preferred_plmn (MManager *mm, struct menu_data *menu) { TapiHandle *handle = menu_manager_ref_user_data(mm); int result; - int domain; + int operation; + TelNetworkPreferredPlmnInfo_t info; - msg ("call tel_set_network_service_domain()"); + msg ("call tel_set_network_preferred_plmn()"); + + memset(&info, 0, sizeof(TelNetworkPreferredPlmnInfo_t)); - domain = atoi(data_net_set_service_domain_domain); + operation = atoi(data_net_set_preferred_plmn_mode); + info.Index = atoi(data_net_set_preferred_plmn_ef_index); + info.SystemType = atoi(data_net_set_preferred_plmn_type); + strncpy(info.Plmn, data_net_set_preferred_plmn_plmn, 6); - result = tel_set_network_service_domain (handle, domain, on_net_set_service_domain, NULL); + result = tel_set_network_preferred_plmn (handle, operation, &info, on_net_set_preferred_plmn, NULL); if (result != TAPI_API_SUCCESS) { msg ("failed. (result = %d)", result); } @@ -563,14 +564,14 @@ static int run_net_set_service_domain (MManager *mm, struct menu_data *menu) return 0; } -static int run_net_get_service_domain (MManager *mm, struct menu_data *menu) +static int run_net_get_preferred_plmn (MManager *mm, struct menu_data *menu) { TapiHandle *handle = menu_manager_ref_user_data(mm); int result; - msg ("call tel_get_network_service_domain()"); + msg ("call tel_get_network_preferred_plmn()"); - result = tel_get_network_service_domain (handle, on_net_get_service_domain, NULL); + result = tel_get_network_preferred_plmn (handle, on_net_get_preferred_plmn, NULL); if (result != TAPI_API_SUCCESS) { msg ("failed. (result = %d)", result); } @@ -578,19 +579,14 @@ static int run_net_get_service_domain (MManager *mm, struct menu_data *menu) return 0; } -static int run_net_set_band (MManager *mm, struct menu_data *menu) +static int run_net_set_cancel_manual_search (MManager *mm, struct menu_data *menu) { TapiHandle *handle = menu_manager_ref_user_data(mm); int result; - int mode; - int band; - msg ("call tel_set_network_band()"); - - mode = atoi(data_net_set_band_mode); - band = atoi(data_net_set_band_band); + msg ("call tel_cancel_network_manual_search()"); - result = tel_set_network_band (handle, mode, band, on_net_set_band, NULL); + result = tel_cancel_network_manual_search (handle, on_net_set_cancel_manual_search, NULL); if (result != TAPI_API_SUCCESS) { msg ("failed. (result = %d)", result); } @@ -598,14 +594,14 @@ static int run_net_set_band (MManager *mm, struct menu_data *menu) return 0; } -static int run_net_get_band (MManager *mm, struct menu_data *menu) +static int run_net_get_serving_network (MManager *mm, struct menu_data *menu) { TapiHandle *handle = menu_manager_ref_user_data(mm); int result; - msg ("call tel_get_network_band()"); + msg ("call tel_get_network_serving()"); - result = tel_get_network_band (handle, on_net_get_band, NULL); + result = tel_get_network_serving (handle, on_net_get_serving_network, NULL); if (result != TAPI_API_SUCCESS) { msg ("failed. (result = %d)", result); } @@ -613,23 +609,17 @@ static int run_net_get_band (MManager *mm, struct menu_data *menu) return 0; } -static int run_net_set_preferred_plmn (MManager *mm, struct menu_data *menu) +static int run_net_set_mode (MManager *mm, struct menu_data *menu) { TapiHandle *handle = menu_manager_ref_user_data(mm); int result; - int operation; - TelNetworkPreferredPlmnInfo_t info; - - msg ("call tel_set_network_preferred_plmn()"); + int mode; - memset(&info, 0, sizeof(TelNetworkPreferredPlmnInfo_t)); + msg ("call tel_set_network_mode()"); - operation = atoi(data_net_set_preferred_plmn_mode); - info.Index = atoi(data_net_set_preferred_plmn_ef_index); - info.SystemType = atoi(data_net_set_preferred_plmn_type); - strncpy(info.Plmn, data_net_set_preferred_plmn_plmn, 6); + mode = atoi(data_net_set_mode_mode); - result = tel_set_network_preferred_plmn (handle, operation, &info, on_net_set_preferred_plmn, NULL); + result = tel_set_network_mode (handle, mode, on_net_set_mode, NULL); if (result != TAPI_API_SUCCESS) { msg ("failed. (result = %d)", result); } @@ -637,14 +627,14 @@ static int run_net_set_preferred_plmn (MManager *mm, struct menu_data *menu) return 0; } -static int run_net_get_preferred_plmn (MManager *mm, struct menu_data *menu) +static int run_net_get_mode (MManager *mm, struct menu_data *menu) { TapiHandle *handle = menu_manager_ref_user_data(mm); int result; - msg ("call tel_get_network_preferred_plmn()"); + msg ("call tel_get_network_mode()"); - result = tel_get_network_preferred_plmn (handle, on_net_get_preferred_plmn, NULL); + result = tel_get_network_mode (handle, on_net_get_mode, NULL); if (result != TAPI_API_SUCCESS) { msg ("failed. (result = %d)", result); } @@ -652,14 +642,14 @@ static int run_net_get_preferred_plmn (MManager *mm, struct menu_data *menu) return 0; } -static int run_net_set_cancel_manual_search (MManager *mm, struct menu_data *menu) +static int run_net_get_neighboring_cell_info (MManager *mm, struct menu_data *menu) { TapiHandle *handle = menu_manager_ref_user_data(mm); int result; - msg ("call tel_cancel_network_manual_search()"); + msg ("call tel_get_network_neighboring_cell_info()"); - result = tel_cancel_network_manual_search (handle, on_net_set_cancel_manual_search, NULL); + result = tel_get_network_neighboring_cell_info (handle, on_net_get_neighboring_cell_info, NULL); if (result != TAPI_API_SUCCESS) { msg ("failed. (result = %d)", result); } @@ -667,14 +657,14 @@ static int run_net_set_cancel_manual_search (MManager *mm, struct menu_data *men return 0; } -static int run_net_get_serving_network (MManager *mm, struct menu_data *menu) +static int run_net_set_default_data_subscription (MManager *mm, struct menu_data *menu) { TapiHandle *handle = menu_manager_ref_user_data(mm); int result; - msg ("call tel_get_network_serving()"); + msg ("call tel_set_network_default_data_subscription()"); - result = tel_get_network_serving (handle, on_net_get_serving_network, NULL); + result = tel_set_network_default_data_subscription (handle, on_net_set_default_data_subscription, NULL); if (result != TAPI_API_SUCCESS) { msg ("failed. (result = %d)", result); } @@ -682,52 +672,64 @@ static int run_net_get_serving_network (MManager *mm, struct menu_data *menu) return 0; } -static int run_net_set_mode (MManager *mm, struct menu_data *menu) +static int run_net_get_default_data_subscription (MManager *mm, struct menu_data *menu) { - TapiHandle *handle = menu_manager_ref_user_data(mm); - int result; - int mode; + TapiHandle *handle = menu_manager_ref_user_data (mm); + TelNetworkDefaultDataSubs_t default_subs = TAPI_NETWORK_DEFAULT_DATA_SUBS_UNKNOWN; + int result = 0; - msg ("call tel_set_network_mode()"); - - mode = atoi(data_net_set_mode_mode); + msg ("call tel_get_network_default_data_subscription()"); - result = tel_set_network_mode (handle, mode, on_net_set_mode, NULL); + result = tel_get_network_default_data_subscription (handle, &default_subs); if (result != TAPI_API_SUCCESS) { - msg ("failed. (result = %d)", result); + msg("api call failed with[0x%x]", result); + return 0; } + msg("'default' Data Subscription = %s", + ((default_subs == TAPI_NETWORK_DEFAULT_DATA_SUBS_SIM1) ? "SIM 1" + : ((default_subs == TAPI_NETWORK_DEFAULT_DATA_SUBS_SIM2) ? "SIM 2" + : "Unknown"))); + return 0; } -static int run_net_get_mode (MManager *mm, struct menu_data *menu) + +static int run_net_set_default_subscription(MManager *mm, struct menu_data *menu) { TapiHandle *handle = menu_manager_ref_user_data(mm); - int result; + int result = 0; - msg ("call tel_get_network_mode()"); + msg("call tel_set_network_default_subscription()"); - result = tel_get_network_mode (handle, on_net_get_mode, NULL); + result = tel_set_network_default_subscription(handle, on_net_set_default_subscription, NULL); if (result != TAPI_API_SUCCESS) { - msg ("failed. (result = %d)", result); + msg("failed. (result = %d)", result); } - return 0; + return result; } -static int run_net_get_neighboring_cell_info (MManager *mm, struct menu_data *menu) +static int run_net_get_default_subscription(MManager *mm, struct menu_data *menu) { TapiHandle *handle = menu_manager_ref_user_data(mm); - int result; + int result = 0; + TelNetworkDefaultSubs_t default_subs = TAPI_NETWORK_DEFAULT_SUBS_UNKNOWN; - msg ("call tel_get_network_neighboring_cell_info()"); + msg("call tel_get_network_default_subscription()"); - result = tel_get_network_neighboring_cell_info (handle, on_net_get_neighboring_cell_info, NULL); + result = tel_get_network_default_subscription(handle, &default_subs); if (result != TAPI_API_SUCCESS) { - msg ("failed. (result = %d)", result); + msg("failed. (result = %d)", result); + return 0; } - return 0; + msg("'default' Subscription for CS (Voice) = %s", + ((default_subs == TAPI_NETWORK_DEFAULT_SUBS_SIM1) ? "SIM 1" + : ((default_subs == TAPI_NETWORK_DEFAULT_SUBS_SIM2) ? "SIM 2" + : "Unknown"))); + + return result; } static int show_properties (MManager *mm, struct menu_data *menu) @@ -742,9 +744,9 @@ static int show_properties (MManager *mm, struct menu_data *menu) ps = -1, roam = -1, sig_dbm = -1, - sig_level = -1; + sig_level = -1, + option = -1; char *plmn = NULL, - *option = NULL, *n_name = NULL, *s_name = NULL; @@ -759,7 +761,7 @@ static int show_properties (MManager *mm, struct menu_data *menu) tel_get_property_int (handle, TAPI_PROP_NETWORK_SIGNALSTRENGTH_DBM, &sig_dbm); tel_get_property_int (handle, TAPI_PROP_NETWORK_SIGNALSTRENGTH_LEVEL, &sig_level); tel_get_property_int (handle, TAPI_PROP_NETWORK_ROAMING_STATUS, &roam); - tel_get_property_string (handle, TAPI_PROP_NETWORK_NAME_OPTION, &option); + tel_get_property_int (handle, TAPI_PROP_NETWORK_NAME_OPTION, &option); tel_get_property_string (handle, TAPI_PROP_NETWORK_NETWORK_NAME, &n_name); tel_get_property_string (handle, TAPI_PROP_NETWORK_SPN_NAME, &s_name); @@ -768,7 +770,7 @@ static int show_properties (MManager *mm, struct menu_data *menu) " [service_type]: %d [act]: %d [plmn]: \"%s\"\n" " [ps_type]: %d [cs_status]: %d [ps_status]: %d\n" " [sig_dbm]: %d [sig_level]: %d [roaming_status]: %d\n" - " [option]: \"%s\" [network_name]: \"%s\" [spn_name]: \"%s\"", + " [option]: %d [network_name]: \"%s\" [spn_name]: \"%s\"", lac, cellid, svc_type, act, plmn, ps_type, cs, ps, @@ -776,7 +778,6 @@ static int show_properties (MManager *mm, struct menu_data *menu) option, n_name, s_name); g_free (plmn); - g_free (option); g_free (n_name); g_free (s_name); @@ -805,32 +806,6 @@ static struct menu_data menu_net_get_plmn_mode[] = { { NULL, NULL, }, }; - -static struct menu_data menu_net_set_service_domain[] = { - { "1", "domain (1=combined, 2=cs, 3=ps)", NULL, NULL, data_net_set_service_domain_domain}, - { "2", "run", NULL, run_net_set_service_domain, NULL}, - { NULL, NULL, }, -}; - -static struct menu_data menu_net_get_service_domain[] = { - { "1", "run", NULL, run_net_get_service_domain, NULL}, - { NULL, NULL, }, -}; - - -static struct menu_data menu_net_set_band[] = { - { "1", "mode (1=preferred, 2=only)", NULL, NULL, data_net_set_band_mode}, - { "2", "band (1=GSM850, 2=GSM900_1800, 3=GSM1900, 4=GSM, 5=WCDMA, 6=WCDMA850, ...)", NULL, NULL, data_net_set_band_band}, - { "3", "run", NULL, run_net_set_band, NULL}, - { NULL, NULL, }, -}; - -static struct menu_data menu_net_get_band[] = { - { "1", "run", NULL, run_net_get_band, NULL}, - { NULL, NULL, }, -}; - - static struct menu_data menu_net_set_preferred_plmn[] = { { "1", "mode (1=add, 2=edit, 3=delete)", NULL, NULL, data_net_set_preferred_plmn_mode}, { "2", "plmn (45001)", NULL, NULL, data_net_set_preferred_plmn_plmn}, @@ -873,15 +848,31 @@ static struct menu_data menu_net_get_neighboring_cell_info[] = { { NULL, NULL, }, }; +static struct menu_data menu_net_set_default_data_subscription[] = { + { "1", "run", NULL, run_net_set_default_data_subscription, NULL}, + { NULL, NULL, }, +}; + +static struct menu_data menu_net_get_default_data_subscription[] = { + { "1", "run", NULL, run_net_get_default_data_subscription, NULL}, + { NULL, NULL, }, +}; + +static struct menu_data menu_net_set_default_subscription[] = { + { "1", "run", 0, run_net_set_default_subscription, 0}, + { 0, 0, }, +}; + +static struct menu_data menu_net_get_default_subscription[] = { + { "1", "run", 0, run_net_get_default_subscription, 0}, + { 0, 0, }, +}; + struct menu_data menu_net[] = { { "1", "Search", menu_net_search, NULL, NULL}, { "2a", "SET PLMN Selection mode (Automatic)", menu_net_set_plmn_mode_automatic, NULL, NULL}, { "2s", "SET PLMN Selection mode (Manual)", menu_net_set_plmn_mode_manual, NULL, NULL}, { "2g", "GET PLMN Selection mode", menu_net_get_plmn_mode, NULL, NULL}, - { "3s", "SET Service Domain", menu_net_set_service_domain, NULL, NULL}, - { "3g", "GET Service Domain", menu_net_get_service_domain, NULL, NULL}, - { "4s", "SET Band", menu_net_set_band, NULL, NULL}, - { "4g", "GET Band", menu_net_get_band, NULL, NULL}, { "5s", "SET Preferred PLMN", menu_net_set_preferred_plmn, NULL, NULL}, { "5g", "GET Preferred PLMN", menu_net_get_preferred_plmn, NULL, NULL}, { "6", "SET Cancel manual search", menu_net_set_cancel_manual_search, NULL, NULL}, @@ -889,6 +880,10 @@ struct menu_data menu_net[] = { { "8s", "SET Mode", menu_net_set_mode, NULL, NULL}, { "8g", "GET Mode", menu_net_get_mode, NULL, NULL}, { "9g", "GET Neighboring Cell Info", menu_net_get_neighboring_cell_info, NULL, NULL}, + { "10", "SET Default Data Subscription", menu_net_set_default_data_subscription, NULL, NULL}, + { "11", "GET Default Data Subscription", menu_net_get_default_data_subscription, NULL, NULL}, + { "12", "SET Default Subscription (for Voice)", menu_net_set_default_subscription, 0, 0}, + { "13", "GET Default Subscription (for Voice)", menu_net_get_default_subscription, 0, 0}, { "*", "", NULL, show_properties, NULL }, { NULL, NULL, }, }; @@ -935,6 +930,18 @@ void register_network_event (TapiHandle *handle) msg("event register failed(%d)", ret); } + ret = tel_register_noti_event (handle, + TAPI_NOTI_NETWORK_DEFAULT_DATA_SUBSCRIPTION, on_noti_default_data_subs, NULL); + if (ret != TAPI_API_SUCCESS) { + msg("event register failed(%d)", ret); + } + + ret = tel_register_noti_event (handle, + TAPI_NOTI_NETWORK_DEFAULT_SUBSCRIPTION, on_noti_default_subs, NULL); + if (ret != TAPI_API_SUCCESS) { + msg("event register failed(%d)", ret); + } + /* Property */ ret = tel_register_noti_event (handle, TAPI_PROP_NETWORK_SIGNALSTRENGTH_DBM, on_prop_signal_dbm, NULL); diff --git a/wearable/test_src/network.h b/test_src/network.h similarity index 88% rename from wearable/test_src/network.h rename to test_src/network.h index 51fc06e..4f74949 100644 --- a/wearable/test_src/network.h +++ b/test_src/network.h @@ -1,7 +1,7 @@ /* - * Telephony test application + * libslp-tapi * - * Copyright (c) 2012 Samsung Electronics Co., Ltd. All rights reserved. + * Copyright (c) 2014 Samsung Electronics Co., Ltd. All rights reserved. * * Contact: Ja-young Gu * diff --git a/wearable/test_src/phonebook.c b/test_src/phonebook.c similarity index 92% rename from wearable/test_src/phonebook.c rename to test_src/phonebook.c index b021663..8a601ef 100644 --- a/wearable/test_src/phonebook.c +++ b/test_src/phonebook.c @@ -1,7 +1,7 @@ /* - * Telephony test application + * libslp-tapi * - * Copyright (c) 2012 Samsung Electronics Co., Ltd. All rights reserved. + * Copyright (c) 2014 Samsung Electronics Co., Ltd. All rights reserved. * * Contact: Ja-young Gu * @@ -41,17 +41,17 @@ }\ } -static char* dbg_pb_type_name[] = { "TAPI_SIM_PB_FDN", "TAPI_SIM_PB_ADN", "TAPI_SIM_PB_SDN", +static const char* dbg_pb_type_name[] = { "TAPI_SIM_PB_FDN", "TAPI_SIM_PB_ADN", "TAPI_SIM_PB_SDN", "TAPI_SIM_PB_3GSIM", "TAPI_SIM_PB_AAS", "TAPI_SIM_PB_GAS", }; -static char* dbg_pb_adf_field_name[] = { "NO VALUE 0", "TAPI_PB_3G_NAME", "TAPI_PB_3G_NUMBER", +static const char* dbg_pb_adf_field_name[] = { "NO VALUE 0", "TAPI_PB_3G_NAME", "TAPI_PB_3G_NUMBER", "TAPI_PB_3G_ANR1", "TAPI_PB_3G_ANR2", "TAPI_PB_3G_ANR3", "TAPI_PB_3G_EMAIL1", "TAPI_PB_3G_EMAIL2", "TAPI_PB_3G_EMAIL3", "TAPI_PB_3G_EMAIL4", "TAPI_PB_3G_SNE", "TAPI_PB_3G_GRP", "TAPI_PB_3G_PBC" }; -static char* dbg_pb_ton_name[] = { "TAPI_SIM_TON_UNKNOWN", "TAPI_SIM_TON_INTERNATIONAL", +static const char* dbg_pb_ton_name[] = { "TAPI_SIM_TON_UNKNOWN", "TAPI_SIM_TON_INTERNATIONAL", "TAPI_SIM_TON_NATIONAL", "TAPI_SIM_TON_NETWORK_SPECIFIC", "TAPI_SIM_TON_DEDICATED_ACCESS", "TAPI_SIM_TON_ALPHA_NUMERIC", "TAPI_SIM_TON_ABBREVIATED_NUMBER", "TAPI_SIM_TON_RESERVED_FOR_EXT", }; -static char* dbg_pb_dcs_name[] = { "TAPI_SIM_TEXT_ENC_ASCII", "TAPI_SIM_TEXT_ENC_GSM7BIT", +static const char* dbg_pb_dcs_name[] = { "TAPI_SIM_TEXT_ENC_ASCII", "TAPI_SIM_TEXT_ENC_GSM7BIT", "TAPI_SIM_TEXT_ENC_UCS2", "TAPI_SIM_TEXT_ENC_HEX", }; static char data_pb_type[MENU_DATA_SIZE + 1] = {}; @@ -276,12 +276,13 @@ static int run_pb_read_sim_pb_record(MManager *mm, struct menu_data *menu) TapiHandle *handle = menu_manager_ref_user_data(mm); TelSimPbType_t pb_type = TAPI_SIM_PB_UNKNOWNN; int rt = 0; - int index = 0; + int local_index = 0; - pb_type = data_pb_type[0] - '0'; - index = data_pb_index[0] -'0'; - msg("request pb [%d], index[%d]", pb_type, index); - rt = tel_read_sim_pb_record(handle, pb_type, index, on_pb_read_sim_pb_record, NULL); + pb_type = atoi(data_pb_type); + local_index = atoi(data_pb_index); + + msg("request pb [%d], local_index[%d]", pb_type, local_index); + rt = tel_read_sim_pb_record(handle, pb_type, local_index, on_pb_read_sim_pb_record, NULL); CHECK_RT(rt); return 0; } @@ -302,12 +303,12 @@ static int run_pb_update_sim_pb_record(MManager *mm, struct menu_data *menu) memset(&pb, 0, sizeof(TelSimPbRecord_t)); - pb.phonebook_type = data_pb_type[0] - '0'; - pb.index = data_pb_index[0] - '0'; + pb.phonebook_type = atoi(data_pb_type); + pb.index = atoi(data_pb_index); snprintf((char*)pb.name, strlen(data_pb_name)+1, "%s", data_pb_name); - pb.dcs = data_pb_dcs[0] - '0'; + pb.dcs = atoi(data_pb_dcs); snprintf((char*)pb.number, strlen(data_pb_number)+1, "%s", data_pb_number); - pb.ton = data_pb_ton[0] - '0'; + pb.ton = atoi(data_pb_ton); if (pb.phonebook_type == TAPI_SIM_PB_3GSIM) { snprintf((char*)pb.anr1, strlen(data_pb_anr1) + 1, "%s", data_pb_anr1); @@ -348,12 +349,13 @@ static int run_pb_delete_sim_pb_record(MManager *mm, struct menu_data *menu) TapiHandle *handle = menu_manager_ref_user_data(mm); TelSimPbType_t pb_type = TAPI_SIM_PB_UNKNOWNN; int rt = 0; - int index = 0; + int local_index = 0; - pb_type = data_pb_type[0] - '0'; - index = data_pb_index[0] -'0'; - msg("request pb [%d], index[%d]", pb_type, index); - rt = tel_delete_sim_pb_record(handle, pb_type, index, on_pb_delete_sim_pb_record, NULL); + pb_type = atoi(data_pb_type); + local_index = atoi(data_pb_index); + + msg("request pb [%d], local_index[%d]", pb_type, local_index); + rt = tel_delete_sim_pb_record(handle, pb_type, local_index, on_pb_delete_sim_pb_record, NULL); CHECK_RT(rt); return 0; } diff --git a/wearable/test_src/phonebook.h b/test_src/phonebook.h similarity index 88% rename from wearable/test_src/phonebook.h rename to test_src/phonebook.h index 36878af..6ce59aa 100644 --- a/wearable/test_src/phonebook.h +++ b/test_src/phonebook.h @@ -1,7 +1,7 @@ /* - * Telephony test application + * libslp-tapi * - * Copyright (c) 2012 Samsung Electronics Co., Ltd. All rights reserved. + * Copyright (c) 2014 Samsung Electronics Co., Ltd. All rights reserved. * * Contact: Ja-young Gu * diff --git a/wearable/test_src/sat.c b/test_src/sat.c similarity index 86% rename from wearable/test_src/sat.c rename to test_src/sat.c index abfbb8f..db8638c 100644 --- a/wearable/test_src/sat.c +++ b/test_src/sat.c @@ -1,7 +1,7 @@ /* - * Telephony test application + * libslp-tapi * - * Copyright (c) 2012 Samsung Electronics Co., Ltd. All rights reserved. + * Copyright (c) 2014 Samsung Electronics Co., Ltd. All rights reserved. * * Contact: Ja-young Gu * @@ -36,7 +36,7 @@ TelSatSetupMenuInfo_t main_menu; static void on_noti_setup_menu(TapiHandle *handle, const char *noti_id, void *data, void *user_data) { - int index; + int local_index; TelSatSetupMenuInfo_t *setup_menu = NULL; msg("noti id (%s)", noti_id); @@ -51,8 +51,8 @@ static void on_noti_setup_menu(TapiHandle *handle, const char *noti_id, void *da msg("menu present (%d)", setup_menu->bIsMainMenuPresent); msg("menu title (%s)", setup_menu->satMainTitle); msg("item cnt (%d)", setup_menu->satMainMenuNum); - for(index=0;index < setup_menu->satMainMenuNum; index++){ - msg("item id(%d) (%s)", setup_menu->satMainMenuItem[index].itemId, setup_menu->satMainMenuItem[index].itemString); + for(local_index=0;local_index < setup_menu->satMainMenuNum; local_index++){ + msg("item id(%d) (%s)", setup_menu->satMainMenuItem[local_index].itemId, setup_menu->satMainMenuItem[local_index].itemString); } msg("menu help info (%d)", setup_menu->bIsSatMainMenuHelpInfo); msg("menu updated (%d)", setup_menu->bIsUpdatedSatMainMenu); @@ -81,7 +81,7 @@ static void on_noti_display_text(TapiHandle *handle, const char *noti_id, void * static void on_noti_select_item(TapiHandle *handle, const char *noti_id, void *data, void *user_data) { - int index; + int local_index; TelSatSelectItemInd_t *select_item = NULL; msg("noti id (%s)", noti_id); @@ -97,11 +97,11 @@ static void on_noti_select_item(TapiHandle *handle, const char *noti_id, void *d msg("help info(%d)", select_item->bIsHelpInfoAvailable); msg("selected item string(%s)", select_item->text.string); msg("string len(%d)", select_item->text.stringLen); - msg("default item index(%d)", select_item->defaultItemIndex); + msg("default item local_index(%d)", select_item->defaultItemIndex); msg("item count(%d)", select_item->menuItemCount); - for(index=0;index < select_item->menuItemCount; index++){ - msg("item index(%d) id(%d) len(%d) str(%s)", index, - select_item->menuItem[index].itemId, select_item->menuItem[index].textLen, select_item->menuItem[index].text); + for(local_index=0;local_index < select_item->menuItemCount; local_index++){ + msg("item local_index(%d) id(%d) len(%d) str(%s)", local_index, + select_item->menuItem[local_index].itemId, select_item->menuItem[local_index].textLen, select_item->menuItem[local_index].text); } } @@ -131,13 +131,13 @@ static int run_sat_select_menu(MManager *mm, struct menu_data *menu) { TapiHandle *handle = menu_manager_ref_user_data(mm); TelSatMenuSelectionReqInfo_t selected_menu; - int result, index=0; + int result, local_index=0; int item_id; msg("call select menu()"); - for(index=0;index < main_menu.satMainMenuNum; index++){ - msg("item id(%d) (%s)", main_menu.satMainMenuItem[index].itemId, main_menu.satMainMenuItem[index].itemString); + for(local_index=0;local_index < main_menu.satMainMenuNum; local_index++){ + msg("item id(%d) (%s)", main_menu.satMainMenuItem[local_index].itemId, main_menu.satMainMenuItem[local_index].itemString); } msg("select item >>> "); if (scanf("%d", &item_id) < 0) { diff --git a/wearable/test_src/sat.h b/test_src/sat.h similarity index 88% rename from wearable/test_src/sat.h rename to test_src/sat.h index 9d6924d..2cc1e97 100644 --- a/wearable/test_src/sat.h +++ b/test_src/sat.h @@ -1,7 +1,7 @@ /* - * Telephony test application + * libslp-tapi * - * Copyright (c) 2012 Samsung Electronics Co., Ltd. All rights reserved. + * Copyright (c) 2014 Samsung Electronics Co., Ltd. All rights reserved. * * Contact: Ja-young Gu * diff --git a/wearable/test_src/sim.c b/test_src/sim.c old mode 100755 new mode 100644 similarity index 84% rename from wearable/test_src/sim.c rename to test_src/sim.c index 5fecb42..733108e --- a/wearable/test_src/sim.c +++ b/test_src/sim.c @@ -1,7 +1,7 @@ /* - * Telephony test application + * libslp-tapi * - * Copyright (c) 2012 Samsung Electronics Co., Ltd. All rights reserved. + * Copyright (c) 2014 Samsung Electronics Co., Ltd. All rights reserved. * * Contact: Ja-young Gu * @@ -49,6 +49,8 @@ } static char data_sim_set_language[MENU_DATA_SIZE + 1] = { 0x01, }; +static char data_sim_set_state[MENU_DATA_SIZE + 1] = { 0x01, }; + static char data_sim_set_cf_b_cphs[MENU_DATA_SIZE + 1] = { }; static char data_sim_set_cf_rec_index[MENU_DATA_SIZE + 1] = { }; @@ -120,8 +122,6 @@ static char data_sim_get_lock_type[MENU_DATA_SIZE + 1] = "1"; static char data_sim_transmit_apdu_apdu[MENU_DATA_SIZE + 1] = "0070000000"; -static char data_sim_op_type[MENU_DATA_SIZE + 1] = "1"; - static int _sim_str_to_hex (char a) { int ret = 0; @@ -144,6 +144,16 @@ static void on_noti_sim_status (TapiHandle *handle, const char *noti_id, msg("status[%d]", *status); } +static void on_noti_sim_cf_state(TapiHandle *handle, const char *noti_id, + void *data, void *user_data) +{ + int *status = data; + msg(""); + msgp ("property(%s) receive !!", TAPI_PROP_SIM_CALL_FORWARD_STATE); + if(status) + msg("status[%d]", *status); +} + static int run_sim_get_init_info (MManager *mm, struct menu_data *menu) { TapiHandle *handle = menu_manager_ref_user_data (mm); @@ -850,7 +860,12 @@ static void on_sim_security_op_resp (TapiHandle *handle, int result, void *data, msg("TAPI_SERVICE_SIM security response received"); - CHECK_ACCESS_RT(sec_rt); + if (sec_rt == TAPI_SIM_PIN_INCORRECT_PASSWORD || + sec_rt == TAPI_SIM_PUK_INCORRECT_PASSWORD) { + msg("SIM operation: Password Incorrect[%d]",sec_rt); + } else { + CHECK_ACCESS_RT(sec_rt); + } msg("sec_rt[%d]", sec_rt); msg("rt->type[%d]", rt->type); @@ -945,7 +960,12 @@ static void on_sim_facility_op_resp (TapiHandle *handle, int result, void *data, msg("TAPI_SERVICE_SIM facility response received"); - CHECK_ACCESS_RT(sec_rt); + if (sec_rt == TAPI_SIM_PIN_INCORRECT_PASSWORD || + sec_rt == TAPI_SIM_PUK_INCORRECT_PASSWORD) { + msg("SIM operation: Password Incorrect[%d]",sec_rt); + } else { + CHECK_ACCESS_RT(sec_rt); + } msg("sec_rt[%d]", sec_rt); msg("f_rt->type[%d]", f_rt->type); @@ -1204,246 +1224,32 @@ static int run_sim_get_atr(MManager *mm, struct menu_data *menu) return 0; } -static int run_sim_request_sync (MManager *mm, struct menu_data *menu) -{ - TapiHandle *handle = menu_manager_ref_user_data (mm); - int rt = 0; - TelSimResponseData_t outparam; - TelSimRequestData_t inparam; - int i = 0; - unsigned char op = 0; - - memset (&outparam, 0, sizeof(TelSimResponseData_t)); - memset (&inparam, 0, sizeof(TelSimRequestData_t)); - - msg("call [%s] tapi service !!!", menu->title); - - if (strlen(data_sim_op_type) == 1) { - op = data_sim_op_type[0] - '0'; - } else { - op = ((data_sim_op_type[0] - '0') * 10) + (data_sim_op_type[1] - '0'); - } - msg("op = [%d]\n", op); - - switch(op) { - case TAPI_SIM_GET_IMSI: - rt = tel_request_sim_sync(handle, op, NULL, &outparam); - msg("mcc[%s]", outparam.imsi_info.szMcc); - msg("mnc[%s]", outparam.imsi_info.szMnc); - msg("msin[%s]", outparam.imsi_info.szMsin); - break; - case TAPI_SIM_GET_ICCID: - rt = tel_request_sim_sync(handle, op, NULL, &outparam); - msg("iccid length[%d]", outparam.iccid_info.icc_length); - msg("iccid[%s]", outparam.iccid_info.icc_num); - break; - case TAPI_SIM_GET_INIT_STATUS: - rt = tel_request_sim_sync(handle, op, NULL, &outparam); - msg("status[%d]", outparam.init_info.card_status); - msg("new_sim[%d]", outparam.init_info.b_is_changed); - break; - case TAPI_SIM_GET_MSISDN: - rt = tel_request_sim_sync(handle, op, NULL, &outparam); - msg("list->count[%d]", outparam.msisdn_list.count); - for (i = 0; i < outparam.msisdn_list.count; i++) - msg("index[%d] - name[%s], num[%s]", i, outparam.msisdn_list.list[i].name, - outparam.msisdn_list.list[i].num); - break; - case TAPI_SIM_GET_SPN: - rt = tel_request_sim_sync(handle, op, NULL, &outparam); - msg("spn name[%s]", outparam.spn.spn); - msg("spn condition[0x%x]", outparam.spn.display_condition); - break; - case TAPI_SIM_GET_CPHS_NET_NAME: - rt = tel_request_sim_sync(handle, op, NULL, &outparam); - msg("cphs full name[%s]", outparam.cphs_netname.full_name); - msg("cphs short name[%s]", outparam.cphs_netname.short_name); - break; - case TAPI_SIM_TRANSFER_APDU: { - unsigned char result_apdu[MENU_DATA_SIZE + 1] = { 0, }; - int i = 0, j = 0, len = 0, hex = 0; - len = strlen (data_sim_transmit_apdu_apdu); - for (i = 0, j = 0; i < len; i += 2, j++) { - hex = (_sim_str_to_hex (data_sim_transmit_apdu_apdu[i]) << 4) - | (_sim_str_to_hex (data_sim_transmit_apdu_apdu[i + 1])); - printf ("0x%x\n", hex); - - result_apdu[j] = hex; - } - for (i = 0; i < len / 2; i++) { - printf ("[%02d] = 0x%02x\n", i, result_apdu[i]); - } - inparam.apdu.apdu_len = len / 2; - inparam.apdu.apdu = (unsigned char*) calloc (inparam.apdu.apdu_len, 1); - if(inparam.apdu.apdu != NULL) { - memcpy (inparam.apdu.apdu, result_apdu, inparam.apdu.apdu_len); - rt = tel_request_sim_sync(handle, op, &inparam, &outparam); - free(inparam.apdu.apdu); - } else { - msg("Memory allocation failed"); - } - - msg("outparam.apdu_resp.apdu_resp_len[%d]", outparam.apdu_resp.apdu_resp_len); - if (outparam.apdu_resp.apdu_resp_len) { - for (i = 0; i < outparam.apdu_resp.apdu_resp_len; i++) - msg("[%d]`s byte is [0x%x]", i, outparam.apdu_resp.apdu_resp[i]); - } - - } break; - case TAPI_SIM_GET_ATR: - rt = tel_request_sim_sync(handle, op, NULL, &outparam); - msg("r_atr->atr_resp_len[%d]", outparam.atr_resp.atr_resp_len); - if (outparam.atr_resp.atr_resp_len) { - for (i = 0; i < outparam.atr_resp.atr_resp_len; i++) - msg("[%d]`s byte is [0x%x]", i, outparam.atr_resp.atr_resp[i]); - } - break; - - default: - break; - } - - CHECK_RT(rt); - - return 0; -} - -static void on_sim_request_async (TapiHandle *handle, int result, void *data, +static void on_sim_set_power_state (TapiHandle *handle, int result, void *data, void *user_data) { - TelSimAccessResult_t access_rt = result; - TelSimResponseData_t *resp = data; - TelSimTapiOperation_t *op = user_data; - int i = 0; - - msg("tel_sim_request_async() response received"); - msg("access_rt[%d]", access_rt); - CHECK_ACCESS_RT(access_rt); - - if(!op) - return; - - switch(*op) { - case TAPI_SIM_GET_INIT_STATUS: - msg("status[%d]", resp->init_info.card_status); - msg("new_sim[%d]", resp->init_info.b_is_changed); - break; - case TAPI_SIM_GET_IMSI: - msg("mcc[%s]", resp->imsi_info.szMcc); - msg("mnc[%s]", resp->imsi_info.szMnc); - msg("msin[%s]", resp->imsi_info.szMsin); - break; - case TAPI_SIM_GET_ICCID: - msg("iccid length[%d]", resp->iccid_info.icc_length); - msg("iccid[%s]", resp->iccid_info.icc_num); - break; - case TAPI_SIM_GET_MSISDN: - msg("list->count[%d]", resp->msisdn_list.count); - for (i = 0; i < resp->msisdn_list.count; i++) - msg("index[%d] - name[%s], num[%s]", i, resp->msisdn_list.list[i].name, - resp->msisdn_list.list[i].num); - break; - case TAPI_SIM_GET_SPN: - msg("spn name[%s]", resp->spn.spn); - msg("spn condition[0x%x]", resp->spn.display_condition); - break; - case TAPI_SIM_GET_CPHS_NET_NAME: - msg("cphs full name[%s]", resp->cphs_netname.full_name); - msg("cphs short name[%s]", resp->cphs_netname.short_name); - break; - case TAPI_SIM_TRANSFER_APDU: { - msg("outparam.apdu_resp.apdu_resp_len[%d]", resp->apdu_resp.apdu_resp_len); - if (resp->apdu_resp.apdu_resp_len) { - for (i = 0; i < resp->apdu_resp.apdu_resp_len; i++) - msg("[%d]`s byte is [0x%x]", i, resp->apdu_resp.apdu_resp[i]); - } + TelSimPowerSetResult_t access_rt = result; - } break; - case TAPI_SIM_GET_ATR: - msg("atr_resp_len[%d]", resp->atr_resp.atr_resp_len); - if (resp->atr_resp.atr_resp_len) { - for (i = 0; i < resp->atr_resp.atr_resp_len; i++) - msg("[%d]`s byte is [0x%x]", i, resp->atr_resp.atr_resp[i]); - } - break; + msg("TAPI_SERVICE_SIM_SET_POWER_STATE response received"); - default: - break; - } + CHECK_ACCESS_RT(access_rt); - if(op) - free(op); + msg("access_rt[%d]", access_rt); } -static int run_sim_request_async (MManager *mm, struct menu_data *menu) +static int run_sim_set_power_state(MManager *mm, struct menu_data *menu) { TapiHandle *handle = menu_manager_ref_user_data (mm); int rt = 0; - TelSimResponseData_t outparam; - TelSimRequestData_t inparam; - unsigned char *op = NULL; - - memset (&outparam, 0, sizeof(TelSimResponseData_t)); - memset (&inparam, 0, sizeof(TelSimRequestData_t)); - op = (unsigned char*)malloc(1); - if(!op) - return 0; msg("call [%s] tapi service !!!", menu->title); - - if (strlen(data_sim_op_type) == 1) { - *op = data_sim_op_type[0] - '0'; - } else { - *op = ((data_sim_op_type[0] - '0') * 10) + (data_sim_op_type[1] - '0'); - } - msg("op = [%d]\n", *op); - - switch(*op) { - case TAPI_SIM_GET_INIT_STATUS: - case TAPI_SIM_GET_IMSI: - case TAPI_SIM_GET_ICCID: - case TAPI_SIM_GET_MSISDN: - case TAPI_SIM_GET_SPN: - case TAPI_SIM_GET_CPHS_NET_NAME: - case TAPI_SIM_GET_ATR: - rt = tel_request_sim_async(handle, *op, NULL, on_sim_request_async, op); - break; - case TAPI_SIM_TRANSFER_APDU: { - unsigned char result_apdu[MENU_DATA_SIZE + 1] = { 0, }; - int i = 0, j = 0, len = 0, hex = 0; - len = strlen (data_sim_transmit_apdu_apdu); - for (i = 0, j = 0; i < len; i += 2, j++) { - hex = (_sim_str_to_hex (data_sim_transmit_apdu_apdu[i]) << 4) - | (_sim_str_to_hex (data_sim_transmit_apdu_apdu[i + 1])); - printf ("0x%x\n", hex); - - result_apdu[j] = hex; - } - for (i = 0; i < len / 2; i++) { - printf ("[%02d] = 0x%02x\n", i, result_apdu[i]); - } - inparam.apdu.apdu_len = len / 2; - inparam.apdu.apdu = (unsigned char*) calloc (inparam.apdu.apdu_len, 1); - if(inparam.apdu.apdu != NULL) { - memcpy (inparam.apdu.apdu, result_apdu, inparam.apdu.apdu_len); - rt = tel_request_sim_async(handle, *op, &inparam, on_sim_request_async, op); - free(inparam.apdu.apdu); - } else { - msg("Memory allocation failed"); - } - } break; - default: - msg(" default case called !!!"); - break; - } - - if(op) - free(op); + data_sim_set_state[0] = data_sim_set_state[0] - '0'; + rt = tel_set_sim_power_state (handle, data_sim_set_state[0], + on_sim_set_power_state, NULL ); CHECK_RT(rt); - return 0; } + static struct menu_data menu_sim_get_init_info[] = { { "1", "run", NULL, run_sim_get_init_info, NULL}, { NULL, NULL, }, @@ -1480,6 +1286,13 @@ static struct menu_data menu_sim_set_language[] = { {NULL, NULL}, }; +static struct menu_data menu_sim_change_state[] = { + {"1", "change state(0:OFF, 1:ON)", NULL, NULL, (char*)data_sim_set_state}, + {"2", "run", NULL, run_sim_set_power_state, NULL}, + {NULL, NULL}, +}; + + static struct menu_data menu_sim_get_cf[] = { {"1", "run", NULL, run_sim_get_cf, NULL}, {NULL, NULL}, @@ -1644,23 +1457,6 @@ static struct menu_data menu_sim_get_atr[] = { {NULL, NULL}, }; -static struct menu_data menu_sim_call_sync[] = { - { "1", "op_type (1:get_init_status, 3:get_imsi, 5:get_iccid,\n\t\t" - "16:get_msisdn, 18:get_spn, 19:get_cphs_net_name, 28:transfer_apdu,\n\t\t" - "29:get_atr)", NULL, NULL, data_sim_op_type}, - { "2", "run", NULL, run_sim_request_sync, NULL}, - { NULL, NULL, }, -}; - -static struct menu_data menu_sim_call_async[] = { - { "1", "op_type (1:get_init_status, 3:get_imsi, 5:get_iccid,\n\t\t" - "16:get_msisdn, 18:get_spn, 19:get_cphs_net_name, 28:transfer_apdu,\n\t\t" - "29:get_atr)", NULL, NULL, data_sim_op_type}, - { "2", "run", NULL, run_sim_request_async, NULL}, - { NULL, NULL, }, -}; - - struct menu_data menu_sim[] = { {"1", "sim init info", menu_sim_get_init_info, NULL, NULL}, {"2", "card type", menu_sim_get_card_type, NULL, NULL}, @@ -1691,8 +1487,7 @@ struct menu_data menu_sim[] = { {"27", "apdu", menu_sim_transmit_apdu, NULL, NULL}, {"28", "atr info", menu_sim_get_atr, NULL, NULL}, {"29", "service table", menu_sim_get_service_table, NULL, NULL}, - {"50", "tel_call_sim_sync", menu_sim_call_sync, NULL, NULL}, - {"51", "tel_call_sim_async", menu_sim_call_async, NULL, NULL}, + {"30", "Change State", menu_sim_change_state, NULL, NULL}, { NULL, NULL, }, }; @@ -1703,6 +1498,8 @@ void register_sim_event (TapiHandle *handle) /* SIM */ ret = tel_register_noti_event (handle, TAPI_NOTI_SIM_STATUS, on_noti_sim_status, NULL ); + ret = tel_register_noti_event (handle, TAPI_PROP_SIM_CALL_FORWARD_STATE, + on_noti_sim_cf_state, NULL ); if (ret != TAPI_API_SUCCESS) { msg("event register failed(%d)", ret); } diff --git a/wearable/test_src/sim.h b/test_src/sim.h similarity index 88% rename from wearable/test_src/sim.h rename to test_src/sim.h index 3cc20d8..7a808b0 100644 --- a/wearable/test_src/sim.h +++ b/test_src/sim.h @@ -1,7 +1,7 @@ /* - * Telephony test application + * libslp-tapi * - * Copyright (c) 2012 Samsung Electronics Co., Ltd. All rights reserved. + * Copyright (c) 2014 Samsung Electronics Co., Ltd. All rights reserved. * * Contact: Ja-young Gu * diff --git a/wearable/test_src/sms.c b/test_src/sms.c old mode 100755 new mode 100644 similarity index 53% rename from wearable/test_src/sms.c rename to test_src/sms.c index ab40dc8..badfbf1 --- a/wearable/test_src/sms.c +++ b/test_src/sms.c @@ -1,7 +1,7 @@ /* - * Telephony test application + * libslp-tapi * - * Copyright (c) 2012 Samsung Electronics Co., Ltd. All rights reserved. + * Copyright (c) 2014 Samsung Electronics Co., Ltd. All rights reserved. * * Contact: Ja-young Gu * @@ -39,7 +39,7 @@ int dcs_pos = 0; unsigned int SmsMsgId = 0; unsigned char tp_mr = 0x00; -char *cmdString[] = { "TAPI_SERVICE_SMS_SEND_UMTS_MSG", +const char *cmdString[] = { "TAPI_SERVICE_SMS_SEND_UMTS_MSG", "TAPI_SERVICE_SMS_READ_MSG", "TAPI_SERVICE_SMS_SAVE_MSG", "TAPI_SERVICE_SMS_DELETE_MSG", "TAPI_SERVICE_SMS_GET_COUNT", "TAPI_SERVICE_SMS_GET_SCA", "TAPI_SERVICE_SMS_SET_SCA", @@ -59,227 +59,65 @@ static void on_resp_save_msg (TapiHandle *handle, int result, void *data, void *user_data); static void on_resp_DeliverReport_msg (TapiHandle *handle, int result, void *data, void *user_data); +int _util_hexstring_to_asciistring(const unsigned char *hex_string, unsigned char *ascii_string,int hex_len); -#ifdef TODO_BY_JYGU -static BOOL EncodeCdmaSmsParamTeleservice(int teleservice_id ,ParamTeleserv_t *ParamTeleserv) -{ - BOOL ret = FALSE; - - if(ParamTeleserv == NULL) { - printf("[EncodeCdmaSmsParamTeleservice] NULL pointer \n"); - return ret; - } +unsigned int SmsUtilEncodeSca(TelSmsAddressInfo_t *sca, unsigned char *sca_num); - 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; -} - -static BOOL EncodeCdmaSmsParamDestAddress(int NumberPlan, char* diallingNum ,ParamAddress_t *ParamAddr) +int _util_hexstring_to_asciistring(const unsigned char *hex_string, unsigned char *ascii_string,int hex_len) { - BOOL ret = FALSE; - int length = 0; + int i,ascii_len; - if(ParamAddr == NULL || diallingNum == NULL) { - printf("[EncodeCdmaSmsParamAddress] NULL pointer \n"); - return ret; + if(hex_string[hex_len-1]>>4 == 0x0f ) { + ascii_len = (hex_len * 2 ) -1; + }else { + ascii_len = (hex_len * 2 ); } - 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; - - ret = TRUE; - - return ret; -} - -static BOOL EncodeCdmaSmsParamCallbackAddress(int NumberPlan, char* diallingNum ,ParamCallback_t *ParamCallback) -{ - BOOL ret = FALSE; - int length = 0; - - if(ParamCallback == NULL || diallingNum == NULL) { - printf("[EncodeCdmaSmsParamAddress] NULL pointer \n"); - return ret; + for (i =0; i < ascii_len; i++ ) { + if (i % 2 == 0) { + ascii_string[i]= (hex_string[i/2] & 0x0f)+ '0'; + }else{ + ascii_string[i]=((hex_string[i/2] >> 4 ))+ '0'; + } } - - 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; - - ret = TRUE; - - return ret; + ascii_string[ascii_len]='\0'; + return ascii_len; } -static BOOL EncodeCdmaSmsParamMsgId(int type, ParamMsgId_t *ParamMsg) +unsigned int SmsUtilEncodeSca(TelSmsAddressInfo_t *sca, unsigned char *sca_num) { - BOOL ret = FALSE; - - if(ParamMsg == NULL) { - printf("[EncodeCdmaSmsParamMsgId] NULL pointer \n"); - return ret; + unsigned int sca_length = 0; + unsigned int additional_len = 0; + unsigned local_index, j; + + sca->Npi = TAPI_SIM_NPI_ISDN_TEL; + sca->Ton = TAPI_SIM_TON_UNKNOWN; + if (sca_num[0] == '+') { + sca->Ton = TAPI_SIM_TON_INTERNATIONAL; + additional_len = 1; + } + sca_length = strlen((char *)sca_num) - additional_len; + if (sca_length % 2 == 0) { + for (local_index = additional_len, j = 0; local_index < sca_length; local_index += 2, j++) + sca->szDiallingNum[j] = ((sca_num[local_index+1] & 0X0F) << 4) | (sca_num[local_index] & 0x0F); + } else { + for (local_index = additional_len, j = 0; local_index < sca_length; local_index += 2, j++) { + if (local_index == (sca_length - 1)) + sca->szDiallingNum[j] = ((0xF0) | (sca_num[local_index] & 0x0F)); + else + sca->szDiallingNum[j] = ((sca_num[local_index+1] & 0X0F) << 4) | (sca_num[local_index] & 0x0F); + } } + sca->szDiallingNum[(sca_length+1)/2] = '\0'; + sca->DialNumLen = (sca_length+1)/2; - ParamMsg->param_id = PARAMID_MESSAGE_ID; - ParamMsg->param_len =3; - ParamMsg->type = type; - ParamMsg->msg_id = SmsMsgId++; - - ret = TRUE; - - return ret; + return sca->DialNumLen; } -static 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; -} -#endif static BOOL EncodeCdmaSmsSubmitTpdu (char* diallingNum, int dialNumLen, char* msgTxt, int msg_len) { -#ifdef TODO_BY_JYGU - ParamTeleserv_t ParamTeleserv = {0,}; - ParamAddress_t ParamAddr = {0,}; - ParamMsgId_t ParamMsg = {0,}; - ParamUserData_t ParamUser = {0,}; - - int i; - int requestId = 0; - - msg("EncodeCdmaSmsSubmitTpdu Func Enter"); - - TelSmsMsgInfo_t *pDataPackage = malloc(sizeof(TelSmsMsgInfo_t)); - memset(pDataPackage, 0, sizeof(TelSmsMsgInfo_t)); - - pDataPackage->MsgType = SMS_MESSAGETYPE_SUBMIT; - - //1 TeleService Identifier - EncodeCdmaSmsParamTeleservice(TELESERVICEID_CMT95, &ParamTeleserv); - pDataPackage->ParamMask |= SMS_PARAM_TELESERVICE_MASK; - memcpy(&pDataPackage->MsgData.OutSubmit.TeleService, &ParamTeleserv.teleserv_id, sizeof(unsigned short)); - msg("teleservice at TEST APP: 0x%x", pDataPackage->MsgData.OutSubmit.TeleService); - - //1 Destination Address - diallingNum[dialNumLen] = '\0'; - EncodeCdmaSmsParamDestAddress(NUMBER_PLAN_UNKNOWN, diallingNum, &ParamAddr); - pDataPackage->ParamMask |= SMS_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); - - //1 Message Identifier - EncodeCdmaSmsParamMsgId(MESSAGETYPE_SUBMIT, &ParamMsg); - pDataPackage->ParamMask |= SMS_PARAM_MESSAGE_ID_MASK; - pDataPackage->MsgData.OutSubmit.MsgId = ParamMsg.type; - pDataPackage->MsgType = ParamMsg.type; - - //1 bearer - pDataPackage->ParamMask |= SMS_PARAM_BEARER_REPLY_MASK; - pDataPackage->MsgData.OutSubmit.ReplySeqNumber = 1; - -#if 0 - //1 Callback Address - EncodeCdmaSmsParamCallbackAddress(NUMBER_PLAN_UNKNOWN, CallbackNum, &Paramcallback); - pDataPackage->ParamMask |= SMS_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); -#endif - //1 User Date - msgTxt[msg_len - 1] = '\0'; - EncodeCdmaSmsParamUserData(msgTxt, &ParamUser); - pDataPackage->ParamMask |= SMS_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); - - msg(""); - msg("=============== Test App Message ================="); - msg(" - MsgType: %d", pDataPackage->MsgType); - msg(" - ParamMask: 0x%08x", pDataPackage->ParamMask); - printf("0000: "); - for (i = 0; i < sizeof(TelSmsMsgInfo_t); i++) { - printf("%02x ", *(((unsigned char *) pDataPackage) + i)); - if ((i + 1) % 8 == 0) - printf(" "); - - if ((i + 1) % 16 == 0) - printf("\n%04x: ", i+1); - } - printf("\n"); - fflush(stdout); - - msg("=============================================="); - - returnStatus = tel_send_sms_msg(pDataPackage, 0x26, &requestId); //more to send is false since it is not concatenated.for concatenated send 1 - - msg("tel_send_sms_msg() requestId: %d", requestId); - - free(pDataPackage); - -#endif return TRUE; } @@ -366,14 +204,11 @@ static BOOL EncodeSmsSubmitTpdu (MManager *mm, char* diallingNum, unsigned char SCA[TAPI_NETTEXT_SCADDRESS_LEN_MAX + 1]; int ret = 0; - - // unsigned char tp_mr = 0x03; - tp_mr++; unsigned char tp_pid = 0; //reaplace type (65) unsigned char tp_dcs; //=17; //class_1(17),class_2(18) unsigned char tp_vp; - int index = 0, ScIndex = 0; + int local_index = 0, ScIndex = 0; int i; int requestId = 0; unsigned char sca_len = 0; @@ -381,6 +216,8 @@ static BOOL EncodeSmsSubmitTpdu (MManager *mm, char* diallingNum, TelSmsDatapackageInfo_t *pDataPackage = NULL; + tp_mr++; + memset (packet, 0, TAPI_NETTEXT_MSG_SIZE_MAX); /************SCA ADDRESS GET START**************/ @@ -418,7 +255,6 @@ static BOOL EncodeSmsSubmitTpdu (MManager *mm, char* diallingNum, //TODO : SCA - // index +=SmsUtilEncodeAddrField(packet,SCA, strlen(SCA) ,0x01,0x01); ScIndex = SmsUtilEncodeAddrField ((unsigned char*) pDataPackage->Sca, (char *) SCA, sca_len, 0x01, 0x01); @@ -432,26 +268,25 @@ static BOOL EncodeSmsSubmitTpdu (MManager *mm, char* diallingNum, tpdu_submit.udhi = FALSE; //false: contains only the short message , true :a Header in addition to the short message tpdu_submit.rp = FALSE; //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; // SUBMIT: bits 0, 1 - packet[index] |= tpdu_submit.rd ? 0x04 : 0; // bit 2 - packet[index] |= tpdu_submit.vpf << 3; // bits 3, 4 - packet[index] |= tpdu_submit.srr ? 0x20 : 0; // bit 5 - packet[index] |= tpdu_submit.udhi ? 0x40 : 0; // bit 6 - packet[index] |= tpdu_submit.rp ? 0x80 : 0; // bit 7 + packet[local_index] = tpdu_submit.msg_type; // SUBMIT: bits 0, 1 + packet[local_index] |= tpdu_submit.rd ? 0x04 : 0; // bit 2 + packet[local_index] |= tpdu_submit.vpf << 3; // bits 3, 4 + packet[local_index] |= tpdu_submit.srr ? 0x20 : 0; // bit 5 + packet[local_index] |= tpdu_submit.udhi ? 0x40 : 0; // bit 6 + packet[local_index] |= tpdu_submit.rp ? 0x80 : 0; // bit 7 - index++; - msg("index of message ref is %d, msgref is %d", index, tp_mr); + local_index++; + msg("local_index of message ref is %d, msgref is %d", local_index, tp_mr); /* TP-MR */ - packet[index++] = tp_mr; + packet[local_index++] = tp_mr; // TP-DA - index += SmsUtilEncodeAddrField (packet + index, diallingNum, dialNumLen, - 0x02, 0x01); + local_index += SmsUtilEncodeAddrField (packet + local_index, diallingNum, dialNumLen, 0x01, 0x01); //msg("DESTINATTION ADDR Encoded ========="); //TP-PID - packet[index++] = tp_pid; + packet[local_index++] = tp_pid; // TP_DCS (Data Coding Scheme) @@ -463,7 +298,7 @@ static BOOL EncodeSmsSubmitTpdu (MManager *mm, char* diallingNum, SmsUtilEncodeDCS (&tp_dcs, &tpdu_submit.dcs); - packet[index++] = tp_dcs; + packet[local_index++] = tp_dcs; //msg("DCS Encoded:tp_dcs =%d =========",tp_dcs); @@ -476,31 +311,31 @@ static BOOL EncodeSmsSubmitTpdu (MManager *mm, char* diallingNum, SmsUtilEncodeValidity (&tp_vp, &tpdu_submit.vp); //tp_vp =65; - packet[index++] = tp_vp; + packet[local_index++] = tp_vp; //msg("Validity Encoded :tp_vp =%d =========",tp_vp); // UDL - packet[index++] = msg_len; + packet[local_index++] = msg_len; // TP-UD if (tpdu_submit.dcs.alphabet_type == SMS_ALPHABET_DEFAULT) { int pos; - pos = SmsUtilPackGSMCode (packet + index, msg, msg_len); - index += pos; + pos = SmsUtilPackGSMCode (packet + local_index, msg, msg_len); + local_index += pos; } - msg("Send packet to phonseSever[%d] -----", index); + msg("Send packet to phonseSever[%d] -----", local_index); - for (i = 0; i < index; i++) { + for (i = 0; i < local_index; i++) { msg("[%02x]", packet[i]); if (i % 10 == 9) msg("\n"); } msg("\n"); - memcpy (pDataPackage->szData, packet, index); - pDataPackage->MsgLength = index; + memcpy (pDataPackage->szData, packet, local_index); + pDataPackage->MsgLength = local_index; msg("***Sending the Message (Api:SendMsg)***"); @@ -515,334 +350,13 @@ static BOOL EncodeSmsSubmitTpdu (MManager *mm, char* diallingNum, return TRUE; -#if 0 - TPDU_SMS_SUBMIT tpdu_submit; - unsigned char entered_SCA[SMS_SCADDRESS_LEN_MAX]; //send SMS �Ҷ� ����ϴ� ���� SCA�� - int ret = 0; - - // unsigned char tp_mr = 0x03; - tp_mr++; - unsigned char tp_pid = 0;//reaplace type (65) - unsigned char tp_dcs;//=17; //class_1(17),class_2(18) - unsigned char tp_vp; - - int index = 0, ScIndex = 0; - int i; - unsigned char sca_len =0; - gboolean returnStatus; - - int msgLength = 0; /**< Size of array szData (which is actual TPDU message) */ - unsigned char szData[SMS_MSG_SIZE_MAX]; /**Sca ,(char *)entered_SCA, sca_len ,0x01,0x01); - - msg("ScIndex is %d", ScIndex); - - // TP-MTI, TP-RD, TP-VPF, TP-SRR, TP_UDHI, TP-RP - tpdu_submit.msg_type = SMS_TPDU_SUBMIT; - tpdu_submit.rd =FALSE;//false :accept duplicate msg , true: reject duplicate msg - tpdu_submit.vpf = SMS_VP_RELATIVE; - tpdu_submit.srr = FALSE;//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 = FALSE;//false :TP Reply Path parameter is not set in this SMS SUBMIT, true : TP Reply Path parameter is set in this SMS SUBMIT - - szData[index] = tpdu_submit.msg_type;// SUBMIT: bits 0, 1 - szData[index] |= tpdu_submit.rd? 0x04 : 0;// bit 2 - szData[index] |= tpdu_submit.vpf << 3;// bits 3, 4 - szData[index] |= tpdu_submit.srr ? 0x20 : 0;// bit 5 - szData[index] |= tpdu_submit.udhi? 0x40 : 0;// bit 6 - szData[index] |= tpdu_submit.rp ? 0x80 : 0;// bit 7 - - index++; - msg("index of message ref is %d, msgref is %d",index,tp_mr); - /* TP-MR */ - szData[index++] = tp_mr; - - // TP-DA - index += SmsUtilEncodeAddrField( szData+index, diallingNum, dialNumLen, 0x02, 0x01); - - //msg("DESTINATTION ADDR Encoded ========="); - - //TP-PID - szData[index++] = tp_pid; - - // TP_DCS (Data Coding Scheme) - tpdu_submit.dcs.bCompressed = FALSE; - tpdu_submit.dcs.bmsg_class_set = TRUE; - tpdu_submit.dcs.coding_group_type =SMS_CODGRP_SM_GENERAL_DCS; - tpdu_submit.dcs.alphabet_type = SMS_ALPHABET_DEFAULT; - tpdu_submit.dcs.class_type = SMS_CLASS_2; - - SmsUtilEncodeDCS(&tp_dcs, &tpdu_submit.dcs); - - szData[index++] = tp_dcs; - - //msg("DCS Encoded:tp_dcs =%d =========",tp_dcs); - - //TP-VP - tpdu_submit.vp.vp_rel_type = SMS_VP_REL_6H; - tpdu_submit.vp.vp_type = SMS_VP_RELATIVE; - tpdu_submit.vp.vpValue =0xff; - - SmsUtilEncodeValidity(&tp_vp,&tpdu_submit.vp); - - //tp_vp =65; - szData[index++] = tp_vp; - //msg("Validity Encoded :tp_vp =%d =========",tp_vp); - - // UDL - szData[index++] = msg_len; - - // TP-UD - if (tpdu_submit.dcs.alphabet_type == SMS_ALPHABET_DEFAULT ) - { - int pos; - pos =SmsUtilPackGSMCode( szData + index, msg, msg_len); - index += pos; - } - - msg("Send szData to phonseSever[%d] -----", index); - - for(i=0; i< index; i++ ) - { - msg("[%02x]", szData[i]); - if( i%10 == 9) - msg("\n"); - } - msg("\n"); - - memcpy( pDataPackage->szData, szData, index); - pDataPackage->MsgLength = index; - - msg("***Sending the Message (Api:SendMsg)***"); - msg("Length : %d", msgLength); - - returnStatus = tel_send_sms(handle, pDataPackage, 0, on_resp_send_msg, NULL); - - msg("SendMsg : returnStatus=0x%x", returnStatus); - - return TRUE; -#endif } -#if 0 -static int DecodeSmsSubmitTpdu(int pdu_len, char * pPDU) -{ - TPDU_SMS_SUBMIT tpdu_submit; - unsigned char scaAddr_len =0; - int destAddr_len = 0; - char diallingNum[SMS_ADDRESS_LEN_MAX]; - char scaAddr[SMS_SCADDRESS_LEN_MAX]; //service center address - char destAddr[SMS_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(diallingNum, &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 == SMS_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'; - } - - //msg(" sca length: %d , sca # : %s", scaAddr_len, scaAddr); - - /* 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(diallingNum, &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 == SMS_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'; - } - //msg(" dest length: %d , dest # : %s", destAddr_len, destAddr); - - 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 = SMS_VP_RELATIVE; //temp - - if(tpdu_submit.vp.vp_type == SMS_VP_RELATIVE) - { - tpdu_submit.vp.vpValue = pPDU[position]; - tpdu_submit.vp.vp_rel_type = SMS_VP_REL_1D; - position++; - } - else if (tpdu_submit.vp.vp_type == SMS_VP_ABSOLUTE || tpdu_submit.vp.vp_type == SMS_VP_ENHANCED) - { - position += 7; - } - - /* TP UDL */ - tpdu_submit.udl = pPDU[position]; - - if ( tpdu_submit.udl> SMS_SMDATA_SIZE_MAX ) - tpdu_submit.udl = SMS_SMDATA_SIZE_MAX; - - position++; - - /* TP UD */ - tpdu_submit.userData = malloc( sizeof ( unsigned char ) * ( SMS_SMDATA_SIZE_MAX + 1 ) ); - - memset(tpdu_submit.userData, 0, sizeof ( unsigned char ) * ( SMS_SMDATA_SIZE_MAX + 1 ) ); - - if (tpdu_submit.dcs.alphabet_type == SMS_ALPHABET_DEFAULT ) - { - char inData[SMS_SMDATA_SIZE_MAX+1]; - - memset( inData, 0x00, SMS_SMDATA_SIZE_MAX + 1 ); - - memcpy( (void*) inData, (void*) &pPDU[position], tpdu_submit.udl ); - - SmsUtilUnpackGSMCode((char *)tpdu_submit.userData, inData, (unsigned char) tpdu_submit.udl); - } - - msg("*************************************"); - msg("Msg Type: TPDU_SUBMIT"); - - if(tpdu_submit.rd) - { - msg("RD: Reject Duplicate") - } - - else if(!tpdu_submit.rd) - { - msg("RD: Accept Duplicate") - } - - if(tpdu_submit.srr) - { - msg("SRR: A status report is requested") - } - - else if(!tpdu_submit.srr) - { - msg("SRR: A status report is not requested") - } - - if(tpdu_submit.udhi) - { - msg("UDHI: Contains a Header in addition to the short message.") - } - else if(!tpdu_submit.udhi) - { - msg("UDHI: Only Short Message") - } - - if(tpdu_submit.rp) - { - msg("RP: Set Reply Path") - } - - else if(!tpdu_submit.rp) - { - msg("RP: Not set Reply Path") - } - - msg("SCA Addr : %s",scaAddr); - msg("To : %s" ,destAddr); - msg("Message : %s " , tpdu_submit.userData); - msg("*************************************"); - - return TRUE; -} -#endif static int DecodeSmsDeliverTpdu (int tpdu_len, char* pTPDU) { TPDU_SMS_DELIVER tpdu_deliver; TmDateTime SCTimeStamp; - ; int orgAddr_len = 0; char diallingNum[SMS_ADDRESS_LEN_MAX + 1]; char orgAddr[SMS_ADDRESS_LEN_MAX + 1]; //originating number @@ -970,235 +484,7 @@ static int DecodeSmsDeliverTpdu (int tpdu_len, char* pTPDU) return dcs_pos; } -#if 0 -static BOOL EncodeSmsDeliverReportTpdu() -{ - TPDU_SMS_DELIVER_REPORT deliver_report; - unsigned char packet[500]; - TelSmsDatapackageInfo_t * pDataPackage; - unsigned char tp_dcs; - unsigned char mask=0x69; - int index=0; - int i; - - TelSmsDatapackageInfo_t del_report; - - memset(&(del_report), 0 , sizeof(TelSmsDatapackageInfo_t)); - - pDataPackage = malloc(sizeof(TelSmsDatapackageInfo_t)); - memset(pDataPackage, 0, sizeof(TelSmsDatapackageInfo_t)); - - memset(packet, 0, 500); - - /* 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-FCS */ - //if(result==FAIL) - //{ - - //} - - /* 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 =SMS_CODGRP_SM_GENERAL_DCS; - deliver_report.dcs.alphabet_type = SMS_ALPHABET_DEFAULT; - deliver_report.dcs.class_type = SMS_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 == SMS_ALPHABET_DEFAULT ) - { - //SmsUtilPackGSMCode( packet + index, msg, msg_len); - } - } - } - msg("EncodeSmsDeliverReportTpdu"); - msg("Send packet to phonseSever[%d] -----", index); - - for(i=0; i< index; i++ ) - { - msg("[%02x]", packet[i]); - if( i%10 == 9) - msg("\n"); - } - msg("\n"); - memcpy( del_report.szData, packet, index); - del_report.MsgLength = index; - msg("msgLength :%d",del_report.MsgLength); - int requestId =0; - tel_send_sms_deliver_report(&del_report,0, &requestId); //madhavi - msg("after send deliver report request id is %d",requestId); - return TRUE; -} -#endif - -#if 0 -static BOOL DecodeSmsSubmitReportTpdu(int length , char *data) -{ - - TPDU_SMS_SUBMIT_REPORT submit_report; - TmDateTime SCTimeStamp;; - int position=1; - int i=0; - unsigned char msgRef, tpdu_len; - int result=0; - unsigned char mask; - - /* Result */ - if(data == NULL) { - msg("pData is Null") - return FALSE; - } - - msg("length :%d",length); - - for(i=0;iSca, &sca_ton, - &sca_npi); + sca_length = datapackage->Sca[0]; + + sca_ton = (datapackage->Sca[offset +1] & 0x70) >> 4; + sca_npi = datapackage->Sca[offset +1] & 0x0F; + + msg("TON %d", sca_ton); + msg("NPI %d", sca_npi); + + /* Modem Send the hex encoded SCA Service center digits*/ + scaAddr_len = _util_hexstring_to_asciistring(&datapackage->Sca[2], (unsigned char *) diallingNum, sca_length-1); + + msg("SCA ascii length%d", scaAddr_len); + msg("SCA Number:[%s]", diallingNum); - scaAddr_len = strlen (diallingNum); if (scaAddr_len > TAPI_NETTEXT_SCADDRESS_LEN_MAX) scaAddr_len = TAPI_NETTEXT_SCADDRESS_LEN_MAX; @@ -1443,10 +741,8 @@ static void on_noti_sms_incom_msg (TapiHandle *handle, const char *noti_id, SmsUtilDecodeDCS (&dcs, datapackage->szData[position + dcs_pos]); - //if(dcs.class_type == TAPI_NETTEXT_CLASS_2) - { + if (dcs.class_type == SMS_CLASS_2) { msg("dcs type is of class2"); - TelSmsData_t WriteData; memset (&WriteData, 0, sizeof(TelSmsData_t)); @@ -1459,6 +755,7 @@ static void on_noti_sms_incom_msg (TapiHandle *handle, const char *noti_id, datapackage->MsgLength); WriteData.MsgStatus = TAPI_NETTEXT_STATUS_READ; + WriteData.SmsData.format = TAPI_NETTEXT_NETTYPE_3GPP; returnStatus = tel_write_sms_in_sim (handle, &WriteData, on_resp_save_msg, NULL ); @@ -1470,9 +767,6 @@ static void on_noti_sms_incom_msg (TapiHandle *handle, const char *noti_id, else if (MTI == SMS_TPDU_STATUS_REPORT) { DecodeSmsStatusReportTpdu (tpdu_len, pTPDU); } - - TelSmsDatapackageInfo_t * del_report = NULL; - del_report = malloc (sizeof(TelSmsDatapackageInfo_t)); memset (del_report, 0, sizeof(TelSmsDatapackageInfo_t)); @@ -1482,6 +776,7 @@ static void on_noti_sms_incom_msg (TapiHandle *handle, const char *noti_id, del_report->szData[0] = SMS_TPDU_DELIVER_REPORT; //TP-UDHI[bit6] : 0 del_report->szData[1] = 0;// TP-PI = 0; bit2: TP-UDL bit1: TP-DCS bit0: TP-PID (No option field) del_report->MsgLength = 2; + del_report->format = TAPI_NETTEXT_NETTYPE_3GPP; msg("***receive message (Api:SendDeliverreport)****"); @@ -1493,6 +788,7 @@ static void on_noti_sms_incom_msg (TapiHandle *handle, const char *noti_id, free (del_report); free (pTPDU); + } static void on_noti_sms_cb_incom_msg (TapiHandle *handle, const char *noti_id, @@ -1529,188 +825,7 @@ static void on_noti_sms_etws_incom_msg (TapiHandle *handle, const char *noti_id, memcpy (& (pPDU[2]), etwsMsg->szMsgData, TAPI_NETTEXT_ETWS_SIZE_MAX + 1); } -#if 0 -static void on_noti_sms_incom_ex_msg(TapiHandle *handle, const char *noti_id, void *data, void *user_data) -{ - tel_service_object_get_int(notiObj, "ParamMask"); - tel_service_object_get_int(notiObj, "MsgType"); - - switch(tel_service_object_get_int(notiObj, "MsgType")) - { - case MESSAGETYPE_DELIVER: - /* Origination address */ - tel_service_object_get_int(notiObj, "OrigAddr.Digit"); - tel_service_object_get_int(notiObj, "OrigAddr.NumberMode"); - tel_service_object_get_int(notiObj, "OrigAddr.NumberType"); - tel_service_object_get_int(notiObj, "OrigAddr.NumberPlan"); - tel_service_object_get_char(notiObj, "OrigAddr.szAddrLength"); - tel_service_object_get_string(notiObj, "OrigAddr.szAddress"); - - /* Origination subaddress */ - tel_service_object_get_int(notiObj, "OrigSubAddr.SubType"); - tel_service_object_get_char(notiObj, "OrigSubAddr.Odd"); - tel_service_object_get_char(notiObj, "OrigSubAddr.szAddrLength"); - tel_service_object_get_string(notiObj, "OrigSubAddr.szAddress"); - - tel_service_object_get_int(notiObj, "TeleService"); - tel_service_object_get_int(notiObj, "bBearerReplySeqRequest"); - tel_service_object_get_char(notiObj, "ReplySeqNumber"); - tel_service_object_get_int(notiObj, "MsgId"); - tel_service_object_get_int(notiObj, "MsgEncoding"); - tel_service_object_get_int(notiObj, "MsgLength"); - tel_service_object_get_string(notiObj, "szData"); - - /* Message center time stamp */ - tel_service_object_get_int(notiObj, "MessageCenterTimeStamp.year"); - tel_service_object_get_int(notiObj, "MessageCenterTimeStamp.month"); - tel_service_object_get_int(notiObj, "MessageCenterTimeStamp.day"); - tel_service_object_get_int(notiObj, "MessageCenterTimeStamp.hours"); - tel_service_object_get_int(notiObj, "MessageCenterTimeStamp.minutes"); - tel_service_object_get_int(notiObj, "MessageCenterTimeStamp.seconds"); - - /* Validity period - Absolute */ - tel_service_object_get_int(notiObj, "ValidityPeriodAbs.year"); - tel_service_object_get_int(notiObj, "ValidityPeriodAbs.month"); - tel_service_object_get_int(notiObj, "ValidityPeriodAbs.day"); - tel_service_object_get_int(notiObj, "ValidityPeriodAbs.hours"); - tel_service_object_get_int(notiObj, "ValidityPeriodAbs.minutes"); - tel_service_object_get_int(notiObj, "ValidityPeriodAbs.seconds"); - - tel_service_object_get_char(notiObj, "ValidityPeriodRel"); - - /* Deferred delivery time - Absolute (not supported) */ - tel_service_object_get_int(notiObj, "DeferredDelTimeAbs.year"); - tel_service_object_get_int(notiObj, "DeferredDelTimeAbs.month"); - tel_service_object_get_int(notiObj, "DeferredDelTimeAbs.day"); - tel_service_object_get_int(notiObj, "DeferredDelTimeAbs.hours"); - tel_service_object_get_int(notiObj, "DeferredDelTimeAbs.minutes"); - tel_service_object_get_int(notiObj, "DeferredDelTimeAbs.seconds"); - - /* Deferred delivery time - Relative (not supported) */ - tel_service_object_get_char(notiObj, "DeferredDelTimeRel"); - - tel_service_object_get_int(notiObj, "Priority"); - tel_service_object_get_int(notiObj, "Privacy"); - tel_service_object_get_char(notiObj, "NumMsg"); - tel_service_object_get_int(notiObj, "bUserAckRequest"); - tel_service_object_get_int(notiObj, "bDeliveryAckRequest"); - tel_service_object_get_int(notiObj, "AlertPriority"); - tel_service_object_get_int(notiObj, "MsgLang"); - - /* Callback number address */ - tel_service_object_get_int(notiObj, "CallBackNumer.Digit"); - tel_service_object_get_int(notiObj, "CallBackNumer.NumberMode"); - tel_service_object_get_int(notiObj, "CallBackNumer.NumberType"); - tel_service_object_get_int(notiObj, "CallBackNumer.NumberPlan"); - tel_service_object_get_char(notiObj, "CallBackNumer.szAddrLength"); - tel_service_object_get_string(notiObj, "CallBackNumer.szAddress"); - - tel_service_object_get_int(notiObj, "Display"); - - break; - - case MESSAGETYPE_DELIVERY_ACK: - /* Origination address */ - tel_service_object_get_int(notiObj, "OrigAddr.Digit"); - tel_service_object_get_int(notiObj, "OrigAddr.NumberMode"); - tel_service_object_get_int(notiObj, "OrigAddr.NumberType"); - tel_service_object_get_int(notiObj, "OrigAddr.NumberPlan"); - tel_service_object_get_char(notiObj, "OrigAddr.szAddrLength"); - tel_service_object_get_string(notiObj, "OrigAddr.szAddress"); - - /* Origination subaddress */ - tel_service_object_get_int(notiObj, "OrigSubAddr.SubType"); - tel_service_object_get_char(notiObj, "OrigSubAddr.Odd"); - tel_service_object_get_char(notiObj, "OrigSubAddr.szAddrLength"); - tel_service_object_get_char(notiObj, "OrigSubAddr.szAddress"); - - tel_service_object_get_int(notiObj, "TeleService"); - tel_service_object_get_int(notiObj, "bBearerReplySeqRequest"); - tel_service_object_get_char(notiObj, "ReplySeqNumber"); - tel_service_object_get_int(notiObj, "MsgId"); - tel_service_object_get_int(notiObj, "MsgEncoding"); - tel_service_object_get_int(notiObj, "MsgLength"); - tel_service_object_get_string(notiObj, "szData"); - - tel_service_object_get_char(notiObj, "UserResponseCode"); - - /* Message center time stamp */ - tel_service_object_get_int(notiObj, "MessageCenterTimeStamp.year"); - tel_service_object_get_int(notiObj, "MessageCenterTimeStamp.month"); - tel_service_object_get_int(notiObj, "MessageCenterTimeStamp.day"); - tel_service_object_get_int(notiObj, "MessageCenterTimeStamp.hours"); - tel_service_object_get_int(notiObj, "MessageCenterTimeStamp.minutes"); - tel_service_object_get_int(notiObj, "MessageCenterTimeStamp.seconds"); - - break; - - case MESSAGETYPE_USER_ACK: - /* Origination address */ - tel_service_object_get_int(notiObj, "OrigAddr.Digit"); - tel_service_object_get_int(notiObj, "OrigAddr.NumberMode"); - tel_service_object_get_int(notiObj, "OrigAddr.NumberType"); - tel_service_object_get_int(notiObj, "OrigAddr.NumberPlan"); - tel_service_object_get_char(notiObj, "OrigAddr.szAddrLength"); - tel_service_object_get_string(notiObj, "OrigAddr.szAddress"); - - /* Origination subaddress */ - tel_service_object_get_int(notiObj, "OrigSubAddr.SubType"); - tel_service_object_get_char(notiObj, "OrigSubAddr.Odd"); - tel_service_object_get_char(notiObj, "OrigSubAddr.szAddrLength"); - tel_service_object_get_char(notiObj, "OrigSubAddr.szAddress"); - - tel_service_object_get_int(notiObj, "TeleService"); - tel_service_object_get_int(notiObj, "bBearerReplySeqRequest"); - tel_service_object_get_char(notiObj, "ReplySeqNumber"); - tel_service_object_get_int(notiObj, "MsgId"); - tel_service_object_get_int(notiObj, "MsgEncoding"); - tel_service_object_get_int(notiObj, "MsgLength"); - tel_service_object_get_string(notiObj, "szData"); - - /* Message center time stamp */ - tel_service_object_get_int(notiObj, "MessageCenterTimeStamp.year"); - tel_service_object_get_int(notiObj, "MessageCenterTimeStamp.month"); - tel_service_object_get_int(notiObj, "MessageCenterTimeStamp.day"); - tel_service_object_get_int(notiObj, "MessageCenterTimeStamp.hours"); - tel_service_object_get_int(notiObj, "MessageCenterTimeStamp.minutes"); - tel_service_object_get_int(notiObj, "MessageCenterTimeStamp.seconds"); - - break; - default: - break; - } -} -#endif -#if 0 -static void on_noti_sms_cb_incom_ex_msg(TapiHandle *handle, const char *noti_id, void *data, void *user_data) -{ - tel_service_object_get_string(notiObj, "szData"); - - /* Message center time stamp */ - tel_service_object_get_int(notiObj, "MessageCenterTimeStamp.year"); - tel_service_object_get_int(notiObj, "MessageCenterTimeStamp.month"); - tel_service_object_get_int(notiObj, "MessageCenterTimeStamp.day"); - tel_service_object_get_int(notiObj, "MessageCenterTimeStamp.hours"); - tel_service_object_get_int(notiObj, "MessageCenterTimeStamp.minutes"); - tel_service_object_get_int(notiObj, "MessageCenterTimeStamp.seconds"); - - /* Validity period - Absolute */ - tel_service_object_get_int(notiObj, "ValidityPeriodAbs.year"); - tel_service_object_get_int(notiObj, "ValidityPeriodAbs.month"); - tel_service_object_get_int(notiObj, "ValidityPeriodAbs.day"); - tel_service_object_get_int(notiObj, "ValidityPeriodAbs.hours"); - tel_service_object_get_int(notiObj, "ValidityPeriodAbs.minutes"); - tel_service_object_get_int(notiObj, "ValidityPeriodAbs.seconds"); - - tel_service_object_get_char(notiObj, "ValidityPeriodRel"); - - tel_service_object_get_int(notiObj, "Priority"); - tel_service_object_get_int(notiObj, "AlertPriority"); - tel_service_object_get_int(notiObj, "MsgLang"); - tel_service_object_get_int(notiObj, "Display"); -} -#endif static void on_noti_sms_memory_status (TapiHandle *handle, const char *noti_id, void *data, void *user_data) @@ -1819,34 +934,34 @@ static void on_resp_read_msg (TapiHandle *handle, int result, void *data, static void on_resp_save_msg (TapiHandle *handle, int result, void *data, void *user_data) { - int *index = data; + int *local_index = data; msg(""); msgb("tel_write_sms_in_sim() response receive"); msg(" - result = 0x%x", result); - msg(" - index = %d", *index); + msg(" - local_index = %d", *local_index); } static void on_resp_delete_msg (TapiHandle *handle, int result, void *data, void *user_data) { - int *index = data; + int *local_index = data; msg(""); msgb("tel_delete_sms_in_sim() response receive"); msg(" - result = 0x%x", result); - msg(" - index = %d", *index); + msg(" - local_index = %d", *local_index); } static void on_resp_DeliverReport_msg (TapiHandle *handle, int result, void *data, void *user_data) { - int *index = data; + int *local_index = data; msg(""); msgb("tel_send_sms_deliver_report() response receive"); msg(" - result = 0x%x", result); - msg(" - index = %d", *index); + msg(" - local_index = %d", *local_index); } static void on_resp_set_sms_sca (TapiHandle *handle, int result, void *data, @@ -1857,14 +972,6 @@ static void on_resp_set_sms_sca (TapiHandle *handle, int result, void *data, msg(" - result = 0x%x", result); } -static void on_resp_set_sms_preferred_bearer (TapiHandle *handle, int result, - void *data, void *user_data) -{ - msg(""); - msgb("tel_set_sms_preferred_bearer() response receive"); - msg(" - result = 0x%x", result); -} - static void on_resp_set_sms_cb_config (TapiHandle *handle, int result, void *data, void *user_data) { @@ -1960,6 +1067,7 @@ static void on_resp_get_sms_parameters (TapiHandle *handle, int result, void *data, void *user_data) { TelSmsParams_t *smsp_param; + int i = 0; if (data == NULL ) { msg("data is Null") @@ -1976,21 +1084,18 @@ static void on_resp_get_sms_parameters (TapiHandle *handle, int result, msg("alpha_id len is 0x%x ", (int )smsp_param->AlphaIdLen); msg("alpha_id is %s ", smsp_param->szAlphaId); msg("param indicator is 0x%x", smsp_param->ParamIndicator); - msg("dest dialling num is %s", smsp_param->TpDestAddr.szDiallingNum); - msg("svcaddr dialling num is %s", smsp_param->TpSvcCntrAddr.szDiallingNum); + + for (i = 0; i < (int) smsp_param->TpDestAddr.DialNumLen; i++) + msg("DestAddr = %d [%02x]", i, smsp_param->TpDestAddr.szDiallingNum[i]); + + for (i = 0; i < (int) smsp_param->TpSvcCntrAddr.DialNumLen; i++) + msg("SCAddr = %d [%02x]", i, smsp_param->TpSvcCntrAddr.szDiallingNum[i]); + msg("pid 0x%x", smsp_param->TpProtocolId); msg("dcs is 0x%x", smsp_param->TpDataCodingScheme); msg("validity is 0x%x", smsp_param->TpValidityPeriod); } -static void on_resp_get_pref_bearer (TapiHandle *handle, int result, void *data, - void *user_data) -{ - msg(""); - msgb("tel_get_sms_preferred_bearer() response receive"); - msg(" - result = 0x%x", result); -} - static void on_resp_get_paramcnt (TapiHandle *handle, int result, void *data, void *user_data) { @@ -2209,7 +1314,7 @@ static int DeleteMessage (MManager *mm, struct menu_data *menu) TapiHandle *handle = menu_manager_ref_user_data (mm); int ret; - int index; + int local_index; char buf[100]; TapiResult_t returnStatus; @@ -2227,12 +1332,12 @@ static int DeleteMessage (MManager *mm, struct menu_data *menu) else if (ret == 0) return ret; - index = atoi (buf); - msg("index value :%d", index); + local_index = atoi (buf); + msg("index value :%d", local_index); msg("***Deleting the message(Api:DeleteMsg,GetMsgCount)***"); - returnStatus = tel_delete_sms_in_sim (handle, index, on_resp_delete_msg, + returnStatus = tel_delete_sms_in_sim (handle, local_index, on_resp_delete_msg, NULL ); msg("returnstatus tel_delete_sms_in_sim() is for delete%d ", returnStatus); returnStatus = tel_get_sms_count (handle, on_resp_get_sms_count, NULL ); @@ -2282,16 +1387,6 @@ static int Getting (MManager *mm, struct menu_data *menu) break; - case 4: - msg("***Getting preferrredBearer(Api:GetPreferredBearer)***") - ; - returnStatus = tel_get_sms_preferred_bearer (handle, - on_resp_get_pref_bearer, NULL ); - msg("ReturnStatus[%d]", returnStatus) - ; - - break; - case 5: msg("***Getting the parameterCount(Api:GetParameterCount)***") ; @@ -2353,7 +1448,6 @@ static int Setting (MManager *mm, struct menu_data *menu) int i; char MemoryStatus[255] = { 0, }; //2006/8/8 - char bearerType[255] = { 0, }; //2006/8/8 TelSmsCbConfig_t *pCBConfig; @@ -2365,65 +1459,49 @@ static int Setting (MManager *mm, struct menu_data *menu) switch (settingMenu) { case 1: //Set Service Center Number { - msg("*** Setting SCA (API: tel_set_sms_sca()) ****"); TelSmsAddressInfo_t sca = {0, }; unsigned char sca_num[TAPI_SIM_SMSP_ADDRESS_LEN + 1]; unsigned int sca_length = 0; unsigned int additional_len = 0; - unsigned index, j; - - RETRY: - msg("Enter the SCA NUMBER:"); - ret = scanf("%s", sca_num); - if (ret > TAPI_SIM_SMSP_ADDRESS_LEN) { - msg("Entered SCA is INVALID - SCA length cannot be greater than %d", TAPI_SIM_SMSP_ADDRESS_LEN); - goto RETRY; - } - sca.Npi = TAPI_SIM_NPI_ISDN_TEL; - sca.Ton = TAPI_SIM_TON_UNKNOWN; - if (sca_num[0] == '+') { - sca.Ton = TAPI_SIM_TON_INTERNATIONAL; - additional_len = 1; - } - sca_length = strlen((char *)sca_num) - additional_len; - if (sca_length % 2 == 0) { - for (index = additional_len, j = 0; index < sca_length; index += 2, j++) - sca.szDiallingNum[j] = ((sca_num[index+1]-'0') << 4) | (sca_num[index]-'0'); - } else { - for (index = additional_len, j = 0; index < sca_length; index += 2, j++) { - if (index == (sca_length - 1)) - sca.szDiallingNum[j] = ((0xF0) | (sca_num[index]-'0')); - else - sca.szDiallingNum[j] = ((sca_num[index+1]-'0') << 4) | (sca_num[index]-'0'); - } - } - sca.szDiallingNum[(sca_length+1)/2] = '\0'; - sca.DialNumLen = strlen((char *)sca.szDiallingNum); - msg("%d", sca.DialNumLen); - returnStatus = tel_set_sms_sca (handle, &sca, 0, on_resp_set_sms_sca, NULL); - msg("Return status: [%d]", returnStatus); - break; - } - - case 2: { - msg("****Setting the BearerType(Api:SetPreferredBearer)****"); + unsigned local_index, j; - msg("Enter Bearer Type(1:PD, 2:CS, 3:PDP 4:CSP):"); - - memset (bearerType, 0, sizeof (bearerType)); + msg("*** Setting SCA (API: tel_set_sms_sca()) ****"); - ret = read (0, bearerType, sizeof (bearerType)); - if (ret <= 0) { - msg(" NULL msg can NOT be sent "); - return -1; + RETRY: + msg("Enter the SCA NUMBER:"); + ret = scanf("%s", sca_num); + if (ret > TAPI_SIM_SMSP_ADDRESS_LEN) { + msg("Entered SCA is INVALID - SCA length cannot be greater than %d", TAPI_SIM_SMSP_ADDRESS_LEN); + goto RETRY; } - msg("Set Preferred Bearer : bearerType =%d ", atoi (bearerType)); - - returnStatus = tel_set_sms_preferred_bearer (handle, - atoi (bearerType), on_resp_set_sms_preferred_bearer, NULL ); - msg("returnStatus after prefbearer set is %d", returnStatus); - - break; + sca.Npi = TAPI_SIM_NPI_ISDN_TEL; + sca.Ton = TAPI_SIM_TON_UNKNOWN; + if (sca_num[0] == '+') { + sca.Ton = TAPI_SIM_TON_INTERNATIONAL; + additional_len = 1; + } + sca_length = strlen((char *)sca_num) - additional_len; + msg("Sca Length:[%d]", sca_length); + + if (sca_length % 2 == 0) { + for (local_index = additional_len, j = 0; local_index < sca_length; local_index += 2, j++) + sca.szDiallingNum[j] = ((sca_num[local_index+1] & 0X0F) << 4) | (sca_num[local_index] & 0x0F); + sca.szDiallingNum[(sca_length/2)] = '\0'; + sca.DialNumLen = (sca_length/2); + } else { + for (local_index = additional_len, j = 0; local_index < sca_length+1; local_index += 2, j++) { + if (local_index == (sca_length - 1)) + sca.szDiallingNum[j] = ((0xF0) | (sca_num[local_index] & 0x0F)); + else + sca.szDiallingNum[j] = ((sca_num[local_index+1] & 0X0F) << 4) | (sca_num[local_index] & 0x0F); + } + sca.szDiallingNum[(sca_length/2)] = sca.szDiallingNum[(sca_length/2)] | 0xF0; + sca.DialNumLen = (sca_length/2)+1; + } + msg("%d", sca.DialNumLen); + returnStatus = tel_set_sms_sca (handle, &sca, 0, on_resp_set_sms_sca, NULL); + msg("Return status: [%d]", returnStatus); + break; } case 3: //Set Deliver Report @@ -2451,7 +1529,7 @@ static int Setting (MManager *mm, struct menu_data *menu) pCBConfig->MsgIdRangeCount = _get_int(); if (pCBConfig->MsgIdRangeCount <= 0 - || pCBConfig->MsgIdRangeCount >= TAPI_NETTEXT_GSM_SMS_CBMI_LIST_SIZE_MAX) { + || pCBConfig->MsgIdRangeCount >= TAPI_NETTEXT_SMS_CBMI_LIST_SIZE_MAX) { msg("Bad Range value"); free (pCBConfig); return -1; @@ -2487,40 +1565,41 @@ static int Setting (MManager *mm, struct menu_data *menu) break; } case 5: { - char* name = "Lpg"; - char* num = "0103001408"; - char* sca = "8210911111"; - - msg("****Setting Parameters(Api:SetParameters)****"); + unsigned int sca_length; + unsigned char sca_num[TAPI_SIM_SMSP_ADDRESS_LEN + 1]; + const char* name = "AlphaID"; smsParameters.RecordIndex = 0x00; - smsParameters.RecordLen = 31; - smsParameters.AlphaIdLen = 3; - memcpy (&smsParameters.szAlphaId, name, strlen (name)); - - smsParameters.ParamIndicator = 0xe0; - smsParameters.TpDestAddr.DialNumLen = 10; - smsParameters.TpDestAddr.Ton = 1; - smsParameters.TpDestAddr.Npi = 1; - - smsParameters.TpSvcCntrAddr.DialNumLen = 10; - smsParameters.TpSvcCntrAddr.Ton = 1; - smsParameters.TpSvcCntrAddr.Npi = 1; - - memcpy (smsParameters.TpDestAddr.szDiallingNum, num, strlen (num)); - memcpy (smsParameters.TpSvcCntrAddr.szDiallingNum, sca, - strlen (sca)); - smsParameters.TpProtocolId = 3; - smsParameters.TpDataCodingScheme = 2; - smsParameters.TpValidityPeriod = 1; - - returnStatus = tel_set_sms_parameters (handle, &smsParameters, - on_resp_set_sms_params, NULL ); + + /* Alpha Id */ + smsParameters.AlphaIdLen = strlen(name); + memcpy(&smsParameters.szAlphaId, name, strlen(name)); + + /* Param Indicator*/ + smsParameters.ParamIndicator = 0xe1; + + /* Destination Number */ + memset(&smsParameters.TpDestAddr, 0x0, sizeof(TelSmsAddressInfo_t)); + + smsParameters.TpProtocolId = 3;/* PID */ + smsParameters.TpDataCodingScheme = 2;/* DCS */ + smsParameters.TpValidityPeriod = 1;/* VP */ + + do { + msg("Enter the SCA NUMBER:"); + ret = scanf("%s", sca_num); + if (ret > TAPI_SIM_SMSP_ADDRESS_LEN) + msg("Entered SCA is INVALID - SCA length cannot be greater than %d", TAPI_SIM_SMSP_ADDRESS_LEN); + } while(ret > TAPI_SIM_SMSP_ADDRESS_LEN); + + sca_length = SmsUtilEncodeSca(&(smsParameters.TpSvcCntrAddr), sca_num); + msg("Encoded SCA Address Length[%d]", sca_length); + + returnStatus = tel_set_sms_parameters (handle, &smsParameters, on_resp_set_sms_params, NULL ); msg("returnstatus after sparam set is %d", returnStatus); break; } - case 6: //Set Memory Full Notification { msg( @@ -2540,24 +1619,6 @@ static int Setting (MManager *mm, struct menu_data *menu) } case 7: //Set Stored MsgStaus { -#if 0 //JYGU - memType=2; - index=2; - msgStauts =2; - - //TapiReadNetText(index, &CurMsgStauts, &DataPackage); - returnStatus = tel_read_sms_in_sim(index,&requestId);//To avoid mismatch of prototypes - msg("returnStatus after read is is %d",returnStatus); - - msg("Before set status : index = %d, CurMsgStauts=%d",index,msgStauts); - - returnStatus = tel_set_sms_message_status(index, msgStauts,&requestId); - msg("returnStatus after msgstatus set is %d",returnStatus); - - //tel_nettext_read(index, &CurMsgStauts, &DataPackage); - returnStatus = tel_read_sms_in_sim(index,&requestId);//To avoid mismatch of prototypes - msg("returnStatus after read is %d",returnStatus); -#endif msg("Not suppored in this Test App !!!"); break; } @@ -2567,19 +1628,6 @@ static int Setting (MManager *mm, struct menu_data *menu) break; } case 9: { -#if 0 //JYGU - int status = 0; - returnStatus =tel_check_sms_device_status(&status); - if (status == 1) - { - msg("Device Ready"); - } - else - { - msg("Device Not Ready"); - } - msg("returnStatus after read is %d",returnStatus); -#endif msg("Not suppored in this Test App !!!"); break; } @@ -2600,7 +1648,7 @@ static struct menu_data menu_sms_getting[] = { { "1", static struct menu_data menu_sms_setting[] = { { "1", "Set Service Center Number", NULL, Setting, NULL }, { "2", - "Set PreferredBearer Type", NULL, Setting, NULL }, { "3", + "Set PreferredBearer Type (Not supported)", NULL, Setting, NULL }, { "3", "Set Deliver Report", NULL, Setting, NULL }, { "4", "Set CB Enable/Disable", NULL, Setting, NULL }, { "5", "Set SMS Parameters", NULL, Setting, NULL }, { "6", diff --git a/wearable/test_src/sms.h b/test_src/sms.h similarity index 99% rename from wearable/test_src/sms.h rename to test_src/sms.h index 49ef877..778f855 100644 --- a/wearable/test_src/sms.h +++ b/test_src/sms.h @@ -1,7 +1,7 @@ /* - * Telephony test application + * libslp-tapi * - * Copyright (c) 2012 Samsung Electronics Co., Ltd. All rights reserved. + * Copyright (c) 2014 Samsung Electronics Co., Ltd. All rights reserved. * * Contact: Ja-young Gu * diff --git a/wearable/test_src/sms_util.c b/test_src/sms_util.c similarity index 85% rename from wearable/test_src/sms_util.c rename to test_src/sms_util.c index 24ecc88..e988a05 100644 --- a/wearable/test_src/sms_util.c +++ b/test_src/sms_util.c @@ -1,7 +1,7 @@ /* - * Telephony test application + * libslp-tapi * - * Copyright (c) 2012 Samsung Electronics Co., Ltd. All rights reserved. + * Copyright (c) 2014 Samsung Electronics Co., Ltd. All rights reserved. * * Contact: Ja-young Gu * @@ -21,6 +21,7 @@ #include #include #include +#include #include "sms_util.h" @@ -358,22 +359,22 @@ unsigned char* SmsUtilEncodeTimeStamp( TmDateTime* tmDateTime, unsigned char* pT int SmsUtilDecodeAddrField(char *diallingNum, char* pAddrField, int *result_ton, int *result_npi ) { - int index = 0; + int local_index = 0; int ton,npi; int DialNumLen=0; - ton = ( pAddrField[index+1] & 0x70 ) >> 4; - npi = pAddrField[index+1] & 0x0F; + ton = ( pAddrField[local_index+1] & 0x70 ) >> 4; + npi = pAddrField[local_index+1] & 0x0F; if ( ton != SMS_TON_ALPHA_NUMERIC ) { // Origination/Destination address �ʵ忡���� length�� ���� address length // origination/destination address �ʵ��� ��� length�� 0 �� ���� number type/plan �ʵ�� 0xFF ���� ���´�. - DialNumLen = pAddrField[index++]; + DialNumLen = pAddrField[local_index++]; } else { - DialNumLen = ( ( ( pAddrField[index++] + 1 ) / 2 ) * 8 ) / 7; + DialNumLen = ( ( ( pAddrField[local_index++] + 1 ) / 2 ) * 8 ) / 7; } @@ -388,15 +389,15 @@ int SmsUtilDecodeAddrField(char *diallingNum, char* pAddrField, int *result_ton printf(" DialNumLen = %d\n", DialNumLen ); - index++; /* ignore Type of Address field */ + local_index++; /* ignore Type of Address field */ if (ton != SMS_TON_ALPHA_NUMERIC ) { - SmsUtilConvertBCD2Digit( diallingNum, (char*) &pAddrField[index],DialNumLen ); + SmsUtilConvertBCD2Digit( diallingNum, (char*) &pAddrField[local_index],DialNumLen ); } else { - SmsUtilUnpackGSMCode( diallingNum, &pAddrField[index],DialNumLen ); + SmsUtilUnpackGSMCode( diallingNum, &pAddrField[local_index],DialNumLen ); } printf( "__SmsDecodeAddrField: diallingNum [%s].\n", (char*) diallingNum ); @@ -413,7 +414,7 @@ int SmsUtilDecodeAddrField(char *diallingNum, char* pAddrField, int *result_ton int SmsUtilEncodeAddrField(unsigned char* pAddrField, char* diallingNum, int DialNumLen, int ton, int npi ) { - int index = 0; + int local_index = 0; if ( diallingNum == NULL || pAddrField == NULL ) return -1; @@ -428,48 +429,49 @@ int SmsUtilEncodeAddrField(unsigned char* pAddrField, char* diallingNum, int Di if ( ton != SMS_TON_ALPHA_NUMERIC ) { // Origination/Destination address �ʵ忡���� length�� ���� address length - pAddrField[index++] = (unsigned char)DialNumLen; - //printf(" addr len packet: %d\n", pAddrField[index]); + pAddrField[local_index++] = (unsigned char)DialNumLen; + //printf(" addr len packet: %d\n", pAddrField[local_index]); } else { - pAddrField[index] = (unsigned char) ( ( ( DialNumLen * 7 + 7 ) / 8 ) * 2 ); + pAddrField[local_index] = (unsigned char) ( ( ( DialNumLen * 7 + 7 ) / 8 ) * 2 ); // ������ ����Ʈ���� ���� 4��Ʈ�� ������ ������ length �ʵ尪�� -1�� �Ѵ�. if ( ( ( DialNumLen * 7 ) % 8 ) <= 4 ) - pAddrField[index]--; + pAddrField[local_index]--; - printf(" addr len packet: %d out of SMS_TON_ALPAHA\n", pAddrField[index]); + printf(" addr len packet: %d out of SMS_TON_ALPAHA\n", pAddrField[local_index]); - index++; + local_index++; } - SET_TON_NPI( pAddrField[index], ton, npi ); + SET_TON_NPI( pAddrField[local_index], ton, npi ); - index++; // SET_TON_NPI �� MACRO �̹Ƿ� ����� �������� ���� + local_index++; // SET_TON_NPI �� MACRO �̹Ƿ� ����� �������� ���� if ( ton != SMS_TON_ALPHA_NUMERIC ) { - SmsUtilConvertDigit2BCD( (char*) &pAddrField[index], (char*) diallingNum, DialNumLen ); + SmsUtilConvertDigit2BCD( (char*) &pAddrField[local_index], (char*) diallingNum, DialNumLen ); if ( DialNumLen % 2 ) - index += DialNumLen / 2 + 1; + local_index += DialNumLen / 2 + 1; else - index += DialNumLen / 2; + local_index += DialNumLen / 2; } else { - index += SmsUtilPackGSMCode( &pAddrField[index], diallingNum, (int) DialNumLen ); + local_index += SmsUtilPackGSMCode( &pAddrField[local_index], diallingNum, (int) DialNumLen ); } - return index; + return local_index; } int SmsUtilDecodeScAddrField( SmsAddressInfo_t* pSmsAddrField, unsigned char* pAddrField ) { - printf("SmsUtilDecodeScAddrField\n"); - int index = 0; + int local_index = 0; int length = 0; + printf("SmsUtilDecodeScAddrField\n"); + if ( pSmsAddrField == NULL || pAddrField == NULL ) { printf( "SmsUtilDecodeScAddrField: pSimAddrField or pAddrField is NULL.\n" ); @@ -479,13 +481,13 @@ int SmsUtilDecodeScAddrField( SmsAddressInfo_t* pSmsAddrField, unsigned char* pA // Service Center address �ʵ忡���� length�� �ڿ� ������ byte�� �� // -> ���� address ���̴� TON/API ����Ʈ�� �����ϰ� ������ ����Ʈ�� 2�� or 2�� - 1(���� ���̰� Ȧ���ΰ��) - length = pAddrField[index]; + length = pAddrField[local_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 �ʵ� + pSmsAddrField->DialNumLen = ( pAddrField[local_index++] - 1 ) * 2; // -1�� TON/API �ʵ� // SMS_SMSP_ADDRESS_LEN ���� address length �� ũ�� SMS_SMSP_ADDRESS_LEN ��ŭ�� ��ȯ�� �Ѵ�. if ( pSmsAddrField->DialNumLen > SMS_ADDRESS_LEN_MAX ) @@ -493,12 +495,12 @@ int SmsUtilDecodeScAddrField( SmsAddressInfo_t* pSmsAddrField, unsigned char* pA pSmsAddrField->DialNumLen = SMS_ADDRESS_LEN_MAX; } - pSmsAddrField->Ton = ( pAddrField[index] & 0x70 ) >> 4; - pSmsAddrField->Npi = pAddrField[index] & 0x0F; + pSmsAddrField->Ton = ( pAddrField[local_index] & 0x70 ) >> 4; + pSmsAddrField->Npi = pAddrField[local_index] & 0x0F; - index++; /* ignore Type of Address field */ + local_index++; /* ignore Type of Address field */ - SmsUtilConvertBCD2Digit( (char*) pSmsAddrField->DialNumLen, (char*) &pAddrField[index], pSmsAddrField->DialNumLen ); + SmsUtilConvertBCD2Digit( (char*) pSmsAddrField->DialNumLen, (char*) &pAddrField[local_index], pSmsAddrField->DialNumLen ); printf( "SmsUtilDecodeScAddrField: diallingNum [%s].\n", (char*) pSmsAddrField->DialNumLen ); @@ -510,7 +512,7 @@ int SmsUtilDecodeScAddrField( SmsAddressInfo_t* pSmsAddrField, unsigned char* pA int SmsUtilEncodeScAddrField( unsigned char* pAddrField, SmsAddressInfo_t * pSmsAddrField ) { - int index = 0; + int local_index = 0; if ( pSmsAddrField == NULL || pAddrField == NULL ) return -1; @@ -519,25 +521,25 @@ int SmsUtilDecodeScAddrField( SmsAddressInfo_t* pSmsAddrField, unsigned char* pA // -> ���� address ���̴� TON/API ����Ʈ�� �����ϰ� ������ ����Ʈ�� 2�� or 2�� - 1(���� ���̰� Ȧ���ΰ��) if ( pSmsAddrField->DialNumLen % 2 ) { - pAddrField[index++] = pSmsAddrField->DialNumLen / 2 + 1 + 1; // +1 �� TON/NPI �ʵ�, Ȧ������ ���� ������ ���߱� ���� �ѹ� �� +1 + pAddrField[local_index++] = pSmsAddrField->DialNumLen / 2 + 1 + 1; // +1 �� TON/NPI �ʵ�, Ȧ������ ���� ������ ���߱� ���� �ѹ� �� +1 } else { - pAddrField[index++] = pSmsAddrField->DialNumLen / 2 + 1; // +1 �� TON/NPI �ʵ� + pAddrField[local_index++] = pSmsAddrField->DialNumLen / 2 + 1; // +1 �� TON/NPI �ʵ� } - SET_TON_NPI( pAddrField[index], pSmsAddrField->Ton, pSmsAddrField->Npi ); + SET_TON_NPI( pAddrField[local_index], pSmsAddrField->Ton, pSmsAddrField->Npi ); - index++; // SET_TON_NPI �� MACRO �̹Ƿ� ����� �������� ���׹߻� + local_index++; // SET_TON_NPI �� MACRO �̹Ƿ� ����� �������� ���׹߻� - SmsUtilConvertDigit2BCD( (char*) &pAddrField[index], (char*) pSmsAddrField->DialNumLen, pSmsAddrField->DialNumLen ); + SmsUtilConvertDigit2BCD( (char*) &pAddrField[local_index], (char*) pSmsAddrField->DialNumLen, pSmsAddrField->DialNumLen ); if ( pSmsAddrField->DialNumLen % 2 ) - index += pSmsAddrField->DialNumLen / 2 + 1; + local_index += pSmsAddrField->DialNumLen / 2 + 1; else - index += pSmsAddrField->DialNumLen / 2; + local_index += pSmsAddrField->DialNumLen / 2; - return index; + return local_index; } void SmsUtilDecodeDCS( Sms_coding_scheme* pCodingScheme, unsigned char dcs ) @@ -571,6 +573,10 @@ void SmsUtilDecodeDCS( Sms_coding_scheme* pCodingScheme, unsigned char dcs ) case 0x03: pCodingScheme->class_type = SMS_CLASS_3; break; + default : + /*Do Nothing*/ + dbg("Default case executed. Invalid option."); + break; } } else // bit 4 = 0 : indicates that bits 1 to 0 are reserved and have no message class meaning @@ -590,6 +596,10 @@ void SmsUtilDecodeDCS( Sms_coding_scheme* pCodingScheme, unsigned char dcs ) case 0x0C: pCodingScheme->alphabet_type = SMS_ALPHABET_MAX; break; + default : + /*Do Nothing*/ + dbg("Default case executed. Invalid option."); + 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 @@ -617,6 +627,10 @@ void SmsUtilDecodeDCS( Sms_coding_scheme* pCodingScheme, unsigned char dcs ) case 0x03: pCodingScheme->class_type = SMS_CLASS_3; break; + default : + /*Do Nothing*/ + dbg("Default case executed. Invalid option."); + break; } } else // bit 4 = 0 : indicates that bits 1 to 0 are reserved and have no message class meaning @@ -636,6 +650,10 @@ void SmsUtilDecodeDCS( Sms_coding_scheme* pCodingScheme, unsigned char dcs ) case 0x0C: pCodingScheme->alphabet_type = SMS_ALPHABET_MAX; break; + default : + /*Do Nothing*/ + dbg("Default case executed. Invalid option."); + break; } } // bits 7..4 = 1000 ~ 1011 : reserved @@ -664,6 +682,10 @@ void SmsUtilDecodeDCS( Sms_coding_scheme* pCodingScheme, unsigned char dcs ) case 0x03: pCodingScheme->waiting_type = SMS_WAITING_OTHER_MSG; break; + default : + /*Do Nothing*/ + dbg("Default case executed. Invalid option."); + break; } } else if ( dcs < 0xF0 ) @@ -687,6 +709,10 @@ void SmsUtilDecodeDCS( Sms_coding_scheme* pCodingScheme, unsigned char dcs ) case 0x03: pCodingScheme->waiting_type = SMS_WAITING_OTHER_MSG; break; + default : + /*Do Nothing*/ + dbg("Default case executed. Invalid option."); + break; } } else @@ -710,15 +736,20 @@ void SmsUtilDecodeDCS( Sms_coding_scheme* pCodingScheme, unsigned char dcs ) case 0x03: pCodingScheme->class_type = SMS_CLASS_3; break; + default : + /*Do Nothing*/ + dbg("Default case executed. Invalid option."); + break; } } } void SmsUtilEncodeDCS( unsigned char* pDCS, Sms_coding_scheme* pCodingScheme ) { - printf("SmsUtilEncodeDCS Start\n"); unsigned char dcs = 0x00; + printf("SmsUtilEncodeDCS Start\n"); + assert( pCodingScheme != NULL ); if( pCodingScheme->coding_group_type == SMS_CODGRP_SM_GENERAL_DCS ) // bit 7..4 is 00xx @@ -839,7 +870,7 @@ void SmsUtilEncodeDCS( unsigned char* pDCS, Sms_coding_scheme* pCodingScheme ) unsigned char SmsUtilEncodeValidity( unsigned char* pValidity, Sms_vp* pVP ) { - unsigned char pos = 0; + unsigned char pos = 0; switch( pVP->vp_type ) { @@ -859,6 +890,11 @@ unsigned char SmsUtilEncodeValidity( unsigned char* pValidity, Sms_vp* pVP ) case SMS_VP_ENHANCED: break; + + default : + /*Do Nothing*/ + dbg("Default Case executed. Invalid Option."); + break; } return pos; diff --git a/wearable/test_src/sms_util.h b/test_src/sms_util.h similarity index 99% rename from wearable/test_src/sms_util.h rename to test_src/sms_util.h index 4edbe9d..f175117 100644 --- a/wearable/test_src/sms_util.h +++ b/test_src/sms_util.h @@ -1,7 +1,7 @@ /* - * Telephony test application + * libslp-tapi * - * Copyright (c) 2012 Samsung Electronics Co., Ltd. All rights reserved. + * Copyright (c) 2014 Samsung Electronics Co., Ltd. All rights reserved. * * Contact: Ja-young Gu * diff --git a/wearable/test_src/ss.c b/test_src/ss.c old mode 100755 new mode 100644 similarity index 99% rename from wearable/test_src/ss.c rename to test_src/ss.c index 06a2f23..b0bfc1e --- a/wearable/test_src/ss.c +++ b/test_src/ss.c @@ -1,7 +1,7 @@ /* - * Telephony test application + * libslp-tapi * - * Copyright (c) 2012 Samsung Electronics Co., Ltd. All rights reserved. + * Copyright (c) 2014 Samsung Electronics Co., Ltd. All rights reserved. * * Contact: Ja-young Gu * @@ -285,10 +285,12 @@ static int run_ss_set_barring(MManager *mm, struct menu_data *menu) memset(&info, 0, sizeof(TelSsBarringInfo_t)); info.Class = atoi(data_ss_set_barring_class); + info.Mode = atoi(data_ss_set_barring_mode); info.Type = atoi(data_ss_set_barring_type); g_strlcpy(info.szPassword, data_ss_set_barring_password, TAPI_SS_GSM_BARR_PW_LEN_MAX+1); msg("info.szPassword - %s data_ss_set_barring_password- %s\n", info.szPassword, data_ss_set_barring_password); + msg("Call barring Mode [%d]\n", info.Mode); result = tel_set_ss_barring(handle, &info, on_ss_barring, NULL); if (result != TAPI_API_SUCCESS) { diff --git a/wearable/test_src/ss.h b/test_src/ss.h similarity index 88% rename from wearable/test_src/ss.h rename to test_src/ss.h index 40ecde1..47a9082 100644 --- a/wearable/test_src/ss.h +++ b/test_src/ss.h @@ -1,7 +1,7 @@ /* - * Telephony test application + * libslp-tapi * - * Copyright (c) 2012 Samsung Electronics Co., Ltd. All rights reserved. + * Copyright (c) 2014 Samsung Electronics Co., Ltd. All rights reserved. * * Contact: Ja-young Gu * diff --git a/wearable/TC/README.txt b/wearable/TC/README.txt deleted file mode 100644 index 51869b8..0000000 --- a/wearable/TC/README.txt +++ /dev/null @@ -1,55 +0,0 @@ -Test-Case ------------------------------------------------------------------------------- - - TETware is suck, but nevertheless we should use this tool. - - - -Add TC code ------------------------------------------------------------------------------- - -1. create your code to testcase/{your-code}.c -2. add '/textcase/{your-code}' to textcase/tslist file - - - -Build ------------------------------------------------------------------------------- - -$ ./gbs_setup.sh -(tizen-build-env)# cd /var/tmp/dts_fw -(tizen-build-env)# ./build.sh -(tizen-build-env)# cat results/build-tar-result-{timestamp}.journal -check the build log (ignore testcase/tet_xres: No such file or directory) -(tizen-build-env)# cat testcase/tet_captured -check the build log -(tizen-build-env)# exit - - - -Copy to Target ------------------------------------------------------------------------------- - -first-time: copy TETware & all build results to target -$ ./push.sh - -after-only-update -$ sdb push testcase/utc_{XXX} /opt/home/tapi/testcase/ - - - -Run ------------------------------------------------------------------------------- - -$ sdb shell -sh-4.1# cd /opt/home/tapi/ -sh-4.1# ./execute.sh - - - -Test Report ------------------------------------------------------------------------------- - -sh-4.1# cat /opt/home/tapi/result/exec-tar-result-{timestamp}.journal -check FAIL case - diff --git a/wearable/TC/_export_env.sh b/wearable/TC/_export_env.sh deleted file mode 100755 index 467c30b..0000000 --- a/wearable/TC/_export_env.sh +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/sh - -source ./config - -export TET_INSTALL_PATH=$TET_INSTALL_HOST_PATH # tetware root path -export TET_TARGET_PATH=$TET_INSTALL_PATH/tetware-target # tetware target path -export PATH=$TET_TARGET_PATH/bin:$PATH -export LD_LIBRARY_PATH=$TET_TARGET_PATH/lib/tet3:$LD_LIBRARY_PATH -export TET_ROOT=$TET_TARGET_PATH diff --git a/wearable/TC/_export_target_env.sh b/wearable/TC/_export_target_env.sh deleted file mode 100755 index c5b2e14..0000000 --- a/wearable/TC/_export_target_env.sh +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/sh -source ./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 diff --git a/wearable/TC/build.sh b/wearable/TC/build.sh deleted file mode 100755 index 72aad6c..0000000 --- a/wearable/TC/build.sh +++ /dev/null @@ -1,16 +0,0 @@ -#!/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 diff --git a/wearable/TC/clean.sh b/wearable/TC/clean.sh deleted file mode 100755 index 29743e0..0000000 --- a/wearable/TC/clean.sh +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/sh - -. ./_export_env.sh # setting environment variables - -export TET_SUITE_ROOT=`pwd` -RESULT_DIR=results - -tcc -c -p ./ # executing tcc, with clean option (-c) -rm -r $RESULT_DIR -rm -r tet_tmp_dir -rm testcase/tet_captured diff --git a/wearable/TC/config b/wearable/TC/config deleted file mode 100644 index 9b8af15..0000000 --- a/wearable/TC/config +++ /dev/null @@ -1,3 +0,0 @@ -PKG_NAME=tapi -TET_INSTALL_HOST_PATH=/var/tmp/dts_fw/TETware -TET_INSTALL_TARGET_PATH=/opt/home/$PKG_NAME/TETware diff --git a/wearable/TC/execute.sh b/wearable/TC/execute.sh deleted file mode 100755 index 0fe02e2..0000000 --- a/wearable/TC/execute.sh +++ /dev/null @@ -1,15 +0,0 @@ -#!/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 diff --git a/wearable/TC/gbs_setup.sh b/wearable/TC/gbs_setup.sh deleted file mode 100755 index 8414be3..0000000 --- a/wearable/TC/gbs_setup.sh +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/sh - -sudo mkdir -p ~/GBS-ROOT/local/BUILD-ROOTS/scratch.armv7l.0/var/tmp/dts_fw -sudo mount -o bind . ~/GBS-ROOT/local/BUILD-ROOTS/scratch.armv7l.0/var/tmp/dts_fw -gbs chroot -r ~/GBS-ROOT/local/BUILD-ROOTS/scratch.armv7l.0 - -# do somgthing... - -sudo umount ~/GBS-ROOT/local/BUILD-ROOTS/scratch.armv7l.0/var/tmp/dts_fw diff --git a/wearable/TC/push.sh b/wearable/TC/push.sh deleted file mode 100755 index 2bbab27..0000000 --- a/wearable/TC/push.sh +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/sh - -. ./config - -TC_PATH=/opt/home/$PKG_NAME - -echo $TC_PATH - -sdb root on -sdb shell "mkdir -p $TC_PATH" -sdb push . $TC_PATH diff --git a/wearable/TC/testcase/Makefile b/wearable/TC/testcase/Makefile deleted file mode 100644 index 751eb02..0000000 --- a/wearable/TC/testcase/Makefile +++ /dev/null @@ -1,27 +0,0 @@ -include ../config - -CC ?= gcc - -C_FILES = $(shell ls utc*.c) - -PKGS = $(PKG_NAME) -PKGS += glib-2.0 - -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 utc*.c | cut -d. -f1) - -all: $(TCS) - -%: %.c - $(CC) -o $@ $< util_common.c $(CFLAGS) $(LDFLAGS) - -clean: - rm -f $(TCS) diff --git a/wearable/TC/testcase/tslist b/wearable/TC/testcase/tslist deleted file mode 100644 index 56bc23b..0000000 --- a/wearable/TC/testcase/tslist +++ /dev/null @@ -1,10 +0,0 @@ -/testcase/utc_common -/testcase/utc_network -/testcase/utc_call -/testcase/utc_ss -/testcase/utc_sim -/testcase/utc_sat -/testcase/utc_sms -/testcase/utc_sap -/testcase/utc_modem -/testcase/utc_gps diff --git a/wearable/TC/testcase/utc_call.c b/wearable/TC/testcase/utc_call.c deleted file mode 100755 index 9aaa5ad..0000000 --- a/wearable/TC/testcase/utc_call.c +++ /dev/null @@ -1,1358 +0,0 @@ -/* - * libslp-tapi - * - * Copyright (c) 2013 Samsung Electronics Co., Ltd. All rights reserved. - * - * Contact: Ja-young Gu - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT 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 "util_common.h" - -TapiHandle *handle; -enum async_state async_flag; - -char szNumber[TAPI_CALL_DIALDIGIT_LEN_MAX + 1] = "+919535009683"; -char emer_num[4] = "911"; -unsigned call_id = 1; -unsigned call_id2 = 2; - -TelCallType_t call_type[3] = { - TAPI_CALL_TYPE_VOICE, - TAPI_CALL_TYPE_DATA, - TAPI_CALL_TYPE_E911 -} ; - -TelCallEmergencyCategory_t emergency_category[9] = { - TAPI_CALL_ECC_DEFAULT, - TAPI_CALL_ECC_POLICE, - TAPI_CALL_ECC_AMBULANCE, - TAPI_CALL_ECC_FIREBRIGADE, - TAPI_CALL_ECC_MARINEGUARD, - TAPI_CALL_ECC_MOUNTAINRESCUE, - TAPI_CALL_ECC_MANUAL_ECALL, - TAPI_CALL_ECC_AUTO_ECALL, - TAPI_CALL_ECC_NONE -}; - -TelCallAnswerType_t answer_type[4] = { - TAPI_CALL_ANSWER_ACCEPT, - TAPI_CALL_ANSWER_REJECT, - TAPI_CALL_ANSWER_REPLACE, - TAPI_CALL_ANSWER_HOLD_AND_ACCEPT -} ; - -TelCallEndType_t end_type[4] = { - TAPI_CALL_END, - TAPI_CALL_END_ALL, - TAPI_CALL_END_ACTIVE_ALL, - TAPI_CALL_END_HOLD_ALL -} ; - -TelSoundVolume_t sound_volume[10] ={ - TAPI_SOUND_MUTE, - TAPI_SOUND_VOLUME_LEVEL_1, - TAPI_SOUND_VOLUME_LEVEL_2, - TAPI_SOUND_VOLUME_LEVEL_3, - TAPI_SOUND_VOLUME_LEVEL_4, - TAPI_SOUND_VOLUME_LEVEL_5, - TAPI_SOUND_VOLUME_LEVEL_6, - TAPI_SOUND_VOLUME_LEVEL_7, - TAPI_SOUND_VOLUME_LEVEL_8, - TAPI_SOUND_VOLUME_LEVEL_9 -} ; - -TelSoundRecording_t sound_recording[2] = { - TAPI_SOUND_RECORDING_OFF, - TAPI_SOUND_RECORDING_ON -} ; - -TelSoundDevice_t sound_device[6] = { - TAPI_SOUND_DEVICE_RECEIVER, - TAPI_SOUND_DEVICE_SPEAKER_PHONE, - TAPI_SOUND_DEVICE_HFK, - TAPI_SOUND_DEVICE_HEADSET, - TAPI_SOUND_DEVICE_BLUETOOTH, - TAPI_SOUND_DEVICE_EC -} ; - -TelSoundType_t sound_type [6] = { - TAPI_SOUND_TYPE_VOICE, - TAPI_SOUND_TYPE_KEYTONE, - TAPI_SOUND_TYPE_BELL, - TAPI_SOUND_TYPE_MESSAGE, - TAPI_SOUND_TYPE_ALARM, - TAPI_SOUND_TYPE_PDA_MISC -} ; - -TelSoundPath_t sound_path[11] = { - TAPI_SOUND_PATH_HANDSET, - TAPI_SOUND_PATH_HEADSET, - TAPI_SOUND_PATH_HANDSFREE, - TAPI_SOUND_PATH_BLUETOOTH, - TAPI_SOUND_PATH_STEREO_BLUETOOTH, - TAPI_SOUND_PATH_SPK_PHONE, - TAPI_SOUND_PATH_HEADSET_3_5PI, - TAPI_SOUND_PATH_BT_NSEC_OFF, - TAPI_SOUND_PATH_MIC1, - TAPI_SOUND_PATH_MIC2, - TAPI_SOUND_PATH_HEADSET_HAC -} ; - -unsigned int extra_vol[2] = { 0, 1 }; -unsigned int clock_status[2] = { 0, 1 }; - - -TelSoundMuteStatus_t mute_status [2] = { - TAPI_SOUND_MUTE_STATUS_OFF, - TAPI_SOUND_MUTE_STATUS_ON -} ; - -TelSoundNoiseReduction_t sound_noise[2] = { - TAPI_SOUND_NOISE_REDUCTION_OFF, - TAPI_SOUND_NOISE_REDUCTION_ON -} ; - -TelSoundEqualizationMode_t sound_equalization[6] = { - TAPI_SOUND_EQUALIZATION_MODE_OFF, - TAPI_SOUND_EQUALIZATION_MODE_ON, - TAPI_SOUND_EQUALIZATION_MODE_FLAG_OFF, - TAPI_SOUND_EQUALIZATION_MODE_FLAG_ON, - TAPI_SOUND_EQUALIZATION_MODE_SOFT1, - TAPI_SOUND_EQUALIZATION_MODE_SOFT2, -} ; - -TelSoundDirection_t sound_direction[2] = { - TAPI_SOUND_DIRECTION_LEFT, - TAPI_SOUND_DIRECTION_RIGHT, -} ; - - -TelSoundMutePath_t mute_path[3] = { - TAPI_SOUND_MUTE_PATH_TX, - TAPI_SOUND_MUTE_PATH_RX, - TAPI_SOUND_MUTE_PATH_ALL -} ; - -/* Dial Call Macro */ -#define DO_DIAL_CALL(func, param1, param2, param3) \ - static void on_##func(TapiHandle *handle, int result, void *data, void *user_data) \ - { \ - int *value = user_data; \ -\ - async_flag = ASYNC_DONE; \ - util_stop_loop(); \ -\ - if (*value != 0xC0FFEE) { \ - dts_fail(#func, "Callback userdata crashed"); \ - } \ - } \ -\ - static void utc_##func (TelCallType_t param1, TelCallEmergencyCategory_t param2, char *param3) \ - { \ - TelCallDial_t info; \ - int ret; \ - int len;\ - int value = 0xC0FFEE; \ -\ - /* with callback */ \ - util_init_loop(); \ -\ - async_flag = ASYNC_READY; \ - memset(&info, 0, sizeof(TelCallDial_t)); \ - len = strlen(param3); \ - info.CallType =param1; \ - info.Ecc = param2; \ - memcpy(info.szNumber, param3, len); \ - ret = tel_dial_call (handle, &info, on_##func, &value); \ - if (ret != TAPI_API_SUCCESS) { \ - dts_fail(#func, "Unexpected return"); \ - } \ -\ - util_start_loop(); \ - util_free_loop(); \ -\ - if (async_flag != ASYNC_DONE) { \ - dts_fail(#func, "Callback not invoked"); \ - } \ -\ - dts_pass(#func); \ - } \ -\ - static void utc_fail_##func (TelCallType_t param1, TelCallEmergencyCategory_t param2, char *param3) \ - { \ - int ret; \ -\ - ret = tel_dial_call (NULL, NULL, NULL,NULL); \ - dts_check_ne(#func, ret, TAPI_API_SUCCESS, "Unexpected return"); \ - } - -/* Answer Call Macro */ -#define DO_ANSWER_CALL(func, param1, param2) \ - static void on_##func(TapiHandle *handle, int result, void *data, void *user_data) \ - { \ - int *value = user_data; \ -\ - async_flag = ASYNC_DONE; \ - util_stop_loop(); \ -\ - if (*value != 0xC0FFEE) { \ - dts_fail(#func, "Callback userdata crashed"); \ - } \ - if (result != 0x0) { \ - dts_fail(#func, "Operation failed"); \ - } \ - } \ -\ - static void utc_##func (unsigned int param1, TelCallAnswerType_t param2) \ - { \ - int ret; \ - int value = 0xC0FFEE; \ -\ - /* with callback */ \ - util_init_loop(); \ -\ - async_flag = ASYNC_READY; \ - ret = tel_answer_call (handle, param1, param2, on_##func, &value); \ - if (ret != TAPI_API_SUCCESS) { \ - dts_fail(#func, "Unexpected return"); \ - } \ -\ - util_start_loop(); \ - util_free_loop(); \ -\ - if (async_flag != ASYNC_DONE) { \ - dts_fail(#func, "Callback not invoked"); \ - } \ -\ - dts_pass(#func); \ - } \ -\ - static void utc_fail_##func (unsigned int param1, TelCallAnswerType_t param2) \ - { \ - int ret; \ -\ - ret = tel_answer_call (NULL, 0, 0,NULL, NULL); \ - dts_check_ne(#func, ret, TAPI_API_SUCCESS, "Unexpected return"); \ - } - - -/* End Call Macro */ -#define DO_END_CALL(func, param1, param2) \ - static void on_##func(TapiHandle *handle, int result, void *data, void *user_data) \ - { \ - int *value = user_data; \ -\ - async_flag = ASYNC_DONE; \ - util_stop_loop(); \ -\ - if (*value != 0xC0FFEE) { \ - dts_fail(#func, "Callback userdata crashed"); \ - } \ - } \ -\ - static void utc_##func (unsigned int param1, TelCallEndType_t param2) \ - { \ - int ret; \ - int value = 0xC0FFEE; \ -\ - /* with callback */ \ - util_init_loop(); \ -\ - async_flag = ASYNC_READY; \ - ret = tel_end_call (handle, param1, param2, on_##func, &value); \ - if (ret != TAPI_API_SUCCESS) { \ - dts_fail(#func, "Unexpected return"); \ - } \ -\ - util_start_loop(); \ - util_free_loop(); \ -\ - if (async_flag != ASYNC_DONE) { \ - dts_fail(#func, "Callback not invoked"); \ - } \ -\ - dts_pass(#func); \ - } \ -\ - static void utc_fail_##func (unsigned int param1, TelCallEndType_t param2) \ - { \ - int ret; \ -\ - ret = tel_end_call (NULL, 0, 0, NULL, NULL); \ - dts_check_ne(#func, ret, TAPI_API_SUCCESS, "Unexpected return"); \ - } - -/* Manage Call Macro (hold/active/spit/transfer */ -#define DO_MANAGE_CALL(func, param1) \ - static void on_##func(TapiHandle *handle, int result, void *data, void *user_data) \ - { \ - int *value = user_data; \ -\ - async_flag = ASYNC_DONE; \ - util_stop_loop(); \ -\ - if (*value != 0xC0FFEE) { \ - dts_fail(#func, "Callback userdata crashed"); \ - } \ - } \ -\ - static void utc_##func (unsigned int param1) \ - { \ - int ret; \ - int value = 0xC0FFEE; \ -\ - /* with callback */ \ - util_init_loop(); \ -\ - async_flag = ASYNC_READY; \ - ret = func (handle, param1, on_##func, &value); \ - if (ret != TAPI_API_SUCCESS) { \ - dts_fail(#func, "Unexpected return"); \ - } \ -\ - util_start_loop(); \ - util_free_loop(); \ -\ - if (async_flag != ASYNC_DONE) { \ - dts_fail(#func, "Callback not invoked"); \ - } \ -\ - dts_pass(#func); \ - } \ -\ - static void utc_fail_##func (unsigned int param1) \ - { \ - int ret; \ -\ - ret = func (NULL, 0, NULL,NULL); \ - dts_check_ne(#func, ret, TAPI_API_SUCCESS, "Unexpected return"); \ - } - -/* Swap/join Call Macro */ -#define DO_SWAP_JOIN_CALL(func, param1, param2) \ - static void on_##func(TapiHandle *handle, int result, void *data, void *user_data) \ - { \ - int *value = user_data; \ -\ - async_flag = ASYNC_DONE; \ - util_stop_loop(); \ -\ - if (*value != 0xC0FFEE) { \ - dts_fail(#func, "Callback userdata crashed"); \ - } \ - } \ -\ - static void utc_##func (unsigned int param1, unsigned int param2) \ - { \ - int ret; \ - int value = 0xC0FFEE; \ -\ - /* with callback */ \ - util_init_loop(); \ -\ - async_flag = ASYNC_READY; \ - ret = func (handle, param1, param2, on_##func, &value); \ - if (ret != TAPI_API_SUCCESS) { \ - dts_fail(#func, "Unexpected return"); \ - } \ -\ - util_start_loop(); \ - util_free_loop(); \ -\ - if (async_flag != ASYNC_DONE) { \ - dts_fail(#func, "Callback not invoked"); \ - } \ -\ - dts_pass(#func); \ - } \ -\ - static void utc_fail_##func (unsigned int param1, unsigned int param2) \ - { \ - int ret; \ -\ - ret = func (NULL, 0, 0, NULL,NULL); \ - dts_check_ne(#func, ret, TAPI_API_SUCCESS, "Unexpected return"); \ - } - - -/* Get Call Volume info Macro */ -#define DO_GET_CALL_VOLUME_INFO(func, param1, param2) \ - static void on_##func(TapiHandle *handle, int result, void *data, void *user_data) \ - { \ - int *value = user_data; \ -\ - async_flag = ASYNC_DONE; \ - util_stop_loop(); \ -\ - if (*value != 0xC0FFEE) { \ - dts_fail(#func, "Callback userdata crashed"); \ - } \ - } \ -\ - static void utc_##func (TelSoundDevice_t param1, TelSoundType_t param2) \ - { \ - int ret; \ - int value = 0xC0FFEE; \ -\ - /* with callback */ \ - util_init_loop(); \ -\ - async_flag = ASYNC_READY; \ - ret = tel_get_call_volume_info (handle, param1, param2, on_##func, &value); \ - if (ret != TAPI_API_SUCCESS) { \ - dts_fail(#func, "Unexpected return"); \ - } \ -\ - util_start_loop(); \ - util_free_loop(); \ -\ - if (async_flag != ASYNC_DONE) { \ - dts_fail(#func, "Callback not invoked"); \ - } \ -\ - dts_pass(#func); \ - } \ -\ - static void utc_fail_##func (TelSoundDevice_t param1, TelSoundType_t param2) \ - { \ - int ret; \ -\ - ret = tel_get_call_volume_info (NULL, 0, 0, NULL, NULL); \ - dts_check_ne(#func, ret, TAPI_API_SUCCESS, "Unexpected return"); \ - } - - -/* Set Call Volume info Macro */ -#define DO_SET_CALL_VOLUME_INFO(func, param1, param2, param3) \ - static void on_##func(TapiHandle *handle, int result, void *data, void *user_data) \ - { \ - int *value = user_data; \ -\ - async_flag = ASYNC_DONE; \ - util_stop_loop(); \ -\ - if (*value != 0xC0FFEE) { \ - dts_fail(#func, "Callback userdata crashed"); \ - } \ - } \ -\ - static void utc_##func (TelSoundDevice_t param1, TelSoundType_t param2, TelSoundVolume_t param3) \ - { \ - TelCallVolumeInfo_t info; \ - int ret; \ - int value = 0xC0FFEE; \ -\ - /* with callback */ \ - util_init_loop(); \ -\ - async_flag = ASYNC_READY; \ - memset(&info, 0x0, sizeof(TelCallVolumeInfo_t)); \ - info.device = param1; \ - info.type = param2; \ - info.volume = param3; \ - ret = tel_set_call_volume_info (handle, &info, on_##func, &value); \ - if (ret != TAPI_API_SUCCESS) { \ - dts_fail(#func, "Unexpected return"); \ - } \ -\ - util_start_loop(); \ - util_free_loop(); \ -\ - if (async_flag != ASYNC_DONE) { \ - dts_fail(#func, "Callback not invoked"); \ - } \ -\ - dts_pass(#func); \ - } \ -\ - static void utc_fail_##func (TelSoundDevice_t param1, TelSoundType_t param2, TelSoundVolume_t param3) \ - { \ - int ret; \ -\ - ret = tel_set_call_volume_info (NULL, NULL, NULL, NULL); \ - dts_check_ne(#func, ret, TAPI_API_SUCCESS, "Unexpected return"); \ - } - -/* Set Call sound path Macro */ -#define DO_SET_CALL_SOUND_PATH(func, param1, param2) \ - static void on_##func(TapiHandle *handle, int result, void *data, void *user_data) \ - { \ - int *value = user_data; \ -\ - async_flag = ASYNC_DONE; \ - util_stop_loop(); \ -\ - if (*value != 0xC0FFEE) { \ - dts_fail(#func, "Callback userdata crashed"); \ - } \ - } \ -\ - static void utc_##func (TelSoundPath_t param1, unsigned int param2) \ - { \ - TelCallSoundPathInfo_t info; \ - int ret; \ - int value = 0xC0FFEE; \ -\ - /* with callback */ \ - util_init_loop(); \ -\ - async_flag = ASYNC_READY; \ - memset(&info, 0x0, sizeof(TelCallSoundPathInfo_t)); \ - info.path = param1; \ - info.ex_volume = param2; \ - ret = tel_set_call_sound_path (handle, &info, on_##func, &value); \ - if (ret != TAPI_API_SUCCESS) { \ - dts_fail(#func, "Unexpected return"); \ - } \ -\ - util_start_loop(); \ - util_free_loop(); \ -\ - if (async_flag != ASYNC_DONE) { \ - dts_fail(#func, "Callback not invoked"); \ - } \ -\ - dts_pass(#func); \ - } \ -\ - static void utc_fail_##func (TelSoundPath_t param1, unsigned int param2) \ - { \ - int ret; \ -\ - ret = tel_set_call_sound_path (NULL, NULL, NULL, NULL); \ - dts_check_ne(#func, ret, TAPI_API_SUCCESS, "Unexpected return"); \ - } - -/* Set Call mute status Macro */ -#define DO_SET_CALL_MUTE_STATUS(func, param1, param2) \ - static void on_##func(TapiHandle *handle, int result, void *data, void *user_data) \ - { \ - int *value = user_data; \ -\ - async_flag = ASYNC_DONE; \ - util_stop_loop(); \ -\ - if (*value != 0xC0FFEE) { \ - dts_fail(#func, "Callback userdata crashed"); \ - } \ - } \ -\ - static void utc_##func (TelSoundMuteStatus_t param1, TelSoundMutePath_t param2) \ - { \ - int ret; \ - int value = 0xC0FFEE; \ -\ - /* with callback */ \ - util_init_loop(); \ -\ - async_flag = ASYNC_READY; \ - ret = tel_set_call_mute_status (handle, param1, param2, on_##func, &value); \ - if (ret != TAPI_API_SUCCESS) { \ - dts_fail(#func, "Unexpected return"); \ - } \ -\ - util_start_loop(); \ - util_free_loop(); \ -\ - if (async_flag != ASYNC_DONE) { \ - dts_fail(#func, "Callback not invoked"); \ - } \ -\ - dts_pass(#func); \ - } \ -\ - static void utc_fail_##func (TelSoundMuteStatus_t param1, TelSoundMutePath_t param2) \ - { \ - int ret; \ -\ - ret = tel_set_call_mute_status (NULL, 0, 0, NULL, NULL); \ - dts_check_ne(#func, ret, TAPI_API_SUCCESS, "Unexpected return"); \ - } - -/* Set Call Sound Recording Macro */ -#define DO_SET_CALL_SOUND_RECORDING(func, param1) \ - static void on_##func(TapiHandle *handle, int result, void *data, void *user_data) \ - { \ - int *value = user_data; \ -\ - async_flag = ASYNC_DONE; \ - util_stop_loop(); \ -\ - if (*value != 0xC0FFEE) { \ - dts_fail(#func, "Callback userdata crashed"); \ - } \ - } \ -\ - static void utc_##func (TelSoundRecording_t param1) \ - { \ - int ret; \ - int value = 0xC0FFEE; \ -\ - /* with callback */ \ - util_init_loop(); \ -\ - async_flag = ASYNC_READY; \ - ret = tel_set_call_sound_recording (handle, ¶m1, on_##func, &value); \ - if (ret != TAPI_API_SUCCESS) { \ - dts_fail(#func, "Unexpected return"); \ - } \ -\ - util_start_loop(); \ - util_free_loop(); \ -\ - if (async_flag != ASYNC_DONE) { \ - dts_fail(#func, "Callback not invoked"); \ - } \ -\ - dts_pass(#func); \ - } \ -\ - static void utc_fail_##func (TelSoundRecording_t param1) \ - { \ - int ret; \ -\ - ret = tel_set_call_sound_recording (NULL, NULL, NULL, NULL); \ - dts_check_ne(#func, ret, TAPI_API_SUCCESS, "Unexpected return"); \ - } - - -/* Set Call Sound Equalization Macro */ -#define DO_SET_CALL_SOUND_EQUALIZATION(func, param1, param2) \ - static void on_##func(TapiHandle *handle, int result, void *data, void *user_data) \ - { \ - int *value = user_data; \ -\ - async_flag = ASYNC_DONE; \ - util_stop_loop(); \ -\ - if (*value != 0xC0FFEE) { \ - dts_fail(#func, "Callback userdata crashed"); \ - } \ - } \ -\ - static void utc_##func (TelSoundEqualizationMode_t param1, TelSoundDirection_t param2) \ - { \ - TelCallSoundEqualization_t info; \ - int ret; \ - int value = 0xC0FFEE; \ -\ - /* with callback */ \ - util_init_loop(); \ -\ - async_flag = ASYNC_READY; \ - memset(&info, 0x0, sizeof(TelCallSoundEqualization_t)); \ - info.mode = param1; \ - info.direction = param2 ; \ - ret = tel_set_call_sound_equalization (handle, &info, on_##func, &value); \ - if (ret != TAPI_API_SUCCESS) { \ - dts_fail(#func, "Unexpected return"); \ - } \ -\ - util_start_loop(); \ - util_free_loop(); \ -\ - if (async_flag != ASYNC_DONE) { \ - dts_fail(#func, "Callback not invoked"); \ - } \ -\ - dts_pass(#func); \ - } \ -\ - static void utc_fail_##func (TelSoundEqualizationMode_t param1, TelSoundDirection_t param2) \ - { \ - int ret; \ -\ - ret = tel_set_call_sound_equalization (NULL, NULL, NULL, NULL); \ - dts_check_ne(#func, ret, TAPI_API_SUCCESS, "Unexpected return"); \ - } - - -/* Set Call Sound Noise Reduction Macro */ -#define DO_SET_CALL_SOUND_NOISE_REDUCTION(func, param1) \ - static void on_##func(TapiHandle *handle, int result, void *data, void *user_data) \ - { \ - int *value = user_data; \ -\ - async_flag = ASYNC_DONE; \ - util_stop_loop(); \ -\ - if (*value != 0xC0FFEE) { \ - dts_fail(#func, "Callback userdata crashed"); \ - } \ - } \ -\ - static void utc_##func (TelSoundNoiseReduction_t param1) \ - { \ - int ret; \ - int value = 0xC0FFEE; \ -\ - /* with callback */ \ - util_init_loop(); \ -\ - async_flag = ASYNC_READY; \ - ret = tel_set_call_sound_noise_reduction (handle, param1, on_##func, &value); \ - if (ret != TAPI_API_SUCCESS) { \ - dts_fail(#func, "Unexpected return"); \ - } \ -\ - util_start_loop(); \ - util_free_loop(); \ -\ - if (async_flag != ASYNC_DONE) { \ - dts_fail(#func, "Callback not invoked"); \ - } \ -\ - dts_pass(#func); \ - } \ -\ - static void utc_fail_##func (TelSoundNoiseReduction_t param1) \ - { \ - int ret; \ -\ - ret = tel_set_call_sound_noise_reduction (NULL, 0, NULL, NULL); \ - dts_check_ne(#func, ret, TAPI_API_SUCCESS, "Unexpected return"); \ - } - -/* Set Call Sound Clock Status Macro */ -#define DO_SET_CALL_SOUND_CLOCK_STATUS(func, param1) \ - static void on_##func(TapiHandle *handle, int result, void *data, void *user_data) \ - { \ - int *value = user_data; \ -\ - async_flag = ASYNC_DONE; \ - util_stop_loop(); \ -\ - if (*value != 0xC0FFEE) { \ - dts_fail(#func, "Callback userdata crashed"); \ - } \ - } \ -\ - static void utc_##func (gboolean param1) \ - { \ - int ret; \ - int value = 0xC0FFEE; \ -\ - /* with callback */ \ - util_init_loop(); \ -\ - async_flag = ASYNC_READY; \ - ret = tel_set_call_sound_clock_status (handle, param1, on_##func, &value); \ - if (ret != TAPI_API_SUCCESS) { \ - dts_fail(#func, "Unexpected return"); \ - } \ -\ - util_start_loop(); \ - util_free_loop(); \ -\ - if (async_flag != ASYNC_DONE) { \ - dts_fail(#func, "Callback not invoked"); \ - } \ -\ - dts_pass(#func); \ - } \ -\ - static void utc_fail_##func (gboolean param1) \ - { \ - int ret; \ -\ - ret = tel_set_call_sound_clock_status (NULL, 0, NULL, NULL); \ - dts_check_ne(#func, ret, TAPI_API_SUCCESS, "Unexpected return"); \ - } - - -/** - * tel_call_dtmf - * - */ -static void on_tel_call_dtmf (TapiHandle *handle, int result, void *data, void *user_data) -{ - int *value = user_data; - - async_flag = ASYNC_DONE; - util_stop_loop (); - - if (*value != 0xC0FFEE) { - dts_fail("tel_call_dtmf", "Callback userdata crashed"); - } -} - -static void utc_tel_call_dtmf () -{ - int ret; - int value = 0xC0FFEE; - - util_init_loop (); - - async_flag = ASYNC_READY; - ret = tel_call_dtmf (handle, "1", - on_tel_call_dtmf, &value); - if (ret != TAPI_API_SUCCESS) { - dts_fail("tel_call_dtmf", "Unexpected return"); - } - - util_start_loop (); - util_free_loop (); - - if (async_flag != ASYNC_DONE) { - dts_fail("tel_call_dtmf", "Callback not invoked"); - } - - dts_pass("tel_call_dtmf"); -} - -static void utc_fail_tel_call_dtmf (void) -{ - int ret; - - ret = tel_call_dtmf (NULL, NULL, NULL, NULL); - if (ret == TAPI_API_SUCCESS) { - dts_fail("tel_call_dtmf", "Parameter check failed"); - } - - ret = tel_call_dtmf (handle, NULL, NULL, NULL); - if (ret == TAPI_API_SUCCESS) { - dts_fail("tel_call_dtmf", "Parameter check failed"); - } - - dts_pass("tel_call_dtmf"); -} - -/** - * tel_deflect_call - * - */ -static void on_tel_deflect_call(TapiHandle *handle, int result, void *data, void *user_data) -{ - int *value = user_data; - - async_flag = ASYNC_DONE; - util_stop_loop (); - - if (*value != 0xC0FFEE) { - dts_fail("tel_deflect_call", "Callback userdata crashed"); - } -} - -static void utc_tel_deflect_call() -{ - TelCallDeflectDstInfo_t info; - int ret; - int value = 0xC0FFEE; - - util_init_loop (); - - async_flag = ASYNC_READY; - memset(&info, 0x0, sizeof(info)); - strcpy(info.number, (unsigned char *)"+919535099681"); - - ret = tel_deflect_call (handle, call_id, &info, - on_tel_deflect_call, &value); - if (ret != TAPI_API_SUCCESS) { - dts_fail("tel_deflect_call", "Unexpected return"); - } - - util_start_loop (); - util_free_loop (); - - if (async_flag != ASYNC_DONE) { - dts_fail("tel_deflect_call", "Callback not invoked"); - } - - dts_pass("tel_deflect_call"); -} - -static void utc_fail_tel_deflect_call (void) -{ - int ret; - - ret = tel_deflect_call (NULL, 0, NULL, NULL, NULL); - if (ret == TAPI_API_SUCCESS) { - dts_fail("tel_deflect_call", "Parameter check failed"); - } - - ret = tel_deflect_call (handle, 0, NULL, NULL, NULL); - if (ret == TAPI_API_SUCCESS) { - dts_fail("tel_deflect_call", "Parameter check failed"); - } - - dts_pass("tel_deflect_call"); -} - -/** - * tel_call_status - * - */ - -static void utc_tel_call_status () -{ - int ret; - int value = 0xC0FFEE; - - util_init_loop (); - - async_flag = ASYNC_READY; - ret = tel_get_call_status (handle, call_id, - value); - if (ret != TAPI_API_SUCCESS) { - dts_fail("tel_call_status", "Unexpected return"); - } - - util_start_loop (); - util_free_loop (); - - if (async_flag != ASYNC_DONE) { - dts_fail("tel_call_status", "Callback not invoked"); - } - - dts_pass("tel_call_status"); -} - -static void utc_fail_tel_call_status(void) -{ - int ret; - - ret = tel_get_call_status (NULL, 0, NULL); - if (ret == TAPI_API_SUCCESS) { - dts_fail("tel_call_status", "Parameter check failed"); - } - - ret = tel_get_call_status (handle, 0, NULL); - if (ret == TAPI_API_SUCCESS) { - dts_fail("tel_call_status", "Parameter check failed"); - } - - dts_pass("tel_call_status"); -} - -/** - * tel_call_status_all - * - */ -static void on_tel_call_status_all(TapiHandle *handle, int result, void *data, void *user_data) -{ - int *value = user_data; - - async_flag = ASYNC_DONE; - util_stop_loop (); - - if (*value != 0xC0FFEE) { - dts_fail("tel_call_status_all", "Callback userdata crashed"); - } -} - -static void utc_tel_call_status_all() -{ - int ret; - int value = 0xC0FFEE; - - util_init_loop (); - - async_flag = ASYNC_READY; - - ret = tel_get_call_status_all (handle, - on_tel_call_status_all, &value); - if (ret != TAPI_API_SUCCESS) { - dts_fail("tel_call_status_all", "Unexpected return"); - } - - util_start_loop (); - util_free_loop (); - - if (async_flag != ASYNC_DONE) { - dts_fail("tel_call_status_all", "Callback not invoked"); - } - - dts_pass("tel_call_status_all"); -} - -static void utc_fail_tel_call_status_all (void) -{ - int ret; - - ret = tel_get_call_status_all (NULL, NULL, NULL); - if (ret == TAPI_API_SUCCESS) { - dts_fail("tel_deflect_call", "Parameter check failed"); - } - - ret = tel_get_call_status_all (handle, NULL, NULL); - if (ret == TAPI_API_SUCCESS) { - dts_fail("tel_call_status_all", "Parameter check failed"); - } - - dts_pass("tel_call_status_all"); -} - -/** - * tel_get_call_mute_status - * - */ -static void on_tel_get_call_mute_status (TapiHandle *handle, int result, void *data, void *user_data) -{ - int *value = user_data; - - async_flag = ASYNC_DONE; - util_stop_loop (); - - if (*value != 0xC0FFEE) { - dts_fail("tel_get_call_mute_status", "Callback userdata crashed"); - } -} - -static void utc_tel_get_call_mute_status () -{ - int ret; - int value = 0xC0FFEE; - - util_init_loop (); - - async_flag = ASYNC_READY; - ret = tel_get_call_mute_status (handle, - on_tel_get_call_mute_status, &value); - if (ret != TAPI_API_SUCCESS) { - dts_fail("tel_get_call_mute_status", "Unexpected return"); - } - - util_start_loop (); - util_free_loop (); - - if (async_flag != ASYNC_DONE) { - dts_fail("tel_get_call_mute_status", "Callback not invoked"); - } - - dts_pass("tel_get_call_mute_status"); -} - -static void utc_fail_tel_get_call_mute_status (void) -{ - int ret; - - ret = tel_get_call_mute_status (NULL, NULL, NULL); - if (ret == TAPI_API_SUCCESS) { - dts_fail("tel_get_call_mute_status", "Parameter check failed"); - } - - ret = tel_get_call_mute_status (handle, NULL, NULL); - if (ret == TAPI_API_SUCCESS) { - dts_fail("tel_get_call_mute_status", "Parameter check failed"); - } - - dts_pass("tel_get_call_mute_status"); -} - - - -/* Dial auto generated functions */ - -DO_DIAL_CALL(tel_dial_voice_call, call_type[0], emergency_category[8], szNumber) -DO_DIAL_CALL(tel_dial_video_call, call_type[1], emergency_category[8], szNumber) -DO_DIAL_CALL(tel_dial_emergency_call, call_type[2], emergency_category[0], emer_num) - -/* Answer auto generated functions */ - -DO_ANSWER_CALL(tel_answer_accept_call, call_id, answer_type[0]) -DO_ANSWER_CALL(tel_answer_reject_call, call_id, answer_type[1]) -DO_ANSWER_CALL(tel_answer_replace_call, call_id, answer_type[2]) -DO_ANSWER_CALL(tel_answer_hold_and_accept_call, call_id, answer_type[3]) - -/* End auto generated functions */ - -DO_END_CALL(tel_end_call, call_id, end_type[0]) -DO_END_CALL(tel_end_all_call, call_id, end_type[1]) -DO_END_CALL(tel_end_active_all_call, call_id, end_type[2]) -DO_END_CALL(tel_end_hold_all_call, call_id, end_type[3]) - -/* Hold/Active/Split/Transfer auto generated functions */ - -DO_MANAGE_CALL(tel_hold_call, call_id) -DO_MANAGE_CALL(tel_active_call, call_id) -DO_MANAGE_CALL(tel_split_call, call_id) -DO_MANAGE_CALL(tel_transfer_call, call_id) - -/* Swap/Join auto generated functions */ - -DO_SWAP_JOIN_CALL(tel_swap_call, call_id, call_id2) -DO_SWAP_JOIN_CALL(tel_join_call, call_id, call_id2) - - -DO_GET_CALL_VOLUME_INFO(tel_get_call_volume_info_receiver, sound_device[0], sound_type[0]) -DO_GET_CALL_VOLUME_INFO(tel_get_call_volume_info_speaker_phone, sound_device[1], sound_type[0]) -DO_GET_CALL_VOLUME_INFO(tel_get_call_volume_info_hfk, sound_device[2], sound_type[0]) -DO_GET_CALL_VOLUME_INFO(tel_get_call_volume_info_headset, sound_device[3], sound_type[0]) -DO_GET_CALL_VOLUME_INFO(tel_get_call_volume_info_bluetooth, sound_device[4], sound_type[0]) -DO_GET_CALL_VOLUME_INFO(tel_get_call_volume_info_ec, sound_device[5], sound_type[0]) - -DO_SET_CALL_VOLUME_INFO(tel_set_call_volume_info_receiver_low, sound_device[0], sound_type[0], sound_volume[0]) -DO_SET_CALL_VOLUME_INFO(tel_set_call_volume_info_receiver_medium, sound_device[0], sound_type[0], sound_volume[4]) -DO_SET_CALL_VOLUME_INFO(tel_set_call_volume_info_receiver_high, sound_device[0], sound_type[0], sound_volume[9]) -DO_SET_CALL_VOLUME_INFO(tel_set_call_volume_info_headset_low, sound_device[3], sound_type[0], sound_volume[0]) -DO_SET_CALL_VOLUME_INFO(tel_set_call_volume_info_headset_medium, sound_device[3], sound_type[0], sound_volume[4]) -DO_SET_CALL_VOLUME_INFO(tel_set_call_volume_info_headset_high, sound_device[3], sound_type[0], sound_volume[9]) -DO_SET_CALL_VOLUME_INFO(tel_set_call_volume_info_bluetooth_low, sound_device[4], sound_type[0], sound_volume[0]) -DO_SET_CALL_VOLUME_INFO(tel_set_call_volume_info_bluetooth_medium, sound_device[4], sound_type[0], sound_volume[4]) -DO_SET_CALL_VOLUME_INFO(tel_set_call_volume_info_bluetooth_high, sound_device[4], sound_type[0], sound_volume[9]) - -DO_SET_CALL_SOUND_PATH(tel_set_call_sound_path_handset_extra_vol_off, sound_path[0], extra_vol[0]) -DO_SET_CALL_SOUND_PATH(tel_set_call_sound_path_handset_extra_vol_on, sound_path[0], extra_vol[1]) -DO_SET_CALL_SOUND_PATH(tel_set_call_sound_path_headset_extra_vol_off, sound_path[1], extra_vol[0]) -DO_SET_CALL_SOUND_PATH(tel_set_call_sound_path_headset_extra_vol_on, sound_path[1], extra_vol[1]) -DO_SET_CALL_SOUND_PATH(tel_set_call_sound_path_handsfree_extra_vol_off, sound_path[2], extra_vol[0]) -DO_SET_CALL_SOUND_PATH(tel_set_call_sound_path_handsfree_extra_vol_on, sound_path[2], extra_vol[1]) -DO_SET_CALL_SOUND_PATH(tel_set_call_sound_path_bluetooth_extra_vol_off, sound_path[3], extra_vol[0]) -DO_SET_CALL_SOUND_PATH(tel_set_call_sound_path_bluetooth_extra_vol_on, sound_path[3], extra_vol[1]) -DO_SET_CALL_SOUND_PATH(tel_set_call_sound_path_spk_phone_extra_vol_off, sound_path[5], extra_vol[0]) -DO_SET_CALL_SOUND_PATH(tel_set_call_sound_path_spk_phone_extra_vol_on, sound_path[5], extra_vol[1]) -DO_SET_CALL_SOUND_PATH(tel_set_call_sound_path_headset_3_5pi_extra_vol_off, sound_path[6], extra_vol[0]) -DO_SET_CALL_SOUND_PATH(tel_set_call_sound_path_headset_3_5pi_extra_vol_on, sound_path[6], extra_vol[1]) -DO_SET_CALL_SOUND_PATH(tel_set_call_sound_path_bt_nsec_off_extra_vol_off, sound_path[7], extra_vol[0]) -DO_SET_CALL_SOUND_PATH(tel_set_call_sound_path_bt_nsec_off_extra_vol_on, sound_path[7], extra_vol[1]) -DO_SET_CALL_SOUND_PATH(tel_set_call_sound_path_mic1_extra_vol_off, sound_path[8], extra_vol[0]) -DO_SET_CALL_SOUND_PATH(tel_set_call_sound_path_mic1_bluetooth_extra_vol_on, sound_path[8], extra_vol[1]) -DO_SET_CALL_SOUND_PATH(tel_set_call_sound_path_mic2_extra_vol_off, sound_path[9], extra_vol[0]) -DO_SET_CALL_SOUND_PATH(tel_set_call_sound_path_mic2_extra_vol_on, sound_path[9], extra_vol[1]) -DO_SET_CALL_SOUND_PATH(tel_set_call_sound_path_headset_hac_extra_vol_off, sound_path[10], extra_vol[0]) -DO_SET_CALL_SOUND_PATH(tel_set_call_sound_path_headset_hac_extra_vol_on, sound_path[10], extra_vol[1]) - - -DO_SET_CALL_MUTE_STATUS(tel_set_call_mute_status_off_tx, mute_status[0], mute_path[0]) -DO_SET_CALL_MUTE_STATUS(tel_set_call_mute_status_off_rx, mute_status[0], mute_path[1]) -DO_SET_CALL_MUTE_STATUS(tel_set_call_mute_status_off_all, mute_status[0], mute_path[2]) -DO_SET_CALL_MUTE_STATUS(tel_set_call_mute_status_on_tx, mute_status[1], mute_path[0]) -DO_SET_CALL_MUTE_STATUS(tel_set_call_mute_status_on_rx, mute_status[1], mute_path[1]) -DO_SET_CALL_MUTE_STATUS(tel_set_call_mute_status_on_all, mute_status[1], mute_path[2]) - -DO_SET_CALL_SOUND_RECORDING(tel_set_call_sound_recording_off, sound_recording[0]) -DO_SET_CALL_SOUND_RECORDING(tel_set_call_sound_recording_on, sound_recording[1]) - -DO_SET_CALL_SOUND_EQUALIZATION(tel_set_call_sound_equalization_mode_off_left, sound_equalization [0], sound_direction[0]) -DO_SET_CALL_SOUND_EQUALIZATION(tel_set_call_sound_equalization_mode_off_right, sound_equalization [0], sound_direction[1]) -DO_SET_CALL_SOUND_EQUALIZATION(tel_set_call_sound_equalization_mode_on_left, sound_equalization [1], sound_direction[0]) -DO_SET_CALL_SOUND_EQUALIZATION(tel_set_call_sound_equalization_mode_on_right, sound_equalization [1], sound_direction[1]) -DO_SET_CALL_SOUND_EQUALIZATION(tel_set_call_sound_equalization_mode_flag_off_left, sound_equalization [2], sound_direction[0]) -DO_SET_CALL_SOUND_EQUALIZATION(tel_set_call_sound_equalization_mode_flag_off_right, sound_equalization [2], sound_direction[1]) -DO_SET_CALL_SOUND_EQUALIZATION(tel_set_call_sound_equalization_mode_flag_on_left, sound_equalization [3], sound_direction[0]) -DO_SET_CALL_SOUND_EQUALIZATION(tel_set_call_sound_equalization_mode_flag_on_right, sound_equalization [3], sound_direction[1]) -DO_SET_CALL_SOUND_EQUALIZATION(tel_set_call_sound_equalization_mode_soft1_left, sound_equalization [4], sound_direction[0]) -DO_SET_CALL_SOUND_EQUALIZATION(tel_set_call_sound_equalization_mode_soft1_right, sound_equalization [4], sound_direction[1]) -DO_SET_CALL_SOUND_EQUALIZATION(tel_set_call_sound_equalization_mode_soft2_left, sound_equalization [5], sound_direction[0]) -DO_SET_CALL_SOUND_EQUALIZATION(tel_set_call_sound_equalization_mode_soft2_right, sound_equalization [5], sound_direction[1]) - -DO_SET_CALL_SOUND_NOISE_REDUCTION(tel_set_call_sound_reduction_off, sound_noise[0]) -DO_SET_CALL_SOUND_NOISE_REDUCTION(tel_set_call_sound_reduction_on, sound_noise[1]) - -DO_SET_CALL_SOUND_CLOCK_STATUS(tel_set_call_sound_clock_status_off, clock_status[0]) -DO_SET_CALL_SOUND_CLOCK_STATUS(tel_set_call_sound_clock_status_on, clock_status[1]) - - -struct tet_testlist tet_testlist[] = { - /* generated TC */ - { utc_tel_dial_voice_call, 1 }, - { utc_fail_tel_dial_voice_call, 2 }, - { utc_tel_dial_video_call, 1 }, - { utc_fail_tel_dial_video_call, 2 }, - { utc_tel_dial_emergency_call, 1 }, - { utc_fail_tel_dial_emergency_call, 2 }, - { utc_tel_answer_accept_call, 1 }, - { utc_fail_tel_answer_accept_call, 2 }, - { utc_tel_answer_reject_call, 1 }, - { utc_fail_tel_answer_reject_call, 2 }, - { utc_tel_answer_replace_call, 1 }, - { utc_fail_tel_answer_replace_call, 2 }, - { utc_tel_answer_hold_and_accept_call, 1 }, - { utc_fail_tel_answer_hold_and_accept_call, 2 }, - { utc_tel_end_call, 1 }, - { utc_fail_tel_end_call, 2 }, - { utc_tel_end_all_call, 1 }, - { utc_fail_tel_end_all_call, 2 }, - { utc_tel_end_active_all_call, 1 }, - { utc_fail_tel_end_active_all_call, 2 }, - { utc_tel_end_hold_all_call, 1 }, - { utc_fail_tel_end_hold_all_call, 2 }, - { utc_tel_hold_call, 1 }, - { utc_fail_tel_hold_call, 2 }, - { utc_tel_active_call, 1 }, - { utc_fail_tel_active_call, 2 }, - { utc_tel_split_call, 1 }, - { utc_fail_tel_split_call, 2 }, - { utc_tel_transfer_call, 1 }, - { utc_fail_tel_transfer_call, 2 }, - { utc_tel_swap_call, 1 }, - { utc_fail_tel_swap_call, 2 }, - { utc_tel_join_call, 1 }, - { utc_fail_tel_join_call, 2 }, - - /* Sound */ - - { utc_tel_get_call_volume_info_receiver, 1}, - { utc_fail_tel_get_call_volume_info_receiver, 2}, - { utc_tel_get_call_volume_info_speaker_phone, 1}, - { utc_fail_tel_get_call_volume_info_speaker_phone, 2}, - { utc_tel_get_call_volume_info_hfk, 1}, - { utc_fail_tel_get_call_volume_info_hfk, 2}, - { utc_tel_get_call_volume_info_headset, 1}, - { utc_fail_tel_get_call_volume_info_headset, 2}, - { utc_tel_get_call_volume_info_bluetooth, 1}, - { utc_fail_tel_get_call_volume_info_bluetooth, 2}, - { utc_tel_get_call_volume_info_ec, 1}, - { utc_fail_tel_get_call_volume_info_ec, 2}, - { utc_tel_set_call_volume_info_receiver_low, 1}, - { utc_fail_tel_set_call_volume_info_receiver_low, 2}, - { utc_tel_set_call_volume_info_receiver_medium, 1}, - { utc_fail_tel_set_call_volume_info_receiver_medium, 2}, - { utc_tel_set_call_volume_info_receiver_high, 1}, - { utc_fail_tel_set_call_volume_info_receiver_high, 2}, - { utc_tel_set_call_volume_info_headset_low, 1}, - { utc_fail_tel_set_call_volume_info_headset_low, 2}, - { utc_tel_set_call_volume_info_headset_medium, 1}, - { utc_fail_tel_set_call_volume_info_headset_medium, 2}, - { utc_tel_set_call_volume_info_headset_high, 1}, - { utc_fail_tel_set_call_volume_info_headset_high, 2}, - { utc_tel_set_call_volume_info_bluetooth_low, 1}, - { utc_fail_tel_set_call_volume_info_bluetooth_low, 2}, - { utc_tel_set_call_volume_info_bluetooth_medium, 1}, - { utc_fail_tel_set_call_volume_info_bluetooth_medium, 2}, - { utc_tel_set_call_volume_info_bluetooth_high, 1}, - { utc_fail_tel_set_call_volume_info_bluetooth_high, 2}, - { utc_tel_set_call_sound_path_handset_extra_vol_off, 1}, - { utc_fail_tel_set_call_sound_path_handset_extra_vol_off, 2}, - { utc_tel_set_call_sound_path_handset_extra_vol_on, 1}, - { utc_fail_tel_set_call_sound_path_handset_extra_vol_on, 2}, - { utc_tel_set_call_sound_path_headset_extra_vol_off, 1}, - { utc_fail_tel_set_call_sound_path_headset_extra_vol_off, 2}, - { utc_tel_set_call_sound_path_headset_extra_vol_on, 1}, - { utc_fail_tel_set_call_sound_path_headset_extra_vol_on, 2}, - { utc_tel_set_call_sound_path_handsfree_extra_vol_off, 1}, - { utc_fail_tel_set_call_sound_path_handsfree_extra_vol_off, 2}, - { utc_tel_set_call_sound_path_handsfree_extra_vol_on, 1}, - { utc_fail_tel_set_call_sound_path_handsfree_extra_vol_on, 2}, - { utc_tel_set_call_sound_path_bluetooth_extra_vol_off, 1}, - { utc_fail_tel_set_call_sound_path_bluetooth_extra_vol_off, 2}, - { utc_tel_set_call_sound_path_bluetooth_extra_vol_on, 1}, - { utc_fail_tel_set_call_sound_path_bluetooth_extra_vol_on, 2}, - { utc_tel_set_call_sound_path_spk_phone_extra_vol_off, 1}, - { utc_fail_tel_set_call_sound_path_spk_phone_extra_vol_off, 2}, - { utc_tel_set_call_sound_path_spk_phone_extra_vol_on, 1}, - { utc_fail_tel_set_call_sound_path_spk_phone_extra_vol_on, 2}, - { utc_tel_set_call_sound_path_headset_3_5pi_extra_vol_off, 1}, - { utc_fail_tel_set_call_sound_path_headset_3_5pi_extra_vol_off, 2}, - { utc_tel_set_call_sound_path_headset_3_5pi_extra_vol_on, 1}, - { utc_fail_tel_set_call_sound_path_headset_3_5pi_extra_vol_on, 2}, - { utc_tel_set_call_sound_path_bt_nsec_off_extra_vol_off, 1}, - { utc_fail_tel_set_call_sound_path_bt_nsec_off_extra_vol_off, 2}, - { utc_tel_set_call_sound_path_bt_nsec_off_extra_vol_on, 1}, - { utc_fail_tel_set_call_sound_path_bt_nsec_off_extra_vol_on, 2}, - { utc_tel_set_call_sound_path_mic1_extra_vol_off, 1}, - { utc_fail_tel_set_call_sound_path_mic1_extra_vol_off, 2}, - { utc_tel_set_call_sound_path_mic1_bluetooth_extra_vol_on, 1}, - { utc_fail_tel_set_call_sound_path_mic1_bluetooth_extra_vol_on, 2}, - { utc_tel_set_call_sound_path_mic2_extra_vol_off, 1}, - { utc_fail_tel_set_call_sound_path_mic2_extra_vol_off, 2}, - { utc_tel_set_call_sound_path_mic2_extra_vol_on, 1}, - { utc_fail_tel_set_call_sound_path_mic2_extra_vol_on, 2}, - { utc_tel_set_call_sound_path_headset_hac_extra_vol_off, 1}, - { utc_fail_tel_set_call_sound_path_headset_hac_extra_vol_off, 2}, - { utc_tel_set_call_sound_path_headset_hac_extra_vol_on, 1}, - { utc_fail_tel_set_call_sound_path_headset_hac_extra_vol_on, 2}, - { utc_tel_set_call_mute_status_off_tx, 1}, - { utc_fail_tel_set_call_mute_status_off_tx, 2}, - { utc_tel_set_call_mute_status_off_rx, 1}, - { utc_fail_tel_set_call_mute_status_off_rx, 2}, - { utc_tel_set_call_mute_status_off_all, 1}, - { utc_fail_tel_set_call_mute_status_off_all, 2}, - { utc_tel_set_call_mute_status_on_tx, 1}, - { utc_fail_tel_set_call_mute_status_on_tx, 2}, - { utc_tel_set_call_mute_status_on_rx, 1}, - { utc_fail_tel_set_call_mute_status_on_rx, 2}, - { utc_tel_set_call_mute_status_on_all, 1}, - { utc_fail_tel_set_call_mute_status_on_all, 2}, - { utc_tel_set_call_sound_recording_off, 1}, - { utc_fail_tel_set_call_sound_recording_off, 2}, - { utc_tel_set_call_sound_recording_on, 1}, - { utc_fail_tel_set_call_sound_recording_on, 2}, - { utc_tel_set_call_sound_equalization_mode_off_left, 1}, - { utc_fail_tel_set_call_sound_equalization_mode_off_left, 2 }, - { utc_tel_set_call_sound_equalization_mode_off_right, 1}, - { utc_fail_tel_set_call_sound_equalization_mode_off_right, 2 }, - { utc_tel_set_call_sound_equalization_mode_on_left, 1}, - { utc_fail_tel_set_call_sound_equalization_mode_on_left, 2}, - { utc_tel_set_call_sound_equalization_mode_on_right, 1}, - { utc_fail_tel_set_call_sound_equalization_mode_on_right, 2}, - { utc_tel_set_call_sound_equalization_mode_flag_off_left, 1}, - { utc_fail_tel_set_call_sound_equalization_mode_flag_off_left, 2}, - { utc_fail_tel_set_call_sound_equalization_mode_flag_off_left, 1}, - { utc_tel_set_call_sound_equalization_mode_flag_off_right, 1}, - { utc_fail_tel_set_call_sound_equalization_mode_flag_off_right, 2}, - { utc_tel_set_call_sound_equalization_mode_flag_on_left, 1}, - { utc_fail_tel_set_call_sound_equalization_mode_flag_on_left, 2}, - { utc_tel_set_call_sound_equalization_mode_flag_on_right, 1}, - { utc_fail_tel_set_call_sound_equalization_mode_flag_on_right, 2}, - { utc_tel_set_call_sound_equalization_mode_soft1_left, 1}, - { utc_fail_tel_set_call_sound_equalization_mode_soft1_left, 2}, - { utc_tel_set_call_sound_equalization_mode_soft1_right, 1}, - { utc_fail_tel_set_call_sound_equalization_mode_soft1_right, 2}, - { utc_tel_set_call_sound_equalization_mode_soft2_left, 1}, - { utc_fail_tel_set_call_sound_equalization_mode_soft2_left, 2}, - { utc_tel_set_call_sound_equalization_mode_soft2_right, 1}, - { utc_fail_tel_set_call_sound_equalization_mode_soft2_right, 2}, - { utc_tel_set_call_sound_reduction_off, 1}, - { utc_fail_tel_set_call_sound_reduction_off, 2}, - { utc_tel_set_call_sound_reduction_on, 1}, - { utc_fail_tel_set_call_sound_reduction_on, 2}, - { utc_tel_set_call_sound_clock_status_off, 1}, - { utc_fail_tel_set_call_sound_clock_status_off, 2}, - { utc_tel_set_call_sound_clock_status_on, 1}, - { utc_fail_tel_set_call_sound_clock_status_on, 2}, - - - /* custom TC */ - { utc_tel_call_dtmf, 1 }, - { utc_fail_tel_call_dtmf, 2 }, - { utc_tel_deflect_call, 1 }, - { utc_fail_tel_deflect_call, 2 }, - { utc_tel_call_status, 1 }, - { utc_fail_tel_call_status, 2 }, - { utc_tel_call_status_all, 1 }, - { utc_fail_tel_call_status_all, 2 }, - { utc_tel_get_call_mute_status, 1}, - { utc_fail_tel_get_call_mute_status, 2}, - - { NULL, 0 }, -}; - -static void startup (void) -{ - /* start of TC */ - tet_printf ("\n Call TC start"); - - handle = tel_init (NULL); -} - -static void cleanup (void) -{ - tel_deinit (handle); - - /* end of TC */ - tet_printf ("\n Call TC end"); -} - -void (*tet_startup) (void) = startup; -void (*tet_cleanup) (void) = cleanup; - diff --git a/wearable/TC/testcase/utc_common.c b/wearable/TC/testcase/utc_common.c deleted file mode 100755 index a5cb1de..0000000 --- a/wearable/TC/testcase/utc_common.c +++ /dev/null @@ -1,284 +0,0 @@ -/* - * libslp-tapi - * - * Copyright (c) 2013 Samsung Electronics Co., Ltd. All rights reserved. - * - * Contact: Ja-young Gu - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT 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 "util_common.h" - -TapiHandle *handle; -enum async_state async_flag; - - -/** - * tel_get_cp_name_list - * - */ -static void utc_tel_get_cp_name_list (void) -{ - char **result; - - result = tel_get_cp_name_list (); - if (result == NULL) { - dts_fail("tel_get_cp_name_list"); - return; - } - - dts_pass("tel_get_cp_name_list"); -} - -/** - * tel_init / tel_deinit - * - */ -static void utc_tel_init_deinit (void) -{ - TapiHandle *h; - int ret; - - h = tel_init (NULL); - if (h == NULL) { - dts_fail("tel_init", "Fail to initialization"); - return; - } - - ret = tel_deinit (h); - if (ret != TAPI_API_SUCCESS) { - dts_fail("tel_deinit", "Fail to deinitialization"); - return; - } - - h = tel_init ("invalid_name"); - if (h == NULL) { - dts_fail("tel_init", "Fail to initialization (invalid name should success)"); - return; - } - - ret = tel_deinit (h); - if (ret != TAPI_API_SUCCESS) { - dts_fail("tel_deinit", "Fail to deinitialization"); - return; - } - - dts_pass("tel_init"); -} - - -static void utc_fail_tel_init_deinit (void) -{ - int ret; - - ret = tel_deinit (NULL); - if (ret == TAPI_API_SUCCESS) { - dts_fail("tel_deinit", "Fail to parameter check"); - return; - } - - dts_pass("tel_deinit"); -} - -/** - * tel_register_noti_event / tel_deregister_noti_event - * - */ -static void on_noti (TapiHandle *h, const char *noti_id, void *data, void *user_data) -{ -} - -static void utc_tel_register_noti_event (void) -{ - int ret; - - ret = tel_register_noti_event (handle, TAPI_NOTI_NETWORK_REGISTRATION_STATUS, on_noti, NULL); - if (ret != TAPI_API_SUCCESS) { - dts_fail("tel_register_noti_event"); - return; - } - - ret = tel_deregister_noti_event (handle, TAPI_NOTI_NETWORK_REGISTRATION_STATUS); - if (ret != TAPI_API_SUCCESS) { - dts_fail("tel_deregister_noti_event"); - return; - } - - dts_pass("tel_register_noti_event"); -} - -static void utc_fail_tel_register_noti_event (void) -{ - int ret; - - ret = tel_register_noti_event (handle, TAPI_NOTI_NETWORK_REGISTRATION_STATUS, NULL, NULL); - if (ret == TAPI_API_SUCCESS) { - dts_fail("tel_register_noti_event"); - return; - } - - ret = tel_register_noti_event (handle, NULL, NULL, NULL); - if (ret == TAPI_API_SUCCESS) { - dts_fail("tel_register_noti_event"); - return; - } - - ret = tel_register_noti_event (NULL, TAPI_NOTI_NETWORK_REGISTRATION_STATUS, on_noti, NULL); - if (ret == TAPI_API_SUCCESS) { - dts_fail("tel_register_noti_event"); - return; - } - - /* deregister the unregistered event */ - ret = tel_deregister_noti_event (handle, TAPI_NOTI_NETWORK_CHANGE); - if (ret == TAPI_API_SUCCESS) { - dts_fail("tel_deregister_noti_event"); - return; - } - - dts_pass("tel_register_noti_event"); -} - - -/** - * tel_get_property_int - * - */ -static void utc_tel_get_property_int (void) -{ - int ret; - int act = 0; - - ret = tel_get_property_int (handle, TAPI_PROP_NETWORK_ACT, &act); - if (ret != TAPI_API_SUCCESS) { - dts_fail("tel_get_property_int"); - return; - } - - dts_pass("tel_get_property_int"); -} - -static void utc_fail_tel_get_property_int (void) -{ - int ret; - int act = 0; - - ret = tel_get_property_int (handle, TAPI_PROP_NETWORK_ACT, NULL); - if (ret == TAPI_API_SUCCESS) { - dts_fail("tel_get_property_int"); - return; - } - - ret = tel_get_property_int (handle, NULL, &act); - if (ret == TAPI_API_SUCCESS) { - dts_fail("tel_get_property_int"); - return; - } - - - ret = tel_get_property_int (NULL, TAPI_PROP_NETWORK_ACT, &act); - if (ret == TAPI_API_SUCCESS) { - dts_fail("tel_get_property_int"); - return; - } - - dts_pass("tel_get_property_int"); -} - - -/** - * tel_get_property_string - * - */ -static void utc_tel_get_property_string (void) -{ - int ret; - char *plmn = NULL; - - ret = tel_get_property_string (handle, TAPI_PROP_NETWORK_PLMN, &plmn); - if (ret != TAPI_API_SUCCESS) { - dts_fail("tel_get_property_string"); - return; - } - - if (plmn) - free (plmn); - - dts_pass("tel_get_property_string"); -} - -static void utc_fail_tel_get_property_string (void) -{ - int ret; - char *plmn = NULL; - - ret = tel_get_property_string (handle, TAPI_PROP_NETWORK_PLMN, NULL); - if (ret == TAPI_API_SUCCESS) { - dts_fail("tel_get_property_string"); - return; - } - - ret = tel_get_property_string (handle, NULL, &plmn); - if (ret == TAPI_API_SUCCESS) { - dts_fail("tel_get_property_string"); - return; - } - - ret = tel_get_property_string (NULL, TAPI_PROP_NETWORK_PLMN, &plmn); - if (ret == TAPI_API_SUCCESS) { - dts_fail("tel_get_property_string"); - return; - } - - dts_pass("tel_get_property_string"); -} - - -struct tet_testlist tet_testlist[] = { - { utc_tel_get_cp_name_list, 1 }, - { utc_tel_init_deinit, 1 }, - { utc_fail_tel_init_deinit, 2 }, - { utc_tel_register_noti_event, 1 }, - { utc_fail_tel_register_noti_event, 2 }, - { utc_tel_get_property_int, 1 }, - { utc_fail_tel_get_property_int, 2 }, - { utc_tel_get_property_string, 1 }, - { utc_fail_tel_get_property_string, 2 }, - { NULL, 0 }, -}; - -static void startup (void) -{ - /* start of TC */ - tet_printf ("\n TC start"); - - handle = tel_init (NULL); -} - -static void cleanup (void) -{ - tel_deinit (handle); - - /* end of TC */ - tet_printf ("\n TC end"); -} - -void (*tet_startup) (void) = startup; -void (*tet_cleanup) (void) = cleanup; diff --git a/wearable/TC/testcase/utc_gps.c b/wearable/TC/testcase/utc_gps.c deleted file mode 100644 index 621767f..0000000 --- a/wearable/TC/testcase/utc_gps.c +++ /dev/null @@ -1,519 +0,0 @@ -/* - * libslp-tapi - * - * Copyright (c) 2013 Samsung Electronics Co., Ltd. All rights reserved. - * - * Contact: Ankit Jogi - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT 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 "util_common.h" - -TapiHandle *handle; -enum async_state async_flag; - -/** - * tel_set_gps_frequency_aiding - * - */ -static void on_tel_set_gps_frequency_aiding (TapiHandle *handle, int result, - void *data, void *user_data) -{ - int *value = user_data; - - async_flag = ASYNC_DONE; - util_stop_loop (); - - if (*value != 0xC0FFEE) { - dts_fail("tel_set_gps_frequency_aiding", "Callback userdata crashed"); - } -} - -static void utc_tel_set_gps_frequency_aiding (void) -{ - int ret; - int value = 0xC0FFEE; - unsigned char state = 'a'; - - util_init_loop (); - - async_flag = ASYNC_READY; - ret = tel_set_gps_frequency_aiding (handle, state, on_tel_set_gps_frequency_aiding, &value); - if (ret != TAPI_API_SUCCESS) { - dts_fail("tel_set_gps_frequency_aiding", "Unexpected return"); - } - - util_start_loop (); - util_free_loop (); - - if (async_flag != ASYNC_DONE) { - dts_fail("tel_set_gps_frequency_aiding", "Callback not invoked"); - } - - dts_pass("tel_set_gps_frequency_aiding"); -} - -static void utc_fail_tel_set_gps_frequency_aiding (void) -{ - int ret; - unsigned char state = 'a'; - - ret = tel_set_gps_frequency_aiding (NULL, state, NULL, NULL); - if (ret == TAPI_API_SUCCESS) { - dts_fail("tel_set_gps_frequency_aiding", "Parameter check failed"); - } - - dts_pass("tel_set_gps_frequency_aiding"); -} - -/** - * tel_confirm_gps_measure_pos - * - */ -static void utc_tel_confirm_gps_measure_pos (void) -{ - int ret; - - util_init_loop (); - - ret = tel_confirm_gps_measure_pos (handle, (unsigned char *)"abc1234", 7); - if (ret != TAPI_API_SUCCESS) { - dts_fail("tel_confirm_gps_measure_pos", "Unexpected return"); - } - - dts_pass("tel_confirm_gps_measure_pos"); -} - -static void utc_fail_tel_confirm_gps_measure_pos (void) -{ - int ret; - - ret = tel_confirm_gps_measure_pos (NULL, (unsigned char *)"abc1234", 7); - if (ret == TAPI_API_SUCCESS) { - dts_fail("tel_confirm_gps_measure_pos", "Parameter check failed"); - } - - ret = tel_confirm_gps_measure_pos (handle, NULL, 7); - if (ret == TAPI_API_SUCCESS) { - dts_fail("tel_confirm_gps_measure_pos", "Parameter check failed"); - } - - dts_pass("tel_confirm_gps_measure_pos"); -} - -/** - * tel_sync_smart_assistant_area_list - * - */ -static void on_tel_sync_smart_assistant_area_list (TapiHandle *handle, int result, - void *data, void *user_data) -{ - int *value = user_data; - - async_flag = ASYNC_DONE; - util_stop_loop (); - - if (*value != 0xC0FFEE) { - dts_fail("tel_sync_smart_assistant_area_list", "Callback userdata crashed"); - } -} - -static void utc_tel_sync_smart_assistant_area_list (void) -{ - int ret; - int value = 0xC0FFEE; - TelSmartAssistantAreaList_t area_list; - - memset (&area_list, 0, sizeof(TelSmartAssistantAreaList_t)); - - area_list.count = 1; - area_list.area->index = 1; - area_list.area->mode_state = TAPI_SMART_ASSISTANT_MODE_STATE_START; - - util_init_loop (); - - async_flag = ASYNC_READY; - ret = tel_sync_smart_assistant_area_list (handle, &area_list, on_tel_sync_smart_assistant_area_list, &value); - if (ret != TAPI_API_SUCCESS) { - dts_fail("tel_sync_smart_assistant_area_list", "Unexpected return"); - } - - util_start_loop (); - util_free_loop (); - - if (async_flag != ASYNC_DONE) { - dts_fail("tel_sync_smart_assistant_area_list", "Callback not invoked"); - } - - dts_pass("tel_sync_smart_assistant_area_list"); -} - -static void utc_fail_tel_sync_smart_assistant_area_list (void) -{ - int ret; - TelSmartAssistantAreaList_t area_list; - - memset (&area_list, 0, sizeof(TelSmartAssistantAreaList_t)); - - area_list.count = 1; - area_list.area->index = 1; - area_list.area->mode_state = TAPI_SMART_ASSISTANT_MODE_STATE_START; - - ret = tel_sync_smart_assistant_area_list (NULL, &area_list, NULL, NULL); - if (ret == TAPI_API_SUCCESS) { - dts_fail("tel_sync_smart_assistant_area_list", "Parameter check failed"); - } - - ret = tel_sync_smart_assistant_area_list (handle, NULL, NULL, NULL); - if (ret == TAPI_API_SUCCESS) { - dts_fail("tel_sync_smart_assistant_area_list", "Parameter check failed"); - } - - dts_pass("tel_sync_smart_assistant_area_list"); -} - -/** - * tel_del_smart_assistant_area_list - * - */ -static void on_tel_del_smart_assistant_area_list (TapiHandle *handle, int result, - void *data, void *user_data) -{ - int *value = user_data; - - async_flag = ASYNC_DONE; - util_stop_loop (); - - if (*value != 0xC0FFEE) { - dts_fail("tel_del_smart_assistant_area_list", "Callback userdata crashed"); - } -} - -static void utc_tel_del_smart_assistant_area_list (void) -{ - int ret; - int value = 0xC0FFEE; - TelSmartAssistantAreaList_t area_list; - - memset (&area_list, 0, sizeof(TelSmartAssistantAreaList_t)); - - area_list.count = 1; - area_list.area->index = 1; - area_list.area->mode_state = TAPI_SMART_ASSISTANT_MODE_STATE_STOP; - - util_init_loop (); - - async_flag = ASYNC_READY; - ret = tel_del_smart_assistant_area_list (handle, &area_list, on_tel_del_smart_assistant_area_list, &value); - if (ret != TAPI_API_SUCCESS) { - dts_fail("tel_del_smart_assistant_area_list", "Unexpected return"); - } - - util_start_loop (); - util_free_loop (); - - if (async_flag != ASYNC_DONE) { - dts_fail("tel_del_smart_assistant_area_list", "Callback not invoked"); - } - - dts_pass("tel_del_smart_assistant_area_list"); -} - -static void utc_fail_tel_del_smart_assistant_area_list (void) -{ - int ret; - TelSmartAssistantAreaList_t area_list; - - memset (&area_list, 0, sizeof(TelSmartAssistantAreaList_t)); - - area_list.count = 1; - area_list.area->index = 1; - area_list.area->mode_state = TAPI_SMART_ASSISTANT_MODE_STATE_STOP; - - ret = tel_del_smart_assistant_area_list (NULL, &area_list, NULL, NULL); - if (ret == TAPI_API_SUCCESS) { - dts_fail("tel_del_smart_assistant_area_list", "Parameter check failed"); - } - - ret = tel_del_smart_assistant_area_list (handle, NULL, NULL, NULL); - if (ret == TAPI_API_SUCCESS) { - dts_fail("tel_del_smart_assistant_area_list", "Parameter check failed"); - } - - dts_pass("tel_del_smart_assistant_area_list"); -} - -/** - * tel_add_smart_assistant_area - * - */ -static void on_tel_add_smart_assistant_area (TapiHandle *handle, int result, - void *data, void *user_data) -{ - int *value = user_data; - - async_flag = ASYNC_DONE; - util_stop_loop (); - - if (*value != 0xC0FFEE) { - dts_fail("tel_add_smart_assistant_area", "Callback userdata crashed"); - } -} - -static void utc_tel_add_smart_assistant_area (void) -{ - int ret; - int value = 0xC0FFEE; - TelSmartAssistantArea_t area; - - memset (&area, 0, sizeof(TelSmartAssistantArea_t)); - - area.index = 1; - area.mode_state = TAPI_SMART_ASSISTANT_MODE_STATE_STOP; - - util_init_loop (); - - async_flag = ASYNC_READY; - ret = tel_add_smart_assistant_area (handle, &area, on_tel_add_smart_assistant_area, &value); - if (ret != TAPI_API_SUCCESS) { - dts_fail("tel_add_smart_assistant_area", "Unexpected return"); - } - - util_start_loop (); - util_free_loop (); - - if (async_flag != ASYNC_DONE) { - dts_fail("tel_add_smart_assistant_area", "Callback not invoked"); - } - - dts_pass("tel_add_smart_assistant_area"); -} - -static void utc_fail_tel_add_smart_assistant_area (void) -{ - int ret; - TelSmartAssistantArea_t area; - - memset (&area, 0, sizeof(TelSmartAssistantArea_t)); - - area.index = 1; - area.mode_state = TAPI_SMART_ASSISTANT_MODE_STATE_STOP; - - ret = tel_add_smart_assistant_area (NULL, &area, NULL, NULL); - if (ret == TAPI_API_SUCCESS) { - dts_fail("tel_add_smart_assistant_area", "Parameter check failed"); - } - - ret = tel_add_smart_assistant_area (handle, NULL, NULL, NULL); - if (ret == TAPI_API_SUCCESS) { - dts_fail("tel_add_smart_assistant_area", "Parameter check failed"); - } - - dts_pass("tel_add_smart_assistant_area"); -} - -/** - * tel_modify_smart_assistant_area - * - */ -static void on_tel_modify_smart_assistant_area (TapiHandle *handle, int result, - void *data, void *user_data) -{ - int *value = user_data; - - async_flag = ASYNC_DONE; - util_stop_loop (); - - if (*value != 0xC0FFEE) { - dts_fail("tel_modify_smart_assistant_area", "Callback userdata crashed"); - } -} - -static void utc_tel_modify_smart_assistant_area (void) -{ - int ret; - int value = 0xC0FFEE; - TelSmartAssistantArea_t area; - - memset (&area, 0, sizeof(TelSmartAssistantArea_t)); - - area.index = 1; - area.mode_state = TAPI_SMART_ASSISTANT_MODE_STATE_START; - - util_init_loop (); - - async_flag = ASYNC_READY; - ret = tel_modify_smart_assistant_area (handle, &area, on_tel_modify_smart_assistant_area, &value); - if (ret != TAPI_API_SUCCESS) { - dts_fail("tel_modify_smart_assistant_area", "Unexpected return"); - } - - util_start_loop (); - util_free_loop (); - - if (async_flag != ASYNC_DONE) { - dts_fail("tel_modify_smart_assistant_area", "Callback not invoked"); - } - - dts_pass("tel_modify_smart_assistant_area"); -} - -static void utc_fail_tel_modify_smart_assistant_area (void) -{ - int ret; - TelSmartAssistantArea_t area; - - memset (&area, 0, sizeof(TelSmartAssistantArea_t)); - - area.index = 1; - area.mode_state = TAPI_SMART_ASSISTANT_MODE_STATE_START; - - ret = tel_modify_smart_assistant_area (NULL, &area, NULL, NULL); - if (ret == TAPI_API_SUCCESS) { - dts_fail("tel_modify_smart_assistant_area", "Parameter check failed"); - } - - ret = tel_modify_smart_assistant_area (handle, NULL, NULL, NULL); - if (ret == TAPI_API_SUCCESS) { - dts_fail("tel_modify_smart_assistant_area", "Parameter check failed"); - } - - dts_pass("tel_modify_smart_assistant_area"); -} - -/** - * tel_set_smart_assistant_info - * - */ -static void on_tel_set_smart_assistant_info (TapiHandle *handle, int result, - void *data, void *user_data) -{ - int *value = user_data; - - async_flag = ASYNC_DONE; - util_stop_loop (); - - if (*value != 0xC0FFEE) { - dts_fail("tel_set_smart_assistant_info", "Callback userdata crashed"); - } -} - -static void utc_tel_set_smart_assistant_info (void) -{ - int ret; - int value = 0xC0FFEE; - TelSmartAssistantInfo_t info; - - memset (&info, 0, sizeof(TelSmartAssistantInfo_t)); - - info.index = 1; - info.lpp_state = TAPI_SMART_ASSISTANT_LPP_STATE_START; - - util_init_loop (); - - async_flag = ASYNC_READY; - ret = tel_set_smart_assistant_info (handle, &info, on_tel_set_smart_assistant_info, &value); - if (ret != TAPI_API_SUCCESS) { - dts_fail("tel_set_smart_assistant_info", "Unexpected return"); - } - - util_start_loop (); - util_free_loop (); - - if (async_flag != ASYNC_DONE) { - dts_fail("tel_set_smart_assistant_info", "Callback not invoked"); - } - - dts_pass("tel_set_smart_assistant_info"); -} - -static void utc_fail_tel_set_smart_assistant_info (void) -{ - int ret; - TelSmartAssistantInfo_t info; - - memset (&info, 0, sizeof(TelSmartAssistantInfo_t)); - - info.index = 1; - info.lpp_state = TAPI_SMART_ASSISTANT_MODE_STATE_START; - - ret = tel_set_smart_assistant_info (NULL, &info, NULL, NULL); - if (ret == TAPI_API_SUCCESS) { - dts_fail("tel_set_smart_assistant_info", "Parameter check failed"); - } - - ret = tel_set_smart_assistant_info (handle, NULL, NULL, NULL); - if (ret == TAPI_API_SUCCESS) { - dts_fail("tel_set_smart_assistant_info", "Parameter check failed"); - } - - dts_pass("tel_set_smart_assistant_info"); -} - -/** - * Generate default TC for no-additional-parameter type API - * - */ -DO(tel_enable_smart_assistant) -DO(tel_disable_smart_assistant) - -struct tet_testlist tet_testlist[] = { - /* generated TC */ - { utc_tel_enable_smart_assistant, 1 }, - { utc_fail_tel_enable_smart_assistant, 2 }, - { utc_tel_disable_smart_assistant, 1 }, - { utc_fail_tel_disable_smart_assistant, 2 }, - /* custom TC */ - { utc_tel_set_gps_frequency_aiding, 1 }, - { utc_fail_tel_set_gps_frequency_aiding, 2 }, - { utc_tel_confirm_gps_measure_pos, 1 }, - { utc_fail_tel_confirm_gps_measure_pos, 2 }, - { utc_tel_sync_smart_assistant_area_list, 1 }, - { utc_fail_tel_sync_smart_assistant_area_list, 2 }, - { utc_tel_del_smart_assistant_area_list, 1 }, - { utc_fail_tel_del_smart_assistant_area_list, 2 }, - { utc_tel_add_smart_assistant_area, 1 }, - { utc_fail_tel_add_smart_assistant_area, 2 }, - { utc_tel_modify_smart_assistant_area, 1 }, - { utc_fail_tel_modify_smart_assistant_area, 2 }, - { utc_tel_set_smart_assistant_info, 1 }, - { utc_fail_tel_set_smart_assistant_info, 2 }, - { NULL, 0 }, -}; - -static void startup (void) -{ - /* start of TC */ - tet_printf ("\n TC start"); - - handle = tel_init (NULL); -} - -static void cleanup (void) -{ - tel_deinit (handle); - - /* end of TC */ - tet_printf ("\n TC end"); -} - -void (*tet_startup) (void) = startup; -void (*tet_cleanup) (void) = cleanup; diff --git a/wearable/TC/testcase/utc_modem.c b/wearable/TC/testcase/utc_modem.c deleted file mode 100644 index a371e28..0000000 --- a/wearable/TC/testcase/utc_modem.c +++ /dev/null @@ -1,396 +0,0 @@ -/* - * libslp-tapi - * - * Copyright (c) 2013 Samsung Electronics Co., Ltd. All rights reserved. - * - * Contact: Ankit Jogi - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT 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 "util_common.h" - -TapiHandle *handle; -enum async_state async_flag; - -/** - * tel_process_power_command - * - */ -static void on_tel_process_power_command (TapiHandle *handle, int result, - void *data, void *user_data) -{ - int *value = user_data; - - async_flag = ASYNC_DONE; - util_stop_loop (); - - if (*value != 0xC0FFEE) { - dts_fail("tel_process_power_command", "Callback userdata crashed"); - } -} - -static void utc_tel_process_power_command (void) -{ - int ret; - int value = 0xC0FFEE; - tapi_power_phone_cmd_t cmd; - - cmd = 1; - - util_init_loop (); - - async_flag = ASYNC_READY; - ret = tel_process_power_command (handle, cmd, on_tel_process_power_command, &value); - if (ret != TAPI_API_SUCCESS) { - dts_fail("tel_process_power_command", "Unexpected return"); - } - - util_start_loop (); - util_free_loop (); - - if (async_flag != ASYNC_DONE) { - dts_fail("tel_process_power_command", "Callback not invoked"); - } - - dts_pass("tel_process_power_command"); -} - -static void utc_fail_tel_process_power_command (void) -{ - int ret; - - ret = tel_process_power_command (NULL, 1, NULL, NULL); - if (ret == TAPI_API_SUCCESS) { - dts_fail("tel_process_power_command", "Parameter check failed"); - } - - ret = tel_process_power_command (handle, 3, NULL, NULL); - if (ret == TAPI_API_SUCCESS) { - dts_fail("tel_process_power_command", "Parameter check failed"); - } - - dts_pass("tel_process_power_command"); -} - -/** - * tel_set_flight_mode - * - */ -static void on_tel_set_flight_mode (TapiHandle *handle, int result, - void *data, void *user_data) -{ - int *value = user_data; - - async_flag = ASYNC_DONE; - util_stop_loop (); - - if (*value != 0xC0FFEE) { - dts_fail("tel_set_flight_mode", "Callback userdata crashed"); - } -} - -static void utc_tel_set_flight_mode (void) -{ - int ret; - int value = 0xC0FFEE; - tapi_power_flight_mode_type_t mode; - - mode = 1; - - util_init_loop (); - - async_flag = ASYNC_READY; - ret = tel_set_flight_mode (handle, mode, on_tel_set_flight_mode, &value); - if (ret != TAPI_API_SUCCESS) { - dts_fail("tel_set_flight_mode", "Unexpected return"); - } - - util_start_loop (); - util_free_loop (); - - if (async_flag != ASYNC_DONE) { - dts_fail("tel_set_flight_mode", "Callback not invoked"); - } - - dts_pass("tel_set_flight_mode"); -} - -static void utc_fail_tel_set_flight_mode (void) -{ - int ret; - - ret = tel_set_flight_mode (NULL, 1, NULL, NULL); - if (ret == TAPI_API_SUCCESS) { - dts_fail("tel_set_flight_mode", "Parameter check failed"); - } - - ret = tel_set_flight_mode (handle, 3, NULL, NULL); - if (ret == TAPI_API_SUCCESS) { - dts_fail("tel_set_flight_mode", "Parameter check failed"); - } - - dts_pass("tel_set_flight_mode"); -} - -/** - * tel_get_misc_me_version_sync - * - */ -static void utc_tel_get_misc_me_version_sync (void) -{ - TelMiscVersionInformation *ret = NULL; - - util_init_loop (); - - async_flag = ASYNC_READY; - ret = tel_get_misc_me_version_sync (handle); - if (ret == NULL) { - dts_fail("tel_get_misc_me_version_sync", "Unexpected return"); - } - - dts_pass("tel_get_misc_me_version_sync"); -} - -static void utc_fail_tel_get_misc_me_version_sync (void) -{ - TelMiscVersionInformation *ret = NULL; - - ret = tel_get_misc_me_version_sync (NULL); - if (ret != NULL) { - dts_fail("tel_get_misc_me_version_sync", "Unexpected return"); - } - - dts_pass("tel_get_misc_me_version_sync"); -} - -/** - * tel_get_misc_me_sn_sync - * - */ -static void utc_tel_get_misc_me_sn_sync (void) -{ - char *ret = NULL; - - util_init_loop (); - - ret = tel_get_misc_me_sn_sync (handle); - if (ret == NULL) { - dts_fail("tel_get_misc_me_sn_sync", "Unexpected return"); - } - - dts_pass("tel_get_misc_me_sn_sync"); -} - -static void utc_fail_tel_get_misc_me_sn_sync (void) -{ - char *ret = NULL; - - ret = tel_get_misc_me_sn_sync (NULL); - if (ret != NULL) { - dts_fail("tel_get_misc_me_sn_sync", "Unexpected return"); - } - - dts_pass("tel_get_misc_me_sn_sync"); -} - -/** - * tel_get_misc_me_sn_sync - * - */ -static void utc_tel_get_misc_me_imei_sync (void) -{ - char *ret = NULL; - - util_init_loop (); - - ret = tel_get_misc_me_imei_sync (handle); - if (ret == NULL) { - dts_fail("tel_get_misc_me_imei_sync", "Unexpected return"); - } - - dts_pass("tel_get_misc_me_imei_sync"); -} - -static void utc_fail_tel_get_misc_me_imei_sync (void) -{ - char *ret = NULL; - - ret = tel_get_misc_me_imei_sync (NULL); - if (ret != NULL) { - dts_fail("tel_get_misc_me_imei_sync", "Unexpected return"); - } - - dts_pass("tel_get_misc_me_imei_sync"); -} - -/** - * tel_check_modem_power_status - * - */ -static void utc_tel_check_modem_power_status (void) -{ - int ret; - int result; - - util_init_loop (); - - ret = tel_check_modem_power_status (handle, &result); - if (ret != TAPI_API_SUCCESS) { - dts_fail("tel_check_modem_power_status", "Unexpected return"); - } - - dts_pass("tel_check_modem_power_status"); -} - -static void utc_fail_tel_check_modem_power_status (void) -{ - int ret; - int result; - - ret = tel_check_modem_power_status (NULL, &result); - if (ret != TAPI_API_SUCCESS) { - dts_fail("tel_check_modem_power_status", "Unexpected return"); - } - - ret = tel_check_modem_power_status (handle, NULL); - if (ret != TAPI_API_SUCCESS) { - dts_fail("tel_check_modem_power_status", "Unexpected return"); - } - - dts_pass("tel_check_modem_power_status"); -} - -/** - * tel_control_modem_dun_pin_ctrl - * - */ -static void on_tel_control_modem_dun_pin_ctrl (TapiHandle *handle, int result, - void *data, void *user_data) -{ - int *value = user_data; - - async_flag = ASYNC_DONE; - util_stop_loop (); - - if (*value != 0xC0FFEE) { - dts_fail("tel_control_modem_dun_pin_ctrl", "Callback userdata crashed"); - } -} - -static void utc_tel_control_modem_dun_pin_ctrl (void) -{ - int ret; - int value = 0xC0FFEE; - tapi_ps_btdun_pincontrol pincontrol; - - pincontrol.signal = GPRS_SIGNAL_DCD; - pincontrol.status = GPRS_SIGNAL_STATUS_ON; - - util_init_loop (); - - async_flag = ASYNC_READY; - ret = tel_control_modem_dun_pin_ctrl (handle, &pincontrol, on_tel_control_modem_dun_pin_ctrl, &value); - if (ret != TAPI_API_SUCCESS) { - dts_fail("tel_control_modem_dun_pin_ctrl", "Unexpected return"); - } - - util_start_loop (); - util_free_loop (); - - if (async_flag != ASYNC_DONE) { - dts_fail("tel_control_modem_dun_pin_ctrl", "Callback not invoked"); - } - - dts_pass("tel_control_modem_dun_pin_ctrl"); -} - -static void utc_fail_tel_control_modem_dun_pin_ctrl (void) -{ - int ret; - - ret = tel_control_modem_dun_pin_ctrl (NULL, NULL, NULL, NULL); - if (ret == TAPI_API_SUCCESS) { - dts_fail("tel_control_modem_dun_pin_ctrl", "Parameter check failed"); - } - - ret = tel_control_modem_dun_pin_ctrl (handle, NULL, NULL, NULL); - if (ret == TAPI_API_SUCCESS) { - dts_fail("tel_control_modem_dun_pin_ctrl", "Parameter check failed"); - } - - dts_pass("tel_control_modem_dun_pin_ctrl"); -} - -/** - * Generate default TC for no-additional-parameter type API - * - */ -DO(tel_get_flight_mode) -DO(tel_get_misc_me_version) -DO(tel_get_misc_me_sn) -DO(tel_get_misc_me_imei) - -struct tet_testlist tet_testlist[] = { - /* generated TC */ - { utc_tel_get_flight_mode, 1 }, - { utc_fail_tel_get_flight_mode, 2 }, - { utc_tel_get_misc_me_version, 1 }, - { utc_fail_tel_get_misc_me_version, 2 }, - { utc_tel_get_misc_me_sn, 1 }, - { utc_fail_tel_get_misc_me_sn, 2 }, - { utc_tel_get_misc_me_imei, 1 }, - { utc_fail_tel_get_misc_me_imei, 2 }, - /* custom TC */ - { utc_tel_process_power_command, 1 }, - { utc_fail_tel_process_power_command, 2 }, - { utc_tel_set_flight_mode, 1 }, - { utc_fail_tel_set_flight_mode, 2 }, - { utc_tel_get_misc_me_version_sync, 1 },//// - { utc_fail_tel_get_misc_me_version_sync, 2 },//// - { utc_tel_get_misc_me_sn_sync, 1 },//// - { utc_fail_tel_get_misc_me_sn_sync, 2 },//// - { utc_tel_get_misc_me_imei_sync, 1 },///////// - { utc_fail_tel_get_misc_me_imei_sync, 2 },////////// - { utc_tel_check_modem_power_status, 1 }, - { utc_fail_tel_check_modem_power_status, 2 }, - { utc_tel_control_modem_dun_pin_ctrl, 1 }, - { utc_fail_tel_control_modem_dun_pin_ctrl, 2 }, - { NULL, 0 }, -}; - -static void startup (void) -{ - /* start of TC */ - tet_printf ("\n TC start"); - - handle = tel_init (NULL); -} - -static void cleanup (void) -{ - tel_deinit (handle); - - /* end of TC */ - tet_printf ("\n TC end"); -} - -void (*tet_startup) (void) = startup; -void (*tet_cleanup) (void) = cleanup; diff --git a/wearable/TC/testcase/utc_network.c b/wearable/TC/testcase/utc_network.c deleted file mode 100755 index 924b6d4..0000000 --- a/wearable/TC/testcase/utc_network.c +++ /dev/null @@ -1,380 +0,0 @@ -/* - * libslp-tapi - * - * Copyright (c) 2013 Samsung Electronics Co., Ltd. All rights reserved. - * - * Contact: Ja-young Gu - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT 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 "util_common.h" - -TapiHandle *handle; -enum async_state async_flag; - -/** - * tel_select_network_manual - * - */ -static void on_tel_select_network_manual (TapiHandle *handle, int result, - void *data, void *user_data) -{ - int *value = user_data; - - async_flag = ASYNC_DONE; - util_stop_loop (); - - if (*value != 0xC0FFEE) { - dts_fail("tel_select_network_manual", "Callback userdata crashed"); - } -} - -static void utc_tel_select_network_manual (void) -{ - int ret; - int value = 0xC0FFEE; - - util_init_loop (); - - async_flag = ASYNC_READY; - ret = tel_select_network_manual (handle, "45001", TAPI_NETWORK_SYSTEM_LTE, - on_tel_select_network_manual, &value); - if (ret != TAPI_API_SUCCESS) { - dts_fail("tel_select_network_manual", "Unexpected return"); - } - - util_start_loop (); - util_free_loop (); - - if (async_flag != ASYNC_DONE) { - dts_fail("tel_select_network_manual", "Callback not invoked"); - } - - dts_pass("tel_select_network_manual"); -} - -static void utc_fail_tel_select_network_manual (void) -{ - int ret; - - ret = tel_select_network_manual (NULL, NULL, 0, NULL, NULL); - if (ret == TAPI_API_SUCCESS) { - dts_fail("tel_select_network_manual", "Parameter check failed"); - } - - ret = tel_select_network_manual (handle, NULL, 0, NULL, NULL); - if (ret == TAPI_API_SUCCESS) { - dts_fail("tel_select_network_manual", "Parameter check failed"); - } - - dts_pass("tel_select_network_manual"); -} - -/** - * tel_set_network_band - * - */ -static void on_tel_set_network_band (TapiHandle *handle, int result, void *data, - void *user_data) -{ - int *value = user_data; - - async_flag = ASYNC_DONE; - util_stop_loop (); - - if (*value != 0xC0FFEE) { - dts_fail("tel_set_network_band", "Callback userdata crashed"); - } -} - -static void utc_tel_set_network_band (void) -{ - int ret; - int value = 0xC0FFEE; - - util_init_loop (); - - async_flag = ASYNC_READY; - ret = tel_set_network_band (handle, TAPI_NETWORK_BAND_MODE_ONLY, - TAPI_NETWORK_BAND_TYPE_ANY, on_tel_set_network_band, &value); - if (ret != TAPI_API_SUCCESS) { - dts_fail("tel_set_network_band", "Unexpected return"); - } - - util_start_loop (); - util_free_loop (); - - if (async_flag != ASYNC_DONE) { - dts_fail("tel_set_network_band", "Callback not invoked"); - } - - dts_pass("tel_set_network_band"); -} - -static void utc_fail_tel_set_network_band (void) -{ - int ret; - - ret = tel_set_network_band (NULL, 0, 0, NULL, NULL); - if (ret == TAPI_API_SUCCESS) { - dts_fail("tel_set_network_band", "Parameter check failed"); - } - - dts_pass("tel_set_network_band"); -} - -/** - * tel_set_network_mode - * - */ -static void on_tel_set_network_mode (TapiHandle *handle, int result, void *data, - void *user_data) -{ - int *value = user_data; - - async_flag = ASYNC_DONE; - util_stop_loop (); - - if (*value != 0xC0FFEE) { - dts_fail("tel_set_network_mode", "Callback userdata crashed"); - } -} - -static void utc_tel_set_network_mode (void) -{ - int ret; - int value = 0xC0FFEE; - - util_init_loop (); - - async_flag = ASYNC_READY; - ret = tel_set_network_mode (handle, TAPI_NETWORK_MODE_AUTO, - on_tel_set_network_mode, &value); - if (ret != TAPI_API_SUCCESS) { - dts_fail("tel_set_network_mode", "Unexpected return"); - } - - util_start_loop (); - util_free_loop (); - - if (async_flag != ASYNC_DONE) { - dts_fail("tel_set_network_mode", "Callback not invoked"); - } - - dts_pass("tel_set_network_mode"); -} - -static void utc_fail_tel_set_network_mode (void) -{ - int ret; - - ret = tel_set_network_mode (NULL, 0, NULL, NULL); - if (ret == TAPI_API_SUCCESS) { - dts_fail("tel_set_network_mode", "Parameter check failed"); - } - - dts_pass("tel_set_network_mode"); -} - -/** - * tel_set_network_preferred_plmn - * - */ -static void on_tel_set_network_preferred_plmn (TapiHandle *handle, int result, - void *data, void *user_data) -{ - int *value = user_data; - - async_flag = ASYNC_DONE; - util_stop_loop (); - - if (*value != 0xC0FFEE) { - dts_fail("tel_set_network_preferred_plmn", "Callback userdata crashed"); - } -} - -static void utc_tel_set_network_preferred_plmn (void) -{ - int ret; - int value = 0xC0FFEE; - TelNetworkPreferredPlmnInfo_t info; - - memset (&info, 0, sizeof(TelNetworkPreferredPlmnInfo_t)); - info.SystemType = TAPI_NETWORK_SYSTEM_GSM; - info.Index = 1; - strncpy (info.Plmn, TAPI_NETWORK_PLMN_LEN_MAX, "45001"); - - util_init_loop (); - - async_flag = ASYNC_READY; - ret = tel_set_network_preferred_plmn (handle, TAPI_NETWORK_PREF_PLMN_ADD, - &info, on_tel_set_network_preferred_plmn, &value); - if (ret != TAPI_API_SUCCESS) { - dts_fail("tel_set_network_preferred_plmn", "Unexpected return"); - } - - util_start_loop (); - util_free_loop (); - - if (async_flag != ASYNC_DONE) { - dts_fail("tel_set_network_preferred_plmn", "Callback not invoked"); - } - - dts_pass("tel_set_network_preferred_plmn"); -} - -static void utc_fail_tel_set_network_preferred_plmn (void) -{ - int ret; - - ret = tel_set_network_preferred_plmn (NULL, 0, NULL, NULL, NULL); - if (ret == TAPI_API_SUCCESS) { - dts_fail("tel_set_network_preferred_plmn", "Parameter check failed"); - } - - dts_pass("tel_set_network_preferred_plmn"); -} - -/** - * tel_set_network_service_domain - * - */ -static void on_tel_set_network_service_domain (TapiHandle *handle, int result, - void *data, void *user_data) -{ - int *value = user_data; - - async_flag = ASYNC_DONE; - util_stop_loop (); - - if (*value != 0xC0FFEE) { - dts_fail("tel_set_network_service_domain", "Callback userdata crashed"); - } -} - -static void utc_tel_set_network_service_domain (void) -{ - int ret; - int value = 0xC0FFEE; - - util_init_loop (); - - async_flag = ASYNC_READY; - ret = tel_set_network_service_domain (handle, - TAPI_NETWORK_SERVICE_DOMAIN_COMBINED, - on_tel_set_network_service_domain, &value); - if (ret != TAPI_API_SUCCESS) { - dts_fail("tel_set_network_service_domain", "Unexpected return"); - } - - util_start_loop (); - util_free_loop (); - - if (async_flag != ASYNC_DONE) { - dts_fail("tel_set_network_service_domain", "Callback not invoked"); - } - - dts_pass("tel_set_network_service_domain"); -} - -static void utc_fail_tel_set_network_service_domain (void) -{ - int ret; - - ret = tel_set_network_service_domain (NULL, 0, NULL, NULL); - if (ret == TAPI_API_SUCCESS) { - dts_fail("tel_set_network_service_domain", "Parameter check failed"); - } - - dts_pass("tel_set_network_service_domain"); -} - - -/** - * Generate default TC for no-additional-parameter type API - * - */ -DO(tel_search_network) -DO(tel_cancel_network_manual_search) -DO(tel_get_network_band) -DO(tel_get_network_mode) -DO(tel_get_network_neighboring_cell_info) -DO(tel_get_network_preferred_plmn) -DO(tel_get_network_selection_mode) -DO(tel_get_network_service_domain) -DO(tel_get_network_serving) -DO(tel_select_network_automatic) - -struct tet_testlist tet_testlist[] = { - /* generated TC */ -// { utc_tel_search_network, 1 }, -// { utc_fail_tel_search_network, 2 }, - { utc_tel_cancel_network_manual_search, 1 }, - { utc_fail_tel_cancel_network_manual_search, 2 }, - { utc_tel_get_network_band, 1 }, - { utc_fail_tel_get_network_band, 2 }, - { utc_tel_get_network_mode, 1 }, - { utc_fail_tel_get_network_mode, 2 }, - { utc_tel_get_network_neighboring_cell_info, 1 }, - { utc_fail_tel_get_network_neighboring_cell_info, 2 }, - { utc_tel_get_network_preferred_plmn, 1 }, - { utc_fail_tel_get_network_preferred_plmn, 2 }, - { utc_tel_get_network_selection_mode, 1 }, - { utc_fail_tel_get_network_selection_mode, 2 }, - { utc_tel_get_network_service_domain, 1 }, - { utc_fail_tel_get_network_service_domain, 2 }, - { utc_tel_get_network_serving, 1 }, - { utc_fail_tel_get_network_serving, 2 }, - { utc_tel_select_network_automatic, 1 }, - { utc_fail_tel_select_network_automatic, 2 }, - - /* custom TC */ - { utc_tel_select_network_manual, 1 }, - { utc_fail_tel_select_network_manual, 2 }, - { utc_tel_set_network_band, 1 }, - { utc_fail_tel_set_network_band, 2 }, - { utc_tel_set_network_mode, 1 }, - { utc_fail_tel_set_network_mode, 2 }, - { utc_tel_set_network_preferred_plmn, 1 }, - { utc_fail_tel_set_network_preferred_plmn, 2 }, - { utc_tel_set_network_service_domain, 1 }, - { utc_fail_tel_set_network_service_domain, 2 }, - { NULL, 0 }, -}; - -static void startup (void) -{ - /* start of TC */ - tet_printf ("\n TC start"); - - handle = tel_init (NULL); -} - -static void cleanup (void) -{ - tel_deinit (handle); - - /* end of TC */ - tet_printf ("\n TC end"); -} - -void (*tet_startup) (void) = startup; -void (*tet_cleanup) (void) = cleanup; diff --git a/wearable/TC/testcase/utc_phonebook.c b/wearable/TC/testcase/utc_phonebook.c deleted file mode 100755 index a249fa0..0000000 --- a/wearable/TC/testcase/utc_phonebook.c +++ /dev/null @@ -1,464 +0,0 @@ -/* - * libslp-tapi - * - * Copyright (c) 2013 Samsung Electronics Co., Ltd. All rights reserved. - * - * Contact: Anga Santhosh Kumar - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT 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 "util_common.h" - -TapiHandle *handle; -enum async_state async_flag; - -/** - * tel_get_sim_pb_init_info - * - */ -static void utc_tel_get_sim_pb_init_info(void) -{ - int ret; - int init_completed = 0; - TelSimPbList_t pb_list; - - memset(&pb_list, 0, sizeof(TelSimPbList_t)); - - util_init_loop(); - - ret = tel_get_sim_pb_init_info(handle, &init_completed, &pb_list); - if (ret != TAPI_API_SUCCESS) { - dts_fail("tel_get_sim_pb_init_info", "Unexpected return"); - } - - dts_pass("tel_get_sim_pb_init_info"); -} - -static void utc_fail_tel_get_sim_pb_init_info(void) -{ - int ret; - int init_completed = 0; - - ret = tel_get_sim_pb_init_info(NULL, NULL, NULL); - if (ret == TAPI_API_SUCCESS) { - dts_fail("tel_get_sim_pb_init_info", "Parameter check failed"); - } - - ret = tel_get_sim_pb_init_info(handle, NULL, NULL); - if (ret == TAPI_API_SUCCESS) { - dts_fail("tel_get_sim_pb_init_info", "Parameter check failed"); - } - - ret = tel_get_sim_pb_init_info(handle, &init_completed, NULL); - if (ret == TAPI_API_SUCCESS) { - dts_fail("tel_get_sim_pb_init_info", "Parameter check failed"); - } - - dts_pass("tel_get_sim_pb_init_info"); -} - -/** - * tel_get_sim_pb_count - * - */ -static void on_tel_get_sim_pb_count (TapiHandle *handle, int result, - void *data, void *user_data) -{ - int *value = user_data; - - async_flag = ASYNC_DONE; - util_stop_loop (); - - if (*value != 0xC0FFEE) { - dts_fail("tel_get_sim_pb_count", "Callback userdata crashed"); - } -} - -static void utc_tel_get_sim_pb_count (void) -{ - int ret; - int value = 0xC0FFEE; - - util_init_loop (); - - async_flag = ASYNC_READY; - ret = tel_get_sim_pb_count (handle, TAPI_SIM_PB_FDN, - on_tel_get_sim_pb_count, &value); - if (ret != TAPI_API_SUCCESS) { - dts_fail("tel_get_sim_pb_count", "Unexpected return"); - } - - util_start_loop (); - util_free_loop (); - - if (async_flag != ASYNC_DONE) { - dts_fail("tel_get_sim_pb_count", "Callback not invoked"); - } - - dts_pass("tel_get_sim_pb_count"); -} - -static void utc_fail_tel_get_sim_pb_count (void) -{ - int ret; - - ret = tel_get_sim_pb_count (NULL, TAPI_SIM_PB_FDN, NULL, NULL); - if (ret == TAPI_API_SUCCESS) { - dts_fail("tel_get_sim_pb_count", "Parameter check failed"); - } - - ret = tel_get_sim_pb_count (handle, TAPI_SIM_PB_FDN, NULL, NULL); - if (ret == TAPI_API_SUCCESS) { - dts_fail("tel_get_sim_pb_count", "Parameter check failed"); - } - - ret = tel_get_sim_pb_count (handle, TAPI_SIM_PB_UNKNOWNN, on_tel_get_sim_pb_count, NULL); - if (ret == TAPI_API_SUCCESS) { - dts_fail("tel_get_sim_pb_count", "Parameter check failed"); - } - - dts_pass("tel_get_sim_pb_count"); -} - -/** - * tel_get_sim_pb_meta_info - * - */ -static void on_tel_get_sim_pb_meta_info (TapiHandle *handle, int result, void *data, - void *user_data) -{ - int *value = user_data; - - async_flag = ASYNC_DONE; - util_stop_loop (); - - if (*value != 0xC0FFEE) { - dts_fail("tel_get_sim_pb_meta_info", "Callback userdata crashed"); - } -} - -static void utc_tel_get_sim_pb_meta_info (void) -{ - int ret; - int value = 0xC0FFEE; - - util_init_loop (); - - async_flag = ASYNC_READY; - ret = tel_get_sim_pb_meta_info (handle, TAPI_SIM_PB_FDN, - on_tel_get_sim_pb_meta_info, &value); - if (ret != TAPI_API_SUCCESS) { - dts_fail("tel_get_sim_pb_meta_info", "Unexpected return"); - } - - util_start_loop (); - util_free_loop (); - - if (async_flag != ASYNC_DONE) { - dts_fail("tel_get_sim_pb_meta_info", "Callback not invoked"); - } - - dts_pass("tel_get_sim_pb_meta_info"); -} - -static void utc_fail_tel_get_sim_pb_meta_info (void) -{ - int ret; - - ret = tel_get_sim_pb_meta_info (NULL, TAPI_SIM_PB_FDN, NULL, NULL); - if (ret == TAPI_API_SUCCESS) { - dts_fail("tel_get_sim_pb_meta_info", "Parameter check failed"); - } - - ret = tel_get_sim_pb_meta_info (handle, TAPI_SIM_PB_FDN, NULL, NULL); - if (ret == TAPI_API_SUCCESS) { - dts_fail("tel_get_sim_pb_meta_info", "Parameter check failed"); - } - - ret = tel_get_sim_pb_meta_info (handle, TAPI_SIM_PB_UNKNOWNN, on_tel_get_sim_pb_meta_info, NULL); - if (ret == TAPI_API_SUCCESS) { - dts_fail("tel_get_sim_pb_meta_info", "Parameter check failed"); - } - - dts_pass("tel_get_sim_pb_meta_info"); -} - -/** - * tel_read_sim_pb_record - * - */ -static void on_tel_read_sim_pb_record (TapiHandle *handle, int result, - void *data, void *user_data) -{ - int *value = user_data; - - async_flag = ASYNC_DONE; - util_stop_loop (); - - if (*value != 0xC0FFEE) { - dts_fail("tel_read_sim_pb_record", "Callback userdata crashed"); - } -} - -static void utc_tel_read_sim_pb_record (void) -{ - int ret; - int value = 0xC0FFEE; - - util_init_loop (); - - async_flag = ASYNC_READY; - ret = tel_read_sim_pb_record (handle, TAPI_SIM_PB_ADN, - 1, on_tel_read_sim_pb_record, &value); - if (ret != TAPI_API_SUCCESS) { - dts_fail("tel_read_sim_pb_record", "Unexpected return"); - } - - util_start_loop (); - util_free_loop (); - - if (async_flag != ASYNC_DONE) { - dts_fail("tel_read_sim_pb_record", "Callback not invoked"); - } - - dts_pass("tel_read_sim_pb_record"); -} - -static void utc_fail_tel_read_sim_pb_record (void) -{ - int ret; - - ret = tel_read_sim_pb_record (NULL, TAPI_SIM_PB_ADN, 1, NULL, NULL); - if (ret == TAPI_API_SUCCESS) { - dts_fail("tel_read_sim_pb_record", "Parameter check failed"); - } - - ret = tel_read_sim_pb_record (handle, TAPI_SIM_PB_ADN, 1, NULL, NULL); - if (ret == TAPI_API_SUCCESS) { - dts_fail("tel_read_sim_pb_record", "Parameter check failed"); - } - - ret = tel_read_sim_pb_record (handle, TAPI_SIM_PB_ADN, 0, on_tel_read_sim_pb_record, NULL); - if (ret == TAPI_API_SUCCESS) { - dts_fail("tel_read_sim_pb_record", "Parameter check failed"); - } - - ret = tel_read_sim_pb_record (handle, TAPI_SIM_PB_UNKNOWNN, 1, on_tel_read_sim_pb_record, NULL); - if (ret == TAPI_API_SUCCESS) { - dts_fail("tel_read_sim_pb_record", "Parameter check failed"); - } - - dts_pass("tel_read_sim_pb_record"); -} - -/** - * tel_update_sim_pb_record - * - */ -static void on_tel_update_sim_pb_record (TapiHandle *handle, int result, - void *data, void *user_data) -{ - int *value = user_data; - - async_flag = ASYNC_DONE; - util_stop_loop (); - - if (*value != 0xC0FFEE) { - dts_fail("tel_update_sim_pb_record", "Callback userdata crashed"); - } -} - -static void utc_tel_update_sim_pb_record (void) -{ - int ret; - int value = 0xC0FFEE; - TelSimPbRecord_t req_data; - - memset(&req_data, 0, sizeof(TelSimPbRecord_t)); - req_data.phonebook_type = TAPI_SIM_PB_ADN; - req_data.index = 1; - strncpy(req_data.name, 6, "aaaaa"); - req_data.dcs = TAPI_SIM_TEXT_ENC_ASCII; - strncpy(req_data.number, 11, "8884266646"); - req_data.ton = TAPI_SIM_TON_NATIONAL; - - util_init_loop (); - - async_flag = ASYNC_READY; - ret = tel_update_sim_pb_record (handle, &req_data, - on_tel_update_sim_pb_record, &value); - if (ret != TAPI_API_SUCCESS) { - dts_fail("tel_update_sim_pb_record", "Unexpected return"); - } - - util_start_loop (); - util_free_loop (); - - if (async_flag != ASYNC_DONE) { - dts_fail("tel_update_sim_pb_record", "Callback not invoked"); - } - - dts_pass("tel_update_sim_pb_record"); -} - -static void utc_fail_tel_update_sim_pb_record (void) -{ - int ret; - TelSimPbRecord_t req_data; - - memset(&req_data, 0, sizeof(TelSimPbRecord_t)); - - ret = tel_update_sim_pb_record (NULL, NULL, NULL, NULL); - if (ret == TAPI_API_SUCCESS) { - dts_fail("tel_update_sim_pb_record", "Parameter check failed"); - } - - ret = tel_update_sim_pb_record (handle, NULL, NULL, NULL); - if (ret == TAPI_API_SUCCESS) { - dts_fail("tel_update_sim_pb_record", "Parameter check failed"); - } - - req_data.index = 0; - ret = tel_update_sim_pb_record (handle, &req_data, NULL, NULL); - if (ret == TAPI_API_SUCCESS) { - dts_fail("tel_update_sim_pb_record", "Parameter check failed"); - } - - req_data.index = 1; - req_data.phonebook_type = TAPI_SIM_PB_UNKNOWNN; - ret = tel_update_sim_pb_record (handle, &req_data, NULL, NULL); - if (ret == TAPI_API_SUCCESS) { - dts_fail("tel_update_sim_pb_record", "Parameter check failed"); - } - - dts_pass("tel_update_sim_pb_record"); -} - -/** - * tel_delete_sim_pb_record - * - */ -static void on_tel_delete_sim_pb_record (TapiHandle *handle, int result, - void *data, void *user_data) -{ - int *value = user_data; - - async_flag = ASYNC_DONE; - util_stop_loop (); - - if (*value != 0xC0FFEE) { - dts_fail("tel_delete_sim_pb_record", "Callback userdata crashed"); - } -} - -static void utc_tel_delete_sim_pb_record (void) -{ - int ret; - int value = 0xC0FFEE; - - util_init_loop (); - - async_flag = ASYNC_READY; - ret = tel_delete_sim_pb_record (handle, TAPI_SIM_PB_ADN, - 1, on_tel_delete_sim_pb_record, &value); - if (ret != TAPI_API_SUCCESS) { - dts_fail("tel_delete_sim_pb_record", "Unexpected return"); - } - - util_start_loop (); - util_free_loop (); - - if (async_flag != ASYNC_DONE) { - dts_fail("tel_delete_sim_pb_record", "Callback not invoked"); - } - - dts_pass("tel_delete_sim_pb_record"); -} - -static void utc_fail_tel_delete_sim_pb_record (void) -{ - int ret; - - ret = tel_delete_sim_pb_record (NULL, TAPI_SIM_PB_ADN, 1, NULL, NULL); - if (ret == TAPI_API_SUCCESS) { - dts_fail("tel_delete_sim_pb_record", "Parameter check failed"); - } - - ret = tel_delete_sim_pb_record (handle, TAPI_SIM_PB_ADN, 0, NULL, NULL); - if (ret == TAPI_API_SUCCESS) { - dts_fail("tel_delete_sim_pb_record", "Parameter check failed"); - } - - ret = tel_delete_sim_pb_record (handle, TAPI_SIM_PB_UNKNOWNN, 1, NULL, NULL); - if (ret == TAPI_API_SUCCESS) { - dts_fail("tel_delete_sim_pb_record", "Parameter check failed"); - } - - dts_pass("tel_delete_sim_pb_record"); -} - - - -/** - * Generate default TC for no-additional-parameter type API - * - */ -DO(tel_get_sim_pb_usim_meta_info) - -struct tet_testlist tet_testlist[] = { - /* generated TC */ - { utc_tel_get_sim_pb_usim_meta_info, 1 }, - { utc_fail_tel_get_sim_pb_usim_meta_info, 2 }, - - /* custom TC */ - { utc_tel_get_sim_pb_init_info, 1 }, - { utc_fail_tel_get_sim_pb_init_info, 2 }, - { utc_tel_get_sim_pb_count, 1 }, - { utc_fail_tel_get_sim_pb_count, 2 }, - { utc_tel_get_sim_pb_meta_info, 1 }, - { utc_fail_tel_get_sim_pb_meta_info, 2 }, - { utc_tel_read_sim_pb_record, 1 }, - { utc_fail_tel_read_sim_pb_record, 2 }, - { utc_tel_update_sim_pb_record, 1 }, - { utc_fail_tel_update_sim_pb_record, 2 }, - { utc_tel_delete_sim_pb_record, 1 }, - { utc_fail_tel_delete_sim_pb_record, 2 }, - { NULL, 0 }, -}; - -static void startup (void) -{ - /* start of TC */ - tet_printf ("\n TC start"); - - handle = tel_init (NULL); -} - -static void cleanup (void) -{ - tel_deinit (handle); - - /* end of TC */ - tet_printf ("\n TC end"); -} - -void (*tet_startup) (void) = startup; -void (*tet_cleanup) (void) = cleanup; diff --git a/wearable/TC/testcase/utc_sap.c b/wearable/TC/testcase/utc_sap.c deleted file mode 100644 index 219854c..0000000 --- a/wearable/TC/testcase/utc_sap.c +++ /dev/null @@ -1,309 +0,0 @@ -/* - * libslp-tapi - * - * Copyright (c) 2013 Samsung Electronics Co., Ltd. All rights reserved. - * - * Contact: Ankit Jogi - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT 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 "util_common.h" - -TapiHandle *handle; -enum async_state async_flag; - -/** - * tel_req_sap_connect - * - */ -static void on_tel_req_sap_connect (TapiHandle *handle, int result, - void *data, void *user_data) -{ - int *value = user_data; - - async_flag = ASYNC_DONE; - util_stop_loop (); - - if (*value != 0xC0FFEE) { - dts_fail("tel_req_sap_connect", "Callback userdata crashed"); - } -} - -static void utc_tel_req_sap_connect (void) -{ - int ret; - int value = 0xC0FFEE; - int max_msg_size; - - max_msg_size = 255; - - util_init_loop (); - - async_flag = ASYNC_READY; - ret = tel_req_sap_connect (handle, max_msg_size, on_tel_req_sap_connect, &value); - if (ret != TAPI_API_SUCCESS) { - dts_fail("tel_req_sap_connect", "Unexpected return"); - } - - util_start_loop (); - util_free_loop (); - - if (async_flag != ASYNC_DONE) { - dts_fail("tel_req_sap_connect", "Callback not invoked"); - } - - dts_pass("tel_req_sap_connect"); -} - -static void utc_fail_tel_req_sap_connect (void) -{ - int ret; - - ret = tel_req_sap_connect (NULL, 0, NULL, NULL); - if (ret == TAPI_API_SUCCESS) { - dts_fail("tel_req_sap_connect", "Parameter check failed"); - } - - dts_pass("tel_req_sap_connect"); -} - -/** - * tel_req_sap_transfer_apdu - * - */ -static void on_tel_req_sap_transfer_apdu (TapiHandle *handle, int result, - void *data, void *user_data) -{ - int *value = user_data; - - async_flag = ASYNC_DONE; - util_stop_loop (); - - if (*value != 0xC0FFEE) { - dts_fail("tel_req_sap_transfer_apdu", "Callback userdata crashed"); - } -} - -static void utc_tel_req_sap_transfer_apdu (void) -{ - int ret; - int value = 0xC0FFEE; - TelSapApduData_t apdu; - - memset (&apdu, 0, sizeof(TelSimApdu_t)); - - apdu.apdu_len = 7; - strcpy ((char *)apdu.apdu_data, "a0a40000026f02"); - - util_init_loop (); - - async_flag = ASYNC_READY; - ret = tel_req_sap_transfer_apdu (handle, &apdu, on_tel_req_sap_transfer_apdu, &value); - if (ret != TAPI_API_SUCCESS) { - dts_fail("tel_req_sap_transfer_apdu", "Unexpected return"); - } - - util_start_loop (); - util_free_loop (); - - if (async_flag != ASYNC_DONE) { - dts_fail("tel_req_sap_transfer_apdu", "Callback not invoked"); - } - - dts_pass("tel_req_sap_transfer_apdu"); -} - -static void utc_fail_tel_req_sap_transfer_apdu (void) -{ - int ret; - - ret = tel_req_sap_transfer_apdu (NULL, NULL, NULL, NULL); - if (ret == TAPI_API_SUCCESS) { - dts_fail("tel_req_sap_transfer_apdu", "Parameter check failed"); - } - - ret = tel_req_sap_transfer_apdu (handle, NULL, NULL, NULL); - if (ret == TAPI_API_SUCCESS) { - dts_fail("tel_req_sap_transfer_apdu", "Parameter check failed"); - } - - dts_pass("tel_req_sap_transfer_apdu"); -} - -/** - * tel_req_sap_transport_protocol - * - */ -static void on_tel_req_sap_transport_protocol (TapiHandle *handle, int result, - void *data, void *user_data) -{ - int *value = user_data; - - async_flag = ASYNC_DONE; - util_stop_loop (); - - if (*value != 0xC0FFEE) { - dts_fail("tel_req_sap_transport_protocol", "Callback userdata crashed"); - } -} - -static void utc_tel_req_sap_transport_protocol (void) -{ - int ret; - int value = 0xC0FFEE; - TelSimSapProtocol_t protocol; - - protocol = 0; - - util_init_loop (); - - async_flag = ASYNC_READY; - ret = tel_req_sap_transport_protocol (handle, protocol, on_tel_req_sap_transport_protocol, &value); - if (ret != TAPI_API_SUCCESS) { - dts_fail("tel_req_sap_transport_protocol", "Unexpected return"); - } - - util_start_loop (); - util_free_loop (); - - if (async_flag != ASYNC_DONE) { - dts_fail("tel_req_sap_transport_protocol", "Callback not invoked"); - } - - dts_pass("tel_req_sap_transport_protocol"); -} - -static void utc_fail_tel_req_sap_transport_protocol (void) -{ - int ret; - - ret = tel_req_sap_transport_protocol (NULL, 0, NULL, NULL); - if (ret == TAPI_API_SUCCESS) { - dts_fail("tel_req_sap_transport_protocol", "Parameter check failed"); - } - - dts_pass("tel_req_sap_transport_protocol"); -} - -/** - * tel_req_sap_power_operation - * - */ -static void on_tel_req_sap_power_operation (TapiHandle *handle, int result, - void *data, void *user_data) -{ - int *value = user_data; - - async_flag = ASYNC_DONE; - util_stop_loop (); - - if (*value != 0xC0FFEE) { - dts_fail("tel_req_sap_power_operation", "Callback userdata crashed"); - } -} - -static void utc_tel_req_sap_power_operation (void) -{ - int ret; - int value = 0xC0FFEE; - TelSimSapPowerMode_t power_mode; - - power_mode = 0; - - util_init_loop (); - - async_flag = ASYNC_READY; - ret = tel_req_sap_power_operation (handle, power_mode, on_tel_req_sap_power_operation, &value); - if (ret != TAPI_API_SUCCESS) { - dts_fail("tel_req_sap_power_operation", "Unexpected return"); - } - - util_start_loop (); - util_free_loop (); - - if (async_flag != ASYNC_DONE) { - dts_fail("tel_req_sap_power_operation", "Callback not invoked"); - } - - dts_pass("tel_req_sap_power_operation"); -} - -static void utc_fail_tel_req_sap_power_operation (void) -{ - int ret; - - ret = tel_req_sap_power_operation (NULL, 0, NULL, NULL); - if (ret == TAPI_API_SUCCESS) { - dts_fail("tel_req_sap_power_operation", "Parameter check failed"); - } - - dts_pass("tel_req_sap_power_operation"); -} - -/** - * Generate default TC for no-additional-parameter type API - * - */ -DO(tel_req_sap_disconnect) -DO(tel_req_sap_connection_status) -DO(tel_req_sap_transfer_atr) -DO(tel_req_sap_cardreader_status) - -struct tet_testlist tet_testlist[] = { - /* generated TC */ - { utc_tel_req_sap_disconnect, 1 }, - { utc_fail_tel_req_sap_disconnect, 2 }, - { utc_tel_req_sap_connection_status, 1 }, - { utc_fail_tel_req_sap_connection_status, 2 }, - { utc_tel_req_sap_transfer_atr, 1 }, - { utc_fail_tel_req_sap_transfer_atr, 2 }, - { utc_tel_req_sap_cardreader_status, 1 }, - { utc_fail_tel_req_sap_cardreader_status, 2 }, - /* custom TC */ - { utc_tel_req_sap_connect, 1 }, - { utc_fail_tel_req_sap_connect, 2 }, - { utc_tel_req_sap_transfer_apdu, 1 }, - { utc_fail_tel_req_sap_transfer_apdu, 2 }, - { utc_tel_req_sap_transport_protocol, 1 }, - { utc_fail_tel_req_sap_transport_protocol, 2 }, - { utc_tel_req_sap_power_operation, 1 }, - { utc_fail_tel_req_sap_power_operation, 2 }, - { NULL, 0 }, -}; - -static void startup (void) -{ - /* start of TC */ - tet_printf ("\n TC start"); - - handle = tel_init (NULL); -} - -static void cleanup (void) -{ - tel_deinit (handle); - - /* end of TC */ - tet_printf ("\n TC end"); -} - -void (*tet_startup) (void) = startup; -void (*tet_cleanup) (void) = cleanup; diff --git a/wearable/TC/testcase/utc_sat.c b/wearable/TC/testcase/utc_sat.c deleted file mode 100644 index 6752af4..0000000 --- a/wearable/TC/testcase/utc_sat.c +++ /dev/null @@ -1,335 +0,0 @@ -/* - * libslp-tapi - * - * Copyright (c) 2013 Samsung Electronics Co., Ltd. All rights reserved. - * - * Contact: Shaik Alimulla - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT 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 "util_common.h" - -TapiHandle *handle; -enum async_state async_flag; -TelSatSetupMenuInfo_t main_menu; - -/** - * tel_get_sat_main_menu_info - * Synchronous call - * - */ - -static void utc_tel_get_sat_main_menu_info (void) -{ - int ret; - - ret = tel_get_sat_main_menu_info (handle, &main_menu); - if (ret != TAPI_API_SUCCESS) { - dts_fail("tel_get_sat_main_menu_info", "Unexpected return"); - } - - dts_pass("tel_get_sat_main_menu_info"); -} - -static void utc_fail_tel_get_sat_main_menu_info (void) -{ - int ret; - - ret = tel_get_sat_main_menu_info (NULL, NULL); - if (ret == TAPI_API_SUCCESS) { - dts_fail("tel_get_sat_main_menu_info", "Parameter check failed"); - } - - ret = tel_get_sat_main_menu_info (handle, NULL); - if (ret == TAPI_API_SUCCESS) { - dts_fail("tel_get_sat_main_menu_info", "Parameter check failed"); - } - - dts_pass("tel_get_sat_main_menu_info"); -} - -/** - * tel_select_sat_menu - * - */ -static void on_tel_select_sat_menu (TapiHandle *handle, int result, - void *data, void *user_data) -{ - int *value = user_data; - - async_flag = ASYNC_DONE; - util_stop_loop (); - - if (*value != 0xC0FFEE) { - dts_fail("tel_select_sat_menu", "Callback userdata crashed"); - } -} - -static void utc_tel_select_sat_menu (void) -{ - int ret; - int value = 0xC0FFEE; - TelSatMenuSelectionReqInfo_t selected_menu; - - selected_menu.bIsHelpRequested = 0; - selected_menu.itemIdentifier = 0x01; - - util_init_loop (); - - async_flag = ASYNC_READY; - ret = tel_select_sat_menu (handle, &selected_menu, on_tel_select_sat_menu, &value); - if (ret != TAPI_API_SUCCESS) { - dts_fail("tel_select_sat_menu", "Unexpected return"); - } - - util_start_loop (); - util_free_loop (); - - if (async_flag != ASYNC_DONE) { - dts_fail("tel_select_sat_menu", "Callback not invoked"); - } - - dts_pass("tel_select_sat_menu"); -} - -static void utc_fail_tel_select_sat_menu (void) -{ - int ret; - - ret = tel_select_sat_menu (NULL, NULL, NULL, NULL); - if (ret == TAPI_API_SUCCESS) { - dts_fail("tel_select_sat_menu", "Parameter check failed"); - } - - ret = tel_select_sat_menu (handle, NULL, NULL, NULL); - if (ret == TAPI_API_SUCCESS) { - dts_fail("tel_select_sat_menu", "Parameter check failed"); - } - - dts_pass("tel_select_sat_menu"); -} - -/** - * tel_download_sat_event - * - */ -static void on_tel_download_sat_event (TapiHandle *handle, int result, - void *data, void *user_data) -{ - int *value = user_data; - - async_flag = ASYNC_DONE; - util_stop_loop (); - - if (*value != 0xC0FFEE) { - dts_fail("tel_download_sat_event", "Callback userdata crashed"); - } -} - -static void utc_tel_download_sat_event (void) -{ - int ret; - int value = 0xC0FFEE; - TelSatEventDownloadReqInfo_t event_data; - - event_data.eventDownloadType = TAPI_EVENT_SAT_DW_TYPE_CALL_CONNECTED; - - util_init_loop (); - - async_flag = ASYNC_READY; - ret = tel_download_sat_event (handle, &event_data, on_tel_download_sat_event, &value); - if (ret != TAPI_API_SUCCESS) { - dts_fail("tel_download_sat_event", "Unexpected return"); - } - - util_start_loop (); - util_free_loop (); - - if (async_flag != ASYNC_DONE) { - dts_fail("tel_download_sat_event", "Callback not invoked"); - } - - dts_pass("tel_download_sat_event"); -} - -static void utc_fail_tel_download_sat_event (void) -{ - int ret; - - ret = tel_download_sat_event (NULL, NULL, NULL, NULL); - if (ret == TAPI_API_SUCCESS) { - dts_fail("tel_download_sat_event", "Parameter check failed"); - } - - ret = tel_download_sat_event (handle, NULL, NULL, NULL); - if (ret == TAPI_API_SUCCESS) { - dts_fail("tel_download_sat_event", "Parameter check failed"); - } - - dts_pass("tel_download_sat_event"); -} - -/** - * tel_send_sat_ui_display_status - * - */ -static void utc_tel_send_sat_ui_display_status (void) -{ - int ret; - TelSatUiDisplayStatusType_t status; - - status = TAPI_SAT_DISPLAY_SUCCESS; - - ret = tel_send_sat_ui_display_status (handle, 0, status); - if (ret != TAPI_API_SUCCESS) { - dts_fail("tel_send_sat_ui_display_status", "Unexpected return"); - } - - dts_pass("tel_send_sat_ui_display_status"); -} - -static void utc_fail_tel_send_sat_ui_display_status (void) -{ - int ret; - - ret = tel_send_sat_ui_display_status (NULL, 0, 0); - if (ret == TAPI_API_SUCCESS) { - dts_fail("tel_send_sat_ui_display_status", "Parameter check failed"); - } - - dts_pass("tel_send_sat_ui_display_status"); -} - -/** - * tel_send_sat_ui_user_confirm - * - */ -static void utc_tel_send_sat_ui_user_confirm (void) -{ - int ret; - TelSatUiUserConfirmInfo_t user_confirm_data; - - user_confirm_data.commandId = 0; - user_confirm_data.commandType = TAPI_SAT_CMD_TYPE_DISPLAY_TEXT; - user_confirm_data.keyType = TAPI_SAT_USER_CONFIRM_YES; - user_confirm_data.dataLen = 0; - user_confirm_data.pAdditionalData = NULL; - - - ret = tel_send_sat_ui_user_confirm (handle, &user_confirm_data); - if (ret != TAPI_API_SUCCESS) { - dts_fail("tel_send_sat_ui_user_confirm", "Unexpected return"); - } - - dts_pass("tel_send_sat_ui_user_confirm"); -} - -static void utc_fail_tel_send_sat_ui_user_confirm (void) -{ - int ret; - - ret = tel_send_sat_ui_user_confirm (NULL, NULL); - if (ret == TAPI_API_SUCCESS) { - dts_fail("tel_send_sat_ui_user_confirm", "Parameter check failed"); - } - - ret = tel_send_sat_ui_user_confirm (handle, NULL ); - if (ret == TAPI_API_SUCCESS) { - dts_fail("tel_send_sat_ui_user_confirm", "Parameter check failed"); - } - - dts_pass("tel_send_sat_ui_user_confirm"); -} - -/** - * tel_send_sat_app_exec_result - * - */ -static void utc_tel_send_sat_app_exec_result (void) -{ - int ret; - TelSatAppsRetInfo_t app_ret_info; - - app_ret_info.commandId = 0; - app_ret_info.commandType = TAPI_SAT_CMD_TYPE_DISPLAY_TEXT; - app_ret_info.appsRet.displayText.resp = TAPI_SAT_R_SUCCESS; - app_ret_info.appsRet.displayText.meProblem = TAPI_SAT_ME_PROBLEM_NO_SPECIFIC_CAUSE; - - ret = tel_send_sat_app_exec_result (handle, &app_ret_info); - if (ret != TAPI_API_SUCCESS) { - dts_fail("tel_send_sat_app_exec_result", "Unexpected return"); - } - - dts_pass("tel_send_sat_app_exec_result"); -} - -static void utc_fail_tel_send_sat_app_exec_result (void) -{ - int ret; - - ret = tel_send_sat_app_exec_result (NULL, NULL); - if (ret == TAPI_API_SUCCESS) { - dts_fail("tel_send_sat_app_exec_result", "Parameter check failed"); - } - - ret = tel_send_sat_app_exec_result (handle, NULL ); - if (ret == TAPI_API_SUCCESS) { - dts_fail("tel_send_sat_app_exec_result", "Parameter check failed"); - } - - dts_pass("tel_send_sat_app_exec_result"); -} - -struct tet_testlist tet_testlist[] = { - /* generated TC */ - { utc_tel_get_sat_main_menu_info, 1 }, - { utc_fail_tel_get_sat_main_menu_info, 2 }, - { utc_tel_select_sat_menu, 1 }, - { utc_fail_tel_select_sat_menu, 2 }, - { utc_tel_download_sat_event, 1 }, - { utc_fail_tel_download_sat_event, 2 }, - { utc_tel_send_sat_ui_display_status, 1 }, - { utc_fail_tel_send_sat_ui_display_status, 2 }, - { utc_tel_send_sat_ui_user_confirm, 1 }, - { utc_fail_tel_send_sat_ui_user_confirm, 2 }, - { utc_tel_send_sat_app_exec_result, 1 }, - { utc_fail_tel_send_sat_app_exec_result, 2 }, - { NULL, 0 }, -}; - -static void startup (void) -{ - /* start of TC */ - tet_printf ("\n TC start"); - - handle = tel_init (NULL); -} - -static void cleanup (void) -{ - tel_deinit (handle); - - /* end of TC */ - tet_printf ("\n TC end"); -} - -void (*tet_startup) (void) = startup; -void (*tet_cleanup) (void) = cleanup; diff --git a/wearable/TC/testcase/utc_sim.c b/wearable/TC/testcase/utc_sim.c deleted file mode 100644 index b063ba1..0000000 --- a/wearable/TC/testcase/utc_sim.c +++ /dev/null @@ -1,1423 +0,0 @@ -/* - * libslp-tapi - * - * Copyright (c) 2013 Samsung Electronics Co., Ltd. All rights reserved. - * - * Contact: Ankit Jogi - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT 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 "util_common.h" - -TapiHandle *handle; -enum async_state async_flag; - - -/** - * tel_get_sim_init_info - * - */ -static void utc_tel_get_sim_init_info (void) -{ - int ret; - TelSimCardStatus_t sim_status; - int card_changed; - - util_init_loop (); - - ret = tel_get_sim_init_info (handle, &sim_status, &card_changed); - if (ret != TAPI_API_SUCCESS) { - dts_fail("tel_get_sim_init_info", "Unexpected return"); - } - - dts_pass("tel_get_sim_init_info"); -} - -static void utc_fail_tel_get_sim_init_info (void) -{ - int ret; - TelSimCardStatus_t sim_status; - int card_changed; - - ret = tel_get_sim_init_info (NULL, &sim_status, &card_changed); - if (ret == TAPI_API_SUCCESS) { - dts_fail("tel_get_sim_init_info", "Parameter check failed"); - } - - ret = tel_get_sim_init_info (handle, NULL, &card_changed); - if (ret == TAPI_API_SUCCESS) { - dts_fail("tel_get_sim_init_info", "Parameter check failed"); - } - - ret = tel_get_sim_init_info (handle, &sim_status, NULL); - if (ret == TAPI_API_SUCCESS) { - dts_fail("tel_get_sim_init_info", "Parameter check failed"); - } - - ret = tel_get_sim_init_info (handle, NULL, NULL); - if (ret == TAPI_API_SUCCESS) { - dts_fail("tel_get_sim_init_info", "Parameter check failed"); - } - - dts_pass("tel_get_sim_init_info"); -} - -/** - * tel_get_sim_type - * - */ -static void utc_tel_get_sim_type (void) -{ - int ret; - TelSimCardType_t card_type; - - util_init_loop (); - - ret = tel_get_sim_type (handle, &card_type); - if (ret != TAPI_API_SUCCESS) { - dts_fail("tel_get_sim_type", "Unexpected return"); - } - - dts_pass("tel_get_sim_type"); -} - -static void utc_fail_tel_get_sim_type (void) -{ - int ret; - TelSimCardType_t card_type; - - ret = tel_get_sim_type (NULL, &card_type); - if (ret == TAPI_API_SUCCESS) { - dts_fail("tel_get_sim_type", "Parameter check failed"); - } - - ret = tel_get_sim_type (handle, NULL); - if (ret == TAPI_API_SUCCESS) { - dts_fail("tel_get_sim_type", "Parameter check failed"); - } - - dts_pass("tel_get_sim_type"); -} - -/** - * tel_get_sim_imsi - * - */ -static void utc_tel_get_sim_imsi (void) -{ - int ret; - TelSimImsiInfo_t imsi; - - util_init_loop (); - - ret = tel_get_sim_imsi (handle, &imsi); - if (ret != TAPI_API_SUCCESS) { - dts_fail("tel_get_sim_imsi", "Unexpected return"); - } - - dts_pass("tel_get_sim_imsi"); -} - -static void utc_fail_tel_get_sim_imsi (void) -{ - int ret; - TelSimImsiInfo_t imsi; - - ret = tel_get_sim_imsi (NULL, &imsi); - if (ret == TAPI_API_SUCCESS) { - dts_fail("tel_get_sim_imsi", "Parameter check failed"); - } - - ret = tel_get_sim_imsi (handle, NULL); - if (ret == TAPI_API_SUCCESS) { - dts_fail("tel_get_sim_imsi", "Parameter check failed"); - } - - dts_pass("tel_get_sim_imsi"); -} - -/** - * tel_get_sim_ecc - * - */ -static void utc_tel_get_sim_ecc (void) -{ - int ret; - TelSimEccList_t ecc; - - util_init_loop (); - - ret = tel_get_sim_ecc (handle, &ecc); - if (ret != TAPI_API_SUCCESS) { - dts_fail("tel_get_sim_ecc", "Unexpected return"); - } - - dts_pass("tel_get_sim_ecc"); -} - -static void utc_fail_tel_get_sim_ecc (void) -{ - int ret; - TelSimEccList_t ecc; - - ret = tel_get_sim_ecc (NULL, &ecc); - if (ret == TAPI_API_SUCCESS) { - dts_fail("tel_get_sim_ecc", "Parameter check failed"); - } - - ret = tel_get_sim_ecc (handle, NULL); - if (ret == TAPI_API_SUCCESS) { - dts_fail("tel_get_sim_ecc", "Parameter check failed"); - } - - dts_pass("tel_get_sim_ecc"); -} - -/** - * tel_set_sim_language - * - */ -static void on_tel_set_sim_language (TapiHandle *handle, int result, - void *data, void *user_data) -{ - int *value = user_data; - - async_flag = ASYNC_DONE; - util_stop_loop (); - - if (*value != 0xC0FFEE) { - dts_fail("tel_set_sim_language", "Callback userdata crashed"); - } -} - -static void utc_tel_set_sim_language (void) -{ - int ret; - int value = 0xC0FFEE; - - util_init_loop (); - - async_flag = ASYNC_READY; - ret = tel_set_sim_language (handle, 2, on_tel_set_sim_language, &value); - if (ret != TAPI_API_SUCCESS) { - dts_fail("tel_set_sim_language", "Unexpected return"); - } - - util_start_loop (); - util_free_loop (); - - if (async_flag != ASYNC_DONE) { - dts_fail("tel_set_sim_language", "Callback not invoked"); - } - - dts_pass("tel_set_sim_language"); -} - -static void utc_fail_tel_set_sim_language (void) -{ - int ret; - - ret = tel_set_sim_language (NULL, 0, NULL, NULL); - if (ret == TAPI_API_SUCCESS) { - dts_fail("tel_set_sim_language", "Parameter check failed"); - } - - dts_pass("tel_set_sim_language"); -} - -/** - * tel_set_sim_callforwarding_info - * - */ -static void on_tel_set_sim_callforwarding_info (TapiHandle *handle, int result, - void *data, void *user_data) -{ - int *value = user_data; - - async_flag = ASYNC_DONE; - util_stop_loop (); - - if (*value != 0xC0FFEE) { - dts_fail("tel_set_sim_callforwarding_info", "Callback userdata crashed"); - } -} - -static void utc_tel_set_sim_callforwarding_info (void) -{ - int ret; - int value = 0xC0FFEE; - TelSimCallForwardingReq_t req_cphs_cf; - - memset (&req_cphs_cf, 0, sizeof(TelSimCallForwardingReq_t)); - - req_cphs_cf.b_cphs = 1; - req_cphs_cf.cf_data_u.cphs_cf.b_line1 = 1; - req_cphs_cf.cf_data_u.cphs_cf.b_line2 = 0; - req_cphs_cf.cf_data_u.cphs_cf.b_fax = 1; - req_cphs_cf.cf_data_u.cphs_cf.b_data = 0; - - util_init_loop (); - - async_flag = ASYNC_READY; - ret = tel_set_sim_callforwarding_info (handle, &req_cphs_cf, on_tel_set_sim_callforwarding_info, &value); - if (ret != TAPI_API_SUCCESS) { - dts_fail("tel_set_sim_callforwarding_info", "Unexpected return"); - } - - util_start_loop (); - util_free_loop (); - - if (async_flag != ASYNC_DONE) { - dts_fail("tel_set_sim_callforwarding_info", "Callback not invoked"); - } - - dts_pass("tel_set_sim_callforwarding_info"); -} - -static void utc_fail_tel_set_sim_callforwarding_info (void) -{ - int ret; - TelSimCallForwardingReq_t req_cphs_cf; - - memset (&req_cphs_cf, 0, sizeof(TelSimCallForwardingReq_t)); - - req_cphs_cf.b_cphs = 1; - req_cphs_cf.cf_data_u.cphs_cf.b_line1 = 1; - req_cphs_cf.cf_data_u.cphs_cf.b_line2 = 0; - req_cphs_cf.cf_data_u.cphs_cf.b_fax = 1; - req_cphs_cf.cf_data_u.cphs_cf.b_data = 0; - - ret = tel_set_sim_callforwarding_info (NULL, &req_cphs_cf, NULL, NULL); - if (ret == TAPI_API_SUCCESS) { - dts_fail("tel_set_sim_callforwarding_info", "Parameter check failed"); - } - - ret = tel_set_sim_callforwarding_info (handle, NULL, NULL, NULL); - if (ret == TAPI_API_SUCCESS) { - dts_fail("tel_set_sim_callforwarding_info", "Parameter check failed"); - } - - dts_pass("tel_set_sim_callforwarding_info"); -} - -/** - * tel_set_sim_messagewaiting_info - * - */ -static void on_tel_set_sim_messagewaiting_info (TapiHandle *handle, int result, - void *data, void *user_data) -{ - int *value = user_data; - - async_flag = ASYNC_DONE; - util_stop_loop (); - - if (*value != 0xC0FFEE) { - dts_fail("tel_set_sim_messagewaiting_info", "Callback userdata crashed"); - } -} - -static void utc_tel_set_sim_messagewaiting_info (void) -{ - int ret; - int value = 0xC0FFEE; - TelSimMessageWaitingReq_t req_mw; - - memset (&req_mw, 0, sizeof(TelSimMessageWaitingReq_t)); - - req_mw.b_cphs = 1; - req_mw.mw_data_u.cphs_mw.b_voice1 = 1; - req_mw.mw_data_u.cphs_mw.b_voice2 = 0; - req_mw.mw_data_u.cphs_mw.b_fax = 1; - req_mw.mw_data_u.cphs_mw.b_data = 0; - - util_init_loop (); - - async_flag = ASYNC_READY; - ret = tel_set_sim_messagewaiting_info (handle, &req_mw, on_tel_set_sim_messagewaiting_info, &value); - if (ret != TAPI_API_SUCCESS) { - dts_fail("tel_set_sim_messagewaiting_info", "Unexpected return"); - } - - util_start_loop (); - util_free_loop (); - - if (async_flag != ASYNC_DONE) { - dts_fail("tel_set_sim_messagewaiting_info", "Callback not invoked"); - } - - dts_pass("tel_set_sim_callforwarding_info"); -} - -static void utc_fail_tel_set_sim_messagewaiting_info (void) -{ - int ret; - TelSimMessageWaitingReq_t req_mw; - - memset (&req_mw, 0, sizeof(TelSimMessageWaitingReq_t)); - - req_mw.b_cphs = 1; - req_mw.mw_data_u.cphs_mw.b_voice1 = 1; - req_mw.mw_data_u.cphs_mw.b_voice2 = 0; - req_mw.mw_data_u.cphs_mw.b_fax = 1; - req_mw.mw_data_u.cphs_mw.b_data = 0; - - ret = tel_set_sim_messagewaiting_info (NULL, &req_mw, NULL, NULL); - if (ret == TAPI_API_SUCCESS) { - dts_fail("tel_set_sim_messagewaiting_info", "Parameter check failed"); - } - - ret = tel_set_sim_messagewaiting_info (handle, NULL, NULL, NULL); - if (ret == TAPI_API_SUCCESS) { - dts_fail("tel_set_sim_messagewaiting_info", "Parameter check failed"); - } - - dts_pass("tel_set_sim_messagewaiting_info"); -} - -/** - * tel_set_sim_mailbox_info - * - */ -static void on_tel_set_sim_mailbox_info (TapiHandle *handle, int result, - void *data, void *user_data) -{ - int *value = user_data; - - async_flag = ASYNC_DONE; - util_stop_loop (); - - if (*value != 0xC0FFEE) { - dts_fail("tel_set_sim_mailbox_info", "Callback userdata crashed"); - } -} - -static void utc_tel_set_sim_mailbox_info (void) -{ - int ret; - int value = 0xC0FFEE; - TelSimMailBoxNumber_t req_mb; - - memset (&req_mb, 0, sizeof(TelSimMailBoxNumber_t)); - - req_mb.b_cphs = 1; - req_mb.rec_index = 1; - req_mb.profile_num = 1; - req_mb.mb_type = 1; - req_mb.alpha_id_max_len = 10; - strcpy (req_mb.alpha_id, "123456"); - req_mb.ton = 2; - req_mb.npi = 8; - strcpy (req_mb.num, "9988776655"); - - util_init_loop (); - - async_flag = ASYNC_READY; - ret = tel_set_sim_mailbox_info (handle, &req_mb, on_tel_set_sim_mailbox_info, &value); - if (ret != TAPI_API_SUCCESS) { - dts_fail("tel_set_sim_mailbox_info", "Unexpected return"); - } - - util_start_loop (); - util_free_loop (); - - if (async_flag != ASYNC_DONE) { - dts_fail("tel_set_sim_mailbox_info", "Callback not invoked"); - } - - dts_pass("tel_set_sim_mailbox_info"); -} - -static void utc_fail_tel_set_sim_mailbox_info (void) -{ - int ret; - TelSimMailBoxNumber_t req_mb; - - memset (&req_mb, 0, sizeof(TelSimMailBoxNumber_t)); - - req_mb.b_cphs = 1; - req_mb.rec_index = 1; - req_mb.profile_num = 1; - req_mb.mb_type = 1; - req_mb.alpha_id_max_len = 10; - strcpy (req_mb.alpha_id, "123456"); - req_mb.ton = 2; - req_mb.npi = 8; - strcpy (req_mb.num, "9988776655"); - - ret = tel_set_sim_mailbox_info (NULL, &req_mb, NULL, NULL); - if (ret == TAPI_API_SUCCESS) { - dts_fail("tel_set_sim_mailbox_info", "Parameter check failed"); - } - - ret = tel_set_sim_mailbox_info (handle, NULL, NULL, NULL); - if (ret == TAPI_API_SUCCESS) { - dts_fail("tel_set_sim_mailbox_info", "Parameter check failed"); - } - - dts_pass("tel_set_sim_mailbox_info"); -} - -/** - * tel_req_sim_authentication - * - */ -static void on_tel_req_sim_authentication (TapiHandle *handle, int result, - void *data, void *user_data) -{ - int *value = user_data; - - async_flag = ASYNC_DONE; - util_stop_loop (); - - if (*value != 0xC0FFEE) { - dts_fail("tel_set_sim_mailbox_info", "Callback userdata crashed"); - } -} - -static void utc_tel_req_sim_authentication (void) -{ - int ret; - int value = 0xC0FFEE; - TelSimAuthenticationData_t authentication_data; - - memset (&authentication_data, 0, sizeof(TelSimAuthenticationData_t)); - - authentication_data.auth_type = 1; - authentication_data.rand_length = 16; - authentication_data.autn_length = 16; - strcpy (authentication_data.rand_data, "AAAAAAAAAAAAAAAA"); - strcpy (authentication_data.autn_data, "AAAAAAAAAAAAAAAA"); - - util_init_loop (); - - async_flag = ASYNC_READY; - ret = tel_req_sim_authentication (handle, &authentication_data, on_tel_req_sim_authentication, &value); - if (ret != TAPI_API_SUCCESS) { - dts_fail("tel_req_sim_authentication", "Unexpected return"); - } - - util_start_loop (); - util_free_loop (); - - if (async_flag != ASYNC_DONE) { - dts_fail("tel_req_sim_authentication", "Callback not invoked"); - } - - dts_pass("tel_req_sim_authentication"); -} - -static void utc_fail_tel_req_sim_authentication (void) -{ - int ret; - TelSimAuthenticationData_t authentication_data; - - memset (&authentication_data, 0, sizeof(TelSimAuthenticationData_t)); - - authentication_data.auth_type = 1; - authentication_data.rand_length = 16; - authentication_data.autn_length = 16; - strcpy (authentication_data.rand_data, "AAAAAAAAAAAAAAAA"); - strcpy (authentication_data.autn_data, "AAAAAAAAAAAAAAAA"); - - ret = tel_req_sim_authentication (NULL, &authentication_data, NULL, NULL); - if (ret == TAPI_API_SUCCESS) { - dts_fail("tel_req_sim_authentication", "Parameter check failed"); - } - - ret = tel_req_sim_authentication (handle, NULL, NULL, NULL); - if (ret == TAPI_API_SUCCESS) { - dts_fail("tel_req_sim_authentication", "Parameter check failed"); - } - - dts_pass("tel_req_sim_authentication"); -} - -/** - * tel_verifiy_sim_pins - * - */ -static void on_tel_verifiy_sim_pins (TapiHandle *handle, int result, - void *data, void *user_data) -{ - int *value = user_data; - - async_flag = ASYNC_DONE; - util_stop_loop (); - - if (*value != 0xC0FFEE) { - dts_fail("tel_verifiy_sim_pins", "Callback userdata crashed"); - } -} - -static void utc_tel_verifiy_sim_pins (void) -{ - int ret; - int value = 0xC0FFEE; - TelSimSecPw_t pin_data; - - memset (&pin_data, 0, sizeof(TelSimSecPw_t)); - - pin_data.type = 0; - pin_data.pw_len = 4; - pin_data.pw = calloc(1, pin_data.pw_len); - strcpy ((char *)pin_data.pw, "1234"); - - util_init_loop (); - - async_flag = ASYNC_READY; - ret = tel_verifiy_sim_pins (handle, &pin_data, on_tel_verifiy_sim_pins, &value); - if (ret != TAPI_API_SUCCESS) { - dts_fail("tel_verifiy_sim_pins", "Unexpected return"); - } - - util_start_loop (); - util_free_loop (); - - if (async_flag != ASYNC_DONE) { - dts_fail("tel_verifiy_sim_pins", "Callback not invoked"); - } - - dts_pass("tel_verifiy_sim_pins"); - free(pin_data.pw); -} - -static void utc_fail_tel_verifiy_sim_pins (void) -{ - int ret; - - TelSimSecPw_t pin_data; - - memset (&pin_data, 0, sizeof(TelSimSecPw_t)); - - pin_data.type = 0; - pin_data.pw_len = 4; - pin_data.pw = calloc(1, pin_data.pw_len); - strcpy ((char *)pin_data.pw, "1234"); - - ret = tel_verifiy_sim_pins (NULL, &pin_data, NULL, NULL); - if (ret == TAPI_API_SUCCESS) { - dts_fail("tel_verifiy_sim_pins", "Parameter check failed"); - } - - pin_data.type = 2; - ret = tel_verifiy_sim_pins (handle, &pin_data, NULL, NULL); - if (ret == TAPI_API_SUCCESS) { - dts_fail("tel_verifiy_sim_pins", "Parameter check failed"); - } - - pin_data.type = 0; - pin_data.pw_len = 3; - ret = tel_verifiy_sim_pins (handle, &pin_data, NULL, NULL); - if (ret == TAPI_API_SUCCESS) { - dts_fail("tel_verifiy_sim_pins", "Parameter check failed"); - } - - pin_data.pw_len = 9; - ret = tel_verifiy_sim_pins (handle, &pin_data, NULL, NULL); - if (ret == TAPI_API_SUCCESS) { - dts_fail("tel_verifiy_sim_pins", "Parameter check failed"); - } - - ret = tel_verifiy_sim_pins (handle, NULL, NULL, NULL); - if (ret == TAPI_API_SUCCESS) { - dts_fail("tel_verifiy_sim_pins", "Parameter check failed"); - } - - dts_pass("tel_verifiy_sim_pins"); - free(pin_data.pw); -} - -/** - * tel_verify_sim_puks - * - */ -static void on_tel_verify_sim_puks (TapiHandle *handle, int result, - void *data, void *user_data) -{ - int *value = user_data; - - async_flag = ASYNC_DONE; - util_stop_loop (); - - if (*value != 0xC0FFEE) { - dts_fail("tel_verify_sim_puks", "Callback userdata crashed"); - } -} - -static void utc_tel_verify_sim_puks (void) -{ - int ret; - int value = 0xC0FFEE; - TelSimSecPw_t puk_data; - TelSimSecPw_t new_pin_data; - - memset (&puk_data, 0, sizeof(TelSimSecPw_t)); - memset (&new_pin_data, 0, sizeof(TelSimSecPw_t)); - - puk_data.type = 2; - puk_data.pw_len = 5; - puk_data.pw = calloc(1, puk_data.pw_len); - strcpy ((char *)puk_data.pw, "22222"); - - new_pin_data.type = 0; - new_pin_data.pw_len = 4; - new_pin_data.pw = calloc(1, new_pin_data.pw_len); - strcpy ((char *)new_pin_data.pw, "1111"); - - util_init_loop (); - - async_flag = ASYNC_READY; - ret = tel_verify_sim_puks (handle, &puk_data, &new_pin_data, on_tel_verify_sim_puks, &value); - if (ret != TAPI_API_SUCCESS) { - dts_fail("tel_verify_sim_puks", "Unexpected return"); - } - - util_start_loop (); - util_free_loop (); - - if (async_flag != ASYNC_DONE) { - dts_fail("tel_verify_sim_puks", "Callback not invoked"); - } - - dts_pass("tel_verify_sim_puks"); - free(puk_data.pw); - free(new_pin_data.pw); -} - -static void utc_fail_tel_verify_sim_puks (void) -{ - int ret; - TelSimSecPw_t puk_data; - TelSimSecPw_t new_pin_data; - - memset (&puk_data, 0, sizeof(TelSimSecPw_t)); - memset (&new_pin_data, 0, sizeof(TelSimSecPw_t)); - - puk_data.type = 2; - puk_data.pw_len = 5; - puk_data.pw = calloc(1, puk_data.pw_len); - strcpy ((char *)puk_data.pw, "22222"); - - new_pin_data.type = 0; - new_pin_data.pw_len = 4; - new_pin_data.pw = calloc(1, new_pin_data.pw_len); - strcpy ((char *)new_pin_data.pw, "1111"); - - ret = tel_verify_sim_puks (NULL, &puk_data, &new_pin_data, NULL, NULL); - if (ret == TAPI_API_SUCCESS) { - dts_fail("tel_verify_sim_puks", "Parameter check failed"); - } - ret = tel_verify_sim_puks (NULL, NULL , &new_pin_data, NULL, NULL); - if (ret == TAPI_API_SUCCESS) { - dts_fail("tel_verify_sim_puks", "Parameter check failed"); - } - ret = tel_verify_sim_puks (NULL, &puk_data, NULL, NULL, NULL); - if (ret == TAPI_API_SUCCESS) { - dts_fail("tel_verify_sim_puks", "Parameter check failed"); - } - ret = tel_verify_sim_puks (NULL, NULL, NULL, NULL, NULL); - if (ret == TAPI_API_SUCCESS) { - dts_fail("tel_verify_sim_puks", "Parameter check failed"); - } - puk_data.type = 0; - ret = tel_verify_sim_puks (NULL, &puk_data, &new_pin_data, NULL, NULL); - if (ret == TAPI_API_SUCCESS) { - dts_fail("tel_verify_sim_puks", "Parameter check failed"); - } - puk_data.type = 2; - new_pin_data.type = 2; - ret = tel_verify_sim_puks (NULL, &puk_data, &new_pin_data, NULL, NULL); - if (ret == TAPI_API_SUCCESS) { - dts_fail("tel_verify_sim_puks", "Parameter check failed"); - } - puk_data.type = 2; - new_pin_data.type = 0; - puk_data.pw_len = 3; - ret = tel_verify_sim_puks (NULL, &puk_data, &new_pin_data, NULL, NULL); - if (ret == TAPI_API_SUCCESS) { - dts_fail("tel_verify_sim_puks", "Parameter check failed"); - } - puk_data.pw_len = 9; - ret = tel_verify_sim_puks (NULL, &puk_data, &new_pin_data, NULL, NULL); - if (ret == TAPI_API_SUCCESS) { - dts_fail("tel_verify_sim_puks", "Parameter check failed"); - } - new_pin_data.pw_len = 3; - ret = tel_verify_sim_puks (NULL, &puk_data, &new_pin_data, NULL, NULL); - if (ret == TAPI_API_SUCCESS) { - dts_fail("tel_verify_sim_puks", "Parameter check failed"); - } - new_pin_data.pw_len = 9; - ret = tel_verify_sim_puks (NULL, &puk_data, &new_pin_data, NULL, NULL); - if (ret == TAPI_API_SUCCESS) { - dts_fail("tel_verify_sim_puks", "Parameter check failed"); - } - puk_data.pw_len = 5; - new_pin_data.pw_len = 5; - puk_data.pw = NULL; - ret = tel_verify_sim_puks (NULL, &puk_data, &new_pin_data, NULL, NULL); - if (ret == TAPI_API_SUCCESS) { - dts_fail("tel_verify_sim_puks", "Parameter check failed"); - } - new_pin_data.pw = NULL; - ret = tel_verify_sim_puks (NULL, &puk_data, &new_pin_data, NULL, NULL); - if (ret == TAPI_API_SUCCESS) { - dts_fail("tel_verify_sim_puks", "Parameter check failed"); - } - - dts_pass("tel_verify_sim_puks"); - free(puk_data.pw); - free(new_pin_data.pw); -} - -/** - * tel_change_sim_pins - * - */ -static void on_tel_change_sim_pins (TapiHandle *handle, int result, - void *data, void *user_data) -{ - int *value = user_data; - - async_flag = ASYNC_DONE; - util_stop_loop (); - - if (*value != 0xC0FFEE) { - dts_fail("tel_change_sim_pins", "Callback userdata crashed"); - } -} - -static void utc_tel_change_sim_pins (void) -{ - int ret; - int value = 0xC0FFEE; - TelSimSecPw_t old_pin; - TelSimSecPw_t new_pin; - - memset (&old_pin, 0, sizeof(TelSimSecPw_t)); - memset (&new_pin, 0, sizeof(TelSimSecPw_t)); - - old_pin.type = 0; - old_pin.pw_len = 4; - old_pin.pw = calloc(1, old_pin.pw_len); - strcpy ((char *)old_pin.pw, "1111"); - - new_pin.type = 0; - new_pin.pw_len = 4; - new_pin.pw = calloc(1, new_pin.pw_len); - strcpy ((char *)new_pin.pw, "2222"); - - util_init_loop (); - - async_flag = ASYNC_READY; - ret = tel_change_sim_pins (handle, &old_pin, &new_pin, on_tel_change_sim_pins, &value); - if (ret != TAPI_API_SUCCESS) { - dts_fail("tel_change_sim_pins", "Unexpected return"); - } - - util_start_loop (); - util_free_loop (); - - if (async_flag != ASYNC_DONE) { - dts_fail("tel_change_sim_pins", "Callback not invoked"); - } - - dts_pass("tel_change_sim_pins"); - free(old_pin.pw); - free(new_pin.pw); -} - -static void utc_fail_tel_change_sim_pins (void) -{ - int ret; - TelSimSecPw_t old_pin; - TelSimSecPw_t new_pin; - - memset (&old_pin, 0, sizeof(TelSimSecPw_t)); - memset (&new_pin, 0, sizeof(TelSimSecPw_t)); - - old_pin.type = 0; - old_pin.pw_len = 4; - old_pin.pw = calloc(1, old_pin.pw_len); - strcpy ((char *)old_pin.pw, "1111"); - - new_pin.type = 0; - new_pin.pw_len = 4; - new_pin.pw = calloc(1, new_pin.pw_len); - strcpy ((char *)new_pin.pw, "2222"); - - ret = tel_change_sim_pins (NULL, &old_pin, &new_pin, NULL, NULL); - if (ret == TAPI_API_SUCCESS) { - dts_fail("tel_change_sim_pins", "Parameter check failed"); - } - ret = tel_change_sim_pins (NULL, NULL , &new_pin, NULL, NULL); - if (ret == TAPI_API_SUCCESS) { - dts_fail("tel_change_sim_pins", "Parameter check failed"); - } - ret = tel_change_sim_pins (NULL, &old_pin, NULL, NULL, NULL); - if (ret == TAPI_API_SUCCESS) { - dts_fail("tel_change_sim_pins", "Parameter check failed"); - } - ret = tel_change_sim_pins (NULL, NULL, NULL, NULL, NULL); - if (ret == TAPI_API_SUCCESS) { - dts_fail("tel_change_sim_pins", "Parameter check failed"); - } - old_pin.type = 2; - ret = tel_change_sim_pins (NULL, &old_pin, &new_pin, NULL, NULL); - if (ret == TAPI_API_SUCCESS) { - dts_fail("tel_change_sim_pins", "Parameter check failed"); - } - old_pin.type = 0; - new_pin.type = 2; - ret = tel_change_sim_pins (NULL, &old_pin, &new_pin, NULL, NULL); - if (ret == TAPI_API_SUCCESS) { - dts_fail("tel_change_sim_pins", "Parameter check failed"); - } - old_pin.type = 0; - new_pin.type = 0; - old_pin.pw_len = 3; - ret = tel_change_sim_pins (NULL, &old_pin, &new_pin, NULL, NULL); - if (ret == TAPI_API_SUCCESS) { - dts_fail("tel_change_sim_pins", "Parameter check failed"); - } - old_pin.pw_len = 9; - ret = tel_change_sim_pins (NULL, &old_pin, &new_pin, NULL, NULL); - if (ret == TAPI_API_SUCCESS) { - dts_fail("tel_change_sim_pins", "Parameter check failed"); - } - new_pin.pw_len = 3; - ret = tel_change_sim_pins (NULL, &old_pin, &new_pin, NULL, NULL); - if (ret == TAPI_API_SUCCESS) { - dts_fail("tel_change_sim_pins", "Parameter check failed"); - } - new_pin.pw_len = 9; - ret = tel_change_sim_pins (NULL, &old_pin, &new_pin, NULL, NULL); - if (ret == TAPI_API_SUCCESS) { - dts_fail("tel_change_sim_pins", "Parameter check failed"); - } - old_pin.pw_len = 4; - new_pin.pw_len = 4; - old_pin.pw = NULL; - ret = tel_change_sim_pins (NULL, &old_pin, &new_pin, NULL, NULL); - if (ret == TAPI_API_SUCCESS) { - dts_fail("tel_change_sim_pins", "Parameter check failed"); - } - new_pin.pw = NULL; - ret = tel_change_sim_pins (NULL, &old_pin, &new_pin, NULL, NULL); - if (ret == TAPI_API_SUCCESS) { - dts_fail("tel_change_sim_pins", "Parameter check failed"); - } - - dts_pass("tel_change_sim_pins"); - free(old_pin.pw); - free(new_pin.pw); -} - -/** - * tel_disable_sim_facility - * - */ -static void on_tel_disable_sim_facility (TapiHandle *handle, int result, - void *data, void *user_data) -{ - int *value = user_data; - - async_flag = ASYNC_DONE; - util_stop_loop (); - - if (*value != 0xC0FFEE) { - dts_fail("tel_disable_sim_facility", "Callback userdata crashed"); - } -} - -static void utc_tel_disable_sim_facility (void) -{ - int ret; - int value = 0xC0FFEE; - TelSimFacilityPw_t pw; - - memset (&pw, 0, sizeof(TelSimFacilityPw_t)); - - pw.lock_type = 1; - pw.pw_len = 5; - pw.pw = calloc(1, pw.pw_len); - strcpy ((char *)pw.pw, "12345"); - - util_init_loop (); - - async_flag = ASYNC_READY; - ret = tel_disable_sim_facility (handle, &pw, on_tel_disable_sim_facility, &value); - if (ret != TAPI_API_SUCCESS) { - dts_fail("tel_disable_sim_facility", "Unexpected return"); - } - - util_start_loop (); - util_free_loop (); - - if (async_flag != ASYNC_DONE) { - dts_fail("tel_disable_sim_facility", "Callback not invoked"); - } - - dts_pass("tel_disable_sim_facility"); - free(pw.pw); -} - -static void utc_fail_tel_disable_sim_facility (void) -{ - int ret; - TelSimFacilityPw_t pw; - - memset (&pw, 0, sizeof(TelSimFacilityPw_t)); - - pw.lock_type = 1; - pw.pw_len = 5; - pw.pw = calloc(1, pw.pw_len); - strcpy ((char *)pw.pw, "12345"); - - ret = tel_disable_sim_facility (NULL, &pw, NULL, NULL); - if (ret == TAPI_API_SUCCESS) { - dts_fail("tel_disable_sim_facility", "Parameter check failed"); - } - - ret = tel_disable_sim_facility (handle, NULL, NULL, NULL); - if (ret == TAPI_API_SUCCESS) { - dts_fail("tel_disable_sim_facility", "Parameter check failed"); - } - - pw.lock_type = 0; - ret = tel_disable_sim_facility (handle, &pw, NULL, NULL); - if (ret == TAPI_API_SUCCESS) { - dts_fail("tel_disable_sim_facility", "Parameter check failed"); - } - - pw.lock_type = 9; - ret = tel_disable_sim_facility (handle, &pw, NULL, NULL); - if (ret == TAPI_API_SUCCESS) { - dts_fail("tel_disable_sim_facility", "Parameter check failed"); - } - - pw.lock_type = 1; - pw.pw = NULL; - ret = tel_disable_sim_facility (handle, &pw, NULL, NULL); - if (ret == TAPI_API_SUCCESS) { - dts_fail("tel_disable_sim_facility", "Parameter check failed"); - } - - dts_pass("tel_disable_sim_facility"); - free(pw.pw); -} - -/** - * tel_enable_sim_facility - * - */ -static void on_tel_enable_sim_facility (TapiHandle *handle, int result, - void *data, void *user_data) -{ - int *value = user_data; - - async_flag = ASYNC_DONE; - util_stop_loop (); - - if (*value != 0xC0FFEE) { - dts_fail("tel_enable_sim_facility", "Callback userdata crashed"); - } -} - -static void utc_tel_enable_sim_facility (void) -{ - int ret; - int value = 0xC0FFEE; - TelSimFacilityPw_t pw; - - memset (&pw, 0, sizeof(TelSimFacilityPw_t)); - - pw.lock_type = 1; - pw.pw_len = 5; - pw.pw = calloc(1, pw.pw_len); - strcpy ((char *)pw.pw, "12345"); - - util_init_loop (); - - async_flag = ASYNC_READY; - ret = tel_enable_sim_facility (handle, &pw, on_tel_enable_sim_facility, &value); - if (ret != TAPI_API_SUCCESS) { - dts_fail("tel_enable_sim_facility", "Unexpected return"); - } - - util_start_loop (); - util_free_loop (); - - if (async_flag != ASYNC_DONE) { - dts_fail("tel_enable_sim_facility", "Callback not invoked"); - } - - dts_pass("tel_enable_sim_facility"); - free(pw.pw); -} - -static void utc_fail_tel_enable_sim_facility (void) -{ - int ret; - TelSimFacilityPw_t pw; - - memset (&pw, 0, sizeof(TelSimFacilityPw_t)); - - pw.lock_type = 1; - pw.pw_len = 5; - pw.pw = calloc(1, pw.pw_len); - strcpy ((char *)pw.pw, "12345"); - - ret = tel_enable_sim_facility (NULL, &pw, NULL, NULL); - if (ret == TAPI_API_SUCCESS) { - dts_fail("tel_enable_sim_facility", "Parameter check failed"); - } - - ret = tel_enable_sim_facility (handle, NULL, NULL, NULL); - if (ret == TAPI_API_SUCCESS) { - dts_fail("tel_enable_sim_facility", "Parameter check failed"); - } - - pw.lock_type = 0; - ret = tel_enable_sim_facility (handle, &pw, NULL, NULL); - if (ret == TAPI_API_SUCCESS) { - dts_fail("tel_enable_sim_facility", "Parameter check failed"); - } - - pw.lock_type = 9; - ret = tel_enable_sim_facility (handle, &pw, NULL, NULL); - if (ret == TAPI_API_SUCCESS) { - dts_fail("tel_enable_sim_facility", "Parameter check failed"); - } - - pw.lock_type = 1; - pw.pw = NULL; - ret = tel_enable_sim_facility (handle, &pw, NULL, NULL); - if (ret == TAPI_API_SUCCESS) { - dts_fail("tel_enable_sim_facility", "Parameter check failed"); - } - - dts_pass("tel_enable_sim_facility"); - free(pw.pw); -} - -/** - * tel_get_sim_facility - * - */ -static void on_tel_get_sim_facility (TapiHandle *handle, int result, - void *data, void *user_data) -{ - int *value = user_data; - - async_flag = ASYNC_DONE; - util_stop_loop (); - - if (*value != 0xC0FFEE) { - dts_fail("tel_get_sim_facility", "Callback userdata crashed"); - } -} - -static void utc_tel_get_sim_facility (void) -{ - int ret; - int value = 0xC0FFEE; - - util_init_loop (); - - async_flag = ASYNC_READY; - ret = tel_get_sim_facility (handle, 3, on_tel_get_sim_facility, &value); - if (ret != TAPI_API_SUCCESS) { - dts_fail("tel_get_sim_facility", "Unexpected return"); - } - - util_start_loop (); - util_free_loop (); - - if (async_flag != ASYNC_DONE) { - dts_fail("tel_get_sim_facility", "Callback not invoked"); - } - - dts_pass("tel_get_sim_facility"); -} - -static void utc_fail_tel_get_sim_facility (void) -{ - int ret; - - ret = tel_get_sim_facility (NULL, 3, NULL, NULL); - if (ret == TAPI_API_SUCCESS) { - dts_fail("tel_get_sim_facility", "Parameter check failed"); - } - - ret = tel_get_sim_facility (handle, 0, NULL, NULL); - if (ret == TAPI_API_SUCCESS) { - dts_fail("tel_get_sim_facility", "Parameter check failed"); - } - - ret = tel_get_sim_facility (handle, 9, NULL, NULL); - if (ret == TAPI_API_SUCCESS) { - dts_fail("tel_get_sim_facility", "Parameter check failed"); - } - - dts_pass("tel_get_sim_facility"); -} - -/** - * tel_get_sim_lock_info - * - */ -static void on_tel_get_sim_lock_info (TapiHandle *handle, int result, - void *data, void *user_data) -{ - int *value = user_data; - - async_flag = ASYNC_DONE; - util_stop_loop (); - - if (*value != 0xC0FFEE) { - dts_fail("tel_get_sim_lock_info", "Callback userdata crashed"); - } -} - -static void utc_tel_get_sim_lock_info (void) -{ - int ret; - int value = 0xC0FFEE; - - util_init_loop (); - - async_flag = ASYNC_READY; - ret = tel_get_sim_lock_info (handle, 3, on_tel_get_sim_lock_info, &value); - if (ret != TAPI_API_SUCCESS) { - dts_fail("tel_get_sim_lock_info", "Unexpected return"); - } - - util_start_loop (); - util_free_loop (); - - if (async_flag != ASYNC_DONE) { - dts_fail("tel_get_sim_lock_info", "Callback not invoked"); - } - - dts_pass("tel_get_sim_lock_info"); -} - -static void utc_fail_tel_get_sim_lock_info (void) -{ - int ret; - - ret = tel_get_sim_lock_info (NULL, 3, NULL, NULL); - if (ret == TAPI_API_SUCCESS) { - dts_fail("tel_get_sim_facility", "Parameter check failed"); - } - - ret = tel_get_sim_lock_info (handle, 0, NULL, NULL); - if (ret == TAPI_API_SUCCESS) { - dts_fail("tel_get_sim_lock_info", "Parameter check failed"); - } - - ret = tel_get_sim_lock_info (handle, 9, NULL, NULL); - if (ret == TAPI_API_SUCCESS) { - dts_fail("tel_get_sim_lock_info", "Parameter check failed"); - } - - dts_pass("tel_get_sim_lock_info"); -} - -/** - * tel_req_sim_apdu - * - */ -static void on_tel_req_sim_apdu (TapiHandle *handle, int result, - void *data, void *user_data) -{ - int *value = user_data; - - async_flag = ASYNC_DONE; - util_stop_loop (); - - if (*value != 0xC0FFEE) { - dts_fail("tel_req_sim_apdu", "Callback userdata crashed"); - } -} - -static void utc_tel_req_sim_apdu (void) -{ - int ret; - int value = 0xC0FFEE; - TelSimApdu_t apdu_data; - - memset (&apdu_data, 0, sizeof(TelSimApdu_t)); - - apdu_data.apdu_len = 7; - apdu_data.apdu = calloc(1, apdu_data.apdu_len); - strcpy ((char *)apdu_data.apdu, "a0a40000026f02"); - - util_init_loop (); - - async_flag = ASYNC_READY; - ret = tel_req_sim_apdu (handle, &apdu_data, on_tel_req_sim_apdu, &value); - if (ret != TAPI_API_SUCCESS) { - dts_fail("tel_req_sim_apdu", "Unexpected return"); - } - - util_start_loop (); - util_free_loop (); - - if (async_flag != ASYNC_DONE) { - dts_fail("tel_req_sim_apdu", "Callback not invoked"); - } - - dts_pass("tel_req_sim_apdu"); - free(apdu_data.apdu); -} - -static void utc_fail_tel_req_sim_apdu (void) -{ - int ret; - TelSimApdu_t apdu_data; - - memset (&apdu_data, 0, sizeof(TelSimApdu_t)); - - apdu_data.apdu_len = 7; - apdu_data.apdu = calloc(1, apdu_data.apdu_len); - strcpy ((char *)apdu_data.apdu, "a0a40000026f02"); - - ret = tel_req_sim_apdu (NULL, &apdu_data, NULL, NULL); - if (ret == TAPI_API_SUCCESS) { - dts_fail("tel_req_sim_apdu", "Parameter check failed"); - } - - ret = tel_req_sim_apdu (handle, NULL, NULL, NULL); - if (ret == TAPI_API_SUCCESS) { - dts_fail("tel_req_sim_apdu", "Parameter check failed"); - } - - apdu_data.apdu = NULL; - ret = tel_req_sim_apdu (handle, &apdu_data, NULL, NULL); - if (ret == TAPI_API_SUCCESS) { - dts_fail("tel_req_sim_apdu", "Parameter check failed"); - } - - dts_pass("tel_req_sim_apdu"); - free(apdu_data.apdu); -} - -/** - * Generate default TC for no-additional-parameter type API - * - */ -DO(tel_get_sim_iccid) -DO(tel_get_sim_language) -DO(tel_get_sim_callforwarding_info) -DO(tel_get_sim_messagewaiting_info) -DO(tel_get_sim_mailbox_info) -DO(tel_get_sim_cphs_info) -DO(tel_get_sim_service_table) -DO(tel_get_sim_msisdn) -DO(tel_get_sim_oplmnwact) -DO(tel_get_sim_spn) -DO(tel_get_sim_cphs_netname) -DO(tel_req_sim_atr) - -struct tet_testlist tet_testlist[] = { - /* generated TC */ - { utc_tel_get_sim_iccid, 1 }, - { utc_fail_tel_get_sim_iccid, 2 }, - { utc_tel_get_sim_language, 1 }, - { utc_fail_tel_get_sim_language, 2 }, - { utc_tel_get_sim_callforwarding_info, 1 }, - { utc_fail_tel_get_sim_callforwarding_info, 2 }, - { utc_tel_get_sim_messagewaiting_info, 1 }, - { utc_fail_tel_get_sim_messagewaiting_info, 2 }, - { utc_tel_get_sim_mailbox_info, 1 }, - { utc_fail_tel_get_sim_mailbox_info, 2 }, - { utc_tel_get_sim_cphs_info, 1 }, - { utc_fail_tel_get_sim_cphs_info, 2 }, - { utc_tel_get_sim_service_table, 1 }, - { utc_fail_tel_get_sim_service_table, 2 }, - { utc_tel_get_sim_msisdn, 1 }, - { utc_fail_tel_get_sim_msisdn, 2 }, - { utc_tel_get_sim_oplmnwact, 1 }, - { utc_fail_tel_get_sim_oplmnwact, 2 }, - { utc_tel_get_sim_spn, 1 }, - { utc_fail_tel_get_sim_spn, 2 }, - { utc_tel_get_sim_cphs_netname, 1 }, - { utc_fail_tel_get_sim_cphs_netname, 2 }, - { utc_tel_req_sim_atr, 1 }, - { utc_fail_tel_req_sim_atr, 2 }, - /* custom TC */ - { utc_tel_get_sim_init_info, 1 }, - { utc_fail_tel_get_sim_init_info, 2 }, - { utc_tel_get_sim_type, 1 }, - { utc_fail_tel_get_sim_type, 2 }, - { utc_tel_get_sim_imsi, 1 }, - { utc_fail_tel_get_sim_imsi, 2 }, - { utc_tel_get_sim_ecc, 1 }, - { utc_fail_tel_get_sim_ecc, 2 }, - { utc_tel_set_sim_language, 1 }, - { utc_fail_tel_set_sim_language, 2 }, - { utc_tel_set_sim_callforwarding_info, 1 }, - { utc_fail_tel_set_sim_callforwarding_info, 2 }, - { utc_tel_set_sim_messagewaiting_info, 1 }, - { utc_fail_tel_set_sim_messagewaiting_info, 2 }, - { utc_tel_set_sim_mailbox_info, 1 }, - { utc_fail_tel_set_sim_mailbox_info, 2 }, - { utc_tel_req_sim_authentication, 1 }, - { utc_fail_tel_req_sim_authentication, 2 }, - { utc_tel_verifiy_sim_pins, 1 }, - { utc_fail_tel_verifiy_sim_pins, 2 }, - { utc_tel_verify_sim_puks, 1 }, - { utc_fail_tel_verify_sim_puks, 2 }, - { utc_tel_change_sim_pins, 1 }, - { utc_fail_tel_change_sim_pins, 2 }, - { utc_tel_disable_sim_facility, 1 }, - { utc_fail_tel_disable_sim_facility, 2 }, - { utc_tel_enable_sim_facility, 1 }, - { utc_fail_tel_enable_sim_facility, 2 }, - { utc_tel_get_sim_facility, 1 }, - { utc_fail_tel_get_sim_facility, 2 }, - { utc_tel_get_sim_lock_info, 1 }, - { utc_fail_tel_get_sim_lock_info, 2 }, - { utc_tel_req_sim_apdu, 1 }, - { utc_fail_tel_req_sim_apdu, 2 }, - { NULL, 0 }, -}; -static void startup (void) -{ - /* start of TC */ - tet_printf ("\n TC start"); - - handle = tel_init (NULL); -} - -static void cleanup (void) -{ - tel_deinit (handle); - - /* end of TC */ - tet_printf ("\n TC end"); -} - -void (*tet_startup) (void) = startup; -void (*tet_cleanup) (void) = cleanup; diff --git a/wearable/TC/testcase/utc_sms.c b/wearable/TC/testcase/utc_sms.c deleted file mode 100755 index 5d02d0a..0000000 --- a/wearable/TC/testcase/utc_sms.c +++ /dev/null @@ -1,959 +0,0 @@ -/* - * libslp-tapi - * - * Copyright (c) 2013 Samsung Electronics Co., Ltd. All rights reserved. - * - * Contact: Ja-young Gu - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT 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 "util_common.h" - -TapiHandle *handle; -enum async_state async_flag; - -/** - * tel_send_sms - * - */ -static void on_tel_send_sms(TapiHandle *handle, int result, void *data, void *user_data) -{ - int *value = user_data; - - async_flag = ASYNC_DONE; - util_stop_loop (); - - if (*value != 0xC0FFEE) { - dts_fail("tel_send_sms", "Callback userdata crashed"); - } -} - -static void utc_tel_send_sms(void) -{ - int ret; - int value = 0xC0FFEE; - - TelSmsDatapackageInfo_t *pDataPackage = NULL; - - char *tpdu = "TEST SMS"; - unsigned char sca[TAPI_SIM_SMSP_ADDRESS_LEN]; - int sca_length; - - pDataPackage = malloc(sizeof(TelSmsDatapackageInfo_t)); - memset (pDataPackage, 0x0, sizeof(TelSmsDatapackageInfo_t)); - - sca_length = 0x05; - sca[0] = 0x89; - sca[1] = 0x54; - sca[2] = 0x80; - sca[3] = 0x07; - sca[4] = 0x10; - - memcpy(pDataPackage->Sca, sca, sca_length); - pDataPackage->MsgLength = strlen(tpdu); - memcpy(pDataPackage->szData, tpdu, pDataPackage->MsgLength); - - util_init_loop (); - - async_flag = ASYNC_READY; - ret = tel_send_sms(handle, pDataPackage, 0, on_tel_send_sms, &value); - if (ret != TAPI_API_SUCCESS) { - dts_fail("tel_send_sms", "Unexpected return"); - } - - free(tpdu); - util_start_loop (); - util_free_loop (); - - if (async_flag != ASYNC_DONE) { - dts_fail("tel_send_sms", "Callback not invoked"); - } - - dts_pass("tel_send_sms"); -} - -static void utc_fail_tel_send_sms(void) -{ - int ret; - - ret = tel_send_sms (NULL, NULL, 0, NULL, NULL); - if (ret == TAPI_API_SUCCESS) { - dts_fail("tel_send_sms", "Parameter check failed"); - } - - ret = tel_send_sms (handle, NULL, 0, NULL, NULL); - if (ret == TAPI_API_SUCCESS) { - dts_fail("tel_send_sms", "Parameter check failed"); - } - - dts_pass("tel_send_sms"); -} - -/** - * tel_read_sms_in_sim - * - */ -static void on_tel_read_sms_in_sim(TapiHandle *handle, int result, void *data, void *user_data) -{ - int *value = user_data; - - async_flag = ASYNC_DONE; - util_stop_loop (); - - if (*value != 0xC0FFEE) { - dts_fail("tel_read_sms_in_sim", "Callback userdata crashed"); - } -} - -static void utc_tel_read_sms_in_sim(void) -{ - int ret; - int value = 0xC0FFEE; - int index = 1; - - util_init_loop (); - - async_flag = ASYNC_READY; - ret = tel_read_sms_in_sim (handle, index, on_tel_read_sms_in_sim, &value); - if (ret != TAPI_API_SUCCESS) { - dts_fail("tel_read_sms_in_sim", "Unexpected return"); - } - - util_start_loop (); - util_free_loop (); - - if (async_flag != ASYNC_DONE) { - dts_fail("tel_read_sms_in_sim", "Callback not invoked"); - } - - dts_pass("tel_read_sms_in_sim"); -} - -static void utc_fail_tel_read_sms_in_sim(void) -{ - int ret; - - ret = tel_read_sms_in_sim(NULL, -1, NULL, NULL); - if (ret == TAPI_API_SUCCESS) { - dts_fail("tel_read_sms_in_sim", "Parameter check failed"); - } - - ret = tel_read_sms_in_sim(handle, 256, NULL, NULL); - if (ret == TAPI_API_SUCCESS) { - dts_fail("tel_read_sms_in_sim", "Parameter check failed"); - } - - dts_pass("tel_read_sms_in_sim"); -} - -/** - * tel_write_sms_in_sim - * - */ -static void on_tel_write_sms_in_sim(TapiHandle *handle, int result, void *data, void *user_data) -{ - int *value = user_data; - - async_flag = ASYNC_DONE; - util_stop_loop (); - - if (*value != 0xC0FFEE) { - dts_fail("tel_write_sms_in_sim", "Callback userdata crashed"); - } -} - -static void utc_tel_write_sms_in_sim(void) -{ - int ret; - int value = 0xC0FFEE; - TelSmsData_t *pWriteData; - unsigned char sca[TAPI_SIM_SMSP_ADDRESS_LEN]; - char *tpdu = "WRITE SMS"; - int sca_length; - pWriteData->SimIndex = 1; - pWriteData->MsgStatus = TAPI_NETTEXT_STATUS_READ; - - sca_length = 0x05; - sca[0] = 0x89; - sca[1] = 0x54; - sca[2] = 0x80; - sca[3] = 0x07; - sca[4] = 0x10; - - pWriteData->SmsData.MsgLength = strlen(tpdu); - - memcpy(pWriteData->SmsData.Sca, sca, sca_length); - memcpy(pWriteData->SmsData.szData, tpdu, pWriteData->SmsData.MsgLength); - - util_init_loop (); - - async_flag = ASYNC_READY; - ret = tel_write_sms_in_sim(handle, pWriteData, on_tel_write_sms_in_sim, &value); - if (ret != TAPI_API_SUCCESS) { - dts_fail("tel_write_sms_in_sim", "Unexpected return"); - } - - util_start_loop (); - util_free_loop (); - - if (async_flag != ASYNC_DONE) { - dts_fail("tel_write_sms_in_sim", "Callback not invoked"); - } - - dts_pass("tel_write_sms_in_sim"); -} - -static void utc_fail_tel_write_sms_in_sim(void) -{ - int ret; - - ret = tel_write_sms_in_sim(NULL, NULL, NULL, NULL); - if (ret == TAPI_API_SUCCESS) { - dts_fail("tel_write_sms_in_sim", "Parameter check failed"); - } - - ret = tel_write_sms_in_sim(handle, NULL, NULL, NULL); - if (ret == TAPI_API_SUCCESS) { - dts_fail("tel_write_sms_in_sim", "Parameter check failed"); - } - - dts_pass("tel_write_sms_in_sim"); -} - -/** - * tel_delete_sms_in_sim - * - */ -static void on_tel_delete_sms_in_sim(TapiHandle *handle, int result, void *data, void *user_data) -{ - int *value = user_data; - - async_flag = ASYNC_DONE; - util_stop_loop (); - - if (*value != 0xC0FFEE) { - dts_fail("tel_delete_sms_in_sim", "Callback userdata crashed"); - } -} - -static void utc_tel_delete_sms_in_sim(void) -{ - int ret; - int value = 0xC0FFEE; - int index = 1; - - util_init_loop (); - - async_flag = ASYNC_READY; - ret = tel_delete_sms_in_sim(handle, index, on_tel_delete_sms_in_sim, &value); - if (ret != TAPI_API_SUCCESS) { - dts_fail("tel_delete_sms_in_sim", "Unexpected return"); - } - - util_start_loop (); - util_free_loop (); - - if (async_flag != ASYNC_DONE) { - dts_fail("tel_delete_sms_in_sim", "Callback not invoked"); - } - - dts_pass("tel_delete_sms_in_sim"); -} - -static void utc_fail_tel_delete_sms_in_sim(void) -{ - int ret; - - ret = tel_delete_sms_in_sim (NULL, -2, NULL, NULL); - if (ret == TAPI_API_SUCCESS) { - dts_fail("tel_delete_sms_in_sim", "Parameter check failed"); - } - - ret = tel_delete_sms_in_sim (handle, 256, NULL, NULL); - if (ret == TAPI_API_SUCCESS) { - dts_fail("tel_delete_sms_in_sim", "Parameter check failed"); - } - - dts_pass("tel_delete_sms_in_sim"); -} - -/** - * tel_get_sms_sca - * - */ -static void on_tel_get_sms_sca(TapiHandle *handle, int result, void *data, void *user_data) -{ - int *value = user_data; - - async_flag = ASYNC_DONE; - util_stop_loop (); - - if (*value != 0xC0FFEE) { - dts_fail("tel_get_sms_sca", "Callback userdata crashed"); - } -} - -static void utc_tel_get_sms_sca(void) -{ - int ret; - int value = 0xC0FFEE; - int index = 1; - - util_init_loop (); - - async_flag = ASYNC_READY; - ret = tel_get_sms_sca(handle, index, on_tel_get_sms_sca, &value); - if (ret != TAPI_API_SUCCESS) { - dts_fail("tel_get_sms_sca", "Unexpected return"); - } - - util_start_loop (); - util_free_loop (); - - if (async_flag != ASYNC_DONE) { - dts_fail("tel_get_sms_sca", "Callback not invoked"); - } - - dts_pass("tel_get_sms_sca"); -} - -static void utc_fail_tel_get_sms_sca(void) -{ - int ret; - - ret = tel_get_sms_sca(NULL, -1, NULL, NULL); - if (ret == TAPI_API_SUCCESS) { - dts_fail("tel_get_sms_sca", "Parameter check failed"); - } - - ret = tel_get_sms_sca(handle, 256, NULL, NULL); - if (ret == TAPI_API_SUCCESS) { - dts_fail("tel_get_sms_sca", "Parameter check failed"); - } - - - dts_pass("tel_get_sms_sca"); -} - -/** - * tel_set_sms_sca - * - */ -static void on_tel_set_sms_sca(TapiHandle *handle, int result, void *data, void *user_data) -{ - int *value = user_data; - - async_flag = ASYNC_DONE; - util_stop_loop (); - - if (*value != 0xC0FFEE) { - dts_fail("tel_set_sms_sca", "Callback userdata crashed"); - } -} - -static void utc_tel_set_sms_sca(void) -{ - int ret; - int value = 0xC0FFEE; - int index = 1; - TelSmsAddressInfo_t *sca = NULL; - - sca->DialNumLen = 0x5; - sca->Npi = TAPI_SIM_NPI_ISDN_TEL; - sca->Ton = TAPI_SIM_TON_INTERNATIONAL; - sca->szDiallingNum[0] = 0x89; - sca->szDiallingNum[1] = 0x54; - sca->szDiallingNum[2] = 0x80; - sca->szDiallingNum[3] = 0x07; - sca->szDiallingNum[4] = 0x10; - - util_init_loop (); - - async_flag = ASYNC_READY; - ret = tel_set_sms_sca(handle, sca, index, on_tel_set_sms_sca, &value); - if (ret != TAPI_API_SUCCESS) { - dts_fail("tel_set_sms_sca", "Unexpected return"); - } - - util_start_loop (); - util_free_loop (); - - if (async_flag != ASYNC_DONE) { - dts_fail("tel_set_sms_sca", "Callback not invoked"); - } - - dts_pass("tel_set_sms_sca"); -} - -static void utc_fail_tel_set_sms_sca(void) -{ - int ret; - - ret = tel_set_sms_sca(NULL, NULL, -1, NULL, NULL); - if (ret == TAPI_API_SUCCESS) { - dts_fail("tel_set_sms_sca", "Parameter check failed"); - } - - ret = tel_set_sms_sca(handle, NULL, -1, NULL, NULL); - if (ret == TAPI_API_SUCCESS) { - dts_fail("tel_set_sms_sca", "Parameter check failed"); - } - - dts_pass("tel_set_sms_sca"); -} - -/** - * tel_set_sms_cb_config - * - */ -static void on_tel_set_sms_cb_config(TapiHandle *handle, int result, void *data, void *user_data) -{ - int *value = user_data; - - async_flag = ASYNC_DONE; - util_stop_loop (); - - if (*value != 0xC0FFEE) { - dts_fail("tel_set_sms_cb_config", "Callback userdata crashed"); - } -} - -static void utc_tel_set_sms_cb_config(void) -{ - int ret; - int value = 0xC0FFEE; - int i; - TelSmsCbConfig_t *pCBConfig = NULL; - pCBConfig->CBEnabled = 0x01; - pCBConfig->Net3gppType = 0x01; - pCBConfig->MsgIdMaxCount = 0x10; - pCBConfig->MsgIdRangeCount = 0x05; - - for (i = 0; i < pCBConfig->MsgIdRangeCount; i++) { - pCBConfig->MsgIDs[i].Net3gpp.FromMsgId = 0x01; - pCBConfig->MsgIDs[i].Net3gpp.ToMsgId = 0x02; - pCBConfig->MsgIDs[i].Net3gpp.Selected = 0x01; - } - util_init_loop (); - - async_flag = ASYNC_READY; - ret = tel_set_sms_cb_config(handle, pCBConfig, on_tel_set_sms_cb_config, &value); - if (ret != TAPI_API_SUCCESS) { - dts_fail("tel_set_sms_cb_config", "Unexpected return"); - } - - util_start_loop (); - util_free_loop (); - - if (async_flag != ASYNC_DONE) { - dts_fail("tel_set_sms_cb_config", "Callback not invoked"); - } - - dts_pass("tel_set_sms_cb_config"); -} - -static void utc_fail_tel_set_sms_cb_config(void) -{ - int ret; - - ret = tel_set_sms_cb_config(NULL, NULL, NULL, NULL); - if (ret == TAPI_API_SUCCESS) { - dts_fail("tel_set_sms_cb_config", "Parameter check failed"); - } - - ret = tel_set_sms_cb_config(handle, NULL, NULL, NULL); - if (ret == TAPI_API_SUCCESS) { - dts_fail("tel_set_sms_cb_config", "Parameter check failed"); - } - - dts_pass("tel_set_sms_cb_config"); -} - -/** - * tel_set_sms_memory_status - * - */ -static void on_tel_set_sms_memory_status(TapiHandle *handle, int result, void *data, void *user_data) -{ - int *value = user_data; - - async_flag = ASYNC_DONE; - util_stop_loop (); - - if (*value != 0xC0FFEE) { - dts_fail("tel_set_sms_memory_status", "Callback userdata crashed"); - } -} - -static void utc_tel_set_sms_memory_status(void) -{ - int ret; - int value = 0xC0FFEE; - int memory_available = 2; - - util_init_loop (); - - async_flag = ASYNC_READY; - ret = tel_set_sms_memory_status(handle, memory_available, on_tel_set_sms_memory_status, &value); - if (ret != TAPI_API_SUCCESS) { - dts_fail("tel_set_sms_memory_status", "Unexpected return"); - } - - util_start_loop (); - util_free_loop (); - - if (async_flag != ASYNC_DONE) { - dts_fail("tel_set_sms_memory_status", "Callback not invoked"); - } - - dts_pass("tel_set_sms_memory_status"); -} - -static void utc_fail_tel_set_sms_memory_status(void) -{ - int ret; - - ret = tel_set_sms_memory_status(NULL, -1, NULL, NULL); - if (ret == TAPI_API_SUCCESS) { - dts_fail("tel_set_sms_memory_status", "Parameter check failed"); - } - - ret = tel_set_sms_memory_status(handle, -1, NULL, NULL); - if (ret == TAPI_API_SUCCESS) { - dts_fail("tel_set_sms_memory_status", "Parameter check failed"); - } - - ret = tel_set_sms_memory_status(handle, 4, NULL, NULL); - if (ret == TAPI_API_SUCCESS) { - dts_fail("tel_set_sms_memory_status", "Parameter check failed"); - } - - dts_pass("tel_set_sms_memory_status"); -} - -/** - * tel_set_sms_preferred_bearer - * - */ -static void on_tel_set_sms_preferred_bearer(TapiHandle *handle, int result, void *data, void *user_data) -{ - int *value = user_data; - - async_flag = ASYNC_DONE; - util_stop_loop (); - - if (*value != 0xC0FFEE) { - dts_fail("tel_set_sms_preferred_bearer", "Callback userdata crashed"); - } -} - -static void utc_tel_set_sms_preferred_bearer(void) -{ - int ret; - int value = 0xC0FFEE; - - util_init_loop (); - - async_flag = ASYNC_READY; - ret = tel_set_sms_preferred_bearer(handle, TAPI_NETTEXT_BEARER_PS_ONLY, on_tel_set_sms_preferred_bearer, &value); - if (ret != TAPI_API_SUCCESS) { - dts_fail("tel_set_sms_preferred_bearer", "Unexpected return"); - } - - util_start_loop (); - util_free_loop (); - - if (async_flag != ASYNC_DONE) { - dts_fail("tel_set_sms_preferred_bearer", "Callback not invoked"); - } - - dts_pass("tel_set_sms_preferred_bearer"); -} - -static void utc_fail_tel_set_sms_preferred_bearer(void) -{ - int ret; - - ret = tel_set_sms_preferred_bearer(NULL, -1, NULL, NULL); - if (ret == TAPI_API_SUCCESS) { - dts_fail("tel_set_sms_preferred_bearer", "Parameter check failed"); - } - - ret = tel_set_sms_preferred_bearer(handle, -1, NULL, NULL); - if (ret == TAPI_API_SUCCESS) { - dts_fail("tel_set_sms_preferred_bearer", "Parameter check failed"); - } - dts_pass("tel_set_sms_preferred_bearer"); -} - -/** - * tel_send_sms_deliver_report - * - */ -static void on_tel_send_sms_deliver_report(TapiHandle *handle, int result, void *data, void *user_data) -{ - int *value = user_data; - - async_flag = ASYNC_DONE; - util_stop_loop (); - - if (*value != 0xC0FFEE) { - dts_fail("tel_send_sms_deliver_report", "Callback userdata crashed"); - } -} - -static void utc_tel_send_sms_deliver_report(void) -{ - int ret; - int value = 0xC0FFEE; - TelSmsDatapackageInfo_t *pDataPackage = NULL; - - char *tpdu = "TEST SMS"; - unsigned char sca[TAPI_SIM_SMSP_ADDRESS_LEN]; - int sca_length; - - pDataPackage = malloc(sizeof(TelSmsDatapackageInfo_t)); - memset (pDataPackage, 0x0, sizeof(TelSmsDatapackageInfo_t)); - - sca_length = 0x05; - sca[0] = 0x89; - sca[1] = 0x54; - sca[2] = 0x80; - sca[3] = 0x07; - sca[4] = 0x10; - - memcpy(pDataPackage->Sca, sca, sca_length); - pDataPackage->MsgLength = strlen(tpdu); - memcpy(pDataPackage->szData, tpdu, pDataPackage->MsgLength); - - - util_init_loop (); - - async_flag = ASYNC_READY; - ret = tel_send_sms_deliver_report(handle, pDataPackage, TAPI_NETTEXT_SENDSMS_SUCCESS, on_tel_send_sms_deliver_report, &value); - if (ret != TAPI_API_SUCCESS) { - dts_fail("tel_send_sms_deliver_report", "Unexpected return"); - } - - util_start_loop (); - util_free_loop (); - - if (async_flag != ASYNC_DONE) { - dts_fail("tel_send_sms_deliver_report", "Callback not invoked"); - } - - dts_pass("tel_send_sms_deliver_report"); -} - -static void utc_fail_tel_send_sms_deliver_report(void) -{ - int ret; - - ret = tel_send_sms_deliver_report(NULL, NULL, -1, NULL, NULL); - if (ret == TAPI_API_SUCCESS) { - dts_fail("tel_send_sms_deliver_report", "Parameter check failed"); - } - - dts_pass("tel_send_sms_deliver_report"); -} - -/** - * tel_set_sms_message_status - * - */ -static void on_tel_set_sms_message_status(TapiHandle *handle, int result, void *data, void *user_data) -{ - int *value = user_data; - - async_flag = ASYNC_DONE; - util_stop_loop (); - - if (*value != 0xC0FFEE) { - dts_fail("tel_set_sms_message_status", "Callback userdata crashed"); - } -} - -static void utc_tel_set_sms_message_status(void) -{ - int ret; - int value = 0xC0FFEE; - int index = 1; - - util_init_loop (); - - async_flag = ASYNC_READY; - ret = tel_set_sms_message_status(handle, index, TAPI_NETTEXT_STATUS_READ, on_tel_set_sms_message_status, &value); - if (ret != TAPI_API_SUCCESS) { - dts_fail("tel_set_sms_message_status", "Unexpected return"); - } - - util_start_loop (); - util_free_loop (); - - if (async_flag != ASYNC_DONE) { - dts_fail("tel_set_sms_message_status", "Callback not invoked"); - } - - dts_pass("tel_set_sms_message_status"); -} - -static void utc_fail_tel_set_sms_message_status(void) -{ - int ret; - - ret = tel_set_sms_message_status(NULL, -2, -1, NULL, NULL); - if (ret == TAPI_API_SUCCESS) { - dts_fail("tel_set_sms_message_status", "Parameter check failed"); - } - - dts_pass("tel_set_sms_message_status"); -} - -/** - * tel_get_sms_parameters - * - */ -static void on_tel_get_sms_parameters(TapiHandle *handle, int result, void *data, void *user_data) -{ - int *value = user_data; - - async_flag = ASYNC_DONE; - util_stop_loop (); - - if (*value != 0xC0FFEE) { - dts_fail("tel_get_sms_parameters", "Callback userdata crashed"); - } -} - -static void utc_tel_get_sms_parameters(void) -{ - int ret; - int value = 0xC0FFEE; - int index = 1; - - util_init_loop (); - - async_flag = ASYNC_READY; - ret = tel_get_sms_parameters(handle, index, on_tel_get_sms_parameters, &value); - if (ret != TAPI_API_SUCCESS) { - dts_fail("tel_get_sms_parameters", "Unexpected return"); - } - - util_start_loop (); - util_free_loop (); - - if (async_flag != ASYNC_DONE) { - dts_fail("tel_get_sms_parameters", "Callback not invoked"); - } - - dts_pass("tel_get_sms_parameters"); -} - -static void utc_fail_tel_get_sms_parameters(void) -{ - int ret; - - ret = tel_get_sms_parameters(NULL, -1, NULL, NULL); - if (ret == TAPI_API_SUCCESS) { - dts_fail("tel_get_sms_parameters", "Parameter check failed"); - } - - ret = tel_get_sms_parameters(handle, 256, NULL, NULL); - if (ret == TAPI_API_SUCCESS) { - dts_fail("tel_get_sms_parameters", "Parameter check failed"); - } - - dts_pass("tel_get_sms_parameters"); -} - -/** - * tel_set_sms_parameters - * - */ -static void on_tel_set_sms_parameters(TapiHandle *handle, int result, void *data, void *user_data) -{ - int *value = user_data; - - async_flag = ASYNC_DONE; - util_stop_loop (); - - if (*value != 0xC0FFEE) { - dts_fail("tel_set_sms_parameters", "Callback userdata crashed"); - } -} - -static void utc_tel_set_sms_parameters(void) -{ - int ret; - int value = 0xC0FFEE; - TelSmsParams_t *pSmsSetParameters = NULL; - - char* name = "airtel"; - char* num = "0103001408"; - char* sca = "9845087001"; - - pSmsSetParameters->RecordIndex = 0x00; - pSmsSetParameters->RecordLen = 31; - pSmsSetParameters->AlphaIdLen = 3; - memcpy (&pSmsSetParameters->szAlphaId, name, strlen (name)); - - pSmsSetParameters->ParamIndicator = 0xe0; - pSmsSetParameters->TpDestAddr.DialNumLen = 10; - pSmsSetParameters->TpDestAddr.Ton = 1; - pSmsSetParameters->TpDestAddr.Npi = 1; - - pSmsSetParameters->TpSvcCntrAddr.DialNumLen = 10; - pSmsSetParameters->TpSvcCntrAddr.Ton = 1; - pSmsSetParameters->TpSvcCntrAddr.Npi = 1; - - memcpy (pSmsSetParameters->TpDestAddr.szDiallingNum, num, strlen (num)); - memcpy (pSmsSetParameters->TpSvcCntrAddr.szDiallingNum, sca, strlen (sca)); - pSmsSetParameters->TpProtocolId = 3; - pSmsSetParameters->TpDataCodingScheme = 2; - pSmsSetParameters->TpValidityPeriod = 1; - - util_init_loop (); - - async_flag = ASYNC_READY; - ret = tel_set_sms_parameters(handle, pSmsSetParameters, on_tel_set_sms_parameters, &value); - if (ret != TAPI_API_SUCCESS) { - dts_fail("tel_set_sms_parameters", "Unexpected return"); - } - - util_start_loop (); - util_free_loop (); - - if (async_flag != ASYNC_DONE) { - dts_fail("tel_set_sms_parameters", "Callback not invoked"); - } - - dts_pass("tel_set_sms_parameters"); -} - -static void utc_fail_tel_set_sms_parameters(void) -{ - int ret; - - ret = tel_set_sms_parameters(NULL, NULL, NULL, NULL); - if (ret == TAPI_API_SUCCESS) { - dts_fail("tel_set_sms_parameters", "Parameter check failed"); - } - - dts_pass("tel_set_sms_parameters"); -} - -static void utc_tel_check_sms_device_status(void) -{ - int ret; - int readyStatus; - - ret = tel_check_sms_device_status(handle, &readyStatus); - if (ret != TAPI_API_SUCCESS) { - dts_fail("tel_set_sms_parameters", "Unexpected return"); - } - - dts_pass("tel_set_sms_parameters"); -} - -static void utc_fail_tel_check_sms_device_status(void) -{ - int ret; - - ret = tel_check_sms_device_status(NULL, NULL); - if (ret == TAPI_API_SUCCESS) { - dts_fail("tel_set_sms_parameters", "Parameter check failed"); - } - - dts_pass("tel_set_sms_parameters"); -} - - -/** - * Generate default TC for no-additional-parameter type API - * - */ -DO(tel_get_sms_count) -DO(tel_get_sms_cb_config) -DO(tel_get_sms_preferred_bearer) -DO(tel_get_sms_parameter_count) - -struct tet_testlist tet_testlist[] = { - /* generated TC */ - { utc_tel_get_sms_count, 1 }, - { utc_fail_tel_get_sms_count, 2 }, - { utc_tel_get_sms_cb_config, 1 }, - { utc_fail_tel_get_sms_cb_config, 2 }, - { utc_tel_get_sms_preferred_bearer, 1 }, - { utc_fail_tel_get_sms_preferred_bearer, 2 }, - { utc_tel_get_sms_parameter_count, 1 }, - { utc_fail_tel_get_sms_parameter_count, 2 }, - - /* custom TC */ - { utc_tel_send_sms, 1 }, - { utc_fail_tel_send_sms, 2 }, - { utc_tel_read_sms_in_sim, 1 }, - { utc_fail_tel_read_sms_in_sim, 2 }, - { utc_tel_write_sms_in_sim, 1 }, - { utc_fail_tel_write_sms_in_sim, 2 }, - { utc_tel_delete_sms_in_sim, 1 }, - { utc_fail_tel_delete_sms_in_sim, 2 }, - { utc_tel_get_sms_sca, 1 }, - { utc_fail_tel_get_sms_sca, 2 }, - { utc_tel_set_sms_sca, 1 }, - { utc_fail_tel_set_sms_sca, 2 }, - { utc_tel_set_sms_cb_config, 1 }, - { utc_fail_tel_set_sms_cb_config, 2 }, - { utc_tel_set_sms_memory_status, 1 }, - { utc_fail_tel_set_sms_memory_status, 2 }, - { utc_tel_set_sms_preferred_bearer, 1 }, - { utc_fail_tel_set_sms_preferred_bearer, 2 }, - { utc_tel_send_sms_deliver_report, 1 }, - { utc_fail_tel_send_sms_deliver_report, 2 }, - { utc_tel_set_sms_message_status, 1 }, - { utc_fail_tel_set_sms_message_status, 2 }, - { utc_tel_get_sms_parameters, 1 }, - { utc_fail_tel_get_sms_parameters, 2 }, - { utc_tel_set_sms_parameters, 1 }, - { utc_fail_tel_set_sms_parameters, 2 }, - { utc_tel_check_sms_device_status, 1 }, - { utc_fail_tel_check_sms_device_status, 2 }, - { NULL, 0 }, -}; - -static void startup (void) -{ - /* start of TC */ - tet_printf ("\n TC start"); - - handle = tel_init (NULL); -} - -static void cleanup (void) -{ - tel_deinit (handle); - - /* end of TC */ - tet_printf ("\n TC end"); -} - -void (*tet_startup) (void) = startup; -void (*tet_cleanup) (void) = cleanup; diff --git a/wearable/TC/testcase/utc_ss.c b/wearable/TC/testcase/utc_ss.c deleted file mode 100755 index d18b2cc..0000000 --- a/wearable/TC/testcase/utc_ss.c +++ /dev/null @@ -1,970 +0,0 @@ -/* - * libslp-tapi - * - * Copyright (c) 2013 Samsung Electronics Co., Ltd. All rights reserved. - * - * Contact: Ja-young Gu - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT 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 "util_common.h" - -TapiHandle *handle; -enum async_state async_flag; - -static char data_ss_set_barring_password[TAPI_SS_GSM_BARR_PW_LEN_MAX+1] = "0000"; - -TelSsClass_t class = 0x10; - -TelSsBarringType_t barring_type[9] = { - TAPI_SS_CB_TYPE_BAOC, - TAPI_SS_CB_TYPE_BOIC, - TAPI_SS_CB_TYPE_BOIC_NOT_HC, - TAPI_SS_CB_TYPE_BAIC, - TAPI_SS_CB_TYPE_BIC_ROAM, - TAPI_SS_CB_TYPE_AB, - TAPI_SS_CB_TYPE_AOB, - TAPI_SS_CB_TYPE_AIB, - TAPI_SS_CB_TYPE_BIC_NOT_SIM -} ; - -TelSsBarringMode_t barring_mode [2] = { - TAPI_SS_CB_MODE_ACTIVATE, - TAPI_SS_CB_MODE_DEACTIVATE -}; - -TelSsForwardWhen_t forwarding_type[7] = { - TAPI_SS_CF_WHEN_CFU, - TAPI_SS_CF_WHEN_CFB, - TAPI_SS_CF_WHEN_CFNRy, - TAPI_SS_CF_WHEN_CFNRc, - TAPI_SS_CF_WHEN_CF_ALL, - TAPI_SS_CF_WHEN_CFC -}; - -TelSsForwardMode_t forwarding_mode[4] = { - TAPI_SS_CF_MODE_DISABLE_EV, - TAPI_SS_CF_MODE_ENABLE_EV, - TAPI_SS_CF_MODE_REGISTRATION_EV, - TAPI_SS_CF_MODE_ERASURE_EV -}; - -TelSsCallWaitingMode_t waiting_mode [2] = { - TAPI_SS_CW_MODE_ACTIVATE, - TAPI_SS_CW_MODE_DEACTIVATE -}; - -TelSsCliType_t cli_type[6] = { - TAPI_SS_CLI_CLIP, - TAPI_SS_CLI_CLIR, - TAPI_SS_CLI_COLP, - TAPI_SS_CLI_COLR, - TAPI_SS_CLI_CDIP, - TAPI_SS_CLI_CNAP -}; - -TelSsCliStatus_t cli_mode[6] = { - TAPI_CLI_STATUS_NOT_PROVISONED, - TAPI_CLI_STATUS_PROVISIONED, - TAPI_CLI_STATUS_ACTIVATED, - TAPI_CLI_STATUS_UNKOWN, - TAPI_CLI_STATUS_TEMP_RESTRICTED, - TAPI_CLI_STATUS_TEMP_ALLOWED -}; - -/* Barring Activate/De-activate Macro */ -#define DO_BARRING(func, param1, param2, param3) \ - static void on_##func(TapiHandle *handle, int result, void *data, void *user_data) \ - { \ - int *value = user_data; \ -\ - async_flag = ASYNC_DONE; \ - util_stop_loop(); \ -\ - if (*value != 0xC0FFEE) { \ - dts_fail(#func, "Callback userdata crashed"); \ - } \ - if (result != 0x0) { \ - dts_fail(#func, "Operation failed"); \ - } \ - } \ -\ - static void utc_##func (TelSsClass_t param1, TelSsBarringType_t param2, TelSsBarringMode_t param3) \ - { \ - TelSsBarringInfo_t info; \ - int ret; \ - int value = 0xC0FFEE; \ -\ - /* with callback */ \ - util_init_loop(); \ -\ - async_flag = ASYNC_READY; \ - memset(&info, 0, sizeof(TelSsBarringInfo_t)); \ - info.Class =param1; \ - info.Type = param2; \ - info.Mode = param3; \ - g_strlcpy(info.szPassword, data_ss_set_barring_password, TAPI_SS_GSM_BARR_PW_LEN_MAX); \ - ret = tel_set_ss_barring (handle, &info, on_##func, &value); \ - if (ret != TAPI_API_SUCCESS) { \ - dts_fail(#func, "Unexpected return"); \ - } \ -\ - util_start_loop(); \ - util_free_loop(); \ -\ - if (async_flag != ASYNC_DONE) { \ - dts_fail(#func, "Callback not invoked"); \ - } \ -\ - dts_pass(#func); \ - } \ -\ - static void utc_fail_##func (TelSsClass_t param1, TelSsBarringType_t param2, TelSsBarringMode_t param3) \ - { \ - int ret; \ -\ - ret = tel_set_ss_barring (NULL, NULL, NULL,NULL); \ - dts_check_ne(#func, ret, TAPI_API_SUCCESS, "Unexpected return"); \ - } - -/* Barring Status Macro */ -#define DO_BARRING_STATUS(func, param1, param2) \ - static void on_##func (TapiHandle *handle, int result, void *data, void *user_data) \ - { \ - int *value = user_data; \ -\ - async_flag = ASYNC_DONE; \ - util_stop_loop(); \ -\ - if (*value != 0xC0FFEE) { \ - dts_fail(#func, "Callback userdata crashed"); \ - } \ - if (result != 0x0) { \ - dts_fail(#func, "Operation failed"); \ - } \ - } \ -\ - static void utc_##func (TelSsClass_t param1, TelSsBarringType_t param2) \ - { \ - int ret; \ - int value = 0xC0FFEE; \ -\ - /* with callback */ \ - util_init_loop(); \ -\ - async_flag = ASYNC_READY; \ - ret = tel_get_ss_barring_status (handle, param1, param2, on_##func, &value); \ - if (ret != TAPI_API_SUCCESS) { \ - dts_fail(#func, "Unexpected return"); \ - } \ -\ - util_start_loop(); \ - util_free_loop(); \ -\ - if (async_flag != ASYNC_DONE) { \ - dts_fail(#func, "Callback not invoked"); \ - } \ -\ - dts_pass(#func); \ - } \ -\ - static void utc_fail_##func (TelSsClass_t param1, TelSsBarringType_t param2) \ - { \ - int ret; \ -\ - ret = tel_get_ss_barring_status (NULL, 0, 0, NULL, NULL); \ - dts_check_ne(#func, ret, TAPI_API_SUCCESS, "Unexpected return"); \ - } - -/* Forwarding Register/Erasure Macro*/ -#define DO_FORWARDING(func, param1, param2, param3) \ - static void on_##func (TapiHandle *handle, int result, void *data, void *user_data) \ - { \ - int *value = user_data; \ -\ - async_flag = ASYNC_DONE; \ - util_stop_loop(); \ -\ - if (*value != 0xC0FFEE) { \ - dts_fail(#func, "Callback userdata crashed"); \ - } \ - if (result != 0x0) { \ - dts_fail(#func, "Operation failed"); \ - } \ - } \ -\ - static void utc_##func (TelSsClass_t param1, TelSsForwardWhen_t param2, TelSsForwardMode_t param3) \ - { \ - TelSsForwardInfo_t info;\ - int ret; \ - int value = 0xC0FFEE; \ -\ - /* with callback */ \ - util_init_loop(); \ -\ - async_flag = ASYNC_READY; \ - memset(&info, 0, sizeof(TelSsForwardInfo_t)); \ - info.Class = param1; \ - info.Condition = param2; \ - info.NoReplyConditionTimer = 0x05;\ - info.Mode = param3;\ - info.Ton = 0x01;\ - info.Npi = 0x01;\ - strncpy((char*)info.szPhoneNumber, "+919535099681", 13);\ - info.szPhoneNumber[13] = '\0';\ - ret = tel_set_ss_forward (handle, &info, on_##func, &value); \ - if (ret != TAPI_API_SUCCESS) { \ - dts_fail(#func, "Unexpected return"); \ - } \ -\ - util_start_loop(); \ - util_free_loop(); \ -\ - if (async_flag != ASYNC_DONE) { \ - dts_fail(#func, "Callback not invoked"); \ - } \ -\ - dts_pass(#func); \ - } \ -\ - static void utc_fail_##func (TelSsClass_t param1, TelSsForwardWhen_t param2, TelSsForwardMode_t param3) \ - { \ - int ret; \ -\ - ret = tel_set_ss_forward (NULL, NULL, NULL, NULL); \ - dts_check_ne(#func, ret, TAPI_API_SUCCESS, "Unexpected return"); \ - } - -/* Forwarding Get Status Macro*/ -#define DO_FORWARDING_STATUS(func, param1, param2) \ - static void on_##func (TapiHandle *handle, int result, void *data, void *user_data) \ - { \ - int *value = user_data; \ -\ - async_flag = ASYNC_DONE; \ - util_stop_loop(); \ -\ - if (*value != 0xC0FFEE) { \ - dts_fail(#func, "Callback userdata crashed"); \ - } \ - if (result != 0x0) { \ - dts_fail(#func, "Operation failed"); \ - } \ - } \ -\ - static void utc_##func (TelSsClass_t param1, TelSsForwardWhen_t param2) \ - { \ - int ret; \ - int value = 0xC0FFEE; \ -\ - /* with callback */ \ - util_init_loop(); \ -\ - async_flag = ASYNC_READY; \ - ret = tel_get_ss_forward_status (handle, param1, param2, on_##func, &value); \ - if (ret != TAPI_API_SUCCESS) { \ - dts_fail(#func, "Unexpected return"); \ - } \ -\ - util_start_loop(); \ - util_free_loop(); \ -\ - if (async_flag != ASYNC_DONE) { \ - dts_fail(#func, "Callback not invoked"); \ - } \ -\ - dts_pass(#func); \ - } \ -\ - static void utc_fail_##func (TelSsClass_t param1, TelSsForwardWhen_t param2) \ - { \ - int ret; \ -\ - ret = tel_get_ss_forward_status (NULL, 0, 0, NULL, NULL); \ - dts_check_ne(#func, ret, TAPI_API_SUCCESS, "Unexpected return"); \ - } - -/* Waiting Activate/De-activate Macro*/ -#define DO_WAITING(func, param1, param2) \ - static void on_##func (TapiHandle *handle, int result, void *data, void *user_data) \ - { \ - int *value = user_data; \ -\ - async_flag = ASYNC_DONE; \ - util_stop_loop(); \ -\ - if (*value != 0xC0FFEE) { \ - dts_fail(#func, "Callback userdata crashed"); \ - } \ - if (result != 0x0) { \ - dts_fail(#func, "Operation failed"); \ - } \ - } \ -\ - static void utc_##func (TelSsClass_t param1, TelSsCallWaitingMode_t param2) \ - { \ - TelSsWaitingInfo_t info; \ - int ret; \ - int value = 0xC0FFEE; \ -\ - /* with callback */ \ - util_init_loop(); \ - memset(&info, 0, sizeof(TelSsWaitingInfo_t)); \ - async_flag = ASYNC_READY; \ - info.Class = param1;\ - info.Mode = param2;\ - ret = tel_set_ss_waiting (handle, &info, on_##func, &value); \ - if (ret != TAPI_API_SUCCESS) { \ - dts_fail(#func, "Unexpected return"); \ - } \ -\ - util_start_loop(); \ - util_free_loop(); \ -\ - if (async_flag != ASYNC_DONE) { \ - dts_fail(#func, "Callback not invoked"); \ - } \ -\ - dts_pass(#func); \ - } \ -\ - static void utc_fail_##func (TelSsClass_t param1, TelSsCallWaitingMode_t param2) \ - { \ - int ret; \ -\ - ret = tel_set_ss_waiting (NULL, NULL, NULL, NULL); \ - dts_check_ne(#func, ret, TAPI_API_SUCCESS, "Unexpected return"); \ - } - -/* Set CLI Status Macro */ -#define DO_CLI(func, param1, param2) \ - static void on_##func (TapiHandle *handle, int result, void *data, void *user_data) \ - { \ - int *value = user_data; \ -\ - async_flag = ASYNC_DONE; \ - util_stop_loop(); \ -\ - if (*value != 0xC0FFEE) { \ - dts_fail(#func, "Callback userdata crashed"); \ - } \ - if (result != 0x0) { \ - dts_fail(#func, "Operation failed"); \ - } \ - } \ -\ - static void utc_##func (TelSsCliType_t param1, TelSsCliStatus_t param2) \ - { \ - int ret; \ - int value = 0xC0FFEE; \ -\ - /* with callback */ \ - util_init_loop(); \ -\ - async_flag = ASYNC_READY; \ - ret = tel_set_ss_cli_status(handle, param1, param2, on_##func, &value); \ - if (ret != TAPI_API_SUCCESS) { \ - dts_fail(#func, "Unexpected return"); \ - } \ -\ - util_start_loop(); \ - util_free_loop(); \ -\ - if (async_flag != ASYNC_DONE) { \ - dts_fail(#func, "Callback not invoked"); \ - } \ -\ - dts_pass(#func); \ - } \ -\ - static void utc_fail_##func (TelSsCliType_t param1) \ - { \ - int ret; \ -\ - ret = tel_set_ss_cli_status (NULL, 0, 0, NULL, NULL); \ - dts_check_ne(#func, ret, TAPI_API_SUCCESS, "Unexpected return"); \ - } - -/* CLI Interrogation Macro */ -#define DO_CLI_STATUS(func, param1) \ - static void on_##func (TapiHandle *handle, int result, void *data, void *user_data) \ - { \ - int *value = user_data; \ -\ - async_flag = ASYNC_DONE; \ - util_stop_loop(); \ -\ - if (*value != 0xC0FFEE) { \ - dts_fail(#func, "Callback userdata crashed"); \ - } \ - if (result != 0x0) { \ - dts_fail(#func, "Operation failed"); \ - } \ - } \ -\ - static void utc_##func (TelSsCliType_t param1) \ - { \ - int ret; \ - int value = 0xC0FFEE; \ -\ - /* with callback */ \ - util_init_loop(); \ -\ - async_flag = ASYNC_READY; \ - ret = tel_get_ss_cli_status(handle, param1, on_##func, &value); \ - if (ret != TAPI_API_SUCCESS) { \ - dts_fail(#func, "Unexpected return"); \ - } \ -\ - util_start_loop(); \ - util_free_loop(); \ -\ - if (async_flag != ASYNC_DONE) { \ - dts_fail(#func, "Callback not invoked"); \ - } \ -\ - dts_pass(#func); \ - } \ -\ - static void utc_fail_##func (TelSsCliType_t param1) \ - { \ - int ret; \ -\ - ret = tel_get_ss_cli_status (NULL, 0, NULL, NULL); \ - dts_check_ne(#func, ret, TAPI_API_SUCCESS, "Unexpected return"); \ - } - - -/** - * tel_change_ss_barring_password - * - */ -static void on_tel_change_ss_barring_password (TapiHandle *handle, int result, void *data, void *user_data) -{ - int *value = user_data; - - async_flag = ASYNC_DONE; - util_stop_loop (); - - if (*value != 0xC0FFEE) { - dts_fail("tel_change_ss_barring_password", "Callback userdata crashed"); - } - if (result != 0x0) { - dts_fail("tel_change_ss_barring_password", "Operation failed"); - } -} - -static void utc_tel_change_ss_barring_password (void) -{ - int ret; - int value = 0xC0FFEE; - - util_init_loop (); - - async_flag = ASYNC_READY; - ret = tel_change_ss_barring_password (handle, "0000","1111", "1111", - on_tel_change_ss_barring_password, &value); - if (ret != TAPI_API_SUCCESS) { - dts_fail("tel_change_ss_barring_password", "Unexpected return"); - } - - util_start_loop (); - util_free_loop (); - - if (async_flag != ASYNC_DONE) { - dts_fail("tel_change_ss_barring_password", "Callback not invoked"); - } - - dts_pass("tel_change_ss_barring_password"); -} - -static void utc_fail_tel_change_ss_barring_password (void) -{ - int ret; - - ret = tel_change_ss_barring_password (NULL, NULL, 0, NULL, NULL, NULL); - if (ret == TAPI_API_SUCCESS) { - dts_fail("tel_change_ss_barring_password", "Parameter check failed"); - } - - ret = tel_change_ss_barring_password (handle, NULL, 0, NULL, NULL, NULL); - if (ret == TAPI_API_SUCCESS) { - dts_fail("tel_change_ss_barring_password", "Parameter check failed"); - } - - dts_pass("tel_change_ss_barring_password"); -} - - -/** - * tel_ss_waiting_status - * - */ -static void on_tel_ss_waiting_status (TapiHandle *handle, int result, void *data, void *user_data) -{ - int *value = user_data; - - async_flag = ASYNC_DONE; - util_stop_loop (); - - if (*value != 0xC0FFEE) { - dts_fail("tel_ss_waiting_status", "Callback userdata crashed"); - } - if (result != 0x0) { - dts_fail("tel_ss_waiting_status", "Operation failed"); - } -} - -static void utc_tel_ss_waiting_status (void) -{ - int ret; - int value = 0xC0FFEE; - - util_init_loop (); - - async_flag = ASYNC_READY; - ret = tel_get_ss_waiting_status (handle, 0x10, - on_tel_ss_waiting_status, &value); - if (ret != TAPI_API_SUCCESS) { - dts_fail("tel_ss_waiting_status", "Unexpected return"); - } - - util_start_loop (); - util_free_loop (); - - if (async_flag != ASYNC_DONE) { - dts_fail("tel_ss_waiting_status", "Callback not invoked"); - } - - dts_pass("tel_ss_waiting_status"); -} - -static void utc_fail_tel_ss_waiting_status (void) -{ - int ret; - - ret = tel_get_ss_waiting_status (NULL, 0, NULL, NULL); - if (ret == TAPI_API_SUCCESS) { - dts_fail("el_ss_waiting_status", "Parameter check failed"); - } - - ret = tel_get_ss_waiting_status (handle, 0, NULL, NULL); - if (ret == TAPI_API_SUCCESS) { - dts_fail("el_ss_waiting_status", "Parameter check failed"); - } - - dts_pass("el_ss_waiting_status"); -} - - -/** - * tel_ss_init_ussd - * - */ -static void on_tel_ss_init_ussd (TapiHandle *handle, int result, void *data, void *user_data) -{ - int *value = user_data; - - async_flag = ASYNC_DONE; - util_stop_loop (); - - if (*value != 0xC0FFEE) { - dts_fail("tel_ss_init_ussd", "Callback userdata crashed"); - } - if (result != 0x0) { - dts_fail("tel_ss_init_ussd", "Operation failed"); - } -} - -static void utc_tel_ss_init_ussd (void) -{ - int ret; - int value = 0xC0FFEE; - TelSsUssdMsgInfo_t info; - - util_init_loop (); - - async_flag = ASYNC_READY; - memset(&info, 0, sizeof(TelSsUssdMsgInfo_t)); - info.Type = 0x01; - info.Length = 0x05; - strncpy(info.szString, "*121#", 5); - ret = tel_send_ss_ussd_request (handle, &info, - on_tel_ss_init_ussd, &value); - if (ret != TAPI_API_SUCCESS) { - dts_fail("tel_ss_init_ussd", "Unexpected return"); - } - - util_start_loop (); - util_free_loop (); - - if (async_flag != ASYNC_DONE) { - dts_fail("tel_ss_init_ussd", "Callback not invoked"); - } - - dts_pass("tel_ss_init_ussd"); -} - -static void utc_fail_tel_ss_init_ussd (void) -{ - int ret; - - ret = tel_send_ss_ussd_request (NULL, NULL, NULL, NULL); - if (ret == TAPI_API_SUCCESS) { - dts_fail("tel_ss_init_ussd", "Parameter check failed"); - } - - ret = tel_send_ss_ussd_request (handle, NULL, 0, NULL); - if (ret == TAPI_API_SUCCESS) { - dts_fail("tel_ss_init_ussd", "Parameter check failed"); - } - - dts_pass("tel_ss_init_ussd"); -} - -/** - * tel_ss_cancel_ussd - * - */ -static void on_tel_ss_cancel_ussd (TapiHandle *handle, int result, void *data, void *user_data) -{ - int *value = user_data; - - async_flag = ASYNC_DONE; - util_stop_loop (); - - if (*value != 0xC0FFEE) { - dts_fail("tel_ss_cancel_ussd", "Callback userdata crashed"); - } - if (result != 0x0) { - dts_fail("tel_ss_cancel_ussd", "Operation failed"); - } -} - -static void utc_tel_ss_cancel_ussd (void) -{ - int ret; - int value = 0xC0FFEE; - TelSsUssdMsgInfo_t info; - - util_init_loop (); - - async_flag = ASYNC_READY; - memset(&info, 0, sizeof(TelSsUssdMsgInfo_t)); - info.Type = 0x03; - info.Length = 0x05; - strncpy(info.szString, "*121#", 5); - ret = tel_send_ss_ussd_request (handle, &info, - on_tel_ss_cancel_ussd, &value); - if (ret != TAPI_API_SUCCESS) { - dts_fail("tel_ss_cancel_ussd", "Unexpected return"); - } - - util_start_loop (); - util_free_loop (); - - if (async_flag != ASYNC_DONE) { - dts_fail("tel_ss_cancel_ussd", "Callback not invoked"); - } - - dts_pass("tel_ss_cancel_ussd"); -} - -static void utc_fail_tel_ss_cancel_ussd (void) -{ - int ret; - - ret = tel_send_ss_ussd_request (NULL, NULL, NULL, NULL); - if (ret == TAPI_API_SUCCESS) { - dts_fail("tel_ss_cancel_ussd", "Parameter check failed"); - } - - ret = tel_send_ss_ussd_request (handle, NULL, 0, NULL); - if (ret == TAPI_API_SUCCESS) { - dts_fail("tel_ss_cancel_ussd", "Parameter check failed"); - } - - dts_pass("tel_ss_cancel_ussd"); -} - -/* Barring activate and De-activate auto generated functions */ - -DO_BARRING(tel_barring_baoc_activate, class, barring_type[0], barring_mode[0]) -DO_BARRING(tel_barring_baoc_deactivate, class, barring_type[0], barring_mode[1]) -DO_BARRING(tel_barring_boic_activate, class, barring_type[1], barring_mode[0]) -DO_BARRING(tel_barring_boic_deactivate, class, barring_type[1], barring_mode[1]) -DO_BARRING(tel_barring_boic_not_hc_activate, class, barring_type[2], barring_mode[0]) -DO_BARRING(tel_barring_boic_not_hc_deactivate, class, barring_type[2], barring_mode[1]) -DO_BARRING(tel_barring_baic_activate, class, barring_type[3], barring_mode[0]) -DO_BARRING(tel_barring_baic_deactivate, class, barring_type[3], barring_mode[1]) -DO_BARRING(tel_barring_bic_roam_activate, class, barring_type[4], barring_mode[0]) -DO_BARRING(tel_barring_bic_roam_deactivate, class, barring_type[4], barring_mode[1]) -DO_BARRING(tel_barring_ab_activate, class, barring_type[5], barring_mode[0]) -DO_BARRING(tel_barring_ab_deactivate, class, barring_type[5], barring_mode[1]) -DO_BARRING(tel_barring_aob_activate, class, barring_type[6], barring_mode[0]) -DO_BARRING(tel_barring_aob_deactivate, class, barring_type[6], barring_mode[1]) -DO_BARRING(tel_barring_aib_activate, class, barring_type[7], barring_mode[0]) -DO_BARRING(tel_barring_aib_deactivate, class, barring_type[7], barring_mode[1]) -DO_BARRING(tel_barring_bic_not_sim_activate, class, barring_type[8], barring_mode[0]) -DO_BARRING(tel_barring_bic_not_sim_deactivate, class, barring_type[8], barring_mode[1]) - -/* Barring get status auto generated functions */ - -DO_BARRING_STATUS(tel_barring_baoc_status, class, barring_type[0]) -DO_BARRING_STATUS(tel_barring_boic_status, class, barring_type[1]) -DO_BARRING_STATUS(tel_barring_boic_not_hc_status, class, barring_type[2]) -DO_BARRING_STATUS(tel_barring_baic_status, class, barring_type[3]) -DO_BARRING_STATUS(tel_barring_bic_roam_status, class, barring_type[4]) -DO_BARRING_STATUS(tel_barring_ab_status, class, barring_type[5]) -DO_BARRING_STATUS(tel_barring_aob_status, class, barring_type[6]) -DO_BARRING_STATUS(tel_barring_aib_status, class, barring_type[7]) -DO_BARRING_STATUS(tel_barring_bic_not_sim_status, class, barring_type[8]) - -/* Forwarding register and erasure auto generated functions */ - -DO_FORWARDING(tel_forwarding_cfu_register, class, forwarding_type[0], forwarding_mode[2]) -DO_FORWARDING(tel_forwarding_cfu_erasure, class, forwarding_type[0], forwarding_mode[3]) -DO_FORWARDING(tel_forwarding_cfb_register, class, forwarding_type[1], forwarding_mode[2]) -DO_FORWARDING(tel_forwarding_cfb_erasure, class, forwarding_type[1], forwarding_mode[3]) -DO_FORWARDING(tel_forwarding_cfnry_register, class, forwarding_type[2], forwarding_mode[2]) -DO_FORWARDING(tel_forwarding_cfnry_erasure, class, forwarding_type[2], forwarding_mode[3]) -DO_FORWARDING(tel_forwarding_cfnrc_register, class, forwarding_type[3], forwarding_mode[2]) -DO_FORWARDING(tel_forwarding_cfunrc_erasure, class, forwarding_type[3], forwarding_mode[3]) -DO_FORWARDING(tel_forwarding_cf_all_register, class, forwarding_type[4], forwarding_mode[2]) -DO_FORWARDING(tel_forwarding_cf_all_erasure, class, forwarding_type[4], forwarding_mode[3]) -DO_FORWARDING(tel_forwarding_cfc_register, class, forwarding_type[5], forwarding_mode[2]) -DO_FORWARDING(tel_forwarding_cfc_erasure, class, forwarding_type[5], forwarding_mode[3]) - - -/* Forwarding get status auto generated functions */ - -DO_FORWARDING_STATUS(tel_forwarding_cfu_status, class, forwarding_type[0]) -DO_FORWARDING_STATUS(tel_forwarding_cfb_status, class, forwarding_type[1]) -DO_FORWARDING_STATUS(tel_forwarding_cfnry_status, class, forwarding_type[2]) -DO_FORWARDING_STATUS(tel_forwarding_cfnrc_status, class, forwarding_type[3]) -DO_FORWARDING_STATUS(tel_forwarding_cf_all_status, class, forwarding_type[4]) -DO_FORWARDING_STATUS(tel_forwarding_cfc_status, class, forwarding_type[5]) - - -/* Waiting activate/de-activate Macro */ - -DO_WAITING(tel_waiting_activate, class, waiting_mode[0]) -DO_WAITING(tel_waiting_deactivate, class, waiting_mode[1]) - -/* CLI set status auto generated functions */ - -DO_CLI(tel_CLIP_activate, cli_type[0], cli_mode[2]) -DO_CLI(tel_CLIP_deactivate, cli_type[0], cli_mode[0]) -DO_CLI(tel_CLIR_activate, cli_type[1], cli_mode[2]) -DO_CLI(tel_CLIR_deactivate, cli_type[1], cli_mode[0]) -DO_CLI(tel_COLP_activate, cli_type[2], cli_mode[2]) -DO_CLI(tel_COLP_deactivate, cli_type[2], cli_mode[0]) -DO_CLI(tel_COLR_activate, cli_type[3], cli_mode[2]) -DO_CLI(tel_COLR_deactivate, cli_type[3], cli_mode[0]) -DO_CLI(tel_CDIP_activate, cli_type[4], cli_mode[2]) -DO_CLI(tel_CDIP_deactivate, cli_type[4], cli_mode[0]) -DO_CLI(tel_CNAP_activate, cli_type[5], cli_mode[2]) -DO_CLI(tel_CNAP_deactivate, cli_type[5], cli_mode[0]) - -/* CLI get status auto generated functions */ - -DO_CLI_STATUS(tel_CLIP_status, cli_type[0]) -DO_CLI_STATUS(tel_CLIR_status, cli_type[1]) -DO_CLI_STATUS(tel_COLP_status, cli_type[2]) -DO_CLI_STATUS(tel_COLR_status, cli_type[3]) -DO_CLI_STATUS(tel_CDIP_status, cli_type[4]) -DO_CLI_STATUS(tel_CNAP_status, cli_type[5]) - - -struct tet_testlist tet_testlist[] = { - /* generated TC */ - { utc_tel_barring_baoc_activate, 1 }, - { utc_fail_tel_barring_baoc_activate, 2 }, - { utc_tel_barring_baoc_deactivate, 1 }, - { utc_fail_tel_barring_baoc_deactivate, 2 }, - { utc_tel_barring_boic_activate, 1 }, - { utc_fail_tel_barring_boic_activate, 2 }, - { utc_tel_barring_boic_deactivate, 1 }, - { utc_fail_tel_barring_boic_deactivate, 2 }, - { utc_tel_barring_boic_not_hc_activate, 1 }, - { utc_fail_tel_barring_boic_not_hc_activate, 2 }, - { utc_tel_barring_boic_not_hc_deactivate, 1 }, - { utc_fail_tel_barring_boic_not_hc_deactivate, 2 }, - { utc_tel_barring_baic_activate, 1 }, - { utc_fail_tel_barring_baic_activate, 2 }, - { utc_tel_barring_baic_deactivate, 1 }, - { utc_fail_tel_barring_baic_deactivate, 2 }, - { utc_tel_barring_bic_roam_activate, 1 }, - { utc_fail_tel_barring_bic_roam_activate, 2 }, - { utc_tel_barring_bic_roam_deactivate, 1 }, - { utc_fail_tel_barring_bic_roam_deactivate, 2 }, - { utc_tel_barring_ab_activate, 1 }, - { utc_fail_tel_barring_ab_activate, 2 }, - { utc_tel_barring_ab_deactivate, 1 }, - { utc_fail_tel_barring_ab_deactivate, 2 }, - { utc_tel_barring_aob_activate, 1 }, - { utc_fail_tel_barring_aob_activate, 2 }, - { utc_tel_barring_aob_deactivate, 1 }, - { utc_fail_tel_barring_aob_deactivate, 2 }, - { utc_tel_barring_aib_activate, 1 }, - { utc_fail_tel_barring_aib_activate, 2 }, - { utc_tel_barring_aib_deactivate, 1 }, - { utc_fail_tel_barring_aib_deactivate, 2 }, - { utc_tel_barring_bic_not_sim_activate, 1 }, - { utc_fail_tel_barring_bic_not_sim_activate, 2 }, - { utc_tel_barring_bic_not_sim_deactivate, 1 }, - { utc_fail_tel_barring_bic_not_sim_deactivate, 2 }, - - { utc_tel_barring_baoc_status, 1 }, - { utc_fail_tel_barring_baoc_status, 2 }, - { utc_tel_barring_boic_status, 1 }, - { utc_fail_tel_barring_boic_status, 2 }, - { utc_tel_barring_boic_not_hc_status, 1 }, - { utc_fail_tel_barring_boic_not_hc_status, 2 }, - { utc_tel_barring_baic_status, 1 }, - { utc_fail_tel_barring_baic_status, 2 }, - { utc_tel_barring_ab_status, 1 }, - { utc_fail_tel_barring_ab_status, 2 }, - { utc_tel_barring_bic_roam_status, 1 }, - { utc_fail_tel_barring_bic_roam_status, 2 }, - { utc_tel_barring_ab_status, 1 }, - { utc_fail_tel_barring_ab_status, 2 }, - { utc_tel_barring_aob_status, 1 }, - { utc_fail_tel_barring_aob_status, 2 }, - { utc_tel_barring_aib_status, 1 }, - { utc_fail_tel_barring_aib_status, 2 }, - { utc_tel_barring_bic_not_sim_status, 1 }, - { utc_fail_tel_barring_bic_not_sim_status, 2 }, - - { utc_tel_forwarding_cfu_register, 1 }, - { utc_fail_tel_forwarding_cfu_register, 2 }, - { utc_tel_forwarding_cfu_erasure, 1 }, - { utc_fail_tel_forwarding_cfu_erasure, 2 }, - { utc_tel_forwarding_cfb_register, 1 }, - { utc_fail_tel_forwarding_cfb_register, 2 }, - { utc_tel_forwarding_cfb_erasure, 1 }, - { utc_fail_tel_forwarding_cfb_erasure, 2 }, - { utc_tel_forwarding_cfnry_register, 1 }, - { utc_fail_tel_forwarding_cfnry_register, 2 }, - { utc_tel_forwarding_cfnry_erasure, 1 }, - { utc_fail_tel_forwarding_cfnry_erasure, 2 }, - { utc_tel_forwarding_cfnrc_register, 1 }, - { utc_fail_tel_forwarding_cfnrc_register, 2 }, - { utc_tel_forwarding_cfunrc_erasure, 1 }, - { utc_fail_tel_forwarding_cfunrc_erasure, 2 }, - { utc_tel_forwarding_cf_all_register, 1 }, - { utc_fail_tel_forwarding_cf_all_register, 2 }, - { utc_tel_forwarding_cf_all_erasure, 1 }, - { utc_fail_tel_forwarding_cf_all_erasure, 2 }, - { utc_tel_forwarding_cfc_register, 1 }, - { utc_fail_tel_forwarding_cfc_register, 2 }, - { utc_tel_forwarding_cfc_erasure, 1 }, - { utc_fail_tel_forwarding_cfc_erasure, 2 }, - - { utc_tel_forwarding_cfu_status, 1 }, - { utc_fail_tel_forwarding_cfu_status, 2 }, - { utc_tel_forwarding_cfb_status, 1 }, - { utc_fail_tel_forwarding_cfb_status, 2 }, - { utc_tel_forwarding_cfnry_status, 1 }, - { utc_fail_tel_forwarding_cfnry_status, 2 }, - { utc_tel_forwarding_cfnrc_status, 1 }, - { utc_fail_tel_forwarding_cfnrc_status, 2 }, - { utc_tel_forwarding_cf_all_status, 1 }, - { utc_fail_tel_forwarding_cf_all_status, 2 }, - { utc_tel_forwarding_cfc_status, 1 }, - { utc_fail_tel_forwarding_cfc_status, 2 }, - - - { utc_tel_waiting_activate, 1 }, - { utc_fail_tel_waiting_activate, 2 }, - { utc_tel_waiting_deactivate, 1 }, - { utc_fail_tel_waiting_deactivate, 2 }, - - { utc_tel_CLIP_status, 1 }, - { utc_fail_tel_CLIP_status, 2 }, - { utc_tel_CLIR_status, 1 }, - { utc_fail_tel_CLIR_status, 2 }, - { utc_tel_COLP_status, 1 }, - { utc_fail_tel_COLP_status, 2 }, - { utc_tel_COLR_status, 1 }, - { utc_fail_tel_COLR_status, 2 }, - { utc_tel_CDIP_status, 1 }, - { utc_fail_tel_CDIP_status, 2 }, - { utc_tel_CNAP_status, 1 }, - { utc_fail_tel_CNAP_status, 2 }, - - { utc_tel_CLIP_activate, 1 }, - { utc_fail_tel_CLIP_activate, 2 }, - { utc_tel_CLIP_deactivate, 1 }, - { utc_fail_tel_CLIP_deactivate, 2 }, - { utc_tel_CLIR_activate, 1 }, - { utc_fail_tel_CLIR_activate, 2 }, - { utc_tel_CLIR_deactivate, 1 }, - { utc_fail_tel_CLIR_deactivate, 2 }, - { utc_tel_COLP_activate, 1 }, - { utc_fail_tel_COLP_activate, 2 }, - { utc_tel_COLP_deactivate, 1 }, - { utc_fail_tel_COLP_deactivate, 2 }, - { utc_tel_COLR_activate, 1 }, - { utc_fail_tel_COLR_activate, 2 }, - { utc_tel_COLR_deactivate, 1 }, - { utc_fail_tel_COLR_deactivate, 2 }, - { utc_tel_CDIP_activate, 1 }, - { utc_fail_tel_CDIP_activate, 2 }, - { utc_tel_CDIP_deactivate, 1 }, - { utc_fail_tel_CDIP_deactivate, 2 }, - { utc_tel_CNAP_activate, 1 }, - { utc_fail_tel_CNAP_activate, 2 }, - { utc_tel_CNAP_deactivate, 1 }, - { utc_fail_tel_CNAP_deactivate, 2 }, - - /* custom TC */ - { utc_tel_change_ss_barring_password, 1 }, - { utc_fail_tel_change_ss_barring_password, 2 }, - { utc_tel_ss_waiting_status, 1 }, - { utc_fail_tel_ss_waiting_status, 2 }, - { utc_tel_ss_init_ussd, 1 }, - { utc_fail_tel_ss_init_ussd, 2 }, - { utc_tel_ss_cancel_ussd, 1 }, - { utc_fail_tel_ss_cancel_ussd, 2 }, - - { NULL, 0 }, -}; - -static void startup (void) -{ - /* start of TC */ - tet_printf ("\n SS TC start"); - - handle = tel_init (NULL); -} - -static void cleanup (void) -{ - tel_deinit (handle); - - /* end of TC */ - tet_printf ("\n SS TC end"); -} - -void (*tet_startup) (void) = startup; -void (*tet_cleanup) (void) = cleanup; - diff --git a/wearable/TC/testcase/util_common.c b/wearable/TC/testcase/util_common.c deleted file mode 100644 index 23ea758..0000000 --- a/wearable/TC/testcase/util_common.c +++ /dev/null @@ -1,53 +0,0 @@ -/* - * libslp-tapi - * - * Copyright (c) 2013 Samsung Electronics Co., Ltd. All rights reserved. - * - * Contact: Ja-young Gu - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT 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 "util_common.h" - -static GMainLoop *g_loop = NULL; -static GMainContext *g_ctx = NULL; - -void util_init_loop () -{ - g_ctx = g_main_context_new (); - g_main_context_push_thread_default (g_ctx); - g_loop = g_main_loop_new (g_ctx, FALSE); -} - -void util_free_loop () -{ - g_main_context_pop_thread_default (g_ctx); - g_main_loop_unref (g_loop); - g_main_context_unref (g_ctx); - - g_ctx = NULL; - g_loop = NULL; - -} - -void util_start_loop () -{ - g_main_loop_run (g_loop); -} - -void util_stop_loop () -{ - g_main_loop_quit (g_loop); -} diff --git a/wearable/TC/testcase/util_common.h b/wearable/TC/testcase/util_common.h deleted file mode 100755 index 7afee06..0000000 --- a/wearable/TC/testcase/util_common.h +++ /dev/null @@ -1,112 +0,0 @@ -/* - * libslp-tapi - * - * Copyright (c) 2013 Samsung Electronics Co., Ltd. All rights reserved. - * - * Contact: Ja-young Gu - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT 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 __UTIL_COMMON_H__ -#define __UTIL_COMMON_H__ - -/** - * Generate default TC for no-additional-parameter type API - * - * - positive case ('utc_' prefix) - * - valid handle - * - with callback - * check user_data validation in callback - * not check result and data (modem state dependancy) - * - without callback - * - * - negative case ('utc_fail_' prefix) - * - invalid handle (NULL) - * - * Usage: - * DO(tel_get_network_band) - * - * struct tet_testlist tet_testlist[] = { - * { ... }, - * { utc_tel_get_network_band, 1 }, - * { utc_fail_tel_get_network_band, 1 }, - * { ... }, - * }; - * - */ -#define DO(func) \ - static void on_##func (TapiHandle *handle, int result, void *data, void *user_data) \ - { \ - int *value = user_data; \ -\ - async_flag = ASYNC_DONE; \ - util_stop_loop(); \ -\ - if (*value != 0xC0FFEE) { \ - dts_fail(#func, "Callback userdata crashed"); \ - } \ -\ - } \ -\ - static void utc_##func (void) \ - { \ - int ret; \ - int value = 0xC0FFEE; \ -\ - /* with callback */ \ - util_init_loop(); \ -\ - async_flag = ASYNC_READY; \ - ret = func (handle, on_##func, &value); \ - if (ret != TAPI_API_SUCCESS) { \ - dts_fail(#func, "Unexpected return"); \ - } \ -\ - util_start_loop(); \ - util_free_loop(); \ -\ - if (async_flag != ASYNC_DONE) { \ - dts_fail(#func, "Callback not invoked"); \ - } \ -\ - /* without callback */ \ - ret = func (handle, NULL, NULL); \ - if (ret != TAPI_API_SUCCESS) { \ - dts_fail(#func, "Unexpected return"); \ - return; \ - } \ -\ - dts_pass(#func); \ - } \ -\ - static void utc_fail_##func (void) \ - { \ - int ret; \ -\ - ret = func (NULL, NULL, NULL); \ - dts_check_ne(#func, ret, TAPI_API_SUCCESS, "Unexpected return"); \ - } - -enum async_state { - ASYNC_READY, - ASYNC_DONE -}; - -void util_init_loop (); -void util_free_loop (); - -void util_start_loop (); -void util_stop_loop (); - -#endif diff --git a/wearable/TC/tet_scen b/wearable/TC/tet_scen deleted file mode 100644 index 03f029a..0000000 --- a/wearable/TC/tet_scen +++ /dev/null @@ -1,7 +0,0 @@ -all - ^TEST -##### Scenarios for TEST ##### - -# Test scenario -TEST - :include:/testcase/tslist diff --git a/wearable/TC/tetbuild.cfg b/wearable/TC/tetbuild.cfg deleted file mode 100644 index f7eda55..0000000 --- a/wearable/TC/tetbuild.cfg +++ /dev/null @@ -1,5 +0,0 @@ -TET_OUTPUT_CAPTURE=True # capture option for build operation checking -TET_BUILD_TOOL=make # build with using make command -TET_BUILD_FILE=-f Makefile # execution file (Makefile) for build -TET_API_COMPLIANT=True # use TET API in Test Case ? -TET_PASS_TC_NAME=True # report passed TC name in Journal file? diff --git a/wearable/TC/tetclean.cfg b/wearable/TC/tetclean.cfg deleted file mode 100644 index 2a0477a..0000000 --- a/wearable/TC/tetclean.cfg +++ /dev/null @@ -1,5 +0,0 @@ -TET_OUTPUT_CAPTURE=True # capture option -TET_CLEAN_TOOL= make clean # clean tool -TET_CLEAN_FILE= Makefile # file for clean -TET_API_COMPLIANT=True # TET API useage -TET_PASS_TC_NAME=True # showing name , passed TC diff --git a/wearable/TC/tetexec.cfg b/wearable/TC/tetexec.cfg deleted file mode 100644 index ef3e452..0000000 --- a/wearable/TC/tetexec.cfg +++ /dev/null @@ -1,5 +0,0 @@ -TET_OUTPUT_CAPTURE=True # capturing execution or not -TET_EXEC_TOOL= # ex) exec : execution tool set up/ Optional -TET_EXEC_FILE= # ex) exectool : execution file/ Optional -TET_API_COMPLIANT=True # Test case or Tool usesTET API? -TET_PASS_TC_NAME=True # showing Passed TC name ? diff --git a/wearable/image/SLP_TelephonyFW_PG_image001.png b/wearable/image/SLP_TelephonyFW_PG_image001.png deleted file mode 100755 index af8da9e..0000000 Binary files a/wearable/image/SLP_TelephonyFW_PG_image001.png and /dev/null differ diff --git a/wearable/image/SLP_TelephonyFW_PG_image002.png b/wearable/image/SLP_TelephonyFW_PG_image002.png deleted file mode 100755 index fa22ee2..0000000 Binary files a/wearable/image/SLP_TelephonyFW_PG_image002.png and /dev/null differ diff --git a/wearable/image/SLP_TelephonyFW_PG_image003.png b/wearable/image/SLP_TelephonyFW_PG_image003.png deleted file mode 100755 index c518ec7..0000000 Binary files a/wearable/image/SLP_TelephonyFW_PG_image003.png and /dev/null differ diff --git a/wearable/image/SLP_TelephonyFW_PG_image004.png b/wearable/image/SLP_TelephonyFW_PG_image004.png deleted file mode 100755 index 96f5184..0000000 Binary files a/wearable/image/SLP_TelephonyFW_PG_image004.png and /dev/null differ diff --git a/wearable/include/ITapiCall.h b/wearable/include/ITapiCall.h deleted file mode 100755 index 8f0d6c0..0000000 --- a/wearable/include/ITapiCall.h +++ /dev/null @@ -1,2213 +0,0 @@ -/* - * libslp-tapi - * - * Copyright (TapiHandle *handle, c) 2011 Samsung Electronics Co., Ltd. All rights reserved. - * - * Contact: Ja-young Gu - * - * Licensed under the Apache License, Version 2.0 (TapiHandle *handle, the "License", tapi_response_cb callback, void *user_data); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT 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 ITapiCall.h - * - * Call APIs allow an application to accomplish the following services: @n - * - Make a mobile originated Emergency call, Voice call, or Video call. @n - * - Accept or Reject incoming calls. @n - * - Release Calls. @n - * - Call dependent supplementary services such as call hold, retrieve, DTMF. @n - * - Multi -party call management, setup conference call, split conference call. @n - * - Call information such as get call information, get line identification number. @n - * - To verify whether a call (TapiHandle *handle, voice / video ) is possible at any given time. @n - */ - -#ifndef _ITAPI_CALL_H_ -#define _ITAPI_CALL_H_ - -#include -#include -#include - -#ifdef __cplusplus -extern "C" -{ -#endif - - /** - * @brief This function originates MO call setup. This is an asynchronous function. The function completes immediately and - * call setup proceeds in background. - * - * This API makes Dbus method call to Telephony Sever and gets immediate feedback. - * However it just means that the API request has been transfered to the CP successfully. - * The actual operation result is being delivered in the corresponding event asynchronously. - * - * @par Sync (TapiHandle *handle, or) Async: - * This is an Asynchronous API. - * - * @par Important Notes: - * - MO call setup continues in background. There are multiple states involved in the call setup procedure. Upon request completion - * successful or not, various event notifications are sent to client along with data associated with event - * (TapiHandle *handle, Successful data or error information) based on the indication or response received at the Telephony Server. - * - Setting up Emergency call - * - when #TelCallType_t is voice_call, voice call is setup unless dial_number parameter is an - * emergency number known to telephony FW (TapiHandle *handle, like 112 for all 2G and above, other numbers may operator - * specific or device configuration specific, so Telephony FW will read relevant SIM files and refer to internal - * configuration records). If an emergency number is passed and #TelCallType_t is voice_call, Telephony - * FW shall setup emergency phone call. - * - When #TelCallType_t is emergency call, emergency call is always set up. - * - * @warning - * - * @param [in] handle - * - handle from tel_init() - * - * @param[in] pParams - * - #TelCallDial_t contains the CallType(TapiHandle *handle, whether it is a voice call or data call etc) and number. - * - * - * @param [in] callback - * - To register callback function for result of this function. - * - * @param [in] user_data - * - user data for user specification - * - * @par Async Response Message: - * TAPI_EVENT_CALL_SETUP_CNF is sent to the application when the lower layers get the call originate response. - * Asynchronous return status is indicated by #TelCallCause_t and call handle is sent in the event data. - * Various asynchronous indications are described in the unsolicited notifications section . [Refer, \ref page8] - * - * @pre - * - Initialize Dbus connection with #tel_init - * - Register caller's application name with #tel_register_app_name - * - Register telephony events to listen - * - A event loop is running to listen events - * - * @post - * - None. - * - * @return Return Type (int) \n - * - 0 - indicating that the operation has completed successfully. \n - * - Else it will return failure and error code ( Refer Doxygen doc or #TapiResult_t) - * - * @par Prospective Clients: - * Embedded call application - * - * @see tel_answer_call tel_end_call - * \image html CallSetup.jpg - * \image latex CallSetup.jpg - * - * @code - * #include - * - * int ret_status =0; - * TapiHandle *handle; - * TelCallDial_t pParams; - * tapi_response_cb callback; - * void *user_data; - * char normal[16] = "1234";//Called party number - * memset( &pParams, 0, sizeof(TelCallDial_t)); - * pParams.CallType = TAPI_CALL_TYPE_VOICE; - * strcpy( pParams.szNumber,normal); - * - * ret_status = tel_dial_call (handle, &pParams, callback, user_data); // outgoing call - * @endcode - * - * @remarks - * - None - * - * - */ -int tel_dial_call(TapiHandle *handle, const TelCallDial_t *pParams, tapi_response_cb callback, void *user_data); - - /** - * @brief This function is used to answer the incoming call by accepting or rejecting the call. - * - * This API makes Dbus method call to Telephony Sever and gets immediate feedback. - * However it just means that the API request has been transfered to the CP successfully. - * The actual operation result is being delivered in the corresponding event asynchronously. - * - * @par Sync (TapiHandle *handle, or) Async: - * This is an Asynchronous API. - * - * @par Important Notes: - * - None. - * - * @warning - * - * @param [in] handle - * - handle from tel_init() - * - * @param[in] CallHandle - * - This is the unique handle for referring the call. This call handle is available to Application through incoming call - * (TapiHandle *handle, TAPI_EVENT_CALL_INCOM_IND) event. - * - * @param[in] AnsType - * - Answer type - accept / reject / replace / hold and accept. but, for CDMA, only accept is allowed. - * - * @param [in] callback - * - To register callback function for result of this function. - * - * @param [in] user_data - * - user data for user specification - * - * @par Async Response Message: - * - The event associated with this request is TAPI_EVENT_CALL_ANSWER_CNF. Asynchronous return status is - * indicated by #TelCallCause_t and call handle is sent in the event data. - * - TAPI_EVENT_CALL_CONNECTED_IND / TAPI_EVENT_CALL_END_IND event will be notified in case of call is accepted/rejected. - * - * @pre - * - Initialize Dbus connection with #tel_init - * - Register caller's application name with #tel_register_app_name - * - Register telephony events to listen - * - A event loop is running to listen events - * - Call associated with call handle should be TAPI_CALL_STATE_INCOM state otherwise the API fails and there can be a - * maximum of 1 existing call. - * - * @post - * - None. - * - * @return Return Type (TapiHandle *handle, int) \n - * - 0 - indicating that the operation has completed successfully. \n - * - Else it will return failure and error code (TapiHandle *handle, Refer Doxygen doc or #TapiResult_t) - * - * @par Prospective Clients: - * Embedded call application - * - * @see tel_dial_call tel_end_call - * - * \image html CallIncoming.jpg - * \image latex CallIncoming.jpg - * - * @code - * #include - * - * int ret_status ; - * TapiHandle *handle; - * unsigned int CallHandle; - * TelCallAnswerType_t AnsType; - * tapi_response_cb callback; - * void *user_data; - * - * ret_status = tel_answer_call (handle, pCallHandle, AnsType, callback, user_data); // call answer - * @endcode - * - * @remarks - * - None - * - * - * @remarks - * - None - * - * - */ -int tel_answer_call(TapiHandle *handle, unsigned int CallHandle, TelCallAnswerType_t AnsType, tapi_response_cb callback, void *user_data); - - /** - * - * @brief This function releases the call identified by Call Handle irrespective of call is hold or active state. - * It is used when releasing specific active call in multiparty call. - * - * This API makes Dbus method call to Telephony Sever and gets immediate feedback. - * However it just means that the API request has been transfered to the CP successfully. - * The actual operation result is being delivered in the corresponding event asynchronously. - * - * - * @par Sync (TapiHandle *handle, or) Async: - * This is an Asynchronous API. - * - * @par Important Notes: - * - In case of MPTY Call handle, Call end event is returned for each call in MPTY. - * - * @warning - * - * @param [in] handle - * - handle from tel_init() - * - * @param[in] CallHandle - * - Unique handle for referring the call. - * - * @param [in] callback - * - To register callback function for result of this function. - * - * @param [in] EndType - * - End Type - end specific call/end all calls/end all held calls/end all active calls - * - * @param [in] user_data - * - user data for user specification - * - * @par Async Response Message: - * - The event associated with this request is TAPI_EVENT_CALL_RELEASE_CNF and Asynchronous return status - * is indicated by #TelCallCause_t and call handle for the released call is sent in the event data.. - * - * - The event TAPI_EVENT_CALL_END_IND_IND is received as final asynchronous response and the associated data is #TelCallEndInfo_t. - * Asynchronous return status is indicated by #TelCallCause_t. - * - * @pre - * - Initialize Dbus connection with #tel_init - * - Register caller's application name with #tel_register_app_name - * - Register telephony events to listen - * - A event loop is running to listen events - * - Call handle should be valid and there should be an existing call in Active/hold state. - * - * @post - * - None. - * - * @return Return Type (int) \n - * - 0 - indicating that the operation has completed successfully. \n - * - Else it will return failure and error code (TapiHandle *handle, Refer Doxygen doc or #TapiResult_t) - * - * @par Prospective Clients: - * Embedded call application - * - * @see tel_dial_call tel_answer_call - * - * @code - * #include - * - * int ret_status ; - * TapiHandle *handle; - * unsigned int CallHandle; - * TelCallEndType_t EndType; - * tapi_response_cb callback; - * void *user_data; - * - * ret_status = tel_end_call (handle, pCallHandle, EndType, callback, user_data); // call end - * @endcode - * - * - * @remarks - * - None - * - * - */ -int tel_end_call(TapiHandle *handle, unsigned int CallHandle, TelCallEndType_t EndType, tapi_response_cb callback, void *user_data); - - - /** - * - * @brief This function puts the given call on hold. The call identified by Call Handle should be in active state. - * - * This API makes Dbus method call to Telephony Sever and gets immediate feedback. - * However it just means that the API request has been transfered to the CP successfully. - * The actual operation result is being delivered in the corresponding event asynchronously. - * - * - * @par Sync (TapiHandle *handle, or) Async: - * This is an Asynchronous API. - * - * @par Important Notes: - * - Call duration for the call will be calculated from the time call has been connected until call is released, - * i.e. Time duration during the call on hold will also be counted. - * - * @warning - * - * @param [in] handle - * - handle from tel_init() - * - * @param[in] CallHandle - * - Unique handle for referring the call. - * - * @param [in] callback - * - To register callback function for result of this function. - * - * @param [in] user_data - * - user data for user specification - * - * @par Async Response Message: - * - The event associated with this request is TAPI_EVENT_CALL_HOLD_CNF. Asynchronous return status is - * indicated by #TelCallCause_t and call handle is sent in the event data. - * - * @pre - * - Initialize Dbus connection with #tel_init - * - Register caller's application name with #tel_register_app_name - * - Register telephony events to listen - * - A event loop is running to listen events - * - The call identified by the Call Handle should be in active state. - * - * @post - * - None. - * - * @return Return Type (int) \n - * - 0 - indicating that the operation has completed successfully. \n - * - Else it will return failure and error code (TapiHandle *handle, Refer Doxygen doc or #TapiResult_t) - * - * @par Prospective Clients: - * Embedded call application - * - * @code - * #include - * - * int ret_status ; - * TapiHandle *handle; - * unsigned int CallHandle; - * tapi_response_cb callback; - * void *user_data; - * - * ret_status = tel_hold_call(handle, CallHandle, callback, user_data); // hold call - * @endcode - * - * - * @see tel_retrieve_call - * - * @remarks - * - None - * - * - */ - int tel_hold_call(TapiHandle *handle, unsigned int CallHandle, tapi_response_cb callback, void *user_data); - - /** - * - * @brief This function retrieves the held call. The call identified by Call Handle must be in held state. - * - * This API makes Dbus method call to Telephony Sever and gets immediate feedback. - * However it just means that the API request has been transfered to the CP successfully. - * The actual operation result is being delivered in the corresponding event asynchronously. - * - * - * @par Sync (TapiHandle *handle, or) Async: - * This is an Asynchronous API. - * - * @par Important Notes: - * - Call duration for the call will be calculated from the moment call has been connected until call is released. - * - * @warning - * - * @param [in] handle - * - handle from tel_init() - * - * @param[in] CallHandle - * - Unique handle for referring the call. - * - * @param [in] callback - * - To register callback function for result of this function. - * - * @param [in] user_data - * - user data for user specification - * - * @par Async Response Message: - * - The event associated with this request is TAPI_EVENT_CALL_RETRIEVE_CNF. Asynchronous return status is indicated - * by #TelCallCause_t and call handle is sent in the event data. - * - * @pre - * - Initialize Dbus connection with #tel_init - * - Register caller's application name with #tel_register_app_name - * - Register telephony events to listen - * - A event loop is running to listen events - * - Call should be in held state in order to retrieve into active state and no active call present. - * - * @post - * - None. - * - * @return Return Type (int) \n - * - 0 - indicating that the operation has completed successfully. \n - * - Else it will return failure and error code (TapiHandle *handle, Refer Doxygen doc or #TapiResult_t) - * - * @par Prospective Clients: - * Embedded call application - * - * @see - * - * @code - * #include - * - * int ret_status ; - * TapiHandle *handle; - * unsigned int CallHandle; - * tapi_response_cb callback; - * void *user_data; - * - * ret_status = tel_active_call(handle, CallHandle, callback, user_data); // active call - * @endcode - * - * @remarks - * - None - * - * - */ -int tel_active_call(TapiHandle *handle, unsigned int CallHandle, tapi_response_cb callback, void *user_data); - - /** - * - * @brief Swap calls. This is only for calls you dialed or answered with Telephony. - * Swap is only available for the voice calls. - * - * This API makes Dbus method call to Telephony Sever and gets immediate feedback. - * However it just means that the API request has been transfered to the CP successfully. - * The actual operation result is being delivered in the corresponding event asynchronously. - * - * @par Notes: - * During a call, user can place all active calls and accepts the other held call with this function. - * If the terminal is not within a call, it will fail. - * - * - * @par Sync (TapiHandle *handle, or) Async: - * This is an Asynchronous API. - * - * @par Important Notes: - * - None. - * - * @warning - * - * @param [in] handle - * - handle from tel_init() - * - * @param[in] CallHandle1 - * - This is active call - * - * @param[in] CallHandle2 - * - This is Held call - * - * @param [in] callback - * - To register callback function for result of this function. - * - * @param [in] user_data - * - user data for user specification - * - * @par Async Response Message: - * - - * - * @pre - * - Initialize Dbus connection with #tel_init - * - Register caller's application name with #tel_register_app_name - * - Register telephony events to listen - * - A event loop is running to listen events - * - None. - * - * @post - * - None. - * - * @return Return Type (int) \n - * - 0 - indicating that the operation has completed successfully. \n - * - Else it will return failure and error code (TapiHandle *handle, Refer Doxygen doc or #TapiResult_t) - * - * @par Prospective Clients: - * Embedded call application - * - * @code - * #include - * - * int ret_status ; - * TapiHandle *handle; - * unsigned int CallHandle1; - * unsigned int CallHandle2; - * tapi_response_cb callback; - * void *user_data; - * - * ret_status = tel_swap_call(handle, CallHandle1, CallHandle2, callback, user_data); // swap call - * @endcode - * - * @see None. - * - * @remarks - * - None - * - * - */ - int tel_swap_call(TapiHandle *handle, unsigned int CallHandle1, unsigned int CallHandle2, tapi_response_cb callback, void *user_data); - - /** - * - * @brief This function sends one or more DTMF digits during the call. - * - * @par Notes: - * DTMF is abbreviation of Dual-tone-multi-frequency. It is used for telecommunication signaling - * over telephone lines in the voice-frequency band between UE and other communications devices. - * For example UE send DTMF tone to a server to choose options which the server provides. - * If the UE is not within a call, this function will fail with error code. * - * - * This function makes Dbus method call to Telephony Sever and gets immediate feedback. - * However it just means that the API request has been transfered to the CP successfully. - * The actual operation result is being delivered in the corresponding event asynchronously. - * - * @par Sync (TapiHandle *handle, or) Async: - * This is an Asynchronous API. - * - * @par Important Notes: - * -There will be a single asynchronous notification for all the DTMF digits sent. If the users of this API need an asynchronous - * response for each DTMF digit then User has to call this API multiple times passing each single DTMF digit in pDtmfString. - * - * @warning - * - * @param [in] handle - * - handle from tel_init() - * - * @param[in] pDtmfString - * - A Null terminated DTMF string to be sent from MS. - * - * @param [in] callback - * - To register callback function for result of this function. - * - * @param [in] user_data - * - user data for user specification - * - * @par Async Response Message: - * - The event associated with this request is TAPI_EVENT_CALL_SEND_DTMF_CNF. Asynchronous return status - * is indicated by #TelCallCause_t and call handle is sent in the event data. - * - * @pre - * - Initialize Dbus connection with #tel_init - * - Register caller's application name with #tel_register_app_name - * - Register telephony events to listen - * - A event loop is running to listen events - * - Active call should be present. - * - * @post - * - None. - * - * @return Return Type (TapiHandle *handle, int) \n - * - 0 - indicating that the operation has completed successfully. \n - * - Else it will return failure and error code (TapiHandle *handle, Refer Doxygen doc or #TapiResult_t) - * - * @par Prospective Clients: - * Embedded call application - * - * - * \image html CallDtmf.jpg - * \image latex CallDtmf.jpg - * - * @code - * #include - * - * int ret_status ; - * TapiHandle *handle; - * unsigned int pCallHandle; - * void *user_data; - * char DtmfString[10] = {0, }; - * strcpy(DtmfString, "123456789");//Sample DTMF digits that need to be sent - * ret_status= tel_call_dtmf(handle, DtmfString, callback, user_data); - * @endcode - * - * - * @see None. - * - * @remarks - * - None - * - * - */ - int tel_call_dtmf(TapiHandle *handle, const char *pDtmfString, tapi_response_cb callback, void *user_data); - - /** - * - * @brief This function joins the given two calls (TapiHandle *handle, one call in active conversation state and other call in held state) into conference. - * - * This function makes Dbus method call to Telephony Sever and gets immediate feedback. - * However it just means that the API request has been transfered to the CP successfully. - * The actual operation result is being delivered in the corresponding event asynchronously. - * - * - * @par Sync (TapiHandle *handle, or) Async: - * This is an Asynchronous API. - * - * @par Important Notes: - * - Call handle of an active call or held call will be made as MPTY-id, and the other call handle will join in a conference). - * - * @warning - * - * @param [in] handle - * - handle from tel_init() - * - * @param[in] CallHandle1 - * - The unique handle can be either an active call or held call. - * - * @param[in] CallHandle2 - * - Unique call handle. - * - * @param [in] callback - * - To register callback function for result of this function. - * - * @param [in] user_data - * - user data for user specification - * - * @par Async Response Message: - * - The event associated with this request is TAPI_EVENT_CALL_SETUPCONFERENCE_CNF. Asynchronous return - * status is indicated by #TelCallCause_t and call handle of the MPTY call is sent in the event data. - * - * @pre - * - Initialize Dbus connection with #tel_init - * - Register caller's application name with #tel_register_app_name - * - Register telephony events to listen - * - A event loop is running to listen events - * - 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. - * - * @post - * - None. - * - * @return Return Type (int) \n - * - 0 - indicating that the operation has completed successfully. \n - * - Else it will return failure and error code (TapiHandle *handle, Refer Doxygen doc or #TapiResult_t) - * - * @par Prospective Clients: - * Embedded call application - * - * @see tel_split_call - * - * @code - * #include - * - * int ret_status ; - * TapiHandle *handle - * unsigned int CallHandle1; - * unsigned int CallHandle2; - * tapi_response_cb callback; - * void *user_data; - * int pRequestID=0; - * - * ret_status= tel_join_call(handle, CallHandle1, CallHandle2, callback, user_data); // call join - * @endcode - * - * @remarks - * - None - * - * - * - * - */ - int tel_join_call(TapiHandle *handle, unsigned int CallHandle1, unsigned int CallHandle2, tapi_response_cb callback, void *user_data); - - /** - * - * @brief This function triggers to splits a private call from multiparty call. This API allows creating a private communication - * with one of remote parties in a multiparty session. TAPI client application has to pass the call handle which needs - * to split from the multiparty call. - * - * This function makes Dbus method call to Telephony Sever and gets immediate feedback. - * However it just means that the API request has been transfered to the CP successfully. - * The actual operation result is being delivered in the corresponding event asynchronously. - * - * - * @par Sync (TapiHandle *handle, or) Async: - * This is an Asynchronous API. - * - * @par Important Notes: - * - The list of call handles present in the conference call is retrieved using #tel_get_call_conf_list API - * - * @warning - * - * @param [in] handle - * - handle from tel_init() - * - * @param[in] CallHandle - * - Handle of call to be made private. Call handle referring to the call that is to be split from the conference - * (TapiHandle *handle, call to be made private). - * - * @param [in] callback - * - To register callback function for result of this function. - * - * @param [in] user_data - * - user data for user specification - * - * @par Async Response Message: - * - The event associated with this request is TAPI_EVENT_CALL_SPLITCONFERENCE_CNF. Asynchronous return status - * is indicated by #TelCallCause_t and call handle for the split call is sent in the event data. - * - * @pre - * - Initialize Dbus connection with #tel_init - * - Register caller's application name with #tel_register_app_name - * - Register telephony events to listen - * - A event loop is running to listen events - * - Call should be in multiparty conference call. - * - * @post - * - Split call will be the active call and the conference will be held call. - * - * @return Return Type (int) \n - * - 0 - indicating that the operation has completed successfully. \n - * - Else it will return failure and error code (TapiHandle *handle, Refer Doxygen doc or #TapiResult_t) - * - * @par Prospective Clients: - * Embedded call application - * - * @see tel_join _call - * - * @code - * #include - * - * int ret_status ; - * TapiHandle *handle; - * unsigned int CallHandle; - * tapi_response_cb callback; - * void *user_data; - * - * ret_status= tel_split_call(handle, CallHandle, callback, user_data); // call split - * @endcode - * - * @remarks - * - None - * - * - * - * - */ - int tel_split_call(TapiHandle *handle, unsigned int CallHandle, tapi_response_cb callback, void *user_data); - - /** - * - * @brief Get the current calling line identification number. - * - * This function makes Dbus method call to Telephony Sever and gets immediate feedback. - * However it just means that the API request has been transfered to the CP successfully. - * The actual operation result is being delivered in the corresponding event asynchronously. - * - * @par Notes: - * If the USIM card has multiple number, an user can choose which number he use. - * For example, a line is for private, the other line is for business. - * Using this function, user can get information about which line is currently active. - * - * This API makes Dbus method call to Telephony Sever and gets immediate feedback. - * However it just means that the API request has been transfered to the CP successfully. - * The actual operation result is being delivered in the corresponding event asynchronously. - * - * @par Sync (TapiHandle *handle, or) Async: - * This is an Asynchronous API. - * - * @par Important Notes: - * NONE - * - * @warning - * - * @param [in] handle - * - handle from tel_init() - * - * @param [in] callback - * - To register callback function for result of this function. - * - * @param [in] user_data - * - user data for user specification - * - * @pre - * - Initialize Dbus connection with #tel_init - * - Register caller's application name with #tel_register_app_name - * - Register telephony events to listen - * - A event loop is running to listen events - * - * @post - * - None. - * - * @return Return Type (TapiHandle *handle, int) \n - * - 0 - indicating that the operation has completed successfully. \n - * - Else it will return failure and error code (TapiHandle *handle, Refer Doxygen doc or #TapiResult_t) - * - * @par Prospective Clients: - * Embedded call application - * - * @see tel_set_call_act_line - * - * @code - * #include - * - * TapiHandle *handle; - * tapi_response_cb callback; - * void *user_data; - * ret_status= tel_get_call_act_line(handle, callback, user_data); // get call active line - * @endcode - * - * @remarks - * - None - * - * - */ - int tel_get_call_act_line(TapiHandle *handle, tapi_response_cb callback, void *user_data); - - /** - * - * @brief Set the current calling line identification number. - * - * This function makes Dbus method call to Telephony Sever and gets immediate feedback. - * However it just means that the API request has been transfered to the CP successfully. - * The actual operation result is being delivered in the corresponding event asynchronously. - * - * - * @par Sync (TapiHandle *handle, or) Async: - * This is an Asynchronous API. - * - * @par Important Notes: - * NONE - * - * @warning - * - * @param [in] handle - * - handle from tel_init() - * - * @param[in] active_line - * - calling line identification - * - * @param [in] callback - * - To register callback function for result of this function. - * - * @param [in] user_data - * - user data for user specification - * - * @pre - * - Initialize Dbus connection with #tel_init - * - Register caller's application name with #tel_register_app_name - * - Register telephony events to listen - * - A event loop is running to listen events - * - * @post - * - None. - * - * @return Return Type (TapiHandle *handle, int) \n - * - 0 - indicating that the operation has completed successfully. \n - * - Else it will return failure and error code (TapiHandle *handle, Refer Doxygen doc or #TapiResult_t) - * - * @par Prospective Clients: - * Embedded call application - * - * @see tel_get_call_act_line - * - * @code - * #include - * - * int ret_status ; - * TapiHandle *handle; - * TelCallActiveLine_t active_line ; - * tapi_response_cb callback,; - * void *user_data; - * - * ret_status = tel_set_call_act_line (handle, active_line, callback, user_data); // set call active line - * @endcode - * - * @remarks - * - None - * - * - */ - int tel_set_call_act_line(TapiHandle *handle, TelCallActiveLine_t active_line, tapi_response_cb callback, void *user_data); - - /** - * - * @brief This function triggers to do an explicit call transfer by connecting the two parties where in one party being - * active (TapiHandle *handle, active state) and another party being held (TapiHandle *handle, held state). - * - * This function makes Dbus method call to Telephony Sever and gets immediate feedback. - * However it just means that the API request has been transfered to the CP successfully. - * The actual operation result is being delivered in the corresponding event asynchronously. - * - * @par Notes: - * The ECT supplementary service enables the served mobile subscriber (TapiHandle *handle, subscriber A) who has two calls, - * each of which can be an incoming or outgoing call, to connect the other parties in the two calls - * and release the served mobile subscribers own connection. - * Prior to transfer, the connection shall have been established on the call - * between subscriber A and subscriber B. On the call between subscriber A and subscriber C, - * either the connection shall have been established prior to transfer, or, as a network option, - * transfer can occur while subscriber C is being informed of the call - * (TapiHandle *handle, i.e. the connection has not yet been established.) - * - * - * @par Sync (TapiHandle *handle, or) Async: - * This is an Asynchronous API. - * - * @par Important Notes: - * - None. - * - * @warning - * - * @param [in] handle - * - handle from tel_init() - * - * @param[in] CallHandle - * - Call handle of an active call. - * - * @param [in] callback - * - To register callback function for result of this function. - * - * @param [in] user_data - * - user data for user specification - * - * @par Async Response Message: - * - The event associated with this request is TAPI_EVENT_CALL_TRANSFER_CNF. Asynchronous return status is - * indicated by #TelCallCause_t and call handle is sent in the event data. Call handle in event data is active - * call handle which is used in the #tel_exe_call_explicit_transfer request. - * - * @pre - * - In order to call transfer, Served mobile subscriber should have 2 calls in one in active state and another one Call - * in Held state. - * - * @post - * - When the request has been completed successfully, Call end indication will be sent to both the calls (TapiHandle *handle, active and held). - * - * @return Return Type (int) \n - * - 0 - indicating that the operation has completed successfully. \n - * - Else it will return failure and error code (TapiHandle *handle, Refer Doxygen doc or #TapiResult_t) - * - * @par Prospective Clients: - * Embedded call application - * - * @see None. - * - * @code - * #include - * - * int ret_status ; - * TapiHandle *handle; - * unsigned int pCallHandle;//active call - * tapi_response_cb callback; - * void *user_data; - * - * ret_status= tel_transfer_call (handle, pCallHandle, callback, user_data); // explicit transfer - * @endcode - * - * @remarks - * -None - * - * - */ - int tel_transfer_call(TapiHandle *handle, unsigned int CallHandle, tapi_response_cb callback, void *user_data); - - -/** - * - * @brief This function gets status for the current call identified by Call Handle whenever application wants the call status. Call handle must be valid. - * - * This function makes Dbus method call to Telephony Sever and gets immediate feedback. - * However it just means that the API request has been transfered to the CP successfully. - * The actual operation result is being delivered in the corresponding event asynchronously. - * - * - * @par Sync (TapiHandle *handle, or) Async: - * This is a Synchronous API. - * - * @par Important Notes: - * - None. - * - * @warning - * - * @param [in] handle - * - handle from tel_init() - * - * @param[in] CallHandle - * - Unique handle for referring the call. - * - * @param [out] pCallStatus - * - Call status information like destination number, call direction (TapiHandle *handle, MO or MT), call type (TapiHandle *handle, voice or data etc), whether - * the call is in conference state or not, present call state etc are returned through this parameter. - * - * @par Async Response Message: - * - None. - * - * @pre - * - Initialize Dbus connection with #tel_init - * - Register caller's application name with #tel_register_app_name - * - Register telephony events to listen - * - A event loop is running to listen events - * - * @post - * - None. - * - * @return Return Type (TapiHandle *handle, int) \n - * - 0 - indicating that the operation has completed successfully. \n - * - Else it will return failure and error code (TapiHandle *handle, Refer Doxygen doc or #TapiResult_t) - * - * @par Prospective Clients: - * Embedded call application - * - * - * - * - * @code - * #include - * - * int ret_status ; - * int call_id; - * TapiHandle *handle; - * TelCallStatus_t *out; // allocate memory - * - * ret_status= tel_get_call_status(handle, call_id, out); // get call status info - * @endcode - * - * - * @see None. - * - * @remarks - * - None - * - * - */ -int tel_get_call_status(TapiHandle *handle, int call_id, TelCallStatus_t *out ); - - -int tel_get_call_status_all(TapiHandle *handle, TelCallStatusCallback cb, void *user_data) ; - - - /** - * - * @brief This function gets duration of the given call. This is a synchronous function. Duration is accounted from the moment - * the connection is established, i.e. call goes into active state for first time. - * - * This function makes Dbus method call to Telephony Sever and gets immediate feedback. - * However it just means that the API request has been transfered to the CP successfully. - * The actual operation result is being delivered in the corresponding event asynchronously. - * - * - * @par Sync (TapiHandle *handle, or) Async: - * This is a Synchronous API. - * - * @par Important Notes: - * - None. - * - * @warning - * - * @param [in] handle - * - handle from tel_init() - * - * @param[in] CallHandle - * - Unique handle for referring the call. - * - * @param [out] pDurationInSecs - * - The total call duration in seconds from the call connecting time to the present time is returned through this parameter. - * - * @par Async Response Message: - * - None. - * - * @pre - * - Initialize Dbus connection with #tel_init - * - Register caller's application name with #tel_register_app_name - * - Register telephony events to listen - * - A event loop is running to listen events - * - * @post - * - None. - * - * @return Return Type (TapiHandle *handle, int) \n - * - TAPI_API_SUCCESS - indicating that the operation has completed successfully. \n - * - Else it will return failure and error code (TapiHandle *handle, Refer #TapiResult_t) - * - * @par Prospective Clients: - * Embedded call application - * - * - * @code - * #include - * - * int ret_status ; - * TapiHandle *handle - * unsigned int CallHandle; - * unsigned int * pDurationInSecs; // allocate memory - * - * ret_status= tel_get_call_duration(handle, CallHandle, pDurationInSecs); // get call duration - * @endcode - * - * - * @see None. - * - * @remarks - * - None - * - * - */ - int tel_get_call_duration(TapiHandle *handle, unsigned int CallHandle, unsigned int * pDurationInSecs) ; - - /** - *@brief Deflect the incoming call to other subscriber - * - * If informed about an incoming call this call may be redirected to an another destination by - * entering the destination Number. The cleint spcifies the dstiantion number to which the current - * incoming call needs to be redirected is specifed via info argument. - * - * - * @par Sync (TapiHandle *handle, or) Async: - * This is an Asynchronous API. - * - * @par Important Notes: - * - None. - * - * @warning - * - * @param [in] handle - * - handle from tel_init() - * - * @param[in] CallHandle - * - This is incoming call handle - * - * @param[out] deflect_info - * - Destination Number - * - * @param [in] callback - * - To register callback function for result of this function. - * - * @param [in] user_data - * - user data for user specification - * - * @par Async Response Message: - * - - * - * @pre - * - Initialize Dbus connection with #tel_init - * - Register caller's application name with #tel_register_app_name - * - Register telephony events to listen - * - A event loop is running to listen events - * - * @post - * - None. - * - * @return Return Type (int) \n - * - 0 indicating that the operation has completed successfully. \n - * - Else it will return failure and error code (TapiHandle *handle, Refer Doxygen doc or #TapiResult_t) - * - * @par Prospective Clients: - * Embedded call application - * - * @remarks - * - None - * - * @code - * #include - * #include - * - * TapiHandle *handle; - * unsigned int CallHandle; - * const TelCallDeflectDstInfo_t *deflect_info; //allocate memory - * tapi_response_cb callback; - * void *user_data; - * - * tel_deflect_call(handle, CallHandle, deflect_info, callback, user_data); // call deflect - * - * @endcode - * - * @see None. - * - * @remarks - * - None - * - */ - int tel_deflect_call(TapiHandle *handle, unsigned int CallHandle, const TelCallDeflectDstInfo_t *deflect_info, tapi_response_cb callback, void *user_data); - - - /** - * - * @brief Activate Call Completion to a Busy Subscriber. - * - * @par Notes: - * When subscriber A encounters a Network Determined User Busy (TapiHandle *handle, NDUB) destination B, - * subscriber A can request the CCBS supplementary service (TapiHandle *handle, i.e. activate a CCBS Request against destination B). - * The network will then monitor the wanted destination B for becoming idle. - * When the wanted destination B becomes idle, then the network will wait a short time - * in order to allow destination B to make an outgoing call. - * If destination B does not make any outgoing call within this time, - * then the network shall automatically recall subscriber A. - * When subscriber A accepts the CCBS recall, within a defined time, then the network will automatically - * generate a CCBS call to destination B. - * - * This function makes Dbus method call to Telephony Sever and gets immediate feedback. - * However it just means that the API request has been transfered to the CP successfully. - * The actual operation result is being delivered in the corresponding event asynchronously. - * - * @par Sync (TapiHandle *handle, or) Async: - * This is an Asynchronous API. - * - * @par Important Notes: - * - None. - * - * @warning - * - * @param [in] handle - * - handle from tel_init() - * - * @param [in] CallHandle - * - Handle of the call. - * - * @param [in] callback - * - To register callback function for result of this function. - * - * @param [in] user_data - * - user data for user specification - * - * @par Async Response Message: - * - - * - * @pre - * - Initialize Dbus connection with #tel_init - * - Register caller's application name with #tel_register_app_name - * - Register telephony events to listen - * - A event loop is running to listen events - * - * @post - * - None. - * - * @return Return Type ( int) \n - * - 0 - indicating that the operation has completed successfully. \n - * - Else it will return failure and error code (TapiHandle *handle, Refer Doxygen doc or #TapiResult_t) - * - * @par Prospective Clients: - * Embedded call application - * - * @code - * #include - * - * int ret; - * TapiHandle *handle; - * unsigned int call_handle; - * tapi_response_cb callback; - * void *user_data; - * int req_id; - * - * ret = tel_activate_call_ccbs(handle, call_handle, callback, user_data); // ccbs activate - * @endcode - * - * - * @see None. - * - * @remarks - * - None - * - */ - int tel_activate_call_ccbs(TapiHandle *handle, unsigned int CallHandle, tapi_response_cb callback, void *user_data); - - - /** - * @brief This is a synchronous function returns all call handles within the given conference call. - * - * This function makes Dbus method call to Telephony Sever and gets immediate feedback. - * However it just means that the API request has been transfered to the CP successfully. - * The actual operation result is being delivered in the corresponding event asynchronously. - * - * @par Sync (TapiHandle *handle, or) Async: - * This is a Synchronous API. - * - * @par Important Notes: - * - Call should be a Multi-party conference call in order to return actual no of calls and call handles in the conference calls. - * - * @warning - * - * @param [in] handle - * - handle from tel_init() - * - * @param[in] CallHandle - * - Handle of call which is associated with the conference. - * - * @param [out] pCallList - * - list of call joined in the conference call. In case there is no active conference. The list will be zero and - * number of calls parameter value will also be zero. Maximum number of calls in a conference can be up to 5 - * (TapiHandle *handle, Based on 3GPP TS 22.084). Memory allocation for call list is integer array of size 5. - * - * @param [out] pNoOfCalls - * - Number of the calls present in conference. - * - * @par Async Response Message: - * -None. - * - * @pre - * - Initialize Dbus connection with #tel_init - * - Register caller's application name with #tel_register_app_name - * - Register telephony events to listen - * - A event loop is running to listen events - * - * @post - * -None. - * - * @return Return Type (int) \n - * - 0 - indicating that the operation has completed successfully. \n - * - Else it will return failure and error code (TapiHandle *handle, Refer Doxygen doc or #TapiResult_t) - * - * @par Prospective Clients: - * Embedded call application - * - * @code - * #include - * - * int ret_status ; - * TapiHandle *handle; - * unsigned int CallHandle; - * unsigned int pcallList[5]; - * tapi_response_cb callback; - * int noOfCalls; - * void *user_data; - * - * ret_status= tel_get_call_conf_list(handle, CallHandle, pcallList, &noOfCalls); // get conference call list - * @endcode - * - * @see tel_join_call - * - * @remarks - * - None - * - * - */ -int tel_get_call_conf_list(TapiHandle *handle, unsigned int CallHandle, unsigned int *pCallList, int *pNoOfCalls); - - - /** - * - * @brief This function gets voice privacy option mode in phone(TapiHandle *handle, CDMA only). - * - * This function makes Dbus method call to Telephony Sever and gets immediate feedback. - * However it just means that the API request has been transfered to the CP successfully. - * The actual operation result is being delivered in the corresponding event asynchronously. - * - * @par Sync (TapiHandle *handle, or) Async: - * This is a Asynchronous API. - * - * @par Important Notes: - * - None. - * - * @warning - * - * @param [in] handle - * - handle from tel_init() - * - * @param[in] PrivacyType - * - Privacy Type. - * - * @param [in] callback - * - To register callback function for result of this function. - * - * @param [in] user_data - * - user data for user specification - * - * @par Async Response Message: - * - The event associated with this request is TAPI_EVENT_CALL_GET_PRIVACYMODE_CNF. Asynchronous return status - * is indicated by #TelCallCause_t. #TelCallPrivacyMode_t is included in this event. - * - * - * @pre - * - Initialize Dbus connection with #tel_init - * - Register caller's application name with #tel_register_app_name - * - Register telephony events to listen - * - A event loop is running to listen events - * - * @post - * - None. - * - * @return Return Type (int) \n - * - 0 - indicating that the operation has completed successfully. \n - * - Else it will return failure and error code (TapiHandle *handle, Refer Doxygen doc or #TapiResult_t) - * - * @par Prospective Clients: - * Embedded call application - * - * - * - * @code - * #include - * - * int ret_status = -1; - * TapiHandle *handle; - * TelCallPrivacyType_t privacyType; - * tapi_response_cb callback; - * void *user_data; - * privacyType=TAPI_CALL_PRIVACY_TYPE_MS; - * ret_status =tel_get_call_privacy_mode (handle, privacyType, callback, user_data); // get call privacy_mode - * @endcode - * - * - * @see None. - * - * @remarks - * - None - * - * - */ - int tel_get_call_privacy_mode(TapiHandle *handle, TelCallPrivacyType_t PrivacyType, tapi_response_cb callback, void *user_data); - - - /** - * - * @brief This function sets voice privacy option mode in phone. It is available only where call exists(TapiHandle *handle, CDMA only). - * - * - * This function makes Dbus method call to Telephony Sever and gets immediate feedback. - * However it just means that the API request has been transfered to the CP successfully. - * The actual operation result is being delivered in the corresponding event asynchronously. - * - * @par Sync (TapiHandle *handle, or) Async: - * This is a Asynchronous API. - * - * @par Important Notes: - * - None. - * - * @warning - * - * @param [in] handle - * - handle from tel_init() - * - * @param[in] PrivacyInfo - * - voice privacy option mode(TapiHandle *handle, ENHANCED or STANDARD) - * - * @param [in] callback - * - To register callback function for result of this function. - * - * @param [in] user_data - * - user data for user specification - * - * @par Async Response Message: - * - The event associated with this request is TAPI_EVENT_CALL_SET_PRIVACYMODE_CNF. Asynchronous return status - * is indicated by #TelCallCause_t. - * - * - * @pre - * - Initialize Dbus connection with #tel_init - * - Register caller's application name with #tel_register_app_name - * - Register telephony events to listen - * - A event loop is running to listen events - * - * @post - * - None. - * - * @return Return Type (int) \n - * - 0 - indicating that the operation has completed successfully. \n - * - Else it will return failure and error code (TapiHandle *handle, Refer Doxygen doc or #TapiResult_t) - * - * @par Prospective Clients: - * Embedded call application - * - * - * - * @code - * #include - * - * TapiHandle *handle; - * int ret_status = -1; - * tapi_response_cb callback; - * void *user_data; - * TelCallPrivacyMode_t pPrivacyMode_info={0,}; - * pPrivacyMode_info = TAPI_CALL_PRIVACY_MODE_STANDARD; - * - * ret_status = tel_set_call_privacy_mode (handle, pPrivacyMode_info, callback, user_data); // set call privacy mode - * @endcode - * - * @see None. - * - * @remarks - * - None - * - * - */ - int tel_set_call_privacy_mode(TapiHandle *handle, TelCallVoicePrivacyInfo_t PrivacyInfo, tapi_response_cb callback, void *user_data); - - -/** - * - * @brief This function requests to send a Flash with Information Message(TapiHandle *handle, CDMA only). - * - * This function makes Dbus method call to Telephony Sever and gets immediate feedback. - * However it just means that the API request has been transfered to the CP successfully. - * The actual operation result is being delivered in the corresponding event asynchronously. - * - * - * @par Sync (TapiHandle *handle, or) Async: - * This is a Asynchronous API. - * - * @warning - * - * @par Important Notes: - * - None. - * - * @param [in] handle - * - handle from tel_init() - * - * @param[in] pDialNumber - * - this is the calling number for 3 way call. But in the call waiting, this param should be NULL. - * - * @param [in] callback - * - To register callback function for result of this function. - * - * @param [in] user_data - * - user data for user specification - * - * @par Async Response Message: - * - The event associated with this request is TAPI_EVENT_CALL_FLASHINFO_CNF. Asynchronous return status - * is indicated by #TelCallCause_t. - * - * - * @pre - * - None. - * - * @post - * - None. - * - * @return Return Type (int) \n - * - 0 - indicating that the operation has completed successfully. \n - * - Else it will return failure and error code (TapiHandle *handle, Refer Doxygen doc or #TapiResult_t) - * - * @par Prospective Clients: - * Embedded call application - * - * @code - * #include - * - * int ret_status = -1; - * TapiHandle *handle; - * tapi_response_cb callback; - * void *user_data; - * char const * const pDialNumber = "9999900000"; - * ret_status = tel_exe_call_flash_info(handle, pDialNumber, callback, user_data); // call flash info - * @endcode - * - * @see None. - * - * @remarks - * - None - * - * - */ - int tel_exe_call_flash_info(TapiHandle *handle, const char *pDialNumber, tapi_response_cb callback, void *user_data); - - -/** - * - * @brief This function requests to exit emergency call mode(TapiHandle *handle, CDMA only). - * - * This function makes Dbus method call to Telephony Sever and gets immediate feedback. - * However it just means that the API request has been transfered to the CP successfully. - * The actual operation result is being delivered in the corresponding event asynchronously. - * - * @par Sync (TapiHandle *handle, or) Async: - * This is a Asynchronous API. - * - * @warning - * - * @par Important Notes: - * - None. - * - * @param [in] handle - * - handle from tel_init() - * - * @param [in] callback - * - To register callback function for result of this function. - * - * @param [in] user_data - * - user data for user specification - * - * @par Async Response Message: - * - The event associated with this request is TAPI_EVENT_CALL_EXIT_EMERGENCYMODE_CNF. Asynchronous return status - * is indicated by #TelCallCause_t. - * - * @pre - * - current state is emergency callback mode. - * - * @post - * - None. - * - * @return Return Type (int) \n - * - 0 - indicating that the operation has completed successfully. \n - * - Else it will return failure and error code (TapiHandle *handle, Refer Doxygen doc or #TapiResult_t) - * - * @par Prospective Clients: - * Embedded call application - * - * @code - * #include - * - * tapi_response_cb callback; - * int ret; - * TapiHandle *handle; - * void *user_data; - * ret = tel_exit_call_emergency_mode (handle, callback, user_data); // emergency call - * - * @endcode - * - * @see None. - * - * @remarks - * - None - * - * - */ - int tel_exit_call_emergency_mode(TapiHandle *handle, tapi_response_cb callback, void *user_data); - - -/** - * - * @brief This function is used for querying the information about a call time and call count. - * - * This function makes Dbus method call to Telephony Sever and returns immediate value. - * However it just means that the API request has been transfered to the CP successfully. - * The actual operation result is being delivered in the corresponding event asynchronously. - * - * @par Sync (TapiHandle *handle, or) Async: - * This is a Asynchronous API. - * - * @warning - * - * @par Important Notes: - * - None. - * - * @param [in] handle - * - handle from tel_init() - * - * @param[in] req_mask - * - call time request type mask. - * - * @param [in] callback - * - To register callback function for result of this function. - * - * @param [in] user_data - * - user data for user specification - * - * - * @par Async Response Message: - * - The event associated with this request is TAPI_EVENT_CALL_GET_CALL_TIME_CNF. Asynchronous return status - * is indicated by #TelCallCause_t. - * - * - * @pre - * - None. - * - * @post - * - None. - * - * @return Return Type (int) \n - * - 0 - indicating that the operation has completed successfully. \n - * - Else it will return failure and error code (TapiHandle *handle, Refer Doxygen doc or #TapiResult_t) - * - * @par Prospective Clients: - * Embedded call application - * - * @code - * #include - * - * int ret_status = -1; - * TapiHandle *handle; - * tapi_response_cb callback; - * void *user_data; - * TelCallTimeMaskType_t mask_byte1 = {0,}; - * TelCallTimeMaskType_t mask_byte2 = {0,}; - * unsigned short mask_type; - * mask_byte1 = TAPI_CALL_TIME_TYPE_TOTAL_CALL_CNT; //masking call type - * mask_byte2 = TAPI_CALL_TIME_TYPE_TOTAL_CALL_TIME; - * - * mask_type = mask_byte1; - * mask_type << 8; - * mask_type = mask_byte2; - * - * ret_status = tel_get_call_time(handle, mask_type, callback, user_data); - * - * @endcode - * - * @see None. - * - * @remarks - * - None - * - * - */ - int tel_get_call_time(TapiHandle *handle, unsigned short req_mask, tapi_response_cb callback, void *user_data); - - /** - * - * @brief This function is to get call volume. - * - * This function makes Dbus method call to Telephony Sever and returns immediate value. - * However it just means that the API request has been transfered to the CP successfully. - * The actual operation result is being delivered in the corresponding event asynchronously. - * - * @par Sync (TapiHandle *handle, or) Async: - * This is a Asynchronous API. - * - * @warning - * - * @par Important Notes: - * - None. - * - * @param [in] handle - * - handle from tel_init() - * - * @param [in] device - * - sound device - * - * @param [in] type - * - sound type - * - * @param [in] callback - * - To register callback function for result of this function. - * - * @param [in] user_data - * - user data for user specification - * - * @par Async Response Message: - * - TelCallGetVolumeInfoResp_t - * - * @pre - * - None. - * - * @post - * - None. - * - * @return Return Type (int) \n - * - 0 - indicating that the operation has completed successfully. \n - * - Else it will return failure and error code (TapiHandle *handle, Refer Doxygen doc or #TapiResult_t) - * - * @par Prospective Clients: - * Embedded call application - * - * @see None. - * - * @remarks - * - None - * - * - */ - - int tel_get_call_volume_info(TapiHandle *handle, TelSoundDevice_t device, TelSoundType_t type, tapi_response_cb callback, void *user_data ); - -/** - * - * @brief This function is to set call volume. - * - * This function makes Dbus method call to Telephony Sever and returns immediate value. - * However it just means that the API request has been transfered to the CP successfully. - * The actual operation result is being delivered in the corresponding event asynchronously. - * - * @par Sync (TapiHandle *handle, or) Async: - * This is a Asynchronous API. - * - * @warning - * - * @par Important Notes: - * - None. - * - * @param [in] handle - * - handle from tel_init() - * - * @param [in] path - * - call volume information - * - * @param [in] callback - * - To register callback function for result of this function. - * - * @param [in] user_data - * - user data for user specification - * - * @par Async Response Message: - * - None. - * - * @pre - * - None. - * - * @post - * - None. - * - * @return Return Type (TapiHandle *handle, int) \n - * - 0 - indicating that the operation has completed successfully. \n - * - Else it will return failure and error code (TapiHandle *handle, Refer Doxygen doc or #TapiResult_t) - * - * @par Prospective Clients: - * Embedded call application - * - * @see None. - * - * @remarks - * - None - * - * - */ - -int tel_set_call_volume_info(TapiHandle *handle, TelCallVolumeInfo_t *info, tapi_response_cb callback, void *user_data ); - -/** - * - * @brief This function is to set call sound path. - * - * This function makes Dbus method call to Telephony Sever and returns immediate value. - * However it just means that the API request has been transfered to the CP successfully. - * The actual operation result is being delivered in the corresponding event asynchronously. - * - * @par Sync (TapiHandle *handle, or) Async: - * This is a Asynchronous API. - * - * @par Important Notes: - * - None. - * - * - * @warning - * - * @param [in] handle - * - handle from tel_init() - * - * @param [in] path - * - call sound path information - * - * @param [in] callback - * - To register callback function for result of this function. - * - * @param [in] user_data - * - user data for user specification - * - * @par Async Response Message: - * - None. - * - * @pre - * - None. - * - * @post - * - None. - * - * @return Return Type (TapiHandle *handle, int) \n - * - 0 - indicating that the operation has completed successfully. \n - * - Else it will return failure and error code (TapiHandle *handle, Refer Doxygen doc or #TapiResult_t) - * - * @par Prospective Clients: - * Embedded call application - * - * @see None. - * - * @remarks - * - None - * - * - */ - -int tel_set_call_sound_path(TapiHandle *handle, TelCallSoundPathInfo_t *path, tapi_response_cb callback, void *user_data ); - -/** - * - * @brief This function is to set call mute state - * - * This function makes Dbus method call to Telephony Sever and returns immediate value. - * However it just means that the API request has been transfered to the CP successfully. - * The actual operation result is being delivered in the corresponding event asynchronously. - * - * @par Sync (TapiHandle *handle, or) Async: - * This is a Asynchronous API. - * - * - * @warning - * - * @par Important Notes: - * - None. - * - * @param [in] handle - * - handle from tel_init() - * - * @param [in] mute - * - Sound Mute Status - * - * @param [in] callback - * - To register callback function for result of this function. - * - * @param [in] user_data - * - user data for user specification - * - * @par Async Response Message: - * - None. - * - * @pre - * - None. - * - * @post - * - None. - * - * @return Return Type (TapiHandle *handle, int) \n - * - 0 - indicating that the operation has completed successfully. \n - * - Else it will return failure and error code (TapiHandle *handle, Refer Doxygen doc or #TapiResult_t) - * - * @par Prospective Clients: - * Embedded call application - * - * @see None. - * - * @remarks - * - None - * - * - */ - -int tel_set_call_mute_status(TapiHandle *handle, TelSoundMuteStatus_t mute, TelSoundMutePath_t path, tapi_response_cb callback, void *user_data ); - -/** - * - * @brief This function is to get call mute state - * - * This function makes Dbus method call to Telephony Sever and returns immediate value. - * However it just means that the API request has been transfered to the CP successfully. - * The actual operation result is being delivered in the corresponding event asynchronously. - * - * @par Sync (TapiHandle *handle, or) Async: - * This is a Asynchronous API. - * - * @warning - * - * @par Important Notes: - * - None. - * - * @param [in] handle - * - handle from tel_init() - * - * @param [in] callback - * - To register callback function for result of this function. - * - * @param [in] user_data - * - user data for user specification - * - * @par Async Response Message: - * - TelCallGetMuteStatusResp_t - * - * @pre - * - None. - * - * @post - * - None. - * - * @return Return Type (TapiHandle *handle, int) \n - * - 0 - indicating that the operation has completed successfully. \n - * - Else it will return failure and error code (TapiHandle *handle, Refer Doxygen doc or #TapiResult_t) - * - * @par Prospective Clients: - * Embedded call application - * - * @see None. - * - * @remarks - * - None - * - * - */ - -int tel_get_call_mute_status(TapiHandle *handle, tapi_response_cb callback, void *user_data ); - -/** - * - * @brief This function is to set call sound recording - * - * This function makes Dbus method call to Telephony Sever and returns immediate value. - * However it just means that the API request has been transfered to the CP successfully. - * The actual operation result is being delivered in the corresponding event asynchronously. - * - * @par Sync (TapiHandle *handle, or) Async: - * This is a Asynchronous API. -* - * @warning - * - * @par Important Notes: - * - None. - - * @param [in] handle - * - handle from tel_init() - * - * @param [in] on - * - Sound recording on / off - * - * @param [in] callback - * - To register callback function for result of this function. - * - * @param [in] user_data - * - user data for user specification - * - * @par Async Response Message: - * - None. - * - * @pre - * - None. - * - * @post - * - None. - * - * @return Return Type (TapiHandle *handle, int) \n - * - 0 - indicating that the operation has completed successfully. \n - * - Else it will return failure and error code (TapiHandle *handle, Refer Doxygen doc or #TapiResult_t) - * - * @par Prospective Clients: - * Embedded call application - * - * @see None. - * - * @remarks - * - None - * - * - */ - -int tel_set_call_sound_recording(TapiHandle *handle, TelSoundRecording_t *on, tapi_response_cb callback, void *user_data); - -/** - * - * @brief This function is to set call sound equalization. - * - * This function makes Dbus method call to Telephony Sever and returns immediate value. - * However it just means that the API request has been transfered to the CP successfully. - * The actual operation result is being delivered in the corresponding event asynchronously. - * - * @par Sync (TapiHandle *handle, or) Async: - * This is a Asynchronous API. - * - * @par Important Notes: - * - None. - * - * - * @warning - * - * @param [in] handle - * - handle from tel_init() - * - * @param [in] eq - * - call sound equalization information - * - * @param [in] callback - * - To register callback function for result of this function. - * - * @param [in] user_data - * - user data for user specification - * - * @par Async Response Message: - * - None. - * - * @pre - * - None. - * - * @post - * - None. - * - * @return Return Type (TapiHandle *handle, int) \n - * - 0 - indicating that the operation has completed successfully. \n - * - Else it will return failure and error code (TapiHandle *handle, Refer Doxygen doc or #TapiResult_t) - * - * @par Prospective Clients: - * Embedded call application - * - * @see None. - * - * @remarks - * - None - * - * - */ - -int tel_set_call_sound_equalization(TapiHandle *handle, TelCallSoundEqualization_t *eq, tapi_response_cb callback, void *user_data); - - /** - * - * @brief This function is used for querying the set call sound reduction. - * - * This function makes Dbus method call to Telephony Sever and returns immediate value. - * However it just means that the API request has been transfered to the CP successfully. - * The actual operation result is being delivered in the corresponding event asynchronously. - * - * @par Sync (TapiHandle *handle, or) Async: - * This is a Asynchronous API. - * - * @par Important Notes: - * - None. - * - * - * @warning - * - * @param [in] handle - * - handle from tel_init() - * - * @param [in] noise - * - - * - * @param [in] callback - * - To register callback function for result of this function. - * - * @param [in] user_data - * - user data for user specification - * - * - * @par Async Response Message: - * - None. - * - * @pre - * - None. - * - * @post - * - None. - * - * @return Return Type (TapiHandle *handle, int) \n - * - 0 - indicating that the operation has completed successfully. \n - * - Else it will return failure and error code (TapiHandle *handle, Refer Doxygen doc or #TapiResult_t) - * - * @par Prospective Clients: - * Embedded call application - * - * @code - * - * @endcode - * - * @see None. - * - * @remarks - * - None - * - * - */ - - int tel_set_call_sound_noise_reduction(TapiHandle *handle, TelSoundNoiseReduction_t noise, tapi_response_cb callback, void *user_data); - - /** - * - * @brief This function is used to set call sound clock status - * - * This function makes Dbus method call to Telephony Sever and returns immediate value. - * However it just means that the API request has been transfered to the CP successfully. - * The actual operation result is being delivered in the corresponding event asynchronously. - * - * @par Sync (TapiHandle *handle, or) Async: - * This is a Asynchronous API. - * - * @par Important Notes: - * - None. - * - * @warning - * - * @param [in] handle - * - handle from tel_init() - * - * @param [in] enable - * - sound clock status ( TRUE : enable, FALSE : disable ) - * - * @param [in] callback - * - To register callback function for result of this function. - * - * @param [in] user_data - * - user data for user specification - * - * - * @par Async Response Message: - * - None. - * - * @pre - * - None. - * - * @post - * - None. - * - * @return Return Type (TapiHandle *handle, int) \n - * - 0 - indicating that the operation has completed successfully. \n - * - Else it will return failure and error code (TapiHandle *handle, Refer Doxygen doc or #TapiResult_t) - * - * @par Prospective Clients: - * Embedded call application - * - * @code - * - * @endcode - * - * @see None. - * - * @remarks - * - None - * - * - */ - - int tel_set_call_sound_clock_status(TapiHandle *handle, gboolean status, tapi_response_cb callback, void *user_data ); - - -#ifdef __cplusplus -} -#endif - -#endif /* _ITAPI_CALL_H_ */ - - /** -* @} -*/ diff --git a/wearable/include/ITapiGps.h b/wearable/include/ITapiGps.h deleted file mode 100644 index 12e51f7..0000000 --- a/wearable/include/ITapiGps.h +++ /dev/null @@ -1,637 +0,0 @@ -/* - * libslp-tapi - * - * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. - * - * Contact: Ja-young Gu - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT 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 GPS_TAPI GPS - * @{ - * - * @file ITapiGps.h - - @brief This file serves as a "C" header file defines functions for Tapi GPS\n - It contains a sample set of function prototypes that would be required by applications. - * GPS APIs allow an application to accomplish the following services: @n - * - Confirm gps measure position information. @n - */ - - -#ifndef _ITAPI_GPS_H_ -#define _ITAPI_GPS_H_ - -#include -#include -#include -#include - -#ifdef __cplusplus -extern "C" -{ -#endif - -/** - * @brief This function sends the confirmation data for measure position message. - * - * @par Sync (or) Async: - * This is an Synchronous API. - * - * @par Important Notes: - * - None. - * - * @warning - * - None. - * - * @param [in] handle - * - handle from tel_init(). - * - * @param [in] data - * -#user confirmation data for each vender. - * - * @param [in] data_len - * - data length - * - * @pre - * - TAPI_EVENT_GPS_MEASURE_POSITION_IND should be sent to application by Telephony Server. - * - * @post - * - none - * - * @return Return Type (int) \n - * - TAPI_API_SUCCESS - indicating that the operation has completed successfully. \n - * - Refer #TapiResult_t for failure and error code - * - * @par Prospective Clients: - * GPS Deamon - * - * - * @code - * - * int result; - * gps_measure_position_confirm_t data; - * result = tel_confirm_gps_measure_pos(handle, (unsigned char *)&data, sizeof(gps_measure_position_confirm_t)); - * - * - */ -/*================================================================================================*/ -int tel_confirm_gps_measure_pos(TapiHandle *handle, unsigned char *data, unsigned int data_len); - -/** - * @brief This function is invoked to set the gps frequency aiding. - * - * This function makes Dbus method call to Telephony Sever and returns immediate value. - * However it just means that the API request has been transfered to the CP successfully. - * The actual operation result is being delivered in the corresponding event asynchronously. - * - * @par Sync (or) Async: - * This is an Asynchronous API. - * - * @par Important Notes: - * - None. - * - * @warning - * - None. - * - * @param [in] handle - * - handle from tel_init(). - * - * @param [in] state - * - enable / disable state. - * - * @param [in] data_len - * - data length - - * @param [in] callback - * - To register callback function for result. - * - * @param [in] user_data - * - user_data for user specification. - * - * @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 - * - Refer #TapiResult_t for failure and error code - * - * @par Prospective Clients: - * GPS daemon. - * - * @code - * - * unsigned char state = true; - * - * result = tel_set_gps_frequency_aiding(handle, state, on_gps_set_frequency_aiding, NULL); - * - * @endcode - * - * @see - * - None. - * - * @remarks - * - None. - * - * - * - */ -/*================================================================================================*/ - -int tel_set_gps_frequency_aiding(TapiHandle *handle, unsigned char state, tapi_response_cb callback, void *user_data); - -/** - * @brief This function is invoked to enable smart assistant. - * - * This function makes Dbus method call to Telephony Sever and returns immediate value. - * However it just means that the API request has been transfered to the CP successfully. - * The actual operation result is being delivered in the corresponding event asynchronously. - * - * @par Sync (or) Async: - * This is an Asynchronous API. - * - * @par Important Notes: - * - None. - * - * @warning - * - None. - * - * @param [in] handle - * - handle from tel_init(). - * - * @param [in] callback - * - To register callback function for result. - * - * @param [in] user_data - * - user_data for user specification. - * - * @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 - * - Refer #TapiResult_t for failure and error code - * - * @par Prospective Clients: - * Location Manager. - * - * @code - * #include - * TapiHandle *handle; - * tapi_response_cb callback; - * void *user_data; - * - * result = tel_enable_smart_assistant(handle, callback, user_data); - * - * @endcode - * - * @see - * - None. - * - * @remarks - * - None. - * - * - * - */ -/*================================================================================================*/ -int tel_enable_smart_assistant(TapiHandle *handle, tapi_response_cb callback, void* user_data); - -/** - * @brief This function is invoked to disable smart assistant. - * - * This function makes Dbus method call to Telephony Sever and returns immediate value. - * However it just means that the API request has been transfered to the CP successfully. - * The actual operation result is being delivered in the corresponding event asynchronously. - * - * @par Sync (or) Async: - * This is an Asynchronous API. - * - * @par Important Notes: - * - None. - * - * @warning - * - None. - * - * @param [in] handle - * - handle from tel_init(). - * - * @param [in] callback - * - To register callback function for result. - * - * @param [in] user_data - * - user_data for user specification. - * - * @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 - * - Refer #TapiResult_t for failure and error code - * - * @par Prospective Clients: - * Location Manager. - * - * @code - * #include - * TapiHandle *handle; - * tapi_response_cb callback; - * void *user_data; - * - * result = tel_disable_smart_assistant(handle, callback, user_data); - * - * @endcode - * - * @see - * - None. - * - * @remarks - * - None. - * - * - * - */ -/*================================================================================================*/ - -int tel_disable_smart_assistant(TapiHandle *handle, tapi_response_cb callback, void* user_data); - -/** - * @brief This function is invoked to sync smart assistant area list. - * - * This function makes Dbus method call to Telephony Sever and returns immediate value. - * However it just means that the API request has been transfered to the CP successfully. - * The actual operation result is being delivered in the corresponding event asynchronously. - * - * @par Sync (or) Async: - * This is an Asynchronous API. - * - * @par Important Notes: - * - None. - * - * @warning - * - None. - * - * @param [in] handle - * - handle from tel_init(). - * - * @param [in] callback - * - To register callback function for result. - * - * @param [in] user_data - * - user_data for user specification. - * - * @par Async Response Message: - * - None - * - * @pre - * - Smart Assistant should be enabled. - * - * @post - * - None. - * - * @return Return Type (int) \n - * - TAPI_API_SUCCESS - indicating that the operation has completed successfully. \n - * - Refer #TapiResult_t for failure and error code - * - * @par Prospective Clients: - * Location Manager. - * - * @code - * #include - * TapiHandle *handle; - * tapi_response_cb callback; - * void *user_data; - * TelSmartAssistantAreaList_t area_list; - * - * area_list.count = 2; - * area_list.area[0].index = 1; - * area_list.area[0].mode_state = TAPI_SMART_ASSISTANT_MODE_STATE_START; - * area_list.area[1].index = 2; - * area_list.area[1].mode_state = TAPI_SMART_ASSISTANT_MODE_STATE_STOP; - * - * result = tel_sync_smart_assistant_area_list(handle, &area_list, callback, user_data); - * - * @endcode - * - * @see - * - None. - * - * @remarks - * - None. - * - * - * - */ -/*================================================================================================*/ -int tel_sync_smart_assistant_area_list(TapiHandle *handle, TelSmartAssistantAreaList_t *area_list, tapi_response_cb callback, void* user_data); - -/** - * @brief This function is invoked to delete smart assistant area list. - * - * This function makes Dbus method call to Telephony Sever and returns immediate value. - * However it just means that the API request has been transfered to the CP successfully. - * The actual operation result is being delivered in the corresponding event asynchronously. - * - * @par Sync (or) Async: - * This is an Asynchronous API. - * - * @par Important Notes: - * - None. - * - * @warning - * - None. - * - * @param [in] handle - * - handle from tel_init(). - * - * @param [in] callback - * - To register callback function for result. - * - * @param [in] user_data - * - user_data for user specification. - * - * @par Async Response Message: - * - None - * - * @pre - * - Smart Assistant should be enabled. - * - * @post - * - None. - * - * @return Return Type (int) \n - * - TAPI_API_SUCCESS - indicating that the operation has completed successfully. \n - * - Refer #TapiResult_t for failure and error code - * - * @par Prospective Clients: - * Location Manager. - * - * @code - * #include - * TapiHandle *handle; - * tapi_response_cb callback; - * void *user_data; - * TelSmartAssistantAreaList_t area_list; - * - * area_list.count = 2; - * area_list.area[0].index = 1; - * area_list.area[1].index = 2; - * - * result = tel_del_smart_assistant_area_list(handle, &area_list, callback, user_data); - * - * @endcode - * - * @see - * - None. - * - * @remarks - * - None. - * - * - * - */ -/*================================================================================================*/ -int tel_del_smart_assistant_area_list(TapiHandle *handle, TelSmartAssistantAreaList_t *area_list, tapi_response_cb callback, void* user_data); - -/** - * @brief This function is invoked to add smart assistant area. - * - * This function makes Dbus method call to Telephony Sever and returns immediate value. - * However it just means that the API request has been transfered to the CP successfully. - * The actual operation result is being delivered in the corresponding event asynchronously. - * - * @par Sync (or) Async: - * This is an Asynchronous API. - * - * @par Important Notes: - * - None. - * - * @warning - * - None. - * - * @param [in] handle - * - handle from tel_init(). - * - * @param [in] callback - * - To register callback function for result. - * - * @param [in] user_data - * - user_data for user specification. - * - * @par Async Response Message: - * - None - * - * @pre - * - Smart Assistant should be enabled. - * - * @post - * - None. - * - * @return Return Type (int) \n - * - TAPI_API_SUCCESS - indicating that the operation has completed successfully. \n - * - Refer #TapiResult_t for failure and error code - * - * @par Prospective Clients: - * Location Manager. - * - * @code - * #include - * TapiHandle *handle; - * tapi_response_cb callback; - * void *user_data; - * TelSmartAssistantArea_t area; - * - * area.index = 1; - * area.mode_state = TAPI_SMART_ASSISTANT_MODE_STATE_START; - * - * result = tel_add_smart_assistant_area(handle, &area, callback, user_data); - * - * @endcode - * - * @see - * - None. - * - * @remarks - * - None. - * - * - * - */ -/*================================================================================================*/ -int tel_add_smart_assistant_area(TapiHandle *handle, TelSmartAssistantArea_t *area, tapi_response_cb callback, void* user_data); - -/** - * @brief This function is invoked to modify smart assistant area. - * - * This function makes Dbus method call to Telephony Sever and returns immediate value. - * However it just means that the API request has been transfered to the CP successfully. - * The actual operation result is being delivered in the corresponding event asynchronously. - * - * @par Sync (or) Async: - * This is an Asynchronous API. - * - * @par Important Notes: - * - None. - * - * @warning - * - None. - * - * @param [in] handle - * - handle from tel_init(). - * - * @param [in] callback - * - To register callback function for result. - * - * @param [in] user_data - * - user_data for user specification. - * - * @par Async Response Message: - * - None - * - * @pre - * - Smart Assistant should be enabled. - * - * @post - * - None. - * - * @return Return Type (int) \n - * - TAPI_API_SUCCESS - indicating that the operation has completed successfully. \n - * - Refer #TapiResult_t for failure and error code - * - * @par Prospective Clients: - * Location Manager. - * - * @code - * #include - * TapiHandle *handle; - * tapi_response_cb callback; - * void *user_data; - * TelSmartAssistantArea_t area; - * - * area.index = 1; - * area.mode_state = TAPI_SMART_ASSISTANT_MODE_STATE_START; - * - * result = tel_modify_smart_assistant_area(handle, &area, callback, user_data); - * - * @endcode - * - * @see - * - None. - * - * @remarks - * - None. - * - * - * - */ -/*================================================================================================*/ -int tel_modify_smart_assistant_area(TapiHandle *handle, TelSmartAssistantArea_t *area, tapi_response_cb callback, void* user_data); - -/** - * @brief This function is invoked to send smart assistant aiding information to CP. - * - * This function makes Dbus method call to Telephony Sever and returns immediate value. - * However it just means that the API request has been transfered to the CP successfully. - * The actual operation result is being delivered in the corresponding event asynchronously. - * - * @par Sync (or) Async: - * This is an Asynchronous API. - * - * @par Important Notes: - * - None. - * - * @warning - * - None. - * - * @param [in] handle - * - handle from tel_init(). - * - * @param [in] callback - * - To register callback function for result. - * - * @param [in] user_data - * - user_data for user specification. - * - * @par Async Response Message: - * - None - * - * @pre - * - Smart Assistant should be enabled. - * - * @post - * - None. - * - * @return Return Type (int) \n - * - TAPI_API_SUCCESS - indicating that the operation has completed successfully. \n - * - Refer #TapiResult_t for failure and error code - * - * @par Prospective Clients: - * Location Manager. - * - * @code - * #include - * TapiHandle *handle; - * tapi_response_cb callback; - * void *user_data; - * TelSmartAssistantInfo_t info; - * - * info.index = 1; - * info.lpp_state = TAPI_SMART_ASSISTANT_LPP_STATE_START; - * - * result = tel_set_smart_assistant_info(handle, &info, callback, user_data); - * - * @endcode - * - * @see - * - None. - * - * @remarks - * - None. - * - * - * - */ -/*================================================================================================*/ -int tel_set_smart_assistant_info(TapiHandle *handle, TelSmartAssistantInfo_t *info, tapi_response_cb callback, void* user_data); - -#ifdef __cplusplus -} -#endif - -#endif /* _ITAPI_GPS_H_ */ - -/** - * @} - */ diff --git a/wearable/include/ITapiModem.h b/wearable/include/ITapiModem.h deleted file mode 100644 index 29fb106..0000000 --- a/wearable/include/ITapiModem.h +++ /dev/null @@ -1,500 +0,0 @@ -/* - * libslp-tapi - * - * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. - * - * Contact: Ja-young Gu - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT 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 MODEM_TAPI POWER - * @{ - * - * These APIs allow an application to accomplish the following services: @n - * - Process power command @n - * - Reset the phone power (on / off), @n - * - Process airplane mode @n - */ - -#ifndef _ITAPI_MODEM_H_ -#define _ITAPI_MODEM_H_ - -#include -#include -#include -#include -#include "ITapiPS.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * - * @brief This API is used to turn power off or on the modem. - * - * @par Sync (or) Async: - * This is a Synchronous API. - * - * @par Important Notes: - * -NONE - * - * @warning - * - None. - * - * - * @param [in] handle - * - handle from tel_init() - * - * @param [in] cmd - * - This index value is the power command as #tapi_power_phone_cmd_t. - * - * @param [in] callback - * - To register callback function for result of this function. - * - * @param [in] user_data - * - user data for user specification - * - * @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 - * - Otherwise it provides an error code (Refer #TapiResult_t) - * - * @par Prospective Clients: - * External Apps. - * - * - */ -int tel_process_power_command(TapiHandle *handle, tapi_power_phone_cmd_t cmd, tapi_response_cb callback, void *user_data); - -/** - * - * @brief This API is used to enter or leave airplane mode - * - * @par Sync (or) Async: - * This is a Asynchronous API. - * - * @par Important Notes: - * -NONE - * - * @warning - * - None. - * - * - * @param [in] handle - * - handle from tel_init() - * - * @param [in] mode - * - This mode value is the flight flag #tapi_power_flight_mode_type_t. - * - * @param [in] callback - * - To register callback function for result of this function. - * - * @param [in] user_data - * - user data for user specification - * - * @par Async Response Message: - * The event associated is TAPI_EVENT_MODEM_FLIGHT_MODE_RESP and the event data is #tapi_power_flight_mode_resp_type_t. - * Asynchronous return status is always TAPI_API_SUCCESS. - * - * @pre - * - None. - * - * @post - * - None. - * - * @return Return Type (int) \n - * - TAPI_API_SUCCESS - indicating that the operation has completed successfully. \n - * - Otherwise it provides an error code (Refer #TapiResult_t) - * - * @par Prospective Clients: - * External Apps. - * - * - */ -int tel_set_flight_mode(TapiHandle *handle, tapi_power_flight_mode_type_t mode, tapi_response_cb callback, void *user_data); - -int tel_get_flight_mode(TapiHandle *handle, tapi_response_cb callback, void *user_data); - -/** - * - * @brief This function is invoked to Get ME version information. - * - * @par Sync (or) Async: - * This is a synchronous API. - * - * @par Important Notes: - * - None. - * - * @warning - * - None. - * - * @param [in] handle - * - handle from tel_init() - * - * @param [in] callback - * - To register callback function for result of this function. - * - * @param [in] user_data - * - user data for user specification - * - * @par Async Response Message: - * - NA - * - * @pre - * - None. - * - * @post - * - None. - * - * @return Return Type (int) \n - * - Integer '0' ( same with TAPI_API_SUCCESS ) - indicating that the operation has completed successfully. \n - * - Negative integer : it provides an error code (Refer #TapiResult_t) - * - * @par Prospective Clients: - * External Apps. - * - */ -int tel_get_misc_me_version(TapiHandle *handle, tapi_response_cb callback, void *user_data); - -/** - * - * @brief This function is to get misc me version - * - * @par Sync (or) Async: - * This is a Synchronous API. - * - * @par Important Notes: - * - None. - * - * @warning - * - None. - * - * @param [in] handle - * - handle from tel_init() - * - * @par Async Response Message: - * - Na - * - * @pre - * - None. - * - * @post - * - None. - * - * @return Return Type ( TelMiscVersionInformation * ) \n - * - Misc Version Information - * - * @par Prospective Clients: - * External Apps. - * - */ - - -TelMiscVersionInformation *tel_get_misc_me_version_sync(TapiHandle *handle); - - -/** - * - * @brief This function is invoked to Get ME IMEI/ESN/MEID for each phone type. - * - * @par Sync (or) Async: - * This is a synchronous API. - * - * @par Important Notes: - * - None. - * - * @warning - * - None. - * - * @param [in] handle - * - handle from tel_init() - * - * @param [in] callback - * - To register callback function for result of this function. - * - * @param [in] user_data - * - user data for user specification - * - * @par Async Response Message: - * - NA - * - * @pre - * - None. - * - * @post - * - None. - * - * @return Return Type (int) \n - * - Integer '0' ( same with TAPI_API_SUCCESS ) - indicating that the operation has completed successfully. \n - * - Negative integer : it provides an error code (Refer #TapiResult_t) - * - * @par Prospective Clients: - * External Apps. - * - */ -int tel_get_misc_me_sn(TapiHandle *handle, tapi_response_cb callback, void *user_data); - -/** - * - * @brief This function is to get misc me Sereal Number - * - * This function makes Dbus method call to Telephony Sever and returns immediate value. - * However it just means that the API request has been transfered to the CP successfully. - * The actual operation result is being delivered in the corresponding event asynchronously. - * - * @par Sync (TapiHandle *handle, or) Async: - * This is a Synchronous API. - * - * @par Important Notes: - * - None. - * - * @warning - * - * - * @param [in] handle - * - handle from tel_init() - * - * @pre - * - None. - * - * @post - * - None. - * - * @return Return Type (char*) \n - * - Sereal Number string - * - * @par Prospective Clients: - * Embedded call application - * - * @see None. - * - * @remarks - * - None - * - * - */ - -char *tel_get_misc_me_sn_sync(TapiHandle *handle); - -/** - * - * @brief This function is to get misc me imei - * - * @par Sync (or) Async: - * This is a Asynchronous API. - * - * @par Important Notes: - * - None. - * - * @warning - * - None. - * - * @param [in] handle - * - handle from tel_init() - * - * @param [in] callback - * - To register callback function for result of this function. - * - * @param [in] user_data - * - user data for user specification - * - * @par Async Response Message: - * - IMEI - * - * @pre - * - None. - * - * @post - * - None. - * - * @return Return Type (int) \n - * - Integer '0' ( same with TAPI_API_SUCCESS ) - indicating that the operation has completed successfully. \n - * - Negative integer : it provides an error code (Refer #TapiResult_t) - * - * @par Prospective Clients: - * External Apps. - * - */ - -int tel_get_misc_me_imei(TapiHandle *handle, tapi_response_cb callback, void *user_data); - -/** - * - * @brief This function is to get misc me imei - * - * This function makes Dbus method call to Telephony Sever and returns immediate value. - * However it just means that the API request has been transfered to the CP successfully. - * The actual operation result is being delivered in the corresponding event asynchronously. - * - * @par Sync (TapiHandle *handle, or) Async: - * This is a Synchronous API. - * - * @par Important Notes: - * - None. - * - * @warning - * - * - * @param [in] handle - * - handle from tel_init() - * - * - * @pre - * - None. - * - * @post - * - None. - * - * @return Return Type (char*) \n - * - IMEI string - * - * @par Prospective Clients: - * Embedded call application - * - * @see None. - * - * @remarks - * - None - * - * - */ - -char *tel_get_misc_me_imei_sync(TapiHandle *handle); - -/** - * - * @brief This function is to check modem power status - * - * This function makes Dbus method call to Telephony Sever and returns immediate value. - * However it just means that the API request has been transfered to the CP successfully. - * The actual operation result is being delivered in the corresponding event asynchronously. - * - * @par Sync (TapiHandle *handle, or) Async: - * This is a Asynchronous API. - * - * @par Important Notes: - * - None. - * - * @warning - * - * - * @param [in] handle - * - handle from tel_init() - * - * @param [out] result - * - result of checking modem power status. - * - * @par Async Response Message: - * - - * - * @pre - * - None. - * - * @post - * - None. - * - * @return Return Type (TapiHandle *handle, int) \n - * - 0 - indicating that the operation has completed successfully. \n - * - Else it will return failure and error code (TapiHandle *handle, Refer Doxygen doc or #TapiResult_t) - * - * @par Prospective Clients: - * Embedded call application - * - * @see None. - * - * @remarks - * - None - * - * - */ - -int tel_check_modem_power_status(TapiHandle *handle, int *result); - -/** - * - * @brief This function is to control modem dun pin - * - * This function makes Dbus method call to Telephony Sever and returns immediate value. - * However it just means that the API request has been transfered to the CP successfully. - * The actual operation result is being delivered in the corresponding event asynchronously. - * - * @par Sync (TapiHandle *handle, or) Async: - * This is a Asynchronous API. - * - * @par Important Notes: - * - None. - * - * @warning - * - * - * @param [in] handle - * - handle from tel_init() - * - * @param [in] pincontrol - * - pin control inforamation - * - * @param [in] callback - * - To register callback function for result of this function. - * - * @param [in] user_data - * - user data for user specification - * - * @par Async Response Message: - * - None. - * - * @pre - * - None. - * - * @post - * - None. - * - * @return Return Type (TapiHandle *handle, int) \n - * - 0 - indicating that the operation has completed successfully. \n - * - Else it will return failure and error code (TapiHandle *handle, Refer Doxygen doc or #TapiResult_t) - * - * @par Prospective Clients: - * Embedded call application - * - * @see None. - * - * @remarks - * - None - * - * - */ - -int tel_control_modem_dun_pin_ctrl(TapiHandle *handle, tapi_ps_btdun_pincontrol *pincontrol, tapi_response_cb callback, void *user_data); - -#ifdef __cplusplus -} -#endif - -#endif /* _ITAPI_MODEM_H_ */ - -/** - * @} - */ diff --git a/wearable/include/ITapiNetText.h b/wearable/include/ITapiNetText.h deleted file mode 100755 index a9cbca2..0000000 --- a/wearable/include/ITapiNetText.h +++ /dev/null @@ -1,1311 +0,0 @@ -/* - * libslp-tapi - * - * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. - * - * Contact: Ja-young Gu - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT 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 ITapiNettext.h - - @brief This file serves as a "C" header file defines functions for Tapi Nettext\n - It contains a sample set of function prototypes that would be required by applications. - - */ - -#ifndef _ITAPI_NETTEXT_H_ -#define _ITAPI_NETTEXT_H_ - -#include -#include -#include - -#ifdef __cplusplus -extern "C" -{ -#endif - - /** - * @brief This API is used to send an SMS message to the network. This API interface allows transmitting SMS PDU as defined by - * 3GPP TS 23.040 (SMS-SUBMIT, SMS-COMMAND) to lower layers. This API allows keeping the dedicated link at lower layers - * by passing information as more messages to send in parameters. This will enable not to release if a dedicated connection is - * used for transmission. Access to this API is limited to in-house application and we recommend you use Message Framework API(MAPI). - * - * @par Sync (or) Async: - * This is an Asynchronous API. - * - * @par Important Notes: - * - None. - * - * @warning - * - None. - * - * - * @param [in] handle - * - handle from tel_init() - * - * @param [in] pDataPackage - * - Contains SMS-SUBMIT TPDU - * - * @param [in] bMoreMsgToSend - * - will be set to TRUE when there are more than one message to be send or Multiple segmented concatenated - * message to be send, otherwise FALSE. This flag indicates OEM that more messages to send. - * - * @param [in] callback - * - To register callback function for result of this function. - * - * @param [in] user_data - * - user data for user specification - * - * @par Async Response Message: - * Asynchronous return status is indicated by #TelSmsResponse_t. - * - * @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 - * - * TelSmsDatapackageInfo_t *pDataPackage; - * int ret_status = TAPI_API_SUCCESS; - * TapiHandle *handle; - * tapi_response_cb callback; - * void* user_data; - * - * - * pDataPackage = (TelSmsDatapackageInfo_t*) malloc(sizeof(TelSmsDatapackageInfo_t)); - - * pDataPackage 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(handle, pDataPackage, bMoreMsgToSend, callback, user_data); - * @endcode - * - * @see - * - None. - * - * @remarks - * - None. - * - * - */ -/*================================================================================================*/ -int tel_send_sms(TapiHandle *handle, const TelSmsDatapackageInfo_t *pDataPackage, int bMoreMsgToSend, tapi_response_cb callback, void* user_data); - - /** - * @brief This function reads a message from SIM card storage. SIM index (index used when storing the SMS) number to be passed to in order - * to read particular SMS message. Total number of messages can be retrieved by #TelTapiSmsGetCount function. - * Access to this API is limited to in-house application and we recommend you use Message Framework API(MAPI). - * - * @par Sync (or) Async: - * This is an Asynchronous API. - * - * @par Important Notes: - * - None. - * - * @warning - * - None. - * - * - * @param [in] handle - * - handle from tel_init() - * - * @param [in] index - * - Index number of the message to be read - * - * @param [in] callback - * - To register callback function for result of this function. - * - * @param [in] user_data - * - user data for user specification - * - * @par Async Response Message: - * Asynchronous return status is indicated by #TelSmsResponse_t. - * - * @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 ret_status = TAPI_API_SUCCESS; - * TapiHandle *handle;//Obtained from tel_init(); - * tapi_response_cb callback; - * void* user_data; - * int index; - * - * ret_status = tel_read_sms_in_sim(handle, index, callback, user_data); - * - * @endcode - * - * @see - * - None. - * - * @remarks - * - None. - * - * - */ -/*================================================================================================*/ - int tel_read_sms_in_sim(TapiHandle *handle, int index, tapi_response_cb callback, void* user_data); - - /** - * @brief This function writes a message to SIM storage area. - * Access to this API is limited to in-house application and we recommend you use Message Framework API(MAPI). - * - * @par Sync (or) Async: - * This is an Asynchronous API. - * - * @par Important Notes: - * - None. - * - * @warning - * - None. - * - * - * @param [in] handle - * - handle from tel_init() - * - * @param [in] pWriteData - * - SMS message structure. - * - * @param [in] callback - * - To register callback function for result of this function. - * - * @param [in] user_data - * - user data for user specification - * - * @par Async Response Message: - * Asynchronous return status is indicated by #TelSmsResponse_t. - * - * @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 ret_status = TAPI_API_SUCCESS; - * TapiHandle *handle;//Obtained from tel_init(); - * tapi_response_cb callback; - * void* user_data; - - * TelSmsData_t *pWriteData; - * char *msg = "This is an Test SMS"; - * char *SCA = "821091"; - * - * pWriteData =(TelSmsData_t *)malloc(sizeof(TelSmsData_t)); - * - * conv_service_center_address(pWriteData->SmsData.Sca, SCA); //convert service center address - * conv_msg_into_tpdu(pWriteData->SmsData.szData, pWriteData->SmsData.MsgLength, msg); // convert message into TPDU - * pWrite->MsgStatus = TAPI_NETTEXT_STATUS_READ; - * pWrite->SimIndex = -1; - * - * ret_status = tel_write_sms_in_sim(handle, pWriteData, callback, user_data); - * @endcode - * - * @see - * - None. - * - * @remarks - * - None. - * - * - */ -/*================================================================================================*/ -int tel_write_sms_in_sim(TapiHandle *handle, const TelSmsData_t *pWriteData, tapi_response_cb callback, void* user_data); - - /** - * @brief This function deletes a message specified by index (SIM index used when storing the SMS) - * number from the SIM storage area. Access to this API is limited to in-house application and we recommend you use Message Framework API(MAPI). - * - * @par Sync (or) Async: - * This is an Asynchronous API. - * - * @par Important Notes: - * - None. - * - * @warning - * - None. - * - * - * @param [in] handle - * - handle from tel_init() - * - * @param [in] Index - * - Message index to delete. - * - * @param [in] callback - * - To register callback function for result of this function. - * - * @param [in] user_data - * - user data for user specification - * - * @par Async Response Message: - * Asynchronous return status is indicated by #TelSmsResponse_t. - * - * @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).\n - * @par Prospective Clients: - * External Apps. - * - * @code - * #include - * - * int ret_status = TAPI_API_SUCCESS; - * TapiHandle *handle;//Obtained from tel_init(); - * tapi_response_cb callback; - * void* user_data; - * int index; - * - * ret_status = tel_delete_sms_in_sim(handle, index, callback, user_data); - * - * @endcode - * - * @see - * - None. - * - * @remarks - * - None. - * - * - */ -/*================================================================================================*/ -int tel_delete_sms_in_sim(TapiHandle *handle, int index, tapi_response_cb callback, void* user_data); - - /** - * @brief This function is used to retrieve message count information like Total record count, - * used record count and the indices list for SIM Storage. This is an asynchronous function and - * the response will be sent back in the callback function. Access to this API is limited, we recommend you use Message Framework API(MAPI) besides. - * Access to this API is limited to in-house application. - * - * @par Sync (or) Async: - * This is an Asynchronous API. - * - * @par Important Notes: - * - None. - * - * @warning - * - None. - * - * - * @param [in] handle - * - handle from tel_init() - * - * @param [in] callback - * - To register callback function for result of this function. - * - * @param [in] user_data - * - user data for user specification - - * - * @par Async Response Message: - * Asynchronous return status is indicated by #TelSmsResponse_t. - * - * @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.\n - * - * @code - * #include - * - * int ret_status = TAPI_API_SUCCESS; - * TapiHandle *handle;//Obtained from tel_init(); - * tapi_response_cb callback; - * void* user_data; - * - * ret_status = tel_get_sms_count(handle, callback, user_data); - * @endcode - * - * @see - * - None. - * - * @remarks - * - None. - * - * - */ -/*================================================================================================*/ -int tel_get_sms_count(TapiHandle *handle, tapi_response_cb callback, void* user_data); - - - /** - * @brief This function is used to set SMS CB Message Identifiers in the appropriate EF-CBMI/EF-CBMIR file in (U)SIM. - * This function also indicates underlying provider to enable or disable CB Channel on which CB messages are received. - * Access to this API is limited to in-house application and we recommend you use Message Framework API(MAPI) besides. - * - * @par Sync (or) Async: - * This is an Asynchronous API. - * - * @par Important Notes: - * - None. - * - * @warning - * - None. - * - * - * @param [in] handle - * - handle from tel_init() - * - * @param [in] pCBConfig - * - This structure contains parameters to set SMS CB configuration \n - * (i) Cell broadcast service state. (Enabled/disabled.) \n - * (ii) Cell broadcast message identifier, which denotes whether all cell broadcast message identifiers are selected or only - * some of those.\n - * (iii) The list count of message identifiers to be set.\n - * (iv) The actual list of message identifiers to be set. Each identifier occupies 2 bytes. And the list ranges from 0x00 to 0xff. \n - * These message identifiers denote the source and type of the CB message. Based on the message identifiers set in the SIM, - * the ME receives CB messages with selected message identifiers. - * - * @param [in] callback - * - To register callback function for result of this function. - * - * @param [in] user_data - * - user data for user specification - * - * @par Async Response Message: - * Asynchronous return status is indicated by #TelSmsResponse_t. - * - * @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.\n - * - * @code - * #include - * - * int ret_status = TAPI_API_SUCCESS; - * TapiHandle *handle;//Obtained from tel_init(); - * tapi_response_cb callback; - * void* user_data; - * TelSmsCbConfig_t *pCBConfig = NULL; - * - * pCBConfig = (TelSmsCbConfig_t *)malloc(sizeof(TelSmsCbConfig_t)); - * pCBConfig->bCBEnabled = 1; //fill structure appropriately - * 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(handle, pCBConfig, callback, user_data); - * - * @endcode - * - * @see - * - None. - * - * @remarks - * - None. - * - * - */ -/*================================================================================================*/ -int tel_set_sms_cb_config(TapiHandle *handle, const TelSmsCbConfig_t *pCBConfig, tapi_response_cb callback, void* user_data); - - /** - * @brief This function is used to retrieve SMS CB configuration parameters from EFcbmi file in the SIM. - * Access to this API is limited to in-house application and we recommend you use Message Framework API(MAPI). - * - * @par Sync (or) Async: - * This is an Asynchronous API. - * - * @par Important Notes: - * - None. - * - * @warning - * - None. - * - * - * @param [in] handle - * - handle from tel_init() - * - * @param [in] callback - * - To register callback function for result of this function. - * - * @param [in] user_data - * - user data for user specification - * - * @par Async Response Message: - * Asynchronous return status is indicated by #TelSmsResponse_t. - * - * @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.\n - * - * @code - * #include - * - * int ret_status = TAPI_API_SUCCESS; - * TapiHandle *handle;//Obtained from tel_init(); - * tapi_response_cb callback; - * void* user_data; - * - * ret_status = tel_get_sms_cb_config(handle, callback, user_data); - * @endcode - * - * @see - * - None. - * - * @remarks - * - None. - * - * - */ -/*================================================================================================*/ -int tel_get_sms_cb_config(TapiHandle *handle, tapi_response_cb callback, void* user_data); - - - /** - * @brief This function is used to set SMS preferred bearer on which SMS has to be transmitted. - * Access to this API is limited to in-house application and we recommend you use Message Framework API(MAPI). - * - * @par Sync (or) Async: - * This is an Asynchronous API. - * - * @par Important Notes: - * - None. - * - * @warning - * - None. - * - * - * @param [in] handle - * - handle from tel_init() - * - * @param [in] BearerType - * - Specifies the bearer type. - * - * @param [in] callback - * - To register callback function for result of this function. - * - * @param [in] user_data - * - user data for user specification - * - * @par Async Response Message: - * Asynchronous return status is indicated by #TelSmsResponse_t - * - * @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 ret_status = TAPI_API_SUCCESS; - * TapiHandle *handle;//Obtained from tel_init(); - * tapi_response_cb callback; - * void* user_data; - * TelSmsBearerType_t BearerType = TAPI_NETTEXT_BEARER_PS_ONLY; - * - * ret_status = tel_set_sms_preferred_bearer(handle, BearerType, callback, user_data); - * - * @endcode - * - * @see - * - None. - * - * @remarks - * - None. - * - * - */ -/*================================================================================================*/ -int tel_set_sms_preferred_bearer(TapiHandle *handle, TelSmsBearerType_t BearerType, tapi_response_cb callback, void* user_data); - - /** - * @brief This function is used to get SMS preferred bearer on which SMS has to be transmitted. - * This is an asynchronous function. Access to this API is limited to in-house application and , we recommend you use Message Framework API(MAPI). - * - * @par Sync (or) Async: - * This is an Asynchronous API. - * - * @par Important Notes: - * - None. - * - * @warning - * - None. - * - * - * @param [in] handle - * - handle from tel_init() - * - * @param [in] callback - * - To register callback function for result of this function. - * - * @param [in] user_data - * - user data for user specification - * - * @par Async Response Message: - * Asynchronous return status is indicated by #TelSmsResponse_t. - * - * @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 ret_status = TAPI_API_SUCCESS; - * TapiHandle *handle;//Obtained from tel_init(); - * tapi_response_cb callback; - * void* user_data; - * - * ret_status = tel_get_sms_preferred_bearer(handle, callback, user_data); - * - * @endcode - * - * @see - * - None. - * - * @remarks - * - None. - * - * - */ -/*================================================================================================*/ -int tel_get_sms_preferred_bearer(TapiHandle *handle, tapi_response_cb callback, void* user_data); - - /** - * @brief This function is used to get the SMS parameters for a particular SMS (sent/received) - * based on the SIM index where it is stored. This is an asynchronous function. Access to this API is limited to in-house application and we recommend you use Message Framework API(MAPI). - * - * @par Sync (or) Async: - * This is an Asynchronous API. - * - * @par Important Notes: - * - None. - * - * @warning - * - None. - * - * - * @param [in] handle - * - handle from tel_init() - * - * @param [in] index - * - SIM index where the SMS is stored - * - * @param [in] callback - * - To register callback function for result of this function. - * - * @param [in] user_data - * - user data for user specification - * - * @par Async Response Message: - * Asynchronous return status is indicated by #TelSmsResponse_t - * - * @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 ret_status = TAPI_API_SUCCESS; - * TapiHandle *handle;//Obtained from tel_init(); - * tapi_response_cb callback; - * void* user_data; - * int index; - * - * ret_status = tel_get_sms_parameters(handle, index, callback, user_data); - * - * @endcode - * - * @see - * - None. - * - * @remarks - * - None. - * - * - */ -/*================================================================================================*/ -int tel_get_sms_parameters(TapiHandle *handle, int index, tapi_response_cb callback, void* user_data); - - /** - * @brief This function is used to set the short message service header parameters which are - * used in the origination of MO messages. Access to this API is limited to in-house application and we recommend you use Message Framework API(MAPI). - * - * @par Sync (or) Async: - * This is an Asynchronous API. - * - * @par Important Notes: - * - This API updates/sets SMS Parameters in EFsmsp file in the SIM storage - * - * @warning - * - None. - * - * - * @param [in] handle - * - handle from tel_init() - * - * @param [in] pSmsSetParameters - * - Contains SMS header Parameter information like service center address, destination address, validity period, protocol identifier, - * data coding scheme. - * - * @param [in] callback - * - To register callback function for result of this function. - * - * @param [in] user_data - * - user data for user specification - * - * @par Async Response Message: - * Asynchronous return status is indicated by #TelSmsResponse_t - * - * @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 ret_status = TAPI_API_SUCCESS; - * TapiHandle *handle;//Obtained from tel_init(); - * tapi_response_cb callback; - * void* user_data; - * - * TelSmsParams_t SmsSetParameters = {0,};//fill the structure appropriately - * - * 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(handle, pSmsSetParameters, callback, user_data); - * - * @endcode - * - * @see - * - None. - * - * @remarks - * - None. - * - * - */ -/*================================================================================================*/ -int tel_set_sms_parameters(TapiHandle *handle, const TelSmsParams_t *pSmsSetParameters, tapi_response_cb callback, void* user_data); - - /** - * @brief This function is used to send a deliver report for the received incoming SMS to the network. - * Access to this API is limited to in-house application. - * - * @par Sync (or) Async: - * This is an Asynchronous API. - * - * @par Important Notes: - * - None. - * - * @warning - * - None. - * - * - * @param [in] handle - * - handle from tel_init() - * - * @param [in] pDataPackage - * - Contains SMS Data package.. - * - * @param [in] RPCause - * - Indicates the reason for SMS-DELIVER failure - * - * @param [in] callback - * - To register callback function for result of this function. - * - * @param [in] user_data - * - user data for user specification - * - * @par Async Response Message: - * Asynchronous return status is indicated by #TelSmsResponse_t - * - * @pre - * - SMS-DELIVER-REPORT message structure should be in TPDU format as specified by 3GPP TS 23.040 SMS TPDU. - * - * @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 ret_status = 0; - * Int requestId = -1; - * TelSmsResponse_t RPCause; - * TelSmsDatapackageInfo_t *del_report = NULL; - * - * del_report = (TelSmsDatapackageInfo_t *)malloc(sizeof(TelSmsDatapackageInfo_t)); - * memset(del_report, 0, sizeof(TelSmsDatapackageInfo_t)); - * TelSmsDatapackageInfo_t //fill the structure appropriately - * //Encode Send Delivery Report here - * //EncodeSmsDeliveryReportTpdu(); - * 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 . - * - * RPCause = TAPI_NETTEXT_SENDSMS_SUCCESS; - * printf("***receive message (Api:SendDeliverreport)****\n"); - * - * ret_status = tel_send_sms_deliver_report(handle, pDataPackage, RPCause, callback, user_data); - * - * @endcode - * - * @see - * - None. - * - * @remarks - * - None. - * - * - */ -/*================================================================================================*/ -int tel_send_sms_deliver_report(TapiHandle *handle, const TelSmsDatapackageInfo_t *pDataPackage, TelSmsResponse_t RPCause, tapi_response_cb callback, void* user_data); - - /** - * @brief This function is used to set SMS Service Centre Address information in order to send the SMS. - * Access to this API is limited to in-house application and we recommend you use Message Framework API(MAPI). - * - * @par Sync (or) Async: - * This is an Asynchronous API. - * - * @par Important Notes: - * - This API updates/sets service center address in EFsmsp file in the SIM storage. - * - * @warning - * - None. - * - * @param [in] handle - * - handle from tel_init() - * - * @param [in] pSCA - * - Contains the service centre address informations. - * - * @param [in] Index - * - Contains the record index of the Service center address information in the EF. - * - * @param [in] callback - * - To register callback function for result of this function. - * - * @param [in] user_data - * - user data for user specification - * - * @par Async Response Message: - * Asynchronous return status is indicated by #TelSmsResponse_t. - * - * @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 ret_status; - * TapiHandle *handle;//Obtained from tel_init(); - * tapi_response_cb callback; - * void* user_data; - * int index; - * - * TelSmsAddressInfo_t *sc_addr = NULL; - * - * - * printf("***Setting the SCA(Api:SetSCA)****\n"); - * sca = (TelSmsAddressInfo_t *)malloc(sizeof(TelSmsAddressInfo_t)); - * TelSmsAddressInfo_t // fill the structure appropriately - * memset(sca, 0, sizeof(sca)); - * sca.DialNumLen = 0x5; - * sca.Npi = TAPI_SIM_NPI_ISDN_TEL; - * sca.Ton = TAPI_SIM_TON_INTERNATIONAL; - * sca.szDiallingNum[0] = 0x28; - * sca.szDiallingNum[1] = 0x01; - * sca.szDiallingNum[2] = 0x19; - * sca.szDiallingNum[3] = 0x11; - * sca.szDiallingNum[4] = 0x11; - * - * ret_status = tel_set_sms_sca(handle, pSCA, index, callback, user_data); - * - * @endcode - * - * @see - * - None. - * - * @remarks - * - None. - * - * - */ -/*================================================================================================*/ -int tel_set_sms_sca(TapiHandle *handle, const TelSmsAddressInfo_t *pSCA, int index, tapi_response_cb callback, void* user_data); - - /** - * @brief This function is used to get current SMS Service Centre Address information. - * Access to this API is limited to in-house application and we recommend you use Message Framework API(MAPI). - * - * @par Sync (or) Async: - * This is an Asynchronous API. - * - * @par Important Notes: - * - None. - * - * @warning - * - None. - * - * - * @param [in] handle - * - handle from tel_init() - * - * @param [in] Index - * - Contains the record index of the Service center address information in the SIM EF. - * - * @param [in] callback - * - To register callback function for result of this function. - * - * @param [in] user_data - * - user data for user specification - * - * @par Async Response Message: - * Asynchronous return status is indicated by #TelSmsResponse_t. - * - * @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 ret_status = TAPI_API_SUCCESS; - * TapiHandle *handle;//Obtained from tel_init(); - * tapi_response_cb callback; - * void* user_data; - * int index; - * - * ret_status = tel_get_sms_sca(handle, index, callback, user_data); - * - * @endcode - * - * @see - * - None. - * - * @remarks - * - None. - * - * - */ -/*================================================================================================*/ -int tel_get_sms_sca(TapiHandle *handle, int index, tapi_response_cb callback, void* user_data); - - /** - * @brief This function is used by the applications to inform modem about the memory status of PDA (whether FULL or AVAILABLE) so that modem can inform network . - * Access to this API is limited to in-house application. - * - * @par Sync (or) Async: - * This is an Asynchronous API. - * - * @par Important Notes: - * - None. - * - * @warning - * - None. - * - * - * @param [in] handle - * - handle from tel_init() - * - * @param [in] memoryStatus - * - Contains Memory Status - * - * @param [in] callback - * - To register callback function for result of this function. - * - * @param [in] user_data - * - user data for user specification - * - * @par Async Response Message: - * Asynchronous return status is indicated by #TelSmsResponse_t - * - * @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 ret_status = TAPI_API_SUCCESS; - * TapiHandle *handle;//Obtained from tel_init(); - * tapi_response_cb callback; - * void* user_data; - * int MemoryStatus = TAPI_NETTEXT_PDA_MEMORY_STATUS_AVAILABLE; - * - * ret_status = tel_set_sms_memory_status(handle, memoryStatus, callback, user_data); - * - * @endcode - * - * @see - * - None. - * - * @remarks - * - None. - * - * - */ -/*================================================================================================*/ -int tel_set_sms_memory_status(TapiHandle *handle, int memoryStatus, tapi_response_cb callback, void* user_data); - - /** - * @brief This function is used by the applications to set the message status in the SIM EF. - * Access to this API is limited to in-house application and we recommend you use Message Framework API(MAPI). - * - * @par Sync (or) Async: - * This is an Asynchronous API. - * - * @par Important Notes: - * - None. - * - * @warning - * - None. - * - * - * @param [in] handle - * - handle from tel_init() - * - * @param [in] Index - * - Index of the message whose status has to be set. - * - * @param [in] msgStatus - * - Status of the message to be set. - * - * @param [in] callback - * - To register callback function for result of this function. - * - * @param [in] user_data - * - user data for user specification - * - * @par Async Response Message: - * Asynchronous return status is indicated by #TelSmsResponse_t - * - * @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 ret_status = TAPI_API_SUCCESS; - * TapiHandle *handle;//Obtained from tel_init(); - * tapi_response_cb callback; - * void* user_data; - * int index = 1; - * int MemoryStatus = TAPI_NETTEXT_PDA_MEMORY_STATUS_AVAILABLE; - * - * ret_status = tel_set_sms_message_status(handle, index, msgStatus, callback, user_data); - * - * @endcode - * - * @see - * - None. - * - * @remarks - * - None. - * - * - */ -/*================================================================================================*/ -int tel_set_sms_message_status(TapiHandle *handle, int index, TelSmsMsgStatus_t msgStatus, tapi_response_cb callback, void* user_data); - - /** - * @brief This function is used by the applications to get the count of SMS parameter records stored in SIM EF. - * Access to this API is limited to in-house application. - * - * @par Sync (or) Async: - * This is an Asynchronous API. - * - * @par Important Notes: - * - None. - * - * @warning - * - None. - * - * - * @param [in] handle - * - handle from tel_init() - * - * @param [in] callback - * - To register callback function for result of this function. - * - * @param [in] user_data - * - user data for user specification - * - * @par Async Response Message: - * Asynchronous return status is indicated by #TelSmsResponse_t - * - * @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 ret_status = TAPI_API_SUCCESS; - * TapiHandle *handle;//Obtained from tel_init(); - * tapi_response_cb callback; - * void* user_data; - * - * ret_status = tel_get_sms_parameter_count(handle, callback, user_data); - * @endcode - * - * @see - * - None. - * - * @remarks - * - None. - * - * - */ -/*================================================================================================*/ -int tel_get_sms_parameter_count(TapiHandle *handle, tapi_response_cb callback, void* user_data); - - -/** - * @brief This function is used by the applications to check the sms ready status (whether ready or not) . - * - * @par Sync (or) Async: - * This is a Synchronous API. - * - * @par Important Notes: - * - None. - * - * @warning - * - None. - * - * - * @param [in] handle - * - handle from tel_init() - * - * @param [out] pReadyStatus - * - Contains Ready Status - * - * @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. - * - */ -int tel_check_sms_device_status(TapiHandle *handle, int *pReadyStatus); - -/** - * @brief This function is used by the applications to inform modem about the PDA status(whether PDA is ready to - * recieve messages from network or not). - * - * - * @par Sync (or) Async: - * This is an Asynchronous API. - * - * @par Important Notes: - * - None. - * - * @warning - * - None. - * - * - * @param [in] - * - None - * - * @param [out] - * - None - * - * @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. - * - */ -int tel_set_sms_device_status(void); - -#ifdef __cplusplus -} -#endif - -#endif /* _ITAPI_NETTEXT_H_ */ - -/** -* @} -*/ diff --git a/wearable/include/ITapiNetwork.h b/wearable/include/ITapiNetwork.h deleted file mode 100644 index 93fa83f..0000000 --- a/wearable/include/ITapiNetwork.h +++ /dev/null @@ -1,1101 +0,0 @@ -/* - * libslp-tapi - * - * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. - * - * Contact: Ja-young Gu - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT 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 ITapiNetwork.h - - @brief This file serves as a "C" header file defines functions for Tapi Network\n - It contains a sample set of function prototypes that would be required by applications. - */ - -#ifndef _ITAPI_NETWORK_H_ -#define _ITAPI_NETWORK_H_ - -#include -#include -#include -#include - -#ifdef __cplusplus -extern "C" -{ -#endif - -/** - * @brief This function requests the lower layers to select the network automatically - * - * @par Sync (or) Async: - * This is an Asynchronous API. - * - * This function makes Dbus method call to Telephony Sever and returns immediate value. - * However it just means that the API request has been transfered to the CP successfully. - * The actual operation result is being delivered in the corresponding event asynchronously. - * - * @par Important Notes: - * - None. - * - * @warning - * - None. - * - * @param [in] handle - * - handle from tel_init(). - * - * @param [in] callback - * - To register callback function for result. - * - * @param [in] user_data - * - user_data for user specification. - * - * @par Async Response Message: - * Asynchronous return status is indicated by #TelNetworkOperationCause_t. - * There is no data associated with the response. - * - * @pre - * - A dbus connection is established with #tel_init - * - The application name is registered with #tel_register_app_name - * - The application is registered events to listen asynchronous response with #tel_register_event - * - A event loop is running to listen events - * - * @post - * - None. - * - * @return Return Type (int) \n - * - TAPI_API_SUCCESS - indicating that the operation has completed successfully. \n - * - Refer #TapiResult_t for failure and error code - * - * @par Prospective Clients: - * External Apps. - * - * @code - * #include - * - * int ret_status; - * TapiHandle *handle; - * tapi_response_cb callback; - * void *user_data; - * - * //SET NETWORK SELECTION AUTOMATIC MODE - * ret_status = tel_select_network_automatic(handle, callback, user_data); - * @endcode - * - * @see - * - None. - * - * @remarks - * - None. - * - * - */ -/*================================================================================================*/ -int tel_select_network_automatic(TapiHandle *handle, tapi_response_cb callback, void *user_data); - -/** - * @brief This function requests the lower layers to select the network (PLMN) which has been selected by the user from the Network List - * displayed to the User. - * - * @par Sync (or) Async: - * This is an Asynchronous API. - * - * This function makes Dbus method call to Telephony Sever and returns immediate value. - * However it just means that the API request has been transfered to the CP successfully. - * The actual operation result is being delivered in the corresponding event asynchronously. - * - * @par Important Notes: - * - None. - * - * @warning - * - None. - * - * @param [in] handle - * - handle from tel_init(). - * - * @param[in] plmn - * - User selected PLMN. - - * @param [in] act - * - User selected Access Technology. - - * @param [in] callback - * - To register callback function for result. - * - * @param [in] user_data - * - user_data for user specification. - * - * @par Async Response Message: - * Asynchronous return status is indicated by #TelNetworkOperationCause_t. - * There is no data associated with the response. - * - * @pre - * - A dbus connection is established with #tel_init - * - The application name is registered with #tel_register_app_name - * - The application is registered events to listen asynchronous response with #tel_register_event - * - A event loop is running to listen events - * - * @post - * - None. - * - * @return Return Type (int) \n - * - TAPI_API_SUCCESS - indicating that the operation has completed successfully. \n - * - Refer #TapiResult_t for failure and error code - * @par Prospective Clients: - * External Apps. - * - * @code - * #include - * - * int ret_status; - * unsigned int plmn = 0; - * TapiHandle *handle; - * const char *plmn; - * int act; - * tapi_response_cb callback; - * void *user_data; - * - * //SET NETWORK SELECTION MANUAL MODE - * plmn = 45454; - * act = 0x1; //For GSM. - * ret_status = tel_select_network_manual(handle, plmn, act, callback, user_data); - * @endcode - * - * @see - * - None. - * - * @remarks - * - None. - * - * - */ -/*================================================================================================*/ -int tel_select_network_manual(TapiHandle *handle, const char *plmn, int act, tapi_response_cb callback, void *user_data); - -/** - * @brief This function sends a request to do manual network search for the available networks and provide the - * Network List to the User/Application. - * - * @par Sync (or) Async: - * This is an Asynchronous API. - * - * This function makes Dbus method call to Telephony Sever and returns immediate value. - * However it just means that the API request has been transfered to the CP successfully. - * The actual operation result is being delivered in the corresponding event asynchronously. - * - * @par Important Notes: - * - None. - * - * @warning - * - None. - * - * @param [in] handle - * - handle from tel_init(). - * - * @param [in] callback - * - To register callback function for result. - * - * @param [in] user_data - * - user_data for user specification. - * - * @par Async Response Message: - * Asynchronous return status is indicated by #TelNetworkOperationCause_t. - * Data associated with the response is #TelNetworkPlmnList_t. - * - * @pre - * - A dbus connection is established with #tel_init - * - The application name is registered with #tel_register_app_name - * - The application is registered events to listen asynchronous response with #tel_register_event - * - A event loop is running to listen events - * - * @post - * - In the available network list, user can select one of the networks successfully. - * - * @return Return Type (int) \n - * - TAPI_API_SUCCESS - indicating that the operation has completed successfully. \n - * - Refer #TapiResult_t for failure and error code - * @par Prospective Clients: - * External Apps. - * - * @code - * #include - * - * int ret_status; - * TapiHandle *handle; - * tapi_response_cb callback; - * void *user_data; - * - * // NETWORK SEARCH - * ret_status = tel_search_network(handle, callback, user_data); - * @endcode - * - * @see - * - None. - * - * @remarks - * - None. - * - * - */ -/*================================================================================================*/ -int tel_search_network(TapiHandle *handle, tapi_response_cb callback, void *user_data); - -/** - * @brief This function requests for the present network selection mode i.e. automatic or manual. - * - * @par Sync (or) Async: - * This is an Asynchronous API. - * - * This function makes Dbus method call to Telephony Sever and returns immediate value. - * However it just means that the API request has been transfered to the CP successfully. - * The actual operation result is being delivered in the corresponding event asynchronously. - * - * @par Important Notes: - * - None. - * - * @warning - * - None. - * - * @param [in] handle - * - handle from tel_init(). - * - * @param [in] callback - * - To register callback function for result. - * - * @param [in] user_data - * - user_data for user specification. - * - * @par Async Response Message: - * Asynchronous return status is indicated by #TelNetworkOperationCause_t. - * Data associated with the response is #TelNetworkSelectionMode_t. - * - * @pre - * - A dbus connection is established with #tel_init - * - The application name is registered with #tel_register_app_name - * - The application is registered events to listen asynchronous response with #tel_register_event - * - A event loop is running to listen events - * - * @post - * - None. - * - * @return Return Type (int) \n - * - TAPI_API_SUCCESS - indicating that the operation has completed successfully. \n - * - Refer #TapiResult_t for failure and error code - * @par Prospective Clients: - * External Apps. - * - * @code - * #include - * - * int ret_status; - * TapiHandle *handle; - * tapi_response_cb callback; - * void *user_data; - * - * // GET NETWORK SELECTION MODE - * ret_status = tel_get_network_selection_mode (handle, callback, user_data); - * @endcode - * - * @see - * - None. - * - * @remarks - * - None. - * - * - * - */ -/*================================================================================================*/ -int tel_get_network_selection_mode(struct tapi_handle *handle, tapi_response_cb callback, void *user_data); - -/** - * @brief This function is called when User/application wants to configure the service domain to only CS or only PS or Both. - * This API triggers the underlying protocol stack to do register with Network for only CS services or only PS services - * or both based on the option set using this API. - * - * @par Sync (or) Async: - * This is an Asynchronous API. - * - * This function makes Dbus method call to Telephony Sever and returns immediate value. - * However it just means that the API request has been transfered to the CP successfully. - * The actual operation result is being delivered in the corresponding event asynchronously. - * - * @par Important Notes: - * - None. - * - * @warning - * - None. - * - * - * @param [in] handle - * - handle from tel_init(). - * - * @param[in] ServiceDomain - * - Specifies the type of Service domain (Packet switch, Circuit switch or both) - * - * @param [in] callback - * - To register callback function for result. - * - * @param [in] user_data - * - user_data for user specification. - * - * @par Async Response Message: - * The event associated is TAPI_EVENT_NETWORK_SET_SVC_DOMAIN_CNF and there is no event data associated with this event - * and asynchronous return status is indicated by #TelNetworkOperationCause_t. - * - * @pre - * - A dbus connection is established with #tel_init - * - The application name is registered with #tel_register_app_name - * - The application is registered events to listen asynchronous response with #tel_register_event - * - A event loop is running to listen events - * - * @post - * - None. - * - * @return Return Type (int) \n - * - TAPI_API_SUCCESS - indicating that the operation has completed successfully. \n - * - Refer #TapiResult_t for failure and error code - * - * @par Prospective Clients: - * External Apps. - * - * @code - * #include - * - * int ret_status; - * TapiHandle *handle; - * TelNetworkServiceDomain_t domain; - * tapi_response_cb callback; - * void *user_data; - * - * // SET NETWORK SERVICE DOMAIN - * domain = TAPI_NETWORK_SERVICE_DOMAIN_AUTOMATIC; - * - * ret_status = tel_set_network_service_domain (handle, domain, callback, user_data); - * @endcode - * - * @see - * - None. - * - * @remarks - * - None. - * - * - */ -/*================================================================================================*/ -int tel_set_network_service_domain(TapiHandle *handle, TelNetworkServiceDomain_t domain, - tapi_response_cb callback, void *user_data); - -/** - * @brief This function requests for the present network service domain i.e. CS or PS or both or automatic. - * - * @par Sync (or) Async: - * This is an Asynchronous API. - * - * This function makes Dbus method call to Telephony Sever and returns immediate value. - * However it just means that the API request has been transfered to the CP successfully. - * The actual operation result is being delivered in the corresponding event asynchronously. - * - * @par Important Notes: - * - None. - * - * @warning - * - None. - * - * @param [in] handle - * - handle from tel_init(). - * - * @param [in] callback - * - To register callback function for result. - * - * @param [in] user_data - * - user_data for user specification. - * - * @par Async Response Message: - * Asynchronous return status is indicated by #TelNetworkOperationCause_t. - * Data associated with the response is #TelNetworkServiceDomain_t. - * - * @pre - * - A dbus connection is established with #tel_init - * - The application name is registered with #tel_register_app_name - * - The application is registered events to listen asynchronous response with #tel_register_event - * - A event loop is running to listen events - * - * @post - * - None. - * - * @return Return Type (int) \n - * - TAPI_API_SUCCESS - indicating that the operation has completed successfully. \n - * - Refer #TapiResult_t for failure and error code - * @par Prospective Clients: - * External Apps. - * - * @code - * #include - * - * int ret_status; - * TapiHandle *handle; - * tapi_response_cb callback; - * void *user_data; - * - * // GET NETWORK SERVICE DOMAIN - * ret_status = tel_get_network_service_domain (handle, callback, user_data); - * - * @endcode - * - * @see - * - None. - * - * @remarks - * - None. - * - * - */ -/*================================================================================================*/ -int tel_get_network_service_domain(TapiHandle *handle, tapi_response_cb callback, void *user_data); - - -/** - * @brief This function is invoked to set the network band and allows the underlying OEM provider to scan the set band. - * - * This function makes Dbus method call to Telephony Sever and returns immediate value. - * However it just means that the API request has been transfered to the CP successfully. - * The actual operation result is being delivered in the corresponding event asynchronously. - * - * @par Sync (or) Async: - * This is an Asynchronous API. - * - * @par Important Notes: - * - None. - * - * @warning - * - None. - * - * - * @param [in] handle - * - handle from tel_init(). - * - * @param[in] mode - * - Band preference indicates the band provided to be preferred or selected band. - * - * @param[in] band - * - This enumeration defines different network bands that user can choose. - * - * @param [in] callback - * - To register callback function for result. - * - * @param [in] user_data - * - user_data for user specification. - * - * @par Async Response Message: - * The event associated is TAPI_EVENT_NETWORK_SETNWBAND_CNF and there is no event data associated with this event and asynchronous - * return status is indicated by #TelNetworkOperationCause_t. - * - * @pre - * - A dbus connection is established with #tel_init - * - The application name is registered with #tel_register_app_name - * - The application is registered events to listen asynchronous response with #tel_register_event - * - A event loop is running to listen events - * - * @post - * - None. - * - * @return Return Type (int) \n - * - TAPI_API_SUCCESS - indicating that the operation has completed successfully. \n - * - Refer #TapiResult_t for failure and error code - * @par Prospective Clients: - * External Apps. - * - * @code - * #include - * - * int ret_status; - * TapiHandle *handle; - * TelNetworkBandPreferred_t mode; - * TelNetworkBand_t band; - * tapi_response_cb callback; - * void *user_data; - * - * mode = TAPI_NETWORK_BAND_MODE_PREFERRED; - * band = TAPI_NETWORK_BAND_TYPE_GSM_900_1800; - * - * // SET NETWORK BAND - * ret_status = tel_set_network_band (handle, mode, band, callback, user_data); - * - * @endcode - * - * @see - * - None. - * - * @remarks - * - None. - * - * - * - */ -/*================================================================================================*/ -int tel_set_network_band(TapiHandle *handle, TelNetworkBandPreferred_t mode, - TelNetworkBand_t band, tapi_response_cb callback, void *user_data); - -/** - * @brief This function requests for the present network band. - * - * This function makes Dbus method call to Telephony Sever and returns immediate value. - * However it just means that the API request has been transfered to the CP successfully. - * The actual operation result is being delivered in the corresponding event asynchronously. - * - * @par Sync (or) Async: - * This is an Asynchronous API. - * - * @par Important Notes: - * - None. - * - * @warning - * - None. - * - * - * @param [in] handle - * - handle from tel_init(). - * - * @param [in] callback - * - To register callback function for result. - * - * @param [in] user_data - * - user_data for user specification. - * - * @par Async Response Message: - * Asynchronous return status is indicated by #TelNetworkOperationCause_t. - * Data associated with the response is #TelNetworkBand_t. - * - * @pre - * - A dbus connection is established with #tel_init - * - The application name is registered with #tel_register_app_name - * - The application is registered events to listen asynchronous response with #tel_register_event - * - A event loop is running to listen events - * - * @post - * - None. - * - * @return Return Type (int) \n - * - TAPI_API_SUCCESS - indicating that the operation has completed successfully. \n - * - Refer #TapiResult_t for failure and error code - * @par Prospective Clients: - * External Apps. - * - * @code - * #include - * - * int ret_status; - * TapiHandle *handle; - * tapi_response_cb callback; - * void *user_data; - * - * // GET NETWORK BAND - * ret_status = tel_get_network_band(handle, callback, user_data); - * - * @endcode - * - * @see - * - None. - * - * @remarks - * - None. - * - * - * - */ -/*================================================================================================*/ -int tel_get_network_band(TapiHandle *handle, tapi_response_cb callback, void *user_data); - -/** - * @brief This function is invoked to set the network preferred plmn - * - * This function makes Dbus method call to Telephony Sever and returns immediate value. - * However it just means that the API request has been transfered to the CP successfully. - * The actual operation result is being delivered in the corresponding event asynchronously. - * - * @par Sync (or) Async: - * This is an Asynchronous API. - * - * @par Important Notes: - * - None. - * - * @warning - * - None. - * - * - * @param [in] handle - * - handle from tel_init(). - * - * @param[in] operation - * - Operation indicates the operation to be done on preferred plmn . - * - * @param[in] info - * - This gives the plmn Info. - * - * @param [in] callback - * - To register callback function for result. - * - * @param [in] user_data - * - user_data for user specification. - * - * @par Async Response Message: - * The event associated is TAPI_EVENT_NETWORK_SETPREFFPLMN_CNF and there is no event data associated with this event and asynchronous - * return status is indicated by #TelNetworkOperationCause_t. - * - * @pre - * - A dbus connection is established with #tel_init - * - The application name is registered with #tel_register_app_name - * - The application is registered events to listen asynchronous response with #tel_register_event - * - A event loop is running to listen events - * - * @post - * - None. - * - * @return Return Type (int) \n - * - TAPI_API_SUCCESS - indicating that the operation has completed successfully. \n - * - Refer #TapiResult_t for failure and error code - * @par Prospective Clients: - * External Apps. - * - * @code - * #include - * - * int ret_status; - * TapiHandle *handle; - * TelNetworkPreferredPlmnOp_t operation; - * TelNetworkPreferredPlmnInfo_t info; - * tapi_response_cb callback; - * void *user_data; - * - * unsigned char *plmn = "45454"; - * - * operation = TAPI_NETWORK_PREF_PLMN_ADD; - * memset(&info, 0, sizeof(TelNetworkPreferredPlmnInfo_t)); - * info.Index = 0; - * info.SystemType = TAPI_NETWORK_SYSTEM_GSM; - * memcpy(info.Plmn, plmn, strlen(plmn)); - * - * // SET NETWORK PREFERRED PLMN - * ret_status = tel_set_network_preferred_plmn(handle, operation, &info, callback, user_data); - * - * @endcode - * - * @see - * - None. - * - * @remarks - * - None. - * - * - * - */ -/*================================================================================================*/ -int tel_set_network_preferred_plmn(TapiHandle *handle, TelNetworkPreferredPlmnOp_t operation, - TelNetworkPreferredPlmnInfo_t *info, tapi_response_cb callback, void *user_data); - -/** - * @brief This function is invoked to get the preferred plmn list - * - * This function makes Dbus method call to Telephony Sever and returns immediate value. - * However it just means that the API request has been transfered to the CP successfully. - * The actual operation result is being delivered in the corresponding event asynchronously. - * - * @par Sync (or) Async: - * This is an Asynchronous API. - * - * @par Important Notes: - * - None. - * - * @warning - * - None. - * - * @param [in] handle - * - handle from tel_init(). - * - * @param [in] callback - * - To register callback function for result. - * - * @param [in] user_data - * - user_data for user specification. - * - * - * @par Async Response Message: - * Asynchronous return status is indicated by #TelNetworkOperationCause_t. - * Data associated with the response is #TelNetworkPreferredPlmnList_t. - * - * @pre - * - A dbus connection is established with #tel_init - * - The application name is registered with #tel_register_app_name - * - The application is registered events to listen asynchronous response with #tel_register_event - * - A event loop is running to listen events - * - * @post - * - None. - * - * @return Return Type (int) \n - * - TAPI_API_SUCCESS - indicating that the operation has completed successfully. \n - * - Refer #TapiResult_t for failure and error code - * @par Prospective Clients: - * External Apps. - * - * @code - * #include - * - * int ret_status; - * TapiHandle *handle; - * tapi_response_cb callback; - * void *user_data; - * - * // GET NETWORK PREFERRED PLMN - * ret_status = tel_get_network_preferred_plmn(handle, callback, user_data); - * - * @endcode - * - * @see - * - None. - * - * @remarks - * - None. - * - * - * - */ -/*================================================================================================*/ -int tel_get_network_preferred_plmn(TapiHandle *handle, tapi_response_cb callback, void *user_data); - - -/** - * @brief This function is called to cancel the triggered manual network search. - * - * @par Sync (or) Async: - * This is an Asynchronous API. - * - * @par Important Notes: - * - None. - * - * @warning - * - None. - * - * @param [in] handle - * - handle from tel_init(). - * - * @param [in] callback - * - To register callback function for result. - * - * @param [in] user_data - * - user_data for user specification. - * - * @par Async Response Message: - * Asynchronous return status is indicated by #TelNetworkOperationCause_t. - * There is no data associated with the response. - * - * @pre - * - Manual network search is already triggered. - * - * @post - * - None. - * - * @return Return Type (int) \n - * - TAPI_API_SUCCESS - indicating that the operation has completed successfully. \n - * - Refer #TapiResult_t for failure and error code - * - * @par Prospective Clients: - * External Apps. - * - * @code - * #include - * - * int ret_status; - * TapiHandle *handle; - * tapi_response_cb callback; - * void *user_data; - * - * // CANCEL NETWORK MANUAL SEARCH - * ret_status = tel_cancel_network_manual_search(handle, callback, user_data); - * - * @endcode - * - * @see - * - None. - * - * @remarks - * - None. - * - */ -/*================================================================================================*/ -int tel_cancel_network_manual_search(TapiHandle *handle, tapi_response_cb callback, void *user_data); - -/** - * @brief This function is called to get network serving information - * - * @par Sync (or) Async: - * This is an Asynchronous API. - * - * @par Important Notes: - * - None. - * - * @warning - * - None. - * - * @param [in] handle - * - handle from tel_init(). - * - * @param [in] callback - * - To register callback function for result. - * - * @param [in] user_data - * - user_data for user specification. - * - * @par Async Response Message: - * Asynchronous return status is indicated by #TelNetworkOperationCause_t. - * Data associated with the response is #TelNetworkServing_t. - * - * @pre - * - * @post - * - None. - * - * @return Return Type (int) \n - * - TAPI_API_SUCCESS - indicating that the operation has completed successfully. \n - * - Refer #TapiResult_t for failure and error code - * - * @par Prospective Clients: - * External Apps. - * - * @code - * #include - * - * int ret_status; - * TapiHandle *handle; - * tapi_response_cb callback; - * void *user_data; - * - * // GET NETWORK SERVING - * ret_status = tel_get_network_serving(handle, callback, user_data); - * - * @endcode - * - * @see - * - None. - * - * @remarks - * - None. - * - * - */ -/*================================================================================================*/ -int tel_get_network_serving(TapiHandle *handle, tapi_response_cb callback, void *user_data); - -/** - * @brief This function is called to set network mode. - * - * @par Sync (or) Async: - * This is an Asynchronous API. - * - * @par Important Notes: - * - None. - * - * @warning - * - None. - * - * @param [in] handle - * - handle from tel_init(). - * - * @param [in] mode - * - Specifies the network mode (GSM only or WCDMA only or Automatic etc) - * - * @param [in] callback - * - To register callback function for result. - * - * @param [in] user_data - * - user_data for user specification. - * - * @par Async Response Message: - * Asynchronous return status is indicated by #TelNetworkOperationCause_t. - * There is no data associated with the response. - * - * @pre - * - * @post - * - None. - * - * @return Return Type (int) \n - * - TAPI_API_SUCCESS - indicating that the operation has completed successfully. \n - * - Refer #TapiResult_t for failure and error code - * - * @par Prospective Clients: - * External Apps. - * - * @code - * #include - * - * int ret_status; - * TapiHandle *handle; - * int mode; - * tapi_response_cb callback; - * void *user_data; - * - * mode = 0x01; //GSM mode - * // SET NETWORK MODE - * ret_status = tel_set_network_mode(handle, mode, callback, user_data); - * - * @endcode - * - * @see - * - None. - * - * @remarks - * - None. - * - */ -/*================================================================================================*/ -int tel_set_network_mode(TapiHandle *handle, int mode, tapi_response_cb callback, void *user_data); - -/** - * @brief This function is called to get network mode. - * - * @par Sync (or) Async: - * This is an Asynchronous API. - * - * @par Important Notes: - * - None. - * - * @warning - * - None. - * - * @param [in] handle - * - handle from tel_init(). - * - * @param [in] callback - * - To register callback function for result. - * - * @param [in] user_data - * - user_data for user specification. - * - * @par Async Response Message: - * Asynchronous return status is indicated by #TelNetworkOperationCause_t. - * Data associated with the response is GSM only or WCDMA only or Automatic etc. - * - * @pre - * - * @post - * - None. - * - * @return Return Type (int) \n - * - TAPI_API_SUCCESS - indicating that the operation has completed successfully. \n - * - Refer #TapiResult_t for failure and error code - * - * @par Prospective Clients: - * External Apps. - * - * @code - * #include - * - * int ret_status; - * TapiHandle *handle; - * tapi_response_cb callback; - * void *user_data; - * - * // GET NETWORK MODE - * ret_status = tel_get_network_mode(handle, callback, user_data); - * - * @endcode - * - * @see - * - None. - * - * @remarks - * - None. - * - */ -/*================================================================================================*/ -int tel_get_network_mode(TapiHandle *handle, tapi_response_cb callback, void *user_data); - -/** - * @brief This function is called to get neighboring cell info. - * - * @par Sync (or) Async: - * This is an Asynchronous API. - * - * @par Important Notes: - * - None. - * - * @warning - * - None. - * - * @param [in] handle - * - handle from tel_init(). - * - * @param [in] callback - * - To register callback function for result. - * - * @param [in] user_data - * - user_data for user specification. - * - * @par Async Response Message: - * Asynchronous return status is indicated by #TelNetworkOperationCause_t. - * Data associated with the response is #TelNetworkNeighboringCellInfo_t. - * - * @pre - * - * @post - * - None. - * - * @return Return Type (int) \n - * - TAPI_API_SUCCESS - indicating that the operation has completed successfully. \n - * - Refer #TapiResult_t for failure and error code - * - * @par Prospective Clients: - * External Apps. - * - * @code - * #include - * - * int ret_status; - * TapiHandle *handle; - * tapi_response_cb callback; - * void *user_data; - * - * // GET NETWORK NEIGHBORING CELL INFO - * ret_status = tel_get_network_neighboring_cell_info(handle, callback, user_data); - * - * @endcode - * - * @see - * - None. - * - * @remarks - * - None. - * - */ -/*================================================================================================*/ -int tel_get_network_neighboring_cell_info(TapiHandle *handle, tapi_response_cb callback, void *user_data); - -#ifdef __cplusplus -} -#endif - -#endif /* _ITAPI_NETWORK_H_ */ - -/** - * @} - */ diff --git a/wearable/include/ITapiPS.h b/wearable/include/ITapiPS.h deleted file mode 100644 index b49c4e7..0000000 --- a/wearable/include/ITapiPS.h +++ /dev/null @@ -1,764 +0,0 @@ -/* - * libslp-tapi - * - * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. - * - * Contact: Ja-young Gu - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT 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 GPRS_TAPI GPRS - * @{ - * - * GPRS APIs allow an application to accomplish the following services: @n - * - activate , deactivate PDP service @n - * - */ - -#ifndef _ITAPI_PS_H_ -#define _ITAPI_PS_H_ - -#include -#include -#include -#include - -#ifdef __cplusplus -extern "C" -{ -#endif - -/* Defining macros for PSMAN profiles */ -#define TAPI_PDP_ADDR_LEN_MAX 20 -#define TAPI_PDP_APN_LEN_MAX 101 -#define TAPI_PDP_NAME_LEN_MAX 16 -#define TAPI_PDP_MAX_USERNAME_LEN 32 -#define TAPI_PDP_MAX_PASSWORD_LEN 32 -#define TAPI_PDP_MAX_DNS_LEN 16 -#define MAX_PDP_CONTEXTS_ALLOWED 3 -#define MAX_GPRS_PORT_LIST 200 - -typedef enum { - TAPI_GPRS_DEFINE_PDP_CONTEXT=0x01, /* 0x01 : Define PDP Context */ - TAPI_GSM_GPRS_QOS, /* 0x02 : Quality of Service Profile */ - TAPI_GSM_GPRS_PS, /* 0x03 : PS attach or detach */ - TAPI_GSM_GPRS_PDP_CONTEXT, /* 0x04 : PDP context activate or deactivate */ - TAPI_GSM_GPRS_ENTER_DATA, /* 0x05 : Enter data */ - TAPI_GSM_GPRS_SHOW_PDP_ADDR, /* 0x06 : Show PDP address*/ - TAPI_GSM_GPRS_MS_CLASS, /* 0x07 : GPRS mobile station class*/ - TAPI_GSM_GPRS_3G_QUAL_SRVC_PROFILE, /* 0x08 : 3G Quality of service profile */ - TAPI_GSM_GPRS_IP_CONFIGURATION, /* 0x09 : Multiple PDP context IP configuration */ - TAPI_GSM_GPRS_DEFINE_SEC_PDP_CONTEXT, /* 0X0A : AT+CGDSCONT 05.10.07 ky.doo EDIT */ - TAPI_GSM_GPRS_TFT, /* 0X0B : AT+CGTFT 05.10.07 ky.doo EDIT */ - TAPI_GSM_GPRS_HSDPA_STATUS, /* 0x0C : HSDPA status */ - TAPI_GSM_GPRS_CURRENT_SESSION_DATA_COUNTER,/* 0x0D : Current data session tx/rx total bytes */ - TAPI_GSM_GPRS_DATA_DORMANT, /* 0x0E : Force to set Dormant */ - TAPI_GSM_GPRS_DUN_PIN_CTRL , /* 0x0F : Dial up Networking Pin Control Message */ - TAPI_GSM_GPRS_CALL_STATUS, /* 0x10 : DS TE2 Data Call result(Multiple PDP) */ - TAPI_GSM_GPRS_PORT_SEL, /* 0x11 : PORT SEL */ - TAPI_GSM_GPRS_MAX -} tapi_gprs_type_t; - -typedef enum{ - TAPI_PDP_MODE_ADD = 0x01, /*ADD*/ - TAPI_PDP_MODE_DEL = 0x02 /*Delete*/ -} tapi_pdp_mode_type_t; - -typedef enum{ - TAPI_PDP_AUTH_NONE = 0x0, /* No authentication */ - TAPI_PDP_AUTH_PAP = 0x1, /* PAP authentication */ - TAPI_PDP_AUTH_CHAP = 0x2, /* CHAP authentication */ - TAPI_PDP_AUTH_MAX = 0xff - -} tapi_pdp_auth_type_t; - -typedef enum { - GPRS_PDP_TYPE_UNKNOWN = 0x00, - GPRS_PDP_TYPE_X25 = 0x01, - GPRS_PDP_TYPE_IP = 0x02, - GPRS_PDP_TYPE_IHOSP = 0x03, - GPRS_PDP_TYPE_PPP = 0x04, - GPRS_PDP_TYPE_IPV6 = 0x05, -} tapi_pdp_type_t; - -/* HSDPA Status Variable */ -typedef enum { - HSDPA_INACTIVE, - HSDPA_ACTIVE -} tapi_hspda_status_type; - -typedef enum { - GPRS_SIGNAL_DCD = 0x01, - GPRS_DATA_SIGNAL_DTR = 0x04, - GPRS_DATA_SIGNAL_DSR = 0x06, - GPRS_DATA_SIGNAL_RTS = 0x07, - GPRS_DATA_SIGNAL_CTS = 0x08, - GPRS_DATA_SIGNAL_RI = 0x09, -} tapi_ps_btdun_pincontrol_signal; - -typedef enum { - GPRS_SIGNAL_STATUS_OFF = 0x00, - GPRS_SIGNAL_STATUS_ON = 0x01, -} tapi_ps_btdun_pincontrol_status; - -typedef enum { - TAPI_GPRS_PS_STATUS_DETACH = 0x00, - TAPI_GPRS_PS_STATUS_ATTACH = 0x01, - TAPI_GPRS_PS_STATUS_MAX -} tapi_gprs_pdp_status; - -typedef enum { - TAPI_GPRS_MO_SMS_SVC_CIRCUIT = 0x00, - TAPI_GPRS_MO_SMS_SVC_GPRS = 0x01, - TAPI_GPRS_MO_SMS_SVC_CIRCUITPREFERRED = 0x02, - TAPI_GPRS_MO_SMS_SVC_GPRSPREFERRED = 0x03, -} tapi_gprs_pdp_mo_sms_service; - -typedef enum { - TAPI_GPRS_3G_QOS_TYPE_REQUEST = 0x01, - TAPI_GPRS_3G_QOS_TYPE_MIN_ACCEPT = 0x02, - TAPI_GPRS_3G_QOS_TYPE_NEGOTIATE = 0x03, -} tapi_gprs_pdp_3g_qos_type; - -typedef enum { - TAPI_GPRS_3G_QOS_DELI_ORDER_NO = 0x00, - TAPI_GPRS_3G_QOS_DELI_ORDER_YES = 0x01, - TAPI_GPRS_3G_QOS_DELI_ORDER_SUBSCRIBE = 0x02, -} tapi_gprs_pdp_3g_qos_deli_order; - -typedef enum { - DSTATE_OK = 0x00, - DSTATE_CONNECT, - DSTATE_RING, - DSTATE_NO_CARRIER, - DSTATE_ERROR, - DSTATE_NO_DIALTONE, - DSTATE_BUSY, - DSTATE_NO_ANSWER, - DSTATE_RESULT_FDN, - DSTATE_MAX, -} tapi_gprs_data_status; - -typedef enum { - PDP_ACT_FAILURE_CAUSE_NORMAL = 0x00, // 0x00 : Normal Process ( no problem ) - PDP_ACT_FAILURE_CAUSE_REL_BY_USER = 0x01, // Call Released by User - PDP_ACT_FAILURE_CAUSE_REGULAR_DEACTIVATION = 0x02, // Regular deactivation - PDP_ACT_FAILURE_CAUSE_LLC_SNDCP = 0x03, // LLC SNDCP failure - PDP_ACT_FAILURE_CAUSE_INSUFFICIENT_RESOURCE = 0x04, // Insufficient resources - PDP_ACT_FAILURE_CAUSE_UNKNOWN_APN = 0x05, // Missing or unknown apn - PDP_ACT_FAILURE_CAUSE_UNKNOWN_PDP_ADDRESS = 0x06, // Unknown PDP address or type - PDP_ACT_FAILURE_CAUSE_USER_AUTH_FAILED = 0x07, // Unknown PDP address or type - PDP_ACT_FAILURE_CAUSE_ACT_REJ_GGSN = 0x08, // Unknown PDP address or type - PDP_ACT_FAILURE_CAUSE_ACT_REJ_UNSPECIFIED = 0x09, // Unknown PDP address or type - PDP_ACT_FAILURE_CAUSE_SVC_OPTION_NOT_SUPPORTED = 0x0A, // Service option not supported - PDP_ACT_FAILURE_CAUSE_SVC_NOT_SUBSCRIBED = 0x0B, // Requested service option not subscribed - PDP_ACT_FAILURE_CAUSE_SVC_OPT_OUT_ORDER = 0x0C, // Service out of order - PDP_ACT_FAILURE_CAUSE_NSAPI_USED = 0x0D, // NSAPI already used - PDP_ACT_FAILURE_CAUSE_QOS_NOT_ACCEPTED = 0x0E, // QoS not accepted - PDP_ACT_FAILURE_CAUSE_NETWORK_FAILURE = 0x0F, // Network Failure - PDP_ACT_FAILURE_CAUSE_REACT_REQUIRED = 0x10, // Reactivation Required - PDP_ACT_FAILURE_CAUSE_REATURE_NOT_SUPPORTED = 0x11, // Feature not supported - PDP_ACT_FAILURE_CAUSE_TFT_FILTER_ERROR = 0x12, // TFT or filter error - PDP_ACT_FAILURE_CAUSE_UNKOWN_PDP_CONTEXT = 0x13, // Unknown PDP context - PDP_ACT_FAILURE_CAUSE_INVALID_MSG = 0x14, // Invalid MSG - PDP_ACT_FAILURE_CAUSE_PROTOCOL_ERROR = 0x15, // Protocol error - PDP_ACT_FAILURE_CAUSE_MOBILE_FAILURE_ERROR = 0x16, // Mobile failure error - PDP_ACT_FAILURE_CAUSE_TIMEOUT_ERROR = 0x17, // Timeout error - PDP_ACT_FAILURE_CAUSE_UNKNOWN_ERROR = 0x18, // Unknown error - PDP_ACT_FAILURE_CAUSE_MAX , -} tapi_gprs_ds_status_reason; - -typedef enum { - INTERNAL_PS_CALL = 0x00, - EXTERNAL_PS_CALL = 0x01 -} tapi_gprs_external_status; - -typedef enum { - PDP_DEVICE_INFO_GET = 0x00, - PDP_DEVICE_INFO_SET = 0x01 -} tapi_gprs_device_info; - -typedef enum{ - TAPI_GPRS_PORT_LIST_NOT_USE, // 0x00 - TAPI_GPRS_PORT_LIST_WHITE, // 0x01 - TAPI_GPRS_PORT_LIST_BLACK, // 0x02 -} tapi_gprs_port_list_type; - -typedef enum { - TAPI_PDP_STATE_NONE, /* 0x00 Default state for a given PDP context*/ - TAPI_PDP_STATE_ACTIVATING, /* 0x01 TS will be in this state when there is a START PDP Request until it is activated by modem - This state PDP is not yet UP*/ - TAPI_PDP_STATE_ACTIVE, /* 0x02 After PDP activation is completed by modem and sent to PDA - This state PDP is fully UP*/ - TAPI_PDP_STATE_MODIFYING, /* 0x03 This state is reserved for future use - When TS support modifying existing PDP*/ - TAPI_PDP_STATE_DEACTIVATING, /* 0x04 TS will be in this state when there is STOP PDP request from App until it is deactivated by modem */ -} tapi_gprs_state; - -typedef enum { - TAPI_PDP_DATA_DORMANCY_SUCCESS, - TAPI_PDP_DATA_DORMANCY_FAILED -} TelTapiGprsDataDormancy_t; - -/* Suspend Reason Type */ -typedef enum { - TAPI_PDP_SUSPEND_NO_SVC = 0x01, - TAPI_PDP_SUSPEND_RAT_CHANGE = 0x02, - TAPI_PDP_SUSPEND_GPRS_HOLD = 0x03, - TAPI_PDP_SUSPEND_FLOW_CONTROL = 0x04, - TAPI_PDP_SUSPEND_GPRS_SUSPEND = 0x05, - TAPI_PDP_SUSPEND_RAU = 0x06, - TAPI_PDP_SUSPEND_LU = 0x07, - TAPI_PDP_TRANSFER_STATUS_MAX -} tapi_gprs_suspend_type; - -typedef struct { - tapi_gprs_type_t type; - tapi_phone_err_t cause; -} tapi_gprs_error_info_t; - -typedef struct { - int cont_id; - tapi_pdp_err_t err; -} tapi_ps_pdp_info_t; - -typedef struct { - int cont_id; - tapi_pdp_err_t err; -} tapi_ps_net_stop_rsp_t; - -typedef struct { - int cont_id; - tapi_pdp_err_t err; -} tapi_ps_net_activation_rsp_t; - -typedef struct { - int cont_id; - tapi_pdp_err_t err; -} tapi_ps_net_stop_ind_t; - -/* ps attach response */ -typedef struct { - int state; - int transfer_status; -} tapi_ps_attach_response_t; - -/* ps call statistics */ -typedef struct { - unsigned char cid; // call id . for proper bit alignment prefer int than short - unsigned long int rx; // total number of bytes received for this cid - unsigned long int tx; // total number of bytes transmitted for this cid -} tapi_ps_call_statistics_t; - -typedef struct { - tapi_ps_btdun_pincontrol_signal signal; - tapi_ps_btdun_pincontrol_status status; -} tapi_ps_btdun_pincontrol; - -/** - * This structure defines PDP information. - * @see ps_net_info_t - */ -typedef struct { - unsigned short is_primary_cont; /*Primary or secondary*/ - int primary_cont; /*Primary context id, if the is the context is secondary*/ - char apn[TAPI_PDP_APN_LEN_MAX]; - unsigned char pdp_address[TAPI_PDP_ADDR_LEN_MAX]; - unsigned char username[TAPI_PDP_MAX_USERNAME_LEN ]; - unsigned char password[TAPI_PDP_MAX_PASSWORD_LEN ]; - unsigned char dns1[TAPI_PDP_MAX_DNS_LEN ]; // @field Context activation DNS1 - unsigned char dns2[TAPI_PDP_MAX_DNS_LEN ]; // @field Context activation DNS2 - tapi_pdp_auth_type_t auth_type; - tapi_pdp_type_t pdp_type; -} tapi_pdp_info_t; - -typedef struct { - int cont_id; - tapi_pdp_info_t pdp_info; -} tapi_ps_net_start_req_t; - -typedef struct { - unsigned short is_primary_cont; /*Primary or secondary*/ - unsigned char username[TAPI_PDP_MAX_USERNAME_LEN ]; - unsigned char password[TAPI_PDP_MAX_PASSWORD_LEN ]; - unsigned char dns1[TAPI_PDP_MAX_DNS_LEN ]; // @field Context activation DNS1 - unsigned char dns2[TAPI_PDP_MAX_DNS_LEN ]; // @field Context activation DNS2 - tapi_pdp_auth_type_t auth_type; -} tapi_pdpdeact_info_t; - -typedef struct { - int cont_id; - tapi_pdpdeact_info_t pdp_info; -} tapi_ps_net_stop_req_t; - -typedef struct { - unsigned char field_flag; - unsigned char ip_address[4]; - unsigned char primary_dns[4]; - unsigned char secondary_dns[4]; - unsigned char gateway[4]; - unsigned char subnet_mask[4]; -} tapi_pdp_resp_info_t; - -typedef struct { - int cont_id; - tapi_pdp_err_t err; - tapi_pdp_resp_info_t pdp_info; - char devname[TAPI_PDP_NAME_LEN_MAX]; -} tapi_ps_net_start_rsp_t; - -typedef struct tagSetPDPActDeact { - int cid; - unsigned char username[TAPI_PDP_MAX_USERNAME_LEN ]; // @field Context activation user name - unsigned char passwd[TAPI_PDP_MAX_PASSWORD_LEN ]; // @field Context activation password - unsigned char dns1[TAPI_PDP_MAX_DNS_LEN ]; // @field Context activation DNS1 - unsigned char dns2[TAPI_PDP_MAX_DNS_LEN ]; // @field Context activation DNS2 - tapi_pdp_auth_type_t auth; -} tapi_gprs_pdp_act_deact_set; - -typedef struct { - char cid; - tapi_gprs_pdp_status state; -} tapi_gprs_pdp_status_info; - -typedef struct { - char num_act; - tapi_gprs_pdp_status_info info[3]; -} tapi_gprs_pdp_status_res; - -typedef struct { - char cid; - char address[20]; -} tapi_gprs_pdp_address_res; - -typedef struct { - unsigned char cid; - tapi_gprs_data_status status; - tapi_gprs_ds_status_reason reason; - unsigned char external; -} tapi_gprs_pdp_status_reason_info; - -typedef struct { - tapi_gprs_port_list_type type; - unsigned char len; - unsigned short list[MAX_GPRS_PORT_LIST]; -} tapi_gprs_port_list; - -typedef struct { - tapi_gprs_port_list tcp_list; - tapi_gprs_port_list udp_list; -} tapi_gprs_pdp_port_list_setting_info_t; - -/** - * @brief This API is used to request to Telephony Server to set PDP context define info, PDP activation. - * Access to this API is limited, we recommend you use Data Network API - * - * This function makes Dbus method call to Telephony Sever and returns immediate value. - * However it just means that the API request has been transfered to the CP successfully. - * The actual operation result is being delivered in the corresponding event asynchronously. - * - * @par Sync (or) Async: - * This is an Asynchronous API. - * - * @par Important Notes: - * -NONE - * - * @warning - * - None. - * - * @param[in] pNet_start_req_info - * - This input has the PDP context define info, PDP activation info #tapi_ps_net_start_req_t - * - * @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_PS_PDP_ACT_RSP and the event data is #tapi_ps_pdp_info_t. - * - * - * @pre - * - A dbus connection is established with #tel_init - * - The application name is registered with #tel_register_app_name - * - The application is registered events to listen asynchronous response with #tel_register_event - * - A event loop is running to listen events - * - * @post - * - None. - * - * @return Return Type (int) \n - * - Integer '0' - indicating that the operation has completed successfully. \n - * - Negative integer : it provides an error code (Refer #TapiResult_t) - * - * @par Prospective Clients: - * External Apps. - * - * @code - * #include - * - * int ret_status; - * int request_id = 0; - * tapi_ps_net_start_req_t start_req; - * - * start_req.cont_id = CONTEXT_ID; //use proper id regarding upper layer usage - * strcpy(start_req.pdp_info.apn, APN_ADDRESS); - * - * ret_status = tel_activate_gprs_pdp (&start_req, &request_id); - * @endcode - * - * @see - * - None. - * - * @remarks - * - None. - */ -/*================================================================================================*/ -int tel_activate_gprs_pdp(const tapi_ps_net_start_req_t *pNet_start_req_info, int *pRequestID); - -/** - * @brief This API is used to request to Telephony Server to deactivate PDP service - * Access to this API is limited, we recommend you use Data Network API - * - * This function makes Dbus method call to Telephony Sever and returns immediate value. - * However it just means that the API request has been transfered to the CP successfully. - * The actual operation result is being delivered in the corresponding event asynchronously. - * - * @par Sync (or) Async: - * This is an Asynchronous API. - * - * @par Important Notes: - * -NONE - * - * @warning - * - None. - * - * @param[in] net_stop_req_info - * - This input has the PDP context define info, PDP activation info #tapi_ps_net_start_req_t - * - * @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_PS_PDP_DEACT_RSP and the event data is #tapi_ps_pdp_info_t. - * - * - * @pre - * - A dbus connection is established with #tel_init - * - The application name is registered with #tel_register_app_name - * - The application is registered events to listen asynchronous response with #tel_register_event - * - A event loop is running to listen events - * - * @post - * - None. - * - * @return Return Type (int) \n - * - Integer '0' - indicating that the operation has completed successfully. \n - * - Negative integer : it provides an error code (Refer #TapiResult_t) - * - * @par Prospective Clients: - * External Apps. - * - * @code - * #include - * - * int ret_status; - * int request_id = 0; - * tapi_ps_net_stop_req_t end_req; - * - * 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); //use context id which is used in activate time - * @endcode - * - * @see - * - None. - * - * @remarks - * - None. - */ -/*================================================================================================*/ -int tel_deactivate_gprs_pdp(const tapi_ps_net_stop_req_t *net_stop_req_info, int *pRequestID); - -/** - * @brief This API is used to send modem data channels to dormant state for power saving when there is no data flowing for certain time - * Access to this API is limited, we recommend you use Data Network API - * - * This function makes Dbus method call to Telephony Sever and returns immediate value. - * However it just means that the API request has been transfered to the CP successfully. - * The actual operation result is being delivered in the corresponding event asynchronously. - * - * @par Sync (or) Async: - * This is an Asynchronous API. - * - * @par Important Notes: - * -NONE - * - * @warning - * - 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_PS_DATA_DORMANT_RESP and the event data is #TelTapiGprsDataDormancy_t. - * - * @pre - * - A dbus connection is established with #tel_init - * - The application name is registered with #tel_register_app_name - * - The application is registered events to listen asynchronous response with #tel_register_event - * - A event loop is running to listen events - * - * @post - * - None. - * - * @return Return Type (int) \n - * - Integer '0' - indicating that the operation has completed successfully. \n - * - Negative integer : it provides an error code (Refer #TapiResult_t) - * - * @par Prospective Clients: - * External Apps. - * - * @code - * #include - * - * int ret_status; - * int request_id = 0; - * - * ret_status = tel_set_gprs_dormant(&request_id); //if user want to dormant state - * @endcode - * - * @see - * - None. - * - * @remarks - * - None. - */ -/*================================================================================================*/ -int tel_set_gprs_dormant(int *pRequestID); - -/** - * @brief This API is used to get port list - * Access to this API is limited, we recommend you use Data Network API - * - * This function makes Dbus method call to Telephony Sever and returns immediate value. - * However it just means that the API request has been transfered to the CP successfully. - * The actual operation result is being delivered in the corresponding event asynchronously. - * - * @par Sync (or) Async: - * This is an Asynchronous API. - * - * @par Important Notes: - * -NONE - * - * @warning - * - 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_PS_PDP_GET_PORTLIST_RSP and the event data is #tapi_gprs_pdp_port_list_setting_info_t. - * - * @pre - * - A dbus connection is established with #tel_init - * - The application name is registered with #tel_register_app_name - * - The application is registered events to listen asynchronous response with #tel_register_event - * - A event loop is running to listen events - * - * @post - * - None. - * - * @return Return Type (int) \n - * - Integer '0' - indicating that the operation has completed successfully. \n - * - Negative integer : it provides an error code (Refer #TapiResult_t) - * - * @par Prospective Clients: - * External Apps. - * - * @code - * #include - * - * int ret_val; - * int requestId = 0; - * - * ret_val = tel_get_gprs_port_list(&requestId); //get port list with async response. current return value means whether request send low layer properly or not - * @endcode - * - * @see - * - None. - * - * @remarks - * - None. - */ -/*================================================================================================*/ -int tel_get_gprs_port_list(int *pRequestID); - -/** - * @brief This API is used to set port list - * Access to this API is limited, we recommend you use Data Network API - * - * This function makes Dbus method call to Telephony Sever and returns immediate value. - * However it just means that the API request has been transfered to the CP successfully. - * The actual operation result is being delivered in the corresponding event asynchronously. - * - * @par Sync (or) Async: - * This is an Asynchronous API. - * - * @par Important Notes: - * -NONE - * - * @warning - * - None. - * - * @param[in] info - * - This input has the TCP/UDP port list information info #tapi_gprs_pdp_port_list_setting_info_t - * - * @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: - * -None - * - * @pre - * - A dbus connection is established with #tel_init - * - The application name is registered with #tel_register_app_name - * - The application is registered events to listen asynchronous response with #tel_register_event - * - A event loop is running to listen events - * - * @post - * - None. - * - * @return Return Type (int) \n - * - Integer '0' - indicating that the operation has completed successfully. \n - * - Negative integer : it provides an error code (Refer #TapiResult_t) - * - * @par Prospective Clients: - * External Apps. - * - * @code - * #include - * - * int ret_val; - * int requestId = 0; - * tapi_gprs_pdp_port_list_setting_info_t test; - * - * memset(&test, 0, sizeof(tapi_gprs_pdp_port_list_setting_info_t)); - * test.tcp_list.type = TAPI_GPRS_PORT_LIST_NOT_USE; - * test.tcp_list.len = 1; - * test.tcp_list.list[0] = 1004; - * test.udp_list.type = TAPI_GPRS_PORT_LIST_NOT_USE; - * test.udp_list.len = 1; - * test.udp_list.list[i] = 1111; - * - * ret_val = tel_set_gprs_port_list(&test, &requestId); //get operation result with async response. current return value means whether request send low layer properly or not - * - * @endcode - * - * @see - * - None. - * - * @remarks - * - None. - */ -/*================================================================================================*/ -int tel_set_gprs_port_list(tapi_gprs_pdp_port_list_setting_info_t *info, int *pRequestID); - - -/** - * @brief This API is used to request BT Dun enable or disable - * Access to this API is limited, we recommend you use Data Network API - * - * This function makes Dbus method call to Telephony Sever and returns immediate value. - * However it just means that the API request has been transfered to the CP successfully. - * The actual operation result is being delivered in the corresponding event asynchronously. - * - * @par Sync (or) Async: - * This is an Asynchronous API. - * - * @par Important Notes: - * -NONE - * - * @warning - * - None. - * - * @param[in] pincontrol - * - This input has the BT Dun pin control information #tapi_ps_btdun_pincontrol - * - * @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_PS_BTDUN_PINCONTROL_NOTI or TAPI_EVENT_PS_ERROR_IND. - * -In success, the event associated is TAPI_EVENT_PS_BTDUN_PINCONTROL_NOTI and the event data is #tapi_ps_btdun_pincontrol. - * In fail, the event associated is TAPI_EVENT_PS_ERROR_IND and the event data is #tapi_gprs_error_info_t. - * - * @pre - * - A dbus connection is established with #tel_init - * - The application name is registered with #tel_register_app_name - * - The application is registered events to listen asynchronous response with #tel_register_event - * - A event loop is running to listen events - * - * @post - * - None. - * - * @return Return Type (int) \n - * - Integer '0' - indicating that the operation has completed successfully. \n - * - Negative integer : it provides an error code (Refer #TapiResult_t) - * - * @par Prospective Clients: - * External Apps. - * - * @code - * #include - * - * 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); //get control result with async response. current return value means whether request send low layer properly or not - * @endcode - * - * @see - * - None. - * - * @remarks - * - None. - */ -/*================================================================================================*/ - -#ifdef __cplusplus -} -#endif - -#endif //_ITAPI_PS_H_ - -/** - * @} - */ diff --git a/wearable/include/ITapiPhonebook.h b/wearable/include/ITapiPhonebook.h deleted file mode 100755 index d116d60..0000000 --- a/wearable/include/ITapiPhonebook.h +++ /dev/null @@ -1,547 +0,0 @@ -/* - * libslp-tapi - * - * Copyright (c) 2012 Samsung Electronics Co., Ltd. All rights reserved. - * - * Contact: Ja-young Gu - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT 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 PHONEBOOK_TAPI PHONEBOOK -* @{ -* -* @file ITapiPhonebook.h - - @brief This file serves as a "C" header file defines functions for Tapi SIM phonebook Services.\n - It contains a sample set of function prototypes that would be required by applications. - -*/ - -#ifndef _ITAPI_PHONEBOOK_H_ -#define _ITAPI_PHONEBOOK_H_ - -#include -#include -#include -#include - -#ifdef __cplusplus -extern "C" -{ -#endif - -/** - * @brief This function is used to get current inserted SIM phonebook init status, available phonebook list and first valid index in case of FDN, ADN, 3G phonebook. - * Access to this API is limited to in-house application and we recommend you use phonebook-engine APIs. - * - * @par Sync (or) Async: - * This is an synchronous API. - * - * @par Important Notes: - * - We recommend to use phonebook-engine APIs for handling phonebook(including SIM phonebook). - * If user uses SIM phonebook related APIs directly, it can break device phonebook consistency because all phonebook information managed in phonebook-engine. - * pb_list and first_index value are available at init_completed status is '1' only. - * - * @warning - * - None. - * - * @param [in] handle - * - handle from tel_init(). - * - * @param [out] init_completed - * - phonebook init status. '0' is not init, '1' is init complete to use. - * - * @param [out] pb_list - * - available SIM phonebook list. This value is valid in phonebook init complete case. - * - * @par Async Response Message: - * - None. - * - * @pre - * - None. - * - * @post - * - None. - * - * @return Return Type (int) \n - * - Integer '0' ( same with TAPI_API_SUCCESS ) - indicating that the operation has completed successfully. \n - * - Negative integer : it provides an error code (Refer #TapiResult_t) - * - * @par Prospective Clients: - * External Apps. - * - * @see None - * - * @code - * #include - * int err_code = 0; - * TelSimPbList_t pb_list = {0,}; - * int pPbInitCompleted = 0; // init or not - * TapiHandle *handle; // handle given by tel_init() - * - * // GET SIM PHONEBOOK INIT INFORMATION - * err_code = tel_get_sim_pb_init_info(handle, &pPbInitCompleted, &pb_list); - * @endcode - * - * @remarks None - * - */ -/*================================================================================================*/ -int tel_get_sim_pb_init_info(TapiHandle *handle, int *init_completed, TelSimPbList_t *pb_list); - - -/** - * @brief This API is used to get number of used records and total records in specific SIM phonebook type. - * Access to this API is limited to in-house application and we recommend you use phonebook-engine APIs. - * - * This function makes Dbus method call to Telephony Sever and returns immediate value. - * However it just means that the API request has been transfered to the CP successfully. - * The actual operation result is being delivered in the corresponding event asynchronously. - * - * @par Sync (or) Async: - * This is an Asynchronous API. - * - * @par Important Notes: - * - We recommend to use phonebook-engine APIs for handling phonebook(including SIM phonebook). - * If user uses SIM phonebook related APIs directly, it can break device phonebook consistency because all phonebook information managed in phonebook-engine. - * - * @warning - * - None. - * - * - * @param [in] handle - * - handle from tel_init(). - * - * @param[in] pb_type - * -Different storage types to be selected in SIM. #TelSimPbType_t - * - * @param [in] callback - * - To register callback function for result. - * - * @param [in] user_data - * - user_data for user specification. - * - * @par Async Response Message: - * The event data is #TelSimPbStorageInfo_t. - * Asynchronous return status is indicated by #TelSimPbAccessResult_t. - * - * @pre - * - A dbus connection is established with #tel_init - * - The application name is registered with #tel_register_app_name - * - The application is registered events to listen asynchronous response with #tel_register_event - * - A event loop is running to listen events - * - * @post - * - None. - * - * @return Return Type (int) \n - * - Integer '0' ( same with TAPI_API_SUCCESS ) - indicating that the operation has completed successfully. \n - * - Negative integer : it provides an error code (Refer #TapiResult_t) - * - * @par Prospective Clients: - * External Apps. - * - * @see None - * - * @code - * #include - * int err_code = 0; - * int request_id = 0; - * TapiHandle *handle; // handle given by tel_init() - * tapi_response_cb callback; // Initialized callback function pointer in which response is returned - * TelSimPbType_t storage_type = 0x00; - * storage_type = TAPI_SIM_PB_3GSIM; // usim phonebook - * err_code = tel_get_sim_pb_count(handle, storage_type, callback, &request_id); - * @endcode - * - * @remarks None - * - */ -/*================================================================================================*/ -int tel_get_sim_pb_count(TapiHandle *handle, TelSimPbType_t pb_type, tapi_response_cb callback, void *user_data); - - -/** - * @brief This API is used to get max text length and max number length supported by SIM phone book elementary file. - * Access to this API is limited to in-house application and we recommend you use phonebook-engine APIs. - * - * This function makes Dbus method call to Telephony Sever and returns immediate value. - * However it just means that the API request has been transfered to the CP successfully. - * The actual operation result is being delivered in the corresponding event asynchronously. - * - * @par Sync (or) Async: - * This is an Asynchronous API. - * - * @par Important Notes: - * - The max number length includes the storage space provided by the corresponding EXT file for a given Dialling Number file. - * - We recommend to use phonebook-engine APIs for handling phonebook(including SIM phonebook). - * If user uses SIM phonebook related APIs directly, it can break device phonebook consistency because all phonebook information managed in phonebook-engine. - * - * @warning - * - None. - * - * @param [in] handle - * - handle from tel_init(). - * - * @param[in] pb_type - * -Different storage types to be selected in SIM. #TelSimPbType_t - * - * @param [in] callback - * - To register callback function for result. - * - * @param [in] user_data - * - user_data for user specification. - * - * @par Async Response Message: - * The event data is #TelSimPbEntryInfo_t. - * Asynchronous return status is indicated by #TelSimPbAccessResult_t. - * - * @pre - * - A dbus connection is established with #tel_init - * - The application name is registered with #tel_register_app_name - * - The application is registered events to listen asynchronous response with #tel_register_event - * - A event loop is running to listen events - * - * @post - * - None. - * - * @return Return Type (int) \n - * - Integer '0' ( same with TAPI_API_SUCCESS ) - indicating that the operation has completed successfully. \n - * - Negative integer : it provides an error code (Refer #TapiResult_t) - * - * @par Prospective Clients: - * External Apps. - * - * @see None - * - * @code - * #include - * int err_code = 0; - * int request_id = 0; - * TapiHandle *handle; // handle given by tel_init() - * tapi_response_cb callback; // Initialized callback function pointer in which response is returned - * TelSimPbType_t storage_type = 0x00; - * storage_type = TAPI_SIM_PB_ADN; // ADN phonebook - * err_code = tel_get_sim_pb_meta_info(handle, storage_type, callback, &request_id); - * @endcode - * - * @remarks None - * - */ -/*================================================================================================*/ -int tel_get_sim_pb_meta_info(TapiHandle *handle, TelSimPbType_t pb_type, tapi_response_cb callback, void *user_data); - - -/** - * @brief This API is used to get SIM 3G phonebook supported EFs like ANR, SNE, GRP, EMAIL etc and corresponding EFs max text length, number length and size. - * Access to this API is limited to in-house application and we recommend you use phonebook-engine APIs. - * - * This function makes Dbus method call to Telephony Sever and returns immediate value. - * However it just means that the API request has been transfered to the CP successfully. - * The actual operation result is being delivered in the corresponding event asynchronously. - * - * @par Sync (or) Async: - * This is an Asynchronous API. - * - * @par Important Notes: - * - We recommend to use phonebook-engine APIs for handling phonebook(including SIM phonebook). - * If user uses SIM phonebook related APIs directly, it can break device phonebook consistency because all phonebook information managed in phonebook-engine. - * - * @warning - * - None. - * - * @param [in] handle - * - handle from tel_init(). - * - * @param [in] callback - * - To register callback function for result. - * - * @param [in] user_data - * - user_data for user specification. - * - * @par Async Response Message: - * The event data is #TelSimPbCapabilityInfo_t. - * Asynchronous return status is indicated by #TelSimPbAccessResult_t. - * - * @pre - * - A dbus connection is established with #tel_init - * - The application name is registered with #tel_register_app_name - * - The application is registered events to listen asynchronous response with #tel_register_event - * - A event loop is running to listen events - * - * @post - * - None. - * - * @return Return Type (int) \n - * - Integer '0' ( same with TAPI_API_SUCCESS ) - indicating that the operation has completed successfully. \n - * - Negative integer : it provides an error code (Refer #TapiResult_t) - * - * @par Prospective Clients: - * External Apps. - * - * @see None - * - * @code - * #include - * int err_code = 0; - * int request_id = 0; - * TapiHandle *handle; // handle given by tel_init() - * tapi_response_cb callback; // Initialized callback function pointer in which response is returned - * err_code = tel_get_sim_pb_usim_meta_info(handle, callback, &request_id); - * @endcode - * - * @remarks None - * - */ -/*================================================================================================*/ -int tel_get_sim_pb_usim_meta_info(TapiHandle *handle, tapi_response_cb callback, void *user_data); - - -/** - * @brief This API is used to read SIM phone book entry information from given storage type and index. - * Access to this API is limited to in-house application and we recommend you use phonebook-engine APIs. - * - * This function makes Dbus method call to Telephony Sever and returns immediate value. - * However it just means that the API request has been transfered to the CP successfully. - * The actual operation result is being delivered in the corresponding event asynchronously. - * - * @par Sync (or) Async: - * This is an Asynchronous API. - * - * @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. - * - We recommend to use phonebook-engine APIs for handling phonebook(including SIM phonebook). - * If user uses SIM phonebook related APIs directly, it can break device phonebook consistency because all phonebook information managed in phonebook-engine. - * - * @warning - * - None. - * - * @param [in] handle - * - handle from tel_init(). - * - * @param[in] pb_type - * -Different storage types to be selected in SIM. #TelSimPbType_t - * - * @param[in] index - * -Index for accessing the SIM data. - * - * @param [in] callback - * - To register callback function for result. - * - * @param [in] user_data - * - user_data for user specification. - * - * @par Async Response Message: - * The event data is #TelSimPbRecord_t. - * Asynchronous return status is indicated by #TelSimPbAccessResult_t. - * - * @pre - * - A dbus connection is established with #tel_init - * - The application name is registered with #tel_register_app_name - * - The application is registered events to listen asynchronous response with #tel_register_event - * - A event loop is running to listen events - * - * @post - * - None. - * - * @return Return Type (int) \n - * - Integer '0' ( same with TAPI_API_SUCCESS ) - indicating that the operation has completed successfully. \n - * - Negative integer : it provides an error code (Refer #TapiResult_t) - * - * @par Prospective Clients: - * External Apps. - * - * @see None - * - * @code - * #include - * int err_code = 0; - * int request_id = 0; - * TapiHandle *handle; // handle given by tel_init() - * tapi_response_cb callback; // Initialized callback function pointer in which response is returned - * unsigned short index = 1; - * TelSimPbType_t storage_type = 0x00; - * storage_type = TAPI_SIM_PB_3GSIM; // usim phonebook - * err_code = tel_read_sim_pb_record(handle, storage_type, index, callback, &request_id); - * @endcode - * - * @remarks None - * - */ -/*================================================================================================*/ -int tel_read_sim_pb_record(TapiHandle *handle, TelSimPbType_t pb_type, unsigned short index, tapi_response_cb callback, void *user_data); - - -/** - * @brief This API is used to add or edit SIM phone book record entry information. - * Access to this API is limited to in-house application and we recommend you use phonebook-engine APIs. - * - * This function makes Dbus method call to Telephony Sever and returns immediate value. - * However it just means that the API request has been transfered to the CP successfully. - * The actual operation result is being delivered in the corresponding event asynchronously. - * - * @par Sync (or) Async: - * This is an Asynchronous API. - * - * @par Important Notes: - * - We recommend to use phonebook-engine APIs for handling phonebook(including SIM phonebook). - * If user uses SIM phonebook related APIs directly, it can break device phonebook consistency because all phonebook information managed in phonebook-engine. - * - * @warning - * - None. - * - * - * @param [in] handle - * - handle from tel_init(). - * - * @param[in] req_data - * -phonebook data which will be updated or added. #TelSimPbRecordData_t - * - * @param [in] callback - * - To register callback function for result. - * - * @param [in] user_data - * - user_data for user specification. - * - * @par Async Response Message: - * The event data is NULL. - * Asynchronous return status is indicated by #TelSimPbAccessResult_t. - * - * @pre - * - A dbus connection is established with #tel_init - * - The application name is registered with #tel_register_app_name - * - The application is registered events to listen asynchronous response with #tel_register_event - * - A event loop is running to listen events - * - * @post - * - None. - * - * @return Return Type (int) \n - * - Integer '0' ( same with TAPI_API_SUCCESS ) - indicating that the operation has completed successfully. \n - * - Negative integer : it provides an error code (Refer #TapiResult_t) - * - * @par Prospective Clients: - * External Apps. - * - * @see None - * - * @code - * #include - * int err_code = 0; - * int request_id = 0; - * TapiHandle *handle; // handle given by tel_init() - * tapi_response_cb callback; // Initialized callback function pointer in which response is returned - * unsigned short index = 1; - * TelSimPbRecord_t data; - * data.StorageFileType = TAPI_SIM_PB_3GSIM; // usim phonebook - * data.Index = 1; // index which will be updated - * data.NextIndex = 0; - * //data.ContactInfo will be added - * err_code = tel_update_sim_pb_record(handle, &data, callback, &request_id); - * @endcode - * - * @remarks None - * - */ -/*================================================================================================*/ -int tel_update_sim_pb_record(TapiHandle *handle, const TelSimPbRecord_t *req_data, tapi_response_cb callback, void *user_data); - - -/** - * @brief This API is used to delete a SIM phonebook record. - * Access to this API is limited to in-house application and we recommend you use phonebook-engine APIs. - * - * This function makes Dbus method call to Telephony Sever and returns immediate value. - * However it just means that the API request has been transfered to the CP successfully. - * The actual operation result is being delivered in the corresponding event asynchronously. - * - * @par Sync (or) Async: - * This is an Asynchronous API. - * - * @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. - * - We recommend to use phonebook-engine APIs for handling phonebook(including SIM phonebook). - * If user uses SIM phonebook related APIs directly, it can break device phonebook consistency because all phonebook information managed in phonebook-engine. - * - * @warning - * - None. - * - * - * @param [in] handle - * - handle from tel_init(). - * - * @param[in] pb_type - * -Different storage types to be selected in SIM. #TelSimPbType_t - * - * @param[in] index - * -Index of the record to be deleted. - * - * @param [in] callback - * - To register callback function for result. - * - * @param [in] user_data - * - user_data for user specification. - * - * @par Async Response Message: - * The event data is NULL. - * Asynchronous return status is indicated by #TelSimPbAccessResult_t. - * - * @pre - * - A dbus connection is established with #tel_init - * - The application name is registered with #tel_register_app_name - * - The application is registered events to listen asynchronous response with #tel_register_event - * - A event loop is running to listen events - * - * @post - * - None. - * - * @return Return Type (int) \n - * - Integer '0' ( same with TAPI_API_SUCCESS ) - indicating that the operation has completed successfully. \n - * - Negative integer : it provides an error code (Refer #TapiResult_t) - * - * @par Prospective Clients: - * External Apps. - * - * @see None - * - * @code - * #include - * int err_code = 0; - * int request_id = 0; - * TapiHandle *handle; // handle given by tel_init() - * tapi_response_cb callback; // Initialized callback function pointer in which response is returned - * unsigned short index = 1; - * TelSimPbType_t storage_type = 0x00; - * storage_type = TAPI_SIM_PB_3GSIM; // usim phonebook - * err_code = tel_delete_sim_pb_record(handle, storage_type, index, callback, &request_id); - * @endcode - * - * @remarks None - * - */ -/*================================================================================================*/ -int tel_delete_sim_pb_record(TapiHandle *handle, TelSimPbType_t pb_type, unsigned short index, tapi_response_cb callback, void *user_data); - -#ifdef __cplusplus -} -#endif - -#endif /* _ITAPI_PHONEBOOK_H_ */ - -/** -* @} -*/ diff --git a/wearable/include/ITapiSap.h b/wearable/include/ITapiSap.h deleted file mode 100644 index c23bd37..0000000 --- a/wearable/include/ITapiSap.h +++ /dev/null @@ -1,433 +0,0 @@ -/* - * libslp-tapi - * - * Copyright (c) 2012 Samsung Electronics Co., Ltd. All rights reserved. - * - * Contact: Ja-young Gu - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT 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 SAP_TAPI SAP -* @{ -* -* @file ITapiSap.h - - @brief This file serves as a "C" header file defines functions for Tapi SAP Services.\n - It contains a sample set of function prototypes that would be required by applications. - -*/ - -#ifndef _ITAPI_SAP_H_ -#define _ITAPI_SAP_H_ - -#include -#include -#include -#include - -#ifdef __cplusplus -extern "C" -{ -#endif - -/** - * @brief This API is used to request to connect sap. - * - * @par Sync (or) Async: - * This is an Asynchronous API. - * - * @par Important Notes: - * - None - * - * @warning - * - None. - * - * @param [in] handle - * - handle from tel_init(). - * - * @param[in] max_msg_size - * - * @param [in] callback - * - To register callback function for result. - * - * @param [in] user_data - * - user_data for user specification. - * - * @par - * - * @pre - * - * @post - * - * @return Return Type (int) \n - * - Integer '0' ( same with TAPI_API_SUCCESS ) - indicating that the operation has completed successfully. \n - * - Negative integer : it provides an error code (Refer #TapiResult_t) - * - * @par Prospective Clients: - * External Apps. - * - * @see None - * - * @code - * - * @endcode - * - * @remarks None - * - */ -/*================================================================================================*/ -int tel_req_sap_connect(TapiHandle *handle, int max_msg_size, tapi_response_cb callback, void *user_data); - -/** - * @brief This API is used to request sap to disconnect sap. - * - * @par Sync (or) Async: - * This is an Asynchronous API. - * - * @par Important Notes: - * - None - * - * @warning - * - None. - * - * @param [in] handle - * - handle from tel_init(). - * - * @param [in] callback - * - To register callback function for result. - * - * @param [in] user_data - * - user_data for user specification. - * - * @par - * - * @pre - * - * @post - * - * @return Return Type (int) \n - * - Integer '0' ( same with TAPI_API_SUCCESS ) - indicating that the operation has completed successfully. \n - * - Negative integer : it provides an error code (Refer #TapiResult_t) - * - * @par Prospective Clients: - * External Apps. - * - * @see None - * - * @code - * - * @endcode - * - * @remarks None - * - */ -/*================================================================================================*/ -int tel_req_sap_disconnect(TapiHandle *handle, tapi_response_cb callback, void *user_data); - -/** - * @brief This API is used to request sap connection status. - * - * @par Sync (or) Async: - * This is an Asynchronous API. - * - * @par Important Notes: - * - None - * - * @warning - * - None. - * - * @param [in] handle - * - handle from tel_init(). - * - * @param [in] callback - * - To register callback function for result. - * - * @param [in] user_data - * - user_data for user specification. - * - * @par - * - * @pre - * - * @post - * - * @return Return Type (int) \n - * - Integer '0' ( same with TAPI_API_SUCCESS ) - indicating that the operation has completed successfully. \n - * - Negative integer : it provides an error code (Refer #TapiResult_t) - * - * @par Prospective Clients: - * External Apps. - * - * @see None - * - * @code - * - * @endcode - * - * @remarks None - * - */ -/*================================================================================================*/ -int tel_req_sap_connection_status(TapiHandle *handle, tapi_response_cb callback, void *user_data); - -/** - * @brief This API is used to request to get atr. - * - * @par Sync (or) Async: - * This is an Asynchronous API. - * - * @par Important Notes: - * - None - * - * @warning - * - None. - * - * @param [in] handle - * - handle from tel_init(). - * - * @param [in] callback - * - To register callback function for result. - * - * @param [in] user_data - * - user_data for user specification. - * - * @par - * - * @pre - * - * @post - * - * @return Return Type (int) \n - * - Integer '0' ( same with TAPI_API_SUCCESS ) - indicating that the operation has completed successfully. \n - * - Negative integer : it provides an error code (Refer #TapiResult_t) - * - * @par Prospective Clients: - * External Apps. - * - * @see None - * - * @code - * - * @endcode - * - * @remarks None - * - */ -/*================================================================================================*/ -int tel_req_sap_transfer_atr(TapiHandle *handle, tapi_response_cb callback, void *user_data); - -/** - * @brief This API is used to request to transfer apdu. - * - * @par Sync (or) Async: - * This is an Asynchronous API. - * - * @par Important Notes: - * - None - * - * @warning - * - None. - * - * @param [in] handle - * - handle from tel_init(). - * - * @param [in] apdu_data - * - * @param [in] callback - * - To register callback function for result. - * - * @param [in] user_data - * - user_data for user specification. - * - * @par - * - * @pre - * - * @post - * - * @return Return Type (int) \n - * - Integer '0' ( same with TAPI_API_SUCCESS ) - indicating that the operation has completed successfully. \n - * - Negative integer : it provides an error code (Refer #TapiResult_t) - * - * @par Prospective Clients: - * External Apps. - * - * @see None - * - * @code - * - * @endcode - * - * @remarks None - * - */ -/*================================================================================================*/ -int tel_req_sap_transfer_apdu(TapiHandle *handle, TelSapApduData_t *apdu_data, tapi_response_cb callback, void *user_data); - -/** - * @brief This API is used to request to transport protocol. - * - * @par Sync (or) Async: - * This is an Asynchronous API. - * - * @par Important Notes: - * - None - * - * @warning - * - None. - * - * @param [in] handle - * - handle from tel_init(). - * - * @param [in] protocol - * - SAP transport protocol type - * - * @param [in] callback - * - To register callback function for result. - * - * @param [in] user_data - * - user_data for user specification. - * - * @par - * - * @pre - * - * @post - * - * @return Return Type (int) \n - * - Integer '0' ( same with TAPI_API_SUCCESS ) - indicating that the operation has completed successfully. \n - * - Negative integer : it provides an error code (Refer #TapiResult_t) - * - * @par Prospective Clients: - * External Apps. - * - * @see None - * - * @code - * - * @endcode - * - * @remarks None - * - */ -/*================================================================================================*/ -int tel_req_sap_transport_protocol(TapiHandle *handle, TelSimSapProtocol_t protocol, tapi_response_cb callback, void *user_data); - -/** - * @brief This API is used to request to control power_mode. - * - * @par Sync (or) Async: - * This is an Asynchronous API. - * - * @par Important Notes: - * - None - * - * @warning - * - None. - * - * @param [in] handle - * - handle from tel_init(). - * - * @param [in] power_mode - * - enum data for controlling power mode of client - * - * @param [in] callback - * - To register callback function for result. - * - * @param [in] user_data - * - user_data for user specification. - * - * @par - * - * @pre - * - * @post - * - * @return Return Type (int) \n - * - Integer '0' ( same with TAPI_API_SUCCESS ) - indicating that the operation has completed successfully. \n - * - Negative integer : it provides an error code (Refer #TapiResult_t) - * - * @par Prospective Clients: - * External Apps. - * - * @see None - * - * @code - * - * @endcode - * - * @remarks None - * - */ -/*================================================================================================*/ -int tel_req_sap_power_operation(TapiHandle *handle, TelSimSapPowerMode_t power_mode, tapi_response_cb callback, void *user_data); - -/** - * @brief This API is used to request to get card_reader_status. - * - * @par Sync (or) Async: - * This is an Asynchronous API. - * - * @par Important Notes: - * - None - * - * @warning - * - None. - * - * @param [in] handle - * - handle from tel_init(). - * - * @param [in] callback - * - To register callback function for result. - * - * @param [in] user_data - * - user_data for user specification. - * - * @par - * - * @pre - * - * @post - * - * @return Return Type (int) \n - * - Integer '0' ( same with TAPI_API_SUCCESS ) - indicating that the operation has completed successfully. \n - * - Negative integer : it provides an error code (Refer #TapiResult_t) - * - * @par Prospective Clients: - * External Apps. - * - * @see None - * - * @code - * - * @endcode - * - * @remarks None - * - */ -/*================================================================================================*/ -int tel_req_sap_cardreader_status(TapiHandle *handle, tapi_response_cb callback, void *user_data); - -#ifdef __cplusplus -} -#endif - -#endif /* _ITAPI_SAP_H_ */ - -/** -* @} -*/ diff --git a/wearable/include/ITapiSat.h b/wearable/include/ITapiSat.h deleted file mode 100644 index c5f137b..0000000 --- a/wearable/include/ITapiSat.h +++ /dev/null @@ -1,419 +0,0 @@ -/* - * libslp-tapi - * - * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. - * - * Contact: Ja-young Gu - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT 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 ITapiSat.h - - @brief This file serves as a "C" header file defines functions for Tapi Sat Services.\n - It contains a sample set of function prototypes that would be required by applications. - - Note: Telephony SAT functionality is message relaying from USIM application to SAT related applications. - */ - -#ifndef _ITAPI_SAT_H_ -#define _ITAPI_SAT_H_ - -#include -#include -#include - -#ifdef __cplusplus -extern "C" -{ -#endif - - /** - * @brief Sends the user choice of the main menu options to the USIM. - * - * @par Notes: - * A set of possible menu options is supplied by the USIM - * using the proactive command SET UP MENU. Telephony server receives the command - * and publishes this information.SAT UI application should list the menu when it initially launched. - * If the user subsequently chooses an option, then SAT UI application replies - * the command with user's choice using this API. - * - * This API makes Dbus method call to Telephony Sever and gets immediate feedback. - * However it just means that the API request has been transfered to the CP successfully. - * The actual operation result is delivered with the async response as below. - * - * @par Warning: - * Do not use this function. This function is dedicated to the SAT UI embedded application only. - * - * @par Sync (or) Async: - * This is an Asynchronous API. - * - * @param [in] handle - * - handle from tel_init(). - * - * @param [in] pMenuSelect - * - #TelSatMenuSelectionReqInfo_t contains information like which SAT menu item has been selected or whether Help is required. - * - * @param [in] callback - * - To register callback function for result. - * - * @param [in] user_data - * - user_data for user specification. - * - * @par Async Response Message: - * - The event associated is TAPI_EVENT_SAT_MENU_SELECTION_CNF and the Asynchronous return status is indicated by #TelSatEnvelopeResp_t. - * - * @pre - * - This function supposed to be called after getting TAPI_EVENT_SAT_SETUP_MENU_IND event from telephony server\n - * - * @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: - * SAT-UI - * - * @see tel_get_sat_main_menu_info - * - * @code - * #include - * int ret_status =0; - * TapiHandle *handle; // Handle given by tel_init() - * tapi_response_cb callback; //Initialized call-back function pointer in which response is returned - * TelSatMenuSelectionReqInfo_t selected_menu; - * void *user_data; // Set User data - * selected_menu.itemIdentifier = '1'; //selected menu num - * selected_menu.bIsHelpRequested = 0; - * ret_status = tel_select_sat_menu(handle, &selected_menu, callback, user_data); - * @endcode - * - * @remarks None - * - * - */ -/*================================================================================================*/ -int tel_select_sat_menu(TapiHandle *handle, const TelSatMenuSelectionReqInfo_t* pMenuSelect, tapi_response_cb callback, void *user_data); - - /** - * @brief Download SAT events to USIM - * - * @par Notes: - * A set of events for the terminal to monitor can be supplied by the USIM using the proactive command SET UP EVENT - * LIST. If the USIM has sent this command, and an event which is part of the list subsequently occurs, the terminal - * informs the USIM using this function, relevant for that event. - * If USIM commands to monitor a browser termination event, the SAT-UI application has to call this function. - * - * This API makes Dbus method call to Telephony Sever and gets immediate feedback. - * However it just means that the API request has been transfered to the CP successfully. - * The actual operation result is delivered with the async response as below. - * - * @par Warning: - * Do not use this function. This function is dedicated to the SAT UI embedded application only. - * - * @par Sync (or) Async: - * This is an Asynchronous API. - * - * @param [in] handle - * - handle from tel_init(). - * - * @param [in] pEventData - * - #TelSatEventDownloadReqInfo_t contains the necessary parameters like event type and information associated with it. - * - * @param [in] callback - * - To register callback function for result. - * - * @param [in] user_data - * - user_data for user specification. - * - * @par Async Response Message: - * - The event associated is TAPI_EVENT_SAT_EVENT_DOWNLOAD_CNF and the Asynchronous return status is indicated by #TelSatEnvelopeResp_t. - * - * @pre - * - A SET UP EVENT LIST proactive command supplies a set of event to monitor. - * - * @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: - * SAT-UI - * - * @see None - * - * @code - * #include - * int ret_status =0; - * TapiHandle *handle; // Handle given by tel_init() - * tapi_response_cb callback; //Initialized call-back function pointer in which response is returned - * TelSatEventDownloadReqInfo_t pEventData; - * void *user_data; // Set User data - * pEventData.eventDownloadType = TAPI_EVENT_SAT_DW_TYPE_IDLE_SCREEN_AVAILABLE; - * pEventData.u.bIdleScreenAvailable = 1; //event occur or not - * ret_status = tel_download_sat_event(handle, &pEventData, callback, user_data); - * @endcode - * - * @remarks None - * - * - */ -/*================================================================================================*/ -int tel_download_sat_event(TapiHandle *handle, const TelSatEventDownloadReqInfo_t* pEventData, tapi_response_cb callback, void *user_data); - - /** - * @brief Send the UI display status of the alpha identifier of a specific proactive command to Telephony Server. - * - * When SAT-UI receives a proactive command, SAT-UI should draw a UI for relevant command. - * As it completes , SAT-UI inform USIM with this function. Afterwards, USIM is getting ready to send another commands. - * - * This function makes Dbus method call to Telephony Sever and gets immediate feedback. - * - * @par Warning: - * Do not use this function. This function is dedicated to the SAT UI embedded application only. - * - * @par Sync (or) Async: - * This is a Synchronous API. - * - * @param [in] handle - * - handle from tel_init(). - * - * @param [in] commandId - * - Specific proactive command id from the Application - * - * @param [in] status - * - #TelSatUiDisplayStatusType_t contain display status(SUCCESS/FAIL). - * - * @par Async Response Message: - * - None. - * - * @pre - * - Display request for the alpha identifier of a Proactive Command should be sent by Telephony Server. - * - * @post - * - If the display status is SUCCESS Telephony Server sends a request to application for Proactive Command Execution. - * - If the display status is FAIL Telephony Server sends Terminal Response for the Proactive Command. - * - * @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: - * SAT-UI - * - * @see None - * - * @code - * #include - * int commandId = 1; //this value should be server given value - * TapiHandle *handle; // Handle given by tel_init() - * ret_status = 0; - * ret_status = tel_send_sat_ui_display_status(handle, commandId, TAPI_SAT_DISPLAY_SUCCESS); - * @endcode - * - * @remarks None - * - * - */ -/*================================================================================================*/ -int tel_send_sat_ui_display_status(TapiHandle *handle, int commandId, TelSatUiDisplayStatusType_t status); - - /** - * @brief This function sends the UI User confirmation data for a specific Proactive Command to the Telephony Server. - * - * In case that the proactive commands need user response, SAT-UI can send it using this function. - * The response can be 'OK', 'Cancel', 'Move Back' and 'End Session'. Upon this response, USIM can send - * a proactive command subsequently to indicate next UI action. - * - * This function makes Dbus method call to Telephony Sever and gets immediate feedback. - * - * @par Warning: - * Do not use this function. This function is dedicated to the SAT UI embedded application only. - * - * @par Sync (or) Async: - * This is a synchronous API. - * - * @param [in] handle - * - handle from tel_init(). - * - *@param [in] pUserConfirmData - * -#TelSatUiUserConfirmInfo_t contains Specific user confirmation data. - * - * @par Async Response Message: - * - None - * - * @pre - * - User Confirmation request for a specific Proactive Command should be sent to application by Telephony Server. - * - * @post - * - If the User Confirmation is positive Telephony Server sends a request to application for Proactive Command Execution. - * - If the User Confirmation is negative Telephony Server sends Terminal Response for the Proactive Command. - * - * @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: - * SAT-UI - * - * @see None - * - * @code - * #include - * int ret_status =0; - * TelSatUiUserConfirmInfo_t cfm_data; - * TapiHandle *handle; // Handle given by tel_init() - * cfm_data.commandId = '1'; //this value should be server given value - * cfm_data.commandType = TAPI_SAT_CMD_TYPE_SETUP_CALL; - * cfm_data.keyType = TAPI_SAT_USER_CONFIRM_YES; - * ret_status = tel_send_sat_ui_user_confirm(handle, &cfm_data); - * @endcode - * - * @remarks None - * - * - */ -/*================================================================================================*/ -int tel_send_sat_ui_user_confirm(TapiHandle *handle, TelSatUiUserConfirmInfo_t *pUserConfirmData); - - /** - * @brief This function provides SAT(Sim Application toolkit) Main Menu information for SAT-UI. - * - * Once the USIM supplies the SET UP MENU proactive command, telephony server not only publish - * TAPI_EVENT_SAT_SETUP_MENU_IND event but also caches the menu information. - * The SAT-UI applicatoin can get the menu list using this function. - * - * This function makes Dbus method call to Telephony Sever and gets immediate feedback. - * - * @par Warning: - * Do not use this function. This function is dedicated to the SAT UI embedded application only. - * - * @par Sync (or) Async: - * This is a Synchronous API. - * - * @param [in] handle - * - handle from tel_init(). - * - * @param [out] pMainMenu - * - #TelSatSetupMenuInfo_t contain all menu related information which are required like menu title, icon, item count, etc. - * - * @par Async Response Message: - * - None - * - * @pre - * - When SAT SIM is inserted. we can get meaningful data. without SAT SIM, Null is returned - * - * @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: - * SAT-UI - * - * @see tel_select_sat_menu - * - * @code - * #include - * int ret_status =0; - * TapiHandle *handle; // Handle given by tel_init() - * TelSatSetupMenuInfo_t menu; //this struct will be pull up with SIM menu info - * ret_status = tel_get_sat_main_menu_info(handle, &menu); - * @endcode - * - * @remarks None - * - * - */ -/*================================================================================================*/ -int tel_get_sat_main_menu_info(TapiHandle *handle, TelSatSetupMenuInfo_t *pMainMenu); - - /** - * @brief This API provides the Operation result(s) for the Proactive Command execution by the Application(s) to the Telephony Server. - * - * The USIM commands the terminal to do some predefined action, such as sending short message, - * making a voice call, launching an Internet browser and so on. Those actions are defined by 3GPP TS31.111. - * Once a application executes the requested action by USIM, it reports the operation result to USIM using this function. - * - * This function makes Dbus method call to Telephony Sever and gets immediate feedback. - * - * @par Warning: - * Do not use this function. This function is dedicated to the SAT UI embedded application only. - ** - * @par Sync (or) Async: - * This is a Synchronous API. - * - * @param [in] handle - * - handle from tel_init(). - * - * @param [out] pAppRetInfo - * - #TelSatAppsRetInfo_t contains execution result of a specific proactive command by application. - * - * @par Async Response Message: - * - None - * - * @pre - * - Proactive Command execution request should be sent by Telephony Server to SAT related applications. - * - * @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: - * Embeded applications which are predefined by 3GPP TS31.111 - * - * @see None - * - * @code - * #include - * int ret_status =0; -* TapiHandle *handle; // Handle given by tel_init() - * TelSatAppsRetInfo_t app_ret; - * app_ret.commandType = TAPI_SAT_CMD_TYPE_SETUP_CALL; - * app_ret.commandId = 1; //this value should be server given value - * app_ret.appsRet.setupCall.resp = TAPI_SAT_R_SUCCESS; - * ret_status = tel_send_sat_app_exec_result(handle, &app_ret); - * @endcode - * - * @remarks None - * - * - */ -/*================================================================================================*/ -int tel_send_sat_app_exec_result(TapiHandle *handle, TelSatAppsRetInfo_t *pAppRetInfo); - - -#ifdef __cplusplus -} -#endif - -#endif /* _ITAPI_SAT_H_ */ - -/** - * @} - */ diff --git a/wearable/include/ITapiSim.h b/wearable/include/ITapiSim.h deleted file mode 100644 index e0e4c23..0000000 --- a/wearable/include/ITapiSim.h +++ /dev/null @@ -1,2211 +0,0 @@ -/* - * libslp-tapi - * - * Copyright (c) 2012 Samsung Electronics Co., Ltd. All rights reserved. - * - * Contact: Ja-young Gu - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT 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 ITapiSim.h - * - * @brief This file serves as a "C" header file defines functions for Tapi SIM Services. - * It contains a sample set of function prototypes that would be required by applications. - */ - -#ifndef _ITAPI_SIM_H_ -#define _ITAPI_SIM_H_ - -#include -#include -#include -#include - -#ifdef __cplusplus -extern "C" -{ -#endif - -/* - * @brief This API is used to get SIM Card Initialization status and SIM Card Identification. - * Most of modules which require SIM data should check SIM status before using it definitely. - * - * @par Sync (or) Async: - * This is a Synchronous API. - * - * @par Important Notes: - * - Card Identification value is available in TAPI_SIM_STATUS_SIM_INIT_COMPLETED case only. - * - * @warning - * - None. - * - * @param [in] handle - * - handle from tel_init(). - * - * @param [out] sim_status - * - This parameter returns SIM initialization status from Telephony server boot up time. - * First, You can find sim existance if returned value are not in TAPI_SIM_STATUS_CARD_NOT_PRESENT and TAPI_SIM_STATUS_CARD_REMOVED. - * - * @param [out] card_changed - * - This parameter returns sim card identification value when sim_status is TAPI_SIM_STATUS_SIM_INIT_COMPLETED. - * - card_changed value just present whether current inserted SIM card differs with previous SIM or not. - * - * @par Async Response Message: - * - None - * - * @pre - * - None. - * - * @post - * - None. - * - * @return Return Type (int) - * - Integer '0' ( same with TAPI_API_SUCCESS & TAPI_SIM_ACCESS_SUCCESS ) - indicating that the operation has completed successfully. - * - Negative integer : it provides an error code before actual operations. (Refer #TapiResult_t) - * - Positive integer : it provides an error code while actual operations. (Refer to #TelSimAccessResult_t) - * - * @par Prospective Clients: - * External Apps. - * - * @see None - * - * @code - * #include - * - * int err_code = TAPI_API_SUCCESS; - * TelSimCardStatus_t status = 0x00; - * int b_card_changed = 0; - * TapiHandle *handle; // Handle given by tel_init() - * - * // GET SIM INIT INFORMATION - * err_code = tel_get_sim_init_info(handle, &status, &b_card_changed); - * - * @endcode - * - * @remarks None - * - */ -/*================================================================================================*/ -int tel_get_sim_init_info(TapiHandle *handle, TelSimCardStatus_t *sim_status, int *card_changed); - -/** - * @brief This API is used to get the Card Type whether Card is a SIM or a USIM. - * - * @par Sync (or) Async: - * This is a Synchronous API. - * - * @par Important Notes: - * - None - * - * @warning - * - None. - * - * @param [in] handle - * - handle from tel_init(). - * - * @param [out] card_type - * 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 - * - None. - * - * @post - * - None. - * - * @return Return Type (int) - * - Integer '0' ( same with TAPI_API_SUCCESS & TAPI_SIM_ACCESS_SUCCESS ) - indicating that the operation has completed successfully. - * - Negative integer : it provides an error code before actual operations. (Refer #TapiResult_t) - * - Positive integer : it provides an error code while actual operations. (Refer to #TelSimAccessResult_t) - * - * @par Prospective Clients: - * External Apps. - * - * @see None - * - * @code - * #include - * int err_code = 0; - * TelSimCardType_t cardInfo; //unkwon, sim(normally gsm), usim(normally umts) - * TapiHandle *handle; // Handle given by tel_init() - * - * err_code = tel_get_sim_type(handle, &cardInfo); - * - * @endcode - * - * @remarks None - * - */ -/*================================================================================================*/ -int tel_get_sim_type(TapiHandle *handle, TelSimCardType_t *card_type); - -/** - * @brief This API is used to get the IMSI information. - * - * @par Sync (or) Async: - * This is a Synchronous API. - * - * @par Important Notes: - * - IMSI value is the value that security needs. - * - * @warning - * - None. - * - * @param [in] handle - * - handle from tel_init(). - * - * @param [out] imsi - * This parameter returns the IMSI information. Refer #TelSimImsiInfo_t - * - * @par Async Response Message: - * - None - * - * @pre - * - User can get valid return value or make operations after SIM init complete(card status is TAPI_SIM_STATUS_SIM_INIT_COMPLETED). - * - None. - * - * @post - * - None. - * - * @return Return Type (int) - * - Integer '0' ( same with TAPI_API_SUCCESS & TAPI_SIM_ACCESS_SUCCESS ) - indicating that the operation has completed successfully. - * - Negative integer : it provides an error code before actual operations. (Refer #TapiResult_t) - * - Positive integer : it provides an error code while actual operations. (Refer to #TelSimAccessResult_t) - * - * @par Prospective Clients: - * External Apps. - * - * @see None - * - * @code - * #include - * int err_code = 0; - * TelSimImsiInfo_t sim_imsi_info; // mcc, mnc, msisdn - * err_code = tel_get_sim_imsi(handle, &sim_imsi_info); - * @endcode - * - * @remarks None - * - */ -/*================================================================================================*/ -int tel_get_sim_imsi(TapiHandle *handle, TelSimImsiInfo_t *imsi); - -/** - * @brief This API is used to get ECC(SIM) or UECC(USIM) data. - * - * @par Sync (or) Async: - * This is a Synchronous API. - * - * @par Important Notes: - * - None - * - * @warning - * - None. - * - * @param [in] handle - * - handle from tel_init(). - * - * @param [out] ecc - * - This parameter returns - * * * the SIM emergency call code information like ecc length, service type etc - * * * and number of ECC records. - * - * @par Async Response Message: - * - None - * - * @pre - * - User can get valid return value or make operations after SIM init complete(card status is TAPI_SIM_STATUS_SIM_INIT_COMPLETED). - * - None. - * - * @post - * - None. - * - * @return Return Type (int) - * - Integer '0' ( same with TAPI_API_SUCCESS & TAPI_SIM_ACCESS_SUCCESS ) - indicating that the operation has completed successfully. - * - Negative integer : it provides an error code before actual operations. (Refer #TapiResult_t) - * - Positive integer : it provides an error code while actual operations. (Refer to #TelSimAccessResult_t) - * - * @par Prospective Clients: - * External Apps. - * - * @see None - * - * @code - * #include - * int err_code = 0; - * TelSimEccList_t ecc_info = {0}; // Get ECC list info and ecc_count - * err_code = tel_get_sim_ecc(handle, &ecc_info); - * @endcode - * - * @remarks None - * - */ -/*================================================================================================*/ -int tel_get_sim_ecc(TapiHandle *handle, TelSimEccList_t *ecc); - -/** - * @brief This API is used to get Unique identification number of the (U)ICC. - * ICC means Integrated Circuit Card. - * - * @par Sync (or) Async: - * This is a Asynchronous API. - * - * @par Important Notes: - * - IC Card number value is the value that security needs. - * - * @warning - * - None. - * - * @param [in] handle - * - handle from tel_init(). - * - * @param [in] callback - * - To register callback function for result. - * - * @param [in] user_data - * - user_data for user specification. - * - * @par Async Response Message: - * - None - * - * @pre - * - User can get valid return value or make operations after SIM init complete(card status is TAPI_SIM_STATUS_SIM_INIT_COMPLETED). - * - None. - * - * @post - * - None. - * - * @return Return Type (int) - * - Integer '0' ( same with TAPI_API_SUCCESS & TAPI_SIM_ACCESS_SUCCESS ) - indicating that the operation has completed successfully. - * - Negative integer : it provides an error code before actual operations. (Refer #TapiResult_t) - * - Positive integer : it provides an error code while actual operations. (Refer to #TelSimAccessResult_t) - * - * @par Prospective Clients: - * External Apps. - * - * @see None - * - * @code - * #include - * int err_code = 0; - * TapiHandle *handle; // Handle given by tel_init() - * tapi_response_cb callback; //Initialized call-back function pointer in which response is returned - * void *user_data; // Set User data - * err_code = tel_get_sim_iccid(handle, callback, user_data); - * @endcode - * - * @remarks None - * - */ -/*================================================================================================*/ -int tel_get_sim_iccid(TapiHandle *handle, tapi_response_cb callback, void *user_data); - -/** - * @brief This API is used to get the language preference(indication) information. - * - * @par Sync (or) Async: - * This is a Asynchronous API. - * - * @par Important Notes: - * - None - * - * @warning - * - None. - * - * @param [in] handle - * - handle from tel_init(). - * - * @param [in] callback - * - To register callback function for result. - * - * @param [in] user_data - * - user_data for user specification. - * - * @par Async Response Message: - * - None - * - * @pre - * - User can get valid return value or make operations after SIM init complete(card status is TAPI_SIM_STATUS_SIM_INIT_COMPLETED). - * - None. - * - * @post - * - None. - * - * @return Return Type (int) - * - Integer '0' ( same with TAPI_API_SUCCESS & TAPI_SIM_ACCESS_SUCCESS ) - indicating that the operation has completed successfully. - * - Negative integer : it provides an error code before actual operations. (Refer #TapiResult_t) - * - Positive integer : it provides an error code while actual operations. (Refer to #TelSimAccessResult_t) - * - * @par Prospective Clients: - * External Apps. - * - * @see None - * - * @code - * #include - * int err_code = 0; - * TapiHandle *handle; // Handle given by tel_init() - * tapi_response_cb callback; //Initialized call-back function pointer in which response is returned - * void *user_data; // Set User data - * err_code = tel_get_sim_language(handle, callback, user_data); - * @endcode - * - * @remarks None - * - */ -/*================================================================================================*/ -int tel_get_sim_language(TapiHandle *handle, tapi_response_cb callback, void *user_data); - -/** - * @brief This API is used to update the language preference information to SIM card. - * - * This function makes Dbus method call to Telephony Sever and returns immediate value. - * However it just means that the API request has been transfered to the CP successfully. - * The actual operation result is being delivered in the corresponding event asynchronously. - * - * @par Sync (or) Async: - * This is a Asynchronous API. - * - * @par Important Notes: - * - This function update SIM Language information directly and can effect device language setting. Use carefully. - * - * @warning - * - None. - * - * @param [in] handle - * - handle from tel_init(). - * - * @param [in] language - * This parameter returns the language preference information. - * - * @param [in] callback - * - To register callback function for result. - * - * @param [in] user_data - * - user_data for user specification. - * - * @par Async Response Message: - * The event associated is TAPI_EVENT_SIM_SET_LANGUAGE_CNF. - * Asynchronous return status is indicated by #TelSimAccessResult_t. - * - * @pre - * - A dbus connection is established with #tel_init - * - The application name is registered with #tel_register_app_name - * - The application is registered events to listen asynchronous response with #tel_register_event - * - A event loop is running to listen events - * - User can get valid return value or make operations after SIM init complete(card status is TAPI_SIM_STATUS_SIM_INIT_COMPLETED). - * - None. - * - * @post - * - None. - * - * @return Return Type (int) - * - Integer '0' ( same with TAPI_API_SUCCESS & TAPI_SIM_ACCESS_SUCCESS ) - indicating that the operation has completed successfully. - * - Negative integer : it provides an error code before actual operations. (Refer #TapiResult_t) - * - Positive integer : it provides an error code while actual operations. (Refer to #TelSimAccessResult_t) - * - * @par Prospective Clients: - * External Apps. - * - * @see None - * - * @code - * #include - * int err_code = 0; - * TelSimLanguagePreferenceCode_t language = 0x00; //init - * language = TAPI_SIM_LP_ENGLISH; //language value - * TapiHandle *handle; // Handle given by tel_init() - * tapi_response_cb callback; //Initialized call-back function pointer in which response is returned - * void *user_data; // Set User data - * err_code = tel_set_sim_language(handle, language, callback, user_data); - * @endcode - * - * @remarks None - * - */ -/*================================================================================================*/ -int tel_set_sim_language(TapiHandle *handle, TelSimLanguagePreferenceCode_t language, tapi_response_cb callback, void *user_data); - -/** - * @brief This API is used to get the SIM Call forwarding indication related data(EF-CFIS and CPHS case). - * this data is required for Call forwarding related functionality in handset. - * - * @par Sync (or) Async: - * This is a Asynchronous API. - * - * @par Important Notes: - * - None - * - * @warning - * - None - * - * @param [in] handle - * - handle from tel_init(). - * - * @param [in] callback - * - To register callback function for result. - * - * @param [in] user_data - * - user_data for user specification. - * - * @par Async Response Message: - * - None - * - * @pre - * - User can get valid return value or make operations after SIM init complete(card status is TAPI_SIM_STATUS_SIM_INIT_COMPLETED). - * - None - * - * @post - * - None - * - * @return Return Type (int) - * - Integer '0' ( same with TAPI_API_SUCCESS & TAPI_SIM_ACCESS_SUCCESS ) - indicating that the operation has completed successfully. - * - Negative integer : it provides an error code before actual operations. (Refer #TapiResult_t) - * - Positive integer : it provides an error code while actual operations. (Refer to #TelSimAccessResult_t) - * - * @par Prospective Clients: - * External Apps - * - * @see None - * - * @code - * #include - * int err_code = 0; - * TapiHandle *handle; // Handle given by tel_init() - * tapi_response_cb callback; //Initialized call-back function pointer in which response is returned - * void *user_data; // Set User data - * err_code = tel_get_sim_callforwarding_info(handle, callback, user_data); - * if(err_code == TAPI_API_SUCCESS) { - * if(cf_data.b_cphs) { //b_cphs means current SIM is for CPHS or not. - * printf("Current SIM is CPHS"); - * } else { - * printf("Current SIM is not CPHS but 3GPP"); - * } - * } else { - * printf("TAPI API FAIL: Error Code [0x%x]",err_code); - * } - * @endcode - * - * @remarks None - * - */ -/*================================================================================================*/ -int tel_get_sim_callforwarding_info(TapiHandle *handle, tapi_response_cb callback, void *user_data); - -/** - * @brief This API is used to set the SIM Call forwarding indication related data(EF-CFIS and CPHS case). - * this data is required for Call forwarding related functionality in handset. - * - * @par Sync (or) Async: - * This is a Asynchronous API. - * - * @par Important Notes: - * - None - * - * @warning - * - None - * - * @param [in] handle - * - handle from tel_init(). - * - * @param [in] callback - * - To register callback function for result. - * - * @param [in] user_data - * - user_data for user specification. - * - * @par Async Response Message: - * - None - * - * @pre - * - User can get valid return value or make operations after SIM init complete(card status is TAPI_SIM_STATUS_SIM_INIT_COMPLETED). - * - None - * - * @post - * - None - * - * @return Return Type (int) - * - Integer '0' ( same with TAPI_API_SUCCESS & TAPI_SIM_ACCESS_SUCCESS ) - indicating that the operation has completed successfully. - * - Negative integer : it provides an error code before actual operations. (Refer #TapiResult_t) - * - Positive integer : it provides an error code while actual operations. (Refer to #TelSimAccessResult_t) - * - * @par Prospective Clients: - * External Apps - * - * @see None - * - * @code - * #include - * int err_code = 0; - * TelSimCallForwardingReq_t *req_cf; - * TapiHandle *handle; // Handle given by tel_init() - * tapi_response_cb callback; //Initialized call-back function pointer in which response is returned - * void *user_data; // Set User data - * err_code = tel_set_sim_callforwarding_info(handle, &req_cf, callback, user_data); - * @endcode - * - * @remarks None - * - */ -/*================================================================================================*/ -int tel_set_sim_callforwarding_info(TapiHandle *handle, TelSimCallForwardingReq_t *req_cf, tapi_response_cb callback, void *user_data); - -/** - * @brief This API is used to get the SIM message waiting indication related data(EF-MWIS and CPHS case). - * this data is required for Message waiting related functionality in handset. - * - * @par Sync (or) Async: - * This is a Asynchronous API. - * - * @par Important Notes: - * - None - * - * @warning - * - None - * - * @param [in] handle - * - handle from tel_init(). - * - * @param [in] callback - * - To register callback function for result. - * - * @param [in] user_data - * - user_data for user specification. - * - * @par Async Response Message: - * - None - * - * @pre - * - User can get valid return value or make operations after SIM init complete(card status is TAPI_SIM_STATUS_SIM_INIT_COMPLETED). - * - None - * - * @post - * - None - * - * @return Return Type (int) - * - Integer '0' ( same with TAPI_API_SUCCESS & TAPI_SIM_ACCESS_SUCCESS ) - indicating that the operation has completed successfully. - * - Negative integer : it provides an error code before actual operations. (Refer #TapiResult_t) - * - Positive integer : it provides an error code while actual operations. (Refer to #TelSimAccessResult_t) - * - * @par Prospective Clients: - * External Apps - * - * @see None - * - * @code - * #include - * TelSimMessageWaiting_s mw_data; - * int err_code = 0; - * TapiHandle *handle; // Handle given by tel_init() - * tapi_response_cb callback; //Initialized call-back function pointer in which response is returned - * void *user_data; // Set User data - * err_code = tel_get_sim_messagewaiting_info(handle, callback, user_data); - * if(err_code == TAPI_API_SUCCESS) { - * if(mw_data.b_cphs) { //b_cphs means current SIM is for CPHS or not. - * printf("Current SIM is CPHS"); - * } else { - * printf("Current SIM is not CPHS but 3GPP"); - * } - * } else { - * printf("TAPI API FAIL: Error Code [0x%x]",err_code); - * } - * @endcode - * - * @remarks None - * - */ -/*================================================================================================*/ -int tel_get_sim_messagewaiting_info(TapiHandle *handle, tapi_response_cb callback, void *user_data); - -/** - * @brief This API is used to set the SIM message waiting indication related data(EF-MWIS and CPHS case). - * this data is required for Message waiting related functionality in handset. - * - * @par Sync (or) Async: - * This is a Asynchronous API. - * - * @par Important Notes: - * - None - * - * @warning - * - None - * - * @param [in] handle - * - handle from tel_init(). - * - * @param [in] callback - * - To register callback function for result. - * - * @param [in] user_data - * - user_data for user specification. - * - * @par Async Response Message: - * - None - * - * @pre - * - User can get valid return value or make operations after SIM init complete(card status is TAPI_SIM_STATUS_SIM_INIT_COMPLETED). - * - None - * - * @post - * - None - * - * @return Return Type (int) - * - Integer '0' ( same with TAPI_API_SUCCESS & TAPI_SIM_ACCESS_SUCCESS ) - indicating that the operation has completed successfully. - * - Negative integer : it provides an error code before actual operations. (Refer #TapiResult_t) - * - Positive integer : it provides an error code while actual operations. (Refer to #TelSimAccessResult_t) - * - * @par Prospective Clients: - * External Apps - * - * @see None - * - * @code - * #include - * TelSimMessageWaiting_s mw_data; - * int err_code = 0; - * TelSimMessageWaitingReq_t *req_mw; // Get message waiting info - * TapiHandle *handle; // Handle given by tel_init() - * tapi_response_cb callback; //Initialized call-back function pointer in which response is returned - * void *user_data; // Set User data - * err_code = tel_set_sim_messagewaiting_info(handle, &req_mw, callback, user_data); - * @endcode - * - * @remarks None - * - */ -/*================================================================================================*/ -int tel_set_sim_messagewaiting_info(TapiHandle *handle, TelSimMessageWaitingReq_t *req_mw, tapi_response_cb callback, void *user_data); - -/** - * @brief This API is used to get the SIM mailbox related data(EF-MBDN, MBDI and CPHS case). - * this data is required for Mailbox related functionality in handset. - * - * @par Sync (or) Async: - * This is a Asynchronous API. - * - * @par Important Notes: - * - None - * - * @warning - * - None. - * - * @param [in] handle - * - handle from tel_init(). - * - * @param [in] callback - * - To register callback function for result. - * - * @param [in] user_data - * - user_data for user specification. - * - * @par Async Response Message: - * - None - * - * @pre - * - User can get valid return value or make operations after SIM init complete(card status is TAPI_SIM_STATUS_SIM_INIT_COMPLETED). - * - None. - * - * @post - * - None. - * - * @return Return Type (int) - * - Integer '0' ( same with TAPI_API_SUCCESS & TAPI_SIM_ACCESS_SUCCESS ) - indicating that the operation has completed successfully. - * - Negative integer : it provides an error code before actual operations. (Refer #TapiResult_t) - * - Positive integer : it provides an error code while actual operations. (Refer to #TelSimAccessResult_t) - * - * @par Prospective Clients: - * External Apps. - * - * @see None - * - * @code - * #include - * int err_code = 0; - * TapiHandle *handle; // Handle given by tel_init() - * tapi_response_cb callback; //Initialized call-back function pointer in which response is returned - * void *user_data; // Set User data - * err_code = tel_get_sim_mailbox_info(handle, callback, user_data); - * if(err_code == TAPI_API_SUCCESS) { - * if(mbox.b_cphs) { //b_cphs means current SIM is for CPHS or not. - * printf("Current SIM is CPHS"); - * } else { - * printf("Current SIM is not CPHS but 3GPP"); - * } - * } else { - * printf("TAPI API FAIL: Error Code [0x%x]",err_code); - * } - * @endcode - * - * @remarks None - * - */ -/*================================================================================================*/ -int tel_get_sim_mailbox_info(TapiHandle *handle, tapi_response_cb callback, void *user_data); - -/** - * @brief This API is used to set the SIM mailbox related data(EF-MBDN, MBDI and CPHS case). - * this data is required for Mailbox related functionality in handset. - * - * @par Sync (or) Async: - * This is a Asynchronous API. - * - * @par Important Notes: - * - None - * - * @warning - * - None. - * - * @param [in] handle - * - handle from tel_init(). - * - * @param [in] callback - * - To register callback function for result. - * - * @param [in] user_data - * - user_data for user specification. - * - * @par Async Response Message: - * - None - * - * @pre - * - User can get valid return value or make operations after SIM init complete(card status is TAPI_SIM_STATUS_SIM_INIT_COMPLETED). - * - None. - * - * @post - * - None. - * - * @return Return Type (int) - * - Integer '0' ( same with TAPI_API_SUCCESS & TAPI_SIM_ACCESS_SUCCESS ) - indicating that the operation has completed successfully. - * - Negative integer : it provides an error code before actual operations. (Refer #TapiResult_t) - * - Positive integer : it provides an error code while actual operations. (Refer to #TelSimAccessResult_t) - * - * @par Prospective Clients: - * External Apps. - * - * @see None - * - * @code - * #include - * int err_code = 0; - * TelSimMailBoxNumber_t *req_mb; // Get SIM mail box number info - * TapiHandle *handle; // Handle given by tel_init() - * tapi_response_cb callback; //Initialized call-back function pointer in which response is returned - * void *user_data; // Set User data - * err_code = tel_set_sim_mailbox_info(handle, &req_mb, callback, user_data); - * @endcode - * - * @remarks None - * - */ -/*================================================================================================*/ -int tel_set_sim_mailbox_info(TapiHandle *handle, TelSimMailBoxNumber_t *req_mb, tapi_response_cb callback, void *user_data); - -/** - * @brief This API is used to get the SIM CPHS specific data. - * this data is required for CPHS related functionality in handset. - * - * @par Sync (or) Async: - * This is an Asynchronous API. - * - * @par Important Notes: - * - None - * - * @warning - * - None - * - * @param [in] handle - * - handle from tel_init(). - * - * @param [in] callback - * - To register callback function for result. - * - * @param [in] user_data - * - user_data for user specification. - * - * @par Async Response Message: - * - None - * - * @pre - * - User can get valid return value or make operations after SIM init complete(card status is TAPI_SIM_STATUS_SIM_INIT_COMPLETED). - * - * @post - * - None - * - * @return Return Type (int) - * - Integer '0' ( same with TAPI_API_SUCCESS & TAPI_SIM_ACCESS_SUCCESS ) - indicating that the operation has completed successfully. - * - Negative integer : it provides an error code before actual operations. (Refer #TapiResult_t) - * - Positive integer : it provides an error code while actual operations. (Refer to #TelSimAccessResult_t) - * - * @par Prospective Clients: - * External Apps - * - * @see None - * - * @code - * #include - * int err_code = 0; - * TapiHandle *handle; // Handle given by tel_init() - * tapi_response_cb callback; //Initialized call-back function pointer in which response is returned - * void *user_data; // Set User data - * err_code = tel_get_sim_cphs_info(handle, callback, user_data); - * if(err_code == TAPI_API_SUCCESS) { - * if(cphs_data.b_used) { //b_used means current SIM is for CPHS or not. - * printf("Current SIM is CPHS"); - * } else { - * printf("Current SIM is not CPHS but 3GPP"); - * } - * } else { - * printf("TAPI API FAIL: Error Code [0x%x]",err_code); - * } - * @endcode - * - * @remarks None - * - */ -/*================================================================================================*/ -int tel_get_sim_cphs_info(TapiHandle *handle, tapi_response_cb callback, void *user_data); - -/** - * @brief This API is used to get the SIM Service Table. - * this data is required to know which SIM services are enabled or disabled. - * - * @par Sync (or) Async: - * This is an Asynchronous API. - * - * @par Important Notes: - * - None - * - * @warning - * - None - * - * @param [in] handle - * - handle from tel_init(). - * - * @param [in] callback - * - To register callback function for result. - * - * @param [in] user_data - * - user_data for user specification. - * - * @par Async Response Message: - * - None - * - * @pre - * - User can get valid return value or make operations after SIM init complete(card status is TAPI_SIM_STATUS_SIM_INIT_COMPLETED). - * - * @post - * - None - * - * @return Return Type (int) - * - Integer '0' ( same with TAPI_API_SUCCESS & TAPI_SIM_ACCESS_SUCCESS ) - indicating that the operation has completed successfully. - * - Negative integer : it provides an error code before actual operations. (Refer #TapiResult_t) - * - Positive integer : it provides an error code while actual operations. (Refer to #TelSimAccessResult_t) - * - * @par Prospective Clients: - * External Apps - * - * @see None - * - * @code - * #include - * int err_code = 0; - * TapiHandle *handle; // Handle given by tel_init() - * tapi_response_cb callback; //Initialized call-back function pointer in which response is returned - * void *user_data; // Set User data - * err_code = tel_get_sim_service_table(handle, callback, user_data); - * @endcode - * - * @remarks None - * - */ -/*================================================================================================*/ -int tel_get_sim_service_table(TapiHandle *handle, tapi_response_cb callback, void *user_data); - -/** - * @brief This API is used to get the SIM MSISDN data. Regarding 3GPP specification, Current value is optional. - * - * @par Sync (or) Async: - * This is an Asynchronous API. - * - * @par Important Notes: - * - None - * - * @warning - * - None - * - * @param [in] handle - * - handle from tel_init(). - * - * @param [in] callback - * - To register callback function for result. - * - * @param [in] user_data - * - user_data for user specification. - * - * @par Async Response Message: - * - None - * - * @pre - * - User can get valid return value or make operations after SIM init complete(card status is TAPI_SIM_STATUS_SIM_INIT_COMPLETED). - * - * @post - * - None - * - * @return Return Type (int) - * - Integer '0' ( same with TAPI_API_SUCCESS & TAPI_SIM_ACCESS_SUCCESS ) - indicating that the operation has completed successfully. - * - Negative integer : it provides an error code before actual operations. (Refer #TapiResult_t) - * - Positive integer : it provides an error code while actual operations. (Refer to #TelSimAccessResult_t) - * - * @par Prospective Clients: - * External Apps - * - * @see None - * - * @code - * #include - * int err_code = 0; - * TapiHandle *handle; // Handle given by tel_init() - * err_code = tel_get_sim_msisdn(handle, callback, user_data); - * if(err_code == TAPI_API_SUCCESS) - * { - * * printf(" ============================================"); - * * printf("name[%s]",msisdn.name); - * * printf("num[%s]",msisdn.num); - * * if(msisdn.name == '\0';) //If current SIM does not have, Null string will be returned. - * * * printf("name is null string"); - * - * * if(msisdn.num == '\0';) //If current SIM does not have, Null string will be returned. - * * * printf("number is null string"); - * } - * else - * { - * * printf("TAPI API FAIL: Error Code [0x%x]",err_code); - * } - * - * @endcode - * - * @remarks None - * - */ -/*================================================================================================*/ -int tel_get_sim_msisdn(TapiHandle *handle, tapi_response_cb callback, void *user_data); - -/** - * @brief This API is used to get the SIM OPLMNWACT(Operator controlled PLMN Selector with Access Technology) data. Regarding 3GPP specification, Current value is optional. - * - * @par Sync (or) Async: - * This is an Asynchronous API. - * - * @par Important Notes: - * - None - * - * @warning - * - None - * - * @param [in] handle - * - handle from tel_init(). - * - * @param [in] callback - * - To register callback function for result. - * - * @param [in] user_data - * - user_data for user specification. - * - * @par Async Response Message: - * - None - * - * @pre - * - User can get valid return value or make operations after SIM init complete(card status is TAPI_SIM_STATUS_SIM_INIT_COMPLETED). - * - * @post - * - None - * - * @return Return Type (int) - * - Integer '0' ( same with TAPI_API_SUCCESS & TAPI_SIM_ACCESS_SUCCESS ) - indicating that the operation has completed successfully. - * - Negative integer : it provides an error code before actual operations. (Refer #TapiResult_t) - * - Positive integer : it provides an error code while actual operations. (Refer to #TelSimAccessResult_t) - * - * @par Prospective Clients: - * External Apps - * - * @see None - * - * @code - * int err_code = 0; - * TapiHandle *handle; // Handle given by tel_init() - * tapi_response_cb callback; //Initialized call-back function pointer in which response is returned - * void *user_data; // Set User data - * err_code = tel_get_sim_oplmnwact(handle, callback, user_data); - * - * @endcode - * - * @remarks None - * - */ -/*================================================================================================*/ -int tel_get_sim_oplmnwact(TapiHandle *handle, tapi_response_cb callback, void *user_data); - -/** - * @brief This API is used to get the SIM SPN data. Regarding 3GPP specification, Current value is optional. - * - * @par Sync (or) Async: - * This is an Asynchronous API. - * - * @par Important Notes: - * - None - * - * @warning - * - None - * - * @param [in] handle - * - handle from tel_init(). - * - * @param [in] callback - * - To register callback function for result. - * - * @param [in] user_data - * - user_data for user specification. - * - * @par Async Response Message: - * - None - * - * @pre - * - User can get valid return value or make operations after SIM init complete(card status is TAPI_SIM_STATUS_SIM_INIT_COMPLETED). - * - * @post - * - None - * - * @return Return Type (int) - * - Integer '0' ( same with TAPI_API_SUCCESS & TAPI_SIM_ACCESS_SUCCESS ) - indicating that the operation has completed successfully. - * - Negative integer : it provides an error code before actual operations. (Refer #TapiResult_t) - * - Positive integer : it provides an error code while actual operations. (Refer to #TelSimAccessResult_t) - * - * @par Prospective Clients: - * External Apps - * - * @see None - * - * @code - * int err_code = 0; - * TapiHandle *handle; // Handle given by tel_init() - * tapi_response_cb callback; //Initialized call-back function pointer in which response is returned - * void *user_data; // Set User data - * err_code = tel_get_sim_spn(handle, callback, user_data); - * - * @endcode - * - * @remarks None - * - */ -/*================================================================================================*/ -int tel_get_sim_spn(TapiHandle *handle, tapi_response_cb callback, void *user_data); - -/** - * @brief This API is used to get the SIM CPHS NETNAME data. - * - * @par Sync (or) Async: - * This is an Asynchronous API. - * - * @par Important Notes: - * - None - * - * @warning - * - None - * - * @param [in] handle - * - handle from tel_init(). - * - * @param [in] callback - * - To register callback function for result. - * - * @param [in] user_data - * - user_data for user specification. - * - * @par Async Response Message: - * - None - * - * @pre - * - User can get valid return value or make operations after SIM init complete(card status is TAPI_SIM_STATUS_SIM_INIT_COMPLETED). - * - * @post - * - None - * - * @return Return Type (int) - * - Integer '0' ( same with TAPI_API_SUCCESS & TAPI_SIM_ACCESS_SUCCESS ) - indicating that the operation has completed successfully. - * - Negative integer : it provides an error code before actual operations. (Refer #TapiResult_t) - * - Positive integer : it provides an error code while actual operations. (Refer to #TelSimAccessResult_t) - * - * @par Prospective Clients: - * External Apps - * - * @see None - * - * @code - * int err_code = 0; - * TapiHandle *handle; // Handle given by tel_init() - * tapi_response_cb callback; //Initialized call-back function pointer in which response is returned - * void *user_data; // Set User data - * err_code = tel_get_sim_cphs_netname(handle, callback, user_data); - * - * @endcode - * - * @remarks None - * - */ -/*================================================================================================*/ -int tel_get_sim_cphs_netname(TapiHandle *handle, tapi_response_cb callback, void *user_data); - -/** - * @brief This API is used to execute the authentication procedure by using SIM. - * - * This function makes Dbus method call to Telephony Sever and returns immediate value. - * However it just means that the API request has been transfered to the CP successfully. - * The actual operation result is being delivered in the corresponding event asynchronously. - * This function supports IMS, 3G and GSM authentication. - * - * @par Sync (or) Async: - * This is an Asynchronous API. - * - * @par Important Notes: - * -NONE - * - * @warning - * - None. - * - * @param [in] handle - * - handle from tel_init(). - * - * @param[in] authentication_data - * - This input has the authentication code to be validated by ISIM,3G and GSM application in the SIM card. #TelSimAuthenticationData_t - * - * @param [in] callback - * - To register callback function for result. - * - * @param [in] user_data - * - user_data for user specification. - * - * @par Async Response Message: - * -The event associated is TAPI_SIM_EVENT_AUTHENTICATION_CNF and the event data is #TelSimAuthenticationResponse_t. - * Asynchronous return status is indicated by #TelSimAccessResult_t. - * - * @pre - * - A dbus connection is established with #tel_init - * - The application name is registered with #tel_register_app_name - * - The application is registered events to listen asynchronous response with #tel_register_event - * - A event loop is running to listen events - * - * @post - * - None. - * - * @return Return Type (int) - * - Integer '0' ( same with TAPI_API_SUCCESS & TAPI_SIM_ACCESS_SUCCESS ) - indicating that the operation has completed successfully. - * - Negative integer : it provides an error code before actual operations. (Refer #TapiResult_t) - * - Positive integer : it provides an error code while actual operations. (Refer to #TelSimAccessResult_t) - * - * @par Prospective Clients: - * External Apps. - * - * @see None - * - * @code - * #include - * int err_code = 0; - * TapiHandle *handle; // Handle given by tel_init() - * tapi_response_cb callback; //Initialized call-back function pointer in which response is returned - * void *user_data; // Set User data - * TelSimAuthenticationData_t pAuthenticationData; - * strcpy((char*)pAuthenticationData.rand_data, "username@operator.com"); //access data - * pAuthenticationData.rand_length= strlen("username@operator.com"); - * strcpy((char*)pAuthenticationData.autn_data, "+1-212-555-12345"); // auth data - * pAuthenticationData.autn_length = strlen("+1-212-555-12345"); - * err_code = tel_req_sim_authentication(handle, &pAuthenticationData, callback, user_data); - * @endcode - * - * @remarks None - * - */ -/*================================================================================================*/ -int tel_req_sim_authentication(TapiHandle *handle, TelSimAuthenticationData_t *authentication_data, tapi_response_cb callback, void *user_data); - - - -/** - * @brief This API performs PIN1/PIN2/SIM LOCK verification. This function performs PIN verification based on the pin type passed along with pin data. - * PIN1 code : The SIM card has its own password is to check access permissions - * SIM Lock code : Between Device and the SIM card using a SIM password is only available on certain handsets to be used to authorize. - * - * This function makes Dbus method call to Telephony Sever and returns immediate value. - * However it just means that the API request has been transfered to the CP successfully. - * The actual operation result is being delivered in the corresponding event asynchronously. - * - * @par Sync (or) Async: - * This is an Asynchronous API. - * - * @par Important Notes: - * - Based on Pin status (PIN/PUK/SIM LOCK) is blocked, an unsolicited event TAPI_EVENT_SIM_STATUS_IND is published to Applications on Device boot time. - * - if pin status is PUK, you should use #tel_verify_sim_puks instead of this API. - * - * @warning - * - None. - * - * @param [in] handle - * - handle from tel_init(). - * - * @param[in] pin_data - * -PIN code, entered by the user. you should make all parameters. - * - * @param [in] callback - * - To register callback function for result. - * - * @param [in] user_data - * - user_data for user specification. - * - * @par Async Response Message: - * The event associated is TAPI_EVENT_SIM_VERIFY_SEC_CNF and the event data is #TelSimSecResult_t. - * Asynchronous return status is indicated by #TelSimPinOperationResult_t. - * If returned status is TAPI_SIM_PIN_OPERATION_SUCCESS, Verification successes. - * If returned status is TAPI_SIM_PIN_INCORRECT_PASSWORD, Verification fails and you can check retry count by using event data #TelSimSecResult_t. - * - * @pre - * - Initialize Dbus connection with #tel_init - * - Register caller's application name with #tel_register_app_name - * - Register telephony events to listen - * - A event loop is running to listen events - * - This API is used when #TelSimCardStatus_t is TAPI_SIM_STATUS_SIM_PIN_REQUIRED or TAPI_SIM_STATUS_SIM_LOCK_REQUIRED on boot time. - * - Currently there`s no proper scenario for PIN2 verification by using this API. - * - * @post - * - None. - * - * @return Return Type (int) - * - Integer '0' ( same with TAPI_API_SUCCESS & TAPI_SIM_ACCESS_SUCCESS ) - indicating that the operation has completed successfully. - * - Negative integer : it provides an error code before actual operations. (Refer #TapiResult_t) - * - Positive integer : it provides an error code while actual operations. (Refer to #TelSimAccessResult_t) - * - * @par Prospective Clients: - * External Apps. - * - * @see None - * - * @code - * #include - * TapiHandle *handle; // Handle given by tel_init() - * tapi_response_cb callback; //Initialized call-back function pointer in which response is returned - * void *user_data; // Set User data - * err_code = TAPI_API_SUCCESS; // 0 - * int length = TAPI_SIM_PIN_LENGTH+1; - * char init_pin_val[length] ; - * - * strcpy(init_pin_val, PIN1_NORMAL); - * - * TelSimSecPw_t pin_data = {0,}; - * - * 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(handle, &pin_data, callback, user_data); - * - * @endcode - * - * @remarks None - * - */ -/*================================================================================================*/ -int tel_verifiy_sim_pins(TapiHandle *handle, const TelSimSecPw_t *pin_data, tapi_response_cb callback, void *user_data); - -/** - * @brief This function performs unblock PIN1/PIN2 operation based on PUK information passed along with - * unblock information entered by the user. - * If you get sim card status(TAPI_SIM_STATUS_SIM_PUK_REQUIRED) by using #tel_get_sim_init_info on boot time - * or (TAPI_SIM_PIN_STATUS_BLOCKED) by using #tel_get_sim_facility after normal initialization for specific operation, - * you may unblock PIN1/PIN2. - * - * This function makes Dbus method call to Telephony Sever and returns immediate value. - * However it just means that the API request has been transfered to the CP successfully. - * The actual operation result is being delivered in the corresponding event asynchronously. - * - * @par Sync (or) Async: - * This is an Asynchronous API. - * - * @par Important Notes: - * - Based on Pin status (PIN1/PIN2) is blocked, an unsolicited event TAPI_EVENT_SIM_STATUS_IND - * is published to Applications on boot time also. - * - * @warning - * - If you fail to unblock PIN til given retry count, Your SIM card be permanent block status. - * - * @param [in] handle - * - handle from tel_init(). - * - * @param[in] puk_data - * -Specifies unblocking PIN password #TelSimSecPw_t - * - * @param[in] new_pin_data - * -Specifies PIN password which you want to use after unblocking operation #TelSimSecPw_t - * - * @param [in] callback - * - To register callback function for result. - * - * @param [in] user_data - * - user_data for user specification. - * - * @par Async Response Message: - * The event associated is TAPI_EVENT_SIM_VERIFY_PUK_CNF and the event data is #TelSimSecResult_t. - * Asynchronous return status is indicated by #TelSimPinOperationResult_t. - * If returned status is TAPI_SIM_PIN_OPERATION_SUCCESS, Verification successes. - * If returned status is TAPI_SIM_PUK_INCORRECT_PASSWORD, Verification fails and you can check retry count by using event data #TelSimSecResult_t. - * - * @pre - * - Initialize Dbus connection with #tel_init - * - Register caller's application name with #tel_register_app_name - * - Register telephony events to listen - * - A event loop is running to listen events - * - PIN1 or PIN2 status should be TAPI_SIM_PIN_STATUS_BLOCKED and Card status should be TAPI_SIM_STATUS_SIM_PUK_REQUIRED on boot time. - * - * @post - * - After Success on unblocking for PIN1 or PIN2, each pin check facility is enabled even if previous facility is disabled. - * - * @return Return Type (int) - * - Integer '0' ( same with TAPI_API_SUCCESS & TAPI_SIM_ACCESS_SUCCESS ) - indicating that the operation has completed successfully. - * - Negative integer : it provides an error code before actual operations. (Refer #TapiResult_t) - * - Positive integer : it provides an error code while actual operations. (Refer to #TelSimAccessResult_t) - * - * @par Prospective Clients: - * External Apps. - * - * @see None - * - * @code - * #include - * - * TapiHandle *handle; // Handle given by tel_init() - * tapi_response_cb callback; //Initialized call-back function pointer in which response is returned - * void *user_data; // Set User data - * err_code = TAPI_API_SUCCESS; // 0 - * int length = TAPI_SIM_PIN_LENGTH+1; - * - * char init_pin_val[length]; - * char init_puk_val[length]; - * - * strcpy(init_pin_val, PIN1_NORMAL); - * strcpy(init_puk_val, PUK1_NORMAL); - * - * TelSimSecPw_t puk_data = {0,}; - * TelSimSecPw_t new_pin_data = {0,}; - * - * 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(handle, &puk_data, &new_pin_data, callback, user_data); - * - * @endcode - * - * @remarks None - * - */ -/*================================================================================================*/ -int tel_verify_sim_puks(TapiHandle *handle, const TelSimSecPw_t *puk_data, const TelSimSecPw_t *new_pin_data, tapi_response_cb callback, void *user_data); - - -/** - * @brief This function changes PIN1/PIN2 code based on the pin type passed along with old pin data and new pin data. - * - * This function makes Dbus method call to Telephony Sever and returns immediate value. - * However it just means that the API request has been transfered to the CP successfully. - * The actual operation result is being delivered in the corresponding event asynchronously. - * - * @par Sync (or) Async: - * This is an Asynchronous API. - * - * @par Important Notes: - * - User should fill up pin type equally both old_pin and new_pin. - * - * @warning - * - None. - * - * @param [in] handle - * - handle from tel_init(). - * - * @param[in] old_pin - * -Old pin code, entered by the user. #TelSimSecPw_t - * - * @param[in] new_pin - * -New pin code, entered by the user. #TelSimSecPw_t - * - * @param [in] callback - * - To register callback function for result. - * - * @param [in] user_data - * - user_data for user specification. - * - * @par Async Response Message: - * The event associated is TAPI_EVENT_SIM_CHANGE_PINS_CNF and the event data is #TelSimSecResult_t. - * Asynchronous return status is indicated by #TelSimPinOperationResult_t. - * If returned status is TAPI_SIM_PIN_OPERATION_SUCCESS, Change operation finish successfully. - * If returned status is TAPI_SIM_PIN_INCORRECT_PASSWORD, Change operation fails and you can check retry count by using event data #TelSimSecResult_t. - * - * @pre - * - Initialize Dbus connection with #tel_init - * - Register caller's application name with #tel_register_app_name - * - Register telephony events to listen - * - A event loop is running to listen events - * - User can get valid return value or make operations after SIM init complete(card status is TAPI_SIM_STATUS_SIM_INIT_COMPLETED). - * - PIN which user want to change check facility should be enabled. - * - * @post - * - None. - * - * @return Return Type (int) - * - Integer '0' ( same with TAPI_API_SUCCESS & TAPI_SIM_ACCESS_SUCCESS ) - indicating that the operation has completed successfully. - * - Negative integer : it provides an error code before actual operations. (Refer #TapiResult_t) - * - Positive integer : it provides an error code while actual operations. (Refer to #TelSimAccessResult_t) - * - * @par Prospective Clients: - * External Apps. - * - * @see None - * - * @code - * #include - * - * TapiHandle *handle; // Handle given by tel_init() - * tapi_response_cb callback; //Initialized call-back function pointer in which response is returned - * void *user_data; // Set User data - * err_code = TAPI_API_SUCCESS; // 0 - * int length = TAPI_SIM_PIN_LENGTH+1; - * char init_old_pin_val[length] ; - * char init_new_pin_val[length]; - * - * memset(&init_old_pin_val, 0 , length); - * memset(&init_new_pin_val, 0 , length); - * - * TelSimSecPw_t old_pin = {0,}; - * TelSimSecPw_t new_pin = {0,}; - * - * 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(handle, &old_pin, &new_pin, callback, user_data); - * - * @endcode - * - * @remarks None - * - */ -/*================================================================================================*/ -int tel_change_sim_pins(TapiHandle *handle, const TelSimSecPw_t *old_pin, const TelSimSecPw_t *new_pin, tapi_response_cb callback, void *user_data); - -/** - * @brief This API is used to disable the SIM facility. - * - * @par Sync (or) Async: - * This is an Asynchronous API. - * - * @par Important Notes: - * - None - * - * @warning - * - None. - * - * @param [in] handle - * - handle from tel_init(). - * - * @param[in] pw - * - a structure which contains facility type and password. - * - * @param [in] callback - * - To register callback function for result. - * - * @param [in] user_data - * - user_data for user specification. - * - * @par - * - * @pre - * - * @post - * - * @return Return Type (int) - * - Integer '0' ( same with TAPI_API_SUCCESS & TAPI_SIM_ACCESS_SUCCESS ) - indicating that the operation has completed successfully. - * - Negative integer : it provides an error code before actual operations. (Refer #TapiResult_t) - * - Positive integer : it provides an error code while actual operations. (Refer to #TelSimAccessResult_t) - * - * @par Prospective Clients: - * External Apps. - * - * @see None - * - * @code - * int err_code = 0; - * TapiHandle *handle; // Handle given by tel_init() - * tapi_response_cb callback; //Initialized call-back function pointer in which response is returned - * void *user_data; // Set User data - * TelSimFacilityPw_t *fc_pw; - * int length = TAPI_SIM_PIN_LENGTH+1; - * char init_pin_val[length] ; - * - * strcpy(init_pin_val, PIN1_NORMAL); - * - * fc_pw.lock_type = TAPI_SIM_LOCK_SC; // Set locktype for which facility should be disabled; - * fc_pw.pw_len = strlen(init_pin_val); - * - * printf("pw_len[%d]", fc_pw.pw_len); - * - * fc_pw.pw = (char*)malloc(length); - * memcpy(fc_pw.pw,init_pin_val,length); - * err_code = tel_disable_sim_facility(handle, fc_pw, callback, user_data); - * - * @endcode - * - * @remarks None - * - */ -/*================================================================================================*/ -int tel_disable_sim_facility(TapiHandle *handle, TelSimFacilityPw_t *pw, tapi_response_cb callback, void *user_data); - -/** - * @brief This API is used to enable the SIM facility. - * - * @par Sync (or) Async: - * This is an Asynchronous API. - * - * @par Important Notes: - * - None - * - * @warning - * - None. - * - * @param [in] handle - * - handle from tel_init(). - * - * @param[in] pw - * - a structure which contains facility type and password. - * - * @param [in] callback - * - To register callback function for result. - * - * @param [in] user_data - * - user_data for user specification. - * - * @par - * - * @pre - * - * @post - * - * @return Return Type (int) - * - Integer '0' ( same with TAPI_API_SUCCESS & TAPI_SIM_ACCESS_SUCCESS ) - indicating that the operation has completed successfully. - * - Negative integer : it provides an error code before actual operations. (Refer #TapiResult_t) - * - Positive integer : it provides an error code while actual operations. (Refer to #TelSimAccessResult_t) - * - * @par Prospective Clients: - * External Apps. - * - * @see None - * - * @code - * int err_code = 0; - * TapiHandle *handle; // Handle given by tel_init() - * tapi_response_cb callback; //Initialized call-back function pointer in which response is returned - * void *user_data; // Set User data - * TelSimFacilityPw_t *fc_pw; - * int length = TAPI_SIM_PIN_LENGTH+1; - * char init_pin_val[length] ; - * - * strcpy(init_pin_val, PIN1_NORMAL); - * - * fc_pw.lock_type = TAPI_SIM_LOCK_SC; // Set locktype for which facility should be disabled; - * fc_pw.pw_len = strlen(init_pin_val); - * - * printf("pw_len[%d]", fc_pw.pw_len); - * - * fc_pw.pw = (char*)malloc(length); - * memcpy(fc_pw.pw,init_pin_val,length); - * err_code = tel_enable_sim_facility(handle, fc_pw, callback, user_data); - * - * @endcode - * - * @remarks None - * - */ -/*================================================================================================*/ -int tel_enable_sim_facility(TapiHandle *handle, TelSimFacilityPw_t *pw, tapi_response_cb callback, void *user_data); - -/** - * @brief This API is used to get the SIM facility. - * - * @par Sync (or) Async: - * This is an Asynchronous API. - * - * @par Important Notes: - * - None - * - * @warning - * - None. - * - * @param [in] handle - * - handle from tel_init(). - * - * @param[in] type - * - type of security lock type enum values. - * - * @param [in] callback - * - To register callback function for result. - * - * @param [in] user_data - * - user_data for user specification. - * - * @par - * - * @pre - * - * @post - * - * @return Return Type (int) - * - Integer '0' ( same with TAPI_API_SUCCESS & TAPI_SIM_ACCESS_SUCCESS ) - indicating that the operation has completed successfully. - * - Negative integer : it provides an error code before actual operations. (Refer #TapiResult_t) - * - Positive integer : it provides an error code while actual operations. (Refer to #TelSimAccessResult_t) - * - * @par Prospective Clients: - * External Apps. - * - * @see None - * - * @code - * int err_code = 0; - * TapiHandle *handle; // Handle given by tel_init() - * tapi_response_cb callback; //Initialized call-back function pointer in which response is returned - * void *user_data; // Set User data - * TelSimLockType_t type = TAPI_SIM_LOCK_SC; // Set locktype for which facility should be disabled; - * err_code = tel_get_sim_facility(handle, type, callback, user_data); - * - * @endcode - * - * @remarks None - * - */ -/*================================================================================================*/ -int tel_get_sim_facility(TapiHandle *handle, TelSimLockType_t type, tapi_response_cb callback, void *user_data); - -/** - * @brief This API is used to get the SIM LOCK TYPE info. - * - * @par Sync (or) Async: - * This is an Asynchronous API. - * - * @par Important Notes: - * - None - * - * @warning - * - None. - * - * @param [in] handle - * - handle from tel_init(). - * - * @param[in] type - * - type of security lock type enum values. - * - * @param [in] callback - * - To register callback function for result. - * - * @param [in] user_data - * - user_data for user specification. - * - * @par - * - * @pre - * - * @post - * - * @return Return Type (int) - * - Integer '0' ( same with TAPI_API_SUCCESS & TAPI_SIM_ACCESS_SUCCESS ) - indicating that the operation has completed successfully. - * - Negative integer : it provides an error code before actual operations. (Refer #TapiResult_t) - * - Positive integer : it provides an error code while actual operations. (Refer to #TelSimAccessResult_t) - * - * @par Prospective Clients: - * External Apps. - * - * @see None - * - * @code - * int err_code = 0; - * TapiHandle *handle; // Handle given by tel_init() - * tapi_response_cb callback; //Initialized call-back function pointer in which response is returned - * void *user_data; // Set User data - * TelSimLockType_t type = TAPI_SIM_LOCK_SC; // Set locktype for which facility should be disabled; - * err_code = tel_get_sim_lock_info(handle, type, callback, user_data); - * - * @endcode - * - * @remarks None - * - */ -/*================================================================================================*/ -int tel_get_sim_lock_info(TapiHandle *handle, TelSimLockType_t type, tapi_response_cb callback, void *user_data); - -/** - * @brief This API provides common interface for accessing SIM data based on USIM generic command in ETSI TS 102 221 - * and 3GPP TS 31.102 Characteristics of the Universal Subscriber Identity Module (USIM) application. - * This API provides only interface to send APDU. User should know well APDU usage. - * - * This function makes Dbus method call to Telephony Sever and returns immediate value. - * However it just means that the API request has been transfered to the CP successfully. - * The actual operation result is being delivered in the corresponding event asynchronously. - * - * @par Sync (or) Async: - * This is an Asynchronous API. - * - * @par Important Notes: - * - None - * - * @warning - * - None. - * - * @param [in] handle - * - handle from tel_init(). - * - * @param[in] apdu_data - * - * @param [in] callback - * - To register callback function for result. - * - * @param [in] user_data - * - user_data for user specification. - * - * @par Async Response Message: - * The event associated is TAPI_EVENT_SIM_APDU_CNF and the event data is #TelSimApduResp_t. - * Asynchronous return status is indicated by #TelSimAccessResult_t. - * - * @pre - * - A dbus connection is established with #tel_init - * - The application name is registered with #tel_register_app_name - * - The application is registered events to listen asynchronous response with #tel_register_event - * - A event loop is running to listen events - * - User can get valid return value or make operations after SIM init complete(card status is TAPI_SIM_STATUS_SIM_INIT_COMPLETED). - * - None. - * - * @post - * - None. - * - * @return Return Type (int) - * - Integer '0' ( same with TAPI_API_SUCCESS & TAPI_SIM_ACCESS_SUCCESS ) - indicating that the operation has completed successfully. - * - Negative integer : it provides an error code before actual operations. (Refer #TapiResult_t) - * - Positive integer : it provides an error code while actual operations. (Refer to #TelSimAccessResult_t) - * - * @par Prospective Clients: - * External Apps. - * - * @see None - * - * @code - * #include - * int err_code =0; - * TapiHandle *handle; // Handle given by tel_init() - * tapi_response_cb callback; //Initialized call-back function pointer in which response is returned - * void *user_data; // Set User data - * TelSimApdu_t apdu = {0,}; - * int tmp_apdu[5] = {0xa,5,6,7,8}; - * apdu.apdu_len = 5; //user should check - * apdu.apdu = apdu; - * - * err_code = tel_req_sim_apdu(handle, apdu, callback, user_data); - * @endcode - * - * @remarks None - * - */ -/*================================================================================================*/ -int tel_req_sim_apdu(TapiHandle *handle, TelSimApdu_t* apdu_data, tapi_response_cb callback, void *user_data); - -/** - * @brief This API provides common interface to get SIM ATR(Answer To Reset) value. - * - * This function makes Dbus method call to Telephony Sever and returns immediate value. - * However it just means that the API request has been transfered to the CP successfully. - * The actual operation result is being delivered in the corresponding event asynchronously. - * - * @par Sync (or) Async: - * This is an Asynchronous API. - * - * @par Important Notes: - * - None - * - * @warning - * - None. - * - * @param [in] handle - * - handle from tel_init(). - * - * @param [in] callback - * - To register callback function for result. - * - * @param [in] user_data - * - user_data for user specification. - * - * @par Async Response Message: - * The event associated is TAPI_EVENT_SIM_ATR_CNF and the event data is #TelSimAtrResp_t. - * Asynchronous return status is indicated by #TelSimAccessResult_t. - * - * @pre - * - A dbus connection is established with #tel_init - * - The application name is registered with #tel_register_app_name - * - The application is registered events to listen asynchronous response with #tel_register_event - * - A event loop is running to listen events - * - User can get valid return value or make operations after SIM init complete(card status is TAPI_SIM_STATUS_SIM_INIT_COMPLETED). - * - None. - * - * @post - * - None. - * - * @return Return Type (int) - * - Integer '0' ( same with TAPI_API_SUCCESS & TAPI_SIM_ACCESS_SUCCESS ) - indicating that the operation has completed successfully. - * - Negative integer : it provides an error code before actual operations. (Refer #TapiResult_t) - * - Positive integer : it provides an error code while actual operations. (Refer to #TelSimAccessResult_t) - * - * @par Prospective Clients: - * External Apps. - * - * @see None - * - * @code - * #include - * int err_code =0; - * TapiHandle *handle; // Handle given by tel_init() - * tapi_response_cb callback; //Initialized call-back function pointer in which response is returned - * void *user_data; // Set User data - * - * // REQUEST SIM ATR - * err_code = tel_req_sim_atr(handle, callback, user_data); - * @endcode - * - * @remarks None - * - */ -/*================================================================================================*/ -int tel_req_sim_atr(TapiHandle *handle, tapi_response_cb callback, void *user_data); - -/* - * @brief This API provides synchronous call interface over some operations (refer to @param [in] op_type) - * - * @par Sync (or) Async: - * This is an Synchronous API. - * - * @par Important Notes: - * - None - * - * @warning - * - None. - * - * @param [in] handle - * - handle from tel_init(). - * - * @param [in] op_type - * operation type to do what caller want. - * - TAPI_SIM_GET_INIT_STATUS - * - TAPI_SIM_GET_CARD_TYPE - * - TAPI_SIM_GET_IMSI - * - TAPI_SIM_GET_ECC - * - TAPI_SIM_GET_ICCID - * - TAPI_SIM_GET_SPN - * - TAPI_SIM_GET_CPHS_NET_NAME - * - TAPI_SIM_TRANSFER_APDU - * - TAPI_SIM_GET_ATR - * - ( below are not supported. ) - * - TAPI_SIM_GET_LANGUAGE - * - TAPI_SIM_SET_LANGUAGE - * - TAPI_SIM_GET_CALL_FORWARDING - * - TAPI_SIM_SET_CALL_FORWARDING - * - TAPI_SIM_GET_MESSAGE_WAITING - * - TAPI_SIM_SET_MESSAGE_WAITING - * - TAPI_SIM_GET_MAILBOX - * - TAPI_SIM_SET_MAILBOX - * - TAPI_SIM_GET_CPHS_INFO - * - TAPI_SIM_GET_SVCT - * - TAPI_SIM_GET_MSISDN - * - TAPI_SIM_GET_OPLMWACT - * - TAPI_SIM_AUTHENTICATION - * - TAPI_SIM_VERIFY_SEC - * - TAPI_SIM_VERIFY_PUK - * - TAPI_SIM_CHANGE_PIN - * - TAPI_SIM_DISABLE_FACILITY - * - TAPI_SIM_ENABLE_FACILITY - * - TAPI_SIM_GET_FACILITY - * - TAPI_SIM_GET_LOCK_INFO - * - * @param [in] inparam - * input parameter of union type. caller should fill when it is needed as below. - * - TAPI_SIM_GET_INIT_STATUS : (not needed) - * - TAPI_SIM_GET_CARD_TYPE : (not needed) - * - TAPI_SIM_GET_IMSI : (not needed) - * - TAPI_SIM_GET_ECC : (not needed) - * - TAPI_SIM_GET_ICCID : (not needed) - * - TAPI_SIM_GET_SPN : (not needed) - * - TAPI_SIM_GET_CPHS_NET_NAME : (not needed) - * - TAPI_SIM_TRANSFER_APDU : TelSimApdu_t - * - TAPI_SIM_GET_ATR : (not needed) - * - * @param [out] outparam - * output parameter of union type. TAPI returns a value as caller want. - * - TAPI_SIM_GET_INIT_STATUS : TelSimInitInfo_t - * - TAPI_SIM_GET_CARD_TYPE : TelSimCardType_t - * - TAPI_SIM_GET_IMSI : TelSimImsiInfo_t - * - TAPI_SIM_GET_ECC : TelSimEccList_t - * - TAPI_SIM_GET_ICCID : TelSimIccIdInfo_t - * - TAPI_SIM_GET_SPN : TelSimSpn_t - * - TAPI_SIM_GET_CPHS_NET_NAME : TelSimCphsNetName_t - * - TAPI_SIM_TRANSFER_APDU : TelSimApduResp_t - * - TAPI_SIM_GET_ATR : TelSimAtrResp_t - * - * @par Async Response Message: - * - None - * - * @pre - * - None. - * - * @post - * - None. - * - * @return Return Type (int) - * - Integer '0' ( same with TAPI_API_SUCCESS & TAPI_SIM_ACCESS_SUCCESS ) - indicating that the operation has completed successfully. - * - Negative integer : it provides an error code before actual operations. (Refer #TapiResult_t) - * - Positive integer : it provides an error code while actual operations. (Refer to #TelSimAccessResult_t) - * - * @par Prospective Clients: - * External Apps. - * - * @see None - * - * @code (for example, tel_req_sim_apdu()) - * #include - * int rt = 0; - * TelResponseData_t outparam; - * TelRequestData_t inparam; - * TapiHandle *handle; // Handle given by tel_init() - * unsigned char apdu[5] = { 0x00, 0x70, 0x00, 0x00, 0x00}; - * memset (&outparam, 0, sizeof(TelResponseData_t)); - * memset (&inparam, 0, sizeof(TelRequestData_t)); - * - * inparam.apdu.apdu_len = strlen(apdu); - * inparam.apdu.apdu = (unsigned char*)malloc(5); - * memcpy (inparam.apdu.apdu, apdu, inparam.apdu.apdu_len); - * - * rt = tel_request_sim_sync(handle, TAPI_SIM_TRANSFER_APDU, &inparam, &outparam); - * - * if(inparam.apdu.apdu) - * free(inparam.apdu.apdu); - * - * msg("rt = [%d]", rt); - * if (rt == 0) { - * msg("outparam.apdu_resp.apdu_resp_len[%d]", outparam.apdu_resp.apdu_resp_len); - * if (outparam.apdu_resp.apdu_resp_len) { - * for (i = 0; i < outparam.apdu_resp.apdu_resp_len; i++) - * msg("[%d]`s byte is [0x%x]", i, outparam.apdu_resp.apdu_resp[i]); - * } - * } - * @endcode - * - * @remarks None - * - */ -/*================================================================================================*/ -int tel_request_sim_sync(TapiHandle *handle, TelSimTapiOperation_t op_type, TelSimRequestData_t *inparam, TelSimResponseData_t *outparam); - -/* - * @brief This API provides asynchronous call interface over some operations (refer to @param [in] op_type) - * - * @par Sync (or) Async: - * This is an Asynchronous API. - * - * @par Important Notes: - * - None - * - * @warning - * - None. - * - * @param [in] handle - * - handle from tel_init(). - * - * @param [in] op_type - * operation type to do what caller want. - * - TAPI_SIM_GET_INIT_STATUS - * - TAPI_SIM_GET_CARD_TYPE - * - TAPI_SIM_GET_IMSI - * - TAPI_SIM_GET_ECC - * - TAPI_SIM_GET_ICCID - * - TAPI_SIM_GET_SPN - * - TAPI_SIM_GET_CPHS_NET_NAME - * - TAPI_SIM_TRANSFER_APDU - * - TAPI_SIM_GET_ATR - * - ( below are not supported. ) - * - TAPI_SIM_GET_LANGUAGE - * - TAPI_SIM_SET_LANGUAGE - * - TAPI_SIM_GET_CALL_FORWARDING - * - TAPI_SIM_SET_CALL_FORWARDING - * - TAPI_SIM_GET_MESSAGE_WAITING - * - TAPI_SIM_SET_MESSAGE_WAITING - * - TAPI_SIM_GET_MAILBOX - * - TAPI_SIM_SET_MAILBOX - * - TAPI_SIM_GET_CPHS_INFO - * - TAPI_SIM_GET_SVCT - * - TAPI_SIM_GET_MSISDN - * - TAPI_SIM_GET_OPLMWACT - * - TAPI_SIM_AUTHENTICATION - * - TAPI_SIM_VERIFY_SEC - * - TAPI_SIM_VERIFY_PUK - * - TAPI_SIM_CHANGE_PIN - * - TAPI_SIM_DISABLE_FACILITY - * - TAPI_SIM_ENABLE_FACILITY - * - TAPI_SIM_GET_FACILITY - * - TAPI_SIM_GET_LOCK_INFO - * - * @param [in] inparam - * input parameter of union type. caller should fill when it is needed as below. - * - TAPI_SIM_GET_INIT_STATUS : (not needed) - * - TAPI_SIM_GET_CARD_TYPE : (not needed) - * - TAPI_SIM_GET_IMSI : (not needed) - * - TAPI_SIM_GET_ECC : (not needed) - * - TAPI_SIM_GET_ICCID : (not needed) - * - TAPI_SIM_GET_SPN : (not needed) - * - TAPI_SIM_GET_CPHS_NET_NAME : (not needed) - * - TAPI_SIM_TRANSFER_APDU : TelSimApdu_t - * - TAPI_SIM_GET_ATR : (not needed) - - * @param [in] callback - * - To register callback function for result. - * - * @param [in] user_data - * - user_data for user specification. - * - * @par Async Response Message: * - * Asynchronous return status is indicated by #TelSimAccessResult_t. - * Asynchronous response data is #TelSimResponseData_t union type. TAPI returns what caller want. - * - TAPI_SIM_GET_INIT_STATUS : TelSimInitInfo_t - * - TAPI_SIM_GET_CARD_TYPE : TelSimCardType_t - * - TAPI_SIM_GET_IMSI : TelSimImsiInfo_t - * - TAPI_SIM_GET_ECC : TelSimEccList_t - * - TAPI_SIM_GET_ICCID : TelSimIccIdInfo_t - * - TAPI_SIM_GET_SPN : TelSimSpn_t - * - TAPI_SIM_GET_CPHS_NET_NAME : TelSimCphsNetName_t - * - TAPI_SIM_TRANSFER_APDU : TelSimApduResp_t - * - TAPI_SIM_GET_ATR : TelSimAtrResp_t - * - * @pre - * - None. - * - * @post - * - None. - * - * @return Return Type (int) - * - Integer '0' ( same with TAPI_API_SUCCESS & TAPI_SIM_ACCESS_SUCCESS ) - indicating that the operation has completed successfully. - * - Negative integer : it provides an error code before actual operations. (Refer #TapiResult_t) - * - Positive integer : it provides an error code while actual operations. (Refer to #TelSimAccessResult_t) - * - * @par Prospective Clients: - * External Apps. - * - * @see None - * - * @code (for example, tel_req_sim_apdu()) - * #include - * int rt = 0; - * TelRequestData_t inparam; - * TapiHandle *handle; // Handle given by tel_init() - * unsigned char apdu[5] = { 0x00, 0x70, 0x00, 0x00, 0x00}; - * memset (&inparam, 0, sizeof(TelRequestData_t)); - * - * inparam.apdu.apdu_len = 5; - * inparam.apdu.apdu = (unsigned char*)malloc(5); - * memcpy (inparam.apdu.apdu, apdu, inparam.apdu.apdu_len); - * - * rt = tel_request_sim_async(handle, TAPI_SIM_TRANSFER_APDU, &inparam, on_sim_call_async, NULL); - * if(inparam.apdu.apdu) - * free(inparam.apdu.apdu); - * } - * } - * - * void on_sim_call_async (TapiHandle *handle, int result, void *data, - * void *user_data) - * { - * TelSimAccessResult_t access_rt = result; - * TelSimResponseData_t *resp = data; - * int i = 0; - * - * msg("tel_request_sim_async() response received"); - * msg("access_rt[%d]", access_rt); - * - * if (access_rt == 0) { - * msg("apdu_resp_len[%d]", resp->apdu_resp.apdu_resp_len); - * if (resp->apdu_resp.apdu_resp_len) { - * for (i = 0; i < resp->apdu_resp.apdu_resp_len; i++) - * msg("[%d]`s byte is [0x%x]", i, resp->apdu_resp.apdu_resp[i]); - * } - * } - * } - * - * @endcode - * - * @remarks None - * - */ -/*================================================================================================*/ -int tel_request_sim_async(TapiHandle *handle, TelSimTapiOperation_t op_type, TelSimRequestData_t *inparam, tapi_response_cb callback, void *user_data); - -#ifdef __cplusplus -} -#endif - -#endif /* _ITAPI_SIM_H_ */ - -/** -* @} -*/ diff --git a/wearable/include/ITapiSs.h b/wearable/include/ITapiSs.h deleted file mode 100755 index dd63254..0000000 --- a/wearable/include/ITapiSs.h +++ /dev/null @@ -1,1116 +0,0 @@ -/* - * libslp-tapi - * - * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. - * - * Contact: Ja-young Gu - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT 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 SS_TAPI SS(Supplementary services) -* @{ -* -* @file ITapiSs.h - - @brief This file serves as a "C" header file defines functions for Tapi Supplementary services\n - It contains a sample set of function prototypes that would be required by applications. - */ - -#ifndef _ITAPI_SS_H_ -#define _ITAPI_SS_H_ - -#include -#include -#include - -#ifdef __cplusplus -extern "C" -{ -#endif - - /** - * @brief This function sends a request to activate/deactivate call barring. - * - * This service makes it possible for a mobile subscriber - * to activate barring of certain categories of outgoing or incoming calls according to a barring program which is selected from a set - * of one or more barring programs chosen at provision time and is valid for all outgoing or incoming calls, or just those associated - * with a specific basic service group. Also this API allows deactivating call barring based on categories set. - * If the user call this function with wrong password 3 times subsequently, the barring service can be blocked. - * If this function is called normally, the asynchronous response comes in a few second from network. The response indicates - * the service request has been granted or not. - * - * This API makes Dbus method call to Telephony Sever and gets immediate feedback. - * However it just means that the API request has been transfered to the CP successfully. - * The actual operation result is delivered with the async response as below. - * - * @par Sync (or) Async: - * This is an Asynchronous API. - * - * @par Important Notes: - * - None. - * - * @warning - * - None. - * - * @param [in] handle - * - handle from tel_init(). - * - * @param [in] info - * - Contains the information about call barring - * - * @param [in] callback - * - To register callback function for result. - * - * @param [in] user_data - * - user_data for user specification. - * - * @par Async Response Message: - * Asynchronous return status is indicated by #TelSsBarringResp_t. - * - * @pre - * - Initialize Dbus connection with #tel_init - * - Register caller's application name with #tel_register_app_name - * - Register telephony events to listen - * - A event loop is running to listen events - * - * @post - * - None. - * - * @return Return Type (int) \n - * - TAPI_API_SUCCESS - indicating that the operation has completed successfully. \n - * - Refer #TapiResult_t for failure and error code - * - * @par Prospective Clients: - * External Apps. - * - * \see tel_get_ss_barring_status, tel_change_ss_barring_password - * - * @code - * #include - * - * int ret_status = -1; - * TelSsCallBarringInfo_t pBarringInfo;// = {0,}; - * void *user_data; - * char bar_pwd[5]="0000"; - * TapiHandle *handle; // Handle given by tel_init() - * tapi_response_cb callback; //Initialized call-back function pointer in which response is returned - * - * pBarringInfo.Mode = TAPI_SS_CALL_BAR_ACTIVATE; - * pBarringInfo.Type = TAPI_CALL_BARRING_ALL_OUTGOING_CALLS; - * pBarringInfo.CallType = TAPI_CALL_TYPE_VOICE_EV; - * strcpy(pBarringInfo.szPassword,bar_pwd); - * ret_status = tel_set_ss_barring (handle,&pBarringInfo,callback,user_data); - * @endcode - * - * @remarks - * - None - * - * - */ - /*================================================================================================*/ -int tel_set_ss_barring(TapiHandle *handle, TelSsBarringInfo_t *info, tapi_response_cb callback, void *user_data); - -/** - * - * @brief This function gets call barring status. - * - * The mobile subscriber may determine by subscription of a set of one or more unique barring - * programs what kind of outgoing or incoming calls should be barred. - * If this function is called normally, the asynchronous response comes in a few second from network. - * The response indicates the service status. - * - * This API makes Dbus method call to Telephony Sever and gets immediate feedback. - * However it just means that the API request has been transfered to the CP successfully. - * The actual operation result is delivered with the async response as below. - * - * @par Sync (or) Async: - * This is an Asynchronous API. - * - * @par Important Notes: - * - None. - * - * @warning - * - None. - * - * @param [in] handle - * - handle from tel_init(). - * - * @param [in] ss_class - * - Specifies the type of call i.e. Voice call, Video Call etc. - * - * @param [in] type - * - Specifies barring type i.e. Outgoing international, outgoing all, Incoming all etc. - * - * @param [in] callback - * - To register callback function for result. - * - * @param [in] user_data - * - user_data for user specification. - * - * @par Async Response Message: - * Asynchronous return status is indicated by #TelSsBarringResp_t. - * - * @pre - * - Initialize Dbus connection with #tel_init - * - Register caller's application name with #tel_register_app_name - * - Register telephony events to listen - * - A event loop is running to listen events - * - * @post - * - None. - * - * @return Return Type (#TapiResult_t) \n - * - TAPI_API_SUCCESS - indicating that the operation has completed successfully. \n - * - Refer #TapiResult_t for failure and error code - * - * @par Prospective Clients: - * External Apps. - * - * \see tel_set_ss_barring, tel_change_ss_barring_password - * - * @code - * #include - * - * int ret_status; - * TelSsCallBarType_t BarType =TAPI_CALL_BARRING_ALL_OUTGOING_INTERN_CALL; - * TelSsCallType_t CallType = TAPI_CALL_TYPE_VOICE_EV; - * void *user_data; - * TapiHandle *handle; // Handle given by tel_init() - * tapi_response_cb callback; //Initialized call-back function pointer in which response is returned - * - * ret_status = tel_get_ss_barring_status(handle,CallType,BarType,callback,user_data); // get barring status - * printf ("The return value is %d\n", ret_status); - * - * @endcode - * - * - * @remarks - * - None - * - * - */ -/*================================================================================================*/ -int tel_get_ss_barring_status(TapiHandle *handle, TelSsClass_t ss_class, TelSsBarringType_t type, tapi_response_cb callback, void *user_data); - - /** - * - * @brief This function allows changing of the barring password in Network. - * - * User can request network to change his own barring password. If the old password is not same with - * what network knows, it will be rejected by network. Also new password should be same with another new password - * which is to confirm user input. Otherwise the request must be rejected by Telephony Sever. - * If the user call this function with wrong old password 3 times subsequently, the barring service can be blocked. - * If this function is called normally, the asynchronous response comes in a few second from network. - * The response indicates the service request has been granted or not. - * - * This API makes Dbus method call to Telephony Sever and gets immediate feedback. - * However it just means that the API request has been transfered to the CP successfully. - * The actual operation result is delivered with the async response as below. - * - * - * @par Sync (or) Async: - * This is an Asynchronous API. - * - * @par Important Notes: - * - Based on 3GPP TS 22.030 section 6.5.4 Registration of New Password. Only one Change Barring Password request is allowed - * at a time and TS might return TAPI_API_REQUEST_MAX_IN_PROGRESS if another request is received. - * - * @warning - * - None. - * - * @param [in] handle - * - handle from tel_init(). - * - * @param [in] old_password - * - Old password set for Barring in Network. This is Null terminated string - * - * @param [in] new_password - * - New password for Barring to be set in Network. This is Null terminated string. - * - * @param [in] new_password_again - * - New password again. This is Null terminated string. - * - * @param [in] callback - * - To register callback function for result. - * - * @param [in] user_data - * - user_data for user specification. - * - * @par Async Response Message: - * Asynchronous return status will be succes or failure. - * - * @pre - * - Initialize Dbus connection with #tel_init - * - Register caller's application name with #tel_register_app_name - * - Register telephony events to listen - * - A event loop is running to listen events - * - * @post - * - None. - * - * @return Return Type (int) \n - * - TAPI_API_SUCCESS - indicating that the operation has completed successfully. \n - * - Refer #TapiResult_t for failure and error code - * @par Prospective Clients: - * External Apps. - * - * @see - * - None - * - * @code - * #include - * - * int ret_status; - * void *user_data; - * TapiHandle *handle; // Handle given by tel_init() - * tapi_response_cb callback; //Initialized call-back function pointer in which response is returned - * - * ret_status = tel_change_ss_barring_password (handle,"0000","1111","1111",callback,user_data); // change barring password - * - * @endcode - * - * @remarks - * - None - * - * - */ -/*================================================================================================*/ -int tel_change_ss_barring_password(TapiHandle *handle, - const char *old_password, - const char *new_password, - const char *new_password_again, - tapi_response_cb callback, void *user_data); - - /** - * - * @brief This function allows to set (register/erase/activate/deactivate) call forwarding option at the Network. - * - * This enables to forward the 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, - * addressed to the called mobile subscriber's directory number and which meet - * various call FORWARD condition 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 under this call forward condition. - * Application has to call this API in order to explicitly register/erase/activate/deactivate - * the call forwarding. Request will be passed irrespective of whether already - * another SS call forward is ongoing. - * - * If this function is called normally, the asynchronous response comes in a few second from network. The response indicates - * the service request has been granted or not. - * - * This API makes Dbus method call to Telephony Sever and gets immediate feedback. - * However it just means that the API request has been transfered to the CP successfully. - * The actual operation result is delivered with the async response as below. - * - * - * @par Sync (or) Async: - * This is an Asynchronous API. - * - * @par Important Notes: - * - None. - * - * @warning - * - None. - * - * @param [in] handle - * - handle from tel_init(). - * - * @param [in] info - * - Contains the Call forward information like forward mode, forward type, etc. - * - * @param [in] callback - * - To register callback function for result. - * - * @param [in] user_data - * - user_data for user specification. - * - * @par Async Response Message: - * Asynchronous return status is indicated by #TelSsForwardResp_t. - * - * @pre - * - Initialize Dbus connection with #tel_init - * - Register caller's application name with #tel_register_app_name - * - Register telephony events to listen - * - A event loop is running to listen events - * - * @post - * - None. - * - * @return Return Type (int) \n - * - TAPI_API_SUCCESS - indicating that the operation has completed successfully. \n - * - Refer #TapiResult_t for failure and error code - * @par Prospective Clients: - * External Apps. - * - * - * \image html CallForward.jpg - * \image latex CallForward.jpg - * - * \see tel_get_ss_forward_status - * - * @code - * #include - * - * int ret_status =0; - * void *user_data; - * 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]= {"9986529874"};//number to which calles need to be forwarded. - * TapiHandle *handle; // Handle given by tel_init() - * tapi_response_cb callback; //Initialized call-back function pointer in which response is returned - * - * len = strlen(cf_number); - * printf("Length of CF number :%d \n",len); - * memcpy(&(pForwardInfo.szPhoneNumber),cf_number,len); - * - * ret_status = tel_set_ss_forward (handle,&pForwardInfo,callback,user_data); - * - * @endcode - * @remarks - * - None - * - * - */ -/*================================================================================================*/ -int tel_set_ss_forward(TapiHandle *handle, const TelSsForwardInfo_t *info, tapi_response_cb callback, void *user_data); - - /** - * - * @brief This function provides option to get the call forwarding status of different calls from Network. - * - * The data request procedure enables the mobile subscriber to obtain information about the data stored in the PLMN. - * After having requested this procedure the network shall return the following information: - * - in response to a general data request the served mobile subscriber should be given a list of all Basic service groups - * to which call forwarding unconditional is registered, including information whether or not it is active and operative, - * and the associated forwarded-to numbers - * - in response to a specific request concerning one particular Basic service group, - * the served mobile subscriber should be informed whether or not call forwarding unconditional is registered, - * including information whether or not it is active and operative for that Basic service group. - * If CFU is registered, the associated forwarded-to number shall be given. - * - * If this function is called normally, the asynchronous response comes in a few second from network. - * The response indicates the service status. - * - * This API makes Dbus method call to Telephony Sever and gets immediate feedback. - * However it just means that the API request has been transfered to the CP successfully. - * The actual operation result is delivered with the async response as below. - * - * - * @par Sync (or) Async: - * This is an Asynchronous API. - * - * @par Important Notes: - * - None. - * - * @warning - * - None. - * - * @param [in] handle - * - handle from tel_init(). - * - * @param [in] ss_class - * - Specifying the Forward call type i.e. voice call, Video Call, Data Calls etc. - * - * @param [in] condition - * - Used to specify the forward condition i.e. unconditional, When no reply, when busy, when not reachable etc. - * - * @param [in] callback - * - To register callback function for result. - * - * @param [in] user_data - * - user_data for user specification. - * - * @par Async Response Message: - * Asynchronous return status is indicated by #TelSsForwardResp_t. - * - * @pre - * - Initialize Dbus connection with #tel_init - * - Register caller's application name with #tel_register_app_name - * - Register telephony events to listen - * - A event loop is running to listen events - * - * @post - * - None. - * - * @return Return Type (int) \n - * - TAPI_API_SUCCESS - indicating that the operation has completed successfully. \n - * - Refer #TapiResult_t for failure and error code - * - * @par Prospective Clients: - * External Apps. - * - * \see tel_set_ss_forward - * - * @code - * #include - * int ret_status = 0; - * TelSsForwardType_t type =TAPI_CS_FORWARD_TYPE_VOICE_EV; - * TelSsForwardWhen_t condition = TAPI_SS_FORWARD_WHEN_UNCONDITIONAL_EV; - * void *user_data; - * TapiHandle *handle; // Handle given by tel_init() - * tapi_response_cb callback; //Initialized call-back function pointer in which response is returned - * - * ret_status = tel_get_ss_forward_status(handle,type,condition,callback,user_data); // get forward status - * - * @endcode - * @remarks - * - None - * - * - */ -/*================================================================================================*/ -int tel_get_ss_forward_status(TapiHandle *handle, TelSsClass_t ss_class, TelSsForwardWhen_t condition, tapi_response_cb callback, void *user_data); - - /** - * - * @brief This function activates/deactivates the call waiting service. - * The call waiting service permits a mobile to be notified of an incoming - * call (as per basic call procedures) while the traffic channel (BM or LM) is not available for the incoming call and the mobile subscriber - * is engaged in an active or held call. Subsequently, the subscriber can accept, reject, or ignore the incoming call. - * If this function is called normally, the asynchronous response comes in a few second from network. The response indicates - * the service request has been granted or not. - * - * This API makes Dbus method call to Telephony Sever and gets immediate feedback. - * However it just means that the API request has been transfered to the CP successfully. - * The actual operation result is delivered with the async response as below. - * - * - * @par Sync (or) Async: - * This is an Asynchronous API. - * - * @par Important Notes: - * - None. - * - * @warning - * - None. - * - * - * @param [in] handle - * - handle from tel_init(). - * - * @param [in] info - * - Specifies the status of call-waiting service i.e. On (TRUE) or off (FALSE) - * - * @param [in] callback - * - To register callback function for result. - * - * @param [in] user_data - * - user_data for user specification. - * - * @par Async Response Message: - * Asynchronous return status is indicated by #TelSsWaitingResp_t. - * - * @pre - * - Initialize Dbus connection with #tel_init - * - Register caller's application name with #tel_register_app_name - * - Register telephony events to listen - * - A event loop is running to listen events - * - * @post - * - None. - * - * @return Return Type (int) \n - * - TAPI_API_SUCCESS - indicating that the operation has completed successfully. \n - * - Refer #TapiResult_t for failure and error code - * - * @par Prospective Clients: - * External Apps. - * - * \see tel_get_ss_waiting_status - * - * @code - * #include - * - * int ret_status; - * TelSsWaitingInfo_t waitInfo; - * waitInfo.Mode = TAPI_SS_CW_ACTIVATE; - * waitInfo.CallType =TAPI_CALL_TYPE_VOICE_EV; - * void *user_data; - * TapiHandle *handle; // Handle given by tel_init() - * tapi_response_cb callback; //Initialized call-back function pointer in which response is returned - * - * ret_status = tel_set_ss_waiting (handle,&waitInfo,callback,user_data); // set call waiting - * @endcode - * - * @remarks - * - None - * - * - */ -/*================================================================================================*/ -int tel_set_ss_waiting(TapiHandle *handle, const TelSsWaitingInfo_t *info, tapi_response_cb callback, void *user_data); - - /** - * - * @brief This function queries the status of call waiting service. - * - * @par Notes: - * The call waiting service permits a mobile to be notified of an incoming call - * (as per basic call procedures) while the traffic channel (BM or LM) is not available for the incoming call and the mobile subscriber - * is engaged in an active or held call. Subsequently, the subscriber can accept, reject, or ignore the incoming call. - * If this function is called normally, the asynchronous response comes in a few second from network. - * The response indicates the service status. - * - * This API makes Dbus method call to Telephony Sever and gets immediate feedback. - * However it just means that the API request has been transfered to the CP successfully. - * The actual operation result is delivered with the async response as below. - * - * - * @par Sync (or) Async: - * This is an Asynchronous API. - * - * @par Important Notes: - * - None. - * - * @warning - * - None. - * - * - * @param [in] handle - * - handle from tel_init(). - * - * @param [in] ss_class - * - enum data defines call type - * - * @param [in] callback - * - To register callback function for result. - * - * @param [in] user_data - * - user_data for user specification. - * - * @par Async Response Message: - * Asynchronous return status is indicated by #TelSsWaitingResp_t. - * - * @pre - * - Initialize Dbus connection with #tel_init - * - Register caller's application name with #tel_register_app_name - * - Register telephony events to listen - * - A event loop is running to listen events - * - * @post - * - None. - * - * @return Return Type (int) \n - * - TAPI_API_SUCCESS - indicating that the operation has completed successfully. \n - * - Refer #TapiResult_t for failure and error code - * @par Prospective Clients: - * External Apps. - * - * \see tel_set_ss_waiting - * @code - * #include - * - * int ret_status; - * TelSsCallType_t CallType = TAPI_CALL_TYPE_VOICE_EV; - * void *user_data; - * TapiHandle *handle; // Handle given by tel_init() - * tapi_response_cb callback; //Initialized call-back function pointer in which response is returned - * - * ret_status = tel_get_ss_waiting_status (handle,CallType,callback,user_data); // get call waiting info - * @endcode - * - * @remarks - * - None - * - * - */ -/*================================================================================================*/ -int tel_get_ss_waiting_status(TapiHandle *handle, const TelSsClass_t ss_class, tapi_response_cb callback, void *user_data); - -/** - * - * @brief This function activates/deactivates the status of calling line identity service. - * - * @par Notes: - * The group of Line Identification Supplementary Services is divided into the following six Supplementary Services: - * CLIP - Calling line identification presentation - * This Supplementary Service provides for the ability to indicate the line identity of the calling party to the called party. - * The network shall deliver the calling line identity to the called party at call set-up time, - * regardless of the terminal capability to handle the information. - * CLIR - Calling line identification restriction - * the CLIR Supplementary Service is a Supplementary Service offered to the calling party - * to prevent presentation of the calling party's line identity, to the called party. - * COLP - Connected line identification presentation - * This Supplementary Service is not a dialing check but an indication to the calling subscriber - * of the connected line identity in a full ISDN/PLMN environment, - * the connected line identity shall include all the information necessary to unambiguously identify the connected party. - * The network shall deliver the connected line identity to the calling party - * regardless of the terminal capability to handle the information. - * COLR - Connected line identification restriction - * The COLR Supplementary Service is a Supplementary Service offered - * to the connected party to prevent presentation of the connected line identity, to the calling party. - * In the case where the calling party has an override category. - * CDIP - Called line identification presentation - * CNAP - Calling name presentation - * This function queries the service status with #TelSsCliType_t - * - * If this function is called normally, the asynchronous response comes in a few second from network. - * The response indicates the service status. - * - * This API makes Dbus method call to Telephony Sever and gets immediate feedback. - * However it just means that the API request has been transfered to the CP successfully. - * The actual operation result is delivered with the async response as below. - * - * - * @par Sync (or) Async: - * This is an Asynchronous API. - * - * @par Important Notes: - * - None. - * - * @warning - * - None. - * - * @param [in] handle - * - handle from tel_init(). - * - * @param [in] type - * - enum data defines Cli service type - * - * @param [in] status - * - enum data defines Cli Status - * - * @param [in] callback - * - To register callback function for result. - * - * @param [in] user_data - * - user_data for user specification. - * - * @par Async Response Message: - * Asynchronous return status is indicated by #TelSsCliResp_t. - * - * @pre - * - Initialize Dbus connection with #tel_init - * - Register caller's application name with #tel_register_app_name - * - Register telephony events to listen - * - A event loop is running to listen events - * - * @post - * - None. - * - * @return Return Type (int) \n - * - TAPI_API_SUCCESS - indicating that the operation has completed successfully. \n - * - Refer #TapiResult_t for failure and error code - * - * @par Prospective Clients: - * External Apps. - * - * @code - * #include - * - * int ret_status = 0; - * TelSsCliType_t CliType =TAPI_SS_CLI_CDIP; - * void *user_data; - * TapiHandle *handle; // Handle given by tel_init() - * tapi_response_cb callback; //Initialized call-back function pointer in which response is returned - * - * ret_status = tel_set_ss_cli_status(handle,CliType,CliStatus,callback,user_data); // get cli info - * @endcode - * - * @see - * - None - * - * @remarks - * - None - * - * - */ -/*================================================================================================*/ -int tel_set_ss_cli_status(TapiHandle *handle, TelSsCliType_t type, TelSsCliStatus_t status, tapi_response_cb callback, void *user_data); - -/** - * - * @brief This function queries the status of calling line identity service. - * - * @par Notes: - * The group of Line Identification Supplementary Services is divided into the following six Supplementary Services: - * CLIP - Calling line identification presentation - * This Supplementary Service provides for the ability to indicate the line identity of the calling party to the called party. - * The network shall deliver the calling line identity to the called party at call set-up time, - * regardless of the terminal capability to handle the information. - * CLIR - Calling line identification restriction - * the CLIR Supplementary Service is a Supplementary Service offered to the calling party - * to prevent presentation of the calling party's line identity, to the called party. - * COLP - Connected line identification presentation - * This Supplementary Service is not a dialing check but an indication to the calling subscriber - * of the connected line identity in a full ISDN/PLMN environment, - * the connected line identity shall include all the information necessary to unambiguously identify the connected party. - * The network shall deliver the connected line identity to the calling party - * regardless of the terminal capability to handle the information. - * COLR - Connected line identification restriction - * The COLR Supplementary Service is a Supplementary Service offered - * to the connected party to prevent presentation of the connected line identity, to the calling party. - * In the case where the calling party has an override category. - * CDIP - Called line identification presentation - * CNAP - Calling name presentation - * This function queries the service status with #TelSsCliType_t - * - * If this function is called normally, the asynchronous response comes in a few second from network. - * The response indicates the service status. - * - * This API makes Dbus method call to Telephony Sever and gets immediate feedback. - * However it just means that the API request has been transfered to the CP successfully. - * The actual operation result is delivered with the async response as below. - * - * - * @par Sync (or) Async: - * This is an Asynchronous API. - * - * @par Important Notes: - * - None. - * - * @warning - * - None. - * - * @param [in] handle - * - handle from tel_init(). - * - * @param [in] type - * - enum data defines Cli service type - * - * @param [in] callback - * - To register callback function for result. - * - * @param [in] user_data - * - user_data for user specification. - * - * @par Async Response Message: - * Asynchronous return status is indicated by #TelSsCliResp_t. - * - * @pre - * - Initialize Dbus connection with #tel_init - * - Register caller's application name with #tel_register_app_name - * - Register telephony events to listen - * - A event loop is running to listen events - * - * @post - * - None. - * - * @return Return Type (int) \n - * - TAPI_API_SUCCESS - indicating that the operation has completed successfully. \n - * - Refer #TapiResult_t for failure and error code - * - * @par Prospective Clients: - * External Apps. - * - * @code - * #include - * - * int ret_status = 0; - * TelSsCliType_t CliType =TAPI_SS_CLI_CDIP; - * void *user_data; - * TapiHandle *handle; // Handle given by tel_init() - * tapi_response_cb callback; //Initialized call-back function pointer in which response is returned - * - * ret_status = tel_get_ss_cli_status(handle,CliType,callback,user_data); // get cli info - * @endcode - * - * @see - * - None - * - * @remarks - * - None - * - * - */ -/*================================================================================================*/ -int tel_get_ss_cli_status(TapiHandle *handle, TelSsCliType_t type, tapi_response_cb callback, void *user_data); - - /** - * - * @brief This function is used to send a USSD string or User response to the Network. - * - * The unstructured supplementary service data (USSD) mechanism allows the Mobile Station (MS) user and - * a PLMN operator defined application to communicate in a way which is transparent - * to the MS and to intermediate network entities. - * The mechanism allows development of PLMN specific supplementary services. - * USSD string is like *109, *109*72348937857623#. - * There are two modes of USSD: MMI-mode and application mode. - * MMI-mode USSD is for the transparent transport of MMI strings entered by the user to the network using this function - * and for the transparent transport of text strings from the network that are displayed - * by the mobile for user information. - * Application mode USSD is for the transparent transport of data between the network and the UE. - * Application mode USSD is intended to be used by applications in the network and their peer applications in the UE. - * The peer application in the UE send response with #tel_send_ss_ussd_response - * - * If this function is called normally, the asynchronous response comes in a few second from the telephony server. - * The response indicates whether the sending request is successfully delivered or not. - * - * This API makes Dbus method call to Telephony Sever and gets immediate feedback. - * However it just means that the API request has been transfered to the CP successfully. - * The actual operation result is delivered with the async response as below. - * @par Sync (or) Async: - * This is an Asynchronous API. - * - * @par Important Notes: - * - None. - * - * @warning - * - None. - * - * @param [in] handle - * - handle from tel_init(). - * - * @param [in] info - * - Data coding scheme used (GSM 7bit or 8bit default alphabet etc, defined as 3GPP TS 23.038) - * - USSD String data length - * - ANSI string passed by the client - * - * @param [in] callback - * - To register callback function for result. - * - * @param [in] user_data - * - user_data for user specification. - * - * @par Async Response Message: - * Asynchronous return status is indicated by #TelSsUssdResp_t. - * - * @pre - * - Initialize Dbus connection with #tel_init - * - Register caller's application name with #tel_register_app_name - * - Register telephony events to listen - * - A event loop is running to listen events - * - 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) - * - * @post - * - None. - * - * @return Return Type (int) \n - * - TAPI_API_SUCCESS - indicating that the operation has completed successfully. \n - * - Refer #TapiResult_t for failure and error code - * - * @par Prospective Clients: - * External Apps. - * - * \see #tel_send_ss_ussd_response, #tel_send_ss_ussd_cancel - * - *\image html ussd.jpg - *\image latex ussd.jpg - * - * @code - * #include - * - * char ussdString[TAPI_SS_USSD_DATA_SIZE_MAX]; - * int ret; - * TapiHandle *handle; // Handle given by tel_init() - * tapi_response_cb callback; //Initialized call-back function pointer in which response is returned - * void *user_data; - * - * memset(ussdString, 0, TAPI_SS_USSD_DATA_SIZE_MAX); - * strcpy(ussdString , "*124#"); - * - * ret = tel_send_ss_ussd_request(handle,ussdString,callback,user_data); // request ussd - * @endcode - * - * @remarks - * - None - * - * - */ -/*================================================================================================*/ -int tel_send_ss_ussd_request(TapiHandle *handle, const TelSsUssdMsgInfo_t *info, tapi_response_cb callback, void *user_data); - - /** - * - * @brief This function is used to Read AOC parameter values on the SIM. - * - * @par Notes - * This supplementary service provides the MS with the information to produce an estimate - * of the cost of the service used. Charges are indicated for the call(s) in progress - * when mobile originated or for the roaming leg only when mobile terminated. - * Any charges for non-call related transactions, and for certain supplementary services, - * such as Call Forwarding are not indicated. - * The MS will receive at the beginning of each call (and as necessary during the call) - * a message, the Charge Advice Information. This message contains the elements which together define - * the rate at which the call is to be charged, time dependence, - * data dependence and for unit increments - see TS 22.024 [3]. - * The MS shall still indicate appropriate charges even when roaming, based on Home PLMN units. - * Where applicable, the volume charge for Packet data service, - * in addition to the normal time dependent and incremental charges, shall be indicated. - * To indicate the charge per call the Mobile station shall display the units consumed - * so far during the present call(s) and maintain this value until the MS is switched off or a new call set-up is attempted. - * Where required to indicate the total accumulated charge, the MS shall be able to display, - * and the SIM/USIM shall store in the ACM, the running cumulative unit charge. - * This value must be stored securely, and all reasonable steps shall be taken to ensure that - * the written value cannot be interrupted, reset or corrupted (except resetting under control of the unblocking key). - * This function get the AOC configuration information from PLMN - * - * If this function is called normally, the asynchronous response comes in a few second from Telephony Server. - * The response indicates whether the query is delivered successfully to network or not. - * - * This API makes Dbus method call to Telephony Sever and gets immediate feedback. - * However it just means that the API request has been transfered to the CP successfully. - * The actual operation result is being delivered asynchronously. - * - * @par Sync (or) Async: - * This is an Asynchronous API. - * - * @par Important Notes: - * - None. - * - * @warning - * - None. - * - * - * @param [in] handle - * - handle from tel_init(). - * - * @param [in] AocType - * - Specifies which type of Advice of charge information to be read namely Maximum ACM, - * Price per unit currency, Current call meter and Accumulated call meter values. - * - * @param [in] callback - * - To register callback function for result. - * - * @param [in] user_data - * - user_data for user specification. - * - * @par Async Response Message: - * None - * - * @pre - * - Advice of charge depends on the SIM for setting or reading AOC parameters. - * - Setting of AOC needs PIN2 Verification - * - * @post - * - None. - * - * @return Return Type (int) \n - * - TAPI_API_SUCCESS - indicating that the operation has completed successfully. \n - * - Refer #TapiResult_t for failure and error code - * - * @par Prospective Clients: - * External Apps. - * - * \see tel_set_ss_aoc_info - * - *\image html ussd.jpg - *\image latex ussd.jpg - * @code - * #include - * - * TelSsAocType_t AocType = TAPI_SS_AOC_TYPE_ACM; - * TapiHandle *handle; // Handle given by tel_init() - * tapi_response_cb callback; //Initialized call-back function pointer in which response is returned - * void *user_data; - * - * ret_status = tel_get_ss_aoc_info (handle,AocType,callback,user_data); // get AOC info - * @endcode - * - * @remarks - * - None - * - * - */ -/*================================================================================================*/ -int tel_get_ss_aoc_info(TapiHandle *handle, TelSsAocType_t AocType, tapi_response_cb callback, void *user_data); - - /** - * - * @brief This function is used to Read AOC parameter values on the SIM. - * - * @par Notes: - * Refer #tel_get_ss_aoc_info - * - * If this function is called normally, the asynchronous response comes in a few second from Telephony Server. - * The response indicates whether the query is delivered successfully to network or not. - * - * This API makes Dbus method call to Telephony Sever and gets immediate feedback. - * However it just means that the API request has been transfered to the CP successfully. - * The actual operation result is being delivered asynchronously. - * - * @par Sync (or) Async: - * This is an Asynchronous API. - * - * @par Important Notes: - * - None. - * - * @warning - * - None. - * - * - * @param [in] handle - * - handle from tel_init(). - * - * @param [in] AocSetInfo - * - Specifies which type of Advice of charge information to be set namely Maximum ACM, - * Price per unit currency, Current call meter and Accumulated call meter values. - * - * @param [in] callback - * - To register callback function for result. - * - * @param [in] user_data - * - user_data for user specification. - * - * @par Async Response Message: - * None - * - * @pre - * - Advice of charge depends on the SIM for setting or reading AOC parameters. - * - Setting of AOC needs PIN2 Verification - * - * @post - * - None. - * - * @return Return Type (int) \n - * - TAPI_API_SUCCESS - indicating that the operation has completed successfully. \n - * - Refer #TapiResult_t for failure and error code - * - * @par Prospective Clients: - * External Apps. - * - * \see tel_get_ss_aoc_info - * - *\image html ussd.jpg - *\image latex ussd.jpg - * @code - * #include - * - * TelCallAocInfo_t *pAocSetInfo; - * void *user_data; - * pAocSetInfo = (TelCallAocInfo_t *)calloc(1,sizeof(TelCallAocInfo_t)); - * pAocSetInfo->AocType = TAPI_SS_AOC_TYPE_RESET; - * int ret_status =0; - * TapiHandle *handle; // Handle given by tel_init() - * tapi_response_cb callback; //Initialized call-back function pointer in which response is returned - * - * ret = tel_set_ss_aoc_info (handle,pAocSetInfo,callback,user_data); // set aoc info - * @endcode - * - * - * @remarks - * - None - * - * - */ -/*================================================================================================*/ -int tel_set_ss_aoc_info(TapiHandle *handle, TelCallAocInfo_t *AocSetInfo, tapi_response_cb callback, void *user_data); - -#ifdef __cplusplus -} -#endif - -#endif /* _ITAPI_SS_H_ */ - -/** -* @} -*/ diff --git a/wearable/include/SLP_TelephonyFW_PG.h b/wearable/include/SLP_TelephonyFW_PG.h deleted file mode 100755 index 8e76296..0000000 --- a/wearable/include/SLP_TelephonyFW_PG.h +++ /dev/null @@ -1,7644 +0,0 @@ -/* - * libslp-tapi - * - * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. - * - * Contact: Ja-young Gu - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT 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("com.samsung.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("com.samsung.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("com.samsung.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("com.samsung.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("com.samsung.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("com.samsung.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_dial_call(TapiHandle *handle, const TelCallDial_t *pParams, tapi_response_cb callback, void *user_data); -@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() -{ - TapiHandle *handle = menu_manager_ref_user_data(mm); - TelCallDial_t data; - int result; - int len; - - memset(&data, 0, sizeof(TelCallDial_t)); - - data.CallType = atoi(data_call_type); - len = strlen(data_call_number); - if (len > TAPI_CALL_DIALDIGIT_LEN_MAX) { - msg("number too long"); - return 0; - } - - memcpy(data.szNumber, data_call_number, len); - - msg("call tel_dail_call()"); - - result = tel_dial_call(handle, &data, on_dial_call, 0); - if (result != TAPI_API_SUCCESS) { - msg("failed. (result = %d)", result); - } - - return 0; -} - -//CALLBACK FUNCTION TO BE USED -static void app_callback (TelTapiEvent_t *event) -{ - int eventClass; - int eventType; - 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) - { - //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(TapiHandle *handle, unsigned int CallHandle, TelCallAnswerType_t AnsType, tapi_response_cb callback, void *user_data); -@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) -{ - TapiHandle *handle = menu_manager_ref_user_data(mm); - int result; - unsigned int call_id; - TelCallAnswerType_t answer_type; - - - msg("call tel_answer_call()"); - - call_id = atoi(data_call_id); - answer_type = atoi(data_answer_type); - - result = tel_answer_call(handle, call_id, answer_type, on_answer_call, 0); - if (result != TAPI_API_SUCCESS) { - msg("failed. (result = %d)", result); - } - - return 0; -} - -//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 -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) -{ - TapiHandle *handle = menu_manager_ref_user_data(mm); - int result; - unsigned int call_id; - TelCallEndType_t end_type; - - msg("call tel_end_call()"); - - call_id = atoi(data_call_id); - end_type = atoi(data_end_type); - - result = tel_end_call(handle, call_id, end_type, on_end_call, 0); - if (result != TAPI_API_SUCCESS) { - msg("failed. (result = %d)", result); - } - - return 0; -} //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(TapiHandle *handle, unsigned int CallHandle, tapi_response_cb callback, void *user_data); -@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) -{ - unsigned int call_handle = VC_TAPI_CALLHANDLE; - TapiResult_t tapi_err = TAPI_API_SUCCESS; - // Hold the call - //Puts the given call on hold - tapi_err = tel_hold_call(tapi_handle, call_handle, _vc_core_engine_hold_call_resp_cb, NULL); - if (TAPI_API_SUCCESS != tapi_err) { - CALL_ENG_DEBUG(ENG_DEBUG, "tel_hold_call() Failed Error Code: %d", tapi_err); - return FALSE; - } - - return; -} //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_active_call(TapiHandle *handle, unsigned int CallHandle, tapi_response_cb callback, void *user_data); -@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) -{ - unsigned int call_handle = VC_TAPI_CALLHANDLE; - TapiResult_t tapi_err = TAPI_API_SUCCESS; - - tapi_err = tel_active_call(tapi_handle, call_handle, _vc_core_engine_active_call_resp_cb, NULL); - if (TAPI_API_SUCCESS != tapi_err) { - CALL_ENG_DEBUG(ENG_DEBUG, "tel_active_call() Failed Error Code: %d", tapi_err); - return FALSE; - } -} //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(TapiHandle *handle, unsigned int CallHandle1, unsigned int CallHandle2, tapi_response_cb callback, void *user_data); -@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 ; - TapiHandle *handle; - unsigned int CallHandle1; - unsigned int CallHandle2; - tapi_response_cb callback; - void *user_data; - ret_status = tel_swap_call(handle, CallHandle1, CallHandle2, callback, user_data); - if (TAPI_API_SUCCESS != tapi_err) { - CALL_ENG_DEBUG(ENG_DEBUG, "tel_swap_call() Failed, Error Code: %d", tapi_err); - return FALSE; - } - - return TRUE; -} //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_call_dtmf(TapiHandle *handle, const char *pDtmfString, tapi_response_cb callback, void *user_data); -@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 ; - TapiHandle *handle; - unsigned int pCallHandle; - void *user_data; - char DtmfString[10] = {0, }; - strcpy(DtmfString, "123456789");//Sample DTMF digits that need to be sent - ret_status= tel_call_dtmf(handle, DtmfString, callback, user_data); - - if (TAPI_API_SUCCESS != tapi_err) { - CALL_ENG_DEBUG(ENG_DEBUG, "tapi_call_dtmf Failed, Error Code: %d", tapi_err); - return FALSE; - } - - CALL_ENG_DEBUG(ENG_DEBUG, " Ended..."); - - return TRUE; -} -//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(TapiHandle *handle, unsigned int CallHandle1, unsigned int CallHandle2, tapi_response_cb callback, void *user_data); -@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 ; - TapiHandle *handle - unsigned int CallHandle1; - unsigned int CallHandle2; - tapi_response_cb callback; - void *user_data; - ret_status= tel_join_call(handle, CallHandle1, CallHandle2, callback, user_data); ; - 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(TapiHandle *handle, unsigned int CallHandle, tapi_response_cb callback, void *user_data); -@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 ; - TapiHandle *handle; - unsigned int CallHandle; - tapi_response_cb callback; - void *user_data; - ret_status= tel_split_call(handle, CallHandle, callback, user_data); - 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(TapiHandle *handle, TelCallActiveLine_t active_line, tapi_response_cb callback, void *user_data); -@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 ; - TapiHandle *handle; - TelCallActiveLine_t active_line ; - tapi_response_cb callback,; - void *user_data; - - ret_status = tel_set_call_act_line (handle, active_line, callback, user_data); - 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(handle, callback, user_data); - 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_transfer_call(TapiHandle *handle, unsigned int CallHandle, tapi_response_cb callback, void *user_data); -@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 ; - TapiHandle *handle; - unsigned int pCallHandle;//active call - tapi_response_cb callback; - void *user_data; - ret_status= tel_transfer_call (handle, pCallHandle, callback, user_data); - 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(TapiHandle *handle, int call_id, TelCallStatus_t *out ); -@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 ; - int call_id; - TapiHandle *handle; - TelCallStatus_t *out; - ret_status= tel_get_call_status(handle, call_id, out); - 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(TapiHandle *handle, 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 ; - TapiHandle *handle - unsigned int CallHandle; - unsigned int * pDurationInSecs; - ret_status= tel_get_call_duration(handle, CallHandle, pDurationInSecs); - 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(TapiHandle *handle, 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 ; - TapiHandle *handle; - unsigned int CallHandle; - unsigned int callList[5]; - tapi_response_cb callback; - int noOfCalls; - void *user_data; - ret_status= tel_get_call_conf_list(handle, CallHandle, callList, &noOfCalls, callback, user_data); - 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(TapiHandle *handle, TelCallPrivacyType_t PrivacyType, tapi_response_cb callback, void *user_data); -int tel_set_call_privacy_mode(TapiHandle *handle, TelCallVoicePrivacyInfo_t PrivacyInfo, tapi_response_cb callback, void *user_data); -@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() -{ - TapiHandle *handle; - int ret_status = -1; - tapi_response_cb callback; - void *user_data; - TelCallPrivacyMode_t pPrivacyMode_info={0,}; - pPrivacyMode_info = TAPI_CALL_PRIVACY_MODE_STANDARD; - ret_status = tel_set_call_privacy_mode (handle, pPrivacyMode_info, callback, user_data); - 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() -{ - TapiHandle *handle; - int ret_status = -1; - tapi_response_cb callback; - void *user_data; - TelCallPrivacyMode_t pPrivacyMode_info={0,}; - pPrivacyMode_info = TAPI_CALL_PRIVACY_MODE_STANDARD; - ret_status = tel_set_call_privacy_mode (handle, pPrivacyMode_info, callback, user_data); - 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(TapiHandle *handle, const char *pDialNumber, tapi_response_cb callback, void *user_data); -@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; - tapi_response_cb callback; - void *user_data; - const char *pDialNumber = "9999900000"; - - ret_status = tel_exe_call_flash_info(handle, pDialNumber, callback, user_data); - 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(TapiHandle *handle, unsigned short req_mask, tapi_response_cb callback, void *user_data); -@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; - TapiHandle *handle; - tapi_response_cb callback; - void *user_data; - TelCallTimeMaskType_t mask_byte1 = {0,}; - TelCallTimeMaskType_t mask_byte2 = {0,}; - unsigned short mask_type; - mask_byte1 = TAPI_CALL_TIME_TYPE_TOTAL_CALL_CNT; //masking call type - mask_byte2 = TAPI_CALL_TIME_TYPE_TOTAL_CALL_TIME; - mask_type = mask_byte1; - mask_type << 8; - mask_type = mask_byte2; - - ret_status = tel_get_call_time(handle, mask_type, callback, user_data); - 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 -Tapi_handle *handle; -char *noti_id = TAPI_NOTI_SS_FORWARD_STATUS; // We need to register for all events, like barring, waiting etc. -tapi_response_cb callback; -void *user_data; -int ret; - -handle = tel_init(); -if (!handle) -{ - TEST_DEBUG("tel_init Failed"); -} - -ret = tel_register_noti_event(handle,noti_id,callback,userdata); -if(ret != TAPI_API_SUCCESS) -{ - TEST_DEBUG("SS Event registration failed"); -} -else -{ - printf("SS Event registration is Done"); -} - -tel_register_app_name("com.samsung.appname"); - -// DEREGISTER EVENT -ret = tel_deregister_event(handle,noti_id); -if (ret != TAPI_API_SUCCESS) -{ - printf("Event 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(TapiHandle *handle, TelSsBarringInfo_t *info, tapi_response_cb callback, void *user_data); -int tel_get_ss_barring_status(TapiHandle *handle, TelSsClass_t class, TelSsBarringType_t type, tapi_response_cb callback, void *user_data); -int tel_change_ss_barring_password(TapiHandle *handle,const char *old_password,const char *new_password,const char *new_password_again,tapi_response_cb callback, void *user_data); -@endcode - -SAMPLE CODE FOR SET 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; - char *bar_pwd = "0000"; - Tapi_handle handle; - tapi_response_cb callback; - void *user_data; - - 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 (handle,&BarringInfo,callback,user_data); - 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 (TapiHandle *handle, int result, void *data, void *user_data) -{ - TelSsBarringResp_t *resp = data; - int i = 0; - - msg(""); - msgb("tel_set_ss_barring() or tel_get_ss_barring_status() response receive"); - msg(" - result = 0x%x", result); - - if (!resp) - return; - - msg(" - record_num = %d", resp->record_num); - - for (i = 0; i < resp->record_num; i++) { - msg(" - [%d] Class=%d, Status=%d, Flavour=%d", - i, - resp->record[i].Class, - resp->record[i].Status, - resp->record[i].Flavour); - } -} -@endcode - -SAMPLE CODE FOR GET 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; - Tapi_handle handle; - tapi_response_cb callback; - void *user_data; - - ret_status = tel_get_ss_barring_status (handle,BarType, CallType,callback,user_data); - 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 (TapiHandle *handle, int result, void *data, void *user_data) -{ - TelSsBarringResp_t *resp = data; - int i = 0; - - msg(""); - msgb("tel_set_ss_barring() or tel_get_ss_barring_status() response receive"); - msg(" - result = 0x%x", result); - - if (!resp) - return; - - msg(" - record_num = %d", resp->record_num); - - for (i = 0; i < resp->record_num; i++) { - msg(" - [%d] Class=%d, Status=%d, Flavour=%d", - i, - resp->record[i].Class, - resp->record[i].Status, - resp->record[i].Flavour); - } -} -@endcode - -SAMPLE CODE FOR CHANGING BARRING PASSWORD -@code -#include -#include -#include - -//SUBSCRIBE FOR EVENTS AS MENTIONED IN Event Register and Deregister -void changebarpwd() -{ - int ret_status; - Tapi_handle handle; - tapi_response_cb callback; - void *user_data; - - ret_status = tel_change_ss_barring_password ("0000", "0000", "0000", user_data); - 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(TapiHandle *handle, int result, void *data, void *user_data) -{ - msg(""); - msgb("tel_change_ss_barring_password() response receive"); - msg(" - result = 0x%x", result); -} -@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(TapiHandle *handle, const TelSsForwardInfo_t *info, tapi_response_cb callback, void *user_data); -int tel_get_ss_forward_status(TapiHandle *handle, TelSsClass_t class, TelSsForwardWhen_t condition, tapi_response_cb callback, void *user_data); -@endcode - -SAMPLE CODE FOR SET CALL FORWARD -@code -#include -#include -#include - -//SUBSCRIBE FOR EVENTS AS MENTIONED INEvent Register and Deregister -void callfwd() -{ - int ret_status = 0; - TelSsForwardInfo_t pForwardInfo; - Tapi_handle handle; - tapi_response_cb callback; - void *user_data; - - 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(handle,&pForwardInfo,callback,user_data); - 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(TapiHandle *handle, int result, void *data, void *user_data) -{ - TelSsForwardResp_t *resp = data; - int i; - - msg(""); - msgb("tel_set_ss_forward() or tel_get_ss_forward_status() response receive"); - msg(" - result = 0x%x", result); - - if (!resp) - return; - - msg(" - record_num = %d", resp->record_num); - - for (i = 0; i < resp->record_num; i++) { - msg(" - [%d] Class=%d, Status=%d, ForwardCondition=%d, NoReplyWaitTime=%d, bCallForwardingNumberPresend=%d, szCallForwardingNumber=[%s]", - i, - resp->record[i].Class, - resp->record[i].Status, - resp->record[i].ForwardCondition, - resp->record[i].NoReplyWaitTime, - resp->record[i].bCallForwardingNumberPresent, - resp->record[i].szCallForwardingNumber); - } -} -@endcode - -SAMPLE CODE FOR GET CALL FORWARD STATUS -@code -#include -#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; - Tapi_handle handle; - tapi_response_cb callback; - void *user_data; - - ret_status = tel_get_ss_forward_status(handle,Type,Condition,callback,user_data); - 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(TapiHandle *handle, int result, void *data, void *user_data) -{ - TelSsForwardResp_t *resp = data; - int i; - - msg(""); - msgb("tel_set_ss_forward() or tel_get_ss_forward_status() response receive"); - msg(" - result = 0x%x", result); - - if (!resp) - return; - - msg(" - record_num = %d", resp->record_num); - - for (i = 0; i < resp->record_num; i++) { - msg(" - [%d] Class=%d, Status=%d, ForwardCondition=%d, NoReplyWaitTime=%d, bCallForwardingNumberPresend=%d, szCallForwardingNumber=[%s]", - i, - resp->record[i].Class, - resp->record[i].Status, - resp->record[i].ForwardCondition, - resp->record[i].NoReplyWaitTime, - resp->record[i].bCallForwardingNumberPresent, - resp->record[i].szCallForwardingNumber); - } -} -//... -@endcode -@} -@defgroup Use_Cases3_4 Call Waiting -@ingroup Use_Cases3_SUPPLEMENTARY_SERVICE -@{ - - -

Call 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(TapiHandle *handle, const TelSsWaitingInfo_t *info, tapi_response_cb callback, void *user_data); -int tel_get_ss_waiting_status(TapiHandle *handle, const TelSsClass_t class, tapi_response_cb callback, void *user_data); -@endcode - -SAMPLE CODE FOR SET CALL WAITING -@code -#include -#include -#include - -//SUBSCRIBE FOR EVENTS AS MENTIONED IN Event Register and Deregister -void callwaiting() -{ - int ret_status; - TelSsWaitingInfo_t waitInfo; - Tapi_handle handle; - tapi_response_cb callback; - void *user_data; - - waitInfo.Mode = TAPI_SS_CW_ACTIVATE; - waitInfo.CallType = TAPI_CALL_TYPE_VOICE_EV; - - ret_status = tel_set_ss_waiting (handle,&waitInfo,callback,user_data); - 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(TapiHandle *handle, int result, void *data, void *user_data) -{ - TelSsWaitingResp_t *resp = data; - int i; - - msg(""); - msgb("tel_set_ss_waiting() or tel_get_ss_waiting_status() response receive"); - msg(" - result = 0x%x", result); - - if (!resp) - return; - - msg(" - record_num = %d", resp->record_num); - - for (i = 0; i < resp->record_num; i++) { - msg(" - [%d] Class=%d, Status=%d", - i, - resp->record[i].Class, - resp->record[i].Status); - } -} -@endcode - -SAMPLE CODE FOR GET CALL WAITING STATUS -@code -#include -#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; - Tapi_handle handle; - tapi_response_cb callback; - void *user_data; - - ret_status = tel_get_ss_waiting_status(handle,CallType,callback,user_data); - 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(TapiHandle *handle, int result, void *data, void *user_data) -{ - TelSsWaitingResp_t *resp = data; - int i; - - msg(""); - msgb("tel_set_ss_waiting() or tel_get_ss_waiting_status() response receive"); - msg(" - result = 0x%x", result); - - if (!resp) - return; - - msg(" - record_num = %d", resp->record_num); - - for (i = 0; i < resp->record_num; i++) { - msg(" - [%d] Class=%d, Status=%d", - i, - resp->record[i].Class, - resp->record[i].Status); - } -} -@endcode -@} -@defgroup Use_Cases3_5 CLI Service Status -@ingroup Use_Cases3_SUPPLEMENTARY_SERVICE -@{ - - -

CLI 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_set_ss_cli_status(TapiHandle *handle, TelSsCliType_t type, TelSsCliStatus_t status, tapi_response_cb callback, void *user_data); -int int tel_get_ss_cli_status(TapiHandle *handle, TelSsCliType_t type, tapi_response_cb callback, void *user_data); -@endcode - -SAMPLE CODE FOR SET CLI STATUS -@code -#include -#include -#include - -//SUBSCRIBE FOR EVENTS AS MENTIONED IN Event Register and Deregister -void cliservicestatus() -{ - int ret_status; - TelSsCliType_t type = TAPI_SS_CLI_CLIP;; - TelSsCliStatus_t status; - Tapi_handle handle; - tapi_response_cb callback; - void *user_data; - - ret_status = tel_set_ss_cli_status(handle,type,status,callback,user_data); - 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(TapiHandle *handle, int result, void *data, void *user_data) -{ - TelSsCliResp_t *resp = data; - - msg(""); - msgb("tel_get_ss_cli_status() response receive"); - msg(" - result = 0x%x", result); - - if (!resp) - return; - - msg(" - type = %d", resp->Type); - msg(" - status = %d", resp->Status); -} -@endcode - -SAMPLE CODE FOR GET CLI STATUS -@code -#include -#include - -//SUBSCRIBE FOR EVENTS AS MENTIONED IN Event Register and Deregister -void cliservicestatus() -{ - int ret_status; - TelSsCliType_t CliType = TAPI_SS_CLI_CLIP; - Tapi_handle handle; - tapi_response_cb callback; - void *user_data; - - ret_status = tel_get_ss_cli_status (handle,CliType,callback,user_data); - 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(TapiHandle *handle, int result, void *data, void *user_data) -{ - TelSsCliResp_t *resp = data; - - msg(""); - msgb("tel_get_ss_cli_status() response receive"); - msg(" - result = 0x%x", result); - - if (!resp) - return; - - msg(" - type = %d", resp->Type); - msg(" - status = %d", resp->Status); -} -@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 tel_send_ss_ussd_request(TapiHandle *handle, const TelSsUssdMsgInfo_t *info, tapi_response_cb callback, void *user_data); -@endcode - -SAMPLE CODE FOR SEND USSD REQUEST -@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_status; - - memset(ussdString, 0, TAPI_SS_USSD_DATA_SIZE_MAX); - strcpy(ussdString, "*124#"); - Tapi_handle handle; - tapi_response_cb callback; - void *user_data; - - ret_status = tel_send_ss_ussd_request (handle,ussdString,callback,user_data); - 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(TapiHandle *handle, int result, void *data, void *user_data) -{ - TelSsUssdResp_t *resp = data; - - msg(""); - msgb("tel_send_ss_ussd_request() response receive"); - msg(" - result = 0x%x", result); - - if (!resp) - return; - - msg(" - type = %d", resp->Type); - msg(" - status = %d", resp->Status); - msg(" - length = %d", resp->Length); - msg(" - string = [%s]", resp->szString); -} -@endcode -@} -@defgroup Use_Cases3_7 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_set_ss_aoc_info(TapiHandle *handle, TelCallAocInfo_t *AocSetInfo, tapi_response_cb callback, void *user_data); -int tel_get_ss_aoc_info(TapiHandle *handle, TelSsAocType_t AocType, tapi_response_cb callback, void *user_data); -{ -@endcode - -SAMPLE CODE FOR SET AOC INFO -@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; - Tapi_handle handle; - tapi_response_cb callback; - void *user_data; - - pAocSetInfo = (TelCallAocInfo_t *)calloc(1, sizeof(TelCallAocInfo_t)); - pAocSetInfo->AocType = TAPI_SS_AOC_TYPE_RESET; - - ret = tel_set_ss_aoc_info(handle,pAocSetInfo,callback,user_data); - 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; - }//... -} -@endcode - -SAMPLE CODE FOR GET AOC INFO -@code -#include -#include - -//SUBSCRIBE FOR EVENTS AS MENTIONED IN Event Register and Deregister - -void aocinforeq() -{ - TelSsAocType_t AocType = TAPI_SS_AOC_TYPE_ACM; - Tapi_handle handle; - tapi_response_cb callback; - void *user_data; - - ret_status = tel_get_ss_aoc_info(handle,AocType,callback,user_data); - 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. -The telephony framework only provides an interface to the modem and doesnot 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 -TapiHandle *handle; -char *noti_id = TAPI_NOTI_SMS_INCOM_MSG; -tapi_response_cb callback; -void* user_data; -int api_err; - -handle = tel_init(); -if (handle) -{ - TEST_DEBUG("tel_init Failed"); -} -api_err = tel_register_noti_event(handle, noti_id, callback, user_data); -printf("Nettext Class registration is Done: noti_id is %d, handle is %d\n", noti_id, handle); - -// DEREGISTER EVENT -api_err = tel_deregister_noti_event(handle, noti_id); -if (handle) -{ - printf("Event Unregistration Fail\n"); -} - -// SMS notification callback function -void notification_callback(TapiHandle *handle, const char *noti_id, void *data, void *user_data) -{ - printf(" app _callback is called \n"); - - switch (noti_id) - { - case TAPI_NOTI_SMS_INCOM_MSG: - 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_NOTI_SMS_CB_INCOM_MSG: - TelSmsCbMsg_t *ptrCbMsgInfo; - printf("SMS Cell Broadcasting Incoming Message\n"); - ptrCbMsgInfo = (TelSmsCbMsg_t *)data; - // Decoding Cell broadcasting Message in szData [Refer to 3GPP TS23.041 9.4.1] - break; - - case TAPI_NOTI_SMS_INCOM_EX_MSG: - TelSmsMsgInfo_t *pMsgInfo; - printf("CDMA SMS Incoming Message\n"); - pMsgInfo = (TelSmsMsgInfo_t *)data; - // Decoding TPDU(SMS-DELIVER, SMS-STATUS) - break; - - case TAPI_NOTI_SMS_CB_INCOM_EX_MSG: - TelSmsMsgInfo_t *pMsgInfo = NULL; - printf("CDMA SMS Incoming Message\n"); - pMsgInfo = (TelSmsMsgInfo_t *)EventData; - // Decoding Cell broadcasting Message in szData - break; - - case TAPI_NOTI_SMS_MEMORY_STATUS: - int *status = NULL; - printf("SIM Memory Status Notification\n"); - status = (TelSmsMemStatusType *)data; - 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_NOTI_SMS_DEVICE_READY: - int *pDeviceReady = NULL; - printf("SMS Device Ready Status Notification\n"); - pDeviceReady = (int*)data; - 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(TapiHandle *handle, const TelSmsDatapackageInfo_t *pDataPackage, int bMoreMsgToSend, tapi_response_cb callback, void* user_data) -@endcode - -This API is restricted for direct use. Use the Message Framework API instead. - -SAMPLE CODE -@code -#include -#include -#include -#include - -void send_sms() -{ - //Obtain Tapi Handle as mentioned in Event Register and Deregister - TelSmsDatapackageInfo_t *pDataPackage; - int ret_status = TAPI_API_SUCCESS; - TapiHandle *handle; - tapi_response_cb callback; - void* user_data; - - - pDataPackage = (TelSmsDatapackageInfo_t*) malloc(sizeof(TelSmsDatapackageInfo_t)); - - pDataPackage /* fill the structure appropriately/ - Sca parameter is optional. If you don't provide Service center address, you should fi - MsgLength is length of szData - fill the szData in TelSmsDatapackageInfo_t with SMS-SUBMIT or SMS-COMMAND TPDU. - - ret_status = tel_send_sms(handle, pDataPackage, bMoreMsgToSend, on_resp_send_sms, user_data); - if (ret_status == TAPI_API_SUCCESS) - { - printf("successful\n"); - } - else - { - printf("error = %d\n", ret_status); - } - //WAIT FOR THE EVENT HERE -} - -static void on_resp_send_sms(TapiHandle *handle, int result, void *data, void *user_data) -{ - printf("%d", result); - if (result != 0) - { - //TEST_DEBUG("******This is nonzero status. ******\n"); - return; - } -}@endcode -@} -@defgroup Use_Cases4_3 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(TapiHandle *handle, int index, tapi_response_cb callback, void* user_data); -@endcode - -This API is restricted for direct use. Use the Message Framework API instead. - -SAMPLE CODE -@code -#include -#include -#include -#include - -void read_sms() -{ - //Obtain Tapi Handle as mentioned in Event Register and Deregister - TapiHandle *handle; - int selectedNo; - int ret; - char buf[100]; - int returnStatus = 0; - - memset (buf, 0, sizeof (buf)); - - returnStatus = tel_get_sms_count (handle, on_resp_get_sms_count, user_data); - //In the Response of get count tel_read_sms_in_sim will be called - printf("tel_get_sms_count(): 0x%x", returnStatus) -} - -static void on_resp_read_msg(TapiHandle *handle, int result, void *data, void *user_data) -{ - TelSmsData_t * sim_data; - int scaAddr_len = 0; - char * pTPDU; - int tpdu_len = 0; - char diallingNum[TAPI_NETTEXT_ADDRESS_LEN_MAX + 1] = { 0, }; - char scaAddr[TAPI_NETTEXT_SCADDRESS_LEN_MAX + 2] = { 0, }; //service center address - int sca_ton, sca_npi; - int position; - - sim_data = (TelSmsData_t *) data; - - //find msg_status from sim data - - position = 0; - memset (diallingNum, 0, sizeof (diallingNum)); - SmsUtilDecodeAddrField (diallingNum, (char *) sim_data->SmsData.Sca, - &sca_ton, &sca_npi); - position += 2; //include Address-Length, Type of Address - - scaAddr_len = strlen ((char *) diallingNum); - if (scaAddr_len > TAPI_NETTEXT_SCADDRESS_LEN_MAX - 1) - scaAddr_len = TAPI_NETTEXT_SCADDRESS_LEN_MAX - 1; - - if (scaAddr_len % 2) - position += scaAddr_len / 2 + 1; - else - position += scaAddr_len / 2; - - if (sca_ton == SMS_TON_INTERNATIONAL) { - scaAddr[0] = '+'; - memcpy (&scaAddr[1], diallingNum, scaAddr_len); - } - else { - memcpy (scaAddr, diallingNum, scaAddr_len); - } - - tpdu_len = sim_data->SmsData.MsgLength; - - printf("SCA Number : %s tpdu_len is %d", scaAddr, tpdu_len); - - pTPDU = malloc (sizeof(unsigned char) * tpdu_len); - if (!pTPDU) - return; - - printf("bfor memcopy position is %d", position); - memcpy (pTPDU, & (sim_data->SmsData.szData[0]), tpdu_len); - printf("after memcpy"); - - DecodeSmsDeliverTpdu (tpdu_len, pTPDU); -} -//... -@endcode -@} -@defgroup Use_Cases4_4 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(TapiHandle *handle, const TelSmsData_t *pWriteData, tapi_response_cb callback, void* user_data);@endcode - -This API is restricted for direct use. Use the Message Framework API instead. - -SAMPLE CODE -@code -#include -#include -#include -#include - -void write_sms() -{ - //Obtain Tapi Handle as mentioned in Event Register and Deregister - int ret_status = TAPI_API_SUCCESS; - TapiHandle *handle;//Obtained from tel_init(); - tapi_response_cb callback; - void* user_data; - - TelSmsData_t *pWriteData; - char *msg = "This is an Test SMS"; - char *SCA = "821091"; - - pWriteData =(TelSmsData_t *)malloc(sizeof(TelSmsData_t)); - - conv_service_center_address(pWriteData->SmsData.Sca, SCA); //convert service center address - conv_msg_into_tpdu(pWriteData->SmsData.szData, pWriteData->SmsData.MsgLength, msg); // convert message into TPDU - pWrite->MsgStatus = TAPI_NETTEXT_STATUS_READ; - pWrite->SimIndex = -1; - - ret_status = tel_write_sms_in_sim(handle, pWriteData, on_resp_write_sms, user_data); - if (ret_status == TAPI_API_SUCCESS) - { - printf("successful\n"); - } - else - { - printf("error = %d\n", ret_status); - } - //WAIT FOR EVENT HERE -} -static void on_resp_write_sms(TapiHandle *handle, int result, void *data, void *user_data) -{ - int *index = data; - - printf("tel_write_sms_in_sim() response receive"); - printf(" - result = 0x%x", result); - printf(" - index = %d", *index); -} -@endcode -@} -@defgroup Use_Cases4_5 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(TapiHandle *handle, int index, tapi_response_cb callback, void* user_data); -@endcode - -This API is restricted for direct use. Use the Message Framework API instead. - -SAMPLE CODE: -@code -#include -#include -#include -#include - -void delete_sms() -{ - //Obtain Tapi Handle as mentioned in Event Register and Deregister - int ret_status = TAPI_API_SUCCESS; - TapiHandle *handle;//Obtained from tel_init(); - tapi_response_cb callback; - void* user_data; - int index; - - ret_status = tel_delete_sms_in_sim(handle, index, on_resp_delete_sms, user_data); - if (ret_status == TAPI_API_SUCCESS) - { - printf("successful\n"); - } - else - { - printf("error = %d\n", ret_status); - } - //WAIT FOR EVENT HERE -} -static void on_resp_delete_sms(TapiHandle *handle, int result, void *data, void *user_data) -{ - int *index = data; - printf("tel_delete_sms_in_sim() response receive"); - printf(" - result = 0x%x", result); - printf(" - index = %d", *index); -} -@endcode -@} -@defgroup Use_Cases4_6 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(TapiHandle *handle, tapi_response_cb callback, void* user_data); -@endcode - -This API is restricted for direct use. Use the Message Framework API instead. - -SAMPLE CODE -@code -#include -#include -#include -#include - -void get_count() -{ - //Obtain Tapi Handle as mentioned in Event Register and Deregister - int ret_status; - TapiHandle *handle; - tapi_response_cb callback; - void* user_data; - - ret_status = tel_get_sms_count(handle, on_resp_get_count, user_data); - if (ret_status == TAPI_API_SUCCESS) - { - printf("successful\n"); - } - else - { - printf("error = %d\n", ret_status); - } - //WAIT FOR EVENT HERE -} -static void on_resp_get_count(TapiHandle *handle, int result, void *data, void *user_data) -{ - static TelSmsStoredMsgCountInfo_t *countInfo; - int loop_counter = 0; - TapiResult_t returnStatus = TAPI_API_SUCCESS; - - countInfo = (TelSmsStoredMsgCountInfo_t*) data; - - printf("tel_get_sms_count() response receive"); - printf(" - result = 0x%x", result); - - if (countInfo->UsedCount != 0x00) //if used count is not zero - { - printf("Index LIST.........."); - for (loop_counter = 0; loop_counter < countInfo->UsedCount; - loop_counter++) { - printf("[%02x]", countInfo->IndexList[loop_counter]); - returnStatus = tel_read_sms_in_sim (handle, countInfo->IndexList[loop_counter], on_resp_read_msg, user_data); - printf("After read msg: returnstatus %d", returnStatus); - } - printf("In MsgCountNotification total cnt is %d, usedcnt is %dapi_err %d", - countInfo->TotalCount, countInfo->UsedCount, returnStatus); - } - - printf("In MsgCountNotification total cnt is %d, usedcnt is %d", - countInfo->TotalCount, countInfo->UsedCount); -} -@endcode -@} -@defgroup Use_Cases4_7 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(handle, pCBConfig, callback, user_data); -@endcode - -This API is restricted for direct use. Use the Message Framework API instead. - -SAMPLE CODE -@code -#include -#include -#include -#include - -void set_cbconfig() -{ - //Obtain Tapi Handle as mentioned in Event Register and Deregister - TapiHandle *handle; - tapi_response_cb callback; - void* user_data; - - pCBConfig = calloc (1, sizeof(TelSmsCbConfig_t)); - if (!pCBConfig) - return -1; - - msg("Enter CB ON/OFF (1: Enable, 0:Disable): "); - pCBConfig->CBEnabled =;//fill appropriately - - msg("Enter Max ID Count: "); - pCBConfig->MsgIdMaxCount =);//fill appropriately - - msg("Enter MsgIdRangeCount ( < 10 ): "); - pCBConfig->MsgIdRangeCount =;//fill appropriately - - if (pCBConfig->MsgIdRangeCount <= 0 - || pCBConfig->MsgIdRangeCount >= TAPI_NETTEXT_GSM_SMS_CBMI_LIST_SIZE_MAX) { - printf("Bad Range value"); - free (pCBConfig); - return -1; - } - - for (i = 0; i < pCBConfig->MsgIdRangeCount; i++) { - printf("Enter %d FromMsgId : ", i + 1); - pCBConfig->MsgIDs[i].Net3gpp.FromMsgId = _get_int(); - - printf("Enter %d ToMsgId : ", i + 1); - pCBConfig->MsgIDs[i].Net3gpp.ToMsgId = _get_int(); - - printf("Enter %d Selected : ", i + 1); - pCBConfig->MsgIDs[i].Net3gpp.Selected = _get_int(); - } - - pCBConfig->Net3gppType = 0x01; - - returnStatus = tel_set_sms_cb_config(handle, pCBConfig, on_resp_set_sms_cb_config, user_data); - 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 on_resp_set_sms_cb_config (TapiHandle *handle, int result, void *data, void *user_data) -{ - printf(""); - printf("tel_set_sms_cb_config() response receive"); - printf(" - result = 0x%x", result); -}@endcode -@} -@defgroup Use_Cases4_8 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 -int tel_get_sms_cb_config(TapiHandle *handle, tapi_response_cb callback, void* user_data); -@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; - //Obtain Tapi Handle as mentioned in Event Register and Deregister - TapiHandle *handle; - tapi_response_cb callback; - void* user_data; - ret_status = tel_get_sms_cb_config(handle, on_resp_get_cb_config, user_data); - - 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 on_resp_get_cb_config (TapiHandle *handle, int result, void *data, void *user_data) -{ - TelSmsCbConfig_t * CBConfig; - int i = 0; - - CBConfig = (TelSmsCbConfig_t *) data; - - printf("tel_get_sms_cb_config() response receive"); - printf(" - result = 0x%x", result); - - - if (CBConfig->CBEnabled == TRUE) - msg("Cell Broadcast Msg Enabled...") - else - msg("Cell Broadcast Msg Disabled...") - - - if (CBConfig->Net3gppType == 0x01) - msg("Network type is 3gpp ") - else if (CBConfig->Net3gppType == 0x02) - msg("Network type is CDMA"); - - printf("CBMI Range Count: %d \n", CBConfig->MsgIdRangeCount); - - if (CBConfig->MsgIdRangeCount != 0) { - msg("----- CBMI List -----"); - for (i = 0; i < CBConfig->MsgIdRangeCount; i++) { - msg("From No.%d - [0x%04x]", i, - CBConfig->MsgIDs[i].Net3gpp.FromMsgId); - msg("To No.%d - [0x%04x]", i, CBConfig->MsgIDs[i].Net3gpp.ToMsgId); - } - } -} - -//... -@endcode -@} -@defgroup Use_Cases4_9 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(TapiHandle *handle, const TelSmsAddressInfo_t *pSCA, int index, tapi_response_cb callback, void* user_data); -int tel_get_sms_sca(TapiHandle *handle, int index, tapi_response_cb callback, void* user_data); -@endcode - -This API is restricted for direct use. Use the Message Framework API instead. - -SAMPLE CODE -@code -#include -#include -#include -#include - -void set_sca() -{ - int ret_status; - //Obtain Tapi Handle as mentioned in Event Register and Deregister - TapiHandle *handle; - tapi_response_cb callback; - void* user_data; - TelSmsAddressInfo_t sca; - - memset (&sca, 0, sizeof(TelSmsAddressInfo_t)); - - sca.DialNumLen = 0x5; - sca.Npi = TAPI_SIM_NPI_ISDN_TEL; - sca.Ton = TAPI_SIM_TON_INTERNATIONAL; - sca.szDiallingNum[0] = 0x28; - sca.szDiallingNum[1] = 0x01; - sca.szDiallingNum[2] = 0x19; - sca.szDiallingNum[3] = 0x11; - sca.szDiallingNum[4] = 0x11; - - - ret_status = int tel_set_sms_sca(handle, pSCA, index, on_resp_set_sms_sca, user_data); - //[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); - } -} - -static void on_resp_set_sms_sca (TapiHandle *handle, int result, void *data, void *user_data) -{ - printf("tel_set_sms_sca() response receive"); - printf(" - result = 0x%x", result); -} - -//.. - -//get SCA -#include -#include -#include -#include - -void get_sca() -{ - int ret_status; - //Obtain Tapi Handle as mentioned in Event Register and Deregister - TapiHandle *handle; - tapi_response_cb callback; - void* user_data; - - ret_status = int tel_get_sms_sca(handle, index, on_resp_get_sms_sca, user_data); - if (ret_status == TAPI_API_SUCCESS) - { - printf("successful\n"); - } - else - { - printf("error = %d\n", ret_status); - } -} - -static void on_resp_get_sms_sca (TapiHandle *handle, int result, void *data, - void *user_data) -{ - TelSmsAddressInfo_t *scaInfo = data; - unsigned int i = 0; - - printf("tel_get_sms_sca() response receive"); - printf(" - result = 0x%x", result); - printf(" - TON = %d", scaInfo->Ton); - printf(" - NPI = %d", scaInfo->Npi); - printf(" - DialNumLen = %d", scaInfo->DialNumLen); - printf(" - SCA Num"); - - for (i = 0; i < scaInfo->DialNumLen; i++) { - printf("[%02x]", scaInfo->szDiallingNum[i]); - if (i % 10 == 9) - printf("\n"); - } -} - - -@endcode -@} -@defgroup Use_Cases4_10 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_get_sms_preferred_bearer(TapiHandle *handle, tapi_response_cb callback, void* user_data); -int tel_set_sms_preferred_bearer(TapiHandle *handle, TelSmsBearerType_t BearerType, tapi_response_cb callback, void* user_data); -@endcode - -This API is restricted for direct use. Use the Message Framework API instead. - -SAMPLE CODE: -@code -#include -#include -#include -#include - -void set_pb() -{ - int ret_status; - //Obtain Tapi Handle as mentioned in Event Register and Deregister - TapiHandle *handle; - tapi_response_cb callback; - void* user_data; - - TelSmsBearerType_t BearerType = TAPI_NETTEXT_BEARER_PS_ONLY; - - ret_status = tel_get_sms_preferred_bearer(handle, on_resp_set_sms_preferred_bearer, user_data); - if (ret_status == TAPI_API_SUCCESS) - { - printf("successful\n"); - } - else - { - printf("error = %d\n", ret_status); - } -} -static void on_resp_set_sms_preferred_bearer (TapiHandle *handle, int result, void *data, void *user_data) -{ - printf(""); - printf("tel_set_sms_preferred_bearer() response receive"); - printf(" - result = 0x%x", result); -} -//get preferred bearer -#include -#include -#include -#include -void get_pb() -{ - int ret_status; - //Obtain Tapi Handle as mentioned in Event Register and Deregister - TapiHandle *handle; - tapi_response_cb callback; - void* user_data; - ret_status = tel_get_sms_preferred_bearer(handle, callback, user_data); - if (ret_status == TAPI_API_SUCCESS) - { - printf("successful\n"); - } - else - { - printf("error = %d\n", ret_status); - } -} -static void on_resp_get_pref_bearer (TapiHandle *handle, int result, void *data, void *user_data) -{ - printf(""); - printf("tel_get_sms_preferred_bearer() response receive"); - printf(" - result = 0x%x", result); -} -@endcode -@} -@defgroup Use_Cases4_11 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_get_sms_parameters(TapiHandle *handle, int index, tapi_response_cb callback, void* user_data); -int tel_set_sms_parameters(TapiHandle *handle, const TelSmsParams_t *pSmsSetParameters, tapi_response_cb callback, void* user_data); -@endcode - -This API is restricted for direct use. Use the Message Framework API instead. - -SAMPLE CODE: -@code -#include -#include -#include -#include - -void set_param() -{ - //Obtain Tapi Handle as mentioned in Event Register and Deregister - TapiHandle *handle; - tapi_response_cb callback; - void* user_data; - int ret_status; - - 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(handle, pSmsSetParameters, on_resp_set_sms_params, user_data); - if (ret_status == TAPI_API_SUCCESS) - { - printf("successful\n"); - } - else - { - printf("error = %d\n", ret_status); - } -} -static void on_resp_set_sms_params (TapiHandle *handle, int result, void *data, void *user_data) -{ - printf("tel_set_sms_params() response receive"); - printf(" - result = 0x%x", result); -} -//... - -//get params -#include -#include -#include -#include - -void get_params() -{ - int ret_status; - //Obtain Tapi Handle as mentioned in Event Register and Deregister - TapiHandle *handle; - tapi_response_cb callback; - void* user_data; - - ret_status = tel_get_sms_parameters(handle, index, on_resp_get_sms_parameters, user_data); - if (ret_status == TAPI_API_SUCCESS) - { - printf("successful\n"); - } - else - { - printf("error = %d\n", ret_status); - } -} -static void on_resp_get_sms_parameters (TapiHandle *handle, int result, void *data, void *user_data) -{ - TelSmsParams_t *smsp_param; - - smsp_param = (TelSmsParams_t *) data; - - printf("tel_get_sms_parameters() response receive"); - printf(" - result = 0x%x", result); - - printf("record index is 0x%x", smsp_param->RecordIndex); - printf("record len is 0x%x", smsp_param->RecordLen); - printf("alpha_id len is 0x%x ", (int )smsp_param->AlphaIdLen); - printf("alpha_id is %s ", smsp_param->szAlphaId); - printf("param indicator is 0x%x", smsp_param->ParamIndicator); - printf("dest dialling num is %s", smsp_param->TpDestAddr.szDiallingNum); - printf("svcaddr dialling num is %s", smsp_param->TpSvcCntrAddr.szDiallingNum); - printf("pid 0x%x", smsp_param->TpProtocolId); - printf("dcs is 0x%x", smsp_param->TpDataCodingScheme); - printf("validity is 0x%x", smsp_param->TpValidityPeriod); -} -@endcode -@} -@defgroup Use_Cases4_12 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(TapiHandle *handle, const TelSmsDatapackageInfo_t *pDataPackage, TelSmsResponse_t RPCause, tapi_response_cb callback, void* user_data); -@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; - //Obtain Tapi Handle as mentioned in Event Register and Deregister - TapiHandle *handle; - tapi_response_cb callback; - void* user_data; - - TelSmsResponse_t RPCause; - 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(handle, pDataPackage, RPCause, callback, user_data); - if (ret_status == TAPI_API_SUCCESS) - { - printf("successful\n"); - } - else - { - printf("error = %d\n", ret_status); - } -} -static void on_resp_DeliverReport_msg (TapiHandle *handle, int result, void *data, void *user_data) -{ - int *index = data; - - printf(""); - printf("tel_send_sms_deliver_report() response receive"); - printf(" - result = 0x%x", result); - printf(" - index = %d", *index); -} -@endcode -@} -@defgroup Use_Cases4_13 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(TapiHandle *handle, int memoryStatus, tapi_response_cb callback, void* user_data); -@endcode - -This API is restricted for direct use. Use the Message Framework API instead. - -SAMPLE CODE: -@code -#include -#include -#include -#include -void set_memstatus() -{ - //Obtain Tapi Handle as mentioned in Event Register and Deregister - TapiHandle *handle; - tapi_response_cb callback; - void* user_data; - int ret_status; - int MemoryStatus = TAPI_NETTEXT_PDA_MEMORY_STATUS_AVAILABLE; - - ret_status = tel_set_sms_memory_status(handle, memoryStatus, on_resp_set_mem_status, user_data); - if (ret_status == TAPI_API_SUCCESS) - { - printf("successful\n"); - } - else - { - printf("error = %d\n", ret_status); - } -} -static void on_resp_set_mem_status (TapiHandle *handle, int result, void *data, void *user_data) -{ - printf("tel_set_sms_mem_status() response receive"); - printf(" - result = 0x%x", result); -} -@endcode -@} -@defgroup Use_Cases4_14 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(TapiHandle *handle, int index, TelSmsMsgStatus_t msgStatus, tapi_response_cb callback, void* user_data); - -@endcode - -This API is restricted for direct use. Use the Message Framework API instead. - -SAMPLE CODE: -@code -#include -#include -#include -#include - -void set_msgstatus() -{ - //Obtain Tapi Handle as mentioned in Event Register and Deregister - TapiHandle *handle; - tapi_response_cb callback; - void* user_data; - int ret_status; - int Index = 2; - TelSmsMsgStatus_t MsgStatus = TAPI_NETTEXT_STATUS_READ; - - ret_status = tel_set_sms_message_status(handle, index, msgStatus, on_resp_set_msg_status, user_data); - printf ("The return value is %d\n", ret_status); - - returnStatus = tel_read_sms_in_sim (handle, index, on_resp_read_msg, user_data); - printf("returnStatus after read is %d",returnStatus); - if (ret_status == TAPI_API_SUCCESS) - { - printf("successful\n"); - } - else - { - printf("error = %d\n", ret_status); - } -} -static void on_resp_set_msg_status (TapiHandle *handle, int result, void *data, void *user_data) -{ - printf("tel_set_sms_msg_status() response receive"); - printf(" - result = 0x%x", result); -} -@endcode -@} -@defgroup Use_Cases4_15 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(TapiHandle *handle, tapi_response_cb callback, void* user_data); -@endcode - -This API is restricted for direct use. Use the Message Framework API instead. - -SAMPLE CODE: -@code -#include -#include -#include -#include - -void get_paramcount() -{ - //Obtain Tapi Handle as mentioned in Event Register and Deregister - TapiHandle *handle; - tapi_response_cb callback; - void* user_data; - int ret_status; - - ret_status = tel_get_sms_parameter_count(handle, on_resp_get_paramcnt, user_data); - 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); - } -} -static void on_resp_get_paramcnt (TapiHandle *handle, int result, void *data, void *user_data) -{ - int * RecordCount; - - RecordCount = (int *) data; - - printf("tel_get_sms_parameter_count() response receive"); - printf(" - result = 0x%x", result); - printf(" - In param_count_noti the record count is %d", *RecordCount); -} -@endcode -@} - -@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 - -TapiHandle *handle; -char *noti_id = TAPI_EVENT_NETWORK_LOCATIONCELLINFO_IND; -tapi_response_cb callback; -void* user_data; -int api_err; - -handle = tel_init(); -if (handle) -{ - TEST_DEBUG("tel_init Failed"); -} - -// REGISTER EVENT -api_err = tel_register_noti_event(handle, noti_id, app_callback, user_data); -if (api_err == TAPI_API_SUCCESS) -{ - printf("Network notification registration is Done: noti_id is %d, handle is %d\n", noti_id, handle); -} - -// DEREGISTER EVENT -api_err = tel_deregister_noti_event(handle, noti_id); -if (api_err != TAPI_API_SUCCESS) -{ - printf("Event Unregistration 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: - //process notification data - break; - - case TAPI_EVENT_NETWORK_RADIO_INFO_IND: - //process notification data - break; - - case TAPI_EVENT_NETWORK_SPN_INFO: - //process notification data - break; - - case TAPI_EVENT_NETWORK_DISPLAYINFO_IND: - //process notification data - 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(TapiHandle *handle, tapi_response_cb callback, void *user_data) -int tel_select_network_manual(TapiHandle *handle, const char *plmn, int act, tapi_response_cb callback, void *user_data) -@endcode - -SAMPLE CODE: -@code -#include -#include -#include "TapiCommon.h" - -//SUBSCRIBE FOR EVENTS AS MENTIONED IN Event Register and Deregister -void select_nw() -{ - int ret_status; - TapiHandle *handle; - tapi_response_cb callback; - void *user_data; - unsigned int plmn = 0; - - //CASE 1. MANUAL MODE - plmn = 45454; - act = 0x1; - ret_status = tel_select_network_manual(handle, plmn, act, callback, user_data); - - // CASE 2. AUTOMATIC MODE - ret_status = tel_select_network_automatic(handle, callback, user_data); - 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(TapiHandle *handle, tapi_response_cb callback, void *user_data); -@endcode - -SAMPLE CODE: -@code -#include -#include -#include "TapiCommon.h" - -//SUBSCRIBE FOR EVENTS AS MENTIONED IN Event Register and Deregister -void searchnw() -{ - int ret_status; - TapiHandle *handle; - tapi_response_cb callback; - void *user_data; - - ret_status = tel_search_network(handle, callback, user_data); - 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(TapiHandle *handle, tapi_response_cb callback, void *user_data); -@endcode - -SAMPLE CODE -@code -#include -#include -#include "TapiCommon.h" - -//SUBSCRIBE FOR EVENTS AS MENTIONED IN Event Register and Deregister -void get_selmode() -{ - int ret_status; - TapiHandle *handle; - tapi_response_cb callback; - void *user_data; - - //GET THE SELECTION MODE - - ret_status = tel_get_network_selection_mode (handle, callback, user_data); - 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(TapiHandle *handle, TelNetworkServiceDomain_t domain, tapi_response_cb callback, void *user_data); -int tel_get_network_service_domain(TapiHandle *handle, tapi_response_cb callback, void *user_data); -@endcode - -SAMPLE CODE -@code -#include -#include -#include -#include "TapiCommon.h" - -//SUBSCRIBE FOR EVENTS AS MENTIONED IN Event Register and Deregister -void set_servicedomain() -{ - int ret_status; - TapiHandle *handle; - TelNetworkServiceDomain_t domain; - tapi_response_cb callback; - void *user_data; - - //SET NETWORK SERVICE DOMAIN - domain = TAPI_NETWORK_SERVICE_DOMAIN_AUTOMATIC; - - ret_status = tel_set_network_service_domain (handle, domain, callback, user_data); - 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; - TapiHandle *handle; - tapi_response_cb callback; - void *user_data; - - ret_status = tel_get_network_service_domain (handle, callback, user_data); - 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(TapiHandle *handle, int mode, tapi_response_cb callback, void *user_data); -int tel_get_network_mode(TapiHandle *handle, tapi_response_cb callback, void *user_data); -@endcode - -SAMPLE CODE -@code -#include -#include -#include "TapiCommon.h" - -//SUBSCRIBE FOR EVENTS AS MENTIONED IN Event Register and Deregister -void setnwmode() -{ - int ret_status; - TapiHandle *handle; - int mode; - tapi_response_cb callback; - void *user_data; - - mode = 0x01; - ret_status = tel_set_network_mode(handle, mode, callback, user_data); - 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; - TapiHandle *handle; - tapi_response_cb callback; - void *user_data; - - ret_status = tel_get_network_mode(handle, callback, user_data); - 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(TapiHandle *handle, TelNetworkBandPreferred_t mode, TelNetworkBand_t band, tapi_response_cb callback, void *user_data); -int tel_get_network_band(TapiHandle *handle, tapi_response_cb callback, void *user_data); -@endcode - -SAMPLE CODE: -@code -#include -#include -#include "TapiCommon.h" - -//SUBSCRIBE FOR EVENTS AS MENTIONED IN Event Register and Deregister -void setnwband() -{ - int ret_status; - TapiHandle *handle; - TelNetworkBandPreferred_t mode; - TelNetworkBand_t band; - tapi_response_cb callback; - void *user_data; - - mode = TAPI_NETWORK_BAND_MODE_PREFERRED; - band = TAPI_NETWORK_BAND_TYPE_GSM_900_1800; - - ret_status = tel_set_network_band (handle, mode, band, callback, user_data); - 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; - TapiHandle *handle; - tapi_response_cb callback; - void *user_data; - - ret_status = tel_get_network_band(handle, callback, user_data); - 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(TapiHandle *handle, TelNetworkPreferredPlmnOp_t operation, TelNetworkPreferredPlmnInfo_t *info, tapi_response_cb callback, void *user_data); -int tel_get_network_preferred_plmn(TapiHandle *handle, tapi_response_cb callback, void *user_data); -@endcode - -SAMPLE CODE -@code -#include -#include -#include "TapiCommon.h" - -//SUBSCRIBE FOR EVENTS AS MENTIONED IN Event Register and Deregister -void set_preferredplmn() -{ - int ret_status; - TapiHandle *handle; - TelNetworkPreferredPlmnOp_t operation; - TelNetworkPreferredPlmnInfo_t info; - tapi_response_cb callback; - void *user_data; - - unsigned char *plmn = "45454"; - - //SET PLMN - operation = TAPI_NETWORK_PREF_PLMN_ADD; - memset(&info, 0, sizeof(TelNetworkPreferredPlmnInfo_t)); - info.Index = 0; - info.SystemType = TAPI_NETWORK_SYSTEM_GSM; - memcpy(info.Plmn, plmn, strlen(plmn)); - - ret_status = tel_set_network_preferred_plmn(handle, operation, &info, callback, user_data); - 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; - TapiHandle *handle; - tapi_response_cb callback; - void *user_data; - - ret_status = tel_get_network_preferred_plmn(handle, callback, user_data); - 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_Cases6_1 SIM -@ingroup Use_Cases6_SIM -@{ - - -

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; -TapiHandle *handle; // Handle given by tel_init() -char *noti_id; // Get Noti id -tapi_notification_cb callback; //Initialized call-back function pointer in which notification data is returned -void *user_data = NULL; // Set User data - -api_err = TelTapiInit(); -if (api_err != TAPI_API_SUCCESS) -{ - TEST_DEBUG("TelTapiInit Failed - api_err = %d \n", api_err); -} - -api_err = tel_register_noti_event(handle, noti_id, callback, user_data); -printf("SIM Event registration is Done:"); - -// DEREGISTER EVENT -api_err = tel_deregister_noti_event(handle, noti_id); -if (api_err != TAPI_API_SUCCESS) -{ - printf("Event Class Unregeration Fail\n"); - -} -@endcode -@} -@defgroup Use_Cases6_2 PIN, SIM Lock operations -@ingroup Use_Cases6_SIM -@{ - - -

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_facility(TapiHandle *handle, TelSimFacilityPw_t *sec_data, tapi_response_cb callback, void *user_data); -int tel_disable_sim_facility(TapiHandle *handle, TelSimFacilityPw_t *sec_data, tapi_response_cb callback, void *user_data); -int tel_change_sim_pins(TapiHandle *handle, const TelSimSecPw_t *old_pin, const TelSimSecPw_t *new_pin, tapi_response_cb callback, void *user_data); -int tel_verify_sim_puks(TapiHandle *handle, const TelSimSecPw_t *puk_data, const TelSimSecPw_t *new_pin_data, tapi_response_cb callback, void *user_data); -int tel_verifiy_sim_pins(TapiHandle *handle, const TelSimSecPw_t *pin_data, tapi_response_cb callback, void *user_data); -int tel_get_sim_facility(TapiHandle *handle, TelSimLockType_t type, tapi_response_cb callback, void *user_data); -int tel_get_sim_lock_info(TapiHandle *handle, TelSimLockType_t type, tapi_response_cb callback, void *user_data); -@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 err_code; - int length = TAPI_SIM_PIN_LENGTH + 1; - char init_pin_val[length] ; - TelSimSecPw_t pin_data; - TapiHandle *handle; // Handle given by tel_init() - tapi_response_cb callback; //Initialized call-back function pointer in which response is returned - void *user_data = NULL; // Set User 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(handle, &pin_data, on_resp_sim_sec_op, user_data); - 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 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; - TapiHandle *handle; // Handle given by tel_init() - tapi_response_cb callback; //Initialized call-back function pointer in which response is returned - void *user_data = NULL; // Set User data - - 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(handle, &old_pin, &new_pin, on_resp_sim_sec_op, user_data); - 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 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; - TapiHandle *handle; // Handle given by tel_init() - tapi_response_cb callback; //Initialized call-back function pointer in which response is returned - void *user_data = NULL; // Set User 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(handle, &puk_data, &new_pin_data, on_resp_sim_sec_op, user_data); - 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 err_code; - int length = TAPI_SIM_PIN_LENGTH + 1; - char init_pin_val[length] ; - TelSimSecPw_t pin_data; - TapiHandle *handle; // Handle given by tel_init() - tapi_response_cb callback; //Initialized call-back function pointer in which response is returned - void *user_data = NULL; // Set User 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(handle, &pin_data, on_resp_sim_sec_op, user_data); - if (err_code != TAPI_API_SUCCESS) - { - printf("TAPI API FAIL: Error Code [0x%x]", err_code); - } - // WAIT FOR EVENT FROM HERE -} - -//RESPONSE PART -//CALLBACK FUNCTION TO BE USED -static void on_resp_sim_sec_op(TapiHandle *handle, int result, void *data, void *user_data) -{ - TelSimPinOperationResult_t sec_rt = result; - TelSimSecResult_t *rt = data; - - printf("sec_rt[%d]", sec_rt); - printf("rt->type[%d]", rt->type); - printf("rt->retry_count[%d]", rt->retry_count); -} -@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); - - TelSimFacilityPw_t sec_data; - sec_data.lock_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_facility(handle, sec_data, on_resp_sim_facility_op, user_data); - 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); - - TelSimFacilityPw_t sec_data; - sec_data.lock_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_facility(handle, sec_data, on_resp_sim_facility_op, user_data); - 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 err_code; - int length = TAPI_SIM_PIN_LENGTH+1; - char init_pin_val[length]; - - strcpy(init_pin_val, SIM_NORMAL); - - TelSimFacilityPw_t sec_data; - sec_data.lock_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_facility(handle, sec_data, on_resp_sim_facility_op, user_data); - 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); - - TelSimFacilityPw_t sec_data; - sec_data.lock_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_facility(handle, sec_data, on_resp_sim_facility_op, user_data); - if (err_code != TAPI_API_SUCCESS) - { - printf("TAPI API FAIL: Error Code [0x%x]", err_code); - } - //WAIT EVENT RESPONSE FROM HERE -} - -@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_facility_status() -{ - int error_code; - TelSimLockType_t type = TAPI_SIM_PTYPE_PIN1 // or TAPI_SIM_PTYPE_PIN2 or TAPI_SIM_PTYPE_SIM; - - err_code = tel_get_sim_facility(handle, type, callback, user_data); - if (err_code != TAPI_API_SUCCESS) - { - printf("TAPI API FAIL: Error Code [0x%x]", err_code); - } - printf("*****************************************************"); -} - -void get_lock_status() -{ - int error_code; - TelSimLockType_t type = TAPI_SIM_PTYPE_PIN1 // or TAPI_SIM_PTYPE_PIN2 or TAPI_SIM_PTYPE_SIM; - - err_code = tel_get_sim_lock_info(handle, type, callback, user_data); - if (err_code != TAPI_API_SUCCESS) - { - printf("TAPI API FAIL: Error Code [0x%x]", err_code); - } - printf("*****************************************************"); -} - -@endcode -@} -@defgroup Use_Cases6_3 Personalisation Lock -@ingroup Use_Cases6_SIM -@{ - - -

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_facility(TapiHandle *handle, TelSimFacilityPw_t *pw, tapi_response_cb callback, void *user_data); -int tel_disable_sim_facility(TapiHandle *handle, TelSimFacilityPw_t *pw, tapi_response_cb callback, void *user_data); -int tel_get_sim_facility(TapiHandle *handle, TelSimLockType_t type, tapi_response_cb callback, void *user_data); -@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 err_code; - TelSimLockType_t type = TAPI_SIM_LOCK_PN; // Set locktype for which facility should be disabled; - - err_code = tel_get_sim_facility(handle, type, on_resp_get_sim_facility, user_data); - if (err_code != TAPI_API_SUCCESS) - { - printf("TAPI API FAIL: Error Code [0x%x]", err_code); - } - // WAIT EVENT RESPONSE FROM HERE -} - -//RESPONSE PART -//CALLBACK FUNCTION TO BE USED -static void on_resp_get_sim_facility(TapiHandle *handle, int result, void *data, void *user_data) -{ - TelSimPinOperationResult_t sec_rt = result; - TelSimFacilityInfo_t *fi = data; - - printf("sec_rt[%d]", sec_rt); - printf("fi->type[%d]", fi->type); - printf("fi->f_status[%d]", fi->f_status); -} -@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 err_code; - TelSimFacilityPw_t *fc_pw; - int length = TAPI_SIM_PIN_LENGTH+1; - char init_pin_val[length] ; - - strcpy(init_pin_val, PIN1_NORMAL); - - fc_pw.lock_type = TAPI_SIM_LOCK_PN; // Set locktype for which facility should be disabled; - fc_pw.pw_len = strlen(init_pin_val); - - printf("pw_len[%d]", fc_pw.pw_len); - - fc_pw.pw = (char*)malloc(length); - memcpy(fc_pw.pw,init_pin_val,length); - - err_code = tel_enable_sim_facility(handle, fc_pw, on_resp_sim_facility_op, user_data); - - 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 err_code; - TelSimFacilityPw_t *fc_pw; - int length = TAPI_SIM_PIN_LENGTH+1; - char init_pin_val[length] ; - - strcpy(init_pin_val, PIN1_NORMAL); - - fc_pw.lock_type = TAPI_SIM_LOCK_PN; // Set locktype for which facility should be disabled; - fc_pw.pw_len = strlen(init_pin_val); - - printf("pw_len[%d]", fc_pw.pw_len); - - fc_pw.pw = (char*)malloc(length); - memcpy(fc_pw.pw,init_pin_val,length); - - err_code = tel_disable_sim_facility(handle, fc_pw, on_resp_sim_facility_op, user_data); - if (err_code != TAPI_API_SUCCESS) - { - printf("TAPI API FAIL: Error Code [0x%x]", err_code); - } - // WAIT EVENT RESPONSE FROM HERE -} - -//RESPONSE PART -//CALLBACK FUNCTION TO BE USED -static void on_resp_sim_facility_op(TapiHandle *handle, int result, void *data, void *user_data) -{ - TelSimPinOperationResult_t sec_rt = result; - TelSimFacilityResult_t *f_rt = data; - - printf("sec_rt[%d]", sec_rt); - printf("f_rt->type[%d]", f_rt->type); - printf("f_rt->retry_count[%d]", f_rt->retry_count); -} - -@endcode -@} -@defgroup Use_Cases6_4 FDN -@ingroup Use_Cases6_SIM -@{ - - -

FDN

-These APIs are used to enable/disable FDN and to retrieve the current FDN status. - -@code -int tel_enable_sim_facility(TapiHandle *handle, TelSimFacilityPw_t *pw, tapi_response_cb callback, void *user_data); -int tel_disable_sim_facility(TapiHandle *handle, TelSimFacilityPw_t *pw, tapi_response_cb callback, void *user_data); -int tel_get_sim_facility(TapiHandle *handle, TelSimLockType_t type, tapi_response_cb callback, void *user_data); - -@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 api_ret; - TelSimFacilityPw_t *fc_pw; - int length = TAPI_SIM_PIN_LENGTH+1; - char init_pin_val[length] ; - - strcpy(init_pin_val, PIN1_NORMAL); - - fc_pw.lock_type = TAPI_SIM_PTYPE_PIN2; // Set locktype for which facility should be disabled; - fc_pw.pw_len = strlen(init_pin_val); - - printf("pw_len[%d]", fc_pw.pw_len); - - fc_pw.pw = (char*)malloc(length); - memcpy(fc_pw.pw,init_pin_val,length); - - err_code = tel_enable_sim_facility(handle, fc_pw, on_resp_sim_facility_op, user_data); - 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 api_ret; - TelSimFacilityPw_t *fc_pw; - int length = TAPI_SIM_PIN_LENGTH+1; - char init_pin_val[length] ; - - strcpy(init_pin_val, PIN1_NORMAL); - - fc_pw.lock_type = TAPI_SIM_PTYPE_PIN2; // Set locktype for which facility should be disabled; - fc_pw.pw_len = strlen(init_pin_val); - - printf("pw_len[%d]", fc_pw.pw_len); - - fc_pw.pw = (char*)malloc(length); - memcpy(fc_pw.pw,init_pin_val,length); - - err_code = tel_disable_sim_facility(handle, fc_pw, on_resp_sim_facility_op, user_data); - - if (err_code != TAPI_API_SUCCESS) - { - printf("TAPI API FAIL: Error Code [0x%x]", err_code); - } - // WAIT FOR EVENT FROM HERE - - - //RESPONSE PART - //CALLBACK FUNCTION TO BE USED - static void on_resp_disable_sim_facility(TapiHandle *handle, int result, void *data, void *user_data) - { - TelSimPinOperationResult_t sec_rt = result; - TelSimFacilityResult_t *f_rt = data; - - printf("sec_rt[%d]", sec_rt); - printf("f_rt->type[%d]", f_rt->type); - printf("f_rt->retry_count[%d]", f_rt->retry_count); - } - - // OPERATION REQUEST GET FDN STATUS PART - void get_fdn_status() - { - printf("Get FDN status"); - TelSimLockType_t type = TAPI_SIM_LOCK_SC; // Set locktype for which facility should be disabled; - - err_code = tel_get_sim_facility(handle, type, on_resp_get_sim_facility, user_data); - - err_code = tel_get_sim_facility(handle, type, on_resp_get_sim_facility, user_data); - 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_Cases6_5 IMSI Information -@ingroup Use_Cases6_SIM -@{ - - -

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(handle, &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_Cases6_6 ECC Information -@ingroup Use_Cases6_SIM -@{ - - -

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; - TelSimEccList_t ecc_info = {0}; // Get ECC list info and ecc_count - err_code = tel_get_sim_ecc(handle, &ecc_info); - - printf("The Retrun Status is %d", err_code); - - printf(" ECC count [%d]\n", ecc_info.ecc_rec_count); -} - -void get_uecc() -{ - int err_code; - int i = 0; - - printf(" Get USIM ECC "); - - TelSimEccList_t uecc_info = {{{0,}}}; - - err_code = tel_get_sim_ecc(handle, &uecc_info); - if (err_code == TAPI_API_SUCCESS) - { - printf("ECC count [%d]", uecc_info.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(TapiHandle *handle, tapi_response_cb callback, void *user_data); -int tel_set_sim_language(TapiHandle *handle, TelSimLanguagePreferenceCode_t language, tapi_response_cb callback, void *user_data); -@endcode - -SAMPLE CODE: GET SIM LANGUAGE -@code -#include -#include -#include "TapiCommon.h" - -void getlanguageprefinfo() -{ - int err_code; - TapiHandle *handle; // Handle given by tel_init() - tapi_response_cb callback; //Initialized call-back function pointer in which response is returned - void *user_data; // Set User data - - err_code = tel_get_sim_language(handle, on_resp_getlanguage, user_data); - 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 setlanguageprefinfo() -{ - int err_code; - TelSimLanguagePreferenceCode_t language = 0x00; //init - language = TAPI_SIM_LP_ENGLISH; //language value - TapiHandle *handle; // Handle given by tel_init() - tapi_response_cb callback; //Initialized call-back function pointer in which response is returned - void *user_data; // Set User data - err_code = tel_set_sim_language(handle, language, on_resp_setlanguage, user_data); - - if (err_code != TAPI_API_SUCCESS) - { - printf("TAPI API FAIL: Error Code [0x%x]", err_code); - } - // WAIT EVENT RESPONSE FROM HERE -} - - -//RESPONSE PART -//CALLBACK FUNCTION TO BE USED -static void on_resp_getlanguage(TapiHandle *handle, int result, void *data, void *user_data) -{ - TelSimLanguagePreferenceCode_t *language = data; - TelSimAccessResult_t access_rt = result; - - printf("access rt[%d]", access_rt); - printf("language[%d]", *language); -} -static void on_resp_setlanguage(TapiHandle *handle, int result, void *data, void *user_data) -{ - TelSimAccessResult_t access_rt = result; - - printf("access_rt[%d]", access_rt); -} -@endcode -@} -@defgroup Use_Cases6_8 Getting Card Type -@ingroup Use_Cases6_SIM -@{ - - -

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; //unkwon, sim(normally gsm), usim(normally umts) - TapiHandle *handle; // Handle given by tel_init() - - err_code = tel_get_sim_type(handle, &cardInfo); - - printf("card type is %d\n", cardInfo); -} -@endcode -@} -@defgroup Use_Cases6_9 Getting SIM Card Initialization Status -@ingroup Use_Cases6_SIM -@{ - - -

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 = TAPI_API_SUCCESS; - TelSimCardStatus_t status = 0x00; - int b_card_changed = 0; - TapiHandle *handle; // Handle given by tel_init() - - // GET SIM INIT INFORMATION - err_code = tel_get_sim_init_info(handle, &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_Cases6_10 SIM ACCESS COMMANDS Interface -@ingroup Use_Cases6_SIM -@{ - - -

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; - void *user_data = NULL; // Set User data - - 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(handle, &rsim_data, user_data); - if (err_code != TAPI_API_SUCCESS) - { - printf("TAPI API FAIL: Error Code [0x%x]", err_code); - } - // WAIT EVENT RESPONSE FROM HERE -} -@endcode -@} -@defgroup Use_Cases6_11 SIM Mailbox EF management -@ingroup Use_Cases6_SIM -@{ - - -

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(TapiHandle *handle, tapi_response_cb callback, void *user_data); -int tel_set_sim_mailbox_info(TapiHandle *handle, TelSimMailBoxNumber_t *req_mb, tapi_response_cb callback, void *user_data); -@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 = 0; - TapiHandle *handle; // Handle given by tel_init() - tapi_response_cb callback; //Initialized call-back function pointer in which response is returned - void *user_data; // Set User data - err_code = tel_get_sim_mailbox_info(handle, on_resp_get_sim_mailbox, user_data); - if(err_code == TAPI_API_SUCCESS) { - if(mbox.b_cphs) { //b_cphs means current SIM is for CPHS or not. - printf("Current SIM is CPHS"); - } else { - printf("Current SIM is not CPHS but 3GPP"); - } - } else { - printf("TAPI API FAIL: Error Code [0x%x]",err_code); - } - -} -// OPERATION REQUEST UPDATE SIM MAILBOX INFO PART -void update_sim_mailbox() -{ - int err_code = 0; - TelSimMailBoxNumber_t *req_mb; // Get SIM mail box number info - TapiHandle *handle; // Handle given by tel_init() - tapi_response_cb callback; //Initialized call-back function pointer in which response is returned - void *user_data; // Set User data - err_code = tel_set_sim_mailbox_info(handle, &req_mb, on_resp_set_sim_mailbox, user_data); - - if (err_code != TAPI_API_SUCCESS) - { - printf("TAPI API FAIL: Error Code [0x%x]", err_code); - } - // WAIT EVENT RESPONSE FROM HERE -} - -//RESPONSE PART -//CALLBACK FUNCTION TO BE USED -static void on_resp_get_sim_mailbox(TapiHandle *handle, int result, void *data, void *user_data) -{ - TelSimAccessResult_t access_rt = result; - TelSimMailboxList_t *list = data; - int i = 0; - - printf("access_rt[%d]", access_rt); - printf("count[%d]", list->count); - - for (i = 0; i < list->count; i++) { - printf("list->list[%d].b_cphs[%d]", i, list->list[i].b_cphs); - printf("list->list[%d].rec_index[%d]", i, list->list[i].rec_index); - printf("list->list[%d].profile_num[%d]", i, list->list[i].profile_num); - printf("list->list[%d].mb_type[%d]", i, list->list[i].mb_type); - printf("list->list[%d].alpha_id_max_len[%d]", i, - list->list[i].alpha_id_max_len); - printf("list->list[%d].alpha_id[%s]", i, list->list[i].alpha_id); - printf("list->list[%d].ton[0x%x]", i, list->list[i].ton); - printf("list->list[%d].npi[0x%x]", i, list->list[i].npi); - printf("list->list[%d].num[%s]", i, list->list[i].num); - printf("list->list[%d].cc_id[0x%x]", i, list->list[i].cc_id); - printf("list->list[%d].ext1_id[0x%x]", i, list->list[i].ext1_id); - } -} - -static void on_resp_set_sim_mailbox(TapiHandle *handle, int result, void *data, void *user_data) -{ - TelSimAccessResult_t access_rt = result; - - printf("access_rt[%d]", access_rt); -} -@endcode -@} -@defgroup Use_Cases6_12 SIM Indication Status EFs management -@ingroup Use_Cases6_SIM -@{ - - -

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_messagewaiting_info(TapiHandle *handle, tapi_response_cb callback, void *user_data); -int tel_set_sim_messagewaiting_info(TapiHandle *handle, TelSimMessageWaitingReq_t *req_mw, tapi_response_cb callback, void *user_data); -@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 = 0; - TapiHandle *handle; // Handle given by tel_init() - tapi_response_cb callback; //Initialized call-back function pointer in which response is returned - void *user_data; // Set User data - err_code = tel_get_sim_messagewaiting_info(handle, on_resp_get_sim_mwis, user_data); - if(err_code == TAPI_API_SUCCESS) { - if(mw_data.b_cphs) { //b_cphs means current SIM is for CPHS or not. - printf("Current SIM is CPHS"); - } else { - printf("Current SIM is not CPHS but 3GPP"); - } - } else { - printf("TAPI API FAIL: Error Code [0x%x]",err_code); - } - -} - -// OPERATION REQUEST UPDATE SIM MESSAGE WAITING INDICATION STATUS INFO PART -//SUBSCRIBE FOR EVENTS AS MENIONED IN Event Register and Deregister - -void update_sim_mwis() -{ - TelSimMessageWaiting_s mw_data; - int err_code = 0; - TelSimMessageWaitingReq_t *req_mw; // Get message waiting info - TapiHandle *handle; // Handle given by tel_init() - tapi_response_cb callback; //Initialized call-back function pointer in which response is returned - void *user_data; // Set User data - err_code = tel_set_sim_messagewaiting_info(handle, &req_mw, on_resp_set_sim_mwis, user_data); - - if (err_code != TAPI_API_SUCCESS) - { - printf("TAPI API FAIL: Error Code [0x%x]", err_code); - } - // WAIT EVENT RESPONSE FROM HERE -} - - -//RESPONSE PART -//CALLBACK FUNCTION TO BE USED -static void on_resp_get_sim_mwis(TapiHandle *handle, int result, void *data, void *user_data) -{ - TelSimAccessResult_t access_rt = result; - TelSimMessageWaitingResp_t *mw = data; - int i = 0; - - printf("access_rt[%d]", access_rt); - printf("mw->b_cphs[%d]", mw->b_cphs); - - if (mw->b_cphs) { - printf("mw->cphs_mw.b_voice1[%d]", mw->cphs_mw.b_voice1); - printf("mw->cphs_mw.b_voice2[%d]", mw->cphs_mw.b_voice2); - printf("mw->cphs_mw.b_fax[%d]", mw->cphs_mw.b_fax); - printf("mw->cphs_mw.b_data[%d]", mw->cphs_mw.b_data); - } - else { - for (i = 0; i < mw->mw_list.profile_count; i++) { - printf("mw->mw_list.mw[%d].rec_index[%d]", i, - mw->mw_list.mw[i].rec_index); - printf("mw->mw_list.mw[%d].indicator_status[0x%x]", i, - mw->mw_list.mw[i].indicator_status); - printf("mw->mw_list.mw[%d].voice_count[%d]", i, - mw->mw_list.mw[i].voice_count); - printf("mw->mw_list.mw[%d].fax_count[%d]", i, - mw->mw_list.mw[i].fax_count); - printf("mw->mw_list.mw[%d].email_count[%d]", i, - mw->mw_list.mw[i].email_count); - printf("mw->mw_list.mw[%d].other_count[%d]", i, - mw->mw_list.mw[i].other_count); - printf("mw->mw_list.mw[%d].video_count[%d]", i, - mw->mw_list.mw[i].video_count); - } - } - -} - -static void on_resp_set_sim_mwis(TapiHandle *handle, int result, void *data, void *user_data) -{ - TelSimAccessResult_t access_rt = result; - printf("access_rt[%d]", access_rt); -} - -@endcode -@} -@defgroup Use_Cases6_13 Phone Book -@ingroup Use_Cases6_SIM -@{ - - -

Phone Book

-[Note] Telephony Emulator does not support this feature. - -Telephony provides APIs for various phonebook related features such as getting SIM initialization status, supported phonebook types, first valid index, total records and used records in phonebook, phonebook entry information and reading, updating, deleting of SIM phonebook records. - -@code -int tel_get_sim_pb_count(TapiHandle *handle, TelSimPbType_t pb_type, tapi_response_cb callback, void *user_data); -int tel_get_sim_pb_meta_info(TapiHandle *handle, TelSimPbType_t pb_type, tapi_response_cb callback, void *user_data); -int tel_get_sim_pb_usim_meta_info(TapiHandle *handle, tapi_response_cb callback, void *user_data); -int tel_read_sim_pb_record(TapiHandle *handle, TelSimPbType_t pb_type, unsigned short index, tapi_response_cb callback, void *user_data); -int tel_update_sim_pb_record(TapiHandle *handle, const TelSimPbRecord_t *req_data, tapi_response_cb callback, void *user_data); -int tel_delete_sim_pb_record(TapiHandle *handle, TelSimPbType_t pb_type, unsigned short index, tapi_response_cb callback, void *user_data); -int tel_get_sim_pb_init_info(TapiHandle *handle, int *init_completed, TelSimPbList_t *pb_list); -@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; - TelSimPbType_t StorageFileType = TAPI_SIM_PB_3GSIM; - int pRequestId = 0; - TapiHandle *handle; - - ret_status = tel_get_sim_pb_count(handle, StorageFileType, on_resp_get_sim_pb_count, &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 on_resp_get_sim_pb_count (TapiHandle *handle, int result, void *data, void *user_data) -{ - TelSimPbAccessResult_t access_rt = result; - TelSimPbStorageInfo_t *ps = data; - - printf("on_pb_get_sim_pb_count received"); - printf("access_rt[%d]", access_rt); - if (access_rt == TAPI_SIM_PB_SUCCESS) { - if (ps->StorageFileType <= TAPI_SIM_PB_GAS) { - printf("StorageFileType[%d][%s]", ps->StorageFileType, dbg_pb_type_name[ps->StorageFileType]); - } else { - printf("StorageFileType[%d]", ps->StorageFileType); - } - printf("TotalRecordCount[%d]", ps->TotalRecordCount); - printf("UsedRecordCount[%d]", ps->UsedRecordCount); - } -} -@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; - TelSimPbType_t StorageFileType = TAPI_SIM_PB_FDN; - int pRequestId = 0; - TapiHandle *handle; - - ret_status = tel_get_sim_pb_meta_info (handle, StorageFileType, on_resp_get_sim_pb_meta_info, &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 on_resp_get_sim_pb_meta_info(TapiHandle *handle, int result, void *data, void *user_data) -{ - TelSimPbAccessResult_t access_rt = result; - TelSimPbEntryInfo_t *pe = data; - - printf("on_pb_get_sim_pb_meta_info received"); - printf("access_rt[%d]", access_rt); - if (access_rt == TAPI_SIM_PB_SUCCESS) { - if (pe->StorageFileType <= TAPI_SIM_PB_GAS) { - printf("StorageFileType[%d][%s]", pe->StorageFileType, dbg_pb_type_name[pe->StorageFileType]); - } else { - printf("StorageFileType[%d]", pe->StorageFileType); - } - printf("PbIndexMin[%d]",pe->PbIndexMin); - printf("PbIndexMax[%d]",pe->PbIndexMax); - printf("PbNumLenMax[%d]",pe->PbNumLenMax); - printf("PbTextLenMax[%d]",pe->PbTextLenMax); - printf("PbUsedCount[%d]",pe->PbUsedCount); - } - -} -@endcode - -SAMPLE CODE TO GET USIM ENTRY INFO AND CAPABILITY INFO -@code -#include -#include -#include "TapiCommon.h" - -//SUBSCRIBE FOR EVENTS AS MENIONED IN Event Register and Deregister -void getPBCapabilityInfo() -{ - int ret_status; - int pRequestId = 0; - TapiHandle *handle; - - ret_status = tel_get_sim_pb_usim_meta_info(handle, on_resp_get_sim_pb_usim_meta_info, &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 on_resp_get_sim_pb_usim_meta_info(TapiHandle *handle, int result, void *data, void *user_data) -{ - TelSimPbAccessResult_t access_rt = result; - TelSimPbCapabilityInfo_t *capa = data; - int i = 0; - - printf("on_pb_get_sim_pb_3g_meta_info received"); - printf("access_rt[%d]", access_rt); - if (access_rt == TAPI_SIM_PB_SUCCESS) { - for (i = 0; i < capa->FileTypeCount; i++) { - if(capa->FileTypeInfo[i].field_type <=TAPI_PB_3G_PBC ) { - printf("capa->FileTypeInfo[%d].field_type[%d][%s]", i, capa->FileTypeInfo[i].field_type, dbg_pb_adf_field_name[capa->FileTypeInfo[i].field_type]); - } else { - printf("capa->FileTypeInfo[%d].field_type[%d]", i, capa->FileTypeInfo[i].field_type); - } - printf("capa->FileTypeInfo[%d].index_max[%d]", i, capa->FileTypeInfo[i].index_max); - printf("capa->FileTypeInfo[%d].text_max[%d]", i, capa->FileTypeInfo[i].text_max); - printf("capa->FileTypeInfo[%d].used_count[%d]", i, capa->FileTypeInfo[i].used_count); - } - } - -} -@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; - TelSimPbType_t StorageFileType = TAPI_SIM_PB_FDN; - unsigned short Index = 4; - int pRequestId = 0; - TapiHandle *handle; - - ret_status = tel_read_sim_pb_record (handle, StorageFileType,Index, on_resp_read_sim_pb_record, &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 on_resp_read_sim_pb_record (TapiHandle *handle, int result, void *data, void *user_data) -{ - TelSimPbAccessResult_t access_rt = result; - TelSimPbRecord_t *pr = data; - - printf("on_pb_read_sim_pb_record received"); - printf("access_rt[%d]", access_rt); - if(access_rt == TAPI_SIM_PB_SUCCESS) { - if( pr->phonebook_type <= TAPI_SIM_PB_GAS){ - printf("phonebook_type[%d][%s]", pr->phonebook_type, dbg_pb_type_name[pr->phonebook_type]); - } else { - printf("phonebook_type[%d]", pr->phonebook_type); - } - printf("index[%d]", pr->index); - printf("next_index[%d]", pr->next_index); - printf("name[%s]", pr->name); - if(pr->dcs <= TAPI_SIM_TEXT_ENC_HEX) { - printf("dcs[%d][%s]", pr->dcs, dbg_pb_dcs_name[pr->dcs]); - } else { - printf("dcs[%d]", pr->dcs); - } - printf("number[%s]", pr->number); - - if(pr->ton <= TAPI_SIM_TON_RESERVED_FOR_EXT) { - printf("ton[%d][%s]", pr->ton, dbg_pb_ton_name[pr->ton]); - } else { - printf("ton[%d]", pr->ton); - } - - if (pr->phonebook_type == TAPI_SIM_PB_3GSIM) { - printf("anr1[%s]", pr->anr1); - if(pr->anr1_ton <= TAPI_SIM_TON_RESERVED_FOR_EXT) { - printf("anr1_ton[%d][%s]", pr->anr1_ton, dbg_pb_ton_name[pr->anr1_ton]); - } else { - printf("anr1_ton[%d]", pr->anr1_ton); - } - printf("anr2[%s]", pr->anr2); - if(pr->anr2_ton <= TAPI_SIM_TON_RESERVED_FOR_EXT) { - printf("anr2_ton[%d][%s]", pr->anr2_ton, dbg_pb_ton_name[pr->anr2_ton]); - } else { - printf("anr2_ton[%d]", pr->anr2_ton); - } - printf("anr3[%s]", pr->anr3); - if(pr->anr3_ton <= TAPI_SIM_TON_RESERVED_FOR_EXT) { - printf("anr3_ton[%d][%s]", pr->anr3_ton, dbg_pb_ton_name[pr->anr3_ton]); - } else { - printf("anr3_ton[%d]", pr->anr3_ton); - } - printf("email1[%s]", pr->email1); - printf("email2[%s]", pr->email2); - printf("email3[%s]", pr->email3); - printf("email4[%s]", pr->email4); - printf("group_index[%d]", pr->group_index); - printf("pb_control[%d]", pr->pb_control); - } - } - -} -@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; - TelSimPbRecord_t pb_add; - int pRequestId = 0; - TapiHandle *handle; - - pb_add.StorageFileType = TAPI_SIM_PB_3GSIM; - pb_add.Index = 1; - pb_add.NextIndex = 0; - - ret_status = tel_update_sim_pb_record(handle, &pb_add, on_resp_update_sim_pb_record, &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 on_resp_update_sim_pb_record(TapiHandle *handle, int result, void *data, void *user_data) -{ - TelSimPbAccessResult_t access_rt = result; - - printf("on_pb_update_sim_pb_record received"); - printf("access_rt[%d]", access_rt); -} -@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; - TapiHandle *handle; - TelSimPbType_t StorageFileType = TAPI_SIM_PB_3GSIM; - unsigned short RecordIndex = 1; - int pRequestId = 0; - - ret_status = tel_delete_sim_pb_record (handle, StorageFileType, RecordIndex, on_resp_delete_sim_pb_record, &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 on_resp_delete_sim_pb_record(TapiHandle *handle, int result, void *data, void *user_data) -{ - TelSimPbAccessResult_t access_rt = result; - - printf("on_pb_delete_sim_pb_record received"); - printf("access_rt[%d]", access_rt); - -} -@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() -{ - TapiHandle *handle; - TelSimPbList_t pb_list; - int pPbInitCompleted = 0; - - err_code = tel_get_sim_pb_init_info(handle, &pPbInitCompleted, &pb_list); - 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_Cases6_14 Getting 3G Phone Book Information -@ingroup Use_Cases6_SIM -@{ - - -

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_Cases6_15 SAP (Sim access Profile) features -@ingroup Use_Cases6_SIM -@{ - -

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_Cases6_16 ISIM Features -@ingroup Use_Cases6_SIM -@{ - - -

ISIM Features

-[Note] Telephony Emulator does not support this feature. - -@code -int tel_req_sim_authentication( TelSimAuthenticationData_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; - TelSimAuthenticationData_t authenticationData; - authenticationData.rand_length = 100; - authenticationData.rand_length = 100; - authenticationData.rand_data = "test data"; - authenticationData.autn_data = "test data"; - int pRequestId = 0; - - ret_status = tel_req_sim_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_AUTHENTICATION_CNF: - printf("TAPI_EVENT_SIM_AUTHENTICATION_CNF"); - break; - //... - } -} -@endcode -@} -@defgroup Use_Cases6_17 SIM NOTIFICATION MESSAGE -@ingroup Use_Cases6_SIM -@{ - - -

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_Cases7_1 Event Register and Deregister -@ingroup Use_Cases7_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("com.samsung.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_Cases7_2 Voice path control -@ingroup Use_Cases7_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 - -This API is permitted for Samsung in-house applications only -@} -@defgroup Use_Cases7_3 Volume control -@ingroup Use_Cases7_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 - -This API is permitted for Samsung in-house applications only -@} -@defgroup Use_Cases7_4 Mic mute control -@ingroup Use_Cases7_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 - -This API is permitted for Samsung in-house applications only - -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_Cases8_1 Event register and deregister -@ingroup Use_Cases8_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; -TapiHandle *handle; // Handle given by tel_init() -char *noti_id; // Get Noti id -tapi_notification_cb callback; //Initialized call-back function pointer in which notification data is returned -void *user_data = NULL; // Set User data - -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_noti_event(handle, noti_id, on_noti_sat, user_data); -printf("SAT Event registration is Done: sub id is %d, api_err is %d\n",subscription_id,api_err); - -tel_register_app_name("com.samsung.appname"); - -// DEREGISTER EVENT -api_err = tel_deregister_noti_event(handle, noti_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 on_noti_sat(TapiHandle *handle, const char *noti_id, void *data, void *user_data) -{ - //CALL BACK FUNTION TO BE CALLED - switch (noti_id) - { - 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_Cases8_2 Main Menu Information -@ingroup Use_Cases8_SAT -@{ - - -

Main Menu Information

-[Note] Telephony Emulator does not support this feature. - -Telephony provides APIs for retreiving SAT Main Menu Information. - -This API is permitted for Samsung in-house applications only - -@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; - TapiHandle *handle; // Handle given by tel_init() - TelSatSetupMenuInfo_t SatMainMenuInfo; - - ReturnStatus = tel_get_sat_main_menu_info(handle, &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) - -These APIs are permitted for Samsung in-house applications only - -@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 ReturnStatus; - TapiHandle *handle; // Handle given by tel_init() - tapi_response_cb callback; //Initialized call-back function pointer in which response is returned - TelSatMenuSelectionReqInfo_t SatMenuSelect; - void *user_data = NULL; // Set User data - - SatMenuSelect.itemIdentifier = 1; - SatMenuSelect.bIsHelpRequested = FALSE; - - ReturnStatus = tel_select_sat_menu(handle, &SatMenuSelect, on_resp_sat_select_menu, user_data); - 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 on_resp_sat_select_menu(TapiHandle *handle, int result, void *data, void *user_data) -{ - printf("select menu item result(%d)", result); - -} -@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 ReturnStatus; - TapiHandle *handle; // Handle given by tel_init() - tapi_response_cb callback; //Initialized call-back function pointer in which response is returned - TelSatEventDownloadReqInfo_t SatEventData; - void *user_data = NULL; // Set User data - - SatEventData.eventDownloadType = TAPI_EVENT_SAT_DW_TYPE_IDLE_SCREEN_AVAILABLE; - - SatEventData.u.bIdleScreenAvailable = TRUE; - - ReturnStatus = tel_download_sat_event(handle, &SatEventData, on_resp_sat_download_event, user_data); - 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 on_resp_sat_download_event(TapiHandle *handle, int result, void *data, void *user_data) -{ - printf("select menu item result(%d)", result); -} -@endcode -@} -@defgroup Use_Cases8_4 Application Execution result -@ingroup Use_Cases8_SAT -@{ - - -

Application Execution result

-[Note] Telephony Emulator does not support this feature. - -Telephony provides this API to get the Application execution result. - -This API is permitted for Samsung in-house applications only - -@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; - TapiHandle *handle; // Handle given by tel_init() - 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(handle, &SatAppRetInfo); - if (ReturnStatus == TAPI_API_SUCCESS) - { - printf(" Sending Application Execution Result Successful \n"); - } - else - printf("ReturnStatus =%d\n", ReturnStatus); -} -@endcode -@} -@defgroup Use_Cases8_5 UI /User Confirmation -@ingroup Use_Cases8_SAT -@{ - - -

UI /User Confirmation

-[Note] Telephony Emulator does not support this feature. - -Send user's confirmation message to the USIM application - -These APIs are permitted for Samsung in-house applications only - -@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; - TapiHandle *handle; - TelSatUiDisplayStatusType_t DisplatStatus; - int CommandId; - - DisplatStatus = TAPI_SAT_DISPLAY_SUCCESS; - CommandId = commandId; //Command Id of the Proactive Command - - ReturnStatus = tel_send_sat_ui_display_status(handle, 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; - TapiHandle *handle; // Handle given by tel_init() - 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(handle, &UserConfirmData); - if (ReturnStatus == TAPI_API_SUCCESS) - printf(" Sending User Confirmation Data Successful \n"); - else - printf("ReturnStatus =%d\n", ReturnStatus); -} -@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_SIM SIM -* @defgroup Use_Cases7_SOUND SOUND -* @defgroup Use_Cases8_SAT SAT - @} - @} -*/ diff --git a/wearable/include/TapiUtility.h b/wearable/include/TapiUtility.h deleted file mode 100644 index 30af58c..0000000 --- a/wearable/include/TapiUtility.h +++ /dev/null @@ -1,273 +0,0 @@ -/* - * libslp-tapi - * - * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. - * - * Contact: Ja-young Gu - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT 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 TelUtility.h - - @brief This file serves as a "C" header file defines structures for Utility Services. \n - It contains a sample set of constants, enums, structs that would be required by applications. - */ - -#ifndef _TEL_UTILITY_H_ -#define _TEL_UTILITY_H_ - -__BEGIN_DECLS - -#define INVALID_REQUEST_ID -1 /**< Invalid RequestId Value */ -#define DBUS_DEFAULT_PATH "/org/tizen/telephony" - -/** - * @enum TapiResult_t - * Below enumerations are the return codes of TAPI API's - */ -typedef enum { - TAPI_API_SUCCESS = 0, /**= src_len) { \ - memcpy(dest, src, src_len); \ - } \ - else { \ - 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; \ - } \ -} - -__END_DECLS - -#endif //_TEL_UTILITY_H_ -/** - * @} - */ diff --git a/wearable/include/TelCall.h b/wearable/include/TelCall.h deleted file mode 100755 index 7bfbee3..0000000 --- a/wearable/include/TelCall.h +++ /dev/null @@ -1,1039 +0,0 @@ -/* - * libslp-tapi - * - * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. - * - * Contact: Ja-young Gu - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT 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 -#include - -#ifdef __cplusplus -extern "C" { -#endif - -#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 /**< Maximum Dail Number Length */ - -/** - * @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_REJ_SAT_CALL_CTRL, /**< Rejection SAT Call Contorl */ - 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_FIXED_DIALING_NUMBER_ONLY, /**< Fixed Dialing Number Only */ - 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, /**< End unspecified */ - - /* 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_ACTIVE, /**< Call is in connected and conversation state */ - TAPI_CALL_STATE_HELD, /**< Call is in held state */ - TAPI_CALL_STATE_DIALING, /**< Call is in dialing state */ - TAPI_CALL_STATE_ALERT, /**< Call is in alerting state */ - TAPI_CALL_STATE_INCOMING, /**< Call is in incoming state */ - TAPI_CALL_STATE_WAITING, /**< Call is in answered state, and waiting for connected indication event */ - TAPI_CALL_STATE_MAX /**< Call state unknown */ -} 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 { - TAPI_CALL_MT_CLI_PRESENT = 0x31, /**< 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_CNA_PRESENT = 0x32, /**< Calling Name Info presnet,TelCallingNameInfo_t of call info struct contains this info.*/ - TAPI_CALL_MT_SS_UNDEFINED = 0x00, /**< Undefined ss indication. Ignore mt_ss_info*/ - -} 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 TelCallEndType_t - * End type used as in parameter in the end call API. - */ -typedef enum { - TAPI_CALL_END = 0, /**< End Specific Call*/ - TAPI_CALL_END_ALL, /**< End All Calls*/ - TAPI_CALL_END_ACTIVE_ALL, /**< End All Active Calls*/ - TAPI_CALL_END_HOLD_ALL, /**< End All Held Calls*/ -} TelCallEndType_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 TelCallNoCliCause_t - * This enumeration defines the value for "No Cli cause". - */ -typedef enum { - TAPI_CALL_NO_CLI_CAUSE_NONE = -1, /**< None */ - TAPI_CALL_NO_CLI_CAUSE_UNAVAILABLE = 0x00, /**< Unavailable */ - TAPI_CALL_NO_CLI_CAUSE_REJECTBY_USER = 0x01, /**< Rejected by User */ - TAPI_CALL_NO_CLI_CAUSE_INTERACTION_OTHERSERVICES = 0x02, /**< Other services */ - TAPI_CALL_NO_CLI_CAUSE_COINLINE_PAYPHONE = 0x03, /**< Coin line phone */ -} TelCallNoCliCause_t; - -/** - * @enum TelCallCliMode_t - * This enumeration defines the value for "Cli mode". - */ -typedef enum { - TAPI_CALL_PRES_AVAIL, /** */ - TelCallNoCliCause_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. */ - TelCallCliMode_t CliMode; /** */ - TelCallNoCliCause_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 { - TelCallCliMode_t CliMode; /** */ - TelCallNoCliCause_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; - -// New Struct for New API -typedef enum { - TAPI_SOUND_MUTE =0x00, /** - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT 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 - -/* 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; - -#ifdef __cplusplus -} -#endif - -#endif /* _TEL_DEFINES_H_ */ - -/** - * @} - */ diff --git a/wearable/include/TelDisplay.h b/wearable/include/TelDisplay.h deleted file mode 100644 index 82eeda1..0000000 --- a/wearable/include/TelDisplay.h +++ /dev/null @@ -1,200 +0,0 @@ -/* - * libslp-tapi - * - * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. - * - * Contact: Ja-young Gu - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT 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 -#include - -#ifdef __cplusplus -extern "C" { -#endif - -#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 */ - -/** - * 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; - -/** - * 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; - -#ifdef __cplusplus -} -#endif - -#endif /* _TEL_DISPLAY_H_ */ - -/** - * @} - */ diff --git a/wearable/include/TelErr.h b/wearable/include/TelErr.h deleted file mode 100644 index 0b25164..0000000 --- a/wearable/include/TelErr.h +++ /dev/null @@ -1,186 +0,0 @@ -/* - * libslp-tapi - * - * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. - * - * Contact: Ja-young Gu - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT 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_ - -#ifdef __cplusplus -extern "C" -{ -#endif - -/************************************************************ -** 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; - -#ifdef __cplusplus -} -#endif - -#endif // _TEL_ERR_H_ - -/** -* @} -*/ diff --git a/wearable/include/TelGps.h b/wearable/include/TelGps.h deleted file mode 100644 index 53d090e..0000000 --- a/wearable/include/TelGps.h +++ /dev/null @@ -1,140 +0,0 @@ -/* - * libslp-tapi - * - * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. - * - * Contact: Ja-young Gu - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT 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 GPS_TAPI GPS -* @{ -* -* @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_GPS_H_ -#define _TEL_GPS_H_ - -#ifdef __cplusplus -extern "C" -{ -#endif - -#define TAPI_SMART_ASSISTANT_AREA_LIST_MAX 10 /**< Maximum smart assistant area list */ - -/** - * @enum TelSmartAssistantMode_t - * This enumeration defines the smart assistant mode state. - */ -typedef enum { - TAPI_SMART_ASSISTANT_SYNC = 1, - TAPI_SMART_ASSISTANT_DELETE = 2, - TAPI_SMART_ASSISTANT_ADD = 1, - TAPI_SMART_ASSISTANT_MODIFY = 2 -} TelSmartAssistantOperationType_t; - -/** - * @enum TelSmartAssistantMode_t - * This enumeration defines the smart assistant mode state. - */ -typedef enum { - TAPI_SMART_ASSISTANT_MODE_STATE_START = 1, - TAPI_SMART_ASSISTANT_MODE_STATE_STOP -} TelSmartAssistantModeState_t; - -/** - * - * This structure defines the smart assistant area. - */ -typedef struct { - unsigned int index; /**< Smart Assistant area ID */ - TelSmartAssistantModeState_t mode_state; /**< Smart Assistant mode state */ -} TelSmartAssistantArea_t; - -/** - * - * This structure defines the smart assistant area list. - */ -typedef struct { - unsigned int count; /**< Smart Assistant area count */ - TelSmartAssistantArea_t area[TAPI_SMART_ASSISTANT_AREA_LIST_MAX]; -} TelSmartAssistantAreaList_t; - - -/** - * @enum TelSmartAssistantLppState_t - * This enumeration defines the smart assistant mode state. - */ -typedef enum { - TAPI_SMART_ASSISTANT_LPP_STATE_START = 1, - TAPI_SMART_ASSISTANT_LPP_STATE_STOP -} TelSmartAssistantLppState_t; - -/** - * - * This structure defines the smart assistant info. - * AP(Application processor) let the CP(Modem) know the lpp state of Smart Assistant - */ -typedef struct { - unsigned int index; /**< Smart Assistant area ID */ - TelSmartAssistantLppState_t lpp_state; /**< Smart Assistant lpp state */ -} TelSmartAssistantInfo_t; - - -/** - * @enum TelSmartAssistantInitStatus_t - * This enumeration defines the smart assistant init status. - */ -typedef enum { - TAPI_SMART_ASSISTANT_INIT_SUCCESS = 1, - TAPI_SMART_ASSISTANT_INIT_FAIL -} TelSmartAssistantInitStatus_t; - -/** - * @enum TelSmartAssistantAreaStatus_t - * This enumeration defines the smart assistant area status. - */ -typedef enum { - TAPI_SMART_ASSISTANT_AREA_STATUS_IN = 1, - TAPI_SMART_ASSISTANT_AREA_STATUS_OUT -} TelSmartAssistantAreaStatus_t; - - -struct tel_noti_smart_assistant_area_status { - TelSmartAssistantAreaStatus_t area_status; - unsigned int index; /**< Smart Assistant area ID */ -}; - -struct tel_noti_smart_assistant_sync_status { - TelSmartAssistantInitStatus_t init_status; - int init_fail_cause; -}; - - -#ifdef __cplusplus -} -#endif - -#endif // _TEL_GPS_H_ - -/** -* @} -*/ diff --git a/wearable/include/TelMisc.h b/wearable/include/TelMisc.h deleted file mode 100644 index 8e4a8c4..0000000 --- a/wearable/include/TelMisc.h +++ /dev/null @@ -1,349 +0,0 @@ -/* - * libslp-tapi - * - * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. - * - * Contact: Ja-young Gu - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT 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 -#include - -#ifdef __cplusplus -extern "C" { -#endif - -#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 - -/** - * @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; - -/** - * 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; - -#ifdef __cplusplus -} -#endif - -#endif // _TEL_MISC_H_ -/** - * @} - */ diff --git a/wearable/include/TelNetwork.h b/wearable/include/TelNetwork.h deleted file mode 100644 index 8d75ef1..0000000 --- a/wearable/include/TelNetwork.h +++ /dev/null @@ -1,492 +0,0 @@ -/* - * libslp-tapi - * - * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. - * - * Contact: Ja-young Gu - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT 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_ - -#ifdef __cplusplus -extern "C" -{ -#endif - -#define TAPI_NETWORK_ORDER_MAX 5 /**< Maximum network order */ -#define TAPI_NETWORK_LIST_MAX 15 /**< Maximum network list */ -#define TAPI_NETWORK_PLMN_LEN_MAX 6 /**< Maximum PLMN length*/ -#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 */ -#define TAPI_NETWORK_GERAN_NEIGHBORING_CELL_LIST_MAX 6 /**< Maximum GERAN neighboring cell list */ -#define TAPI_NETWORK_UMTS_NEIGHBORING_CELL_LIST_MAX 24 /**< Maximum UMTS neighboring cell list */ - -/* This value defines the network mode */ -#define TAPI_NETWORK_MODE_AUTO 0x00 /**< Set Network mode to AUTOMATIC */ -#define TAPI_NETWORK_MODE_GSM 0x01 /**< Set Network mode to GSM */ -#define TAPI_NETWORK_MODE_WCDMA 0x02 /**< Set Network mode to WCDMA */ -#define TAPI_NETWORK_MODE_CDMA 0x04 /**< Set Network mode to CDMA */ -#define TAPI_NETWORK_MODE_LTE 0x08 /**< Set Network mode to LTE */ - -/** - * @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 */ -} TelNetworkSelectionMode_t; - -/** - * @enum TelNetworkServiceDomain_t - * This enumeration defines the network service domains . - */ -typedef enum { - TAPI_NETWORK_SERVICE_DOMAIN_COMBINED, /**< This member sets the Circuit switch and Packet Switch domain */ - TAPI_NETWORK_SERVICE_DOMAIN_PS, /**< This member sets the Packet Switch service domain */ - TAPI_NETWORK_SERVICE_DOMAIN_CS, /**< This member sets the Circuit Switch service domain */ - TAPI_NETWORK_SERVICE_DOMAIN_AUTOMATIC /**< This member sets the service domain to Circuit Switch and Packet Switch or Circuit Switch or Packet Switch domain */ -} TelNetworkServiceDomain_t; - -/** - * @enum TelNetworkServiceLevel_t - * This enumeration defines the status of network service. - */ -typedef enum { - TAPI_NETWORK_SERVICE_LEVEL_NO, /**< No service available in the network ME is camped */ - TAPI_NETWORK_SERVICE_LEVEL_EMERGENCY, /**< Only emergency service available in the network ME is camped */ - TAPI_NETWORK_SERVICE_LEVEL_FULL, /**< FULL service available in the network ME is camped */ - TAPI_NETWORK_SERVICE_LEVEL_SEARCH /**< Searching for service */ -} TelNetworkServiceLevel_t; - -/** - * @enum TelNetworkServiceLevel_t - * This enumeration defines the service types of TAPI. - */ -typedef enum { - TAPI_NETWORK_SERVICE_TYPE_UNKNOWN = 0x0, /**< Service type is Unknown */ - TAPI_NETWORK_SERVICE_TYPE_NO_SERVICE, /**< No Service available */ - TAPI_NETWORK_SERVICE_TYPE_EMERGENCY, /**< Service type is Emergency */ - TAPI_NETWORK_SERVICE_TYPE_SEARCH, /**< Service type is Serching */ - TAPI_NETWORK_SERVICE_TYPE_2G, /**< Service type is 2G */ - TAPI_NETWORK_SERVICE_TYPE_2_5G, /**< Service type is 2.5G */ - TAPI_NETWORK_SERVICE_TYPE_2_5G_EDGE, /**< Service type is 2.5G (EDGE) */ - TAPI_NETWORK_SERVICE_TYPE_3G, /**< Service type is 3G */ - TAPI_NETWORK_SERVICE_TYPE_HSDPA, /**< Service type is HSDPA */ - TAPI_NETWORK_SERVICE_TYPE_LTE /**< Service type is LTE */ -} TelNetworkServiceType_t; - -/** - * @enum TelNetworkSystemType_t - * This enumeration defines the system types of TAPI. - */ -typedef enum -{ - TAPI_NETWORK_SYSTEM_NO_SRV, /**< No Service available */ - TAPI_NETWORK_SYSTEM_GSM, /**< Available service is GSM */ - TAPI_NETWORK_SYSTEM_GPRS, /**< Available service is GPRS */ - TAPI_NETWORK_SYSTEM_EGPRS, /**< Available service is EGPRS */ - TAPI_NETWORK_SYSTEM_PCS1900, /**< Available service is PCS1900 band */ - TAPI_NETWORK_SYSTEM_UMTS, /**< Available service is UMTS */ - TAPI_NETWORK_SYSTEM_GSM_AND_UMTS, /**< Both GSM and UMTS systems available */ - TAPI_NETWORK_SYSTEM_HSDPA, /**< Available service is hsdpa */ - TAPI_NETWORK_SYSTEM_IS95A, /**< Available service is IS95A */ - TAPI_NETWORK_SYSTEM_IS95B, /**< Available service is IS95B */ - TAPI_NETWORK_SYSTEM_CDMA_1X, /**< Available service is CDMA 1X */ - TAPI_NETWORK_SYSTEM_EVDO_REV_0, /**< Available service is EV-DO rev0 */ - TAPI_NETWORK_SYSTEM_1X_EVDO_REV_0_HYBRID, /**< Available service is 1X and EV-DO rev0 */ - TAPI_NETWORK_SYSTEM_EVDO_REV_A, /**< Available service is EV-DO revA */ - TAPI_NETWORK_SYSTEM_1X_EVDO_REV_A_HYBRID, /**< Available service is 1X and EV-DO revA */ - TAPI_NETWORK_SYSTEM_EVDV, /**< Available service is EV-DV */ - TAPI_NETWORK_SYSTEM_LTE /**< Available service is LTE */ -} TelNetworkSystemType_t; - -/** - * @enum TelNetworkBandPreferred_t - * This enumeration defines the operations that can be done on network Band. - */ -typedef enum -{ - TAPI_NETWORK_BAND_MODE_PREFERRED = 0x01, /**< Preferred band. (If preferred Band is not available, then underlying modem can search on other bands) */ - TAPI_NETWORK_BAND_MODE_ONLY = 0x02, /**< This allows only particular band. */ -} TelNetworkBandPreferred_t; - -/** - * @enum TelNetworkBand_t - * This enumeration defines different network Bands. - */ -typedef enum -{ - TAPI_NETWORK_BAND_TYPE_ANY = 0x00, /**< All bands can be tried. */ - TAPI_NETWORK_BAND_TYPE_GSM850, /**< This member sets the band to GSM 850 */ - TAPI_NETWORK_BAND_TYPE_GSM_900_1800, /**< This member sets the band to GSM 900_1800 */ - TAPI_NETWORK_BAND_TYPE_GSM1900, /**< GSM 1900*/ - TAPI_NETWORK_BAND_TYPE_GSM, /**< This member sets all GSM bands */ - TAPI_NETWORK_BAND_TYPE_WCDMA, /**< This member sets all WCDMA bands */ - TAPI_NETWORK_BAND_TYPE_WCDMA850, /**< This member sets the band to WCDMA 850 */ - TAPI_NETWORK_BAND_TYPE_WCDMA1900, /**< This member sets the band to WCDMA 1900 */ - TAPI_NETWORK_BAND_TYPE_WCDMA2100, /**< This member sets the band to WCDMA 2100 */ - TAPI_NETWORK_BAND_TYPE_GSM900, /**< GSM 900*/ - TAPI_NETWORK_BAND_TYPE_GSM1800, /**< This member sets the band to GSM 1800 */ - TAPI_NETWORK_BAND_TYPE_GSM_850_1900, /**< This member sets the band to GSM 850_1900 */ - TAPI_NETWORK_BAND_TYPE_LTE_BAND_4, /**< This member sets the band to LTE BAND 4*/ - TAPI_NETWORK_BAND_TYPE_LTE_BAND_17 /**< This member sets the band to LTE BAND 17 */ -} TelNetworkBand_t; - -/** - * @enum TelNetworkOperationCause_t - * This enumeration defines different network operation cause. - */ -typedef enum -{ - TAPI_NETWORK_NO_ERR = 0x00, /**< There is no error for any network operation. */ - TAPI_NETWORK_OPERATION_ABORTED, /**< This error is sent when operation is aborted */ - TAPI_NETWORK_OPERATION_FAILED, /**< There is an error for any network operation. */ - TAPI_NETWORK_PHONE_IN_USE_ERR, /**< This error will be returned when any network operation is tried while phone is in use(eg, Voice / Data call in progress due to which network operation failed) */ - TAPI_NETWORK_OFFLINE_ERR, /**< This error is sent when any network option is tried when phone is in offline mode */ - TAPI_NETWORK_CONFIG_SETTINGS_FAILURE_ERR, /**< This error is sent when modem is unable to process the config settings information. */ - TAPI_NETWORK_INTERNAL_FAILURE_ERR, /**< This error to indicate internal failure */ - TAPI_NETWORK_MEMORY_FULL_ERR /**< This error is caused by memory full */ -} TelNetworkOperationCause_t; - - -/** - * @enum TelNetworkPreferredPlmnOp_t - * This enumeration defines the operation that can be done on preferred PLMN. - */ -typedef enum -{ - TAPI_NETWORK_PREF_PLMN_ADD=0x01, /**< Addition to Network Preferred Plmn list*/ - TAPI_NETWORK_PREF_PLMN_EDIT, /**< Edit the network Preferred Plmn list */ - TAPI_NETWORK_PREF_PLMN_DELETE /**< Delete the entry to network Preferred Plmn list*/ -} TelNetworkPreferredPlmnOp_t; - -/** - * @enum TelNetworkPlmnType_t - * This structure defines Network Plmn type. - */ -typedef enum -{ - TAPI_UNKNOWN_PLMN=0, /**< Network Plmn type Unknown */ - TAPI_HOME_PLMN , /**< Network Plmn type Home Plmn */ - TAPI_AVAILABLE_PLMN, /**< Network Plmn Available */ - TAPI_FORBIDDEN_PLMN, /**< Network Plmn Forbidden */ -}TelNetworkPlmnType_t; - -/** - * @enum TelNetworkHomeZoneCommand_t - * This enumeration defines network home zone command. - */ -typedef enum -{ - TAPI_NETWORK_ZONEINFO_NONE, /**< Network Zone info none */ - TAPI_NETWORK_ZONEINFO_IND, /**< Network Zone info indication */ - TAPI_NETWORK_ZONEINFO_CLEAR /**< Network Zone info clear */ -}TelNetworkHomeZoneCommand_t; - -/** - * @enum TelNetworkHomeZone_t - * This enumeration defines network home zone type. - */ -typedef enum -{ - TAPI_NETWORK_ZONE_NONE, /**< Network Zone Type none */ - TAPI_NETWORK_ZONETYPE_HOMEZONE, /**< Network Zone Type Home zone */ - TAPI_NETWORK_ZONETYPE_CITYZONE, /**< Network Zone Type City zone */ -}TelNetworkHomeZone_t; - -/** - * @enum TelNetworkNameDispCondition_t - * This enumeration defines network name display condition type. - */ -typedef enum -{ - TAPI_NETWORK_DISP_INVALID= 0x00, /**< Invalid Display Condition */ - TAPI_NETWORK_DISP_SPN = 0x01, /**< Display Condition is SPN */ - TAPI_NETWORK_DISP_PLMN = 0x02, /**< Display Condition is PLMN */ - TAPI_NETWORK_DISP_SPN_PLMN = 0x03, /**< Display Condition is SPN or PLMN */ -}TelNetworkNameDispCondition_t; - -/** - * @enum TelNetworkPrefNetType_t - * This enumeration defines CDMA Preferred Network Type(CDMA only). - */ -typedef enum -{ - TAPI_NETWORK_PREF_NET_TYPE_AUTOMATIC = 0x01, /**< 0x01 : AUTOMATIC */ - TAPI_NETWORK_PREF_NET_TYPE_AUTOMATIC_A, /**< 0x02 : AUTOMATIC A */ - TAPI_NETWORK_PREF_NET_TYPE_AUTOMATIC_B, /**< 0x03 : AUTOMATIC B */ - TAPI_NETWORK_PREF_NET_TYPE_HOME_ONLY, /**< 0x04 : HOME ONLY */ - TAPI_NETWORK_PREF_NET_TYPE_ROAM_ONLY, /**< 0x05 : ROAM ONLY */ -} TelNetworkPrefNetType_t; - -/** - * @enum TelNetworkPrlPrefOnly_t - * This enumeration defines CDMA PRL Preferred Only field stored in the PRL(CDMA only). - */ -typedef enum -{ - TAPI_NETWORK_PRL_PREF_ONLY_OFF, /**< Preferred Only is FALSE */ - TAPI_NETWORK_PRL_PREF_ONLY_ON, /**< Preferred Only is TRUE */ - TAPI_NETWORK_PRL_PREF_ONLY_NONE /**< There isn't Preferred Only Option */ -} TelNetworkPrlPrefOnly_t; - -/** - * - * This structure defines the preferred plmn information. - */ -typedef struct { - unsigned char Index; /**< Network Preferred Plmn list index */ - char Plmn[TAPI_NETWORK_PLMN_LEN_MAX + 1]; /**< Network Preferred Plmn */ - char network_name[TAPI_NETWORK_NAME_LEN_MAX + 1]; /**< Network Name */ - char service_provider_name[TAPI_NETWORK_NAME_LEN_MAX + 1]; /**< Service provider name */ - TelNetworkSystemType_t SystemType; /**< Network system type */ -} TelNetworkPreferredPlmnInfo_t; - -/** - * - * This structure defines the preferred plmn list. - */ -typedef struct { - unsigned int NumOfPrefPlmns; /**< Number of preferred plmns in the list */ - TelNetworkPreferredPlmnInfo_t PrefPlmnRecord[TAPI_PREFERRED_PLMN_RECORDS_MAX]; /**< preferred plmns list */ -} TelNetworkPreferredPlmnList_t; - -/** - * - * This structure defines the location area code and cell id. - */ -typedef struct { - unsigned short LocationAreaCode; /**< Network Location area code */ - unsigned long CellId; /**< Network Cell Id */ -} TelNetworkLocationCellInfo_t; - -/** - * - * This structure defines the network status . - */ -typedef struct { - unsigned char svctype; /**< Network svc type */ - unsigned char roaming; /**< Network roaming */ -} TelNetworkStatus_t; - -/** - * - * This structure defines the network Cs,Ps status. - */ -typedef struct { - unsigned char cstype; /**< Network Cs type */ - unsigned char pstype; /**< Network Ps type */ -} TelNetworkCsPsStatus_t; - -/** - * TelNetworkIdentity_t - * This structure defines the network identity. - */ -typedef struct { - char network_name[TAPI_NETWORK_NAME_LEN_MAX + 1]; /**< Network Name */ - char service_provider_name[TAPI_NETWORK_NAME_LEN_MAX + 1]; /**< Service provider name */ - char plmn[TAPI_NETWORK_PLMN_LEN_MAX+1]; /**< Network PLMN */ - unsigned int plmn_id; /**< PLMN ID */ - TelNetworkPlmnType_t type_of_plmn; /**< PLMN type */ - TelNetworkSystemType_t access_technology; /**< Access technology */ -} TelNetworkIdentity_t; - -/** - * - * This structure defines the network Plmn list. - */ -typedef struct { - char networks_count; /**< Network Plmn count */ - TelNetworkIdentity_t network_list[TAPI_NETWORK_LIST_MAX]; /**< Network list */ -} TelNetworkPlmnList_t; - -/** - * - * This structure defines the network display info. - */ -typedef struct { - int DisplayInfo[TAPI_NETWORK_DISPLAY_INFO_ELEMENTS]; /**< Network display info */ -} TelNetworkDisplayInfo_t; - -typedef struct { - TelNetworkNameDispCondition_t DispCondition; /**< Display condition of SPN & PLMN */ - unsigned char Spn[TAPI_NETWORK_SPN_LEN_MAX + 1]; /**< Spn value */ - unsigned char Plmn[TAPI_NETWORK_NAME_LEN_MAX + 1]; /**< PLMN value, In 2G case if DispPlmn is true and the PLMN value is null then Network module has to display registered PLMN */ -} TelNetworkSpnPlmnDisplayInfo_t; - -/** - * * @struct TelNetworkSpnMccMncInfo_t - * This structure defines the network Spn, Mcc and Mnc info. - */ -typedef struct { - int mcc; /**< Network mcc */ - int mnc; /**< Network Mnc */ - char bDispCondition; /** - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT 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 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 - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * 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_ON = 0, TAPI_PHONE_POWER_STATUS_OFF, TAPI_PHONE_POWER_STATUS_ERROR, -} 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; - -#ifdef __cplusplus -} -#endif - -#endif /* _TEL_POWER_H_ */ - -/** - * @} - */ diff --git a/wearable/include/TelSat.h b/wearable/include/TelSat.h deleted file mode 100644 index 169e452..0000000 --- a/wearable/include/TelSat.h +++ /dev/null @@ -1,719 +0,0 @@ -/* - * libslp-tapi - * - * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. - * - * Contact: Ja-young Gu - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT 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 -#include -#include -#include -#include -#include -#include - -#ifdef __cplusplus -extern "C" -{ -#endif - -#define TAPI_SAT_DEF_TITLE_LEN_MAX 255 /**< 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 - -// 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 - -#ifdef __cplusplus -extern "C" -{ -#endif - -/** - * @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; - -// 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; - -#ifdef __cplusplus -} -#endif - -#endif /* _TEL_SAT_ENVELOPE_H_ */ - -/** - * @} - */ diff --git a/wearable/include/TelSatObj.h b/wearable/include/TelSatObj.h deleted file mode 100644 index e16536a..0000000 --- a/wearable/include/TelSatObj.h +++ /dev/null @@ -1,1399 +0,0 @@ -/* - * libslp-tapi - * - * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. - * - * Contact: Ja-young Gu - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT 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 -#include - -#ifdef __cplusplus -extern "C" -{ -#endif - -#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 255 /**< 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 */ - -/** - * @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; - -/** - * 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 - -#ifdef __cplusplus -extern "C" -{ -#endif - -#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 */ - -/** - * 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; - -#ifdef __cplusplus -} -#endif - -#endif /* _TEL_SAT_PROACTV_CMD_H_ */ - -/** - * @} - */ diff --git a/wearable/include/TelSim.h b/wearable/include/TelSim.h deleted file mode 100644 index 454ee60..0000000 --- a/wearable/include/TelSim.h +++ /dev/null @@ -1,1456 +0,0 @@ -/* - * libslp-tapi - * - * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. - * - * Contact: Ja-young Gu - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT 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 - -#ifdef __cplusplus -extern "C" -{ -#endif - -/** Maximum ICCID Length */ -#define TAPI_SIM_ICCID_LEN_MAX 20 - -/** 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 - -/** MSISDN number max length */ -#define TAPI_SIM_MSISDN_DIALING_NUMBER_LEN 26 - -/** CSP profile entry count max length */ -#define TAPI_SIM_CPHS_CUSTOMER_SERVICE_PROFILE_ENTRY_COUNT_MAX 11 - -/** Authentication code max length */ -#define TAPI_SIM_AUTH_MAX_REQ_DATA_LEN 256 - -/** Authentication response data max length */ -#define TAPI_SIM_AUTH_MAX_RESP_DATA_LEN 128 - -/** SAP APDU max length */ -/** 2048 is for QMI definition. (1024 : general length, 1024 : extra length for additional response) */ -#define TAPI_SIM_APDU_MAX_LEN 2048 - -/** SIM 3G Phone book EF Max count */ -#define TAPI_SIM_PB_3G_FILE_MAX_COUNT 13 - -/** SIM Phone book Record name max length */ -#define TAPI_SIM_PB_RECORD_NAME_MAX_LEN 255 - -/** SIM Phone book Record number max length */ -#define TAPI_SIM_PB_RECORD_NUMBER_MAX_LEN 255 - -/** SIM Phone book Record email max length */ -#define TAPI_SIM_PB_RECORD_EMAIL_MAX_LEN 255 - -/** SAP Answer to Reset data max length */ -#define TAPI_SIM_SAP_ATR_DATA 256 - -#define TAPI_SIM_NET_FULL_NAME_MAX_LEN 40 - -#define TAPI_SIM_NET_SHORT_NAME_MAX_LEN 10 - -#define TAPI_SIM_MSP_CNT_MAX 2 - -#define TAPI_SIM_OPERATION_TIMEOUT 1234 - -#define TAPI_SIM_SST_SERVICE_CNT_MAX 56 - -#define TAPI_SIM_UST_SERVICE_CNT_MAX 64 - -/** - * @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 */ - TAPI_SIM_CARD_TYPE_RUIM, - TAPI_SIM_CARD_TYPE_IMS, -} TelSimCardType_t; - -/** - * @enum TelSimFileID_t - * This enumeration defines the card type. - */ -typedef enum { - TAPI_SIM_EF_DIR = 0x2F00, /**< Root Directory for the USIM */ - TAPI_SIM_EF_ICCID = 0x2FE2, /**< the ICC Identification file */ - TAPI_SIM_EF_IMSI = 0x6F07, /**< the IMSI file */ - TAPI_SIM_EF_SST = 0x6F38, /**< the SIM Service Table file */ - TAPI_SIM_EF_EST = 0x6F56, /**< the Enabled Service Table file */ - TAPI_SIM_EF_OPLMN_ACT = 0x6F61, /**< the OPLMN List file*/ - TAPI_SIM_EF_GID1 = 0x6F3E, /**< the Group Identifier Level 1 */ - TAPI_SIM_EF_GID2 = 0x6F3F, /**< the Group Identifier Level 2 */ - - TAPI_SIM_EF_ELP = 0x2F05, /**< the Extended Language Preference file */ - TAPI_SIM_EF_LP = 0x6F05, /**< SIM: Language preference */ - TAPI_SIM_EF_ECC = 0x6FB7, /**< the Emergency Call Codes */ - TAPI_SIM_EF_SPN = 0x6F46, /**< the Service Provider Name */ - TAPI_SIM_EF_SPDI = 0x6FCD, /**< the Service provider display information*/ - TAPI_SIM_EF_PNN = 0x6FC5, /**< the PLMN Network Name File*/ - TAPI_SIM_EF_OPL = 0x6FC6, /**< the Operator PLMN List File*/ - TAPI_SIM_EF_MSISDN = 0x6F40, /**< MSISDN */ - - TAPI_SIM_EF_SMS = 0x6F3C, /** < Short Messages file */ - TAPI_SIM_EF_SMSP = 0x6F42, /** < SMS Parameter */ - TAPI_SIM_EF_SMSS = 0x6F43, /** < SMS Status */ - TAPI_SIM_EF_CBMI = 0x6F45, /** < Cell Broadcast Message Identifier */ - TAPI_SIM_EF_MBDN = 0x6FC7, /** < SIM Mail Box Dialing Number file */ - - TAPI_SIM_EF_USIM_MBI = 0x6FC9, /** < Mailbox Identifier -linear fixed*/ - TAPI_SIM_EF_USIM_MWIS = 0x6FCA, /** < Message Waiting Indication Status -linear fixed*/ - TAPI_SIM_EF_USIM_CFIS = 0x6FCB, /** < Call forward indication status -linear fixed*/ - - /* CPHS FILE ID */ - TAPI_SIM_EF_CPHS_VOICE_MSG_WAITING = 0x6F11, /** < CPHS voice MSG waiting indication */ - TAPI_SIM_EF_CPHS_SERVICE_STRING_TABLE = 0x6F12, /** < CPHS service string table */ - TAPI_SIM_EF_CPHS_CALL_FORWARD_FLAGS = 0x6F13, /** < CPHS call forward flags */ - TAPI_SIM_EF_CPHS_OPERATOR_NAME_STRING = 0x6F14, /** < CPHS operator name string */ - TAPI_SIM_EF_CPHS_CUSTOMER_SERVICE_PROFILE = 0x6F15, /** < CPHS customer service profile */ - TAPI_SIM_EF_CPHS_CPHS_INFO = 0x6F16, /** < CPHS information */ - TAPI_SIM_EF_CPHS_MAILBOX_NUMBERS = 0x6F17, /** < CPHS mail box numbers */ - TAPI_SIM_EF_CPHS_OPERATOR_NAME_SHORT_FORM_STRING = 0x6F18, /** < CPHS operator name short form string */ - TAPI_SIM_EF_CPHS_INFORMATION_NUMBERS = 0x6F19, /** < CPHS information numbers */ - /* CPHS ALS FILE ID */ - TAPI_SIM_EF_CPHS_DYNAMICFLAGS = 0x6F9F, /** < CPHS Dynamics flags */ - TAPI_SIM_EF_CPHS_DYNAMIC2FLAG = 0x6F92, /** < CPHS Dynamics2 flags */ - TAPI_SIM_EF_CPHS_CUSTOMER_SERVICE_PROFILE_LINE2 = 0x6F98, /** < CPHS CSP2 */ - - /* Invalid File ID, All the file ID are less than this Value*/ - TAPI_SIM_EF_INVALID = 0xFFFF, /**< Invalid file.*/ - TAPI_SIM_EF_OTHERS, /**< Element to indicate an unknown file.*/ -}TelSimFileID_t; - -/** - * @enum TelSimFacilityStatus_t - * This enumeration defines the pin status. - */ -typedef enum { - TAPI_SIM_FACILITY_DISABLED = 0x00, - TAPI_SIM_FACILITY_ENABLED = 0x01, - TAPI_SIM_FACILITY_UNKNOWN = 0xFF -} TelSimFacilityStatus_t; - -/** - * @enum TelSimPinOperationResult_t - * This enumeration defines the pin operation result from the lower layers. - */ -typedef enum { - TAPI_SIM_PIN_OPERATION_SUCCESS, /**< Operation involving PIN (verification/change/enable/disable, etc) is successful. */ - TAPI_SIM_BUSY, /**< SIM is busy */ - TAPI_SIM_CARD_ERROR, /**< SIM card error - General errors */ - TAPI_SIM_INCOMPATIBLE_PIN_OPERATION, /**< SIM Incompatible pin operation that is in case when invalid SIM command is given or incorrect parameters are supplied to the SIM. */ - TAPI_SIM_PIN_INCORRECT_PASSWORD, /**< SIM PIN Incorrect password */ - TAPI_SIM_PUK_INCORRECT_PASSWORD, /**< SIM PUK Incorrect Password */ - TAPI_SIM_PUK_REQUIRED, /**< PUK Required */ - TAPI_SIM_PIN_REQUIRED, /**< PIN Required */ - TAPI_SIM_NCK_REQUIRED, /**< Network Control Key Required */ - TAPI_SIM_NSCK_REQUIRED, /**< Network Subset Control Key Required */ - TAPI_SIM_SPCK_REQUIRED, /**< Service Provider Control Key Required */ - TAPI_SIM_CCK_REQUIRED, /**< Corporate Control Key Required */ - TAPI_SIM_LOCK_REQUIRED, /**< PH-SIM (phone-SIM) locked state **/ - TAPI_SIM_PERM_BLOCKED /**< Permanently Blocked **/ -} TelSimPinOperationResult_t; - -/** - * @enum TelSimAccessResult_t - * This enumeration defines the SIM access result from the lower layers. - */ -typedef enum { - TAPI_SIM_ACCESS_SUCCESS, /**< Access to file successful. */ - TAPI_SIM_ACCESS_CARD_ERROR, /**< SIM card error */ - TAPI_SIM_ACCESS_FILE_NOT_FOUND, /**< File not found */ - TAPI_SIM_ACCESS_ACCESS_CONDITION_NOT_SATISFIED, /**< Access condition is not fulfilled */ - TAPI_SIM_ACCESS_FAILED, /**< Access failed. */ -} TelSimAccessResult_t; - -/** - * @enum TelSimPinType_t - * This enumeration defines the pin type. - */ -typedef enum { - TAPI_SIM_PTYPE_PIN1 = 0x00, /**< PIN 1 code */ - TAPI_SIM_PTYPE_PIN2 = 0x01, /**< PIN 2 code */ - TAPI_SIM_PTYPE_PUK1 = 0x02, /**< PUK 1 code */ - TAPI_SIM_PTYPE_PUK2 = 0x03, /**< PUK 2 code */ - TAPI_SIM_PTYPE_UPIN = 0x04, /**< Universal PIN - Unused now */ - TAPI_SIM_PTYPE_ADM = 0x05, /**< Administrator - Unused now */ - TAPI_SIM_PTYPE_SIM = 0x06 /**< SIM Lock code */ -} TelSimPinType_t; - -/** - * @enum TelSimTypeOfNum_t - * This enumeration defines the type of number. - */ -typedef enum { - TAPI_SIM_TON_UNKNOWN = 0, /**< unknown */ - TAPI_SIM_TON_INTERNATIONAL = 1, /**< international number */ - TAPI_SIM_TON_NATIONAL = 2, /**< national number */ - TAPI_SIM_TON_NETWORK_SPECIFIC = 3, /**< network specific number */ - TAPI_SIM_TON_DEDICATED_ACCESS = 4, /**< subscriber number */ - TAPI_SIM_TON_ALPHA_NUMERIC = 5, /**< alphanumeric, GSM 7-bit default alphabet) */ - TAPI_SIM_TON_ABBREVIATED_NUMBER = 6, /**< abbreviated number */ - TAPI_SIM_TON_RESERVED_FOR_EXT = 7 /**< reserved for extension */ -} TelSimTypeOfNum_t; - -/** - * @enum TelSimTextEncrypt_t - * This enumeration defines the text encryption types - */ -typedef enum { - TAPI_SIM_TEXT_ENC_ASCII, /**< ASCII Encoding */ - TAPI_SIM_TEXT_ENC_GSM7BIT, /**< GSM 7 Bit Encoding */ - TAPI_SIM_TEXT_ENC_UCS2, /**< UCS2 Encoding */ - TAPI_SIM_TEXT_ENC_HEX, /**< HEX Encoding */ -} TelSimTextEncrypt_t; - -/** - * @enum TelSimNumberingPlanIdentity_t - * This enumeration defines the numbering plan identifier. - */ -typedef enum { - TAPI_SIM_NPI_UNKNOWN = 0, /**< Unknown */ - TAPI_SIM_NPI_ISDN_TEL = 1, /**< ISDN/Telephone numbering plan */ - TAPI_SIM_NPI_DATA_NUMBERING_PLAN = 3, /**< Data numbering plan */ - TAPI_SIM_NPI_TELEX = 4, /**< Telex numbering plan */ - TAPI_SIM_NPI_SVC_CNTR_SPECIFIC_PLAN = 5, /**< Service Center Specific plan */ - TAPI_SIM_NPI_SVC_CNTR_SPECIFIC_PLAN2 = 6, /**< Service Center Specific plan */ - TAPI_SIM_NPI_NATIONAL = 8, /**< National numbering plan */ - TAPI_SIM_NPI_PRIVATE = 9, /**< Private numbering plan */ - TAPI_SIM_NPI_ERMES_NUMBERING_PLAN = 10, /**< ERMES numbering plan */ - TAPI_SIM_NPI_RESERVED_FOR_EXT = 0xF /**< Reserved for extension */ -} TelSimNumberingPlanIdentity_t; - -/** - * @enum TelSimEccEmergencyServiceInfo_t - * This enumeration defines the emergency service type. - */ -typedef enum { - TAPI_SIM_ECC_ESC_POLICE = 0x01, /**< Police */ - TAPI_SIM_ECC_ESC_AMBULANCE = 0x02, /**< Ambulance */ - TAPI_SIM_ECC_ESC_FIREBRIGADE = 0x04, /**< Fire brigade */ - TAPI_SIM_ECC_ESC_MARAINEGUARD = 0x08, /**< Marine guard */ - TAPI_SIM_ECC_ESC_MOUTAINRESCUE = 0x10, /**< Mountain rescue */ - TAPI_SIM_ECC_ESC_SPARE = 0x00 /**< Spare */ -} TelSimEccEmergencyServiceInfo_t; - -/** - * @enum TelSimLanguagePreferenceCode_t - * This enumeration defines the language indication code. - */ -typedef enum { - TAPI_SIM_LP_GERMAN = 0x00, /**< German */ - TAPI_SIM_LP_ENGLISH = 0x01, /**< English */ - TAPI_SIM_LP_ITALIAN = 0x02, /**< Italian */ - TAPI_SIM_LP_FRENCH = 0x03, /**< French */ - TAPI_SIM_LP_SPANISH = 0x04, /**< Spanish */ - TAPI_SIM_LP_DUTCH = 0x05, /**< Dutch */ - TAPI_SIM_LP_SWEDISH = 0x06, /**< Swedish */ - TAPI_SIM_LP_DANISH = 0x07, /**< Danish */ - TAPI_SIM_LP_PORTUGUESE = 0x08, /**< Portuguese */ - TAPI_SIM_LP_FINNISH = 0x09, /**< Finnish */ - TAPI_SIM_LP_NORWEGIAN = 0x0A, /**< Norwegian */ - TAPI_SIM_LP_GREEK = 0x0B, /**< Greek */ - TAPI_SIM_LP_TURKISH = 0x0C, /**< Turkish */ - TAPI_SIM_LP_HUNGARIAN = 0x0D, /**< Hungarian */ - TAPI_SIM_LP_POLISH = 0x0E, /**< Polish */ - TAPI_SIM_LP_KOREAN = 0x0F, /**< Korean */ - TAPI_SIM_LP_CHINESE = 0x10, /**< Chinese */ - TAPI_SIM_LP_RUSSIAN = 0x11, /**< Russian */ - TAPI_SIM_LP_JAPANESE = 0x12, /**< Japanese */ - TAPI_SIM_LP_LANG_UNSPECIFIED = 0xFF /**< Unspecified */ -} TelSimLanguagePreferenceCode_t; - -/** - * @enum TelSimCardStatus_t - * This enumeration defines the SIM card status - */ -typedef enum { - TAPI_SIM_STATUS_CARD_ERROR = 0x00, /**< Bad card / On the fly SIM gone bad **/ - TAPI_SIM_STATUS_CARD_NOT_PRESENT = 0x01, /**< Card not present **/ - TAPI_SIM_STATUS_SIM_INITIALIZING = 0x02, /**< SIM is Initializing state **/ - TAPI_SIM_STATUS_SIM_INIT_COMPLETED = 0x03, /**< SIM Initialization ok **/ - TAPI_SIM_STATUS_SIM_PIN_REQUIRED = 0x04, /**< PIN required state **/ - TAPI_SIM_STATUS_SIM_PUK_REQUIRED = 0x05, /**< PUK required state **/ - TAPI_SIM_STATUS_CARD_BLOCKED = 0x06, /**< PIN/PUK blocked(permanently blocked- All the attempts for PIN/PUK failed) **/ - TAPI_SIM_STATUS_SIM_NCK_REQUIRED = 0x07, /**< Network Control Key required state **/ - TAPI_SIM_STATUS_SIM_NSCK_REQUIRED = 0x08, /**< Network Subset Control Key required state **/ - TAPI_SIM_STATUS_SIM_SPCK_REQUIRED = 0x09, /**< Service Provider Control Key required state **/ - TAPI_SIM_STATUS_SIM_CCK_REQUIRED = 0x0a, /**< Corporate Control Key required state **/ - TAPI_SIM_STATUS_CARD_REMOVED = 0x0b, /**< Card removed **/ - TAPI_SIM_STATUS_SIM_LOCK_REQUIRED = 0x0c, /**< PH-SIM (phone-SIM) locked state **/ - TAPI_SIM_STATUS_CARD_CRASHED = 0x0d, /**< Runtime SIM card error **/ - TAPI_SIM_STATUS_UNKNOWN = 0xff /**< Unknown status. It can be initial status **/ -} TelSimCardStatus_t; - -/** - * @struct TelSimInitInfo_t - * This struct has informations that card_status and whether it is changed. - */ -typedef struct { - TelSimCardStatus_t card_status; - unsigned char b_is_changed; -} TelSimInitInfo_t; - -/** - * @enum TelSimCphsPhaseType_t - * This enum gives the current CPHS phase of SIM card. - */ -typedef enum { - TAPI_SIM_CPHS_PHASE1 = 0x01, /**< phase1 */ - TAPI_SIM_CPHS_PHASE2 = 0x02, /**< phase2 */ - TAPI_SIM_CPHS_PHASE_RFU = 0xff /**< RFU */ -} TelSimCphsPhaseType_t; - -/** - * @enum TelSimCphsIndexLevelIndicator_t - * This struct gives CPHS index level indication. - */ -typedef enum { - TAPI_SIM_CPHS_INDEX_LEVEL_ONE = 0x01, /**< SIM cphs index level one */ - TAPI_SIM_CPHS_INDEX_LEVEL_TWO = 0x02, /**< SIM cphs index level two */ - TAPI_SIM_CPHS_INDEX_LEVEL_THREE = 0x03, /**< SIM cphs index level three */ - TAPI_SIM_CPHS_INDEX_LEVEL_RFU = 0xff /**< SIM cphs index level rfu */ -} TelSimCphsIndexLevelIndicator_t; - -/** - * @enum TelSimCphsCustomerServiceGroup_t - * This struct gives CPHS group service type information . - */ -typedef enum { - TAPI_SIM_CPHS_CSP_SERVICE_GROUP_CALL_OFFERING = 0x01, /**< Group csp offering*/ - TAPI_SIM_CPHS_CSP_SERVICE_GROUP_CALL_RESTRICTION = 0x02, /**< Group csp restriction*/ - TAPI_SIM_CPHS_CSP_SERVICE_GROUP_OTHER_SUPP_SERVICES = 0x03, /**< Group csp supplementary services*/ - TAPI_SIM_CPHS_CSP_SERVICE_GROUP_CALL_COMPLETION = 0x04, /**< Group csp completion*/ - TAPI_SIM_CPHS_CSP_SERVICE_GROUP_TELESERVICES = 0x05, /**< Group csp teleservices*/ - TAPI_SIM_CPHS_CSP_SERVICE_GROUP_CPHS_TELESERVICES = 0x06, /**< Group csp cphs teleservies*/ - TAPI_SIM_CPHS_CSP_SERVICE_GROUP_CPHS_FEATURES = 0x07, /**< Group csp cphs features*/ - TAPI_SIM_CPHS_CSP_SERVICE_GROUP_NUMBER_IDENTIFIERS = 0x08, /**< Group csp number identifiers*/ - TAPI_SIM_CPHS_CSP_SERVICE_GROUP_PHASE_SERVICES = 0x09, /**< Group csp phase services*/ - TAPI_SIM_CPHS_CSP_SERVICE_GROUP_VALUE_ADDED_SERVICES = 0xC0, /**< Group csp value added services*/ - TAPI_SIM_CPHS_CSP_SERVICE_GROUP_INFORMATION_NUMBERS = 0xD5 /**< Group csp information numbers*/ -} TelSimCphsCustomerServiceGroup_t; - -/** - * @enum TelSimMailboxType_t - * This enum gives mailbox type. - */ -typedef enum { - TAPI_SIM_MAILBOX_VOICE = 0x01, /**< Voicemail*/ - TAPI_SIM_MAILBOX_FAX = 0x02, /**< Fax*/ - TAPI_SIM_MAILBOX_EMAIL = 0x03, /**< Email*/ - TAPI_SIM_MAILBOX_OTHER = 0x04, /**< Other*/ - TAPI_SIM_MAILBOX_VIDEO = 0x05, /**< Videomail*/ - TAPI_SIM_MAILBOX_DATA = 0x06, /**< Data*/ -} TelSimMailboxType_t; - -/** - * @enum TelSimDynamicFlagsSelectedLineId_t - * This enum gives dynamics flag selected line information. - */ -typedef enum { - TAPI_SIM_DYNAMIC_FLAGS_LINE1 = 0x01, /**< line 1 */ - TAPI_SIM_DYNAMIC_FLAGS_LINE2 = 0x00, /**< line 2*/ - TAPI_SIM_DYNAMIC_FLAGS_RFU = 0xff /**< rfu*/ -} TelSimDynamicFlagsSelectedLineId_t; - -/** - * @enum tapi_sim_dynamic2_flag_als_status_t - * This enum gives dynamics2 flag selected line information. - */ -typedef enum { - TAPI_SIM_PIN2_ACCESSIBLE_FLAGS_LOCKED = 0x01, /**< Dynamic flags locked */ - TAPI_SIM_PIN2_ACCESSIBLE_FLAGS_UNLOCKED = 0x00, /**< Dynamic flags unlocked */ - TAPI_SIM_PIN2_ACCESSIBLE_FLAGS_RFU = 0xff /**< rfu */ -} TelSimDynamic2FlagAlsStatus_t; - - -/** - * @enum TelSimAuthenticationType_t - * This is used for Authentication Procedure by using SIM. - */ -typedef enum { - TAPI_SIM_AUTH_TYPE_IMS = 0x00, /**< IMS Authentication */ - TAPI_SIM_AUTH_TYPE_GSM, /**< GSM Authentication */ - TAPI_SIM_AUTH_TYPE_3G, /**< 3G Authentication */ - TAPI_SIM_AUTH_TYPE_MAX /**< TBD */ -} TelSimAuthenticationType_t; - -/** - * @enum TelSimAuthenticationResult_t - * This is used for Authentication Procedure. - */ -typedef enum { - TAPI_SIM_AUTH_NO_ERROR = 0x00, /**< ISIM no error */ - TAPI_SIM_AUTH_CANNOT_PERFORM, /**< status - can't perform authentication */ - TAPI_SIM_AUTH_SKIP_RESPONSE, /**< status - skip authentication response */ - TAPI_SIM_AUTH_MAK_CODE_FAILURE, /**< status - MAK(Multiple Activation Key) code failure */ - TAPI_SIM_AUTH_SQN_FAILURE, /**< status - SQN(SeQuenceNumber) failure */ - TAPI_SIM_AUTH_SYNCH_FAILURE, /**< status - synch failure */ - TAPI_SIM_AUTH_UNSUPPORTED_CONTEXT, /**< status - unsupported context */ - TAPI_SIM_AUTH_MAX /**< TBD */ -} TelSimAuthenticationResult_t; - -/** - * @enum TelSimLockType_t - * This structure gives security lock type enum values - */ -typedef enum { - TAPI_SIM_LOCK_PS = 0x01, /** < 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 - */ - 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 - */ - 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, /** < Corporate Personalization */ -} TelSimLockType_t; - -/** - * @enum TelSimLockKey_t - * This structure gives security lock key information enum values - */ -typedef enum { - TAPI_SIM_LOCK_KEY_NOT_NEED = 0x00, /**< key not need */ - TAPI_SIM_LOCK_KEY_PIN = 0x01, /**< PIN required */ - TAPI_SIM_LOCK_KEY_PUK = 0x02, /**< PUK required */ - TAPI_SIM_LOCK_KEY_PIN2 = 0x03, /**< PIN2 required */ - TAPI_SIM_LOCK_KEY_PUK2 = 0x04, /**< PUK2 required */ - TAPI_SIM_LOCK_PERM_BLOCKED = 0x05, /**< Permanent block SIM */ -} TelSimLockStatus_t; - -/** - * @enum TelSimSapPowerMode_t - * This enum gives the SAP message Ids between SAP client and SAP server. - */ -typedef enum { - TAPI_SIM_SAP_POWER_SIM_ON_REQ, /**< SAP Client request about power SIM on in Server */ - TAPI_SIM_SAP_POWER_SIM_OFF_REQ, /**< SAP Client request about power SIM off in Server */ - TAPI_SIM_SAP_RESET_SIM_REQ, /**< SAP Client request about SIM reset in Server */ -} TelSimSapPowerMode_t; - -/** - * @enum TelSimSapConnectionStatus_t - * This enum gives the SAP connection status information . - */ -typedef enum { - TAPI_SIM_SAP_CONNECTION_STATUS_OK = 0x00, /**< connect successfully */ - TAPI_SIM_SAP_CONNECTION_STATUS_UNABLE_TO_ESTABLISH, /**< unable to establish connection */ - TAPI_SIM_SAP_CONNECTION_STATUS_NOT_SUPPORT_MAX_SIZE, /**< when server does not support message length that client want send */ - TAPI_SIM_SAP_CONNECTION_STATUS_TOO_SMALL_MAX_SIZE /**< when client want to connect with very small message length which is not supported by Server */ -} TelSimSapConnectionStatus_t; - -/** - * @enum TelSimSapDissconnectType_t - * This enum gives the SAP disconnect type information. - */ -typedef enum { - TAPI_SIM_SAP_DISCONNECT_TYPE_GRACEFUL = 0x00, /**< disconnection procedure ends after finishing current work */ - TAPI_SIM_SAP_DISCONNECT_TYPE_IMMEDIATE /**< disconnection procedure ends immediately*/ -} TelSimSapDissconnectType_t; - -/** - * @enum TelSimSapStatusInfo_t - * This enum gives the SAP current connection status information - */ -typedef enum { - TAPI_SIM_SAP_STATUS_UNKNOWN = 0x00, /**< SAP server connection status - unknown*/ - TAPI_SIM_SAP_STATUS_NO_SIM, /**< SAP server connection status - no SIM*/ - TAPI_SIM_SAP_STATUS_NOT_READY, /**< SAP server connection status - not ready*/ - TAPI_SIM_SAP_STATUS_READY, /**< SAP server connection status - ready*/ - TAPI_SIM_SAP_STATUS_CONNECTED /**< SAP server connection status - connected*/ -} TelSimSapStatusInfo_t; - -/** - * @enum TelSimSapCardStatus_t - * This enum gives the SIM card status if server`s status changed about connection with subscription module - */ -typedef enum { - TAPI_SIM_SAP_CARD_STATUS_UNKNOWN = 0x00, /**< SAP server status(card reader status) - unknown*/ - TAPI_SIM_SAP_CARD_STATUS_RESET, /**< SAP server status(card reader status) - reset*/ - TAPI_SIM_SAP_CARD_STATUS_NOT_ACCESSIBLE, /**< SAP server status(card reader status) - not accessible*/ - TAPI_SIM_SAP_CARD_STATUS_REMOVED, /**< SAP server status(card reader status) - removed*/ - TAPI_SIM_SAP_CARD_STATUS_INSERTED, /**< SAP server status(card reader status) - inserted*/ - TAPI_SIM_SAP_CARD_STATUS_RECOVERED /**< SAP server status(card reader status) - recovered*/ -} TelSimSapCardStatus_t; - -/** - * @enum TelSimSapResultCode_t - * This enum gives the SAP result information. - */ -typedef enum { - TAPI_SIM_SAP_RESULT_CODE_OK = 0x00, /**< SAP operation result - ok*/ - TAPI_SIM_SAP_RESULT_CODE_NO_REASON, /**< SAP operation result - no reason*/ - TAPI_SIM_SAP_RESULT_CODE_CARD_NOT_ACCESSIBLE, /**< SAP operation result - not accessible*/ - TAPI_SIM_SAP_RESULT_CODE_CARD_ALREADY_POWER_OFF, /**< SAP operation result - card already power off*/ - TAPI_SIM_SAP_RESULT_CODE_CARD_REMOVED, /**< SAP operation result - card removed*/ - TAPI_SIM_SAP_RESULT_CODE_CARD_ALREADY_POWER_ON, /**< SAP operation result - card already power on*/ - TAPI_SIM_SAP_RESULT_CODE_DATA_NOT_AVAILABLE, /**< SAP operation result - data not available*/ - TAPI_SIM_SAP_RESULT_CODE_NOT_SUPPORT /**< SAP operation result - not support*/ -} TelSimSapResultCode_t; - -/** - * @enum TelSimSapProtocol_t - * This enum gives SAP transport protocol type - */ -typedef enum { - TAPI_SIM_SAP_PROTOCOL_T0, /**< T = 0, character*/ - TAPI_SIM_SAP_PROTOCOL_T1 /**< T = 1, block*/ -} TelSimSapProtocol_t; - -/** - * @enum TelSimPbAccessResult_t - * This enumeration defines the Phone book access result - */ -typedef enum { - TAPI_SIM_PB_SUCCESS, /**< SIM phonebook operation successful. */ - TAPI_SIM_PB_FAIL, /**< SIM phonebook operation failure. */ - TAPI_SIM_PB_INVALID_INDEX, /**< The index passed was not a valid index. */ - TAPI_SIM_PB_INVALID_NUMBER_LENGTH, /**< The number length is exceeds the max length allowed (or 0). */ - TAPI_SIM_PB_INVALID_NAME_LENGTH, /**< The name length is exceeds the max length allowed (or 0). */ - TAPI_SIM_PB_ACCESS_CONDITION_NOT_SATISFIED, /**< Access condition for PB file is not satisfied. */ -} TelSimPbAccessResult_t; - -/** - * @enum TelSimPbFileType_t - * This enumeration defines different storage types to be selected in SIM or USIM - */ -typedef enum { - TAPI_SIM_PB_FDN, /**< Fixed Dialing Number */ - TAPI_SIM_PB_ADN, /**< SIM - ADN */ - TAPI_SIM_PB_SDN, /**< Service Dialing Number */ - TAPI_SIM_PB_3GSIM, /**< USIM - 3G phone book */ - TAPI_SIM_PB_AAS, /**< Additional number Alpha String */ - TAPI_SIM_PB_GAS, /**< Grouping identifier Alpha String */ - TAPI_SIM_PB_UNKNOWNN = 0xFF, /**< Unknown file type */ -} TelSimPbType_t; - -/** - * @enum TelSimPb3GFileType_t - * This enumeration defines the different storage field types in 3G Phone book. - */ -typedef enum { - /* for 3G phone storage field type */ - TAPI_PB_3G_NAME = 0x01, /**< Name */ - TAPI_PB_3G_NUMBER, /**< Number */ - TAPI_PB_3G_ANR1, /**< First Another number*/ - TAPI_PB_3G_ANR2, /**< Second Another number */ - TAPI_PB_3G_ANR3, /**< Third Another number */ - TAPI_PB_3G_EMAIL1, /**< First Email */ - TAPI_PB_3G_EMAIL2, /**< Second Email */ - TAPI_PB_3G_EMAIL3, /**< Third Email */ - TAPI_PB_3G_EMAIL4, /**< Fourth Email */ - TAPI_PB_3G_SNE, /**< Second name entry of main name*/ - TAPI_PB_3G_GRP, /**< Group */ - TAPI_PB_3G_PBC, /** <1 byte control info and 1 byte hidden info*/ -} TelSimPb3GFileType_t; - -/** - * @enum TelSimSSTService_t - * This enumeration defines the list of SST services in SIM Service Table. (GSM) - */ -typedef enum { - // service 1 ~ 8 - TAPI_SIM_SST_CHV1_DISABLE_FUNC = 0, /**< CHV1 disable function */ - TAPI_SIM_SST_ADN, /**< abbreviated Dialing number */ - TAPI_SIM_SST_FDN, /**< fixed Dialing number */ - TAPI_SIM_SST_SMS, /**< short message storage */ - TAPI_SIM_SST_AOC, /**< advice of charge */ - TAPI_SIM_SST_CCP, /**< capability configuration parameters */ - TAPI_SIM_SST_PLMN_SELECTOR, /**< plmn selector */ - TAPI_SIM_SST_RFU1, /**< rfu */ - - // service 9 ~ 16 - TAPI_SIM_SST_MSISDN = 8, /**< msisdn */ - TAPI_SIM_SST_EXT1, /**< extension1 */ - TAPI_SIM_SST_EXT2, /**< extension2 */ - TAPI_SIM_SST_SMS_PARAMS, /**< sms parameteres */ - TAPI_SIM_SST_LND, /**< last number dialed */ - TAPI_SIM_SST_CELL_BROADCAST_MSG_ID, /**< cell broadcast message identifier */ - TAPI_SIM_SST_GID_LV1, /**< group identifier level 1 */ - TAPI_SIM_SST_GID_LV2, /**< group identifier level 2 */ - - // service 17 ~ 24 - TAPI_SIM_SST_SPN = 16, /**< service provider name */ - TAPI_SIM_SST_SDN, /**< service Dialing number */ - TAPI_SIM_SST_EXT3, /**< extension3 */ - TAPI_SIM_SST_RFU2, /**< rfu */ - TAPI_SIM_SST_VGCS_GID_LIST, /**< vgcs group identifier (EF-VGCS, EF-VGCSS) */ - TAPI_SIM_SST_VBS_GID_LIST, /**< vbs group identifier (EF-VBS, EF-VBSS) */ - TAPI_SIM_SST_ENHANCED_MULTI_LV_PRECEDENCE_PREEMPTION_SRVC, /**< enhanced multi-level precedence and pre-emption service */ - TAPI_SIM_SST_AUTO_ANSWER_FOR_EMLPP, /**< automatic answer fro eMLPP */ - - // service 25 ~ 32, - TAPI_SIM_SST_DATA_DOWNLOAD_VIA_SMS_CB = 24, /**< data download via sms-cb */ - TAPI_SIM_SST_DATA_DOWNLOAD_VIA_SMS_PP, /**< data download via sms-pp */ - TAPI_SIM_SST_MENU_SELECTION, /**< menu selection */ - TAPI_SIM_SST_CALL_CTRL, /**< call control */ - TAPI_SIM_SST_PROACTIVE_SIM, /**< proactive sim command */ - TAPI_SIM_SST_CELL_BROADCAST_MSG_ID_RANGES, /**< cell broadcast message identifier ranges */ - TAPI_SIM_SST_BDN, /**< barred Dialing numbers */ - TAPI_SIM_SST_EXT4, /**< extension 4 */ - - // service 33 ~ 40 - TAPI_SIM_SST_DEPERSONALIZATION_CTRL_KEYS = 32, /**< de-personalization control keys */ - TAPI_SIM_SST_COOPERATIVE_NETWORK_LIST, /**< co-operative network list */ - TAPI_SIM_SST_SMS_STATUS_REPORTS, /**< short message status reports */ - TAPI_SIM_SST_NIA, /**< network's indication of alerting in the MS (NIA) */ - TAPI_SIM_SST_MO_SMS_CTRL_BY_SIM, /**< mobile-originated short message control by sim */ - TAPI_SIM_SST_GPRS, /**< gprs */ - TAPI_SIM_SST_IMG, /**< image */ - TAPI_SIM_SST_SOLSA, /**< support of local service area */ - - // service 41 ~ 48 - TAPI_SIM_SST_USSD_STR_DATA_OBJECT_SUPPORTED_IN_CALL_CTRL = 40, /**< ussd string data object supported in call control */ - TAPI_SIM_SST_RUN_AT_CMD_CMD, /**< RUN AT COMMAND command */ - TAPI_SIM_SST_USER_CTRLED_PLMN_SELECTOR_WACT, /**< user controlled PLMN selector with Access technology */ - TAPI_SIM_SST_OPERATOR_CTRLED_PLMN_SELECTOR_WACT, /**< operator controlled PLMN selector with Access technology */ - TAPI_SIM_SST_HPLMN_SELECTOR_WACT, /**< HPLMN selector with access technology */ - TAPI_SIM_SST_CPBCCH_INFO, /**< CPBCCH information */ - TAPI_SIM_SST_INVESTIGATION_SCAN, /**< investigation scan */ - TAPI_SIM_SST_EXTENDED_CAPA_CONF_PARAMS, /**< extended capability configuration parameters */ - - // service 49 ~ 56 - TAPI_SIM_SST_MEXE = 48, /**< MExE */ - TAPI_SIM_SST_RPLMN_LAST_USED_ACCESS_TECH, /**< RPLMN last used access technology */ - TAPI_SIM_SST_PLMN_NETWORK_NAME, /*PLMN Network Name*/ - TAPI_SIM_SST_OPERATOR_PLMN_LIST, /*Operator PLMN List*/ - TAPI_SIM_SST_MBDN, /*Mailbox Dialling Numbers*/ - TAPI_SIM_SST_MWIS, /*Message Waiting Indication Status*/ - TAPI_SIM_SST_CFIS, /*Call Forwarding Indication Status*/ - TAPI_SIM_SST_SPDI, /*Service Provider Display Information*/ -} TelSimSSTService_t; - -/** - * @enum TelSimUSTService_t - * This enumeration defines the list of UST services in SIM Service Table. (USIM) - */ -typedef enum { - // service 1 ~ 8 - TAPI_SIM_UST_LOCAL_PB = 0, /**< local phone book */ - TAPI_SIM_UST_FDN, /**< fixed Dialing number */ - TAPI_SIM_UST_EXT2, /**< extension2 */ - TAPI_SIM_UST_SDN, /**< service Dialing number */ - TAPI_SIM_UST_EXT3, /**< extension3 */ - TAPI_SIM_UST_BDN, /**< barred Dialing numbers */ - TAPI_SIM_UST_EXT4, /**< extension 4 */ - TAPI_SIM_UST_OUTGOING_CALL_INFO, /**< outgoing call information */ - - // service 9 ~ 16 - TAPI_SIM_UST_INCOMING_CALL_INFO = 8, /**< incoming call information */ - TAPI_SIM_UST_SMS, /**< short message storage */ - TAPI_SIM_UST_SMS_STATUS_REPORTS, /**< short message status reports */ - TAPI_SIM_UST_SMS_PARAMS, /**< sms parameteres */ - TAPI_SIM_UST_AOC, /**< advice of charge */ - TAPI_SIM_UST_CCP, /**< capability configuration parameters */ - TAPI_SIM_UST_CELL_BROADCAST_MSG_ID, /**< cell broadcast message identifier */ - TAPI_SIM_UST_CELL_BROADCAST_MSG_ID_RANGES, /**< cell broadcast message identifier ranges */ - - // service 17 ~ 24 - TAPI_SIM_UST_GID_LV1 = 16, /**< group identifier level 1 */ - TAPI_SIM_UST_GID_LV2, /**< group identifier level 2 */ - TAPI_SIM_UST_SPN, /**< service provider name */ - TAPI_SIM_UST_USER_CTRLED_PLMN_SELECTOR_WACT, /**< user controlled PLMN selector with Access technology */ - TAPI_SIM_UST_MSISDN, /**< msisdn */ - TAPI_SIM_UST_IMG, /**< image */ - TAPI_SIM_UST_SOLSA, /**< support of local service area */ - TAPI_SIM_UST_ENHANCED_MULTI_LV_PRECEDENCE_PREEMPTION_SRVC, /**< enhanced multi-level precedence and pre-emption service */ - - // service 25 ~ 32 - TAPI_SIM_UST_AUTO_ANSWER_FOR_EMLPP = 24, /**< automatic answer fro eMLPP */ - TAPI_SIM_UST_RFU1, /**< rfu */ - TAPI_SIM_UST_GSM_ACCESS, /**< gsm access */ - TAPI_SIM_UST_DATA_DOWNLOAD_VIA_SMS_PP, /**< data download via sms-pp */ - TAPI_SIM_UST_DATA_DOWNLOAD_VIA_SMS_CB, /**< data download via sms-cb */ - TAPI_SIM_UST_CALL_CTRL, /**< call control by usim*/ - TAPI_SIM_UST_MO_SMS_CTRL, /**< mobile-originated short message control by usim */ - TAPI_SIM_UST_RUN_AT_CMD_CMD, /**< RUN AT COMMAND command */ - - // service 33 ~ 40 - TAPI_SIM_UST_SHALL_BE_SET_TO_ONE = 32, /**< shall be set to 1 */ - TAPI_SIM_UST_ENABLED_SRVC_TABLE, /**< enabled service table */ - TAPI_SIM_UST_ACL, /**< APN control list */ - TAPI_SIM_UST_DEPERSONALIZATION_CTRL_KEYS, /**< de-personalization control keys */ - TAPI_SIM_UST_COOPERATIVE_NETWORK_LIST, /**< co-operative network list */ - TAPI_SIM_UST_GSM_SEC_CONTEXT, /**< gsm security context */ - TAPI_SIM_UST_CPBCCH_INFO, /**< CPBCCH information */ - TAPI_SIM_UST_INVESTIGATION_SCAN, /**< investigation scan */ - - // service 41 ~ 48 - TAPI_SIM_UST_MEXE = 40, /**< MExE */ - TAPI_SIM_UST_OPERATOR_CTRLED_PLMN_SELECTOR_WACT, /**< operator controlled PLMN selector with Access technology */ - TAPI_SIM_UST_HPLMN_SELECTOR_WACT, /**< HPLMN selector with access technology */ - TAPI_SIM_UST_EXT5, /**< extension 5 */ - TAPI_SIM_UST_PLMN_NETWORK_NAME, /*PLMN Network Name*/ - TAPI_SIM_UST_OPERATOR_PLMN_LIST, /*Operator PLMN List*/ - TAPI_SIM_UST_MBDN, /*Mailbox Dialling Numbers*/ - TAPI_SIM_UST_MWIS, /*Message Waiting Indication Status*/ - - // service 49 ~ 56 - TAPI_SIM_UST_CFIS = 48, /*Call Forwarding Indication Status*/ - TAPI_SIM_UST_RPLMN_LAST_USED_ACCESS_TECH, /**< RPLMN last used access technology */ - TAPI_SIM_UST_SPDI, /*Service Provider Display Information*/ - TAPI_SIM_UST_MMS, /**< multi media messaging service */ - TAPI_SIM_UST_EXT8, /**< extension 8 */ - TAPI_SIM_UST_CALL_CTRL_ON_GPRS, /**< call control on gprs by usim */ - TAPI_SIM_UST_MMS_USER_CONNECTIVITY_PARAMS, /**< mms user connectivity parameters */ - TAPI_SIM_UST_NIA, /**< network's indication of alerting in the MS (NIA) */ - - // service 57 ~ 64 - TAPI_SIM_UST_VGCS_GID_LIST = 56, /**< vgcs group identifier List (EF-VGCS, EF-VGCSS) */ - TAPI_SIM_UST_VBS_GID_LIST, /**< vbs group identifier List (EF-VBS, EF-VBSS) */ - TAPI_SIM_UST_PSEUDONYM, - TAPI_SIM_UST_USER_CTRLED_PLMN_SELECTOR_IWLAN, /**< user controlled PLMN selector for I-WLAN access */ - TAPI_SIM_UST_OPERATOR_CTRLED_PLMN_SELECTOR_IWLAN, /**< operator controlled PLMN selector for I-WLAN access */ - TAPI_SIM_UST_USER_CTRLED_WSID_LIST, - TAPI_SIM_UST_OPERATOR_CTRLED_WSID_LIST, - TAPI_SIM_UST_VGCS_SEC, -} TelSimUSTService_t; - -/** - * @enum TelSimTapiOperation_t - * This enumeration defines the list of TAPI-SIM Operations. - */ -typedef enum { - TAPI_SIM_GET_INIT_STATUS = 1, - TAPI_SIM_GET_CARD_TYPE, - TAPI_SIM_GET_IMSI, - TAPI_SIM_GET_ECC, - TAPI_SIM_GET_ICCID = 5, - TAPI_SIM_GET_LANGUAGE, - TAPI_SIM_SET_LANGUAGE, - TAPI_SIM_GET_CALL_FORWARDING, - TAPI_SIM_SET_CALL_FORWARDING, - TAPI_SIM_GET_MESSAGE_WAITING = 10, - TAPI_SIM_SET_MESSAGE_WAITING, - TAPI_SIM_GET_MAILBOX, - TAPI_SIM_SET_MAILBOX, - TAPI_SIM_GET_CPHS_INFO, - TAPI_SIM_GET_SVCT = 15, - TAPI_SIM_GET_MSISDN, - TAPI_SIM_GET_OPLMWACT, - TAPI_SIM_GET_SPN, - TAPI_SIM_GET_CPHS_NET_NAME, - TAPI_SIM_AUTHENTICATION = 20, - TAPI_SIM_VERIFY_SEC, - TAPI_SIM_VERIFY_PUK, - TAPI_SIM_CHANGE_PIN, - TAPI_SIM_DISABLE_FACILITY, - TAPI_SIM_ENABLE_FACILITY = 25, - TAPI_SIM_GET_FACILITY, - TAPI_SIM_GET_LOCK_INFO, - TAPI_SIM_TRANSFER_APDU, - TAPI_SIM_GET_ATR, - TAPI_SIM_GET_FIELDS = 30, //for get various data at once - - //for notification - TAPI_SIM_STATUS = 100, - TAPI_SIM_REFRESHED, -} TelSimTapiOperation_t; - -typedef struct { - char service[TAPI_SIM_SST_SERVICE_CNT_MAX]; // should access with 'enum TelSimSSTService_t' as index -} TelSimSST_t; - -typedef struct { - char service[TAPI_SIM_UST_SERVICE_CNT_MAX]; // should access with 'enum TelSimUSTService_t' as index -} TelSimUST_t; - -typedef struct { - TelSimCardType_t sim_type; - union { - TelSimSST_t sst; - TelSimUST_t ust; - } table; -} TelSimServiceTable_t; - -/** - * This data structure defines the data for the Imsi information. - */ -typedef struct { - char szMcc[3 + 1]; /**< mobile country code */ - char szMnc[3 + 1]; /**< mobile network code */ - char szMsin[10 + 1]; /**< mobile station identification number */ -} TelSimImsiInfo_t; - -typedef struct { - char name[30+1]; - char number[6+1]; - TelSimEccEmergencyServiceInfo_t category; -}TelSimEcc_t; - -typedef struct { - int ecc_count; - TelSimEcc_t list[15]; -}TelSimEccList_t; - -typedef struct { - int icc_length; /**< Integrated Circuit Card number length */ - char icc_num[TAPI_SIM_ICCID_LEN_MAX]; /**< Integrated Circuit Card number */ -} TelSimIccIdInfo_t; - -typedef struct { - int b_cphs; - int rec_index; /**< index which stands for the location where record is saved in SIM*/ - int profile_num; /**< SIM profile index*/ - TelSimMailboxType_t mb_type; - int alpha_id_max_len; /**< alpha max length in SIM - READ ONLY*/ - char alpha_id[TAPI_SIM_XDN_ALPHA_ID_MAX_LEN + 1]; /**< Alpha Identifier */ - TelSimTypeOfNum_t ton; /**< Type Of Number */ - TelSimNumberingPlanIdentity_t npi; /**< Number Plan Identity */ - char num[TAPI_SIM_XDN_DIALING_NUMBER_LEN + 1]; /**< Dialing Number/SSC String */ - unsigned char cc_id; /**< Capability/Configuration Identifier */ - unsigned char ext1_id; /**< Extensiion1 Record Identifier */ -}TelSimMailBoxNumber_t; - -typedef struct { - int count; - TelSimMailBoxNumber_t list[TAPI_SIM_MSP_CNT_MAX*5]; //max is 10 -}TelSimMailboxList_t; - -typedef struct { - int rec_index; - unsigned char msp_num; /**< MSP number*/ - unsigned char cfu_status; /**< call forwarding unconditional indication status*/ - TelSimTypeOfNum_t ton; /**< TON*/ - TelSimNumberingPlanIdentity_t npi; /**< NPI*/ - char cfu_num[TAPI_SIM_XDN_DIALING_NUMBER_LEN + 1];/**< Dialing Number/SSC String*/ - unsigned char cc2_id; /**< Capability/Configuration2 Record Identifier */ - unsigned char ext7_id; /**< Extension 7 Record Identifier */ -}TelSimCfis_t; - -typedef struct { - int profile_count; - TelSimCfis_t cf[TAPI_SIM_MSP_CNT_MAX]; -}TelSimCfisList_t; - -typedef struct { - int b_line1; /**< CallForwardUnconditionalLine 1 */ - int b_line2; /**< CallForwardUnconditionalLine 2 */ - int b_fax; /**< CallForwardUnconditional FAX */ - int b_data; /** - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT 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 - -#ifdef __cplusplus -extern "C" -{ -#endif - -/* NetText */ -/** 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 - -#define TAPI_NETTEXT_MSG_SIZE_MAX 918 /**< Maximum Message Size */ -#define TAPI_NETTEXT_CB_SIZE_MAX 93 /** Maximum CB Message Size */ -#define TAPI_NETTEXT_ETWS_SIZE_MAX 1252 /** Maximum ETWS 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 9 /**< CB maximum page size*/ -#define TAPI_NETTEXT_GSM_SMS_MSG_NUM_MAX 255 /**< 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 SS_TAPI SS(Supplementary services) - * @{ - * - * @file TelSs.h - - @brief This file serves as a "C" header file and defines structures for Tapi Supplementary Services\n - It contains a sample set of constants, enums, structs that would be required by applications. - */ - -#ifndef _TEL_SS_H_ -#define _TEL_SS_H_ - -#include -#include - -#ifdef __cplusplus -extern "C" -{ -#endif - -/** maximum length of barring password */ -#define TAPI_SS_GSM_BARR_PW_LEN_MAX 4 /** - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT 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_COMMON_H_ -#define _TAPI_COMMON_H_ - -/** -* @addtogroup TAPI_COMMON -* @{ -* -* @file tapi_common.h -* @brief TAPI Common Interface -*/ - -#include -#include - -#include -#include - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * @brief Fetches the list of available CPs - * - * @par Sync (or) Async: - * Synchronous API - * - * @param[out] None. - * - * @return #List of available CPs on SUCCESS and NULL on FAILURE. - */ -char** tel_get_cp_name_list(void); - -/** - * @brief Acquires a TAPI Handle for specified CP name - * - * @par Sync (or) Async: - * Synchronous API - * - * @param[in] cp_name CP Name against which TAPI handle is required \n - * NULL CP Name will return TapiHandle bound to the first CP in the list of available CPs - * - * @return #TapiHandle on SUCCESS and NULL on FAILURE. - */ -TapiHandle* tel_init(const char *cp_name); - -/** - * @brief De-initializes the TAPI Handle - * - * @par Sync (or) Async: - * Synchronous API - * - * @param[in] handle #TapiHandle obtained from tel_init() - * - * @return #TapiResult_t - */ -int tel_deinit(TapiHandle *handle); - -/** - * @brief Registers Notification CallBack for events on DBus interface - * - * @par Sync (or) Async: - * Synchronous API - * - * @param[in] handle #TapiHandle obtained from tel_init() - * - * @param[in] noti_id Notification Id for which callback has to be registered - * - * @param[in] callback #tapi_notification_cb Notification callback which will be invoked on event - * - * @param user_data User Data - * - * @return #TapiResult_t - */ -int tel_register_noti_event(TapiHandle *handle, const char *noti_id, - tapi_notification_cb callback, void *user_data); - -/** - * @brief De-Registers Notification CallBack for events on DBus interface - * - * @par Sync (or) Async: - * Synchronous API - * - * @param[in] handle #TapiHandle obtained from tel_init() - * - * @param[in] noti_id Notification Id for which callback has to be de-registered - * - * @return #TapiResult_t - */ - int tel_deregister_noti_event(TapiHandle *handle, const char *noti_id); - -/** - * @brief Gets the property value in integer format for given property - * - * @par Sync (or) Async: - * Synchronous API - * - * @param[in] handle #TapiHandle obtained from tel_init() - * - * @param[in] property Property which is to be retrieved from Dbus - * - * @param[out] result Property value in integer format - * - * @return #TapiResult_t - */ -int tel_get_property_int(TapiHandle *handle, const char *property, int *result); - -/** - * @brief Gets the property value in string format for given property - * - * @par Sync (or) Async: - * Synchronous API - * - * @param[in] handle #TapiHandle obtained from tel_init() - * - * @param[in] property Property which is to be retrieved from Dbus - * - * @param[out] result Property value in string format - * - * @return #TapiResult_t - */ -int tel_get_property_string(TapiHandle *handle, const char *property, char **result); - -#ifdef __cplusplus -} -#endif - -/** @}*/ - -#endif /* _TAPI_COMMON_H_ */ - diff --git a/wearable/libslp-tapi.manifest b/wearable/libslp-tapi.manifest deleted file mode 100644 index 5cfdc53..0000000 --- a/wearable/libslp-tapi.manifest +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - diff --git a/wearable/src/tapi_gps.c b/wearable/src/tapi_gps.c deleted file mode 100644 index 146bfde..0000000 --- a/wearable/src/tapi_gps.c +++ /dev/null @@ -1,299 +0,0 @@ -/* - * libslp-tapi - * - * Copyright (c) 2012 Samsung Electronics Co., Ltd. All rights reserved. - * - * Contact: Ja-young Gu - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT 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 "TapiUtility.h" - -#include "common.h" -#include "tapi_log.h" -#include "ITapiGps.h" - -static void on_response_default_set(GObject *source_object, GAsyncResult *res, gpointer user_data) -{ - GError *error = NULL; - GDBusConnection *conn = NULL; - struct tapi_resp_data *evt_cb_data = user_data; - int result = -1; - - GVariant *dbus_result; - - conn = G_DBUS_CONNECTION (source_object); - dbus_result = g_dbus_connection_call_finish(conn, res, &error); - CHECK_DEINIT(error); - - if (!dbus_result) { - if (evt_cb_data->cb_fn) { - evt_cb_data->cb_fn(evt_cb_data->handle, -1, NULL, evt_cb_data->user_data); - } - - if (error) - g_error_free(error); - - g_free(evt_cb_data); - return; - } - - - g_variant_get (dbus_result, "(i)", &result); - - if (evt_cb_data->cb_fn) { - evt_cb_data->cb_fn(evt_cb_data->handle, result, NULL, evt_cb_data->user_data); - } - - g_free(evt_cb_data); -} - - -EXPORT_API int tel_set_gps_frequency_aiding(TapiHandle *handle, unsigned char state, tapi_response_cb callback, void *user_data) -{ - struct tapi_resp_data *evt_cb_data = NULL; - GVariant *param; - - dbg("Func Entrance"); - - TAPI_RET_ERR_NUM_IF_FAIL(handle, TAPI_API_INVALID_PTR); - - MAKE_RESP_CB_DATA(evt_cb_data, handle, callback, user_data); - - param = g_variant_new("(y)", state); - - g_dbus_connection_call(handle->dbus_connection, - DBUS_TELEPHONY_SERVICE , handle->path, DBUS_TELEPHONY_GPS_INTERFACE, - "SetFrequencyAiding", param, NULL, - G_DBUS_CALL_FLAGS_NONE, TAPI_DEFAULT_TIMEOUT, handle->ca, - on_response_default_set, evt_cb_data); - - return TAPI_API_SUCCESS; -} - -EXPORT_API int tel_confirm_gps_measure_pos(TapiHandle *handle, unsigned char *data, unsigned int data_len) -{ - GVariant *param = NULL; - GVariant *rst = NULL; - GError *gerr = 0; - gchar *encoded_data = NULL; - gint result; - - dbg("Func Entrance"); - - TAPI_RET_ERR_NUM_IF_FAIL(handle, TAPI_API_INVALID_PTR); - TAPI_RET_ERR_NUM_IF_FAIL(handle->dbus_connection, TAPI_API_INVALID_INPUT); - TAPI_RET_ERR_NUM_IF_FAIL(data, TAPI_API_INVALID_PTR); - - msg("call tel_confirm_gps_measure_pos(). data_len=%d", data_len); - encoded_data = g_base64_encode((const guchar*)data, data_len); - - param = g_variant_new("(s)", encoded_data); - - rst = g_dbus_connection_call_sync(handle->dbus_connection, DBUS_TELEPHONY_SERVICE , handle->path, - DBUS_TELEPHONY_GPS_INTERFACE, "ConfirmMeasurePos", param, NULL, G_DBUS_CALL_FLAGS_NONE, TAPI_DEFAULT_TIMEOUT, handle->ca, &gerr); - - g_free(encoded_data); - - if(!rst){ - dbg( "error to gps measure pos confirm(%s)", gerr->message); - g_error_free (gerr); - return TAPI_API_OPERATION_FAILED; - } - dbg("send gps user confirm format(%s)", g_variant_get_type_string(rst)); - - g_variant_get(rst, "(i)", &result); - dbg("result (%d)", result); - - return TAPI_API_SUCCESS; -} - -EXPORT_API int tel_enable_smart_assistant(TapiHandle *handle, tapi_response_cb callback, void *user_data) -{ - struct tapi_resp_data *evt_cb_data = NULL; - - dbg("Func Entrance"); - - TAPI_RET_ERR_NUM_IF_FAIL(handle, TAPI_API_INVALID_PTR); - - MAKE_RESP_CB_DATA(evt_cb_data, handle, callback, user_data); - - g_dbus_connection_call(handle->dbus_connection, - DBUS_TELEPHONY_SERVICE , handle->path, DBUS_TELEPHONY_GPS_INTERFACE, - "EnableSmartAssistant", NULL, NULL, - G_DBUS_CALL_FLAGS_NONE, TAPI_DEFAULT_TIMEOUT, handle->ca, - on_response_default_set, evt_cb_data); - - return TAPI_API_SUCCESS; -} - -EXPORT_API int tel_disable_smart_assistant(TapiHandle *handle, tapi_response_cb callback, void *user_data) -{ - struct tapi_resp_data *evt_cb_data = NULL; - - dbg("Func Entrance"); - - TAPI_RET_ERR_NUM_IF_FAIL(handle, TAPI_API_INVALID_PTR); - - MAKE_RESP_CB_DATA(evt_cb_data, handle, callback, user_data); - - g_dbus_connection_call(handle->dbus_connection, - DBUS_TELEPHONY_SERVICE , handle->path, DBUS_TELEPHONY_GPS_INTERFACE, - "DisableSmartAssistant", NULL, NULL, - G_DBUS_CALL_FLAGS_NONE, TAPI_DEFAULT_TIMEOUT, handle->ca, - on_response_default_set, evt_cb_data); - - return TAPI_API_SUCCESS; -} - -EXPORT_API int tel_sync_smart_assistant_area_list(TapiHandle *handle, TelSmartAssistantAreaList_t *area_list, tapi_response_cb callback, void *user_data) -{ - struct tapi_resp_data *evt_cb_data = NULL; - GVariant *param = NULL, *inparam = NULL; - GVariantBuilder *b; - unsigned int i; - - TAPI_RET_ERR_NUM_IF_FAIL(area_list, TAPI_API_INVALID_PTR); - TAPI_RET_ERR_NUM_IF_FAIL(handle, TAPI_API_INVALID_PTR); - - MAKE_RESP_CB_DATA(evt_cb_data, handle, callback, user_data); - dbg("count:%d", area_list->count); - - b = g_variant_builder_new(G_VARIANT_TYPE ("a(ii)")); - - for (i = 0; i < area_list->count; i++) { - g_variant_builder_add(b, "(ii)", area_list->area[i].index, area_list->area[i].mode_state); - } - - inparam = g_variant_builder_end(b); - param = g_variant_new("(iv)", area_list->count, inparam); - - g_dbus_connection_call(handle->dbus_connection, - DBUS_TELEPHONY_SERVICE , handle->path, DBUS_TELEPHONY_GPS_INTERFACE, - "SyncSmartAssistantAreaList", param, NULL, - G_DBUS_CALL_FLAGS_NONE, TAPI_DEFAULT_TIMEOUT, handle->ca, - on_response_default_set, evt_cb_data); - - return TAPI_API_SUCCESS; -} - -EXPORT_API int tel_del_smart_assistant_area_list(TapiHandle *handle, TelSmartAssistantAreaList_t *area_list, tapi_response_cb callback, void *user_data) -{ - struct tapi_resp_data *evt_cb_data = NULL; - GVariant *param = NULL, *inparam = NULL; - GVariantBuilder *b; - unsigned int i; - - TAPI_RET_ERR_NUM_IF_FAIL(area_list, TAPI_API_INVALID_PTR); - TAPI_RET_ERR_NUM_IF_FAIL(handle, TAPI_API_INVALID_PTR); - - MAKE_RESP_CB_DATA(evt_cb_data, handle, callback, user_data); - dbg("count:%d", area_list->count); - - b = g_variant_builder_new(G_VARIANT_TYPE ("a(ii)")); - - for (i = 0; i < area_list->count; i++) { - g_variant_builder_add(b, "(ii)", area_list->area[i].index, area_list->area[i].mode_state); - } - - inparam = g_variant_builder_end(b); - param = g_variant_new("(iv)", area_list->count, inparam); - - g_dbus_connection_call(handle->dbus_connection, - DBUS_TELEPHONY_SERVICE , handle->path, DBUS_TELEPHONY_GPS_INTERFACE, - "DelSmartAssistantAreaList", param, NULL, - G_DBUS_CALL_FLAGS_NONE, TAPI_DEFAULT_TIMEOUT, handle->ca, - on_response_default_set, evt_cb_data); - - return TAPI_API_SUCCESS; -} - -EXPORT_API int tel_add_smart_assistant_area(TapiHandle *handle, TelSmartAssistantArea_t *area, tapi_response_cb callback, void *user_data) -{ - struct tapi_resp_data *evt_cb_data = NULL; - GVariant *param; - - TAPI_RET_ERR_NUM_IF_FAIL(area, TAPI_API_INVALID_PTR); - TAPI_RET_ERR_NUM_IF_FAIL(handle, TAPI_API_INVALID_PTR); - - MAKE_RESP_CB_DATA(evt_cb_data, handle, callback, user_data); - - param = g_variant_new("(ii)", - area->index, - area->mode_state); - - g_dbus_connection_call(handle->dbus_connection, - DBUS_TELEPHONY_SERVICE , handle->path, DBUS_TELEPHONY_GPS_INTERFACE, - "AddSmartAssistantArea", param, NULL, - G_DBUS_CALL_FLAGS_NONE, TAPI_DEFAULT_TIMEOUT, handle->ca, - on_response_default_set, evt_cb_data); - - return TAPI_API_SUCCESS; -} - -EXPORT_API int tel_modify_smart_assistant_area(TapiHandle *handle, TelSmartAssistantArea_t *area, tapi_response_cb callback, void *user_data) -{ - struct tapi_resp_data *evt_cb_data = NULL; - GVariant *param; - - TAPI_RET_ERR_NUM_IF_FAIL(area, TAPI_API_INVALID_PTR); - TAPI_RET_ERR_NUM_IF_FAIL(handle, TAPI_API_INVALID_PTR); - - dbg("index:%d, mode_state:%d", area->index, area->mode_state); - - MAKE_RESP_CB_DATA(evt_cb_data, handle, callback, user_data); - - param = g_variant_new("(ii)", - area->index, - area->mode_state); - - g_dbus_connection_call(handle->dbus_connection, - DBUS_TELEPHONY_SERVICE , handle->path, DBUS_TELEPHONY_GPS_INTERFACE, - "ModifySmartAssistantArea", param, NULL, - G_DBUS_CALL_FLAGS_NONE, TAPI_DEFAULT_TIMEOUT, handle->ca, - on_response_default_set, evt_cb_data); - - return TAPI_API_SUCCESS; -} - -EXPORT_API int tel_set_smart_assistant_info(TapiHandle *handle, TelSmartAssistantInfo_t *info, tapi_response_cb callback, void *user_data) -{ - struct tapi_resp_data *evt_cb_data = NULL; - GVariant *param; - - TAPI_RET_ERR_NUM_IF_FAIL(info, TAPI_API_INVALID_PTR); - TAPI_RET_ERR_NUM_IF_FAIL(handle, TAPI_API_INVALID_PTR); - - dbg("index:%d, lpp_state:%d", info->index, info->lpp_state); - - MAKE_RESP_CB_DATA(evt_cb_data, handle, callback, user_data); - - param = g_variant_new("(ii)", - info->index, - info->lpp_state); - - g_dbus_connection_call(handle->dbus_connection, - DBUS_TELEPHONY_SERVICE , handle->path, DBUS_TELEPHONY_GPS_INTERFACE, - "SetSmartAssistantInfo", param, NULL, - G_DBUS_CALL_FLAGS_NONE, TAPI_DEFAULT_TIMEOUT, handle->ca, - on_response_default_set, evt_cb_data); - - return TAPI_API_SUCCESS; -} - diff --git a/wearable/test_src/gps.c b/wearable/test_src/gps.c deleted file mode 100644 index 5755ee3..0000000 --- a/wearable/test_src/gps.c +++ /dev/null @@ -1,1165 +0,0 @@ -/* - * Telephony test application - * - * Copyright (c) 2012 Samsung Electronics Co., Ltd. All rights reserved. - * - * Contact: Ja-young Gu - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT 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 "menu.h" -#include "gps.h" - -/* GPS Chipset on AP - START */ -//GPS CP MO Location - -/* MOLR Type */ -typedef enum { - TAPI_GPS_MOLR_INVALID, - TAPI_GPS_MOLR_LOCATION_ESTIMATE, - TAPI_GPS_MOLR_ASSISTANCE_DATA, - TAPI_GPS_MOLR_DECIPHERING_KEY -} tapi_gps_molr_e_type; - -/* Response Time Type */ -typedef enum { - TAPI_GPS_RESPONSE_TIME_INVALID, - TAPI_GPS_RESPONSE_TIME_LOW_DELAY, - TAPI_GPS_RESPONSE_TIME_DELAY_TOLERANT -} tapi_gps_response_time; - -/* Location Method Type */ -typedef enum { - TAPI_GPS_LOCATION_METHOD_INVALID, - TAPI_GPS_LOCATION_METHOD_MSBASED_EOTD, - TAPI_GPS_LOCATION_METHOD_MSASSISTED_EOTD, - TAPI_GPS_LOCATION_METHOD_ASSISTED_GPS -} tapi_gps_location_method_e_type; - -/* GAD Shape Type */ -typedef enum { - TAPI_GPS_SHAPE_ELLIPSOIDPOINT, - TAPI_GPS_SHAPE_ELLIPSOIDPOINT_WITH_UNCERTAINTY_CIRCLE, - TAPI_GPS_SHAPE_ELLIPSOIDPOINT_WITH_UNCERTAINTY_ELLIPSE, - TAPI_GPS_SHAPE_POLYGON, - TAPI_GPS_SHAPE_ELLIPSOIDPOINT_WITH_ALTITUDE, - TAPI_GPS_SHAPE_ELLIPSOIDPOINT_WITH_ALTITUDE_AND_UNCERTAINTYELI, - TAPI_GPS_SHAPE_ELLIPSOIDPOINT_ARC -} tapi_gps_gad_shape_e_type; - -/* GPS Assistance Data Flags */ -#define GPS_ASSISTANCE_NONE 0x00000000 -#define GPS_ASSISTANCE_ALMANAC 0x00000001 -#define GPS_ASSISTANCE_UTC_MODEL 0x00000002 -#define GPS_ASSISTANCE_IONO_MODEL 0x00000004 -#define GPS_ASSISTANCE_NAVI_MODEL 0x00000008 -#define GPS_ASSISTANCE_DGPS_CORRECTION 0x00000010 -#define GPS_ASSISTANCE_REF_LOCATION 0x00000020 -#define GPS_ASSISTANCE_REF_TIME 0x00000040 -#define GPS_ASSISTANCE_ACQUISITION_ASSISTANCE 0x00000080 -#define GPS_ASSISTANCE_REAL_TIME_INTEGRITY 0x00000100 - -//GPS Assist Data Message - -/* GPS Crrier Type */ -typedef enum { - TAPI_GPS_CARRIER_INVALID, - TAPI_GPS_CARRIER_GSM, - TAPI_GPS_CARRIER_UMTS -} tapi_gps_carrier_e_type; - -/* Utran Sfn Uncertainty */ -typedef enum { - TAPI_GPS_UTRAN_SFN_UNCERTAINTY_INVALID, - TAPI_GPS_UTRAN_SFN_UNCERTAINTY_LESSTHAN_10, - TAPI_GPS_UTRAN_SFN_UNCERTAINTY_MORETHAN_10 -} tapi_gps_sfn_unc_e_type; - -/* UTRAN Choice mode Type */ -typedef enum { - TAPI_GPS_UTRAN_CHOICE_INVALID, - TAPI_GPS_UTRAN_CHOICE_FDD, - TAPI_GPS_UTRAN_CHOICE_TDD -} tapi_gps_utrn_choice_mode_e_type; - -/* DGPS Status Type */ -typedef enum { - TAPI_GPS_DGPS_INVALID, - TAPI_GPS_DGPS_UDRE_SCALE_1_0, - TAPI_GPS_DGPS_UDRE_SCALE_0_75, - TAPI_GPS_DGPS_UDRE_SCALE_0_5, - TAPI_GPS_DGPS_UDRE_SCALE_0_3, - TAPI_GPS_DGPS_UDRE_SCALE_0_2, - TAPI_GPS_DGPS_UDRE_SCALE_0_1, - TAPI_GPS_DGPS_NO_DATA -} tapi_gps_dgps_status_e_type; - -/* Navigation Satellite Status Type*/ -typedef enum { - TAPI_GPS_NAVIGATION_MODEL_NEW_SATELLITE_NEW_NAVIGATION, - TAPI_GPS_NAVIGATION_MODEL_EXIST_SATELLITE_EXIST_NAVIGATION, - TAPI_GPS_NAVIGATION_MODEL_EXIST_SATELLITE_NEW_NAVIGATION, - TAPI_GPS_NAVIGATION_MODEL_RESERVED -} tapi_gps_navigation_sat_status_e_type; - -//GPS Measure Position Message -/* Method Type */ -typedef enum { - TAPI_GPS_METHODTYPE_INVALID, - TAPI_GPS_METHODTYPE_MS_ASSISTED, - TAPI_GPS_METHODTYPE_MS_BASED, - TAPI_GPS_METHODTYPE_MS_BASED_PREF, - TAPI_GPS_METHODTYPE_MS_ASSISTED_PREF -} tapi_gps_method_e_type; - -/* Use Multiple Sets Type */ -typedef enum { - TAPI_GPS_MULTIPLESETS_INVALID, - TAPI_GPS_MULTIPLESETS_MULTIPLESETS, - TAPI_GPS_MULTIPLESETS_ONESET -} tapi_gps_use_multi_sets_e_type; - -/* Environment Char Type */ -typedef enum { - TAPI_GPS_ENVIRONMENT_INVALID, - TAPI_GPS_ENVIRONMENT_BAD_AREA, - TAPI_GPS_ENVIRONMENT_NOT_BAD_AREA, - TAPI_GPS_ENVIRONMENT_MIXED_AREA -} tapi_gps_env_char_e_type; - -/* Cell Timing Wanted Type */ -typedef enum { - TAPI_GPS_CELLTIMING_INVALID, - TAPI_GPS_CELLTIMING_WANTED, - TAPI_GPS_CELLTIMING_NOT_WANTED -} tapi_gps_cell_timing_wnt_e_type; - -/* Additional Assist Request Type */ -typedef enum { - TAPI_GPS_ADDITIONAL_ASSISREQ_INVALID, - TAPI_GPS_ADDITIONAL_ASSISREQ_REQ, - TAPI_GPS_ADDITIONAL_ASSISREQ_NOT_REQ -} tapi_gps_add_assit_req_e_type; - -/* Measure Position Response Type */ -typedef enum { - TAPI_GPS_MSR_POS_RES_LOCATION, - TAPI_GPS_MSR_POS_RES_GPS_MEASUREMENTS, - TAPI_GPS_MSR_POS_RES_AID_REQ, - TAPI_GPS_MSR_POS_RES_ERROR -} tapi_gps_msr_pos_res_e_type; - -/* GPS element multi path Type */ -typedef enum { - TAPI_GPS_MULTIPATH_NOT_MEASURED, - TAPI_GPS_MULTIPATH_LOW, - TAPI_GPS_MULTIPATH_MEDIUM, - TAPI_GPS_MULTIPATH_HIGH -}tapi_gps_multi_path_e_type; - -/* Accuracy Flag Value */ -#define QOS_PRESENT_HORIZONTAL_ACCURACY 0x01 -#define QOS_PRESENT_VERTICAL_ACCURACY 0x02 - -//GPS MTLR Notification Message -/* MTLR Notification Type */ -typedef enum { - TAPI_GPS_NO_NOTIFY_NO_VERIFY, - TAPI_GPS_USER_NOTIFY_ONLY, /* Location Notification Allowed */ - TAPI_GPS_USER_NOTIFY_VERIFY_ALLOW_NO_RESP, /* notify and verify, if no response, Location Notification Allowed */ - TAPI_GPS_USER_NOTIFY_VERIFY_NOT_ALLOW_NO_RESP, /* notify and verify, if no response, Location Notification Not Allowed */ - TAPI_GPS_PRIVACY_NEEDED, - TAPI_GPS_PRIVACY_OVERRIDE -} tapi_gps_mtlr_notify_e_type; - -/* location estimate Type */ -typedef enum { - TAPI_GPS_ESTIMATE_TYPE_CURRENT_LOCATION, ///< Current Location - TAPI_GPS_ESTIMATE_TYPE_CURRENT_OR_LAST_KNOWN_LOCATION, ///< Current or Last Known Location - TAPI_GPS_ESTIMATE_TYPE_INITIAL_LOCATION, ///< Initial Location - TAPI_GPS_ESTIMATE_TYPE_ACTIVATE_DEFERRED_LOC, ///< Activate Deferred Location - TAPI_GPS_ESTIMATE_TYPE_CANCEL_DEFERRED_LOC, ///< Cancel Deferred Location - TAPI_GPS_ESTIMATE_TYPE_NOTIFY_VERIFY_ONLY, ///< Notification and Verification Only - TAPI_GPS_ESTIMATE_TYPE_INVALID -} tapi_gps_loc_estimate_e_type; - -/* ID Format Type */ -typedef enum { - TAPI_GPS_FORMAT_IND_LOGICAL_NAME, - TAPI_GPS_FORMAT_IND_EMAIL_ADDRESS, - TAPI_GPS_FORMAT_IND_MSISDN, - TAPI_GPS_FORMAT_IND_URL, - TAPI_GPS_FORMAT_IND_SIPURL, - TAPI_GPS_FORMAT_IND_IMS_PUBLIC_ID -} tapi_gps_format_ind_e_type; - -/* Verify Response Type */ -typedef enum { - TAPI_GPS_VERIFY_RSP_TYPE_DENIED, - TAPI_GPS_VERIFY_RSP_TYPE_GRANTED, - TAPI_GPS_VERIFY_RSP_TYPE_INVALID -} tapi_gps_verify_rsp_e_type; - -typedef enum { - TAPI_GPS_FREQ_AIDING_DISABLE = 0, - TAPI_GPS_FREQ_AIDING_ENABLE, -} tapi_gps_freq_aiding_e_type; - -/* GPS Chipset on AP - END */ - - -/* GPS Chipset on AP - START */ -typedef struct { - unsigned long int qosFlag; - unsigned char horizontalAccuracy; - unsigned char verticalCoordinateRequest; - unsigned char verticalAccuracy; - unsigned char responseTime; //0x01:low delay, 0x02: delay tolerant -}__attribute__ ((packed)) tapi_gps_qos_t; - -typedef struct { - unsigned char sat_id; - unsigned char iode; -}__attribute__ ((packed)) tapi_gps_sat_info_t; - -typedef struct { - unsigned char beginWeek; - unsigned char endWeek; - unsigned char beginTow; - unsigned char endTow; -}__attribute__ ((packed)) tapi_gps_ext_ephe_chk_t; - -typedef struct { - unsigned long int assistanceFlag; - unsigned short gpsWeek; - unsigned char gpsToe; - unsigned char nSat; - unsigned char toeLimit; - tapi_gps_sat_info_t satInfo[15]; - unsigned char gpsExtendedEphemeris; - tapi_gps_ext_ephe_chk_t extEphemerisChk; -}__attribute__ ((packed)) tapi_gps_assistance_data_t; - -typedef struct { - tapi_gps_molr_e_type molr_type; - tapi_gps_location_method_e_type location_method; - tapi_gps_qos_t qos; - unsigned char client_id[82]; - unsigned char mlc_num[82]; - tapi_gps_assistance_data_t assistance_data; - tapi_gps_gad_shape_e_type gad_shape; - unsigned char serviceTypeID; - unsigned char pseudonymIndicator; -}__attribute__ ((packed)) tapi_gps_cp_mo_loc_set_t; //APGPS - Control Plane Mo Location - Set - -//Measure Position message -typedef struct { - unsigned char satId; //Satellite ID - unsigned char cno; // 0~63, unit of dB-Hz - signed short doppler; // -32768~32767, Hz and scale factor 0.2 - unsigned short wholeChips; // 0~1022 - unsigned short fracChips; // 0~1024 - unsigned char lcsMultiPath; - unsigned char pseuRangeRmsErr; // 0~63 -}__attribute__ ((packed)) tapi_gps_measuremet_element_t; - -typedef struct { - unsigned long int gpsTow; ///< GPS time of week [msec] - unsigned short gpsWeek; ///< GPS week [0 .. 1023] - unsigned char nrOfSats; ///< number of satellites [1 .. 16] - tapi_gps_measuremet_element_t GpsMeasure[16]; -}__attribute__ ((packed)) tapi_gps_measure_t; - -typedef struct { - signed long int latitude; - signed long int longitude; -}__attribute__ ((packed)) tapi_gps_ellipsoid_po_t; - -typedef struct { - tapi_gps_ellipsoid_po_t point; - unsigned char uncertainRadius; -}__attribute__ ((packed)) tapi_gps_po_unc_circle_t; - -typedef struct { - tapi_gps_ellipsoid_po_t point; - unsigned char semiMajorAxis; - unsigned char semiMinorAxis; - unsigned char orientationAngle; - unsigned char confidence; -}__attribute__ ((packed)) tapi_gps_po_unc_ellipse_t; - -typedef struct { - tapi_gps_ellipsoid_po_t point; - signed short altitude; - unsigned char semiMajorAxis; - unsigned char semiMinorAxis; - unsigned char orientationAngle; - unsigned char uncertainAltitude; - unsigned char confidence; -}__attribute__ ((packed)) tapi_gps_po_alt_unc_ellipse_t; - -typedef struct { - tapi_gps_ellipsoid_po_t point; - unsigned short innerRadius; - unsigned char uncertainRadius; - unsigned char offsetAngle; - unsigned char includedAngle; - unsigned char confidence; -}__attribute__ ((packed)) tapi_gps_ellipsoid_arc_t; - -typedef struct { - tapi_gps_ellipsoid_po_t point; - signed short altitude; -}__attribute__ ((packed)) tapi_gps_ellipsoid_alt_t; - -typedef struct { - unsigned char noOfPoints; - tapi_gps_ellipsoid_po_t points[15]; -}__attribute__ ((packed)) tapi_gps_polygon_t; - -typedef struct { - unsigned char shape_type; - tapi_gps_po_unc_circle_t p_unc_clrcle; - tapi_gps_po_unc_ellipse_t p_unc_ellipse; - tapi_gps_po_alt_unc_ellipse_t p_alt_unc_ellipse; - tapi_gps_ellipsoid_arc_t ellipsoid_arc; - tapi_gps_ellipsoid_po_t ellipsoid_po; - tapi_gps_ellipsoid_alt_t ellipsoid_alt; - tapi_gps_polygon_t polygon; -}__attribute__ ((packed)) tapi_gps_loc_info_t; - -typedef struct { - unsigned long int gpsTow; ///< GPS time of week [msec] - unsigned short gpsWeek; ///< GPS week [0 .. 1023] - unsigned char fixType; ///< Fix type. 2D(0x01) or 3D(0x02) - tapi_gps_loc_info_t measured_loc_info; -}__attribute__ ((packed)) tapi_gps_measure_loc_info_t; - -typedef struct { - unsigned char valid; - unsigned long int cellFrames; - unsigned char choice_mode; - unsigned long int UtranFdd; //FDD Primary Scrambling Code - unsigned long int UtranTdd; // TDD Cell Parameter ID - unsigned long int sfn; //SFN -}__attribute__ ((packed)) tapi_gps_utran_gps_ref_time_t; - -typedef struct { - unsigned char result; // 0x00 : SUCCESS, 0x01 : Fail - tapi_gps_msr_pos_res_e_type response_type; //should be 4 byte - tapi_gps_measure_t gps_measure; - tapi_gps_measure_loc_info_t loc_info; - tapi_gps_assistance_data_t measured_assit_data; - tapi_gps_utran_gps_ref_time_t UtranGpsRefTime; // only for 3G -}__attribute__ ((packed)) tapi_gps_measure_position_confirm_t; //APGPS - Measure Position message - confirm - -typedef struct { - unsigned char reqId; - tapi_gps_verify_rsp_e_type response; -}__attribute__ ((packed)) tapi_gps_mtlr_notification_confirm_t; //AGPS - MTLR Notification message - confirm - - -//RX part -typedef struct { - unsigned short arfcn; //ARFCN of GSM network - unsigned char bsic; //Base Station Identity Code - unsigned char rx_lev; // RX signal level - unsigned char ta; //Timing Advance -}__attribute__ ((packed)) tapi_gps_gsm_extended_radio_signal_info_t; //APGPS - GSM Extended Radio Signal Info - Resp - -typedef struct { - unsigned long int flag; - unsigned char horizontalAccuracy; - unsigned char vertcalAccuracy; -}__attribute__ ((packed)) tapi_gps_accuracy_t; - -typedef struct { - unsigned char method_type; - tapi_gps_accuracy_t accuracy; - unsigned char rsp_time; - unsigned char use_multi_sets; - unsigned char environment_char; - unsigned char cell_timing_wnt; - unsigned char add_assist_req; -}__attribute__ ((packed)) tapi_gps_measure_position_indi_t; //APGPS - Measure Position message -indication - -typedef struct { - unsigned short deferredLocEventType; - tapi_gps_mtlr_notify_e_type locEstimateType; -}__attribute__ ((packed)) tapi_gps_mtlr_loc_t; - -typedef struct { - unsigned long int length; //Length of APDU - unsigned char val[63]; //APDU data -}__attribute__ ((packed)) tapi_gps_string_t; - -typedef struct { - unsigned char dcs; - tapi_gps_string_t str; - tapi_gps_format_ind_e_type format_indicator; -}__attribute__ ((packed)) tapi_gps_dcs_string_t; - -typedef struct { - unsigned char dcs; - tapi_gps_string_t str; -}__attribute__ ((packed)) tapi_gps_code_word_t; - -typedef struct { - unsigned char req_id; - tapi_gps_mtlr_notify_e_type notify_type; - tapi_gps_mtlr_loc_t loc; - unsigned char client_id[82]; - tapi_gps_dcs_string_t client_name; - tapi_gps_dcs_string_t requestor_id; - tapi_gps_code_word_t code_word; - unsigned char svc_type_id; -}__attribute__ ((packed)) tapi_gps_mtlr_notification_indi_t; //AGPS - MTLR Notification message - Indication - -typedef struct { - unsigned char cipherKeyFlag; - unsigned char currentDecipherKey[7]; - unsigned char nextDecipherKey[7]; -}__attribute__ ((packed)) tapi_gps_deciphering_keys_t; - -typedef struct { - tapi_gps_loc_info_t loc_info; - unsigned char no_loc; - tapi_gps_deciphering_keys_t decper_keys; -}__attribute__ ((packed)) tapi_gps_cp_mo_loc_noti_t; //APGPS - Control Plane Mo Location - Notification - -typedef struct { - unsigned char valid; - unsigned short bcchCarrier; - unsigned short bsic; - unsigned long int frameNumber; - unsigned short timeSlot; - unsigned short bitNumber; -}__attribute__ ((packed)) tapi_gps_gsm_time_t; - -typedef struct { - unsigned char valid; - unsigned long int gpsTimeUncertainty; -}__attribute__ ((packed)) tapi_gps_utran_gps_unc_t; - -typedef struct { - unsigned char valid; - signed long int driftRate; -}__attribute__ ((packed)) tapi_gps_drift_rate_t; - -typedef struct { - tapi_gps_utran_gps_ref_time_t UtranGpsRefTime; - tapi_gps_utran_gps_unc_t UtranGpsUncertainty; - unsigned char UtranSfnUncertainty; - tapi_gps_drift_rate_t UtranDriftRate; -}__attribute__ ((packed)) tapi_gps_utran_time_t; - -typedef struct { - unsigned short satID; - unsigned short tlmWord; - unsigned char antiSpoofFlag; - unsigned char alertFlag; - unsigned char tmlReservedBits; -}__attribute__ ((packed)) tapi_gps_gps_tow_assist_t; - -typedef struct { - unsigned long int gpsTow; - unsigned long int gpsWeek; - unsigned char nrOfSats; - union { - tapi_gps_gsm_time_t gsm_time; - tapi_gps_utran_time_t UtranTime; - } networkTimeInfo; - tapi_gps_gps_tow_assist_t GpsTowAssist[12]; -}__attribute__ ((packed)) tapi_gps_ref_time_t; - -typedef struct { - unsigned char shapeType; - unsigned char hemisphere; - unsigned short altitude; - unsigned long int latitude; - signed long int longitude; - unsigned char directionOfAlt; - unsigned char semiMajorUncert; - unsigned char semiMinorUncert; - unsigned char majorAxis; - unsigned char altUncert; - unsigned char confidence; -}__attribute__ ((packed)) tapi_gps_ref_loc_t; - -typedef struct { - unsigned char satId; //Satellite ID - unsigned short iode; - unsigned char udre; - signed short pseudoRangeCor; - signed short rangeRateCor; -}__attribute__ ((packed)) tapi_gps_dgps_sat_list_t; - -typedef struct { - unsigned long int gpsTow; - unsigned char status; - unsigned long int numberOfSat; - tapi_gps_dgps_sat_list_t seqOfSatElement[16]; -}__attribute__ ((packed)) tapi_gps_dgps_correction_t; - -typedef struct { - unsigned long int rsv1; // 0~838860 - unsigned long int rsv2; // 0~16777215 - unsigned long int rsv3; // 0~16777215 - unsigned long int rsv4; // 0~65535 -}__attribute__ ((packed)) tapi_gps_navi_subframe_rsv_t; - -typedef struct { - unsigned char ephemCodeOnL2; // 0~3 - unsigned char ephemUra; // 0~15 - unsigned char ephemSvHealth; // 0~63 - unsigned short ephemIodc; // 0~1023 - unsigned char ephemL2PFlag; // 0~1 - tapi_gps_navi_subframe_rsv_t NavigationSubFrameRsv; - signed char ephemTgd; // -128~127 - unsigned short ephemToc; // 0~37799 - signed char ephemAf2; // -128~12 - signed short ephemAf1; // -32768~32767 - signed long int ephemAf0; // -2097152~2097151 - signed short ephemCrs; // -32768~32767 - signed short ephemDeltaN; // -32768~32767 - signed long int ephemM0; // -2147483648~2147483647 - signed short ephemCuc; // -32768~32767 - unsigned long int ephemE; // 0~4294967295 - signed short ephemCus; // -32768~32767 - unsigned long int ephemAPowrHalf; // 0~4294967295 - unsigned short ephemToe; // 0~37799 - signed char ephemFitFlag; // 0~1 - unsigned char ephemAoda; // 0~31 - signed short ephemCic; // -32768~32767 - signed long int ephemOmegaA0; // -2147483648~2147483647 - signed short ephemCis; // -32768~32767 - signed long int ephemI0; // -2147483648~2147483647 - signed short ephemCrc; // -32768~32767 - signed long int ephemW; // -2147483648~2147483647 - signed long int ephemOmegaADot; // -8388608~8388607 - signed short ephemIDot; // -8192~8191 -}__attribute__ ((packed)) tapi_gps_navi_ephe_t; - -typedef struct { - unsigned char satId; - unsigned char NavigationSatStatus; - tapi_gps_navi_ephe_t NavigationEphemeris; -}__attribute__ ((packed)) tapi_gps_navi_sat_info_t; - -typedef struct { - unsigned long int numberOfSat; - tapi_gps_navi_sat_info_t NavigationSatInfo[16]; -}__attribute__ ((packed)) tapi_gps_navi_model_t; - -typedef struct { - signed char alfa0; // -128~127 - signed char alfa1; // -128~127 - signed char alfa2; // -128~127 - signed char alfa3; // -128~127 - signed char beta0; // -128~127 - signed char beta1; // -128~127 - signed char beta2; // -128~127 - signed char beta3; // -128~127 -}__attribute__ ((packed)) tapi_gps_iono_model_t; - -typedef struct { - signed long int utcA1; // -8388608~8388607 - signed long int utcA0; // -2147483648~2147483647 - unsigned char utcTot; // 0~255 - unsigned char utcWNt; // 0~255 - signed char utcDeltaTls; // -128~127 - unsigned char utcWNlsf; // 0~255 - signed char utcDN; // -128~127 - signed char utcDeltaTlsf; // -128~127 -}__attribute__ ((packed)) tapi_gps_utc_model_t; - -typedef struct { - signed char dataId; // only for 3G, 0~3, if this value is -1, it means this value is invalid - unsigned char satId; - unsigned short almanacE; // 0~65536 - unsigned char almanacToa; // 0~255 - signed short almanacKsii; // -32768~3276 - signed short almanacOmegaDot; // -32768~3276 - unsigned char almanacSvHealth; // 0~255 - unsigned long int almanacAPowerHalf; // 0~16777215 - signed long int almanacOmega0; // -8388608~8388607 - signed long int almanacW; // -8388608~8388607 - signed long int almanacM0; // -8388608~8388607 - signed short almanacAf0; // -1024~1023 - signed short almanacAf1; // -1024~1023 -}__attribute__ ((packed)) tapi_gps_almanac_sat_info_t; - -typedef struct { - unsigned char almanacWNa; // 0~255 - unsigned long int numberOfSat; - tapi_gps_almanac_sat_info_t AlmanacSatInfo[64]; -}__attribute__ ((packed)) tapi_gps_almanac_model_t; - -typedef struct { - tapi_gps_utran_gps_ref_time_t AcqUtranGpsRefTime; - tapi_gps_utran_gps_unc_t AcqUtranGpsUncertainty; -}__attribute__ ((packed)) tapi_gps_acq_utran_time_t; - -typedef struct { - unsigned char satId; - signed short doppler0; // -2048~2047 (real value is from -5120 to 5117.5 by step of 2.5) - unsigned char doppler1; // 0~63 (real value is from -0.966 to 0.483 by step of 0.023) - unsigned char dopplerUncertainty; // 0~7 (12.5, 25, 50, 100, 200) - unsigned short codePhase; // 0~1022 - unsigned char intCodePhase; // 0~19 - unsigned char gpsBitNumber; // 0~3 - unsigned char codePhaseSearchWindow; // 0~15 (1023, 1, 2, 3, 4, 6, 8, 12, 16, 24, 32, 48, 64, 96, 128, 192) - unsigned char azimuth; // 0~31, 11.25 degree resolution - unsigned char elevation; // 0~7, 11.25 degree resolution -}__attribute__ ((packed)) tapi_gps_acq_sat_info_t; - -typedef struct { - unsigned long int gpsTow; - union { - tapi_gps_gsm_time_t gsm_time; - tapi_gps_acq_utran_time_t AcqUtranTime; - } acquisitionTimeInfo; - unsigned long int numberOfSat; - tapi_gps_acq_sat_info_t lcsAcquisitionSatInfo[16]; -}__attribute__ ((packed)) tapi_gps_acq_assist_t; - -typedef struct { - unsigned char satId[16]; - unsigned char numOfSat; -}__attribute__ ((packed)) tapi_gps_r_time_int_t; - -typedef struct { - unsigned long int flag; -// tapi_gps_carrier_e_type cr_type; - tapi_gps_ref_time_t ref_time; - tapi_gps_ref_loc_t ref_loc; - tapi_gps_dgps_correction_t dgps_corrections; - tapi_gps_navi_model_t navi_model; - tapi_gps_iono_model_t iono_model; - tapi_gps_utc_model_t utc_model; - tapi_gps_almanac_model_t almanac; - tapi_gps_acq_assist_t acq_assist; - tapi_gps_r_time_int_t r_time_int; -}__attribute__ ((packed)) tapi_gps_assist_data_noti_t; //APGPS - GPS Assist Data Message - Notification - -typedef struct { - unsigned char lock_status; - unsigned char afc_update; -}__attribute__ ((packed)) tapi_gps_frequency_aiding_noti_t; - -/* GPS Chipset on AP - END */ - -static char data_gps_set_frequency_aiding[MENU_DATA_SIZE + 1] = "1"; -static char data_smart_assistant_area_index[MENU_DATA_SIZE + 1] = "1"; -static char data_smart_assistant_area_mode[MENU_DATA_SIZE + 1] = "1"; - -static void _gps_hex_dump(char *pad, int size, const void *data) -{ - char buf[255] = {0, }; - char hex[4] = {0, }; - int i; - unsigned char *p; - - if (size <= 0) { - msg("%sno data", pad); - return; - } - p = (unsigned char *)data; - - snprintf(buf, 255, "%s%04X: ", pad, 0); - for (i = 0; iflag); - g_free(decoded_data); -} - -static void on_ind_measure_position(TapiHandle *handle, const char *noti_id, void *data, void *user_data) -{ - guchar *decoded_data = NULL; - gsize length; - tapi_gps_measure_position_indi_t *ind = NULL; - - msg(""); - msgb("event(%s) receive !!", TAPI_IND_GPS_MEASURE_POSITION); - msg("data=%p", data); - if(!data) - return; - - msg(" ## Before decoding ##"); - _gps_print_dump(strlen(data), data); - - decoded_data = g_base64_decode((const gchar *)data, &length); - ind = (tapi_gps_measure_position_indi_t *)decoded_data; - - msg(" ## After decoding ##"); - _gps_print_dump(length, decoded_data); - - msg(" - length = %d", length); - msg(" - method_type = %d", ind->method_type); - msg(" - rsp_time = %d", ind->rsp_time); - msg(" - use_multi_sets = %d", ind->use_multi_sets); - msg(" - environment_char = %d", ind->environment_char); - msg(" - cell_timing_wnt = %d", ind->cell_timing_wnt); - msg(" - add_assist_req = %d", ind->add_assist_req); - g_free(decoded_data); -} - -static void on_noti_reset_assist_data(TapiHandle *handle, const char *noti_id, void *data, void *user_data) -{ - msg(""); - msgb("event(%s) receive !!", TAPI_NOTI_GPS_RESET_ASSIST_DATA); - msg("data=%p", data?data:0); -} - -static void on_noti_frequency_aiding(TapiHandle *handle, const char *noti_id, void *data, void *user_data) -{ - tapi_gps_frequency_aiding_noti_t *noti = (tapi_gps_frequency_aiding_noti_t *)data; - - msg(""); - msgb("event(%s) receive !!", TAPI_NOTI_GPS_FREQUENCY_AIDING); - msg("data=%p", data); - if(!data) - return; - - msg(" - lock = %d", noti->lock_status); - msg(" - afc_update = %d", noti->afc_update); -} - -static void on_noti_area_status(TapiHandle *handle, const char *noti_id, void *data, void *user_data) -{ - struct tel_noti_smart_assistant_area_status *noti = (struct tel_noti_smart_assistant_area_status *)data; - - msg(""); - msgb("event(%s) receive !!", TAPI_NOTI_SMART_ASSISTANT_AREA_STATUS); - msg("data=%p", data); - if(!data) - return; - - msg(" - area_status(1:IN, 2:OUT) = %d", noti->area_status); - msg(" - index = %d", noti->index); -} - -static void on_noti_sync_status(TapiHandle *handle, const char *noti_id, void *data, void *user_data) -{ - struct tel_noti_smart_assistant_sync_status *noti = (struct tel_noti_smart_assistant_sync_status *)data; - - msg(""); - msgb("event(%s) receive !!", TAPI_NOTI_SMART_ASSISTANT_SYNC_STATUS); - msg("data=%p", data); - if(!data) - return; - - msg(" - init_status(1:Success, 2:Fail) = %d", noti->init_status); - msg(" - init_fail_cause = %d", noti->init_fail_cause); -} - -/* Response */ -static void on_gps_set_frequency_aiding(TapiHandle *handle, int result, void *data, void *user_data) -{ - msg(""); - msgb("tel_set_gps_frequency_aiding() response receive"); - msg(" - result = 0x%x", result); -} - -static void on_enable_smart_assistant(TapiHandle *handle, int result, void *data, void *user_data) -{ - msg(""); - msgb("tel_enable_smart_assistant() response receive"); - msg(" - result = 0x%x", result); -} - -static void on_disable_smart_assistant(TapiHandle *handle, int result, void *data, void *user_data) -{ - msg(""); - msgb("tel_disable_smart_assistant() response receive"); - msg(" - result = 0x%x", result); -} - -static void on_sync_smart_assistant_area_list(TapiHandle *handle, int result, void *data, void *user_data) -{ - msg(""); - msgb("tel_sync_smart_assistant_area_list() response receive"); - msg(" - result = 0x%x", result); -} - -static void on_del_smart_assistant_area_list(TapiHandle *handle, int result, void *data, void *user_data) -{ - msg(""); - msgb("tel_del_smart_assistant_area_list() response receive"); - msg(" - result = 0x%x", result); -} - -static void on_add_smart_assistant_area(TapiHandle *handle, int result, void *data, void *user_data) -{ - msg(""); - msgb("tel_add_smart_assistant_area() response receive"); - msg(" - result = 0x%x", result); -} - -static void on_modify_smart_assistant_area(TapiHandle *handle, int result, void *data, void *user_data) -{ - msg(""); - msgb("tel_set_gps_frequency_aiding() response receive"); - msg(" - result = 0x%x", result); -} - -static void on_set_smart_assistant_info(TapiHandle *handle, int result, void *data, void *user_data) -{ - msg(""); - msgb("tel_set_smart_assistant_info() response receive"); - msg(" - result = 0x%x", result); -} - - -/* Request */ -static int run_gps_set_frequency_aiding(MManager *mm, struct menu_data *menu) -{ - TapiHandle *handle = menu_manager_ref_user_data(mm); - int result; - unsigned char state; - msg("call tel_set_gps_frequency_aiding()"); - - state = atoi(data_gps_set_frequency_aiding); - - result = tel_set_gps_frequency_aiding(handle, state, on_gps_set_frequency_aiding, NULL); - if (result != TAPI_API_SUCCESS) { - msg("failed. (result = %d)", result); - } - msg("exit"); - - return 0; -} - -static int run_gps_confirm_measure_position(MManager *mm, struct menu_data *menu) -{ - TapiHandle *handle = menu_manager_ref_user_data(mm); - int result; - tapi_gps_measure_position_confirm_t data; - - msg("call tel_confirm_gps_measure_pos()."); - _gps_print_dump(sizeof(tapi_gps_measure_position_confirm_t), &data); - - result = tel_confirm_gps_measure_pos(handle, (unsigned char *)&data, sizeof(tapi_gps_measure_position_confirm_t)); - - if (result != TAPI_API_SUCCESS) { - msg("failed. (result = %d)", result); - } - msg("exit"); - return 0; -} - -static int run_enable_smart_assistant(MManager *mm, struct menu_data *menu) -{ - TapiHandle *handle = menu_manager_ref_user_data(mm); - int result; - msg("call tel_enable_smart_assistant()"); - - result = tel_enable_smart_assistant(handle, on_enable_smart_assistant, NULL); - if (result != TAPI_API_SUCCESS) { - msg("failed. (result = %d)", result); - } - msg("exit"); - - return 0; -} - -static int run_disable_smart_assistant(MManager *mm, struct menu_data *menu) -{ - TapiHandle *handle = menu_manager_ref_user_data(mm); - int result; - msg("call tel_disable_smart_assistant()"); - - result = tel_disable_smart_assistant(handle, on_disable_smart_assistant, NULL); - if (result != TAPI_API_SUCCESS) { - msg("failed. (result = %d)", result); - } - msg("exit"); - - return 0; -} -static int run_sync_smart_assistant_area_list(MManager *mm, struct menu_data *menu) -{ - TapiHandle *handle = menu_manager_ref_user_data(mm); - TelSmartAssistantAreaList_t area_list; - int result; - - memset(&area_list, 0, sizeof(TelSmartAssistantAreaList_t)); - - area_list.count = 3; - area_list.area[0].index = 1; - area_list.area[0].mode_state = TAPI_SMART_ASSISTANT_MODE_STATE_START; - area_list.area[1].index = 2; - area_list.area[1].mode_state = TAPI_SMART_ASSISTANT_MODE_STATE_STOP; - area_list.area[2].index = 3; - area_list.area[2].mode_state = TAPI_SMART_ASSISTANT_MODE_STATE_START; - msg("call tel_sync_smart_assistant_area_list()"); - - result = tel_sync_smart_assistant_area_list(handle, &area_list, on_sync_smart_assistant_area_list, NULL); - if (result != TAPI_API_SUCCESS) { - msg("failed. (result = %d)", result); - } - msg("exit"); - - return 0; -} -static int run_del_smart_assistant_area_list(MManager *mm, struct menu_data *menu) -{ - TapiHandle *handle = menu_manager_ref_user_data(mm); - TelSmartAssistantAreaList_t area_list; - int result; - - memset(&area_list, 0, sizeof(TelSmartAssistantAreaList_t)); - area_list.count = 3; - area_list.area[0].index = 1; - area_list.area[0].mode_state = TAPI_SMART_ASSISTANT_MODE_STATE_START; - area_list.area[1].index = 2; - area_list.area[1].mode_state = TAPI_SMART_ASSISTANT_MODE_STATE_STOP; - area_list.area[2].index = 3; - area_list.area[2].mode_state = TAPI_SMART_ASSISTANT_MODE_STATE_START; - - msg("call tel_del_smart_assistant_area_list()"); - - result = tel_del_smart_assistant_area_list(handle, &area_list, on_del_smart_assistant_area_list, NULL); - if (result != TAPI_API_SUCCESS) { - msg("failed. (result = %d)", result); - } - msg("exit"); - - return 0; -} -static int run_add_smart_assistant_area(MManager *mm, struct menu_data *menu) -{ - TapiHandle *handle = menu_manager_ref_user_data(mm); - TelSmartAssistantArea_t area; - int result; - - area.index = atoi(data_smart_assistant_area_index); - area.mode_state = atoi(data_smart_assistant_area_mode); - - msg("call tel_add_smart_assistant_area() index=%d", area.index); - - result = tel_add_smart_assistant_area(handle, &area, on_add_smart_assistant_area, NULL); - if (result != TAPI_API_SUCCESS) { - msg("failed. (result = %d)", result); - } - msg("exit"); - - return 0; -} -static int run_modify_smart_assistant_area(MManager *mm, struct menu_data *menu) -{ - TapiHandle *handle = menu_manager_ref_user_data(mm); - TelSmartAssistantArea_t area; - int result; - - area.index = atoi(data_smart_assistant_area_index); - area.mode_state = atoi(data_smart_assistant_area_mode); - - msg("call tel_modify_smart_assistant_area() index=%d", area.index); - - result = tel_modify_smart_assistant_area(handle, &area, on_modify_smart_assistant_area, NULL); - if (result != TAPI_API_SUCCESS) { - msg("failed. (result = %d)", result); - } - msg("exit"); - - return 0; -} -static int run_set_smart_assistant_info(MManager *mm, struct menu_data *menu) -{ - TapiHandle *handle = menu_manager_ref_user_data(mm); - TelSmartAssistantInfo_t info; - int result; - - info.index = atoi(data_smart_assistant_area_index); - info.lpp_state = atoi(data_smart_assistant_area_mode); - - msg("call tel_set_smart_assistant_info() index=%d", info.index); - - result = tel_set_smart_assistant_info(handle, &info, on_set_smart_assistant_info, NULL); - if (result != TAPI_API_SUCCESS) { - msg("failed. (result = %d)", result); - } - msg("exit"); - - return 0; -} - -/* Menu */ -static struct menu_data menu_gps_set_frequency_aiding[] = { - { "1", "state (0=Disable, 1=Enable)", NULL, NULL, data_gps_set_frequency_aiding}, - { "2", "run", NULL, run_gps_set_frequency_aiding, NULL}, - { NULL, NULL, }, -}; - -static struct menu_data menu_gps_confirm_measure_position[] = { - { "1", "run", NULL, run_gps_confirm_measure_position, NULL}, - { NULL, NULL, }, -}; - -static struct menu_data menu_enable_smart_assistant[] = { - { "1", "run", NULL, run_enable_smart_assistant, NULL}, - { NULL, NULL, }, -}; - -static struct menu_data menu_disable_smart_assistant[] = { - { "1", "run", NULL, run_disable_smart_assistant, NULL}, - { NULL, NULL, }, -}; - -static struct menu_data menu_sync_smart_assistant_area_list[] = { - { "1", "run", NULL, run_sync_smart_assistant_area_list, NULL}, - { NULL, NULL, }, -}; - -static struct menu_data menu_del_smart_assistant_area_list[] = { - { "1", "run", NULL, run_del_smart_assistant_area_list, NULL}, - { NULL, NULL, }, -}; - -static struct menu_data menu_add_smart_assistant_area[] = { - { "1", "index (1=Default Index)", NULL, NULL, data_smart_assistant_area_index}, - { "2", "mode (1=Enable, 2=Disable)", NULL, NULL, data_smart_assistant_area_mode}, - { "3", "run", NULL, run_add_smart_assistant_area, NULL}, - { NULL, NULL, }, -}; - -static struct menu_data menu_modify_smart_assistant_area[] = { - { "1", "index (1=Default Index)", NULL, NULL, data_smart_assistant_area_index}, - { "2", "mode (1=Enable, 2=Disable)", NULL, NULL, data_smart_assistant_area_mode}, - { "3", "run", NULL, run_modify_smart_assistant_area, NULL}, - { NULL, NULL, }, -}; - -static struct menu_data menu_set_smart_assistant_info[] = { - { "1", "index (1=Default Index)", NULL, NULL, data_smart_assistant_area_index}, - { "2", "lpp_state (1=Start, 2=Stop)", NULL, NULL, data_smart_assistant_area_mode}, - { "3", "run", NULL, run_set_smart_assistant_info, NULL}, - { NULL, NULL, }, -}; - -struct menu_data menu_gps[] = { - { "1", "SET Frequency Aiding", menu_gps_set_frequency_aiding, NULL, NULL}, - { "2", "CONFIRM Measure Position", menu_gps_confirm_measure_position, NULL, NULL}, - { "3", "ENABLE Smart Assistant", menu_enable_smart_assistant, NULL, NULL}, - { "4", "DISABLE Smart Assistant", menu_disable_smart_assistant, NULL, NULL}, - { "5", "SYNC Smart Assistant Area List", menu_sync_smart_assistant_area_list, NULL, NULL}, - { "6", "DELETE Smart Assistant Area List", menu_del_smart_assistant_area_list, NULL, NULL}, - { "7", "ADD Smart Assistant Area", menu_add_smart_assistant_area, NULL, NULL}, - { "8", "MODIFY Smart Assistant Area", menu_modify_smart_assistant_area, NULL, NULL}, - { "9", "SET Smart Assistant info", menu_set_smart_assistant_info, NULL, NULL}, - { NULL, NULL, }, -}; - -void register_gps_event(TapiHandle *handle) -{ - int ret; - - /* Gps */ - ret = tel_register_noti_event(handle, TAPI_NOTI_GPS_ASSIST_DATA, on_noti_assist_data, NULL); - if (ret != TAPI_API_SUCCESS) { - msg("event register failed(%d)", ret); - } - - ret = tel_register_noti_event(handle, TAPI_IND_GPS_MEASURE_POSITION, on_ind_measure_position, NULL); - if (ret != TAPI_API_SUCCESS) { - msg("event register failed(%d)", ret); - } - - ret = tel_register_noti_event(handle, TAPI_NOTI_GPS_RESET_ASSIST_DATA, on_noti_reset_assist_data, NULL); - if (ret != TAPI_API_SUCCESS) { - msg("event register failed(%d)", ret); - } - - ret = tel_register_noti_event(handle, TAPI_NOTI_GPS_FREQUENCY_AIDING, on_noti_frequency_aiding, NULL); - if (ret != TAPI_API_SUCCESS) { - msg("event register failed(%d)", ret); - } - - ret = tel_register_noti_event(handle, TAPI_NOTI_SMART_ASSISTANT_AREA_STATUS, on_noti_area_status, NULL); - if (ret != TAPI_API_SUCCESS) { - msg("event register failed(%d)", ret); - } - - ret = tel_register_noti_event(handle, TAPI_NOTI_SMART_ASSISTANT_SYNC_STATUS, on_noti_sync_status, NULL); - if (ret != TAPI_API_SUCCESS) { - msg("event register failed(%d)", ret); - } -} diff --git a/wearable/test_src/gps.h b/wearable/test_src/gps.h deleted file mode 100644 index f1df777..0000000 --- a/wearable/test_src/gps.h +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Telephony test application - * - * Copyright (c) 2012 Samsung Electronics Co., Ltd. All rights reserved. - * - * Contact: Ja-young Gu - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT 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 __GPS_H__ -#define __GPS_H__ - - -void register_gps_event(TapiHandle *handle); - -#endif diff --git a/wearable/unit-test/CMakeLists.txt b/wearable/unit-test/CMakeLists.txt deleted file mode 100644 index e26654f..0000000 --- a/wearable/unit-test/CMakeLists.txt +++ /dev/null @@ -1,34 +0,0 @@ -CMAKE_MINIMUM_REQUIRED(VERSION 2.6) -PROJECT(libslp-tapi-unit-test C) - -SET(PREFIX ${CMAKE_INSTALL_PREFIX}) -SET(EXEC_PREFIX "\${prefix}") -SET(LIBDIR "\${prefix}/lib") -SET(INCLUDEDIR "\${prefix}/include") - -SET(TESTS - test-thread -) - -REMOVE_DEFINITIONS("-DTAPI_LOG_TAG=\"LIBTAPI\"") -ADD_DEFINITIONS("-DTAPI_LOG_TAG=\"TAPIUNIT\"") - -FOREACH(test ${TESTS}) - ADD_EXECUTABLE(${test} ${test}.c) - TARGET_LINK_LIBRARIES(${test} ${pkgs_LDFLAGS} "-L${CMAKE_BINARY_DIR} -lSLP-tapi") -# INSTALL(TARGETS ${test} RUNTIME DESTINATION bin/) - ADD_DEPENDENCIES(${test} run.sh) - SET(TEST_LIST "${TEST_LIST} ${test}") -ENDFOREACH(test) - - -ADD_CUSTOM_TARGET(run.sh) -ADD_CUSTOM_COMMAND( - TARGET run.sh - POST_BUILD - COMMAND echo "gtester ${TEST_LIST} -o report.xml" > run.sh - COMMAND chmod +x run.sh - COMMENT "Generating gtester script" - VERBATIM # for double-quoted strings.. - ) -ADD_DEPENDENCIES(run.sh SLP-tapi) diff --git a/wearable/unit-test/log.h b/wearable/unit-test/log.h deleted file mode 100644 index a87ba51..0000000 --- a/wearable/unit-test/log.h +++ /dev/null @@ -1,64 +0,0 @@ -/* - * libslp-tapi - * - * Copyright (c) 2012 Samsung Electronics Co., Ltd. All rights reserved. - * - * Contact: Ja-young Gu - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT 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_UNIT_TEST_LOG_H__ -#define __TAPI_UNIT_TEST_LOG_H__ - -__BEGIN_DECLS - -#ifdef FEATURE_DLOG_DEBUG - -#include - -#ifndef TAPI_LOG_TAG -#define TAPI_LOG_TAG "TAPIUNIT" -#endif - -#define msg(fmt,args...) { RLOG(LOG_INFO, TAPI_LOG_TAG, fmt "\n", ##args); } -#define dbg(fmt,args...) { RLOG(LOG_DEBUG, TAPI_LOG_TAG, fmt "\n", ##args); } -#define warn(fmt,args...) { RLOG(LOG_WARN, TAPI_LOG_TAG, fmt "\n", ##args); } -#define err(fmt,args...) { RLOG(LOG_ERROR, TAPI_LOG_TAG, fmt "\n", ##args); } -#define fatal(fmt,args...) { RLOG(LOG_FATAL, TAPI_LOG_TAG, fmt "\n", ##args); } - -#define smsg(fmt,args...) { SECURE_RLOG(LOG_INFO, TAPI_LOG_TAG, fmt "\n", ##args); } -#define sdbg(fmt,args...) { SECURE_RLOG(LOG_DEBUG, TAPI_LOG_TAG, fmt "\n", ##args); } -#define swarn(fmt,args...) { SECURE_RLOG(LOG_WARN, TAPI_LOG_TAG, fmt "\n", ##args); } -#define serr(fmt,args...) { SECURE_RLOG(LOG_ERROR, TAPI_LOG_TAG, fmt "\n", ##args); } -#define sfatal(fmt,args...) { SECURE_RLOG(LOG_FATAL, TAPI_LOG_TAG, fmt "\n", ##args); } - -#else - -#define msg(fmt,args...) -#define dbg(fmt,args...) -#define warn(fmt,args...) -#define err(fmt,args...) -#define fatal(fmt,args...) - -#define smsg(fmt,args...) -#define sdbg(fmt,args...) -#define swarn(fmt,args...) -#define serr(fmt,args...) -#define sfatal(fmt,args...) - -#endif - -__END_DECLS - -#endif diff --git a/wearable/unit-test/test-thread.c b/wearable/unit-test/test-thread.c deleted file mode 100644 index 9173d82..0000000 --- a/wearable/unit-test/test-thread.c +++ /dev/null @@ -1,162 +0,0 @@ -/* - * 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 -#include -#include -#include -#include -#include -#include - -#include -#include - -#include -#include -#include - -#include "log.h" - - -static pid_t get_tid () -{ - return syscall (__NR_gettid); -} - -struct meta_data { - pid_t tid; - GMainLoop *loop; - GMainContext *context; -}; - -static void on_cb (TapiHandle *h, int result, void *data, void *user_data) -{ - struct meta_data *m = user_data; - int *status = data; - - g_assert (m != NULL); - g_assert (m->tid == get_tid()); - - dbg ("response: %d", *status); - g_main_loop_quit (m->loop); -} - -static gboolean on_timeout (gpointer user_data) -{ - g_assert_not_reached (); - return FALSE; -} - -static void *do_blocking_request_response (gpointer user_data) -{ - struct meta_data m; - TapiHandle *h = user_data; - GSource *timer; - int ret; - - m.tid = get_tid(); - m.context = g_main_context_new(); - m.loop = g_main_loop_new (m.context, FALSE); - - g_main_context_push_thread_default (m.context); - - if (!user_data) { - h = tel_init (NULL); - g_assert (h != NULL); - } - - ret = tel_get_flight_mode (h, on_cb, &m); - g_assert (ret == TAPI_API_SUCCESS); - - timer = g_timeout_source_new_seconds (60); - g_source_set_callback (timer, on_timeout, &m, NULL); - g_source_attach (timer, m.context); - g_source_unref (timer); - - g_main_loop_run (m.loop); - - g_main_context_pop_thread_default (m.context); - g_main_context_unref (m.context); - g_main_loop_unref (m.loop); - - if (!user_data) - tel_deinit (h); - - return NULL; -} - -static void test_each_request (void) -{ - GThread *th1; - GThread *th2; - - /* Request from A thread */ - th1 = g_thread_new ("test1-A", do_blocking_request_response, NULL); - g_assert (th1 != NULL); - - /* Request from B thread */ - th2 = g_thread_new ("test1-B", do_blocking_request_response, NULL); - g_assert (th2 != NULL); - - g_thread_join (th1); - g_thread_join (th2); -} - -static void test_cross_request (void) -{ - GThread *th1; - GThread *th2; - GThread *th3; - TapiHandle *h; - - h = tel_init (NULL); - g_assert (h != NULL); - - /* Request from A thread with shared handle */ - th1 = g_thread_new ("test2-A", do_blocking_request_response, h); - g_assert (th1 != NULL); - - /* Sync Request from Default context */ - g_assert (tel_get_misc_me_imei_sync (h) != NULL); - - /* Request from B thread with custom handle */ - th2 = g_thread_new ("test2-B", do_blocking_request_response, NULL); - g_assert (th2 != NULL); - - /* Request from C thread with shared handle */ - th3 = g_thread_new ("test3-C", do_blocking_request_response, h); - g_assert (th3 != NULL); - - g_thread_join (th1); - g_thread_join (th2); - g_thread_join (th3); - - tel_deinit (h); -} - -int main (int argc, char **argv) -{ - g_test_init (&argc, &argv, NULL); - g_type_init (); - - g_test_add_func ("/thread/each_request", test_each_request); - g_test_add_func ("/thread/cross_request", test_cross_request); - - return g_test_run(); -}