From d42c91c28efb1442cfe4b03a463434f2238dcd1a Mon Sep 17 00:00:00 2001 From: Dongchul Lim Date: Mon, 7 Apr 2014 19:44:08 +0900 Subject: [PATCH] Initial refactoring merge Change-Id: I7f4b94178ae6092ec29ba7658836e605f5b1722c --- AUTHORS | 6 - CMakeLists.txt | 50 +- LICENSE | 408 +-- include/at.h | 197 +- include/co_call.h | 321 +- include/co_context.h | 234 +- include/co_gps.h | 41 +- include/co_modem.h | 58 +- include/co_network.h | 164 +- include/co_phonebook.h | 57 +- include/co_ps.h | 61 +- include/co_sap.h | 49 +- include/co_sat.h | 104 +- include/co_sim.h | 428 ++- include/co_sms.h | 100 +- include/co_ss.h | 214 +- include/common/tel_call.h | 831 +++++ include/common/tel_gps.h | 126 + include/{type/gps.h => common/tel_if.h} | 34 +- include/common/tel_modem.h | 136 + include/common/tel_network.h | 355 ++ include/common/tel_phonebook.h | 253 ++ include/common/tel_return.h | 54 + include/common/tel_sap.h | 179 + include/common/tel_sat.h | 1813 ++++++++++ include/common/tel_sim.h | 703 ++++ include/common/tel_sms.h | 332 ++ include/common/tel_ss.h | 421 +++ include/communicator.h | 57 +- include/core_object.h | 184 +- include/hal.h | 118 +- include/log.h | 23 +- include/mux.h | 31 +- include/plugin.h | 56 +- include/queue.h | 156 +- include/server.h | 95 +- include/storage.h | 262 +- include/tcore.h | 75 +- include/type/call.h | 642 ---- include/type/command.h | 174 + include/type/common.h | 106 +- include/type/modem.h | 138 - include/type/network.h | 406 --- include/type/notification.h | 268 +- include/type/phonebook.h | 233 -- include/type/ps.h | 239 +- include/type/request.h | 213 -- include/type/response.h | 202 -- include/type/sap.h | 160 - include/type/sat.h | 1789 ---------- include/type/sat_internal.h | 1262 +++++++ include/type/sim.h | 992 ------ include/type/sms.h | 1012 ------ include/type/sound.h | 90 - include/type/ss.h | 330 -- include/udev.h | 23 +- include/user_request.h | 84 - include/util.h | 238 +- packaging/libtcore.spec | 6 +- src/at.c | 818 ++--- src/co_call.c | 1459 +++----- src/co_context.c | 807 ++--- src/co_gps.c | 193 +- src/co_modem.c | 351 +- src/co_network.c | 985 ++---- src/co_phonebook.c | 341 +- src/co_ps.c | 777 ++--- src/co_sap.c | 301 +- src/co_sat.c | 5779 ++++++++++++++++--------------- src/co_sim.c | 2957 ++++++---------- src/co_sms.c | 608 +--- src/co_ss.c | 529 ++- src/communicator.c | 100 +- src/core_object.c | 1444 +++++--- src/hal.c | 450 ++- src/mux.c | 954 ++--- src/plugin.c | 376 +- src/queue.c | 669 ++-- src/server.c | 847 ++--- src/storage.c | 332 +- src/udev.c | 5 +- src/user_request.c | 304 -- src/util.c | 2271 +++++++----- tcore.pc.in | 2 +- 84 files changed, 20223 insertions(+), 20829 deletions(-) delete mode 100644 AUTHORS mode change 100644 => 100755 CMakeLists.txt mode change 100644 => 100755 include/co_ps.h create mode 100644 include/common/tel_call.h create mode 100644 include/common/tel_gps.h rename include/{type/gps.h => common/tel_if.h} (57%) create mode 100644 include/common/tel_modem.h create mode 100644 include/common/tel_network.h create mode 100644 include/common/tel_phonebook.h create mode 100644 include/common/tel_return.h create mode 100644 include/common/tel_sap.h create mode 100644 include/common/tel_sat.h create mode 100644 include/common/tel_sim.h create mode 100644 include/common/tel_sms.h create mode 100755 include/common/tel_ss.h delete mode 100644 include/type/call.h create mode 100644 include/type/command.h delete mode 100644 include/type/modem.h delete mode 100755 include/type/network.h delete mode 100644 include/type/phonebook.h delete mode 100644 include/type/request.h delete mode 100644 include/type/response.h delete mode 100644 include/type/sap.h delete mode 100644 include/type/sat.h create mode 100644 include/type/sat_internal.h delete mode 100644 include/type/sim.h delete mode 100644 include/type/sms.h delete mode 100644 include/type/sound.h delete mode 100644 include/type/ss.h delete mode 100644 include/user_request.h mode change 100644 => 100755 src/co_ps.c delete mode 100644 src/user_request.c mode change 100644 => 100755 src/util.c diff --git a/AUTHORS b/AUTHORS deleted file mode 100644 index 0e9faa9..0000000 --- a/AUTHORS +++ /dev/null @@ -1,6 +0,0 @@ -Jongman Park -Ja-young Gu -Kyeongchul Kim -DongHoo Park -Youngman Park -Inho Oh diff --git a/CMakeLists.txt b/CMakeLists.txt old mode 100644 new mode 100755 index 7a22280..a7699c8 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -18,6 +18,8 @@ ENDFOREACH(flag) SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -I${CMAKE_SOURCE_DIR}/include ${EXTRA_CFLAGS} -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wdeclaration-after-statement -Wmissing-declarations -Wredundant-decls -Wcast-align") +INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR} ${CMAKE_SOURCE_DIR}/include ${CMAKE_SOURCE_DIR}/include/common) + ADD_DEFINITIONS("-DFEATURE_TLOG_DEBUG") ADD_DEFINITIONS("-DTCORE_LOG_TAG=\"TCORE\"") ADD_DEFINITIONS("-DTCORE_VERSION=\"${VERSION}\"") @@ -26,30 +28,30 @@ MESSAGE(${CMAKE_C_FLAGS}) MESSAGE(${CMAKE_EXE_LINKER_FLAGS}) SET(SRCS - src/server.c - src/plugin.c - src/hal.c - src/at.c - src/udev.c - src/communicator.c - src/storage.c - src/queue.c - src/user_request.c - src/util.c - src/core_object.c - src/co_modem.c - src/co_network.c - src/co_ps.c - src/co_context.c - src/co_sim.c - src/co_sat.c - src/co_sap.c - src/co_call.c - src/co_ss.c - src/co_sms.c - src/co_phonebook.c - src/co_gps.c - src/mux.c + + src/server.c + src/plugin.c + src/hal.c + src/at.c +# src/udev.c + src/communicator.c + src/storage.c + src/queue.c + src/util.c + src/core_object.c + src/co_modem.c + src/co_network.c + src/co_ps.c + src/co_context.c + src/co_sim.c + src/co_sat.c + src/co_sap.c + src/co_call.c + src/co_ss.c + src/co_sms.c + src/co_phonebook.c + src/co_gps.c + src/mux.c ) diff --git a/LICENSE b/LICENSE index bae7f54..3d69259 100644 --- a/LICENSE +++ b/LICENSE @@ -1,204 +1,204 @@ -Copyright (c) 2000 - 2012 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. - +Copyright (c) 2000 - 2012 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/include/at.h b/include/at.h index 383ffdb..b50baad 100644 --- a/include/at.h +++ b/include/at.h @@ -1,9 +1,8 @@ /* * libtcore * - * Copyright (c) 2012 Samsung Electronics Co., Ltd. All rights reserved. - * - * Contact: Ja-young Gu + * Copyright (c) 2013 Samsung Electronics Co. Ltd. All rights reserved. + * Copyright (c) 2013 Intel Corporation. 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. @@ -18,140 +17,84 @@ * limitations under the License. */ -#ifndef __TCORE_AT_H__ -#define __TCORE_AT_H__ +#ifndef __AT_H__ +#define __AT_H__ -__BEGIN_DECLS +#ifdef __cplusplus +extern "C" { +#endif #include #include -#define ZERO 0 - -enum tcore_at_command_type { - TCORE_AT_NO_RESULT, /* no intermediate response expected */ - TCORE_AT_NUMERIC, /* a single intermediate response starting with a 0-9 */ - TCORE_AT_SINGLELINE, /* a single intermediate response starting with a prefix */ - TCORE_AT_MULTILINE, /* multiple line intermediate response starting with a prefix */ - TCORE_AT_PDU -}; - -enum ATCMEError{ - AT_ERROR_MOBILE_FAILRURE =0, - AT_ERROR_NOT_CONNECTED_TO_PHONE =1, - AT_ERROR_LINK_RESERVED =2, - AT_ERROR_OPER_NOT_ALLOWED =3, - AT_ERROR_OPER_NOT_SUPPORTED =4, - AT_ERROR_PH_SIM_PIN_REQUIRED =5, - AT_ERROR_PH_FSIM_PIN_REQUIRED =6, - AT_ERROR_PH_FSIM_PUK_REQUIRED =7, - - AT_ERROR_SIM_NOT_INSERTED =10, - AT_ERROR_SIM_PIN_REQUIRED =11, - AT_ERROR_SIM_PUK_REQUIRED =12, - AT_ERROR_SIM_FAILURE =13, - AT_ERROR_SIM_BUSY =14, - AT_ERROR_SIM_WRONG =15, - AT_ERROR_INCORRECT_PWD =16, - AT_ERROR_SIM_PIN2_REQUIRED =17, - AT_ERROR_SIM_PUK2_REQUIRED =18, - - AT_ERROR_MEMORY_FULL =20, - AT_ERROR_INVALID_INDEX =21, - AT_ERROR_NOT_FOUND =22, - AT_ERROR_MEMORY_FAILURE =23, - AT_ERROR_TEXT_TOO_LONG =24, - AT_ERROR_INVALID_CHAR_IN_STR =25, - AT_ERROR_DIAL_TOO_LONG =26, - AT_ERROR_INVALID_CHAR_IN_DIAL =27, - - AT_ERROR_NO_NETWORK_SVC =30, - AT_ERROR_NETWORK_TIMEOUT =31, - AT_ERROR_EMERGENCY_CALL_ONLY =32, - - AT_ERROR_NET_PERSONAL_PIN_REQ =40, - AT_ERROR_NET_PERSONAL_PUN_REQ =41, - AT_ERROR_NET_SUB_PERSONAL_PIN_REQ =42, - AT_ERROR_NET_SUB_PERSONAL_PUK_REQ =43, - AT_ERROR_PROVIDER_PERSONAL_PIN_REQ =44, - AT_ERROR_PROVIDER_PERSONAL_PUK_REQ =45, - AT_ERROR_CORP_PERSONAL_PIN_REQ =46, - AT_ERROR_CORP_PERSONAL_PUK_REQ =47, - AT_ERROR_HIDDEN_KEY_REQUIRED =48, - AT_ERROR_EAP_METHOD_NOT_SUPPORTED =49, - AT_ERROR_INCORRECT_PARAM =50, - - AT_ERROR_UNKNOWN =100 -}; - - -struct tcore_at_request { - char *cmd; - char *next_send_pos; - char *prefix; - enum tcore_at_command_type type; -}; - -struct tcore_at_response { - int success; /* true if final response indicates success (eg "OK") */ - char *final_response; /* eg OK, ERROR */ +#define ZERO 0 + +typedef enum { + TCORE_AT_COMMAND_TYPE_NO_RESULT, /* no intermediate response expected */ + TCORE_AT_COMMAND_TYPE_NUMERIC, /* a single intermediate response starting with a 0-9 */ + TCORE_AT_COMMAND_TYPE_SINGLELINE, /* a single intermediate response starting with a prefix */ + TCORE_AT_COMMAND_TYPE_MULTILINE, /* multiple line intermediate response starting with a prefix */ + TCORE_AT_COMMAND_TYPE_PDU +} TcoreAtCommandType; + +typedef struct { + gchar *cmd; + gchar *prefix; + TcoreAtCommandType type; + + gchar *next_send_pos; +} TcoreAtRequest; + +typedef struct { + gboolean success; /* true if final response indicates success (eg "OK") */ + gchar *final_response; /* eg OK, ERROR */ GSList *lines; /* any intermediate responses */ -}; +} TcoreAtResponse; -typedef gboolean (*TcoreATNotificationCallback)(TcoreAT *at, const GSList *lines, +typedef gboolean (*TcoreAtNotificationCallback)(TcoreAT *at, const GSList *lines, void *user_data); -typedef struct tcore_at_response TcoreATResponse; -typedef struct tcore_at_request TcoreATRequest; +void tcore_at_process_binary_data(TcoreAT *at, gchar *position, guint data_len); +gboolean tcore_at_add_hook(TcoreHal *hal, void *hook_func); -void tcore_at_process_binary_data(TcoreAT *at,char *position,int data_len); -int sum_4_bytes(char* posn); +TcoreAT *tcore_at_new(TcoreHal *hal); +void tcore_at_free(TcoreAT *at); -gboolean tcore_at_add_hook(TcoreHal *hal, void *hook_func); -TcoreAT* tcore_at_new(TcoreHal *hal); -void tcore_at_free(TcoreAT *at); - -TReturn tcore_at_buf_write(TcoreAT *at, unsigned int data_len, - const char *data); - -TReturn tcore_at_set_request(TcoreAT *at, TcoreATRequest *req, gboolean send); -TcoreATRequest* tcore_at_get_request(TcoreAT *at); -TcoreATResponse* tcore_at_get_response(TcoreAT *at); - -TReturn tcore_at_add_notification(TcoreAT *at, const char *prefix, - gboolean pdu, TcoreATNotificationCallback callback, - void *user_data); -TReturn tcore_at_remove_notification(TcoreAT *at, const char *prefix, - TcoreATNotificationCallback callback); -TReturn tcore_at_remove_notification_full(TcoreAT *at, - const char *prefix, - TcoreATNotificationCallback callback, void *user_data); - -TcoreATRequest* tcore_at_request_new(const char *cmd, const char *prefix, - enum tcore_at_command_type type); -void tcore_at_request_free(TcoreATRequest *req); - -gboolean tcore_at_process(TcoreAT *at, unsigned int data_len, - const char *data); - -TcorePending* tcore_at_pending_new(CoreObject *co, const char *cmd, - const char *prefix, enum tcore_at_command_type type, - TcorePendingResponseCallback func, void *user_data); - -GSList* tcore_at_tok_new(const char *line); -void tcore_at_tok_free(GSList *tokens); -char* tcore_at_tok_extract(const char *src); -char* tcore_at_tok_nth(GSList *tokens, unsigned int token_index); - -TReturn tcore_prepare_and_send_at_request(CoreObject *co, - const char *at_cmd, - const char *at_cmd_prefix, - enum tcore_at_command_type at_cmd_type, - UserRequest *ur, - TcorePendingResponseCallback resp_cb, - void *resp_cb_data, - TcorePendingSendCallback send_cb, - void *send_cb_data); -__END_DECLS +TelReturn tcore_at_buf_write(TcoreAT *at, guint data_len, const gchar *data); +TelReturn tcore_at_set_request(TcoreAT *at, TcoreAtRequest *req, gboolean send); +TcoreAtRequest *tcore_at_get_request(TcoreAT *at); +TcoreAtResponse *tcore_at_get_response(TcoreAT *at); + +TelReturn tcore_at_add_notification(TcoreAT *at, const gchar *prefix, gboolean pdu, + TcoreAtNotificationCallback callback, void *user_data); +TelReturn tcore_at_remove_notification(TcoreAT *at, const gchar *prefix, TcoreAtNotificationCallback callback); +TelReturn tcore_at_remove_notification_full(TcoreAT *at, const gchar *prefix, + TcoreAtNotificationCallback callback, void *user_data); + +TcoreAtRequest *tcore_at_request_new(const gchar *cmd, const gchar *prefix, TcoreAtCommandType type); +void tcore_at_request_free(TcoreAtRequest *at_req); + +gboolean tcore_at_process(TcoreAT *at, guint data_len, const gchar *data); + +TcorePending *tcore_at_pending_new(CoreObject *co, const gchar *cmd, + const gchar *prefix, TcoreAtCommandType type, + TcorePendingResponseCallback func, void *user_data); + +GSList *tcore_at_tok_new(const gchar *line); +void tcore_at_tok_free(GSList *tokens); +gchar *tcore_at_tok_extract(const gchar *src); +gchar *tcore_at_tok_nth(GSList *tokens, guint index); + +TelReturn tcore_at_prepare_and_send_request(CoreObject *co, + const gchar *cmd, const gchar *prefix, TcoreAtCommandType type, + TcorePendingPriority priority, void *request, + TcorePendingResponseCallback resp_cb, void *resp_cb_data, + TcorePendingSendCallback send_cb, void *send_cb_data, + guint timeout, TcorePendingTimeoutCallback timeout_cb, void *timeout_cb_data); + +#ifdef __cplusplus +} #endif + +#endif /* __AT_H__ */ diff --git a/include/co_call.h b/include/co_call.h index e8e13a4..e339298 100644 --- a/include/co_call.h +++ b/include/co_call.h @@ -1,9 +1,8 @@ /* * libtcore * - * Copyright (c) 2012 Samsung Electronics Co., Ltd. All rights reserved. - * - * Contact: Ja-young Gu + * Copyright (c) 2013 Samsung Electronics Co. Ltd. All rights reserved. + * Copyright (c) 2013 Intel Corporation. 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. @@ -18,235 +17,91 @@ * limitations under the License. */ -#ifndef __TCORE_CO_CALL_H__ -#define __TCORE_CO_CALL_H__ - -#include - -__BEGIN_DECLS - -#define MAX_CALL_NUMBER_LEN 83 -#define MAX_CALL_NAME_LEN 83 - -enum tcore_call_type { - TCORE_CALL_TYPE_VOICE, - TCORE_CALL_TYPE_VIDEO, - TCORE_CALL_TYPE_E911, -}; - -enum tcore_call_direction { - TCORE_CALL_DIRECTION_NONE, - TCORE_CALL_DIRECTION_OUTGOING, - TCORE_CALL_DIRECTION_INCOMING, -}; - -enum tcore_call_status { - TCORE_CALL_STATUS_IDLE, - TCORE_CALL_STATUS_ACTIVE, - TCORE_CALL_STATUS_HELD, - TCORE_CALL_STATUS_DIALING, - TCORE_CALL_STATUS_ALERT, - TCORE_CALL_STATUS_INCOMING, - TCORE_CALL_STATUS_WAITING, -}; - -enum tcore_call_cli_mode { - TCORE_CALL_CLI_MODE_DEFAULT, - TCORE_CALL_CLI_MODE_PRESENT, - TCORE_CALL_CLI_MODE_RESTRICT, -}; - -enum tcore_call_cna_mode { - TCORE_CALL_CNA_MODE_DEFAULT, - TCORE_CALL_CNA_MODE_PRESENT, - TCORE_CALL_CNA_MODE_RESTRICT, -}; - -enum tcore_call_answer_type { - TCORE_CALL_ANSWER_ACCEPT, - TCORE_CALL_ANSWER_REJECT, - TCORE_CALL_ANSWER_REPLACE, - TCORE_CALL_ANSWER_HOLD_AND_ACCEPT, -}; - -enum tcore_call_end_type { - TCORE_CALL_END_DEFAULT, - TCORE_CALL_END_ALL, - TCORE_CALL_END_ALL_ACTIVE, - TCORE_CALL_END_ALL_HELD, -}; - -typedef struct call_object CallObject; - -struct tcore_call_operations { - TReturn (*dial)(CoreObject *o, UserRequest *ur); - TReturn (*answer)(CoreObject *o, UserRequest *ur); - TReturn (*end)(CoreObject *o, UserRequest *ur); - TReturn (*hold)(CoreObject *o, UserRequest *ur); - TReturn (*active)(CoreObject *o, UserRequest *ur); - TReturn (*swap)(CoreObject *o, UserRequest *ur); - TReturn (*join)(CoreObject *o, UserRequest *ur); - TReturn (*split)(CoreObject *o, UserRequest *ur); - TReturn (*deflect)(CoreObject *o, UserRequest *ur); - TReturn (*transfer)(CoreObject *o, UserRequest *ur); - TReturn (*send_dtmf)(CoreObject *o, UserRequest *ur); - TReturn (*set_sound_path)(CoreObject *o, UserRequest *ur); - TReturn (*set_sound_volume_level)(CoreObject *o, UserRequest *ur); - TReturn (*get_sound_volume_level)(CoreObject *o, UserRequest *ur); - TReturn (*mute)(CoreObject *o, UserRequest *ur); - TReturn (*unmute)(CoreObject *o, UserRequest *ur); - TReturn (*get_mute_status)(CoreObject *o, UserRequest *ur); - TReturn (*set_sound_recording)(CoreObject *o, UserRequest *ur); - TReturn (*set_sound_equalization)(CoreObject *o, UserRequest *ur); - TReturn (*set_sound_noise_reduction)(CoreObject *o, UserRequest *ur); - TReturn (*set_sound_clock_status)(CoreObject *o, UserRequest *ur); - TReturn (*set_active_line)(CoreObject *o, UserRequest *ur); - TReturn (*get_active_line)(CoreObject *o, UserRequest *ur); - TReturn (*activate_ccbs)(CoreObject *o, UserRequest *ur); -}; - -/* To be removed later */ -struct tcore_call_information_operations { - void (*mo_call_col)(CoreObject *o, char *number, enum tcore_notification_command); - void (*mo_call_waiting)(CoreObject *o, enum tcore_notification_command); - void (*mo_call_cug)(CoreObject *o, int cug_index); - void (*mo_call_forwarded)(CoreObject *o, enum tcore_notification_command); - void (*mo_call_barred_incoming)(CoreObject *o, enum tcore_notification_command); - void (*mo_call_barred_outgoing)(CoreObject *o, enum tcore_notification_command); - void (*mo_call_deflected)(CoreObject *o, enum tcore_notification_command); - void (*mo_call_clir_suppression_reject)(CoreObject *o, enum tcore_notification_command); - void (*mo_call_cfu)(CoreObject *o, enum tcore_notification_command); - void (*mo_call_cfc)(CoreObject *o, enum tcore_notification_command); - void (*mt_call_cli)(CoreObject *o, enum tcore_call_cli_mode mode, char *number); - void (*mt_call_cna)(CoreObject *o, enum tcore_call_cna_mode mode, char *name, int dcs); - void (*mt_call_forwarded_call)(CoreObject *o, char *number, enum tcore_notification_command); - void (*mt_call_cug_call)(CoreObject *o, int cug_index, char *number); - void (*mt_call_deflected_call)(CoreObject *o, char *number, enum tcore_notification_command); - void (*mt_call_transfered)(CoreObject *o, char *number, enum tcore_notification_command); - void (*call_held)(CoreObject *o, char *number, enum tcore_notification_command); - void (*call_active)(CoreObject *o, char *number, enum tcore_notification_command); - void (*call_joined)(CoreObject *o, char *number, enum tcore_notification_command); - void (*call_released_on_hold)(CoreObject *o, char *number, enum tcore_notification_command); - void (*call_transfer_alert)(CoreObject *o, char *number, enum tcore_notification_command); - void (*call_transfered)(CoreObject *o, char *number, enum tcore_notification_command); - void (*call_cf_check_message)(CoreObject *o, char *number, enum tcore_notification_command); -}; - -typedef void(*ConfirmCallback)(TcorePending *p, int data_len, const void *data, void *user_data); - -struct tcore_call_control_operations { - TReturn (*answer_hold_and_accept)(CoreObject *o, UserRequest *ur, ConfirmCallback cb, void *user_data); - TReturn (*answer_replace)(CoreObject *o, UserRequest *ur, ConfirmCallback cb, void *user_data); - TReturn (*answer_reject)(CoreObject *o, UserRequest *ur, ConfirmCallback cb, void *user_data); - TReturn (*end_specific)(CoreObject *o, UserRequest *ur, const int id, ConfirmCallback cb, void *user_data); - TReturn (*end_all_active)(CoreObject *o, UserRequest *ur, ConfirmCallback cb, void *user_data); - TReturn (*end_all_held)(CoreObject *o, UserRequest *ur, ConfirmCallback cb, void *user_data); - TReturn (*active)(CoreObject *o, UserRequest *ur, ConfirmCallback cb, void *user_data); - TReturn (*hold)(CoreObject *o, UserRequest *ur, ConfirmCallback cb, void *user_data); - TReturn (*swap)(CoreObject *o, UserRequest *ur, ConfirmCallback cb, void *user_data); - TReturn (*join)(CoreObject *o, UserRequest *ur, ConfirmCallback cb, void *user_data); - TReturn (*split)(CoreObject *o, UserRequest *ur, const int id, ConfirmCallback cb, void *user_data); - TReturn (*transfer)(CoreObject *o, UserRequest *ur, ConfirmCallback cb, void *user_data); - TReturn (*deflect)(CoreObject *o, UserRequest *ur, const char *number, ConfirmCallback cb, void *user_data); -}; - -// Call Core API -CoreObject *tcore_call_new(TcorePlugin *p, - struct tcore_call_operations *ops, TcoreHal *hal); -void tcore_call_free( CoreObject *o); - -void tcore_call_override_ops(CoreObject *o, - struct tcore_call_operations *call_ops, - struct tcore_call_control_operations *control_ops); - -// Call Object API -CallObject *tcore_call_object_new( CoreObject *o, int id ); -gboolean tcore_call_object_free( CoreObject *o, CallObject *co ); - -CallObject *tcore_call_object_current_on_mt_processing( CoreObject *o ); -CallObject *tcore_call_object_current_on_mo_processing( CoreObject *o ); -CallObject *tcore_call_object_find_by_id( CoreObject *o, int id ); -CallObject *tcore_call_object_find_by_number( CoreObject *o, char *num ); -GSList *tcore_call_object_find_by_status( CoreObject *o, enum tcore_call_status cs ); - -int tcore_call_object_get_id( CallObject *co ); - -gboolean tcore_call_object_set_type( CallObject *co, enum tcore_call_type ct ); -enum tcore_call_type tcore_call_object_get_type( CallObject *co ); - -gboolean tcore_call_object_set_direction( CallObject *co, enum tcore_call_direction cd ); -enum tcore_call_direction tcore_call_object_get_direction( CallObject *co ); - -gboolean tcore_call_object_set_status( CallObject *co, enum tcore_call_status cs ); -enum tcore_call_status tcore_call_object_get_status( CallObject *co ); - -gboolean tcore_call_object_set_cli_info( CallObject *co, enum tcore_call_cli_mode mode, char *num ); -enum tcore_call_cli_mode tcore_call_object_get_cli_mode( CallObject *co ); -int tcore_call_object_get_number( CallObject *co, char *num ); - -gboolean tcore_call_object_set_cna_info( CallObject *co, enum tcore_call_cna_mode mode, char *name, int dcs ); -enum tcore_call_cna_mode tcore_call_object_get_cna_mode( CallObject *co ); -int tcore_call_object_get_name( CallObject *co, char *name ); - -gboolean tcore_call_object_set_multiparty_state ( CallObject *co, gboolean is ); -gboolean tcore_call_object_get_multiparty_state ( CallObject *co ); - -gboolean tcore_call_object_set_active_line( CallObject *co, unsigned int line ); -int tcore_call_object_get_active_line( CallObject *co ); - - -// Call Control API -gboolean tcore_call_control_new( CoreObject *o, struct tcore_call_control_operations *ops ); -void tcore_call_control_free( CoreObject *o ); - -TReturn tcore_call_control_answer_hold_and_accept( CoreObject* o, UserRequest* ur, ConfirmCallback cb, void* user_data ); -TReturn tcore_call_control_answer_replace( CoreObject* o, UserRequest* ur, ConfirmCallback cb, void* user_data ); -TReturn tcore_call_control_answer_reject( CoreObject* o, UserRequest* ur, ConfirmCallback cb, void* user_data ); - -TReturn tcore_call_control_end_specific( CoreObject* o, UserRequest* ur, const int id, ConfirmCallback cb, void* user_data ); -TReturn tcore_call_control_end_all_active( CoreObject* o, UserRequest* ur, ConfirmCallback cb, void* user_data ); -TReturn tcore_call_control_end_all_held( CoreObject* o, UserRequest* ur, ConfirmCallback cb, void* user_data ); - -TReturn tcore_call_control_active( CoreObject* o, UserRequest* ur, ConfirmCallback cb, void* user_data ); -TReturn tcore_call_control_hold( CoreObject* o, UserRequest* ur, ConfirmCallback cb, void* user_data ); -TReturn tcore_call_control_swap( CoreObject* o, UserRequest* ur, ConfirmCallback cb, void* user_data ); -TReturn tcore_call_control_join( CoreObject* o, UserRequest* ur, ConfirmCallback cb, void* user_data ); -TReturn tcore_call_control_split( CoreObject* o, UserRequest* ur, const int id, ConfirmCallback cb, void* user_data ); -TReturn tcore_call_control_transfer( CoreObject* o, UserRequest* ur, ConfirmCallback cb, void* user_data ); -TReturn tcore_call_control_deflect( CoreObject* o, UserRequest* ur, const char* number, ConfirmCallback cb, void* user_data ); - -void tcore_call_control_set_operations( CoreObject* o, struct tcore_call_control_operations *ops ); - - -void tcore_call_information_mo_col( CoreObject *o, char* number ); -void tcore_call_information_mo_waiting( CoreObject *o ); -void tcore_call_information_mo_cug( CoreObject *o, int cug_index ); -void tcore_call_information_mo_forwarded( CoreObject *o ); -void tcore_call_information_mo_barred_incoming( CoreObject *o ); -void tcore_call_information_mo_barred_outgoing( CoreObject *o ); -void tcore_call_information_mo_deflected( CoreObject *o ); -void tcore_call_information_mo_clir_suppression_reject( CoreObject *o ); -void tcore_call_information_mo_cfu( CoreObject *o ); -void tcore_call_information_mo_cfc( CoreObject *o ); - -void tcore_call_information_mt_cli( CoreObject *o, enum tcore_call_cli_mode mode, char* number ); -void tcore_call_information_mt_cna( CoreObject *o, enum tcore_call_cna_mode mode, char* name, int dcs ); -void tcore_call_information_mt_forwarded_call( CoreObject *o, char* number ); -void tcore_call_information_mt_cug_call( CoreObject *o, int cug_index, char* number ); -void tcore_call_information_mt_deflected_call( CoreObject *o, char* number ); -void tcore_call_information_mt_transfered( CoreObject *o, char* number ); - -void tcore_call_information_held( CoreObject *o, char* number ); -void tcore_call_information_active( CoreObject *o, char* number ); -void tcore_call_information_joined( CoreObject *o, char* number ); -void tcore_call_information_released_on_hold( CoreObject *o, char* number ); -void tcore_call_information_transfer_alert( CoreObject *o, char* number ); -void tcore_call_information_transfered( CoreObject *o, char* number ); -void tcore_call_information_cf_check_ss_message( CoreObject *o, char* number ); - -/* To be removed later */ -void tcore_call_information_set_operations( CoreObject *o, struct tcore_call_information_operations *ops ); - -__END_DECLS +#ifndef _CO_CALL_H__ +#define _CO_CALL_H__ + +#include "core_object.h" +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +typedef TelCallStatus CallObject; + +typedef struct { + TelReturn (*dial)(CoreObject *co, const TelCallDial *dial_info, TcoreObjectResponseCallback cb, void *cb_data); + TelReturn (*answer)(CoreObject *co, TelCallAnswerType ans_type, TcoreObjectResponseCallback cb, void *cb_data); + TelReturn (*end)(CoreObject *co, const TelCallEnd *end_info, TcoreObjectResponseCallback cb, void *cb_data); + TelReturn (*send_dtmf)(CoreObject *co, const char *dtmf_str, TcoreObjectResponseCallback cb, void *cb_data); + TelReturn (*hold)(CoreObject *co, TcoreObjectResponseCallback cb ,void *cb_data); + TelReturn (*active)(CoreObject *co, TcoreObjectResponseCallback cb, void *cb_data); + TelReturn (*swap)(CoreObject *co, TcoreObjectResponseCallback cb, void *cb_data); + TelReturn (*join)(CoreObject *co, TcoreObjectResponseCallback cb, void *cb_data); + TelReturn (*split)(CoreObject *co, unsigned int call_id, TcoreObjectResponseCallback cb, void *cb_data); + TelReturn (*transfer)(CoreObject *co, TcoreObjectResponseCallback cb, void *cb_data); + TelReturn (*deflect)(CoreObject *co, const char *deflect_to, TcoreObjectResponseCallback cb, void *cb_data); + TelReturn (*set_active_line)(CoreObject *co, TelCallActiveLine active_line, TcoreObjectResponseCallback cb, void *cb_data); + TelReturn (*get_active_line)(CoreObject *co, TcoreObjectResponseCallback cb, void *cb_data); + TelReturn (*set_volume_info)(CoreObject *co, const TelCallVolumeInfo *volume_info, TcoreObjectResponseCallback cb, void *cb_data); + TelReturn (*get_volume_info)(CoreObject *co, TelCallSoundDevice sound_device, TcoreObjectResponseCallback cb, void *cb_data); + TelReturn (*set_sound_path)(CoreObject *co, const TelCallSoundPathInfo *sound_path_info, TcoreObjectResponseCallback cb, void *cb_data); + TelReturn (*set_mute)(CoreObject *co, gboolean mute, TcoreObjectResponseCallback cb, void *cb_data); + TelReturn (*get_mute_status)(CoreObject *co, TcoreObjectResponseCallback cb, void *cb_data); + TelReturn (*set_sound_recording)(CoreObject *co, TelCallSoundRecording sound_rec, TcoreObjectResponseCallback cb, void *cb_data); + TelReturn (*set_sound_equalization)(CoreObject *co, const TelCallSoundEqualization *sound_eq, TcoreObjectResponseCallback cb, void *cb_data); +} TcoreCallOps; + + +/* Call Core API */ +CoreObject *tcore_call_new(TcorePlugin *p, TcoreCallOps *ops, TcoreHal *hal); +void tcore_call_free(CoreObject *co); + +gboolean tcore_call_set_ops(CoreObject *co, TcoreCallOps *ops); +void tcore_call_override_ops(CoreObject *co, TcoreCallOps *call_ops); + +/* Call Object API */ +CallObject *tcore_call_object_new(CoreObject *co, unsigned int call_id); +void tcore_call_object_free(CoreObject *co, CallObject *call_obj); +CallObject *tcore_call_object_current_on_mt_processing(CoreObject *co); +CallObject *tcore_call_object_current_on_mo_processing(CoreObject *co); +CallObject *tcore_call_object_find_by_id(CoreObject *co, unsigned int call_id); +CallObject *tcore_call_object_find_by_number(CoreObject *co, const char *num); +GSList *tcore_call_object_find_by_status(CoreObject *co, TelCallState cs); + +gboolean tcore_call_object_get_id(CallObject *call_obj, unsigned int *call_id); + +gboolean tcore_call_object_set_type(CallObject *call_obj, TelCallType ct); +gboolean tcore_call_object_get_call_type(CallObject *call_obj, TelCallType *call_type); + + +gboolean tcore_call_object_set_direction(CallObject *call_obj, gboolean mo); +gboolean tcore_call_object_get_direction(CallObject *call_obj, gboolean *mo_call); + +gboolean tcore_call_object_set_state(CallObject *call_obj, TelCallState call_state); +gboolean tcore_call_object_get_state(CallObject *call_obj, TelCallState *call_state); + +gboolean tcore_call_object_set_cli_info(CallObject *call_obj, TelCallCliValidity cli_validity, char *num); +gboolean tcore_call_object_get_cli_validity(CallObject *call_obj, TelCallCliValidity *cli_validity); +gsize tcore_call_object_get_number(CallObject *call_obj, char *num); + +gboolean tcore_call_object_set_cni_info(CallObject *call_obj, TelCallCniValidity cni_validity, char *name); +gboolean tcore_call_object_get_cni_validity(CallObject *call_obj, TelCallCniValidity *cni_validity); +gsize tcore_call_object_get_name(CallObject *call_obj, char *name); + +gboolean tcore_call_object_set_multiparty_state(CallObject *call_obj, gboolean state); +gboolean tcore_call_object_get_multiparty_state(CallObject *call_obj, gboolean *mpty); + +gboolean tcore_call_object_set_mt_forward(CallObject *call_obj, gboolean forward); +gboolean tcore_call_object_get_mt_forward(CallObject *call_obj, gboolean *forward); + +gboolean tcore_call_object_set_active_line(CallObject *call_obj, TelCallActiveLine line); +gboolean tcore_call_object_get_active_line(CallObject *call_obj, TelCallActiveLine *active_line); +gboolean tcore_call_object_get_count(CoreObject *co, unsigned int *count); + +#ifdef __cplusplus +} +#endif #endif diff --git a/include/co_context.h b/include/co_context.h index 489e3ce..a8a71e5 100644 --- a/include/co_context.h +++ b/include/co_context.h @@ -1,9 +1,8 @@ /* * libtcore * - * Copyright (c) 2012 Samsung Electronics Co., Ltd. All rights reserved. - * - * Contact: Ja-young Gu + * Copyright (c) 2013 Samsung Electronics Co. Ltd. All rights reserved. + * Copyright (c) 2013 Intel Corporation. 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. @@ -18,115 +17,136 @@ * limitations under the License. */ -#ifndef __TCORE_CO_CONTEXT_H__ -#define __TCORE_CO_CONTEXT_H__ +#ifndef __CO_CONTEXT_H__ +#define __CO_CONTEXT_H__ -#include +#ifdef __cplusplus +extern "C" { +#endif -__BEGIN_DECLS - -enum co_context_state { - CONTEXT_STATE_DEACTIVATED, - CONTEXT_STATE_ACTIVATING, - CONTEXT_STATE_ACTIVATED, - CONTEXT_STATE_DEACTIVATING, -}; - -enum co_context_type { - CONTEXT_TYPE_UNKNOWN, - CONTEXT_TYPE_X25, - CONTEXT_TYPE_IP, - CONTEXT_TYPE_IHOST, - CONTEXT_TYPE_PPP, - CONTEXT_TYPE_IPV6, -}; - -enum co_context_role { - CONTEXT_ROLE_UNKNOWN, - CONTEXT_ROLE_INTERNET, - CONTEXT_ROLE_MMS, - CONTEXT_ROLE_PREPAID_INTERNET, - CONTEXT_ROLE_PREPAID_MMS, - CONTEXT_ROLE_TETHERING, - CONTEXT_ROLE_USER_DEFINED, -}; - -enum co_context_d_comp { - CONTEXT_D_COMP_OFF, - CONTEXT_D_COMP_ON, - CONTEXT_D_COMP_V42BIS, - CONTEXT_D_COMP_V44, -}; - -enum co_context_h_comp { - CONTEXT_H_COMP_OFF, - CONTEXT_H_COMP_ON, - CONTEXT_H_COMP_RFC1144, - CONTEXT_H_COMP_RFC2507, - CONTEXT_H_COMP_RFC3095 -}; - -enum co_context_auth { - CONTEXT_AUTH_NONE, - CONTEXT_AUTH_PAP, - CONTEXT_AUTH_CHAP -}; +#include +#include +#include "type/ps.h" + +typedef enum { + TCORE_CONTEXT_STATE_DEACTIVATED, + TCORE_CONTEXT_STATE_DEFINING, + TCORE_CONTEXT_STATE_DEFINED, + TCORE_CONTEXT_STATE_ACTIVATING, + TCORE_CONTEXT_STATE_ACTIVATED, + TCORE_CONTEXT_STATE_DEACTIVATING, +} TcoreContextState; + +typedef enum { + TCORE_CONTEXT_TYPE_UNKNOWN, + TCORE_CONTEXT_TYPE_X25, + TCORE_CONTEXT_TYPE_IP, + TCORE_CONTEXT_TYPE_IHOST, + TCORE_CONTEXT_TYPE_PPP, + TCORE_CONTEXT_TYPE_IPV6, +} TcoreContextType; + +typedef enum { + TCORE_CONTEXT_ROLE_UNKNOWN, + TCORE_CONTEXT_ROLE_INTERNET, + TCORE_CONTEXT_ROLE_MMS, + TCORE_CONTEXT_ROLE_PREPAID_INTERNET, + TCORE_CONTEXT_ROLE_PREPAID_MMS, + TCORE_CONTEXT_ROLE_TETHERING, + TCORE_CONTEXT_ROLE_USER_DEFINED, +} TcoreContextRole; + +typedef enum { + TCORE_CONTEXT_D_COMP_OFF, + TCORE_CONTEXT_D_COMP_ON, + TCORE_CONTEXT_D_COMP_V42BIS, + TCORE_CONTEXT_D_COMP_V44, +} TcoreContextDComp; + +typedef enum { + TCORE_CONTEXT_H_COMP_OFF, + TCORE_CONTEXT_H_COMP_ON, + TCORE_CONTEXT_H_COMP_RFC1144, + TCORE_CONTEXT_H_COMP_RFC2507, + TCORE_CONTEXT_H_COMP_RFC3095 +} TcoreContextHComp; + +typedef enum { + TCORE_CONTEXT_AUTH_NONE, + TCORE_CONTEXT_AUTH_PAP, + TCORE_CONTEXT_AUTH_CHAP +} TcoreContextAuth; CoreObject *tcore_context_new(TcorePlugin *p, TcoreHal *hal); -void tcore_context_free(CoreObject *o); - -CoreObject *tcore_context_clone(TcorePlugin *p, const char *name, TcoreHal *hal); - -TReturn tcore_context_set_state(CoreObject *o, enum co_context_state state); -enum co_context_state tcore_context_get_state(CoreObject *o); -TReturn tcore_context_set_id(CoreObject *o, unsigned int id); -unsigned int tcore_context_get_id(CoreObject *o); -TReturn tcore_context_set_role(CoreObject *o, enum co_context_role type); -enum co_context_role tcore_context_get_role(CoreObject *o); - -TReturn tcore_context_set_apn(CoreObject *o, const char *apn); -char *tcore_context_get_apn(CoreObject *o); - -TReturn tcore_context_set_address(CoreObject *o, const char *addr); -char *tcore_context_get_address(CoreObject *o); -TReturn tcore_context_set_dns1(CoreObject *o, const char *dns); -char *tcore_context_get_dns1(CoreObject *o); -TReturn tcore_context_set_dns2(CoreObject *o, const char *dns); -char *tcore_context_get_dns2(CoreObject *o); - -TReturn tcore_context_set_type(CoreObject *o, enum co_context_type type); -enum co_context_type tcore_context_get_type(CoreObject *o); -TReturn tcore_context_set_data_compression(CoreObject *o, enum co_context_d_comp comp); -enum co_context_d_comp tcore_context_get_data_compression(CoreObject *o); -TReturn tcore_context_set_header_compression(CoreObject *o, enum co_context_h_comp comp); -enum co_context_h_comp tcore_context_get_header_compression(CoreObject *o); - -TReturn tcore_context_set_username(CoreObject *o, const char *username); -char *tcore_context_get_username(CoreObject *o); -TReturn tcore_context_set_password(CoreObject *o, const char *password); -char *tcore_context_get_password(CoreObject *o); -TReturn tcore_context_set_auth(CoreObject *o, enum co_context_auth auth); -enum co_context_auth tcore_context_get_auth(CoreObject *o); -TReturn tcore_context_set_proxy(CoreObject *o, const char *proxy); -char *tcore_context_get_proxy(CoreObject *o); -TReturn tcore_context_set_mmsurl(CoreObject *o, const char *mmsurl); -char *tcore_context_get_mmsurl(CoreObject *o); -TReturn tcore_context_set_profile_name(CoreObject *o, const char *profile_name); -char *tcore_context_get_profile_name(CoreObject *o); - -TReturn tcore_context_set_devinfo(CoreObject *o, struct tnoti_ps_pdp_ipconfiguration *devinfo); -TReturn tcore_context_reset_devinfo(CoreObject *o); -void tcore_context_cp_service_info(CoreObject *dest, CoreObject *src); +void tcore_context_free(CoreObject *co); + +gboolean tcore_context_get_state(CoreObject *co, TcoreContextState *state); +gboolean tcore_context_set_state(CoreObject *co, TcoreContextState state); + +gboolean tcore_context_get_id(CoreObject *co, guint *id); +gboolean tcore_context_set_id(CoreObject *co, guint id); + +gboolean tcore_context_get_role(CoreObject *co, TcoreContextRole *role); +gboolean tcore_context_set_role(CoreObject *co, TcoreContextRole type); + +gboolean tcore_context_get_apn(CoreObject *co, gchar **apn); +gboolean tcore_context_set_apn(CoreObject *co, const gchar *apn); + +gboolean tcore_context_get_address(CoreObject *co, gchar **addr); +gboolean tcore_context_set_address(CoreObject *co, const gchar *addr); + +gboolean tcore_context_get_dns1(CoreObject *co, gchar **dns); +gboolean tcore_context_set_dns1(CoreObject *co, const gchar *dns); + +gboolean tcore_context_get_dns2(CoreObject *co, gchar **dns); +gboolean tcore_context_set_dns2(CoreObject *co, const gchar *dns); + +gboolean tcore_context_get_type(CoreObject *co, TcoreContextType *type); +gboolean tcore_context_set_type(CoreObject *co, TcoreContextType type); + +gboolean tcore_context_get_data_compression(CoreObject *co, TcoreContextDComp *comp); +gboolean tcore_context_set_data_compression(CoreObject *co, TcoreContextDComp comp); -TReturn tcore_context_set_ipv4_addr(CoreObject *o, const char *addr); -char *tcore_context_get_ipv4_addr(CoreObject *o); -TReturn tcore_context_set_ipv4_dns(CoreObject *o, const char *dns1, const char *dns2); -char *tcore_context_get_ipv4_dns1(CoreObject *o); -char *tcore_context_get_ipv4_dns2(CoreObject *o); -char *tcore_context_get_ipv4_gw(CoreObject *o); -TReturn tcore_context_set_ipv4_devname(CoreObject *o, const char *name); -char *tcore_context_get_ipv4_devname(CoreObject *o); +gboolean tcore_context_get_header_compression(CoreObject *co, TcoreContextHComp *comp); +gboolean tcore_context_set_header_compression(CoreObject *co, TcoreContextHComp comp); -__END_DECLS +gboolean tcore_context_get_username(CoreObject *co, gchar **username); +gboolean tcore_context_set_username(CoreObject *co, const gchar *username); +gboolean tcore_context_get_password(CoreObject *co, gchar **password); +gboolean tcore_context_set_password(CoreObject *co, const gchar *password); + +gboolean tcore_context_get_auth(CoreObject *co, TcoreContextAuth *auth); +gboolean tcore_context_set_auth(CoreObject *co, TcoreContextAuth auth); + +gboolean tcore_context_get_proxy(CoreObject *co, gchar **proxy); +gboolean tcore_context_set_proxy(CoreObject *co, const gchar *proxy); + +gboolean tcore_context_get_mmsurl(CoreObject *co, gchar **mmsurl); +gboolean tcore_context_set_mmsurl(CoreObject *co, const gchar *mmsurl); + +gboolean tcore_context_get_profile_name(CoreObject *co, gchar **profile_name); +gboolean tcore_context_set_profile_name(CoreObject *co, const gchar *profile_name); + +gboolean tcore_context_set_devinfo(CoreObject *co, TcorePsPdpIpConf *devinfo); +gboolean tcore_context_reset_devinfo(CoreObject *co); + +gboolean tcore_context_get_ipv4_addr(CoreObject *co, gchar **ipv4); +gboolean tcore_context_set_ipv4_addr(CoreObject *co, const gchar *addr); + +gboolean tcore_context_get_ipv4_dns1(CoreObject *co, gchar **ipv4_dns); +gboolean tcore_context_get_ipv4_dns2(CoreObject *co, gchar **ipv4_dns2); +gboolean tcore_context_set_ipv4_dns(CoreObject *co, const gchar *dns1, const gchar *dns2); + +gboolean tcore_context_get_ipv4_gw(CoreObject *co, gchar **ipv4_gw); + +gboolean tcore_context_get_ipv4_devname(CoreObject *co, gchar **dev_name); +gboolean tcore_context_set_ipv4_devname(CoreObject *co, const gchar *name); + +void tcore_context_cp_service_info(CoreObject *dest, CoreObject *src); + +#ifdef __cplusplus +} #endif + +#endif /* __CO_CONTEXT_H__ */ diff --git a/include/co_gps.h b/include/co_gps.h index 767fa4a..ad4202d 100644 --- a/include/co_gps.h +++ b/include/co_gps.h @@ -1,9 +1,8 @@ /* * libtcore * - * Copyright (c) 2012 Samsung Electronics Co., Ltd. All rights reserved. - * - * Contact: Ja-young Gu + * Copyright (c) 2013 Samsung Electronics Co. Ltd. All rights reserved. + * Copyright (c) 2013 Intel Corporation. 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. @@ -18,25 +17,33 @@ * limitations under the License. */ -#ifndef __TCORE_CO_GPS_H__ -#define __TCORE_CO_GPS_H__ - -#include +#ifndef __CO_GPS_H__ +#define __CO_GPS_H__ -__BEGIN_DECLS +#include "core_object.h" +#include +#include +#ifdef __cplusplus +extern "C" { +#endif -struct tcore_gps_operations { - TReturn (*confirm_measure_pos)(CoreObject *o, UserRequest *ur); - TReturn (*set_frequency_aiding)(CoreObject *o, UserRequest *ur); -}; +typedef struct { + TelReturn (*confirm_measure_pos)(CoreObject *co, const TelGpsDataInfo *gps_data, + TcoreObjectResponseCallback cb, void *cb_data); + TelReturn (*set_frequency_aiding)(CoreObject *co, gboolean state, + TcoreObjectResponseCallback cb, void *cb_data); +} TcoreGpsOps; -CoreObject *tcore_gps_new(TcorePlugin *p, - struct tcore_gps_operations *ops, TcoreHal *hal); -void tcore_gps_free(CoreObject *o); -void tcore_gps_override_ops(CoreObject *o, struct tcore_gps_operations *gps_ops); +CoreObject *tcore_gps_new(TcorePlugin *plugin, TcoreGpsOps *ops, TcoreHal *hal); +void tcore_gps_free(CoreObject *co); -__END_DECLS +gboolean tcore_gps_set_ops(CoreObject *co, TcoreGpsOps *ops); +void tcore_gps_override_ops(CoreObject *co, TcoreGpsOps *ops); +#ifdef __cplusplus +} #endif + +#endif/* __CO_GPS_H__ */ diff --git a/include/co_modem.h b/include/co_modem.h index a2f334f..a747336 100644 --- a/include/co_modem.h +++ b/include/co_modem.h @@ -1,9 +1,8 @@ /* * libtcore * - * Copyright (c) 2012 Samsung Electronics Co., Ltd. All rights reserved. - * - * Contact: Ja-young Gu + * Copyright (c) 2013 Samsung Electronics Co. Ltd. All rights reserved. + * Copyright (c) 2013 Intel Corporation. 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. @@ -18,37 +17,38 @@ * limitations under the License. */ -#ifndef __TCORE_CO_MODEM_H__ -#define __TCORE_CO_MODEM_H__ - -#include - -__BEGIN_DECLS +#ifndef __CO_MODEM_H__ +#define __CO_MODEM_H__ +#include "core_object.h" +#include +#include -struct tcore_modem_operations { - TReturn (*power_on)(CoreObject *o, UserRequest *ur); - TReturn (*power_off)(CoreObject *o, UserRequest *ur); - TReturn (*power_reset)(CoreObject *o, UserRequest *ur); - TReturn (*set_flight_mode)(CoreObject *o, UserRequest *ur); - TReturn (*get_imei)(CoreObject *o, UserRequest *ur); - TReturn (*get_version)(CoreObject *o, UserRequest *ur); - TReturn (*get_sn)(CoreObject *o, UserRequest *ur); - TReturn (*dun_pin_ctrl)(CoreObject *o, UserRequest *ur); - TReturn (*get_flight_mode)(CoreObject *o, UserRequest *ur); -}; +#ifdef __cplusplus +extern "C" { +#endif -CoreObject *tcore_modem_new(TcorePlugin *p, - struct tcore_modem_operations *ops, TcoreHal *hal); -void tcore_modem_free(CoreObject *o); +typedef struct { + TelReturn (*set_power_status)(CoreObject *co, TelModemPowerStatus status, TcoreObjectResponseCallback cb, void *cb_data); + TelReturn (*set_flight_mode)(CoreObject *co, gboolean enable, TcoreObjectResponseCallback cb, void *cb_data); + TelReturn (*get_flight_mode)(CoreObject *co, TcoreObjectResponseCallback cb, void *cb_data); + TelReturn (*get_version)(CoreObject *co, TcoreObjectResponseCallback cb, void *cb_data); + TelReturn (*get_imei)(CoreObject *co, TcoreObjectResponseCallback cb, void *cb_data); +} TcoreModemOps; -void tcore_modem_override_ops(CoreObject *o, struct tcore_modem_operations *modem_ops); +CoreObject *tcore_modem_new(TcorePlugin *plugin, TcoreModemOps *ops, TcoreHal *hal); +void tcore_modem_free(CoreObject *co); -TReturn tcore_modem_set_flight_mode_state(CoreObject *o, gboolean flag); -gboolean tcore_modem_get_flight_mode_state(CoreObject *o); -TReturn tcore_modem_set_powered(CoreObject *o, gboolean pwr); -gboolean tcore_modem_get_powered(CoreObject *o); +gboolean tcore_modem_set_ops(CoreObject *co, TcoreModemOps *ops); +void tcore_modem_override_ops(CoreObject *co, TcoreModemOps *ops); -__END_DECLS +gboolean tcore_modem_set_flight_mode_state(CoreObject *co, gboolean state); +gboolean tcore_modem_get_flight_mode_state(CoreObject *co, gboolean *state); +gboolean tcore_modem_set_powered(CoreObject *co, gboolean pwr); +gboolean tcore_modem_get_powered(CoreObject *co, gboolean *pwr); +#ifdef __cplusplus +} #endif + +#endif /* __CO_MODEM_H__ */ diff --git a/include/co_network.h b/include/co_network.h index 108fc7d..53e9dfc 100644 --- a/include/co_network.h +++ b/include/co_network.h @@ -1,9 +1,8 @@ /* * libtcore * - * Copyright (c) 2012 Samsung Electronics Co., Ltd. All rights reserved. - * - * Contact: Ja-young Gu + * Copyright (c) 2013 Samsung Electronics Co. Ltd. All rights reserved. + * Copyright (c) 2013 Intel Corporation. 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. @@ -18,115 +17,84 @@ * limitations under the License. */ -#ifndef __TCORE_CO_NETWORK_H__ -#define __TCORE_CO_NETWORK_H__ - -#include - -__BEGIN_DECLS - - -enum tcore_network_service_domain_type { - TCORE_NETWORK_SERVICE_DOMAIN_TYPE_CIRCUIT, - TCORE_NETWORK_SERVICE_DOMAIN_TYPE_PACKET -}; - -enum tcore_network_name_type { - TCORE_NETWORK_NAME_TYPE_SHORT, - TCORE_NETWORK_NAME_TYPE_FULL, - TCORE_NETWORK_NAME_TYPE_SPN, -}; - -enum tcore_network_name_priority { - TCORE_NETWORK_NAME_PRIORITY_UNKNOWN, - TCORE_NETWORK_NAME_PRIORITY_NETWORK, - TCORE_NETWORK_NAME_PRIORITY_SPN, - TCORE_NETWORK_NAME_PRIORITY_ANY, -}; - -struct tcore_network_operator_info { - char mcc[4]; - char mnc[4]; - char name[41]; - char country[4]; -}; - -struct tcore_network_operations { - TReturn (*search)(CoreObject *o, UserRequest *ur); - TReturn (*set_plmn_selection_mode)(CoreObject *o, UserRequest *ur); - TReturn (*get_plmn_selection_mode)(CoreObject *o, UserRequest *ur); - TReturn (*set_service_domain)(CoreObject *o, UserRequest *ur); - TReturn (*get_service_domain)(CoreObject *o, UserRequest *ur); - TReturn (*set_band)(CoreObject *o, UserRequest *ur); - TReturn (*get_band)(CoreObject *o, UserRequest *ur); - TReturn (*set_preferred_plmn)(CoreObject *o, UserRequest *ur); - TReturn (*get_preferred_plmn)(CoreObject *o, UserRequest *ur); - TReturn (*set_order)(CoreObject *o, UserRequest *ur); - TReturn (*get_order)(CoreObject *o, UserRequest *ur); - TReturn (*set_power_on_attach)(CoreObject *o, UserRequest *ur); - TReturn (*get_power_on_attach)(CoreObject *o, UserRequest *ur); - TReturn (*set_cancel_manual_search)(CoreObject *o, UserRequest *ur); - TReturn (*get_serving_network)(CoreObject *o, UserRequest *ur); - TReturn (*set_mode)(CoreObject *o, UserRequest *ur); - TReturn (*get_mode)(CoreObject *o, UserRequest *ur); - TReturn (*set_neighboring_cell_info)(CoreObject *o, UserRequest *ur); - TReturn (*get_neighboring_cell_info)(CoreObject *o, UserRequest *ur); -}; - -CoreObject *tcore_network_new(TcorePlugin *plugin, - struct tcore_network_operations *ops, TcoreHal *hal); +#ifndef __CO_NETWORK_H__ +#define __CO_NETWORK_H__ + +#include "core_object.h" +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct { + TelReturn (*get_identity_info)(CoreObject *co, TcoreObjectResponseCallback cb, void *cb_data); + TelReturn (*search)(CoreObject *co, TcoreObjectResponseCallback cb, void *cb_data); + TelReturn (*cancel_search)(CoreObject *co, TcoreObjectResponseCallback cb, void *cb_data); + TelReturn (*select_automatic)(CoreObject *co, TcoreObjectResponseCallback cb, void *cb_data); + TelReturn (*select_manual)(CoreObject *co, const TelNetworkSelectManualInfo *sel_manual, TcoreObjectResponseCallback cb, void *cb_data); + TelReturn (*get_selection_mode)(CoreObject *co, TcoreObjectResponseCallback cb, void *cb_data); + TelReturn (*set_preferred_plmn)(CoreObject *co, const TelNetworkPreferredPlmnInfo *pref_plmn, TcoreObjectResponseCallback cb, void *cb_data); + TelReturn (*get_preferred_plmn)(CoreObject *co, TcoreObjectResponseCallback cb, void *cb_data); + TelReturn (*set_mode)(CoreObject *co, TelNetworkMode mode, TcoreObjectResponseCallback cb, void *cb_data); + TelReturn (*get_mode)(CoreObject *co, TcoreObjectResponseCallback cb, void *cb_data); + TelReturn (*get_neighboring_cell_info)(CoreObject *co, TcoreObjectResponseCallback cb, void *cb_data); +}TcoreNetworkOps; + +CoreObject* tcore_network_new(TcorePlugin *plugin, TcoreNetworkOps *ops, TcoreHal *hal); void tcore_network_free(CoreObject *co); -void tcore_network_override_ops(CoreObject *o, struct tcore_network_operations *network_ops); +gboolean tcore_network_set_ops(CoreObject *co, TcoreNetworkOps *ops); +void tcore_network_override_ops(CoreObject *co, TcoreNetworkOps *ops); + -TReturn tcore_network_set_plmn(CoreObject *co, const char *plmn); -char *tcore_network_get_plmn(CoreObject *co); +gboolean tcore_network_get_cs_reg_status(CoreObject *co, + TelNetworkRegStatus *cs_status); +gboolean tcore_network_set_cs_reg_status(CoreObject *co, + TelNetworkRegStatus cs_status); -TReturn tcore_network_set_network_name(CoreObject *co, - enum tcore_network_name_type type, const char *network_name); -char *tcore_network_get_network_name(CoreObject *co, - enum tcore_network_name_type type); +gboolean tcore_network_get_ps_reg_status(CoreObject *co, + TelNetworkRegStatus *ps_status); +gboolean tcore_network_set_ps_reg_status(CoreObject *co, + TelNetworkRegStatus ps_status); -TReturn tcore_network_set_network_name_priority(CoreObject *co, - enum tcore_network_name_priority priority); -TReturn tcore_network_get_network_name_priority(CoreObject *co, - enum tcore_network_name_priority *priority); -TReturn tcore_network_set_roaming_state(CoreObject *co, gboolean state); -gboolean tcore_network_get_roaming_state(CoreObject *co); +gboolean tcore_network_get_access_technology(CoreObject *co, + TelNetworkAct *act); +gboolean tcore_network_set_access_technology(CoreObject *co, + TelNetworkAct act); -TReturn tcore_network_set_service_status(CoreObject *co, - enum tcore_network_service_domain_type type, - enum telephony_network_service_domain_status status); -TReturn tcore_network_get_service_status(CoreObject *co, - enum tcore_network_service_domain_type type, - enum telephony_network_service_domain_status *result); +gboolean tcore_network_get_roam_state(CoreObject *co, gboolean *state); +gboolean tcore_network_set_roam_state(CoreObject *co, gboolean state); -TReturn tcore_network_set_access_technology(CoreObject *co, - enum telephony_network_access_technology act); -TReturn tcore_network_get_access_technology(CoreObject *co, - enum telephony_network_access_technology *result); -TReturn tcore_network_set_lac(CoreObject *co, unsigned int lac); -TReturn tcore_network_get_lac(CoreObject *co, unsigned int *result); +gboolean tcore_network_get_lac(CoreObject *co, unsigned int *lac); +gboolean tcore_network_set_lac(CoreObject *co, unsigned int lac); -TReturn tcore_network_set_rac(CoreObject *co, unsigned int rac); -TReturn tcore_network_get_rac(CoreObject *co, unsigned int *result); +gboolean tcore_network_get_rac(CoreObject *co, unsigned int *rac); +gboolean tcore_network_set_rac(CoreObject *co, unsigned int rac); -TReturn tcore_network_set_cell_id(CoreObject *co, unsigned int cell_id); -TReturn tcore_network_get_cell_id(CoreObject *co, unsigned int *result); +gboolean tcore_network_get_cell_id(CoreObject *co, unsigned int *cell_id); +gboolean tcore_network_set_cell_id(CoreObject *co, unsigned int cell_id); -TReturn tcore_network_set_service_type(CoreObject *co, - enum telephony_network_service_type service_type); -TReturn tcore_network_get_service_type(CoreObject *co, - enum telephony_network_service_type *result); +/* The calling function needs to free memory allocated at output parameter */ +gboolean tcore_network_get_plmn(CoreObject *co, char **plmn); +gboolean tcore_network_set_plmn(CoreObject *co, const char *plmn); -TReturn tcore_network_operator_info_add(CoreObject *co, - struct tcore_network_operator_info *noi); +gboolean tcore_network_get_short_name(CoreObject *co, char **short_name); +gboolean tcore_network_set_short_name(CoreObject *co, const char *short_name); -struct tcore_network_operator_info *tcore_network_operator_info_find(CoreObject *co, - const char *mcc, const char *mnc); +gboolean tcore_network_get_long_name(CoreObject *co, char **long_name); +gboolean tcore_network_set_long_name(CoreObject *co, const char *long_name); -__END_DECLS +gboolean tcore_network_get_operator_name(CoreObject *co, + const char *plmn, char **name); +gboolean tcore_network_set_operator_name(CoreObject *co, + const char *plmn, const char *name); + +#ifdef __cplusplus +} +#endif #endif diff --git a/include/co_phonebook.h b/include/co_phonebook.h index 792ad2c..b2d6294 100644 --- a/include/co_phonebook.h +++ b/include/co_phonebook.h @@ -1,9 +1,8 @@ /* * libtcore * - * Copyright (c) 2012 Samsung Electronics Co., Ltd. All rights reserved. - * - * Contact: Ja-young Gu + * Copyright (c) 2013 Samsung Electronics Co. Ltd. All rights reserved. + * Copyright (c) 2013 Intel Corporation. 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. @@ -18,37 +17,41 @@ * limitations under the License. */ -#ifndef __TCORE_CO_PHONEBOOK_H__ -#define __TCORE_CO_PHONEBOOK_H__ - -#include +#ifndef __CO_PHONEBOOK_H__ +#define __CO_PHONEBOOK_H__ -__BEGIN_DECLS +#include "core_object.h" +#include +#include -struct tcore_phonebook_operations { - TReturn (*get_count)(CoreObject *o, UserRequest *ur); - TReturn (*get_info)(CoreObject *o, UserRequest *ur); - TReturn (*get_usim_info)(CoreObject *o, UserRequest *ur); - TReturn (*read_record)(CoreObject *o, UserRequest *ur); - TReturn (*update_record)(CoreObject *o, UserRequest *ur); - TReturn (*delete_record)(CoreObject *o, UserRequest *ur); -}; +#ifdef __cplusplus +extern "C" { +#endif -CoreObject *tcore_phonebook_new(TcorePlugin *p, - struct tcore_phonebook_operations *ops, TcoreHal *hal); -void tcore_phonebook_free(CoreObject *n); +typedef struct { + TelReturn (*get_info)(CoreObject *co, TelPbType pb_type, TcoreObjectResponseCallback cb, void *cb_data); + TelReturn (*read_record)(CoreObject *co, const TelPbRecordInfo *record, TcoreObjectResponseCallback cb, void *cb_data); + TelReturn (*update_record)(CoreObject *co, const TelPbUpdateRecord *req_data, TcoreObjectResponseCallback cb, void *cb_data); + TelReturn (*delete_record)(CoreObject *co, const TelPbRecordInfo *record, TcoreObjectResponseCallback cb, void *cb_data); +} TcorePbOps; -void tcore_phonebook_override_ops(CoreObject *o, struct tcore_phonebook_operations *phonebook_ops); +CoreObject *tcore_phonebook_new(TcorePlugin *p, TcorePbOps *ops, TcoreHal *hal); +void tcore_phonebook_free(CoreObject *co); -gboolean tcore_phonebook_get_status(CoreObject *o); -gboolean tcore_phonebook_set_status(CoreObject *o, gboolean b_init); +gboolean tcore_phonebook_set_ops(CoreObject *co, TcorePbOps *ops); +void tcore_phonebook_override_ops(CoreObject *co, TcorePbOps *phonebook_ops); -struct tel_phonebook_support_list* tcore_phonebook_get_support_list(CoreObject *o); -gboolean tcore_phonebook_set_support_list(CoreObject *o, struct tel_phonebook_support_list *list); +gboolean tcore_phonebook_get_status(CoreObject *co, gboolean *init_status); +gboolean tcore_phonebook_set_status(CoreObject *co, gboolean init_status); -enum tel_phonebook_type tcore_phonebook_get_selected_type(CoreObject *o); -gboolean tcore_phonebook_set_selected_type(CoreObject *o, enum tel_phonebook_type t); +gboolean tcore_phonebook_get_support_list(CoreObject *co, TelPbList **pb_list); +gboolean tcore_phonebook_set_support_list(CoreObject *co, TelPbList *pb_list); -__END_DECLS +gboolean tcore_phonebook_get_selected_type(CoreObject *co, TelPbType *pb_type); +gboolean tcore_phonebook_set_selected_type(CoreObject *co, TelPbType pb_type); +#ifdef __cplusplus +} #endif + +#endif /*__CO_PHONEBOOK_H__*/ diff --git a/include/co_ps.h b/include/co_ps.h old mode 100644 new mode 100755 index 33138d3..adbf905 --- a/include/co_ps.h +++ b/include/co_ps.h @@ -1,9 +1,8 @@ /* * libtcore * - * Copyright (c) 2012 Samsung Electronics Co., Ltd. All rights reserved. - * - * Contact: Ja-young Gu + * Copyright (c) 2013 Samsung Electronics Co. Ltd. All rights reserved. + * Copyright (c) 2013 Intel Corporation. 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. @@ -18,45 +17,49 @@ * limitations under the License. */ -#ifndef __TCORE_CO_PS_H__ -#define __TCORE_CO_PS_H__ +#ifndef __CO_PS_H__ +#define __CO_PS_H__ #include +#include #include -__BEGIN_DECLS - +#ifdef __cplusplus +extern "C" { +#endif -#define PS_MAX_CID 4 +#define TCORE_PS_MAX_CID 4 -struct tcore_ps_operations { - TReturn (*define_context)(CoreObject *co_ps, CoreObject *context, void *user_data); - TReturn (*activate_context)(CoreObject *co_ps, CoreObject *context, void *user_data); - TReturn (*deactivate_context)(CoreObject *co_ps, CoreObject *context, void *user_data); -}; +typedef struct { + TelReturn (*define_context)(CoreObject *co_ps, CoreObject *context, + TcoreObjectResponseCallback cb, void *cb_data); + TelReturn (*activate_context)(CoreObject *co_ps, CoreObject *context, + TcoreObjectResponseCallback cb, void *cb_data); + TelReturn (*deactivate_context)(CoreObject *co_ps, CoreObject *context, + TcoreObjectResponseCallback cb, void *cb_data); +} TcorePsOps; CoreObject *tcore_ps_new(TcorePlugin *p, - struct tcore_ps_operations *ops, TcoreHal *hal); + TcorePsOps *ops, TcoreHal *hal); void tcore_ps_free(CoreObject *o); -void tcore_ps_override_ops(CoreObject *o, struct tcore_ps_operations *ps_ops); +gboolean tcore_ps_set_ops(CoreObject *o, TcorePsOps *ps_ops); +void tcore_ps_override_ops(CoreObject *o, TcorePsOps *ps_ops); -TReturn tcore_ps_add_context(CoreObject *o, CoreObject *ctx_o); -TReturn tcore_ps_remove_context(CoreObject *o, CoreObject *ctx_o); -CoreObject *tcore_ps_ref_context_by_role(CoreObject *o, enum co_context_role role); -GSList *tcore_ps_ref_context_by_id(CoreObject *o, unsigned int id); +gboolean tcore_ps_add_context(CoreObject *o, CoreObject *ctx_o); +gboolean tcore_ps_remove_context(CoreObject *o, CoreObject *ctx_o); -TReturn tcore_ps_set_online(CoreObject *o, gboolean state); +gboolean tcore_ps_set_online(CoreObject *o, gboolean state); -TReturn tcore_ps_assign_context_id(CoreObject *o, CoreObject *context, unsigned int cid); -TReturn tcore_ps_clear_context_id(CoreObject *o, CoreObject *context); +gboolean tcore_ps_assign_context_id(CoreObject *o, CoreObject *context, guint cid); +gboolean tcore_ps_clear_context_id(CoreObject *o, CoreObject *context); -TReturn tcore_ps_define_context(CoreObject *o, CoreObject *ps_context, void *user_data); - -TReturn tcore_ps_activate_context(CoreObject *o, CoreObject *context, void *user_data); -TReturn tcore_ps_deactivate_context(CoreObject *o, CoreObject *context, void *user_data); -TReturn tcore_ps_deactivate_contexts(CoreObject *o); - -__END_DECLS +CoreObject *tcore_ps_ref_context_by_role(CoreObject *o, TcoreContextRole role); +gboolean tcore_ps_ref_context_by_id(CoreObject *o, guint id, GSList **list); +gboolean tcore_ps_is_active_apn(CoreObject *o, const char* apn); +#ifdef __cplusplus +} #endif + +#endif /* __CO_PS_H__ */ diff --git a/include/co_sap.h b/include/co_sap.h index cc12358..c8e345b 100644 --- a/include/co_sap.h +++ b/include/co_sap.h @@ -1,9 +1,8 @@ /* * libtcore * - * Copyright (c) 2012 Samsung Electronics Co., Ltd. All rights reserved. - * - * Contact: Ja-young Gu + * Copyright (c) 2013 Samsung Electronics Co. Ltd. All rights reserved. + * Copyright (c) 2013 Intel Corporation. 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. @@ -18,30 +17,34 @@ * limitations under the License. */ -#ifndef __TCORE_CO_SAP_H__ -#define __TCORE_CO_SAP_H__ - -#include +#ifndef __CO_SAP_H__ +#define __CO_SAP_H__ -__BEGIN_DECLS +#include "core_object.h" +#include -struct tcore_sap_operations { - TReturn (*connect)(CoreObject *o, UserRequest *ur); - TReturn (*disconnect)(CoreObject *o, UserRequest *ur); - TReturn (*req_status)(CoreObject *o, UserRequest *ur); - TReturn (*set_transport_protocol)(CoreObject *o, UserRequest *ur); - TReturn (*set_power)(CoreObject *o, UserRequest *ur); - TReturn (*get_atr)(CoreObject *o, UserRequest *ur); - TReturn (*transfer_apdu)(CoreObject *o, UserRequest *ur); - TReturn (*get_cardreader_status)(CoreObject *o, UserRequest *ur); -}; +#ifdef __cplusplus +extern "C" { +#endif -CoreObject *tcore_sap_new(TcorePlugin *p, - struct tcore_sap_operations *ops, TcoreHal *hal); -void tcore_sap_free(CoreObject *o); +typedef struct { + TelReturn (*req_connect)(CoreObject *co, unsigned int max_msg_size, TcoreObjectResponseCallback cb, void *cb_data); + TelReturn (*req_disconnect)(CoreObject *co, TcoreObjectResponseCallback cb, void *cb_data); + TelReturn (*get_atr)(CoreObject *co, TcoreObjectResponseCallback cb, void *cb_data); + TelReturn (*req_transfer_apdu)(CoreObject *co, const TelSapApdu *apdu_data, TcoreObjectResponseCallback cb, void *cb_data); + TelReturn (*req_transport_protocol)(CoreObject *co, TelSimSapProtocol protocol, TcoreObjectResponseCallback cb, void *cb_data); + TelReturn (*req_power_operation)(CoreObject *co, TelSapPowerMode power_mode, TcoreObjectResponseCallback cb, void *cb_data); + TelReturn (*get_cardreader_status)(CoreObject *co, TcoreObjectResponseCallback cb, void *cb_data); +} TcoreSapOps; -void tcore_sap_override_ops(CoreObject *o, struct tcore_sap_operations *sap_ops); +CoreObject *tcore_sap_new(TcorePlugin *plugin, TcoreSapOps *sap_ops, TcoreHal *hal); +void tcore_sap_free(CoreObject *co); -__END_DECLS +gboolean tcore_sap_set_ops(CoreObject *co, TcoreSapOps *ops); +void tcore_sap_override_ops(CoreObject *co, TcoreSapOps *sap_ops); +#ifdef __cplusplus +} #endif + +#endif /* __CO_SAP_H__ */ diff --git a/include/co_sat.h b/include/co_sat.h index 4ff5cf5..c1f78f9 100644 --- a/include/co_sat.h +++ b/include/co_sat.h @@ -1,9 +1,8 @@ /* * libtcore * - * Copyright (c) 2012 Samsung Electronics Co., Ltd. All rights reserved. - * - * Contact: Ja-young Gu + * Copyright (c) 2013 Samsung Electronics Co., Ltd. All rights reserved. + * Copyright (c) 2013 Intel Corporation. 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. @@ -18,78 +17,37 @@ * limitations under the License. */ -#ifndef __TCORE_CO_SAT_H__ -#define __TCORE_CO_SAT_H__ +#ifndef __CO_SAT_H__ +#define __CO_SAT_H__ #include +#include "type/sat_internal.h" +#include -enum tcore_sat_result{ - TCORE_SAT_SUCCESS, - TCORE_SAT_SUCCESS_PARTIAL_COMPREHENSION, - TCORE_SAT_UNABLE_TO_PERFORM_CMD, - TCORE_SAT_REQUIRED_VALUE_MISSING, - TCORE_SAT_COMMAND_NOT_UNDERSTOOD, - TCORE_SAT_BEYOND_ME_CAPABILITY, - TCORE_SAT_COMMAND_TYPE_NOT_UNDERSTOOD, - TCORE_SAT_ERROR_FATAL -}; - -struct tcore_sat_proactive_command { - int cmd_num; - enum tel_sat_proactive_cmd_type cmd_type; - union { - struct tel_sat_display_text_tlv display_text; - struct tel_sat_get_inkey_tlv get_inkey; - struct tel_sat_get_input_tlv get_input; - struct tel_sat_more_time_tlv more_time; - struct tel_sat_play_tone_tlv play_tone; - struct tel_sat_setup_menu_tlv setup_menu; - struct tel_sat_select_item_tlv select_item; - struct tel_sat_send_sms_tlv send_sms; - struct tel_sat_send_ss_tlv send_ss; - struct tel_sat_send_ussd_tlv send_ussd; - struct tel_sat_setup_call_tlv setup_call; - struct tel_sat_refresh_tlv refresh; - struct tel_sat_provide_local_info_tlv provide_local_info; - struct tel_sat_setup_event_list_tlv setup_event_list; - struct tel_sat_setup_idle_mode_text_tlv setup_idle_mode_text; - struct tel_sat_send_dtmf_tlv send_dtmf; - struct tel_sat_language_notification_tlv language_notification; - struct tel_sat_launch_browser_tlv launch_browser; - struct tel_sat_open_channel_tlv open_channel; - struct tel_sat_close_channel_tlv close_channel; - struct tel_sat_receive_channel_tlv receive_data; - struct tel_sat_send_channel_tlv send_data; - struct tel_sat_get_channel_status_tlv get_channel_status; -/* - TelSatRefreshIndInfo_t refresh; - TelSatProvideLocalInfoIndInfo_t provideLocInfo; - TelSatLaunchBrowserIndInfo_t launchBrowser; - TelSatSetupIdleModeTextIndInfo_t idleText; - TelSatSendDtmfIndInfo_t sendDtmf; - TelSatLanguageNotificationIndInfo_t languageNotification; - TelSatOpenChannelIndInfo_t openChannel; - TelSatCloseChannelIndInfo_t closeChannel; - TelSatReceiveDataIndInfo_t receiveData; - TelSatSendDataIndInfo_t sendData; - TelSatGetChannelStatusIndInfo_t getChannelStatus; -*/ - } data; -}; - -struct tcore_sat_operations { - TReturn (*envelope)(CoreObject *o, UserRequest *ur); - TReturn (*terminal_response)(CoreObject *o, UserRequest *ur); -}; - -int tcore_sat_decode_proactive_command(unsigned char* tlv_origin, unsigned int tlv_length, struct tcore_sat_proactive_command* decoded_tlv); -int tcore_sat_encode_envelop_cmd(const struct treq_sat_envelop_cmd_data *src_envelop, char *dst_envelop); -int tcore_sat_encode_terminal_response(const struct treq_sat_terminal_rsp_data *src_tr, char *dst_tr); - -CoreObject *tcore_sat_new(TcorePlugin *p, - struct tcore_sat_operations *ops, TcoreHal *hal); -void tcore_sat_free(CoreObject *n); - -void tcore_sat_override_ops(CoreObject *o, struct tcore_sat_operations *sat_ops); +#ifdef __cplusplus + extern "C" { +#endif +/* OEM operations */ +typedef struct { + TelReturn (*send_envelope)(CoreObject *co, const TelSatRequestEnvelopCmdData *envelop_data, TcoreObjectResponseCallback cb, void *cb_data); + TelReturn (*send_terminal_response)(CoreObject *co, const TelSatRequestTerminalResponseData *terminal_rsp_data, TcoreObjectResponseCallback cb, void *cb_data); + TelReturn (*send_user_confirmation)(CoreObject *co, const TelSatRequestUserConfirmationData *user_conf_data, TcoreObjectResponseCallback cb, void *cb_data); +}TcoreSatOps; + +CoreObject *tcore_sat_new(TcorePlugin *p, TcoreSatOps *sat_ops, TcoreHal *hal); +void tcore_sat_free(CoreObject *co); +void tcore_sat_override_ops(CoreObject *co, TcoreSatOps *sat_ops); +gboolean tcore_sat_set_ops(CoreObject *co, TcoreSatOps *ops); + +gboolean tcore_sat_decode_proactive_command(unsigned char* tlv_origin, unsigned int tlv_length, + TelSatDecodedProactiveData* decoded_tlv, int* decode_err_code); +int tcore_sat_decode_call_control_result(unsigned char* tlv_origin, unsigned int tlv_length, TelSatNotiCallControlResultInd* call_ctrl_result_tlv); +gboolean tcore_sat_encode_envelop_cmd(const TelSatRequestEnvelopCmdData *src_envelop, char *dst_envelop, int* envelope_length); +gboolean tcore_sat_encode_terminal_response(const TelSatRequestTerminalResponseData *src_tr, char *dst_tr, int* tr_length); + +#ifdef __cplusplus +} #endif + +#endif /* __CO_SAT_H__ */ diff --git a/include/co_sim.h b/include/co_sim.h index f761916..4a5a0fb 100644 --- a/include/co_sim.h +++ b/include/co_sim.h @@ -1,9 +1,8 @@ /* * libtcore * - * Copyright (c) 2012 Samsung Electronics Co., Ltd. All rights reserved. - * - * Contact: Ja-young Gu + * Copyright (c) 2013 Samsung Electronics Co. Ltd. All rights reserved. + * Copyright (c) 2013 Intel Corporation. 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. @@ -18,97 +17,336 @@ * limitations under the License. */ -#ifndef __TCORE_CO_SIM_H__ -#define __TCORE_CO_SIM_H__ - -#include - -__BEGIN_DECLS - -struct tcore_sim_operations { - TReturn (*verify_pins)(CoreObject *o, UserRequest *ur); - TReturn (*verify_puks)(CoreObject *o, UserRequest *ur); - TReturn (*change_pins)(CoreObject *o, UserRequest *ur); - TReturn (*get_facility_status)(CoreObject *o, UserRequest *ur); - TReturn (*enable_facility)(CoreObject *o, UserRequest *ur); - TReturn (*disable_facility)(CoreObject *o, UserRequest *ur); - TReturn (*get_lock_info)(CoreObject *o, UserRequest *ur); - TReturn (*read_file)(CoreObject *o, UserRequest *ur); - TReturn (*update_file)(CoreObject *o, UserRequest *ur); - TReturn (*transmit_apdu)(CoreObject *o, UserRequest *ur); - TReturn (*get_atr)(CoreObject *o, UserRequest *ur); - TReturn (*req_authentication)(CoreObject *o, UserRequest *ur); -}; - -CoreObject *tcore_sim_new(TcorePlugin *p, - struct tcore_sim_operations *ops, TcoreHal *hal); -void tcore_sim_free(CoreObject *n); - -void tcore_sim_override_ops(CoreObject *o, - struct tcore_sim_operations *sim_ops); - -enum tel_sim_type tcore_sim_get_type(CoreObject *o); -gboolean tcore_sim_set_type(CoreObject *o, enum tel_sim_type type); - -struct tel_sim_imsi *tcore_sim_get_imsi(CoreObject *o); -gboolean tcore_sim_set_imsi(CoreObject *o, struct tel_sim_imsi *imsi); - -enum tel_sim_status tcore_sim_get_status(CoreObject *o); -gboolean tcore_sim_set_status(CoreObject *o, enum tel_sim_status status); - -gboolean tcore_sim_get_identification(CoreObject *o); -gboolean tcore_sim_set_identification(CoreObject *o, gboolean b_changed); - -struct tel_sim_service_table *tcore_sim_get_service_table(CoreObject *o); -gboolean tcore_sim_set_service_table(CoreObject *o, struct tel_sim_service_table *svct); - -gboolean tcore_sim_get_cphs_status(CoreObject *o); -gboolean tcore_sim_set_cphs_status(CoreObject *o, gboolean b_support); - -gboolean tcore_sim_link_userdata(CoreObject *o, void *userdata); -void *tcore_sim_ref_userdata(CoreObject *o); - -gboolean tcore_sim_decode_iccid(struct tel_sim_iccid *p_out, unsigned char *p_in, int in_length); -gboolean tcore_sim_decode_lp(struct tel_sim_language *p_out, unsigned char *p_in, int in_length); -char *tcore_sim_encode_lp(int *out_length, struct tel_sim_language *p_in); -gboolean tcore_sim_decode_li(enum tel_sim_file_id file_id, struct tel_sim_language *p_out, unsigned char *p_in, int in_length); -char *tcore_sim_encode_li(int *out_length, struct tel_sim_language *p_in); -gboolean tcore_sim_decode_imsi(struct tel_sim_imsi *p_out, unsigned char *p_in, int in_length); -gboolean tcore_sim_decode_sst(struct tel_sim_sst *p_sst, unsigned char *p_in, int in_length); -gboolean tcore_sim_decode_spn(struct tel_sim_spn *p_spn, unsigned char *p_in, int in_length); -gboolean tcore_sim_decode_spdi(struct tel_sim_spdi *p_spdi, unsigned char *p_in, int in_length); -gboolean tcore_sim_decode_msisdn(struct tel_sim_msisdn *p_msisdn, unsigned char *p_in, int in_length); -gboolean tcore_sim_decode_xdn(struct tel_sim_dialing_number *p_xdn, unsigned char *p_in, int in_length); -char *tcore_sim_encode_xdn(int out_length, struct tel_sim_dialing_number *p_xdn); -gboolean tcore_sim_decode_ecc(struct tel_sim_ecc_list *p_ecc, unsigned char *p_in, int in_length); -gboolean tcore_sim_decode_ust(struct tel_sim_ust *p_ust, unsigned char *p_in, int in_length); -gboolean tcore_sim_decode_est(struct tel_sim_est *p_est, unsigned char *p_in, int in_length); -gboolean tcore_sim_decode_uecc(struct tel_sim_ecc *p_ecc, unsigned char *p_in, int in_length); -gboolean tcore_sim_decode_gid( struct tel_sim_gid *p_gid, unsigned char *p_in, int in_length); -gboolean tcore_sim_decode_mbi(struct tel_sim_mbi *p_mbi, unsigned char *p_in, int in_length); -gboolean tcore_sim_encode_mbi(char *p_out, int out_length, struct tel_sim_mbi *p_mbi); -gboolean tcore_sim_decode_mwis(struct tel_sim_mw *pMwis, unsigned char *p_in, int in_length); -char *tcore_sim_encode_mwis(int *out_length, const struct tel_sim_mw *pMwis); -gboolean tcore_sim_decode_vmwf(struct tel_sim_cphs_mw *p_vmwf, unsigned char *p_in, unsigned long in_length); -char *tcore_sim_encode_vmwf(int *out_length, const struct tel_sim_cphs_mw *p_vmwf); -gboolean tcore_sim_decode_cfis(struct tel_sim_cfis *cfis, unsigned char *p_in, int in_length); -char *tcore_sim_encode_cfis(int *out_length, const struct tel_sim_cfis *p_cfis); -gboolean tcore_sim_decode_cff(struct tel_sim_cphs_cf *cfis, unsigned char *p_in, int in_length); -char *tcore_sim_encode_cff(const struct tel_sim_cphs_cf *cff); -gboolean tcore_sim_decode_csp(struct tel_sim_cphs_csp *p_csp, unsigned char *p_in, int in_length); -gboolean tcore_sim_encode_csp(unsigned char *p_out, int out_length, struct tel_sim_cphs_csp *p_csp); -gboolean tcore_sim_decode_dynamic_flag(struct tel_sim_cphs_dflag *p_df, unsigned char *p_in, int in_length); -gboolean tcore_sim_encode_dynamic_flag(char *p_out, int out_length, struct tel_sim_cphs_dflag *p_df); -gboolean tcore_sim_decode_dynamic2_flag(struct tel_sim_cphs_dflag2 *p_d2f, unsigned char *p_in, int in_length); -gboolean tcore_sim_encode_dynamic2_flag(char *p_out, int out_length, struct tel_sim_cphs_dflag2 *p_d2f); -gboolean tcore_sim_decode_cphs_info(struct tel_sim_cphs_info *pCphsInfo, unsigned char *p_in, int in_length); -gboolean tcore_sim_decode_short_ons(unsigned char *p_out, unsigned char *p_in, int in_length); -gboolean tcore_sim_decode_ons(unsigned char *p_out, unsigned char *p_in, int in_length); -gboolean tcore_sim_decode_information_number(struct tel_sim_cphs_info_number *p_info, unsigned char *p_in, int in_length); -gboolean tcore_sim_decode_opl(struct tel_sim_opl *p_opl, unsigned char *p_in, int in_length); -gboolean tcore_sim_decode_pnn(struct tel_sim_pnn *p_pnn, unsigned char *p_in, int in_length); -gboolean tcore_sim_decode_oplmnwact(struct tel_sim_oplmnwact_list *p_list, unsigned char *p_in, int in_length); - -__END_DECLS +#ifndef __CO_SIM_H__ +#define __CO_SIM_H__ + +#include "core_object.h" +#include +#include + +#ifdef __cplusplus + extern "C" { +#endif + +#define TEL_SIM_LANG_CNT_MAX 30 /**< Max language count */ +#define TEL_SIM_XDN_ALPHA_ID_LEN_MAX 30 /**< Max alpha id length */ +#define TEL_SIM_XDN_NUMBER_LEN_MAX 20 /**< Max XDN number length */ +#define TEL_SIM_SST_LEN_MAX 20 /**< Telephony defined */ +#define TEL_SIM_SST_SERVICE_CNT_MAX 56 /**< Max SST service count */ +#define TEL_SIM_UST_SERVICE_CNT_MAX 64 /**< Max UST service count */ +#define TEL_SIM_SPDI_PLMN_MAX 41 /**< Max SPDI PLMN */ +#define TEL_SIM_UST_BYTE_LEN_MAX 8 /**< Max UST byte length */ +#define TEL_SIM_ECC_BYTE_LEN_MAX 3 /**< Max ECC byte length */ +#define TEL_SIM_MAIL_BOX_IDENTIFIER_LEN_MAX 5 /**< Max mail box identifier length */ +#define TEL_SIM_CPHS_VMWF_LEN_MAX 2 /**< Max CPHS VMWF length */ +#define TEL_SIM_CPHS_OPERATOR_NAME_LEN_MAX 25 /**< Max CPHS operator name length */ +#define TEL_SIM_CPHS_OPERATOR_NAME_SHORT_FORM_LEN_MAX 10 /**< Max CPHS operator name short form length */ + +typedef enum { + // service 1 ~ 8 + TEL_SIM_SST_CHV1_DISABLE_FUNC = 0, /**< CHV1 disable function */ + TEL_SIM_SST_ADN, /**< abbreviated Dialing number */ + TEL_SIM_SST_FDN, /**< fixed Dialing number */ + TEL_SIM_SST_SMS, /**< short message storage */ + TEL_SIM_SST_AOC, /**< advice of charge */ + TEL_SIM_SST_CCP, /**< capability configuration parameters */ + TEL_SIM_SST_PLMN_SELECTOR, /**< plmn selector */ + TEL_SIM_SST_RFU1, /**< rfu */ + + // service 9 ~ 16 + TEL_SIM_SST_MSISDN = 8, /**< msisdn */ + TEL_SIM_SST_EXT1, /**< extension1 */ + TEL_SIM_SST_EXT2, /**< extension2 */ + TEL_SIM_SST_SMS_PARAMS, /**< sms parameteres */ + TEL_SIM_SST_LND, /**< last number dialed */ + TEL_SIM_SST_CELL_BROADCAST_MSG_ID, /**< cell broadcast message identifier */ + TEL_SIM_SST_GID_LV1, /**< group identifier level 1 */ + TEL_SIM_SST_GID_LV2, /**< group identifier level 2 */ + + // service 17 ~ 24 + TEL_SIM_SST_SPN = 16, /**< service provider name */ + TEL_SIM_SST_SDN, /**< service Dialing number */ + TEL_SIM_SST_EXT3, /**< extension3 */ + TEL_SIM_SST_RFU2, /**< rfu */ + TEL_SIM_SST_VGCS_GID_LIST, /**< vgcs group identifier (EF-VGCS, EF-VGCSS) */ + TEL_SIM_SST_VBS_GID_LIST, /**< vbs group identifier (EF-VBS, EF-VBSS) */ + TEL_SIM_SST_ENHANCED_MULTI_LV_PRECEDENCE_PREEMPTION_SRVC, /**< enhanced multi-level precedence and pre-emption service */ + TEL_SIM_SST_AUTO_ANSWER_FOR_EMLPP, /**< automatic answer fro eMLPP */ + + // service 25 ~ 32, + TEL_SIM_SST_DATA_DOWNLOAD_VIA_SMS_CB = 24, /**< data download via sms-cb */ + TEL_SIM_SST_DATA_DOWNLOAD_VIA_SMS_PP, /**< data download via sms-pp */ + TEL_SIM_SST_MENU_SELECTION, /**< menu selection */ + TEL_SIM_SST_CALL_CTRL, /**< call control */ + TEL_SIM_SST_PROACTIVE_SIM, /**< proactive sim command */ + TEL_SIM_SST_CELL_BROADCAST_MSG_ID_RANGES, /**< cell broadcast message identifier ranges */ + TEL_SIM_SST_BDN, /**< barred Dialing numbers */ + TEL_SIM_SST_EXT4, /**< extension 4 */ + + // service 33 ~ 40 + TEL_SIM_SST_DEPERSONALIZATION_CTRL_KEYS = 32, /**< de-personalization control keys */ + TEL_SIM_SST_COOPERATIVE_NETWORK_LIST, /**< co-operative network list */ + TEL_SIM_SST_SMS_STATUS_REPORTS, /**< short message status reports */ + TEL_SIM_SST_NIA, /**< network's indication of alerting in the MS (NIA) */ + TEL_SIM_SST_MO_SMS_CTRL_BY_SIM, /**< mobile-originated short message control by sim */ + TEL_SIM_SST_GPRS, /**< gprs */ + TEL_SIM_SST_IMG, /**< image */ + TEL_SIM_SST_SOLSA, /**< support of local service area */ + + // service 41 ~ 48 + TEL_SIM_SST_USSD_STR_DATA_OBJECT_SUPPORTED_IN_CALL_CTRL = 40, /**< ussd string data object supported in call control */ + TEL_SIM_SST_RUN_AT_CMD_CMD, /**< RUN AT COMMAND command */ + TEL_SIM_SST_USER_CTRLED_PLMN_SELECTOR_WACT, /**< user controlled PLMN selector with Access technology */ + TEL_SIM_SST_OPERATOR_CTRLED_PLMN_SELECTOR_WACT, /**< operator controlled PLMN selector with Access technology */ + TEL_SIM_SST_HPLMN_SELECTOR_WACT, /**< HPLMN selector with access technology */ + TEL_SIM_SST_CPBCCH_INFO, /**< CPBCCH information */ + TEL_SIM_SST_INVESTIGATION_SCAN, /**< investigation scan */ + TEL_SIM_SST_EXTENDED_CAPA_CONF_PARAMS, /**< extended capability configuration parameters */ + + // service 49 ~ 56 + TEL_SIM_SST_MEXE = 48, /**< MExE */ + TEL_SIM_SST_RPLMN_LAST_USED_ACCESS_TECH, /**< RPLMN last used access technology */ + TEL_SIM_SST_PLMN_NETWORK_NAME, /*PLMN Network Name*/ + TEL_SIM_SST_OPERATOR_PLMN_LIST, /*Operator PLMN List*/ + TEL_SIM_SST_MBDN, /*Mailbox Dialling Numbers*/ + TEL_SIM_SST_MWIS, /*Message Waiting Indication Status*/ + TEL_SIM_SST_CFIS, /*Call Forwarding Indication Status*/ + TEL_SIM_SST_SPDI /*Service Provider Display Information*/ +} TelSimSstService; + +typedef enum { + // service 1 ~ 8 + TEL_SIM_UST_LOCAL_PB = 0, /**< local phone book */ + TEL_SIM_UST_FDN, /**< fixed Dialing number */ + TEL_SIM_UST_EXT2, /**< extension2 */ + TEL_SIM_UST_SDN, /**< service Dialing number */ + TEL_SIM_UST_EXT3, /**< extension3 */ + TEL_SIM_UST_BDN, /**< barred Dialing numbers */ + TEL_SIM_UST_EXT4, /**< extension 4 */ + TEL_SIM_UST_OUTGOING_CALL_INFO, /**< outgoing call information */ + + // service 9 ~ 16 + TEL_SIM_UST_INCOMING_CALL_INFO = 8, /**< incoming call information */ + TEL_SIM_UST_SMS, /**< short message storage */ + TEL_SIM_UST_SMS_STATUS_REPORTS, /**< short message status reports */ + TEL_SIM_UST_SMS_PARAMS, /**< sms parameteres */ + TEL_SIM_UST_AOC, /**< advice of charge */ + TEL_SIM_UST_CCP, /**< capability configuration parameters */ + TEL_SIM_UST_CELL_BROADCAST_MSG_ID, /**< cell broadcast message identifier */ + TEL_SIM_UST_CELL_BROADCAST_MSG_ID_RANGES, /**< cell broadcast message identifier ranges */ + + // service 17 ~ 24 + TEL_SIM_UST_GID_LV1 = 16, /**< group identifier level 1 */ + TEL_SIM_UST_GID_LV2, /**< group identifier level 2 */ + TEL_SIM_UST_SPN, /**< service provider name */ + TEL_SIM_UST_USER_CTRLED_PLMN_SELECTOR_WACT, /**< user controlled PLMN selector with Access technology */ + TEL_SIM_UST_MSISDN, /**< msisdn */ + TEL_SIM_UST_IMG, /**< image */ + TEL_SIM_UST_SOLSA, /**< support of local service area */ + TEL_SIM_UST_ENHANCED_MULTI_LV_PRECEDENCE_PREEMPTION_SRVC, /**< enhanced multi-level precedence and pre-emption service */ + + // service 25 ~ 32 + TEL_SIM_UST_AUTO_ANSWER_FOR_EMLPP = 24, /**< automatic answer fro eMLPP */ + TEL_SIM_UST_RFU1, /**< rfu */ + TEL_SIM_UST_GSM_ACCESS, /**< gsm access */ + TEL_SIM_UST_DATA_DOWNLOAD_VIA_SMS_PP, /**< data download via sms-pp */ + TEL_SIM_UST_DATA_DOWNLOAD_VIA_SMS_CB, /**< data download via sms-cb */ + TEL_SIM_UST_CALL_CTRL, /**< call control by usim*/ + TEL_SIM_UST_MO_SMS_CTRL, /**< mobile-originated short message control by usim */ + TEL_SIM_UST_RUN_AT_CMD_CMD, /**< RUN AT COMMAND command */ + + // service 33 ~ 40 + TEL_SIM_UST_SHALL_BE_SET_TO_ONE = 32, /**< shall be set to 1 */ + TEL_SIM_UST_ENABLED_SRVC_TABLE, /**< enabled service table */ + TEL_SIM_UST_ACL, /**< APN control list */ + TEL_SIM_UST_DEPERSONALIZATION_CTRL_KEYS, /**< de-personalization control keys */ + TEL_SIM_UST_COOPERATIVE_NETWORK_LIST, /**< co-operative network list */ + TEL_SIM_UST_GSM_SEC_CONTEXT, /**< gsm security context */ + TEL_SIM_UST_CPBCCH_INFO, /**< CPBCCH information */ + TEL_SIM_UST_INVESTIGATION_SCAN, /**< investigation scan */ + + // service 41 ~ 48 + TEL_SIM_UST_MEXE = 40, /**< MExE */ + TEL_SIM_UST_OPERATOR_CTRLED_PLMN_SELECTOR_WACT, /**< operator controlled PLMN selector with Access technology */ + TEL_SIM_UST_HPLMN_SELECTOR_WACT, /**< HPLMN selector with access technology */ + TEL_SIM_UST_EXT5, /**< extension 5 */ + TEL_SIM_UST_PLMN_NETWORK_NAME, /*PLMN Network Name*/ + TEL_SIM_UST_OPERATOR_PLMN_LIST, /*Operator PLMN List*/ + TEL_SIM_UST_MBDN, /*Mailbox Dialling Numbers*/ + TEL_SIM_UST_MWIS, /*Message Waiting Indication Status*/ + + // service 49 ~ 56 + TEL_SIM_UST_CFIS = 48, /*Call Forwarding Indication Status*/ + TEL_SIM_UST_RPLMN_LAST_USED_ACCESS_TECH, /**< RPLMN last used access technology */ + TEL_SIM_UST_SPDI, /*Service Provider Display Information*/ + TEL_SIM_UST_MMS, /**< multi media messaging service */ + TEL_SIM_UST_EXT8, /**< extension 8 */ + TEL_SIM_UST_CALL_CTRL_ON_GPRS, /**< call control on gprs by usim */ + TEL_SIM_UST_MMS_USER_CONNECTIVITY_PARAMS, /**< mms user connectivity parameters */ + TEL_SIM_UST_NIA, /**< network's indication of alerting in the MS (NIA) */ + + // service 57 ~ 64 + TEL_SIM_UST_VGCS_GID_LIST, /**< vgcs group identifier List (EF-VGCS, EF-VGCSS) */ + TEL_SIM_UST_VBS_GID_LIST, /**< vbs group identifier List (EF-VBS, EF-VBSS) */ + TEL_SIM_UST_PSEUDONYM, + TEL_SIM_UST_USER_CTRLED_PLMN_SELECTOR_IWLAN, /**< user controlled PLMN selector for I-WLAN access */ + TEL_SIM_UST_OPERATOR_CTRLED_PLMN_SELECTOR_IWLAN, /**< operator controlled PLMN selector for I-WLAN access */ + TEL_SIM_UST_USER_CTRLED_WSID_LIST, + TEL_SIM_UST_OPERATOR_CTRLED_WSID_LIST, + TEL_SIM_UST_VGCS_SEC +} TelSimUstService; +typedef enum { + TEL_SIM_EF_DIR = 0x2F00, /**< Root Directory for the USIM */ + TEL_SIM_EF_ICCID = 0x2FE2, /**< the ICC Identification file */ + TEL_SIM_EF_IMSI = 0x6F07, /**< the IMSI file */ + TEL_SIM_EF_SST = 0x6F38, /**< the SIM Service Table file. EF UST has same address */ + TEL_SIM_EF_EST = 0x6F56, /**< the Enabled Service Table file */ + TEL_SIM_EF_OPLMN_ACT = 0x6F61, /**< the OPLMN List file*/ + TEL_SIM_EF_GID1 = 0x6F3E, /**< the Group Identifier Level 1 */ + TEL_SIM_EF_GID2 = 0x6F3F, /**< the Group Identifier Level 2 */ + + TEL_SIM_EF_ELP = 0x2F05, /**< the Extended Language Preference file */ + TEL_SIM_EF_LP = 0x6F05, /**< SIM: Language preference */ + TEL_SIM_EF_ECC = 0x6FB7, /**< the Emergency Call Codes */ + TEL_SIM_EF_SPN = 0x6F46, /**< the Service Provider Name */ + TEL_SIM_EF_SPDI = 0x6FCD, /**< the Service provider display information*/ + TEL_SIM_EF_PNN = 0x6FC5, /**< the PLMN Network Name File*/ + TEL_SIM_EF_OPL = 0x6FC6, /**< the Operator PLMN List File*/ + TEL_SIM_EF_MBDN = 0x6FC7, /** < SIM Mail Box Dialing Number file */ + TEL_SIM_EF_MSISDN = 0x6F40, /**< MSISDN */ + TEL_SIM_EF_EXT1 = 0x6F4A, /**< Extension File-1 */ + TEL_SIM_EF_EXT5 = 0x6F4E, /**< Extension File-5 */ + TEL_SIM_EF_IMG = 0x4F20, /**Image file*/ + + TEL_SIM_EF_USIM_LI = 0x6A05, /**< USIM: Language Indication */ + TEL_SIM_EF_USIM_PL = 0x2A05, /**< the Language Preference file of USIM */ + TEL_SIM_EF_USIM_MBI = 0x6FC9, /** < Mailbox Identifier -linear fixed*/ + TEL_SIM_EF_USIM_MWIS = 0x6FCA, /** < Message Waiting Indication Status -linear fixed*/ + TEL_SIM_EF_USIM_CFIS = 0x6FCB, /** < Call forward indication status -linear fixed*/ + + /* CPHS FILE ID */ + TEL_SIM_EF_CPHS_VOICE_MSG_WAITING = 0x6F11, /** < CPHS voice MSG waiting indication */ + TEL_SIM_EF_CPHS_SERVICE_STRING_TABLE = 0x6F12, /** < CPHS service string table */ + TEL_SIM_EF_CPHS_CALL_FORWARD_FLAGS = 0x6F13, /** < CPHS call forward flags */ + TEL_SIM_EF_CPHS_OPERATOR_NAME_STRING = 0x6F14, /** < CPHS operator name string */ + TEL_SIM_EF_CPHS_CUSTOMER_SERVICE_PROFILE = 0x6F15, /** < CPHS customer service profile */ + TEL_SIM_EF_CPHS_CPHS_INFO = 0x6F16, /** < CPHS information */ + TEL_SIM_EF_CPHS_MAILBOX_NUMBERS = 0x6F17, /** < CPHS mail box numbers */ + TEL_SIM_EF_CPHS_OPERATOR_NAME_SHORT_FORM_STRING = 0x6F18, /** < CPHS operator name short form string */ + TEL_SIM_EF_CPHS_INFORMATION_NUMBERS = 0x6F19, /** < CPHS information numbers */ + /* CPHS ALS FILE ID */ + TEL_SIM_EF_CPHS_DYNAMICFLAGS = 0x6F9F, /** < CPHS Dynamics flags */ + TEL_SIM_EF_CPHS_DYNAMIC2FLAG = 0x6F92, /** < CPHS Dynamics2 flags */ + TEL_SIM_EF_CPHS_CUSTOMER_SERVICE_PROFILE_LINE2 = 0x6F98, /** < CPHS CSP2 */ + TEL_SIM_EF_PBR = 0x4F30, + + /* SMS FILE ID */ + TEL_SIM_EF_SMSP = 0x6F42, /** < SMSP File */ + + /* Invalid File ID, All the file ID are less than this Value*/ + TEL_SIM_EF_INVALID = 0xFFFF, /**< Invalid file.*/ + TEL_SIM_EF_OTHERS, /**< Element to indicate an unknown file.*/ +} TelSimFileId; + +typedef struct { + TelSimCardType sim_type; + union { + char sst_service[TEL_SIM_SST_SERVICE_CNT_MAX]; // should accessed with 'enum tel_sim_sst_service' as index + char ust_service[TEL_SIM_UST_SERVICE_CNT_MAX]; // should accessed with 'enum tel_sim_ust_service' as index + } table; +} TelSimServiceTable; + +/* OEM operations */ +typedef struct { + TelReturn (*get_imsi)(CoreObject *co, TcoreObjectResponseCallback cb, void *cb_data); + TelReturn (*get_ecc)(CoreObject *co, TcoreObjectResponseCallback cb, void *cb_data); + TelReturn (*get_iccid)(CoreObject *co, TcoreObjectResponseCallback cb, void *cb_data); + TelReturn (*get_language)(CoreObject *co, TcoreObjectResponseCallback cb, void *cb_data); + TelReturn (*set_language)(CoreObject *co, TelSimLanguagePreferenceCode language, TcoreObjectResponseCallback cb, void *cb_data); + TelReturn (*get_callforwarding_info)(CoreObject *co, TcoreObjectResponseCallback cb, void *cb_data); + TelReturn (*get_messagewaiting_info)(CoreObject *co, TcoreObjectResponseCallback cb, void *cb_data); + TelReturn (*set_messagewaiting_info)(CoreObject *co, const TelSimMwis *request, TcoreObjectResponseCallback cb, void *cb_data); + TelReturn (*get_mailbox_info)(CoreObject *co, TcoreObjectResponseCallback cb, void *cb_data); + TelReturn (*set_mailbox_info)(CoreObject *co, const TelSimMailBoxNumber *request, TcoreObjectResponseCallback cb, void *cb_data); + TelReturn (*get_msisdn)(CoreObject *co, TcoreObjectResponseCallback cb, void *cb_data); + TelReturn (*get_spn)(CoreObject *co, TcoreObjectResponseCallback cb, void *cb_data); + TelReturn (*get_cphs_netname)(CoreObject *co, TcoreObjectResponseCallback cb, void *cb_data); + TelReturn (*get_sp_display_info)(CoreObject *co, TcoreObjectResponseCallback cb, void *cb_data); + TelReturn (*req_authentication)(CoreObject *co, const TelSimAuthenticationData *request, TcoreObjectResponseCallback cb, void *cb_data); + TelReturn (*verify_pins)(CoreObject *co, const TelSimSecPinPw *request, TcoreObjectResponseCallback cb, void *cb_data); + TelReturn (*verify_puks)(CoreObject *co, const TelSimSecPukPw *request, TcoreObjectResponseCallback cb, void *cb_data); + TelReturn (*change_pins)(CoreObject *co, const TelSimSecChangePinPw *request, TcoreObjectResponseCallback cb, void *cb_data); + TelReturn (*disable_facility)(CoreObject *co, const TelSimFacilityPw *request, TcoreObjectResponseCallback cb, void *cb_data); + TelReturn (*enable_facility)(CoreObject *co, const TelSimFacilityPw *request, TcoreObjectResponseCallback cb, void *cb_data); + TelReturn (*get_facility)(CoreObject *co, TelSimLockType lock_type, TcoreObjectResponseCallback cb, void *cb_data); + TelReturn (*get_lock_info)(CoreObject *co, TelSimLockType lock_type, TcoreObjectResponseCallback cb, void *cb_data); + TelReturn (*req_apdu)(CoreObject *co, const TelSimApdu *request, TcoreObjectResponseCallback cb, void *cb_data); + TelReturn (*req_atr)(CoreObject *co, TcoreObjectResponseCallback cb, void *cb_data); +} TcoreSimOps; + +CoreObject *tcore_sim_new(TcorePlugin *plugin, TcoreSimOps *sim_ops, TcoreHal *hal); +void tcore_sim_free(CoreObject *co); + +gboolean tcore_sim_set_ops(CoreObject *co, TcoreSimOps *ops); +void tcore_sim_override_ops(CoreObject *co, + TcoreSimOps *sim_ops); + +gboolean tcore_sim_get_type(CoreObject *co, TelSimCardType *type); +gboolean tcore_sim_set_type(CoreObject *co, TelSimCardType type); + +gboolean tcore_sim_get_imsi(CoreObject *co, TelSimImsiInfo **imsi); +gboolean tcore_sim_set_imsi(CoreObject *co, TelSimImsiInfo *imsi); + +gboolean tcore_sim_get_status(CoreObject *co, TelSimCardStatus *status); +gboolean tcore_sim_set_status(CoreObject *co, TelSimCardStatus status); + +gboolean tcore_sim_get_identification(CoreObject *co, TelSimCardChangeStatus *change_status); +gboolean tcore_sim_set_identification(CoreObject *co, TelSimCardChangeStatus change_status); + +gboolean tcore_sim_get_service_table(CoreObject *co, TelSimServiceTable **svct); +gboolean tcore_sim_set_service_table(CoreObject *co, TelSimServiceTable *svct); + +gboolean tcore_sim_get_cphs_status(CoreObject *co, gboolean *is_supported); +gboolean tcore_sim_set_cphs_status(CoreObject *co, gboolean is_support); + +gboolean tcore_sim_get_spn(CoreObject *co, gchar **spn); +gboolean tcore_sim_set_spn(CoreObject *co, gchar *spn); +gboolean tcore_sim_get_disp_condition(CoreObject *co, TelSimSpnDispCondition *disp_condition); +gboolean tcore_sim_set_disp_condition(CoreObject *co, TelSimSpnDispCondition disp_condition); + +gboolean tcore_sim_link_userdata(CoreObject *co, void *userdata); +void *tcore_sim_ref_userdata(CoreObject *co); + +gboolean tcore_sim_decode_iccid(unsigned char *enc_iccid, int enc_iccid_len, char *dec_iccid); +gboolean tcore_sim_decode_lp(unsigned char *enc_lang, int enc_lang_len, TelSimLanguagePreferenceCode *dec_lang); +gboolean tcore_sim_encode_lp(TelSimLanguagePreferenceCode dec_lang, char **enc_lang, int *enc_lang_len); +gboolean tcore_sim_decode_li(unsigned char *enc_lang, int enc_lang_len, int file_id, TelSimLanguagePreferenceCode *dec_lang); +gboolean tcore_sim_encode_li(TelSimLanguagePreferenceCode dec_lang, char **en_lang, int *en_lang_len); +gboolean tcore_sim_decode_imsi(unsigned char *en_imsi, int en_imsi_len, TelSimImsiInfo *dec_imsi); +gboolean tcore_sim_decode_sst(unsigned char *enc_sst, int enc_sst_len, char *dec_sst); +gboolean tcore_sim_decode_spn(unsigned char *enc_spn, int enc_spn_len, TelSimSpn *dec_spn); +gboolean tcore_sim_decode_spdi(unsigned char *enc_spdi, int enc_spdi_len, TelSimSpPlmnList *dec_spdi); +gboolean tcore_sim_decode_msisdn(unsigned char *enc_msisdn, int enc_msisdn_len, TelSimSubscriberInfo *dec_msisdn); +gboolean tcore_sim_decode_xdn(unsigned char *enc_xdn, int enc_xdn_len, char *alpha_id, char *num); +gboolean tcore_sim_encode_xdn(char *alpha_id, char *num, char *enc_xdn, int enc_xdn_len); +gboolean tcore_sim_decode_ecc(unsigned char *enc_ecc, int enc_ecc_len, TelSimEccList *dec_ecc); +gboolean tcore_sim_decode_ust(unsigned char *enc_ust, int enc_ust_len, char *dec_ust); +gboolean tcore_sim_decode_uecc(unsigned char* enc_uecc, int enc_uecc_len, TelSimEcc *dec_ecc); +gboolean tcore_sim_decode_mbi(unsigned char *enc_mbi, int enc_mbi_len, TelSimMbi *dec_mbi); +gboolean tcore_sim_decode_cff(unsigned char *enc_cff, int enc_cff_len, TelSimMwis *dec_mwis); +gboolean tcore_sim_decode_mwis(unsigned char *enc_mwis, int enc_mwis_len, TelSimMwis *dec_mwis); +gboolean tcore_sim_encode_mwis(const TelSimMwis *mwis, guint field_count, + gchar **encoded_mwis, guint *encoded_mwis_len); +gboolean tcore_sim_decode_vmwf(unsigned char* enc_vmwf, unsigned long enc_vmwf_len, TelSimMwis *dec_vmwf); +gboolean tcore_sim_decode_ons(unsigned char* enc_ons, int enc_ons_len, unsigned char *dec_ons); +gboolean tcore_sim_decode_cfis(unsigned char *enc_cfis, int enc_cfis_len, TelSimCfis *dec_cfis); +gboolean tcore_sim_decode_short_ons(unsigned char *enc_short_ons, int enc_short_ons_len, unsigned char *dec_short_ons); +gboolean tcore_sim_decode_opl(unsigned char *enc_opl, int enc_opl_len, TelSimOpl *dec_opl); +gboolean tcore_sim_decode_pnn(unsigned char* enc_pnn, int enc_pnn_len, TelSimPnn *dec_pnn); + +#ifdef __cplusplus +} #endif + +#endif /* __CO_SIM_H__ */ diff --git a/include/co_sms.h b/include/co_sms.h index 09770c3..d112040 100644 --- a/include/co_sms.h +++ b/include/co_sms.h @@ -1,9 +1,8 @@ /* * libtcore * - * Copyright (c) 2012 Samsung Electronics Co., Ltd. All rights reserved. - * - * Contact: Ja-young Gu + * Copyright (c) 2013 Samsung Electronics Co. Ltd. All rights reserved. + * Copyright (c) 2013 Intel Corporation. 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. @@ -18,66 +17,47 @@ * limitations under the License. */ -#ifndef __TCORE_CO_SMS_H__ -#define __TCORE_CO_SMS_H__ - -#include - -__BEGIN_DECLS - - -#define nDefaultSMSPWithoutAlphaId 28 - -#define SMSPValidDestAddr 0x01 -#define SMSPValidSvcAddr 0x02 -#define SMSPValidPID 0x04 -#define SMSPValidDCS 0x08 -#define SMSPValidVP 0x10 +#ifndef __CO_SMS_H__ +#define __CO_SMS_H__ -#define nDestAddrOffset 1 -#define nSCAAddrOffset 13 -#define nPIDOffset 25 -#define nDCSOffset 26 -#define nVPOffset 27 +#define tcore_sms_convert_to_semioctet_length(length) ((length + 1) / 2) -struct property_sms_info { - int g_trans_id; - int SMSPRecordLen; -}; +#include "core_object.h" +#include +#include -struct tcore_sms_operations { - TReturn (*send_umts_msg)(CoreObject *o, UserRequest *ur); - TReturn (*read_msg)(CoreObject *o, UserRequest *ur); - TReturn (*save_msg)(CoreObject *o, UserRequest *ur); - TReturn (*delete_msg)(CoreObject *o, UserRequest *ur); - TReturn (*get_stored_msg_cnt)(CoreObject *o, UserRequest *ur); - TReturn (*get_sca)(CoreObject *o, UserRequest *ur); - TReturn (*set_sca)(CoreObject *o, UserRequest *ur); - TReturn (*get_cb_config)(CoreObject *o, UserRequest *ur); - TReturn (*set_cb_config)(CoreObject *o, UserRequest *ur); - TReturn (*set_mem_status)(CoreObject *o, UserRequest *ur); - TReturn (*get_pref_brearer)(CoreObject *o, UserRequest *ur); - TReturn (*set_pref_brearer)(CoreObject *o, UserRequest *ur); - TReturn (*set_delivery_report)(CoreObject *o, UserRequest *ur); - TReturn (*set_msg_status)(CoreObject *o, UserRequest *ur); - TReturn (*get_sms_params)(CoreObject *o, UserRequest *ur); - TReturn (*set_sms_params)(CoreObject *o, UserRequest *ur); - TReturn (*get_paramcnt)(CoreObject *o, UserRequest *ur); - TReturn (*send_cdma_msg)(CoreObject *o, UserRequest *ur); -}; - - -int _tcore_util_sms_encode_smsParameters(const struct telephony_sms_Params *incoming, unsigned char *data, int SMSPRecordLen); -gboolean tcore_sms_get_ready_status(CoreObject *o); -gboolean tcore_sms_set_ready_status(CoreObject *o, int status); - -CoreObject* tcore_sms_new(TcorePlugin *p, - struct tcore_sms_operations *ops, TcoreHal *hal); -void tcore_sms_free(CoreObject * n); - -void tcore_sms_override_ops(CoreObject *o, struct tcore_sms_operations *sms_ops); - -__END_DECLS +#ifdef __cplusplus +extern "C" { +#endif +typedef struct tcore_sms_operations { + TelReturn (*send_sms)(CoreObject *co, const TelSmsSendInfo *send_info, TcoreObjectResponseCallback cb, void *cb_data); + TelReturn (*read_in_sim)(CoreObject *co, unsigned int index, TcoreObjectResponseCallback cb, void *cb_data); + TelReturn (*write_in_sim)(CoreObject *co, const TelSmsSimDataInfo *wdata, TcoreObjectResponseCallback cb, void *cb_data); + TelReturn (*delete_in_sim)(CoreObject *co, unsigned int index, TcoreObjectResponseCallback cb, void *cb_data); + TelReturn (*get_count)(CoreObject *co, TcoreObjectResponseCallback cb, void *cb_data); + TelReturn (*set_cb_config)(CoreObject *co, const TelSmsCbConfigInfo *cb_conf, TcoreObjectResponseCallback cb, void *cb_data); + TelReturn (*get_cb_config)(CoreObject *co, TcoreObjectResponseCallback cb, void *cb_data); + TelReturn (*get_parameters)(CoreObject *co, TcoreObjectResponseCallback cb, void *cb_data); + TelReturn (*set_parameters)(CoreObject *co, const TelSmsParamsInfo *params, TcoreObjectResponseCallback cb, void *cb_data); + TelReturn (*send_deliver_report)(CoreObject *co, const TelSmsDeliverReportInfo *dr_info, TcoreObjectResponseCallback cb, void *cb_data); + TelReturn (*set_sca)(CoreObject *co, const TelSmsSca *sca, TcoreObjectResponseCallback cb, void *cb_data); + TelReturn (*get_sca)(CoreObject *co, TcoreObjectResponseCallback cb, void *cb_data); + TelReturn (*set_memory_status)(CoreObject *co, gboolean available, TcoreObjectResponseCallback cb, void *cb_data); + TelReturn (*set_message_status)(CoreObject *co, const TelSmsStatusInfo *status_info, TcoreObjectResponseCallback cb, void *cb_data); +} TcoreSmsOps; + +gboolean tcore_sms_get_ready_status(CoreObject *co, gboolean *status); +gboolean tcore_sms_set_ready_status(CoreObject *co, gboolean status); + +CoreObject *tcore_sms_new(TcorePlugin *p, TcoreSmsOps *sms_ops, TcoreHal *hal); +void tcore_sms_free(CoreObject *co); + +gboolean tcore_sms_set_ops(CoreObject *co, TcoreSmsOps *ops); +void tcore_sms_override_ops(CoreObject *co, TcoreSmsOps *sms_ops); + +#ifdef __cplusplus +} #endif +#endif /*__CO_SMS_H__*/ diff --git a/include/co_ss.h b/include/co_ss.h index fa4367d..a7a98df 100644 --- a/include/co_ss.h +++ b/include/co_ss.h @@ -1,9 +1,8 @@ /* * libtcore * - * Copyright (c) 2012 Samsung Electronics Co., Ltd. All rights reserved. - * - * Contact: Ja-young Gu + * Copyright (c) 2013 Samsung Electronics Co. Ltd. All rights reserved. + * Copyright (c) 2013 Intel Corporation. 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. @@ -18,181 +17,50 @@ * limitations under the License. */ -#ifndef __TCORE_CO_SS_H__ -#define __TCORE_CO_SS_H__ - -#include - -__BEGIN_DECLS - -#define MAX_TCORE_SS_NUMBER_LEN 83 - -enum tcore_ss_class { - TCORE_SS_CLATCORE_SS_NONE = 0x00, /* 0x00 */ - - /* TELESERVICE */ - TCORE_SS_CLATCORE_SS_ALL_TELE = 0x10, /* 0x10 : All Teleservices */ - TCORE_SS_CLATCORE_SS_VOICE = 0x11, /* 0x11 : All Voice (telephony) */ - TCORE_SS_CLATCORE_SS_ALL_DATA_TELE = 0x12, /* 0x12 : All Data Teleservices */ - TCORE_SS_CLATCORE_SS_FAX = 0x13, /* 0x13 : All Fax Service */ - TCORE_SS_CLATCORE_SS_SMS = 0x16, /* 0x16 : SMS service */ - TCORE_SS_CLATCORE_SS_VGCS = 0x17, /* 0x17 : Voice Group Call Service */ - TCORE_SS_CLATCORE_SS_VBS = 0x18, /* 0x18 : Voice Broadcast */ - TCORE_SS_CLATCORE_SS_ALL_TELE_EXPT_SMS = 0x19, /* 0x19 : All teleservice except SMS */ - - /* BEARER SERVICE */ - TCORE_SS_CLATCORE_SS_ALL_BEARER = 0x20, /* 0X20 : all bearer services */ - TCORE_SS_CLATCORE_SS_ALL_ASYNC = 0x21, /* 0x21 : All Async services */ - TCORE_SS_CLATCORE_SS_ALL_SYNC = 0x22, /* 0x22 : All sync services */ - TCORE_SS_CLATCORE_SS_ALL_CS_SYNC = 0x24, /* 0x24 : All Circuit switched sync */ - TCORE_SS_CLATCORE_SS_ALL_CS_ASYNC = 0x25, /* 0x25 : All Circuit switched async */ - TCORE_SS_CLATCORE_SS_ALL_DEDI_PS = 0x26, /* 0x26 : All Dedicated packet Access */ - TCORE_SS_CLATCORE_SS_ALL_DEDI_PAD = 0x27, /* 0x27 : All Dedicated PAD Access */ - TCORE_SS_CLATCORE_SS_ALL_DATA_CDA = 0x28, /* 0x28 : All Data CDA */ - - /* PLMN SPECIFIC TELESERVICE */ - TCORE_SS_CLATCORE_SS_PLMN_TELE_ALL = 0x50, /* 0x50 : PLMN specific teleservices */ - TCORE_SS_CLATCORE_SS_PLMN_TELE_1 = 0x51, /* 0x51 : PLMN specific teleservice 1 */ - TCORE_SS_CLATCORE_SS_PLMN_TELE_2 = 0x52, /* 0x52 : PLMN specific teleservice 2 */ - TCORE_SS_CLATCORE_SS_PLMN_TELE_3 = 0x53, /* 0x53 : PLMN specific teleservice 3 */ - TCORE_SS_CLATCORE_SS_PLMN_TELE_4 = 0x54, /* 0x54 : PLMN specific teleservice 4 */ - TCORE_SS_CLATCORE_SS_PLMN_TELE_5 = 0x55, /* 0x55 : PLMN specific teleservice 5 */ - TCORE_SS_CLATCORE_SS_PLMN_TELE_6 = 0x56, /* 0x56 : PLMN specific teleservice 6 */ - TCORE_SS_CLATCORE_SS_PLMN_TELE_7 = 0x57, /* 0x57 : PLMN specific teleservice 7 */ - TCORE_SS_CLATCORE_SS_PLMN_TELE_8 = 0x58, /* 0x58 : PLMN specific teleservice 8 */ - TCORE_SS_CLATCORE_SS_PLMN_TELE_9 = 0x59, /* 0x59 : PLMN specific teleservice 9 */ - TCORE_SS_CLATCORE_SS_PLMN_TELE_A = 0x60, /* 0x60 : PLMN specific teleservice 10 */ - TCORE_SS_CLATCORE_SS_PLMN_TELE_B = 0x61, /* 0x61 : PLMN specific teleservice 11 */ - TCORE_SS_CLATCORE_SS_PLMN_TELE_C = 0x62, /* 0x62 : PLMN specific teleservice 12 */ - TCORE_SS_CLATCORE_SS_PLMN_TELE_D = 0x63, /* 0x63 : PLMN specific teleservice 13 */ - TCORE_SS_CLATCORE_SS_PLMN_TELE_E = 0x64, /* 0x64 : PLMN specific teleservice 14 */ - TCORE_SS_CLATCORE_SS_PLMN_TELE_F = 0x65, /* 0x65 : PLMN specific teleservice 15 */ - - /* PLMN SPECIFIC BEARER SERVICE */ - TCORE_SS_CLATCORE_SS_PLMN_BEAR_ALL = 0x70, /* 0x70 : All PLMN specific bearer services */ - TCORE_SS_CLATCORE_SS_PLMN_BEAR_1 = 0x71, /* 0x71 : PLMN specific bearer service 1 */ - TCORE_SS_CLATCORE_SS_PLMN_BEAR_2 = 0x72, /* 0x72 : PLMN specific bearer service 2 */ - TCORE_SS_CLATCORE_SS_PLMN_BEAR_3 = 0x73, /* 0x73 : PLMN specific bearer service 3 */ - TCORE_SS_CLATCORE_SS_PLMN_BEAR_4 = 0x74, /* 0x74 : PLMN specific bearer service 4 */ - TCORE_SS_CLATCORE_SS_PLMN_BEAR_5 = 0x75, /* 0x75 : PLMN specific bearer service 5 */ - TCORE_SS_CLATCORE_SS_PLMN_BEAR_6 = 0x76, /* 0x76 : PLMN specific bearer service 6 */ - TCORE_SS_CLATCORE_SS_PLMN_BEAR_7 = 0x77, /* 0x77 : PLMN specific bearer service 7 */ - TCORE_SS_CLATCORE_SS_PLMN_BEAR_8 = 0x78, /* 0x78 : PLMN specific bearer service 8 */ - TCORE_SS_CLATCORE_SS_PLMN_BEAR_9 = 0x79, /* 0x79 : PLMN specific bearer service 9 */ - TCORE_SS_CLATCORE_SS_PLMN_BEAR_A = 0x80, /* 0x80 : PLMN specific bearer service 10 */ - TCORE_SS_CLATCORE_SS_PLMN_BEAR_B = 0x81, /* 0x81 : PLMN specific bearer service 11 */ - TCORE_SS_CLATCORE_SS_PLMN_BEAR_C = 0x82, /* 0x82 : PLMN specific bearer service 12 */ - TCORE_SS_CLATCORE_SS_PLMN_BEAR_D = 0x83, /* 0x83 : PLMN specific bearer service 13 */ - TCORE_SS_CLATCORE_SS_PLMN_BEAR_E = 0x84, /* 0x84 : PLMN specific bearer service 14 */ - TCORE_SS_CLATCORE_SS_PLMN_BEAR_F = 0x85, /* 0x85 : PLMN specific bearer service 15 */ - - /* CPHS - AUXILIARY SERVICE */ - TCORE_SS_CLATCORE_SS_AUX_VOICE = 0x89, /* 0x89 : All Auxiliary Voice (Auxiliary telephony) */ - - TCORE_SS_CLATCORE_SS_ALL_GPRS_BEARER = 0x99, /* 0x99 : All GPRS bearer services */ - TCORE_SS_CLATCORE_SS_ALL_TELE_BEARER = 0xFF, /* 0xFF : all tele and bearer services */ -}; +#ifndef __CO_SS_H__ +#define __CO_SS_H__ -enum tcore_ss_status { - TCORE_SS_STATUS_REG = 0x01, /* 0x01 : Registration */ - TCORE_SS_STATUS_DEREG, /* 0x02 : De-registration(erase) */ - TCORE_SS_STATUS_ACTIVATE, /* 0x03 : Activation */ - TCORE_SS_STATUS_DEACTIVATE, /* 0x04 : De-activation */ - TCORE_SS_STATUS_MAX -}; +#include "core_object.h" +#include +#include -enum tcore_ss_barring_mode { - TCORE_SS_BARR_MODE_NONE, - TCORE_SS_BARR_MODE_BAOC, /* 0x01 : Barring All Outgoing Calls */ - TCORE_SS_BARR_MODE_BOIC, /* 0x02 : Barring Outgoing International Calls */ - TCORE_SS_BARR_MODE_BOIC_NOT_HC, /* 0x03 : Barring Outgoing International Calls except to Home Country */ - TCORE_SS_BARR_MODE_BAIC, /* 0x04 : Barring All Incoming Calls */ - TCORE_SS_BARR_MODE_BIC_ROAM, /* 0x05 : Barring Incoming Calls when roam, outside of the Home Country */ - TCORE_SS_BARR_MODE_AB, /* 0x06 : All Barring Services */ - TCORE_SS_BARR_MODE_AOB, /* 0x07 : All Outgoing Barring Services */ - TCORE_SS_BARR_MODE_AIB, /* 0x08 : All Incoming Barring Services */ - TCORE_SS_BARR_MODE_BIC_NOT_SIM, /* 0x09 : Barring Incoming Calls which is not stored in the SIM memory */ - TCORE_SS_BARR_MODE_MAX -}; - -enum tcore_ss_forwarding_mode { - TCORE_SS_CF_MODE_CFU = 0x01, /* 0x01 : Call Forwarding Unconditional */ - TCORE_SS_CF_MODE_CFB, /* 0x02 : Call Forwarding Mobile Busy */ - TCORE_SS_CF_MODE_CFNRy, /* 0x03 : Call Forwarding No Reply */ - TCORE_SS_CF_MODE_CFNRc, /* 0x04 : Call Forwarding Not Reachable */ - TCORE_SS_CF_MODE_CF_ALL, /* 0x05 : All Call Forwarding */ - TCORE_SS_CF_MODE_CFC, /* 0x06 : All Conditional Call Forwarding */ - TCORE_SS_CF_MODE_MAX /* 0x07 : Max */ -}; - -enum tcore_ss_ussd_type { - TCORE_SS_USSD_TYPE_USER_INITIATED = 0x01, /* User Initiated USSD Message */ - TCORE_SS_USSD_TYPE_USER_RES, /* User Response to Network Initiated Message */ - TCORE_SS_USSD_TYPE_USER_RELEASE, /* SS Termination by user */ - TCORE_SS_USSD_TYPE_NETWORK_INITIATED, /* Network Initiated USSD Message */ - TCORE_SS_USSD_TYPE_MAX, -}; - -enum tcore_ss_ussd_status { - TCORE_SS_USSD_NO_ACTION_REQUIRE = 0x01, /* 0x01 : no further user action required information needed after mobile initiated operation) */ - TCORE_SS_USSD_ACTION_REQUIRE, /* 0x02 : further user action required(network initiated USSD Request, or further information needed after mobile initiated operation) */ - TCORE_SS_USSD_TERMINATED_BY_NET, /* 0x03 : USSD terminated by network */ - TCORE_SS_USSD_OTHER_CLIENT, /* 0x04 : other local client has responded */ - TCORE_SS_USSD_NOT_SUPPORT, /* 0x05 : operation not supported */ - TCORE_SS_USSD_TIME_OUT, /* 0x06 : network time out */ - TCORE_SS_USSD_MAX -}; - -enum tcore_ss_aoc_type { - TCORE_SS_AOC_TYPE_RESET = 0x00, /* AoC Reset Message */ - TCORE_SS_AOC_TYPE_ACM = 0x01, /* Accumulated call meter Message */ - TCORE_SS_AOC_TYPE_CCM = 0x02, /* Current call meter Message */ - TCORE_SS_AOC_TYPE_MAXACM = 0x04, /* Max Accumulated call meter Message */ - TCORE_SS_AOC_TYPE_PUC = 0x08, /* Price per unit and currency Message */ - TCORE_SS_AOC_TYPE_MAX = 0x10 -}; +#ifdef __cplusplus +extern "C" { +#endif typedef struct ussd_session UssdSession; -struct tcore_ss_operations { - TReturn (*barring_activate)(CoreObject *o, UserRequest *ur); - TReturn (*barring_deactivate)(CoreObject *o, UserRequest *ur); - TReturn (*barring_change_password)(CoreObject *o, UserRequest *ur); - TReturn (*barring_get_status)(CoreObject *o, UserRequest *ur); - TReturn (*forwarding_activate)(CoreObject *o, UserRequest *ur); - TReturn (*forwarding_deactivate)(CoreObject *o, UserRequest *ur); - TReturn (*forwarding_register)(CoreObject *o, UserRequest *ur); - TReturn (*forwarding_deregister)(CoreObject *o, UserRequest *ur); - TReturn (*forwarding_get_status)(CoreObject *o, UserRequest *ur); - TReturn (*waiting_activate)(CoreObject *o, UserRequest *ur); - TReturn (*waiting_deactivate)(CoreObject *o, UserRequest *ur); - TReturn (*waiting_get_status)(CoreObject *o, UserRequest *ur); - TReturn (*cli_activate)(CoreObject *o, UserRequest *ur); - TReturn (*cli_deactivate)(CoreObject *o, UserRequest *ur); - TReturn (*cli_get_status)(CoreObject *o, UserRequest *ur); - TReturn (*send_ussd)(CoreObject *o, UserRequest *ur); - TReturn (*set_aoc)(CoreObject *o, UserRequest *ur); - TReturn (*get_aoc)(CoreObject *o, UserRequest *ur); -}; - - -CoreObject *tcore_ss_new(TcorePlugin *p, - struct tcore_ss_operations *ops, TcoreHal *hal); -void tcore_ss_free(CoreObject *o); - -void tcore_ss_override_ops(CoreObject *o, struct tcore_ss_operations *ss_ops); - -struct ussd_session *tcore_ss_ussd_create_session(CoreObject *o, - enum tcore_ss_ussd_type type, void *data, int data_len); -void tcore_ss_ussd_destroy_session(struct ussd_session *ussd_s); -struct ussd_session *tcore_ss_ussd_get_session(CoreObject *o); -enum tcore_ss_ussd_type tcore_ss_ussd_get_session_type(struct ussd_session* ussd_s); -void tcore_ss_ussd_set_session_type(struct ussd_session* ussd_s, - enum tcore_ss_ussd_type type); -int tcore_ss_ussd_get_session_data(struct ussd_session* ussd_s, void** data); -void tcore_ss_ussd_set_session_data(struct ussd_session* ussd_s, - void* data, int data_len); +typedef struct { + TelReturn (*set_barring)(CoreObject *co, const TelSsBarringInfo *barring_info, TcoreObjectResponseCallback cb, void *cb_data); + TelReturn (*get_barring_status)(CoreObject *co, const TelSsBarringGetInfo *get_barring_info, TcoreObjectResponseCallback cb, void *cb_data); + TelReturn (*change_barring_password)(CoreObject *co, const TelSsBarringPwdInfo *barring_pwd_info, TcoreObjectResponseCallback cb, void *cb_data); + TelReturn (*set_forwarding)(CoreObject *co, const TelSsForwardInfo *forwarding_info, TcoreObjectResponseCallback cb, void *cb_data); + TelReturn (*get_forwarding_status)(CoreObject *co, const TelSsForwardGetInfo *get_forwarding_info, TcoreObjectResponseCallback cb, void *cb_data); + TelReturn (*set_waiting)(CoreObject *co, const TelSsWaitingInfo *waiting_info, TcoreObjectResponseCallback cb, void *cb_data); + TelReturn (*get_waiting_status)(CoreObject *co, TelSsClass ss_class, TcoreObjectResponseCallback cb, void *cb_data); + TelReturn (*set_cli)(CoreObject *co, const TelSsCliInfo *cli_info, TcoreObjectResponseCallback cb, void *cb_data); + TelReturn (*get_cli_status)(CoreObject *co, TelSsCliType cli_type, TcoreObjectResponseCallback cb, void *cb_data); + TelReturn (*send_ussd_request)(CoreObject *co, const TelSsUssdInfo *ussd_request, TcoreObjectResponseCallback cb, void *cb_data); +} TcoreSsOps; + + +CoreObject *tcore_ss_new(TcorePlugin *p, TcoreSsOps *ops, TcoreHal *hal); +void tcore_ss_free(CoreObject *co); + +gboolean tcore_ss_set_ops(CoreObject *co, TcoreSsOps *ops); +void tcore_ss_override_ops(CoreObject *co, TcoreSsOps *ss_ops); + +UssdSession *tcore_ss_ussd_create_session(CoreObject *co, TelSsUssdType type, void *data, guint data_len); +void tcore_ss_ussd_destroy_session(UssdSession *ussd_s); +UssdSession *tcore_ss_ussd_get_session(CoreObject *co); +gboolean tcore_ss_ussd_get_session_type(UssdSession *ussd_s, TelSsUssdType *ussd_type); +gboolean tcore_ss_ussd_set_session_type(UssdSession *ussd_s, TelSsUssdType type); +gboolean tcore_ss_ussd_get_session_data(UssdSession *ussd_s, void **data, guint *data_len); +gboolean tcore_ss_ussd_set_session_data(UssdSession *ussd_s, void *data, guint data_len); + +#ifdef __cplusplus +} +#endif -__END_DECLS #endif diff --git a/include/common/tel_call.h b/include/common/tel_call.h new file mode 100644 index 0000000..5b18ac6 --- /dev/null +++ b/include/common/tel_call.h @@ -0,0 +1,831 @@ +/* + * tel-headers + * + * Copyright (c) 2013 Samsung Electronics Co. Ltd. All rights reserved. + * Copyright (c) 2013 Intel Corporation. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef __TEL_CALL_H__ +#define __TEL_CALL_H__ + +#include +#include + +/** +* @addtogroup TAPI_CALL +* @{ +* +* @file tel_call.h +* @brief TAPI Call Interface +*/ + +#ifdef __cplusplus +extern "C" { +#endif + +#define TELEPHONY_CALL_INTERFACE TELEPHONY_SERVICE".Call" + +#define TEL_CALL_CALLING_NAME_LEN_MAX 82 /**< The maximum length of the string for calling party name. */ +#define TEL_CALL_CALLING_NUMBER_LEN_MAX 82 /**< Maximum Dialling Digit Length */ +#define TEL_CALL_MAX_CALLS_COUNT 6 /**< Maximum number of call can be possible at a time */ +#define TEL_CALL_MAX_SOUND_EQ_PARAMETER_SIZE 6 /**< Maximum number of sound equalization parameter size */ +#define TEL_CALL_MAX_VOLUME_INFO_RECORD 20 /**< Maximum number of record for volume information */ + +/** + * @enum TelCallResult + * Response (Return) values. + */ +typedef enum { + TEL_CALL_RESULT_SUCCESS, /**< Operation completed successfully */ + TEL_CALL_RESULT_FAILURE, /**< Operation Failed */ + TEL_CALL_RESULT_INVALID_PARAMETER, /**< Invalid input parameters */ + TEL_CALL_RESULT_MEMORY_FAILURE, /**< Memory allocation failed */ + TEL_CALL_RESULT_OPERATION_NOT_SUPPORTED, /**< Operation not supported */ + TEL_CALL_RESULT_FDN_RESTRICTED, /**< FDN calls only */ + TEL_CALL_RESULT_NETWORK_BUSY, /**< Network busy */ + TEL_CALL_RESULT_SERVICE_NOT_ALLOWED, /**< Service is not allowed */ + TEL_CALL_RESULT_OPERATION_NOT_PERMITTED /**< Operation not permitted */ +} TelCallResult; + +/** + * @enum TelCallEndCause + * Call End Cause. + */ +typedef enum { + TEL_CALL_END_CAUSE_NONE, /**< No Cause */ + TEL_CALL_END_CAUSE_FAILED, /**< Call failed */ + TEL_CALL_END_CAUSE_UNASSIGNED_NUMBER, /**< Unassigned Number */ + TEL_CALL_END_CAUSE_NO_ROUTE_TO_DEST, /**< No Route to Destination */ + TEL_CALL_END_CAUSE_OPERATOR_DETERMINED_BARRING, /**< Operator Determined Barring */ + TEL_CALL_END_CAUSE_NORMAL_CALL_CLEARING, /**< Normal Call Clearing */ + TEL_CALL_END_CAUSE_USER_BUSY, /**< User Busy */ + TEL_CALL_END_CAUSE_NO_USER_RESPONDING, /**< No user Responding */ + TEL_CALL_END_CAUSE_USER_ALERTING_NO_ANSWER, /**< User Alerting no Answer */ + TEL_CALL_END_CAUSE_CALL_REJECTED, /**< Call Rejected */ + TEL_CALL_END_CAUSE_NUMBER_CHANGED, /**< Number Changed */ + TEL_CALL_END_CAUSE_DESTINATION_OUT_OF_ORDER, /**< Destination out of Order */ + TEL_CALL_END_CAUSE_INVALID_NUMBER_FORMAT, /**< Invalid Number Format */ + TEL_CALL_END_CAUSE_FACILITY_REJECTED, /**< Facility Rejected */ + TEL_CALL_END_CAUSE_NO_CIRCUIT_CHANNEL_AVAILABLE, /**< No Circuit Channel Available */ + TEL_CALL_END_CAUSE_NETWORK_OUT_OF_ORDER, /**< Network out of Order */ + TEL_CALL_END_CAUSE_TEMPORARY_FAILURE, /**< Temporary Failure */ + TEL_CALL_END_CAUSE_SWITCHING_EQUIPMENT_CONGESTION, /**< Switching Equipment Congestion */ + TEL_CALL_END_CAUSE_REQUESTED_CIRCUIT_CHANNEL_NOT_AVAILABLE, /**< Requested Circuit channel not available */ + TEL_CALL_END_CAUSE_REQUESTED_FACILITY_NOT_SUBSCRIBED, /**< Requested facility not subscribed */ + TEL_CALL_END_CAUSE_ACM_GEQ_ACMMAX, /**< ACM equal to greater than ACMAX */ + TEL_CALL_END_CAUSE_IMEI_NOT_ACCEPTED, /**< IMEI not accepted */ + TEL_CALL_END_CAUSE_NETWORK_FAILURE, /**< Network unavailable */ + TEL_CALL_END_CAUSE_CONGESTION, /**< Congestion */ + TEL_CALL_END_CAUSE_SERVICE_OPTION_OUT_OF_ORDER, /**< Service option temporarily out of order */ + TEL_CALL_END_CAUSE_ACCESS_CLASS_BLOCKED, /**< Access class blocked */ +} TelCallEndCause; + +/** + * @enum TelCallState + * Call States. + */ +typedef enum { + TEL_CALL_STATE_IDLE, /**< Call is in idle state - i.e. no call */ + TEL_CALL_STATE_ACTIVE, /**< Call is in connected and conversation state */ + TEL_CALL_STATE_HELD, /**< Call is in held state */ + TEL_CALL_STATE_DIALING, /**< Call is in dialing state */ + TEL_CALL_STATE_ALERT, /**< Call is in alerting state */ + TEL_CALL_STATE_INCOMING, /**< Call is in incoming state */ + TEL_CALL_STATE_WAITING, /**< Call is in waiting state */ +} TelCallState; + +/** + * @enum TelCallActiveLine + * IN GSM ONLY: Call Active Line. + */ +typedef enum { + TEL_CALL_ACTIVE_LINE1, /**< Line 1 */ + TEL_CALL_ACTIVE_LINE2 /**< Line 2 */ +} TelCallActiveLine; + +/** + * @enum TelCallAnswerType + * Call Answer Types. + */ +typedef enum { + TEL_CALL_ANSWER_ACCEPT, /**< Used to answer an incoming call when there are no current active calls. */ + TEL_CALL_ANSWER_REJECT, /**< Used to reject the incoming call */ + TEL_CALL_ANSWER_REPLACE, /**< Release current active call and accept the incoming call */ + TEL_CALL_ANSWER_HOLD_AND_ACCEPT, /**< Hold the current active call, and accept the wating call */ +} TelCallAnswerType; + +/** + * @enum TelCallEndType + * Call End Types. + */ +typedef enum { + TEL_CALL_END, /**< Used to end single call with call handle */ + TEL_CALL_END_ALL, /**< Used to end all calls */ + TEL_CALL_END_ACTIVE_ALL, /**< Used to end all active calls */ + TEL_CALL_END_HOLD_ALL, /**< Used to end all hold calls */ +} TelCallEndType; + +/** + * @enum TelCallType + * Call Type. + */ +typedef enum { + TEL_CALL_TYPE_VOICE, /**< Voice call type. */ + TEL_CALL_TYPE_VIDEO, /**< Video call type */ + TEL_CALL_TYPE_E911 /**< Emergency call type. */ +} TelCallType; + +/** + * @enum TelCallActiveState + * Current Call State. + */ +typedef enum { + TEL_CALL_CONNECT_IDLE, /**< Call is in Idle state. */ + TEL_CALL_CONNECT_ACTIVE, /**< Call is in Active state.*/ + TEL_CALL_CONNECT_HELD /**< Call is in Held state. */ +} TelCallActiveState; + +/** + * @enum TelCallCliValidity + * CLI(Calling Line Identification) Validity. + */ +typedef enum { + TEL_CALL_CLI_VALIDITY_VALID, /**< CLI is valid */ + TEL_CALL_CLI_VALIDITY_WITHHELD, /**< CLI is withheld ("Rejected by user")*/ + TEL_CALL_CLI_VALIDITY_NOT_AVAILABLE, /**< CLI is not available ("Interaction with other service" or "Unavailable")*/ + TEL_CALL_CLI_VALIDITY_NOT_AVAILABLE_PAYPHONE, /**< CLI is not available ("Coin line/payphone")*/ +} TelCallCliValidity; + +/** + * @enum TelCallCniValidity + * CNI(Calling Name Identification) Validity. + */ +typedef enum { + TEL_CALL_CNI_VALIDITY_VALID, /**< CLI is valid */ + TEL_CALL_CNI_VALIDITY_WITHHELD, /**< CLI is withheld */ + TEL_CALL_CNI_VALIDITY_NOT_AVAILABLE, /**< CLI is not available */ +} TelCallCniValidity; + +/** + * @enum TelCallEmergencyCategory + * Emergency Call Category. + */ +typedef enum { + TEL_CALL_ECC_DEFAULT = 0x00, /**< ECC is default */ + TEL_CALL_ECC_POLICE = 0x01, /**< ECC is police */ + TEL_CALL_ECC_AMBULANCE = 0x02, /**< ECC is ambulance */ + TEL_CALL_ECC_FIREBRIGADE = 0x04, /**< ECC is fire station */ + TEL_CALL_ECC_MARINEGUARD = 0x08, /**< ECC is marine gaurd */ + TEL_CALL_ECC_MOUNTAINRESCUE = 0x10, /**< ECC is mountaion rescue */ + TEL_CALL_ECC_MANUAL_ECALL = 0x20, /**< ECC is manual Ecall */ + TEL_CALL_ECC_AUTO_ECALL = 0x40 /**< ECC is Auto Ecall */ +} TelCallEmergencyCategory; + +/** + * Call Dial Info. + */ +typedef struct { + TelCallType call_type; /**< Sets type of call (voice, data, video, emergency) */ + TelCallEmergencyCategory ecc; /**< In case of emergency call, may provide category instead of number */ + char number[TEL_CALL_CALLING_NUMBER_LEN_MAX + 1]; /**< A string containing the destination phone number. This follows the dial number format.*/ +} TelCallDial; + +/** + * Call End Info. + */ +typedef struct { + unsigned int call_id; /**< Unique id for referring the call to release */ + TelCallEndType end_type; /**< End type used */ +} TelCallEnd; + +/** + * Call Status Info. + */ +typedef struct { + unsigned int call_id; /**< Unique id for referring the call */ + + TelCallType call_type; /**< Specifies type of call (voice, data, emergency) */ + TelCallState call_state; /**< Current Call state */ + + gboolean mo_call; /**< TRUE for MO Call; FALSE if MT call*/ + gboolean mpty; /**< TRUE for Multi-party Call; FALSE if not Multi-party Call*/ + + TelCallCliValidity cli_validity; /**< Calling Line Identificatoin (only if mobile terminated call) */ + char number[TEL_CALL_CALLING_NUMBER_LEN_MAX + 1]; /**< Mobile Number */ + + TelCallCniValidity cni_validity; /**< Calling Name Identification (only if mobile terminated call) */ + char name[TEL_CALL_CALLING_NAME_LEN_MAX + 1]; /**< Caller name */ + + gboolean forward; /**< TRUE if call is forwared (only if mobile terminated call) */ + + TelCallActiveLine active_line; /**< Active line */ +} TelCallStatus; + +/** + * All Call Status Info. + */ +typedef struct { + unsigned int count; /**< Number of calls */ + TelCallStatus status[TEL_CALL_MAX_CALLS_COUNT]; /**< Call Status Info */ +} TelCallStatusList; + +/** + * Incoming Call Info. + */ +typedef struct { + unsigned int call_id; /**< Unique id for referring the call */ + + TelCallCliValidity cli_validity; /**< Calling Line Identificatoin (only if mobile terminated call) */ + char number[TEL_CALL_CALLING_NUMBER_LEN_MAX + 1]; /**< Mobile Number */ + + TelCallCniValidity cni_validity; /**< Calling Name Identification (only if mobile terminated call) */ + char name[TEL_CALL_CALLING_NAME_LEN_MAX + 1]; /**< Caller name */ + + gboolean forward; /**< TRUE if call is forwared (only if mobile terminated call) */ + + TelCallActiveLine active_line; /**< Active line */ +}TelCallIncomingInfo; + +/** + * All Call Status idle notification. + */ +typedef struct { + unsigned int call_id; /**< Unique id for referring the call */ + TelCallEndCause cause; /**< End cause for the call indicates whether the call is released normally or due to other cause*/ +} TelCallStatusIdleNoti; + +/** + * @enum TelCallSoundRecording + * Call Sound Recording status. + */ +typedef enum { + TEL_SOUND_RECORDING_STOP, /**< Stop call recording */ + TEL_SOUND_RECORDING_START, /**< Start call recording */ + TEL_SOUND_RECORDING_PAUSE /**< Pause call recording */ +} TelCallSoundRecording; + +/** + * @enum TelCallSoundDevice + * Call Sound Device type. + */ +typedef enum { + TEL_SOUND_DEVICE_RECEIVER = 0x00, /**< Receiving the sound on receiver */ + TEL_SOUND_DEVICE_SPEAKER_PHONE = 0x10, /**< Receiving the sound on speaker phone */ + TEL_SOUND_DEVICE_HFK = 0x20, /**< Receiving the sound on HFK */ + TEL_SOUND_DEVICE_HEADSET = 0x30, /**< Receiving the sound on Headset */ + TEL_SOUND_DEVICE_BLUETOOTH = 0x40, /**< Receiving the sound on Bluetooth */ + TEL_SOUND_DEVICE_EC = 0xA0, /**< Receiving the sound on Echo Cancellation device */ +} TelCallSoundDevice; + +/** + * Call Sound Volume Info. + */ +typedef struct { + TelCallSoundDevice device; /**< Sound device */ + unsigned int volume; /**TRUE: Sound clock is ON\n FALSE: Sound clock is OFF + * @retval user_data user data passed while registering the event + */ +#define TEL_NOTI_CALL_SOUND_CLOCK_STATUS TELEPHONY_CALL_INTERFACE":CallSoundClockStatus" + +/** @}*/ +/** @}*/ + +#ifdef __cplusplus +} +#endif + +/** + * @} + */ + #endif /* __TEL_CALL_H__ */ diff --git a/include/common/tel_gps.h b/include/common/tel_gps.h new file mode 100644 index 0000000..d84efbc --- /dev/null +++ b/include/common/tel_gps.h @@ -0,0 +1,126 @@ +/* + * tel-headers + * + * Copyright (c) 2013 Samsung Electronics Co. Ltd. All rights reserved. + * Copyright (c) 2013 Intel Corporation. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef __TEL_GPS_H__ +#define __TEL_GPS_H__ + +#include + +/** +* @addtogroup TAPI_GPS +* @{ +* +* @file tel_gps.h +* @brief TAPI GPS Interface +*/ + +#ifdef __cplusplus +extern "C" { +#endif + +#define TELEPHONY_GPS_INTERFACE TELEPHONY_SERVICE".Gps" + +/** + * @enum TelGpsResult + * Response (Return) values. + */ +typedef enum { + TEL_GPS_RESULT_SUCCESS, /**< Operation completed successfully */ + TEL_GPS_RESULT_FAILURE, /**< Operation Failed */ + TEL_GPS_RESULT_INVALID_PARAMETER, /**< Invalid input parameters */ + TEL_GPS_RESULT_MEMORY_FAILURE, /**< Memory allocation failed */ + TEL_GPS_RESULT_OPERATION_NOT_SUPPORTED, /**< Operation not supported */ + TEL_GPS_RESULT_OPERATION_NOT_PERMITTED, /**< Operation not permitted */ + TEL_GPS_RESULT_UNKNOWN_FAILURE /**< Unknown failure */ +} TelGpsResult; + +/** + * GPS info. + */ +typedef struct { + unsigned int data_len; /**< Data length of GPS info */ + unsigned char *data; /**< GPS information */ +} TelGpsDataInfo; + +/** + * \defgroup TAPI_EVENT TAPI Event IDs + * @{ + */ + +/** + * \defgroup TEL_EVENT_GPS GPS Event IDs + * @{ + */ + +/** + * @hideinitializer + * @brief GPS assist data + * @section subscription Event Subscription + * @details Event can be subscribed with event id TEL_NOTI_GPS_ASSIST_DATA + * @sa tapi_register_event_id + * @section handling Event Handling + * @details TAPI will invoke the registered callback (\ref TapiEvtCb) and return the following data: + * @retval handle #TelHandle used for registering the event + * @retval evt_id TEL_NOTI_GPS_ASSIST_DATA + * @retval data reference to GPS data (as a string) + * @retval user_data user data passed while registering the event + */ +#define TEL_NOTI_GPS_ASSIST_DATA TELEPHONY_GPS_INTERFACE":AssistData" + +/** + * @hideinitializer + * @brief GPS position information + * @section subscription Event Subscription + * @details Event can be subscribed with event id TEL_NOTI_GPS_MEASURE_POSITION + * @sa tapi_register_event_id + * @section handling Event Handling + * @details TAPI will invoke the registered callback (\ref TapiEvtCb) and return the following data: + * @retval handle #TelHandle used for registering the event + * @retval evt_id TEL_NOTI_GPS_MEASURE_POSITION + * @retval data reference to GPS data (as a string) + * @retval user_data user data passed while registering the event + */ +#define TEL_NOTI_GPS_MEASURE_POSITION TELEPHONY_GPS_INTERFACE":MeasurePosition" + +/** + * @hideinitializer + * @brief GPS reset assist data + * @section subscription Event Subscription + * @details Event can be subscribed with event id TEL_NOTI_GPS_RESET_ASSIST_DATA + * @sa tapi_register_event_id + * @section handling Event Handling + * @details TAPI will invoke the registered callback (\ref TapiEvtCb) and return the following data: + * @retval handle #TelHandle used for registering the event + * @retval evt_id TEL_NOTI_GPS_RESET_ASSIST_DATA + * @retval data None + * @retval user_data user data passed while registering the event + */ +#define TEL_NOTI_GPS_RESET_ASSIST_DATA TELEPHONY_GPS_INTERFACE":ResetAssistData" + +/** @}*/ +/** @}*/ + +#ifdef __cplusplus +} +#endif + +/** + * @} + */ +#endif /* __TEL_GPS_H__ */ diff --git a/include/type/gps.h b/include/common/tel_if.h similarity index 57% rename from include/type/gps.h rename to include/common/tel_if.h index f20e487..b159238 100644 --- a/include/type/gps.h +++ b/include/common/tel_if.h @@ -1,9 +1,8 @@ /* - * libtcore + * tel-headers * - * Copyright (c) 2012 Samsung Electronics Co., Ltd. All rights reserved. - * - * Contact: Ja-young Gu + * Copyright (c) 2013 Samsung Electronics Co. Ltd. All rights reserved. + * Copyright (c) 2013 Intel Corporation. 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. @@ -18,24 +17,17 @@ * limitations under the License. */ -#ifndef __TYPE_GPS_H__ -#define __TYPE_GPS_H__ - -__BEGIN_DECLS - -struct treq_gps_set_frequency_aiding { - unsigned char enable; -}; +#ifndef __TEL_IF_H__ +#define __TEL_IF_H__ -struct tresp_gps_set_frequency_aiding { - TReturn result; -}; +/** Telephony service name */ +#define TELEPHONY_SERVICE "org.tizen.telephony" -struct tnoti_gps_frequency_aiding { - unsigned char lock_status; - unsigned char afc_update; -}; - -__END_DECLS +/** Telephony object path */ +#define TELEPHONY_OBJECT_PATH "/org/tizen/telephony" +#ifdef __cplusplus +} #endif + +#endif /* __TEL_IF_H__ */ diff --git a/include/common/tel_modem.h b/include/common/tel_modem.h new file mode 100644 index 0000000..de62261 --- /dev/null +++ b/include/common/tel_modem.h @@ -0,0 +1,136 @@ +/* + * tel-headers + * + * Copyright (c) 2013 Samsung Electronics Co. Ltd. All rights reserved. + * Copyright (c) 2013 Intel Corporation. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef __TEL_MODEM_H__ +#define __TEL_MODEM_H__ + +#include + +/** +* @addtogroup TAPI_MODEM +* @{ +* +* @file tel_modem.h +* @brief TAPI Modem Interface +*/ + +#ifdef __cplusplus +extern "C" { +#endif + +#define TELEPHONY_MODEM_INTERFACE TELEPHONY_SERVICE".Modem" + +#define TEL_MODEM_IMEI_LENGTH_MAX 15 /**< Maximum IMEI length */ + +#define TEL_MODEM_VERSION_LENGTH_MAX 32 /**< Maximum version information length */ + +/** + * @enum TelModemResult + * Response (Result) codes + */ +typedef enum { + TEL_MODEM_RESULT_SUCCESS, /**< Operation completed successfully */ + TEL_MODEM_RESULT_FAILURE, /**< Operation Failed */ + TEL_MODEM_RESULT_INVALID_PARAMETER, /**< Invalid input parameters */ + TEL_MODEM_RESULT_MEMORY_FAILURE, /**< Memory allocation failed */ + TEL_MODEM_RESULT_OPERATION_NOT_SUPPORTED,/**< Operation not supported */ + TEL_MODEM_RESULT_OPERATION_NOT_PERMITTED, /**< Operation not permitted */ + TEL_MODEM_RESULT_UNKNOWN_FAILURE /**< Unknown failure */ +} TelModemResult; + +/** + * @enum TelModemPowerStatus + * Power Status + */ +typedef enum { + TEL_MODEM_POWER_OFF, /**< Modem power off */ + TEL_MODEM_POWER_ON, /**< Modem power on */ + TEL_MODEM_POWER_ERROR /**< Modem power error */ +} TelModemPowerStatus; + +/** + * @enum TelModemFlightModeStatus + * Flight Mode Status + */ +typedef enum { + TEL_MODEM_FLIGHT_MODE_UNKNOWN, /**< Status is unknown at the moment */ + TEL_MODEM_FLIGHT_MODE_OFF, /**< Flight mode is OFF. Device is Online */ + TEL_MODEM_FLIGHT_MODE_ON /**< Flight mode is ON. Device is in Low Power */ +} TelModemFlightModeStatus; + +/** + * Version Information + */ +typedef struct { + char software_version[TEL_MODEM_VERSION_LENGTH_MAX + 1]; /**< Software Version */ + char hardware_version[TEL_MODEM_VERSION_LENGTH_MAX + 1]; /**< Hardware Version */ + char calibration_date[TEL_MODEM_VERSION_LENGTH_MAX + 1]; /**< Calibration Date */ + char product_code[TEL_MODEM_VERSION_LENGTH_MAX + 1]; /**< Product Code */ +} TelModemVersion; + +/** + * \defgroup TAPI_EVENT TAPI Event IDs + * @{ + */ + +/** + * \defgroup TAPI_EVENT_MODEM Modem Event IDs + * @{ + */ + +/** + * @hideinitializer + * @brief Power Status + * @section subscription Event Subscription + * @details Event can be subscribed with event id TEL_NOTI_MODEM_POWER_STATUS + * @sa tapi_register_event_id + * @section handling Event Handling + * @details TAPI will invoke the registered callback (\ref TapiEvtCb) and return the following data: + * @retval handle #TelHandle used for registering the event + * @retval evt_id TEL_NOTI_MODEM_POWER_STATUS + * @retval data \ref TelModemPowerStatus + * @retval user_data user data passed while registering the event + */ +#define TEL_NOTI_MODEM_POWER_STATUS TELEPHONY_MODEM_INTERFACE":power_status" + +/** + * @hideinitializer + * @brief Flight Mode Status + * @section subscription Event Subscription + * @details Event can be subscribed with event id TEL_NOTI_MODEM_FLIGHT_MODE_STATUS + * @sa tapi_register_event_id + * @section handling Event Handling + * @details TAPI will invoke the registered callback (\ref TapiEvtCb) and return the following data: + * @retval handle #TelHandle used for registering the event + * @retval evt_id TEL_NOTI_MODEM_FLIGHT_MODE_STATUS + * @retval data TRUE: Flight mode is ON\n FALSE: Flight mode is OFF + * @retval user_data user data passed while registering the event + */ +#define TEL_NOTI_MODEM_FLIGHT_MODE_STATUS TELEPHONY_MODEM_INTERFACE":flight_mode_status" + +/** @}*/ +/** @}*/ + +#ifdef __cplusplus +} +#endif + +/** @}*/ + +#endif /* __TEL_MODEM_H__ */ diff --git a/include/common/tel_network.h b/include/common/tel_network.h new file mode 100644 index 0000000..e3120a9 --- /dev/null +++ b/include/common/tel_network.h @@ -0,0 +1,355 @@ +/* + * tel-headers + * + * Copyright (c) 2013 Samsung Electronics Co. Ltd. All rights reserved. + * Copyright (c) 2013 Intel Corporation. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef __TEL_NETWORK_H__ +#define __TEL_NETWORK_H__ + +#include + +/** +* @addtogroup TAPI_NETWORK +* @{ +* +* @file tel_network.h +* @brief TAPI Network Interface +*/ + +#ifdef __cplusplus +extern "C" { +#endif + +#define TELEPHONY_NETWORK_INTERFACE TELEPHONY_SERVICE".Network" + +#define TEL_NETWORK_PLMN_LEN_MAX 6 /**< Maximum PLMN(MCCMNC) length */ + +/** + * @enum TelNetworkResult + * Response (Return) values. + */ +typedef enum { + TEL_NETWORK_RESULT_SUCCESS, /**< Operation completed successfully */ + TEL_NETWORK_RESULT_FAILURE, /**< Operation Failed */ + TEL_NETWORK_RESULT_INVALID_PARAMETER, /**< Invalid input parameters */ + TEL_NETWORK_RESULT_MEMORY_FAILURE, /**< Memory allocation failed */ + TEL_NETWORK_RESULT_OPERATION_NOT_PERMITTED, /**< Operation not permitted */ + TEL_NETWORK_RESULT_OPERATION_NOT_SUPPORTED /**< Operation not supported */ +} TelNetworkResult; + +/** + * @enum TelNetworkMode + * Network Mode + */ +typedef enum { + TEL_NETWORK_MODE_AUTO, /**< auto select network mode or hybrid */ + TEL_NETWORK_MODE_2G, /**< 2G: GSM, GPRS, EDGE etc */ + TEL_NETWORK_MODE_3G, /**< 3G: UMTS, HSDPA, HSUPA etc */ + TEL_NETWORK_MODE_LTE, /**< LTE */ +} TelNetworkMode; + +/** + * @enum TelNetworkSelectionMode + * Network Selection Mode + */ +typedef enum { + TEL_NETWORK_SELECTION_MODE_AUTOMATIC, /**< Automatic selection mode*/ + TEL_NETWORK_SELECTION_MODE_MANUAL, /**< Manual selection mode */ +} TelNetworkSelectionMode; + +/** + * @enum TelNetworkAct + * Network Access Technology + */ +typedef enum { + TEL_NETWORK_ACT_UNKNOWN, /**< ACT is not presented */ + TEL_NETWORK_ACT_GSM, /**< GSM */ + TEL_NETWORK_ACT_GPRS, /**< GPRS */ + TEL_NETWORK_ACT_EGPRS, /**< EDGE */ + TEL_NETWORK_ACT_UMTS, /**< 3G */ + TEL_NETWORK_ACT_GSM_AND_UMTS, /**< Both GSM and UMTS available */ + TEL_NETWORK_ACT_HSDPA, /**< HSDPA */ + TEL_NETWORK_ACT_HSUPA, /**< HSUPA */ + TEL_NETWORK_ACT_HSPA, /**< HSDPA & HSUPA */ + TEL_NETWORK_ACT_LTE, /**< LTE */ +} TelNetworkAct; + +/** + * @enum TelNetworkRegStatus + * Network Registration Status + */ +typedef enum { + TEL_NETWORK_REG_STATUS_UNREGISTERED, /**< Not registered, not searching */ + TEL_NETWORK_REG_STATUS_REGISTERED, /**< Registered, home network */ + TEL_NETWORK_REG_STATUS_SEARCHING, /**< Not regsitered, searching */ + TEL_NETWORK_REG_STATUS_DENIED, /**< Registration is denied */ + TEL_NETWORK_REG_STATUS_UNKNOWN, /**< Unknown */ + TEL_NETWORK_REG_STATUS_ROAMING, /**< Registered, roaming */ +} TelNetworkRegStatus; + +/** + * @enum TelNetworkPlmnStatus + * Network Plmn Status + */ +typedef enum +{ + TEL_NETWORK_STATUS_UNKNOWN, /**< Unknown Plmn */ + TEL_NETWORK_STATUS_AVAILABLE, /**< Available Plmn */ + TEL_NETWORK_STATUS_CURRENT, /**< Network currently registered */ + TEL_NETWORK_STATUS_FORBIDDEN, /**< Forbidden Plmn */ +} TelNetworkPlmnStatus; + +/** + * Network Registration Status Information + */ +typedef struct { + TelNetworkRegStatus cs_status; /**< CS domain registration status */ + TelNetworkRegStatus ps_status; /**< PS domain registration status */ + TelNetworkAct act; /**< Access technology */ +} TelNetworkRegStatusInfo; + +/** + * Network Cell Information + */ +typedef struct { + unsigned int lac; /**< Location Area Code */ + unsigned int cell_id; /**< Cell id */ + unsigned int rac; /**< Routing Area Code - PS network specific */ +} TelNetworkCellInfo; + +/** + * Network Registration Information + */ +typedef struct { + TelNetworkRegStatusInfo reg_status_info; /**< Registration Status Information */ + TelNetworkCellInfo cell_info; /**< Cell Information */ +} TelNetworkRegistrationInfo; + +/** + * Network Identity Information + */ +typedef struct { + char *plmn; /**< numeric name (MCCMNC) */ + char *short_name; /**< short alphanumeric operator name */ + char *long_name; /**< long alphanumeric operator name */ +} TelNetworkIdentityInfo; + +/** + * Network Selection Manual Information + */ +typedef struct { + char *plmn; /**< numeric name (MCCMNC) */ + TelNetworkAct act; /**< Access technology */ +} TelNetworkSelectManualInfo; + +/** + * Network Information + */ +typedef struct { + TelNetworkPlmnStatus plmn_status; /**< Plmn Status */ + TelNetworkAct act; /**< Access technology */ + TelNetworkIdentityInfo network_identity; /**< Network Identity Information */ +} TelNetworkInfo; + +/** + * Network Plmn List + */ +typedef struct { + unsigned int count; /**< Network Plmn count */ + TelNetworkInfo *network_list; /**< Network list */ +} TelNetworkPlmnList; + +/** + * Network Preferred Plmn Information + */ +typedef struct { + unsigned int index; /**< Preferred Plmn list index, start from 1 */ + char *plmn; /**< numeric operator name (MCCMNC) */ + TelNetworkAct act; /**< Access technology */ +} TelNetworkPreferredPlmnInfo; + +/** + * Network Preferred Plmn List + */ +typedef struct { + unsigned int count; /**< Number of preferred plmns in the list */ + TelNetworkPreferredPlmnInfo *list; /**< Preferred Plmns List */ +} TelNetworkPreferredPlmnList; + +/** + * Network Gsm Neighbour Cell Information + */ +typedef struct { + int cell_id; /**< Cell ID (-1 indicates cell ID not present)*/ + int lac; /**< Location area code (ignored when cell_id not present) */ + int bcch; /**< Broadcast Control Channel Frequency number */ + int bsic; /**< Base Station Identification Code */ + int rxlev; /**< Received Signal Strength level. Valid values: (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 not detectable + */ +} TelNetworkGsmNeighbourCellInfo; + +/** + * Network Umts Neighbour Cell Information + */ +typedef struct { + int cell_id; /**< Cell ID (-1 indicates cell ID not present)*/ + int lac; /**< Location area code (ignored if cell_id not present)*/ + int arfcn; /**< UTRA Absolute RF Channel Number */ + int psc; /**< Primary scrambling Code */ + int rscp; /**< Received Signal Code Power. Valid values: (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 not detectable + */ +} TelNetworkUmtsNeighbourCellInfo; + +/** + * Network Neighbour Cell Information + */ +typedef struct { + unsigned int gsm_list_count; /**< GSM cells count */ + TelNetworkGsmNeighbourCellInfo *gsm_list; /**< GSM cells information */ + unsigned int umts_list_count; /**< UMTS cells count */ + TelNetworkUmtsNeighbourCellInfo *umts_list; /**< UMTS cells information */ +} TelNetworkNeighbourCellInfo; + +/** + * Network Nitz Information + */ +typedef struct { + unsigned int year; /**< Last two digits of year */ + unsigned int month; /**< Month */ + unsigned int day; /**< Day */ + unsigned int hour; /**< Hour */ + unsigned int minute; /**< Minute */ + unsigned int second; /**< Second */ + int gmtoff; /**< GMT Offset */ + gboolean isdst; /**< Daylight Saving Time Valid */ + int dstoff; /**< Daylight Saving Time Offset */ + char *plmn; /**< numeric name (MCCMNC) */ +} TelNetworkNitzInfoNoti; + +/** + * \defgroup TAPI_EVENT TAPI Event IDs + * @{ + */ + +/** + * \defgroup TAPI_EVENT_NETWORK Network Event IDs + * @{ + */ + +/** + * @hideinitializer + * @brief Network registration status + * @section subscription Event Subscription + * @details Event can be subscribed with event id TEL_NOTI_NETWORK_REGISTRATION_STATUS + * @sa tapi_register_event_id + * @section handling Event Handling + * @details TAPI will invoke the registered callback (\ref TapiEvtCb) and return the following data: + * @retval handle #TelHandle used for registering the event + * @retval evt_id TEL_NOTI_NETWORK_REGISTRATION_STATUS + * @retval data reference to \ref TelNetworkRegStatusInfo structure + * @retval user_data user data passed while registering the event + */ +#define TEL_NOTI_NETWORK_REGISTRATION_STATUS TELEPHONY_NETWORK_INTERFACE":RegistrationStatus" + +/** + * @hideinitializer + * @brief Network cell information + * @section subscription Event Subscription + * @details Event can be subscribed with event id TEL_NOTI_NETWORK_CELL_INFO + * @sa tapi_register_event_id + * @section handling Event Handling + * @details TAPI will invoke the registered callback (\ref TapiEvtCb) and return the following data: + * @retval handle #TelHandle used for registering the event + * @retval evt_id TEL_NOTI_NETWORK_CELL_INFO + * @retval data reference to \ref TelNetworkCellInfo structure + * @retval user_data user data passed while registering the event + */ +#define TEL_NOTI_NETWORK_CELL_INFO TELEPHONY_NETWORK_INTERFACE":CellInfo" + +/** + * @hideinitializer + * @brief Network Identity information + * @section subscription Event Subscription + * @details Event can be subscribed with event id TEL_NOTI_NETWORK_IDENTITY + * @sa tapi_register_event_id + * @section handling Event Handling + * @details TAPI will invoke the registered callback (\ref TapiEvtCb) and return the following data: + * @retval handle #TelHandle used for registering the event + * @retval evt_id TEL_NOTI_NETWORK_IDENTITY + * @retval data reference to \ref TelNetworkIdentityInfo structure + * @retval user_data user data passed while registering the event + */ +#define TEL_NOTI_NETWORK_IDENTITY TELEPHONY_NETWORK_INTERFACE":Identity" + +/** + * @hideinitializer + * @brief Network RSSI + * @section subscription Event Subscription + * @details Event can be subscribed with event id TEL_NOTI_NETWORK_RSSI + * @sa tapi_register_event_id + * @section handling Event Handling + * @details TAPI will invoke the registered callback (\ref TapiEvtCb) and return the following data: + * @retval handle #TelHandle used for registering the event + * @retval evt_id TEL_NOTI_NETWORK_RSSI + * @retval data \ref unsigned int rssi + * @retval user_data user data passed while registering the event + */ +#define TEL_NOTI_NETWORK_RSSI TELEPHONY_NETWORK_INTERFACE":Rssi" + +/** + * @hideinitializer + * @brief Network time information + * @section subscription Event Subscription + * @details Event can be subscribed with event id TEL_NOTI_NETWORK_TIME_INFO + * @sa tapi_register_event_id + * @section handling Event Handling + * @details TAPI will invoke the registered callback (\ref TapiEvtCb) and return the following data: + * @retval handle #TelHandle used for registering the event + * @retval evt_id TEL_NOTI_NETWORK_TIME_INFO + * @retval data reference to \ref TelNetworkNitzInfoNoti structure + * @retval user_data user data passed while registering the event + */ +#define TEL_NOTI_NETWORK_TIME_INFO TELEPHONY_NETWORK_INTERFACE":TimeInfo" + +/** @}*/ +/** @}*/ + +#ifdef __cplusplus +} +#endif + +/** @}*/ + +#endif /* __TEL_NETWORK_H__ */ + diff --git a/include/common/tel_phonebook.h b/include/common/tel_phonebook.h new file mode 100644 index 0000000..fc39db7 --- /dev/null +++ b/include/common/tel_phonebook.h @@ -0,0 +1,253 @@ +/* + * tel-headers + * + * Copyright (c) 2013 Samsung Electronics Co. Ltd. All rights reserved. + * Copyright (c) 2013 Intel Corporation. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef __TEL_PHONEBOOK_H__ +#define __TEL_PHONEBOOK_H__ + +#include + +/** +* @addtogroup TAPI_PHONEBOOK +* @{ +* +* @file tel_phonebook.h +* @brief TAPI Phonebook Interface +*/ + +#ifdef __cplusplus +extern "C" +{ +#endif + +#define TELEPHONY_PB_INTERFACE TELEPHONY_SERVICE".Phonebook" + +#define TEL_PB_TEXT_MAX_LEN 255 /**< Phone book text maximum length */ +#define TEL_PB_NUMBER_MAX_LEN 82 /**< Phone book number maximum length */ +#define TEL_PB_ANR_MAX_COUNT 3 /**< Phone book ANR maximum count */ +#define TEL_PB_EMAIL_MAX_COUNT 4 /**< Phone book email maximum count */ + +/** + * @enum TelPbResult + * Response (Return) values. + */ +typedef enum { + TEL_PB_RESULT_SUCCESS, /**< Operation completed successfully */ + TEL_PB_RESULT_FAILURE, /**< Operation Failed */ + TEL_PB_RESULT_INVALID_PARAMETER, /**< Invalid input parameters */ + TEL_PB_RESULT_MEMORY_FAILURE, /**< Memory allocation failed */ + TEL_PB_RESULT_OPERATION_NOT_SUPPORTED, /**< Operation not supported */ + TEL_PB_RESULT_UNKNOWN_FAILURE, /**< Unknown failure */ + TEL_PB_RESULT_INVALID_INDEX, /**< The index passed was not a valid index. */ + TEL_PB_RESULT_NOT_INITIALIZED, /**< Phonebook not initialized */ + TEL_PB_RESULT_PIN2_REQUIRED, /**< PIN2 Required */ + TEL_PB_RESULT_PUK2_REQUIRED, /**< PUK2 Required */ + TEL_PB_RESULT_ACCESS_RESTRICTED, /**< Access restricted */ + TEL_PB_RESULT_OPERATION_NOT_PERMITTED /**< Operation not permitted */ +} TelPbResult; + +/** + * @enum TelPbType + * This enumeration defines the Phonebook type. + */ +typedef enum { + TEL_PB_FDN, /**< Fixed Dialing Number */ + TEL_PB_ADN, /**< Abbreviated dialling numbers */ + TEL_PB_SDN, /**< Service Dialing Number */ + TEL_PB_USIM, /**< USIM - 3G phone book */ +} TelPbType; + +/** + * This data structure gives the phone book availability of current SIM + */ +typedef struct { + gboolean fdn; /**< Availability of Fixed Dialing Number */ + gboolean adn; /**< Availability of Abbreviated dialling numbers */ + gboolean sdn; /**< Availability of Service Dialing Number */ + gboolean usim; /**< Availability of USIM - 3G phone book */ +} TelPbList; + +/** + * @enum TelPbInitInfo + * This data structure gives the phonebook init information + */ +typedef struct { + gboolean init_status; /**< Phonebook init status */ + TelPbList pb_list; /**< Phonebook availability of current SIM */ +} TelPbInitInfo; + +/** + *This data structure gives the phone book entry information(SIM). + */ +typedef struct { + unsigned int max_count; /**< Total number of locations in selected memory */ + unsigned int used_count; /**< Number of used locations in selected memory */ + unsigned int max_num_len; /**< maximum length of field "number" */ + unsigned int max_text_len; /**< maximum length of field "text" */ +} TelPbSimInfo; + +/** + *This data structure gives the phone book entry information(USIM). + */ +typedef struct { + unsigned int max_count; /**< Total number of locations in selected memory */ + unsigned int used_count; /**< Number of used locations in selected memory */ + unsigned int max_num_len; /**< maximum length of field "number" */ + unsigned int max_text_len; /**< maximum length of field "text" */ + + unsigned char max_anr_count; /**< Total number of locations for Additional Number */ + unsigned int max_anr_len; /**< Maximun length for Additional Number */ + + unsigned char max_email_count; /**< Total number of locations for email */ + unsigned int max_email_len; /**< Maximun length for email */ + + unsigned int max_sne_len; /**< Maximun length for second name*/ + + unsigned int max_gas_count; /**< Total number of locations for Grouping Alpha String */ + unsigned int max_gas_len; /**< Maximun length for Grouping Alpha String */ + + unsigned int max_aas_count; /**< Total number of locations for Additional Alpha String */ + unsigned int max_aas_len; /**< Maximun length for Additional Alpha String */ +} TelPbUsimInfo; + +/** + *This data structure gives SIM/USIM the phone book entry information. + */ +typedef struct { + TelPbType pb_type; /**< Type of Phone book */ + union { + TelPbSimInfo sim; /**< 2G sim phone book info */ + TelPbUsimInfo usim; /**< 3G sim phone book info */ + } info_u; /**< union */ +} TelPbInfo; + +/** + *These data structures defines the phone book record fields. + */ +typedef char TelPbName[TEL_PB_TEXT_MAX_LEN + 1]; /**< Record of Phone book name */ + +typedef char TelPbNumber[TEL_PB_NUMBER_MAX_LEN + 1]; /**< Record of Phone book number */ + +typedef char TelPbEmail[TEL_PB_TEXT_MAX_LEN + 1]; /**< Record of Phone book email */ + +/** + *These data structures defines the phone book Additional number information + */ +typedef struct { + TelPbNumber number; /**< Additional number */ + gboolean description; /**< TRUE if the ANR has an additional number description */ + TelPbName aas; /**< Additional number description */ +} TelPbAnr; + +/** + *These data structures defines the USIM phone book records + */ +typedef struct { + TelPbName name; /**< USIM Phone book name */ + TelPbNumber number; /**< USIM Phone book number */ + + TelPbName sne; /**< USIM Phone book second name */ + TelPbName grp_name; /**< USIM Phone book group name */ + + unsigned char anr_count; /**< USIM Phone book Additional number count */ + TelPbAnr anr[TEL_PB_ANR_MAX_COUNT]; /**< USIM Phone book Additional number description */ + + unsigned char email_count; /**< USIM Phone book email count */ + TelPbEmail email[TEL_PB_EMAIL_MAX_COUNT]; /**< USIM Phone book email description */ + + gboolean hidden; /**< indicates if the entry is hidden or not - only available, if a UICC with an active USIM application is present */ +} TelPbUsimRecord; + +/** + *These data structures defines the SIM phone book records + */ +typedef struct { + TelPbName name; /**< SIM Phone book name */ + TelPbNumber number; /**< SIM Phone book number */ +} TelPbSimRecord; + +/** + *These data structures defines the read record informations + */ +typedef struct { + unsigned int index; /**< Index of phonebook memory */ + unsigned int next_index; /**< Next index of phonebook memory */ + + TelPbType pb_type; /**< Type of Phone book */ + union { + TelPbSimRecord sim; /**< 2G sim phone book info */ + TelPbUsimRecord usim; /**< 3G sim phone book info */ + } rec_u; /**< union */ +} TelPbReadRecord; + +/** + *These data structures defines the update record informations + */ +typedef struct { + unsigned int index; /**< Index of phonebook memory */ + + TelPbType pb_type; /**< Type of Phone book */ + union { + TelPbSimRecord sim; /**< 2G sim phone book info */ + TelPbUsimRecord usim; /**< 3G sim phone book info */ + } rec_u; /**< union */ +} TelPbUpdateRecord; + +/** + *These data structures defines the phone book record informations + */ +typedef struct { + TelPbType pb_type; /**< Type of Phone book */ + unsigned int index; /**< Index of phonebook memory */ +} TelPbRecordInfo; + +/** + * \defgroup TAPI_EVENT TAPI Event IDs + * @{ + */ + +/** + * \defgroup TEL_EVENT_PHONEBOOK Phonebook Event IDs + * @{ + */ + +/** + * @hideinitializer + * @brief Phonebook init status + * @section subscription Event Subscription + * @details Event can be subscribed with event id TEL_NOTI_PB_STATUS + * @sa tapi_register_event_id + * @section handling Event Handling + * @details TAPI will invoke the registered callback (\ref TapiEvtCb) and return the following data: + * @retval handle #TelHandle used for registering the event + * @retval evt_id TEL_NOTI_PB_STATUS + * #retval data \ref TelPbInitInfo + * @retval user_data user data passed while registering the event + */ +#define TEL_NOTI_PB_STATUS TELEPHONY_PB_INTERFACE":Status" + +/** @}*/ +/** @}*/ + +#ifdef __cplusplus +} +#endif + +/** @}*/ + +#endif /* __TEL_PHONEBOOK_H__ */ diff --git a/include/common/tel_return.h b/include/common/tel_return.h new file mode 100644 index 0000000..2dc87a6 --- /dev/null +++ b/include/common/tel_return.h @@ -0,0 +1,54 @@ +/* + * tel-headers + * + * Copyright (c) 2013 Samsung Electronics Co. Ltd. All rights reserved. + * Copyright (c) 2013 Intel Corporation. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef __TEL_RETURN_H__ +#define __TEL_RETURN_H__ + +/** +* @addtogroup TAPI_COMMON +* @{ +* +* @file tel_return.h +* @brief TAPI return values +*/ + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @enum TelReturn + * TAPI return values + */ +typedef enum { + TEL_RETURN_SUCCESS, /**< Operation completed successfully */ + TEL_RETURN_FAILURE, /**< Operation Failed */ + TEL_RETURN_INVALID_PARAMETER, /**< Invalid input parameters */ + TEL_RETURN_MEMORY_FAILURE, /**< Memory allocation failed */ + TEL_RETURN_OPERATION_NOT_SUPPORTED, /**< Operation not supported */ + TEL_RETURN_UNKNOWN_FAILURE /**< Unknown failure */ +} TelReturn; + +#ifdef __cplusplus +} +#endif + +/** @}*/ + +#endif /* __TEL_RETURN_H__ */ diff --git a/include/common/tel_sap.h b/include/common/tel_sap.h new file mode 100644 index 0000000..d22d363 --- /dev/null +++ b/include/common/tel_sap.h @@ -0,0 +1,179 @@ +/* + * tel-headers + * + * Copyright (c) 2013 Samsung Electronics Co. Ltd. All rights reserved. + * Copyright (c) 2013 Intel Corporation. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +#ifndef __TEL_SAP_H__ +#define __TEL_SAP_H__ + +#include + +/** +* @addtogroup TAPI_SAP +* @{ +* +* @file tel_sap.h +* @brief TAPI SAP Interface +*/ + +#ifdef __cplusplus +extern "C" { +#endif + +#define TELEPHONY_SAP_INTERFACE TELEPHONY_SERVICE".Sap" + +#define TEL_SAP_APDU_LEN_MAX 261 /**< APDU max command length */ +#define TEL_SAP_APDU_RESP_LEN_MAX 258 /**< APDU max response length */ +#define TEL_SAP_ATR_LEN_MAX 33 /**< Answer to Reset data max length */ + +/** + * @enum TelSapResult + * This enum gives the SAP result information. + */ + +typedef enum { + TEL_SAP_RESULT_SUCCESS, /**< operation successfully completed*/ + TEL_SAP_RESULT_FAILURE_NO_REASON, /**< no reason*/ + TEL_SAP_RESULT_CARD_NOT_ACCESSIBLE, /**< not accessible*/ + TEL_SAP_RESULT_CARD_ALREADY_POWERED_OFF,/**< card already powered off*/ + TEL_SAP_RESULT_CARD_REMOVED, /**< card removed*/ + TEL_SAP_RESULT_CARD_ALREADY_POWERED_ON, /**< card already powered on*/ + TEL_SAP_RESULT_DATA_NOT_AVAILABLE, /**< data not available*/ + TEL_SAP_RESULT_NOT_SUPPORTED, /**< not supported*/ + TEL_SAP_RESULT_UNABLE_TO_ESTABLISH, /**< unable to establish connection*/ + TEL_SAP_RESULT_NOT_SUPPORT_MAX_SIZE, /**< server does not support message length that client want send*/ + TEL_SAP_RESULT_TOO_SMALL_MAX_SIZE, /**< client wants to connect with very small message length which is not supported by Server */ + TEL_SAP_RESULT_ONGOING_CALL, /**< server cannot reset the SIM due to an ongoing call */ + TEL_SAP_RESULT_OPERATION_NOT_PERMITTED /** Operation not permitted */ +} TelSapResult; + +/** + * @enum TelSapPowerMode + * This enum gives the SAP message Ids between SAP client and SAP server. + */ +typedef enum { + TEL_SAP_SIM_POWER_ON_REQ, /**< SAP Client request for Power ON SIM off in Server */ + TEL_SAP_SIM_POWER_OFF_REQ, /**< SAP Client request for Power OFF SIM off in Server */ + TEL_SAP_SIM_RESET_REQ, /**< SAP Client request for reset SIM in Server */ +} TelSapPowerMode; + +/** + * @enum TelSapDisconnectType + * This enum gives the SAP disconnect type information. + */ +typedef enum { + TEL_SAP_DISCONNECT_TYPE_GRACEFUL, /**< disconnection procedure ends after finishing current work */ + TEL_SAP_DISCONNECT_TYPE_IMMEDIATE /**< disconnection procedure ends immediately */ +} TelSapDisconnectType; + +/** + * @enum TelSapCardStatus + * This enum gives the SIM card status if server`s status changed about connection with subscription module + */ +typedef enum { + TEL_SAP_CARD_STATUS_UNKNOWN, /**< SAP server status - unknown*/ + TEL_SAP_CARD_STATUS_RESET, /**< SAP server status - reset*/ + TEL_SAP_CARD_STATUS_NOT_ACCESSIBLE, /**< SAP server status - not accessible*/ + TEL_SAP_CARD_STATUS_REMOVED, /**< SAP server status - removed*/ + TEL_SAP_CARD_STATUS_INSERTED, /**< SAP server status - inserted*/ + TEL_SAP_CARD_STATUS_RECOVERED /**< SAP server status - recovered*/ +} TelSapCardStatus; + +/** + * @enum TelSimSapProtocol + * This enum gives SAP transport protocol type + */ +typedef enum { + TEL_SIM_SAP_PROTOCOL_T0, /**< T = 0, character*/ + TEL_SIM_SAP_PROTOCOL_T1 /**< T = 1, block*/ +} TelSimSapProtocol; + +/** + * This data structure gives the SAP ATR response data information. + */ +typedef struct { + unsigned int atr_len; /**< SAP ATR response data length */ + unsigned char atr[TEL_SAP_ATR_LEN_MAX]; /**< SAP ATR response data */ +} TelSapAtr; + +/** + * This data structure is used to transfer the SAP APDU command. + */ +typedef struct { + unsigned int apdu_len; /**< SAP APDU length */ + unsigned char apdu[TEL_SAP_APDU_LEN_MAX]; /**< SAP APDU data */ +} TelSapApdu; + +/** + * This data structure gives the SAP APDU response. + */ +typedef struct { + unsigned int apdu_resp_len; /**< SAP APDU response data length */ + unsigned char apdu_resp[TEL_SAP_APDU_RESP_LEN_MAX]; /**< SAP APDU response data */ +} TelSapApduResp; + +/** + * \defgroup TAPI_EVENT TAPI Event IDs + * @{ + */ + +/** + * \defgroup TEL_EVENT_SAP SAP Event IDs + * @{ + */ + +/** + * @hideinitializer + * @brief SAP status + * @section subscription Event Subscription + * @details Event can be subscribed with event id TEL_NOTI_SAP_STATUS + * @sa tapi_register_event_id + * @section handling Event Handling + * @details TAPI will invoke the registered callback (\ref TapiEvtCb) and return the following data: + * @retval handle #TelHandle used for registering the event + * @retval evt_id TEL_NOTI_SAP_STATUS + * @retval data \ref TelSapCardStatus + * @retval user_data user data passed while registering the event + */ +#define TEL_NOTI_SAP_STATUS TELEPHONY_SAP_INTERFACE":Status" + +/** + * @hideinitializer + * @brief SAP disconnect type + * @section subscription Event Subscription + * @details Event can be subscribed with event id TEL_NOTI_SAP_DISCONNECT + * @sa tapi_register_event_id + * @section handling Event Handling + * @details TAPI will invoke the registered callback (\ref TapiEvtCb) and return the following data: + * @retval handle #TelHandle used for registering the event + * @retval evt_id TEL_NOTI_SAP_DISCONNECT + * @retval data \ref TelSapDisconnectType + * @retval user_data user data passed while registering the event + */ +#define TEL_NOTI_SAP_DISCONNECT TELEPHONY_SAP_INTERFACE":Disconnect" + +/** @}*/ +/** @}*/ + +#ifdef __cplusplus +} +#endif + +/** @}*/ + +#endif /* __TEL_SAP_H__ */ diff --git a/include/common/tel_sat.h b/include/common/tel_sat.h new file mode 100644 index 0000000..58e819c --- /dev/null +++ b/include/common/tel_sat.h @@ -0,0 +1,1813 @@ +/* + * tel-headers + * + * Copyright (c) 2013 Samsung Electronics Co. Ltd. All rights reserved. + * Copyright (c) 2013 Intel Corporation. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef __TEL_SAT_H__ +#define __TEL_SAT_H__ + +#include +#include +#include +#include + +/** +* @addtogroup TAPI_SAT +* @{ +* +* @file tel_sat.h +* @brief TAPI sat Interface +*/ + +#ifdef __cplusplus +extern "C" { +#endif + +#define TELEPHONY_SAT_INTERFACE TELEPHONY_SERVICE".Sat" + +#define TEL_SAT_DEF_TEXT_STRING_LEN_MAX 500 /**< max length for Text String */ +#define TEL_SAT_DEF_TITLE_LEN_MAX 50 /**< max length for Menu Title */ +#define TEL_SAT_DEF_ITEM_STR_LEN_MAX 50 /**< max length for default item string */ +#define TEL_SAT_TEXT_STRING_LEN_MAX 500 /**< max length for text string */ +#define TEL_SAT_DEF_BIT_MASK_CONTACT 0x01 /**< Bit Mask for Contact */ +#define TEL_SAT_DEF_BIT_MASK_MSG 0x02 /**< Bit Mask for Msg */ +#define TEL_SAT_DEF_BIT_MASK_OTHER 0x04 /**< Bit Mask for Psh */ +#define TEL_SAT_REFRESH_FILE_LIST 20 /**< Refresh File List */ +#define TEL_SAT_DEF_SS_LEN_MAX 250 /**< max length for SS */ +#define TEL_SAT_DEF_USSD_LEN_MAX 250 /**< max length for USSD */ +#define TEL_SAT_DIALING_NUMBER_LEN_MAX 200 /**< max length for dailing number */ +#define TEL_SAT_ALPHA_ID_LEN_MAX 255 /**< max length of alpha identifier */ +#define TEL_SAT_SUB_ADDR_LEN_MAX 30 /**< max length for Sub address */ +#define TEL_SAT_CCP_DATA_LEN_MAX 30 /**< max length of ccp data */ +#define TEL_SAT_SS_STRING_LEN_MAX 160 /**< max length for SS string */ +#define TEL_SAT_USSD_STRING_LEN_MAX 255 /**< max length for USSD string */ +#define TEL_SAT_ITEM_TEXT_LEN_MAX 45 /**< max length of item text */ +#define TEL_SAT_SMS_TPDU_SMS_DATA_LEN_MAX 175 /**< max length for SMS TPDU SMS data */ +#define TEL_SAT_FILE_ID_LIST_MAX_COUNT 255 /**< max length for file id list */ +#define TEL_SAT_ITEMS_NEXT_ACTION_INDI_LIST_MAX_COUNT 50 /**< max count of items next action indication list */ +#define TEL_SAT_EVENT_LIST_MAX 17 /**< max count of event list */ +#define TEL_SAT_IMG_DATA_FILE_PATH_LEN_MAX 50 /**< max length of image data file name (Icon, CLUT) */ +#define TEL_SAT_ICON_LIST_MAX_COUNT 50 /**< max count of icon list */ +#define TEL_SAT_DTMF_STRING_LEN_MAX 30 /**< max length of dtmf string */ +#define TEL_SAT_URL_LEN_MAX 129 /**< max length of URL*/ +#define TEL_SAT_PROVISIONING_FILE_PATH_LEN_MAX 50 /**< max length of provisioning file path */ +#define TEL_SAT_CHANNEL_DATA_STRING_LEN_MAX 255 /**< max length for channel data string */ +#define TEL_SAT_OTHER_ADDR_LEN_MAX 30 /**< max length of other address */ +#define TEL_SAT_NET_ACC_NAM_LEN_MAX 30 /**< max length of net acc name */ +#define TEL_SAT_REMOTE_ENTITY_ADDR_LEN_MAX 50 /**< max length of remote entity address */ +#define TEL_SAT_ITEM_TEXT_ATTRIBUTES_LIST_MAX_COUNT 50 /**< max count of item text attributes list */ +#define TEL_SAT_MENU_ITEM_COUNT_MAX 40 /**< max count for Menu items */ + +/** + * @enum TelSatResult + * Response (Result) codes +*/ +typedef enum { + TEL_SAT_RESULT_SUCCESS, /**< Operation completed successfully */ + TEL_SAT_RESULT_FAILURE, /**< Operation Failed */ + TEL_SAT_RESULT_INVALID_PARAMETER, /**< Invalid input parameters */ + TEL_SAT_RESULT_MEMORY_FAILURE, /**< Memory allocation failed */ + TEL_SAT_RESULT_OPERATION_NOT_SUPPORTED, /**< Operation not supported */ + TEL_SAT_RESULT_UNKNOWN_FAILURE, /**< Unknown failure */ + + TEL_SAT_RESULT_REQUIRED_VALUE_MISSING, /**< Required value missing */ + TEL_SAT_RESULT_COMMAND_NOT_UNDERSTOOD, /**< Command not understood by ME */ + TEL_SAT_RESULT_BEYOND_ME_CAPABILITY /**< Beyond ME capability */ +} TelSatResult; + +/** + * @enum TelSatUiUserConfirmType + * This enumeration defines UI user confirm types +*/ +typedef enum { + TEL_SAT_USER_CONFIRM_YES, /**